/dpt/ - Daily Programming Thread:

Since I made this thread, everyone has to bear with my waifu.

So, what are you working on currently, what are the main challenges?
Is the compiler really always right?

Other urls found in this thread:

github.com/saolof/clj-minesweep/blob/master/minesweep.clj
codelle.com/blog/2016/5/embedding-pypy-in-a-c-application/
benchmarksgame.alioth.debian.org/u64q/compare.php?lang=clojure&lang2=python3
en.wikipedia.org/wiki/Meme
lysator.liu.se/c/bwk-on-pascal.html
patorjk.com/software/taag/#p=display&f=Graffiti&t=Type Something
visualize-your-git.herokuapp.com/
en.wikipedia.org/wiki/Duff's_device
blog.deepgram.com/how-to-get-a-job-in-deep-learning/
deeplearning.net/deep-learning-job-listings/
drive.google.com/open?id=0BygJV4MP6jP8NHJJZ0wtR3lMVzQ
twitter.com/SFWRedditImages

First question would be: is mastering Qt worth it?
The idea of a multi-platform design library, with testing functionality, is extremely appealing to me.

I want to make a bash script that does the following
>makes a .txt file with a random letter
>waits 1 hour
>deletes old .txt file
>makes a new .txt file with a random letter
>repeat
any help is appreciated

might as well set a timer and do it manually

in case you didnt see I posted in the last thread

oh thanks

/dpt/-chan, daisuki~

Ask your much beloved programming literate anything (IAMA)

Poor doggies

did they dieded?

Poor bulls.

Yep.

qt weights 32 fucking gigabyte :O

THICC

I chuckled

Does anyone remember that software that lets you draw on your commit history?

I eventually want to start developing games with C++, but in the meantime while I have all these ideas I want to implement and not enough C++ skills to implement them should I use Unity or Monogame?

What course would you guys pick for your first one?
I just want to get into the it field and then later on go into university.

Do you guys do anything while programming? I.e. listen to music, watch TV shows, watch streams, read chatrooms, that sorta thing? I need little distractions like that to help me from going mad when I'm doing programming work that doesn't take much concentration.

i masturbate to the code i am writing

...

Any of the above. I just take breaks whenever something is frustrating me a lot.

If you want to make games just use unity or game maker. If you want to make game engines / do graphics programming, learn C++, openGL etc.

best /dpt/ ever

all me

what c++ library or tool do I use for

1. GUI
2. testing
?

>I just take breaks
This is what I'm trying to avoid.

reported

I generally listen to music, streams are too distracting

well you can just listen to music. You obviously can't watch stuff while programming.

liar

B-But it's not allowed to tell us that desu

could be worse

I sometimes "watch" TV shows on my second monitor. Just slap on a couple of old episodes of friends or something else I don't care about paying close attention to.

Obviously I also check in on this thread every now and then.

moot was right about generals

Is object oriented programming really necessary?

What's wrong with just defining functions, instead of making a class with methods?

Do I need to just git gud or is OOP just abstraction for it's own sake?

The abstraction part of OOP isn't anything special. The encapsulation is what makes it worthwhile.

>is OOP just abstraction for it's own sake?
Kind of. But there's also a ton of extra features like inheritance that, when used sparingly and only where appropriate, enhance code clarity a lot. Basically it's easier to describe your intent through code only when you follow an OOP style. At least that has been my experience. It's not like you need OOP though, so use whatever you like.

I've been working on learning clojure lately, by doing a few small projects like a vanilla wow fishing bot, and a command line minesweep.

I'm not entirely sure if I am using "idiomatic" clojure though, here's my minesweep: github.com/saolof/clj-minesweep/blob/master/minesweep.clj

Feel free to criticize the horrible quality of my code. ^^

Inheritance doesn't improve code clarity at all. It's equivalent to adding an object of the inherited class as a field and then forwarding calls to its methods.

It actually makes code clarity worse IMO because you're suddenly pulling everything into the object's namespace instead of having it filed under the name of the field.

>Is object oriented programming really necessary?
No

Is Python good? Or only a meme?

It's okay for beginners. Not for real work.

I am reading a book on algorithms, and I'm already struggling immensely 30 pages in. I stare for hours at the screen trying to do the exercises and wrap my mind around seemingly simple stuff. I feel retarded for having such a hard time with this.

If you're looking for high performance then no however it's really good for general automation, quick hackjobs/tools and webdev backend as well as for plugins.

Yeah, it's great for anything crypto, math, or big-int related, and it's good for game logic. Not so good for rendering or anything that needs sped though. Then again, if you're using an interpreted language where you need speed, you're clearly too stupid to be programming.

Bait.

>it's good for game logic
Compared to Lua? Don't make me laugh.

whats a dpt approved exercise...

jump rope?

This isn't even the main issue of inheritance.
The main issue of inheritance is overriding.

>Compared to Lua?
Yeah, definitely compared to Lua. Your Roblox/Garry's Mod script impresses nobody, jake.

Yeah well you started on code clarity. The fragility of any code using inheritance is another big issue, for sure.

Give me something quick to make

