[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: 317
Thread images: 30

File: dpt_flat.png (102KB, 1000x1071px) Image search: [Google]
dpt_flat.png
102KB, 1000x1071px
Old thread: >>59785901

What are you working on /g/?
>>
File: 1460067423956.gif (514KB, 342x342px) Image search: [Google]
1460067423956.gif
514KB, 342x342px
Daily reminder that Functional Programming is for special snowflake redditors
>>
Please do not use an anime image next time. Thanks.
>>
>>59790860
Do you still cry yourself to sleep because you failed SICP or whatever your school's equivalent was?
>>
>>59790871
>projecting
>>
>>59790848
https://news.ycombinator.com/item?id=14060846
Walter managed to switch the dmd backend to Boost
>>
>>59790877
Who said "projecting"?
>>
>>59790871
>hehe i am le special snowflake because i know how to cdr down a list!!!! i am much smarter than u heheh dont these stupid startups know how much superior my special snowflake language is? why arent they using haskell??? WTF!!!
>>
>>59790877
Projecting what? I passed that class. You evidently didn't, brainlet.

It's so sad to see the Blub paradox in action.
>>
>>59790896
Do you think car and cdr are Haskell functions?

Were you dropped on your head and fed bleach as an infant?
>>
File: fedora says.jpg (33KB, 332x396px) Image search: [Google]
fedora says.jpg
33KB, 332x396px
>>59790897
>It's so sad to see the Blub paradox in action.
>>
>>59790878
D is dead. Please stop trying to flog a dead horse.
>>
Thanks for a traditional image.
>>
>>59790906
What a handsome chap.
>>
>>59790909
Wrong
>>
>>59790924
It's been dead for years, Andrei. Just give it up. Your family misses you.
>>
>>59790896
>>59790906
Who are you quoting this from?
>>
Python, Ruby, Go, and Node are all shit.
>>
>>59790939
You're wasting a lot of space by listing them.
>>
>>59790934
I am quoting >>59790906 from >>59790897 my /jp/ friend.
>>
>>59790939
t. unemployable haskell autist
>>
>>59790942
Yes, I suppose it would be more efficient to list the few languages that aren't shit.
>>
>>59790943
I see. Thank you for clarifying.
>>
File: ui.png (721KB, 2880x1800px) Image search: [Google]
ui.png
721KB, 2880x1800px
>>59790883
>SDL2
this is good advice but i want to start developing my actual app and not getting lost in rabbit holes. i don't care how gui works under the hood, i just need comfy framework easy to style like picrelated, with native perfomance and static linking, it is too much to ask in 2017
>>
>>59790945
It's funny because I'm employed as a functional programmer.
>>
>>59790946
Either that or simply state the common properties these languages have which causes them to be instant shitlangs.
>>
>>59790956
t. unemployed dysfunctional programmer
>>
>>59790860
I don't mean to be a faggot, but C isn't such a bad language, it's fast and nice and simple and it makes me happy, but those other functional ones are where the special snowflake really begins to shine. Stay away from them.
>>
Are there any drugs that will make me program better? Apart from hormones, of course.
>>
>>59790964
Cum
>>
>>59790953
>native performance
>electron
No. This will not happen. Electron has terrible performance.

Stop being lazy and do it properly.
>>
>>59790964
Steve Jobs used LSD to make the Apple I and II.
>>
Guys how do I git gud? I dont wanna be a code monkey and that's all I'll be (if im lucky) after I grad... what do?
>>
>>59790964
Amphetamines

They fuck up my short term memory but a lot of people report the opposite so your mileage may vary
>>
>>59790977
Learn the basic git commands like clone, checkout, commit, push, pull, branch, merge.
>>
>>59790953
>with native perfomance
Delphi/Lazarus
>>
>>59790963
>where the special snowflake really begins to shine
You mean
>where my limited intellect runs out and I stop being able to understand the code
>>
>>59790931
Excellent meme my dude
>>
>>59790983
already know them!
>>
>>59790953
https://github.com/vurtun/nuklear
>>
>>59790977
What do you want to do then?
>>
>>59790998
i want to be a system programmer sans the C++
>>
>>59791006
>i want to be a system programmer sans the C++
>system programmer
>no C++
good luck
>>
>>59790993
t. special snowflake millennial with massively inflated ego from overcoddling parents
>>
>>59790993
>where my limited intellect runs out and I stop being able to understand the code
You mean
>I'm so smart because I can code haskell lmao gtfo dumbfag OOPers you'll never be as special and intellectual as me
>>
>>59790993
>>59791012
>>59791020
who are you retards quoting?
>>
>>59791040
He is clearly referencing post numbers: 59790993, 59791012 and 59791020.
>>
>>59791040
Nobody. I didn't quote anyone.
>>
>>59791020
>you'll never be as special and intellectual as me
Well, you clearly won't be, because you're still arguing against functional languages being superior to whatever shit you prefer to use.

>>59791017
You should take the dildo out of your ass to ease that butthurt.
>>
>>59791061
t. special snowflake millennial
>>
>>59791061
Saying "functional languages" isn't enough since they are a subset of both POO and procedural programming.
>>
Anyone have recommendations for must-read books for beginners? Very new, and looking for something to get me started.
>>
>>59791061
You do understand that functional and OOP languages are entirely different and serve their own unique purposes. Stating that one is superior to the other is silly and lacks a deep understanding of the real purpose of a functional language.
Besides that, functional programmers are a minority in programmers and software space so of course you're going to be called a special snowflake.
>>
@59791090
>You do understand that functional and OOP languages are entirely different
Only a retard can make such claims considering one is a subset of the other.
>>
File: ss.2017-04-08.jpg (45KB, 203x199px) Image search: [Google]
ss.2017-04-08.jpg
45KB, 203x199px
thinking about a text input method for xbox one controller where you move the 2 different analog sticks in diff directions for the various letters, just doing a standalone app to begin with to try out different things, with a view to having a native input method for windows. will probably be very slow compared to touch typing, but whatever
>>
>>59791087
you should write a macro that takes an error handling function, a message, and a condition and use that everywhere.
>>
https://github.com/dlang/dmd/pull/6680
D is now free software.
>>
>>59791127
>POO
>>>/r/abbit
>>
>>59791090
t. buttflustered OOP language user trying to stay relevant
>>
>>59791129
anon...
>>
File: keyboard.jpg (105KB, 575x293px) Image search: [Google]
keyboard.jpg
105KB, 575x293px
>>59791116
That's a horrible idea, anon, don't be the 395th person to make a failed keyboard.
>>
>>59790848
Can somebody tell me when sometimes I can't terminate my program with ctrl+c in the terminal?
>>
>>59791134
What did you mean by this? Should I substitute all members of OOP for the word itself? That would make him a "buttflustered FP language user" and a "buttflustered imperative language user" .
>>
>>59790860
>If I can't understand it useless...

Godamn, I have some many colleagues like. People who refuse to open a book. People who shun any type of knowledge that may not have immediate value. People who are in CompSci, but HATE discreet mathematics.

You are a vermin that no one respects. You are bound to be a mediocre loser.
>>
File: 1460339733190.jpg (313KB, 1280x720px) Image search: [Google]
1460339733190.jpg
313KB, 1280x720px
>>59791165
You shouldn't be writing looping garbage in the first place
>>
>>59791165
But, anon, ctrl+c is copy. you are merely copying the application.
>>
>>59791133
Are you the guy who keeps claiming that C structs are OOP?
>>
>>59791173
>i passed my first semester discrete math course, i am le special snowflake xd
>>
What makes a programming language a systems language if not system calls?
>>
>>59791173
>If I can't understand it useless...
Who said this?
>any type of knowledge that may not have immediate value
Such a thing is by definition impossible. Assuming you aren't some sort of animal.
>>
>>59791173
>claims to value knowledge
>can't even tell the difference between 'Discrete' and 'Discreet'
lmao pseudo-intellectuals
>>
>>59791182
This isn't your subreddit.
>>
>>59791200
So that's a yes then.
>>
>>59791197
Who are you quoting? He literally didn't say that.
>>
>>59791183
I really do wonder what happens to people like you later in life. I don't know happened to most of my peers. People like you, who thought that it's "dumb" to know ans learn. People that think that others are only trying to show off.
>>
>>59791202
That was heavily implied to be a "no". I'm sorry your plebbitor mind can't infer that.
>>
>>59791208
He misspelled 'discrete' when getting all high and mighty about passing a course for undergrads.
>>
>>59790995
learn javascript
>>
>>59791218
>i am le superior intellectual mind, all my peers r inferior, i am le special snowflake xddddd
Signs you go to a shit school
>>
>computers are for fucking nerds
>>
>>59791224
he's either indian ESL or trolling
>>
>>59791224
Oh no I mistyped, whatever shall I do?

Mate...
>>
>>59791165
because you pressed ctrl+s on accident with your fat fingers and XOFF'd the terminal. You need to press control+q to fix it.
>>
>>59791238
You calling me a nerd, faggot?
>>
"The entire point of programming is automation. The question that immediately comes to mind after you learn this fact is - why not program a computer to program itself? Macros are a simple mechanism for generating code, in other words, automating programming. Unless your system includes a better mechanism for automating programming (so far, I have not seen any such mechanisms), _not_ having macros means that you basically don't understand _why_ you are writing code.

This is why it is not surprising that most software sucks - a lot of programmers only have a very shallow understanding of why they are programming. Even many hackers just hack because it's fun. So is masturbation.

This is also the reason why functional programming languages ignore macros. The people behind them are not interested in programming automation. Wadler created ML to help automate proofs. The Haskell gang is primarily interested in advancing applied type theory.

Which brings me to my last point: as you probably know, the reputation of the functional programming people as intelligent is not baseless. You don't need macros if you know what you are doing (your domain), and your system is already targeted at your domain. Adding macros to ML will have no impact on its usefulness for building theorem provers. You can't make APL or Matlab better languages for working with arrays by adding macros. But as soon as you need to express new domain concepts in a language that does not natively support them, macros become essential to maintaining good, concise code. This IMO is the largest missing piece in most projects based around domain-driven design."
>>
>>59791224
>claims to value knowledge
>can't even tell the difference between 'Discrete' and 'Discreet'
Where did he say this?

>>59791233
Who are you quoting here?
>>
File: 1487984280808.jpg (308KB, 712x1134px) Image search: [Google]
1487984280808.jpg
308KB, 712x1134px
>>59791119
Something like this perhaps? Excuse my shit macro, I haven't made one ever.
#define ERR_CHECK(cond, err_handler, msg) {if (cond) {fputs(msg, stderr); err_handler();}}

void some_err_handler() {
/* ... */
}

bool some_func(Struct* s) {
ERR_CHECK(!(s = malloc(sizeof *s)), &some_err_handler, "Blah blah blah");

/* ... */

return true;
};
>>
>>59791249
What a beautiful string of text. This post will end the argument.
>>
>>59791240
You confused homophones, that's not a "typo", that's borderline illiteracy which is hilarious considering you're chiding other people for "shunning knowledge without immediate value"
>>
>>59791177
The problem isn't with loops, it's with goto.
>>
>>59791263
Add a
__LINE__
to your output for improved usability.
>>
>>59791233
>>59791250
He is the average channer that probably has a miserable life. He thinks everything different is a meme, hates "sjw" languages, thinks only "numales" use things like R or Ruby, and engages the "C vs C++" threads. The common bottom of the barrel of society.
>>
>>59791263
#define log_error(msg) fprintf(stderr, "[ERROR] (%s:%d: errno: %d) %s\n", __FILE__, __LINE__, errno, msg) 
#define log_errorf(msg, ...) fprintf(stderr, "[ERROR] (%s:%d: errno: %d) %s\n", __FILE__, __LINE__, errno, msg, __VA_ARGS__)

#define assertm(cond, kill, msg) if(!(cond)) { log_error(msg); if(kill) { assert(cond); exit(EXIT_FAILURE); }}
#define assertmf(cond, kill, msg, ...) if(!(cond)) { log_errorf(msg, __VA_ARGS__); if(kill) { assert(cond); exit(EXIT_FAILURE); }}


Any function that can fail should return a bool and it should be checked by the caller that way if it's not a error that kills the entire program caller functions can adjust appropriately to a failed function.
>>
>>59791282
Defeated at his argument, helpless and confused anon cannot comprehend what the other anon is saying, and subsequently goes back to his instinctual phrases.
>>
File: 1477722759673.jpg (56KB, 500x500px) Image search: [Google]
1477722759673.jpg
56KB, 500x500px
>>59791277
By "looping" I mean non-termination, gotos can't be recursive in most languages which have them.
>>
>>59791270
Yeah dude sure. I don't know know how to write "discrete math". Fuck yeah...
>>
File: 1490761562480.png (372KB, 954x768px) Image search: [Google]
1490761562480.png
372KB, 954x768px
>>59791299
..why are you here?
>>
>>59791165
Ctrl+C merely sends a signal to the running program, such as signal's behaviour can be overridden by the developer.
>>
>>59791248
yeah im pretty gay desu I watch sissy hypno porn and get turned on by shemales but I have had sex with multiple women and surf the waves not the internet bitch

computers are for nerds. you program my shit to keep my lifestyle going nerds. pale nerds lmao.
>>
>>59791315
le special snowflake can't respond to an accusation and proceeds to talk as if he was david attenborough.

Fucking redditors.
>>
>>59791333
If he can't figure out why CTRL-C doesn't kill his program he probably didn't write his own signal handler.
>>
>>59791333
I misread. But at least I got trips.
>>
>>59791249
The majority of /pol/ are useless garbage who barely can do simple things like dynamic programming. They try to be original and different and better then others by showing here their knowledge of helloworlds in languages which are not in the mainstream, Haskell or ML.
>>
>>59791316
Well goto is the only "controversial" thing I have in my code so idk what you're trying to say
>>59791333
Elaborate pls
>>
>>59791332
To engage on "Intel vs amd" and "Nvidia vs Amd" desu...
>>
>>59791350
*/pol/ = /dpt/
>>
>>59791356
Lazy fuck.
https://www.gnu.org/software/libc/manual/html_node/Signal-Handling.html
>>
File: 1487935569956-0.png (402KB, 598x1021px) Image search: [Google]
1487935569956-0.png
402KB, 598x1021px
>>59791284
>>59791311
That's bretty cool and some good advice. Thanks for helping and not shitposting like 90% of what this thread has devolved into again.
>>
>>59791321
Hello loser.
>>
>>59791366
If a signal handler is not implemented then the compiler will add a default one - one that kills the program.
>>
>>59791340
>>59791321
>>59791282
>>59790860
What's with calling everyone redditors today? Shouldn't you have a legitimate argument about the topic at hand instead of insulting them?
>>
File: 1486678895770.png (122KB, 262x207px) Image search: [Google]
1486678895770.png
122KB, 262x207px
>>59791356
I'm saying you should remove all loops for which you cannot prove termination. Goto isn't really "controversial" if used properly.
>>
>>59791382
Just report for shitposting and hide.
>>
>>59791382
Was there a time that wasn't like this?
>>
>>59791359
Did someone say AMD?
Rizon will bring the company back for sure. Intel is toast. Blue and green is for fags. red is the coolest and edgiest color and will bring in the most sales.
>>
>>59791382
see
>>59791340
then
>>59791321
>>
>>59791372
as an addendum to error handling you can also look at implementing your own exception system using setjmp and longjmp, might be useful if you ever do embedded programming.
>>
>>59791411
Just use CEXCEPTION. It uses just that and works well.
>>
File: 2017-03-24_00-32-10.gif (863KB, 800x600px) Image search: [Google]
2017-03-24_00-32-10.gif
863KB, 800x600px
>>59790996
>https://github.com/vurtun/nuklear
its not there yet
>>
>>59791383
I have several loops where I'm iterating stuff until they give satisfactory numerical answers, though this shouldn't matter here because I have been able to terminate the program while one of these loops runs.
>>
File: detab2.png (20KB, 1658x585px) Image search: [Google]
detab2.png
20KB, 1658x585px
Which detab is more efficient?
Can anyone come up with a more efficient detab in c?
>>
>>59791430
Not allowed to pull random githubs for code in a lot of embedded projects, I've had to do everything in house in the past.
>>
>>59790964
Fresh pajeet's poo from streets.
Steve Jobs used that.
>>
>>59791451
You basically can't implement it much different than CEXCEPTION does it though. All you'd do is basically write the same code with slightly different names.

>>59791441
> until they give satisfactory numerical answers
Not every series is guaranteed to converge. Define a maximum number of tries and keep the closest you got to the target.
>>
>>59791449
you're still working on that? lul
>>
should I use the posix regex library, or the built-in c++11 one?
>>
>>59791484
built-in
>>
>>59791484
Neither.
>>
>>59791411
Yeah, I certainly noticed the similarities. Just wasn't sure if it was the right way to go for C.
>embedded programming
Any advice for how to teach and practice that yourself at home? I was thinking of programming for devices such as the NES since it has very limited resources, and I can use an emulator to easily test my work.
Finally, which C standard do you usually use for embedded systems?

>>59791430
I'll look into it, but I prefer to try stuff myself before I use these kind of libraries so I know how it works.

>>59791435
I thought they would've fixed that by now...
>>
Ahhh another thing that the average channer that rolls into CompSci also hates: HARDWARE. BOoooooOooo... It's scary... Le "hardware"... Anything that remotely approaches Architecture and Organization is met with a loud REEEEEE followed by "This is not CompEng!". So obviously something like ModelSim is literally the Antichrist.
>>
>>59791506
Go away special snowflake, you're not as smart as you think you are reddit
>>
>>59791501
Don't expect anything past C99. Wouldn't amaze me if they force C89 even on older stuff.
>>
>>59791483
I like thorough work. Its saturday and I have enough time.
Meanwhile I set up my visual studio
Read few pages of a probability book.
Shitposted here.
And looked up about Sweden truck simulator.

KRC is very good book in my opinion and its just 288 pages. I believe if I do it thoroughly I can optimize my socket program very well.
>>
File: owl.jpg (29KB, 248x248px) Image search: [Google]
owl.jpg
29KB, 248x248px
>>59791525
>mfw using C11 on microcontrollers at work
>>
>>59791518
Sure as hell smarter than you. Which explains why I'm here, to laugh and point at people like you to make me feel better about my own failings...
>>
>>59791536
lucky you
>>
>>59791537
>Which explains why I'm here, to laugh and point at people like you to make me feel better about my own failings
So you only come here to shitpost? Fuck off reddit
>>
>>59791501
>I thought they would've fixed that by now
even then its still too immature
i am gonna byte the nodejs bullet
>>
The reason I love C over Java or C++ is, C doens't have huge library.
Every now and then C#, C++ or Java would add tons of libraries. Using libraries make development faster but also makes you very dump.
>1)So the best bet is if you want to understand programming and underline computer science stuff workings, do C or LISP.
>2)If you are building a project or working for a company do Java,C# or C++.
But nobody told you to not to do both.
Both are necessary but I guess people should start with 1 and then slowly incorporate 2.
>>
>>59791565
>I like C because it has less tools and features
>smart people always reinvent the wheel and do not care about productivity
>>
>>59791565
Wow, an actually reasonable opinion on programming languages
Get off /g/
>>
>>59791553
>telling me to go off to reddit
>accuses me of shitposting

