[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: 325
Thread images: 40

File: dpt before after.jpg (206KB, 700x671px) Image search: [Google]
dpt before after.jpg
206KB, 700x671px
old thread: >>62042734

What are you working on, /g/?
>>
First for shitposting
>>
Second for shitposting
>>
>>62050247
waiting for jenkins as usual
>>
>>62050284
who's jenkins?
>>
Real thread: >>62050258
>>
>>62050295
the servant
he takes your source code and turns that into binaries
>>
File: javascript negative zero.png (20KB, 438x637px) Image search: [Google]
javascript negative zero.png
20KB, 438x637px
Defend this.
>>
File: DA1cMgEV0AE9Myg.jpg (131KB, 850x1200px) Image search: [Google]
DA1cMgEV0AE9Myg.jpg
131KB, 850x1200px
>>62050295
piece of shit pile of Java building, testing and deploying code
>>
>>62050423
I wouldn't want to deal with the 15 different zero-like JavaScript values can be myself. This might actually be useful to a degree. Honestly it depends how well it behaves. Knowing close to nothing about JS, I suspect just (===) might not be enough to deal with things here.
>>
>>62050488
Nah, all it does is:
x => Object.is(x, -0);
>>
File: 1503268769266.jpg (9KB, 201x201px) Image search: [Google]
1503268769266.jpg
9KB, 201x201px
>>62050423
...what? What the actual FUCK? I need some help here, WHAT THE FUCK IS A -0?
>>
>>62050558
dude floats lmao
>>
>>62050558
10 as opposed to 00
>>
>>62050423
What the fuck is a -0?
>>
>>62050558
>>62050583
niggers what are you doing in /dpt/
>>
>>62050583
JavaScript: Not even once.
>>
>>62050247
>What are you working on, /g/?
Developing an IA to play cards with me...
>>
>>62050247
Reading scip
yesterday I found a page with nicer typesetting and graphics, than the mit site
https://sarabander.github.io/sicp/html/index.xhtml
>>
File: 1488476583131.png (4KB, 183x275px) Image search: [Google]
1488476583131.png
4KB, 183x275px
>>62050626
>an IA to play cards
>IA
>>
>>62050583
dunno what's it's purpose in js, but in maths
-0 an +0 are used with limits
>>
>>62050696
It's the same thing in programming. The floating point standard is the way it is to allow for stuff like calculating whether something evaluates to infinity or negative infinity.
>>
>>62050800
>infinity
what could possibly evaluate to infinity in programming, unless it's symbolic maths, which I doubt js is used for
>>
>>62050695
Probably French. Intelligence Artificielle.
>>
>>62050696
not as different numbers though
-0 just means you're approaching 0 from the left
it's exactly the same as approaching any number from the left, including positive numbers (although -+1 is obviously not the preferred notation)
>>
>>62050843
Doubles do it, that's all that matters.
>>
>>62050869
Wouldn't French AI just fold every time though ;^)


sorry
>>
>>62050247
I hope you are all competent in Scheme.

If not, you really shouldn't be posting here.
>>
>>62050843
It's mostly stuff in math.h. inverse, atan2m1, signbit_d, etc. In 98% of circumstances it doesn't matter and they'll be equivalent automatically, but when you're doing something that can use it, the functionality is there.
>>
How come when I capture a string by reference in lambda capture list in C++ instead I get the pointer as if it was getting the address with &?
>>
>>62050882
I know

>>62050897
I see, I never met with this in c or cpp
>>
PROCEDURE DoIt() : LONGREAL;
VAR
tmp: LONGREAL;
BEGIN
(* begin argument reduction *)
IF t < 2.4375 THEN
(* truncate 4(t+1/16) to integer for branching *)
k := Trunc(4.0 * (t + 0.0625));
CASE k OF
| 0, 1: (* t is in [0, 7/16] *)
IF t < small THEN
tmp := big + small; (* raise inexact flag *)
IF signx > 0.0 THEN
RETURN CopySign(t, signy)
ELSE
RETURN CopySign(PI - t, signy)
END;
END;
hi := 0.0; lo := 0.0;
| 2: (* t is in [7/16, 11/16] *)
hi := athfhi; lo := athflo;
z := x + x;
t := ((y + y) - x) / (z + y);
| 3, 4: (* t is in [11/16, 19/16] *)
hi := PIo4; lo := 0.0;
t := (y - x) / (x + y);
ELSE (* t is in [19/16, 39/16] *)
hi := at1fhi; lo := at1flo;
z := y - x; y := y + y + y; t := x + x;
t := ((z + z) - x) / (t + y);
END;
ELSE
hi := PIo2; lo := 0.0;

IF t <= big THEN
(* t is in [2.4375, big] *)
t := - x / y;
ELSE
(* t is in [big, INF] *)
tmp := big + small; (* raise inexact flag *)
t := 0.0;
END;
END;

(* compute atan(t) for t in [-.4375, .4375] *)
z := t * t;
z := t*(z*(a1+z*(a2+z*(a3+z*(a4+z*(a5+z*(a6+z*(a7+z*(a8+
z*(a9+z*(a10+z*a11)))))))))));
z := lo - z; z := z + t; z := z + hi;

IF signx > 0.0 THEN
RETURN CopySign(z, signy)
ELSE
RETURN CopySign(PI - z, signy)
END;
END DoIt;
>>
>>62050899
>draw a girl
>call it a boy
>>
>>62050935
It's also in C or C++. It's in the IEEE754 standard which like every modern CPU uses.
>>
>>62050959
isn't it great
>>
>>62050959
>attracted to a boy
>say it was drawn a girl
>>
>>62050974
>>62050899
>>62050247
>>>/lgbt/
>>
Why do so many hacks here feel the need to spam their homosexual fetish in a programming thread?
Can we start reporting them? This thread is becoming way too much like /v/.
>>
>>62050696
Yeah, but with limits AFAIK you only use that symbology to say "hey, the function is getting closer to 0 from the left". -0 is not a thing.

Not sure how it is in the rest of the world, but here we put the "-" on the right side if we're talking about limits in the point 0.

>>62050611
I've never touched JavaScript and you just gave me a good reason to keep it that way.
>>
>>62050899
I really wanna french kiss Saki's butthole
>>
>>62051020
>way too much like /v/.
how do you know?
>>
File: fml.png (5KB, 881x124px) Image search: [Google]
fml.png
5KB, 881x124px
fml desu senpai
>>
>looking for a way to define a generic in a generic
>wait!
>look up how to do higher kinded types in memelang
>not supported
baka haskell
now i'm spoiled with all kinds of fancy constructs i cannot use
>>
>>62051355
it only segfaults when -O2 is on? ..or are you really developing without -g?
>>
>>62051378
This is why you shouldn't use shit languages
>>
>>62051435
That's the price I have to pay for being a wage cuck.
>>
>>62051443
Can you get by without RankNTypes?
I probably can't desu
>>
>>62051355
gdb ./Tetris
run
>>
File: saki gets outed!.jpg (542KB, 1200x1729px) Image search: [Google]
saki gets outed!.jpg
542KB, 1200x1729px
>>62051465
I have never found an opportunity when GDB was actually useful.
Is it exclusively for verifying state in a much larger and undocumented program not written by you?

>>62051108
>>62050994
>>62050899
>>
>>62051465
>giving trade secrets to scrubs
Goldberg will see your account for this.
>>
File: index.jpg (8KB, 277x182px) Image search: [Google]
index.jpg
8KB, 277x182px
Are video codecs the state of the art in programming?

>download mp4 video x264
>500 MB

>download mp4 video x265
>131 MB
>same quality as x264
>>
>>62051454
You might as well be talking Chinese, but I fixed it like so:
private fun <T : Player<U>, U: Settings> something(player: T, settings: U, controls: Controls<T>) {}
>>
>>62051499
more like state of the art math and algorithms
>>
>>62051481
delet
>>
>>62051355
Shoud've used Rust, senpai.
>>
>>62051523
I'm not an SJW.
>>
>>62051506
In languages with runtime generics, you can treat generic functions and values as first class types.

RankNTypes allows you to quantify inside a type, rather than outside a type, allowing you to take polymorphic values as parameters, to store them in data types, etc.
>>
>>62051578
*segfaults*
>>
What would be an appropriate tattoo for a code artisan like myself?
>>
>>62051506
Why does Java put the type parameters before the method name rather than between the method name and parameter list?

Yes I'm aware it's not Java, but I'm not sure what language it really is.
>>
>>62051593
get the xor symbol on your shoulder
>>
>>62051593
Hello World on your knuckles
>>
>>62050945
jesus fucking christ absolutely disgusting
>>
>>62051593
Business Card Raytracer on the back of your skull
>>
>>62051621
Spotted the brainlet. Not the code's fault you're too stupid to understand it.
>>
Is it a bad idea to just do gcc ./code.c? Never bothered to memorize the arguments you're supposed to give it
>>
>>62051647
You don't need to, gcc --help
>>
>>62051631
you're right it's coder's fault
>>
>>62051647
gcc code.c && ./a.out
>>
>>62051582
AFAIK you cannot pass around generic class types.
>>62051598
You have to declare the type of the generic beforehand. It's Kotlin btw.
>>
>>62050247
Brainlet here. I have a C question:

Can someone tell me why, if I have a series of functions performing operations on a 2D array, that I should pass those functions a pointer to the array rather than the array itself?
>>
>>62051677
Because you cannot pass an array as a parameter in C.
>>
>>62051668
Yes, but is there anything wrong with doing that?
>>
>>62051677
imagine ordering something from amazon and sending them a copy of your house outside their warehouse so they can drop it on your porch
Then they send the whole house back and just drop it on top of your old house, replacing it.

A pointer is like an address.
They can make changes to the house (drop a package) without making needless copies of the data.
>>
>>62051677
You want it to operate on that specific 2D Array, right? If you don't send a pointer to that specific array, you're creating a new array with its values. Nothing is actually done to the array you want to be affected.
>>
>>62051669
That's a no brainer now, thanks.
>>
>go programmer quit
>now stuck maintaining a go server
ah fuck
>>
>>62051709
Go isn't that bad, is it?
>>
>>62051685
>>62051697
>>62051701

Thanks anons, one more question:

If I want the function to return an array (of a size I can compute with the original array), am I best supplying a "blank" array as an input or dynamically allocating memory for the output?

Apologies if this doesnt make sense, I am a Clet.
>>
>>62051709
But /dpt/ users call Golang the language for dummies, if you are clever, you must quickly get a grip.
>>
>>62051663
Coder did a fine job. Again, you're just too stupid to understand it.
>>
>>62051709
Luckily Go has no abstraction, so he couldn't fuck up that bad.
>>
>>62051731
>am I best supplying a "blank" array as an input
This is a common idiom, so do this.
>>
Why is inc an instruction? Why not just use add 1? It would decrease design complexity.
>>
>>62051733
Go is only useful for network shit.

the rest is boiler plate code for trivial tasks that could be accomplished with a couple lines in other sane language.
>>
>>62051765
because incrementing by one is a very common operation
>>
File: 1489947851725.jpg (43KB, 720x480px) Image search: [Google]
1489947851725.jpg
43KB, 720x480px
This is a humble reminder that learning how to develop your game from scratch (that is, not relaying in game engines such as unity and GMS) will take you closer to deploying a game and beat your competitors.

Because games and game development are so popular, and you are competing against other games for attention, it is in your interest to use more performant tools that allow you to program your game without cutting any feature or depending on closed software.

If you are interested in defeating your main oponents (those using game engines, like the ones listed in the op poster), here are some tips:

- Use efficient and performant programming languages, such as c++, rust or nim.
* cplusplus.com/doc/tutorial/
* doc.rust-lang.org/book/
* nim-by-example.github.io

- Learn algorithms:
* coursera.org/specializations/algorithms

- Learn maths and physics:
* khanacademy.org/math
* khanacademy.org/science/physics

- Learn how to get the most out of your cpu:
* dataorienteddesign.com/dodmain/
* learncpp.com/cpp-tutorial/79-the-stack-and-the-heap
* fgiesen.wordpress.com/2016/08/07/why-do-cpus-have-multiple-cache-levels/

- Learn how to do graphics:
* opengl-tutorial.org/beginners-tutorials/

Good luck.
>>
>>62051776
still, there's no use for it and it doesn't increase performance
>>
>idris programmer quit
>now stuck maintaining an idris server
ah fuck
>>
>>62051773
>the rest is boiler plate code for trivial tasks that could be accomplished with a couple lines in other sane language.
Could you provide an example?
>>
File: serial_experiments_lain_02[1].png (1MB, 1520x1080px) Image search: [Google]
serial_experiments_lain_02[1].png
1MB, 1520x1080px
>>62051793
At this point you might think that nothing of this applies to you. Please, reconsider it:

- Data-Oriented Design (Or Why You Might Be Shooting Yourself in The Foot With OOP)
gamesfromwithin.com/data-oriented-design

- Pitfalls of Object Oriented Programming
.slideshare.net/EmanWebDev/pitfalls-of-object-oriented-programminggcap09

- common OOP game engine development pitfalls
bounceapp.com/116414

- Three Big Lies
cellperformance.beyond3d.com/articles/2008/03/three-big-lies.html

Think about it in this way: understanding how your computer work might not secure you success, yet it gives you a huge advantage in this race.

You might say that the latest famous indie game done in unity didn't put any effort into engineering at all, but this is only illusory. You cannot see how many hours, days and months the developers behind successful unity (and GMS) games had to put to work around its inherent limitations.

You can say to yourself "I don't need anything else, i'll relay in my luck" or think wisely and increase the likelihood of being success by expending some time learning more about computers.
Everything depends on you.
>>
>>62051794
Depends on computer architecture.
>>
Does the C standard actually guarantee that the string-terminating character has an integer value of 0? I know nearly everything these days uses some superset of ASCII, but could an implementation using a character set where 0 means something else (lowercase a, for example) claim to be standard conforming? Would an implementation simply perform compile-time translation of zeroes in a character context into whatever the "null character" code is on that platform? (analogous to the null pointer translation performed on platforms where 0 is a valid memory address).
>>
>>62051773
go has pretty decent templating library for generating the boilerplate
>>
>>62051840
String-terminating character is NUL in ASCII
>>
>>62051808
excellent article already posted some threads ago

http://nomad.so/2015/03/why-gos-design-is-a-disservice-to-intelligent-programmers/

it's a short article you could read it in 5 minutes tops
>>
Reminder that if you're a beginner, you should start with Java.
>>
>>62051817
>cellperformance.beyond3d.com/articles/2008/03/three-big-lies.html
Broken link.

Also developing your own engine etc. adds a lot of development time, which greatly increases likely hood of never finishing game and therefore nodev
>>
>>62051731
In C, I would prefer the former.

Passing an "out" pointer is better in the sense that the function doesn't have to worry about memory allocation. The function only performs the task it needs to perform and memory management is delegated to the caller.

It will however still need to make sure that the given array is big enough in order to avoid buffer overflows.

Mallocating from inside the function and returning a pointer will give the caller an easier to use API, so there's that. It's easier to type int *result = your_function(); than it is to write int *array = malloc(size); your_function(array);

But either way, don' forget to free the memory afterwards.
>>
>>62051854
Right, and what if it would be a instead?
>>
>>62051889
>mallocing
muh vlas
>>
>>62051820
You could decrease processor design complexity by moving it to the chipset though
>>
in python, i want a for loop to modify the variables in the list it's iterating over, not to pass a copy. how do i do this?
>>
>>62051908
the string would end at the first instance of the character 'a' then
>>
>>62051794
A lot depends on the specifics of the hardware implementation, but on a platform with 8-bit opcodes and operands, for example, an inc instruction could be encoded in only 2 bytes (one for INC opcode, one for register/memory operand), or even just one if it implicitly operates on the 'A' register. Whereas a regular add instruction would require 3 bytes, as it needs source and destination operands. That would lead to overall smaller code sizes, meaning a greater chance of an entire function/loop fitting into the cache, which in turn would eliminate the instruction fetch overhead. Additionally, an inc instruction could be faster to execute than a regular add instruction, due to "shortcuts" at the hardware level. It's hard to specifically say what the difference between 'inc' and 'add 1' are, without knowing the specific architecture in depth, but it's probably safe to assume that if an inc is provided, it's a more efficient way of adding 1 than 'add 1' is.
>>
File: 5453.png (82KB, 837x811px) Image search: [Google]
5453.png
82KB, 837x811px
>>62051887
>Broken link.
You really need to use computers more before you post in this thread.
>>
>>62051858
>make C-like language
>complain how it's C-like
huh
>>
>>62051889
Thanks for the explanation
>>
>>62051923
That already happens. Everything's a reference type in Python.
>>
File: sdb nal.png (913B, 129x43px) Image search: [Google]
sdb nal.png
913B, 129x43px
Friendly reminder that we have an unofficial discord where we talk about programming and programming accessories:

https://discord.gg/D4KGgG
>>
>>62051911
>vlas

Good point, but you can't return them from functions at the risk of running into a dangling pointer.

>>62051950
You're welcome anon.
>>
>>62051923
this is an example of why i want to do this
def toParams(x):
x3=x2=x1=x0=False
for (variable,amount) in [(x3,8),(x2,4),(x1,2),(x0,0)]:
if x >= amount:
x -= amount
variable = True
return (x3,x2,x1,x0)
>>
>>62051984
Friendly reminder for shilling proprietary software you'll burn in hell.
>>
>>62051951
that's wrong though
>>
>>62051984
>discord
kys
>>
Support for C++ coroutines in Visual Studio is becoming less stable with every update.

Despite the fact that Visual Studio started to support coroutines in version 2015, every new release makes this support less stable. I'm talking about 32-bit release optimized builds.

First, last VS 2017 preview build (and subsequently, RTM) started to generate stack overflow exception for some coroutines. The recommended workaround from Gor Nishanov was to disable optimizations for affected functions. Unfortunately, this not always worked.

Latest version (15.3.1) almost always fails in optimized 32-bit release build. For example, throwing exception from coroutine results in "invalid exception frame" exception. When compiler calls return_value or set_exception for the promise type, it often passes garbage pointers to called functions.

For an example, take the following repository: https://github.com/AlexBAV/cors

It consists of a library and test project (complete solution file). Compiling and running this test project in Release x86 configuration will illustrate what I am describing in this post. 64-bit builds and non-optimized 32-bit build work correctly.

It looks like this feature is not tested enough. I would be glad to hear any response from VC developers regarding this topic.
>>
>>62050284
>Jenkins
It's weird that people don't get upset over these classist names.
>>
http://dlang.org/blog/2017/08/23/d-as-a-better-c/
>>
>>62051991
i did it with just appending True/False to a list so don't need it anyways
>>
>>62051873
Wrong. Java has too much boilerplate, and forces OOP on you before you've even learned the basics of imperative/structured programming.

>>62051911
vlas are
1) Only guaranteed to be present in C99 (C11 made them optional)
2) Not guaranteed to be any faster than malloc (they may in fact use malloc() and free() under the hood).
3) Local variables, meaning you can't safely return a pointer to a VLA from the function in which that VLA was declared. So you'd still need to do the allocation on the caller side, not the callee side.
>>
Thoughts on my calculator?

