[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: 319
Thread images: 43

File: 1503897682056.jpg (481KB, 1200x1730px) Image search: [Google]
1503897682056.jpg
481KB, 1200x1730px
What are you working on, /g/?

Old thread: >>62180040
>>
>>62188731
First for (giving her the) D
>>
>>62188731
Would you (((pair program))) with a titty monster?
>>
>>62188773
i'm not a homo but i was going to say "no because i'm a homo" for keks
i then realized
do you think when homos are forced into straightish situations they have the same feelings about it as straights do when the situation turns too gay
like
"ew that's fucking gay"
except they're the homo instead
so it's like
"ew that's fucking straight"
like
hot girl showing too much tit
the faggot: "wow put those away you perv there might be children watching"
steamy lesbian makeout
faggot: "gross get a room you two"
>>
>>62188773
Yes, she can sit on my lap and type while I sniff her hair
>>
>>62188868
I think most queers just say "hahahaha honey i ain't no jive ass nigga" during those situations
>>
>>62188868
>i'm not a homo but i was going to say "no because i'm a homo" for keks
>i then realized
>do you think when homos are forced into straightish situations they have the same feelings about it as straights do when the situation turns too gay
>like
>"ew that's fucking gay"
>except they're the homo instead
>so it's like
>"ew that's fucking straight"
>like
>hot girl showing too much tit
>the faggot: "wow put those away you perv there might be children watching"
>steamy lesbian makeout
>faggot: "gross get a room you two"
is what homos think in that situation
>>
Here's my kode from another thread. Guess what it does.
procedure convert(n, r)
res := 0
reverse(n) ? while res +:= r ^ (&pos - 1) * move(1)
return res
end

The language is Icon.
>>
File: tuks6.jpg (31KB, 640x360px) Image search: [Google]
tuks6.jpg
31KB, 640x360px
Daily reminder Rust 1.20 is out, don't forget to `rustup update`, guys and gals!
>>
>>62188943
Dumb akariposter
>>
Is this good?
def doble(n):
n=int(n)*2
print("That number's doble is "+str(n))
while True:
print("A number.")
doble(input(""))
>>
File: 1496810915969.jpg (98KB, 1456x896px) Image search: [Google]
1496810915969.jpg
98KB, 1456x896px
>>62188948
Dumb frogposter
>>
>>62188945
>Are there any alternatives to RDBMS that are also RDBMS?
Gee, I wonder.
>>
Community platform.

QUESTION:
Are there any alternatives to traditional SQL relational databases
which are just as fast, lets you query data by relations
and also support transactions?
>>
>>62188965
>says teh frogposter
>>
File: 1377461472674.gif (833KB, 200x150px) Image search: [Google]
1377461472674.gif
833KB, 200x150px
>>62188965
Literally
>>
>>62188731
Ai-chan = Kouhai-chan > *
>>
>>62188967
Yeah I know, but I did add "SQL". So there.

There's a lot of alternatives, key value stores and what not, and maybe they're great, but they lack some of the amazing features I can find with e.g postgres.
>>
I have over 100,000 rep on stackoverflow. how easy should it be for me to get another job? I'm bored at my current one.
>>
File: s.png (166KB, 1664x1013px) Image search: [Google]
s.png
166KB, 1664x1013px
>>62188731
>What are you working on, /g/?
official /dpt/ ultimate SoKoBan. finished the level checker. will now implement the game-play logic, then the gui and game rendering. wish me gambatte.
>>
File: gav1ybpbrq0y.jpg (119KB, 1320x908px) Image search: [Google]
gav1ybpbrq0y.jpg
119KB, 1320x908px
>>62188982
>mentioning the word frogposter
Dumb frogposter
>>
File: database-decisions.png (264KB, 1673x1298px) Image search: [Google]
database-decisions.png
264KB, 1673x1298px
>>62189005
MongoDB ofc.
>>
>>62188907
i just noticed you casually and subtly suggested i'm a homo there
well played sir
>>
>>62188931
>Guess what it does.
>The language is Icon.
why are you requesting an impossible task of us
>>
>>62189032
make an AI for it
>>
File: 1503653685196.png (7KB, 254x199px) Image search: [Google]
1503653685196.png
7KB, 254x199px
>>62188162
Return won't work, the process on a thread just keeps going until it finishes. Thanks for help anyway.
>>
>>62189074
If it was a language everybody knows this would be trivial.
>>
>>62189091
not him but im pretty sure there's a way to terminate those threads
check the docs on the python site if you havent
>>
>>62189022
You could have 0 rep on stackoverflow and it wouldn't change anything.

Nobody cares about some meaningless number on some helpdesk site unless you're applying to be some kind of management position in your area of expertise.
>>
>>62189097
Not so.
Icon's semantics are fundamentally counterintuitive.
>>
File: bfraser 4.jpg (184KB, 640x427px) Image search: [Google]
bfraser 4.jpg
184KB, 640x427px
>>62188731

sauce?
>>
>>62189080
kek. resolving sokoban is PSPACE (harder than NP complete)
>>
>>62189022
>>62189127
>some kind of management position
that seems like it would be an improvement desu
>>
>>62188958
no 'n' must be converted to a number then to binary then to string then you add a "0" then you convert it back to base 10 (string) then to an int and then you print it like you did.
>>
>>62189135
It's pretty comfy once you've stepped into the void. I like how everything is a statement, failing, generators.
>>
>>62189188
oh
didnt know

u dont need to fully resolve it though?
surely there's approximation algos
>>
>>62189058
Good input. Interesting chart.
>>
>>62189218
gross m9
>>
https://github.com/majestrate/XD

I added an sftp storage driver to my i2p bittorrent client.
I have no idea if it works or not :+DDDDD
>>
>>62189269
>XD
fuck off
>>
File: xd_logo_512x512.png (127KB, 512x512px) Image search: [Google]
xd_logo_512x512.png
127KB, 512x512px
>>62189295
>asspain
FUCKING FINALLY someone gets annoyed by the name, it took ages.
>>
>>62189269
Looks cute
>>
>>62189269
>go
>not gpl licensed
into the trash it goes.
>>
>>62189349
using GPL with go would be like going to an orgy knowing you have a bad case of herpes.
>>
>>62189091
It looks like the only thing you need is something in download_files() to raise an exception upon a cancel event.
>>
How do you guys handle switching back and forth between languages? I occasionally move between python, lua, javascript and c#

for example, in some languages a boolean statement is 'True', while in others it's 'true'.

Some doesn't use semicolons to end statements. Some use :, or 'then', etc.

Do you just spend 10 minutes refreshing on basic syntax? its pretty annoying
>>
>>62189366
Gonna try to find other solution. I don't want to make my downloader dependent on GUI or thread class. But I'm going to take your suggestion into account I don't find other solution. Thank you.
>>
>>62189410
I do it by not having sub-average intelligence
>>
>>62189410
There are languages with syntax derived from C and languages with syntax derived from BASIC. Everything else is weird shit you won't be using very often anyway (don't even mention lisp meme). Most simple mistakes are automatically fixed by good IDEs anyway.
>>
>>62189444
I expected a bait response but i suppose I was wrong for having a little faith in some /g/tard.
>>
I have set of letters and numbers. I need to exit this loop when it encounters a number.
do {
scanf(" %c", &record);
printf("%c", record);
} while (record == 'H' || record == 'O' || record == 'w' || record == 'S' || record == 'P');