No it's true. Dynamically typed langugaes are not suitable for real work.

Rule 1. The compiler is always right.

Rule 2. If the compiler for some reason happens to be wrong, see Rule 1.

A question: have you ever embedded both in a practical application? In my experience Lua is much better for that - multiple states, no GIL, much cleaner API, better documented.

Rule 3. The above rules do not apply for the MS compilers for C and C++.

I didn't start on code clarity, that was a different user.

Whatever.

>a meme
Programming languages aren't memes. Except for Javascript.

Python is good for small and/or focused things: odd jobs that need solving, automation of processes, math, and web stuff among others. Python is bad for anything really serious or larger than, say, Deluge.

Python doesn't replace, it supplements.

Does anyone here know of a way to use a PBKDF2 derived key to generate a public-private key pair with RSA in JavaScript? I can't find any libraries that do it for me.

I'm trying to reimplement what cryptico does but without all the lack of being maintained anymore and all-rights-reserved.

>Except for Javascript.
burned :^)

JavaScript is pretty good for client side web dev.

>multi-platform
qt outside of linux is dog shit

Shit-tier bait.
>embedded both in a practical application
I've embedded toy-versions of both in few a hobby applications, but there is no such thing as a 'practical application' which is also a videogame.

>but there is no such thing as a 'practical application' which is also a videogame.
This is your defense for Python over Lua? Holy shit, delusional.

Something like Chibi Scheme is much better to embed than Lua. If you're going to need to write a lot of stuff yourself, you might as well do it in a Lisp instead of a crippled scripting language.

OKAY CEEPLUSPLUSFAGGOT, YOU HAVE 3 SECONDS TO TELL ME IF THIS WILL COMPILE:
#include
int main(int argc, char **argv) {
std::vector v1, v2;
(argc > 1 ? v1 : v2).push_back(1);
return 0;
}

Not the same user, but my experience with embedding any Lisp/Scheme has been very negative.

Great opinion mate but we're discussing Python vs. Lua.

you cant have arguments for your main function, baka

Maybe

In c++, what's the difference between:
const Object &Deque::getFront() const


and
const Object Deque::getFront() const


What is the purpose of the address-of operator?
Also, what does the const mean at the front of the method signature? Why would the return type be labeled as const? What is the purpose of that?

@56732818
No (you) 4u

Rule 4. The MS compilers do not care about Rule 3. See also: Rule 2.

I don't understand what you mean by this. I just answered the question.

C++ is bad, but "I can write bad code in it" is not a reason to say a language is bad. You can write bad code in any language.

LISP is great if you want something that can be easily implemented but is also not shit, but did I just see an implication that it wasn't a scripting language?

I have Minecraft running 24/24.

>compsci student
>first programming course
>java
>start decent
>starts getting more and more involved
>slowly start hating it
>have assignment due monday
>instructions are wonky and don't know how to do it
>uni is like 1 1/2 or 2 hours away
>there and back around 3 or 4 hours
>programming in particular is a disaster to ask the teacher through e-mail
>look up java documentation to try and make an honest effort to advance assignment
>don't understand any of it
Hello darkness my old friend.

& applied to a type is a reference. Like a pointer but you're supposed to be able to rely on them always pointing to a valid object. The const signifies that the object is not to be mutated through the reference.

If someone says is good for game logic and game logic ONLY I'm going to safely assume that they mean to embed. Which Python sucks at. And every Lisp implementation I've tried.

First one returns a const reference, second one returns a const value and will therefore implicitly use a copy constructor or a move constructor.

tell us about the assignment, user. maybe we could help

Dynamically typed languages are perfectly suitable as long as your team mates aren't monkeys.

Sure you can.

Rule 5. You're autistic, wasting the post limit, and wasting time. If that's all you have to contribute to the thread, you may as well not post.

Sucks to suck lol

