[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: 348
Thread images: 42

File: 1498408261711.jpg (128KB, 600x1005px) Image search: [Google]
1498408261711.jpg
128KB, 600x1005px
Old thread: >>61114866

What are you working on, /g/?
>>
>>61122451
Daily reminder C++ obsoletes all other languages other than ML and Lisp families.
>>
File: c-3.png (40KB, 1620x774px) Image search: [Google]
c-3.png
40KB, 1620x774px
>>61122474
>>
rewriting C++ in OCaml
>>
http://harmful.cat-v.org/software/c++/I_did_it_for_you_all
Worth a read.
>>
File: 1498117439711.png (753KB, 1338x5868px) Image search: [Google]
1498117439711.png
753KB, 1338x5868px
>>61122474
C++ killed the art of programming.
>>
>>61122483
>Why do people want this? I don't get it.
do(you(actually(enjoy(your(shit(like(this?)))))::dumb::faggo<T>))
>>
>Why do people want this? I don't get it.
It results in MUCH cleaner,elegant, and expressive code. Especially when working with ranges.
Although C++'s would probably use :: like Rust, so itd look gross.
>>
>>61122512
AHAHAHA THAT DAMAGE CONTROL
>Interviewer: So how exactly did you do it?
Stroustrup: It was only supposed to be a joke, I never thought people would take the book seriously. Anyone with half a brain can see that object-oriented programming is counter-intuitive, illogical and inefficient..
>>
>>61122512
>Stroustrup:
>Well, one day, when I was sitting in my office, I thought of this little scheme, which would redress the balance a little. I thought ‘I wonder what would happen, if there were a language so complicated, so difficult to learn, that nobody would ever be able to swamp the market with programmers? Actually, I got some of the ideas from X10, you know, X windows. That was such a bitch of a graphics system, that it only just ran on those Sun 3/60 things.. They had all the ingredients for what I wanted. A really ridiculously complex syntax, obscure functions, and pseudo-OO structure. Even now, nobody writes raw X-windows code. Motif is the only way to go if you want to retain your sanity..
What a nice guy. He saved us from the pajeet.
>>
>>61122584
You know thats a fake interview right?
>>
>>61122602
you know you are lying right?
>>
>>61122602
This one's real:
C++ is a horrible language. It's made more horrible by the fact that a lot
of substandard programmers use it, to the point where it's much much
easier to generate total and utter crap with it. Quite frankly, even if
the choice of C were to do *nothing* but keep the C++ programmers out,
that in itself would be a huge reason to use C.
>>
>>61122611
>Bjarne hates Linux
>Linus hates C++
I see a pattern
>>
>>61122606
http://www.networkworld.com/article/2222576/software/snopes-com-debunks-old-c----interview--hoax.html
>>61122611
Linus is great, but C is shit.
>>
>>61122639
C++ killed programming
>>
>>61122602
>fake
Anon didn't you read the leaks back then? Every source that 'debunks' this references exchanges that are way later.
>>
>>61122602
damage control at it finest
sepplesfag truly are worst kind faggots
>>
>>61122690
>implying i use pajeetware
>>
>>61122584
Regardless of who says it it's completely true for anything but the simplest programs. And oop people tend to plead that there are no big programs that are done in 'good' poo. But even if this were simply developer incompetence you must ask why large oop programs aren't as easy to do as imperative programs.
>>
>>61122736
>But even if this were simply developer incompetence you must ask why large oop programs aren't as easy to do as imperative programs.
Because that's completely untrue, lol
>>
>>61122639
>"debunking" satire
wow thanks internet you couldn't be even dumber than I thought
>>
File: IMG_5516.jpg (521KB, 3000x2000px) Image search: [Google]
IMG_5516.jpg
521KB, 3000x2000px
rate this.

Got it out of the uni library today, because my prof said it is good.
Will I become a power programmer now?
>>
>>61122762
Well when retards unironically believe it, it needs to be done.
>>
Please help me /g/

- Been a python programmer hobby/professionally for 6 years
- Read K&R, literally too stupid to do anything right in C beyond their exercises
- Decide to learn Go, get familiar with the syntax

How do I learn all this stuff that feels naturally for me in Python?
For nearly any problem it doesn't take long to come up with a proper strategy (OOP, comprehensions, using namedtuple or enum or whatever standard library module that fits the job perfectly). In Go I have to think/google for hours and come up with what feels like a hacky solution.

Is there any way to learn the 'mindset' of a new programming language?
>>
>>61122856
Python kills your brain
>>
>>61122870
Can I un-kill it?
>>
>>61122885
Yes, a good dose of Idris may fix you
>>
>>61122911
>thinking he will even get past functions when he can barely do C
>>61122885
Just keep at C mang. and stop using python, seriously.
>>
File: old_hag_langs.png (173KB, 600x355px) Image search: [Google]
old_hag_langs.png
173KB, 600x355px
Reminder that not everything is a function.
>>
File: durple.png (73KB, 1289x719px) Image search: [Google]
durple.png
73KB, 1289x719px
>>
>>61122957
Youre right, there can also be obscene macro hacks :^)
>>
File: 1486403872071.png (174KB, 962x543px) Image search: [Google]
1486403872071.png
174KB, 962x543px
>>61123003
>>
>>61122957
This

Some things are free variables
>>
>>61122451
>>61122486
>>61122518
>>61122556
>>61122584
>>61122591
>>61122611
>>61122650
>>61122690
Reminder that C++ is the best language even though it's ugly and dirty. Java is also quite good even though it's even more disgusting.
Reminder that real programming is never pretty and clean. Faggots who write "cute," "comfy," or "elegant" code are good programmers, but they're also smelly NEETs who sleep with dolls of little girls.
Reminder that real programming is functional, object-oriented, imperative, AND declarative, and uses recursion AND iteration, and there's no rhyme or reason, nor any other kind of decency, as to what's used when for what.
Reminder that if you don't hate your code, hate the language you work with, hate your boss, and hate your life, you're almost certainly not making anything useful.
Reminder that efficiency matters more than abstraction, readability to your superiors who are stupid and know nothing about programming matters more than either, and your little programmer fee fees and "time" are lowest possible priority.
Reminder that programming is a job. Not a hobby. Not a field of study. A fucking job.
>>
File: 1498310847457.png (9KB, 637x130px) Image search: [Google]
1498310847457.png
9KB, 637x130px
>>61123048
>>
>>61123048
C++ killed programming.
>>
>>61123104
If by "bad" you mean disgusting then yes I agree. But reminder that this is not actually bad because the needs of the industry outweigh the needs of the programmer.
>>61123116
Programming's been dead from the start you fat faggot.
>>
>>61123048
>>61123143
>Brainlet C++ code monkey
>>>/out/
>>
>>61123048
There's no strict dichotomy between nice and useful, in real life there are degrees. On the large project I'm working on, there are components in different languages. The C components are much nicer to work on than the Java components.
>>
>>61123175
>code monkey
Reminder that code monkeys are the only kinds of programmers the world will ever need and any skill beyond that is wasted.
I'm competent in many """better""" languages that are worlds more advanced and more expressive. They're """"great"""" -- in the sense that if I ever programmed for a hobby, I'd definitely use them instead. But why the FUCK would I ever PROGRAM for a FUCKING HOBBY.
>>
>>61123217
Because I don't sell programming as a fast food product.
>>
>>61123217
lol ur gay
>>
Are programmers math rejects? I feel like I started programming because I was to dum for math
>>
>>61123242
>Because I don't have a job. I'm so sheltered by the state that I haven't yet learned that "wage slave" isn't a real insult because there are only three kinds of people: "wage slaves," "welfare babies," and "corporate fatcats."
ftfy
>>
>>61123300
>Because I don't have a job.
What makes you say that, indian code monkey?
>>
>>61123309
>code monkey
Reminder that this is the only kind of job in software development that exists. If this is not what you do, you do not develop software.
>>
>>61123035
What even is blend? Why push it so hard?
>>
>>61123217
These C++ ""programmers"" make me cringe
>>
>>61123320
Yeah, I don't "develop" software like a tamed monkey. Is that too hard to fathom?
>>
>>61123048
>c++ is the best
>presents Java as the second option
Yep. You're certifiably retarded anon. I won't bother reading more.
>>
>>61123342
What else do you expect from a monkey?
>>
File: anal beads.png (148KB, 651x905px) Image search: [Google]
anal beads.png
148KB, 651x905px
>>61123323
>Why push it so hard?
What are you talking about? They don't give a shit about Blend. I'm not sure why the one anon keeps spamming that same screenshot in these threads.