I feel like I tried putting everything in while condition but this loop just prints everything, even numbers and then stuck printing last letter.
>>
>>62189519
It's not a bait response.
Most languages are fundamentally the same, their only difference is cosmetic.
If you actually get thrown off by the fact that some languages force semicolons and others don't it means you memorized a language and not how to program.
>>
>>62189531
do {
scanf("%c", &record);
printf("%c", record);
} while (!isdigit(record));

Something like this should work just fine. isdigit() is in ctype.h iirc.
>>
>>62189509
>Everything else is weird shit you won't be using very often anyway
The problem is when I actually do need to use it for something simple

>Most simple mistakes are automatically fixed by good IDEs anyway.
True, but I usually only have my IDE set to the main language I'm using C#.

I use notepad++ for everything else. I should proper get a proper IDE for them.

thanks for the non-bait reponse
>>
>>62189509
>don't even mention lisp meme)
lisp is very intuitive and far from a meme
>>
>>62189444
You do it by having literally nothing else to occupy your narrow mind, autie.
>>
>>62189670
but it's not JS therefore 50% of programmers will refuse to even consider it
>>
>>62189719
>javascript monkeys are programmers
funny joke
>>
>>62189574
yes, thank you
>>
>>62189742
javascript isn't funny any more, please make it stop
>>
>>62189670
Yeah, now try to find a job where you use lisp.
It's mostly used in academia which isn't exactly known for their extensive hiring programs.

>>62189719
JS is biggest pile of garbage I've ever coded in. At startup I worked I avoided anything js like a plague, to the point of moving small chunks of code to the backend which was in considerably better Java.
>>
>>62189790
there are no brakes on the javascript rapetrain
>>
>>62189719
wchich is weird
it has a very beautiful syntax and a very easy syntax in more than one ways
the notation is easy to read (if you exclude the ))))))) ) at the end
it's easy to write an interpreter for such a notation AND to compile it
so it's useful to understand not just for lisp
@(function main () ()
(print_num (fibs_iter 10)))


@(function fibs (n) ()
(if (< n 2)
n
(+ (fibs (- n 1)) (fibs (- n 2)))))

@(function and (arg1 arg2) () (if arg1 (if arg2 1 0) 0))

@(function fibs_iter (n) (i a b tmp)
(= i 0)
(= a 0)
(= b 1)
(while (< i n)
(begin
(print_num a)
(= tmp a)
(= a b)
(= b (+ b tmp))
(= i (+ 1 i))))
a)

code rel is something i made a compiler to gnu asm for
>>62189800
im not trying to find a job, programming is plan B for me and a hobby
>>
>>62189214
thanks pal, actually going to look on how to convert decimal numbers to binary, the rest doesnt make much sense, specially the end
>>
File: 1495584563215.png (1MB, 785x757px) Image search: [Google]
1495584563215.png
1MB, 785x757px
>https://stackoverflow.com/a/11822850/5132608
SO BASICALLY THERE IS NO WAY TO GRACEFULLY AND EASILY CANCEL DOWNLOAD IN FUCKING PYTHON
GOOD JOB GUIDO VAN ROSSUM

are all languages retarded like this? or is it just python?
>>
>>62189867
use curl
>>
>>62189867
see this is what happens when everyone relies on hobbyist modules and nobody wants to write any new code or at least some bindings for curl.
>>
>>62189867
we warned you about python anon

reminder that guido wanted to remove lambdas from python
>>
>>62189867
im sure it's your code's fault
what, you cant end a thread using an if branch inside the execution of the thread itself

thread runs a function
inside function
if bad shit is happening:
.....return