Meme languages:
Rust
Javascript
Ruby
Python
Java
C#
Pascal (lol)
Delphi (kek)
COBOL (good thing, it's dead now)
Fortran (do they still teach this trash to poor science students?)

Did I forget anything?

>Fucking vanilla
You're a programmer goddammit. Why the hell don't you have machines and computercraft installed? I made a mail system using CC, redstone logic, and ender chests, and some other things. Shit was fun.

No, they're useless. Literally no point in them existing at all, except maybe for beginners.

>If someone says is good for game logic and game logic ONLY
Good thing nobody said that.

you forgot all of the actual meme languages, i.e. esoteric programming laguages like bf, whitespace and all the jamming/golfing langs

You cant seriously list languages that are used around the world as industry standard (Jaava and Javascript) as meme languages.

You simply cannot.

Because that is, like, your opinion, man. Not much else.

codelle.com/blog/2016/5/embedding-pypy-in-a-c-application/

>everything I don't like or use is a meme

When will this meme end?

>>don't understand any of it
Hahahaha, turd.
Why do niglets that can't do a hello world always join CS?

Sure thing, Sancho Panza.

Lua is SHIT.

Does anybody know any good resources for learning audio programming? I want to make a audio visualizer

>[Python]'s good for game logic. Not so good for rendering or anything that needs sped though.
t. >dynamically linking is embedding

a first source is supposed to teach you, not to test your skills

FFT

How so?

1: it's a fact
2: nobody talked about lua either until , this post was just as offtopic as the other one.

Why is it that one dynamically typed language can be 50 times faster than another dynamically typed language?

benchmarksgame.alioth.debian.org/u64q/compare.php?lang=clojure&lang2=python3

totally depends on the run time. there can be a difference of 1000x if one language is interpreted and one is compiled.

>Because that is, like, your opinion, man
Nice meme

>You cant seriously list languages that are used around the world as industry standard (Jaava and Javascript) as meme languages.
It's commonly accepted that both Java and Javashit are shit languages. However Javascript is used way too much for memes like the web or nodejs by hipsters and Java is being forced on poor CS students and pajeets.
So yes, they are both memes.

>what is JIT compilation

>You're a programmer goddammit
I am not.

>Why the hell don't you have machines and computercraft installed?
I am against modifications, they denature the game and insult the game's creators.

Most statically typed languages as well are useless.

Natural languages are memes.

>not a programmer
>/dpt/
So you're just a shitposter?

It's been a while, but Lua is extremely straightforward when it comes to embedding and there's a lot of documentation on doing so.

Though I'm looking at the Chicken embedding API and it seems alright. I don't think I ever tried it for some reason. This was a while ago so maybe it's a new development?

I don't care about most langugaes. I care about good ones. All the langugaes that are any good for serious work and high productivity are statically typed.

Speaking of esoteric languages.
Which is the (on purpose) absolutely worst language to use in existence?
Like, Hello-World-takes-20-pages levels of ridiculous.

>computercraft
non-free (unlike opencomputers), small number of addons (unlike opencomputers), much inferior to opencomputers and doesn't support the last versions (unlike opencomputers)

Oh look, another C/Perl programmer shitting up the thread with opinions instead of talking about programming.

>Javascript
Works just fine for what it's supposed to do, and v8 makes it work damn fast for backend too.
>Ruby
The language's purpose is to be easy for humans to read and write, and it does that perfectly.
>Python
It's strict indentation rules force even the dumbest of pajeets to write at least semi-readable code. Great for team projects that require high-level abstraction.
>Pascal (lol)
I don't see how Pascal is a meme. It's readable, has a nice syntax, and has a pretty okay well-learned community. What issue could anyone have with Pascal?
>COBOL (good thing, it's dead now)
A language which is supposed to look like English, and ends up looking like English. It influenced a lot of the languages you use today, and for good reason. What's your issue with this?
>Fortran (do they still teach this trash to poor science students?)
It's really easy to teach math and science majors Fortran, because it basically works exactly how they'd expect it to. I have no idea what your issue is with it. It's fallen out of popularity because things like mathmatica have taken it's place, but Fortran is just fine.
>C#
It can't be a meme if nobody ever liked or used it.

That post says "it's great for anything crypto, math, or big-int related" which definitely don't seem like subsets of game logic to me.

You're autistic. Minecraft is shit.

Language != Implementation

Tell us if you still think that once you turn 18.

That's how i feel about mods. I thought i was the only one.

Although it's hard carry the insult to the creator argument when the game itself has inbuilt mod support.

For every language, there are millions of smartasses that call it shit on the internet. Nonetheless, thousands of hipster languages dies out, Java and JavaScript are still here to stay and required in most jobs.

>That post says "it's great for anything crypto, math, or big-int related" which definitely don't seem like subsets of game logic to me.
In the context of game programming, where EMBEDDING a scripting language is important.

Thanks for all the help, Cred Forums. You guys sure do know a lot about programming. :^)

Dunno. Ook and Whitespace are pretty annoying to work in.

Well I'm accustomed to it because I usually roll with Tekkit-like modpacks.

I've made my own modpacks before, but no one I know will use them, like it's extremely difficult to set up or dangerous or something.

Fucking autistic pansies.

Being able to decompile and replace parts of the program due to it being written in Java isn't exactly "built-in mod support". Unless you're not talking about Minecraft here. Which is ironic because Minecraft has basically ridden on the coattails of mods for most of its successful lifetime.

i really doubt many of you are actual programmers, if you are still having the java vs c++ vs the rest debate daily

no real programmer refuses to utilize whatever language seems suitable or is used in the current project

>In the context of game programming
I'm the guy who posted it. No, not in the context of game programming. That's not how the word 'and' works in English. "Salt is good for seasoning and preserving meats" does not mean "salt is good only for seasoning preserved meats".

I'm not contesting that Lua is better than Python for those things. I'm saying it's better for embedding in games. The quote
>[Python]'s good for game logic. Not so good for rendering or anything that needs sped though.
is clearly talking about embedding it in a game engine.

No really. Natural languages are literally memes. It's how they develop and spread.

en.wikipedia.org/wiki/Meme

Learn to punctuate and capitalize sentences and people will take you more seriously.
>no real programmer refuses to utilize whatever language seems suitable or is used in the current project

"No true Scotsman blah blah blah."
The center of the "Java and C++ are shit" opinion is that they don't seem suitable for anything.

Yeah, who cares about insulting the creator, the creator has no vision. Mods are the only reason MC is still slightly relevant.

>Works just fine for what it's supposed to do
It doesn't work fine for anything.

>It's strict indentation rules force even the dumbest of pajeets to write at least semi-readable code
It's 2017, can't people still not use automatic indention tools?

>What issue could anyone have with Pascal?
You can't seriously ask that.

>It influenced a lot of the languages you use today, and for good reason
Wrong.

>A language which is supposed to look like English, and ends up looking like English
More like looks like poo.


>I am against modifications, they denature the game and insult the game's creators.
Because the vanilla game by itself is shit.
Why are you against customisation?

But I didn't say it was "good for game logic and game logic ONLY", which you claimed I did. You're trying to shift the focus and reword what you've already posted now that you've realized it's stupid.

Premade modpacks are cancer

>whatever language seems suitable
They are not suitable for anything.

>used in the current project
Any project using them is shit.

The un-moddable version of Minecraft (Pocket Edition) has sold better than the normal version. That's a recent phenomenon, though. It would have never done well enough on PC without the potential for mods to fix everything, and it would have never gotten the fame to also make it big on consoles and mobile.

I'm a spaniard so it will be a rough translation of the instructions.
>Design and implement a program that handles the shipping process of three types of vehicles: land, air and water
>each vehicle has a name, licence plate, max speed, max weight load, cost per ton for a Km, tank capacity and tank usage per Km
We were given the data for them.
>This data should be loaded from an external file, like a .txt for instance
>Use three classes: Controller, visualizer and modeler
>the program should allow you to create any vehicle you want and display its data
>allows the user to set a distance and a load. All transports are usable, but recommend the one with the lowest price and the fastest
>for each vehicle created report how much time they will take to move a load in tons. For air and water vehicles they have to manage the landing gear deployment and hull water load respectively, each taking an extra hour both ways
>any vehicle can complete a load heavier than its max, given it makes several trips
>display the cost of the user-defined load
>every vehicle has a speed/load ratio; for each 10% of used load capacity the speed drops by 4%

I might be missing some things but that's the basic gist of it.
I don't understand if it's supposed to be like a tool or a simulation, it's like it wants to be both but it's neither. The landing gear and water weight shit is just there to make it more convoluted than it needs to be.

In the context of games. That was my intent from the start but I didn't make it clear.

>Because the vanilla game by itself is shit.
Please don't say that. Minecraft is one the greatest game ever.

Guyse, does it make sense to go for a Data Science degree?

One is usually well advised to stay away from rare, fancy sounding degrees. But I really think this one has potential, instead of becoming the one million and first CS master on my street.

N0t_G4b3n? Is that you?

>>Works just fine for what it's supposed to do
>It doesn't work fine for anything.
Not a counter argument. It works great for front-end webdev and it's the only OOP language that does OOP well.
>>It's strict indentation rules force even the dumbest of pajeets to write at least semi-readable code
>It's 2017, can't people still not use automatic indention tools?
I clearly said "dumbest of pajeets". Can you not read Pajeet?
>>What issue could anyone have with Pascal?
>You can't seriously ask that.
Not a counter argument. Tell me the issue you have with it.
>>It influenced a lot of the languages you use today, and for good reason
>Wrong.
Not a counter argument. Tell me the languages you use that aren't influenced by COBOL.
>>A language which is supposed to look like English, and ends up looking like English
>More like looks like poo.
Not a counter argument. This is an 18 and up website.

>Any project using them is shit.
>80% of the software project industry are utter shit. For only the languages I personally recommend are not.

Alright, I'll propose you did mean that, since I can't prove you didn't.

LISP is insanely easy to embed, and Python is just as easy to embed as Lua. "It sucks" is not a real argument.

I was speaking in general. But iirc, minecraft does have a mod selector in the main menu.

Must developers tend to like mods though. It's free labor making content for your game and increasing the games lifespan, while at the same time maintaining plausible deniability if something breaks. "Nope. Not my fault."

>un-moddable
ModPE is a thing and an official "modding API" is up to be announced for it in tw odays.

>It works great for front-end webdev
And webdev happens to be trash.

>I clearly said "dumbest of pajeets".
Yes, and? How is this relevant? Nobody gives a shit about pajeets except than the people that work with them.
If you work with pajeets and you are not a pajeet then you can easily use an indention tool. Are you dense?

>Not a counter argument. Tell me the issue you have with it.
lysator.liu.se/c/bwk-on-pascal.html

>Tell me the languages you use that aren't influenced by COBOL.
Scheme, C, Haskell, etc

>Not a counter argument.
Have you ever actually used it? Every cobol program looks like someone puked in his food.

>insult the game's creators.
In Minecraft's case, the game creators cooperate with both the largest modding API (Forge) and the largest modpack group (Feed the Beast), in addition to all the current developers having been hired from either the largest plugin API (Bukkit) or from the only decompilation suite (MCP).

Effectively, everyone involved in the game since 1.0, bar Jeb who is now only involved with game design, is both a modder and cooperating with modders. They've even contracted out a modder (DrZhark - Mo' Creatures) to help develop horses for 1.6.

