[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: 351
Thread images: 44

File: prog.jpg (105KB, 473x496px) Image search: [Google]
prog.jpg
105KB, 473x496px
old thread: >>60686369

What are you working on, /g/?
>>
First for C
>>
Making a python .plist installer.
>>
File: 1467570941060.jpg (517KB, 1521x1076px) Image search: [Google]
1467570941060.jpg
517KB, 1521x1076px
>>
haskell!
>>
About to start working on a C++ Huffman encoder/compressor

How hard is it gonna be?
>>
whats the easiest job to get hired for with a comp sci degree?
>>
>>60697438
1gb/s garbage rate
>>
>>60697393
Trying to build out a LIFX library in Rust so I can make some neat shit.

I have no idea what I'm doing though, because it invovles fucking with UDP packets.
>>
>>60697454
Java
>>
>>60697458
haskell!
>>
File: 1495673874839.gif (145KB, 500x500px) Image search: [Google]
1495673874839.gif
145KB, 500x500px
>>60697438
>>60697487
>>
>>60697450
Huffman is not so hard, lzw fucked me in the head for some reason back in school
>>
>>60697484
>hi, we are looking for experienced java developers with strong skills in the following
>minimum 10 years experience
>35k starting
- every java dev job advert
>>
>>60697367
>//operators
> int add;
> int sub;
> int div;
> int mul;
>could be compacted into a single var called, say, result.
how though?

>System.out.println( (I == add ? "correct" : "retry"));
My book mentions this, apparently it is called the ternary operator.
is i understand it, the statement says:
if I = add is true, then use the string value "correct", elsewise use the string value "retry".
I think i will try that, be back with new code soon.
>"dont mean to be harsh, but..."
dont worry anon, im a beginner and expect beginner incompetence from myself.
>>
>>60697454

PC technician/support
>>
>>60697518
IT helpdesk
>>
>>60697536
in what, a call center?
>>
File: old_hag_langs.png (173KB, 600x355px) Image search: [Google]
old_hag_langs.png
173KB, 600x355px
>>60697415
>>
>>60697542

Call center, PC repair shop, anything!
>>
>"Hello, here is my degree in CS, I want to take calls"
hmm
>>
>>60697539
pain and suffering

>>60697581
call centers here are where people go to neck themselves, and repair shops typically want tinkerers and the like, not devs.
>>
>>60697614
>pain and suffering
enjoy CS
>>
ITT: Make a Hidden Markov Chain in the language in your choice.

Python:
import hmmlearn
>>
>>60697646
import Data.HMM
>>
>>60697519
public class Math_Master {
public static void main(String[] args) {

Scanner in = new Scanner(System.in);

Random rng = new Random();

//set random operator selector
int op = 1;

//rand operands
int a, b;

int input = 0;
int result = 0;

//integer variable range
System.out.println("please input numerical range:");
int range = in.nextInt();

for (int t = 1; t != 10; t++){
a = rng.nextInt(range);
b = rng.nextInt(range);
switch (op) {
//addition
case 0:
result = a + b;
System.out.println("please add " + a + " and " + b + ":");
input = in.nextInt();
break;
//subtraction
case 1:
result = a - b;
System.out.println("please subtract " + a + " and " + b + ":");
input = in.nextInt();
break;
//division
case 2:
result = a / b;
System.out.println("please divide " + a + " and " + b + ":");
input = in.nextInt();
break;
//multiplication
case 3:
result = a * b;
System.out.println("please multiply " + a + " and " + b + ":");
input = in.nextInt();
break;
//error message
default:
System.out.println("programming is fucked");
} //switch

System.out.println( (input == result ? "correct" : "retry"));

}
}
}

Haven't ran it but something like that is what I had in mind. Could also print before switch
>>
Is there a sticky somewhere I could look at for resources on learning how to program? I'm taking a summer course for it but having more resources to work on would be nice.

>inb4 Google it yourself faggot
First step in all research is checking whether someone else asked the same question.
>>
Bad girl.

New chair is awesome.

Drink and snack on me. Imma find something for rhe day.

Rather...

..... . ........

...
.try the day dnrink and snack
Dont look at me. Also heres your dick.
>>
>>60697454
What about with no degree?
>>
>>60697784
Barista
>>
File: 1494974910065.jpg (362KB, 1453x1879px) Image search: [Google]
1494974910065.jpg
362KB, 1453x1879px
>>60697393
C influenced languages get an automatic F in my book.
>>
>>60697842
Yeah, Lisp fortran and SML are the only languages that are good.
>>
>>60697721
here is improved version.
I copied your idea of abbreviating "int a;/int b;" into just "int a, b;"
also took the idea of introducing values of a dn b at beginning of for loop before switch operation.

have to wander what you are diong with the input and result variables. are those really necessary for it to work?
>>
File: smug_ran.jpg (632KB, 709x1063px) Image search: [Google]
smug_ran.jpg
632KB, 709x1063px
>>60697842
Your book sucks lmao.
>>
>>60697869
Replace Lisp with Forth and you're almost right.
>>
>>60697877
forgot to paste:
ackage Math;
import java.util.Random;
import java.util.Scanner;

public class Math_Master {
public static void main(String[] args) {
//RNG
Random r = new Random();

//set random operator selector
int op = r.nextInt(3);
//random integer values
int a, b;

//Scanner
Scanner s = new Scanner(System.in);
//user input
int I;

//operators
int add;
int sub;
int div;
int mul;

//integer variable range
System.out.println("please input numerical range:");
int range = s.nextInt();

for (int t = 1; t != 10; t++){
a = r.nextInt(range);
b = r.nextInt(range);
switch (op) {
//addition
case 0:
System.out.println("please add " + a + " and " + b + ":");
add = a + b;
I = s.nextInt();
System.out.println( (I == add ? "correct" : "incorrect.\nThe correct answer was: " + add));
break;
//subtraction
case 1:
System.out.println("please subtract " + a + " and " + b + ":");
sub = a - b;
I = s.nextInt();
System.out.println( (I == sub ? "correct" : "incorrect.\nThe correct answer was: " + sub));
break;

//division
case 2:
System.out.println("please divide " + a + " and " + b + ":");
div = a / b;
I = s.nextInt();
System.out.println( (I == div ? "correct" : "incorrect.\nThe correct answer was: " + div));
break;
//multiplication
case 3:
System.out.println("please multiply " + a + " and " + b + ":");
mul = a * b;
I = s.nextInt();
System.out.println( (I == mul ? "correct" : "incorrect.\nThe correct answer was: " + mul));
break;
//error message
default:
System.out.println("programming is fucked");
}
}
}
}
>>
File: 1fe.png (59KB, 658x662px) Image search: [Google]
1fe.png
59KB, 658x662px
Complete programming/coding/software brainlet here: how hard is it to make a program that detects data patterns? For example, if I had 10 pages of just random number sets, could a program be made that detects the same set over and over again? pls help
>>
>>60697886
Fortran >>>>>>>>>>>>>>>>>>>>> C
You have to be mentally ill to deny this.
>>
>>60697900
Easy. Just use statistics.
>>
I made a minimax AI in my n-length tic-tac-toe game but it is slow. How can it be made faster?

I saw alpha-beta pruning on wikipedia and will try that. I also thought of checking whether a possible move is just a rotation or flip of another move and then not evaluating it.
>>
>>60697906
>no pointer support
>>
>>60697922
excuse the autism but could you explain what you mean?
>>
>>60697895
going to see if i can implement a scoring system after a 2 hour break, then will see if i can figure out how to export the finished product and turn into a fully fledged and downloadable application on GitHub.

adding a scoring system will not be too tough, just a small bit of trial and error. Doing the rest i imagine will be very difficult. It has no GUI so i expect launching it with a cmd console will be the only way.
>>
File: test.png (2MB, 709x1063px) Image search: [Google]
test.png
2MB, 709x1063px
>>60697886
>>
>>60697906
>tfw memed Fortran so much that people are starting to buy my shills
Yes good little goy.
>>
>>60697946
You don't need pointers when you have pass by reference.
>>
>>60697808
Please say it ain't so.
>>
>>60697906
>auto restrict
>>
>>60697393
>/prog/
>picture

Bring back world4ch
>>
>>60697877
>>60697895
>>60697953


>are those really necessary for it to work?
Unfortunately yes, it's one of Java's many small faults and is required to output outside of the switch statement, as input and result are only operated on in an inner, conditional scope. This means Java can't guarantee that the values have been set and Java disallows your using variables that haven't been initialized.

You have the basic idea for sure, and that's what's important. You'll learn clever optimizations/quality-of-life tricks by trial and error and repetition.

A scoring system will be extremely easy, the GUI much less so if you don't have any experience with JavaFX. That said, once you have a basic understanding of JavaFX, making a GUI for a program like this will be trivial as well.

Is there anything that has to be done other than the scoring system and a GUI?
>>
>>60697900
You can use CLI programs for that, no need for any code. uniq can probably do what you want, do
man unique 
>>
>>60697968
Absolutely any language not influenced by C is better than C.
>>
>>60698027
That's a strange way to say nothing's better than C
>>
File: test2.png (2MB, 709x1063px) Image search: [Google]
test2.png
2MB, 709x1063px
>>60697886
>>
>>60697614
>not devs.

A CS degree doesn't make you a dev. Not at all.

Most CS students I see, meet and met know jack shit nor burn with enough passion for development to amount to a real developer.

If you want to be a developer, sit down your ass, and have it spanked, bruising and hurting until your farts shit out abstractions.
>>
>>60698025
>Unfortunately yes, it's one of Java's many small faults and is required to output outside of the switch statement
doesn't look like it since i don't seem to recall ever implementing it into my program
>You'll learn clever optimizations/quality-of-life tricks by trial and error and repetition.
leake forgoing the whole result and input variable fiasco?
>You have the basic idea for sure, and that's what's important.
what was the basic idea again? Thanks for the complement but i would appreciate an elaboration on what exactly it is i got.
>the GUI much less so if you don't have any experience with JavaFX
definitely going to forgo the GUI
>Is there anything that has to be done other than the scoring system and a GUI?
as mentioned i still need to attempt to export and distribute. in other words, i need to figure out how to zip the finished package and be able to run it on other computers without much hassle. This skill will be ueful when i start designing proper applicatins or games.
>>
>>60698079
>sit down your ass, and have it spanked, bruising and hurting until your farts shit out abstractions.
that's kinda hot, I feel horny and motivated now
>>
I got my first programming job. 99% of the workday I spend on fixing issues brought up by my nitpicking coworker.

How do I get his nitpicking skills so I don't waste his time, and can deliver code that is first time right?
>>
>>60695504
That's some of the worst advice.
Yes documentation is important but all of school documentation is outdated and probably wouldn't fit with your worksplaces idea of tidy anyway. You learn from what they do at the company.
Like fucking >>60695277 this shit would never fly at my company. That stuff would only be useful if you work on a company where you're expected to have extremely fragmented developer time. If you write every other line of a system or whatever. If you write a significant code chunk you need to provide a good API and document the reasons for the design (i.e. if you find that using a continuous array is better for performance than whatever clever data-structure solution you came up with you write that down). You shouldn't explain how things are done the code does that.
>>
https://github.com/tjmehta/is-positive-integer

wtf, why is npm so bizarre
>>
a 6502 reference in man format would be neat but fuck writing man pages is shit
>>
>>60698161
isPositiveInteger(0) // false

Does that imply it's negative, becouse its neither,
0 = ±0
A place where `tralse` would be appropriate.
>>
>>60698112
>doesn't look like it since i don't seem to recall ever implementing it into my program
This is because you choose to output "success/retry" INSIDE the switch statement rather than outside, which obfuscates the code by adding repetitive lines where only one could suffice. The same is done with your input.

>leake forgoing the whole result and input variable fiasco?
No, I was more thinking using a workaround for that "fiasco" in order to make your code flow better and be easier to read.

>what was the basic idea again? Thanks for the complement but i would appreciate an elaboration on what exactly it is i got.
You understand how to program what you need, but what you don't understand is how to program what you need elegantly. Realistically, switch statements are massive and can be hard to decipher compared to just procedural lines of code, so it makes sense to make them as small as possible. Your for loop for example, could be compacted into a much more readable and "pretty" for loop as I'll post in the next comment with the introduction of a string to store the operation word.

Readability is extremely important in programming. If you plan on making a career out of it, it's about as important as making sure the code functions properly. You'll learn that there's a way to do things, and then there's a way to do things properly. The "fiasco" that you say my code introduces is a workaround to make the code readable. It's a small price to pay.
>>
>>60698293
...
String opWord = ""; //"fiasco"
...
for (int t = 1; t != 10; t++){
a = rng.nextInt(range);
b = rng.nextInt(range);
switch (op) {
//addition
case 0:
result = a + b;
opWord = "add";
break;
//subtraction
case 1:
result = a - b;
opWord = "subtract";
break;
//division
case 2:
result = a / b;
opWord = "divide";
break;
//multiplication
case 3:
result = a * b;
opWord = "multiply";
break;
//error message
default:
System.out.println("programming is fucked");
} //switch

System.out.println("Please " + opWord + " " + a + " and " + b + ": ");
input = in.nextInt();
System.out.println( (input == result ? "correct" : "retry"));

} //for
>>
>>60698267
No, zero is neither positive nor negative.
>>
>>60698323
>what is IEEE 754
>>
>>60698255
Man pages are in some ancient format that dates back to the mid 60s, no wonder it's shit.
>>
>>60698353
a standard for floating-point arithmetic, not applicable to integer arithmetic
>>
>>60698353
>Is 10 greater or less than 10
>Neither
>Yeah but it says so right here that it's less than
>>
>>60698267
>isCat(Bird) //false
Does this imply it's a dog?

Kys
>>
>>60697721
>>60697895
>>60698322

Java pajeets.
>>
>>60698079
What the actual fuck does a CS major consist of in the USA?
>>
>>60698519
and you are?
>>
>>60698267
Why not use
(x > 0)
?
Or is the "is integer" more important part of the deal?
>>
>>60698293
already improved it.
Here it is:
public class Math_Master {
public static void main(String[] args) {
//RNG
Random r = new Random();

//set random operator selector
int op = r.nextInt(3);
//random integer values
int a, b;

//Scanner
Scanner s = new Scanner(System.in);
//user input
int I;

//universal operator
int result;

//score
//int right = 0;
//int wrong = 0;

//integer variable range
System.out.println("please input numerical range:");
int range = s.nextInt();

for (int t = 1; t != 10; t++){
a = r.nextInt(range);
b = r.nextInt(range);
I = s.nextInt();
switch (op) {
//addition
case 0:
System.out.println(a + " + " + b + "=");
result = a + b;
System.out.println( (I == result ? "correct" : "incorrect.\nThe correct answer was: " + result));
break;
//subtraction
case 1:
System.out.println(a + " - " + b + "=");
result = a - b;
System.out.println( (I == result ? "correct" : "incorrect.\nThe correct answer was: " + result));
break;

//division
case 2:
System.out.println(a + " / " + b + "=");
result = a / b;
System.out.println( (I == result ? "correct" : "incorrect.\nThe correct answer was: " + result));
break;
//multiplication
case 3:
System.out.println(a + " * " + b + "=");
result = a * b;
System.out.println( (I == result ? "correct" : "incorrect.\nThe correct answer was: " + result));
break;
//error message
default:
System.out.println("programming is fucked");
}
}
}
}
>>
>>60698322
I wish i had the streamlining skills that you do.
I had not though to introduce a string variable to substitute segments of the string.
Going to work on it now, see if i can streamline anything else (though i suspect not).
>>
>Using if clauses insted of using a array of function pointers

Seriously hope you guys don't waste precious memory like
>>
>>60698610
>I had not though to introduce a string variable to substitute segments of the string.
Dysgenics is a real phenomenon folks.
>>
>>60698627
Explain further.
>>
>>60698656
Step 1:
Declare functions that do what you would do in the if clauses
Step 2:
Make an array of functionpointers
Step 3:
Acces the correct function by doing the following
(*array_name[if_val])(inputs)

Only works if you have small sequential values
>>
>>60698696
How does this avoid if clauses?
>>
>>60698656
I feel like he's talking about instruction cache. But I'd say that his advice is retarded because processor wouldn't be able to branch predict with such an array.
>>
>>60697393

hi /g/. I'm new to programming. I am currently trying to learn Java from Michael Fudge from jewtube.

I'd love to hear if you have some material that'd be useful during my studies.
>>
>>60698711
Lets say you want to do x if val == 0 and y if val == 1
You write two functions, one that does x and one that does y
You make an array of their pointers, lets call it arr
Now you can just go arr[val]() without wasting memory on if clauses
>>
>>60698322
tried this.
code is fucked.

there is such a thing as oversimplifying code.
>>
>>60698322
Dont use switch case
Use functionpointers in an array
>>
>>60698749
Let's say I want to do x if val < 0 and y if val > 0.
>>
>>60698610
>>60698635
i take that comment back.
With those streamlining skills the application will likely never work.
>>
>>60698749
>>60698779
So basically, what you meant to say is
>>using switch case instead of using an array of function pointers
because >>60698785
>>
>>60698744
what do you know so far?
>>
>>60698079
>Most CS students I see, meet and met know jack shit nor burn with enough passion for development to amount to a real developer.
how the fuck can anyone live and breathe programming? i mean its not bad as a job, i certainly dont hate it, but in my spare time ive got other shit i want to do more for the most part.
>>
>>60698785
I will just assume val is a signed 8 Bit Integer
You would have to have a function pointer array of length 256, the 1-127 indexes point to y, 128 - 255 point to x, 0 is undefined
Then you acces that array by
arr[(uint8_t)val]()
>>
>>60698744
give me time and i will write an exemplary omniscript.
>>
this is final product.
as streamlined as it can get without being broken:
package Math;
import java.util.Random;
import java.util.Scanner;

public class Math_Master {
public static void main(String[] args) {
//RNG
Random r = new Random();

//set random operator selector
int op = r.nextInt(3);
//random integer values
int a, b;

//Scanner
Scanner s = new Scanner(System.in);

//user input
int I;

//Universal Operator
int result;
//Operator Name
String type;

//score
//int right = 0;
//int wrong = 0;

//integer variable range
System.out.println("please input numerical range:");
int range = s.nextInt();

for (int t = 1; t != 10; t++){
a = r.nextInt(range);
b = r.nextInt(range);
I = s.nextInt();
switch (op) {
//addition
case 0:
result = a + b;
type = " + ";
System.out.println(a + type + b + "=");
System.out.println( (I == result ? "correct" : "incorrect.\nThe correct answer was: " + result));
break;
//subtraction
case 1:
result = a - b;
type = " - ";
System.out.println(a + type + b + "=");
System.out.println( (I == result ? "correct" : "incorrect.\nThe correct answer was: " + result));
break;
//division
case 2:
result = a / b;
type = " / ";
System.out.println(a + type + b + "=");
System.out.println( (I == result ? "correct" : "incorrect.\nThe correct answer was: " + result));
break;
//multiplication
case 3:
result = a * b;
type = " * ";
System.out.println(a + type + b + "=");
System.out.println( (I == result ? "correct" : "incorrect.\nThe correct answer was: " + result));
break;
//error message
default:
System.out.println("programming is fucked");
}
}
}
}
>>
>>60698832
And I will just use conditionals instead.
>>
>>60698877
Fine Pajeet, do what you want
>>
>>60698585
Aren't you asking for input before you ask the question? Try to ask for user input after the switch statement
>>
>>60698887
No, you are Pajeet.
>>
>>60698899
what are you, retarded?
I need to define integers, input, result, etc BEFORE i print the text asking for input. If i do it the other way around then the code is fucked.
>>
>>60698861
You can improve it further. If you going to use a type variable, put the print statements after the switch statements. Not everything has to be inside it.
>>
>>60698887
Not him, but comment on >>60698715. Is it worth stalling your entire pipeline only for... what exactly?
>>
>>60698899
plus the variation of the a, b type, and result variables are case dependent, if i request them outside of the case then their values will be undefined/ambiguous.
>>
>>60698956
memes
>>
File: dlang_chan.jpg (139KB, 470x545px) Image search: [Google]
dlang_chan.jpg
139KB, 470x545px
>Features
https://dlang.org/comparison.html
>Standard library
https://dlang.org/phobos/index.html
>Package manager
https://code.dlang.org
>GC
https://dlang.org/spec/garbage.html
https://dlang.org/blog/2017/03/20/dont-fear-the-reaper/
https://dlang.org/blog/2017/04/28/automem-hands-free-raii-for-d/
>Books
https://wiki.dlang.org/Books

>>60697393
Missing /prog/.
Please give it back to us, Hiro. I'll suck your tiny nip micro-dick if you do.
>>
>>60698945
tried that but the code stops working when i do.
I figure that the values of the variables are dependent on the case, and therefore cannot be called outside of it.
>>
What are some good resources if I need to learn Python but only the very basics and nothing advanced?
>>
>>60698861
you ask for input before displaying the problem?
>>
>>60698822
At this point in time, I'm trying to wrap my head around projects that includes multiple classes. I'm declaring variables before the main method, and constructing methods that return these variables. Then I'm calling them from the main class to edit the parameters as I please.

I hope that gives you a hint. I've created a program that can detect palindromes (wow), and some slightly more advanced stuff. But nothing extraordinary yet.

>>60698841
Really?
>>
>>60698977
I want to cuddle with Dlang-chan.
>>
>>60699000
nice tripple digits

if you are reffering to the "please input range" value, then i can delete that and have a fixed range for the integers a and b.
>>
File: chinatsu_8.jpg (86KB, 467x397px) Image search: [Google]
chinatsu_8.jpg
86KB, 467x397px
>>60699022
>>
>>60698744
Do that course http://mooc.fi/courses/2013/programming-part-1/
It's actually good anbd not some yt meme
>>
>>60698938
Just trying to understand your code without compiling it, no need to get so fucking hostile.

You have already defined the user input, put it at the end of the switch statement, aswell as all of the print statements.
>>
>>60699003
>pallindrome detector
thats quite impressive. I haven't gotten there yet because im still a beginner

>Really?
sure why not?
It will be very basic though, so don't expect a comprehensive code demo or anything advanced.
>>
>>60698832
>a function pointer array of length 256
>somehow better than 'if then'
what are you optimising for again?
>>
File: cycle_costs.png (119KB, 2400x2000px) Image search: [Google]
cycle_costs.png
119KB, 2400x2000px
Some info to take advantage of when you do micro-optimizations in your system language of choice.
>>
>>60699043
>ou have already defined the user input, put it at the end of the switch statement,
if the input is the I integer, then putting it at the end of the switch statement would be moronic, as the program would not know what the input is. Input needs to be defined prior to input being input, elsewise the input wont read as input.
Like i said earlier, it is case sensitive.

Apologies for the hostility but asking me ot define an integer after it has been requested is like asking me to melt nails before i put them into wood.
>>
>>60698938
I believe this should work. Haven't touched java in awhile


package Math;
import java.util.Random;
import java.util.Scanner;

public class Math_Master {
public static void main(String[] args) {
//RNG
Random r = new Random();

//set random operator selector
int op = r.nextInt(3);
//random integer values
int a, b;

//Scanner
Scanner s = new Scanner(System.in);

//user input
int I;

//Universal Operator
int result;
//Operator Name
String type;

//score
//int right = 0;
//int wrong = 0;

//integer variable range
System.out.println("please input numerical range:");
int range = s.nextInt();

for (int t = 1; t != 10; t++){
a = r.nextInt(range);
b = r.nextInt(range);
switch (op) {
//addition
case 0:
result = a + b;
type = " + ";
break;
//subtraction
case 1:
result = a - b;
type = " - ";
break;
//division
case 2:
result = a / b;
type = " / ";
break;
//multiplication
case 3:
result = a * b;
type = " * ";
break;
//error message
default:
System.out.println("programming is fucked");
}
System.out.println(a + type + b + "=");

I = s.nextInt();

System.out.println( (I == result ? "correct" : "incorrect.\nThe correct answer was: " + result));
}
}
}
>>
File: Linus_Torvalds.jpg (245KB, 600x819px) Image search: [Google]
Linus_Torvalds.jpg
245KB, 600x819px
>>60697393
Reminder: This is the ideal male body. You may not like it, but this is what peak performance looks like.
>>
>>60699109
this is exactly the code i had when it broke.
Try compiling and running, see what happens.
>>
>>60699114
>tfw not finn ubermensch
>>
File: ideal male.png (203KB, 816x639px) Image search: [Google]
ideal male.png
203KB, 816x639px
>>60699114
>>
>>60699060
Thanks man! I'm programming Java atm., you should definitely check out Michael Fudge on youtube, he's a pretty neat and long introduction to Java. He even created 20 tasks for the student to complete alongside his videos. Each task containing different projects and 1 debug task
>>
>>60699144
whats the error you bongo, i bet its something like 'type is undefined', its because string is nullable when you declare it you have to use String type = ""; just to keep the oracle jews happy
>>
Speaking about Linux, can anyone explain systemd controversy really simple? I know it's not programming related per se but I feel like programmers should be better at explaining it
>>
fun with haskell
data Person 
= Person
{ name :: String
, age :: Int
} deriving (Show, Eq)

ruby = Person "Ruby" 13
anon = Person "Anon" 21

people = [anon, Person "Jenny" 34, Person "Andy" 56, ruby]

find n = listToMaybe (filter (\p -> name p == n) people)

converse p = do
if p == ruby
then putStrLn "You leave this figure in the corner."
else do
let n = name p
putStrLn ("You: Hello, " ++ n ++ "!")
putStrLn (n ++ ": Hello! Long time no see. How are the kids?")
putStrLn ("You: Great, thanks! Good talking to you. Goodbye.")
putStrLn (n ++ ": Goodbye.")

meet name = maybe (putStrLn "No one here by that name") converse (find name)


Output:
Ok, modules loaded: Main.
*Main> meet "John"
No one here by that name
*Main> meet "Jenny"
You: Hello, Jenny!
Jenny: Hello! Long time no see. How are the kids?
You: Great, thanks! Good talking to you. Goodbye.
Jenny: Goodbye.
*Main> meet "Ruby"
You leave this figure in the corner.
>>
>>60697438
TRASHKELL!!
>>
>>60699200
I have rethought such an idea.
You know how integers and strings work, you likely already know how a switch statement works, how to produce loops and conditional statements (if-else). you also likely know how to etect user input and generate random numbers, as well as call on objects in a library, etc.

Correct me if i am wrong, but if you do know all this then you will learn nothing from my demo.

that, plus i don't know how to export it so i would just have to copy-pasta it here.
>>
>>60699241
Why is haskell so fucking unnatural to read
>>
>>60699208
>type is undefined
nope.

I tried anon's exemplary code that used:
String type = "";
>>
>>60698463
It's a bit more binary than that.
>>
>>60699300
Because it is academic garbage.
>>
>>60699300
because you're used to C
>>
>>60699300
It's not meant to be used
>>
>>60698577
In computer science both exist.
>Zero values are finite values with significand 0. These are signed zeros, the sign bit specifies if a zero is +0 (positive zero) or −0 (negative zero).
>>
>>60699306
>variable type might have not been initialized.
You never defined it you knob.

Literally all you have to do is initalize them to their base case.

        //user input
int I = 0;
//Universal Operator
int result =0;
//Operator Name
String type = "";
>>
>>60699308
No, because zero is neither positive nor negative.

>>60699350
Whom are you quoting?
>>
>>60699306
how about you answer the question then, im not installing jde just to see what error the compiler shits out
>>
>>60699387
Wikipedia
>>
>>60699300
you really cant read that anon? I think its fairly straightforward.
>>
>>60699399

Considering I needed to download it, I did. Here's the problem>>60699385
>>
>>60699387
It depends on the context, in French mathematics, its generally considered both, so there is no actual standard. Blindly inferring your own opinion is stupid.
>>
>>60699284
Actually your intuition is correct. But I wouldn't mind if you share your hard work anyway!
>>
>>60699442
good work, we have successfully made his homework look slightly better
>>
>>60699442
so i was right to say that doing this was a horrible idea?
>>
>>60699241
new!
findAnd action name = maybe (putStrLn "No one here by that name.") action (find name)


*Main> findAnd kiss "Jenny"
You plant a fat kiss on Jenny's lips. Jenny blushes heavily. I think Jenny likes you!
*Main> findAnd kiss "Ruby"
You refuse to do that.
>>
>>60699481
sure i got nothing else anyways.
btw, a great book for learning would be "Sams Teach Yourself Java".
>>
>>60699491
someone who cant read a basic fucking error message trying to learn programming is the only horrible idea here
>>
>>60699492
>You refuse to do that.
Why, you don't want to kiss a boy (girl (boy (girl)))? How transphobic of you, anon!
>>
>>60699491
>>60699526
Literally googling the problem would have solved it for you.

Just Remember
>/g/ is NOT your personal tech support team
>>
Rewriting my type checker using a more ENTERPRISE design.
>>
>>60698995
Bumping. I can look up stuff myself if I need to but just wanted to know if one book/site/whatever really stands out.
>>
>>60699628
http://tdc-www.harvard.edu/Python.pdf
>>
>>60699527
oh gosh I'm so sorry!
data Person 
= Person
{ name :: String
, age :: Int
, gender :: Gender
} deriving (Show, Eq)

data Gender = Boy Gender | Girl Gender | Trans Gender | End deriving (Show, Eq)

boy = Boy End
girl = Girl End

ruby = Person "Ruby" 13 (Boy (Girl (Boy (girl))))
anon = Person "Anon" 21 boy
>>
File: 1465267537944.png (286KB, 576x720px) Image search: [Google]
1465267537944.png
286KB, 576x720px
>>60699671
Marvelous. Simply marvelous.
>>
>>60699526
:^)