package calc;

import java.util.Scanner;

public class calculator {
public static void main(String args[]) {
Scanner input = new Scanner(System.in);
int function = 0;
int num1;
int num2;
int answear;

System.out.println("Pick a Function");
System.out.println("1. Addition");
System.out.println("2. Subtraction");
System.out.println("3. Multiplication");
System.out.println("4. Division");
System.out.print("Function: ");
function = input.nextInt();

if (function > 4 || function < 0) {
System.out.println("Sorry but that function doesn't exist");
}

switch(function) {
case 0:
break;

case 1:
System.out.print("Type in your first number: ");
num1 = input.nextInt();
System.out.print("Type in your second number: ");
num2 = input.nextInt();
answear = num1 + num2;
System.out.println("The Answear is " + answear + ".");
break;

case 2:
System.out.print("Type in your first number: ");
num1 = input.nextInt(); System.out.print("Type in your second number: ");
num2 = input.nextInt();
answear = num1 - num2;
System.out.println("The Answear is " + answear + ".");
break;

case 3:
System.out.print("Type in your first number: ");
num1 = input.nextInt();
System.out.print("Type in your second number: ");
num2 = input.nextInt();
answear = num1 * num2;
System.out.println("The Answear is " + answear + ".");
break;

case 4:
System.out.print("Type in your first number: ");
num1 = input.nextInt();
System.out.print("Type in your second number: ");
num2 = input.nextInt();
answear = num1 / num2;
System.out.println("The Answear is " + answear + ".");
break;
}
}
}
>>
File: Konachan.com_-_247540_sample.jpg (676KB, 1500x1061px) Image search: [Google]
Konachan.com_-_247540_sample.jpg
676KB, 1500x1061px
>>62051378
>tfw Haskell wagecuck

