[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: 334
Thread images: 50

File: yuki_k&r.png (350KB, 500x492px) Image search: [Google]
yuki_k&r.png
350KB, 500x492px
What are you working on, /g/?

Old thread: >>58690487
>>
first for common lisp being the best lisp
>>
Fixing my wall before painting it.
Fuck this shit is time consuming.
If you can, don't do it yourself and just hire someone, because it takes way too much time that you could spend better otherwise.
>>
rewriting the linux kernel in scala
>>
>>58693986
and it has no bindings for xlib or ncurses
>>
haskell is SHIT
>>
>>58694038
what should i use instead
>>
>>58694053
Idris
>>
>>58694060
>meme is SHIT
>what should i use instead
>meme2
>>
>>58694060
what does it do better than hakell
>>
>>58694080
>he prefers writing the same code over and over again
>>
>>58694082
Dependent types
>>
Can I have conditional replaces in regexes?
Let's say, given some /^([a-z])([a-z]).*/ pattern, I want to replace first group with [A-Z], and the second group with [z-a].
My language is Perl.
>>
>>58694053
be a real man and use C++
>>
>>58694099
What language?
>>
https://www.youtube.com/watch?v=X36ye-1x_HQ
>>
>>58694115
i ditched it for D & could not be happier
>>58694098
is that it?
>>
>>58694130
>type-driven development
sounds fucking gay as hell

they're just doing things differently for the heck of it
>>
File: 1455539299913.jpg (160KB, 616x723px) Image search: [Google]
1455539299913.jpg
160KB, 616x723px
>>58693968
So pic related is the decompiled source of an executable on some machine, it executes with root permissions.

When I try running say "<program> 0 5000000 R > /tmp/out" the output file doesn't seem to contain anything from memory, but its filesize is correct.
W-why is this?
>>
>>58694132
>>58694149
holy kek, you guys have gotta be memeing
>>
php.net/manual/en/function.password-hash.php

what the hell is this talking about when it says it prefers you to let it generate the salt automatically? if the function is generating a random salt every time how are you supposed to store the salt so you know how to get it to use it the next time a user enters their password and you want to check if its correct? you'd have to get lucky and get the exact same random salt, no?
>>
>>58694163
D is great
>>
>>58694163
>muh special snowflake memelang who no one in the software industry uses
>y-yyou're the one's memeing
>>
>>58694166
>The used algorithm, cost and salt are returned as part of the hash. Therefore, all information that's needed to verify the hash is included in it. This allows the password_verify() function to verify the hash without needing separate storage for the salt or algorithm information.
>>
>>58694121
Please read thoroughly
>>
>>58694177
That's not the part I think you were memeing about.
>>
>>58694209
then what else does idris offer?
>>
>>58694246
dependent types
>>
>>58694270
>what else
>>58694098
>>
>>58694246
Totality checking
>>
>>58694286
syntax extensions (more than just rebindable)
>>
>having failed to convince anywhere else on the internet that their outdated, stale language has more utility than any other language except go, the D retards decided to try /dpt/
>>
@58694315
>hating on D
>>
File: Type Iteration.png (10KB, 568x217px) Image search: [Google]
Type Iteration.png
10KB, 568x217px
>>58694315
I used to shill D here about a year ago
>>
>>58694202
I did. What language?
>>
>>58694374
English.
>>
File: feel.png (6KB, 205x246px) Image search: [Google]
feel.png
6KB, 205x246px
>get ce degree
>get first programming job
>get tasked with improving a module of a system some guy wrote more than a year ago
>the module is written on an older version of the system so i first need to port it to the new version
>find out that the module is full of spaghetti code going god knows where into the system
>the tables for the users of the module are located inside the database used by the system framework instead of the database for the separate modules
>some module code is integrated into the login system which should have been a separate module in the first place

Is this it? Is this really what being a professional programmer is like? I was so happy to get a job and now I want to kill myself.
>>
>>58694343
>thinking D has anything of value

>>58694365
And then you grew up, huh?
>>
>>58694378
What makes you think so? The Latin alphabet isn't really specific to English.
>>
File: 1485532910988.jpg (623KB, 850x1242px) Image search: [Google]
1485532910988.jpg
623KB, 850x1242px
>>58693968
>What are you working on, /g/?
A Youtube to mp3 converter in Python.

I'm new to programming and I decided to write it as my first real "project" with the aid of youtube-dl and ffmpeg. It's nothing more than a simple script that links youtube-dl and ffmpeg, I'm sure anyone experienced could do it in a couple minutes but I had so many problems getting it to work. After 5 hours reading through documentation and source code and failure after failure it finally worked so I'm pretty happy.
>>
>>58694404
The Latin alphabet is so much better with æ, þ and ð added.
>>
>>58694398
>And then you grew up
And then I learned F#
And I shilled that for a month or two
>>
>>58694404
Because I speak English and I need to use regexes in English.
>>
>>58694398
D is a prime replacement for c++ as soon as the gc is made completely optional. And even right now its far superior and a joy to work with unlike c++
>>
>>58694434
OSGTP, is that you?
>>
>>58694456
>superior
>has a GC
Pick one.
>>
>>58694433
Agreed. But he didn't have them in his original post.
>>58694439
Why would you even need them in English?
>>
>>58694459
Yes. C# is trash.
>>
>>58694483
everything is trash according to /g/
>>
>>58694427
youtube-dl --extract-audio --audio-format mp3 $MY_URL_HERE
>>
>>58694184
ok so how do you use it the next time without setting the salt manually to what it returned dipshit? it works once
>>
>>58694473
i love that dpt can never give me anything else. Try it sometime & youll see
>>
>>58694516
>This allows the password_verify() function to verify the hash without needing separate storage for the salt or algorithm information.
>>
>>58694481
Because I speak English.
>>
>>58694246
It has a built-in proof system so you can prove your program is correct at compile-time. Of course, there are external proof systems too, so it isn't unique in that regard. It is a vehicle for dependent types research, and dependent types allow you to verify things that would normally be verified at runtime (example: type-safe printf).
>>
>>58694535
see >>58694516
you obviously don't even know what salted hashing is if you don't understand what i'm saying so don't respond
>>
>>58694549
Could you show the exact use you have for regexes in English?
>>
>>58694557
>It has a built-in proof system so you can prove your program is correct at compile-time.
D has that as well, but ill watch the video
>>
>>58694574
So you're saying you want to be left to wallow in your ignorance?
>>
>>58694510
But then I don't get to learn Python
>>
>>58694427
After seeing >>58694510, I wonder what kind of monstrosity you conjured.
>>
>>58694531
>shifting the goalposts
>>
>>58694582
Right now.
s/^OP$/faggot/ig
s/^>>58694549$/for/
>>
>>58694603
That's a good thing, anon. Python cripples the mind.
>>
Anyone else notice the thread is really rude and unhelpful when there's not many anime posts
>>
>>58694641
Cry moar, weeb
>>
>>58694616
we've established the one blight, but by no means does it make D bad. Especially knowing the primary maintainers agree
>>
>>58694574
The salt is returned as part of the hash. Think of it like adding two strings together
>>
>>58694646
I bet you can't even code you bully
>>
File: 1481526738785.jpg (145KB, 600x631px) Image search: [Google]
1481526738785.jpg
145KB, 600x631px
>>58694641
helpful unrude thread time
>>
>>58694641
WHAT THE FUCK?! POST SOME THEN, YOU GODDAMN CUMFART
>>
>>58694650
Call me when D can target as many architectures as and is as widely supported as C++
>>
File: hm.png (661KB, 600x600px) Image search: [Google]
hm.png
661KB, 600x600px
>>58694675
>C*MF*RT

Please never say that again
>>
File: 6390345.webm (1MB, 1280x720px) Image search: [Google]
6390345.webm
1MB, 1280x720px
>>58694646
>>58694675
>>
File: 1455434781796.jpg (1MB, 2000x1613px) Image search: [Google]
1455434781796.jpg
1MB, 2000x1613px
>>58694641
anti-anime autists are known shitposters who are worse than the worst AF'ing faggot
>>
>>58694705
>anti-anime autists
could have just written "redditors"
>>
>>58694603
You can still do it as a learning exercise.
>>
>>58694690
>>58694703
>>58694705
>>58694670
Can we talk about programming?
>>
File: 1485473423537.jpg (153KB, 1104x1200px) Image search: [Google]
1485473423537.jpg
153KB, 1104x1200px
>>58694730
Yes please tell me about what you're working on Anon
>>
>>58694730
every single image/post you replied to is inherently tied to programming. you wouldn't notice though since you don't know anything about programming
>>
File: 1469386545769.jpg (85KB, 550x550px) Image search: [Google]
1469386545769.jpg
85KB, 550x550px
>>58694715
true
>>
>>58694456
>>58694650
Trust me, the GC is never going away. It's too late. They'll make noises about it forever but never actually do it.
>>
>>58694014
There's a package that provides bindings for X11 and the FFI tutorial literally uses ncurses for examples.
>>
>>58694005
>run linux ontop of the JVM
please kill this planet
>>
>>58694742
not him, but i'm working on a program which tells me which anime to watch next
>>
>>58694742
I'm working on a game in C, what about you?
>>
File: 1485291323709.jpg (27KB, 500x600px) Image search: [Google]
1485291323709.jpg
27KB, 500x600px
>>
>>58694574
>can't tell if horribly stupid or trolling
>>
>>58694776

epic jpeg

ha ha ha

so relatable
>>
>>58694776
>jpg degradation

triggered
>>
File: OOP strikes back.jpg (67KB, 1006x692px) Image search: [Google]
OOP strikes back.jpg
67KB, 1006x692px
>>58694793
>>58694803
>>
>>58694747
call me when they start removing @nogc stuff from core & phobos
>>
>>58694776
>>58694813
we get it, you're not cut out for programming and you're projecting your butthurt onto the language you have to use for class
>>
>>58694813

OOP needs to die.
>>
>>58694498
/g/ isn't everything
>>
File: OOP.png (69KB, 1210x467px) Image search: [Google]
OOP.png
69KB, 1210x467px
>>58694845
>>58694853
>>
>>58694813
>he thinks this is the correct way of doing OOP
>>
>>58694947
What is the correct way of doing OOP?
Every example of OOP people post get met with "this is not how you do OOP" comments.
>>
File: 1404591512474.png (889KB, 756x715px) Image search: [Google]
1404591512474.png
889KB, 756x715px
Anyone know good ressources/books about Machine Learning applied to NLP? Most of the stuff I found online was ML applied to various topics which don't interest me.
>>
>>58694964
>What is the correct way of doing OOP?
Not at all
>>
>>58694813

I've seen teachers who are so shit they unironically encourage this type of garbage
>>
where's akaribbs anon??? i havent seen him in a week
>>
>>58694964

int rng1 = rand() % 7;
int rng2 = rand() % 7;
>>
>>58694456
It sounds like what you're really saying is:
>D is a prime replacement for Java or C#
>>
Reminder that snakes make good pets but poor programming languages.
>>
>>58695044
isn't it
(rand() % 6) + 1
?
>>
>>58694813
no just java & pajeets

void main()
{
import std.stdio : writeln;
import std.random;

auto n = uniform(1,6);
auto n2 = uniform(1,6);

writeln(n," ",n2 );
writeln("Their total: ", n+n2);
}
>>
>>58695044
I already said this.
>>58694975
>>
>>58695115
I agree, and there's no shame in replacing Java or C# but not C++.
>>
>>58695123
>you wouldn't program a snake
>>
>>58695132
>>58694853
>>
File: 1483862770074.jpg (39KB, 640x480px) Image search: [Google]
1483862770074.jpg
39KB, 640x480px
>>58695132
https://godbolt.org/g/qmv5iG
>>
>>58695155
OOP already is dying
>>
>muh C++, java, C#, D, haskell, ...
just learn Go and stop memeing
>>
>>58695183
Go is shit.
>>
@58695183
>muh
stopped reading right there
>>
Didn't see the new thread

Can someone help me with some PHP code?

I'm planning on putting all my SQL queries in one file and ask for a specific one to be executed using switch statements. Is this inefficient? Should I separate each query into its own PHP file?
>>
>>58695183
>thinking you can convince anyone that Go isn't a meme language
>>
File: what a twist.jpg (8KB, 201x250px) Image search: [Google]
what a twist.jpg
8KB, 201x250px
>>58695183
>learn Go
>stop memeing
>>
>>58695166
Is that fucking Megas XLR?

>>58695208
You should separate all your PHP code into one file, then delete that file and use a different language.
>>
>>58695183
>No generics because pajeets are too dumb to use them

Literal meme
>>
>>58695190
This desu senpai
>>
>>58695166
>gdc
>>
>>58695208
>php
trash
>>
File: poly.png (15KB, 633x484px) Image search: [Google]
poly.png
15KB, 633x484px
>>58693968
Making some of the math I use for my importance sampler less annoying to use. On my way to implementing some variance reduction techniques in my ray tracer.
>>
Yeah, ocaml really is the best.
>>
>>58695190
>>58695199
>>58695209
>>58695220
>>58695226
>guaranteed replies
thanks for the (You)s

btw, you can start learning Go here:
https://tour.golang.org
learning the basics of Go shouldn't take you long, and it's just awesome.
>>
>>58695256
You could use ^, or even better, literals
>>
File: Untitled.pngww.png (10KB, 678x144px) Image search: [Google]
Untitled.pngww.png
10KB, 678x144px
The Java 2 course I'm taking right now.

public class Rectangle {
private double length = 1;
private double width = 1;
//The following two methods will check if the value given is less than 20 and more than 0, and assign that value if it is.
public void setLength(double len) {
System.out.println("Attempting to set length to " + len);
if (len > 0 && len <20) {
length = len;
}
else {
System.out.println("Must be less than 20 and more than 0!");
}
}
public void setWidth(double wid) {
System.out.println("Attempting to set width to " + wid);
if (wid > 0 && wid <20) {
width = wid;
}
else {
System.out.println("Must be less than 20 and more than 0!");
}
}
//The following methods will return the area and length, as well as calculate the area and perimeter.
public double getLength() {
return length;
}
public double getWidth() {
return width;
}
public double getPerimeter() {
return (width*2 + length*2);
}
public double getArea() {
return (width*length);
}
}
>>
>>58695221
>>58695235

Name a good alternative then
>>
>>58695282
Hope you didn't pay for that "course"
>>
>>58695288
A good alternative to using PHP is not using PHP.
>>
>>58695295
I did.

Its just proof why you don't go to college to become a programmer.
>>
>>58694162
>W-why is this?
You use 0 to read from memory, not R, because that program uses atoi() to parse arguments, even ones that don't really need to be numeric. Because its author is stupid.

What you actually get when you read from some random memory isn't always what you expect. Sometimes it can just kill your program (if you try to read from memory that isn't mapped). Other times, it works but is just zero pages. Virtual memory means you don't read real memory, or at least not using physical addresses.