passive aggression aside, it would seem that i was right in the assumption that one cannot express variables in the way you guys have described, as variables must be called inside the same block.
>>
>>60697518
>35k starting
yeah, maybe in Montana. even the shittiest of shit enterprise Java jobs in ~95% of the US pay at least 50k
>>
>>60699671
oh god that is the ugliest fucking formatting jesus

data Person = Person {
name :: String,
age :: Int,
gender :: Gender
} deriving (Show, Eq)
>>
Is C++ readable in the current year?
>>
>spend 30 minutes tracking bug in python
>it's something an evenly remotely mediocre type system would have prevented

I can't wait for a good language to show up
>>
>>60699863
Depends who's writing.
>>
Why people continue to use C++, even after D and Rust have established themselves, is beyond me.
>>
>>60699877
you must be not the sharpest type then.
>>
>>60699877
>D and Rust have established themselves
Well memed.
>>
>>60699877
Rust and C++ are both ugly and counter-intuitive. D is fine for desktop applications, people don't use D because they don't know about.

C++ has 0 use cases over C and Rust
>>
>>60699948
I'm gonna sound like a Rust shill but here goes:
the syntax grows on your after a while. I find it to be quite aesthetically pleasing now actually.
>>
>>60699877
>"but guys, this language is so much better than all the other languages, why is nobody using it?!"
people who dont understand the context surrounding established programming languages make me laugh.
the best thing you can do these days is trying to meme a language into the industry (i.e. Go) or make it appear pleasing to normies (JavaScript).
>>
So are these threads mostly like /v/ flame wars but with companies/consoles replaced with programming languages?
>>
>>60699979
>being this new
>>
>>60699963
Yeah, Rust is not as bad as the abomination that is C++. However, Rust is even more complex than C++ is. I'm pretty sure Rust will take over C++ in the next 20 years
>>
>>60699979
This thread is not about programming.
>>
>>60699481
here it is:
package Demo_Pair;


