[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

/dpt/ - Daily Programming Thread

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 313
Thread images: 53

Old thread: >>57113677

What are you working on, /g/?
>>
Define 60.
>>
But what's 56 + 4 ?
>>
File: 1467470882633.gif (998KB, 500x282px) Image search: [Google]
1467470882633.gif
998KB, 500x282px
True loyalists to the Queen use Haskell
>>
This better not be the new average of two integers
>>
>>57118146
Define average
>>
>>57118146
How can you average integers if you can't even add them?
>>
>>57118151
>>
>>57118159
Define more
>>
>>57118151
C cup, not a complete midget, white
>>
>>57118178
That's mean
>>
>>57118110
This is a japanese programmer on a date with his boyfriend.
>>
>>57118177
Define define
>>
File: weak typing.png (2KB, 209x18px) Image search: [Google]
weak typing.png
2KB, 209x18px
>>57118183
*Her
>>
Today I dreamed Dennis Ritchie came to my class and gave a talk. Afterwards he talked to some people and gave me a book.
>>
File: snap040.png (62KB, 1062x625px)
snap040.png
62KB, 1062x625px
>>57118188
>>
>>57118159
What extension is this
>>
>>57118231
9fagX
>>
>>57118231
it's built into os x
>>
>>57118219
>not "define google"
>>
>>57118189
>alloc a girl
>call it a boy

C fags will defend this
>>
>>57118256
typedef boy girl
>>
discuss with /dpt/ finest on https://discord.gg/SfvHb
>>
I'm picking up my first language. Any recommendations of what book series or what I should read to learn C and Java?
>>
File: matasano_14.png (77KB, 882x609px) Image search: [Google]
matasano_14.png
77KB, 882x609px
Can /g/ solve simple crypto coding challenges?

https://cryptopals.com/
>>
>>57118350

Do not learn 2 languages at once. Choose one an only one to learn for now and once you have sufficiently grasped enough knowledge about one language, then move on to another.
>>
>>57118358
that spacing.
holy fuck kill yourself
>>
File: snap042.png (14KB, 882x162px) Image search: [Google]
snap042.png
14KB, 882x162px
>>57118389
As if you can do better.

It's a proof of concept, it's not supposed to look pretty.
>>
File: 1386500894426.png (109KB, 688x1434px) Image search: [Google]
1386500894426.png
109KB, 688x1434px
I have to use C++ for university but that language looks like shit. Where can I get the best tl;dr quickstart for C++? I am familiar with Java, Haskell and know a bit of C and Pointers.
>>
>>57118110
b--but.. it's a guy...
>>
File: nani.png (64KB, 693x387px) Image search: [Google]
nani.png
64KB, 693x387px
>>
>>57118358
How can I make my terminal as good looking?
>>
File: >F#.png (73KB, 661x373px) Image search: [Google]
>F#.png
73KB, 661x373px
>>57118631
>>
>>57118641
>not C
Am I really autistic or should I kill myself?
>>
>>57118641
>F# beating all that other shit
Suck it faggots
>>
>>57118655
You can do both
>>
>>57118641
I post a lot on C# stack exchange and I haven't been able to love for as long as I can remember so I'm probably dragging the average down, sorry guys.
>>
>>57118655
C is cancer, and if you like it, you're probably mentally abnormal.

Not in a good way.
>>
File: snap044.png (70KB, 882x604px) Image search: [Google]
snap044.png
70KB, 882x604px
>>57118640
If your vimrc is not 500 lines, you need to git gud
>>
>>57118591
kek
Enjoy a clusterfuck language with a billion ways to do things
>>
>>57118641
IN RUST WE TRUST
>>
>>57118681
Enjoy having no creativity or freedom of though.
>>
File: no.jpg (186KB, 816x488px) Image search: [Google]
no.jpg
186KB, 816x488px
/dpt/-chan, daisuki~

>>57118655
Both

>>57118641
>Rust
https://github.com/rust-lang/rust/pull/25585

>>57118591
Accelerated C++

>>57118358
>C
i bet all the code on that picture could be reduced to 10 lines of python.

>>57118350
>Starting with C or Java
Pic

>>57118189
that's not weak typing.

>>57118210
>Dennis Ritchie
the guy who set programming 30 years backward plt wise

>>57118110
Thank your for using an anime image.
>>
>>57118713
>implying C
That's SEPPLES, deme.
>>
>>57118631
>>57118641
>C# is the most loved of the popular langugaes
feels good to be on the winning team
>>
>>57118732
C# and Python are the only two popular and loved languages.

Feels good.
>>
>>57118641

Rust gets a lot of love to the point where people overgloss its shortcomings.

I really won't learn the language other than a skim on the syntax until they have some more stable APIs and fix the low end stuff I work with. I like how the language is progressing though besides the politics of the language.
>>
File: catintears.jpg (11KB, 261x192px) Image search: [Google]
catintears.jpg
11KB, 261x192px
>>57118631
>>57118641
>lisp missing
>>
File: dpt kill yourself.png (459KB, 796x913px)
dpt kill yourself.png
459KB, 796x913px
>>57118110

https://youtu.be/NJk-ecSlqIE?t=2493

>you will never work on a language for over a decade and get this excited about Tuples
>>
>>57118787
When you go out of your way to use hipster shit, don't be surprised that it's not mainstream.
>>
>>57118809
I think you missed the point. Lisp works off assembly. You're saying he's just not hip enough!
>>
>>57118848
Hip people write directly in machine code using ASCII characters only
>>
>>57118726
>sepples

You mean C post-increment
>>
>>57118868
define increment
>>
>>57118807
That's pretty neat tbqh.
>>
File: :( .png (21KB, 463x79px)
:( .png
21KB, 463x79px
>>57118807
>an audience will never literally applaud for you when you mouse-over and show an error message
>>
>>57118875
define " "
>>
>>57118905
>>
>>57118807
For all the bad things that Microsoft does, they really give programming language R&D a lot of love and it's refreshing.
>>
>>57118905
>>
>>57118919
>>57118923
mind
>>
>>57118921
I've begun mentally separating Microsoft's developer initiatives with those responsible for Windows and non-Azure Enterprise products.

It's like night and day as far as community interaction and actually listening to what people want.
>>
>>57118942
You should. DevDiv in microsoft has always actually been really competent. One of the most talented guys leading DevDiv was madman Scott Guthrie, who was put in charge of Azure many years ago. WinDiv is absolute garbage.
>>
>>57118807
I'm getting jelly as fuck watching this.
>>
I know a bit of java, but i'd like to try c++.
What's the best way to learn it?
Online tutorials? Books?
Do i start with C and then learn what C++ adds to C?
>>
>>57119048
>Do i start with C and then learn what C++ adds to C?
No. Hell no.
You start with Modern C++ if you don't want to kill yourself in the first 5 minutes.
>>
>>57119048
http://open-std.org/JTC1/SC22/WG21/docs/papers/2016/n4606.pdf
>>
>>57119048
http://www.learncpp.com/

This is a great place to start but it's more geared for people with no programming experience so you'll probably find it redundant. It covers some C basics as a way of introducing C++.
>>
So I just started doing shit for a startup, initially it sounded kinda cool and I think I had some rose glasses on. But since we've started writing documentation i kinda realized what they're building is pretty boring (legal tech) however they seem pretty promising in terms of funding. Would it be dumb to quit cause I'm bored with it? The CEO doesn't feel very strong either, seems to have a pretty unclear vision of what the product should be
>>
>>57119059
What would you recommend? I tried learning both qt and c++ at the same time and i kind of managed to make a working gui program, but it'd like to do something without copypasting from stackoverflow like a retard

>>57119068
Thanks, i'll have a look

>>57119114
This one is nice, thank you, i think i'll start with this
>>
>>57119155
>What would you recommend? I tried learning both qt and c++ at the same time and i kind of managed to make a working gui program, but it'd like to do something without copypasting from stackoverflow like a retard
C++ Primer is often recommended, I haven't read it though.
>>
File: spook man.jpg (5KB, 200x175px)
spook man.jpg
5KB, 200x175px
Is OOP a spook?
>>
homework fag here again, is this right?

Thanks for the help so far, it goes directly towards my mark
>>
>>57118183
Hime's not a programmer though.
>>
>>57119400
Mathoverflow is a forum for research questions. Please ask your homework questions on stackoverflow.
>>
>>57119400
How the fuck should we know without seeing the definition of Circle?
>>
>>57119425
>Please ask your homework questions on stackoverflow.
Go fuck yourself.

t. 5k points of SO
>>
>>57119443
How many questions did you answer with
>You should use jquery for this
>>
File: snap045.png (11KB, 430x298px)
snap045.png
11KB, 430x298px
>>57119465
I very deliberately stay out of the webdev tags.
>>
File: 1469467522864.jpg (19KB, 460x345px)
1469467522864.jpg
19KB, 460x345px
>tfw in CS2 class and someone around you fucking stinks
Why can't people take showers?
>>
>>57119430
Here's the circle

>>57119425
Sorry, my teacher can barely speak English and I don't even know what I don't know, I'm just trying to breeze through this module as painlessly as possible. You only need 40% to pass and there's no grade besides pass/fail
>>
>>57119533
That image made me lol audibly.
>>
>>57119533
>Here's the circle
>Doesn't show any of the methods

You're trolling, right?
Go read a Java tutorial. School is not for learning, it's the place you wait for your diploma while you learn on the side.
>>
>>57119514
Autists seem to live under the impression that if they can't smell themselves, nobody else can smell them either.

Protip: we can tell when you skipped a shower, your long greasy hair is a dead giveaway.
>>
>>57119283
OOP is an objectively bad paradigm from a hardware perspective that some people and businesses find easier to work with. That's all is.
>>
>>57119562
>when you skipped a shower
>a
>>
>>57119533
Kind of impossible to help you if you don't show us the move method.
>>
File: fullhing.png (20KB, 406x785px)
fullhing.png
20KB, 406x785px
>>57119546
>>57119556
I wish I was fucking trolling.

Like I said just need to finish this module then I'm done with programming forever I'm terrible at it.
>>
>>57119591
Alright, the answers are 1 and 2, now get off my /g/ please.
>>
Does wearing stockings and a skirt really improve performance and decrease errors while programming?

Any specific color of stockings for optimal efficiency?
>>
>>57119591
The answers are 1, 2, 4
>>
>>57119591
Jesus fucking christ, Java is fucking awful.
>>
>>57119563
Constructors are an obviously retarded idea.
>>
>>57118110
3d japs only
>>
File: 1471162839695.gif (2MB, 649x472px) Image search: [Google]
1471162839695.gif
2MB, 649x472px
>>57119609
>the answers are 1 and 2,
>>57119620
>the answers are 1, 2, 4

When the programming whizzes don't agree I start to worry
>>
File: 1434608571740.jpg (5KB, 153x250px)
1434608571740.jpg
5KB, 153x250px
>>57119591
>glasgow
>>
>>57119646
Yeah it's 1, 2, 4, my bad.
>>
>>57119659
Are you surprised I'm at the uni for retards given my posts so far
>>
>>57119642
I like constructors. I miss them when doing functional shit. I feel like i have to do stuff like Type PlayerRecord and PlayerRecordCreator() type shit, which feels annoying. Maybe I'm doing it wrong.
>>
>>57119665
You can only pick 2 options
>>
>>57119672
class Time {
Time(long milliseconds);
Time(long nanoseconds);
};

hmmm
>>
>>57119563
It's also generally pretty awful when you can't meticulously plan everything out. Idiomatic OO architectures are extremely brittle.

>>57119642
Really, the only bad thing is that constructors have to take the name of the class.
>>
>>57119665
>>57119646
It's 1 and 2, the fourth one will throw an error for converting to float -> int, which is possibly lossy.
>>
>>57119705
class Time {
Time(std::chrono::duration duration);
};


>Using numbers without a unit
>>
>>57119705
What the fuck is that?
>>
>>57119721
Fucking Java.
>>
>>57118110
girl *her = (girl *) malloc(sizeof(boy));
>>
>>57119738
Honestly, Java's type strictness is one of it's only good features. You can still pass that if you cast it to an int, but otherwise it won't work.
>>
File: 1468637166735.gif (2MB, 500x390px)
1468637166735.gif
2MB, 500x390px
>>57119721
Thanks, just submitted it

I'll fuck off to stackoverflow or whatever now
>>
>>57119751
What really annoys me in Java is this
if (thing) {} // Error!
if (thing != nullptr) {} // Fuck consiceness
>>
>>57119763
>I'll fuck off to stackoverflow or whatever now
Don't.
>>
>>57119771
java sound have pointers. you mean
if (thing) {} // Error!
if (thing != null) {} // Fuck conciseness


I like the type strictness, but i hate the verbosity. C# is better.
>>
>any reference can be null in his language
>>
>>57119763
Please don't post your shit questions on stackoverflow.
>>
>>57119803
>java sound have pointers. you mean
Java has pointers. What they call references is really pointers without arithmetic, not what everyone else calls references.
>>
File: 8Lng.jpg (11KB, 250x201px) Image search: [Google]
8Lng.jpg
11KB, 250x201px
>>57119789
>>57119809
Alright well if you want me to stay so much I guess I'll stay here and talk to my cool new programming friends!
>>
>>57119820
If you press CTRL+Q it'll take you to the thread for beginner programmers.
>>
>implying so isn't already overrun with garbage
>>
>>57119763
>>57119721
>You fuckers just helped this retard pass his programming module
Well done.
>>
>>57118110
Simple to use som-package for my unis repository because all those that I could find are either overly complicated, outdated or some really strange ports.
>>
>>57119831
This so much.

>>57119833
He's a java code monkey, I don't compete with that.
>>
>>57119827
I pressed it expecting something scary to happen and nothing did
>>
>>57119850
You can also press the power button for 5 seconds. Or press on your screen with your foot.
>>
Hey guys, check out these pointers without arithmetic, so that they always point to a valid object. We call them references. Oh, by the way, it was too tempting to not let them still be null, so actually I lied and these references might not point to a valid object. Expect the standard library and idiomatic code in general to use null everywhere. Also, we didn't provide any shortcuts to checking for null, so have fun.
>>
>>57119859
gotcha, trying now
>>
>>57119866
Don't forget to delete system32
>>
>>57119865
>Also, we didn't provide any shortcuts to checking for null, so have fun.
>x == null
?
>>
>>57119890
>Explicit conversions
System.Term.Io.Out.Costanza.shiggy()
>>
>>57119890
>what is null coalescing
>what is converting a reference r to (r != null) when a boolean is expected
>>
std::function<DWORD(UINT32, BYTE*)> LoadData = [](UINT32, BYTE*) {return AUDCLNT_BUFFERFLAGS_SILENT;};

I love C++11. Lambdas are the best thing to happen to C++ since function pointers.
>>
>>57119591
Is there a reason for using this this way?
>>
>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.
>>
File: 1475888048297.png (49KB, 197x313px) Image search: [Google]
1475888048297.png
49KB, 197x313px
>>57119905
>>57119910
if (myDikk.in(urAnus) != null) {
System.out.println("fakk u dumb american!11!!");
}


>javac MyDikk.java && java MyDikk
>fakk u dumb american!11!!

HOW DO YOU LIKE JAVA NOW?!
FILTHY AMERICANS!!
>>
>>57119995
>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.
That's much less true since C++11, which has made simple things simple.

Either way if you want to make that argument, I think Java is much worse than either C or C++ in term of being flooded by bad programmers. Just look at >>57120010
>>
>>57119974
wtf test
>>
>>57119995
t. Linus
>>
File: 1476594714769.png (250KB, 728x426px) Image search: [Google]
1476594714769.png
250KB, 728x426px
>>57120027
>Sepples purists
Pure nofunallowed cancer.
>>
>>57120057
FUN is allowed, but Java is not FUN, it's BOILERPLATE.
Sepples is FUNâ„¢.
>>
>>57118677
this
>>
>>57094591
>http://pastebin.com/jEb5RQEk
>>57095193
>You also have an infinite loop
>>57101174
>what's wrong with my loop?
>>57102412
>You shoving everything into one line.
>For fucks sake.

Thanks for the opinion anon.
Is my frugality regarding whitespace a truly bad programming practice? Even when, as in this case, what I'm shoving in one line is just a bunch of simple operations that make sense as a whole, and by doing so I'm not decreasing readability?

Should this
do { y=fibo; z=fiboPrev; fibo=fibo+fiboPrev; fiboPrev=y; fiboBeforePrev=z; } while (fibo < a);


be always nothing but this
do {
y=fibo;
z=fiboPrev;
fibo=fibo+fiboPrev; // or, well, fibo+=fiboPrev;
fiboPrev=y;
fiboBeforePrev=z;
} while (fibo < a);

?

Anyhow, nothing there does make my loop infinite, does it.
>>
>>57120090
Java is pretty fun if you find it an interesting challenge to write the most amount of code possible with the least amount of functionality.
>>
>>57118713
>i bet all the code on that picture could be reduced to 10 lines of python.

But why would you want it to take 100x as long to run?
>>
>>57120181
well they both look like garbage
congrats
>>
>>57120181
no it should be
f(0) => 0
f(1) => 1
f(n) => f(n-2)+f(n-1)
:)
>>
>>57120181
Ha, that was me. Try this input 2000000000 2180000000. You should understand what's going on.
>>
>get asked to make a new site for executives that will be used for legal documentation
>cool, this might be good for moving up
>"So anon, we want them to enter a password to log in but if they forget it we need to send it to them."
>"Send them their password?"
>"Yes, also it should be case-insensitive. These are executives, they are not tech savvy."

How fast should I nope the fuck out?
>>
If multiple threads access to the same array, how is this managed? How to get the best performance?
>>
>>57120446
Just send them a reset password link, what the hell.
You're not actually going to store shit in plaintext.
>>
Fucking yaaaas finally pushed a software update I've been working on for several weeks. Been a real headache. Now I just got a few more other things to work on and then I can relax for a few weeks
>>
>>57120448
>If multiple threads access to the same array, how is this managed?
If at least one of these threads is writing to the array, and another thread is accessing the same element of the array (reading or writing), it's a data race and it will cause bugs.

If your read/threads write to different elements of the array, there's no bug. But if they write to elements that are close to each other, the performance will be very bad due to cache conflicts.

>How to get the best performance?
Make sure your threads don't write close to each other.
Keep all your data contiguous and compact, except for cache line padding as necessary.
>>
>>57120448
use erlang
>>
>>57120317
Please elaborate

>>57120348
I can't into functions yet

>>57120396
You was what, the loop comment guy?
What is this what's going on? Have no clue
>>
>>57120448
Basically just read Ulrich Drepper's 114 pages Memory article: https://www.akkadia.org/drepper/cpumemory.pdf
>>
>>57120446
> these are executives, they are not tech savvy
Wtf else do you think you should do. Do plaintext, and in a few months, come back for free maintenance
>>
>>57120446
Post a link for fun & profit.
>>
>>57120446
>>57120590
And what I mean by maintenance, steal their passwords and use it to buy shit from Amazon, from their account
>>
What's a good resource to learn machine learning? I want to create a handwriting recognition tool and I wanted to try doing it with machine learning.
>>
>>57120560
The 2180... Number overflowes when it's cast to int, to an extremely small negative number. So your loop condition is always true.
>>
>>57120631
There's one guy who made a ML course on coursera and everyone loves him.
Howether the sound is shit quality.

https://www.coursera.org/learn/machine-learning/home
>>
What are some good sources for learning Java and Javascript?
Should I bother with C++ or C#?
>>
>>57118358
Stuck on the first one because of string processing. I'll figure it out soon.
>>
>>57120703
Java and javascript are nothing alike, anon
>>
>>57120725
They both have C style syntax anon
>>
>>57120725
I know, but I want to learn both. I've already dipped my feet into Java.
>>
>>57120715
To be fair the first one is pretty annoying, but then it gets much more interesting.
I'm not quite done with set 4, if I just found the time to finish
>>
Anyone have any experience with image registration in MATLAB or any other language?
>>
>>57120735
It's too late. The loo has already gotten to you. Soon you'll be pooing out on the designated street
>>
>>57120746
Yeah, I feel once I get past it, I'll get used to things.
>>
>>57120764
That's nice. So how about giving some learning sources now?
>>
>>57120794
Idk. I don't actually program. I'm just here to spout /pol/ memes
>>
>>57120818
This is why people /deletepol/
>>
File: luma.png (501KB, 1912x967px)
luma.png
501KB, 1912x967px
Trying to recreate the scene from mercury's luma ( https://www.youtube.com/watch?v=WBuoyegCeXI ) in a browser. Got here so far.

Can't see it on a still screenshot but the ferris wheel is moving properly. Things left to do:
- figure out a proper algorithm to generate trees
- rest of the park attractions
- postprocessing (glow and chromatic abberation)
- figure out a way to draw each light programmaticaly instead of sprites. (if anyone's got a suggestion on how to reproduce the same effect without textures in shaders I'd love to hear it).
-perhaps add preprogrammed camera routes
>>
>>57120667
Thanks, this is quite enlightening. Do tell more. How is the condition true?
I guess my fibo is always non-negative, how can it be less than whatever negative number?
>>
>>57120848
Cool. WebGL?
>>
>>57120924
yeah, with three.js on top. it makes things so much easier.

can't see it fitting on the orignal 64k but then again I'm nowhere near any of Mercury's devs
>>
>>57120848
use a simple shader to render the lights?
>>
>>57120870
Have checks to see if your a and b are > 0. also on your loops, have checks seeing if fibo goes negative.
>>
>>57120960
well this much is obvious. I don't yet know how to write a shader that would do that properly though. Haven't found any good examples either
>>
>>57121134
for each pixel, calculate the distance from the centre of the texture. Then increase the transparency the further away it is. If the pixel is >0.5 from the centre, then make it fully transparent.
>>
>>57121193
this wouldn't quite produce the effect I'm after but I can work with that. Thanks.

I'm clearly not thinking with shaders yet.
>>
yo I got a problem in python
for i in range(len(obj_list)):
obj_list[i].list_inside_obj[i] = True

when I do this all the items in the list become true for every object
I want it to be obj_list[0].list_inside_obj[0] to be true but not obj_list[0].list_inside_obj[1]
>>
>>57121255
it should based on what i can see.

You can adjust it of course to make it closer to what it is you do what. Maybe apply a sin function to the distance from the centre to make the centre less transparent or whatever.
>>
>>57118210
you should write about it in my diary manager script written in Python 3!
http://hastebin.com/vakudofafi.py
>>
I want to learn haskell cause its easiest right?

or do I want to learc C becuase then Im more then half way there of learning c dagger dagger?

or java cause I can make millions off a bunch of dumb android games?
>>
>>57121664
No to all 3.
>>
File: 2d54e7f737e0e30b71de77e7866ec9e9.jpg (177KB, 1345x750px) Image search: [Google]
2d54e7f737e0e30b71de77e7866ec9e9.jpg
177KB, 1345x750px
>2016
>still can't search for coding jobs by experience level

fuck this noise. I'll be unemployed for the rest of my life at this rate
>>
What's the best city to live in as a developer?
>>
>>57121839
http://www.indeed.com/q-Entry-Level-Coding-jobs.html
See the left hand side. Wow that was difficult.

Also your denoiser is bugged, there's lots of artifacts.
>>
There is a lot of noisy code in the classes at the bottom. Does anyone know how to improve this?

https://gist.github.com/acc5a930ed1323cbff606b741562a8e0
>>
>>57119645
I bet she's Korean, can see the plastic under her skin.
>>
Hey guys, automata question...

tl;dr can I use "does not equal" in a regular expression for a language?

Writing up regular expressions for languages like "any string that contains xyz", etc.
Have to write a regular expression for "any string that does NOT contain 101".
Is it possible to just use something like,

Σ = {0, 1}

{ w | w != (0 U 1)* 101 (0 U 1)* }

Or do I have to write in such a way that it asks for any string except with the undesired substring?
Book and Google aren't giving me much to go on.
>>
>>57121839
If there was actually a certification standard for "experience" in programming jobs, all companies would request ONLY the highest level for entry level jobs.
>>
File: vixens424briamyles.jpg (766KB, 2526x1220px) Image search: [Google]
vixens424briamyles.jpg
766KB, 2526x1220px
>>57118110
Based mods.
>>
>>57121871
once language and location are factored in that basically comes down to a handful of unique jobs.

I've had time to get intimately familiar with indeed's search algorithm. There are a lot of duplications
>>
>>57122005

Oh, that it's mane.
>>
>>57121881
Managed to move most of that shit out:
#pragma once

#include "utils/delegate.hh"
#include "utils/intrinsic_rc.hh"

#include <cstdint>

namespace oka {
namespace utils {

using u32 = std::uint32_t;

class LoopWatch;
class LoopTimer;
class LoopDefer;

using LoopWatchCb = std::function<void(LoopWatch, int, u32)>;
using LoopTimerCb = std::function<void(LoopTimer)>;
using LoopDeferCb = std::function<void(LoopDefer)>;

class Loop {
public:
Loop();

void delegate(Delegate d);
int run();
void stop(int i);
void force_iteration();
LoopWatch new_watch(LoopWatchCb cb);
LoopTimer new_timer(int clockid, LoopTimerCb cb);
LoopDefer new_defer(LoopDeferCb cb);

private:
friend class LoopWatch;
friend class LoopTimer;
friend class LoopDefer;

struct Priv;
static Priv* ref(Priv*);
static void unref(Priv *);
IntrinsicRc<Priv, ref, unref> priv_;
};

class LoopWatch {
public:
void set(int fd, u32 events);
void disable();

private:
friend class Loop;
friend class LoopTimer;

struct Priv;
static Priv* ref(Priv*);
static void unref(Priv *);
IntrinsicRc<Priv, ref, unref> priv_;

LoopWatch(Loop::Priv& priv, LoopWatchCb cb);
LoopWatch(Priv& priv);
};

class LoopTimer {
public:
void set(const struct itimerspec *ts, bool abs);
void disable();

private:
friend class Loop;

struct Priv;
static Priv* ref(Priv*);
static void unref(Priv *);
IntrinsicRc<Priv, ref, unref> priv_;

LoopTimer(Loop::Priv& priv, LoopTimerCb cb, int clockid);
LoopTimer(Priv& priv);
};

class LoopDefer {
public:
void set(bool enabled);

private:
friend class Loop;

struct Priv;
static Priv* ref(Priv*);
static void unref(Priv*);
IntrinsicRc<Priv, ref, unref> priv_;

LoopDefer(Loop::Priv& priv, LoopDeferCb cb);
LoopDefer(Priv& priv);
};

}
}
>>
>>57122148
Glad I didn't fell for the POO meme
>>
>>57122206
What meme did you fall for?
>>
>>57122222
He's probably a deprecaskell fag
>>
>>57118159
>average ... (most commonly) the mean
https://www.google.com/search?q=average+math
>>
File: 5453543.png (152KB, 1948x858px)
5453543.png
152KB, 1948x858px
How do I avoid OOP hell while still getting its benefits?
>>
>>57122304

Write procedural C code using the typename_methodname structure.

All the benefit of OOP without the poorly structured hierarchies, hidden vtables, and "design patterns"
>>
>>57122304
What benefits?
>>
>>57122222
nice quints
>>
The Indian teaching assistant for one of my classes e-mailed my friend telling him his assignment had an error and wouldn't compile. Turns out he was trying to compile it without -std=c++11, and I guess the compiler warning "try compiling with std=c++11" didn't hint him off.
>>
>>57122355
That's why you ship a CMakeLists or a Makefile
>>
Is it possible to give a method in C++ internal linkage?
>>
>>57122304
use interfaces and nothing else.
>>
>>57122371
Yeah, declare it static, or put it inside an anonymous namespace.
>>
>>57122367
yeah, most of us use CMake, but this was an introductory MPI program with one file, so I guess he found it easier to use the compiler wrapper.
>>
>>57122382
That sounds wrong.
>>
I have to learn php for school, but I don't want to learn it step-by-step in class because it's boring. I know for myself that the best way to learn new language is to code something. Any ideas?

I'm familiar with nodejs and back-end web development in general.
btw, currently think about blog
>>
>>57122446
Internal linkage is anything that can't be linked with outside of the current translation unit.

Static and anonymous namespaces both enable internal linkage.
>>
>>57122463
No, they do not. static simply makes a method callable without an object.
>>
>>57122487
Right, I was talking about free functions and you were talking about class members.

A method of a class can not have internal linkage unless the class has internal linkage.
>>
File: 1449168919306.jpg (31KB, 353x353px) Image search: [Google]
1449168919306.jpg
31KB, 353x353px
>>57122487
>>
dumb question here, how do i attach an array to what my inputted grade, so if i run it 4 times it will add up the 4 inputted grades?
>>
>>57122556

Read a book.
>>
>>57122556
Java quality.
>>
>>57122566
ive been reading about arrays in the java docs but im just wondering how i would put it into my situation.
>>
>>57122583
Probably because arrays won't help.
>>
>>57122597
what should i do then? whats the most efficient way?
(pls no bully im just trying to learn)
>>
File: 1416109433310.jpg (18KB, 331x341px) Image search: [Google]
1416109433310.jpg
18KB, 331x341px
Is it possible to do oneliner getters/setters in Java, like in C#? If not, is there a way to at least make getters and setters less fuckheug?
public foo {private set; public get;}

is so much prettier than
private foo;
private void setFoo(foo newFoo){
foo = new Foo;
}
public foo getFoo(){
return foo;
}
>>
>>57122753
No.
>>
>>57122798
God damn it java
/why/
>>
File: visualiser.webm (2MB, 800x600px) Image search: [Google]
visualiser.webm
2MB, 800x600px
>>57118110
>What are you working on, /g/?
I wrote a little audio visualiser with OpenGL. I want to write a program to do some audio analysis, but I thought I would write a visualiser so I can see what is happening first.

WebM with sound: https://a.pomf.cat/prhseq.webm
>>
>>57122556
do you know about functions in math? the kind of things that, for a given input, by using a formula, give you an output
for example, you could convert "grades" to "gpa" (for grades > 67) by calculating something like:
gpa= [(grades-60)/4]/2

where [ ] means "the integer part of the division"
in python 2, you'd code this as
gpa=((grades-60)/4)/2.0

i.e., by doing integer/FP math "tricks"
>>
>>57122830
Because of muh simplicity.

What most language "designers" don't seem to realize is that a simple but poorly-designed language will lead to horribly bloated code. Simplicity only works if the language is also well-designed.
>>
>>57122830
If that's all the logic you need for the properties, maybe metaprogramming might help, dunno if Java has that.
>>
>>57122753

public Supplier<T> getX = () -> X;


There's your one-liner. :^)
>>
>>57122956
there's your (you)
>>
Resumed work on my chess engine. Just finished pseudo-legal knight moves.
>>
File: be-a-computer-scientist.png (305KB, 640x974px) Image search: [Google]
be-a-computer-scientist.png
305KB, 640x974px
best c++ book?

best way to learn assembly?

Is SICP worth going through? im curious how much pic related holds true
>>
writing a cli application in java
u know how, when u open mysql from cli in linux, it 'takes over' the commandline and gives u its own prompt until u ctrl+c it?
how do I do that
---
>>
>>57123075
while (true) {
// read line
// evaluate what the user entered
// print a response
// loop back and do it again (Ctrl-C will terminate the endless loop)
}
>>
>>57123062
holy shit i would make that pic and everything close to it illegal, never thought i'd cringe so much at some fucking pixels
>>
>using visual studio for a class I'm taking
>sometimes when typing cursor changes to a grey block that instead of inserting me between whatever I select selects the letter or whatever


how do i stop this
>>
>>57123438

Quit hitting the insert key.
>>
>it won't compile
>i have no idea why and I'm seriously considering killing myself

why
>>
>>57123488
because ur a fag
>>
>>57123488
Cause you can't read the error message
>>
post yfw you realized the C++ is the most practical language in existence today
>>
>>57123599

(you)
>>
>>57122850
>not even a "thanks"
oh well...
>>
File: CdW77MWU.jpg (32KB, 400x400px)
CdW77MWU.jpg
32KB, 400x400px
Let's say I have a marble struct or class, and each marble has a size and color.

enum class Color { RED, BLUE, GREEN};
enum class Size { SMALL, MEDIUM, LARGE};

struct Marble {
Color color;
Size size;

// some methods
}


I also have a list of valid color and size combinations.

Marble validMarbles[] {
{ Color::RED, Size::LARGE },
{ Color::BLUE, Size::MEDIUM },
{ Color::GREEN, Size::SMALL }
};


How do I set up my code so that I get a compile time error if I try to create a marble that's not valid? Something like so...

int main() {
Marble a = { Color::RED, Size::Large }; // in validMarbles[], no error
Marble a = { Color::BLUE, Size::Large }; // not in validMarbles[], throw compiler error
}
>>
>tfw learning common lisp
>all these names
>cddr
>cdaar
>cdddaar

at least I found a way to decipher how they mean
>>
I decided to make a tactics rpg, how do I replace the grid after my character moves? i thinking remembering what the last input was now that I started typing this, thanks knew posting here would help

board = []
for row_num in range(20):
row = []
for col_num in range(17):
row.append("( )")
board.append(row)

board[0].insert(15,"20")
board[1].insert(15,"19")
board[2].insert(15,"18")
board[3].insert(15,"17")
board[4].insert(15,"16")
board[5].insert(15,"15")
board[6].insert(15,"14")
board[7].insert(15,"13")
board[8].insert(15,"12")
board[9].insert(15,"11")
board[10].insert(15,"10")
board[11].insert(15," 9")
board[12].insert(15," 8")
board[13].insert(15," 7")
board[14].insert(15," 6")
board[15].insert(15," 5")
board[16].insert(15," 4")
board[17].insert(15," 3")
board[18].insert(15," 2")
board[19].insert(15," 1")
board[0].insert(0,"20")
board[1].insert(0,"19")
board[2].insert(0,"18")
board[3].insert(0,"17")
board[4].insert(0,"16")
board[5].insert(0,"15")
board[6].insert(0,"14")
board[7].insert(0,"13")
board[8].insert(0,"12")
board[9].insert(0,"11")
board[10].insert(0,"10")
board[11].insert(0," 9")
board[12].insert(0," 8")
board[13].insert(0," 7")
board[14].insert(0," 6")
board[15].insert(0," 5")
board[16].insert(0," 4")
board[17].insert(0," 3")
board[18].insert(0," 2")
board[19].insert(0," 1")


def print_board():
print("-----A----B----C----D----E----F----G----H----I----J----K----L----M----N----O-----")
for row in range(20):
for col in range(17):
token = board[row][col]
if not token:
token = " "
print(token,end=" ")
print()
print("-----A----B----C----D----E----F----G----H----I----J----K----L----M----N----O-----")
print_board()

def player_move(row_num, col_alph ,token):
board[row_num].pop(col_alph)
board[row_num].insert(col_alph,token)


player_move(19,6," @ ")
print_board()
>>
whats the car of a symbol?
nil or just an error?
>>
>can't get a job
>even if I could I'm pretty sure I'd lose it instantly

god life sucks
>>
>>57123766
Use for loops man
>>
>>57123790
Start small, even if you can't get a programming job get a job literally anywhere and get some experience and use it to transition into a job somewhere else. For programming, having a good portfolio (even if it's for open source non-paid stuff) really helps.
>>
>>57123790
>giving up so easily
>implying your not being lazy
>>
File: p1k.jpg (18KB, 393x553px) Image search: [Google]
p1k.jpg
18KB, 393x553px
I'm confused how to draw a 'for' loop in UML activity diagram.

Is picrelated an accurate representation of this?
    int x, y, z;
cin >> x >> y;
z=1;
for (int i=1; i<=y; i++)
{
z*=x;
}
cout << z;

Or where in this pic should I shove the incrementation?

>homework assignment to draw a diagram of this:
>Natural numbers x and y are entered.
>Calculate x to power y, using only adding, subtraction and dividing. Output result.

>I am aware that there could be other valid implementations (for one, having y as decrementing counter y-- and (y>0) as condition) resulting in of course different diagrams.

My question is just whether this pic represents what that particular code says.
It kinda looks just the same as if I were using a 'do-while' loop.
>>
>>57123839
Overflow :^)
>>
>>57123806
I've been applying to 20 jobs a day for a month and a half