My dude
>>
>>59791576
It's like you didn't even read his post
>>
>>59791582
redditor, you need to go and stay go
>>
>>59791565
I love C because it feels adventurous to me; because of this, it's one of the few languages that I have fun programming in. Java, C#, and similar languages bore me to death.
Good post though, anon.
>>
>>59791540
It's not like it matters much. As of yet I'm only using features up to C99.
>>
>>59791565
Java is widely taught not only because it's ubiquitous, but because it is a great learning tool. It's a gateway drug. It is where you can start. It already comes with a buch of pre chewed libraries that do most things. It gets you up and running, exciting you to learn more. That's the way I view it though.
>>
>>59791576
Brainlet detected.
>>
>>59791576
It's not about reinventing the wheel you brainlet, it's about learning how the wheel was made so you can expand on the concept.
>>
>>59791637
>brainlet
post discarded
back to >>>/sci/ where you belong pondscum
>>
>>59791565
>1) Its for being a useless piece of shit all year long and then pretend/fake results so you can get more academic grants
>2) Its for getting shit done, if you don't deliver you get fired
Checks out
>>
File: markTwain.jpg (586KB, 1280x1024px) Image search: [Google]
markTwain.jpg
586KB, 1280x1024px
>>59791656
>>59791576
>>
>>59791657
This brainlet won't understand ever. Must be fucking Mexican or Indian.
>>
File: tmp_8731-1491365339516-921003892.gif (1002KB, 250x251px) Image search: [Google]
tmp_8731-1491365339516-921003892.gif
1002KB, 250x251px
What the fuck with the speed of the thread THIS late?
>>
>>59791695
>late
>>
>>59791695
>wanting 1post/hour
>>
>>59791715
better than this rampant shitposting.
>>
>>59791730
it was only one guy responding to another.
This is great compared to many other gens.
>>
>>59791730
People are waiting for you on the C or C++ thread, mate. Don't keep them waiting.
>>
>>59791741
>This is great compared to many other gens.
this is why /dpt/ is the only general I use.
>>
>>59791165
you might be blocking the console's read of the keyboard, loop on input not being pressed instead of breaking when input is pressed
>>
Something that I've discovered from spending so much time in a research lab over the past two quarters is that being in the same room as another human being dramatically reduces my productivity, although this effect is minimized by headphones. Is anyone else the same way?
>>
>>59791900
thats why mob-programming is a meme.
Same thing happens if you watch people stream programming.
>>
>>59791900
I dropped out of school because I can't handle being around others. Too hostile, mean, and scared
>>
>>59791900
yeah i get nothing done when there's people near me
>>
>>59791900
Not everyone has crippling autism
>>
>>59791900
>>59791915
>>59791925
>>59791937
>>59791954

