/dpt/ daily programming thread

pair programming edition

least recently used:

Attached: pdp-11.jpg (1303x1044, 594K)

Other urls found in this thread:

icube-icps.unistra.fr/img_auth.php/d/db/ModernC.pdf
news.ycombinator.com/item?id=16742401
github.com/perl6/marketing/blob/master/Brochures/Introducing-Perl6-Brochure/Introducing-Perl6-Brochure.pdf
twitter.com/NSFWRedditGif

icube-icps.unistra.fr/img_auth.php/d/db/ModernC.pdf

thoughts on this for learning C? or should I stick with K&R?
thanks.

Why is void a function in Racket?

Is there any script that converts C++ code into syntactically highlighted LaTeX? Kind of like but better.

>fr
need I say more?

Please do, I'm not aware of the french memes regarding tech.

Is this true?

Attached: 1522760556879.png (1192x4808, 917K)

Monoids will save systems programming.

it certainly is a factor in some cases

got a link?

I like C++ but I don't want to be bothered with vtables and struct alignment. Any advice?

news.ycombinator.com/item?id=16742401

tl;dr
C and C++ compilation is hard. Linux makes it easy but only if you're using the system compiler. I am complaining because I have to compile C and C++ like everybody who is not on Linux.

>i'm too lazy to update muh compiler and muh pre-compiled libs
>also too lazy to update muh system

Don't use virtual functions and do worry about structs.

Seriously, how can you still desire to use a language without modules or sandboxed builds in the current year?

>do
You mean "don't", right?

y

lads i can't take my comp sci classes seriously

i have a fair bit of programming experience and all of these assignments essentially amount to stenography. there's no room for making it interesting in any way, any alternate approach i take is penalized. i literally never went to any lectures and i get 90s on the tests/assignments (save for those where i lost points for trying to do something wacky which was my dumb asses fault)

unfortunately i dont have enough of a portfolio to land myself a job and none of the projects I'm working on the side are close enough to completion to justify dropping out of uni

so i guess im just stuck here. thanks for reading my bitchy blogpost

I had the same experience. I feel like it might be a fairly universal phenomenon. Problem statements narrowed down so much to accommodate retards that the solution is obvious yet requires dumbing down. Like "solve X using classes Y, Z, W and this algorithm in pseudocode". Truly code monkey training.

Friendly reminder to use option or std::optional or Nullable!T whenever necessary

Attached: 1520047614749.jpg (643x720, 154K)

Careful - one day the class will suddenly spike 20x in difficulty and you'll find you missed the one important lecture on algorithms and going forward everything will be some variant of algorithmic solution.

You're at the "filter out people actually interested" stage. Soon you'll hit the "filter out people who are interested but too stupid to continue" stage.

what about Maybe T or (forall r. r -> (T -> r) -> r) or (Either () T)

The male supervisor seems happy enough, but the posture of the female keying in the code seems sad.

Oh, those too

Attached: 1519908680190.png (510x474, 262K)

Friendly reminder to always handle error paths first.