Maybe I could make a mobile app or something, but I have literally no idea what. Would people buy a selfie app that applies texture overlays to your face?
>>
When should I use struct and when should I use class in C++?
>>
>>57123500
>>57123494
>i found my error


am i mentally ill


every time I try to program things it's an emotional rollercoaster and i end up considering suicide every single time
>>
>>57123904
They're the same except struct is public by default and class, private.

Personally, I use struct whenever I mean to make a POD type.
>>
>>57123879
Like the other anon said, build a portfolio to make you more appealing to employers.
>>57123904
When you want an stack value, and a heap value? I don't remember the strinct differences of them in Sepples.
>>
>>57123928
Thanks
>>
>>57123928
Perfectly
Ordered
Datums
??
>>
>>57123967
plain old data
>>
>>57123904

Do you need at least one member to be private? Use a class. Is everything public? Use a struct.
>>
>>57123975
pristinely organized decimals
>>
>>57123871
Can't care less about that.
Is my loop drawn correctly?
>>
>>57123839
>>57124171
I don't know why you're doing something so pointless, and UML is fucking horrible, but loop conditions are checked before you execute the loop body, not after.
>>
>>57118110
why isn't dpt automatic, I mean I'd expect someone to have made a script so when this one gets close to limit it makes a new thread and posts in this one, it'd be possible with a 4chan pass right?
>>
>buying a pass
>>
>>57124191
Bots are against the rules.
>gets close to limit
I think you mean AFTER the limit.
>>
>>57124171
You should bitch
>>
>>57124203
yeah I did, didn't know bots were against the rules, it's a shame cause I think that'd be cool
>>
>>57124213
hiro is desperate for scratch right now
you should suggest it as a perk for pass owners
>>
>>57124203