The program doesn't check for errors. Bad Program! Bad Programmer!
>>
>>58695044
(1+ (random 7))
>>
>>58695263
I'd rather use Malbolge than this.
>>
>>58694776
I guess you're one of those dumbass faggots that doesn't check the return codes of system calls in C.
>>
>>58695146
>>58695123
[spoiler]pajeet obviously would[/spoiler]
https://www.youtube.com/watch?v=20GU1Dcpep4
>>
File: king pajeet.png (156KB, 1580x864px) Image search: [Google]
king pajeet.png
156KB, 1580x864px
>>58695282

> java 2
>>
>>58695306
How does it feel to get scammed?
>>
>>58695263
>can't do
package main

func main()
{
import "fmt"
fmt.Println("Hello, 世界")
}


or

package main

import "fmt"
func main()
{
fmt.Println("Hello, 世界")
}


Go is as trash as python
>>
>>58695267
the % and ^ operator do the same thing but ^ has lower precedence then *,/,+,- so if I write x + x^2 then it evaluates it to 4x^2 since it does (x + x)^2. I'm not using literals since I'm lazy.
>>
What kind of codes are more desirable?
1. Short, concise and genius code that takes a while for a fellow project contributor to fully understand. (ie nested ternary/recursion etc)

2. Long, expanded and dumb code that is very easy for a fellow project contributor to fully understand. (ie. dumb if else, while, switch etc)