lol
>>
>>62189867
I thought you were gonna try checking for bCancelDownload?
Why wouldn't this work?
>>
>>62189867
we told you not to do multithreading in python bro
>>
>>62189867
ok, instead of launching a thread
launch a brand new process
that process can be anything you want
for example a bash script that downloads the file with curl or another python script that downloads the file
if you want to cancel, just kill the entire second process
now you have true multithreading with python
>>
>>62189962
I tried. But thread MUST complete its task before it yields control to main thread, or joins with it. I could go as another anon suggested putting an 'if' statement in my download_files() function for cancel signal, but that would make my code spaggeti.
>>
>>62189867
There are several ways you can accomplish this.
That guy alone listed several possibilities.
Don't expect modules to hold your hand 100% of the time.
>>
File: avatar_82e810543efd_128.png (22KB, 128x128px) Image search: [Google]
avatar_82e810543efd_128.png
22KB, 128x128px
>>62189970
we warned you about python bro
we told you dog
>>
File: python.gif (302KB, 500x344px) Image search: [Google]
python.gif
302KB, 500x344px
>>62190028
IT

JUST

KEEPS

HAPPENING
>>
>>62188901
Fags are niggers from the 70s? ...that explains a lot actually.
>>
>>62190020
>Don't expect modules to hold your hand 100% of the time.
;_;

>>62190001
Someone mentioned to launch a thread in a process. Anyhow, it seems that launching another process is the only sane option (although everyone on stackoverflow recommends threading for tkinter instead of using it with processes)
>>
>>62190028
>>62189970
>>62189910
>>62190050
python is bad because this one idiot cant figure out his trivial code

i understand it has flaws, but this is the guy's fault
>>
>>62190059
>>Don't expect modules to hold your hand 100% of the time.
>muh "maude you'lls"
>>
>>62190059
dont use processes, it has significant overhead and you dont need it, besides you'll have to rewrite shit you already wrote and thought about for next to 0 gain

just add an if branch inside the thread, literally who cares
>>
>>62189365
That's retarded.
>>
>>62190090
>just add an if branch inside the thread
he doesn't want to do that for some reason
>>
>>62190090
the magic "if statement" solution doesnt work. the downloading thread is blocked waiting for the download to finish. there's no place for an if statement.
>>
>>62190090
>>62190130
See >>62190169
This is the mockup of my code >>62188337
there's no place to put an if. I need something to interrupt a method in the middle of it's execution.
>>
>>62190200
>there's no place to put an if
You mean you have no control of the source of the download_files method?
>>
>>62190090
>there is significant overhead for creating a process to download a file
>significant overhead for a process
>significant overhead
>A process
>singular
Give me a fucking break you insufferable autist. Spinning off a separate process for his download is perfectly fine.
>>
is open source a meme ? i feel like in the amount of time it takes to get involved you could have just made something yourself.
>>
>>62190264
good luck making a drop-in replacement for linux yourself.
>>
>>62190272
i am talking about programming for an open source project. not using software.
>>
>>62190264
>in the amount of time it takes to get involved you could have just made something yourself.
What does that even mean?
>>
>>62190230
I have. But as I said, it would make Downloader class dependend on GUI. But I guess I could instantiate it with self.downloading = True, and if the cancel button is pressed that it could set self.downloading = False (and then raise an exception as another anon suggested). But, I'd have to pass an instance of Downaloder class to both thread and the cancel button. You may be right, it doesn't sound like much of a spagetti code after all.
>>
>>62190285
>its easier to write your own kernel than to contribute to the linux kernel
wat
>>
how do you code an event handler? do you create another thread, that loops through all the list of events and see if any of them was clicked? what if during the iteration it missed my input how do i take input in real time??
>>
>>62190396
Observer pattern?
>>
>>62190064
python is bad because it is a very badly designed language. this has been covered repeatedly in /dpt/ history
>>
What's the most beautiful/elegant programming language you know?

Lispspergs need not reply
>>
>>62190332
like in the amount of time it takes to read licenses, read code of conducts, sign up to a bunch of websites for communication, navigate and map out the project, decode their bug tracker system, etc,etc. its not even worth it.

normal programming you just grab and go and you get to work on exactly what you want to work on.
>>
>>62190405
>OOP can't do anything without "patterns"
my sides
>>
>>62190428
>he actually sits down and reads the fine points of licenses and CoCs, instead of just noting the license type and ignoring the CoC
Are you autistic or something?
>>
I need help. I am trying to connect to a mysql databse using C++.
I get this error when running the program: # ERR: Access denied for user 'franco'@'localhost' (MySQL error code: 1698, SQLState: 28000 )
This is the line of code where I think the problem comes from: con = driver->connect("tcp://127.0.0.1:3306", "franco", "");

I have already trying using root user and stating the password

Look at pic, maybe the sintax at the line I mentioned before is the problem
>>
What's going on with NodeJS?

https://medium.com/@rvagg/the-truth-about-rod-vagg-f063f6a53557
>>
>>62190441
clearly you have never contributed to open source so why are you even responding ? you wont get a rise out of me.

proprietary teams > open shit teams.
>>
>>62190424
Racket.
>>
Reminder that creating "open source" software, unlike free software, is just doing work for corporations for free.
>>
>>62190444
obviously you dont have access.
did you give yourself access?
what user do you use when connecting from the command line?
>>
>>62190476
Free as in free speech or free beer?
>>
>>62190491
https://www.gnu.org/philosophy/free-sw.en.html
>>
>>62190472
Nigger, just because they tell you to study the CoC, doesn't mean you have to. And you don't have to read the GPL word for word every time you write code for a new project. Figure out what it means once, then continue on with your life.

