[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: 319
Thread images: 31

File: it's a trap.png (873KB, 1275x677px) Image search: [Google]
it's a trap.png
873KB, 1275x677px
Anime Edition

Do you hate anime? If so, please fuck off.
Please DO NOT discuss your hatred of anime on the way.

What are you working on, /g/?

Previous thread: >>55407923
>>
>>55414062
>Anime Edition
>
>Do you hate anime? If so, please fuck off.
>Please DO NOT discuss your hatred of anime on the way.
It's like you are asking for it.
>>
This is the best /dpt/ in a while, thanks guys
>>
>>55414062
>when OP thinks he's boss of the thread
Your waifu is not technology.
>>
QUICK! make a square root function
>>
>>55414556
function sqrt(num) {
return Math.sqrt(num);
}
>>
>>55414556
√ 2
>>
File: ada.png (4MB, 4800x2700px) Image search: [Google]
ada.png
4MB, 4800x2700px
Is Ada any good?
>>
>>55414556
double sqRrt(double n){
while(true){
int x = rand();
if(x*x == n) return x;
}
}
>>
>>55414595
damn i memed too hard and mixed up types

making all these shitty meme code snippets is probably going to sneak up on me and fuck me up in the future where i accidentally do something like this because of muscle memory
>>
>>55414556
double sqrt(int x) {
if (x == 4)
return 2.0;
else if (x == 9)
return 3.0;
else if (x == 16)
return 4.0;
else
throw;
}


Fits all the unit tests
>>
>>55414595
lel
>>
File: rms pajeet.jpg (429KB, 654x726px) Image search: [Google]
rms pajeet.jpg
429KB, 654x726px
>>55414575
you have learned well my son
>>
What kinds of side projects do you guys put on your portfolio to show off to employers?

What kind of projects would impress the average recruiter the most, not including language and framework skills?
>>
Where are the Lisp generals?
>>
>>55414728
They're dead
Like the language
>>
>>55414744
*languages
>>
>>55414744
No pretty sure they moved to some other chan because the shitposting here was just too high.

I just don't remember which.
>>
>>55414757
Isn't Lisp just a singular language because it has dialects?
>>
>>55414777
Is C++ just a C dialect?
>>
>>55414797
No it's like German and English
>>
File: erina.gif (846KB, 500x485px) Image search: [Google]
erina.gif
846KB, 500x485px
Downloading anime images.
Currently at image #2359 of the 2929 I need to download for my Usenet indexer.
It's taking a while because I have to space the requests 5~ seconds apart so I don't get b&
>>
first for Go lightweight threads
>>
>>55414839
Could you upload them for us poor souls to see? Can you post a link in these threads when you are done?
>>
File: 186710.jpg (96KB, 353x500px) Image search: [Google]
186710.jpg
96KB, 353x500px
>>55414859
They're just boring boxart images like this, nothing interesting.
>>
>>55414897
I am still interested, so if you do not mind, I would really appreciate if you posted them :3
>>
>>55414062
how do I initialize a pointer to a struct in another structs constructor.
struct stuff1
{
stuff1()
{
*stuff=stuff2(5);
}
stuff2* stuff;
}

struct stuff2
{
stuff2(int x)
{
y=x;
}
int y;
}
>>
>>55414980
what the fuck
>>
>>55414980
struct stuff2;

struct stuff1
{
stuff1()
{
stuff = new stuff2(5);
}

~stuff1()
{
delete stuff;
}

stuff2 *stuff;
}

struct stuff2
{
stuff2(int x)
{
y = x;
}

int y;
}
>>
>>55415006
If you're going to bully me at least make it make my cock hard
>>
Okay /dpt/, here's my problem.

I want to be able to program in multiple languages, all from the same IDE/editor, with first-class autocomplete/refactoring/debugging support for every language.

I have used emacs for a little over a year, and it has been great so far, but I really need to write java too, and emacs has subpar support for java.

What are my options for a fully integrated Java, C, C++, Python, and HTML5 development?

So far, Eclipse is literally the only one that meets these requirements.

>inb4 jetbrains products
I don't want to fork over the cash for clion and the like
>>
>>55415100
Could just use IntelliJ for Java and Emacs for everything else unless you want to keep it all in one environment.
>>
>>55415100
>>55415124
Ignore me, I didn't read the first part of your post closely enough
>>
>>55415016
So I just tested a few variations of this and it doesnt have to be on the heap. But stuff2 does have to be before stuff1. Problem is stuff one is a class in a different header file.
>>55415006
???
>>
>>55415100
obviously no single ide is best for all languages
pycharm is best python ide
visual studio is best C++ ide
eclipse is simply ok at most
>>
do you think my programming knowledge will be useful if i was transported to a fantasy world?
>>
File: quadbot.png (267KB, 1920x1080px) Image search: [Google]
quadbot.png
267KB, 1920x1080px
>>55414700
Currently working on a raycast "engine". Started as a uni project but I still add some functionality to it from time to time.

Pic related: 1920*1080
1 light source
5 maximum reflection bounce for light
458709 object in scene
render time: 63079ms (which is pretty good for a raycast based methode)
>>
>>55414623
This is what a neural network would essentially boil down to
We still don't have any proper notion of what it means to be intelligent ;_;7
>>
>>55415193
some fa/tg/uy wrote a long story about that

tl;dr: no
>>
>>55414062
Kill yourself you fucking degenerate weaboo
>>
>>55415208
>This is what a neural network would essentially boil down to
No
>>
>>55415193
Yes if you know how to make water logic gates and understand the concept behind assembly. Itd take years before you had a working water computer though.
>>
I can't wait for dpt to become the new desktop threads. Next time don't forget to post cartoon cp :')
>>
I feel like there's enough content for programming/cs to have it's own board?
>>
>>55415293

Hivemind

I was thinking the same thing at the same second just now
>>
>>55415293
No this is the solution:

/phi/

Mathematics, philosophy & programming
>>
>>55415240
yes
>>
>>55415293
We could make our own .+chan as a community project but the issue would be getting someone to host it.
>>
>>55415312
I feel like the former 2 overlap with /sci/?
>>
>>55415203
>tfw i will never be smart enough to program physics simulations

It seems so damn interesting, too

How did you get started with that kind of stuff?

Did you take physics-related classes to get a head start?
>>
>>55415356
No, half of /sci/ hate philosophy because they're science wankers, and it'd be good to divorce mathematics from the science board (mathematics is not a science, no matter how many times scientists claim so)

More to the point, there is a strong link between the three and all of them sometimes occur on /sci/ but would be better off relegated to their own board
>>
>>55415375
A mathematics board would become filled with threads about 0 not being a number, 0.99... != 1, and spivak shills
>>
>>55415411
you mean with 1 thread
>>
>>55415432
This whole thread is cringe
>>
>>55415411
Maybe like on /g/ there's a daily fizzbuzz, there could be a daily 0.99 ... != 1
>>
>>55415489
0.99.. != 1 in surreal number theory
>>
>>55415504
How can you be this stupid?
>>
>>55415548
1 - ε != 1
>>
Newest edition to the continuing rust chip8 emulator.. Literally procrastinating to the point of insanity.

let op = (self.mem.ram[pc] as u16 << 8) | (self.mem.ram[pc+1)


100% sure I'd be done with this project in only 100 or 200 more lines of code if I could just decide on a fucking rendering / sound library to use.

I mean interpreting the opcode is literally just a simple fucking match statement using opcode & 0xf000.
>>
File: v&.png (35KB, 475x122px) Image search: [Google]
v&.png
35KB, 475x122px
What's the best programming language for reasoning about abstract algebra?

>>55415570
>kid
Reported for rape
>>
>>55415581
Python
>>
>>55415598
Please take my question seriously
>>
>>55415581
mathematica
>>
>>55415581
>What's the best programming language for reasoning about abstract algebra?
Agda
>>
File: dafukisthis.png (251KB, 1920x1080px) Image search: [Google]
dafukisthis.png
251KB, 1920x1080px
>>55415360
Master degree in computer sciences - image synthesis and analysis.

No physics classes needed, computing classes in image synthesis. This is just math. Vector arithmetic, intersection equation between ray and triangle/sphere/plane.

There is no physic simulation here (no collision, gravity, ...) just rendering. Except maybe for the lightning but it's more an approximation than a simulation.

Also no need to be super smart to do something like this. You just need proper guidance (and time). Most of the math I needed to do I took from research papers.
>>
Anyone contribute to any cool projects lately? I'm bored of working on stuff that never leaves my harddrive. Would be nice to work on some shared projects for a change.
>>
Making a 3D cheese pizza MMORPG in WebGL.
I'm gonna prob stream it live on YT
>>
>>55415140
You can forward declare struct2 in struct1's header and then include struct2's header in struct1's implementation.
>>
>>55415691
Thanks for the reply, that's reassuring.

Let's say I am a CS undergrad who has taken math classes up to Calculus II and discrete mathematics.

From this point, where should I go to study image analysis and the required math on my own?

Could you recommend some good textbooks or tutorials on these topics?
>>
>download rapidxml
>try to write xml to a file
>bug in rapidxml

into the trash it goes

using c/c++ makes my head hurt sometimes.
>>
>>55414556
Let me give it a shot.
Using newtons method:

fn sqrt(n: f64) -> f64 {
use std::f64;

if n < 0.0 {
f64::NAN
} else {
let minacc = 0.000000001;
let mut x1: f64 = 1.0;
let mut x0 = 0.0;
while (x1 - x0).abs() > minacc {
x0 = x1;
x1 = x0 - (x0*x0-n)/(2.0*x0);
}
x1
}
}


Also created some test cases:

trait ApproxEq {
type Rhs;
fn aeq(&self, &other: Self::Rhs) -> bool;
}

impl ApproxEq for f64 {
type Rhs = f64;
fn aeq(&self, other: f64) -> bool {
return (self - other).abs() < 0.000001;
}
}

#[cfg(test)]
mod test {
use super::{sqrt, ApproxEq};

#[test]
fn values_test() {
assert!(sqrt(0.0).aeq(0.0));
assert!(sqrt(1.0).aeq(1.0));
assert!(sqrt(2.0).aeq(1.4142135623731));
assert!(sqrt(4.0).aeq(2.0));
assert!(sqrt(3.0).aeq(1.73205080756888));
assert!(sqrt(100.0).aeq(10.0));
assert!(sqrt(1024.0).aeq(32.0));
assert!(sqrt(1337.0).aeq(36.5650105975644));
assert!(sqrt(8001.0).aeq(89.4483090952534));
assert!(sqrt(9001.0).aeq(94.8736001214247));
assert!(sqrt(9000000.0).aeq(3000.0));
assert!(sqrt(9000001.0).aeq(3000.00016666666));
}

#[test]
fn test_invalid() {
assert!(sqrt(-0.1).is_nan());
assert!(sqrt(-1.0).is_nan());
assert!(sqrt(-1000.0).is_nan());
assert!(sqrt(-1e308).is_nan());
assert!(sqrt(sqrt(-1.0)).is_nan());
}
}

fn main() {
}


Result:

$ cargo test
Compiling sqrt v0.1.0 (file:///sqrt)
Running /sqrt/target/debug/sqrt-825e747ad4fc9b25

running 2 tests
test test::test_invalid ... ok
test test::values_test ... ok

test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured
>>
>>55415769
>can't even square root negatives
>>
>>55415565
but 1 - epsilon is not 0.99...
>>
>>55415375
Philosophy belongs on /lit/ anyways.
>>
>>55415769
rust looks like shit
>>
>>55415807
No it doesn't, /lit/ is for books and literature
>>
File: sqrt.png (16KB, 448x276px) Image search: [Google]
sqrt.png
16KB, 448x276px
>>55415812
I think it's alright.
It's very specific about the types on interfaces that could be exposed.
>>
Anyone have any useful batch scripts?
>>
File: fuck.jpg (146KB, 850x850px) Image search: [Google]
fuck.jpg
146KB, 850x850px
Heyyyy /g/ sempai~~~~~~~~~~~
I just got debian installed and I need something to program in c so give me something to work on
>>
>>55416030
Recreate wolfenstein 3d
>>
>>55416030
Write a wayland compositor.
>>
>>55416030
Make a terminal based text editor
>>
>>55415769
>
(x1 - x0).abs()

What the fuck?
>
fn aeq(&self, other: f64) -> bool {

JUST
>>
How much can you make working remotely?
>>
>>55414556
sqrt x = max [a ^^ 2 | a <- rat, a ^^ 2 <= x]
rat = rat 1
rat n = [p / q | p <- [1..n], let q = n + 1 - p] ++ rat (n + 1)

: ^ )
>>
>>55415839
It's like you've never been there.
>>
>>55416123
> 1
>>
File: three_lights_RGB.png (206KB, 1920x1080px) Image search: [Google]
three_lights_RGB.png
206KB, 1920x1080px
>>55415691
The math in image synthesis are mostly (not so surprisingly) geometric stuff you probably know (or knew) about (matrix, vectors, trigonometry, ...)

If you are interested in this kind of stuff I'd recommend looking into classic 3D rendering with OpenGL: http://www.opengl-tutorial.org/ (really great tutorials there!)

This is for real-time GPU-based image rendering unlike my project which use a raycast technique (non-real-time CPU-based) but the math is mostly the same the same.

If you wanna look into racasting I just found this: http://www.cs.virginia.edu/~gfx/Courses/2010/IntroGraphics/Lectures/6-RayCasting.pdf (the only stuff I have are in French so not really helpful to you I suppose... )
>>
>>55416123
>How much can you make working remotely?
maximally? Notch is worth like $1.5 billion
if you mean
>How much can the average professional expect to make working remotely?
then around $100/hour
>>
>>55415729
see
>>55416182
i fucked up the reply...
>>
File: hhhh.png (170KB, 1108x582px) Image search: [Google]
hhhh.png
170KB, 1108x582px
Animu indexer now with images
>>
WHERE'S THE ANIME?
FUCK!
>>
Can someone post the image with the project listings? Id like to do a roll for one.
>>
>>55416210
Source code? Language?

>>55416321
https://dpt-roll.github.io/
https://better-dpt-roll.github.io/

Use the number from the post you just made
>>
I appreciate the work you're doing /g/ janitor.
However, you really need to request a ban them for a few days, otherwise they'll just keep doing it.
>>
need help with this function:

void read() {   //sign in

char user[20], pass[20], line[50];
printf("\nUsername: ");
scanf("%s", user);
printf("Password: ");
scanf("%s", pass);

FILE *info;
info = fopen("info.csv", "r");

while (fgets(line, sizeof(line), info) != NULL) {

char *USER = strtok(line, ",");
char *PASS = strtok(NULL, ",");

// printf("username: %s\n", USER);
// printf("password: %s\n", PASS);

int mUsername = strcmp(user, USER); // string comparison functions
int mPassword = strcmp(pass, PASS); // returns 0 iff strings are equal

if (mUsername == 0 && mPassword == 0) {

fclose(info);
loggedIn();
exit(EXIT_SUCCESS);

} else {

continue;

}

}

printf("\nINVALID USERNAME OR PASSWORD... EXITING...\n");

}


Every time i compile the program just skips the if statement and says username and password is invalid, i assume it has something to do with memory allocation, can someone please help thanks lol first timer
>>
File: 1461729611881.gif (748KB, 245x245px) Image search: [Google]
1461729611881.gif
748KB, 245x245px
Interested in learning Java so i can do macros in STAR-CCM+ (CFD software). Friend from EE told me to learn C++. What do?
>>
>>55416497
lol wtf is pass amirite
>>
>>55414062
This is not /b/ go away with your traps.
>>
>>55416501
Learn C++. Java is shit
>>
>>55416534
this

>>55416501
stay away from Java
>>
>>55416501
They're pretty much identical anyway.
>>
File: raytracer.jpg (72KB, 640x693px) Image search: [Google]
raytracer.jpg
72KB, 640x693px
>>55416182
Interesting stuff!

I made a path tracer and a raytracer for my bachelor CS graphics course,

Img is the whitted-style ray tracer in c# using OpenTK. Renders in real time with around 4-5 fps on my 2500k.

You can actually implement these things on a GPU (using OpenCL or something) and get a lot more fps.
>>
>>55415723
I honestly cant get it. Im starting to think that its because there are functions which have to be called from the main class or something.
>>
>>55416497
How do you know it skips the if statement, do you run a step-by-step simulation?
Have you checked to see if the if statement is false for some reason?
>>
File: 1462148809830.png (297KB, 720x405px) Image search: [Google]
1462148809830.png
297KB, 720x405px
>>55416534
Thanks, he told me that if you know C++ java is going to be a walk in the park, and from what i know, people from EE really hate java.

>>55416554
Mokkochi best gril, sorry
>>
>>55416393
Source is in a private repo at the moment, just because it's a bit messy and mostly uncommented.

Python 3 used for
>downloading Usenet headers
>generating XML files
>interacting with aniDB
>downloading files and running them through ffprobe

Python 2 used for
>flask

and a small amount of C used for decoding Usenet content. Also Postgres for the database and searching.
>>
>>55416632
>Python
I thought 4chan was 18+
>>
>>55416597
yes i attempted all of that when i was trying to debug the damn issue...
the if statement is false, i just don't get why it is false, it works when i comment out some stuff, but this isnt good too me... without it conditioning both usernames and passwords
  while (fgets(line, sizeof(line), info) != NULL) {

char *USER = strtok(line, ",");
char *PWD = strtok(NULL, ",");

// printf("username: %s\n", USER);
// printf("password: %s\n", PWD);

int mUsername = strcmp(user, USER); // string comparison functions
// int mPassword = strcmp(pwd, PWD); // returns 0 iff strings are equal

if (mUsername == 0 /* && mPassword == 0 */) {

fclose(info);
loggedIn();
exit(EXIT_SUCCESS);

} else {

continue;

}

}

printf("\nINVALID USERNAME OR PASSWORD... EXITING...\n");

}
>>
File: 1462046585096.png (1MB, 1200x1800px) Image search: [Google]
1462046585096.png
1MB, 1200x1800px
>>55416646
It just werks
>>
Made some progress today. Learning Python.

I kind of understand whats going on in this code, but can someone explain it like I'm 5? Let me know if my notes are wrong.


#importing module
from sys import argv

#setting the arguments you must type before running script.

script, filename = argv

#assigns txt variable to filename typed in the argv. opens said file.
txt = open(filename)


print "Here's your file %r" % filename
#prints what is typed from the txt variable. No paramaters are set.
print txt.read()

print "Type the filename again:"
#asks user to retype filename , assigning it to "file_again"
file_again = raw_input("> ")

#assigns txt_again to open(file_again)
txt_again = open(file_again)


#prints what is typed from the txt_again variable, which is the file_again variable.
print txt_again.read()

>>
>>55416655
Perhaps you have spaces before the '\0' character and that's enough to mess up the comparison without you noticing when you see the string printed out in the console.
I made a server in C a few months back that operated a database and I remember I had a ton of weird problems like the one you're having when manipulating the SQL requests and responses from the DB.
>>
Reminder that pic related is a much better introduction to Python.
>>
File: this article is real and true.png (329KB, 711x610px) Image search: [Google]
this article is real and true.png
329KB, 711x610px
>>55416697
I really like this image but no Haskell?
What did Haskell ever do to you?
>>
/g/ I feel stupid, please to help me figure out why cURL with C is not working

http://pastebin.com/LFzYgzKM
>>
>>55416802
You could at least tell us what the error is
>>
>>55416815
There is none, it just seems like the program hangs. nothing happens and no file gets saved. It compiles just fine
>>
>>55416802
Your
fclose(fp);
is causing the segfault.
I presume curl_easy_cleanup already closes the file for you.
>>
>>55416802
>>55416898
Oh nevermind, you're actually never initializing fp.
>>
File: body.png (29KB, 1920x1080px)
body.png
29KB, 1920x1080px
>>55416572
nice. I love the colors.
We actually look into OpenCL and boost::compute for GPU acceleration during our course but it wasn't the main focus for our raytracer. I only use OpenCL to use threads for the main per-pixel loop.

One thing I use for time optimization is a (axis aligned) bounding box binary tree data structure. It's basically a tree of bounding box containing other bounding box or objects in the scene. That way you don't necessarily need to check for intersection with every objects in your scene.

For 2K triangles this took 450ms insted of 2 minutes for exemple
>>
>>55416920
kill me. Thanks f.a.m.
>>
>>55416878
when I make a pointer to a class. Not the class, just the pointer. Is the space for the class allocated.
>>
>>55416943
Also you're missing
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);

Taken from https://curl.haxx.se/libcurl/c/simple.html

Full example:
#include <stdio.h>
#include <curl/curl.h>

size_t write_data(void *ptr, size_t size, size_t nmemb, FILE *stream) {
size_t written = fwrite(ptr, size, nmemb, stream);
return written;
}

int main(void)
{
CURL *curl;
CURLcode res;
FILE *fp = fopen("wikipedia.html", "wb");
if (!fp) {
perror("Failed to open file");
return 1;
}


/* In windows, this will init the winsock stuff */
curl_global_init(CURL_GLOBAL_ALL);

/* get a curl handle */
curl = curl_easy_init();
if(curl) {
/* First set the URL that is about to receive our POST. This URL can
just as well be a https:// URL if that is what should receive the
data. */
curl_easy_setopt(curl, CURLOPT_URL, "http://en.wikipedia.org/");
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, fp);
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);

/* Perform the request, res will get the return code */
res = curl_easy_perform(curl);
/* Check for errors */
if(res != CURLE_OK)
fprintf(stderr, "curl_easy_perform() failed: %s\n",
curl_easy_strerror(res));

/* always cleanup */
curl_easy_cleanup(curl);
}
fclose(fp);
curl_global_cleanup();
return 0;
}
>>
Hey guy i'm coding in c++