>imagine doing work with someone standing behind you
>>
>>59791964
Thats why Ill never work for a big company. I imagine managers or leads will just do that whenever they want.
>>
>>59791964
I have; I fail 100% of the time. Almost got fired thanks to that.
>>
>>59791925

Eh, for pretty much all of my undergrad years, I didn't work with other people at all. Just go to class, then go home and do homework there. Having to work around others is primarily because we have a lab dedicated graduate research, and we've been told "we really want you to be using the lab." Also because I no longer have a Windows machine, and part of my research has involved Windows-based malware.

>>59791954

It's not really an autism thing, so much as it's a chatter thing. I don't split focus that well with programming. For me, an ideal situation is total silence, no sources of light except for that of my computer screen, and laying horizontally. Total sensory deprivation so that the only thing in front of me is my work. Incidentally, when I finally become a professor, I am going to relish having a door I can just leave locked when it is not office hours.
>>
Find a flaw.

Btw, don't bother replying if your reasoning contains the words 'SJW' or 'numale' because I have those things filtered.
>>
>>59792133
unsafeunsafeunsafeunsafeunsafeunsafeunsafeunsafeunsafeunsafeunsafeunsafeunsafeunsafeunsafeunsafeunsafeunsafeunsafeunsafeunsafeunsafeunsafeunsafeunsafeunsafeunsafeunsafeunsafeunsafeunsafeunsafeunsafeunsafeunsafeunsafeunsafeunsafeunsafeunsafeunsafeunsafeunsafeunsafeunsafeunsafe
>>
>>59792133
It's for SJW numale cucks only
>>
>>59792133
SJW numale cuck shit lang
>>
>>59791116
sounds neat