>80% of the software project industry are utter shit.
Actually 100% of the software project industry are utter shit. Only some free software suck less.

Which Lisp? And Python may be as easy to embed but that's not the only important thing. Python is more bloated and less efficient, despite being less flexible. Lua is extremely simple yet malleable.

It's got a couple shitty decisions like indexing starting from 1 but that's not that egregious.

Opencomputers is awesome. Especially comutronics that allows you to record tapes and play them.
I made Routing, basic IP+ICMP and basic tools for network diagnosis.

Is there some alternative to Qt, if I want to make GUIs on C++? A more light-weight one?

And the 1-indexing is purely a library convention, has nothing to do with the language itself. Considering the language doesn't actually have arrays, only tables.

indexing starting at 1 is correct. array[1] should give the first object at the first position. there no such thing as the 0th object of the 0th position. don't confuse array indexing with pointer arithmetic (c has the later, not the first).

You are a turd!

[word]
Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook? Ook! Ook! Ook? Ook! Ook? Ook.
Ook! Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook?
Ook! Ook! Ook? Ook! Ook? Ook. Ook. Ook. Ook! Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook. Ook! Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook! Ook. Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook? Ook! Ook! Ook? Ook! Ook? Ook. Ook! Ook.
Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook? Ook! Ook! Ook? Ook! Ook? Ook. Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook.
Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook! Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook! Ook. Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook.
Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook!
Ook! Ook. Ook. Ook? Ook. Ook? Ook. Ook. Ook! Ook.
[/word]

