[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: 346
Thread images: 57

File: 1486072446475.jpg (217KB, 700x671px) Image search: [Google]
1486072446475.jpg
217KB, 700x671px
Old thread: >>59594649

What are you working on, /g/?
>>
File: 1490560476619.jpg (81KB, 881x602px) Image search: [Google]
1490560476619.jpg
81KB, 881x602px
>>
>>59600065
Is starting threads with trap anime just tradition, or are they always made by the same person.
>>
>>59600078
>being a wincuck
>>
>>59600095
most likely the same guy every time
>>
>>59600114
I actually don't mind trap threads.
>>
Doing Project Euler again!
I'm a shitty programmer, so I'm very familiar with the error in pic related, but how do I actually get the invocation to show up?

I go to "Other Linker Flags" in "Build Settings" and add the '-v' flag, but it doesn't give me any additional advice...

On a related note, I'm getting this error because I'm trying to use the GMP libraries

I added them to the "Linked Frameworks and Libraries" tab in General and added header/library search paths, but I still get an error. What am I doing wrong?
>>
learning elixir, gives me good feels in the peepee
>>
File: 123ddd.jpg (17KB, 402x265px) Image search: [Google]
123ddd.jpg
17KB, 402x265px
> --long-option=argument
> --long-option argument

What is each of these styles called? How did they come to be?
>>
>>59600146
look up gnu readline and vargs
>>
File: 1428209569855.webm (721KB, 480x360px) Image search: [Google]
1428209569855.webm
721KB, 480x360px
>>
>>59600128
>Mac
>>
File: index.jpg (9KB, 231x218px) Image search: [Google]
index.jpg
9KB, 231x218px
>>59600126
> not preferring the superior loli programming meme

People just don't know the joys of achieving SC satori.
>>
File: 1484707311198.webm (3MB, 1276x1048px) Image search: [Google]
1484707311198.webm
3MB, 1276x1048px
>>
>>59600155
man (1) readline talks about variables and key bindings. Where can I read more about "vargs".

Please help senpais!
>>
>>59600156
The real woman disappeared in the moments later at around 0:14, but no one noticed!
>>
>>59600216
>that guy with the anime girls on his application windows
Oh shit what's up? Have you been doing any other projects or have you mainly ben focusing on this one thing (I ain't judging, it's a cool project!)
>>
>>59600157
I mean, not to tell you how to do your job, but you had a much easier target
>being this desperate that you scream into the void that is /dpt/ for help
Alternatively
>Being this shit at programming
>>
>>59600243
>Being this much of an apple faggot
>>
>>59600228
looks like like I confused, look up getopt
>>
File: 1483916193167.webm (3MB, 1612x892px) Image search: [Google]
1483916193167.webm
3MB, 1612x892px
>>59600232

>>59600202
>>
>>59600095
Same group of (((people)))
>>59600065
Cut your nose.
>>
(((>>59600274)))
No
>>
Building a social network for weebs centered around image sharing and blogging.
>>
>>59600065

SOURCE!!!!!!?????
>>
>>59600095
tradition
>>
>>59600114
>>59600274
>>59600304

>Helping newfags..
>>
>>59600261
>getopt

None of the four man pages answer either of my questions :(
>>
File: 1490562358685.jpg (465KB, 1919x1031px) Image search: [Google]
1490562358685.jpg
465KB, 1919x1031px
>>59600232
mostly playing with this thing
>>
File: suggestive.png (48KB, 1320x222px) Image search: [Google]
suggestive.png
48KB, 1320x222px
>>59600065
daily reminder that /g/ has created a market for striped programming socks
>>
>>59600346
all /g/ did was notice a correlation
>>
>>59600065
>>59600196

After observing many iterations /dpt taught me that:

> A) C is for traps
> B) Lisps are for lolis
>>
>>59600365
What about CLisp?
>>
File: 1413777090510.png (1MB, 1920x1080px) Image search: [Google]
1413777090510.png
1MB, 1920x1080px
W.. where is rust?
>>
>>59600353
stfu faggot
>>
>>59600365
>tfw I've been doing C for a long time
hey guys femanon here :3
>>
>>59600365
c is gross i prefer python :3c
>>
>>59600416
you know its dangerous here for little girls like you right?
>>
>>59600424
n-n-no?
>>
>>59600400
Rust would be a 2 y/o loli
>>
>>59600407
>femanon is a loaded term that doesn't really give me much information about your naughty parts. I'm not sure how to proceed. I don't want to be gay.

That's why I dropped rust.
>>
>>59600447
shit. I meant C I swear
>>
File: krautbbs_03a_02.webm (3MB, 832x1024px) Image search: [Google]
krautbbs_03a_02.webm
3MB, 832x1024px
>>59600065
I was working on webm related, but since KC got raided by the Polizei, I plan to remake this thing for 4chan.
It's basically a BBS-simulator where you can browse boards, open threads and download every file from within a thread.
Was working on posting, but oh well...
>>
>>59600447
sounds like freudian slip, you are right tho
>>59600441
yes, they might want to eat your tiny puffy boobies, i know someone like that ;3
>>
>>59600444
in a safety cage/crib
>>
File: 1384651310271.jpg (49KB, 400x400px) Image search: [Google]
1384651310271.jpg
49KB, 400x400px
>>59600444
What would that make the programmer that write Rust software?
>>
>>59600478
with a helmet and knee pads on
>>
File: tumblr_ofryyks6HB1u0z65io1_500.png (249KB, 500x687px) Image search: [Google]
tumblr_ofryyks6HB1u0z65io1_500.png
249KB, 500x687px
>>59600486
>loli status
>PROTECTED
>>
File: 1399200301506.jpg (123KB, 625x833px) Image search: [Google]
1399200301506.jpg
123KB, 625x833px
>>59600458
>It's basically a BBS-simulator where you can browse boards, open threads and download every file from within a thread.