you'd probably want to rearrange the letters in a way such that the most often used characters have similar movements to increase typing speed
>>
>>59792133

Needs more time to get better libraries. Also, it's ugly as hell (but then again, so is C++, which is what it's intended to replace).
>>
How do I write universal GUI application for Linux/UNIX, so I could require less dependencies as possible?
>>
>>59792328
>universal GUI application
Define what you mean by "universal".
>>
>>59792345
>I could require less dependencies as possible?
>>
>>59792133
Can't find a flaw in a language no one uses.
>this triggers the rustards
>>
>>59792328
Draw straight using X11 I guess, although this will fail for Wayland users. Or set your terminal to non canonical mode and reimplement a basic curses for your application if you wanna do it in terminal.
>>
>>59792407
can't trigger the rustards if there aren't any
>>
>>59792227
>so is C++,
Factually wrong. The only ugly parts of C++ are template abuse that arises from abusing Boost for example, but that's as dumb as criticizing C for the insane function pointers or Haskell for the quadruple nested recursive calls.
>>
>>59792437
>The only ugly parts of C++ are template abuse
std::cout<<"ah yes the beauty of "<<"C++"<<std::endl
>>
>>59792383
I still don't really get what you're asking. Universal how?
Works on GNU/Linux? Works on Windows/macos as well? Works on Wayland as well?
What are you actually trying to accomplish?
>>
>>59792328
Don't. Develop only CLI programs.
>>
>>59792328
ImGUI
>>
>>59792414
If I want to cover both X11 and Wayland, I'd better use GTK?
>>
>>59792456
This. CLI is the future
>>
>>59792536
Its really not.
It just takes one library free of bullshit.
>>
>>59792451
>std::endl
Avoid this!!
>>
>>59792775
What is your suggestion for a system agnostic newline?
>>
>>59792783
\n
Because std::endl is just that except it also flushes.
Dummy.
>>
>>59792775
Why?