I think (2) makes a project large but maintainable and forkable. But it does not give any 1337 cred.
>>
>>58695282
You're a bit behind, dude. We're on Java 8 now.
>>
>>58695363
1
>>
>>58695344
>>58695368
Java 2 as in the second course on Java, not the version of Java
>>
>>58695363
2.

And recursion does not automatically mean that something falls into category 1.

>>58695379
>jokefliesoverstickmanshead.jpg
>>
File: 1393123404186.png (39KB, 499x404px) Image search: [Google]
1393123404186.png
39KB, 499x404px
>>58695351
>python
stopped reading there
>>
>>58695394
>stopped reading after the last word
So you read the whole post?
>>
>>58695388
nested recursion
>>
>>58695379

f a m

you need to stop living a meme
>>
File: 1451937605829.png (8KB, 493x402px) Image search: [Google]
1451937605829.png
8KB, 493x402px
>>58695405
how would I know
>>
File: 1465535441546.png (47KB, 1045x440px) Image search: [Google]
1465535441546.png
47KB, 1045x440px
>>58695183
>>
>>58695282
A professional would throw exceptions if the values are out of range. That would make it possible to do the final part of the problem, the testing. READ THE WHOLE QUESTION.

Also, this is a really simple problem. Harder problems come later and they assume at that point that you've learnt this simple shit.

