/dpt/ - daily programming thread

Animus edition, as requested

Old thread:

Attached: 1525104026635.png (1182x585, 296K)

Other urls found in this thread:

manga.madokami.al/Manga/H/HI/HINA/Hinamatsuri/Hinamatsuri - c001-005x1 (v01) [Various].zip
manga.madokami.al/Manga/H/HI/HINA/Hinamatsuri/Hinamatsuri - c006-010x1 (v02) [Various].zip
manga.madokami.al/Manga/H/HI/HINA/Hinamatsuri/Hinamatsuri - c009-010 (cmp) [No Group].zip
manga.madokami.al/Manga/H/HI/HINA/Hinamatsuri/Hinamatsuri - c011-016x2 (v03) [Various].zip
docs.oracle.com/javase/7/docs/api/java/lang/Thread.html#interrupt()
docs.oracle.com/javase/8/docs/technotes/guides/concurrency/threadPrimitiveDeprecation.html
twitter.com/NSFWRedditVideo

well played, OP

Why can't C++ be good?

because you're gay

>user, how does it feel to know you are creating the next billion+ dollar app?

feels gud, man!
once i'm done, i only have to be concerned with getting it out there. and getting it big before some copycat (like fb/google/etc...) tries to rip me off and slips their inferior version in front of mine.

I want to learn APL. If I do, will I ever actually use it? Or is its only purpose to serve as an interesting exercise in logical and mathematical thinking while learning it?

Flappy bird clone?

Probably wont come of any use. If you do decide to use it for anything you'll regret it when you have to come back and understand what the code did

oh, no.
this is gonna be sweet.
free to users
no ads
in-app purchases only

once people use it they will love it.
just how to get them to try it in the first place... ugh!

stupid question:

what's more important/precious: bandwidth or cpu-time?

as in compression: how far do you go, how do you balance it best?

I'm going on a holiday for three weeks, so I don't feel like starting a new project right now. Instead, I'm reading up on stoicism and learning Chinese.

Attached: 1892019558.jpg (1200x1800, 105K)

is that the sleep hypnotism app or whatever

I think this is tortilla pre-heater of Jow Forums

no, sir.
that's been done. (poorly, by many)

this, sir; has never been done before as far as i can tell. spent a week trying to find something like this to use for myself. since it doesn't seem to exist, i decided to make it myself - hence, my learning how to program.

evolutionary leap?
nay!
evolutionary rocket launch!

I guess autism never held back Mark Zuckerberg.

i'm an aspie, not an autist

does anyone know how to use curl/wget to download files that are linked in a web page and the links look like this in the page
Hinamatsuri - c001-005x1 (v01) [Various].zip
Hinamatsuri - c006-010x1 (v02) [Various].zip
Hinamatsuri - c009-010 (cmp) [No Group].zip
Hinamatsuri - c011-016x2 (v03) [Various].zip
Hinamatsuri - c012-016 (cmp) [No Group].zip
Hinamatsuri - c016 (v03) [keydriven] {v2}.zip
Hinamatsuri - c017 (v04) [keydriven].zip
Hinamatsuri - c017-021x1 (v04) [mix] [Various].zip
Hinamatsuri - c018 (v04) [mag] [No Group] {v0}.zip
Hinamatsuri - c021 (v04) [mag] [No Group] {v0}.zip
Hinamatsuri - c022-027x1 (v05) [mix] [Various].zip
Hinamatsuri - c028-032x1 (v06) [mix] [Norway Scan].zip
Hinamatsuri - c033-038 (v07) [mix] [Norway Scan].zip
Hinamatsuri - c039-043 (v08) [mix] [Various].zip
Hinamatsuri - c044-048 (v09) [mix] [Various].zip
Hinamatsuri - c049-053 (v10) [mix] [Various].zip
Hinamatsuri - c054-058 (v11) [mix] [Various].zip
Hinamatsuri - c059-063 (v12) [mix] [batoto] [anonymous].zip
Hinamatsuri - c064-069x1 (v13) [mix] [batoto] [Various].zip
Hinamatsuri - c070-074x1 (v14) [mix] [Multiple] [Various].zip
Hinamatsuri - c075 (NA) [mag] [MangaDex] [Croxx-Over].zip
Hinamatsuri - c076 (NA) [mag] [MangaDex] [Croxx-Over].zip