I like you, and I think this is a good idea.
>>
>>59600482
pedophiles
>>
File: aaa-fullpage.png (619KB, 1353x2747px) Image search: [Google]
aaa-fullpage.png
619KB, 1353x2747px
>>59600346
lair :(
>>
>>59600576
Just that you know, spelling it correctly didn't yield any results either.
>>
>>59600407
do you like sucking cock?
>>
>>59600657
it makes me feel uncomfortable when i wear tight pants~
>>
I know Unity-tier C#, which language should I learn to do some hobby non-game projects?
>>
File: 1463143611560.png (947B, 416x454px) Image search: [Google]
1463143611560.png
947B, 416x454px
i want to achieve the results of programming but have no interest in the skill itself
>>
>>59600891
Elixir
>>
>>59600891
C# is fine, unity is also not even an awful idea if it's a heavily graphical non-game project. There's also every other toolkit available, gtksharp and that sort of thing.
>>
>>59600095
You're on anime site.

There's reddit for your non-anime needs.
>>
>>59600891
c++
>>
>>59600065
The fuck is this meme?
>>
>>59600146
Who gives a shit which Unix nerd invented it?
>>
>>59600065
Now all you need is to put the dpt twitter in the OP and the conversion to shitposting general will be complete.
>>
>>59600400
Ruby cute
CUTE
>>
File: TURBO SHIT.jpg (192KB, 1226x1280px) Image search: [Google]
TURBO SHIT.jpg
192KB, 1226x1280px
>>59600498
>>59600486
>>59600478
>>59600444
>>59600400

Behold: Rust.
>>
>>59601032
Do his socks make him a better programmer?
>>
>>59600901
I had no particular project in mind, I just want to dive into something else than C#.
>>59600912
Is it insanely hard to learn?
>>
>>59601032
hahahahahahaha
>>
>>59601032
What are you trying to say?
>>
File: 1487463346405.png (97KB, 1934x1069px) Image search: [Google]
1487463346405.png
97KB, 1934x1069px
>>59601032
>>59601042
Behold: (((C)))
>>
>>59601040
It's not as hard as people claim it to be, especially post-C++11.
>>
File: dmd.png (115KB, 283x200px) Image search: [Google]
dmd.png
115KB, 283x200px
>>59601075
>dmd
>>
>>59601075
top kek everytime
>>
File: 1487974409142.jpg (79KB, 640x640px) Image search: [Google]
1487974409142.jpg
79KB, 640x640px
>>59601075
>Falling for the 'c' meme
>>
File: 1341619539905.jpg (107KB, 613x533px) Image search: [Google]
1341619539905.jpg
107KB, 613x533px
>tfw syntax highlighting leads to ugly code
>>
>>59601075
Now compile it with warnings enabled.
>>
>>59601178
>compiling anything without
-Wall -Wextra -Werror
>>
File: 1374575428855.jpg (113KB, 1280x720px) Image search: [Google]
1374575428855.jpg
113KB, 1280x720px
>>59601191
>No -Wpedantic
>>
>>59601139
It's like putting makeup on top of natural beauty.
>>
>>59601139
Use muted colours, or some shit.
>>
>>59601075
That's just pathetic. If you have those behaviors undefined you should either halt the compilation or fucking define the order.

But who the fuck uses C anyways
>>
>>59601075
>Implying any language with functions(in the standard library no less) with side effects is good
>>
>>59601221
Except side effects was the point of that piece of code
>>
File: 1469885054941.png (125KB, 760x316px) Image search: [Google]
1469885054941.png
125KB, 760x316px
hello fellow redditors, which language should I start learning today?
>>
>>59601232
C. Reddit loves it.
>>
>>59601228
And my point was that both D and C were shown to be shit
>>
>>59601243
Only C*
>>
File: 1488818361206.png (289KB, 700x740px) Image search: [Google]
1488818361206.png
289KB, 700x740px
>tfw can't bring myself to like any of the 3 efficient languages
>>
>>59601251
Increment in the D example has a side effect, but has apparently better defined evaluation order.
>>
>>59601269
This so much

>C
97 undefined behaviors in a hello world project and 88 malloc autism per 3 lines
>Rust
Syntax ugly as sin, counter-intuitive sack of shit
>C++
A good collection of problems that exist in C and Rust and more

J U S T
>>
>>59601291
>Rust
>C++
He said efficient
>>
File: 1490213164540.png (216KB, 1712x944px) Image search: [Google]
1490213164540.png
216KB, 1712x944px
>>59601296
>>
>>59601291
He meant C, Pascal and Fortran you nu-male.
>>
File: 1200px-Gnu_meditate_levitate.png (588KB, 1200x1043px) Image search: [Google]
1200px-Gnu_meditate_levitate.png
588KB, 1200x1043px
Is it usually alright to add .txt attachments in an email to a mailing list? Don't want to trigger any autists
>>
>>59601313
>Pascal
lel, it's even slower than Java. In some cases the same goes for FORTRAN you meme spewing kiddie
>>
>>59601305
Thanks for proving my point
>>
>>59601242
but what if I already know C?
Any new meme language that reddit likes?
>>
>>59601323
That does not prove your point
>>
>>59601327
C and C only.
>>
>>59601313
>>59601305
>>
>>59601342
>shitty benchmarks that's rigged so that some languages can't compete fairly
fuck off
>>
File: rooby.jpg (19KB, 300x440px) Image search: [Google]
rooby.jpg
19KB, 300x440px
Practicing Ruby on codeacademy.

I tried to learn it when I was about 13 but didn't have the attention span to keep going. It looks like a lot has changed since then. Learnt Visual Basic in high school and some Python during my undergrad.

What languages are you learning guys?
>>
>>59601313
>Pascal
>>
>>59601358
0/10
>>
>>59601359
C
>>
>>59601359
D
>>
>>59601359
You know, you can use this site without necessity to fill the ``Name'' field.
>>
What programming languages Stallman doesn't recommend to use because of their non-free nature?
>>
>>59601359

>>59601269 here. I started with C
Then JS, C++(didn't finish), Java (didn't finish), C#, python, Vala (didn't finish), D(didn't finish), Rust (didn't finish)
Now I'm learning D. Seems pretty alright but there is almost no way to read a single key stroke (the getch() equivalent) in D.

Out of all the languages Rust looks promising but dealing with its ownership system is a horrible pain in the ass.
>>
>>59601394
By programming language you mean the compiler/VM/libraries, right?
>>
>>59601394
Most likely C# or anything that runs only on clr.
>>
>>59601378
No worries mate.
I was just testing the namefag thing. I know most people here find it annoying though.
>>
>>59601394
Stallman is a fucking pedo autist so who cares.
>>
>>59601503
Me
>>
>>59601503
we pedos must stick together
>>
>>59601359
>Practicing Ruby on codeacademy.

Feel free to ask anything about the language. I got years of experience and knowledge
>>
>>59601471
I know only mips and pic18 but every command takes parameters from registers. If you have value in stack you need to put it's value to some register to operate on it.
>>
>>59601503
pedo website
>>
>>59600894
Yeah nah just kill yourself.
>>
File: tmp_20022-1489437351596-18243771.jpg (322KB, 1280x720px) Image search: [Google]
tmp_20022-1489437351596-18243771.jpg
322KB, 1280x720px
>>59601588
>i'd make you my bitch if you were in prison with me
>see how you like it then
Wew.
Allright, detect my IP and come to catch me, if you can.
>>
>>59601697
Absolutely related.
Write a program to detect pedo messages in /dpt/ and mark them.
Unfortunately, it will make 50% of /dpt/ posts pedo markers.
>>
File: 1489235405283.png (116KB, 700x603px) Image search: [Google]
1489235405283.png
116KB, 700x603px
What's a practical, simple and efficient programming language?
>>
>>59601799
Te question is legit.
I was thinking of C or Lua, but honestly i don't know a shit about programming.
>>
>>59601826
lua's pretty friendly
>>
am i shooting myself in the ass or is this the right way to do binary manipulation?

>python 3
>read bytes from file offset to a list
>manipulate the list, make sublists, do math, add, subtract items, do all kinds of crazy shit
>when done with the list, convert it to bytes and write it back in

i mean it works but is it the """"""""right"""""""" way
>>
>>59601878
I mean I read, say, 4 bytes to and convert the bytes to a list because it's easier to work with [0, 255, 121, 4] than b'/x00/xffy/x04'
when i'm done doing math with the individual list items, just convert the list back to bytes and write the new bytes to the same offset
>>
File: 1478850179316.jpg (18KB, 597x519px) Image search: [Google]
1478850179316.jpg
18KB, 597x519px
>have a long boot up time, takes 6-8 hours from the time when i wake up until i get started with programming
>decide that it's better to stay awake for long periods of time with minimal sleep and rest
>but coffee doesn't work well in the long term for gaining focus and staying awake and alert
what do?
>>
File: dpt.jpg (164KB, 800x1000px) Image search: [Google]
dpt.jpg
164KB, 800x1000px
>>59600065
>>
>>59601951
Exercise and eat a good breakfast.
>>
>>59601951
normal sleep schedule + no internet for the first 2-3 hours after waking up
>>
>>59601545
Could you recommend any texts?

Flying though this codeacademy course.
>>
>>59601956
me in the bottom panel
>>
>>59600394
>C) clisp is for sh0ta
>>
>>59601951
Nigga
I dream about programming.
>>
File: MVI_0705.MOV.webm (2MB, 1280x720px) Image search: [Google]
MVI_0705.MOV.webm
2MB, 1280x720px
Will I make it to google? I did FizzBuzz.
>>
File: IMG_0706.jpg (932KB, 3000x2000px) Image search: [Google]
IMG_0706.jpg
932KB, 3000x2000px
>>59602017
PS: I dont know why the focus fucked up.
It is an arduino with composite output
>>
>>59600394
shitty implementation of good standardized language.
>>
>>59602017
I don't, it's pretty slow... Can you invert binary tree on whiteboard?
>>
File: rubyist.jpg (18KB, 260x325px) Image search: [Google]
rubyist.jpg
18KB, 260x325px
>>59601996
The well grounded Rubyist
Eloquent Ruby

