[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: 311
Thread images: 37

old thread: >>56358765

What are you working on, /g/?
>>
haskell is bad and you should FEEL bad!
>>
Too early.
Delete this thread and kill yourself.
>>
File: 1423028790673.jpg (262KB, 750x852px) Image search: [Google]
1423028790673.jpg
262KB, 750x852px
Absolute newfaggot to programming here.

What's a fun first project for Python? I need something that can make me involved in learning the language. Reading manuals can be boring without doing something fun with the language every now and then.
>>
>>56365631
A TODO list that is persistent (saves the data in a .txt file).
>>
>>56365611
i just ignore him, i've told him to kill himself so many times, i think not acknowledging his existence is better
>>
File: bf1beta.png (3MB, 1752x938px) Image search: [Google]
bf1beta.png
3MB, 1752x938px
>What are you working on, /g/?

I wish I was working on something. There are just too many """fun""" distractions.
>>
File: akari beeemu.gif (2MB, 480x270px) Image search: [Google]
akari beeemu.gif
2MB, 480x270px
I added username and tripcode support to my messageboard written completely in C!

http://akaribbs.mooo.com/
>>
>>56365676
Unnecessary, but congratulations on getting it working.
>>
>>56365674

I can understand this sentiment, sadly.

>>56365652

And yet you still post in his thread.
>>
>>56365823

The worse part is that this diversion is going to require me to upgrade, because the game isn't running fast enough for my liking. I'm avoiding doing work, and it's ALSO going to cost me money.
>>
>>56365676
Trpfagging should be a crime.
>>
>>56365631
A little webcrawler project, anything involiving the internet or files is usually pretty entertaining.
>>
>>56365631
here is a program I made showcasing some fun things python can do, maybe it will inspire you
>>
>>56365608
>babby can't into functional programming
>>
>>56365584
why are there anime girls in the OP for these threads, i'm not complaining i just don't get it.
>>
>>56365950
>>56365631

forgot the link like a fag
http://pastebin.com/LqBwd0ag
Also before I forget. Do not use python for anything big like a game. Python is a great language for the internet and file handling but it is really slow when it comes to any actual computing. Move to C after python because it can do alot and teach you more about programming then python can
>>
So in one of my IS classes, the only 350 class is taught my some old ass dude that obviously needs to be replaced because it's apparent that he's slowly losing his mind.

Anyways, we have to learn Visual Basic. How fucked am I? I mean I have a pretty good fucking feeling I'll never use VB again and we'd be better off learning C#, Python, or Ruby.

Now, I guess I'll fuck off and go do my homework using this shit.
>>
>>56365676
posts resend when i reload.
>>
>>56366007
LOL. Why the fuck are they making you learn VB? I mean it's not completely useless since you can right scripts on any windows machine without downloading anything but damn. If you plan to get a job after school you better learn another language on your own, because if you apply to a job and the only language you know is VB then have fun
>>
>>56365875

Fortunately, my diversion is Minecraft.
Unfortunately, my diversion is Minecraft.

>>56366007

VB isn't a difficult language to learn, and if it's VB.NET, you might just learn a bit about the .NET runtime, so it won't be a complete waste of your time. Also, there are still a couple of companies out there hiring for it.

That said, it's just a terrible language in comparison to C#.
>>
File: 1472516292639.png (566KB, 1000x352px) Image search: [Google]
1472516292639.png
566KB, 1000x352px
>>
>>56366046
>Fortunately, my diversion is Minecraft.
>Unfortunately, my diversion is Minecraft.

That can be costly, too, if you want to use all those fancy shaders, hi-res texture packs, and various other mods.
>>
>>56366046
>That said, it's a terrible language in comparison to C#.
It isn't a language compared to C#. It's like comparing bash to C++
>>
>>56366007
company I interned at used VB, everyone there hated it, kek
good luck boyo
>>
>>56366040
Like I said, the only dude that teaches that is some senile old guy who speaks super slowly. I mean, in another class we learn Java and C# but that's an elective class, this is a required class. I'm not sure why they don't hire someone that knows what the fuck they're doing and has us learn C# or Python.

>>56366046
Yeah I know it's not difficult, plus I already know some Python, JavaScript, and Ruby so it shouldn't be too hard to pick up on it too.
>>
>>56365983
>girl
>>
Started writing a nanopass backend for my compiler. I have a shit ton of work ahead of me though, didn't realize how much work it would be to handle patterns in let bindings.
>>
>>56365975
>smug idiot thinks he's special for using a hipster language/paradigm
>>
>>56366035
Are you reloading as soon as it says "Post submitted!"?

Because I have a cooldown that should prevent that, it's 30 seconds.
>>
>>56365983
this particular """""""""girl"""""""" is a shitty forced meme
>>
>>56366151
>admitting can't program
Awww
>>
>>56365584
I'm working on artificial intelligence to determine whether a picture is anime and change it to something else

Fuck weeaboos. They're fucking degenerates
>>
>>56366161
When I reload the page it asks me to resend data to the page.
>>
>>56365631
Make a program that takes .dat files as a list of data points and plot them.
After you're done sent the program to me.
>>
>>56366273
Are you on firefox?
>>
There's a guy in the last thread who claims to have a degree and yet he's unable to do simple input validation.
>>
How do I convert an ASCII number back into a char that I can use to add onto another int?
>>
>>56366329
It's in C btw
>>
>>56366246
stay delusional
>>
>>56366329
An ascii number IS a char.
>>
>>56366239
how about no
>>
>>56366362
Ok, I have a user input a number and I read this number using getchar();, I am given 49, I want the number this ASCII code represents. Which is '1', and I want to add it to an Integer.
>>
>>56366400
Tell me anon, what's the ASCII value of "0"?
>>
>>56366432
48?
>>
>>56366460
Ok.
And what do you get when you subtract 48 from 49?
>>
File: 1472451888958.jpg (75KB, 1280x720px) Image search: [Google]
1472451888958.jpg
75KB, 1280x720px
>>56365984
You've gone above and beyond. Thanks!
>>
>>56366476
Oh.
>>
>>56366476
Thanks
>>
>>56366294
Yes.
>>
File: 1472595808037.png (2MB, 1920x1080px) Image search: [Google]
1472595808037.png
2MB, 1920x1080px
>>56366482
>>56365984

Wait you sumbitch I just read that code. Add a fuck you to that thank you but thanks for the laugh.
>>
>>56366511
>>56366488
Come back next week when you have trouble adding numbers with more than 1 digit.
>>
File: 1456645965809.jpg (20KB, 540x414px) Image search: [Google]
1456645965809.jpg
20KB, 540x414px
for c++, why is it that I get duplicated output when I declare strings outside of nested for loops that prints characters at specific parts of the array?

But then, I don't get duplicated output when I remove the declaration before the loop to later declare them within the first loop? What the fuck am I missing like a dumbass here?

example of what I mean, with the commented section being the portion that produces duplicated outputs if I initialize them there and not in the loop. No, I don't declare or initialize them twice and this is the case with or without proper type initialization, ie string s="";.
int count;
//string input;
//string even,odd;
cin >> count;

for (int k = 0; k < count; ++k)
{
string input="";
string even, odd="";
cin >> input;

for (size_t i = 0; i <= input.length() - 1; ++i)
{
if (i % 2 == 0)
{
even += input[i];
}
//if (i & 1)
else
{
odd += input[i];
}
}
cout << even << " " << odd << endl;
}
>>
>>56366482
Post more yuru yuris
>>
>>56366400
>>56366432
>>56366460
>>56366476
>>56366488
lol
>>
>>56366521
Get a better browser.
>>
>>56366544
>he fell for the sjw meme
>>
>>56366544
There is no such thing.
>>
>>56365984
>#Deletes all files
>#Downloads random pics, puts ten randomly on desktop
>#moves the mose and holds it down
>>
golang is comfy as fuck.
>>
>>56366556
>>56366561
All my error reports are coming from mozilla firefox users.
It's clear that firefox is shit.
>>
>>56366570
>#
>>
To the anon telling me that all I had to do was to have the event listener subscribe to the event, bypassing the need for an instance/reference of the class that fires the event itself:
I got back home and attempted what you said, and it seems like I'm regrettably correct. As far as I can tell, there is no way in C# to have something listen for global events. It just isn't possible. So what am I looking for, then?
>>
>>56366062

Eh, my computer handles fine with a hi-res texture pack and no graphics card. The main thing that kills me is server lag.

>>56366070

VB.NET and C# are both compiled languages that target .NET CIL. They can be compared.

>>56366137

What language are you compiling for?
>>
>>56366597
Sounds more like a shit site design.
>>
>>56366768
I literally cannot get my browser to resend the same post twice because the cooldown stops you.
I can't recreate your bug.
What are you doing?
>>
>>56365984
Decent advice. Civ4 used python a lot and when heavily modded it takes ages to load - not to mention the time it takes to end turns mid-to-late game.
>>
if you don't know what this does without looking it up you need more practice learning regex

^\t{0,9}[0-9A-Za-z]{1,9}[\.)][ ]
>>
>>56366837
>i.e "please explain this regex for me"
>>
>>56366800
I'm not the guy who initially reported the bug, but I do see the same behavior.

1. send post
2. wait 30 seconds
3. press F5
4. resend exact post
>>
>>56365631
Make pong, and if you want to hard core try making space invaders. It's not hard once you understand pixels and lists.

I recommend using processing library from the processing website. Also use their IDE. It's free and cool.
>>
>>56366538

Learn what scope is.

And the fact is that you aren't clearing the string variables after the input.length() for loop.
>>
I hope some of you are skilled in C. May need some help this term.
>>
>>56366909
Sure. How much are you paying us?
>>
>>56366007
Honestly focus on the class. But look into Python in your free time. I have experience with it, and can say it's pretty easy to pick up and has a lot of potential.
>>
File: 1471791589912.jpg (125KB, 1920x1080px) Image search: [Google]
1471791589912.jpg
125KB, 1920x1080px
>>56366858
if it's too hard for you I can write an easier one

>>56366927
yep, so is R and Java
I would maybe start with python though it's probably the easiest language to pick up
>>
>>56366925
Nothing. Some of you guys do this as a hobby, right? I'm sure they are simple exercises. I'm just retarded.
>>
>>56366964
Yeah dud internet strangers are going to do grunt work for you with no compensation. Real logical lmao
>>
>>56366961
>if it's too hard for you I can write an easier one
I know what is is. It's actually poorly written.
It seems like that you want someone to tell you what it's doing, and are just posing it as a question to try and save face.
>>
>>56366757
my own :3
>>
>>56366057
Where is this from?
>>
>>56366862
Try it now.
>>
>>56366750
I always forgot the real uses for events since I rarely implement them, I think of events just as "collections of function pointers": But WPF uses a concept called "routed events", which are events being propagated in a tree of classes. Don't know if that may help you or if you can use them in plain C#.
>>
>>56366909
I'm not doing shit without compensation.
You'd be paying us a proper programmer's hourly rate.
>>
>>56366989
how would you improve it then?

It's for numbered and lettered lists obviously
>>
>>56366964
> I'm sure they are simple exercises
Then do them yourself or learn how to
What's the point in taking a class if you aren't going to learn
>>
>>56366975
To some of you, it's not even work, right? The exercises will be coming from that C Primer book you guys mock.
>>
>>56367027
I'm incapable of learning. I'm just trying to ride this life out.
>>
>>56367032
>it's not even work, right?
What makes you think we want to do homework-tier shit?
I bet it's CRUD homework too.
>>
>>56367050
You're typing (something you learned) into a computer (something you learned) in english (something you learned). More specifically, the written form of english (something you learned). Additionally, you're reading (something you learned) and you apparently somehow made it to college which would require you learning lots of other things, and then getting high grades
>>
File: Untitled.jpg (21KB, 600x125px) Image search: [Google]
Untitled.jpg
21KB, 600x125px
>>56366997
Doesn't look like anything has changed.
>>
File: nice.gif (1020KB, 257x194px) Image search: [Google]
nice.gif
1020KB, 257x194px
>>56366879
Thanks for your helpful answer and for not being harsh.
>>
Replied to the wrong post before.

>>56367016
>{0,9}
{.9}
>[0-9A-Za-z]
Using a character class of some sort would be better.
I don't know exactly which kind of regex you're using is, but it'll be something like \w or [:alnum:].
>[\.)]
dots do not need to be escaped here.
[.)]
>[ ]
Just have a space.
>>
>>56367134
Ok, try it again.
>>
>>56367166
Nope
>>
does anyone have c primer plus in pdf?
>>
>>56367238
>can't into google
Never gonna make it brah
>>
>>56367263
I always come here first
>>
>>56367238
gotta learn your google-fu, anon.
https://www.google.com/search?q="c+primer+plus"+filetype%3Apdf
>>
>>56367238
I bought it because I'm sure it will be essential to my class and maybe future. Thing is twice as thick as bibles.
>>
>>56367154
all valid points, except for the .9 which doesn't work far as I can tell on any system
>>
>>56366757
>no graphics card

You poor poor man. You could use a GFX card for compute, too, so it's not like it's only got a single use.
>>
>>56367339

Meh. Skylake graphics do decently for my needs.
>>
>>56366528
Lol, np.
>>56366570
Why the long face?
>>
>>56366964
Fuck you, pay me.
>>
File: 1416377911696.png (350KB, 432x423px) Image search: [Google]
1416377911696.png
350KB, 432x423px
I think I finally figured out a good method for this menu that will allow me to quickly and easily add/remove button scripts with no duplication of code and no unnecessary singletons in a way that doesn't break encapsulation.

I have copy of a class on each button that detects clicks, and then requests a delegate from the second class. It then passes this delegate back to the controller, which executes the function.
>>
How should one learn the source code of an entire system? I want to play around with some open source software but I get out off by the size of the project. A specific example being the Linux kernel. Where does one even begin learning the core structure of Linux and all its millions of lines of code? Does one find main and follow execution control from there down or start at the functions which are the leaves of the programming and work up?
>>
>>56367367

I'm moving up to Skylake with my rebuild. I wish I didn't have to support the Intel Jew, but AMD doesn't have anything quite fast enough.
>>
The web is shit. It sucks. It wasn't designed, it just came to be as hacks on top of hacks and 'it just works' solutions. Let's say you can scrap everything and redesign the web from scratch. No more HTML, CSS, JavaScript, the DOM, anything. You can even scrap browsers if you want.

If you could design this system today, how would you, anon, get web content delivered and displayed on computers/phones/televisions/wherever the fuck you feel like? Why is your solution better than the shit we have now?
>>
>>56367638

Gopher, and that's it.
>>
>>56367529
>Where does one even begin learning the core structure of Linux and all its millions of lines of code?
Line 1.
>>
>>56367683
Of which source file?
>>
>>56367560
AMD is shit and they may not be jews but they aren't exactly saints either

>>56367800
>>
Im learning binary. I'm doing binary additions, some use negatives too so I use twos compliment for that. What is overflow? I'm getting 2 different answers depending on who I ask.

1) Is it any extra bit leftover that is cutoff to stay in the same bits
Example: 6-bit

-4 + 19 (=15)

111100
+ 010011
=1 001111 = 001111 = 15, good but we threw out that 1 to get it in 6-bits



2) or when the binary addition isn't correctly representing the addition?
Example: 6-bit

27 + 31 (=58)

11111
+011011
=111010

111010 = -6, not 58


I might be saying something wrong but hopefully you get the general idea.
>>
>>56368020
messed up my second example but you get the idea i hope. copied wrong binary
>>
>>56368020
>>56368020
They're both overflow, just different kinds. 1 is unsigned overflow, 2 is signed overflow.
In both cases, you've gone over the maximum value of the binary number.
>>
pls gib good resources to teach myself shit

I will do it

no memes
>>
>>56368060
Thanks, clears somethings
>>
File: 8Chan prog CS Books Sticky.png (489KB, 1903x1620px) Image search: [Google]
8Chan prog CS Books Sticky.png
489KB, 1903x1620px
>>56368081
what are you even trying to learn?

https://g.sicp.me/books/
http://gen.lib.rus.ec/
>>
what's the best programming language to learn with first, C++, C, python, Java, Perl, Lua, or >>>>>>>>>>>>>>>>>>>>>>html+css
>>
>>56368169
C
>>
>>56368178
what's the best way to learn it? learn C the hard way?
>>
>>56368167
I'm mostly looking for the new libgen to study sysadmin and networking


Your links help, thank you
>>
>>56368187
skim k&r then write/study real code
>>
>>56368202
solid, glad I was helpful
>>
>>56368203
i suck at namespaces scopes and conditional statements. do i have a shot at getting good?
>>
>>56368187
>learn C the hard way?
That book is absolute garbage. Don't read it.
It's filled with things that are factually wrong, and he doesn't explain anything that he does. It's pretty much "copy this code: the book".

I haven't really read books for beginners using C, so I don't really know the quality of most of them.
I've heard good things about "21st Century C" and "C primer plus".
>>
>>56368230
Programming in C by Kochan is pretty good from a beginner standpoint, it doesn't baby you too much, but you start from nothing.
>>
As a freelancer who has just written a pretty cool piece of software, how do I
A.) find enterprise customers?
B.) convince them to pay for my software?
>>
File: 1458153863729-0.png (283KB, 480x451px) Image search: [Google]
1458153863729-0.png
283KB, 480x451px
What the fuck is this /g/? Instructions for C programming course on my school.

>During the course the Visual Studio 2015 is to be used as the software development environment.
>All assignments must be developed by means of this tool.
>Solutions developed with other environments will not be accepted.
>>
>>56368435

Ask a business major.
>>
moved my chaos map program into the 3rd dimension
>>
>>56368486
They won't be able to tell if you're only turning in source code
>>
>>56365676
And you got a domain. Not some sketchy ass ip. What hardware does it run on?
>>
> The most powerful programming language is Lisp. If you don't know Lisp (or its variant, Scheme), you don't know what it means for a programming language to be powerful and elegant. Once you learn Lisp, you will see what is lacking in most other languages.

>Unlike most languages today, which are focused on defining specialized data types, Lisp provides a few data types which are general. Instead of defining specific types, you build structures from these types. Thus, rather than offering a way to define a list-of-this type and a list-of-that type, Lisp has one type of lists which can hold any sort of data.

>Where other languages allow you to define a function to search a list-of-this, and sometimes a way to define a generic list-search function that you can instantiate for list-of-this, Lisp makes it easy to write a function that will search any list — and provides a range of such functions.

>In addition, functions and expressions in Lisp are represented as data in a way that makes it easy to operate on them.

>When you start a Lisp system, it enters a read-eval-print loop. Most other languages have nothing comparable to `read', nothing comparable to `eval', and nothing comparable to `print'. What gaping deficiencies!

prove him wrong
>>
>>56368498

What if they require the project file? That will be something.
>>
File: smug25.jpg (177KB, 881x675px) Image search: [Google]
smug25.jpg
177KB, 881x675px
>>56368496
Give the values of sigma, r and s you used to produce that map.
>>
>>56368532
((((((((((((((((((((())))))))))))))))))))
>Me - 1
>Lisp - 0
>>
>>56368020
notice that when you add to the -6 so it becomes positive, it's like any binary addition, but it's an "overflow" in terms of the bit representation

notice that unsigned integers are modulo 2^n-1, so for example 16 + 58 mod 63 = 16 - 6 = 10

the modulo 2^n-1 is because the extra bits simply get chopped off
>>
>>56368532

He's right.
>>
>>56368532
That is the dumbest thing I have ever heard
>>
>>56368566
so two's complement is really great because a lot of the math in the hardware works the same as unsigned
>>
>>56368532
>>Unlike most languages today, which are focused on defining specialized data types, Lisp provides a few data types which are general. Instead of defining specific types, you build structures from these types. Thus, rather than offering a way to define a list-of-this type and a list-of-that type, Lisp has one type of lists which can hold any sort of data.
Underrated. Just look at hasklel. They had to invent an extra-autistic branch of mathematics just to get around the problem of having not abstracted types away
>>
>>56368486
I'm really glad my TA for the class we did C in was a freetard

Actually most of the professors for CS are unix people.
>>
>>56368486

Sounds like your professor's a retard.

>>56368498

Unless they're expecting a .sln file or whatever...

That said, I have been able to convince professors who insisted on other development environments to let shit past. I had one professor who wanted everyone to use eclipse so it would work with his build scripts. I asked if it'd work if I was just turning in .java files, since I'd rather not waste my time installing an IDE I'd only use for one class. He was fine with it.

Honestly, it's worth asking your professors their reason for needing that specific IDE. It might be that they just want you to use C89, which is the only version of C that Visual Studio (what they are using) can build.
>>
>>56368585
you also might want to take a look at stauration and overflow logic of mmx
>>
>>56368557
I could generate them with CMake but it is still bullshit
>>
postan a few of these for those who like chaos theory
>>
>>56368617
Why not just use the IDE?
It will only stop you using a few C features
>>
>>
>>56368637
why are they flat
>>
>>56368647
3dpd
>>
>>56368637
They're pretty, but I don't really understand what they are
>>
>>56368566
mod 2^n and mod 64 i mean
>>
>>56368637
>>56368619
Breddy fast raytracing you got there.
>>
>>56368647
Dunno, they are like bent pieces of paper, flat but not on a plane.

>>56368664
It's one possible 3-dimensional quadratic map.

the equation is simply:
xn = c[0] + c[1]*x + c[2]*x*x + c[3]*x*y + c[4]*y + c[5]*y*y + c[6]*z + c[7]*z*x + c[8]*z*y + c[9]*z*z;
yn = c[10] + c[11]*x + c[12]*x*x + c[13]*x*y + c[14]*y + c[15]*y*y + c[16]*z + c[17]*z*x + c[18]*z*y + c[19]*z*z;
zn = c[20] + c[21]*x + c[22]*x*x + c[23]*x*y + c[24]*y + c[25]*y*y + c[26]*z + c[27]*z*x + c[28]*z*y + c[29]*z*z;


It maps every point on 3d space to another point, you throw in some points and see where they go to produce the graphic.

The webms actually lists all of the coefficients c0 to c29.

See more here:
http://sprott.physics.wisc.edu/fractals/booktext/sabook.htm

I'm actually trying to figure out some of the BASIC code in there... I have no idea how to read BASIC.
>>
>>56368435
>>56368492
checkout >>>/biz/ maybe?
>>56368532
ha xd funney fat man likes lisp lol
>>56368576
ikr?
>>56368637
reminds me of the PS3 wallpapers
>>
>>56368710
0/10 post come on bro we're better than this
>>
>>56368528
Well, right now it's running on a dual core VPS with 1GB of ram and 1GB swap.

load average: 0.00, 0.01, 0.05
>>
>>56368559

Not.

>>56368576

An.

>>56368710

Argument.

t. Stefan
>>
>>56368891
C# isn't a lisp though
>>
I always just used -O3 when compiling with gcc. Should I bother messing with the other optimization flags? I read the descriptions and frankly I still don't even understand what half of them do or the implications of turning them on.
>>
>>56369053
I just used -o, -Wall, and -std=c99
>>
>>56369053
do you really need that extra ~5ms for performance?
>>
>they haven't unlocked -o7
>>
>>56369108
I'm a lousy programmer currently writing a brute-force-reliant AI.
>>
>>56365584
How should I go if I want to log in http://www.pixiv.net/ then retrieve the cookie or whatever to start scrapping the web itself? I just wanna download some images but doing it without login allow me to only check the first 10 pages for the given search. Any pointers for doing this are welcome. (Using C#).
>>56369108
Not him but setting an optimization flag helps to detect some obscure errors (like for example, doing silly things with the string pool IIRC).

Going to sleep now senpaitachi, will check the thread tomorrow. Gnight.
>>
>>56369143
you could try -ffast-math if you dont need too accurate results from floats
>>
>>56369143
-march=native
-funroll-loops
>>
Just a shout out to OP:

Thanks. I just watched Himegoto. Am drunk. Had some good laughs. Been on a trap thing lately. Good times.
>>
>>56369053
-O3 enables vectorization, which can bring big speed improvements
>>
I know some very basic python (failed a cs intro course)

How much programming should I have under my belt if I want to work on freelance projects that pay a few bucks above minimum wage?
>>
>>56369290
At least a year unless you want to be pajeet-tier and get yelled at for giving your clients shitty code.
>>
>>56369290
how is it possible to fail a cs intro course?

We didn't even learn arrays until the class was mostly over
>>
>>56369303
Any good learning materials? Python, Ruby and Java (out of necessity) are the 3 I want to get gud at. I'll have at least 10-15 hours free each week to study
>>
>>56369322
Im just a lazy awful student that never bothered to fully study the concepts. Shit like grabbing data from a web file and producing a new data table and new dictionaries was advanced tier for me
>>
>>56369303
>implying anyone bothers to look at working code
I feel like knowing how to use unit tests is more important for pajeet-tier employees. Since no-one really cares what you do if your shit works.
Or how else are all these DailyWTF articles made possible?
>>
File: Araragi Tsukihi 01.gif (777KB, 245x138px) Image search: [Google]
Araragi Tsukihi 01.gif
777KB, 245x138px
>>56369394
That's definitely a step in the right direction. When I said "shitty code", I meant more like "only kind of works". Clients would be platinum mad if the code they paid for crashes a lot or ruins a database.
>>
>>56368532
>a list of general things
data List a = Nil | Cons a (List a)


>generic list search
elem i listOfAnyType


>functions and expression
one can partially aply functions in haskell
and be given as inputs to other functions
you can compose functions too

welp, looks like haskell is better than lisp
inb4 datafag starts shitposting
>>
I reckon I jerk off once for about every hundred lines of code I write

How about you guys?
>>
>>56369053

Not really unless you really need more speed and it takes a lot of profiling and testing to really come out ahead.

In general, what is included in -O3 is generally already pretty good. What isn't included that you might want to consider is LTO and its related flags and GRAPHITE and its related flags with loop transforms and optimizations.

What I use after a ton of testing is the following.

//General flags and warnings
-fdiagnostics-color -fno-stack-protector -march=native -pedantic -pedantic-errors -pipe -Wall -Wc++-compat -Wbool-compare -Wcast-align -Wcast-qual -Wconversion -Wdisabled-optimization -Wduplicated-cond -Wextra -Wformat=2 -Winit-self -Wlogical-not-parentheses -Wlogical-op -Wmissing-prototypes -Wmissing-include-dirs -Wmultichar -Wnested-externs -Wnull-dereference -Wpadded -Wpointer-arith -Wredundant-decls -Wsizeof-array-argument -Wshadow -Wshift-negative-value -Wshift-overflow=2 -Wstrict-aliasing -Wstrict-overflow=5 -Wstrict-prototypes -Wswitch-bool -Wswitch-default -Wswitch-enum -Wundef -Wwrite-strings
//Optimization flags
-fgraphite-identity -fisolate-erroneous-paths-attribute -fivopts -fgcse-sm -fgcse-las -flive-range-shrinkage -flto=8 -fmodulo-sched -fmodulo-sched-allow-regmoves -fno-common -fno-ident -fno-asynchronous-unwind-tables -fomit-frame-pointer -frename-registers -freschedule-modulo-scheduled-loops -fsched-pressure -fsched-spec-load -fsched-stalled-insns=0 -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops -fselective-scheduling -fselective-scheduling2 -ftree-loop-distribution -ftree-loop-linear -ftree-vectorize -funsafe-loop-optimizations -fuse-linker-plugin -fvisibility=hidden -Ofast -s


I've seen some crazy flag names in GCC. Favorite one was -floop-unroll-and-jam before they rolled that into -floop-nest-optimize.
>>
File: 1457655572933.jpg (72KB, 680x598px) Image search: [Google]
1457655572933.jpg
72KB, 680x598px
>>56369981
>the power of C
>>
>>56370008

The GCC C++ flags I have aren't much better.
>>
File: ggggg.jpg (164KB, 2000x1000px) Image search: [Google]
ggggg.jpg
164KB, 2000x1000px
Hello, lads! I've been away from this general and programming for awhile, I've been having fun with Brexit.

Anyways, I've thought of something pretty comfy I want to do and I need a script, so I thought I'd come shitpost here again while I work on it.
>>
>>56370348
How do I unsubscribe from your blog?
>>
>>56370363
You can't, lad.

And I see OP is still using a trap image, smdh.
>>
>>56370377
at least there is mcdonalds posting (see previous thread)
>>
I'm writing an application that logs incoming udp traffic. Router sends logs as udp, one line is one packet. particular event isn't bigger than 10 lines or so. How should I handle writing this to disk? Should I simply open log file when application starts and close it when application closes, or open it before outputting messages and close it immediately after?
I want it to run 24/7 on a rpi, so sudden power loss might occur one day.
>>
>>56370430
>Should I simply open log file when application starts and close it when application closes
sounds fine

>I want it to run 24/7 on a rpi, so sudden power loss might occur one day.
Make sure the file system is pretty robust against power outages. Also, use a battery back up.
>>
>>56365584

>>56366166
>>56366121
NAME PLEASE
>>
how do I become Mr Robot
>>
>A full compile o f UE4 engine takes 90 minutes.
So this is the power of Unreal
>>
>>56370487
Take drugs
>>
>>56370544
Wow, that's unreal. Are they using -O4 or something?
>>
File: 1472031750386.png (789KB, 640x1136px) Image search: [Google]
1472031750386.png
789KB, 640x1136px
How do i into mindset of programmer? Like when i need to do something, how to determine what is the best approach (best methods, what loops to use etc)

Are there any flowcharts or something like that?
>>
>>56370620
practice
>>
File: dsa.png (167KB, 636x426px) Image search: [Google]
dsa.png
167KB, 636x426px
just installed node and it's pretty comfy

don't understand the hate it gets
>>
>>56370667
>frogposter
>webshit

Colour me unsurprised
>>
>>56366007
This is why coding bootcamps are going to burst the higher education meme bubble.

They literally ask companies, "What skills do you want new employees to have? Okay, we'll teach those."
>>
>>56370666
Fuck. Really?
>>
>>56370453
On the other hand calling fclose after every write would mean that buffer gets written to disk. Now I see that new messages are coming, but disk size of that file hasn't changed.
>>
i'm taking a data structures and algorithms class this semester and im terrible at math, how fucked am i?
>>
>>56370816
not very
>>
>>56370749
that's true
>>
>>56370816
I failed university calculus 2 times and got a D (second lowest passing grade in my country) on the third attempt, and I completely suck at maths. Still managed to get an A on data structures and algorithms because I found it a lot more interesting and tangible balance a tree than solving differential equations.
>>
Help I'm retarded. I use a text editor and g++ to program on my linux machine but I have no idea what I should use when I'm on my windows machine.

I found mingw and notepad++ but I'm still wondering what I should use.
>>
File: 1470670375085.jpg (54KB, 650x427px) Image search: [Google]
1470670375085.jpg
54KB, 650x427px
I've got a standalone Java app and want to have a login screen for users.

The username/pass will be stored in a mysql server and that's all it will be interacting with - how should I go about doing this?

The JDBC driver seems my best bet. Some people recommend Spring, but this seems to involve setting up a java server between mysql and the app. Is this the "right" way to do it?

Any help appreciated
>>
>>56365584
I'm trying to define a custom Variant type on C++.
I have some problem trying to figure out how to do castings and perform operations like:

WhimsyVariant v = 5;
v = v + 3;


I have copied some ideas from QVariant, but yet I cannot figure out how to do so in a simpler way than defining casting operators one by one.

Is there a better way? I don't care C++11.
>>
>>56370898
I use Qt Creator for that, because it gives you hints.
If you want to share your code, you might want to create a CMake file for that. Qt Creator will recognize all the files you'll include in that file and work normally; and it doesn't generate too many useless files that way.
>>
>>56370929
Sorry, I haven't posted the source to date.
Here: https://github.com/VirusRushTheater/WhimsyDataStructs
>>
>>56367638
9P
>>
>>56370739
yes you will start to become less retarded over time as you get more practice, your brain literally changes to become less retarded at programming
>>
>>56367638
The issue is that technology evolved way too quickly to design a solution from scratch, and web isn't the same as 10 years before because, mainly, that bandwidth limitations aren't as such.

At least be thankful content isn't limited for "Internet Explorer only" anymore.
>>
File: node.jpg (18KB, 539x360px) Image search: [Google]
node.jpg
18KB, 539x360px
>>56370667
>>
>>56370961
Well I actually just decided to install gvim for now on Windows. But I'll check out qt creator.

I'm trying to learn to code without a IDE so I learn better. The first time I tried learning to program I was using visual studio and c# but intellisense and visual studio gave me very bad habits for not remembering shit and taking shortcuts.
>>
>>56371028
so that's why they call it node JS
>>
>>56365584
who's this trap
>>
>>56365631
Make malware that masquerades as sendpkm.py and destroys pokemon carts
>>
>>56370898

MinGW-w64 as your compiler toolchain.
Any text editor you feel comfortable with.
>>
File: Capture.jpg (38KB, 673x359px) Image search: [Google]
Capture.jpg
38KB, 673x359px
>>56371028
>>56371039
>>
>>56370907

Bumping for halp
>>
>>56371022
>>
>>56371059
Ah alright, tyvm I found everything now, thank you.
>>
>>56371065

I don't know, but you'd better be storing a hashed password, as opposed to 'password'.
>>
Just got in the office and a co-worker left some energy drinks for me at my desk with a nice little note.

I'm all warm and fuzzy now.

>>56371065
Anon, it's early morning in burgerland, and this thread is generally slow anyway.

This isn't /b/; you don't need to bump your own post after 17 minutes.

As to your question, it depends on a few things, but generally speaking, you don't expose a database directly to the outside world. You have a server application that handles those requests as a middle man, among other things that shouldn't be done by the client part of the application.
>>
File: ARM software blows.png (10KB, 502x94px) Image search: [Google]
ARM software blows.png
10KB, 502x94px
>>
>>56371020
But is there no easier way? Like there should.be some kind of flowchart most programmers would follow.for.certain language to achieve certain things. Like if i need to do x, doing z is the fastest way to achieve it and so on.
>>
File: 1461582619044.jpg (132KB, 767x581px) Image search: [Google]
1461582619044.jpg
132KB, 767x581px
>>56371033
It's a nice approach, and for that, you should try to learn Makefile or CMake to automate compiling and debugging, because if you do it manually and you've got more than 3 source code files, it becomes a pain in the ass.
Plus, you need a debugger. GDB is a thing but with no graphical interface is a pain in the ass too. Qt Creator has nice alternatives to debug using Qt and its graphical interface.

>>56370620
First thing's first: Whenever you want to solve a problem you need to figure out how to store the data you'll use and that's the most difficult thing to figure out when programming: What are you going to do and which data are you going to use.
For example, if you want to process sound, think it'll be an array of about 44 thousand numbers per second, symbolizing the position your speaker will be. If you want text, an array of a number per letter, and so on.
>>
>>56371109
read some books and/or watch videos
>>
>>56371095
>Just got in the office and a co-worker left some energy drinks for me at my desk with a nice little note.

My literal dream is to get a job working at a video game studio where I can pull all-nighter-crunch marathons with my programming senpai while I bring in tons of different coffee cups from my anime coffee mug collection. I want to be one of those guys thats been with a game studio for 35+ years making role playing games. Like Bethesda, or Obsidian Entertainment.

I don't give a fuck about having a family, or free time, or anything. I just want to make good games. I'm already working hard at it, one of these days I'll have a dev-family.
>>
>>56371109
Pretend you're a carpenter in training.

You walk into the workshop and there is wood and a myriad of tools.

You might decide to cut a piece of wood. There's probably 17 tools that could do it, including repeatedly hammering the end of a chisel into the wood until it breaks, but you're going to have to either find the saw and test it, or have someone tell you to use the saw.

Multiply the potential things you could do to the wood by 100,000, and the number of tools by 1,000,000.

90% of programming is taking each individual task, finding a way to do it, and then combining that finished task with the other 200 tasks. Eventually, you'll remember how to do certain common tasks.
>>
>>56371127
Any recommendations for C#?
>>
>>56371144
This makes sense. I guess practice is the only answer
>>
>>56371142
>falling for the game dev meme
lul
>>
>>56371151
Yellow Book (free PDF on page):
http://www.robmiles.com/c-yellow-book/

The best way to learn C# after you get the basics is to actually use it.

Set out with simple utilities, like a program that finds the largest files and folders on your computer so you can clean up disk hogs. This is a great exercise, because you'll need to eventually consider multithreading for performance, and there's plenty of basic I/O and UI possibilities.
>>
>>56371183
>writing software you don't care about because it has better working conditions and pays more.

Enjoy wasting your life writing software for nameless jewlords so they can manage their shipping containers or whatever the fuck you do.
>>
>>56371142
Post pics of coffee mug collection.

I feel like your dream is going to collapse when you really get out there and see what people are like, but in any case, I hope that works out for you.

I can't share your sentiment on all-nighters, though.

The joy of having a programming job means a relaxed office environment with nice perks. I can work from home whenever, and I'm free to basically develop whatever I want as long as I can sell the idea to stakeholders.

>>56371218
Better option: better working conditions, AND software that you care about. Sadly, vidya studios typically don't offer this. Most anecdotes point out that they're among the shittiest conditions in the tech industry.
>>
>>56371218
i like games too, but unless you're making shitty mobile games it isnt really a way to make a living
>>
Kinda new to programming here, can anyone tell me how to make forms bigger? They are a reasonable size on a pc but when i change the device to a phone its incredibly small, i know i can change the pixel count but i would prefer something like em to make it more consistent but it doesn't work, i cant find anything when i search online
Can only use html and php since the programming is for an assignment related to both, thanks to anyone who can help
>>
>>56371338
>>>/g/wdg
>>
>>56371363
Sorry, i'm not a regular on /g/
>>
>>56371218
You know how are the working conditions in Konami, don't you?
>>
>>56371372
Ignore him, lad. It's find to ask web dev questions here.

You'll be waiting years for a reply on /wdg/.
>>
Is it possible to track the location of a phone call with a rooted device? Either that or reveal a private number?
>>
>>56371374
Its a good thing I'm not a nip working at konami.

I bet the working conditions aren't that bad at like, ironclad games, or Firaxis games, or even something like working on dungeons and dragons online at Turbine.
>>
>>56371410
kill yourself fucktard
>>
>>56371410
No, it is not fine, unless it's part of a larger project that involves actual programming.

This nigga is asking basic bitch questions about straight markup.
>>
https://automatetheboringstuff.com/
Good book? I read ThinkPython years ago and forgot almost everything, I want to relearn the basics and go deeper.
>>
>>56371423
>>56371470
Lads, I know you want to fit in, but think for yourself for once.

Ask yourself, is he really hurting anything asking a simple web dev question here?
>>
>>56371564
he's going to get the answer much faster in wdg than in here ffs
>>
File: shot-2016-09-01_14-23-00.jpg (241KB, 1324x780px) Image search: [Google]
shot-2016-09-01_14-23-00.jpg
241KB, 1324x780px
Improving the Photo manager of my backoffice's software.
>>
>>56371564
>is he really hurting anything asking a simple web dev question here?
First one retard's question is entertained.

Then someone experienced from /wdg/ comes over to the slightly faster thread and answers any web-related questions.

Then more anons show up to ask web dev questions because they're getting answered.

Suddenly /dpt/ becomes Node.JS and Django general.
>>
>>56365584
/sqt/
If I use Python/Java (if its heavy OOP) to implement my logic and functionality of the program, just to "quick sketch" it at first.
And later on rewrite it on C++ and optimize it if necessary or possible.

>Is that bad practice?

I mean most of the times if the problem is trivial or I already done something similar I start right off with C++, but I find it x10 times faster to make something with Python or Java, and imitate the lib functionality later on if its non existent in C++ than to start with C++ and find myself loathing what I need next or how to implement it without any syntax errors, moving my focus and time away from the actual logic problem.
>>
>>56371642
Just write in the language you prefer and make C++ libraries for performance-critical spots.

What could you possibly be making that Python and Java are too slow for your end-goal functionality? In most cases, this is an indication of a failure to be able to optimize within the high-level language.

In any case, no, rewriting your application completely in a different language is generally bad practice. You should be able to tell if you MUST write it entirely in C++ ahead of time, based on performance requirements.
>>
>>56371550
Good book for basics and actually using them, falls short in going in-depth about topics and uses. Leagues better than Think Python but not better than real textbooks. Zelle and Guttag are your aces for in-depth introduction.
>>
>>56371616
why is she so perfect bros?
>>
File: 1472593967190.gif (507KB, 172x172px) Image search: [Google]
1472593967190.gif
507KB, 172x172px
>>56371735
about as perfect as my dick ... guess that's why they go so well together ... cuck
>>
>>56371712
Thanks for your reply.
1)Is it worth it to get into these books? I'd think that just touching the basics and then solving problems/projects would be a better way to learn.
2)If yes, should I do the book I mentioned first before getting into them?
>>
>>56371771
>Is it worth it to get into these books?
Good books can't hurt.
>then solving problems/projects would be a better way to learn.
If a book is stopping you from doing things you want to do, you have more problems to worry about than where to start.

Yes, start with Automate the Boring Stuff.
>>
Why are there so many wageslaves in /dpt/? I miss the days when it was NEETs only.
>>
for the anon yesterday asking for my Euler 40 code.


def Champ():
result = 1
digit_range = 0
for i in range(1, 7):
dn = 10**i
val = ((dn - digit_range)/i) + (10**(i-1)-1)
digit_range += (9*10**(i-1))*(i)
result *= int(str(int(val))[(int((val%1)*i)-1 if int((val%1)*i) > 0 else 0)])
return result

print (Champ())



inb4 who's champ
>>
>>56371818
You miss those days because they didn't make you feel inferior (and rightly so). Get a job, you bum.
>>
>>56371836
No, I'm too independent to become a slave.
>>
>>56371835
Disgusting.
>>
>>56371856
0.005s in Python though

I guess I should clean it up
>>
>>56371818
/dpt/ has never been full of NEETs.

The majority are college and highschool students, and there have always been a few anons with jobs.

PROTIP: Having a job doesn't mean you're a slave, faggot.

Some of us have consulting jobs where we can come and go as we please and work on whatever we want.
>>
>>56371818
>He doesn't get paid with benefits to do what he likes because he thinks he's """independent"""
Get a load of this gay baby
>>
>>56371616

Marion is a national hero.
>>
File: wagies.jpg (263KB, 720x764px) Image search: [Google]
wagies.jpg
263KB, 720x764px
>>56371873
>Forced to work to make someone else rich
>Not a slave
>>
>>56371914
>implying I'm forced
>implying I program when I don't want to
>implying I'm not wealthy

Look, I know you're baiting, and I've humored you so far, but this will be the last time I bother with a NEETcuck like you trying to cope with the crushing depression of being a useless sack of shit.

Either way, 4/10 for getting the (You)s, I guess.
>>
Is F# good?
>>
>>56371914
dumb frogposter
>>
>>56372045
F# is only good if you want .NET and don't care about performance
>>
>>56371835
>int str int

what
>>
Your language sucks.
>>
>>56372090
You're speaking it right now, cuck
>>
>>56372090

>he talks about Fortran like that
>>
>>56372060
Or having a decent type system. It's more mundane first-order shit.
>>
No, your stupid little project to add one tiny little functional programming feature to your favorite mainstream language isn't interesting, it's a waste of time and irresponsibly extends lifetime of a bad language.
>>
>>56371835

I've got a better solution



#this part creates a string of Champernowne's constant

constant = "0,"
i = 1


while i <= 1000000:
i = str(i)
constant += i
#print(constant)
i = int(i)
i+=1

#print(constant)

#here ends the string building part

d1 = constant[2]
d1 = int(d1)
d10 = constant[11]
d10 = int(d10)
d100 = constant[101]
d100 = int(d100)
d1000 = constant[1001]
d1000 = int(d1000)
d10000 = constant[10001]
d10000 = int(d10000)
d100000 = constant[100001]
d100000 = int(d100000)
d1000000 = constant[1000001]
d1000000 = int(d1000000)

sum = d1*d10*d100*d1000*d10000*d100000*d1000000

print(sum)

>>
Functional programming has won, no matter how much the idiots shout and stamp their feet.
>>
>>56372133
>he doesn't DRY his coding
>>
Codes of Conduct are attempts to impose censorship, and stifle progress. Refuse to accept them.
>>
>>56372133

hey dude how about
 int(constant[2]) 
>>
About the only argument that can be made of a language like JavaScript is that it acts as a containment field. Unfortunately too many novice programmers have their careers stunted and their minds ruined by being directed toward it.
>>
>>56372046
Dumb redditor
>>
>>56372213
>Posts le reddit frog
>Calls someone else a redditor
>>
File: 1464988239571.png (509KB, 454x642px) Image search: [Google]
1464988239571.png
509KB, 454x642px
>>56372213
>frogposter
>calling someone a redditor
>>
If JavaScript didn't exist, would you create it?
>>
>>56372270
I don't use it now.

Why would that change?
>>
>>56372249

who is this
>>
>>56372285
semen demon
>>
>>56372285
A boy
>>
>>56372285
Dumb meme character from a generic "dark" shonenshit
>>
>>56372285
Smug anime girl #34983895
>>
>>56371687
It's not that, we are required to work with C++ at work.

But writing for example a simple web crawler in C++ took me 4 hours of work, in Python I was ready in ~20 minutes, then rewrote it in C++ in another 20 or so.

I think, however, I get better at C++ gradually, I recently started to use threading and other great stuff, that python or java sucks at.
>>
>>56372295
Tragfags really are delusional.
You should consider ending your life.
>>
>>56372334
Sounds like I triggered you, m'ladyboy. You might find the trash to be a safe space for you.
>>
>>56372321
I think you mean smug anime boy #362.
>>
Truthful posts are discouraged on /g/ because they may cause some users anxiety and distress.
>>
>>56372225
>>56372249
Pepe is a 4chan meme you goddamn newfags
>>
>>56371914

I really wish we ended all NEETbux.
>>
>>56372387

who the fuck keeps posting this trash
>>
>>56372395
I really wish we ended all OOP.
>>
>>56372249
where can i get a boyfriend like this
>>
>>56372398
Your conscience.
>>
File: faggot.png (6KB, 426x414px) Image search: [Google]
faggot.png
6KB, 426x414px
>>56372393
Reddit is still reddit, even when it posts on 4chan.
>>
>>56372395
I have the right to NEETbux. Get back to work, mister noseberg needs that new jet
>>
>>56372393
It has been re-appropriated to the normies.
>>
New thread: >>56372501
>>
>>56371752
That's a nice mouth
Thread posts: 311
Thread images: 37


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