and the exact links to the files look like so
manga.madokami.al/Manga/H/HI/HINA/Hinamatsuri/Hinamatsuri - c001-005x1 (v01) [Various].zip
manga.madokami.al/Manga/H/HI/HINA/Hinamatsuri/Hinamatsuri - c006-010x1 (v02) [Various].zip
manga.madokami.al/Manga/H/HI/HINA/Hinamatsuri/Hinamatsuri - c009-010 (cmp) [No Group].zip
manga.madokami.al/Manga/H/HI/HINA/Hinamatsuri/Hinamatsuri - c011-016x2 (v03) [Various].zip
...

I suppose I just need a way to get all the zip files linked in the page

ICD-10 puts them all under the heading of Sutism spectrum disorder. F84.0

Tried to replicate tetris in java using swing. Suddenly brainlet. Played gaymes all day.

When you are talking about code how do you personally distinguish between = and == ?

facebook: i get it
google+: i get it
linkedin: i get it
...: i get them

two i just can't seem to get:
pinterest, snapchat

a programmer made these things. so asking you all: WTF?

well, they are wrong.
sorry, not sorry.
and who would be right?
an aspie who studies that shit or a non aspie who wants everyone to feel good

Context.
>x equals 5
>if x equals 5
>let be true if x = 5

man curl
man wget

= assignment
== equality

let user = faggot
if user == faggot
{GTFO}

thanks man!

Madokami has an FTP, use that

= assignment (oppressively racist, because of privileged and underprivileged types receiving different type(race) based things and treatments)
== equality (the only equitable choice, should always return true)
=== identity (oppressively meritocratic, identitarianism is basically nazism.)

== has two equal signs

both shall be equivalence predicates. first for identity equivalence, second for memory address/reference equivalence.

a := new string("123")
b := new string("123")

a = b ;; true
a == b ;; false


= as an assignment operator is madness.

Do you have some fun project ideas? A textboard is an obvious one and will probably teach me the basics as well as what libraries are available for web APIs and databases and stuff, but it's not particularly interesting from a data manipulation perspective.

Hey guys, I'm working on a C program that uses sockets, and I'm having some trouble with a struct that I receive form a socket (I want to 'transform' it to a string). My code is:
while(rrule != NULL) //while(rrule != NULL)
{
if(rrule->src_dst_addr == SRC)
strcpy(src_dst_addr, "src");
else if (rrule->src_dst_addr == DST)
strcpy(src_dst_addr, "dst");

if(rrule->src_dst_port == SRC)
strcpy(src_dst_port, "sport");
else if(rrule->src_dst_port == DST)
strcpy(src_dst_port, "dport");

printf("%d %s %s %d %s %d\n", index, src_dst_addr, inet_ntoa(rrule->addr),
rrule->mask, src_dst_port, rrule->port);

recv(sock, &rrule, sizeof(rrule), 0);
index++;
}

And for what I tell it gives me a seg. fault at:

if(rrule->src_dst_addr == SRC)
strcpy(src_dst_addr, "src");
else if (rrule->src_dst_addr == DST)
strcpy(src_dst_addr, "dst");

What the fuck I'm doing wrong? Thank you gentoos.

don't send the struct like that over the network that's retarded, just use protobuf like a functioning person

Gid gad mother fucking neckbeards and their fucking variable naming

= is a comparison
== doesn't exist
:= is assignment

When I'm talking about them, I use "assignment operator" and "equality operator".

How do I interrupt/kill a java thread without closing my program? System.exit(0) kills the program, and I don't want that

Well prolly src_dst_addr is pointing into the void idk. Or maybe rrule.

Wait wtf? provide the types of your shitvars pls.