Can someone tell me what task 08 even means

Comutronics is one of the few mods that I can't live without nowadays.

Hey fellas, I need your advice. No experience with programming whatsoever but I've always been interested.

In my job I have to jot down a lot of shit on a notepad and then transfer everything to a computer.

I wanna make a program that's just data entrying and saving automatically into a spread sheet or text document. A simple gui with boxes to fill.

What program would be better for this? This is just for ease of use on my part so the simplest and fastest the better.

At work we use sites with Oracle databases. Should I look into that and try to make something similar? I've really have no clue but im eager to learn, so yeah shoot.

but why

something like this I think
patorjk.com/software/taag/#p=display&f=Graffiti&t=Type Something

making a script that does 24 git commits a day

visualize-your-git.herokuapp.com/ ?

>Comutronics
It's Computronics.

Vexatos?

Thanks, looks pretty interesting
Going to steal some font from the website though since doing one myself would take too much autism

That wasn't me.

we all use git here

void duff(char* to, char* from, short count)
{
char n = (count + 7) / 8;
switch(count % 8) {
case 0: do { *to++ = *from++;
case 7: *to++ = *from++;
case 6: *to++ = *from++;
case 5: *to++ = *from++;
case 4: *to++ = *from++;
case 3: *to++ = *from++;
case 2: *to++ = *from++;
case 1: *to++ = *from++;
} while(--n > 0);
}
}


black magic like this is why I love C and C++
Even if it's not useful, being able to do these crazy things is fun.

It's not black magic.
and it was useful in the past.

>in the past
yeah I know, but that's not what I meant

Wtf is going on here?

What does "super" do in Java? I've seen it spread on some code but I don't really understand what it's doing.

en.wikipedia.org/wiki/Duff's_device

tldr it's a unrolled loop

Refers to the class the class inherited from, same way the this keyword refers to the class itself

I gets reference to base object, just like ((Base)this)
You can use it to call original version of methods that you overwrote.

Duff's device. Loop unrolled memcpy. The do while loop is your typical unrolled loop copy, and the switch is used to jump into the loop the amount of the remainder of the unrolling. i.e. if you were copying 53 bytes you would run the 8-unrolled loop 6 times (n in this code), and copy the extra 5 bytes by jumping 8-(lengfth%8) copy statements into the loop using the switch.

Trying to find out how you would implement a "pure" exit function in c++, one that throws no exceptions, just terminates the program, however unsafe that may be. If anyone has any thoughts, clue me in.

*(int *)0 = 1;

Raise SIGABRT.

>no link to the old thread
you useless piece of shit

how about abort()

Ok, I'll bite.

I'm thinking youll be getting some input data about what the customer wants, and based on that you have to performa calculations and give the reccomdendation on which service they should use.

As for the implementation itself, its basic OO stuff. Just make sure you follow the guidelines and it should be ok.

The data might be easier to fetch from a database than a txt file, but if thats out of the option, consider usin JSON or xml to organize it properly.

Interesting.

But how is the loop unrolled if you still rely on a do-while loop?

no one reads the old ones anyways idiot

>"pure" exit function in c++
what is that even supposed to mean?

Because it check the condition 8 times fewer.

It's platform dependent, the kernel manages processes and you need to ask it, typically in the form of a syscall.

??? You can't unroll the entire loop without knowledge of the length at compile time. So unrolling just makes the branching happen only 1/(amount of unrolling) copy steps.