>>62190450
Marxists are trying to liberate it from the oppressive patriarchy of competent male contributors, or some bullshit like that.
>>
>>62190476
no matter how you license it, if the source is available for viewing, you're working for corporations for free
someone who cares enough will simply re-write your code just enough to not be your code anymore in the eyes of the law (with a good lawyer)
>>
>>62190473
Fuck off with your lispshit
>>
>>62190539
Racket isn't even a lisp, it's an abomination.

Don't even get me started on people claiming ruby or javascript are lisps.
>>
>>62190547
>ruby
a bad copy of superior Python
>>
how do people even get into these shitty dynamically "typed" languages? its disgusting desu
>>
File: 1490072799932.png (142KB, 501x585px) Image search: [Google]
1490072799932.png
142KB, 501x585px
>>62190476
>GPL
>working for the Chinese for free
>>
>>62190564
scheme used to be the primary language for teaching cs
>>
>>62190424
I used to hate on java and like all the trendy/faggot languages. The older i get the more I appreciate java. What sucks about it is the ecosystem and the over use of "design" patterns. But the language itself is slick
>>
should settings be in a table view and loaded from some array or just a scrolling view and defined in a layout or some shite
there are a couple dozen settings
it's a phone app

really can't figure out which would be better tbqh
>>
>>62190539
>>62190547
Rude. Racket is a very clean and beautiful language.
>>
>>62190598
sure, compared to javascript
>>
>>62190598
>different brackets
it's awful
>>
>>62190547
How do you define "a lisp"? Conforming to the CL HyperSpec?
>>
>>62188907
God damn i was gonna say something far worse and straightforward, good job anon. Just fuck a dude already you fucking fag.
>>
>>62190620
>different brackets
What? Racket uses parens. Using square brackets is completely optional, they function the same as parens.
>>
>>62190627
parenthesis
>>
>>62190658
Racket uses parenthesis... are you somehow confusing racket with another language?
>>
>>62190620
>using parens at all
>beautiful
pick 1
>>
>>62188907
It doesn't matter what homos think because homos are an irrelevant minority and they will all suffer death when China and Islam have attained social superiority through numbers on the global scene.
>>
>>62190697
We're talking about faithfulness to Lisp.
Now begone.
>>
>>62190697
Name a single whitespace formatted language that doesn't look like dogshit.
>>
File: 46yFL.jpg (39KB, 328x328px) Image search: [Google]
46yFL.jpg
39KB, 328x328px
>>62189867
>>
C# developer here. I love C#'s syntax, language design, and libraries. However, I hate that it's run by Microsoft, that Linux is a second-class citizen, and most importantly that it uses a runtime like Java.

I want to try something else out. Does anyone have any recommendations for me? Looking for something that's a high level language, like C#, but nicer to Linux and the open source community, and without a runtime. Something native.
>>
>>62190895
>high level language, like C# [...] and without a runtime
these are mutually exclusive
>>
>>62190895
>runtime
what is a runtime?
>>
>>62190484
I use franco, the one I am using
>>
>>62190907
Isn't something like Go supposed to be high level and native?
>>
>>62190895
Try Go.
>>
>>62190895
Realistically: C++
Meme answer: Rust
>>
>>62190932
I suppose I should say a VM, like the CLR or JVM.
>>
>>62190980
Can C++ ever be considered a high level language?
>>
>>62190895
>High Level Language
Python, Go
>like C#
C++
>>
Does anyone have any resources for file organization in Rust? I'm used to languages like C++ and Java where the established wisdom is one file per class. Are there any rules of thumb for what should go in different files and what should go in mod.rs?
>>
>>62190996
What, does managing your own memory scare you? It's not that bad, that's why they made smart pointers.
>>
>>62189032
>(define player (Level-player level))
wtf
>>
>>62191007
Yeah
https://stopusingrust.com/useareallanguage.htm
>>
>>62190963
I forgot Go exists, that's probably the best one
>>
>>62189168
>>
>>62190996
why not ? all your basic programming is the same as C# or Java. You really have to get into the nuts and bolts before you can find something *lower* than you expect it to be.
>>
>>62190564
>implying you can't have the compiler optimize the code
>>
>>62190564
Gotta learn Python for a Data Structures class in Uni.

Honestly, it hasn't been that bad, just weird.
>>
>>62191044
What's the anime called?
>>
File: 514tKDs1M7L.jpg (59KB, 398x500px) Image search: [Google]
514tKDs1M7L.jpg
59KB, 398x500px
Reminder that this book is absolutely worth the read, even if the technology is outdated. It will change the way you think.
>>
>>62191035
Dead link
>>
>>62191064
Thanks, I guess I'll give it a go.
>>
>>62191157
>Michael Abrash
Where have I heard that name before?
>>
>>62191165
Dead language
>>
>>62191035
>everyone should just keep using the same language that was designed decades ago, even though every programmer spends their entire life cursing it
>>
>>62191195
Out of all the languages you could pick, Rust shouldn't be it. It's a hobbyist language that will never get a foothold in the industry
>>
>>62191195
>we should continue making new wheels, only for ppl to grow tired of said wheel so they can build another one, until there are too many wheels to count and none of them work together very well

Bunch of clowns riding uni-cycles.
>>
>>62191212
What then? What's a good modern language?
>>
>>62188731
I'm learning C as my first real attempt at programming, and I was wondering if someone could point me in the right direction on a project that I am working on. A while back I tried to take a Java class, and chose a project on the Monty Hall problem. Basically, make a game that runs through it. I ended up copying it because I didn't know enough, but I want to do it for real this time. Here's the issue:

I want to initialize three doors, one has a car, the other two have goats. They need to be random, but always one car and two goats. Does anyone have any ways I could go about making this in C? I haven't finished my first C book yet, so I'm sorry if this just pissed you off.
>>
Is a pointer variable somehow a similar concept as a symbolic link in *nix systems?

I know it's a silly comparison, but I am just trying to understand pointer variables.
>>
>>62191239
Do you always need new toys to play with?
>>
>>62191239
>Good
>Modern
It doesn't exist yet
>>
>>62188868
>like
>"ew that's fucking gay"
>except they're the homo instead
>so it's like
>"ew that's fucking straight"
Actual gay man here. I do this. And my reasoning is because using "gay" in such a way usually is a replacement for the words stupid or retarded.
It's offensive. I don't go on a rage though like some SJW. I just replace Gay with Straight as kind of a "fuck you. I can do it too. How does that feel" kind of thing.
Completely passive aggressive, but it usually gets the point across.
Being gay is not a negative thing to be shamed for.
>but it is because God said so
and so is eating shellfish but you don't see right wing evangelists protesting Red Lobster.
>but you can't have biological children
We can. There's just a lot more red tape involved and a lot more cost. No gay couple has an "oops" child. Every child a gay couple has, whether biological or not because red tape, is wanted. Look up surrogate mothers.

/rant
>>
>>62188731
Becoming full neet, haven't left home in 37 days 21 hours now
>>
>>62191305
I think I'd laugh if I heard a queer go "ew, that's so straight."
"What are you, a FAG?"
>>
File: 1387503671517.png (787KB, 960x818px) Image search: [Google]
1387503671517.png
787KB, 960x818px
>>62191318
Livin' the dream yet?
>>
from os import fork, _exit, EX_OK

pid = fork()
if(pid):
print(pid)
input()
else:
_exit(EX_OK)


Why is the child process's PID still in the list of running processes after executing the _exit function?
>>
>>62191328
>yes
what you gonna do, straightboi
>>
>>62191363
Look you straight in the eye and say "Queers should be hung"
>>
>>62191350
What anime is that?
>>
File: 1440445067796.jpg (205KB, 640x500px) Image search: [Google]
1440445067796.jpg
205KB, 640x500px
>>62191328
>"What are you, a FAG?"
Yes
>>
>>62191375
kinky.
BTW
According to studies, gays are generally more hung.
>>
>>62191232
>why do we spend millions on materials science to produce new alloys for wheel hubs when the wooden wheel worked perfectly before!?
>>
>>62191406
>kinky
I can get the rope and the chair now if you like?
>>
>>62191406
>>62191450
How tall are you? I wanna make sure you swing
>>
Since i'm already here, i might as well:
I'm doing a function that returns the point where 2 lines intersect.
Before that, i'm doing a function that returns true if the lines intersect or false if they don't.
I'm already having trouble for some weird reason. Is that reason that (absolute(a - b) <= 0) is pretty much a == b?
>Working with doubles btw, otherwise i doubt i'd be having trouble
>Should i just give up and work with whole numbers?
>>
Why is rust a meme?
>>
>>62191546
Literally Z E R O foothold in the industry. C++ is already too stronk in the industry, and only webdev pajeets grab onto the newest shit left and right.
>>
File: 1503144235407.jpg (28KB, 542x650px) Image search: [Google]
1503144235407.jpg
28KB, 542x650px
I want to read some lightweight programming book in my free time/bus time, something that is not heavy on programming maybe? Any recommendations? Language doesn't matter, but I'm mostly proficient in Python, and somewhat in Java
>>
>>62191546
6 types of strings
no ternaries
god-awful syntax
shilling not on merit but the same two buzzwords
slower than most languages.
insufferable community
>>
>>62191573
>lightweight programming book
The Pragmatic Programmer
>>
>>62191562
Who cares about the industry? I'll slave away using an inelegant, unsafe 30 year old language at work because it puts food on the table, but that doesn't mean I have to do it at home.
>>
>>62191573
>tfw no bus service nearby and have to drive 1.5 hours to work and 1.5 hours back
>so much wasted time and driving is too draining to study in my little freetime

I WANT TO TAKE THE BUS
AAAAAAAAAAHHHH IT'S NOT FAIR
FUCK YOUUUUUUUUUUUU
>>
>>62191597
Then this >>62191577 sums it up. Also
>Work all day racking your brains on C++
>Want to come home and "hobby dev"
Do yourself a nice favor and use something really high level then. Like Python. Your brain will thank you.
>>
>>62191626
>having car
>complaining
In my country it's almost impossible to find a job if you don't have a car.

>>62191584
gonna look into it, thank you
>>
>>62191705
Impossible to get a job if you don't own a car or a license?
>>
>>62191722
License, sorry. But either way I'm fucked. No job because of license, no money for license because no job
>>
>>62191305
Faggots are extremely petty lmao
>>
>>62191744
Does your country not have a non-driver license? I know the US does.
>No money to get a job
>Money to get a book
C'mon mannnnnnnnnnnn
>>
>>62191407
>implying a programming language is even close to being similar to materials/manufacturing tech
>>
I need to figure out a way to get the latest messages from some telegram groups, anyone here knows how I can do that? I think my only hope is to CTRL+A CTRL+C CTRL+V every second...
>>
>>62191765
>>Money to get a book
>implying
I use internet to get books for """"free"""
>>
>>62191784
Regardless, best of luck getting out of that vicious cycle.
>>
>>62191799
Thanks. I'd put a smiley emoticon, but the whole board would kill me.
>>
File: 178863100db4.jpg (14KB, 240x160px) Image search: [Google]
178863100db4.jpg
14KB, 240x160px
s/\((.+?)\)/'('.$1=~s|\n\t| |gr.')'/gse


