/dpt/ - Daily Programming Thread

What have you been working on, Jow Forums?

Previous thread:

Attached: leader_of_the_free_world.jpg (3721x2470, 3.02M)

Other urls found in this thread:

dailyprog.org/~mabynogy/test/
p.sicp.me/f3Phe.js
p.sicp.me/mDwbH.js
linux.die.net/man/1/dict
github.com/mfyuce/GitTorrent
twitter.com/SFWRedditGifs

Recompiling some fax code from 1995 included on a floppy with a book. I do fax stuff, and I felt like testing my cmake file writing and stuff.

Turns out you can't just tell cmake to make object files and link them later. Something about 3.11 is the only one in which it will explicitly export object files, but holy shit. Up until then, or even now, I lost the page, it would cache object files and even exporting them meant referencing the cache.

What a fucking joke of a make system.

>#include

I was told that C is a serious programming language. Why the fuck does it use hashtags?

Attached: gwen_nervous.png (316x309, 77K)

It's your own fault for not using ??=include

Does anyone here have a job writing Scheme or any other lisp? How does one get a comfy job like that?

Why does Merkel always lean over the table like she's getting fucked up the ass?

Why does Trump always look aloof like he has no idea of what anyone is even talking about?

This is not an answer

On that note, searching for #include on Twitter was a mistake.

Remember: These are the people American/European companies outsource their projects to.

Attached: happy_birthday.png (582x718, 75K)

And your question is unnecessarily insidious. Merkel is a cutie.

I've finally found something I like to make sequential GUI programs in JS. I also did a preprocessor to reduce the JS line noise (no commas/semicolons, less parens and syntactic sugar for arrow functions and generators).

An example (just prints ok/cancel buttons and does some sleep() after):
> dailyprog.org/~mabynogy/test/
> input p.sicp.me/f3Phe.js
> output p.sicp.me/mDwbH.js

I want the english dictionary as json. or yaml or xml or just something.
I want to be able to easily look up the type of word, i.e search for string "word" and return the string "noun", search for "walk" and return "verb", search "on" return "preposition", search "green" return "adjective", search "carelessly" return "adverb" etc.

I could use dictionary.com api if there is one maybe but I'd like to have this local. and I don't want to write my own search algorithm, ideally this would be in python or something else high level and easy that already has things I can import for searching through json or xml efficiently.

user, this is a goldmine

Attached: file.png (584x535, 61K)

>hashtags
I call them tic-tac-toes

Search around dict:
>linux.die.net/man/1/dict

Currently work in Ruby.

What big boy language should I pick up Jow Forums? I'm interested in something not OO, I was thinking Haskell or Scala (never worked in the JVM before).

I was also thinking about Go. I can't really decide.

Attached: file.png (584x119, 23K)

>this picture
Amazing
Beautiful
Classic
This picture deserves to be a painting
Based Trump, absolute legend

Anyone here used cmake? I have a period in a filename and it won't include it as a subfile

Like normally you would have CMakeLists, but instead want mysource.cmakelists , which let's you INCLUDE (myproject.cmakelists), except if I put it in a subdirectory like build/myproject.cmakelists it dies on the / and . for some god retarded reason. If I use no backslash it loses the whole path, one backslash it registers \ and . separately, escaping the slash still only registers a single \ and .

90% of my programming time is spent on retarded bullshit like this