//this class defined the values of variables or
public class strings_and_integers { //the class is public (meaning it can be accessed by other classes)
public static void main(String[] args){
//notice that variables are case sensitive. When calling a variable always spell exactly the same in all cases
int a; //an integer is your typical run-of-the-mill number can be as smal as -2.14 billion and as large as 2.14 billion
double b; //a double, acts like a float so i dont see its need
float c; // a floating point number, useful when dealing with integers that may have decimal values
long d; //longer integer, no clue what its practicak use is over int other than storing REALLY large numbers
short e;//shorter integer, no clue what its practical purpose is since it stores smaller range of integers
String A, B, C, D; //used to store a section of text, between a pair of double quotation marks ("")
char G; // used to store a single letter, between a pair of single quotation marks('')

}
a = 3; // integers should be within the same block (the space between the {}'s) when being defined.
}

//pretend secondary class:

public class values extends strings_and_integers{ // since this 'class' is calling on the previous class, everthing between the 1st and last {'s
// is carried over into this class from the previous class
a = 333;
b = 99.99;
c = 33.354;
d = 999666333000;
A = "Hello ";
B = "There ";
C = "Dear ";
D = "Anon";
a + b = c;
System.out.println(c);
a / b = c;
System.out.println(c);
a * d = d;
System.out.println(e);

System.out.println(A = B + C + D);
}
//calling classes from other classes is the equivalent of embeding information from them