this fucking language
>>
>>62191858
redpill me on PCRE vs ERE vs emacs re
>>
>>62191858
Is that RegEx? What am I looking at?
>>
>>62191007

https://rustbyexample.com/mod/split.html
>>
>>62191878
ruby pls post boipuss
>>
>>62191880
>boipuss
but she's a girl
>>
>>62191880

Wow, that was fast... and no.
>>
>>62191890
pussy
>>
>>62191890
PLEASE
>>
>>62191254
>>I want to initialize three doors, one has a car, the other two have goats. They need to be random, but always one car and two goats. Does anyone have any ways I could go about making this in C?
Generate a random int between 1 and 3. If the int is 1, the car is behind door 1. If it's 3, the car is behind door 3.

Simple, no?
>>
>>62191865
No clue. I've a feeling that emacs will be the most insane.

>>62191868
Yep with some Perl interspersed. It flattens out a C-style function that's been manually wrapped like so:
void foo(int a,
int b,
int c);

It can be made slightly more readable by moving the second expression into a subroutine but that's much to boring.
>>
>>62191972
For what purpose?
>>
>>62191629
>Do yourself a nice favor and use something really high level then. Like Python. Your brain will thank you.
Except Python isn't elegant either.
>>
File: wojak_beard.png (23KB, 353x351px) Image search: [Google]
wojak_beard.png
23KB, 353x351px
>tfw I finally got a job after months of unemployment
>tfw I was starting to enjoy the NEET life
JUST
>>
>>62191972
but why?
>>
File: 1503781265028.jpg (1MB, 620x4144px) Image search: [Google]
1503781265028.jpg
1MB, 620x4144px
what needs to be added to this image?
>>
>>62192011
I suggested it because it's a toy lang that brainlets can pick up and use in an afternoon. No thinking after a long day of work. Just fun.
>>
>>62191360
because on linux, any processes spawned by another process (child processes) continue to display as long as the host is still running
they're referred to as "zombies"
>>
I'm new if you can't tell by my question, and I'm getting started with python. Anyway, why can you append integers but not extend lists with them? I'm trying to get results to go into a list and if I append, it works but it prints a bunch of lists ([1] , then [1, 2] , then [1,2,3] etc).
I want to add them all in one go and the notation where you define the list as list = [x for x in...] is not working, for some reason.

Can't post source at the moment, I apologize for any autism
>>
>>62192086
you can, you probably just got the syntax wrong
for example
list a = [1,2,3]
a += [4,]
>>
>>62192104
I guess so. I've been using (or trying to use) list.extend(1,2)
>>
>>62191988
>>62192034
I'm making a D binding for libxcb so I've written some Perl scripts to speed up converting C headers. This specific snippet is pure autism though because I want the new interface files to conform to my code style.
>>
>>62192046
Where is D?
>>
>>62192150
What about dstep
>>
>>62191752
whatever breeder.
>>
>>62192175
You never answered how tall you were, faggot.
>>
>>62192084
I see. Thanks.
It seems all those zombies are still using resources which is making the whole system start throwing "Resource temporarily unavailable" errors occasionally.
>>
>>62191305
Fuck off faggot. Quit shitting up this thread with your GRIDS.
>>
File: 1502064408674.png (1MB, 1080x1288px) Image search: [Google]
1502064408674.png
1MB, 1080x1288px
>tfw your OCD forces you to align all your declarations/assignments/whatever into neatly organized columns
>tfw not using an extension to do this, just manually tabbing and spacing

I've literally spent tens of thousands of hours just inserting whitespaces over the course of my career and I've gotten paid for it.
>>
>>62192376
Sounds like you're livin' the dream
>>
>>62191858
what
>>
>>62191880
please. do it for the children
>>
>>62191476
>checking if absolute value is less than 0
>>
>>62192046
Rust, the new best language.
>>
>>62192496
>Rust, the new best punching bag
ftfy
>>
File: 1479792028078.jpg (152KB, 960x1280px) Image search: [Google]
1479792028078.jpg
152KB, 960x1280px
>>62192254
>>
>>62192595
>>>/facebook/
>>
>>62192186
Because I wasn't the faggot you replied to.
>yfw you realize there's more than 1 faggot on 4chins
>>
File: 1438553046275.jpg (173KB, 700x1133px) Image search: [Google]
1438553046275.jpg
173KB, 700x1133px
>>62192606
>Twingo memes
>facebook
pick one. These memes are from /o/
>>
>>62192607
Well, gimme your measure and I can set up the same for you.
>>
File: 1499392243070.png (111KB, 311x304px) Image search: [Google]
1499392243070.png
111KB, 311x304px
Is anyone else here too stupid to get programming.
Sad part is I don't have a choice since I have MS and losing function of my body.
>>
>>62192619
>Go home ____ You're Drunk!
>Not facebook-tier
>>
File: 1483847566100.png (60KB, 400x400px) Image search: [Google]
1483847566100.png
60KB, 400x400px
>>62192636
>>
>>62192659
Don't make me honk at you, you son of a bitch
>>
File: 1482635656778.png (67KB, 347x334px) Image search: [Google]
1482635656778.png
67KB, 347x334px
>>62192662
>>
I have a dumb question guys. What does this mean, "the program expands tab characters"?
>>
>>62192676
Lemme rephrase it a bit clearer, what does "Expanding tabs into blanks" mean? And why would that ever be useful?
>>
>>62192676
>>62192719
It means converting tabs to spaces.
>>
>>62192719
I think it means it converts tabs into spaces
>>
Should I bother refreshing my C++ knowledge or should I go learn something else? I had to learn C++ in college a few years ago but I remember getting annoyed by the time I completed my final project. Now that I'm going to start GIS work I want to learn something that'll be helpful for neural networks and the like.
>>
>>62192727
>>62192731
Thank you guys. Does the author of the book phrase it that way, because in a way, you are "expanding the number" of characters used? For example, 1 tab, into 8 spaces?
>>
>>62192789
Yeah. What ever amount of spaces a tab character represents.
>>
>>62192783
Ask your coworkers what they use.
>>
>>62192719
>And why would that ever be useful