Added memoization for pure functions to my Lisp dialect using a shitty key-value pair cache. You can now do the following:
(defun fib [n]
(if (

fag

Why not Javascript, D or Chapel?

Why the homophobia?

Take a lesson from that. Don't use make/cmake and don't put your hands in projects using them. For C/C++ write shell scripts with simple gcc commands and use a single-translation unit (all included).

I'm frankly just not very interested in JS. I have no desire to move to front end and I would rather learn something more performant for back end rather than Node.

Why do you suggest D and Chapel?

>For C/C++ write shell scripts with simple gcc commands and use a single-translation unit (all included).
>recompiling the entire project each time you make a small change
Again, languages designed in the 20th century like Go don't have problems like this.

she's leaning in

Attached: download.jpg (175x289, 7K)

that's what a makefile is for m8

Edgy.

Because he's anonymous here, so he knows he'll get away with it. He's a coward and would never do it IRL.

D is C++ done right. Better than Go IMO.
Chapel is promising. The only language dealing well with paralelism (at many level).

You're sure to find a job in Go but it can be boring as it's already known as the new Java.

Yes but C compilers are still the best.

That's honestly not cool to say. It's 2018, calling people f*gs is passé. Us queer people are here to stay man, just get used to it or live with all that hate & bile in your heart.

Decentralized Github NOW github.com/mfyuce/GitTorrent
Decentralized Github NOW github.com/mfyuce/GitTorrent
Decentralized Github NOW github.com/mfyuce/GitTorrent
Decentralized Github NOW github.com/mfyuce/GitTorrent

Yes is NodeJS, if you want a reimplementation you can do it yourself.

Attached: Women.jpg (454x603, 210K)

>Void Main
>Printf
>\n
>getch()
Jesus...

Turns out it was detecting the file properly, it was just being dumb for other reasons. Whoopee for worse than useless errors.

>>\n
What's wrong with that?

Git is already decentralized. You don't need some fancy web client.

Are you retarded? Even if you are talking about git is not decentralized but distributed.

Let's be charitable and consider that he may have capitalized those words because he was writing "wishes."

Are you a janitor? Did you seriously just mute us for that BS? Jow Forums is not what it used to be, I'm done with this shit place.

The new mods/janitors and Hiroshima Nagasaki don't give a fuck about Jow Forums or what it used to be. This place is just turning into a shittier reddit. That's why nothing cool happens here anymore

I am all for using fag and nigger in Jow Forums but your namecalling to him was directly abusive.

>mods enforce the rules
>throw a tantrum because you wanna be edgy and say "fag" on a blue board
Hate speech is NOT allowed on blue boards, user. It's global rule #3. Stop shitting up Jow Forums.

FINALLY!

No u. Also this

#include
main()
{
unsigned int a=0, b=0, c=0;
printf("Are these three positive integers pythagorean triples?\n");
while (1 > 0)
{
scanf("%d %d %d", &a, &b, &c);
if (a > 0 && b > 0 && c > 0)
{
a = a * a;
b = b * b;
c = c * c;
if ((a + b) == c)
{
printf("They are pythagorean triples!\n");
a = b = c = 0;
}
else
printf("They are not pythagorean triples!\n");
a = b = c = 0;
}
else
printf("Invalid input.\n");
a = b = c = 0;
}
}

Hey Jow Forums, this program determines if three positive integers are pythagorean triples, i.e. that a^2 + b^2 = c^2. The program is a success, it is able to determine if three positive integers are P. triples, but it behaves strangely when the program receives non-decimal characters, such as 'w' or '@', the program begins by getting its input with the scanf function, if those three integers are greater than zero (i.e. non-negative and non-zero), it computes the pythagorean formula, else it tells the user that the input was invalid and starts over, but when the program gets non-decimal characters it infinitely repeats the else statements and the program must be forcefully terminated, this confuses me because shouldn't the program execute the else statements only once and then start over from the scanf function?

I usually never come to Jow Forums anymore because of how boring and shitty it's become.

It's because it's off topic. His posts stayed up because you didn't report him.

so why didn't this get deleted/muted?

I meant this one

Nice propaganda.

1 second after this pic was taken

Attached: opano3kug6311.jpg (660x371, 37K)

Software development is a very broad field.

Databases, Servers, Continuous Integration + Deployment, Web Services, Web Apps, whatever the fuck HTML + CSS together is, Security, Servers, Cloud, Version Control, and then programming.

How much, are you realistically expected to know and to what level of expertise?

Attached: 1523062237260.png (922x988, 87K)

Damn, motherfucking Justin Trudeau towering over everyone in that pic! Manlets BTFO, how will they ever recover?

A little bit about everything, everything about something.

Attached: 1519782326366.jpg (1071x1068, 637K)

>1 second after this pic was taken
>Abe is gone

N-NANI SONO SHINOBI NO SHUHOU DA KA?!?!?!

A Bolton 'stache would look great on Trump.
On Mutti too for that matter.

Attached: b0f273949271057b35a9ee03d45a11d9.jpg (634x996, 223K)

>while (1 > 0)
wtf. I hope you're trolling. fyi ofc the program will repeat that else statement ad infinitum, you wrote an infinite loop. scanf does not consume characters if they're invalid so it will fail each time.

as a beginner-intermediate in c/c++, whats a good resource for different ideas / assignments to program so i can familiarize myself with the language? my main issue is that any ideas i have are much more convenient to do in a language i already know like python and id like to escape that rut somehow

Attached: trump-cube.jpg (720x477, 151K)

amazing what ML is capable of

>scanf does not consume characters if they're invalid so it will fail each time.

that's what i needed to know, thanks

Attached: apex.jpg (1053x877, 101K)

Why does she look excited at the prospect of being taken as a sex slave by people who slaughtered her friends and family?

Build something real. Don't do exercises.

>while(1>0)

Attached: trump2-realistic.jpg (720x599, 155K)

H-HAYAI

Attached: 1414986617190.jpg (600x600, 230K)

Holy shit.

arr.filter(num => num % 2 !== 0)

is 10 times clearer than

filter(lambda x: x % 2 !== 0, arr)

I can't believe it took stumbling upon some JavaScript shitter to make filter actually make sense.

Speaking as a software engineer working on web applications and backend services:
>Databases - you should be pretty proficient in SQL (queries and schema changes) and be able to do basic configuration tasks on whatever RDBMS your company uses (e.g. creating a backup, restoring a backup, etc.)
>Continuous Integration + Deployment - barely anything, this is usually handled 99% by devops/or an IT infrastructure team
>Web Services - unless working specifically with them, just understanding how they communicate is enough to get by
>Web Apps - the basics of how they might be architected, helps to know how common things are implemented (e.g. how a login page is supposed to be coded)
>whatever the fuck HTML + CSS together is - enough to be able to make trivial HTML changes to a page, understanding what the HTML you're reading will be rendered as
>Security - enough to know where you need it
>Servers - barely anything, basically just how to connect to them and maybe very basic configuration tasks
>Cloud - nothing, it doesn't feel very (or any) different from a regular server
>Version Control - enough to download code from the server/remote repository, view history and changes of the code, and check in changes to the code in whatever version control system your company uses
>programming - understanding how and where to apply object oriented principles is important as well as being able to understand most of the code you see in the wild and being able to solve most (simple) problems you might run into

90% of the job is just knowing the different languages you use well (usually SQL and an object oriented language like C#, maybe some others like JS frameworks/HTML/CSS for frontend), the other 10% is just knowing enough of the other technologies in the portfolio to get by. They'll teach you a lot of these things on the job anyway.

spam & CP ok. nazis not ok. like tor.

Avoid all those boring stuffs. Do real programming.

in Haskell this is just
filter odd arr

Autor JS inspire Scheme
Some Hobo had functional features in Python.

Best spoken human language for this field of work?

>abusive
lol

>white women amirite?

English or Japanese
Same for any other field of work
Ruby sucks though

filter(function or None, iterable) --> filter object
|
| Return an iterator yielding those items of iterable for which function(item)
| is true. If function is None, return the items that are true.


Hurr durr RTFM

> THIS IS C++

Attached: Lq7Rngl6m3o_5HL8T7rdtm4jHO_FmCfm7KkzE_N7P-4.jpg (788x767, 135K)

Kek

>nested code tags
Damn, I had no idea you could do that.

Hindi

Also, when I transported the compiled program from my laptop to my desktop (two different processors), the program was behaving in strange ways, such as that it would print 'invalid input' for *valid* inputs. How do I make my programs highly portable?

not lazy so its actually shit

I doubt you'd even be able to run it if instruction sets were the issue. Are you sure you haven't made any changes to the program midway? Does your laptop have a different operating system?

(x for x in arr if x % 2 != 0)
a bit clearer. python lambdas are absolutely horrible for no reason

Why does Jow Forums hate rust again? It's C with monads

Both my laptop and my desktop use a Linux based OS, KDE Manjaro, no I did not make any changes mid-way, I uploaded the program from my laptop to my FTP server and downloaded it from the server to my desktop.

Because the borrow-checker limits the programmer's freedom, which is tedious at best and detrimental to productivity at worst.
And you'll have to use unsafe at some point to write anything useful either way.

std::transmute(boy)

Of course you are going to need Unsafe to write anything useful. That's why its part of the language. You then wrap this in a safe API so that you don't have to think about the ways your unsafe code may wind up being fucked by bad inputs.

transmute is in the mem module

it also takes two type arguments
std::mem::transmute::(you)

>In rust Girl is a alias to person could had penis and non uterus.

I wanted to make two constructors for same class. One for float variable, and other for int variable. I have problem with p3 object in int main. How to show to compiler that number i put is a float and i want to use float constructor, and give int default value, vice versa. Before i used (float (number)) there was ambigous constructor error obviously, are there better way to avoid this? Or better way to write constructors in general? Or maybe i overcomplicate things, and setFloat is better for this purpose? Please help

#include

using namespace std;

class Worker {
int birthday;
float pension;
public:
Worker();
Worker(float pension_in, int birthday_in);
Worker(float pension_in);
Worker(int birthday_in);
void Raise(float amount);
void print();
friend ostream& operator

Attached: trop.png (1280x720, 1.07M)

Whats are some good outlets for finding work?
Or what are some sites to avoid?
Im just digging through search engines atm

Working on a chip8 emulator, can't get it to work. Am I retarded? Should I abandon my hopes of working as a programmer and get a job at Mickey D's?

4500.0f

Most "intermediate" programmers wouldn't even know where to begin. Writing a virtual machine, even this simple, is not that easy. Try using a debugger to step through the code or check memory with valgrind if you're getting segfaults.

Attached: 0.jpg (492x877, 73K)