//i am VERY new, this is to demonstrate some principles, not ot be utilized in an actual application
>>
>>60697393

> mfw a skid mentions Q_rsqrt
>>
File: banner.png (37KB, 892x272px) Image search: [Google]
banner.png
37KB, 892x272px
Working on my imageboard, 4kev.org
>>
>>60700088
Real nice anon
>>
>>60699483
its not homework btw. its recreational.
>>
File: 4You.png (29KB, 892x272px) Image search: [Google]
4You.png
29KB, 892x272px
>>60700088
4You
>>
just gonna leave this here:
https://www.youtube.com/watch?v=XqTg2buXS5o&index=14&list=PLFE2CE09D83EE3E28
>>
>>60700178
whats suppose to be wrong with that? Newboston is a good guy
>>
The absolute state of C++
>>
>>60700198
like i said, im just gonna leave that here.

Is that phrase supposed to be negative?
>>
>>60700100
Thank you very much
>>
>>60700232
The phrase itself isn't but in 4chan parlance it typically is. Some person from /v/ who hates video game produce x will say that and then post some tweet that supposed to show they're terrible.
>>
>>60697890
Forth was partially inspired by lisp. There are quotes from Chuck Moore about it
>>
>>60700315
kk
>>
>>60699650
Alright I'm stupid, which of these links should I follow to start writing things in.
>>
I'm trying to get back into shit, but turns out that VB died a pretty horrible death. What's the goto windows loser language these days?