both are great.
>>
>>59601996

The books recommended by >>59602077 are nice. Also, you can't go wrong with the Ruby pickaxe book. It's available online and covers everything from basics to C extensions.

Make sure to learn the standard library. Things like the Enumerable module are very important.

If you have specific questions, just ask here or create a thread on /g/ I always reply when I see them
>>
Any GTK+ wizards here?

I want to create a simple system tray icon for my utility. According to the GTK3 documentation, the status icon has been deprecated[0]. Some other programs still use it though and it works. What does this mean for the future though?
What other way am I supposed to use to get an icon that sits in system trays?

[0] https://developer.gnome.org/gtk3/stable/GtkStatusIcon.html
>>
>>59601996
Also check out the Stack Overflow Documentation. Lots of explanations and examples there. I contributed some myself
>>
So my select query grabs six columns and I just want to grab for the row where it contains one thing. However I do it, it still ramps up 6 of the same thing. Why is that?
>>
>>59601826
In your case, Lua is better.
C is good language, but it requires much direct work with memory.
>>
I'm doing the CS50 xHarvard course on edX because I want to actually learn programming but I am missing a lot of the fundamentals.

I'm on week 1. I know the problems are supposed to be easy, and they are. However... I just spent 6 hours trying to figure something out because.. I didn't know long long exists and I was trying to (finally managed to) deal with it all in double, then convert it into int at the end.