>>59792783
Is there no text mode binary mode like in C to translate '\n' into the correct string?
>>
>>59792790
Does the standard define "\n" to always print the correct thing (i.e. transforming it to "\r\n" on Windows)? Doesn't sound like a clever thing to do.
>>
>>59792805
>C++
>standard
What did he mean by this?
>>
>>59792828
C++ is the standard example of a bad language
>>
>>59792790
>String flushes anyway, unless you actually configure standard to not.

>>59792805
Yes, it does.

>>59792828
std is standard library https://en.wikipedia.org/wiki/C%2B%2B_Standard_Library
>>
>>59792832
Oh, then that was indeed correct.
>>
>>59792840
>String flushes anyway, unless you actually configure standard to not.
Who are you quoting this from?
>>
>>59792853
http://en.cppreference.com/w/cpp/io/ios_base/sync_with_stdio

Sorry to break the reddit meme.
>>
>>59792840
>Yes, it does.
So on Windows I can't write files with only '\n'? That's stupid.
>>
>>59792861
This link doesn't seem to contain the string "String flushes anyway, unless you actually configure standard to not.".
>>
>>59792867
The entire page is devoted to the topic.
>>
>>59792875
But how did you quote something which doesn't exist?
>>
>>59792882
You seem lost and looking for >>>/b/ to spam with memes.
>>
>>59792805
I don't see why you think std::endl would do anything useful. It doesn't adapt to the platform beyond what a \n does. The Cpp committee is stupid and they do things to confuse people into thinking they're improving on C. Get that in your head already.
It's just a \n and a flush. That's it. Practically everyone knows this now. If you wanted a flush you probably don't want it to be hidden in what just looks like a newline.
>>
>>59790860