If you do it after the limit, someone will have already made a new thread manually, with a trap image.
>>
>>57118110
wtf was the OP?
why is it deleted? is OP a fag? are mods the fags? am I the fag?
>>
>>57124222
And if you create it before the limit, the degenerate will just pre-empt that.

>>57124223
Stupid trap shit.
It's confirmed: No traps allowed.
>>
>>57118110
does anyone else feel totally retarded when they have to do interview questions? i feel like im a competent programmer with some pretty impressive personal projects and im even a professional programmer currently getting paid to work in gamedev, but when i do like, leetcode or hackerrank challenges and stuff i feel like im completely inept. whats the secret to getting your brain wired for these fucking horrid challenge questions?
>>
>>57124235
but I love traps ;_;
>>
>>57124235

It's a war that cannot be won. At least not without a hyper-advanced AI that can predict exactly when Anon is going to post a trap thread, and beat him to the punch one post before.
>>
>hobby project is turning into hot pile of smelly mess
>all I can do is looking at it and sighing
;_;
>>
>>57124401

The problem with code smells is that they only become readily apparent once you've slowed down to really take in the scene.

At that point, it's often too late to unfuckulate some of the major smells.
>>
File: 1476737124589.png (234KB, 717x616px)
1476737124589.png
234KB, 717x616px
>tfw when a programming language allows - to be in function names
EX-CEP-TIO-NAL
>>
File: wat.png (12KB, 615x416px)
wat.png
12KB, 615x416px
Can anybody explain this to me? I got 17 using the leftmost element as the pivot, and 29 using the rightmost as the pivot, and neither of them were right.