if rrule can be NULL, then it must mean it is a pointer.
if you do recv(sock, &rrule, sizeof(rrule), 0), it must mean it's an array.
fix your shit

Thread.interrupt()

I don't know Java but have you tried reading the documentation? This seems like what you're looking for: docs.oracle.com/javase/7/docs/api/java/lang/Thread.html#interrupt()

See, that's exactly what I'm doing, but it's not working. It keeps telling me something about it not being able to be referenced from a nonstatic context, but the method that it's in isn't static.

'parently you should not rely on abruptly exiting the thread using this kind of operations but arrange for the thread to exit gracefully.
docs.oracle.com/javase/8/docs/technotes/guides/concurrency/threadPrimitiveDeprecation.html

Makes sense to me.

typedef struct FORWARD_rule{
struct in_addr addr;
unsigned short src_dst_addr;
unsigned short mask;
unsigned short src_dst_port;
unsigned short port;
}rule;

it's a non-static method in the Thread class, hence you must have a Thread object to call it on.

Thread.currentThread().interrupt()

But see docs.oracle.com/javase/8/docs/technotes/guides/concurrency/threadPrimitiveDeprecation.html

What about src_dst_addr (the variable not the field) and rrule?

rrule is a rule struct and src_dst_addr is a string (same with src_dst_port)

>rrule is a rule struct
why compare it to NULL then? You're not telling the whole story, show me

my absolute nigga

have a cute jap girl

Attached: antiporno.jpg (1920x1036, 382K)

In the quick start for valgrind, the example output lists file and line number for the errors. However when I run valgrind --leak-check=full ./a.out I don't get that luxury. What am I doing wrong?

As a self taught programmer looking for a job, should I show on my github a project with all the various random programming exercises out there? Aside from my personal projects.

Also how easy are entry level jobs?

I made a chat bot with an automatic betting system that works with a database pulling info from the web, would I be ready for entry level jobs?

Attached: 1524461408150.jpg (783x590, 82K)

anyone here current;y or have in the past been part of a startup that at least had some initial success?

a = b 󠇦 󠇦 󠇦 󠇦 󠇦 󠇦 󠇦 a equals b
a == b 󠇦 󠇦 󠇦 󠇦 󠇦 a is equal to b

GUI framework and imageboard client in C++. I love the madness.
Yes, but now we are getting taken over by a bigger company and the senior people jumped ship.

i like to think i'm pretty competent when it comes to learning new things, but for the fucking life of me I cannot grasp OOP. I understand a class is a "blueprint" used to create objects but I cannot fucking see the point of it. can someone give me a direct example of the "power" of OOP please.

Attached: 1491157309245.png (295x229, 92K)

Compile with -g

>Yes, but now we are getting taken over by a bigger company and the senior people jumped ship.
a few questions then:
1) how early/late were you in joining
2) what was your position? duties?
3) what was the compensation package?
4) how is the acquisition structured?
5) do you plan to stay?
6) what was you skillset, degrees, certs that got you hired?
7) regular wager, independent contractor, term, internship, etc...

1) 2 months prior
2) Tech support, docs, modifying peripheral systems
3) Decent for my country
4) The new owners own most of the stock. They basically had an argument with the last director and told him to fuck off in written form.
5) Probably not. A few months, maybe.
6) Dedicated autism and a recommendation from a professor.
7) independent contractor

day 1 of practicing programming..I skipped work because depression..now going to program for fifty hours and see if I like it..

Attached: 3ragx3q6dymz.jpg (784x643, 77K)

thanks for the insight

have some sexy

Attached: 1520884271070.jpg (360x480, 33K)

>modulo

Attached: 1511511379087.png (682x682, 495K)

There is no power, coding in C is like a restaurant, coding in C++ is a fast food. With C++ you take pajeets and they code you parts without knowing about the whole picture. That's the big picture. And even then C++ is way too much of a clusterfuck and Java is more popular. So, C++ is a fast food in the game dev world.