Im having trouble making an attribute to my class an array as opposed to just one pointer

Character::Character(std::string Name, int Age, int a, int b, int c, int d, int e, int f, int g,int h, Item CharItem)
:CharItem(CharItem)
{
SetName(Name);
SetAge(Age);
SetAttributes(a, b, c, d, e, f, g, h);

}


Instead of one "Item" attribute I want to have and array on items. I'm sure the way to go about this is to have an array of item pointers, but for the love of god I have just hit a mental wall with this. Any help would be appreciated. dosent have to be an array, just thinking of the simplest thing right now to get the code operational. thank you again
>>
>>55414062
>be me
>scroll through /agdg/
>see awesome looking tech demos
>read insightful discussions, with lighthearted humor and encouragement abounding
>scroll through /wdg/
>everyone constantly trying to teach and learn from each other
>scroll through /dpt/
>weebs, tripfags, waifufags, trannies, degenerates, circlejerking language fanboys
>arguments about pendantic bullshit like memory management
>no demo projects, not even any code snippets to try out in a repl or something
>only abstract useless bullshit that's mostly wrong because people just use this as a place to rubberducky and stroke their ego
>>
>>55417054
You're welcome to stay

>>55417043
You have a lot of options
1) pass a vector
2) pass a pointer and the length (to pass the array)
3) variadic function
4) use a std::initializer_list
>>
>>55417043
>>55417082