Is FP any use for web dev? I tend to agree that the paradigm is an academic's toy
>>
>>59792891
What are you even babbling about now?
>>
>>59792894
>I don't see why you think std::endl would do anything useful.
I don't see how it's unreasonable to expect that std::endl would depend on the compiler implementation to print \n on unixoid systems and \r\n on Windows systems.
>It doesn't adapt to the platform beyond what a \n does.
Then why even have it? Why bother?
>>
>>59792899
http://elm-lang.org/
>>
>>59792840
>string flushes anyway
But that's entirely separate. Why would you use std::string is beyond me.
It's an awful string implementation. If you just want a generic solution go with Facebook implementation.
https://youtu.be/kPR8h4-qZdk
Here's a presentation by a rather flamboyant man but I think you can handle it.
>>
>>59792930
just supplying info m8.
And if we can slowly chip away at JS's, stranglehold, then thats good
>>
File: 1487817428138.png (154KB, 505x479px) Image search: [Google]
1487817428138.png
154KB, 505x479px
>>59792931
All streams listed on the page flush automatically with /n terminating.
>>
>>59792936
>we
Please don't liken me to your kind. I would never post the sort of thing you just posted.
>>
>>59792944
i dont even use elm or webdev though
>>
>>59792863
That's what 'binary' vs 'text' is for when opening files.
>>
>>59792917
I don't know why they did it for a fact. But I speculate it's to sow confusion about probability.
It's widely considered a mistake now. But calling it a mistake it just to have people start defending them from accusations of malice.
>>
>>59792948
Why did you try to promote your garbage language then?
>>
>>59792937
What page are we talking about?
>>
>>59792953
This leads to the next question about why text somehow magically isn't binary data now. Is ASCII not binary data? Is is non-binary? Fairy dust?
>>
>>59792968
This one. I'm pointing to it right now.
>>
>>59792955
Portability. Not probability.
>>59792969
You can view text vs binary as interpreted vs literal.
>>
>>59792969
ascii is encoding isn't it?

>>59792971
>/dpt/ invaded by webdevs
>>
>>59792971
I'm sorry I can't see what you're pointing at anon.
>>
>>59792976
>you can view a <=> b as x <=> y
Indeed.
>>
>>59792969
They needed a name for a mode which does certain character conversion needed for displaying text properly, so 'text mode' seemed an appropriate name.
>>
@59792962
>is there anything that does x
>yes its <this>
>WOW WHY ARE YOU ANSWERING QUESTIONS STOP

(You)
>>
>>59792977
>>59792989
Who said this?

>>59792994
Can you stop typing in this retarded fashion if you aren't quoting anyone?
>>
/dpt/ is so different from the rest of /g/.
>>
>>59793008
>How many times can you use this meme before being banned.
>>
#59793008
How's your first week on /jp/?
>>
>>59792976
>You can view text vs binary as interpreted vs literal.
You can also view random binary files and let some program interpret it as text.

>>59792977
>ascii is encoding isn't it?
The result is still some binary data.

>>59792991
My point is that making a distinction between "text" and "binary data" is stupid. Introduce good functions that take care of that and don't fucking mess with data written to a file. Because it seems you'd have to write all your """text""" files as """binary""" if you want the contents to be the same on all platforms.
>>
>>59793015
Did your post have a point? I didn't say that.
>>59793017
You're being very short sighted.
>>
>>59793024
>Because it seems you'd have to write all your """text""" files as """binary""" if you want the contents to be the same on all platforms.
No. The content of a text file is lines (without eol). The content of a binary file is the bytes. If you never confuse you'll have no problem. Wanting the same SHA1 for text files is stupid, it has no semantics.
>>
>>59793024
>My point is that making a distinction between "text" and "binary data" is stupid. Introduce good functions that take care of that and don't fucking mess with data written to a file.
Then your issue isn't about distinguishing text vs binary data, but about having explicit functions vs a global mode which switches internal conversion functions on and off, it's a tradeoff between terseness and hidden assumptions vs explicitness and verbosity.
>>
>>59793024
Anon the reason there is text mode and binary mode is because of how there's different platforms. Text mode is for reading and writing text in a consistent format that's supposed by the platform. Binary is for when you wish to control that yourself. As I said you can think of it as interpreted mode and literal mode. Binary mode is literal because it doesn't change what you output. Text mode adapts to the platform (\r\n on Windows instead of just \n for instance).