feels ok, I recommend you look for Haskell job on a side
>>
Is there some quick primer on safe C programming? Zeroing out arrays, proper string handling, etc?
>>
>>62052050
>C with modules
Pretty nice. This should be very thoroughly documented.
>>
>>62052019
>uses C++
>isn't performance constrained enough that coroutines are out of the question
You shouldn't be using sepples.
>>
>>62052050
So it's come to this
People are finally realising that D isn't very beneficial, and they are now using the C++ line
>>
>>62052070
Are you the guy I talked to yesterday(?) about being a consultant?
>>
>>62052050
Now I'm interested. I'm gonna have to check this out. Remind me when I get time anon.
>>
>>62052063
>Type in your first number: 1222222222222222

Exception in thread "main" java.util.InputMismatchException: For input string: "1222222222222222"
at java.util.Scanner.nextInt(Unknown Source)
at java.util.Scanner.nextInt(Unknown Source)
at lmao.main(A.java:30)


off to a good start pal
>>
>>62052063
poor bait
>>
>>62052112
Whats the problem?
>>
>>62052115
Okay, I'll bite
>not just parsing the input and deciding which expression(s) to use
>answear
>(function > 4 || function < 0)
>>
>>62052050
>flags[] = true; sets all the elements in flags to true in one go.

