/dpt/ - Daily Programming Thread

What are you working on?
Previous not worh mentioning.

Attached: Bored-Girl-In-Yuyushiki-Anime-Playing-With-a-Computer-Screen.gif (346x360, 873K)

Other urls found in this thread:

blog.rust-lang.org/2018/05/10/Rust-1.26.html
gnu.org/software/gnu-c-manual/gnu-c-manual.html
en.wikipedia.org/wiki/C_standard_library
gnu.org/software/libc/manual/html_node/Function-Index.html
twitter.com/AnonBabble

Reserved. Stop wanking over lPLs they are tools.

How would I go about implementing my own threads and semaphores in C?

With instruction-set-dependent atomic assembly instructions

What? Not my fault.
When would I have to use inline assembly. Probably for context switches, anywhere else?

Attached: asdfasd.jpg (239x268, 26K)

for portable atomics you need either C11's or C++11's

The project I have is using the Borland C++ 3.1 compiler from 1992. It's literally C with classes

i'm trying to extract url, title pairs with lxml

i do something like
links = xpath('//a')
urls = doc.xpath('//a/@href')
text = doc.xpath('//a[@href]/text()')


but there is no correlation between urls and text.
one is basically scrambled in relation to the other.

quick give me reasons not to learn ocaml!

Haskell supercedes it.

hascuck was in debate but nobody gave shit what the faggot
because hascucks arguments had no side effect

blog.rust-lang.org/2018/05/10/Rust-1.26.html

Attached: 1516798716886.jpg (1920x1080, 310K)

>blog.rust-lang.org/2018/05/10/Rust-1.26.html
>Rust is a systems programming language focused on safety, speed, and concurrency.
>systems programming language
>concurrency

Why is it so dull?

Learning shit tier language on shit tier Visual Studio trying to figure out why this fucking
red line wont go the fuck away!!!!!

Attached: fuckc#.png (140x84, 1K)

why don't you show the rest of the code buddy?

my guess is something in your if statement isn't complete, i.e. the grammar is not parseble.

>fuckc#
>shit tier language
I don't understand how a PL causes one to be this butthurt. Do you find yourself forced to use to it after it has been proved better than you think it is?

c# btfo!

;

what this user said: also, check if that is not some white-space unicode character
it happened to me once or twice when I accidentally pressed AltGr + space

Forgive me, new to Jow Forums Don't know how to properly share code on this board.
Also this is my first 5 hours of coding. Started learning today so I'm sure everything on this is wrong.

Attached: Capture.png (1917x1014, 80K)

Attached: Screen Shot 2018-05-10 at 20.01.59.png (183x30, 4K)

learning about type_traits, by doing my own
template
struct integral_constant { static const T value = v; };

template
using bool_constant = integral_constant;

using true_type = bool_constant;
using false_type = bool_constant;

template struct is_const : false_type {};
template struct is_const : true_type {};

template struct is_pointer : false_type {};
template struct is_pointer : true_type {};

template struct is_volatile : false_type {};
template struct is_volatile : true_type {};

// OR all predicates fn to T
template
struct is_any {
template struct lambda;
};

template
struct is_any {
template
struct lambda {
static const bool value = false;
};
};

template
struct is_any {
template
struct lambda {
static const bool value = f1::value
|| is_any::template lambda::value;
};
};

int main()
{
return is_any::lambda::value;
}

Thank you very much.

Excuse me but..

Attached: lifeless.jpg (704x396, 40K)

why are you putting semicolons on the end of if-else statements?

Attached: fhjuevu5n2bn.jpg (895x503, 39K)

sup bitches. what's a dawg gotta do to see some python bling being blung in this thread? Show some love for the snake, ya hear.

Which is harder to learn, Javascript or Javafx???

What can make a compiled language slower than another if they're both basically generating assembly code?

One is a programming language and one is a GUI toolkit for Java.
Sure, both use the same amount of memory but that is irrelevant.

Post Python benchmarks.

How low level and/or geared towards optimisability the language is.

Which is "easier", considering I know little bit of C?

iterate over the list of elements in links and pull the @href and text content of each.

on a side note: comparing the computational speed of languages is only meaningful when you compare tasks that are somwhat identitcal. so if your implementation of an algorithm in a compiled language is horrible, even compiler optimizations might not be able to help you make it faster than an implementation in a interpreted language.

Neither.

Why?

That it how it is. Decide which PL to use based on what are you going to use it for.

Learn Qt.

Is there any reason to use the 32-bit linux assembly syscall syntax over the 64-bit ones in a 64-bit system?

>make compiler that can't use libraries compiled from it, so if you want to use library you have to include the sources
Why don't every compiler do this? No more proprietary libraries.

I need to learn one of those for an university exam

To support i386 obviously

Javascript

Why all of a sudden you say Javascript?

Because you said it is for an exam.

Consider i have also to learn Java

Then choose javafx?

trying to make a simple operating system

>The project I have is using the Borland C++ 3.1 compiler from 1992.
Your first step here should be to renegotiate your workflow.
Hint: it's 2018

what

A new decentralized internet. I'm calling it SkyCoin.

>make proprietary open source library
>people try to modify or redistribute it because they can and you've put no technical limitations in place to stop them
>sue every single one of them in accordance with the proprietary license and get moni while putting many almost-innocent people in debt for life