I agree there's plenty of in-software binary vs format confusion that's dumb but we're kinda going off topic here right?
>>
>>59790953
QML
>>
do you avoid more than 3 levels of indentation?
>>
>>59793203
I avoid <3 lines of indentation
>>
How would I go about going from interfacing C++ to HTML. In my program I want to find a string from an API, and then print out the URL next to the string. Idk where to start though.
>>
>>59793203
No. That's a pointless rule.
But my lines are less than 73 characters long.
>>
>>59792133
static lifetime checks are fucking stupid
they wanted to solve a problem, instead of solving it, they require you to do a fuck ton of ugly boilerplate, that's not a solution
>>
>>59791900
It depends, at my work there are bants and laughs but when there is work to be done people don't usually talk since they are busy
>>
>>59793217
just use electron like a good boy
>>
>>59792451
can we just deprecate iostreams already
>>
>>59792451
>>59793431
Literally nothing wrong with that.
>>
>>59793431
>>59793438
buffered inputs were a mistake
>>
I don't read posts that try to quote people but don't do it properly or try to @Quote like this

This isn't twitter, fucktards
>>
@59793454
You don't seem to understand the subtext of @.
It's saying that you don't deserve the (You) that you so desperately desire.
>>
>>59793516
Go to twitter faggot, you don't belong here
>>
@59793524
What is this 'twitter'? I've literally never heard of it. Why would I be going there?
>>
>>59793454
>>59793516
>>59793524
>>59793546
Go back there, both of you
>>
>>59793546
What a fucking newfag, lurk more before you try to quote people reddit/twitter cancer
>>
@59793549
Link? Is it even a good site? Why are you trying to send me there?
>>59793556
>reddit
Do they still exist? Or aren't they an endangered species?
>>
So what happens in C++ when I have two a specialized template for bool and another one with std::is_integral? Because apparently std::is_integral returns true for booleans.
>>
>>59793565
it chooses the more specialized one, so if you feed it with bool, it chooses the bool one
>>
>>59793562
newfag, lurk more and learn to quote
>>
>>59793576
Alright, cool, thanks.
>>
File: 1452403462150.png (79KB, 307x400px) Image search: [Google]
1452403462150.png
79KB, 307x400px
>>59793580
This may be a much stronger, more complex emotion on your end.
>>
>>59793601
What? I was just telling the newfag he should lurk more instead of failing at the quote feature
>>
Stop shitting up the thread, no one cares about your blogs
>>
>>59793616
nice blog
>>
>>59793616
sick blog how do i unsubscribe
>>
File: 1476641442264.png (682KB, 1226x813px) Image search: [Google]
1476641442264.png
682KB, 1226x813px
@59793610
Bah, you tried.
>>
>>59793629
Get out newfag, stop failquoting
>>
File: 1420918288135.jpg (28KB, 351x344px) Image search: [Google]
1420918288135.jpg
28KB, 351x344px
@59793636
I'm quaking in my boots, truly.
>>
>>59793656
This isn't twitter, you quote people with two angled brackets >>, lurk more
>>
>>59793668
trolled
>>
>>59793672
>i was only pretending to not know how to quote!
>i was only pretending to be retarded!
Okay.
>>
File: 1487930506024.jpg (219KB, 1920x1080px) Image search: [Google]
1487930506024.jpg
219KB, 1920x1080px
@59793668
How in the fuck can anyone actually be this brain dead? How is it even possible to deny human instincts?
>>59793685
Who wrote this? Please tell me.
>>
>>59793688
retarded newfag still can't figure out how to quote lmao, he only gets it right half of the time

what an idiot
>>
>>59793688
double reverse trolled
>>
@59793695
#rofl
>>59793705
I hear fucking on the beach is a bad idea because sand gets into your naughty bits.
>>
>>59793733
How are you this stupid? You really can't figure out how to quote people after this much help?

Newfags need to go back to r*ddit where they came from.
>>
@59793749
I actually just flipped over to the /g/ interface to make this post, and it's pretty funny how unintelligible /dpt/ is like this.
>>
File: 1491009506251.jpg (24KB, 324x278px) Image search: [Google]
1491009506251.jpg
24KB, 324x278px
@59793695
>The fucking reddit spaces calls someone else a newfag
>>
>>59793773
reddit spacer*
>>
Stop shitting all over /dpt/ and start solving google codejam qual round my dudes
>>
>>59793764
>>59793773
learn to quote, this isn't twitter idiots, you use two sideways chevrons like this

>>(person you want to quote)

How new are you idiots? When did you come to 4chan? 4chan isn't for redditors, kids, we are the final boss of the internet.
>>
@59793789
The problem is that you probably aren't seeing all the posts. If you are just viewing /dpt/ through the /g/ board, you don't see the green posts, the posts with letters in their ids, or anything numberless.
>>
>>59793796
Newfag you still haven't learned to quote, I bet you still run Windows too
>>
File: 1456891155662.png (251KB, 600x490px) Image search: [Google]
1456891155662.png
251KB, 600x490px
@59793803
Lofty goals anon
>>
This thread is so shit. Also check'em.
>>
>>59793848
some of us dont have a choice
>>
How do I proceed with a vtable error? Resources?
>>
>>59793789
>>>/mlp/
>>>/trash/