or if you want a fixed length
std::array
>>
File: transparency_difraction.png (131KB, 1920x1080px) Image search: [Google]
transparency_difraction.png
131KB, 1920x1080px
>>55416941
Also I'm currently working on transparency and diffraction but the transparent surfaces are still producing a shadows as if they were not transparent...
>>
They offered me a job today with a project but I'm afraid I won't know how to do it.
Should I accept it and hope for the best?
>>
>>55417137
I believe in you.
>>
>>55417009
It works perfectly now. Thanks a bunch.
>>
>>55417137
Do it pussy
>>
>>55416632
Flask has python 3 support. I use it to build a Web application in python 3. Nice work though, love seeing your posts
>>
>>55417149
good luck on your journey, stranger ;_;7
>>
>>55417175
can flask be used for anything that must scale well?
>>
>>55417147
Thanks.

>>55417169
Y.you too.
>>
>>55417194
Sure it's very flexible, but I use it only as a rest server.
>>
WHY IS ANIME BEING DELETED IN THE ANIME THREAD??
REEEEE
>>
Does anyone use CherryPy at all anymore? Was it ever used?
I made a restful meta-api in it and it is succinct, but it's ratherfull of old code and I'm sure security holes.
>>
>>55417321
>I made
Don't lie you stupid weaboo
>>
How do you guys stay motivated to learn new shit?
>>
>>55417330
want the code? It's maybe 300 lines. It wasn't hard at all
>>
>>55417355
Link where you stole it from pajeet
>>
>>55417359
unfortuantely I can't, as it is not stolen. I'd show you the references though.
and I'll put it on github or something.
>>
>>55417373
>putting stolen code on github
#triggered
>>
File: 1465419797994.png (638KB, 4760x4986px) Image search: [Google]
1465419797994.png
638KB, 4760x4986px
>>55414556
>>
>>55417054
>/agdg/
>good