> Inb4 smallbasic
>>
>>60699870
It already did.
>>
>>60700402
Probably C#.
>>
File: boss-baby[1].jpg (194KB, 640x427px) Image search: [Google]
boss-baby[1].jpg
194KB, 640x427px
I have no friends but I must tell someone

I have delayed my intro to sci development for too long.
Today, not only have I MADE a file purely from my own program, I can ALSO read from it and write to it again.

I'm basically a step away from writing my own emulator.
"No one man should have all this power" - Descartes

import random

def main():
print "This programs makes usernames"
print

first = raw_input("Enter first name: ")
last = raw_input("Enter last name: ")
rnumber = random.randint(0,100)
uname = first[0] + last[0:] + str(rnumber)

print "Your username is", uname

usernamefile = open("usernames.txt", 'r')
newusernamefile = open("usernames.txt", 'w')
data = usernamefile.read()
newusernamefile.write(data+'\n'+uname+'\n')

usernamefile.close()
newusernamefile.close()

main(


Why does it keep rewriting over my file? I'm trying to make it read my file, copy its contents, and write a new file with another line of new content.
>>
>have to use Java/Haskell for my programming class
>everything is horrible
>Prof is using the most retarded bitwise operationes in his examples

>different class appears where we use Python
>shit actually works
>list comprehensions, actually useful built in functiones, you can use variables
Jesus H. Christ, Python is literally the best of both worlds.
>>
>>60700476
Use 'a' for 'append' if you don't want over writing
open("usernames.txt", 'a')
>>
Okay so what do I use for python if I don't want to program in fucking notepad.
>>
>>60700498
You'll soon learn the error of your ways
>>60700567
emacs
>>
>>60700567
Any editor you like (atom, vim, emacs, sublime...), also there's a JetBrains IDE (PyCharm i think) and you could also use the idle you can download, if you wanted to.
>>
>>60700567
an IDE.
>>
>>60700476
>Why does it keep rewriting over my file?
docs.python.org/2/tutorial/inputoutput.html#reading-and-writing-files

From the docs
>mode can be 'r' when the file will only be read, 'w' for only writing (an existing file with the same name will be erased), and 'a' opens the file for appending; any data written to the file is automatically added to the end
Using 'w' overwrites the file. Use 'a' instead (and you can skip copying the entire file each time you run the program)

Some improvements
#uname = first[0] + last[0:] + str(rnumber)
# last[0:] is literally just last. No need to use slicing
uname = first[0] + last + str(rnumber)

# Using the 'a' mode to append.
usernamefile = open("usernames.txt", 'a')
usernamefile.write(uname+'\n')
usernamefile.close()
>>
Why are (((they))) so insistent on flooding threads like this all over the internet with tranny shit? What's their agenda? To drive people away from programming so they can import more Pajeets?
>>
>>60700736
Anime is a liberal propaganda to (secretly) push homosexuality
>>
>>60700736
>(((they)))
Of whom are you referring?
>>
>>60700536
>>60700656
absolute madmen
my book mentioned appends but it was regarding lists, I didn't know the file operator had it

now I can make an entire LIST of usernames
brb hacking Google
>>
>>60700766
(((them)))
>>
>>60700777
Good luck
>>
File: deeppepe.png (126KB, 256x256px) Image search: [Google]
deeppepe.png
126KB, 256x256px
Sorry if this is a dumb question, but are smart pointers worth using in C++? The implementation seems like a fucking mess and raw pointers are v comfy.
>>
>>60700850
If you're working on a team, then yes.

If you're working solo, then who the fuck cares? Are you going to fire yourself?
>>
>>60700766
To whom*
>>
>>60700862
>Are you going to fire yourself?
One time I had to fire myself after I walked in on myself masturbating in the bathroom while I was supposed to be working. Really no other option at that point.
>>
I'm the guy from the previous thread dealing with the Fire Emblem tool in Java. One of the lines of code is a Pattern that looks like this:
    private static final Pattern ENTER_PATTERN = Pattern.compile(
// Match Name
"\\$Wm([^\\|]+)\\|" +
// Match Position
"(\\d)" +
// Match Wait
"(?:\\$w0)?" +
// Match Previous Name
"(?:\\|(?:\\$Ws\\1\\|)?" +
// Match Emotions
"\\$Wa\\$E([^\\|\r\n]+))?\\|?");

I'm assuming this:
(?:\\$w0)?
means it's searching for:
$w0
I need it to search for:
$w(multiple digits of numbers instead of just one 0)
What exactly do I need to accomplish this?
>>
Alright guys so the ibternet tech comes in tomorrow. Starting tomorrow I have 300mbps and want to have a little projevt going in and out of my room's network to other computers like a hub with a centralized system for reading it.

Imagine your cs pro older cousins laptop had a hd with it and that this hd had every file he ever worked on with notes for every little step, some made by bim, some made by others reading the files like yourself and classmates.

Now imagine a server like that. Just a filesystem and storage space. None if it to be kept in place without a reason and none of it to kept ubcommented for a reason less than ignorance. And with that and only that set in mind, we contribute

It'll be tons of garbage bit maybe someine can get that garbage to someone that can make soneyhing useful out of it and it becomes a reason to keep it there.
>>
>>60701046
Whatever the case i need a sense ofbcommunity if im going to get amyghing done so youre all welcome to fuck up the coming server or try to. I will be unplugging it and going to through the files as often as I can. I just kinda prefer the option ofbmaking a hub rather than another honeypot for the boards.
>>
>>60700208
Literally every modern language does name mangling dumbass
>>
is it weird to like perl
>>
>>60697450
Did this a few weeks ago to run some tests on stuff. The actual Huffman part isn't too bad. It's the accessing and messing with bits part that will get ya.
>>
is converting a tree to a list and then building an AVL tree from it a valid solution to the problem of balancing a binary search tree?
>>
>>60701069
I could also host all kinds game shit and movie sit down things that you'd have to hack in or complete a code thing here to get access to. Questions, answers get in. I like that.
>>
>>60701143
We only have a problem with inconsistent name mangling. Which C++ has. And C++ only has it to support the useless and needlessly complex feature of ``function overloading". A well-designed language wouldn't need to mangle names in an inconsistent way.
>>
>>60701195
Try it and see
>>
>write Python script to gather emails from the gmail accounts I've gotten over the years
>run script
>google locks every single account for suspicious activity
brb killing myself
>>
>>60701143
Most don't do it in such a nonsensical way
>>
>>60701369
kek
tell google you were just testing a script, they'll probably unlock
>>
>want to make demoscenes in NES
>do research
>find ASM tutorials for NES
>start learning it a bit
>a bit later, do a little more research
>find that people are also making these in C
>looks a little easier(?)

Heh, should I continue learning it in asm or just restart it with C?

Though, most of the demos from the wiki show the source code in ASM
>>
How can I extract the contents of all http://www.learncpp.com/ in a single PDF file?

Any 1337 haxor wants to help me out?
>>
>>60701479
You can try using wget or HTTrack?
>>
>>60701476
asm is a good skill

pretty sure you have to use C as a high level assembler anyway if you're doing it for the NES
>>
>>60701511
Yes but I don't want to download the comment section :^(
>>
>>60701369
Why not just download them into a local email client?
>>
>>60701513
Yeah I guess I'll learn ASM first since I wanted to learn ASM and did not have to take the classes for it for some reason.

What do you mean by using C as a higher level assembler? What I'm doing at the moment is write code in demo.asm file and compiling it using ./nesasm demo.asm and getting a demo.nes.

The C -> nes compiler is called cc65 I think. I have it but I guess I'll try it out afterwards.

My goal is to make a simple logo display since the badge I got from LayerOne had a nes emulator and I want to put a logo on it hehe.

Although I still haven't figured out a lot of stuff, I have to read and try a lot of stuff.
>>
>>60701587
cc65 is nice

what i mean by high level assembler is that i don't think you can expect to use a C standard library (cc65 has one) for a NES demo
>>
>>60701630
also i believe cc65 implements the asm() function so i guess you could wrap some instructions in functions
>>
File: 1495147543587.png (6KB, 472x508px) Image search: [Google]
1495147543587.png
6KB, 472x508px
>he doesn't use a language with stack storage pools but rather uses inefficient reference counters for quick dynamic memory
>>
How would you multiply out something like
(1 + X + X^2 + X^3) (1 + X^2)
? I thought using an array with indices representing powers and elements consisting of coefficients would work, but apparently I'm incompetent.
>>
>>60701783
distributive law

or binomial theorem
>>
Is there a better way to do integer string concatenation in Python then just str(int)?
>>
>>60701894
"{}{}".format(some_str, some_int)
>>
>>60701678
oo, like write some asm inside of .c? I've seen that in some source codes, but doing that entirely might be kinda awkward, but I guess it can work.
>>
>>60701907
Do I just call this multiple times to add multiple strings and ints?
Like "You got " + this number " right and " + this other number " wrong"
>>
>>60701936
"You got {} right and {} wrong".format(num1, num2)
>>
>>60700850
dumb frogposter
>>
Java isn't real programming.
>>
I like programming, but I also like cyber security. any areas of cyber security where you have to program? Also, how does pay compare, between a senior software engineer and a senior security analyst?
>>
File: 1495942581000.png (58KB, 229x199px) Image search: [Google]
1495942581000.png
58KB, 229x199px
I like fucking vaginas, but I also like sucking and taking cock. any areas of cock-handling where you have to fuck vaginas? Also, how does the gayness compare, between a prominent vagina fucker and a captain of cock-fondling?
>>
>>60702154
>anime
fuck off aweebshit
>>
>>60702190
>Go to anime website
>Complain about anime
>>
>>60702213
>here
>we
>go
>again
>>
>>60702213
No, he's complaining about you being a shitposting faggot.
>>
>>60702285
>complains about shitposting
>starts shitposting
>>
So in java is there any better way to make sure people put in numbers when I ask for numbers than putting every single nextInt call inside a try catch loop for InputMismatchException?
>>
File: 432863103928.jpg (193KB, 960x720px) Image search: [Google]
432863103928.jpg
193KB, 960x720px
>>60702213
>be over the age of 12
>consumes anime
>>
>>60702317
hasNextInt
>>
>>60702213
anime is for children
>>
>>60702044

Programming isn't real programming
>>
[u][b][i]ANAL[/i][/b][/u] PROGRAMMING
>>
File: 1471675970044.png (26KB, 419x296px) Image search: [Google]
1471675970044.png
26KB, 419x296px
>>60697961
>>60698038
WHAT THE FUCK HAVE YOU DONE TO PICTURES OF MY WIFE?
>>
>>60702457
Spilled my semen all over them
>>
File: I love birds.jpg (57KB, 408x458px) Image search: [Google]
I love birds.jpg
57KB, 408x458px
What is the difference between a method and a function? Is java a decent language to write a roguelike in? I started off with C, but i've switched to learning Java because apparently OOP is all the rage, and also there's a much wider range of beginner resources for Java than C.
>>
>>60702896
OOP is hot garbage. Drop it as quickly as possible,
>>
>>60702896
OOP is trash
>>
File: ss+(2005-08-23+at+01.49.54).jpg (454KB, 1280x1024px) Image search: [Google]
ss+(2005-08-23+at+01.49.54).jpg
454KB, 1280x1024px
What should I do?
>>
>>60702896
>What is the difference between a method and a function? I
Depends on your language, google can help
>>
>>60702912
>>60702901
Idk, I'm a complete noob so I obviously can't speak with much authority, but based on my limited exposure, it seems OOP is useful in some situations, but it was a meme pushed onto the world as this ultimate end all be all solution for all programming ever, shoved down everyone's throat, and after hitting critical mass, resulted in a counter-push of people who completely hate OOP. Sort of like feminism.

Surely it has it's place? There's gotta be some virtue to it. I could see why it'd be useful in developing a roguelike, for example the player/enemies all have similar properties: they have a position on the map that moves around, HP/MP, they go up and down stairs, they
>>
>>60702896
>i've switched to learning Java because apparently OOP is all the rage
>all the rage
don't do this
>>
Serious question. What kind of jobs could you get with a masters in CS that you couldn't get with a Bachelors?
They don't offer EE or CE masters at my school and I'm graduating with a CE degree but thinking about going for a masters in a year or two in CS.
>>
>>60702960
Don't use the saying "all the rage" or don't do things because of trends? I mean that wasn't my ONLY reason for switching to Java. The other reason was that the state uni i'm planning on attending uses Java for the first year. I figured it'd help to have a head-start.
>>
>>60702996
>don't do things because of trends?
this
>>
>>60702694
That's hot, you should actually do that.
>>
>>60702896
OOP is a bona fide meme but C is NOT the solution. Imo just keep learning Java, its fine for a beginner and'll be good for a rougelike.
>>
so other than a few minor features, looks like I'm back to my original problem: type checking. I'm desperately trying to do anything I can before, might implement the module system tomorrow and clean up the remaining icky bits of the core compiler. probably gonna pick up the type parsing too before I even start thinking about actual inference
>>
>>60702896
>>60703109
kys tonight.
>>
>>60702954
Don't listen, they are just University students who think they are smart and cool for being contrarian. Object Orientated Programming can make software much easier to maintain and use it is just often implemented badly in languages and misused by programmers who don't know better. If you are new to programming the best language to use would probably be Python because it is relatively simple and doesn't really do much differently to other mainstream OOP languages. Then move to Java. Really, when it comes to language choice, it depends on what libraries you want to use as some languages have good libraries for some things than others, for instance Python has numpy and scipy which are good for scientific calculations, whilst Java has Android and Ruby has Rails. If you want to make a basic game you could learn Lua and use the LOVE game engine which is pretty basic and easy for beginners, but Lua is just a mind fuck of a language.
>>
>>60703145
This is the most pajeet-tier reply I've seen in these threads for a long time.
>>
>>60697393
Working on some shitty encryption software. I made a polyalphabetic cypher program in Python, but I'm a little scared to do something more ambitious.

Anyone have any good resources on setting up a stronger encryption? I'm going to try to do it in C, but building the GUI in it is intimidating.
>>
>>60703145
Thanks for the advice. I absolutely hated Python, though. I said I stared with C, but for the first few weeks I was actually using Python. If I hadn't switched to C, I think python would've made me quit altogether.

I know the syntax is super easy and all, but it just didn't feel right. I think Python is maybe better after you've already developed some baseline. There were too many ways to do things, it felt cluttered and while my code would work, it often felt so unorganized and ugly. I didn't understand why things were happening, C gave me a much better grasp of my code. When things worked I had a understanding of why. Python is too casual, I think. I know it's a useful language, and I would probably have a much greater appreciation for it now if I returned to it, but idk. Also I was not a fan of the forced control of whitespace at all.
>>
>>60702896
Did you notice yet that OOP is POO the other way around?
>>
File: handy_mami.jpg (306KB, 702x985px) Image search: [Google]
handy_mami.jpg
306KB, 702x985px
>>60702154
Men's rectum is homeomorphic to a vagina anyway so you can just imagine that you're fucking a vagina when you're fucking a man's anus.
>>
why does it feel like clojure is trying to do as much shit as it can differently, it's seriously annoying, it's like the special snowflake of lisps
>>
>>60699618
Oh god, please no.
>>
45 FUCKING YEARS OF COMPETING WITH C AND STILL (S T I L L) A HOT PILE OF GARBAGE
NO WONDER TRASH++ COULD NEVER SURPASS C
>>
>>60703145
>Lua is just a mind fuck of a language.
man I can't even tell what's bait anymore
Lua is literally the easiest shit, my friends were writing Roblox plugins with it when they were like 9 and I remember using it in like 20 other games around that same time.
there's literally not even anything to grasp about it, it's ridiculously simple and the implementation is tiny for a reason
>>
>>60703379
C++ is not a real language. It's just an addon pack of C with 3 standard libraries. Comes with double compilation time too.
>>
>>60703416
> never written anything in lua beyond basic arithmetic with an API handed to you on a plate
Lua is actually a mindfuck of a language http://notebook.kulchenko.com/programming/lua-good-different-bad-and-ugly-parts
This doesn't mean it's bad, but the deeper you look into it, the stranger things become.
>>
>>60703363
why does clojure feel like untyped java with parenthesis
>>
>>60697393
So if I go with just plain Java I'm destined to be a soul crushing legacy code maintainer for fortune 500 companies? Or is kotlin and Scala my ticket out?
>>
>>60703338
not at all. a rectum is homomorphic to a donut
a vagina is homomorphic to no vagnia
completely different
>>
File: smug47.png (554KB, 552x600px) Image search: [Google]
smug47.png
554KB, 552x600px
>>60703534
Shut up dummy and present your butt-vagina.
>>
>>60703560
not until you have at least a basic understanding of topology
>>
>>60703581
>says the one saying "homomorphic"
Keep your mouth shut, bitch.
>>
>>60703487
the only "mind fucks" are the table lengths and multiple return values. Lua is much more consistent than Python or Ruby, maybe even Java too
>>
>>60703593
"no"
>>
>>60698080
I'm not sure of the inner workings of the system, but at this point I'm 99% sure I can do nothing about this.

They probably sign all the requests so even getting the real fingerprint would be a hassle. That's the whole point of this verification system, and I was just hoping this system didn't exist.
>>
>>60700018
Keep on programming! You've already covered the basics + some more. Who's gonna stop you now?

>inb4 senior prog. memes
>>
On average, by how much would C++ increase compile times from using C if you wouldn't use any C++ features? Or would it at all.
>>
>>60703787
if you aren't using c++ features, why the fuck would you use c++?
>>
File: PHP-logo.svg.png (74KB, 1200x648px) Image search: [Google]
PHP-logo.svg.png
74KB, 1200x648px
Using PHP to get servers to download information and push it to a live site to create data graphs. Using world network traffic to the biggest data centers out there
>>
>>60703900
stockholm syndrome
>>
>>60703900
I'm just talking hypothetically because people always say C++ compiles much slower. Is it only slower for template heavy code, or close all in all on major compilers?
>>
>>60703145
Id like to argue with Perl. There's so much documentation and plus its SOOOO much more deployable on *nix machines, while python needs setup universally
>>
>>60703956
STL is template-heavy.
>>
>>60703956
Templates aren't very compiler friendly
>>
>>60703145
>Object Orientated Programming can make software much easier to maintain
>it is just often implemented badly in languages and misused by programmers who don't know better
And that's why it sucks.
Also python is fucking awful, and Java is a mess. You talk about bad OOP and yet present the language that's responsible for terrible design.
>>
>>60703968
if only C++ had real parametric polymorphism
>>
>>60704011
java and python are fine
you cant hate everything forever
thats not healthy
>>
>>60703416
I consider Lua a mind fuck because it so unconventional not necessarily because it is hard.
>>
>>60704058
But I don't hate everything, anon. Don't project; it's not healthy.
>>
>>60704125
tell me about your favorite language anon
>>
File: smug_ran2.png (495KB, 1000x1000px) Image search: [Google]
smug_ran2.png
495KB, 1000x1000px
>>60704058
>java and python are fine
>>
Here's a python thing thats throwing me a bunch. As a random example take this
test = "abcdefghijklmnopqrstuvwxyz"
print("This is the alphabet: " + test)
value = int(input("What letter from the alphabet do you want?"))
test = test[value-1, value]
print(test)

Trying to use int's by their variable name always makes them throw a hissy fit. What stupid mistake am I making?
>>
>>60704011
Did I say that Python and Java were good design? I just said that it is better to learn python because it is simpler and doesn't do anything out of the ordinary compare to some other languages.
>>
>>60704170
it has FP and types and 2d and
>>
>>60704175
your heart is filled with hate
why?
>>
>>60704170
also is pure
>>
>>60704230
>>60704217
haskell!
>>
File: smug_ran1.jpg (180KB, 1732x1593px) Image search: [Google]
smug_ran1.jpg
180KB, 1732x1593px
>>60704222
The only thing in my heart is smug.
>>
File: 1494554821609.gif (442KB, 400x425px) Image search: [Google]
1494554821609.gif
442KB, 400x425px
>>60704236
>>
>>60704237
why?
>>
trying to gradually learn c.

working on a prime factorization program. yes, its probably quite easy to most of you, but i want to try w/o stackexchange.
>>
File: awkward_programming_neet.jpg (164KB, 620x500px) Image search: [Google]
awkward_programming_neet.jpg
164KB, 620x500px
Write a program that can sum all the primes less than 2000000. Only 5% of /g/ will be able to answer this.
>>
what is a good book for python 3?
>>
>>60704299
Ruby

require 'prime'

puts Prime.each(2000000).inject :+


Lua

function primes(max)
local primes = {}
local sieve = {}
local i = 0

for i = 2, max do
sieve[i] = true
end

for prime = 2, max do
if sieve[prime] then
table.insert(primes, prime)
for i = prime * 2, max, prime do
sieve[i] = false
end
end
end

sieve = nil
return function ()
i = i + 1
return primes[i]
end
end


sum = 0

for i in primes(2000000) do
sum = sum + i
end
print(sum)
>>
>>60704237
>being able to use your tails as a comfy chair
I want to be Ran-sama!
>>
File: asuna.jpg (855KB, 1080x1920px) Image search: [Google]
asuna.jpg
855KB, 1080x1920px
>>60704310
"Programming Ruby 1.9 & 2.0" by Dave Thomas.
>>
>>60704299
haskell!
import Data.Numbers.Primes (primes) 

main = print (sum (takeWhile (< 20000) primes))
>>
>>60704299
import Data.Numbers.Primes (primes)
main = (print . sum . takeWhile (<2000000)) primes
>>
>>60704341
Quite weird to wish to be another man's wife anon, but I can see where you're coming from. My wife Ran is an amazing fox-thing.
>>
>>60704345
that's not python, anon
>>
File: 1494309169535.png (425KB, 589x564px) Image search: [Google]
1494309169535.png
425KB, 589x564px
>>60704364
>>60704367
haskellmind tbdesu
>>
>>60704364
ooops, I need a few more zeros
>>60704367
;)
>>
>>60704369
The truth, anon, is that I want to be you husband.
>>
File: test.png (2MB, 850x1202px) Image search: [Google]
test.png
2MB, 850x1202px
>>60704369
>>60704452
>>
>>60704369