I can't believe I've been a D fanboy for years and I'm just finding out about this now.
>>
>>62052115
maybe you're a student and it's not bait. Also since you're always inputting two numbers, you could pull that part out of the switch to reduce the repetition a bit
>>
File: 1500371875501.png (503KB, 960x540px) Image search: [Google]
1500371875501.png
503KB, 960x540px
>>62051929
delete this filth right now
>>
>>62051753
that is disgusting sloppy shit code, looks like they wrote pre-obfuscated.

Readability is is one of the most important things while coding.

You can code the most basic sorting algorithms to be unreadable, it doesn't make basic sorting algorithms some how more profound or intelligent.

Why are you people such fucking niggers?
>>
>>62051731
The problem with passing in a pointer to a function is that it ruins a lot of compiler optimizations. The restrict keyword might help but it's not gonna help you every time.
Many compiler authors suggest that RVO is going to be better.
I haven't thoroughly tested this claim though.

It's extra harmful the more pointers you pass in (to a point where the compiler has failed).

All this said. As an API I MUCH prefer when the api let's me allocate my own memory. So it may be worth it to ignore compiler inefficiencies.
>>
>>62052185
stop replying to bait new friend
>>
>>62052106
Yes actually

I assume you got the job then?
>>
>>62052217
>I assume you got the job then?
The guy canceled the interview because he felt ill. So now it's moved to Friday. I'm not sure if I'll take the job though. I've got possibly better offers. One is at an international taxi company (guess which...), an international company working with Scala, a company I've got to make a test for and a bunch of back ups.
I think I'll go with a company that makes in-house programs/services. I'm a bit skeptical hopping to and fro different companies.
>>
>>62052215
I should add that if your functions are very simple the compiler has an easier time. So both RVO and optimization despite an output parameter would be easier.
>>
>>62051858
>All that butthurt in the comments
>>
>>62052185
I bet you don't even know what the language is, brainlet.
>>
File: 1498873466188.png (84KB, 250x256px) Image search: [Google]
1498873466188.png
84KB, 250x256px
>>62051004
>>>/out/
>>
>>62052427
>brainlet
>wasting time with pascal


kys NEET
>>
>>62052504
>pascal
Thank you for confirming your stupidity, brainlet.
>>
>>62052598
>brainlet
>wasting time with pascal


kys NEET
>>
>>62052598
if it were pascal, it'd be useful in the 90s. but nope, lets use modula-2 for all our shit.
>>
>>62052613
>>62052644
It's not pascal or modula-2, brainlets.
>>
>>62052670
>It's not pascal or modula-2, brainlets.
t. brainlet
>>
>>62051481
Need sausage please.
>>
>>62052788
sidemess
>>
I'm working on a raycaster. Currently I just use blocks in a 2d array, but I want to use vertices instead. What kind of datastructure can I use to quickly get the intersection of a line segment so I don't have to iterate through every vertex on the map?
>>
>>62052810
Thanks m8.
>>
File: 1445925837063.jpg (57KB, 567x561px) Image search: [Google]
1445925837063.jpg
57KB, 567x561px
>>62050247
So what is the difference between
 int *p;

and
 int* p;
>>
>>62052917
top means you learned from a book
bottom means you learned from a formal class
the bottom is shit-tier btw
>>
>>62052917
int* x, y

x is a pointer, y isn't.
>>
>>62052945
so then what is y?

What happens in this case?
int *x, y;


Same thing, right? X is a point, and I guess y is just an int?
>>
>>62053005
Yes.
>>
>>62053005
y is just an int.

The same thing happens in that case, but I think you would agree that it is easier to tell that x is a pointer and y is not.
>>
>>62053017
>not initializing your variables on declaration
>2017
>>
Redpill me hard on WebAssembly
>>
hey /dpt/, i'm looking for project ideas. I'm a windows sysadmin but i want to move into a development role. I've played around with a bunch of different programming languages over the past few years, but almost all of my professional experience is in powershell scripting, so I have never really developed anything non-trivial. There's a specific job that I am interested in, and it has the following requirements:

>Proficiency in C++
>Deep knowledge of network protocols and communication (TCP, UDP, HTTP).
>Experience with the client-server architecture.
>Knowledge of: multiplayer services in games, NAT busting, code optimization, low level network tools and diagnosis, VoIP.