Well that's just plain wrong, though I admit it does have way better programming discussion.
>>
>>55417389
https://github.com/CodeGrimoire/Api2
>>
>>55417054
go back 2 ur drag'n'drop "game" making software, weeb
>>
>>55416602
Yeah, they do embedded software. They wouldn't touch anything with a GC or even use a heap.
>>
File: Disappointed.jpg (50KB, 330x327px) Image search: [Google]
Disappointed.jpg
50KB, 330x327px
>>55417389
>#anything
I'm just sad. /g/ was always bad, but the last three years have been absolutely disgusting.
>>
>>55417390
I can only hope you didn't actually type that all out
>>
>>55416700
>>55416700

pls respond
>>
>>55417456
what explanations do you need? you already wrote notes. i dont see what more help you need
>>
File: depression.jpg (45KB, 535x225px) Image search: [Google]
depression.jpg
45KB, 535x225px
Parsing JSON in C is suffering.
>>
>>55417499
Are you using jansson?
>>
>>55417479

i think im just confused because of how the author laid it out.

he's assigning variables to variables to variables to variables to variables
>>
>>55417499
What library are you using?
https://lloyd.github.io/yajl/ is SAX like, so it should be fairly simple.
>>
>>55417510
No, I've been trying to work with jsmn. I'm looking into jansson now.
>>
template metaprogramming is neato.
>>
>>55417737
check out rascal
>>
yo opengl bros
I need to draw shapes according to there spot in the window. But not perspective matrix if that makes sense.
The problem is that nothing is drawn if I dont include the perspective matrix.
>>
>>55417800
sorry, meant projection matrix, not perspective matrix. It seems like a pain to have to update the projection matrix every time the aspect ratio changed.
>>
why does