OTOH, Java 2? What hole in the ground has the teacher been hiding in?
>>
>>58695371
>How to spot an unhirable NEET
>>
>>58695379
You don't wanna pay to go to university, that's fine, university is expensive in the 3rd world.
But holy fuck dude, you paid someone money to teach you something a single google search could have thought you.
>>
>>58695351
2nd one works just fine, what did you mean?
1st one... you can have many separate files, so who cares

>>58695424
>>>/out/
>>
>>58695418
Well, if you stopped reading at 'python', which was the last word, then you read his whole post. Well done.
>>
File: 1460860391062.png (3KB, 493x402px) Image search: [Google]
1460860391062.png
3KB, 493x402px
>>58695441
how would I know if I reached the end of a post when I stopped reading?
>>
>>58695440
>2nd one works just fine, what did you mean?
no it doesn't, he put a newline between the "{" and the function definition.
>>
>>58695448
Because I very kindly pointed it out to you :)
>>
standard ml or ocaml?
>>
File: d.jpg (77KB, 1280x720px) Image search: [Google]
d.jpg
77KB, 1280x720px
>>58695388
>>58695415

>That was a joke


>>58695425
This is what I wrote to test it.


public class RectangleTest {
public static void main(String[] args) {
Rectangle rect = new Rectangle();
//The following will print out the default values for that rectangle
System.out.println("Width: " + rect.getWidth());
System.out.println("Length: " + rect.getLength());
System.out.println("Perimeter: " + rect.getPerimeter());
System.out.println("Area: " + rect.getArea());
System.out.println("---------------------------------");
//Now the rectangle will have its width set to 5 and length set to 15
rect.setWidth(5);
System.out.println("Width: " + rect.getWidth());
rect.setLength(15);
System.out.println("Length: " + rect.getLength());
System.out.println("Perimeter: " + rect.getPerimeter());
System.out.println("Area: " + rect.getArea());
System.out.println("---------------------------------");
//Now the program will try to set the width to 21 and the length to 34
rect.setWidth(21);
System.out.println("Width: " + rect.getWidth());
rect.setLength(34);
System.out.println("Length: " + rect.getLength());
}
}



>>58695436
I'm not a pajeet programmer friend.
And I do understand that its stupid to pay for this shit.
But my parents forced me to go because they think you have to have a degree to get anywhere in America.
>>
>>58695394
package main

import "fmt"
func main()
{
fmt.Println("Hello, 世界")
}


