/dpt/ - Java Edition

How are you lads doing? What are you doing? What anime are you watching?

Other urls found in this thread:

a.pomf.cat/eqozbe.mp3
twitter.com/NSFWRedditVideo

to be fair
tests that require you to literally just write down code in pencil are fucking stupid and don't actually show anything.

God damn, I thought that shit would be outlawed by now. fucking 70s coding test that was a bad idea even then

Idk in one of my CS classes, we had pen and paper tests. But the questions were on finding errors in implementations of algorithms. I think in that case its fine. But not when you have to implement an entire function.

Why in the living fuck would someone write what should be a single return statement as that mess? What motivates this kind of madness?

ok lads, let's have a contest

We all write a simple painter program. Add as many features as you like
Then we rate each other's.

idk ask whoever wrote it to be a joke

Teachers that whip poor 13 year olds into believing there is only one way to do something. That pic is the American education system in a nutshell.

>>WRONG TIMMY I TOLD YOU TO MAKE A PRIVATE METHOD
>>D- FOR YOU SEE ME AFTER CLASS

I don't know how my peers with ZERO internship experience and empty githubs were able to land 60k + jobs straight out, but I can't even get a interview, not even a fucking phone call and I've been trying for months.
If I don't have a full time position as a developer by Feb next year I'm seriously going to hang myself.

Maybe they had friends?

Don't worry, no charge for them

literally what are you saying
how does that picture have anything to do with that
if anything its the opposite of that
its an extremely intuitive (and less efficient) way of doing something

Did you even look at the code example? They have a clear lack of understanding of what the fuck they are doing.

Is there something like a workbook for algorithms?
Collections like project euler and similar are cool and all, but the tasks there are too random for efficient learning; It's like learning math from a math workbook by picking assignments at random from the whole book.
I'm looking for a book with problems selected by their common theme and on various level of difficulty, from easy introductory problems to harder ones, just like in a math workbook.
Is there anything like that?

"Cracking The Coding Interview" is pretty standard. Might be what you're looking for. It's purpose is for helping CS students prepare for technical interviews, but it might work for your purpose too.

is this some UW bullshit or is it just me

okay! @_@

I wouldn't be surprised if this kid went on and was able to land a six figure job straight out because his uncle's best friend is a manager or something for a company.
and yet I CAN'T GET A GODDAMN JOB. FUCK I WASTED THE LAST FOUR YEARS!

>tfw in college for cs right now

It really doesn't matter to me. If I get a job or not either way I'll be fucking miserable and I'm not the type who values high salary and have low standard of living

I'm basically just floating through. I'm the worst coder in the program

can we not have 2 threads called /dpt/? the fuck is even the point of this one?

thanks, I'll look into it

if someone can't program simple shit on paper how would you know they can program anything decently on a computer? My colleagues hate writing code on paper but to fully understand code the best way is to write it on paper so you actually have to think what you're trying to accomplish.


That op is further evidence of ppl trying to bullshit their way through

I'm working in Javascript, but w/e.
Probably Becca's or the other dyke's name.

Is Chicken Scheme IEEE compliant?

>tfw have to maintain code written by a scientist
Holy shit and you guys thought webdevs were bad

nigga, you'll be required to write code on a whiteboard in an interview

I'm not sure I have the triangle filling skills for this

It's probably your personality.

I am doing a project for class where The user types in a number at it will generate 10 random numbers between the number given and 100 and tell if it is divisible by the number inputed. I got it to work but the user enters a number greater then 15 and less then 1 there should be an error message. IDK how to do this. Please help. I think I'm suppose to use a return.