fml
>>
>>59601788
Python or Go.
>>
>>59602353
>long long
meanwhile in a good language, thats just long
>>
>>59602317
I am pretty sure I am lost in what I am trying to do.
I have 4 different tables.
So the table I want has 8 columns and I only need 6 of them and I want to compare the columns to the other tables as they have stuff I want from them too via the value of the main table.

When I tried my "approach", I got the thing I wanted however it also printed out rows that didn't meet my condition.
>>
oop is the best
hipsters and olfgags cant prove me wrong
>>
>>59602430
it coresponds to your penis
>>
Is Swift an ok choice for first language to learn? I have no specific goals, just want to learn something and Xcode is comfy
>>
File: oop.png (152KB, 1948x858px) Image search: [Google]
oop.png
152KB, 1948x858px
>>59602508
>>
i have to do some state of the art research, is there an archive where can i find papers on some particular framework or application?
>>
>>59602729
hello world programs ofc they can
>>
>>59602283
>>59602317
>>59602441
Just wanted to say I solved it. The reason it repeated the things was due to me not doing all needed checks.
>>
>>59602793
Next time post your actual SQL so we can see what you're doing wrong.

Wanted to help, but I couldn't.
>>
>>59602212
ask in gtk IRC
>>
>>59602353
int64_t
>>
>>59600065
I'm developing a compiler for the empty language.
>>
>>59601588
I would've answered your question about syscalls if you didn't prove you don't belong here.
>>
New to C, I'm curious if I understand this right. There's this function:

cudaMalloc( void** devPtr, size_t count ) 


and it's called like this:

cudaMalloc( (void **) &d_arr, sizeof(float) * 120)


In regards to the first argument passed to the function,
&d_arr
is a pointer to a pointer assuming d_arr is a pointer, right? So we use the
(void **)
to cast it to a void pointer to a pointer, and pass it to he malloc wrapper so the function can actually modify the d_arr i.e. "pass by reference". Is this correct?
>>
Rewriting C++ game engine in C.
>>
>>59603117
Get a life loser
>>
>>59603070
no
>>
C was a mistake
It didn't have to be like this
>>
>>59603171
Very helpful thanks
>>
>>59603153
sepples fag mad that some people have standards and won't lower themselves to use shit like like sepples.
>>
>>59603187
Lol okay loser
>>
>>59603117
working with carmack code or something actually original?
>>
We chose to be "close to the metal" in an era of kb
and we have paid for our short-sightedness ever since
>>
File: 1415858731885.png (509KB, 480x488px) Image search: [Google]
1415858731885.png
509KB, 480x488px
How do you post code on here in that white text box?

I'm trying to learn Python 3 and I'm wondering how I would loop something...

print("how many cats do you have?")
numCats = input()
try:
if int(numCats) >= 4:
print('That is a lot of cats.')
elif int(numCats) in range(1, 3):
print('That is not that many cats.')
elif int(numCats) == 0:
print("Oh, you have no cats.")
except ValueError:
print('You did not enter a number.')


I want to make it so that when it says, "You did not enter a number." it loops back to "How many cats do you have?"
>>
>>59603230
>How do you post code on here in that white text box?
Holy shit, lurk more and read the fucking sticky on the first page of /g/.
>>
>>59603230
Read the rules.
>>
>>59603278
you will never make it brainlet
>>
>>59603265
I'm making progress
>>
>>59603230
I think that's an example from Automate the Boring Stuff, right? Code snippet instructions are in the board sticky.
>>
>>59602652
what are you a brainlet? too hard for u?
>>
>>59603070
I don't know about the other guy, but I think that is correct.
>>
>>59603295
>I think that's an example from Automate the Boring Stuff, right?
Yeah
>Code snippet instructions are in the board sticky.
Ok thx
>>
>>59603117
you will never make it brainlet
>>
>>59603070
this is correct
return value reserved for error codes I guess
>>
>>59603312
you will never make it brainlet
>>
There is no reason to unironically use Python 2.7 in 2k1x, right?
>>
>>59603343
there is no reason to use python in general
>>
>>59603343
Only reason you should use Python 2 is if you're dealing with legacy BS or someone mistakenly made a program in Python 2 and now you're forced to roll with it.
>>
>>59603343
Use 3.6, it got statically typed
>>
>>59603230
you will never make it manlet
>>
File: tiobe.png (47KB, 932x333px) Image search: [Google]
tiobe.png
47KB, 932x333px
>>59603362
nice