Am I just doing it wrong, or is there some kind of standardized method of picking a pivot that I'm supposed to use?
>>
>>57124656
>or is there some kind of standardized method of picking a pivot that I'm supposed to use?
I think Quicksort uses the middle pivot? (It was the middle position, or the middle value, can't remember.)
>>
>>57124656

Did you try a mid pivot with either 47 or 17 as the pivot?

It's an asshole question to ask if you can't see any code and the pivot isn't given. And no, there is no standardized pivot for quicksort. But choosing one when you have some idea of how unsorted your data is can affect runtime to some extent.

Generally, most people use the middle as the pivot.
>>
>>57124689
>I think Quicksort uses the middle pivot?
There are lots of ways you can pick the pivot.
Without knowing what question is using to pick the pivot, there is not way you can work out the answer.
>>
>>57124656
Usually people take the pivot to be the median of the first, middle, and last elements of the list. Finding the actual median value of the list takes too long in general.
>>
>>57124562
why isn't it allowed in languages in the first place???? WHAT THE FUCK
>>
whats a very basic design pattern for handling the result of asynchronous objects, which im going to use in c#

id rather pass around this result object instead of the data from the object because my function could fail or have states that resemble information like resulting an empty list
>>
>>57124747
no way to distinguish foo-bar (foo minus bar) and foo-bar (foo-bar) unless they also enforce spaces around operators.
>>
>>57124953
>not putting spaces around operators

i would fire you in a split second
>>
>>57124980
Good thing that nobody as autistic as you ever gets into a position of power over employees
>>
>>57124980
>"Coding style"
>"Spaces"
>"Don't use spaces around operators, colons, parentheses etc. e.g. write p:=p+i; instead of p := p + i ;"
I do put spaces in my own code though, in fact I've used a language that uses infix operators and allows - in names, Dylan, "Lisp" with Algol syntax, and so spaces are required around operators of course.
>>
File: 1312517174153.png (161KB, 500x349px) Image search: [Google]
1312517174153.png
161KB, 500x349px
>>57124656
>>57124699
47 didn't work.

I can't tell if it's 17 either because we only get 3 attempts, and they hide the correct answer ever after you've used up all your chances.

Why are all CS teachers sadistic assholes?
>>
>>57118110
Send help pls, I need to install the Northwind database but I don't know fucking how. "Sql2000SampleDb" is the package that generated all the other files.
>>
File: 6f449bef47.png (43KB, 768x478px) Image search: [Google]
6f449bef47.png
43KB, 768x478px
>>57125232
Forgot the image.
>>
>>57124562
Going from CL to C/Java is a pain.

gotta take those extra keystrokes for _ or caps or you just fuck it and all lowercase no separator.
>>
File: oh no.jpg (3KB, 125x125px) Image search: [Google]
oh no.jpg
3KB, 125x125px
is there a way to log out the current user through a c program in linux?
>>
>>57119612
rainbow stripes.
>>
File: 1476327735635.png (255KB, 380x593px)
1476327735635.png
255KB, 380x593px
I'm trying to make a file downloader for 4chan and 4+4chan using python. 4+4chan works like a charm but for 4chan I always end up downloading the same file twice due to retarded html conventions.

Having said that I need a way to "skip" a loop in python. Any help?
>>
>>57125345
post your code
>>
File: 1470715952380.jpg (252KB, 1270x1022px) Image search: [Google]
1470715952380.jpg
252KB, 1270x1022px
>>57125345
>>57125414


Actually, forget it: it's my exhentai sauce search who is fucking my shit up.
Everything works fine now.
>>
File: 1459330055509.gif (156KB, 500x500px) Image search: [Google]
1459330055509.gif
156KB, 500x500px
>>57125345
>>57125446

Oops, not really: it's 4chan referencing the same image two (2) times.

Fuck this imageboard.
>>
>>57125509

There's an API, you know.
>>
>>57125509
we can't help if we can't look at your code
>>
I just helped my brother with his JavaScript homework.

>Fucking CodeHS doesn't allow use of variables in the whole first lessons?!
What the fuck...
I had to come up with these convoluted workarounds

Pain in the ass.
That retarded Dog looped all the fuck over the screen and the program took like 50 times as long, because I wasn't allowed to use an Maths or an Variables.
Bullshite.

I'm feeling very sarcastic and anxious after that program.....
>>
File: 1476600708574s.jpg (2KB, 114x125px)
1476600708574s.jpg
2KB, 114x125px
>>57119885
>memeing this hard
>>
File: 1454685985374.png (317KB, 600x637px) Image search: [Google]
1454685985374.png
317KB, 600x637px
>>57125509

I fixed that by moving all my urls to a list and them removing duplicates.

Thanks /dpt/!
>>
>>57124562
>a programming languages that allows spaces in function names
top this
>>
File: c23b31e8cb.png (13KB, 496x260px)
c23b31e8cb.png
13KB, 496x260px
>>57125232
>>57125250
I fucking hate microsoft(tm).
>>
File: 1461441443224.png (440KB, 645x1260px) Image search: [Google]
1461441443224.png
440KB, 645x1260px
>Data Structures class
>submit assignment
>get 30% of total grade
>see what went wrong
>literally 60% of the grade was cut due to styling issues
>30% was due to having too many lines over 80 characters
>a lot was because I didn't do a comment in every line even though in the last assignment I got ripped for commenting too much

Only teacher in the whole campus that does this. Seriously considering dropping and getting a teacher that is, at least, reasonable with the weights instead of cutting more than half of my grade for shit that has 0 to do with the purpose of the assignment.
>>
File: AAAAAAAAAAAAA.jpg (12KB, 474x473px) Image search: [Google]
AAAAAAAAAAAAA.jpg
12KB, 474x473px
>>57125983
>going to college to learn programming
>>
>>57125983
>Things that never happened
>>
NEW THREAD!!

>>57126084
Thread posts: 313
Thread images: 53


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.