Don't post a mongrel brain pic while saying you don't understand OOP. It's not you being dense, it's OOP having no clear definition and being almost buzzword. (But yknow, being malleable is why it's so popular, and we 'tists don't understand that and stuff)

It's basically good design, but explained in a dogmatic enough way that mongrels do it sorta right. The main good design lesson in there I think is /program to an interface, not to an the implementation details/. That means you have your lil' mechanisms inside the class, but you only allow the rest of the code to communicate using the public methods. That way you can enforce invariants within the class without risking the rest of the code breaking it by accident, and if you're really crazy you can change the implementation of the class while not touching the rest of the code. Great!

On top of that you add what OOPtards call "polymorphism" (it's not according to FP masterrace) which is when some code manipulates objects thru a defined set of methods, an "interface", that is provided by many different classes at the same time. that way you can "reuse" that code on all of these classes.

Inheritance was originally in there but it's mostly deprecated.

Finally, it's less of a language feature than a way of structuring your shit so don't focus too much on how it's done in your current shitlang.

Class dismissed
(Get it?)

Nah if you have questions I'll stick around.

dumb frogposter this isn't r/eddit

Racket supports occurrence typing, but is relatively slow and does not have a decent to-js/to-wasm compiler.

Chicken has a lot of useful eggs, relatively fast and targets JS via spock, but doesn't have a type checker.

What should I do?

Attached: azusa-thinking.jpg (2560x1600, 185K)

compile racket to chicken then to js

dumb frogposter

Find a Lisp that compiles to C and compile that to WASM.

>when you are too basedish to call it remainder

Attached: 1524943736333.jpg (1280x960, 216K)

This user summed it up nicely. Ignore anyone who tells you OOP is about inheritance and complex class hierarchies.

I didn't post that Onions one..

Attached: 1524894328150.jpg (638x792, 61K)

dumb frogposter

good news that's chicken. The C produced by chicken is a bit unconventional so I'm not sure if an interpreter can run it well. Is wasm still interpreted?

No. Compiled to binary.

i did fren
no worries

Attached: 1519823618267.png (790x939, 369K)

don't pick on me..
im going to start programming despite being low iq..I want to try it at least..50 hours..got a thing of mtn dew and monster..I'm 26 yrs old never programmed..

Attached: 1522165254568.jpg (585x501, 41K)

equals, equals equals. Like a normal person.

Do you feel lucky fren?

Attached: 1519518534276.jpg (675x675, 68K)

Could still be bytecode. Is it compiled to native?

dumb frogposter

I guess..i might get fired idk..

ok..

Attached: 1522120765613.jpg (1024x962, 67K)

stupid frogposter

Compiled to bytecode by the dev and then compiled to native in the browser. Expect around x1.2 native speeds.

>i might get fired idk
why tho

Attached: 1477539588710.jpg (657x527, 63K)

._.

stupid frogposter

Attached: 1493174952729.png (924x560, 48K)

skipped work cuz depression..and crying baby kept me up for hours and screaming people and drunk..

Attached: 1520858568667.jpg (550x550, 32K)

dumb frogposter
dumb frogposter

I would have done the same

Attached: 1516137336482.png (1105x1053, 90K)

>tfw you didn't read the protocol specs properly so you implemented something that passes all unit tests but doesn't actually work

Attached: 1518892953731.png (784x645, 36K)

dumb frogposter

Attached: 1521919211429.png (225x225, 7K)

Attached: 1519537892007.png (658x545, 176K)

stupid frogposter

I can't believe people would actually pretend to be retarded

Thinking of taking a Compilers module for my final year of college. Sounds really interesting and fun.
What's it like to create compilers? Is it difficult?

dumb frogposter

Attached: 1519082812160.png (657x527, 169K)

Why is vim the best ide?
Hell, even with vim keybindings, it can't compare to the actual vim

opengl is confusing me. can someone tell me how I do this:
I have a vertexbuffer, an indexbuffer, a texture, and a buffer with uvs vor the vertices. how do I render that?

1. bind vertex buffer
2. vertex pointer
3. bind index buffer
4 ???
5. drawelements

Attached: 1520865632495.png (734x778, 90K)