Thank you for using a Lavren image.

rollin

You could fully unroll it. But then you'd have a function with >30k lines of code

You can. Just make a switch with case for every possible value of counter.

Hasklelfag detected.

posix _exit()

>SIZE_T_MAX cases
wew lad. You certainly could if you could prove

I thought about writing a game like this. You have a limited number of frames to finish the game, after which the game shuts down.

>SIZE_T_MAX cases
not necessarily enough:
for (double d = std::numeric_limits::min(); d < std::numeric_limits::max(); d += std::numeric_limits::epsilon() )
{ ... }

just found out about telnet, is it illegal to try to telnet into every ip i can find on google?

ow

·ßÌÌÈß·ß¾

You'll probably end up raising a bunch of alarms on different systems if you try that, so I'd advise you not do it

lol my secret code looks a canadian pop star

anyone can crack it?

You all know strtoul(), don't you?

Well, it turns out that strtoul has some interesting
strategy of return values.

For example, for negative values, it does not return
0 or ULONG_MAX and set errno correctly, no, it
returns the value of the string, which is then
converted to unsigned long, which of course never
causes any underflow problems. I mean, is this justified
in any way? Is this, like, good and normal?
See this gdb session:

(gdb) p strtoul("-10", 0x0, 10)
$1 = -10


What is that even?

>googling IPs
>not torrenting a complete list

Why the fuck would the length of an array be stored as a double?

Nobody cares you RPing fuck

>·ßÌÌÈß·ß¾
nevermind, missing character sets, it isnt anything

That's UB my dude. strtoul should return ULONG_MAX and set errno to ERANGE.

port scanning is illegal.

Well actually it's probably an optimization. The compiler runs strtol and then keeps it as an unsigned. Which is completely wrong. It's probably a bug.

Let's write a bug report to glibc then!

Bye.

>Python
>high-level abstractions
your shit language doesn't even have monads, fuck off

Sounds about right, yeah.

What I'm having trouble with mostly is handling variables between classes, and which methods go in which class. I forgot actually, we have to use five classes: Controller, Visualizer, (generic) Vehicle, Water, Air and Land. The latter three extend Vehicle, which I don't really know how to make use of.
I might be getting it wrong but I think the idea is something along the lines of
>make user choose first what to do (call visualizer with Swing components)
>take user's variables depending on what they chose
>send variables to Vehicle to be processed (I think it's here where all the calculations happen?)
>depending on the type they chose call methods in one of the three type's classes as needed (say they chose a plane, so Air has methods for landing gear and such, and return maybe a boolean denoting the is/isn't deployed, as well as setting and getting that boolean)
>Vehicle finishes calculations and sends result back to Controller
>Controller calls Visualizer again to display results

Mind you, I'm trying to prove in some way that I'm not attempting to get my homework done by people on the internet so I'm sharing more or less the ideas I have.
Like I said, the bigger problems are I'm having trouble sending variables across classes and determining where methods belong on, and I think with how I planned it the Land class seems pretty useless.
Also, for the sake of simplicity we were recommended to use a txt file, but the assignment just says "the vehicle data comes from an external file". We had a very quick overview in class about files since they're not even part of the program and are not evaluated by themselves, but for some reason we're required to use them anyway.
Consider that we've had to cramp down all this theory and practice in just a little over one month and a half, so you know, it can get overwhelming real fast. I'm still having so much trouble with parameters it's not even funny.

try embedding Guile, it's piss easy

Double cannot possibly have more cases than 64bit unsigned integer.

have private internal variables, then use public getters and setters which let you safely get the variables and perform validation on setting them

public class myGayClass
{
private int x;
public int getX(void)
{
return x;
}

public void setX(int y)
{
if (isValid(y))
{
x = y;
}
}
}


Something like that

inb4 Cred Forums fucks the formatting cause I wrote it in quick reply

sizeof char

>doesn't even have monads
You can use monads in Python. Are you complaining that the standard library doesn't, or that there isn't syntactic sugar for it?

Because you don't end up writing a program that embeds Scheme, you end up writing a Guile program.

After reviewing the man-page, I think it is a misdesign
(also, musl does it the same way). In the man-page it says

> The strtoul() function returns either the result of the conversion or,
> if there was a leading minus sign, the negation of the result of the
> conversion represented as an unsigned value, unless the original
> (nonnegated) value would overflow; in the latter case, strtoul() returns
> ULONG_MAX and sets errno to ERANGE.

Either that or this description is as misleading as I think.

>high level abstraction
>no types

That must be a GNU extension.
>

Upon successful completion, these functions shall return the converted value, if any. If no conversion could be performed, 0 shall be returned [CX] [Option Start] and errno may be set to [EINVAL]. [Option End] If the correct value is outside the range of representable values, {ULONG_MAX} or {ULLONG_MAX} shall be returned and errno set to [ERANGE].
From OpenGroup docs.

C# + WPF. Be aware though, WPF learning curve is kinda step.

all of the above

Hi nv :3
Are you a university student?

Windows Forms is more than sufficient for what he's doing.

creepy