function printRandomNums() {

var number = parseInt(document.getElementById("number").value);
var randomNums = 0;
var msg = "";


if(number > 15 || number < 1) {
return msg += " Error" + "";
}else {

msg += "You entered " + number + "";
for(var count = 1; count

The return will return the value from the function and then you have to do something with it. You either have to call the function and write out the result in both branches or use innerHTML thingie on the first one as well instead of the return.

With the numbers egg I think it might be.

Or at least (/ 0.0 0.0) with the numbers egg returns the correct IEEE value of nan.

Captcha: pkwy miranda. Is this Google telling me I need to learn Haskell?

>that shit got 10 points
that's absurdly generous

Ok, so how will that look like on code.

complex numbers return that too
why

Using the function

void swap_array(int** a, int** b) {
int* temp = *a;
*a = *b;
*b = temp;
}


Why does this work

int * a = malloc(sizeof(int)*3);
a[0] = 1;
a[1] = 2;
a[2] = 3;

int* b = malloc(sizeof(int)*3);
b[0] = 4;
b[1] = 5;
b[2] = 6;

swap_array(&a, &b); // a = {4,5,6}, b = {1,2,3}


but this wont

int a[] = {1,2,3};
int b[] = {4,5,6};
swap_array(&a, &b); // a = {1,2,6} b = {4,5,3}


Isn't an array in C just a pointer?

it's been a while since i've done C but im pretty sure you still need to initialize the array size on the bottom

swap_array((int **) a, (int **) b);

The compiler will figure it out.

#;2> (/ 0+0.0i 0+0.0i)
+nan.0
#;4> (/ 0+1.0i 0.0+0.0i)
+nan.0+nan.0i

Huh? makes sense to me user.

Can I get some simple project ideas? Preferably something that will take me no more than a week and I can put on a resume

chip8 emulator

Wolfenstein 3d style raycaster.

>worst coder in the program
Congrats, you'll be our boss one day. Not even joking -- the people who can't code their way out of a wet paper bag, but still understand the process usually end up in management positions. Start studying DevOps stuff and talking to your professors about that route, you may be pleasently surprised by what you can do.

>land a 2nd round "technical" interview
>they ask me to write how I would "reverse a string" on the whiteboard, reversing a string or something, they didn't mention a language
>interviewer gets this incredibly smug grin on his face when i sit back down
>"what are you smiling about?"
>"your code doesn't work"
>"what are you talking about, you have a computer? we could run it right now"
>"no that won't be necessary, your code wouldn't work even if you ran it on the computer, you wanna know why??"
>have a vague feeling he's going to mention semicolons or something stupid, so I say nothing
>"notice how your code has no semicolons, it won't compile, i'm afraid"
>"you didn't ask for compile-able code", you didn't ask for a language either"
>"yeah well you got it wrong, next question--"
Needless to say, I got a rejection email a week later.

What would be a better solution for this?

>(sqrt -9)
+nan.0

what

>What would be a better solution for this?
a working solution

>being upset about getting a rejection letter from a company with a clearly toxic workplace
dude you should be happy as fuck, you dodged a bullet there. I would've walked the fuck out without saying another word after seeing that kind of attitude from the higher ups.

Have you guys ever thought to yourself, "You know, I'd like a language with syntax like Ruby's, but an easy ability to segfault"?

Look no further than Crystal.
# Delete default signal handler
Signal::SEGV.reset

# Casually dereference NULL
puts Pointer(UInt64).null.value

>reposting bait

How the fuck do people manage to write entire backends in pure javascript?

Probably something like

public String toString()
{
n = firstNode;
s = n.data.toString();
while (n.next != null)
{
n = n.next;
s += " " + n.data.toString();
}
return s;
}

It's using info from other problems too so I dunno

They just require("express") and shit out garbage.

cya

the real question is how to properly conjugate "verb" and "vomit"
java is hell to english speakers, i can only imagine the torment all those indian coders must experience trying to read this nonsense

#;5> (sqrt -9)
0.0+3.0i
Works on my machine.

You're using chicken and you did (use numbers) right?

>Crystal is statically type checked
>Crystal has built-in type inference
>def & end

What a weird language.

Does POSIX shell have limits on length of variable strings?
I figured out how to simulate arrays of strings by concatenating them into a newline delimited string and then piping it through some sed calls to split the string and get a specific array member (aka print a specific line number).

Found the problem, thanks!

Ada and Pascal both have "end". It's not that weird.

Both of which are ancient and pretty much ded languages

>Isn't an array in C just a pointer?
not in every case

Not afaik but maybe. What shell? Can you post some demo code that runs into that limit?

>swap_array(&a, &b);
This shit dont compile right?

The second one I mean

Theme of /dpt/:

a.pomf.cat/eqozbe.mp3

>scheme
>(cdr '()) => undefined
lmao

I graduated with a 3.9 GPA in CS in the spring and I still don't have a job. I have 3 decently written, substantial projects on GitHub that I wrote in my free time. I live in the US. I can't even land an interview. It seems like I'm not good enough. I write C++ but I'm certain I could do any language they wanted. I carry my head high. I'm not very attractive, but I refuse to blame that. I dress well. I don't know what to do. I can't just work a shit job because I have 80k in loans due in 4 years. I can't work at Best Buy or a computer store because I don't know shit about IT. I know which algorithms to use in which situations, I've implemented every god damn data structure on Wikipedia, and I even know the stupid development frameworks and design patterns they want us to know. I hate this.

Uggos don't interview well, I hope you realize that.

I was able to compile it on both Windows and Linux using gcc 5.3.0 with no other flags

>don't actually show anything.
It shows you actually understand what you are doing, and don't just mash the keyboard until the compuler swalows it

Yeah, I do.

>I can't work at Best Buy or a computer store because I don't know shit about IT.
How are you in CS but don't feel qualified to work a geek squad desk?

link your github

>he fell for the college meme
>he paid 80 THOUSAND DOLLARS for a programming degree

DEFINITION BlockCiphers;

(* abstraction for the use of block ciphers *)

IMPORT Ciphers, PersistentObjects, Streams;

TYPE
Cipher = POINTER TO CipherRec;
CipherRec = RECORD (Ciphers.CipherRec) END;

PROCEDURE Init (key: Cipher; if: Ciphers.Interface;
inLength, outLength: INTEGER);
(* init a block cipher with its special interface and the corresponding
input and output block lengths *)

PROCEDURE GetInLength (key: Cipher) : INTEGER;
(* returns the input length of a block cipher *)

PROCEDURE GetOutLength (key: Cipher) : INTEGER;
(* returns the output length of a block cipher *)

PROCEDURE EncryptBlock (in: Streams.Stream; key: Cipher;
out: Streams.Stream) : BOOLEAN;
(* encrypts only a certain number of bytes of stream in; the number
depends on the block cipher key *)

PROCEDURE DecryptBlock (in: Streams.Stream; key: Cipher;
out: Streams.Stream) : BOOLEAN;
(* decrypts only a certain number of bytes of stream in; the number
depends on the block cipher key *)

END BlockCiphers.

epic false flag

C++ is a horrible language. It's made more horrible by the fact that a lot of substandard programmers use it, to the point where it's much much easier to generate total and utter crap with it. Quite frankly, even if the choice of C were to do *nothing* but keep the C++ programmers out, that in itself would be a huge reason to use C.

In other words: the choice of C is the only sane choice. I know Miles Bader jokingly said "to piss you off", but it's actually true. I've come to the conclusion that any programmer that would prefer the project to be in C++ over C is likely a programmer that I really *would* prefer to piss off, so that he doesn't come and screw up any project I'm involved with.

C++ leads to really really bad design choices. You invariably start using the "nice" library features of the language like STL and Boost and other total and utter crap, that may "help" you program, but causes:

>infinite amounts of pain when they don't work (and anybody who tells me that STL and especially Boost are stable and portable is just so full of BS that it's not even funny)
>inefficient abstracted programming models where two years down the road you notice that some abstraction wasn't very efficient, but now all your code depends on all the nice object models around it, and you cannot fix it without rewriting your app.

In other words, the only way to do good, efficient, and system-level and portable C++ ends up to limit yourself to all the things that are basically available in C. And limiting your project to C means that people don't screw that up, and also means that you get a lot of programmers that do actually understand low-level issues and don't screw things up with any idiotic "object model" crap.

So I'm sorry, but for something like git, where efficiency was a primary objective, the "advantages" of C++ is just a huge mistake. The fact that we also piss off people who cannot see that is just a big additional advantage.

But I'm sure you'd like it more than git.

>80k in loans due in 4 years.
I can't even imagine what that kind in sword of damocles would feel like.
You ameriburgers realy are a silly bunch.

Tfw Im not white, asian or pajeet so im pretty much garunteed a job when i graduate to fill a diversity quota.

Take that you privileged white male

Have you gone to any meet-ups or hackathons? Have you talked to career counseling services at your uni?

Whats a solid project I could shit out before I apply for jobs when i graduate.
Basically asking if there is a Fizzbuzz for personal projects that I can put on my Github to make it less depressing.

>STL and Boost are stable and portable
It is the truth. I do not have many bad experiences with boost, like 3 reported bugs which are now fixed, and I use boost extensively (the good parts).

>nigs or spics in CS
R A R E
A
R
E

why do people make fun of python?

public String toString() {
final StringBuilder sb = new StringBuilder();
Node nextNode = this.firstNode;
while (nextNode != null) {
sb.append(nextNode.toString());
nextNode = nextNode.next;
}
return sb.toString();

}

Which boost modules do you use? Personally I've been only ever using asio and filesystem but now that we'll have fs in the standard there'll be only asio left and I was wondering if there's any other ones that are worth checking out.

>C/C++
unsafe code is immoral

what the fuck is safety anyway

>swap_array
>It actually just swaps pointers
Cfags will defend this.

impure, non-total code is immoral.

an unsafe program of sufficient complexity is very likely vulnerable to retarded shit, i.e. loading a JPEG executing arbitrary code via stack smashing

this

Because repeating feels like you're working hard, just like in an essay, so they cling to verbose shitlangs, and deep down they know Python is more efficient and will wipe them out so they freak out

reinvent wheels

What ghetto ass scheme are you using? That should str8 up crash your program according to r5rs. As it rightfully should, since () isn't a pair.

it could be worse, at least that jpeg loader isn't running in KERNEL SPACE like windows explorer used to do with it's thumbnail generator

I was a TA for Programming 1, this is probably the smartest "dumb" answer I've seen.

Career counseling just told me to check the CS department's job listings. The only job on there was posted by a retired professor who wanted someone to teach her how to use email. At the job fair, there were no tech companies. There was a booth hiring for the Geek Squad...

Thanks for the free pasta

Because while it was a great concise scripting language when it was introduced, now it's starting to show its age.

Horribly slow and requires multiple dictionary lookups for something as simple as accessing a variable in the correct scope.