Because the definition of a tab is completely up to the editor and user configuration. If you want consistent indentation, use spaces.
>>
>>62192829
Good to know, thanks anon.
>>
File: 1480406866146.png (32KB, 335x158px) Image search: [Google]
1480406866146.png
32KB, 335x158px
>>62191031
I would guess that Level-player is a constructor, and the player object needs to know what level it's on from initialization, or something like that, so the constructor takes a level as an argument.

Relevant capcha
>>
>>62189269
Hey man, haven't seen you around in a while, how's nntpchan going? I should hang out there more often
>>
File: college tits.png (45KB, 305x257px) Image search: [Google]
college tits.png
45KB, 305x257px
>>62193046
Sometimes captcha can be cool
>>
>>62190907
Haskell technically has a runtime, however it is always embedded in the final executable, like Go.
>>
File: 1483822024810.jpg (38KB, 729x644px) Image search: [Google]
1483822024810.jpg
38KB, 729x644px
>>62193124
>>
>>62193230
Please explain this meme if you're going to keep posting it
>>
>>62193248
/o/
>>
>>62193263
Yes, but what's the c o n t e x t
>>
>>62193263
>I don't know, I just think they're funny
wew
>>
>>62193437
>>62193278
Its a cross-board shitposter that has a few gimmicks, he posts in /agdg/ too.
>>
Brainlet here, going through K&R. I am having difficulties understanding this program. Here is the assignment
Exercise 1-22
Write a program to "fold" long input lines into two or more shorter lines after
the last nonblank character that occurs before then-th column of input. Make
sure your program does something intelligent with very long lines, and if there
are no blanks or tabs before the specified column.

What exactly does the author mean by "folding"? Where should I "fold"? Also, I was reviewing the answer, and I didn't really understand it as well. I would like to post it, but for some reason I am getting a "connection error". Any way to bypass that?
>>
>>62193508
It means that if a line exceeds a certain length (column) you find the next whitespace and split the line so that the other half is on the next line. e.g.
the is my long line

After using the program on it you get
this is my
long line
>>
>>62193629
>>62193508
>you find the next whitespace
Change that to the white space before the n-th column
>>
>>62193629
>>62193662
Wow, thanks guys. It makes much more sense now. I know that I am brainlet, but K&R could have phrased that a bit better lol. Anyways, it is a fantastic book nonetheless.
>>
File: 1370455201741.gif (1020KB, 444x250px) Image search: [Google]
1370455201741.gif
1020KB, 444x250px
>>62193705
>tfw your physical copy of K&R is on its way
>>
File: 1483732265802.jpg (415KB, 1632x918px) Image search: [Google]
1483732265802.jpg
415KB, 1632x918px
>>62193278
The Renault Twingo is the antithesis of modern car design. It's small, light, adorable, and not angry. On top of that, it's a reliable, practical, cheap, and adorable.
So it became a meme.

/o/ actually loves the Twingo so much, an an/o/n started a business selling Twingo plush toys.
https://www.autoplush.com/
>>
>>62193737
>an an/o/n started a business selling Twingo plush toys
I have no reaction image to properly simulate my current face
>>
File: 1488313564784.png (617KB, 1178x520px) Image search: [Google]
1488313564784.png
617KB, 1178x520px
>>62193765
how 'bout this one?
>>
>>62192376
I literally thought everyone did this
I'm pretty sure we all do
>>
File: smug_comfy_pepe.jpg (12KB, 225x225px) Image search: [Google]
smug_comfy_pepe.jpg
12KB, 225x225px
>>62193736
>tfw you have already had physical copy of K&R for years
>>
>>62192140
you want to do list.extend([1,2])
>>
File: 1405616600040.gif (879KB, 500x240px) Image search: [Google]
1405616600040.gif
879KB, 500x240px
>>62194110
Soon to be, brother. Soon to be.
>>
What do you call the operation where you generate all length combinations of a multiset (list)?

Say you have the multiset (or list): [1, 2, 3, 4]
I would generate:
[1]
[2]
[3]
[1, 2]
[1, 3]
[1, 4]
[2, 3]
...
[1, 3, 4]
[2, 3, 4]
[1, 2, 3, 4]

What would that operation be called?

It is essentially picking the first partition of all the 2-partitions of the multiset (or list).
>>
I feel what little skill and knowledge I had rotting away...
between working out, taking FIVE non-programming / CS classes this semester, and other random daily bullshit, I have almost no dedicated programming time.
>>
>>62194398
permutations if you want to include repetitions (like 1,2,3 and 3,2,1)
combinations if you don't want to include repetitions
>>
What's the appropriate place to put networking in model/view/presenter? Basically, my application has a clientside user interface for a serverside data model. I need to do some clientside logic, but I also need to do some serverside logic for data validation and verification. I was thinking of having a clientside presenter that attaches to the view and a serverside presenter that attaches to the model, and hiding the netcode in the presenter. Can anyone think of any pitfalls with this? Are there any other patterns that I should consider instead?
>>
Explain to me why

¡Dos!