I want to know everything about my future boyfriend.

>boy

>friend

Also can't stream video to an audience of ~80 people.

Pfft, your shit language doesn't have users.

Lua is optimised in favour of 1-based arrays, and the length operator checks from 1 to the last in a run of non-nil values. While you can opt for 0-based, doing so will bite you in the arse.

just testing something
#include

int
main (int argc, char **argv) {
for (int i=0; i

I will be the girl.

Hi, I think I know why your code wont compile, you misspelt 'studio' in your include.

Teaching Ruby to my stepdaughter.

this

If Ruby makes programmers gay, will make girls more feminine?

I see how this is exploitable. Someone could set argc to INT_MAX and cause a segfault.

it would, if girls programmed

They do, they just have Y chromosomes

Sorry, I just came in to ask you why it was you don't use EXIT_SUCCESS, rather than 0? I find the former to be much more readable.

But -1 is less than 0 and `i` is signed so the loop won't even run, thus causing no damage at all.

>ADVICE PLEASE

I'm 21, A grades in STEM. Self taught Java.

I need money. How do I do this?

I'm thinking about making a bunch of different things, currently working on Android games and an alternative to iTunes.
If I can make money doing this then great.
If not, I'll use it as a portfolio to try and get a job.

Advice?

I need £8 / $10 a day to live, which means 10,000 ad impressions/day. Far from impossible, but I currently have 0.

>I need money. How do I do this?

>it's another NEETpost

There's got to be a semi-guaranteed way to make money programming that doesn't require full time employment.

Well yeah, you could always make the next SpySheriff.

do you guys recommend any spider APIs for python?

Get a job

>so the loop won't even run
Wrong

You are a tard.

Both are correct.

which programming language should i learn that isn't python?
python seems like a bitch language. i need a langauge that says im hardcore. i only want to learn it so that i can tell people i know it.

Ruby.

Some ideas:
Make malware that targets old people
Find someone who has a "really good idea" and is looking for a programmer and try to scam them for money
Make the next big thing
Solve some or all of the millennium problems
Write the definitive book on some subject
Make the next next big thing
Implement Busco Quadnary
Learn Ruby

There are 0 jobs for java that do not require a degree and several years experience.

The only jobs in programming (where I live anyway) are CSS, HTML and JS, which I can do, but I've reached the limit of how much I can learn, so I'll get bored and quit in a month.
Or SQL and C#, which looks boring as fuck.

Is it very unlikely to be able to make money solo? A job is the only way?

go, F#, prolog, matlab

Make a game in Malbolge.

>F#
>Prolog
Why?

not willing to move?

>make the next big thing
this is unironically my plan
>make the next next big thing
it's currently in the conceptual stage

>Wrong

#include

int
main (int argc, char **argv) {

for (int i=0; i

F# is a Meme langage, but it's amazing.

I am. But the only place I can realistically move to doesn't look much more promising. I'd also only be able to move in ~10 months.

thanks for sharing

F# is a shitty ocaml

how so

b-buh muh dotnet

You basically have to reimplement figlet/toilet wait fuck that's 084

For 08 you need to output the ASCII or Unicode number for each character in a string

Also why haven't you done 085 yet you clearly aren't having enough fun

>no multicore support
lel.

Having well supported access to the entire .NET ecosystem and being able to run on every .NET platform is pretty comfy.

Lojban

.NET is shit, ocaml is very portable, ocaml DOES do multicore

no problem
I'm new to the whole Internet thing how hard would that be?
Also currently working on pic related, pretty fun too

kek

you should use actual intellij.
also a monospaced font

You can't most of the time, because argv's elements are allocated on the stack, which will overflow before even reaching main.

I used IntelliJ for a while, didnt like the Keybinds and that it doesnt automatically show the javadoc like netbeans. Its codecompletion is very nice though
Don't like looking at monospaced fonts either, but if you have a recommendation I will try it

>Java
That would explain why you've done the 15 puzzle and the snake game.

For IRC, a decent reference for getting started is RFC 1459, although it's rather outdated, but it should get you started.

Hexchat is a decent client for general IRC use.

Can't really recommend a good channel at this stage though, but IIRC FreeNode at least used to have a bot channel.

On the wire, from the client side, a typical IRC session looks something like this:

NICK Da_BeSt
USER dabest * * :Webchat user
JOIN #help
PRIVMSG #help :hello?
QUIT :Webchat page closed


The messages from the server are in a different form, something like:

:[email protected] PRIVMSG #help :hello?


I tend to wait for the 001 message from the server before joining a channel.

>also a monospaced font
This very much... how the hell did I not spot that? DO NOT USE PROPORTIONAL FONTS FOR CODE

Currently I'm trying to make a program which would make a university schedule for me. And I'm not talking about a graphic program which would show me my classes. The thing is on my university we have to sign for classes by ourselves, and there is a whole lotta combinations and i want my computer to find one, that has least breaks during classes

DejaVu Sans Mono

I mean you can change the keybinds on intelliJ.
monospaced fonts aren't supposed to be beautiful, they're supposed to be legible, so you can tell the difference between 0Oo, ILli, stuff like that.

i haven't touched a full-on ide in some years. are the intellij guys still way out in front?

yes, intelliJ is the best IDE

Anyone ever fuck around with Elm?

I'm enjoying it was more than shit-tier javascript, and it's super fast compared to pretty much all frontend frameworks, but it feels like a lot of explicitness :/

intelliJ is the thing that suggests the rest of your code for you?

blog.deepgram.com/how-to-get-a-job-in-deep-learning/

time to stop being neets

>Anyone ever fuck
>I'm enjoying it was more than shit
You should tone down your explicitness before you criticise

Meh Monospaced still gives me eyecancer
My font hasnt caused me any issues so far anyway
>That would explain why you've done the 15 puzzle and the snake game
? I did the 15 Puzzle because I'm doing the list in order and the snake game because it was the final project of the mooc I took
The Pong game was my personal project though

I AIN'T YELLING, THIS JUST THE WAY I TALK

> enjoying it was more
enjoying it way more*

get cancer

But then you can't align shit properly.

Also, this:

_ _ _ _
_ __ _ __ ___ _ __ ___ _ __| |_(_) ___ _ __ __ _| | (_)___
| '_ \| '__/ _ \| '_ \ / _ \| '__| __| |/ _ \| '_ \ / _` | | | / __|
| |_) | | | (_) | |_) | (_) | | | |_| | (_) | | | | (_| | | | \__ \
| .__/|_| \___/| .__/ \___/|_| \__|_|\___/|_| |_|\__,_|_| |_|___/
|_| |_|
__ __ _
/ _| ___ _ __ / _| __ _ __ _ __ _ ___ | |_ ___
| |_ / _ \| '__| | |_ / _` |/ _` |/ _` |/ _ \| __/ __|
| _| (_) | | | _| (_| | (_| | (_| | (_) | |_\__ \
|_| \___/|_| |_| \__,_|\__, |\__, |\___/ \__|___/
|___/ |___/

qt. cmake tests

But user, aren't you the one who can't align?

I was demonstrating what happens when you use a proportional font.

stripping whitespace doesn't help either i guess

but i think a good point is that you'll spend a lot of time in the command line and there a fixed-width font is a must, so you may as well be consistent

>3 hours round trip
leave at six in the morning.

when you aren't in class, go to the library.

even if you don't have something to study, find something to study.
walk around the computer science section and pick a book, sit down and read. teach yourself the next step ahead in your math course. hell, read the annual soil report in the balkans from the year 1998.

leave, go home sleep, wake up, come back.

if you can't do this then cut back on how much you do until you find what works for you, then you probably aren't gonna get the computer science degree.

>falling for the study meme

Can I learn programming if I can't speak English?

It will be very painful.

Yes but it will be hard to find resources for it past the basics

For you.

It is recommended to know english since the majority of good resources about programming is in this language.
I barely can speak English desu, I don't practice very often nor have people to talk using the enligish language, but if you can read it you gonna be fine.
kek'd

A beginner's guide to algorithms? 99% of the books are impossible for me to understand

Not an active member of /dpt/... in how much shit can I get if I ask for feedback on a code, that is posted on my main account on github, here?
I've been experimenting with a language I'm not familiar, and would want tips on what to improve. All my code is shit-tier, is anybody going waste their time to shit all over my repositories?

I've posted mine before and a few anons gave me feedback one even made a pull request fixing a bug I had

everyone will call you a faggot

do it

You will probably be called a Pajeet but nothing worse

Seems friendly enough, I might post it when I finally get it done.

yes senpai

redpill me on deep learning

i have a research internship with a professor that's to work on a machine that can recognize lung cancer from slides, and now i'm a little spooked since i talked to a girl who said she knew the guy who did it last summer and he got very little help. this will also be my senior honors project

i'm scared

>deep learning
I think it's just a buzzword for machine learning performed with neural networks.

i surmise it'd be helpful for me to take the machine learning elective this spring then?

>redpill me on deep learning
If you get a job in deep learning, you are literally a teacher
And you know what they say about teachers

Those who cannot do, teach...

Except this somewhat breaks down at the university level, because professors are expected both to generate research and to teach. If you get a job teaching deep learning, you're probably also contributing to research on it... even if that research has little to no applications yet in commerce/industry.

>And you know what they say about teachers

Was that supposed to happen?

deeplearning.net/deep-learning-job-listings/

Stupid frogposter

yeah, and probably a course on AI, though AI courses overlap with machine learning so if they don't offer AI the machine learning course likely IS the AI course. Maybe a data science course too.

Not a highschool teacher though. Likely R&D at IBM or doing gucci research at a Uni.

Someone needs to make a new thread

what about big data? is all of this stuff going to need statistics? because i hated statistics classes

this is the last one

stop this meme

drive.google.com/open?id=0BygJV4MP6jP8NHJJZ0wtR3lMVzQ

or audio programming on mit press

Family, EVERYTHING needs statistics. Additionally, machine learning IS statistics.

New thread:
Here you go, fag.

but why

what is ubuntu equivalent of "start java "?