Your waifu is not real, Anon.
>>
>>60697438
There are C tards that think C's speed will make up for their O(n^2) code

And there are shitkell faggots who think they can write anything other than O(n^n)
>>
>>60704472

There are "programmers" who believe it is acceptable not to understand basic category theory.
>>
>>60704490
there are tripfags who should kill themselves instead of attentionwhoring on an anonymous anime forum
>>
>>60704472
kek
>>
>>60704367
>4 times slower than python
can't make this shit up
>>
>>60704500
She's (he's (she's (he's (she's (he's))))) been at it so long that tell her (him (her (him (her (him))))) this will do nothing.
>>
>>60704522
I can count primes faster than a typocal haskell program
>>
>>60704522
Did you compile it with optimisations and restrict the type to a Word64?
>>
>>60700232
yes its mostly seen as a negative
>>
File: Screenshot_20170601_220346.png (47KB, 1200x841px) Image search: [Google]
Screenshot_20170601_220346.png
47KB, 1200x841px
r8 my text editor
>>
File: ran_tewi_wink.png (82KB, 350x238px) Image search: [Google]
ran_tewi_wink.png
82KB, 350x238px
>>60704299
>construct free primon gas
>find Feynman path integral of said primon gas
>set UV cut-off at 2000000
>functional integrate
>the trace quantum action is the sum over primes p of ln(p) up to 2000000
>take exponential
>???
>profit
No mention of modulo or sieving was used.
>>
>>60704625
Make it full screen. Also, is the constant switching between mouse and keyboard annoying?
>>
>>60704181
Please. My only expierence with python was 8 years ago at this point.
>>
New thread
>>60704655
>>60704655
>>60704655
>>
>>60704649
A little bit, but the ability to work with so many files and resize the views so quickly and easy makes editing with vim annoying now. Even if I'm using i3.
>>
File: 1478239191584.png (157KB, 640x797px) Image search: [Google]
1478239191584.png
157KB, 640x797px
>>60704666
Begone Satan
>>
>>60704671
>>60704649
Plus, the mouse adds so much context. If you're working with two projects, a build command in the bar of a file in that project builds it. When your builds get errors, middle clicking them jumps into that file and line and line instantly. It just works out as a faster smoother process. It's not for everyone though, not without syntax highlighting and completion and other fun bits. File lines too maybe, but jumping to files kinda makes that irrelevant
>>
>>60704653
Use : instead of , in your array slice.
>>
>>60703532
I'd also like to know more about this.
>>
>>60704255
>probably quite easy to most of you
Depends. What algorithm are you implementing?
(If you know the math any problem is trivial.)
>>
>>60704490
I already think set theory is superfluous. I won't even start with categories.
>>
>>60706024
Set theory is complete trash though, unlike category theory (which is only slightly trash).
Thread posts: 351
Thread images: 44


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