converts to
¡Dos!


in UTF-8

It's breaking my Labels
>>
>>62194617
stop spreading your OOP design pattern AIDS in here
>>
>>62194398
For a set, this is the powerset. I don't know whether the analogous operation for a multiset has a particular name.
>>
>>62190572
Open source doesn't do that?
>>
>>62194649
t. newfag programmer who can't stand well structured programs
>>
>>62194110
but have you read it
>>
File: smug_pepe_in_the_pool.gif (267KB, 300x456px) Image search: [Google]
smug_pepe_in_the_pool.gif
267KB, 300x456px
>>62194955
Yes you poopy face
>>
>>62189032
hell yea, keep up the good work
>>
>>62194967
I hate this gif. The reflection should meet.
>>
java is bullshit
>>
>>62194967
Dumb frogposter.
>>
File: Java wins again.jpg (46KB, 620x413px) Image search: [Google]
Java wins again.jpg
46KB, 620x413px
Good morning fellow Eurofags

https://www.sciencedaily.com/releases/2017/08/170827101750.htm
>>
>>62195290
>what is correlation
>what is causation
https://www.youtube.com/watch?v=0Rnq1NpHdmw
>>
>>62195345
>implying that matters
>what is being a brainlet
>>
>>62190428
literally only need github and maybe irc
hell, you can just use mailing lists
for example llvm and some other big projects have bugzillas and things, but that's like one minute to register
>>
>>62191858
every language worth a siht has these regexps you fucking brainlet
learn the syntax
>>
>>62195389
>work a comfy white collar job
>stay indoor most of the day
>have a lower risk of early death
>happen to drink a lot of coffee

>be poorfag
>live in a poor neighborhood
>have a higher risk of getting stabbed etc
>happen to drink less coffee

really makes you think
>>
Are there any jobs in programming where you get to work in an office and you get to keep to yourself? Someone brings tasks or whatever and you do them and that's it.
>>
File: normies.jpg (187KB, 1200x900px) Image search: [Google]
normies.jpg
187KB, 1200x900px
>>62195601
it's usually more like this
>>
>>62195594
>>be poorfag
>>live in a poor neighborhood
>>have a higher risk of getting stabbed etc
if you're in /dpt/ you can do better with some discipline and focus
>>
>>62195601
I heard that you can find a place where you can work from "home office"
>>
>>62195620
>>62195601
This
most offices for programming are either open, for open discussion of ideas / sharing

or shared cubicles
>>
>>62195763
what if you prefer to work in quit because you're not a weblet or ui gfx nija?
>>
>>62195820
*quiet
>>
File: dead.png (17KB, 926x249px) Image search: [Google]
dead.png
17KB, 926x249px
post em
>>
>>62194161
Thanks
>>
>>62195911
mouse over it in your IDE
>>
>>62195763
I've yet to work in one. I find it hard to believe I'm just lucky.
I get my own office and a variety of chairs by my choosing.
>>
I wish I discovered F# sooner, so goddamn beautiful
>>
>>62191138
Getsuyoubi no Tawawa. Tawawa on Monday or something in English. It's a series of short Twitter webcomics by a Japanese (I think) illustrator. It was so popular that they even made an anime of it. Last time I remember, his booth at Comiket had the longest queue.
>>
If I don't have that desire to constantly program can I make it as a programmer? I'll work on a project for a couple weeks then go a few weeks without doing anything or only fixing or changing old programs.
>>
>>62196324
if by making it as a programmer, you mean doing it for a living, then sure. There're people out there who absolutely hate their jobs and still make it.
>>
I hit a brick wall with my C program. Any experts here that could help?

Basically I have an array of a strings
char *filenames[] = { "aaaa", "bb", "ccccc" };


I want this to be part of a struct. Because the number of strings inside the array can vary, I can't just define a fixed size array in the struct. So I tried a pointer to it.

struct load_data {
char **img;
};
const char **ptr_images = filenames;
struct load_data data = { ptr_images }

this gives me these errors and warnings:

warning: initialization from incompatible pointer type [-Wincompatible-pointer-types] char **ptr_images = filenames;
note: (near initialization for ‘data.img’)

can anyone tell me the glaring error I'm making and what the right apporach would look like?
>>
>>62196324
if you do any programming at all in your free time, or ever browse programming related web pages (like this one) you're already more active and involved in programming than 90% of professional programmers
>>
>>62189058
The company I work for uses MongoDB as event storage in an event sourcing engine. I hate it so fucking much - like, didn't you have any sane alternative? Literally everything else would've been a better choice!
Fuck, I'm mad now
>>
>>62189058
>>62196422
...and they wanted to use its' gridfs abortion to store files. Luckily, I managed to talk them out of that shit
>>
>>62196416
You need to malloc enough space for ptr_images and then memcpy it.

Also a flexible array member may be appropriate here
>>
New thread:

>>62196453
>>62196453
>>62196453
>>
>>62189800
Done
t. professional clojure programmer
>>
>>62196416
maybe because "filenames" is a const?
which means its a pointer to a space in ur code which cant be edited.
if u memcpy it then it stops being a const ptr and becomes a regular piece of memory u can edit.

>>62196469
flexible arrays bring on their own set of rules u need to learn before using. specifically how to alloc, access and declare.
>>
Voting system for school election using visual basic. The thing is I have n!l background to programming.
>>
File: 77498.png (33KB, 800x627px) Image search: [Google]
77498.png
33KB, 800x627px
How do I actually use ncurses, it seems like a pain in the ass. And would it be possible to write my own macro based implementation for the keks?
Thread posts: 319
Thread images: 43


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