tmp/sandbox439279438/main.go:5: syntax error: unexpected semicolon or newline before {


And because scoped imports are incredibly useful & any language without them are inferior
>>
>>58695183
>just learn Go and stop memeing
ITYM Rust...
>>
File: 1455134773062.png (17KB, 612x567px) Image search: [Google]
1455134773062.png
17KB, 612x567px
>>58695466
That's very kind of you
>>
>>58695435
>ask for someone's opinion
>complain when someone answers
>>
>>58695471
>I'm not a pajeet programmer friend.
>paying money to learn basic Java
I've got some bad news for you.
>>
>>58695482
fuck
>>58695440
>>
>>58695302
You had the chance to say something intelligent, but ya blew it
>>
>>58695490
/g/ - high quality shitposting echochamber
>>
>>58695496

wew you actually made me a little mad.
>>
>>58695482
>>58695451
oh, right.
my editor fixes that for me, so I don't care.
that doesn't mean Go is shit, at all

>scoped imports are incredibly useful
the code is imported anyway, so scoped import doesn't even matter
>>
>>58695488
You're welcome. Well done for finishing to post.
>>
>>58695471
>That was a joke
Not really helping yourself here, bro.

>>58695507
And your mom blew me, so everyone wins.
>>
>>58695512
You should be mad at the jews scamming you for that shit course, not me.
>>
>>58695471
please don't use an anime image next time, especially a kumiko image. your kind shouldn't be using them. thanks!
>>
>>58695471
>This is what I wrote to test it.
Read up on how to do real software testing. Since it is java and just a single class, look at junit that most people use for doing unit testing.

If you do that, you'll write more code, but it will be BETTER code. Nobody sensible tests by just printing things out and eyeballing it; it's far too hard to do it that way.
>>
>>58695518
>my editor fixes that for me, so I don't care.
the fact that youre forced into a formatting style is not fine.
> so scoped import doesn't even matter
They do, people need to get off the C antiquity. Makes your code so much nicer
>>
>>58695539
he really should be mad at either himself (for being such a retard) or his parents (for providing him with such shit genes)
>>
>>58695471
>you have to have a degree to get anywhere in America
You kinda do in the tech world, a good degree is a useful signal
>>
why is java code so easy to read
>>
>his language doesnt have native unit-testing
>>
>>58695617
i think it's genetic. do you have indian ancestry?
>>
>>58695564
>the fact that youre forced into a formatting style is not fine.
this is what retards believe
top kek
>>
File: 1462506300423.jpg (47KB, 484x363px) Image search: [Google]
1462506300423.jpg
47KB, 484x363px
>>58695318
>You use 0 to read from memory, not R
Oh I see. I'm literally retarded.

Though it still doesn't appear to be working correctly..
>>
>>58693968
I'm making a basic console over Telnet for BasicTV. Any suggestions on how to make it great?
>>
>>58695617
Because everything is too verbose.

CalculatorImplementorFactory.getInstance().createCalculatorImplementor(CalculatorImplementationFactory.DEFAULT).getImplemention().calculate(something.getValue())
>>
>>58695617
                               :
:
:
::
:
::
::
::
:: :
:: ::
::: ::
::: :::
::: Java
:: Java
: Java
:::
:::
:
::
:: ::
:Java: :Java: ::
:::
::
Java Java:
av::Java:J


a:Java:Java:Java:Java

:
Java
Java::::Java::Java::Java
:




::
::
:: :::: : :::::
:: :: ::: :: :::
:: ::: ::: ::: :::
:: ::: :: :: :::
:: :: ::: ::: :: : :::
:: :: ::: ::: ::: ::: :::
:: :: ::: ::: :: ::: :::
:: ::: :: :::: :: ::
:::
:::
>>
>>58695629
>his language needs unit testing
>>
@58695639
>cant newline brackets
>not forced
???
>>
File: 1459081435104.jpg (81KB, 720x720px) Image search: [Google]
1459081435104.jpg
81KB, 720x720px
>>58695653
please refrain from using anime images in the future. your kind really shouldn't be doing this.
>>
>>58695638

i dont think so. im a turk. haplogroup research says im most like from Mediterranean, Caucasian, Western and Central Asian descent.
>>
File: ku.png (940KB, 1280x720px) Image search: [Google]
ku.png
940KB, 1280x720px
>>58695496
>>58695536
>>58695555


>>58695539
>Required course to complete the degree requirements
>I have no choice
>Haha bro you have shit genes lol

>>58695557
I will look into it. I changed the class since you suggested I throw exceptions instead.

    public void setLength(double len) {
System.out.println("Attempting to set length to " + len);
if (len > 0 && len <20) {
length = len;
}
else {
throw new IndexOutOfBoundsException("Must be less than 20 and more than 0!");
}
}
public void setWidth(double wid) {
System.out.println("Attempting to set width to " + wid);
if (wid > 0 && wid <20) {
width = wid;
}
else {
throw new IndexOutOfBoundsException("Must be less than 20 and more than 0!");
}
}
>>
>>58695663
enjoy your buggy libraries
>>
>>58695675
that's still what anyone would consider "below average" so it's most likely a good explanation.
>>
>>58695668
who cares if the languages is forcing you? you care about what the code does
and Go is just awesome at what it does.
>>
>>58695682
does java not have assert/enforce?
>>
>>58695682
>i have no choice
you said you are in the US, right? last time i checked it had some kind of legal system
i don't think anyone can force you to do this. which means you do have a choice.
>>
@58695701
>no you're not forced you retard
>w-who cares it doesnt matter anyway!
wwwwwwwwwwwwwwwwwww
>>
AbstractSingletonProxyFactoryBean SimpleBeanFactoryAwareAspectInstanceFactory
>>
File: 1485147174946.jpg (150KB, 724x950px) Image search: [Google]
1485147174946.jpg
150KB, 724x950px
>>58695682
>>
>>58695629
But it does
>>
File: 0.png (435KB, 3000x2250px) Image search: [Google]
0.png
435KB, 3000x2250px
>>58695726
I didn't say you are not forced...
you seem to see reality as a binary thing
I doubt you are a good programmer
>>
>>58693993
Why not just write a script to do it, anon?
>>
>>58695726
i like this post
>>
>>58695629
Mine does
>>
Fucking stack frame analogy

" As each function is called, it may call other functions, which may call other func-
tions—all before any function returns. Each function eventually must return control to the
function that called it. So, we must keep track of the return addresses that each function
needs to return control to the function that called it. The function call stack is the perfect
data structure for handling this information. Each time a function calls another function,
an entry is pushed onto the stack. This entry, called a stack frame, contains the return
address that the called function needs in order to return to the calling function. It also con-
tains some additional information we’ll soon discuss. If the called function returns, instead
of calling another function before returning, the stack frame for the function call is popped,
and control transfers to the return address in the popped stack frame.
Each called function always finds the information it needs to return to its caller at the
top of the call stack. And, if a function makes a call to another function, a stack frame for the
new function call is simply pushed onto the call stack. Thus, the return address required by
the newly called function to return to its caller is now located at the top of the stack.
The stack frames have another important responsibility. Most functions have auto-
matic variables—parameters and some or all of their local variables. Automatic variables
need to exist while a function is executing. They need to remain active if the function
makes calls to other functions. But when a called function returns to its caller, the called
function’s automatic variables need to “go away.” The called function’s stack frame is a
perfect place to reserve the memory for automatic variables. That stack frame exists only
as long as the called function is active. When that function returns—and no longer needs
its local automatic variables—its stack frame is popped from the stack, ..."
>>
>>58695749
>>58695772
good lads
>>
>>58695726
>>58695731
>>58695759
>>58695768
    ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█ ___ █
█ // 7 █
█ (_,_/\ WORSHIP THIS █
█ \ \ YOUR THROBBING GOD █
█ \ \ █
█ _\ \__ █
█ ( \ ) █
█ \___\___/ █
█ █
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
>>
guys I need that image where C++ is represented as an anime girl
>>
File: CBpxF32WEAAFVUm.png (442KB, 600x900px) Image search: [Google]
CBpxF32WEAAFVUm.png
442KB, 600x900px
>>58695791
>>
>>58695797

nice ty
>>
File: c++ anime girl.png (463KB, 785x678px) Image search: [Google]
c++ anime girl.png
463KB, 785x678px
>>58695791
>>
>>58695781
Stack frames were also confusing the first time I learned them, what's the trouble?
>>
>>58695823
Nothing yet, it just feels so autistic
>>
I want to write a library in C that provides common data structures and is not licensed in fucking GPL. Any algorithm and data structs book suggestions? I've got tons of math books too

>>58694115
>not C
>>
>>58695843
Something like GNU Multiprecision?
>>
>>58695629
what shit language doesn't have unit testign?
>>
>>58695706
assert is equvilent to if( false) exit(1)
Sometimes you would rather not quit the program but handle the given situation
>>
>>58695843
>and is not licensed in fucking GPL
Literally why?
>>
How to make a very fun and popular game in C? Not C++, please, I would rather do in assembly than C++. In C, please, my friends.
>>
>>58695962
SDL or SFML bindings
>>
>>58695843
What data structures are you planning to have?
>>
>>58695962
Platform API + OpenGL
>>
>>58696020
The only valid data structure is the list.
>>
>>58696074
just use lisp
its as fast as C but has so much
>>
>>58696074
list as in linked list or contiguous memory?
>>
>>58696094
wanna know how I know you're fat?
>>
>>58695962

Just use SDL. It's a C library, even if it's popular for use in C++ programs. CSFML is also an option, but it's a wrapper library, so it's not ideal.
>>
I could use some tips for an animation algorithm.
I have an animation that consists of 6 distinct frames, but I want each frame to have multiple shots (e.g. 2s or 3s). Within a loop, how could I set up an algorithm to give every two adjacent indices (of the animation array) the same image?
>>
>>58695897
Not really
>>58695955
Because I don't like forcing people into such a restrictive license. Proprietary programs aren't bad unless it's for security or privacy.
>>58696020
mainly
>vectors
>maps implemented with hash tables
>hash tables
>queues
>binary trees of a few varieties
And I'll probably add more, but those will be the initial ones

I also plan to make a library that provides a string data type that stores its character sequence as both as an array and binary tree. Probably call it binstr or something
>>
anyone here use laravel or was i wrong in thinking there are actual coding artizans here
>>
>>58696157
how about threadsafe containers
>>
>>58696118
im not stallman
plus, im only overweight
>>
>>58696170
I haven't done much concurrent programming other than making some simple servers, but from what I know that's doable for me,
>>
>>58695629
It does.
>>
File: legopepe.png (1MB, 1024x1024px) Image search: [Google]
legopepe.png
1MB, 1024x1024px
So I've learned the basics of C and some of the POSIX stuff but I havent really made anything usefull with it. Any recs for a cool beginner level project that would also push me to learn some new stuff?
>>
>>58696266
Chip8 emulator?
>>
>>58696134
Are there any reasons to use SDL over plain OpenGl?
>>
File: c.png (16KB, 1530x145px) Image search: [Google]
c.png
16KB, 1530x145px
So this is the power of C...
>>
>>58696168
No, only wizards here. The PHP shitter thread is >>>/g/wdg
>>
>>58696311
>The previous public release, libpng 1.6.27, fixed a 21-year-old null-pointer dereference (see warning below) and included some minor build tweaks.
>>
>>58696306
Window, input and audio handling, OpenGL is a graphics api ONLY.
>>
File: gol.png (16KB, 1204x1202px) Image search: [Google]
gol.png
16KB, 1204x1202px
Conway's game of life in C++ using SFML. Never programmed it before and I feel like it's something every programmer has to make eventually. Right now I have the window drawn and have figured out how to draw some stuff and now's the time for the fun part which is seeding the grid and then doing generational logic.

Is storing all the cells in a vertexarray of quads a reasonable approach to start with, or is there a better way that I'm unaware of? I'm still new to C++. Pic related it's what I've got so far. The grid is a single vertexarray and so are the quads. I'd like to get a basic implementation working and then work on optimizing it.
>>
>>58696306
not really since glfw & openal exist so fuck sdl
>>
>>58696311
>if programs has devastating bugs it's fine but's if the program was written in C then it's the languages fault.
Fuck off pajeet.
>>
File: 1484944738532.jpg (35KB, 500x375px) Image search: [Google]
1484944738532.jpg
35KB, 500x375px
>>58696362
In Haskell this is just
step cs = filter shouldLive $ nub $ concatMap cellAndNs cs where
shouldLive c = ns == 3 || (ns == 2 && elem c cs) where ns = numLiveNs c
numLiveNs c = length $ filter (`elem` cs) $ filter (/= c) $ cellAndNs c
cellAndNs (x, y) = [(x+x', y+y') | x' <- [-1..1], y' <- [-1..1]]
>>
File: image.jpg (67KB, 480x564px) Image search: [Google]
image.jpg
67KB, 480x564px
>>58696323
>no coding artizans here

aw too bad anonkun
>>
>>58695208
>Should I separate each query into its own PHP file?

No put them into one big ass PHP file. Unless it's too big. Then use a couple files. Just don't separate each query into its own file.
>>
>>58696458
I like Haskell a lot, but I'm also trying to get better at C++.
>>
>>58696458
I can't tell, if it's actually Haskell or a shitty Bash oneliner.
>>
>>58696458
>implying having this much garbage on a line is a good thing
>>
Currently doing http://cs231n.github.io/assignments2016/assignment1/

Idea is to learn how to make CNN for my course conclusion project
>>
>>58696306
>>58696367

SDL is a multimedia library. It handles graphics, windowing, input, and audio all under one library. It's also a lot less of a pain in the ass to use. Seriously, try writing your program in raw OpenGL and OpenAL, then try writing it in SDL. You will be a lot more productive with SDL.
>>
>>58696458
>In Haskell this is just this line of unparsable garbage designed for people with at least one extra chromosome
>>
>>58696516
Given that it's four lines long, it's probably not a one-liner.
>>
>>58696550
>>58696367
SDL also does networking, which is the best cross platform way of networking. SDL is based
>>
>>58696566
It's four lines
>>
File: 1483730818833.png (160KB, 373x345px) Image search: [Google]
1483730818833.png
160KB, 373x345px
>>58696503
>>58696516
>>58696535
>>58696566
>>
>>58696585
of code that does not reflect how a computer handles data nor how a person would ration about the given task or problem.
>>
>>58696609
its pretty much exactly how a person would reason about it
>>
>>58696619
mathematicians aren't people
>>
>>58696577

Wasn't aware SDL did networking now... although if I were looking to a C library for networking, I'd think something like curl or zeromq might be some more ideal choices, depending on what it's needed for.
>>
>>58696665
>>58696577
It only really handles TCP and UDP. Other protocols have to be implemented by the user on top of that. I use cURL for HTTP requests in C.
>>
>>58696516
>>58696535
>>58696566
It's interesting to note that all of these posts seem to think that snippet is one line long.
>>
>>58696700
Says something about the language doesn't it?
As it doesn't make it clear where one line ends and another begins.
>>
>>58696637
Your father isn't a person.
>>
>>58696700
>implying the tabs would be like that if that wasn't one line of interconnected logic garbage
>>
>>58696729
No, you're right, he's a cripple.
>>
>>58696741
I can tell.
>>
>>58696764
It takes one to know one.
>>
>>58696683
>It only really handles TCP and UDP
>I use cURL for HTTP requests in C.
HTTP is a UDP protocol though.
>>
>>58696774
How does it feel being merely a triple-digit? Does it hurt?
>>
>>58696824
What's the matter, struck a nerve, did I?
>>
>>58696813
HTTP is TCP, although the protocol has been ported over to UDP (but not commonly used, at least not by myself)
>>
File: 1484973457026.jpg (110KB, 497x640px) Image search: [Google]
1484973457026.jpg
110KB, 497x640px
>>58696738
>>58696720
I still don't think you can count to four.
>>
>>58696845
>HTTP is TCP
Once again, google lied to me.
>>
>>58696840
Yes... Please don't say that sort of stuff again...
>>
File: Screenshot (33).png (848KB, 1920x1080px) Image search: [Google]
Screenshot (33).png
848KB, 1920x1080px
>>58695436

But anon, isn't the whole point of college to provide technology and instructors to aid students in learning?

If people only logically cared about information, they would read books seeing as there are numerous on every subject ever.

College provides people with tools they don't have access to, which is why people would pay for it.

Of course, that't not to say that anyone going to college now is doing it for that reason. Most people go to college now because its a meme forced by high schools.
>>
>>58696875
My point was that any country that values it's citizens education provides college/university tuition for free.
>>
>>58696859
The indentation looks as if one line wraps around the 80th column.
>>
>Helping Scientists convert excel spreadsheets to MySQL DB.

>can't even open their 10,000 row 50 column 20mb spreadsheet

Is this hell
>>
File: 1485135642832.jpg (246KB, 400x800px) Image search: [Google]
1485135642832.jpg
246KB, 400x800px
>>58696898
And if that happens three times, it would make... four lines.
>>
>>58696897
Well anon, most people on 4chan are from the United States, where college isn't free.

The entire 'point' you are trying to make falls flat.
>>
>>58696919
line wrap != line break
>>
>>58696914
>after 10 minutes opening spreadsheet with sc
>>
File: 1483423464145.jpg (96KB, 576x720px) Image search: [Google]
1483423464145.jpg
96KB, 576x720px
>>58696914
Make sure you keep us updated about this, I am monitoring these threads.

>>58696929
At this point I'm just replying to you as an excuse to post animal reaction images. My initial point was actually one of samefaggery.
>>
>>58696919
No, it would make one line of source code wrapped around the 80th column ... that produces 4 lines of text.
>>
how hard is c++ compared to say java?
>>
>>58696945
>At this point I'm just replying to you as an excuse to post animal reaction images
In other words, you ran out of actual arguments, that's fine, animals are cute.
>>
>>58696945
Yes, and be sure to use new images to give us some clues on which site you came from.
>>
>>58696956
Its the same thing.
You just have to be more careful when using C++ since it assumes the developer knows what they are doing.
Java will interpret your code and make sure it runs safely, which means you can be less careful.
>>
>>58696956
brainlet pajeets aren't welcome here. you do know that, right?
>>
>>58696952
>that produces 4 lines of text.
Aha, you *can* count!

>>58696959
See above. Take a leaf out of his book.

>>58696963
I had roughly 1100 cat images around the time the /dpt/ was born. I've no idea how many I have now.
>>
>>58696978
But it's still one line of source code.
>>
>>58696956
compare the size of their standards reports
>>
>>58696978
Yeah, which is why the images you use have such old time stamps. Or are you suggesting /dpt/ was born relatively recently? In which case you are even more retarded.
>>
>>58696988
No, it isn't. Did you not read the conversation?
>>
>>58696995
Ah yeah, I'm a time traveler
>>
>>58697016
Please prove this you fucking retard.
>>
>>58696988
ghc compiles the code to quantum state in which all outcomes are predetermined with infinitely fast runtime
>>
>>58697001
Yes, it is. Did you read the other posts?
>>
File: 1484927514123.jpg (119KB, 800x600px) Image search: [Google]
1484927514123.jpg
119KB, 800x600px
>>58696995
I'm not sure what you're upset about. /dpt/ was conceived summer 2011, IIRC.
>>
>>58696945
I'm trying to figure out simply which columns need to be condensed into just one column (columns like "data 1997, data 1998", etc.)

But the first problem is I can't fucking Open it to see what the title are. I'm going to just try reading the raw XML myself and only the first few lines using head. I'm doing this on my storage server too so it's slower than my ssd server
>>
>>58697023
That dog is pretty ugly.
>>
>>58695643
Use ssh instead of telnet.
>>
File: 1483698762422.jpg (88KB, 773x960px) Image search: [Google]
1483698762422.jpg
88KB, 773x960px
>>58697025
They must be able to open it in some way to have entered the data in the first place. Just for information gathering, have you tried opening the sheet on their system?

>>58697035
Yup.
>>
>>58697023
>>58697048
i get the "most posters here are animals" joke you're trying to make but could you please post anime instead? at least it's more related to the subject.
>>
>>58697019
this is true. i actually implemented that myself.
>>
New thread:

>>58697071
>>58697071
>>58697071
>>
New thread: >>58697074
>>
File: vVsjW9D.jpg (115KB, 1024x768px) Image search: [Google]
vVsjW9D.jpg
115KB, 1024x768px
>>58697020
Yes, I did. I also wrote the code, which is four lines of Haskell that define four functions.

Where did you go wrong? :)
>>
>>58697075
>>58697077
Bravo
>>
>>58697044
already planned that after I get a basic system set up.
>>58697075
no
>>
>>58697075
>>58697077
Good job, faggots.
>>
>>58697075
>>58697077
fuckin' nailed it
>>
>>58697048
they open their sheet very slowly on an iMac. My server has 256mb ram and is not used for processing huge files like this all at once, just simple web serving stuff
>>
>>58697057
Not much anime is programming related. I'll admit Nagato is an exception.

>>58697075
>>58697077
Nicely done, guys.
>>
>>58697125
Why the fuck would you be processing it on a server with 256mb of RAM?
>>
>>58696925
>not allowed to point out that the US system is inherently stupid because it might upset the burgers

Yeah nah.
It's not even a properly capitalist system either, otherwise you'd be throwing money at people studying subjects that lead into understaffed sectors.
Except nobody is doing that, and they still fucking wonder why the staff supply doesn't meet the demand.
>>
>>58697125
>how do they open such a ridiculous file?
>very slowly
I chuckled.
>>
gib algorithm books pls
>>
>>58697218
>It's not even a properly capitalist system either,
I don't think any sane person will claim that it is. Your initial point is blatantly false by the way.
>>
>>58697239
http://ce.bonabu.ac.ir/uploads/30/CMS/user/file/115/EBook/Introduction.to.Algorithms.3rd.Edition.Sep.2010.pdf
http://is.ptithcm.edu.vn/~tdhuy/Programming/Introduction.to.Algorithms.pdf
>>
>>58697239
The Algorithm Design Manual
Introduction to Algorithms
>>
Any ideas about what the fuck should I create? I have some electronic parts and a few toys that I could make use of to build something, but I don't know what.
Preferrably, I'd like to do some random gadget for my room that's not really useful but might be cool.
I feel like there are lots of things I can do, by I am held back by being able to waste my time on other pointelss shit.
>>
>>58697164
Cause 256mb is all I have?
>>
>>58697248
I'm not >>58696897
Making education unequivocally free is almost certainly a bad idea, all degrees are not anywhere near equal.

But charging someone who wants to become a doctor or a nurse tens of thousands of dollars just so they can do their job saving lives is piss fucking poor in the long term.

I'm all for charging the shit out of fuckers who want to waste 3 years of their life reading literature or studying politics though.
>>
>>58697125
Anyway, if you want to gather information about the sheet, just open it on their iMac. Navigate through it a bit until you get the idea, then try to digest it programatically.
>>
File: SFhadhadtra.jpg (105KB, 640x480px) Image search: [Google]
SFhadhadtra.jpg
105KB, 640x480px
JAVA'S SHIT PYTHON'S SHIT GO IS SHIT C# IS SHIT JAVASCRIPT'S SHIT HASKELL IS SHIT C++ IS SHIT C IS SHIT ASSEMBLY IS SHIT

EVERYTHING IS SHIT!

NOTHING PLEASES YOU SHITS!

I'M GONNA JFDLKSJFLJAFIUAHJFGIUOHJSNGIUNJNFMDSMNIODMNJFIKMJSDFCIKDMJSKJMNFIKDJF
>>
File: 1448521969490.gif (1MB, 350x300px) Image search: [Google]
1448521969490.gif
1MB, 350x300px
>>58697622
>>
>>58697622
>JAVA'S SHIT PYTHON'S SHIT GO IS SHIT C# IS SHIT JAVASCRIPT'S SHIT C++ IS SHIT C IS SHIT
all true though
>>
>>58694964
The only way to win is not to play.
Thread posts: 334
Thread images: 50


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