So about that.
>>
>>59790939
You have zero reason to think that and are just parrotting shit you heard on /g/ to fit in.
>>
>>59793546
>What is this 'twitter'?

https://twitter.com/dpttxt
>>
>>59793905
use rust
>>
>>59793905
undefined reference to vtable?
make sure all virtual functions are defined.
>>
>>59793217
ok Fuck idk what to do. I'll start with printing Hello World in C, then sending it to a page to print it out on a page? Or should I be using python for something like this.
>>
>>59794250
yes use Python
also what exactly are you trying to achieve?
>>
>>59794299
My Program is a basic/retarded version of Pokemon Go.

>Program In C++ Goes through an array of Pokemon Names
>Randomly Chooses 1
>Assigns this to another String Variable


> I am Here

> Using this String Variable, Go to an API/Website and search for a string that is equal to the string variable
>Print out the "imageURL" variable next to it which contains a picture of the Pokemon
>Print this out to local Web Page
>Press Pokeball and Go back to C++ Program to determine if Caught or not

Idk how to connect different programs together though.
>>
I meant to ask for assistance in a simple JS userscript but managed to handle it on my own. Thanks for nothing.
>>
>>59794250
>>59793217
If you want to output different information to a page in real time, you pretty much have to use javascript.
Although your first post sounds more like you are trying to reinvent something like PHP or Perl.
>>
>>59794365
Do you mean that you press the Pokeball /on the local website/ and have it go back to the C++ program?
Because in that case you're looking for a web server/web backend script instead.

Check out Flask (http://flask.pocoo.org/), you can do what you want to do in like 20 lines of code or less.
>>
>>59794388
the first post was just trying to get the basics of interfacing different programming languages. So should I be working on Javascript instead of C++, or do I send result from C++ to Javascript program and get API.

In my class we used Python to parse data from webpages and printed out the results on a Linux Terminal (like searching for time on webpage and printing it out).

Difference here is that I'm starting with C++ and want to send this result to python/javascript to find the info I want from the websites?
>>
>>59794433
Well, something like this (pretty barebones with no error checking and stuff):
from flask import Flask, render_template_string
from random import randint
import requests

app = Flask(__name__)

POKEMONS = ['Bulbasaur', 'Charmander', 'idk']
API_ENDPOINT = 'https://whatever/{}'

@app.route('/')
def route_index():
req = requests.get(API_ENDPOINT.format(
POKEMONS[randint(0, len(POKEMONS - 1))]
))
info = req.json()

return render_template_string(
'<img src="{% image %}">'
'<a href="/catch/{% name %}'
, image = info.whatever, name = info.whatever)

@app.route('/catch/<string:name>')
status = 'You failed to catch the Pokemon.'
if randint(1, 2) == 1:
status = 'You caught the Pokemon!'

return render_template_string(
'<strong>{% status %}</strong>'
, status = status)

if __name__ == '__main__':
app.run()
>>
>>59794433
When pokeball is pressed, the C++ Program then determines probability of it being caught, and will then print if it was successful or not. I'll look into flask right now
>>
It's so, so nice to program in C or C++ after months of weakly typed javascript shit. God, I am home
>>
>>59794646
>C or C++
>>
>>59794646
C++ is fucking disgusting, though. How on earth could you enjoy that?
You're sick.
>>
>>59794726
We've all got our fetishes.
>>
>>59794726
>>59794699
c babbys are awake again, I see
>>
>>59794726
>malloc() isn't disgusting

Fucking "new" is pure.
>>
>>59794486
Just to be absolutely clear, are you actually making something that outputs to a page that is served to somebody via the interweb, or are you just talking about accessing and scraping pages and using that information locally within your executable?
I mean, you said "Print this out to local Web Page" but I'm not seeing how that ties in, and your requirements are a lot more lenient if you aren't serving something.
>>
Anyone here has any experience creating plugins for cordova using plugman?
The IDE part is the one annoying me, specially on iOS
>>
>>59794780
the only internet involved is going to the API to get the imageURL. This one in particular.

https://api.pokemontcg.io/v1/cards?page=5&pageSize=1000

So I look for the string "Charizard" and print out its corresponding URL to my local webpage, not something actually on the internet, but rather looks like

file:///C:/Users/Pokemon.html

From there, I press the pokeball that is also on the webpage, which will then go back to some program (Back to C++ one?) that calculates probability of catching and then printing if it was successful or not on the terminal.
>>
>>59794778
It calls malloc eventually, anyway.
>>
Anyone working on the Google Code Jam qualification round problems?
>>
>>59791435
looks like you're using it correctly and blaming the library instead of your shit programming skills
>>
>>59794930
>Anyone working on the Google Code Jam qualification round problems?
pls insert link

>inb4 yes I can google that, but too lazy
>>
I have no interest in making languages, compilers, or little useless programs so lisp isn't for me. If I want functional I'll use Scala or Haskell.
>>
NEW THREAD WHEN?
>>
New thread:
>>59794995
>>59794995
>>59794995
Thread posts: 317
Thread images: 30


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