Blend is basically a WYSIWYG GUI editor on crack for GUI frameworks like WPF, plus web stuff. It's good for what it does, but the WYSIWYG editor built-in to Visual Studio runs on the same tech and is perfectly adequate.
>>
>>61123327
The only cringeworthy faggots here are the pathetic slobbering NEETs who actually have little enough going on in their lives that they have enough attention span left over to consider programming as something to actually enjoy.
>>
if you're favourite project isn't named after you're waifu why did you even become a programmer
>>
>>61123342
He is right though
>>
File: ran's_DMRG.png (1MB, 900x1440px) Image search: [Google]
ran's_DMRG.png
1MB, 900x1440px
>>61123291
Honestly it's cool and all to idolize and glamourize the fancy math and physics that's going on out there but you have to realize that only the genetically and economically blessed 0.001% get to do cutting edge research in pure theory. In this day and age there is no reason to not incorporate automated computations into your work. Unless you can prove your problem is undecidable you better had some sort of simulations or plots to go with it.
>>
>>61123337
Indeed, you're more like a wild sloth.
>>61123342
It's a truth that becomes self evident as soon as you step out of your protective bubble and let the world use you and drain you like everyone else has to do to survive.
>>
>>61123371
Is there anything more cringeworthy than seeing a low wage code monkey calling others NEETs?
>>
Who let this angry brainlet in?
>>61123048
>>
>>61123413
A "low wage code monkey" is the opposite of a NEET.
Corporate fatcats are also basically NEETs, because they don't really have "jobs" so much as petty theft gigs.
>>
File: 1497832251953.png (206KB, 2724x2200px) Image search: [Google]
1497832251953.png
206KB, 2724x2200px
>>61123048
>Reminder that real programming is never pretty and clean.
This is a funny way to call yourself a brainlet
>>
Reminder that contributing to open source is a corporate slavery in the nutshell.
>>
>>61123441
>>61123471
Allow me to rephrase, because you cunts don't seem to understand.
Reminder that real programming is whatever your boss says it is no matter how much you hate it, and if that situation does not apply to you, you are a piece of shit.
>>
>>61123454
Corporate fatcats have tons of interchangable code monkeys like you, that only makes them superior.
>>
File: 1498343626332.jpg (27KB, 450x370px) Image search: [Google]
1498343626332.jpg
27KB, 450x370px
>google a problem for calc 2 class
>sites title is calc 3 exercises
hmmmm rly made me tink
>>
>>61123479
More like NEETdom in a nutshell.
>>
>>61123510
>superior
Bitch please.
Just like a disgusting rich slob to say superiority is defined by what you "have."
>>
>>61123503
>real programming is whatever your boss says
Yeah, some people are hired just for that. They are not allowd to innovate because they are bad at that.

I'm sorry you have a very wrong perception of the so-called "real" programming. You will never make it.
>>
>>61123544
>innovate
Sorry, I don't read posts with buzzwords. Please rephrase
>>
>>61123560
Oh my! Did I strike a nerve there?
>>
>>61123544
brainlet C++ pajeet BTFO
>>
>>61123560
May be your office has a dep called "R&D"? That's a place where low quality "programmers" such as yourself aren't allowed in..
>>
>>61123544
>They are not allowd to innovate because they are bad at that.
Incorrect.
We are not allowed to innovate because rich people are thieves and are allowed to take whatever """"""job"""""" they want for themselves so of course they'll pick something shit-easy like being an """""""""""""""""""""""idea guy."""""""""""""""""""""""
Because of corporate greed, there is literally no overlap between programming and deciding what needs to be programmed, except among the self-employed, who are basically just NEETs.
>>
>>61123605
But anon, I think he is a freelancing monkey
>>
>>61122493
Wut?
>>
>>61123614
Oh my, you replied to the post again. Looks like I really hit too close to home there, brainlet monkey.
>>
>>61123646
>again
Please explain. That was the first time I replied to it.
>>
>>61123619
>C++
>Java
Not surprised there
>>
File: ....png (170KB, 263x345px) Image search: [Google]
....png
170KB, 263x345px
Friendly reminder that programming is a means to an end.

Programming is the application of useful knowledge to efficient methods of giving computers instructions.

If you're programming, and you don't also have a background in another useful field, you're the definition of a code monkey.
>>
>>61123560
>>61123574
>>61123586
>>61123605
see: >>61123614
>>
>>61123614
>another failure blames "rich people"