>>59603356
yeah, that was my thought. thanks
>>
>>59603117
>>59603187
lol fag
>>
>>59603348
this
>>
>C Sharp
>>
>>59603343
tfw university assignments still in python2
tfw 2/3 = 0
tfw [i for i in iter] overwrite the i outside of hte list comprehension
tfw map returns a list
tfw etc
>>
>>59603377
Reminder the TIOBE is extremely flawed and massively overrepresents C in particular, due to tons of false positives stemming from the fact that it often categorizes C#/C++ things as C.
>>
I've got an C# ORM I developed as a pet project that I always carry and use it around but now I'm thinking about security, what are some common issues I should be wary about?

It basically auto-generates queries based on a map (constructed by reflection) and uses like:

using (DbConnection connection = new ProviderConnection()) {
connection.Open();
DbCommand command = connection.CreateCommand();
command.CommandText = _myOrmMakesThis();
command.ExecuteReader(); //and such
}


Surely that injection is possible since the way it creates the query is by concatenating strings, but since it's dependant on the "map" of the object that's unlikely I think.
Thoughts?
>>
How do I get a job at DeepMind?
>>
>cs degree
>/fit/
>not a manlet
>diamond 1 in league of legends
>still a virgin
:^(
>>
>>59603469
Also, someone said "PROCs are better cause are more secure"
How true is that?
>>
>>59603482
>>league of legends
found your problem
>>
>>59603482
>lmao
>lmao
>lmao
>gaymes
>>>/r9k/

>>>/r9k/
>>>/pol/
>>>/b/
>>
>>59603508
>gender studies
>manlet
>brainlet
>silver
>>
>>59603469
>>59603492
My thoughts are that you should use an existing ORM like EF, or - at the very least - Dapper.

Stored procedures can be more secure to call directly because they ask for parameters and will simply break if you try to hand them raw SQL, assuming the input parameters aren't just an abstraction for more dynamic SQL queries.
>>
>>59603517
>PhD in math
>any job I want
>$300k starting
>>
I have tried my hand at programming but I am totally at a loss.
I have Mingw and MSYS.
I am trying to do something with it and I see that I apparently don't have something called ISL 0.16 or 15.
Fine, so I download the latest ISL. Configure it, make it.
Then what? It doesn't change anything. All of my mingw libraries still look the same, and the problem persists.
I then configured the ISL installation with a prefix which was supposed to dump the relevant files into my default libraries (apparently), but the msys shell didn't understand the command.

And this all stems from not having an uptodate GDB debugger that I've been trying to get because my GDB isn't working the way the one in the tutorial I'm following is.

What a fucking mess.
You have a problem, the fix doesn't work, the fix for the fix doesn't work, and so on.

Blah.

If anyone knows how you're supposed to download a package so that it actually has an effect on your existing setup, feel free to say.
Being a total novice I am sure I have inspired contempt in you.
>>
>>59603482
>dropout
>usually pass cs interviews by a landslide
>chubby
>global elite in cs:go
>regular tinder fucking
>>
File: 1420173773746.jpg (60KB, 500x312px) Image search: [Google]
1420173773746.jpg
60KB, 500x312px
Alright, /g/.
>>59603230
here.

Don't shit on my parade but I'm pretty proud of myself for fixing this.

while True:
print("How many cats do you have?")
numCats = input()
try:
if int(numCats) >= 4:
print('That is a lot of cats.')
break
elif int(numCats) in range(1, 3):
print('That is not that many cats.')
break
elif int(numCats) == 0:
print("Oh, you have no cats.")
break
elif int(numCats) < 0:
print("That is a negative number. How can you have a negative number of cats?")
continue
except ValueError:
print('You did not enter a number. Please enter a number.')
continue

>>
>>59603564
Just use linux
>>
>>59603540
Idk why people treat this as a meme, if you have a PhD in maths from Stanford you DO get any job you want: statistician, machine learning engineer/researcher, data science, quant, postdoc, etc. And if you want to go to a hedge fund, you do get $300k starting. I know fellow CS grads who went to hedge funds for $200k starting only with a master's degree
>>
>>59603590
I've been thinking of doing VirtualBox (whatever it's called) with a linux setup, but I've never touched linux before so I've wanted to avoid it, knowign that setting up Linux will probably be just as unworkable as what I am currently doing.
I might give it a go.
>>
>>59600576
>>59600346
>>
>>59603564
>>59603604
What are you actually trying to program?
>>
>>59603581
How many cats do you have?
j
Traceback (most recent call last):
File "f:/Programming/dpt/cats.py", line 31, in <module>
numCats = input()
File "<string>", line 1, in <module>
NameError: name 'j' is not defined

Nice try.