spent all fucking day tracking down a pointer bug for it to literally turn out to be a compiler issue
fucking gbdk (there's an updated version that fixes it)
was about to pull my fucking hair out, couldn't access a big 'ole table with tile mappings properly, the middle section would end up being corrupted when I tried to display it on screen despite being a-ok in the binary and source, it was fucking up the pointer arithmetic and reaching into god knows where

Attached: long-sustained-yelling.png (500x356, 278K)

>STL

Attached: 1445281588344.gif (240x200, 359K)

I guess it depends on the school. I was taking classes ahead of my year and I got the feeling that those two stages you're talking about were "undergrad" and "graduate".

Thoughts on ∃x∈B.ite(x,T,O)?

s/O/O

Java: is there a painless way to iterate a List in reverse?

that's Ken Thompson (sitting) and Dennis Ritchie

Oh fuck off Jow Forums why would you filter the Norse crossed O to O.

excessive fapping in the last few days really fucked me up
feeling lethargic as fuck
protip don't fap more often than once a day

I'm about to give up

idk what I'm doing anymore

can someone motivate me to keep working

tx.

idk.

Attached: qq.png (1455x492, 47K)

Finally got some free time and trying to decide what project to work on:

- adobe plugin
- crypto trading bot
- that video game I'll never finish

God I hate javascript and NodeJS

dinosaur detected

I think it's ok-ish.

but it's definitely not built for 10000 loc modules. hence TS.

How many seppelsfag can be triggered by a single post?

It's easy to trigger people who've used C++.

C++ is a good language

Attached: 2017%2F09%2F08%2Fa5%2F3023267ca95a4680867b4cab83ea9ea5.48095.jpg (1200x630, 74K)

How do cracking teams have their executables, like keygens/etc, run without smartscreen or UAC popping up? Anytime I create a binary for tutorials and excercies, Windows smartscreen pops up saying my binary is from an unknown publisher (using VS17). I know about signing and needing a certificate which is why this has me curious.

I'm going to lose my fucking mind. This teacher has a fetish for group projects and because it's a community college I've been working with these same 2 other kids for over a year now.
They have this thing where they want to work work work all fucking day and then cry when others don't meanwhile they routinely do things like spend 12 hours doing something that would have taken me one.
These kids worked non-stop over spring break and got done what was equal to about 3 hours of my own work.
At this point I'm just letting them work themselves into the ground doing nothing.
Really, how do you take 9 hours to create inserts in SQL? That's 30 minutes of work.

>You're that faggot who does nothing in team projects
I always told the teacher on fags like you

>doesn't understand what the purpose of units are in a database for a rhetorical grocery store even after I had the teacher explain it twice and I myself explained it three times
>spend 40 hours creating data by hand because too dumb to figure out mockaroo
>spend another 40 hours retyping all the thousands of data entries by hand because too dumb to figure out how bulk inserts work
>stop 3/4th the way through and decide to add check constraints to some attributes, realize too dumb to make it work, revert change
>Ask clarification on something important like storing payment totals in the payments table on the day before it's due and explain it so poorly that the teacher says they don't want them, making the DML for the RFM analysis 3 times as complex
>Clear signs of fetal alcolhol syndrome in the belligerant one, high functioning autism in the beta
Don't tell on me, just put a bullet in my brain.

>SQL
>community college
>group projects
why did you pick this hell in particular?

fucking RIP I had the same sort of project. One stupid person can hold the whole team hostage.\

just show how rust is better than C++. oh wait.

obsessed

use lstlisting and some c++ language definition

Not him but I had a similar problem to that. I had this professor in my second intro to c++ class that constantly grouped everyone together, even though almost all of the work didn't need to be done in a group. I'm pretty sure they do it out of laziness and having less shit to grade.

It's complex but I'm 25 now with no work history(am criminal) and figured it was better than no schooling. Little did I know I would be teaching the classes for a 350 pound 5 foot 2 female SJW professor while using exclusively microsoft tools and SQL.
It's not just SQL in community college, it's SQL in community college using Microsoft SQL server management studio and VB in visual studio for the front end.
If I could post pictures of this professor and these two kids(they really are young, I think i'm 6 years older) you would die in a fit laughter and pity.
Time to get back to hurling passive aggressive comments at these dumb mother fuckers over DISCORD of all platforms.
This project is 40% of the final grade, not that I give a fuck.

>I always told the teacher on fags like you
A kid did that to me once, was the last time he ever told on anyone.

Anyone here ever do really poorly in a CS course yet still pass with a C or better? I'm taking an assembly language course this semester and I am doing fucking terrible at it, I'm stressed that I'm going to fail this class. I haven't talked to the professor about extra credit yet, but I have a test coming up and I'm worried that if I do really bad on it I'm going to fail outright. What do?

They can tell all they want they have no charisma and won't stand up for themselves and so I make sure it gets them no where. I've spent the better part of a year trying to hold their hands and make sure we do well and I am just fucking done.
On some level I actually enjoy working with databases and schema, it's like a little puzzle, I hear there are even decent careers in working with data, but I feel like I've done nothing but hand holding and spoon feeding for the majority of my stay at this school.
I pass with C's all day long niggy it's the way to go. 30% of the work for 76% of the grade, sign me up.

/sci/ doesn't support it.

My roommate wants to put some LED strips up in our dorm. He was just thinking about getting those cheap ones with the little remote, but I was thinking about getting one of those RGB strips and controlling it with a raspi. I want to make a web interface so we can control it from our phones and program in some different modes.
I'm thinking about using python and pigpio to control them, and then just make a simple web interface with Flask. Am I retarded or is this that easy?
I know I need some MOSFETs to control them.

I need something on my shithub thats fairly impressive enough to get me hired somewhere.
Help

Looks pretty good.

node.js is old, shitty hat
There's better and faster things out there, not written in a garbage language

You analyze them in a VM you fucktard
>he actually roots himself on purpose

I wish we could just go back to using real desktop software. Is there anything worse than studying fucking web development api's? Just end me now and this tainted realm with me.

How far can we go?
import std.variant;

Algebraic!(T, string) fib_nth(T)(T n)
{
return
n % 15 ? n % 5 ? n % 3 ? Algebraic!(T, string)(n) : Algebraic!(T, string)("Fizz") : Algebraic!(T, string)("Buzz") : Algebraic!(T, string)("Fizzbuzz");
}

void main()
{
foreach (i; 1 .. 101)
{
import std.stdio;

writeln(fib_nth(i));
}
}

write an OS in rust and i'll hire you

we still are lad.
Web shit didn't magically erase all regular desktop application tools.

>Algebraic!
something something move further from God

Attached: 1467019345752.jpg (180x157, 10K)

help! i need an idea for school project. i have about 9mo experience programming and need a project which will take me ~3mo to complete

> writeln(fib_nth(i));
heathen
i.fib_nth.writeln;

write an interpreter/compiler

for (int i = list.size() - 1; i-- > 0; ) {
...
}

Meh.
If you want something that'll look especially good on a resume make it involve databases in some way. Employers love seeing SQL or big data meme frameworks

Actually ignore this,
for (int i = list.size(); i-- > 0; ) ...
OR
for (int i = list.size() - 1; i >= 0; i--) ...

why is it called algebraic data type though?

a tuple is like *
a variant is like +

std::thinking(&mut self).unwrap()

std::activate(&almonds)

The piece of paper is worth it. Also, shut up and code

Attached: 581b406283faa_image.jpg (700x641, 46K)

dumb frogposter

Anyone have experience with top coder or other crowd source/bounty style platforms? Graduating soon and I'm thinking it'd be a way to earn money with as little commitment as possible

I want to leave OOP
What's the install gentoo equivalent in programming and how do I into it?

Elaborate pls

Haskell.
www.haskellbook.com or learnyouahaskell.com

Is there any reason why freeing a malloc'd unsigned char * would work fine on Windows but crash with "invalid pointer" on Linux?

How do I get a job coding in Coq someone help

Attached: 1349773664266.jpg (361x469, 20K)

see

learn Rust and you'll get the CoC you want all day long

unironically move to france and join the coq team

Which one is faster? Is there a difference between the two?

std::weak_ptr MethodA(const VectorStruct V) {}

vs
std::weak_ptr MethodB(const VectorStruct &V) {}


I have a 3d vector struct in C++, it's an API struct so I cannot implement it my own way. I also have a method called several times each second so I want it to be as efficient as possible. Is passing by const ref faster?

It's usually better to pass by const reference except in the case of the default types like int, float, etc and iterators.

That's the thing I'm trying to avoid. Geniuses at Sun made Iterator that only goes one way.

If VectorStruct is small then there's a good chance it's faster to pass directly. Just try both and benchmark it.

Alright, I suppose I'll have to benchmark it just to be safe

Why aren't you learning Perl 6? Once you try it out, you probably won't want to go back to Python or Ruby. Perl 6 is a different language from Perl 5, fixing all of the old "criticisms" of Perl, implementing proper OOP and multithreading, has awesome unicode and grammar support, etc. You should check it out!

github.com/perl6/marketing/blob/master/Brochures/Introducing-Perl6-Brochure/Introducing-Perl6-Brochure.pdf

Attached: tumblr_p01eouD8OR1vzpl8vo1_1280.png (1000x1000, 1.19M)

Can C++ compete?

Attached: Screenshot-2018-4-4 std visit is everything wrong with modern C++.png (1478x10000, 2.86M)

Is it possible to use a binary format storing custom instructions and parameters without it being if / case / comparsion city?

no u

Should this work?

void SomeMethod(float *TestValue){
float Value = {1.f};
float UninitializedFloat;
TestValue = &UnitializedFloat;
if(Value < (*TestValue)){
(*TestValue) = Value;
}
}


"Value" is getting a different number assigned inside a loop but I omitted it for brevity's sake. My question is regarding assigning an uninitialized float to a pointer, will the if block evaluate?
Essentially I want to check all values and find the smallest one.

Why are you capitalizing your variable names?