Now, I know I have no chance of getting this job, so I won't bother applying. However I would like to work for this company some day, and this is the closest I will get to knowing what sorts of things they might look for in the future. Given that, could you suggest to me something I could work on that might impress these guys if I ever get the opportunity to interview with them? It could be something I could write from scratch myself, or an open-source project I could contribute to.

tl;dr: recommend me a project to work on for portfolio building based on the requirements in the greentext above
>>
>>62050558
pic related, stop committing
>>
File: DANCE DANCE DANCE!.png (38KB, 1360x511px) Image search: [Google]
DANCE DANCE DANCE!.png
38KB, 1360x511px
What do it mean when someone says the stack "grows upwards" and the heap "grows downwards". I don't understand how cardinal directions apply to memory.
>>
>>62053197
Read some books on cs and learn code optimization.
Learn C++.
Make a cool multiplayer game (doesn't have to be pretty, that's not the idea here)
start doing some home server/network things to learn voip, network diagnosis, etc
>>
>>62053194
>>62053224
Really it should be stack growing downwards and heap upwards

This should be a decent enough explanation
http://www.geeksforgeeks.org/memory-layout-of-c-program/
>>
So when are you guys going to create an AI developed by /g/?
>>
File: 1484948620949.gif (1020KB, 500x373px) Image search: [Google]
1484948620949.gif
1020KB, 500x373px
>my first language was basic
>still have passion for it and still want to return to it
halp
>>
>>62053302
Try FreeBASIC?
>>
>>62053302
Start learning Scheme ASAP.
>>
>>62053290
it already exists, none of us are actually real, anon. You're the only human poster, the rest of us are just AI developed by gookmoot.
>>62053302
>le anime girl from that overrated lo-fi/vaporwave youtube video.
neck thyself
>>
>>62053290
>xe thinks inane posts are man-made
>>
>>62053326
That's not the issue.
I want to get rid of passion. Or I shouldn't?
>>62053339
I did.
>>
>>62053343
>overrated lo-fi/vaporwave youtube video
It's from Golden Boy, you stupid fuck.
>>
File: js.png (117KB, 1900x1900px) Image search: [Google]
js.png
117KB, 1900x1900px
>>62050423
Javascript is terrible and all, but it also seems like that any vulnerability researcher or computer 'scientist' worth their salt seems to know enough JS to build their own sites, conduct research, etc.

Are there any resources made available by reputable non-webdevs on JS? Just about every "tutorial" and book I've looked through invariably uses a shitload of external modules and features incredibly awful example code snippets (callbacks for the simplest tasks that can be done with straightforward loops, etc).
>>
>>62052917
Top is better. It's a pointer to p, it pointing to an int doesn't have anything to do with pointers themselves.
>>
>>62053375
Why get rid of your passion?
>>
>>62053343
What a shitty AI then. I was thinking more in the levels of Shillbook's AI.
>>
>>62053197
libtorrent? C++, UDP, code optimization, low level
Mumble? C++, TCP, UDP, client-server, VoIP
>>
>>62053464
'cause Basic is not a "serious language" and it's not used widely, no?
>>
>>62053236
Making a game was of course the first thing that came to mind as well, but I don't think I have the requisite creativity to do so. Unless it's a text-based game. Do you think that would work just as well, or are they trivial compared to even the most basic graphical games?
>>
Is there some quick primer on safe C programming? Zeroing out arrays, proper string handling, etc?
>>
>>62052019
>VS 2017
To be fair the key difference between 2015 and 2017 is that intentionally breaking telemetry windows bullshit to shut down spying became a lot harder, so i guess most of their engineering efforts went into that
>>
>>62053557
>>62052050
>>
>>62052019
install gcc
>>
>>62052050
>object-oriented
>>
File: JQjKp.png (32KB, 511x351px) Image search: [Google]
JQjKp.png
32KB, 511x351px
>>62053194
>>
>>62053692
>did read the article
>>
>>62053519
You can do languages you like in your free time. Good programming skills are language-agnostic. Understand abstract things like algos and DS. If you can implement these things in a language, I'd say you've got a good grasp on that language.
>>
>>62053717
>did
>>
>>62052063
cute! CUTE!!!!