>while True
Don't do this. It's a bad habit to get into the "oh it's just practice" mentality, and you should always at least TRY to see your methods/functions/etc to the very end. Have a set condition.
>range(1,3)
Check the documentation (get into this habit too, no matter where you're gonna stop learning) or re-read the section where Al uses range() because the last argument for range is not inclusive. So for range(1,3), you're gonna get something like:
for x in range(1,3):
print x

1
2


Consider the following as your actual thought process:
# if numCats is an integer:
# if numCats is greater than some number
# print a message about a lot of cats
# else, if the number is between 1 and 2
# print a message about an average number of cats
# else, if the number is 0
# print a message about a lack of cats
# else:
# get input from the user again


Keep at it!
>>
File: 5968872.jpg (25KB, 300x300px) Image search: [Google]
5968872.jpg
25KB, 300x300px
>>59603706
Yeah, good point, i guess I should fix it
>>
>>59603581
No one gives a shit.

This is hello-world-tier babby code.

Use that excitement to get through more of the book and then come back when you've done something useful for yourself.
>>
>>59603733
aren't you a sourpuss
>>
>>59603612
>>>/g/wdg
>>
Is something up with github? My commits are going through, i'm authenticated properly ( i can see the history in github), but they're not counting towards the contributions section.
>>
>>59603794
>he doesn't know
>>
>>59603726
Thanks anon, i really appreciate it
>>
>>59603377
RIP C
>>
>>59603482
>>diamond 1 in league of legends
No wonder you are a virgin
>>
>>59603826
this lol rofl try being a millionaire instead then you might get somewhere
>>
File: The_C_Programming_Language_cover.png (107KB, 792x1023px) Image search: [Google]
The_C_Programming_Language_cover.png
107KB, 792x1023px
https://daniel.haxx.se/blog/2017/03/27/curl-is-c/
>Rust Evangelionism Strikeforce is harrassing the curl guy now
Does their hubris know no bounds?
Don't they understand that portable system software NEEDS to be written in C?
>>
>>59603847
or not having autism. how fucked up do you have to be not to get a girl with online dating booming
>>
>>59603726
Not him, but what Python are you using? If it's 2, you shouldn't be using input anyway.
How many cats do you have?
j
You did not enter a number. Please enter a number.
How many cats do you have?
>>
>>59603720
I was originally just trying to debug a really simply c program, some printf commands.
The GDB wouldn't step into the printf command in the same way as the guy's did in the tutorial I was watching. So I wanted to update it to a new version. Whilst updating GDB in the Msys shell noticed a message reading that an ISL 0.16 or 0.15 library or file (I forget which) couldn't be found. So I installed ISL 0.16, configured and made it, but the message still appeared; the ISL files couldn't be found. And then it struck me, what am I supposed to even do with the installled files? I have those ISL files now, but they were in their own separate directory, outside of the MinGW directory. As a last ditch resort I dumped the whole ISL directory into my default library, but that didn't work either.

The same problem must occur with the GDB download itself. I downloaded the latest GDB tar.xz file or whatever it was. Extracted it. Configured it, made it. And what is supposed to be different? I have that new GDB version now, but it's in a separate directory. All the old GDB version files are still there.
So I'm pretty much given up. I don't even know how to download and install the packages right. I'd have thought that the installed files would sort of, go into the subdirectories within the MinGW directory themselves, and overwrite the old files, but that ain't happening.

I came here to vent more than anything.
In short, my situation is having a barely-working Msys/Mingw setup, but trying to install packages on top of that is seemingly nto working.
MinGW seems to have stopped being updated yonks ago, anyway.
>>
>>59603852
>online dating
i went on a few free dating sites just to look and it was all trash at least where i live. the decent looking ones in other cities probably had an inflated self worth since they would get hundreds of messages
>>
>>59603851
>Don't they understand
No. If they understood anything they wouldn't be Rust evangelists.
>>
>>59601359
Leaning Go has stalled because I have some other shit (mainly thesis defense) to take care of.
>>
>>59603883
>move to a relevant city
>okcupid and tinder
>don't be a faggot with no imagination and no game
>get gf
>>
>>59603866
I've been jockeying between 2 and 3 at work, I probably forgot to change back.
>>
>>59603866
3
>>
>>59603881
Why are you using GDB/tar/ISL/MinGW/any of that for a simple C program?
>>
>>59601359
>codeacademy
Firstly, it's codecademy
Secondly, I thought only people with no programming experience use this kind of shit. Cant you skim a reference book and start writing a project
>>
>>59603851
>https://daniel.haxx.se/blog/2017/03/27/curl-is-c/
>Rewriting means adding heaps of bugs

>you shouldn't have written it in C but I'm not going to rewrite in Rust
well that was pointless, if rust was so good and easy reimplementing curl shouldn't be that hard...
>>
>>59603851
>portable system software NEEDS to be written in C?
Why? C is utter garbage
>>
>>59601359
>ruby
>2017
learn java or C++
>>
>>59603851
Just rewrite curl in Rust. Shouldn't be that hard.
In fact it'd be a nice academic task to rewrite *nix userland tools in Rust.
>>
>>59603956
>rewrite *nix userland tools in Rust
Or Go, or Java, or Prolog...
But an academic exercise is all it would be.
>>
>>59603956
Great I was looking for shit to do anyways. I'll get started straight away
>>
>>59603956
the source code looks pretty small. if you have genuine concerns just read through the source and maybe reimplement it in your favorite non-C language
>>
>>59603970
Not if you wanted to run it on a Lisp Machine. But you'd have to write a TCP/IP stack too...
>>
>>59603956
>In fact it'd be a nice academic task to
to contribute to redox os you meant?
>>
>>59603983
>>59603956
I'll do them in D. Some of them are a bit more complicated than it looks like.
>>
>>59604020
2bh I am still learning Rust and my skills aren't as high, so that's why I was looking for things to do
>>
Just like rewrite gcc in rust my lads
>>
>>59604090
GCC doesn't belong to the GNU coreutils. And it's not written in C either.
>>
>>59601075
That's exactly what you expect out of C you retard, all pre-increments are done before the statement is evaluated.

yourself.neck()
>>
>>59604136
Don't even bother arguing with Rust niggers anon.
>>
>>59601075
kek why is C so shit?
>>
>>59604136
C doesn't have lazy evaluations? What a memelang
>>
>>59601075
any real C/C++ programmer would know this and any real programmer wouldn't write such shitty code
>>
>>59604160
THREADLY REMINDER TO REWRITE EVERYTHING IN RUST

JUST DON'T EXPECT ME TO DO IT OK? I'M BUSY SHILLING RUST
>>
>>59604136
>yourself.neck()
>not using superior (neck yourself)
>>
File: 1486275222031.png (139KB, 228x260px) Image search: [Google]
1486275222031.png
139KB, 228x260px
>>59604184
1 1 1 GO!!
>>
>>59604199
Almost finished with $wc
>>
>>59603901
Just a tutorial introducing the GDB
>>
>>59600095
I actually don't pay much attention to OP's image in /dpt/ and I couldn't care less if it is a trap, 2D, 3DPD, or a serious programming image.
>>
>>59600095
99% is the same one or two faggots

1% is other people trolling
>>
>>59600065
How do you extend your hair?
>>
>>59604234
hair extensions
>>
>>59604234
Think real hard and grunt like you're pooping.
>>
>>59604184
You are just mad C is trash
>>
>>59604272
i don't even like C but you're clearly retarded and/or trolling
>>
>>59604284
Neither.
>>
>>59604311
lol you fucking suck if you think >>59601075 is reasonable code
>>
Alright losers, got an actual question
Working on application add-ins using .NET
I'm not terribly familiar with .NET but I'm getting there, hit a roadblock with one thing though.
I'd like to essentially add a new variable to a class for reasons, but making a child class of the class in question won't work because the only valid method to use said classes is to call a function that makes it based on some input data, which is hidden away in the main program's code.
What angle should I take to get extra data into the file?
>>
>>59604335
It's reasonable if you expect lazy evaluations like a normal human being. C(ancer) has plagued your kind so bad you expect everything to be utter garbage.

However I believe C# and Java could handle this code the right way.
>>
>>59604335
>lol you fucking suck
what do you mean?
>>
>>59604345
Add the variable to the class.
>>
>>59601075
Why does D give the wrong answer?
>>
>>59604160
That ain't Rust, C tard
>>
>>59604392
Because it has properly defined evaluation orders
>>
>>59604365
>>59604381
>>59604393
what the fuck is wrong with you

kill yourselves

4chan is such a shitty waste of time fuck all of you useless idiots
>>
>>59604365
>expect lazy evaluations like a normal human being.
No one expects that because it would be retarded.
>>
>>59604410
it doesn't even matter what you expect because you should never write code like that in the first place
>>
>>59604410
>because it would be retarded.
You just can't reason with a subhuman C tard, can you? No wonder it appeals to newbies so much
>>
>>59604406
If it was proper it would be 1, 1, 1.
>>
>>59604408
>that damage control
>>
>>59604427
>C fags this hard in denial
>>
>>59604427
Even if that was the case if you decide to use clang it'd print 3 2 1, re tard c tard
>>
>>59604395
That's exactly what the Rust Evangelism Strikeforce would say.
>>
>>59604427
No if it was proper it'd evaluate only when it was called
>>
>>59604436
>Brain dead C tard thinks anything that points out the shittyness of C is automatically Rust
>>
>>59604452
Only deluded Rust fans think there's anything wrong with C. Everyone else knows you can't blame the language for a programmer's mistake.
>>
>>59604450
Stop samefagging
>>
>>59604386
Can I override the actual class some way that would allow me to just make that addition without redefining everything?
>>
>>59604469
>There is nothing wrong with C
Say hello to my 76 undefined behaviors
>>
>>59604438
When it's evaluated isn't the issue.
>>
File: 1487822049152.png (231KB, 342x342px) Image search: [Google]
1487822049152.png
231KB, 342x342px
>>59604479
>>
>>59604478
Professionals who actually know the language do not invoke undefined behavior.
>>
>>59604495
>Professionals who actually know the language do not invoke undefined behavior.
Is that why there is a new crippling bug in the Linux kernel every week?
>>
>>59604474
To be honest, my post was kind of a shitpost, but more seriously, you could look into ExpandoObject. Dunno if you care about stuff happening at runtime though.
>>
>>59604490
When the evaluation has no order it is an issue
>>
>>59604503
Linux isn't made by professionals.
>>
>>59604479
>this hurts a c tard
>>
I honestly dont get people who vehemently defend a tool like their own kid.
Just move on to a better tool, C isnt an entity who will cry over you leaving it.
>>
>>59604510
Professionals use C++ instead
>>
File: Ritsuko_Akagi.jpg (28KB, 225x366px) Image search: [Google]
Ritsuko_Akagi.jpg
28KB, 225x366px
Don't feed attention to anti-C fags.
You probably have better things to do.
>>
>>59604506
Then what the fuck was your point?
Whether it's evaluated now or later doesn't help you one bit, it's still the actual order which matters.
>>
File: 1489530656576.jpg (49KB, 600x381px) Image search: [Google]
1489530656576.jpg
49KB, 600x381px
>>59604515
For a C toddler, moving to a better language is hard because of known reasons
>>
>>59604515
The entire industry suffers when someone writes software in a language that isn't C.
>>
>>59604525
Like watching cartoons
>>
>>59604515
>Just move on to a better tool,
Unfortunately there isn't one.
>>
>>59604533
>C used in the industry
Wrong
>>
>>59604526
>Whether it's evaluated now or later doesn't help you one bit,
Uh it helps me write
3 2 1 GO!
>>
>>59604504
I'll have to see, thanks though
>>
>>59604525
C tards go back to >>>/a/
>>
>>59604470
just realize that there is more than one person who thinks you're a worthless piece of shit
>>
>>59604566
You took quite a while to recover
>>
>>59604556
Or 1, 2, 3,
or 1, 1, 1
or any combination at all really.
>>
>>59601075
This is because C doesn't have lazy evaluations. C lacks a lot more things and C programmers have to deal with them while others make fun about it.
>>
>>59604575
Sorry, unspecified behavior is a C thing
>>
>>59604587
> C lacks a lot more things
Such as?
>>
>>59604590
You really don't get it, do you?
>>
>>59604597
Vectors
>>
>>59604610
I get it, I get it. You are grasping on the straws to defend an obvious flaw just because you are a c tard in denial
>>
File: 1479582816622.jpg (32KB, 480x480px) Image search: [Google]
1479582816622.jpg
32KB, 480x480px
>>59604611
C doesn't have vectors? How the fuck would you store arguments from variadic function arguments? Or multi return functions?
>>
>>59604627
>I get it, I get it.
Clearly you don't if you think when anything gets evaluated has anything to do with it.
What if it specifies right to left order, retard?
Or what if everything are mutable reference types and memory fetches are always done last, then 1, 1, 1 is always the answer regardless of operation order.
>>
File: 1476016365112.png (411KB, 500x503px) Image search: [Google]
1476016365112.png
411KB, 500x503px
>>59604656
>multi return function
>'c'
toppest of the keks
>>
>>59604664
>What if it specifies right to left order, retard?
The fucking standard does, idiot. What specifies a module to be read from top to bottom?
>>
>>59604656
>multi return functions?
No such thing.
A function is a mapping from one input to one output.
>>
File: 1481403342500.jpg (2MB, 2000x4000px) Image search: [Google]
1481403342500.jpg
2MB, 2000x4000px
>>59604679
>module
>'c'
Oh boy
>>
>>59604687
>It's another CS toddler thinking programming is maths episode
>>
>>59604679
>The fucking standard does, idiot
Now you're starting to understand.
>>
>>59600095
it's to encourage best practices
>>
>>59604706
>I got owned: the post
>>
>>59604669
>>59604656
What's so funny? It's easy, either

int foo( struct bar *b );


or

int foo( int *a, double *c );


As for variadic there's always va_list. You people should try actually writing a nontrivial C program before shitposting desu
>>
>>59604715
Are you mentally retarded?
>>
>>59604717
He asked for vectors, not (((structs))), re tard c tard
>>
59604728
No more you's for you
>>
>>59604717
What does this have anything to do with C not having modules
>>
>>59604721
All me
>>
File: 1480333122975.jpg (103KB, 964x964px) Image search: [Google]
1480333122975.jpg
103KB, 964x964px
>>59604721
>C programmer makes a program
Memory leaks
>C programmer makes a post
Spelling leaks
>>
Old thread
>>59600079
>>59600079
>>59600079
>>59600079
>>59600079
>>
>>59604803
>Old
nice safety you there rustfag
>>
File: 1489911125711.jpg (37KB, 546x432px) Image search: [Google]
1489911125711.jpg
37KB, 546x432px
>>59601075
Any good alternative to C?
>>
>>59604912
What kind of programs do you want to make?
>>
>>59604912
asm
>>
>>59604912
[spoiler] any of them [/spoiler]
>>
>>59603908
Maybe you're right.

This course isn't very challenging. I only have basic programming experience because it's not really necessary in my field (geology), but I've always wished I knew more.

When I was younger I thought I'd go into comp sci though. I wish these online courses existed back then.
>>
>>59603923
Why?

Actually the only reason I ever looked at Ruby was because a guy on a CS:S surf server recommended it to me when I was a kid.

Coming from a little knowledge with Python and VB it seems very easy.
>>
>>59603891
Ha. You don't happen to be a Geology post-grad do you?
A guy in my office is in exactly the same boat as you.
>>
>>59605622
even for web dev it's not very popular any more

along with python and VB it's literally one of the worst programming languages

with java you can make serious enterprise-grade applications and servers etc

with C++ you can make serious video games and servers etc
>>
>>59605661
Kill yourself
>>
>>59605661
I only want to learn it for fun/something to do. I'm not really familiar with Java or C++, but out of the two Java seems the most friendly.

I have some good (but not really get rich kind) of ideas for apps. Ultimately I'd like to make an app for smartphones useful in geological mapping as a side project/hobby. I thought learning the basics in one of these languages might make the learning curve a bit easier.

Cheers.
>>
>>59606188
java is great for android and it's beginner friendly so i would suggest to learn java
Thread posts: 346
Thread images: 57


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