>Why don't every compiler do this?
Because not all compiler authors are raging shitstains.

Oracle.. plz

How do I start programming?

I have an obsession with final fantasy 7 mechanics and realize I should do something with technology.

If I wanted a small netbook/laptop for programming (also writing and web) what should I look at? Decent CPU and enough RAM, but what else?

Is a budget of around 400 too low?

Attached: 1492368130892.jpg (780x870, 41K)

they are though

thats what i had done but the output wasn't what was expected. turns out i was using
xpath("//@href")
xpath("//text()")

instead of
xpath("@href")
xpath("text()")

i guess i need a break.

that's pounds sterling lads

IMPL TRAIT IS HERE, NIGGERS, UPDATE NOW!
blog.rust-lang.org/2018/05/10/Rust-1.26.html

// always starts from the root of the document. If you want to find a node at any level of descendant to another node use .//

In this case though they are both immediate child nodes so not really any need for either.

Now you understand, though, why proprietary closed source software is much more honest and less insidious than proprietary open source software (though obviously still less honest than free open source software). It's a terrible idea to try to enforce free software by enforcing open source software, because then you'll just put those ignorant of the law in financial danger.

Trying to get VGA out working on an atmega8.
VGA timings are correct. Now i just gotta get enough data out in 32µs/line lol. Not sure if this is possible with 12MHz, but we try.

Attached: IMG_20180510_224218571_LL.jpg (3000x4000, 919K)

I have no idea what you just said but it looks cool

It's been a while since I touched C (probably university) and I've been stuck mostly in C# and Python at work. Is there any intermediate/advanced tutorial series on Youtube you guys recommend?

Attached: _kobabyashi_san_s_dragon_maid__kanna_kamui_render_by_lckiwi-dbl4gl7.png (600x750, 346K)

why?
ask someone who bitches about C# but can't code properly

Attached: 1525902446183.png (392x278, 138K)

>on Youtube
No. Videos are a terrible way to learn programming, at any level.

I'm looking for some nice Android project to write. Please help Jow Forums.

Attached: trevorfeel.jpg (645x773, 67K)

What do you recommend then?

>gnu.org/software/gnu-c-manual/gnu-c-manual.html
To recall the basic syntax and then go through the stdlib (or gnu extension) and posix threads header by header and function by function
>en.wikipedia.org/wiki/C_standard_library
>gnu.org/software/libc/manual/html_node/Function-Index.html

There is no decent image editor on android.
No ability to add overlay, make gifs, add text, simply draw, convert..etc

>at any level.
I can see a video format being good for an absolute beginner.

Just use a computer, soiboy

I would if I could.

I'm writing an interpreter for my custom Lisp dialect. It's supposed to allow for programming in both imperative and functional styles, but with clear separation between them (i.e. functions with side effects can call pure ones, but not vice-versa). Pure functions will use lazy evaluation.

Someone help me

>but with clear separation between them (i.e. functions with side effects can call pure ones
But what about functions with side-effects that are "contained" to the pure function calling them?
// Not pure
void add(int *a)
{
*a += 10;
}

// Pure
int fn(int a)
{
add(&a);
return a;
}

Maybe this is the place for the question:

>need to manage 20-30 employees and their payrolls
>need to follow the 10 trucks they drive and manage expenses and earnings
>need to manage driver rostering
>need to produce reports on every employee, and trucks (profits and losses, downtimes)

Currently I've been doing it with a shitty excel spreadshit. As to make it easier to use I was designing an 'UI' with userforms. Instead I decided to make it a project to learn to program and make a custom software that me and my employees can use.

I asked a few engineering friends and they told me that I could go with php+sql or with grails and react js to build the database and make the user interface (preferably web based but used locally, just for me)

Any other suggestions? I know very little of C++ and mathlab

PyQt

>Currently I've been doing it with a shitty excel spreadshit.

Does this way work?

Why are you changing something that works?

Yeah, okay, so is it out of beta yet? Nobody can get hired for using this if the syntax changes every week and breaks all your code

which scripting language should I use for scripting game engine?

It's on the stable channel as of today! So it will be backwards compatible.

Second is not pure.

for you.

luajit

Backwards compatible with what exactly? Code that was written an hour ago?
C will compile code from before I was born, I don't see why I should switch to this scripting garbage

I agree it's a little bit rusty.

The current solution is semi static: it's stable and smooth when you don't have to change things. If you have to add or remove trucks or drivers, it becomes a nightmare of little changes.

It's a horrible multi user solution, three people have access and change the spreadshit that, with this implementation its a nightmare to use

I'd like to learn from this project

And I think that if I manage to do somethig even remotely usable I'm sure I can sell it to people in the same business

lol

b u mp

>Backwards compatible with what exactly?
Previous versions of Rust >=1.0
> I don't see why I should switch to this scripting garbage
I don't see where I told you to switch from your scripting garbage.

cool

C is not backwards compatible as of C11

wtf how?
not him though.

Compiling every function into it's own shared library so you can recompile them and reload them while the program is running.

Using an interpreted language

In C you dumb cunt

Should I stop learning python and start learning C++? I pretty much understand the fundamentals, and isn't there more that can be done in C++ than in python? Or should I learn C++ and eventually start doing python again?