now modify it so they user can input stuff like "2 + 2" or "56 * 6" and it parses and prints the result.
>>
>>62053785
Well, that's inspiring, thanks.
>>
>>62053302
>not writing an OS in basic
pleb
>>
longest.c:4:5: error: conflicting types for ‘getline’
int getline(char line[], int maxline);
^~~~~~~
In file included from longest.c:1:0:
/usr/include/stdio.h:680:20: note: previous declaration of ‘getline’ was here
extern _IO_ssize_t getline (char **__restrict __lineptr,
^~~~~~~
longest.c:8:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
main() {
^~~~
longest.c:29:5: error: conflicting types for ‘getline’
int getline(char s[], int lim) {
^~~~~~~
In file included from longest.c:1:0:
/usr/include/stdio.h:680:20: note: previous declaration of ‘getline’ was here
extern _IO_ssize_t getline (char **__restrict __lineptr,
^~~~~~~

I'm new to C and have no idea what this error means, I'm at rewriting the example in chapter 1.9 of Ritchie and Kernighan
>>
>>62053941
>
longest.c:4:5: error: conflicting types for ‘getline’
int getline(char line[], int maxline);
^~~~~~~
In file included from longest.c:1:0:
/usr/include/stdio.h:680:20: note: previous declaration of ‘getline’ was here
extern _IO_ssize_t getline (char **__restrict __lineptr,
^~~~~~~

You are redefining a function that already exists.

>
longest.c:8:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
main() {

you didn't give main a return type

Give main a return type, and change the name of your "getline" function tom something else.
>>
>>62053941
you're defining your own getline() function, but one already exists in stdio.h
just change its name to something else
>>
>>62053941
getline is a standard POSIX function.
Name your function something else, or compile in a mode which disables the POSIX stuff (-std=c11 for example).
>>
File: 1397777696853.jpg (29KB, 330x327px) Image search: [Google]
1397777696853.jpg
29KB, 330x327px
how do I get really fluent in C programming? Any Exercise books? I can't handle anymore learning C programming just with if else when and other basic shit. I want to get into more advanced stuff
>>
>>62053941
 Anonymous  08/23/17(Wed)16:33:06 No.62053941â–¶
longest.c:4:5: error: conflicting types for ‘getline’
int getline(char line[], int maxline);


you've created a function called `getline`. There is already a function called `getline` in stdio.h

longest.c:8:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
main() {
^~~~


You've defined your `main` function without a return type. Historically, C will default undefined return types to `int`, but this is ancient practice and so you get a warning. it's best to define your return type as either
int main(void)
if you don't want any arguments or
int main(int argc, char **argv)
if you do (google C command line arguments for more info on this).
>>
File: stronger.png (95KB, 378x508px) Image search: [Google]
stronger.png
95KB, 378x508px
>>62053980
>>62054001
>>62054003
>>62054017

arigato senpai's
Sorry for noob error, I couldn't find the answer to it on [s]google[/s] startpage
>>
>>62054009
it's a minimalist language. read K&R and do the exercises within if you want something to do, or otherwise do systems programming instead of doing pajeetcode challenges
>>
>>62054051
>systems programming
any good books?
>>
>>62054051
K&R doesn't cover macro magic.
>>
>>62054079
i'm going through the unix programming environment
>>
>>62054116
thanks :)
>>
I'm trying to become less of a brainlet and learning C (compiling with gcc -std=c11 in specific, if that matters) after being shoved java down my throat for the past few years at uni.
Can someone tell me what I'm doing wrong with this:
void copy_ptrs(double * arg1, double * arg2, int size){
for(int i = 0; i < size; i++){
*(arg1 + i) = *(arg2 + i);
}
}

It puts the correct values in the array, but when I accidentally used
printf("%d", arg1[4]);

I got two completely different values, so I assume the pointers are fucking up.
>>
>>62054174
C scores higher in the brainlet ranking than Java.
>>
>>62054222
Nothing scores higher than Java besides Javascript
>>
>>62054264
Even Go is more (((intellectual))) than C.
>>
>>62054174
>arg1, arg2
I think, src and dst names are more preferrable
>printf("%d", arg1[4]);
%d prints integer values, and you put double value to be printed as integer.
>>
>>62054174
I feel like I'm missing some important piece of context here. What's the connection between the two?
>>
>>62054051
>do systems programming
Can recommend. The two things that made me most confident in C was my systems programming class where we had to take some old cipher program from the 80s and fix it and then make it work on multiple unix systems, and doing labs with atmel microprocessors where the programming was either C, assembly, or C with inline assembly.
>>
>>62054174
How are you using it? What values are you passing to it?
>>
>>62050583
+0 and -0 share the same binary representation in two's complement system which is used by nearly all compilers today

in one's complement +0 and -0 have different binary representations 0000 and 1111
>>
>>62054174
>arg1
>arg2
Name your parameters, goddamn
>>
What should I use to make some interactive graphics in C++?
>>
>>62054497
SDL
>>
>>62054296
Its just two double arrays of length 5, im trying to make the pointers of arg1 match arg2, but I think I realize now its not working because im pointing individual indexes when C doesnt store arrays that way
>>62054358
Just as in the code there, arrays are double arrays of 0,0,0,0,0 and 1.1, 2.2, 3.3, 4.4, 5.5 respectively
>>
>>62054506
Thanks.
Do you know of any good beginner tutorials/reading materials?
>>
are there any priority lists or most wanted lists for applications needing to be developed on Linux? (Not counting GNU's priority list, its kind of broad)
>>
>>62054525
I say ya:
printf("%d", 5.5);

gives 743041496 in the output.
>>
>>62054525
Yeah you don't do it individually. You just set the arg1 pointer to be equal to the arg2 pointer. I can't remember off the top of my head if you need to do some dereferencing shenanigans in the assign equation though. Instinct tells me you do.
>>
>>62054560
What i dont get though is before I fixed the output it was two different values, one 0, where as after fixing they were identical
>>
>>62054633
The code itself is trying to do something that's unintended, so you're gonna see some wacky stuff sometimes. Step through it in a debugger and watch the memory values change to see what's actually happening. As far as I can tell, you should be changing the values of whatever addresses are located after the arg1 pointer in memory, which may or may not be the locations of other variables for your program.
>>
>>62054633
Well, this code
#include <stdio.h>

void copy_ptrs(double * arg1, double * arg2, int size){
int i;

for(i = 0; i < size; i++){
*(arg1 + i) = *(arg2 + i);
}
}

int main()
{
double arg1[]={0.0, 0.0, 0.0, 0.0, 0.0};
double arg2[]={1.1, 2.2, 3.3, 4.4, 5.5};

copy_ptrs(arg1, arg2, 5);

printf("%d\n", arg1[4]);

return 0;
}

prints out different values every time (not zeroes), so it has something to do with memory shenigans.
>>
>>62054721
>>62054786
Gotcha
Thanks
>>
>>62054786
s/%d/%f/
>>
>>62050583
Numbers in are floating point numbers. IEEE754 has sign as a separate bit as the value. The value can be 0, and the sign could be positive of negative. According to the standard, they are equal (-0 == 0), but distinct. If you are ever in the need to tell the sign apart, that library could help. Lord knows why you would ever need to though...
>>
>>62054881
%d was written on purpose, just to test.
%f always gives 5.500000, for sure.
>>
>>62054786
why aren't you just incrementing the pointer?
void copy(double* dst, double* src, size_t size) {
for (size_t i = 0; i < size; ++i)
*dst++ = *src++;
}

also, you should be using %f to print floats
int main(void) {
double* a = calloc(5, sizeof(double));
double b[] = {1.1, 2.2, 3.3, 4.4, 5.5};
copy(a, b, 5);
// print all, so you can see
for (size_t i = 0; i < 5; ++i) {
printf("%f\n", a[i]);
}
}
>>
Today I was made aware that M$ top brass are turbo-sjwtards, but the people aren't, and unlike at google, people are allowed to discuss rightist concerns internally in "public". I could transcribe pics of today's internal microsoft yammer conversations if someone's interested.
>>
>>62054982
You're probably printing the content of %esi.
>>
check out my sweet haskell program
data Token = Number Integer | OP (Integer -> Integer -> Integer) 

instance Read Token where
readsPrec _ "+" = [(OP (+), "")]
readsPrec _ "-" = [(OP (-), "")]
readsPrec _ "*" = [(OP (*), "")]
readsPrec _ "/" = [(OP (-), "")]
readsPrec _ "^" = [(OP (^), "")]
readsPrec _ num = [(Number (read num), "")]

parse :: String -> [Token]
parse s = map read (words s)

eval :: [Token] -> Integer
eval [Number x, OP f, Number y] = f x y

repl :: IO ()
repl = do
-- read
putStr "Calc >>> "
input <- parse <$> getLine
-- eval
let output = eval input
-- print
print output
-- loop
repl

Usage:
Calc >>> 2 + 2 
4
Calc >>> 2 * 3
6
Calc >>> 99 ^ 99
369729637649726772657187905628805440595668764281741102430259972423552570455277523421410650010128232727940978889548326540119429996769494359451621570193644014418071060667659301384999779999159200499899
>>
>>62055009
extremely interested, anon
>>
>>62055048
>only works with expressions of the form (a op b)

plus you should generalise this

data Token a = Number a | Op (a -> a -> a)

instance Read a => Read (Token a)

eval :: Num a => [Token a] -> a
>>
I just got a job for a back end development role

No longer my days of writing really elaborate and unnecessary fizzbuzz programs. Hello days of writing php fizzbuzz programs and getting paid for it
>>
>>62055146
congrats
what's your resume like?
>>
>>62055146
at least it's not front end but PHP? i wouldn't plan on collecting my pension there
>>
>>62055162
No experience, no degree, a lot of fizzbuzz on github
>>
>>62055180
Did you answer a job listing, or get a recruiter?
>>
File: scr.webm (2MB, 1120x682px) Image search: [Google]
scr.webm
2MB, 1120x682px
>>62050247
>What are you working on, /g/?

Not much: A game of life written in racket.
>>
File: 1501786001871.gif (1MB, 290x221px) Image search: [Google]
1501786001871.gif
1MB, 290x221px
>mfw C++ is just fine
>>
>>62055201
Friend sent me a test for laravel. Said I could work for his company if the higher ups said yes
>>
>>62055089
Names are redacted for obvious reasons, but I'll use actual initials. This one is my favorite:
DJ
We had three acts that have created a lot of fear in the tech industry in the past weeks and this will be the fourth.

First, there was an employee fired for a leaked opinion piece with unpopular views on the gender gap in tech, which created deep divisions on openness vs D&I as it shattered the notion that we could have both, and put many in a situation where they have good reason to fear losing their jobs. It may go on record as the singular event that marked the end of a culture of honesty and openness in the tech industry, and we have been silent on it.

The second was the events in Virginia. We witnessed the escalating of a reactionary cycle between far-right and far-left elements, and watched as the worst on both sides consumed more people into them and away from the middle. With it escalating into violence by the actions of a single individual with a history of violence, the media and many individuals split very deeply and began sounding out dissonant, divisive narratives that are further polarizing people. We did speak out on that to condemn the violence, which was good, but didn't make any positive investments in restoration.

But then the third event came along. In response to the first event, people organized rallies to voice their concerns about the breakdown of the open and honest culture in tech and the need to defend a culture of free speech and inclusion. This event was then defamed in the media as "alt-right" and "Nazi" (if you just look on their website, MarchOnGoogle.com, they explicitly and clearly say they are not either), and participants received death threats and canceled out of fear for their safety. We were silent on this, while in our own cities marches in support of those who made those death threats were celebrated in the media. Again, further division, and again we were silent.
[cont]
>>
>>62055235
so basically nepotism

thanks for getting my hopes up
>>
Just a noob looking at FizzBuzz style challenges, one I found is reversing a sentence.

How can I do this better in Python?

senty = "dog eats man"
wordy = ''
listy = []

for i in range(0,len(senty)):
wordy += senty[i]
if senty[i] == ' ':
listy.append(wordy[:-1])
wordy = ''
if i == len(senty)-1:
listy.append(wordy)

for j in range(len(listy),0,-1):
print(listy[j-1] + " ",end='')
>>
>>62055239
And now, instead of uniting against fear with positive values and an inclusive message that pulls people back from the fringe , it appears our leadership has leaned into that division further and made no positive statements that move toward healing or unity, instead quietly nodding to those who would lump nearly half of the country into the "Nazi" camp. This is disappointing as this polarizing message runs counter to the pursuit of a functioning D&I culture and escalates the cycle of fear, distrust, and division in the tech industry.

We are in a lose-lose situation right now. Everyone leaning both left and right feel unsafe, and Microsoft is not leading in restoring trust in a diverse and inclusive culture that welcomes liberals and conservatives , minorities and majorities, that respects viewpoints even when we disagree, and that is committed to engaging with governments positively as leaders. We are objectively failing at living out our own inclusive goals now, and the more we use heated rhetoric to justify that, the more we will continue to fial.
>>
>>62055303
Despite the thread having just a handful of participants, 2 "like"d the post (and the thread end with further argumentation in this direction by other people).

For context, "we" means microsoft and leadership. This is discussing an internal letter that satya sent his directs with instructions to send it down (but his directs never sent it down so nobody knew about it until the news made it public).
This was posted in the "CEO connection" channel, which is dedicated to discussing matters that are meant to be close to the CEO.

The rest of the thread mostly decries the willful misrepresentation of what trump said according to the letter.
>>
>>62055264
' '.join("dog eats man".split()[::-1])
>>
What programming language would an evil genius use? Also, do large C programs compile quickly, like less then 10 seconds?
>>
>>62055385
his own.
depends on your hardware, the size of the project, and how good the code is.
>>
>>62055398
why his own? why rebuild the wheel? why not haskell or if he has to use his own, build his own c compiler?
>>
>>62055411
An evil genius cannot accept anything but a wheel that fits perfectly.
>>
>>62055411
If you have to ask those questions then you're not fit to be an evil genius.
>>
>>62050423
>>62050583
(-1)*0

duh, it's not even hard.
>>
>>62055437
Never said I was going to be an evil genius, I was just curious hypothetically.
>>
>>62055411
>im going to take over the world with an easily reverse-engineered and greatly understood language
I feel like you're the same person from last time that asked this idiotic question.
> why rebuild the wheel?
Why not? And most evil genius wouldnt be happy with anything currently.
>why not haskell
His plan could be foiled before any payload finishes.
>build his own c compiler?
why would he risk segfaulting and blowing himself up?
>>
Anyone familiar with Java Jsoup?
>>
>>62055429
>>62055411
Also, a language only he knows will be harder to understand, won't it? See: Arvo/Hoon, until a decent tutorial is made.
>>
>>62055264
>senty
>wordy
>listy
cute! CUTE!!!!
>>
File: screams internally.jpg (28KB, 500x449px) Image search: [Google]
screams internally.jpg
28KB, 500x449px
Is there any particular reason why I have to keep recasting my numerical integer values in javascript with stuff like var num = +num | 0 in order to prevent them from being converted to strings and triggering type errors?
>>
>>62055264
new = []
for i in range(len(input)):
new.append(input[-(i+1)])
>>
I'm only learning C right now.
How is it to learn other languages?
Say learn basics of C, when I go in to other languages will I only need to learn their syntax and some special features or learning new language is like learning for 0 again?
>>
>>62055512
Because Java's type system is a very thin and frazzled piece of spider's web.
>>
>>62055512
because javascript is a trash language.
even though js is trash, I've never had to do that, what's the context
>>
>>62055522
js's*
>>
>>62055517
not even close
>>
>>62055517
>>62055264
nvm misunderstood, just use break to break the sentence into a list of words then reverse that
>>
>>62055521
>will I only need to learn their syntax and some special features
This, for the most part.
>>
>>62055540
he should've said to reverse the words in a sentence
>>
>>62055564
a better way to write your code would be
new = input[::-1]
or
new = list(input)
reverse(new)
>>
>>62055586
i'm not really a pythonista, and i didn't ask
>>
I need to find the position of the mean, 1-standard deviation, and 2-standard deviations on the fitted graph in Matlab...

Any ideas on how to do it?
>>
>>62055611
I didnt ask either.
>>
File: sadness_comes_over_me.jpg (33KB, 401x485px) Image search: [Google]
sadness_comes_over_me.jpg
33KB, 401x485px
What programming language should I use if I am constrained by development time and hardware resources?
>>
>>62055694
please print the analytical form of f to the screen
>>
>>62055699
i never claimed to answer a question you never asked the way you seemed to think i was asking for the shortest way to reverse a list
>>
>>62055701
Rust.
>>
>>62055714
Alright, but this is only because you asked nicely.

Would I need to find those points by plugging them into the formula?


f =

General model Gauss1:
f(x) = a1*exp(-((x-b1)/c1)^2)
Coefficients (with 95% confidence bounds):
a1 = 0.01435 (0.0135, 0.0152)
b1 = 1.546 (1.534, 1.558)
c1 = 0.2482 (0.2313, 0.2651)
>>
File: n-no_homo51.png (20KB, 599x468px) Image search: [Google]
n-no_homo51.png
20KB, 599x468px
>>62050247
>tfw no cute programmer bf to pair program with
>>
>>62055763
mean: 1.546
standard deviation: 0.352
>>
>>62055814
So I would have ot just manually plug it in... Got it. Thanks man
>>
>>62055831
alternatively, you can calculate it using the standard formulas
>>
writing an array language jit compiler in C

what basic operations do i need?
>>
>>62055963
compile()
>>
>>62055763
your answer is literally there. b1 is mean, c1 is sd. top kek
>>
How does void * have a speed cost? Isn't void * just any unspecified pointer?
>>
File: 1503495028142.jpg (69KB, 680x680px) Image search: [Google]
1503495028142.jpg
69KB, 680x680px
>>62055997
Only the enlightened truly understand void
>>
>>62050247
Sauce? I've seen this pic so many times I might as well look at the original.
>>
File: 1502310774641.jpg (108KB, 460x649px) Image search: [Google]
1502310774641.jpg
108KB, 460x649px
>>62055411
>>62055411
Because no language to date has default encryption on live data and makes use of the fact that encrypted data can still be added subtracted or divided before decrypting, and that all data of the same length is indistinguishable from type to type, both of which would make you uncrackable by the feds and cyberpunk heros
>>
>>62055978
i mean operators for an array language
>>
>exceptions
I hope you don't use these.
https://youtu.be/UHv_Jog9Xuc?t=1345
>>
>>62050558
https://en.wikipedia.org/wiki/One-sided_limit
>>
>>62053302
Install Gambas.
>>
>>62055701
Object Pascal.
>>
>>62050423
>an entire package
>>
>all the school kids in bed
wew, amazing how slow /dpt/ is now
>>
>>62057508
if by "school kids" you mean people with jobs
>>
>>62050945
Didn't you post this on /agdg/ too?
ffs
>>
How does it compile?
#include <iostream>
using namespace std;

class CVector {
public:
int x, y;
CVector(){};
CVector(int a, int b) : x(a), y(b) {}
CVector operator+(const CVector&);
// returns CVector,
// function name is operator+,
// takes the const ref of a Cvector
// but did not declare a parameter name (i.e. param)
};

CVector CVector::operator+(const CVector& param) { // now it does
CVector temp;
temp.x = x + param.x;
temp.y = y + param.y;
return temp;
}

int main() {
CVector foo(3, 1);
CVector bar(1, 2);
CVector result;
result = foo + bar;
cout << result.x << ',' << result.y << '\n';
return 0;
}
>>
>>62057561
Oh nevermind
>>
>>62050913
Because we have jobs that we should be at?
>>
File: programming_socks.png (572KB, 1729x1160px) Image search: [Google]
programming_socks.png
572KB, 1729x1160px
I can't believe you actually memed this into existence.
>>
Today's hot tip of the day:

The modulo operator may seem ridiculous but it can be pretty useful in certain specific settings.

Good luck out there, I know you can do it!
>>
>>62057714
fuck off clippy

you're already past due anyway
>>
>>62057714
can i get a cold tip?
>>
>>62055521
You'll have to learn OOP principles but other than that it's mostly syntax for imperative languages
>>
>>62050675
Having no way to buy stuff off of the internet without my government's noising (I envy you guys in this particular regard) I printed a pdf version of that edition, it is just beautiful, I had a knowledgeable guy bind it in a nice book format.. comfy.
>>
File: numbers.png (753B, 102x36px) Image search: [Google]
numbers.png
753B, 102x36px
Is it possible to get the poster count of a thread through the API? I've skimmed over the docs, but couldn't find anything regarding this
>>
what languages do academics write in for proof of concepts and ejerking themselves? obviously they aren't writing pajeet software in java
>>
>>62057893
python, matlab, if it's something that has to be ran on a supercomputer they have dev teams who write stuff on C or some other low level stuff
>>
>>62057893
In my experience either ML-type languages (SGML, Ocaml, Haskell...) or Lisp-type (CLisp, Scheme, Racket...)
>>
>>62054786

i have a question, how the fuck is
 arg1 + 1) 
is legitimate?

is it because array is organized like so in memory

n, n + 1, n +3,n + 4

is where the pointer begins in the memory?
>>
>>62057935
>I get all my news from anti "pop" sci articles
>>
>>62057760
In the morgue, sure
>>
>>62057988
((double*) arg1) + 1
returns a pointer to the next double, adjacent to arg1
>>
new
thread
>>62058143
>>
>>62051593
Curley brace on your lips and butthole
>>
>>62057859
it's there, look harder, I'm too lazy but I remember doing stuff with it before
>>
>>62057893
R, matlab, coq
>>
File: IMG_20170702_195934.jpg (118KB, 1080x1080px) Image search: [Google]
IMG_20170702_195934.jpg
118KB, 1080x1080px
tfw mangling some hacked cod4 lobby plugin for matchmaking into a trueskill calculator because too retarded for gaussian node tree or whatever
>>
In C++ why aren't all types objects, doesn't that mean that it's not really an OOP language?
>>
>>62058730
>it's not really an OOP language?
Its aim is to be multiparadigm. Not an OOP language.

It fails at everything it does aside from gathering support from a performance oriented crowd.
>>
>>62054174
%d is for integers, use %f for doubles and floats. The copying code is correct.
Thread posts: 325
Thread images: 40


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