/dpt/ - Daily Programming Thread

What are you working on, Jow Forums?

Previous thread:

Attached: books.jpg (768x1024, 154K)

Other urls found in this thread:

wiki.dlang.org/Build_D_for_Android
wiki.squeak.org/squeak/792
timeshighereducation.com/world-university-rankings/2019/subject-ranking/engineering-and-IT
notes.eatonphil.com/compiler-basics-lisp-to-assembly.html
boards.4channel.org/g/*
highlightjs.org/static/highlight.pack.js
highlight.js/
cdnjs.cloudflare.com/ajax/libs/highlight.js/9.15.6/styles/default.min.css';
github.com/TechEmpower/FrameworkBenchmarks/blob/master/frameworks/Go/fasthttp/src/server-postgresql/server.go
docs.microsoft.com/en-us/dotnet/api/system.net.sockets.udpclient?view=netframework-4.7.2)
en.cppreference.com/w/cpp/language/fold
twitter.com/NSFWRedditImage

...

...

get visual studio and install their android tools faggot

can someone please post an anime girl?

>visual studio
kekekekek

When in Pajeetland, do as Pajeets do.

Attached: 1548595376508.png (538x349, 255K)

wiki.dlang.org/Build_D_for_Android

Learning javascript... fucking amazed
Also diddling with Android dev...less amazing

>Visual Studio for Android
lmao

Use Android Studio.

I know what's fizzbuzz but who do you mean when you say fizzbuzzer?
What's the difference between web 2.0 and 3.0, where's the cutoff point?

how do you build up stamina? I worked for the past couple of days on my project and now I'm exhausted (despite 10 hours of sleep, modafinil, coffee) and don't want to do anything but shitpost on 4channel

Attached: 43641236416234.png (487x365, 68K)

>Use Android Studio.
but I am
pic related, new untouched project

Attached: android.png (388x646, 18K)

was that 10 hours of sleep *a day*
anyway make sure you're eating properly

Here you go, lad.

Attached: 1552508930434.png (577x646, 46K)

You're addicted to caffeine and you probably have depression on top of that.
You can't build up motivation when you have depression.
For now, just lay off the caffeine and drugs for a week or two and see how well you do.

>10 hours of sleep
10 hours of sleep means something is wrong
> modafinil, coffee
great way to crash after

Work around 4-6 hours a day tops.
Socialize, exercise and go on walks.

last night; couple of days ago I had only 5 the night before and somehow managed to push for 12-13 hours of work, didn't feel tired at all, just worked
today I maybe wrote 20 lines in about an hour

wiki.squeak.org/squeak/792
which one to start with?

Use Xamarin, you idiot.

thanks m8
>have to use 3 different build scripts

>gradle
Is this the most offensive thing Google has ever invented?

>POO

Attached: vomit-chan.jpg (680x680, 85K)

There should be two - one for the whole app (it's in the gradle scripts directory) where you will be adding application level libraries/dependencies (like kotlin) and the other one (in the app directory) for the main module where you will be adding libraries and other shit. The third one is probably just a copy of the seconds one.

>how do you build up stamina?
being paid a fat check helps tremendously

how to into making code generation tools
tired of the C++ committee being slow as fuck and would also just like to automate some shit

i've fiddled around with using clang/LLVM as a library but its documentation leaves much to be desired
it's not that everything isn't documented to an acceptable standard - it is (frankly it's rather well done) - it's that clang/LLVM's architecture is extremely complicated and interconnected
the documentation is almost useless without a structural overview of what does what when and how
which sucks because it was made to be used as a library and it appears very well designed

does anyone know if there's some kind of detailed architectural information on clang/LLVM
or if not, are there any easier alternatives to clang/LLVM for creating code generation tools

You need to take frequent breaks. Set at least 20 minutes aside each day for stretches and light aerobics.
Before you go to bed, do something mindless and fun, like a video game or a funny anime.

What are some cute design patterns I should learn to impress cs qts

>cs qts

Attached: 1549113706829.png (549x560, 222K)

Cute asian girls in my program

in my computer science bachelor's degree program I mean

doing absolute shit code for intro java class.

I can't with conditionals...

Ignore LLVM until you desperately need to speed up the runtime execution of your generated code
First make it work, then make it fast

>asian girls
oh ok

Attached: 1549495795254.png (780x717, 455K)

What kind of a shit university has girls?

>I can't with conditionals...
Just think what Jesus would do, given some input.

State universities

Having girls is important for the work/study space. They can provide eye candy and emotional relief, like cats or ping pong tables; plus, they can boost morale by making the real workers feel smart/useful when helping (or simply talking to) them, to counterweight the real discussions with professionals they have to go through throughout the day

All the top 10.
timeshighereducation.com/world-university-rankings/2019/subject-ranking/engineering-and-IT

Attached: THE_top10.png (734x1057, 116K)

That's a bit selfish way to think of it. What of the girls themselves? What if their brains overheat?

Yeah but I mean real university-level programs.

You can't expect of them to be able to make that judgement, so it's unfair to cast the blame on them. The husband should be held accountable in case of any misfortune for mismanaging his woman.

My university is full of roasties, but only the ugly ones come to the CS classes

i know i don't exactly need to be touching llvm a whole lot right now, i just figured clang/LLVM was more semantically correct

my issue is i don't really know how to go from traversing, matching, and visiting the ast to actually generating code
I've had a look at the clang based implementation of qt's meta-object compiler, as that's closest to what I'd like to make, but it left me confused.
the individual pieces of how it works are pretty easy to understand, but I don't know how they all fit together

My web development course had about 200 students, ~50 % of them females. My compilers course had 20 students, all of them men with big bushy linux beards.

lol fucking no
100% male work environment or it's terrible
Women make everything worse

Your compiler course wasn't mandatory?
>tfw I didn't have a single webdev class

Post on 4channel less.

After a while of really getting into your work/projects, you come back here and realize how low-content and time-wasting this place is. You will check 4channel, realize how insubstantial arguing with idiots is and you'll want to go back to being productive right away

Even /dpt/ is just language wars nowadays, sadly.

Also take adderall instead of modafinil. Smoke weed to take the edge off of the stims at night.

Not for my major. I studied machine learning. It probably was mandatory for software development majors, though.

POO lovers praise it as a pinnacle of POO, I want to know what's that about

>tfw almost every girl in my CS classes is fob Chinese or Indian

Attached: 1455193606119.jpg (250x241, 12K)

>Even /dpt/ is just language wars nowadays, sadly.
You don't have to participate. Post interesting things instead.

problematic post

absolutely, samesex group is always shit and faggy

Start here
notes.eatonphil.com/compiler-basics-lisp-to-assembly.html
>my issue is i don't really know how to go from traversing, matching, and visiting the ast to actually generating code
Start with a small/simple AST, like one that only supports a print statement and literal operands, and then gradually add features until you're comfortable with the concept
You might need to throw out your work at some point if your architecture doesn't let you support more advanced features (closures, coroutines, whatever) but the point is to practice and get over the hurdle of "I don't know where to begin"

>I studied machine learning

One of my classes had a Chinese girl who looked 12

Damn right. I can descend gradients you wouldn't even believe.

I wonder what "Haskell music" sounds like.

Imagine allowing women in higher education institutions.

Attached: wymyn.png (461x611, 432K)

Based

So how does one actually learn ML without becoming a regression-monkey?

I bet you can't descend *this* gradient
*whips out meaty cock*

dumb frogposter

Tried to get highlight.js to work with Jow Forums, it's not great because you have to rely on auto-detection for everything. At least lisp code and stuff doesn't seem to break. Requires Jow Forums X.

// ==UserScript==
// @name Jow Forums highlight.js
// @description Changes the code tags on Jow Forums to use highlight.js
// @include boards.4channel.org/g/*
// @require highlightjs.org/static/highlight.pack.js
// ==/UserScript==

// see highlight.js/ for available color schemes
var css_file = 'cdnjs.cloudflare.com/ajax/libs/highlight.js/9.15.6/styles/default.min.css';

hljs.configure({useBR: true});
hljs.initHighlighting();

var link = document.createElement('link');
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = css_file;
document.getElementsByTagName('head')[0].appendChild(link);

function highlight(obj) {
obj.querySelectorAll('pre.prettyprint').forEach(function (pre) { hljs.highlightBlock(pre); });
}

document.addEventListener('4chanXInitFinished', function (e) {
highlight(document.body);
}, false);

document.addEventListener('ThreadUpdate', function (e) {
e.detail.newPosts.forEach(function (id) {
var no = id.split('.')[1]; // board.123
highlight(document.getElementById('p' + no));
});
}, false);

Attached: code.png (800x1907, 121K)

Same sex workforce is fine if the workers are bros with more than 200mg of testosterone in their body.

But we're talking about programmers, so same sex groups will just be nerdy faggy shit

this, where is the workforce representation for cute anime girls

Attached: 1549608480633.png (400x400, 148K)

>aggressive neckbeard linux metalhead
Versus
>normalfag who plays [popular online game] and has tons of friends
Versud
>beta numale

Which is the best / worst coworker?

Not beta numale, he's going to police whatever you say with political correctness and feminist bullshit.

The rest depends on who you are. If you hit the gym & go out, the normie. If you're a linux overlord then the neckbeard.

>not cute girls with feminine penii
homo detected wee woo wee woo

Attached: 74812374812.jpg (800x800, 170K)

You make a recursive descent parser that produces an ast. You then translate the ast into Assembly. You then have a working compiler. Next you write an optimizer to modify the ast. If you get good enough and want to make a compiler for a very specific use case language very quickly you can tokenize with regex and parse straight into Assembly and have a working programming language in a few hundred lines of code. But if you want a monster that’s gcc/clang tier you need an ast and optimizer.

>no Java POOP
Shit taste

Not everyone is into regression. Some prefer classification.

My cousin is going to a bootcamp or something to learn coding, he wants to become an ethical hacker. He was over at my house, needed to use my internet but I have automatic ip assignment turned off, and he had no idea what I meant when I told him what ip and gateway to use. He's 29 btw.

Classification is just regression interpreted as probabilities.

have you tried ethically hacking his boy pussy?

Hopefully the Xilinx 7 series bitstream is fully reverse engineered soon so that I can make my own HDL for it.

github.com/TechEmpower/FrameworkBenchmarks/blob/master/frameworks/Go/fasthttp/src/server-postgresql/server.go

go has the simplest, fastest solution of all the others
who aren't you Go yet, user?

Attached: fortunes.go.png (1894x483, 83K)

Currently trying to get into network programming.
However i cant seem to get it to work (referring to the microsoft udpclient class example docs.microsoft.com/en-us/dotnet/api/system.net.sockets.udpclient?view=netframework-4.7.2)

Can anybody help?

Attached: servernotreceiving.png (1486x669, 69K)

>var
>no strict mode
>snake_case in JS of all things
>4chanX as dependency
>4 spaces instead of 2
>forEach
>single quotes
Never gonna make it.
// ==UserScript==
// @name Jow Forums highlight.js
// @description Changes the code tags on Jow Forums to use highlight.js
// @include boards.4channel.org/g/*
// @require highlightjs.org/static/highlight.pack.js
// @run-at document-start
// ==/UserScript==

"use strict";

// see highlight.js/ for available color schemes
const cssFile = "cdnjs.cloudflare.com/ajax/libs/highlight.js/9.15.6/styles/default.min.css";

document.head.insertAdjacentHTML(
"beforeend",
``
);

hljs.configure({ useBR: true });
hljs.initHighlighting();

const preNodes = document.getElementsByTagName("pre");
const highlightedNodes = document.getElementsByClassName("highlighted");
const { includes: arrayIncludes } = Array.prototype;

const observer = new MutationObserver(() => {
for (const node of preNodes) {
if (arrayIncludes.call(highlightedNodes, node)) continue;
hljs.highlightBlock(node);
node.classList.add("highlighted");
}
});

observer.observe(document.documentElement, { subtree: true, childList: true });

bored
willing to do someone's programming homework

I need a program that can take the description of an arbitary Turing machine and tells me if it'll halt for some input.

could you simplify this for me? I feel really stupid right now.

if Position == 1:
TextString = 'Example Text'

if Position == 2:
TextString = 'More Example Text'

if Position == 3:
TextString = 'Even More Example Text'

put them in an array

change the ifs to else if
otherwise perfect

Woke up at 2pm due to being up all night with back pain. Didn't go to work. Popped some drugs and now I'm on my seat. Pretty much just writing some logic to write to a database and scoping out requirements for other teams.

fuck the amount of garbage code I have to deal with on a daily basis
it would cost me less time if some people weren't on my team
and by some people I mean one person
fucking global variables everywhere
5 layers if if and elses
ffs
i'm so pissed
why can't everyone be as smart as the azn kid who works on the data analytics team

Attached: china.jpg (1920x1079, 583K)

>taking up more memory
why user?

Don't really see a way to "simplify" it further, but you can change its form by using a switch, or else loading it into an array.

Help a retard out, trying to do a shitty calculator junit test, but can't figure out the test.

@Test
@DisplayName("negsqr")
public void testSqrtNegative() {
calc.squirt(-4);
assertEquals(???????);
}

Should it be assertThrows, since the calc throws:
if (n

in something like C or C++ that wouldn't take up more memory

I don't know C# but you're not closing the connection after the send, so your receive is just sitting there waiting for more data. You have the broadcast in the bytes buffer but you're still waiting for receive to return.

You could do something like this, but I don't really see any problems with your solution.
pos_to_text = {
1: "example text",
2: "more...",
3: "even more...",
}
text = pos_to_text[Position]

Wait never mind, the documentation seems to imply receive returns after it gets a datagram.

I think it's because you're not specifying the port in your client. You have to send the datagram to the same port that the server is listening on.

Does that work?

>Never gonna make it.
What a shame, I always wanted to be a webdev. Actually I'd rather kill myself, thanks though.

Vimfags BTFO

is it possible to generate these guys for a general number of arguments (unknown at compile time)?

[spoiler]please don't CS grad maymay this[/spoiler]

Attached: lambdas.png (960x297, 23K)

Oh wait I still can't read. I'm giving up.

parameter pack

en.cppreference.com/w/cpp/language/fold

You could use a switch statement but it would likely compile to the same thing here.

neat

Attached: oy vey jews.gif (472x360, 2.18M)