[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: 321
Thread images: 19

File: John_Backus.jpg (7KB, 147x200px) Image search: [Google]
John_Backus.jpg
7KB, 147x200px
Old: >>56952169
Working on?
>>
>Old thread still on page 1
You don't need to create a new thread right away, idiot.
Did you need to post your dumb image that badly?
>>
>>56957626
>m-m-muh anime
>>
File: 1472720519361.png (622KB, 540x608px) Image search: [Google]
1472720519361.png
622KB, 540x608px
How do I compact down a bunch of stupid commits to one clean commit?
>>
>>56957626
>what is bump limit
>>
please use dpt related images such as himegoto
>>
>>56957615
being a child is loving the elegance of lisp

being an adult is realizing python makes more sense
>>
File: okinawan_programmer.jpg (64KB, 1280x720px) Image search: [Google]
okinawan_programmer.jpg
64KB, 1280x720px
Japanese programmers are cute brown southern girls.
>>
>>56957638
git rebase

>>56957644
The old thread is still valid until it falls off of the board, and creating new threads usually truncates conversations.
Let the old thread fall down the board before creating a new one.

>>56957650
The literal degenerate poster is even worse.
>>
>>56957615
Would it be smarter to write the back end of a website in Go or C++? Which is faster? PHP is cancer. I am having trouble finding books for C++ server side programming.
>>
>>56957615
>Working on?
Writing a modern Forth compiler and a set of libraries and higher-level interfaces based on colorForth
>>
>>56957677
>oh god copying quote numbers is hard
>oh god the mods have to use common sense and delete a saging thread

Honestly at this rate we might as well give rolling threads to all the main generals.

Soon to be a perk of 4chan Gold™ members.
>>
A crappy tcp client and server program for clsss
>>
Reposting in this thread, just incase I get a response.

public class ModuloPrint {

public ModuloPrint() {
for (int i=1;i<=70;i++) if (i % 5 == 0) System.out.print(" "+i);
System.out.println();
}

}


I want the printing to be able to take place anytime after the object is created, in a seperate class member. Meaning I want the modula loop working/caluclating by itself, and a seperate class member that can print the results of ModulaPrint. I know, the class names are retarded atm, gonna change it when I find a solution to my problem. Any help would be appreciated
>>
>>56957678
Write it in C instead.
>>
https://quark.phy.bnl.gov/www/xtoys/schrodinger.c

someone compile this and see what it does
>>
Lads, I have realized that I take longer into understanding the math/logic from the examples in my C textbook, than I do to understand the C "concepts". What is a good math book that I should check while learning C? Thanks in advance.
>>
>>56957678
>Which is faster?
>C++ server side programming
You are confusing things. The performance of network IO is generally not affected by your choice of programming language, other than that you might implement your netcode poorly if you do it yourself. And to clear things up, PHP alone is not suitable as a webserver, that's apaches job. And you can configure apache to run your c++ or go program as well, leaving the networking to apache (which you will most probably never outperform with homebrew solutions, not even to mention security and stability).

>I am having trouble finding books for C++ server side programming.
because "c++ server side programming" is not a topic that could fill a book. using tcp, you bind to a socket, accept connections, and do what you will until either side closes the socket. its all simple file i/o using read() write() etc.
you can find most of what you will need to know to set up a basic telnet client/server on google. if you really need to optimize for performance, in-depth knowledge about various topics like routing, tcp/ip/networking cannot be replaced by a c++/go book.
>>
>>56957781
>https://quark.phy.bnl.gov/www/xtoys/schrodinger.c
>/* version of August 2006 */
his code looks more like 1906
>>
>working on group assignment with two of my best buds
>one is pretty good at doing competitive programming problems, on JV programming team
>the other is pretty useless but pretty chill and tries his best sorta
>JV guy writes out a bunch of utter shit
>horribly designed code, things not modularized in any coherent way
>have to refactor entirely to meet requirements that he hadnt thought about yet
>>
>>56957984
>on JV programming team
this is a thing?
>>
>>56958004
Yep, he's indian too
>>
Are Promises in standard JavaScript or is this something I need a library for?
>>
are indians just naturall shit at programming?
>>
File: pajeet-android.jpg (349KB, 1378x1008px) Image search: [Google]
pajeet-android.jpg
349KB, 1378x1008px
>>56958072
indians are naturally smart
>>
>>56958072

Please do the needful.
>>
>>56957836
>The performance of network IO is generally not affected by your choice of programming language

Why do Facebook and Google use over 5 different languages for their websites then?
>>
What's everything I need to make money from programming without going college?
>>
>>56958140

Memes, mostly.
>>
>>56958140
Why shouldn't they?
>>
File: fizzBuzz.png (16KB, 563x604px) Image search: [Google]
fizzBuzz.png
16KB, 563x604px
All business logic belongs in the database!
>>
>>56958171
Well if they all have the same speeds and cost then why not just write everything in the easiest language?
>>
File: fixing_problems.png (15KB, 312x307px) Image search: [Google]
fixing_problems.png
15KB, 312x307px
What are your favorite programming-related blogs or YouTube channels?
>>
>>56958193
Because the easiest language often depends on domain.

There's your answer.
>>
>>56958210
So would back end language choice ever reduce hosting costs in any way?
>>
>>56958210
The easiest language often also depends on the individual programmer.
>>
>>56958140
Because google is doing heavy traffic over probably thousands of servers. Its like comparing a formula one racer to a go-cart in terms of complexity.
>>
File: 1374574508775.jpg (29KB, 499x500px) Image search: [Google]
1374574508775.jpg
29KB, 499x500px
>>56958250
>Car analogies
>>
>>56958250
>go-cart
>go
HL3 confirmed.
>>
File: tfw.png (953KB, 1280x789px) Image search: [Google]
tfw.png
953KB, 1280x789px
>>56958259
fuck, I didn't even notice I was doing it. Help me.
>>
>>56958228
In theory, sure. Same as in theory, hand-optimised assembly written by a genius programmer will outperform an abstraction written by a compiler.

In practice, no. There are far, far too many factors that outweigh language choice (as in outweigh by an order of magnitude) for it to really matter. It'll never realistically be a make or break element.
>>
>Be in the field for a couple years
>Wound up in a position as a QA analyst where I had to do way more coding than I ever thought I'd need, as well as server admin tasks and vm shenanigans to properly automate our UI test cases
>Decide I should go back to school and finish a CS degree to make a career out of it
>In my third semester, have learned nothing (we're only just now touching on search/sort algorithms)
>Find out from a friend doing his masters that the department heads about 3 years ago stopped weeding out all the idiots in cs 100/200 level courses because local companies were mad not enough cs grads were coming through
i
regret
fucking
everything
jesus christ
>>
>>56958228
maybe slightly. but it has a large effects on maintenance hours, and skilled technician's hours are extremely high when you're in a megacorp that books every fart into their SAP. A year ago:
>sitting on shitter at office
>think 1 minute about a random project i work on
>tell teamleader about idea
>he says cool idea please dont forget to log the time spent figuring that out
>smallest time-unit in time manager is 15min
>my company charges the customer 150€/h for work in my position
>i made 37.5€ for my company sitting on their stinky shitter
>died a little inside the next time i had to shit during office hours
>>
>>56958259
What's wrong with analogies?
>>
>>56958324
Car analogies are the bane of computing.
>>
>>56958296
How do you automate UI testing?
>>
>>56958332
And why, prey tell?
>>
>>56957615
do all FP langs share more or less common syntax?
>>
>>56958248
are you saying people are naturally inclined to be better at some types of programming languages than others? because that sounds like bullshit
>>
>>56958358
They are all terrible.
>>
>>56958358
>prey tell
>>
>>56958250
>go-kart
claiming this shit on github right now
>>
>>56958374
going to go out on a limb and say no

you've got

>ml-like syntax
>haskell syntax (similar to ML but a lot extra)
>lisp syntax
>other declarative languages (prolog)
>>
>>56958332

Agreed, they are contrived in the same way that anti-OOP arguments are contrived.
>>
so many foe intellectuals itt
>>
>>56958400
>that pro-OOP arguments are contrived
FTFY.
>>
>>56958417

Your mum is contrived.
>>
>>56958400
>they are contrived in the same way anti-snake oil arguments are contrived

>>56958421
>mum
you're american, fuck off
>>
>>56957836
>The performance of network IO is generally not affected by your choice of programming language
https://www.techempower.com/benchmarks/
click on "latency"
>>
>they want to virtue signal so bad that they literally cannot stop responding to anything that's vaguely pro-OOP

OH my DOG! It's this easy!
>>
So I've never programmed before what are all the steps to start making money writing code so far I could only think of making a github and get some project on it
>>
>>56958375
Yes, i am saying that. I actually believe this. People have different trains of thought and association chains of association, and language influences that.

But also the simply more pragmatic fact that everything's subjectively easier in a language you're familiar with.
>>
>>56958400
>he fell for the OOP meme

You might have had an argument for SQL vs noSQL
>>
>>56958441
You forgot to link the post you're replying to
>>
>>56958410
my autism is tingling

fuck you. you did that on purpose
>>
>>56958448
Step 0: be a mentally ill feminist in San Francisco
Step 1: collect diversity bux from any (((Employer)))
Step 2: goto Step 1
>>
>>56958398
I solved some simple shit the other day, in one of these competition websites... solved it in many langs, and, man, FP langs seem completely foreigner, not only because FP itself, but the semantics, etc.
ocaml was the one that took me the most time. seriously, even the author of some intro doc makes it clear that he was confused by some rules:
https://ocaml.org/learn/tutorials/structure_of_ocaml_programs.html
>>
>>56958451
all programming languages are just different ways of saying the same thing, just like spoken languages. do people speak certain languages because they're genetically inclined, or because they were raised to speak it?
>>
>>56958482
functional languages are GOAT
>>
>>56958461

I'm not replying to/and or quoting anybody.
>>
>>56958504
IMO, everyone should learn OCaml. There is a LOT to learn from it
>>
>>56957738
If I understand what you're saying - you need to multithread. Look up the Runnable class.
>>
Imagine that there are some people out there who pretend they aren't replying to people.
Disgraceful.
>>
I know, right?
>>
>>56958502
wtf are you talking about? of course our genetics dictate which languages will be easier for us to learn. same for skin color, etc., btw

@56958527
whare are you talking about?
>>
>>56958504
Why?
>>
>>56957835

What math concepts are you having a hard time with? As in, what is your current level of familiarity with maths in general?

It's kind of hard to give you advice when we have no idea what you're finding challenging.
>>
what is SICP? is it worth reading if the only language I know is python?
>>
>>56958551
it all goes back to when alonzo invented the lambda calculus. it was a beautiful, pure and concise expression of computation

then a year later some fag invented this shitty, ugly and awkward version
>>
>>56958502
The languages we were raised to speak influence our ways of thinking. Which influences our perception and conception of the world, and also the very language itself and how we learn and experience new languages.
>>
>>56958563
I guess I gotta brush up my calculus, but besides that, what other math related topics would make me a better programmer in general?
>>
So I've decided on python as my first language, well documented, lots of libraries (think thats what they're called), CLI only, works on mac linux and windows - anyway what are some good websites to learn python 3.x I used codecademy but that was python 2.x I just wrote my code in 3.x but now I'm looking for more websites to teach me
>>
>>56958624
Programming tends to be more about formal logic than maths per se in my experience
>>
>>56958569
no
>>
Why does C++ do so much copying? Doesn't make it slower?
>>
>>56958790
Huh?
>>
>>56958638
Why Python? Why not C?
>>
>>56958804
don't want to bother with makes a gui plus with python I can juts write code in vim then save it and I'm done, no compiling plus doesn't c output .exes that only work on windows?
>>
>>56958588
If you were born in France, you'd be using OCaml. If you were born in Britain, you'd be using Haskell or ML. If you were born in America, you'd be using Scheme.

If you were born in India, you'd be using Java.
>>
>>56958815
Yes, c outputs .exes that only work on windows.
>>
>>56958790
>Why does C++ do so much copying?

[citation needed]

It has move semantics. The fuck are you on about?
>>
>>56958828
I want to make shit that works on OSX windows and linux
>>
>>56958815
>don't want to bother with makes a gui
Who said you have to make a GUI in C?

>plus with python I can juts write code in vim then save it and I'm done no compiling
You can set up something to automatically recompile on save.

>plus doesn't c output .exes that only work on windows?
If you develop on Windows, then yes (unless you're cross-compiling). I'm running Linux and my C compiler outputs ELF binaries by default.
>>
>>56958815
No, C doesn't have a set output. It depends on what platform you're targeting. If you're on GNU/Linux and install GCC, it will compile GNU/Linux executables. If you use MingW on windows, it will output windows executables.
>>
I'm so fucking pissed off at matrix ordering. I have a matrix [a, b, c, d, tx, ty] that I want to feed to a fucking graphic program but other sites show [a, c, tx, b, d, ty] or some other garbage. Is there a way to tell? Is there a value I can feed to something to figure out if I've implemented the algorithms correctly? Yes my maths is horrible but this sure isn't helping.
>>
>>56958819
>Britain
>Haskell or ML

best country best languages
>>
>>56958837
you're really not in a position to be expanding to other markets right now
>>
File: this-guy.gif (4MB, 411x227px) Image search: [Google]
this-guy.gif
4MB, 411x227px
>>56958815
>plus doesn't c output .exes that only work on windows?
not dignifying this with an answer
>>
>>56958815
>I can juts write code in vim then save it and I'm done

>run program
>it hits a branch
>program crashes due to typo

SO MUCH TIME SAVED!
>>
>>56958837
You need to read up on the history of C
>>
>>56958804
Python is going to be a hell of a lot easier for a beginner to grasp than C. Not to mention in C he'll have to learn manual memory management and a string manipulation library that'll occupy basically all his error-checking time and will have no relevance whatsoever outside of C.
>>
>>56958837
$ ./configure --host=i686-w64-mingw32
$ make


Then it'll build something that will work on Windows
>>
>>56958874
When he's done with Python he'll still have massive gaps in his knowledge.
>>
>>56958853
you're asking us whether you're placing inputs in the correct order for a function or expression that you have not shown us
do you understand how crazy that is
>>
>>56958874
Python is trash and will ruin you forever
>>
>>56958837
>>56958872
he needs to read up on the history of computing in general. anyone with an ounce of knowledge on the subject would know how ridiculous that statement is
>>
>>56958874
>will have no relevance whatsoever outside of C.

I hate scripting language advocates. Get to hell and take node.js with you.
>>
>>56958819
>no love for pascal
>>
Guys do you like my matrix function??

int64_t f(uint8_t n)
{
if (n <= 1) return n;
/* if n is too big, fail */
if (n > 92) return -1;
n -= 2;

uint64_t a = 1, b = 1, c = 0, d = 1, e = 1, f = 0;

while (n) {
uint64_t g, h;
if (n & 1) {
g = a * d + b * e;
h = b * d + c * e;
f = b * e + c * f;
d = g;
e = h;
}
g = a * b + b * c;
a = a * a + b * b;
c = b * b + c * c;
b = g;
n >>= 1;
}

/* return d */
return d;
}
>>
>>56958903
>literally the only two language types in existence are C and scripting languages
>>
>>56958874
I'm not arguing against Python or anything now, but if string manipulation and memory management is an issue as a noob, one could start with sepples. C++ doesn't really require you to learn memory management until you're ready for it.
>>
Opinions on C# /dpt/?

My university is offering us the choice of C# or Java tracks, both fulfill the same requirement. I'll get both in the long run I'm sure, but is there any reason one or the other is better to start with? I'm already familiar with C.
>>
>>56958942
Which version of Java?
>>
>>56958918
>memory management only exist in C
>>
>>56958942
C# is just java with more Microsoft cock.
They're both horrible languages though.
>>
>>56958947
I assume it's 8, but they've not specified on class list.
>>
>>56958971
If it were less than 8 I'd say go with C#.

Ask someone else if it's between Java 8 and C# though.
>>
>>56958891
I was thinking more like spending five minutes learning about the origin of C should suffice.
>>
>var
Why the FUCK do people use vars in C#? It just makes code harder to read. There is absolutely no reason at all to use them as far as I can tell other than making your documentation harder to read and your code harder to infer from
>>
>>56959024
Because it's easier to type than a very long type. Otherwise you get

Map<Set<Int>, Function<Int, List<Output<String>>>> m = new HashMap<Set<Int>, Function<Int, List<Output<String>>>>();


everywhere.
>>
>>56958942
Not a whole heap of difference between the two aside from Java being more popular and having more libraries and resources behind it.
>>
>>56959048
I don't know shit about Microsoft Java, but I think at that point, you should be using a typedef or whatever its equivalent is.
>>
>>56959048

Var is still shit.
>>
>>56959073
As far as I'm aware, neither C# nor Java has typedef. Yeah, really.
>>
>>56958853
Row-major vs. column-major. Depends on how the operations are implemented.
>>
>>56959008
but it belies a deep ignorance on the entire field
>>
>>56958927
Well, the question originally was between Python and C. I would also probably recommend C++ before C for an absolute beginner, although that too poses its own problems.
>>
>>56959090
I agree, one should use val instead wherever possible.
>>
>>56959048
in Haskell this is just
mempty
>>
>>56958942
Java 8 flushed any reason to jump to C# in my opinion. I've heard MS likes to give head to students for roping them into their ecosystem though so if you can pull an internship or something out of that track then give it a go.
>>
File: 1475350723115.jpg (81KB, 528x729px) Image search: [Google]
1475350723115.jpg
81KB, 528x729px
What's the equivalent to thread executor pools in c#?
I want to be able to define multiple pools (with different limits to the current number of threads), and then queue threads for them but as far as I can tell it only has the one, static, global thread pool.
>>
thoughts on storing users schedules as strings in a database in the app i'm making to find meeting times between two users? the mysql data type i intend on using can store just over 65,000 characters. an entry would just have 4 fields, a first and last name, a userID, and the schedule (as a text entry)
>>
File: Capture.png (6KB, 368x141px) Image search: [Google]
Capture.png
6KB, 368x141px
>>56959101
How do I tell though? They mention a, b, etc but then show pictures with the matricies in different orders. I also need this to work with webgl functions which are even stranger.
>>
File: 1376908007763.png (133KB, 318x318px) Image search: [Google]
1376908007763.png
133KB, 318x318px
>>56959100
I don't understand how people can defend those shitty languages. They're missing basic features than even very old programming languages have.
>>
>>56959118
And in scalaz it's just O. We're talking about C# and Java, though.
>>
>>56959125
stupid frogposter
>>
>>56959135
It should say somewhere.
>>
>>56959148
Well, O with a stroke through it, which apparently you can't type on 4chan.

https://github.com/scalaz/scalaz/blob/series/7.3.x/core/src/main/scala/scalaz/syntax/MonoidSyntax.scala#L36

>>56959147
Unfortunately they're very widely used.
>>
>>56959155
>Implying it's a dumb question
nah, it's a valid one.
>>
>>56959181
i didn't read the question
i dont care what frogposters want
>>
>>56958400
I get it.
>>
File: 1473484189650.png (375KB, 785x757px) Image search: [Google]
1473484189650.png
375KB, 785x757px
>>56959185
That's nice anon
Why are you mad that I posted pepe, one of 4chan's most vintage memes? Why do you care? You know that "stupid frogposter" is a joke, right?

Now for real, does anybody know the C# equivalent to an executor pool?
>>
>>56959161
https://www.schoolofhaskell.com/school/to-infinity-and-beyond/pick-of-the-week/guide-to-ghc-extensions/basic-syntax-extensions#unicodesyntax
>>
How do I get a programming job in the US? I have 5 years of experience with memes.
>>
>>56959205
>le memes
Fuck off back to r/4chan you stupid fucking robot
Nobody likes you
>>
>>56959215
That's pretty neat. I like the asterism for (***).
>>
>>56959185
That's not a frog; that's a cucumber.
>>
>>56959205
Stop posting the reddit frog and fuck off.
>>
>>56959205
how to spot the redditard who's been there for 5 seconds.jpg
>>
>>56959187

Thanks.
>>
>>56958942
/g/ hates both of them so you won't get any answers worth a shit here.
>>
>>56959254
Mummy I heard some people saying that F# is better than C#. Are they right?
>>
>>56959225
>implying I use /r9k/
nah
Why are you so mad over this lmao

You're not even posting on-topic, I posted a meme but I also was contributing to the thread. If memes actually make you mad, what on earth are you doing on 4chan?

>>56959237
>>56959250

geez anon slow your roll it's too obvious when you post replies exactly the length of the post limit apart

>>56959161
You mean this? Θ
>>
>>56959268

Functionalfags might say that.
>>
>>56959272
More like this:

https://en.wikipedia.org/wiki/Empty_set
>>
why is 4chan stuck in the 00's?
can't /wdt/ and /dpt/ take over it?
>>
>>56959272
Suicide yourself at any moment.
>>
>>56959290
I like 4chan's design.
You can fuck off.
>>
>>56959273
Are they right, though? Is there anything C# can do that F# can't?

>>56959290
http://www.motherfuckingwebsite.com/
>>
>>56959305
He's just mad that his favourite programming paradigm is dead
>>
>>56959305
>Is there anything C# can do that F# can't?

Well, C# has been used for real software packages, and F# hasn't.
>>
>>56959316
Could F# do that too though, in theory?
>>
>>56959305
>http://www.motherfuckingwebsite.com/

http://bettermotherfuckingwebsite.com/
>>
>>56959288
Oh, I didn't fully read the post and there was some post above mine talking about big O notation so I figured you were talking about that
O is a unicode character, actually

>>56959293
:^)

>>56959305
>>56959268
It's all down to preference, in the end. They're both .net.
C# has a bigger userbase so it's likely to have more stuff developed for it for ease of use
>>
>>56959322
It already has
>unironically responding to a tripnigger
>>
>>56959316
>hasn't
Bullshit
>>
>>56959329

No, it hasn't. Nothing of value has been made with a functional language, EVER.
>>
>>56959325
I find that one much harder to read.
>>
>>56959272
The irony is that the only people who get buttblasted about frogposting are newfaggots desperately trying to compensate.
>>
>>56959325
>called "better'
>is actually worse
:joy:
>>
>>56959337
>if i shitpost i can escape
>>
>>56959329
>a tripnigger
That's mummy you're talking about, you horrible person.

>>56959337
But mummy, I wrote systems in Scala at my last job.
>>
>>56959341
t. xxxR3dd1TxXxM4st3Rxxx
>>
>>56959341
>I've never been to any board outside of r9k pol and v
>>
>>56959359

The reality is that we're all stuck here forever, and the shitposting only makes it slightly less painful.
>>
>>56959349
sour grapes: the post
>>
File: last.png (37KB, 1919x405px) Image search: [Google]
last.png
37KB, 1919x405px
Working on my terminal emulator, just spent a bunch of hours going through the ECMA-48 standard and adding parsers for all the standard control codes.

Now I just have to do the reverse, so the terminal can actually respond to requests.

Screenshot is my terminal rendering this PS1:
export PS1="\e[30;48;5;255m/人\e[31m\e[30m ‿‿ \e[31m\e[30m人\"
>>
>>56959325
the original one is better. the second one has too much wasted space on either side
>>
>>56959305
>>56959325
I dont like this

were is my viewing experience
>>
>>56959407
Set your browser colors and fonts to your viewing preferences.
>>
>>56959383
im a gay little twink and suck big daddy dick, give me the daddy dick papa please goo goo ga ga: the post

our posts are of equal quality
>>
>>56959341
I don't even know what his game was, why even get mad over something so inconsequential, especially if it's something so pervasive?
he must be mad literally all the time if frogposting makes him angry and he's on 4chan

>>56959420
are you alright anon
>>
>>56959391
Neat. What is it written in?
>>
>>56959401
No, that is your monitor wasting space.
>>
>>56959470
If a website is wider than I would like, I simply resize my browser window.
>>
>>56959466
It's written in Rust, it uses Cairo and Pango for rendering and XCB for windowing.
>>
>>56959470
>You dumbass. You thought you needed media queries to be responsive, but no. Responsive means that it responds to whatever motherfucking screensize it's viewed on. This site doesn't care if you're on an iMac or a motherfucking Tamagotchi.
- motherfuckingwebsite.com
>>
>>56959489
>Tamagotchi
SHIT, IT'S DEAD
>>
>>56959440
>are you alright anon

He's having a hissy fit because he got wrecked. Just ignore him. It's almost his bed time.

>>56959489
The other site doesn't either. But your website hates good formatting. Anyone who disagrees is autistic.
>>
>>56959489
>>56959505
>>>/g/wdg/
>>
>>56959505
no one here cares about your shitty ripoff of an original and funny website that's worse than the original, and proves itself wrong visibly trying to make a point that it's better. one of them is simpler and adapts naturally to my wide monitor, and the other is more complicated and fails at that same task while purporting to be better. also, my bedtime isn't until midnight and it's 11:32pm so i have plenty of time
>>
>>56959548
>one of them is simpler and adapts naturally to my wide monitor

Text that stretches from edge to edge in a browser is hard to read, though. There's a reason we have margins in books.
>>
finished my PL0 lexer doods
fuck me
>>
>>56959583

Lexing is cool.
>>
File: gally.jpg (28KB, 720x480px) Image search: [Google]
gally.jpg
28KB, 720x480px
>>56959583
What did you write it in and how do you represent your BST?
I'm writing a recursive descent parser in C and I have no fucking clue what I'm doing, everything online is just abstract overviews in pseudocode and the wiki page leaves out so much.
>>
Got done with my school work, wrote this code, got extra credit from my TA
int main(){
printf("\nI'm"); fflush(stdout); Sleep(250); printf(" about"); fflush(stdout); Sleep(250); printf(" to");
fflush(stdout); Sleep(250); printf(" hit"); fflush(stdout); Sleep(250); printf(" my"); fflush(stdout);
Sleep(250); printf(" longest"); fflush(stdout); Sleep(250); printf(" Yea"); fflush(stdout); Sleep(250);
printf(" Boi"); fflush(stdout); Sleep(250); printf(" ever..."); fflush(stdout); Sleep(250);
printf("\n\nYea Boi"); int i; for (i = 0; i < 9999999999; i++){int counter = i; if (counter % 2 == 0)
{printf("i"); Sleep(10); fflush(stdout);}} return 0;
}
>>
>>56959703
Parsing is more interesting
>>
>>56959751
C
lexing, not parsing
that's the next assignment
>>
>>56959765

Optimization and code generation is more interesting.
>>
>>56959765

That's true.
>>
>>56959808
bullshit
>>
How is udemy?
>>
>>56959762
The thing that bothers me the most is that you're using Sleep and didn't #include <stdio.h>
>>
I want to start learning program. What would be a good first language for me? I'm looking a language that would help me get an entry level job in my area (east coast).

The idea of lower level languages is interesting something like C/C++ because of how powerful they are and the ability for them to interact with system hooks and stuff. But I don't even know if it would be worth my time seeing that almost everything I see people are looking *.JS
>>
>>56959869
lol I included stdio.h and windows.h to use the functions, i just didn't include them here. why would I? should I include my comments at the top too?
>>
>>56959888
JS is trash
Don't listen to the python fags
>>
>>56959808
Sorry, haven't gotten that far in my compiler tech book. But lexing and parsing is important and widely applicable out side the field of compilers. I'm learning lexing and parsing to be able to write better programs.
>>
>>56959888
>What would be a good first language
C++
C if you're not scared of memory handling
They enforce better understanding form the beginning.

>help me get an entry level job
Oh, never mind then. I guess Java, C# of JavaScript, then. Whatever, i don't care.
>>
ded thred
>>
File: 1447869516243.jpg (23KB, 320x320px) Image search: [Google]
1447869516243.jpg
23KB, 320x320px
>Porting from Java to C#
I want to fucking shoot myself
Why didn't I port it over sooner when it wouldn't have been such a pain in the dick
>>
>>56960024
why didnt you write in C# in the first place
java is for PAJEET
c sharp is NOTedidos costume
>>
>>56959941
What is a good C compiler for Windows?
>>
>>56960043
gcc
>>
>>56960033
Java is okay
I began writing it as a fun app and then I moved it into something more serious and I wanted to make it in a language that could compile to actual binaries and that was less, well, java-ey.
There's a java to C# converter but it /didn't fucking work/ so here I am
>>
I feel like I'm fucking up so badly /dpt/

I've cut out Java completely from the job search because every single time the interviewer is some indian dude with an impenetrable accent and becuase I can't remember all these extra versions of the same goddamn objects

In doing so, I've basically sliced my job opportunities in half, which is even worse considering I don't know django or react.js and I'm only just learning Angular today

Am I making a horrible mistake?
>>
>>56960076
No, Java is trash
>>
>>56960076
I dont know anything java can do that javascript can't in 2016
>>
>>56960084

t. NEET
>>
>>56960076
Indian Java teams are great for promotions though if you're competent since the competitor is usually not going to be good and your boss will need you to clean up the mess.
>>
>>56960130
>I dont know anything java can do that literally every other language can't in 2016
ftfy
>>
>>56960130
Javascript still can't do threading.

Seriously.
>>
>>56960130
>Webdevs are this dumb.
>>
>>56960135
>you dont like what i like so you must not have a job or be in education
I expect nothing less from a tripfag
>>
What are your aspirations?
>>
>>56960171
Death by boob crush
>>
>>56960043
MingW (which contains a port of gcc >>56960051
)
or Microsofts C/C++ compiler.
>>
>>56960171
To run out of excuses for not killing myself.
>>
File: 1407220426641.gif (2MB, 640x360px) Image search: [Google]
1407220426641.gif
2MB, 640x360px
>>56960195
>Microsofts C/C++ compiler
>Good C compiler
>>
>>56960211
We're talking Windows here. There aren't a whole lot of options.
>>
>>56960171
>>
>>56960076
>listening to /dpt/ memers
>ever
yeah, you fucked up. java is one of the highest paid ones
>>
working with bash scripts

>input
 ./filename.sh 5


it waits till I put in a number again even after I already put it in. why does it ask me again to input number

all I have is
 
b=5
read number

if [ $number == $b]
then
echo "You entered 5."
fi
>>
>>56960164

It's true, though. People who shit on Java are typically smelly basement NEETs. I'm not saying it's a good language, but to dedicate your life to attacking it betrays you.

You can't hide the truth.
>>
>>56960267
You're trying to pass 5 in as an argument, which it'll ignore
>>
>>56960230
>There aren't a whole lot of options.

There aren't a whole lot of options for any OS. There are a few good C compilers, a few platform specific ones, and then a bunch of shit-heap hobby ones.
>>
>>56960281
>>>you dont like what i like so you must not have a job or be in education
>it's true though

sasuga tripfag
>>
>>56960230

If you have to use Visual Studio for C or C++, unless you have some weird bugs or MS specific stuff, you should be compiling everything with Clang with Microsoft CodeGen. If you're using C, it should be the only thing you should be using.

When the C++ compiler actually catches up with being C++14 compliant at least, then maybe you can use the regular compiler for C++. But there is no way you will be also compiling any sane C99 or later code with Microsoft's compiler unless C++ adds all of the syntaxical changes C got from C99 and later, which is close to impossible since they are only merging in standard library changes from the C standard.
>>
>>56960267
Command line arguments in bash are accessed with $0, $1, $2 etc. (with $# being the number of arguments).
'read' will take a number from stdin, not the command line arguments.
>>
>>56960304

I don't speak your silly zipperhead language, weeblord.
>>
>>56960266
I made the choice based on my experiences, not /g/'s racist advise.

Yes, the interviewers being indian was a factor but that was because I couldn't understand the people I was speaking to. Maybe /g/ made me conflate that issue with Java specifically, but my memory is standing pretty strong on this one and even ignoring that I completely bombed a technical interview today because I couldn't remember any of the damn classes and keywords. How the hell is a StringBuilder different from a StringBuffer?
>>
If FP is so great why did God use OOP instead of FP when creating the world?
>>
>>56960351
Dumb american.
>>
>>56960308
> Clang with Microsoft CodeGen
I'll have to look into this.

>When the C++ compiler actually catches up with being C++14 compliant
I don't feel this is an issue for me personally. The compiler is going to catch up to 14 before i do. I'm still getting used to 11.
>>
>>56960351
I still don't get what functional programming is. is JS functional programming since it uses functions as variables and objects?
>>
>>56960425
>mutable state
Nah
>>
>>56960425
Functional programming is to do with functional purity and removal of state.
>>
>>56960338
The expect you to know Javas standard lib (or any standard lib) by heart? Fuck that shit.
>>
>>56960287
ok that makes sense now
>>56960314
yes that's what I want it to do! User will be able to specify how many from here just in case. thanks a bunch

Just needed a single parameter from command line.
deleted read number and replaced it with $1 in my if statement and it's working perfect now
>>
>>56960425
>js
>functional
>>
>>56960423

It's just better to be safe than sorry personally. I don't think Microsoft's C++ compliance is that far off but I know they aren't completely solid on templates, constexpr and some other things.

Better just to use Clang and not have to deal having issues with language features.

C on the other hand has to use Clang due to Microsoft pretty much saying "We only implement C if we have to" attitude.
>>
>>56960435
>>56960437

I have no idea what the fuck that means

>>56960452

I have no idea what functional programming is since most schools don't even bother to explain it, since nobody uses it anyway
>>
>>56960467
>since most schools don't even bother to explain it
I guess your school was shit.
We had a paper where we learned Haskell and programming language fundamentals.
>since nobody uses it anyway
Functional programming has a lot of very interesting idea that you can even apply to imperative programming.
>I have no idea what the fuck that means
A pure function doesn't mutate any external state, i.e. it doesn't modify anything outside of it.
>>
>>56960338
>How the hell is a StringBuilder different from a StringBuffer?

One's thread safe and the other isn't, but to be fair, I had to look that up.

If they require you to just KNOW the standard library (of any language) punch them in the dick.
>>
Can I download a pdf of the Rust book anywhere?
>>
>>56960542
https://killercup.github.io/trpl-ebook/
>>
>>56960518

>If they require you to just KNOW the standard library (of any language) punch them in the dick.

This. They should be testing your DS&A, not how many libs you put to memory.
>>
>>56960580
Thanks, I appreciate it.
>>
What do you think about bitbucket compared to github?
>>
Challenge:
Write an infix expression to postfix expression converter.

e.g. (2+4*((6-3)/(2+1))+5) -> 2 4 6 3 - 2 1 + / * + 5 +
>>
>>56960658
whats the point of crap like this?
>>
File: just fuck me up.png (127KB, 1487x822px) Image search: [Google]
just fuck me up.png
127KB, 1487x822px
I don't want to live anymore
>>
Is shunting-yard obsoleted by recursive descent parsing?
>>
>>56960700
Job security gone too far.
>>
>>56960652
It's okay. They have private repos for free iirc. If you're going away from github, just use gitlab. They have private repos too. But it is open source, so you can self-host it if you ever chose to.
>>
>>56960700
https://www.youtube.com/watch?v=eCiFO7qV54E
>>
>>56960716
I don't see anything wrong with it
it's just java code in visual studio
looks like anon is porting it
>>
>>56960732
>Java
>>
>>56960700
>
Future<?>

De fuck is that generic?
Also, you probably are fucking up your parentheses or curly braces, or brackets since you're getting syntax errors even in if statements. Even seems like you're missing an assembly ref, or a using statement.
>>
>>56960732
>>56960743
Not both of you, but anon is right, check that call to System.Out.Println.
>>
>>56960671

https://en.wikipedia.org/wiki/Reverse_Polish_notation
>>
>>56960744
There's a really neat thing in java, thread pool executors. Essentially you can queue up work to be threaded into a limited number of threads, and get a reference from the enqueue function to a Future, which when called will pause the thread it's called on until the thread finishes and returns a value.

>>56960743
Yeah, java. Which I am porting it out of, into C#.
This is hell
>>
>We have to make a lexer, so basically just splitting the file into tokens and saying what type of token each is
>>Okay, so we can just split it by whitespace and make a linked list of all the tokens
I fucking hate pajeets
>>
>>56960791
>>Okay, so we can just split it by whitespace and make a linked list of all the tokens
Depending on what you're lexing, that might be the correct answer.
But this is what happens when you let non-CS people program.
>>
>>56960811
The thing is, he said that and immediately followed with "what's wrong with that? what's wrong with using a linked list?" because he knows I think they're impractical pretty often

The assignment is to just print out the type of token for all of the tokens in a file. Reading in the file into a linked list of tokens and then going through that list to print them and their type is absolutely retarded
>>
>>56960790
>There's a really neat thing in java, thread pool executors
I think async in C# is better, I mean I'm not an expert, but using Tasks you can run parallel code without worrying how many threads the runtime will use. Since stating the number of threads is silly and could hurt performance. But yeah, have fun translating poo into CuteSharp.
>>
>>56960683
well for one, you're evaluating it even if they ARE equal, so that's ONE wrong case. Two, you're assigning bepis to pepsi instead of comparing for equality on the second else if. Three, you're not handling negative values correctly. You should be comparing to the absolute value of bepis - pepsi.

Should be more of
/* hastefully written pseudo code, no bully */

if bepis == pepsi
print "they're equal"
else
if bepis > pepsi
print "bepis is bigger"
else
print "pepsi is bigger"
if abs(bepis - pepsi) < (1.0 / 100)
print "but it was a close race"


Hopefully I didn't miss something. I'm half awake.
>>
>>56960791
>>56960811
I'm not seeing the problem. Please educate me?
>>
>>56960863
Lexing is usually a lot more complicated than splitting on whitespace, but it's possible that his assignment is that simple.
Also, as he said in his second post, linked lists aren't a very good data structure (although they're used in implementing other good data structures) and keeping the tokens usually isn't necessary.
>>
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7abc446 in strlen () from /usr/lib/libc.so.6
(gdb) backtrace
#0 0x00007ffff7abc446 in strlen () from /usr/lib/libc.so.6
#1 0x00007ffff7aa4ff2 in puts () from /usr/lib/libc.so.6

why does puts call strlen
>>
>>56960899
>why does puts call strlen
Probably because it wants to know the length so it can call memcpy or some shit.
>Program received signal SIGSEGV
Why are you handing puts an invalid string?
>>
>>56960862
I deleted my post because I thought I fixed it but I didn't

and yeah I'm half asleep too so I made the retarded mistake of = instead of ==, now the only problem I have is how to compare absolute values in C++ because the book hasn't told me and I assumed it did so automatically
>>
>>56960890
>Lexing is usually a lot more complicated than splitting on whitespace, but it's possible that his assignment is that simple.
So if i was a CS person i would have known this?

And the other problem was not the use of a linked list specifically but storing the tokens in a collection in general?
>>
>>56960916
oh
And I always thought it just putchar'd until \0
>>
File: john-backus-6.jpg (17KB, 320x240px) Image search: [Google]
john-backus-6.jpg
17KB, 320x240px
>>56957615
OP has an awful pic of John Backus, he never looked that bad all the way to his death pic related corrects that
>>
palmer are you here
palmer i have a quesiton for you
palmer
>>
>>56960924
storing the tokens at all
>collection
kys pajeet
>>
>>56960933
What did i say wrong now?
>>
>>56960922
>now the only problem I have is how to compare absolute values in C++

Look no further than the std library.

// cmath's abs example
#include <iostream> // std::cout
#include <cmath> // std::abs

int main ()
{
std::cout << "abs (3.1416) = " << std::abs (3.1416) << '\n';
std::cout << "abs (-10.6) = " << std::abs (-10.6) << '\n';
return 0;
}
>>
>>56960957
yeah I spoke too soon again and googled and now I can include abs, but goddamn the program isn't working as intended for whatever reason

fuck it I'm going to bed
>>
>>56960924
>So if i was a CS person i would have known this?
As a somebody who has written a few parsers when I hear "lexing", I think of lexing a programming language, so "just split on whitespace" sounds pretty stupid, but it technically counts as lexing.
>And the other problem was not the use of a linked list specifically but storing the tokens in a collection in general?
It's kind of both. From a practical standpoint, linked lists are slow compared to a (dynamic) array.
And normally with a lexer, you immediately hand off the token off to a parser, so you don't need to store shit.

It's not something absolutely retarded like using regular expressions to parse a non-regular language, but it just sounds like someone who is very inexperienced with CS.
>>
>>56960985
>sounds like someone who is very inexperienced with CS.
Presumably, that's why he's talking a class.
>>
>>56961010
Probably.
I'm just being a snob.
>>
can anyone suggest a good, fun course for machine learning/AI to someone who doesn't have a CS education, but only the basics of programming (uni dropout, after 1st year of engineering)?
and by this I mean, I know there are lots of things taught to CS people that I don't know, in statistics, logic, NLP, etc., etc.
>>
>>56961070
The guy who programmed Google's self-driving cars has this course is which is about as simple for a beginner as you can get for this subject:
https://www.udacity.com/course/intro-to-machine-learning--ud120
>>
Can anyone look at my game?

Written in Python with pygame
>>
gonna make a kpop op is that alright with everyone?
>>
>>56961151
Stop being so horny on new threads.
>>
>>56961162
i just like making ops

i dont even post here very often
>>
>>56961099
thanks a lot m8
actually, I was going to follow this course some months ago, but I thought it was a bit basic... and started following the coursera one... then stopped following because of the things needed, and the fucking abuse of notation. plus the teacher didn't seem to give much of a fuck about it, so...
do you also have some pointers on how to practice this stuff? some examples, fun challenges, etc?

>>56961117
you could try posting it, although it would be a better idea to post it in >>>/v/ or whatever
>>
>>56961171
>i just like making ops
stop that

>i dont even post here very often
start that
>>
>>56961188
i lurk i just dont have much to contribute
>>
>>56961151
>>56961171
>Kfag admitting he's pure cancer
>>
>>56961201
>K
>phoneposter talking about cancer
>>
>>56961219
it's for Korean dude, he didn't have a typo
geez
>>
>>56961238
kfag is the nonphoneposter way to write it
>>
>>56961219
I capitalized it on purpose you cancerous faggot
Phoneposters would still be infinitely better than Kfags anyway
>>
>>56961252
>I
>P
>no periods
yep it's a phoneposter
>>
lets get back on topic
>>
>>56961264
You're not using periods either retard
>>
>>56961264
What kind of device am I currently using right now?
>>
>>56958192
Dat case
>>
>>56957781
Never thought I'd see someone try to make C look like LISP.
>>
>>56961320
>>56961320
>>56961320
>>
>>56961294
but im not capitalizing the first letter

>>56961298
I Don't Know You Could Be Trying To Trick Me Now
>>
>>56961342
>I Don't Know You Could Be Trying To Trick Me Now
Nope I'm just using my normal style.
>>
>>56961342
>but im not capitalizing the first letter
What arbitrary bullshit is this? Kill yourself fag, you'd do the world a favor
>>
I hate reading books, I must have some kind of attention deficit disorder because I can never concentrate on them for more than 5 minutes.

I've learned myself recursive descent parsing and can construct an AST, but are there any good resources for learning register allocation and code generation?
Please don't suggest the purple book.
>>
Writing a small game and using WPF for the first time.

I wish I could just use my existing HTML and CSS skills instead of having to learn XML, but I guess this is the price I pay for choosing C#.
>>
>>56961514
>use my existing HTML
>instead of having to learn XML
Anon..
>>
>>56961567
dont tell him...

just send him to /wdg/...
>>
>>56961514
>>>/g/wdg/
Thread posts: 321
Thread images: 19


[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.