lol
>>
>>61122451
void ErrCnt(list<myType>::iterator it){
// i need an if statement which does:
// if (it != end of the list it belongs to)


How do I do this without passing the list as an argument?
>>
>>61123614
>waah rich people are bad because they never promoted me waah
What a sore looser. Sad.
>>
>>61123676
It's simply the truth though.
>>
>>61123614
>rich people are thieves
Fuck off, commie
>>
>>61123696
>It's simply the truth
It absolutely is not.
>>
>>61123694
No, rich people are bad because they use loopholes to fucking steal from everyone.
>>
>>61123560
>Boss assigns you to make a program that does some thing
>You decide what language to use, what libraries to use, and how to write it.

If your job isn't like this you should get a new job.
>>
>>61123720
You will never make it, brainlet loooooser
>>
>>61122451
im making a app so people can know how ghey they are through monitoring they app usage . its not going to track web activity just what apps you use and how often and the updates will add new shit to the list of ghey as fuck apps

each day when you start it up it will show a ghey image of varying severity depending on the previous days activity (going by internal clock not 24 hours later). starts with some boy wearing a dress and ends with full on ghey pron stills all of the images are given the caption "you". for the sifrst day it updates your gheyness every 30 minutes
>>
>>61123705
>>61123715
see: >>61123720
>>
>>61123734
That wasn't actually a response.
>>61123725
Jobs like this don't exist unless they're """""""""""""""""""""""""""""""""""""""""""""jobs""""""""""""""""""""""""""""""""""""""""""""" and only accept people who were born into large inheritances that can be traced back to railroad bullshit.
>>
>>61123720
>>61123738
Don't you people have trashcans to be knocking over?
>>
>>61123756
What part of the world do you live in where jobs like that don't exist? I'm a goddamn intern at a (small) American engineering consultancy company and they let me use whatever I want.
>>
>>61123720
>>61123738
Define "rich"
Define "bad"
Define "steal"

>>61122451
Programming in Power Query M™
>>
>>61123780
>define "steal"
double taxation
>>
>>61123758
No, because I can afford to live a barely reasonable quality of life because I actually work, unlike you faggots who drink lattes all day and fart fucking DIRECTLY into your chairs and get paid massive amounts for this and nothing else.
If I did have to eat out of trashcans, I'd still be glad I don't have to eat literal shit like your asses do when you go brown-nosing around the office.
>>
>>61123775
>I'm a goddamn intern at a (small) American engineering consultancy company and they let me use whatever I want.
Oh.
You must be one of those """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""people""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" from the west coast.
>>
>>61123810
That reminds me about the time I farted in the office, smell was military grade bioweapon. I thought it was alright because I was alone.

>mfw our hr qt pie comes right after that to get something and asks "what is that smell"
>>
>>61123852
>That reminds me about the time I farted in the office, a tiny assmad poorfag came out, I think he might be this guy.
ftfy
>>
>>61123810
>and fart fucking DIRECTLY into your chairs
Where the fuck do you fart, faggot?

Also, just because I get paid plenty, doesn't mean I do any sort of brown-nosing.

In fact, I insulted my way to where I am now. Most meetings are spent shitting on what other people have to say, and proposing cheaper/faster/more effective alternatives. I constantly get taken aside for being too aggressive, particularly with clients and upper management, but I produce results.
>>
why does everyone here hate java

what languages DO you like?
>>
>>61123810
I don't really like Latte's, although I do on occasion fart in my chair. I do work hard at my job, and I don't know how my ass could eat shit.
My reference to trashcans was not eating out of trashcans. I was thinking of the videos of ancomm protesters knocking over trashcans in their cities.

>>61123836
I've never been farther west than Chicago, and I don't see the appeal of California. I live in upstate NY, Syracuse area. It is very cold in the winter, but I've never had a serious hurricane, tornado, or earthquake so I kinda like it here.
>>
>>61123878
>In fact, I insulted my way to where I am now.
Well this is even worst actually
>and proposing
>which is to say you didn't actually make them
>an """""""ideas g[o]y"""""""

>I produce results
Yeah.
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""(You)"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" produce results.
Sure thing buddy.
>>
Wait, what's wrong with farting in a chair? Am I supposed to go to the bathroom everytime I need to leak some gas, sometimes we even fart together with our lead
>>
>>61122451
learning CUDA

the skill floor is quite high, got a working GPU based matrix multiplicator though
>>
>>61123928
He wants you to fart on /g/ with posts like >>61123926
>>
>>61123881
C#
>>
>>61123878
>Where the fuck do you fart, faggot?
>>61123903
>although I do on occasion fart in my chair.
>>61123928
>Wait, what's wrong with farting in a chair?

Of course everyone does this. The implication is that this is literally all you do.
Which of course is bullshit, but the least you could do is attack it for the bullshit it is, rather than deliberately misunderstanding it.
>>
>>61123881
java
>>
>>61123810
>unlike you faggots who drink lattes all day and fart fucking DIRECTLY into your chairs
Haha lol I love toilet humor.
>>
I've recently started learning Java as I know a lot of people who program in it and said they can get me gud job eventually.

I've gone through some online courses (CodeAcademy & SoloLearn) but they cover the basics and stop abruptly, any other tutorials start much more in depth with things that aren't covered (console, arrays, etc).

My intention is to build a portfolio of the below, but no tutorials I've found come remotely close

My goal is to make:
>Slot machine jackpot game
>Interactive gas station pump display (hold button down to roll price and multiply by liters)
>Tic Tac Toe
>Website listing for fake animal adoption agency (or something similar)

Any advice/ebooks/recommendations to get me to the point where I can attempt to make those would be greatly appreciated.

I've never visited /g/, I hope I haven't committed an awful faux pas or been meme worthy.
>>
>>61123991
>le
>>
>>61124001
For graphics in Java you should use JavaFX. I recommend Thinking in Java by Bruce Eckel. It's available for free online.
>>
>>61124001
These are newbie projects, die.
>>
>>61124001
>I hope I haven't committed an awful faux pas or been meme worthy.
Welcome to /g/, where it's literally impossible not to do this under any circumstances because everyone is a meme shitter who would make fun of a fucking rock on the sidewalk and the community bitterly hates every language for its own special reasons.
>>
>>61123971
If that was the case then why did he put emphasis on the word DIRECTLY
>>61124065
He's a newbie
>>
>>61123971
I think the issue was the almost voiced incredulity with the usage of "DIRECTLY", which made the intent get lost in translation.
>>
>>61124080
>If that was the case then why did he put emphasis on the word DIRECTLY
probably to imitate game grumps and vinesauce because this prick belongs on >>>/v/
>>
>>61124116
>youtuber bullshit
Ahh, so he's underage, that explains his outburst
>>
>>61124001
>Slot machine jackpot game
>Interactive gas station pump display (hold button down to roll price and multiply by liters)
>Tic Tac Toe
javafx http://tutorials.jenkov.com/javafx/index.html
or libgdx https://github.com/libgdx/libgdx/wiki

>Website listing for fake animal adoption agency (or something similar)
spring https://github.com/arnaldop/enhanced-pet-clinic
>>
>be racist
>need to justify racism
>arbitrarily decide C++ and Java are shit languages that only brainlet pajeets would use
>use brainlet pajeets using these languages as proof they are bad
>circular reasoning doesn't matter, is proud white, so is right
>meanwhile stubbornly write C code being responsible for exploit after exploit because believe self can't be wrong and using C makes self better than everyone else
>not even ironic about this
/g/ and /dpt/ in a nutshell.
>>
Anybody got a tutorial site for opengl 3.1 on loonix ?
>>
>>61124271
But pajeets use virtually any language. And they do so poorly. That's the problem.
>>
>>61124271
you should learn to write english nigger
>>
>>61124065
Of course they are, I explained I'm a newbie you cunt.

>>61124062
Thanks I'll check out the book, and I already have the Java JDK for Eclipse, is JavaFX included in that?

>>61124068
Everywhere is a shithole I guess.
>>
>>61124304
>what is greentext
>>
>>61124307
>Eclipse
Use IntelliJ, it's way better
>>
Are any of the newer book on C any good or should I just read K&R?
>>
>>61124344
K&R is tried and true
>>
>>61124387
c++14
>>
>>61124328
i use the ultimate edition, and it's way better than eclipse, but i can't vouch for the community edition.
>>
i need help with a basic java program that i'm stuck on

can anyone see what's wrong? besides being terrible code in general, i mean what's causing the erroneous output

>code
https://gist.github.com/yvesklein/a74c180a2abd6880f8184a5cf424951a

>problem
http://www.codeabbey.com/index/task_view/modulo-and-time-difference

pls halp
>>
How can I fix my shit attention span
>>
I posted yesterday at: >>61117788

tl;dr can't get game controller to work at all in SDL2, switching libraries isn't possible for this project.

In response to: >>61117930

There's not much code I have, but the code that is there should work but it's not.

case SDL_CONTROLLERDEVICEADDED:
I_sdl_ContAdd ( event.cdevice );
break;
case SDL_CONTROLLERDEVICEREMOVED:
I_sdl_ContRem ( event.cdevice );
break;
case SDL_CONTROLLERBUTTONDOWN:
case SDL_CONTROLLERBUTTONUP:
I_sdl_ContBtn ( event.cbutton );
break;
case SDL_CONTROLLERAXISMOTION:
I_sdl_ContAxs ( event.caxis );
break;


There is code from my SDL event manager, those functions don't have much in them at the moment, right now I have it so that it sets an integer to event.which.

static void    I_sdl_ContAdd ( SDL_ControllerDeviceEvent event );
static void I_sdl_ContRem ( SDL_ControllerDeviceEvent event );
static void I_sdl_ContBtn ( SDL_ControllerButtonEvent event );
static void I_sdl_ContAxs ( SDL_ControllerAxisEvent event );


And I have both
SDL_Init( SDL_INIT_VIDEO )
and
SDL_InitSubSystem( SDL_INIT_GAMECONTROLLER | SDL_INIT_JOYSTICK )
called.

I even added these bits of code that I saw "might" help
SDL_GameControllerAddMappingsFromFile ( "./gamecontrollerdb.txt" );
SDL_GameControllerEventState(SDL_ENABLE);


Still can't get anything to work. Any ideas?
>>
>>61124647
Turn off your phone, turn off your computer, remove all distractions.
>>
>>61124677
I should add that none of the events even register in the first place. I have other events that register, but not these ones.
>>
File: 1498488016251.jpg (47KB, 720x540px) Image search: [Google]
1498488016251.jpg
47KB, 720x540px
>learning Erlang
>want to do a nice console-based front end
>Erlang has no good libraries for that
>best option is to write a C node to serve as a client for my Erlang program

G-guess I'm learning C now
>>
>>61124647
read cal newport deep work
>>
>>61124647
Listen to ASMR.
>>
>>61124344
>>61124387
K&R is a shit way to learn C.
If you learn C primarily from K&R, you will write bug-ridden, memory leaking programs. You will walk away with no understanding of the edge cases you must consider in C that you wouldn't in other languages. You will learn outdated techniques.

That said, any book to learn modern C tends to read more as a reference than a book to actually learn C.

I suppose, use both K&R and Learn C the Hard Way, the latter of which focuses on safety a bit more.

Then endure 5 years of trial and error before you're actually writing good C code because no one actually gives a fuck to teach how to program C the right way. C books are either made for people who already know C and already have that 5 years of experience, or shallow as fuck books for 5 minute attention spans and are probably surprised if anyone actually finishes them.

Someone should really rewrite K&R for modern C practices.
>>
>>61124776
Blessing in disguise.
>>
Why is C shilled so heavily here?
>>
>>61125008
Autism.
>>
>>61125008
>>>/r/rust
>>
File: 1498330098765.jpg (39KB, 542x542px) Image search: [Google]
1498330098765.jpg
39KB, 542x542px
How do I modify vector contents that's in an object which is passed as a pointer to a function? C++. Nor back(), nor at() work. I supposed I should use double pointers? Not sure about the syntax.
>>
>>61125023
Why are you so defensive and aggressive, it's just a question.
>>
>>61125051
Why are you such a faggot?
>>
>>61125047
show me what you mean in code, it's not clear
>>
>>61125059
Why are you so upset. I'm just wondering why C is shilled so heavily, and when this fact is brought up, people like you screech autistically. I guess the other anon was right.
>>
File: 1498641571083.gif (3MB, 139x157px) Image search: [Google]
1498641571083.gif
3MB, 139x157px
>>61125051
>defensive and aggressive
>>
Attempting to use Java's split method so I only get words back, no punctuation or whitespace.
Works fine with
str.split("\\W+");

except for the fact it's picking up \t as a word. Not sure how to make it knock it the fuck off. Suggestions?
>>
german is the real world equivalent of lisp
>>
>>61125093
I'm sick and tired of you fags hating on C for no good reason.
>>
>>61125008
Because it's a pretty mediocre language.
>>
>>61123688

You don't. If you wanted a fucking awful solution, within a try statement, you could dereference the iterator. If it throws an exception, assume you're at the end of the list. But for the love of God don't do that.
>>
>>61125080
class o{
private:
vector<wstring> v;
public:
vector<wstring> getVector(){
return this->v;
}
}
void func(Object *o){
o->getVector().back().assign(L"TEST"); //doesn't persist original values are intact

}

>>
File: yukari_spurdo.png (796KB, 637x900px) Image search: [Google]
yukari_spurdo.png
796KB, 637x900px
>don't participate in C shitflinging
>still get called autistic
>>
>>61125093
Autism. Literally. Little autistic shits and virgins with assburgers need someway to feel superior to everyone else since there's nothing else good in their life, so they choose a language which does take good skills to program in effectively without fucking everything up, and use that they use that language as proof they're better than all the other programmers.

>>61125123
He wasn't hating on C. He was hating on autistics fucktards that shill C.
>>
Anyone getting a pure CS degree or lesser in this day and age is making a mistake desu. If you want to go full tech, go into engineering. Otherwise find an application space you're interesting in (examples: bioinformatics, applied chemistry) and learn programming on the side to complement it. A programmer without an application domain in this day and age is useless coming out of university. They're a dime a dozen. And with python with C backends and similar languages lowering the barrier to entry (as companies always have done, this whole coursera push for example is designed to make the job market more competitive for the benefit of companies) as well as the cost of compute going down its easier than ever for a 10 year old to write a killer app.

Being a "programmer" is an increasingly awkward career path. Just my 2 cents. I'm not even sure who I'm replying to but I'm sure there's some HS students thinking of CS for uni here.
>>
File: ya_blew_it_pleb.jpg (353KB, 870x500px) Image search: [Google]
ya_blew_it_pleb.jpg
353KB, 870x500px
>>61122474
>other than ML and Lisp families.
desu I threw up a little anon
>>
>>61125152
The getVector function returns a copy of this->v.
If you want to mutate this->v using the getVector function, either return a reference or a pointer from.
>>
File: 1496425515146.gif (99KB, 400x374px) Image search: [Google]
1496425515146.gif
99KB, 400x374px
>>61125155
Just posting in this thread means you're autistic and probably retarded as well.
>>
Simple trigonometry functions with Scheme.


(define sin
(lambda (x)
(* x (trig-helper x 11 2))))

(define cos
(lambda (x)
(trig-helper x 11 1)))


(define trig-helper
(lambda (y n k)
(if (< n k) 1
(- 1 (/ (* y y (trig-helper y n (+ k 2))) k (+ k 1))))))

[\code]
>>
>>61124677
try running an example from lazyfoo to see if that helps you find the problem
>>
>>61125180
What's wrong with ML and Lisp families?
>>
>>61125215
that uses SDL joysticks, joysticks work but I want to use gamecontrollers
>>
>>61125184
I thought it returned the reference to it by default. I guess I spent too much time doing java.
>>
>>61125199
Can confirm. Probably have undiagnosed aspergers or other ASD. Elementary school wanted to get me tested but my mom just got offended at that and thought I was special instead, so instead I just grew up miserable with no social life and no coping mechanisms to handle myself socially.

>feelsbadman.jpg
>>
>>61125120
\\s+ will pickup whitespace, including tabs.
>>
>>61125166
calm down desu
>>
>>61125218
I can't speak much on ML, but Scheme is one of my favorite languages
>>
File: smug_ran2.png (495KB, 1000x1000px) Image search: [Google]
smug_ran2.png
495KB, 1000x1000px
>>61125199
I guess we're all retarded together then.
>>61125210
>Lisp's brackets are so unreadable that he even closed the code tag incorrectly
I seriously don't understand why anyone would take these brackets over intends/braces, or even end's.
>>
>>61125237
Thanks by the way. Never thought it would be something so simple.
>>
>>61125271
Haskell is basically the only relevant language in the ML family, if that means anything.
>>
>>61123048
>Reminder that if you don't hate your code, hate the language you work with, hate your boss, and hate your life, you're almost certainly not making anything useful.

Brah...
>>
>>61125271
>>61125299
Shit, forgot Ocaml and F#, too.
>>
>>61125281
>>61125237
Coming from other languages like Java which treat all object types implicitly as references, it can be a little confusing how C and C++ treats all types as values by default.
I rather like it though, since it means your compound types work the same way your primitives.
>>
>>61125235
what do you assign to SDL_GameController *controller?
>>
File: 2017-06-28-201601_1280x800_scrot.png (312KB, 1280x800px) Image search: [Google]
2017-06-28-201601_1280x800_scrot.png
312KB, 1280x800px
Rate my OverflowError
>>
Not memeing but I'm proficient in html and css, how easy would it be for me to transition to learning c++, java, etc?
>>
>>61125324
>Java which treat all object types implicitly as references
This.
People often say Java treats object types implicitly as pointers.
THIS IS INACCURATE. THEY ARE REFERENCES.
JAVA DOES NOT HAVE POINTERS.
Sepplesfags get confused because in their shitlang, references aren't reseatable, and the assignment operator is a member function of the object bound by the variable on which the operator is invoked.
In Java, references ARE reseatable, and the assignment operator functions ONLY to reseat a reference (except with primitives, which are reassigned by value as in sepples because they're simple and it doesn't matter).
THIS DOES NOT MAKE THEM POINTERS THEY ARE STILL REFERENCES
>>
>>61125480
html or css won't help you in anyway in learning actual programming language.
>>
>>61124450
https://bpaste.net/show/0f64d3f2989a
sorry I had to rewrite it
>>
>>61125480

Those are nothing alike.
>>
>>61125480
>transition
lol try learning from scratch
not very easy unless you're dedicated. css and html are layout "languages"
>>
>>61125480
As easy as switching from Microsoft Word to LibreOffice Writer.
>>
>>61125473
What kind of unreadable garbage am I looking at?

>>61125480
HTML and CSS are nothing like programming. You being proficient in one in no way means you will be proficient in the other.
>>
>>61125503
is Java pass by val or pass by ref?
>>
>>61125531
In Java, primitive values like int or char are passed by value. Objects like String and
Scanner
are passed by reference. Arrays like int[] and
String[]
are also passed by reference.
>>
>>61125506
>>61125513
>>61125514
>>61125519
Well, guess I've wasted my time learning html then.

Where should I start? Any absolute beginner tips?
>>
>>61125519
It's debug output for a program I'm writing. But more importantly the error is a Hidamari Sketch reference
>>
Is Go a suitable choice for c programmers looking to build webshit?
>>
>>61125531
Pass by value always. But for object types, that value is always a """pointer""" so the pointer gets copied.

it's stupid, so people get confused like this >>61125560 poor anon.
>>
>>61125560
Fuck, I fucked up my code tags

>>61125562
You didn't waste you're time, they're just different skills

>>61125563
I couldn't even read the text with that eye rape

>>61125564
Go is a mess. I'd recommend almost any other language over Go. Even Python might be okay.
>>
>>61123048
R U S T
U
S
T
>>
>>61125480
Learn JavaScript first.
HTML and CSS are both declarative presentation languages. They aren't really programming languages, because a programming language is a language for defining how something behaves, and HTML and CSS are only for defining what information things contain and how that information should look, respectively.
JavaScript would be a good first real programming language for you because it exists specifically to dictate behavior to be added to otherwise behavior-less webpages, which are applications whose most basic inner workings you're already familiar with.
Once you understand how a programming language works, as distinguished from a markup language or other kind of presentation language, I'd suggest trying your hand at C.
>>
>>61125578
D O A
O
A
>>
>>61125511
>https://bpaste.net/show/0f64d3f2989a
thank you, i don't know how to use lists and forgot how to use enums but this will help a lot. i'll get to learning and come back to this.
>>
>>61125576
>Go is a mess. I'd recommend almost any other language over Go. Even Python might be okay.
So Java/C# should be ok, senpai? I don't really dig python tbqh
>>
>>61125610
C# with ASP.NET is not bad at all. Java has some web frameworks as well, although I do not know anything about their comparative quality.
>>
Need statically typed and compiled language for general use that does not run on vm, can have gc.
Must not have shitty syntax.
Must support x86,x64,arm and major operating systems.
Must support native threads.
+ for supporting macros
>>
>>61125583
Alright, I'll start the basic JavaScript challenges on freecodecamp. It says it'll take approx 10 hours. What's the difference between Java and JavaScript?

Once I've got a basic understanding what do you recommend I use to learn C (C, C#, and C++ are vastly different, right?)
>>
File: 4cytumpyea6z.png (612KB, 681x1156px) Image search: [Google]
4cytumpyea6z.png
612KB, 681x1156px
lol
>>
>>61125700
nim?
>>
>>61125700
C
>>
>>61125717
Java and Javascript are completely different. The names are a total misnomer.
Java is used largely for desktop applications and Android applications, while Javascript is used in web browsers to add interactivity to websites.
C is an ancient language. C++ began as an extension of C but looks extremely different nowadays. C# is also different to C and C++, and is best described as Microsoft's attempt to imitate Java.
>>
>>61125700
FreePascal.
Unless your definition of "shitty syntax" is "different syntax."
>>
C is not a bad language
C++ is not a bad language
D is not a bad language
Rust is not a bad language
>>
>>61125700
C++
Hell, you can even create your own garbage collector on it
>>
>>61125842
lol, keep telling yourself that. Only one of those is a good language, the others are shit.
>>
>open source my project
>another dev branches it
>whoa cool
>starts doing things to my code that I could never do
>can't look at my code anymore
>ask if I can watch him dev
>says he charges for programming tutoring
>th-thanks
>>
>>61125864
no language with pointers is going to have an efficient GC
>>
>>61125865
Yeah C is alright.
>>
>>61125842
I'd like to add that Java is not a bad language
>>
>>61125922
It's OK for what it is, I guess.
>>
Arabic is not a bad language.
>>
>>61125652
spring in more mature and powerful than asp.net, but the latter is still miles ahead of the hipster shit that some startups use
>>
>>61125842
Omit C++ from that and I agree. C++ is probably the only language I'd actually consider bad. Even brainfuck achieves it's goals more elegantly than C++.
>>
File: bgol35flg86z.jpg (51KB, 700x514px) Image search: [Google]
bgol35flg86z.jpg
51KB, 700x514px
This perfectly describes me.
>>
>>61125895
Post project desu.
I want to know what kind of rewrites impress people.
>>
>>61125938
>for what it is
a bad programming language
>>
>>61126030
This perfectly describes me too
>>
>>61126034
>write library that increments a number
>another dev adds a decrement function
simply amazing
>>
>>61125766
So if C is ancient what would you recommend a complete philistine when it comes to programming?
>>
>>61126197
C remains an excellent language for low language programming, and it's remarkable how much it can do with so little.
Unless you're dealing with the hardware directly or have need of top performance, C and its alternatives (C++, Rust) aren't important to you.

If you just want to develop desktop apps then use Java or something like that.
>>
>wake up
>it's 2017
>there is thing thing called javascript
>there is this package https://github.com/tjmehta/is-positive-integer

really made me :hmmmm:
>>
What are some necessary vim plugins for C dev?
>>
>>61122518
That rant is outdated and mostly only applies to C++03.
>>
>>61126292
I like how when people told the author that his package was shit, he actually defended it
>>
>>61126292
:+1-skintone5:
>>
Ok, I'm getting weird compialtion errors for my OpenGL C++ (only because of GLFW and such) project. Using gcc for my compiler and no cmake.

 (pathto) libglfw3.a undefined reference to symbol 'glclose@@GLIBC_2.25'
(pathto) libdl.so.2: error adding symbols: DSO missing from command line

colelct2: error: ld return 1 exit status


Compiler flags
 gcc main.cpp -lglfw3 -lGL -lm -lxrandr -lXi -lX11 -lXxf86vm -lpthread 


I also tried -Lz and -lz to no avail.

I'm on noobontu 16.04 LTS
>>
>>61126297
emacs
>>
File: idlki19ed76z.png (586KB, 680x954px) Image search: [Google]
idlki19ed76z.png
586KB, 680x954px
haha
>>
/dpt/ has been shitting on C++ even harder lately, it must have gotten better recently.
>>
>>61126273
Not that guy. But how do I read the nonsense people write in C#/Java as desktop apps? Their program seem so incredibly difficult to extend well to me. For instance, all I want to do is queue downloads in case the replay isn't ready and add a UI notifier for that:
https://bitbucket.org/ZuLuuuuuu/reflex-replay-helper
I've opened this and had a good read and I'm seeing that there's an obvious place to insert the code that handles my case (since the exception it throws for when the replay isn't available is just a simple error message).

If this were my program I'd just add a system (if I don't already have one) that lets me defer actions. I'd add an action, if it checks again and it fails it'll just add the same action again. Super clean system with no problems.

Here everything seems completely baked into the UI though. I can't find a single update loop that handles rendering the UI or updating state. How do I even have it make intelligent decisions at all? It has no systems for that at all. It's a simple UI for downloading and launching a process but it's so much code just for that.
I'm not a C# programmer, I've dabbled. But these systems just seem impossible to work with. Why you'd put all your shit in the UI like that is beyond me. You couldn't even give users a CLI without rewriting the whole thing.

Is this normal or is it not? Because everything I look at has similar issues. It has put me off so many times and I've always just rewritten shit instead because it's so much easier. This application doesn't do very much. It's easy to replicate and I'm considering doing that not just for this feature but because it'd let me do much more (like automatic downloads and the likes). But it feels like such a waste every time even if it serves me quite well.
>>
>all these character encodings

Fuck it, I'm just using UTF-8 for everything.
>>
>>61126483
Maybe dpt is just becoming better programmers. They've left the qsort vs std::sort discussion behind and it seemed to be universally agree its just a programming environment difference (qsort being unable to inline because it's source is normally not included in compilation).
>>
>>61126495
C#.PAJEETS have no conception of separation of concerns
>>
>>61126495
>other people's code
110% of all software problems
>>
>>61126593
>Maybe dpt is just becoming better programmers
>Cfags actually believe this

HAHAHA
/dpt/ is full of absolute fucking retards that will NEVER be at the level that I am at now.
>>
>>61126658
t. full stack JS engineer
>>
Thoughts on pygame?
>>
>>61126583
Error: Column "ANAL_BEADS" cannot convert between unicode and non-unicode string data types.
>>
>>61126708
Sorry, I only use real programming languages.
You can't even write a kernel in JS, LMAO. What a fucking joke.
>>
>>61126746
t. code artisan
>>
>>61126746
What is an ``kernel"?
>>
>>61126806
What is your endgame?
>>
File: group_action_alice.jpg (71KB, 853x480px) Image search: [Google]
group_action_alice.jpg
71KB, 853x480px
>>61126806
The kernel of a homomorphism is the set of elements in the domain that gets mapped to the identity.
>>
#define private public
#define protected public
#define class struct

Where is your god now?
>>
>>61126030
This is one of the view things that makes you a shitty programmer.
You WILL write buggy code. Your code will rarely execute the first time you try to run it.
You WILL fuck everything up. A lot. Over and over again.

And the bad coder gives up. The good coder asks, "why?"

This is the difference between a coder and a pleb.
>>
>>61126829
I am trying to help.
>>61126832
I don't think ````people"" in this thread mean that when they say ``kernel".
>>
>>61126836
>Where is your god now?
Looks like he came back
>>
>>61126836
Single-line comment or end-of-line expected


Nice try, guy.
>>
>>61126862
Fuck off back to wherever you came from.
>>
Loving the new C++ metaclass proposal, lads.
>>
can somebody please explain how to use "sort" in C++? or link me a good beginner guide?
>>
>>61126483
/dpt/ is overrun with rustlets and D-icklets who are ass-mad that they're shit language will never be used
>>
File: 1496801936950.png (36KB, 176x176px) Image search: [Google]
1496801936950.png
36KB, 176x176px
>>61126908
You are so fucking full of yourself.
>>
>>61126922
Any c++ reference you will find has nice examples usually.
>>
>>61126941
Asking """What is an ``kernel"?""" doesn't help anyway, idiot.
>>
File: 1494459684321.png (100KB, 450x426px) Image search: [Google]
1494459684321.png
100KB, 450x426px
>>61126969
Maybe you are confused.
>>
>>61123878
>Where the fuck do you fart faggot?

I think he was talking about how people arent wearing pants and underwear
>>
>>61127010
Why would someone get paid massive amounts if they wear no pants or underwear?
>>
>>61126923
You mean faggots who get insta-butthurt when either of those languages are mentioned
>>
File: quizz.png (4KB, 301x61px) Image search: [Google]
quizz.png
4KB, 301x61px
In javascript what will 'string' contain after pic related code?
will it generate an error since u cant change the value of a string once created?
>>
>>61127065
why don't you open your console and find out?
>>
>>61127097
this way is faster
>>
>>61127032
Its unprofessional to be unkempt
>>
>>61126922
The std::sort uses, in the simplest case, a pair of random access iterators on a container. The default sort uses operator< to compare, but you can specify the comparator with an additional argument.
Here's an example of how to use the basic case:

#include <random>
#include <algorithm>
#include <cstdio>

int main()
{
std::random_device rd;
std::mt19937 gen(rd());
std::uniform_int_distribution<> dis(0, 10000);

std::vector<int> v(100);
std::generate(v.begin(), v.end(), [&]() { return dis(gen); });

std::sort(v.begin(), v.end());

for (auto e : v) printf("%d\n", e);
return 0;
}
>>
>%zd compiles fine with gcc
>cross compile for windows with mingw
>printf explodes

I guess mingw doesn't support that feature?
>>
Russian style > bourbaki shit
>>
>>61127151
>std::generate(v.begin(), v.end(), [&]() { return dis(gen); });
Could you explain this bit?
>>
File: 1474790318350.png (20KB, 827x126px) Image search: [Google]
1474790318350.png
20KB, 827x126px
Holy fuck.
>>
>>61127161
Try compiling with -std=c11
>>
>>61127227
This is horrifying.
>>
>>61127227
>>61127253
The future is now
>>
>>61127227
explain this for brainlets
>>
>>61127301
Pretty sure the comments explain it m8
>>
File: Touhou.full.1432542.jpg (528KB, 703x1169px) Image search: [Google]
Touhou.full.1432542.jpg
528KB, 703x1169px
>>61127227
Beautiful.
>>61127301
Read the comments.
>>
Okay I'm being completely goddamn retarded but I havent worked with Java in about 2 years, how the fuck do I compile it into an executable through bash?
I've got about 4 java files and running javac *.java generates the class files, but no executable.
What am I fucking up?
>>
>>61127349
.class files are JVM bytecode
>>
Theres no complier for this language yet and one of the guys im collabing with sent me this snippet and told me it fixes a bug (referencing a bugticket id that dosent exist, nor looks like anything there)
https://pastebin.com/NnNEJB4V
>>
>>61127349
class files are the executables silly. You mean a .jar?
>>
>>61127360
Right, I know that, but I can't get this into an actually usable state through bash. Running it from IntelliJ works fine but I can't remember the damn commands to compile it from bash.
>>
File: taipu.png (8KB, 692x120px) Image search: [Google]
taipu.png
8KB, 692x120px
>>61127232
Nope. Don't matter, just an example from a textbook anyways.

Feature support aside, it's interesting that you get different results when compiled under gcc or mingw even on the same machine. I guess to be safe you should just assume smallest guaranteed size for a type as specified by the standard is what you'll get.
>>
>>61127332
>>61127337
I can see the comments, hence >brainlet
The only thing I understand is the text adventure reference dummy example
>>
>>61127226
It basically fills in the vector with random ints using the dis functor.
std::generate takes the start and end iterators, and the way to fill them. In this case, I use a lambda to wrap the dis functor.
>>
File: nice.jpg (973KB, 3000x4000px) Image search: [Google]
nice.jpg
973KB, 3000x4000px
>>61122451
>What are you working on, /g/?
I was busy etching a PCB today to build a small timelaps system for my eos 700d. Seems to be working and more than enough for my needs.
Next steps:
>make a nice gui
>adjust ADC sensitivty
>make a case
>>
>>61127376
mingw is a port of gcc tho

>>61127370
You don't compile Java to native code. To run the bytecode you type
java MyMainClass

where MyMainClass is the class (with package name) that has the main method
>>
Recursive lossless compression algorithm, in C++. Slowly writing assembly for certain parts, iterating and comparing against C++ generated code.

Learning Haskell for the hell of it.
>>
>>61127440
>>61127368
>>61127360
It's because it was part of a package and I wasnt specifying that as the full name.
That's what I get for using an IDE in place of writing from scratch in emacs.
>>
File: pcb.webm (2MB, 1280x720px) Image search: [Google]
pcb.webm
2MB, 1280x720px
>>61127428
small webm without attached camera.
Gotta implement a way bigger font obviously, but that's in progress
>>
>>61127440
>mingw is a port of gcc tho

I'm not an expert on C compilers, but even if mingw is a port it might not be based on the latest build of gcc. I got both compilers just off Ubuntu's default repo, so who knows how up to date either are.
>>
File: 1452207799745-pol.jpg (233KB, 560x560px) Image search: [Google]
1452207799745-pol.jpg
233KB, 560x560px
I just fell in love with Scala

Data analyst jobs here I come
>>
>>61127528
mingw is still on gcc 6.3.0.
>>
learning SQL for part of a class.
It's always seemed like a baby language, not even a language, just a syntax for small things, but I keep getting stumped by things and I'm not sure if it's because SQL is bullshit or because I'm an awful programmer
>>
File: itshappening.jpg (6KB, 234x160px) Image search: [Google]
itshappening.jpg
6KB, 234x160px
>>61127227
Oh my god
>itshappening.jpg
>>
>>61127528
You can discover this by running gcc --version on both systems

>>61127554
Scala is very shiny on the surface but it's got 1000 ways to bite you in the ass

>>61127557
It is a baby language, with a very specific use, but it's quite good for that use. It's a lot like regular expressions in that sense.
>>
>>61127557
I bet you've never even seen a declarative language before.
>>
>>61127574
>but it's got 1000 ways to bite you in the ass
Please elaborate
>>
>>61127226
You don't need that bit at all. It's irrelevant to usage of the sorting function.
>>
>>61127557
>baby language
hasnt survived over 43 years for no fuckin reason, nigger.

http://blog.sqlizer.io/posts/sql-43/
>>
>>61127349
You may be after a .jar file. Look up how to make a Java archive.
Or you're looking to pack the JVM with the program and actually get a semi-portable executable. There's ways to do it yourself but pajeets recommend you use one of their cruddy solutions. I suspect that's actually what you want.
>>
>>61127587
Implicit variables, macros that aren't documented very well, a very confusing standard library, lots of not-always-clear differences between minor versions
Not an entirely bad language, and it is better than Java (at least Java 7) by a longshot, but I prefer Clojure.
>>
File: possiblyxenocat.jpg (47KB, 405x720px) Image search: [Google]
possiblyxenocat.jpg
47KB, 405x720px
>>61127598
>It's old therefore it's good
>>
Hey guys, who's excited for C++ metaclasses?
>>
>>61127650
Things that suck are replaced by things that don't suck. There are some exceptions, where something has been mediocre enough that no better replacement has come along.
But if you had to create a language for querying a database, I'm not sure what you could do that would be wildly different from SQL.
>>
File: lelfail.mp4.webm (849KB, 1280x720px) Image search: [Google]
lelfail.mp4.webm
849KB, 1280x720px
>>61127466
actually wanted to do a timelapse of making that timelapse system kek.
But failed horribly at the drilling process.
>be me
>be left handed
>wanting to do a close up timelaps
>put camera on left side
kek
>>
>>61127642
Okay. Tbh I tried Clojure before this when I started to explore functional languages but I just can't deal with the amount of ((()))))))))))))))))))
>>
>>61127678
>Things that suck are replaced by things that don't suck.
Then why are all programming languages shit?
>>
>>61127650
Spoken like someone who sucks at SQL.

git gud
>>
>his IDE doesn't color-code nested parentheses
>>
>>61127227
>>61127673
I'm so fucking hyped, I can barely contain my autism.
>>
>>61127722
>his reply dosen't link correctly
>>
>>61127678
>>61127719
Oh buzz off, you beanhead. I say what I want and I don't give a darn. If you don't like it, you can take a hike, pal.
>>
How do you write a windows/linux driver to your newly invented device?
>>
Programming a game.
Trying to figure out how to implement acceleration and deceleration using vectors in 3D. I don't know how to account for positive and negative axis values to apply friction to.

Anyone got any ideas? /agdg/ are useless when it comes to math.
>>
>>61127722
could you clarify who it is that you are quoting?
>>
File: brainlets_on_suicide_watch.png (761KB, 1186x860px) Image search: [Google]
brainlets_on_suicide_watch.png
761KB, 1186x860px
>>61127650
Correct.
>>
>>61127716
Look at what was available before. We don't have to use TCL or VB or Basic. Java 9 is miles better than Java 1 or 2. C++14 is miles better than C++98 or whatever it was called. Python 3 is even marginally better than Python 2.
>>
File: taycm.jpg (68KB, 340x506px) Image search: [Google]
taycm.jpg
68KB, 340x506px
>>61127774
this is the textbook you're looking for
>>
Time to start reading vector math then.

(i, j, k) - (x, y, z) = (i - x, j - y, k - z)
>>
>>61127774
Common way to do it is to just apply friction as a function of the speed vector.
And acceleration/deceleration, that's pretty obviously just a value you use to modify your vector.
Read physics if you're after realism.
>>
>>61127802
I love the covers on Taylor's books. His error text has a railroad train running out of a smashed wall.
>>
>>61127774
just use bullet3d, box2d or something similar. if you ask such things you are clearly not up to the task to write your own physics engine.
>>
>>61127802
Except game physics shouldn't always be realistic. Not advising against lrning physics, just that sometimes, a 10000 kg player character makes total sense, gameplay-wise.
>>
>>61127811
Vectors are ezpz.
>>
What are some really obscure math operations and or geometric systems? It's not obscure but things like tropical geometry comes to mind. It's just an odd replacement of operators and it actually has a use.

I want to learn more.
>>
>>61127868
quaternions
>>
>>61127850
That's fine, and you can tweak and adjust things as you see fit. But if the "friction" and "acceleration" and "vectors" and "three axis coordinate system" are the words that I know them as, then you are referring to things which you can understand with the helpful text and exercises given by Taylor in that text
>>
>>61127845
Most video games don't use physically based systems for simulation simply because they're not that sort of game.
Box2d can be used to simulate particles well. It's inefficient when used like that and a custom system is easily better but it can be done simply for ease of use.

I suspect anon has very specific requirements since she's asking about how to do it herself. So just using a library might not be the best.
It's good that you mention it though but you're assuming too much about the situation.
>>
>>61127868
Clifford algebras (also called geometric algebra)
Getting into topology can open some great doors along those lines, especially defining interesting topologies (with or without interesting distance metrics)
>>
>>61127904
Yeah well I know those. I wouldn't consider them that obscure either. But thanks for mentioning them. I certainly would like to know of them if I didn't.
>>
>>61127868
Does Non-classical logic count? Your criteria is quite vague.
>>
>>61127812
Yeah I've tried that, but I don't know how to apply it to a value that could either be positive or negative. The friction will have to either have to add or subtract from the velocity.
>>61127845
I'm not making a game to make money, I want to learn how to make them. I wouldn't learn anything if I used some proprietary physics engine.
>>
>>61127931
It is vague. But that's because I really don't know what I'm after. So it's hard to be specific. I'm not looking to solve a problem. I just want to learn about something cool.
>>61127927
I'll look into it.
>>
File: solve (4).png (582KB, 1400x788px) Image search: [Google]
solve (4).png
582KB, 1400x788px
>>61127868
Oh boy do I have something in store for you.
>>
>>61127945
>I don't know how to apply it to a value that could either be positive or negative
Just add up the values. If it's positive it all adds up, if it's negative it negates it.
>>
>>61127945
The simplest way to do friction would be to have it be a multiplier on the speed based on the speed.
An example:
https://github.com/ecbambrick/ThrustVector/blob/master/src/physics.lua

It's a simple system and can extended easily.
>>
>>61127955
This is a programming thread, so the "coolest" math that's programming-related is probably category theory, but all maths can be cool, you just have to like it.
>>
>>61127868
http://math.stanford.edu/~vakil/216blog/FOAGdec3014public.pdf
>>
>>61127955
>>61128010
graph theory is also pretty cool and pretty programming related
>>
>>61127945
both are open source. and you might find that you in for more than you wanted when it comes to collision detection, real time collision, intersections and funny things like GJK Algorithm, penetration depth and other stuff. but you will learn a lot.

http://www.realtimerendering.com/intersections.html
https://www.geometrictools.com/index.html
http://realtimecollisiondetection.net/
>>
>>61127868
If you have done a CS degree, you might not have hit on group theory or abstract algebra in general. There is loads of good stuff there but somehow it isn't seen as a fundamental topic except for math students. Just some basic familiarity with groups, and playing around with a few (like the movements of a Rubix cube for a fun example) is a pretty easy task and occasionally helpful
>>
>>61127722
This irritates me with notepad++ and batch scripts. Like really, how goddamn hard is it to recognize keywords when they have parenthesis on either side? How hard is it to make delayed expansion and substring extraction syntax highlight correctly? These things are systematically defined, it's not ever ambiguous. Ever. It's fucking batch, for fuck's sake. And the depth it stops highlighting at is ridiculously shallow.

One of these days I'm going to just go fix it myself. Pointer arithmetic, per line would make this process cheap and trivial. But there's probably a bunch of other shit my idealized conception of information extraction hasn't taken into account, perhaps some of it even justified.
>>
New thread
>>61128103
>>61128103
>>61128103
>>61128103
New thread
Thread posts: 348
Thread images: 42


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