target.write("%r \n %r \n %r \n" % (line1, line2, line3))
work

but

target.write("%r \n %r \n %r \n" ) % (line1, line2, line3)
doesn't?

Just curious.
>>
>>55417882
cuz ur missen' a closen' paren on the sekund wun
>>
>>55417892
>>55417882
also u put a closen' paren 2 early on the sekund wun
>>
>>55414062
A collaborative P2P radio over webrtc. Basically a DHT that contains pointers to audo files in torrents served over Webtorrent. Listeners can approve or disapprove of files, thus influencing the playlist of their peers (their "station").

(inb4 wdg, they don't ask what you are working on)
>>
>>55414062
My knowledge about algorithms in general far outweighs my skill in any particular language (I'm not even comfortable with python, not only is it easy, but it's my main language).
Super frustrating.
>>
okay so if I want to display in console what I wrote for the new lines.

how come i need to open up the file again , THEN read it even though i never closed the file? Why can't I open the file, delete everything, then just read?


print "Opening the file..."
#opens the file typed for filename
target = open(filename, 'w')

#DELETE DELETE DELETE
print "Truncating the file. Goodbye!"
target.truncate()

print "Now I'm going to ask you for three lines."

line1 = raw_input("line 1: ")
line2 = raw_input("line 2: ")
line3 = raw_input("line 3: ")

print "I'm going to write these to the file."

target.write("%r \n %r \n %r \n" % (line1, line2, line3))

target = open(filename, 'r')
print target.read()

print "And finally, we close it."
target.close()
>>
>>55417499
What? There's a million implementations already out there, and doing by hand is also pretty easy. Just figure out a robust way to store and traverse, and then write your parser based on that.
>>
Anyone here do any Android dev. Why is it so difficult and complicated just to do the simplest things? Everything is so fucked up with the Android SDK.
>>
>>55417499
I've done it before. Parsing JSON is pretty easy.
You must be shit.
>>
File: 1462754503245.png (718KB, 838x911px) Image search: [Google]
1462754503245.png
718KB, 838x911px
>Trying out HTML
>It's actually fun.

I guess I'm really am a visual learner. I love writing code and seeing the effects of it. I think I really should had picked up a trade instead of this.

buttfuckit I like wearing a suit and tie to work.
>>
>>55418036
>>55418036
>>55418036

FUCKING

HELP

ME

WHY DO I NEED TO OPEN UP THE FILE TO READ IT IF I NEVER CLOSED IT???????????????
>>
>>55418543
what exactly are you trying to do?
write to the file and then read what you just wrote?

lets say you have a blank file
then you write a line to it
the file pointer is now at the end of the file, beyond the line you just wrote
if you attempt to read from this position, you'll get nothing

when you open the file, the file pointer starts at the beginning
so you can read the line
>>
>>55418647

what the fuck, this was never explained anywhere to me. how the fuck was I supposed to figure that out.
>>
>>55418794
dunno bruh
but reading the lines you just wrote to a file basically never should happen
because if you just wrote the lines then you already know what they are, so you don't need to read them
>>
>>55418521
>html
>code
>>
>>55418863
take systems programming
>>
>>55418876
You are right, it's art.
>>
>>55418891
thanks I already have my degree
>>
>>55418876
HTML is code.
It's not programming though.
>>
>>55418985
oops was meant for
>>55418794
>>
>>55418543
Just open it once with 'rw' you whiny cunt.
>>
I did it years ago in python and php, but I finally got a 4chan image downloader coded in C++. Feels good man.
>>
>>55419031
of course it is programming, you dip
>>
>>55419209
html is not code and it is not programming
you can't compute with html and html is not turing complete
>>
File: 1405857055719.gif (3MB, 200x150px) Image search: [Google]
1405857055719.gif
3MB, 200x150px
>>55419266
What have I done to this thread.

All I said was HTML was fun.
>>
>>55419266
>html is not turing complete
it is, now that css3 is technically included
>>
File: 1467437937714.jpg (53KB, 960x960px)
1467437937714.jpg
53KB, 960x960px
Hey /g/ Im now a senior in my hs and i took a pre ap comp sci course last year and now im going to be taking an ap one this year. It will be over java. i got about a month and a half before it starts and was wondering if anyone could dump some project ideas for me to sharpen my ability in computer science. Thanks.
>>
Lets make Java great again! How would we accomplish this?
>>
>>55419411
Temperature converter
>>
File: 1467443242097.jpg (18KB, 464x464px) Image search: [Google]
1467443242097.jpg
18KB, 464x464px
>>55414062
Anime is for children and the mentally challenged who still think they're children.

You're not mentally challenged, are you?
>>
>>55419411
learn C
>>
>>55419472
I'm sure you're really proud of this post.
>>
>>55419411

A small interpreter for a little toy language. A basic Lisp or IMP style language might be a nice place to start.
>>
>>55419505
are you retarded? You are suggesting a difficult project for a beginner
>>
>>55419518
Anime website
>>
>>55419522
Definitely retarded.
>>
>>55419518

A basic Lisp interpreter a difficult project??

I think you might look in a mirror before accusing others of retardation. I mean damn there are even beginner books on it like this http://www.buildyourownlisp.com/

This is a entry level coding project or intermediate at worst.
>>
>>55419534
See
>>55419472

And ignore animefags.

People like op are crazy attention seeking basement dwellers. Why else would he include such shitty bait in the op.

We need a proper non anime version of this so the shitposts stop.
>>
>>55419581
You are suggesting an intermediate project to a complete beginner you are the noob
>>
>>55419607

You are incapable of parsing simple statements.

"intermediate at worst" meaning if you actually design the thing or are using a language that makes things overly difficult to implement.

In most modern language settings it is a good beginner level first large project.

So many summer trolls on this thread..
>>
>>55419581
not to mention, creating an interpreter is a boring meaningless project that wont interest beginners
they need something more tangible than that
>>
>>55419664
> Le summer may may
>>
>>55419411
CHIP 8 emulator
>>
>>55419588
I was stating the fact the you replied to the wrong post. You're too retarded too see that. it has nothing to do with the anime/anti-anime argument.
>>
>>55415749
Use tinyxml.
>>
>>55419728
Eat shit and die
>>
>>55419803
So, what was the last project you did?
>>
>>55414384
She is not a waifu because that character is acctually a boy who fell for the cross dressing meme
>>
>>55415375
>mathematics is not a science
Then neither Physics, Chemistry, CS ,... are.
Science is about applying maths to model reality math is exactly about that but in a more abstract way.
>>
>>55419715

-_- seeing this makes me feel like I may of accidentally started a meme.

Btw chip8 emulator in rust has made progress I've started on most of the opcodes. Got around 15 / 35 done.

Still really wishing for some recommendations on a good library for the display / sound.

I'm thinking glium will be good for the display. As for audio I'm thinking about using openal-rs but something that feature rich feels like over kill for just generating simple beeps.
>>
>>55419945
>math is about applying math to reality
>>
>>55414556
template <typename T, typename E = std::enable_if_t<(std::is_floating_point<T>() || std::is_integral<T>())>>
auto sqrt(const T number) noexcept
{
const float threehalfs = 1.5f;
float x2 = number * 0.5f;
float y = number;
long i = *reinterpret_cast<long*>(&y);

i = 0x5f3759df - (i >> 1);
y = *reinterpret_cast<float*>(&i);
y *= (threehalfs - (x2 * y * y));
y *= (threehalfs - (x2 * y * y));
y *= (threehalfs - (x2 * y * y));

return 1 / y;
}


Probably loses some precision.
>>
>>55419945
>math is about reality
>>
File: wew lad.png (6KB, 273x312px) Image search: [Google]
wew lad.png
6KB, 273x312px
wew lad is 4chan's newest meme

>when your program compiles
wew lad

>after an anime OP
wew lad

>when someone itt understands C++
wew lad

>your favorite thread discusses the finer points of fizzbuzz
wew lad
>>
>>55418299
>C fags have to reinvent the wheel every 5 seconds
>>
I fucking hate this piece of shit.
I need to make a MVC project and use it with a SQLite database and entity framework.
Everything is great until you need to download the fucking SQLite EF Nuget package which has a new schema a needs tl update nuget which I cant fucking do because no admin access.
What the fuck do I do now?
Any other database which is in a form of a file and can be used without ANY installations?
>>
std::vector<new class(variable)>;

I need to pop the class off the vector but its dynamically allocated. How do I do this without a memory leak. Do I have to make a pointer and set it equal to the top of the vector. Then delete the newly created variable and finally pop the vector?
>>
>>55417390
>unsigned long long int
made me kek
>>
>>55420724
If you can't write a parser for JSON or something similar yourself, you've failed as a programmer and a computer scientist.
>>
>>55417390
uh is he checking if a number is prime. At first I thought he was checking the nth prime the prime number was.
>>
>>55420886

You're talking about something like this?

    std::vector<int*> test;
test.push_back(new int(8));
delete test[0];
test[0] = nullptr;
>>
>>55420979
well in this case I need to pop. I dont know the index.
>>
>>55421020

If you're sure it is the last element this will work.

    std::vector<int*> test;
test.push_back(new int(8));
delete test.back();
test.back() = nullptr;
test.pop_back();
>>
>>55415581
It depends. What kind of abstract algebra?
>>
>>55420463
>super generic signature
>returns float
>>
>>55414728
>>55414744
>>55414757
>>55414770
Lainchan. The website is cancer of another kind, so I never go there, even though I would almost exclusively go through the lisp general threads when they were on /g/.
>>
>>55421072
Use smart pointers, fucko.
>>
>>55420438
>>55420498
I have 2 apples I get another one now I have 3.
>Not math
Math is an abstraction of the real world and if you had any Idea about math you would realize that.
>>
>>55421266
>auto
>super generic
>>
>>55421373
>
template <typename T, typename E = std::enable_if_t<(std::is_floating_point<T>() || std::is_integral<T>())>>

>casts to float
>returns float
>>
>>55421337

The original post didn't ask what would be the best practice here.

So much rage for very little reason.
>>
>>55421072
yeah the vector is also private. The genius who made it didnt create a way to pop it.
>>
>>55421500
Why can't you just replace the raw pointers with smart pointers here?

... If you can modify the source just refactor the damn thing. If not hopefully you have a way to iterator through it and find the portion you want to delete.
>>
>>55417882
Because in the first case you're formatting the input string that you're passing to target.write, however in the second case, you're attempting to format whatever is returned by target.write call, so obviously that's not what you want to do.
>>
>>55421470
You're right, that was unneeded. :<
>>
>apply for job
>get e-mail with a programming challenge
>it's the maximum path sum challenge from HackerRank

should I just tell them i knew the solution to the problem in the first 30 seconds just from exposure to these code challenges? or do they prefer if I pretend I've never seen this problem before and I'm """"solving it""""" even though I literally just know the best possible solution from the start
>>
>>55420125
I'd personally recommend the sdl2 crate, it's relatively easy to use and contains graphics, sound and input handling.
>>
>>55421787
Are you an honest man?
>>
>>55421787
first

It's a good thing that you do code challenges on your own
>>
how different is writing java for companies vs writing java for shitty hobby projects?
will probably get code monkey job in java, but they think i have 3 years of experience with it

i've only ever used it for small-medium stuff in my free time, but im bretty gud at programming in general
>>
>>55414062
weebshit op at it again
>>
>>55421790

I'll look into I used sdl a couple years back in a few projects.

Oh and this is why you shouldn't be lazy and copy / paste to do things.. I fully intend on separating the mass amounts of repetition in that code into functions so it is not a giant ugly as hell mess.

http://pastebin.com/55Vx8j8s

I wrote this so I could start testing functionality while I check out sound / graphics libraries. Luckily most of it was so similar I could just setup some vim macros to do it faster than c&p. Still doesn't give a excuse for doing this though.
>>
>>55422230

You get a cookie if you notice the mistake I have fixed yet due to a error in the macro.
>>
>>55422230
>>55422252

I should get to bed. Apparently I'm drunk enough to not be able to type coherent sentences anymore.
>>
File: 2340983.png (240KB, 571x733px) Image search: [Google]
2340983.png
240KB, 571x733px
What's the C# version of this?

I've been reading Essential C# 6.0 but it's so dry and convoluted
>>
>>55422385

I'm afraid that Essential C# is the big boy of C# books.
>>
>>55421365
That's a computation
>>
Created and published an app. Just installs shit in a folder. Can I call myself a developer now?
I'm calling myself a developer now since I'm publishing more. Just expansion packs.

Where do I pay marketing to get people to buy my app?
>>
>>55422385
That's a terrible book.
>>
>>55422405
What's the sippy cup version then?
>>
I want to practice graphical programming and maybe make a small game while I do it too.

What library would you suggest that is with C or C++? Also, should I use C for this? Since I want to get better at C than practice my C++, thought C++ might have it with less frustration since a lot of the libraries are in there, and also that I'm kind of very rusty with C.
>>
>>55422444
I'm open to suggestions
>>
>>55422449
SDL is pretty cool, it's purely written in C.

>>55422460
On C++? Since that's the book I meant.
>>
>>55422486
Alright, I will consider learning it. Are there any papers or books that I should look out for specifically for video game mathematics? Stuff like Euler's formula and other useful maths?
>>
>>55422509
I haven't stumbled upon a good one yet. You just need a fairly good understanding of linear algebra. Vector/matrix transformations and the likes.
>>
>>55422520
Oh alright, I'll be actually taking linear algebra soon, but I don't know when it will be a good time for my advisor will suggest me to take it for my major.
>>
>>55422534
And if you really would like to get into programming video games, "Game Engine Architecture" is a great read, but don't stress with that, start simple.
>>
>>55422545
Yeah I guess, I've been playing touhou for a long time and ZUN came to AX this year and that actually got me inspired to get back into programming, but I haven't done any GUI programming at all ;_;

I will see what I can do, start small and eventually get better and make something as I learn.

Are games basically like, moving around images and giving them hitboxes and hurtboxes while applying maths to create patterns and flipping around the pictures n shit?
>>
>>55422575
Yeah, you nailed it pretty well.

Once you get somewhat competent, definitely check out the source codes of the Quakes, and Doom.
>>
>>55422595
Oh definitely! Is Quake's source out there? That fast inverse square root was one of the inspirational point for me to start using pointers more often without fear cause it looks amazing.
>>
>>55422595
>>55422612
Here's the video if you wanna check it out, it's pretty fun if you like touhou: https://www.youtube.com/watch?v=lCEv9zJT0Co
>>
>>55422612
It's all here https://github.com/id-Software c:
>>
>>55422620
Amazing, thank you Anon!
>>
>>55422575

You've described the rendering side and some of the physics.

Gui work is annoying.

Math required depends on the game.

Knowledge on trig, matrices, calculus, and general physics formulas really makes things easier.
>>
>>55422634
Godspeed to you, Anon.
>>
>>55422649
Hmm, I'll probably review these once I start studying some code, but I see what you mean; it's possible to do them without math and just brute-force logic, but using maths will make it more fluid and simpler, but that's the part where "knowing math" comes in I guess.

Like adding up pi/4 incrementally which will give specific locations on the unit circle when applying sin or cos functions instead of figuring out or manually inputting pixel locations/destinations of some objects.
>>
>>55422787
Oh, and when it comes to SDL, this is a fairly good starting point: http://lazyfoo.net/SDL_tutorials
The shown code is awful, but it gives you an idea what you can do with it.
>>
>>55422787

Mathematical Vector operations / equations, Quaternions, Differential calculus and calculus in general for physics, Combinatorics, Probability, and statistics are all pretty common for engine programmers.

If you're interested in AI statistics helps a lot.

Every programmer should be competent in algebra, basic mathematics, and basic trig functions (sine, cosine, tangent, the arc versions of these, and Pythagoras' theorem), and working with vectors properly (Actual calculation none of that velocity++ crap).
>>
>>55414671
learned what? please teach me senpai! ( ≧Д≦)
>>
>>55422920
Yea I believe that, some people in my math class mentioned that they don't need math because they do programming and they can easily get the formula from online, but after finishing calc 3, I can see why understanding them is necessary. I might not know how to properly use a math function in a game yet, but I see why it is needed.

I'm kind of thinking of minoring in maths, since I will need few more classes for it, but I'll see what happens. I'm just going to do this as a hobby though, and so I don't forget everything because I became rusty as fuck now.

Thanks for the tips!
>>
>>55419731
i am now,

much better
>>
>>55423013

Calc 2 was the cut off for comp science when I went to college. Actually it was really easy to double major math (Only about 4 extra courses).
>>
>>55417390
this is how I thought calculators worked before I learned programming
>>
>>55419411
Calculator
>>
Hey I'm new to programming and I want to make text based games to share with my friends.

Well I'm not entirely new to programming, I've picked up and dropped what seems like every popular language at some point or another. I've gotten the farthest with C# but I only like programming with it in visual studio and there is things I don't like about it.

Sorry for the long intro. Is python 3.x being shit a meme? I don't even know what a language being shit means right now actually. I just know that while I enjoyed C and C++ working with strings in them was not very enjoyable and I've heard thats easier in python.

I don't know, I'm so lost.
>>
>>55423645
If you wanna make something quick you can always use php, unless you don't want it to be a web based text based game.
>>
>>55423645
>Is python 3.x being shit a meme? I don't even know what a language being shit means right now actually.

That's too cute, Anon.
>>
>>55423645
Learn Haskell


palindromic captcha
>>
>>55423662
I have no idea how running web based stuff even works. Whenever I use applications and stuff I always tend towards using locally installed applications so I've never even tried using a non compiled language.
>>
>>55423680
Alright, python is something like that, but you don't have braces, just indentations instead.

Use whatever you feel comfortable with and whatever your friends think/feel is easy for them to run.

For PHP, you can get WAMP or something and run it from there, even host it from your computer and give your IP to your friends, or give them the files and let them use WAMP on it or something. But you gotta use small bits of HTML here and there. PHP has its own function names, but it's mostly straight forward since it's written in C. Also the website is very helpful as documentation by just searching up the functions you wanna use.
>>
>>55416030
Install gentoo
>>
>>55423645
Yeah, if your primary intention is to get that game done, go with python. It's kinda shit for larger stuff, but for small quick projects it works great. And it is easy.

There are some programs that generate static executables from python, so your friends don't have to install it.
>>
>>55423780
>python
ignore this
>>
File: 1467387409118.jpg (64KB, 610x553px) Image search: [Google]
1467387409118.jpg
64KB, 610x553px
Can I just get some straight advice?

I'm diving into programming - for free atm, but the sooner I knock out my prereqs and get paid feedback and access to peers (Udacity) the better - and I'm doing it for the terrible reason of I just want to learn programming (and get a job doing it)

I'm thinking data analysis will be the track I'm headed down. I love python and I'm not into front end. I also used to love math and I'm looking forward to fully getting into it

Ruby on Rails also seems appealing though I have no experience using it

My question - how bad of an idea is this? The sooner I'm getting paid for this the better.. how likely is that to happen in the immediate future (bay area here)

I know I sound like a fucking idiot and I'm probably fishing for encouragement
>>
>>55420463
>auto
you dense motherfucker
>>55415691
>>55416182
>>55416572
>>55416941
>>55417112
you should port it to vulkan/mantle
>>
For the people using Python with Visual Studio.

Is there any way to get syntax highlighting for variables?
>>
Which is easier to learn as babby's first functional language, Scheme or Haskell? I wrote some GIMP scripts to automate some simple tasks and used RxJava for a little while, but other than that, my experience with them is next to nothing. I'm really tired of dealing with Java's generics and lambdas.
>>
>>55423956
Haskell, easily
>>
I'm having a problem with textures in SFML. I create my objects, load their textures and store them in Class A's private std::vector. All good. Then I pass pointers to those objects to the std::map of Class B via a method in Class A that takes a reference to Class B as its parameter. It is at this point that the textures of objects stored in A and pointed to by B become NULL. Why is this happening? Thanks in advance.
>>
Could you recommend me some book for learning Python, if I already know some programming language, so I don't need to read 15 pages about how the "for" loop works?
>>
>>55424020
Learn basic syntax from a tutorial. Then try to program something and google as you find stuff you don't know how to do
>>
>Keep coding a problem
>Think of a better way you want to do it mid way through
>Keep adding anyways until the things a fucked up mess
>Would have to rewrite the whole thing because the run time is longer than it should be for a simple problem

I fucking hate that
>>
Would it make sense to use Qt for a video game?
This way you wouldn't have to worry about implementing nor embedding a UI framework at all, you could simply use the Qt GUI which is cross-platform and allows for easy skinning. You could probably take it further and use the QPainter et al for rendering rather than raw OpenGL speeding up the development process. Is there any disadvantage to this approach?
>>
>>55424080
None whatsoever. I believe there's another anon (ab)using Qt for that in the /agdg/ thread in /vg/.

To comply with the LGPL all you have to is link to the Qt DLLs, which is not a problem because you're likely already doing that anyway. (and put a Qt license notice somewhere in your program, perhaps a credits screen.)
>>
>>55424237
I guess my main concern is that with Qt I'm not getting a regular event loop as I'm used to and it could take some time to get used to combining both approaches. I'm familiar with Qt and I know how to utilize the slot and signal mechanism, I've just never tried to combine the two though, or rather, I've also done simple video games that used the traditional event loop and I'll probably take a bit of time to figure out how to migrate that over to Qt but I guess that shouldn't be much of a problem.
>>
So, I've written a 4chan image downloader in C++. It works just fine most of the time, but I've run into a thread where it blows up, giving 'std::invalid_argument' saying there's a parse error. Here is the code https://ghostbin.com/paste/t689n and here is the thread >>55405924 I've tried to validate the thread's json data and it appears to be valid. Any ideas, /g/?
>>
>>55423996
Post code, but probably something runs out of scope too early.
>>
>>55424636
No clue, but you got a memory leak here:
buffer = new char[length];
. Use a smart pointer to hold ownership of the buffer.
>>
>>55424636
And verbose shit like this:
for (nlohmann::json::iterator it = o.begin(); it != o.end(); ++it)
could be greatly simplified with auto:
for (auto it = o.begin(); it != o.end(); ++it)
.
>>
>>55424806
if you don't need the iterator

for (auto x : o)
>>
File: thumbs.jpg (116KB, 600x410px) Image search: [Google]
thumbs.jpg
116KB, 600x410px
>>55424782
>>55424806
>>55424814

Thanks for the pointers.
>>
>>55414556
: sqrt-closer 2dup / over - 2 / ;
: isqrt ( n -- r ) 1 begin sqrt-closer dup while + repeat drop nip ;
>>
>>55424814
> for (auto& x : o)

fix'd
>>
>>55414062
>Anime Edition
so how is everyone enjoying "SE"? first manga to depict pair programming and lewd typing
>>
>>55425104
> for (auto&& x : o)
fixed
>>
Trying to get into Haskell so I can go through an algorithm book and translate to code. Any suggested reading? I am going through Learn You a Haskell and have heard that #haskell on rizon is good
>>
>>55425127
int i = 0;
for (i; i < ARRAY_LENGTH(array); i++
{
void* it = &array[i];
}

fix'd
>>
>>55425159
This is worse in every fucking way
>>
Anyone here work with Ruby on Rails? I'm having a real bitch of a time getting my form to submit correctly.
I have a has_many :through relationship and I'm using collection_select {multiple: true} to generate a list of possible entries, and each selected entry should be saved into the join model as an individual record. However, the form passes the selected entries as an array to be saved in a single record. I'll post my controller actions and view form if anyone wants to take a look.
>>
>>55425127
> for (x : o)
soon
>>
>>55425193
for (auto& [x,y,z] : o)
>>
>>55425198
Would that take 3 elements each iteration from o?
>>
>>55425217
No, it splits a tuple
>>
>>55425217
>>55425234
but you could write some function that groups every N elements into a tuple

for (auto& [x0, x1, x2] : every<3>()(range))
...
>>
>>55425257
>>
>>55420463
oh yeah, I remember this trick. It's from John Carmack, the sort of thing you'd only do in game engine programming.
Thread posts: 319
Thread images: 31


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