[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y / ] [Home]
4chanarchives logo

/dpt/ - Daily Programming Thread


Thread replies: 359
Thread images: 38

old thread: >>53594871

What are you working on, /g/?
>>
first for object oriented traps!
>>
Please do not use an anime image next time, thanks.
>>
public class CTrap : IBoipusi {
public IFeminine benis { get; set; }
}
>>
>>53610798
>systems hungarian
Csharts being GOD AWFUL at programming as usual
>>
>graduating from school soon
>only have one job offer for a job I like, but in a city I don't want to live in, and the pay most likely won't be great
>applied to other jobs a few days ago, and haven't heard back yet
>have to accept or reject this current offer in a little over a week

What do, family?
Do I bite the bullet and take this current offer if I don't hear back from anywhere else in time?
>>
>>53610616
Requesting Nagisa's tickling punishment.
>>
>>53610936
kill yourself
>>
>>53610924
What do you specialise in?
>>
>>53610924
why is this even a question TAKE THE JOB
You're lucky to even have an offer in this climate.

The hardest thing to get is experience, after that, you can apply anywhere and they won't trash your resume.
>>
Daily reminder that real programmers use Common Lisp.
>>
>>53610924
do a python+nodejs startup
>>
>>53610949
>You're lucky to even have an offer in this climate.

But Obama said there are twice as many programming jobs as there are programmers.
>>
>>53611005
What's the point of python if you have node?
>>
>>53611024
memes
>>
>>53611020
There are, don't listen to that guy, if you're a good programmer just put yourself up on the job websites and wait for offers, I recently deleted my indeed account because I was receiving too much spam
>>
>>53611020
Yes, but they're not open to you.
If you're not indian and being imported wholesale from india for minimum wage, those doors are not open to you.

It's amazing how slavery in the first world is alive and well.
Companies love H1-Bs so much because they're literal wageslaves.
They won't complain or else they get shipped back to india.
>>
>>53611020
>there are twice as many good programming jobs as there are good programmers
FTFY
>>
>>53611059
>overestimating the number of good programmers
>>
>>53610616
FAAAAAAAAAAAAAAGGGGGGGGGGGGOOOOOOOOOOOOOOOOOOOOTT
>>
>>53611104
>I'm not a real programmer
m8...
>>
>tfw you've mastered the best programming language
>>
>>53611116
>delusional crossdressing fag thinks he's a programmer
fag...
>>
How does one actually implement a text editor?
Where does the text go?
A dynamically allocated array?
>>
>>53610948
At my current internship I'm doing embedded dev, which is the place that's giving me the job offer, but I'm comfortable with software development too.

>>53610949
I'm kind of leaning towards that too, since I dicked around in school and made my GPA not very good, so I need something to make my resume look nice. It really depends on the pay I guess.
I can tolerate living in a shit town for awhile if the pay is nice enough, but it's a small business in a city with a cheap cost of living, so I'm not expecting much.
>>
>>53611148
just leave if you know you don't belong here
>>
>>53611150
I would say a (doubled?)-linked list of string for lines.
>>
>>53611183
there's only a few crossdressing fags or maybe even just one samefagging trap fag in /dpt/
>>
>>53611179
OP, whats the pay?
>>
File: Flat-File-Database.png (14KB, 450x252px) Image search: [Google] [Yandex] [Bing]
Flat-File-Database.png
14KB, 450x252px
I'm building a small weather station around a microcontroller. I need to develop a program which periodically requests/receives weather data via serial port and saves it on computer. I'm probably going to re-purpose some old 75...200 MHz Pentium computer for this task, provided it doesn't consume too much power.

What kind of data storage should I use? Should I use flat-file database such as GDBM which comes with Python?

Pic unrelated
>>
>>53611310
just buy a raspi and put it in a waterproof container
you can even power it with a solar panel

it's much less trouble than trying to repurpose a powerhungry 90s pentium for this task.
>>
>>53611223
are you this new, really?
>>
Linked lists are by far the most robust and flexible data structure. Why aren't you uskg doublly linked lists yet, /dpt/?
>>
>>53611378
you are really this delusional
>>
>>53611393
*circular
>>
>>53611393
arrays shit all over linked shits
>>
>>53611397
>not a real programmer
opinion discarded
>>
>>53611415
>I tested an array of ints vs a list of ints in highschool
yeah, the real world doesn't work like that
>>
>>53611415
Sorry but arrays are not flexible enough for modern day programing.
>>
I'm working on a microkernel for Aarch64 and wanted to play around with graphics in qemu but the virtual video card is such a piece of shit with such a little documentation I'll have to read the qemu source and bosch one to figure it out
>>
>>53611393
friendly reminder that linked list stack implementations are the best stacks
void stack_push(stack_t *stk, int data)
{
frame_t *frame = (frame_t *) malloc(sizeof(frame_t));
frame->data = data;
frame->next = stk->head;
stk->head = frame;
stk->size += 1;
}

int stack_pop(stack_t *stk)
{
if (stk->head == NULL)
printf("Stack empty.\n");
frame_t *frame = stk->head;
int data = frame->data;
stk->head = frame->next;
stk->size -= 1;
free(frame);
return data;
}
>>
>>53611263
Current internship is $12/hr, which considering the area is actually pretty good, actual job offer pay I'm not sure about.
My boss came up to me and said that he really wanted me to work for him, and that he'd have an official offer for me when he comes back about a week from now.

Considering a good 2br apartment with somewhat modern kitchen appliances and an attached garage costs $750/mo, and the business' website has a global Alexa rating of around 2.5million, I wouldn't be surprised if the offer was for around $35-40k.
>>
File: 1458157421766.webm (3MB, 720x405px) Image search: [Google] [Yandex] [Bing]
1458157421766.webm
3MB, 720x405px
>>53610616
>>
>>53611440 (retard)
>>53611445 (funposter)
fucking retards, arrays are by far more versatile, only in highly exceptional situations should you use a linked list
>>
>>53611393
Enjoy your cache misses
>>
>>53611449
CANCER
>frame_t *frame = (frame_t *) malloc(sizeof(frame_t));
BOOOOOOO
BOOOOOOOOOOOOOOOOOOOOOOOOOOOO
BOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
>>
>>53611480
>by far more versatile
nope
>>
>>53611472
>>53611423
just fucking kill yourself, delusional FAG
>>
>>53611440
>>53611445
Enjoy your cache misses.
>>
>>53611482
>>53611507
>I know nothing about computers
you should just go
>>
>>53611531
epic
>>
>>53611531
wew lad
>>
>>53611531
9/10
>>
>>53611573
what must I do to get that last 1? I'm trying really hard, you know :^)
>>
>>53611601
Try adding on something about averaging 2 ints, or assembly++, or C with classes.
>>
>>53611617
even getchar maybe?
>>
>>53611150
https://en.wikipedia.org/wiki/Gap_buffer
>>
>>53611310
Get a RPi and use SQLite, SQLAlchemy is nice.
>>
>>53611841
so every time i enter a single keystroke, i'm literally mallocing and creating a new node in a linked list?
>>
I need to learn everything about apache and php5. What should I read?
>>
>>53611884
how to build a helium exit bag
>>
>>53611884
i hope this is for learning and not because you sweettalked your way into a sysadmin position without knowing shit.
>>
>>53611884
Why do you want to learn php?
>>
>>53611954
>>53611965
send help
>>
>>53611884
It's 2016, unless you have to work with legacy website code, there's no reason to learn PHP. Python, Ruby, Go or Node will all be better choices.
>>
>>53611867
there are different ways of doing it, some anon posted a good link about it some time ago
>>
File: 256.jpg (29KB, 367x451px) Image search: [Google] [Yandex] [Bing]
256.jpg
29KB, 367x451px
>>53611884
but seriously, try in >>>/g/wdg
>>
If I create a pointer by writing
Object* myObject = someFunction();
, where someFunction returns an Object pointer, do I still have to call delete on myObject?
>>
>>53612067
Absolutely.
>>
>>53612067
Only if someFunction allocates the data pointed.
>>
>>53612067
Object *myObject = new Object;
someFunction(myObject);
delete myObject;
>>
>>53612114
It's not a function that I wrote; I'm using TinyXML.

>>53612097
I deleted it and now the program crashes.
>>
>>53612172
RTFM
>>
Working my way through K&R and hit the following problem, my code:

#import <stdio.h>

int isWhiteSpace(int c)
{
if(c == ' ' || c == '\n' || c == '\t')
return 1;
return 0;
}

#define IN 1
#define OUT 0
#define MAX_LENGTH 20

int main()
{

int wordCount = 0;
int wordLength = 0;

int mode = OUT;

int lengthWordsArray[MAX_LENGTH];

int c;

while((c = getchar()) != EOF) {
if(!isWhiteSpace(c)) {
++wordLength;
if(mode == OUT) {
mode = IN;
++wordCount;
if(wordLength <= MAX_LENGTH) {
lengthWordsArray[wordLength] += 1;
}
}
} else if(mode == IN) {
mode = OUT;
wordLength = 0;
}
}

for(int i = 0; i <= MAX_LENGTH; i++) {
printf("Length: %d, occurs: %d\n", i, lengthWordsArray[i]);
};

}


input: hello four two
output:
Length: 0, occurs: 1
Length: 1, occurs: 3
Length: 2, occurs: 1592698952
Length: 3, occurs: 32767
Length: 4, occurs: 13717504
Length: 5, occurs: 1
Length: 6, occurs: 1682473544
Length: 7, occurs: 32767
Length: 8, occurs: 1592698968
Length: 9, occurs: 32767

Can someone spot the bug?
>>
>>53612172
>It's not a function that I wrote; I'm using TinyXML.
Read the doc. It that doc doesn't talk about it don't use the lib.
>>
>>53610616
which programming language is best suited for traps?

i'm thinkin' python because traps got cute lil pythons between they're legs : ))))
>>
>>53612194
int lengthWordsArray[MAX_LENGTH] = { 0 };
>>
i kinda want to write some remote kind of thing for my iphone that i can use while watching movies on my monitor (pc is away from bed like 4 meters). it only has to simulate some button presses (left right up down, space, enter). how can i get started, what can i use?
>>
>>53612246
>>>/lgbt/
Kill yourself.
>>
File: haskelel.jpg (99KB, 529x598px) Image search: [Google] [Yandex] [Bing]
haskelel.jpg
99KB, 529x598px
>>53612246
haskell
>>
>>53612286
>I'm not a real programmer
>>
>>53612365
fuck off to /b/ your funposting isn't even funny
>>
>>53612284
run hackintosh in virtualbox and install xcode
>>
File: 1419490405524.png (110KB, 638x313px) Image search: [Google] [Yandex] [Bing]
1419490405524.png
110KB, 638x313px
>>53612286
>>
>>53612498
>>>/lgbt/

>>53612498
>>53612365
Ban these spamming trollfucks. Same shit thread after thread.
>>
How does /g/ motivate themselves to do courseworks? I feel them starting to pile up and I cannot motivate myself no matter what ;_;
>>
>>53612411
i was trying to avoid that but i guess its the only way, thanks.
>>
File: 1458567993032.png (87KB, 390x352px) Image search: [Google] [Yandex] [Bing]
1458567993032.png
87KB, 390x352px
>>53611455
>mfw my first internship paid 35/hr
>>
File: 1395468415927.png (555KB, 689x637px) Image search: [Google] [Yandex] [Bing]
1395468415927.png
555KB, 689x637px
>>53612522
i dont know why you keep trying to send me to /lgbt/, i'm not gay

anyway please post on topic like i've been doing, i had sparked a very productive and interesting discussion about programming languages before you came along
>>
Is it possible to compute an upper limit to the number of unique, distinct sorting algorithms which can possibly exist?
>>
>>53612733
Yes, there is a countable infinite amount of sorting algorithms.
>>
File: Bait.png (114KB, 955x957px) Image search: [Google] [Yandex] [Bing]
Bait.png
114KB, 955x957px
>>53612684
>>
>>53611499
vectors are by far more versatile
>>
>>53612663
nigga where
>>
>>53612498
I am a trap lover but this board just makes me depressed.
>>
>>53611500
>>
>mfw dropping github in favor of gitgud
I finally realized how fucking awful the github UI is. Besides that, it feels good not to contribute to white genocide.
I'm still amazed why hotwheels still hasn't switched over.
>>
>>53612991
What anime?
What does it mean?
>>
>>53613004
Both shit. Host your own.
>using git
>not cvs
>not having your own irc and mailing list
>>
>>53613011
Death Note

You'd be dead so you'd be not gay anymore

java sucks
>>
Any way to go from reference to raw pointer in Rust without having to rewrite the type again?
>>
>>53613042
Yes, start using an actually good language
>>
>>53612914
casio
>>
>>53610616
webdev general's explaining to me why circular arrays are impossible RIGHT NOW
>>
File: 1456007784488.gif (18KB, 340x340px) Image search: [Google] [Yandex] [Bing]
1456007784488.gif
18KB, 340x340px
>>53613030
>cvs
>>
File: 1422598919393.png (136KB, 459x499px) Image search: [Google] [Yandex] [Bing]
1422598919393.png
136KB, 459x499px
>>53613042
>Rust
>>>>>>>>>>>Rust
>>
>>53613071
lets fuck their shit up senpai
>>
>>53612395
>mad for getting called out
>>
>legacy languages course
>have to use rpg on a fucking as400
Mother of Christ what an abomination. I would rather write in fucking machine code than this. And to top it off the fucking professor never taught anything about it.
>here's the reference manual have fun editing these rpg programs
Aaaaaahhhhhhh
>>
>>53613214
>>legacy languages course
lolwut?
>>
>>53613004
>github
>hosted by a stable SF company full of self-hating white people
>99.9999999% uptime
>gitgud
>hosting by a single virgin NEET who drags video game politics into programming
>site will literally die about 11 months after the NEET decides to kill himself because his hosting service stops receiving payment.

I think I'll chose the former.
>>
>>
>>53613214
Implement a lisp in it and make your programs in it. This is what I do when I have to program in a language I do not like/know well
>>
>>53613214
You're taking a class on outdated languages? WOT
>>
>>53613242
Part of the cs core here. We have to use shit like cl, rpg, the as400 pdm, etc. It is miserable. He literally just gives us IBM reference manuals for the languages and says he'll answer questions.
>>
i'll ask you the same questions i asked /wdg/

without googling anything,
can /dpt/ make a fizzbuzz?
can /dpt/ make a function that swaps the values of 2 integer parameters?
can /dpt/ explain how to swap the values in register A and register B with only logical operations and not using any additional space?
can /dpt/ create a circular array?
>>
>>53613267
why would you willingly publish an article about how you're too incompetent to learn basic math?

please tell me this delusional "webdev" is being blacklisted everywhere
>>
>>53613267
is this real
>>
>>53613297
What uni?
Can you post the rest of the modules?
>>
File: 1458104179403.jpg (309KB, 680x1671px) Image search: [Google] [Yandex] [Bing]
1458104179403.jpg
309KB, 680x1671px
>>53613071
"This is impossible" is a valid answer. Nothing to see really.
>>
>>53613274
I wish. The entire thing is being done inside the as400 pdm. We have to use rpg.
>>
>>53613312
>fizzbuzz
yes
>swap function
yes
>swap with no 3rd variable
why would you want to do this in 2016?
nobody would willingly use XOR swap or addition swap in production code.
>circular array
so it's like a linked list where the last node points to the first?
>>
>>53613257
If gitgud blows up, I'll move to something else like neetcode.
>>
File: 1457475652595.jpg (20KB, 500x313px) Image search: [Google] [Yandex] [Bing]
1457475652595.jpg
20KB, 500x313px
>>53613267
>my impostor-prone state
>>
>>53613386
>so it's like a linked list where the last node points to the first?
it's a circular ARRAY you buffoon
>>
>>53613410
neetcode will die too
if you actually require git hosting, just use something that's free and won't die tomorrow because it's backed by real money, not neetbux.
>>
>>53613331
University of southern Indiana, so it's not really any know institution.

Not sure what you mean about modules, but I assume it's something like what we are all doing in this class. Pic related is all there is on the syllabus.
>>
>>53613448
By that time a dozen others have spawned. It's not like my code magically disappears.
>>
>>53613443
He's trying to have the "circular" part clarified anon. Think before you flame. Anyway, what counts as "circular" and what doesn't? The array+modulo thing seems valid to me...
>>
>>53613061
but he already said he's using Rust, silly
>>
>>53613312
fizzbuzz:
void fizzbuzz(int limit){
boolean printNum;
for(int i = 1; i <= limit; i++){
printNum = true;
if(i%3==0){
printf("fizz");
printNum = false;
}
if(i%5==0){
printf("buzz");
printNum = false;
}
if(printNum){
printf("%d", i);
}
printf(", ");
}
}


swap 2 integer parameters
void swap(int &x, int &y){
int temp = x;
x = y;
y = temp;
}


swap register A and B (not entirely sure about this one?)
A = A XOR B;
B = A XOR B;
A = A XOR B;



circular array: not going to write out all the code for that but i remember you keep track of the start and end positions, and you access things relative to the start. i know modulo factors into it too
>>
>>53613071
You could simulate it with a wrapper quite easily, but if you're working with a standard array in a normal language, it's not possible to make it infinitely repeating because you don't control how the "next" element of any other element is selected - it's just whatever's next to it in memory.
>>
>>53613487
he's trying to pull the linked list bait again
>>
>>53613312
>can /dpt/ make a fizzbuzz?
Yeah
>can /dpt/ make a function that swaps the values of 2 integer parameters?
Yeah
>can /dpt/ explain how to swap the values in register A and register B with only logical operations and not using any additional space?
So just an XOR swap?
>can /dpt/ create a circular array?
It'd take me a few minutes to think about it, but that's just keeping track of the start and end positions and doing some modulo fuckery to create the circular affect, right?
>>
>>53613515
in a circular linked list, you could just insert a node literally anywhere in your daisy chain.
>>
>>53613551
and how long does it take to peep at an item in a given spot in the list? what about in an array?
>>
>>53613551
fucking retard, you have your current position that you write to, you don't insert shit anywhere willy nilly
>>
File: 1456133419115.png (135KB, 600x551px) Image search: [Google] [Yandex] [Bing]
1456133419115.png
135KB, 600x551px
>>53613535
They truly are the most simple and elegant sequences, especially when you want to parse arbitrary semantics out of them. Here's a circular one 4u
#1=(fizz buzz fizzbuzz . #1#)
>>
File: konata.png (86KB, 261x226px) Image search: [Google] [Yandex] [Bing]
konata.png
86KB, 261x226px
friendly reminder that linked lists are literally perfect and you can AND should use them for everything
>>
>>53613515
What language was that, C#?
>>
>>53613694
C **
whoops
>>
>>53613550
Simple enough. This is why /wdg/ or just web-devs in general are a joke.
>>
>>53613683
>terrible random access speed

No. >>>>>>>>/wdg/
>>
>>53613515
>>53613550
It's funny that you want to use the start and end pointers. I was simply thinking of it as keeping the start pointer and the size, then modulusing every access with a wrapper. An array is a ref to the block + its size. Using and end pointer instead means encoding the start and the size into it, which feels redundant. Obviously performance is importanter. And sucks that modulo doesn't round towards negative in C.
>>
>>53613630
SICP MASTER RACE
>>
>>53613694
might not be compilable but i was aiming for C++. i'm rusty in it though, since my university makes us use java now. been over a year since i've written in it
>>
What is a good IDE for my tablet to code mobile??
>>
Should I learn Haskell or Erlang? Which is a more beautiful and readable language? Which is better for actually solving practical problems?

Alternatively, what other functional programming language should I learn?

I've already read my SICP.
>>
>>53613683
>not using trie-based vectors for everything
>>
>>53613683
I'll let le SEPPLES man explain why linked lists are bad.
https://www.youtube.com/watch?v=YQs6IC-vgmo
>>
>>53613683
says the retard that doesn't even know what a circular buffer is or what it's used for
>>
>>53613780
THE SEPPLES HAS SPOKEN
>>
>>53613768
Both, stop being a lazy ass.

>Which is a more beautiful and readable language?
Beautiful? Haskell
Readable? Erlang

>Which is better for actually solving practical problems?
Define practical problems. If you want fault tolerance, concurrency and making web servers then go for erlang.

>I've already read my SICP.
Read your CTMCP then.
>>
>>53613768
>programming language
>beautiful
Stopped reading there.
>>
>>53613768
F# ',:^)
>>
>>53613816
I knew I was fucking right. Fuck you linked lists.
>>
File: BUNBUUU.jpg (107KB, 932x651px) Image search: [Google] [Yandex] [Bing]
BUNBUUU.jpg
107KB, 932x651px
>>53613760
an ssh client connected to your workstation at home
>>
>>53613854
comparing haskell and erlang syntax is like comparing a piece of shit and a pile of shit.
>>
>>53613768
>erlang
>readable
On a more serious note, Erlang is pretty specific about the problems it can solve but is VERY good at it. So probably Haskell.
>>
>>53613758
Ah, I've never personally seen %d been used in C++, although I've barely touched on it though. Only ever seen it in C
>>
>>53612246
Please start taking hormones as quickly as possible
>>
File: 1458596493021.jpg (165KB, 788x1013px) Image search: [Google] [Yandex] [Bing]
1458596493021.jpg
165KB, 788x1013px
>>53613768
Learn Scala :^)
>>
>>53613844
>Read your CTMCP then
Is this book actually good or is this a fresh new meme I haven't heard about?
>>
>>53614135
It is
>>
>>53610889

gill yourslef xD
>>
>>53611951
>>53611884
9/10 post, could've been 10/10 if he linked a tutorial to building an exit bag tho
>>
>>53614112
He used the words "beautiful" and "readable".
>>
>dat banding
and retards say we don't need 10+ bpc color or 24+ bit audio
>>
>>53614159
microsoft cannot into hungarian notation, you can't deny that
>>
File: 1458019263810.png (1MB, 1000x1400px) Image search: [Google] [Yandex] [Bing]
1458019263810.png
1MB, 1000x1400px
Hey /g/. What is the difference between an algorithm and a datastructure? Related: is a modulo-based cyclic array a datastructure distinct from a regular array, or is it rather an algorithm on top?
>>
>>53614407
trying too hard
>>
>>53610616
who's the girl
>>
>>53614407
>he does this to blame traplovers
jewish fag
>>
// Does a bubble sort of the names
void sortNames(vector <string> sort){
for(int i=1; i<sort.size(); i++) {
for(int j=0; j<sort.size()-i; j++) {
if(sort[j] > sort[j+1])
swap(sort[j], sort[j+1]);
}
}
}


I'm still working on/learning this stuff, is this snippet of code correct?

It doesn't make sense to me that int i and int j don't need to be declared within the function and can just be freely used in the for loops.
>>
>>53613004
>white genocide
hahahahahahahahahaahaha
>>
>>53614425
Nagisa from Stains;Gate. She is a shrine maiden.
>>
File: hqdefault.jpg (11KB, 480x360px) Image search: [Google] [Yandex] [Bing]
hqdefault.jpg
11KB, 480x360px
>>53614420
What's wrong senpai? Isn't /dpt/ for long-lasting flamewars about pointless minor semantic differences? I thought so...
>>
>>53614361
>microsoft cannot into hungarian notation, you can't deny that

Which is ironic considering that the inventor of the method was a chief architect at Microsoft.
>>
Should traps wear diapers while programming and what are the best diapers to wear and what are some good clothes to go with diapers?
>>
Hi there guys, iterating through a loop and placing this in a function, how can this be done?

ioctx = cluster.open_ioctx(str(cluster.list_pools()[0]))
data_objs = ioctx.list_objects()

for data_obj in data_objs:
print data_obj.key

locateObjects = "ceph osd map " + str(pools[0]) + " " + str(data_obj.key)
process = subprocess.Popen(locateObjects.split(), stdout=subprocess.PIPE)
output = process.communicate()[0]
print output


Say for instance that data_objs is a list of objects, and say they are called, test_object_1, test_object_2 and test_object_3.

Know when I do the subprocess function with Popen, it only does it for the test_object_3, the last value in the list.

Even when i removed the print function for data_obj and included made it so for data_obj in data_objs THEN subprocess, it didnt process anything.

tl;dr, how to I get it so that the sub process does it for every item in data_objs rather than only the last data_obj in the list?
>>
>>53612246
any more barefeet trap images? there a bit hard to come by on danbooru
>>
>>53614489
Traps should not program but accompany the actual programmer.

They should wear diapers if their masters tell them to.

>what are some good clothes to go with diapers?
gag, blindfold and penis cage while being barefoot and having their feet forcefully painted/tickled
>>
>>53614460
I love how bad /pol/tards are at hiding their leakage from their containment board
>>
>>53614447
>I'm still working on/learning this stuff, is this snippet of code correct?
I haven't spotted any mistakes.
>It doesn't make sense to me that int i and int j don't need to be declared within the function and can just be freely used in the for loops.
Why?
>>
>>53614460
low-quality bait
>>
>>53614585
>Germany is setting itself up to become predominantly non-white within a single generation.
Yes please, fuck germany.
>>
>>53613986
So you're saying Erlang should've been a library in the first place. Makes sense to me.
>>
>>53614612
it's also gonna happen to usa or whatever shithole you live in, it's what the jews want
>>
>>53614627
>it's also gonna happen to usa
You are making it sound better and better!
Thanks refugees!
>>
>>53614644
fuck off kike
>>
>>53610616
expression parser and contemplating suicide
>>
>>53614627
>DA JOOOOOOOS
Back to /pol/, please
>>
>>53614662
Fuck off german faggot.*
I hope your wife, daughter AND son get raped by niggers.

*The g was lower-case intentionally.
>>
>>53614604
Because every function until now has been, "Declare your variables before using them in the function"

There hasn't been any clear explanation that I can declare a variable inside a loop, or that I can't declare the variables outside the loop. It's explained one way, and then all of a sudden it's being used in an entirely new way, and somehow you can't comprehend how that can be confusing?
>>
>>53614709
didn't make enough shekels today huh
>>
>>53614464
I liked the shrine maiden (s)he's cool
>>
>>53614020
It's not C or C++ because boolean isn't a type in C or C++. It's bool in C++ and C doesn't have a boolean type.
>>
File: shut-it-down-jew.jpg (658KB, 2040x3160px) Image search: [Google] [Yandex] [Bing]
shut-it-down-jew.jpg
658KB, 2040x3160px
>>53614685
>>
>>53614495
Please, any ideas?

It's Python, don't let the application code put you off,

I'm basically just asking how to take multiple objects from a list, and for each object, do a linux command with it
>>
>>53614407

algorithms ≡ data structures
>>
>>53614585
demographic changes aren't genocide you fucking retard
>>
>>53614732
didn't destroyed enough white empires today huh? German barbarian.
>>
>>53614839
"the holocaust" wasn't genocide then, it was just some demographic changes
>>
>>53614447
you can declare variables in any part of a function. int i and int j are being declared in the for loop headers.
>int i=1
>int j=0
>>
>>53613780
>advanced algorithms
>can't even make a fucking power point presentation

Embarrassing
>>
>>53614685
explain this

https://www.youtube.com/watch?v=w3ugHP-yZXw
>>
File: 1396651518856.png (46KB, 509x667px) Image search: [Google] [Yandex] [Bing]
1396651518856.png
46KB, 509x667px
>>53614918
>power point
>>
>>53614839
>demographic changes aren't genocide you fucking retard
They literally are.
>>
>>53614887
Would it fuck anything up if they were declared beforehand?

I can't see how it would; e.g.
int i;
int j;

And then the loops give them values.

It's just less efficient, right?
>>
>>53614712
Read up on variable scope. The variables are being declared as part of the for loop and can only be accessed inside of it's respective scope.
>>
>>53614970
>It's just less efficient, right?
no
>>
>>53614970
You would look retarded yes
>>
File: 5028401.gif (26KB, 250x247px) Image search: [Google] [Yandex] [Bing]
5028401.gif
26KB, 250x247px
>>53614937

Why does it always have to be Jews? I want to like them, but come on.

Gun control? Jews.
Socialism? Jews.
Communism? Jews.
Instigation of racial violence? Jews.

Seriously Jews, get it together.
>>
>>53615014
"Get a life jews" https://www.youtube.com/watch?v=qYVK_OqyUzk

Anyways, does anyone use python un-ironically?
>>
>>53614585
>predominantly non-white
So what? The fact that genetics change due to changing populations is not genocide. In fact, I see no problem and I do not care for people's skin color. I see no reason for Germans to be "white". Can you provide an argument that isn't based in subjective conceptions of beauty?

Are whites being rounded up and put in forced labor camps and mass killed? If not, then it's not genocide.

>>53614605
Yes, because everything you disagree with is of course bait.
>>
>>53615057
>Anyways, does anyone use python un-ironically?
it's mostly just the samefagging python troll that gives the appearance that people use it
>>
>>53615067
>Can you provide an argument that isn't based in subjective conceptions of beauty?

Race isn't just a difference in the level of melanin, lad.
>>
>>53615102
I never said that it was. "White" is a skin color, not a "race".
>>
>>53615088
figured as much
>>
Hey /g/uys, I was curious what kind of projects someone learning programming should aim for? I am learning C right now, and was planning on just making my first project like, a D&D based text adventure kind of thing, something I could accomplish, probably over a weekend.
After that I was planning on learning C++, and was wondering if I should just kind of add polymorphism or something to the original project for C++, what would you guys recommend?
And then I was planning on learning Java and C#, and was planning on making kind of like, a game demo kind of thing, say, one level of super mario kind of thing, just, a small level, give it mechanics, and the basis of how i would want a game to perform, because I've heard that the tools available are better for... making a small game quicker in like, C#, than in C++.
>>
>>53615067
https://en.wikipedia.org/wiki/Genocide_definitions

You're talking out of your ass. Go read some actual definitions of the word.

Eliminating white populations through demographic replacement is still genocide, no matter how much you desperately try to deny it.
>>
>>53615134
this
>>
>>53615134
Your argument reminds me of the sjws that want more womyn in technology.
>>
>>53614970
>Would it fuck anything up

Yes. There are languages which you absolutely must declare the variables beforehand. But modern languages don't need this anymore.

In any case, it's considered a matter of visibility. Check this out:

printmemes() {
for(int n = 0; n < 9000; n++) {
print("meme " + n);
}
print("done");
n = 0; // reset back to 0
}


There are languages that won't allow this. The n = 0 in the last line won't compile because the int was declared inside the for loop. If you want n to be accessible outside the loop, you have to declare it outside:

printmemes() {
int n;

for(n = 0; n < 9000; n++) {
print("meme " + n);
}
print("done");
n = 0; // reset back to 0
}


This is useful if you want to continue working with the last n value. If the language allows it and you don't give a fuck about n after the for loop, you should just do it like the first example.
>>
>>53615115
>"White" is a skin color, not a "race".

Right, but white skin also suggests certain things about the genetic makeup of a person. Black skin does the same.
>>
>>53615115
Semantics; you know damn well that an arab isn't genetically equivalent to a white german.
>>
File: cabug.png (23KB, 640x480px) Image search: [Google] [Yandex] [Bing]
cabug.png
23KB, 640x480px
>>53610616
Debugging my cellular automata.
>>
>>53615124
Make something like this one http://pastebin.com/AcmcNzMX
>>
>>53615167
Germans are not white. Kill yourself fucking barbarian.
You are in no way better than the sandniggers.
If you want to save Europe you should start from exterminating germans and THEN go to the niggers.
>>
>>53615166
>Right, but white skin also suggests certain things about the genetic makeup of a person.
It suggests but does not imply.

Let's say we are talking about the white race. My argument still holds. I see no reason to preserve one over another other than based in subjective conceptions of beauty and feelings of who belongs and doesn't belong that are formed by mother's knee inculcation and habit.

>>53615134
Say that it is genocide. This does not necessarily make it bad. Attaching a label to an act does not make it necessarily bad - rather, it is the nature of the act itself. My judgement is that what is happening is not bad. Thus there is at least once case, if you are correct about the definition, where genocide really isn't that bad.

Not only that, but the idea that we can have a "cide" word without any killing involved is preposterous to me.
>>
>>53615163
Is there a standard to always declare the variable like in the second example?

Or will everyone >>53614993 just call me a retard for doing it and I should just go willy nilly however I like so long as it works?

I do personally think it's clearer with the variables always declared in the beginning of the function.
>>
caucasians and east easians have the most neanderthal DNA and are the most capable of rational thinking

niggers and sandniggers are literally stupid as hell, it has been statistically verfied
>>
asd
>>
>>53615230
>Say that it is genocide. This does not necessarily make it bad. Attaching a label to an act does not make it necessarily bad - rather, it is the nature of the act itself
This
This is what SJWs do not undserstand, calling something sexist/racist/etc does not make it bad, "it is the nature of the act itself" as you say.
I hope stormfags realise that they are no better than the SJWs.
>>
>>53615230
It's certainly bad for anyone with white genetics who will soon be seeing everything about their race, their civilization, destroyed.
>>
>>53615238
You'd be a retard for not following the standard.

The proper way to do it now I guess is to use the auto keyword which I guess makes c++ a weakly typed language. People might disagree with that.
>>
>>53615238
>Is there a standard
No. Every language does it differently.
>>
>>53615282
we're not allowed to have holocaust-tier genocide, but when jews do it to whites in subtle ways it's ok, makes sense huh
>>
>>53615308
For C++ there is a standard though (ISO)
>>
>>53615306
Stop posting.
>>
Dependent types in C++
http://pastebin.com/5prxGKG1
bool not_zero (int x) { return x != 0; }

// divide(x,y) requires proof that y != 0, so it will
// NEVER divide by zero
template <typename X, typename Y>
int divide (X x, Y y, PredTrue<Y, not_zero>)
{
return x / y;
}

char _y[1];
char _x[1];

int main (int argc, char** argv)
{
value<int,_x> x = atoi(argv[1]);
value<int,_y> y = atoi(argv[2]);

if (auto proof = pred<int, not_zero>(y))
{
std::cout << divide(x, y, proof()) << std::endl;
}
else
{
std::cout << "divide by zero" << std::endl;
}

return 0;
}
>>
File: c9e.gif (3MB, 500x500px) Image search: [Google] [Yandex] [Bing]
c9e.gif
3MB, 500x500px
daily reminder to report all off-topic /pol/ shitters who post about "muh white genocide" instead of talking about PROGRAMMING AND COMPUTER SCIENCE
>>
>>53615322
Typical SJW, making unrelated arguments.
>>
>>53615230
>I see no reason to preserve one over another other than based in subjective conceptions of beauty

It's not about beauty (which should be apparent to regulars, because I love black women the most), but about civility.

Ever notice that 1-on-1 with a black/arab/etc person is usually fine, but they tend to go full-retard when in groups?

That's the issue.
>>
>>53615387
fuck off trap fag idiot

>>53615391
you're too retarded to understand
>>
>>53615344
You're wrong. The Java style convention is completely different though.
>>
>>53615387
>glasses
cuck

>>53615399
>It's not about beauty
True, it's about muh feelings.
>>
>>53615238
Here's why it's weird. What looks worse...
int i = 0;
for (; i<9; ++i) {
puts("hello");
}

or...
    for (int i = 0; i < 9; ++i) {
puts("hello");
}


The first one also makes "i" accessible by the rest of the function, which really does suck when you have multiple loops.
>>
>>53615238
it's only standard in very old school C
>>
>>53615387
they're still less annoying than trap-posting homosexual weebs
>>
>>53615408
You are too butthurt to make a civilised argument, just like a good sjw you are, fellow car poster.

>boobs
>trap
>>
>>53615416
That's because java is another langauge

there's LITERALLY a standard for C++
https://isocpp.org/std/the-standard
>>
>>53615438
>very old school C
Anything pre-C99. You are wrong.
>>
>>53615451
kill yourself, i'm not wasting my time on a useless retard like you at midnight, and i posted a car thread ONE FUCKING TIME FUCKING IDIOT CLOSETED CAR FETISHIST
>>
File: the new furfags.png (78KB, 1306x354px) Image search: [Google] [Yandex] [Bing]
the new furfags.png
78KB, 1306x354px
>>53615387
/pol/tards are the new furfags

they literally can't stop talking about their obsession with white genocide, cuckoldry and niggers/sandniggers

they have to inject their ideology into every topic they're remotely interested in, regardless of how unrelated it is.
>>
>>53615478
cool story fag
>>
>>53615417
>True, it's about muh feelings.

That's not what I said. You aren't very good at reading, my main man.
>>
>>53615469
>ONE FUCKING TIME
Multiple times shitposted threads with it. Just like you do now with these hot SJW opinions.

>hurrrr it's not my job to educate you!
>the argument ends now!!!
>blocked, bye!

>at midnight
It's not midnight, it's 11:02 (UTC is a thing). German barbarian aka "shame of Europa".
>>
>>53615238
<--- read this
>>
>>53615478
found the redditor
>>
File: Arash AF10_0.jpg (565KB, 1920x1280px) Image search: [Google] [Yandex] [Bing]
Arash AF10_0.jpg
565KB, 1920x1280px
this triggers the sperg (i don't really like this car but whatev)
>>
>>53615520
>That's not what I said
I did not imply that you said that, my beloved niggerloving cuckold. I intentionally quoted you and extended your sentence a bit out of context.
>>
>>53615465

C99 was standardized in early 2000. That was 23 years ago.
>>
File: hmm, yes.jpg (34KB, 396x303px) Image search: [Google] [Yandex] [Bing]
hmm, yes.jpg
34KB, 396x303px
>>53615557
>>
>>53615560
Old school C implies pre-standard C.
>>
>>53615557
>I intentionally quoted you

It must have been somebody else, because it wasn't me.

>niggerloving cuckold

I detest the accusation that my niggerloving has anything to do with cuckoldry.
>>
>>53615557
>>53615549
>>53615500
arr are same
>>
>>53614447
"i" is the pivot element, it must be in the range of [0, sort.size() - 1).
"j" is element to compare with "i", you doesn't need to compare "j" with previous values of "i", so it must be in the range of [i, sort.size()).
And finally the comparison must be between pivot "i" and current element "j".
>>
>>53615573
not really, anything 90s or earlier can be old school

>>53615584
no
>>
>>53615576
You did say
>It's not about beauty

>I detest the accusation that my niggerloving has anything to do with cuckoldry.
Keep telling yourself that.
I bet you asre also into femdom.

>>53615584
>>>53615557 (You)
Excuse me, but I am posting against the car-posting SJW.

>>53615593
Except that old school C means pre-standard C.
>>
File: 1414772269006.jpg (130KB, 1456x769px) Image search: [Google] [Yandex] [Bing]
1414772269006.jpg
130KB, 1456x769px
>>53615626
>Except that old school C means pre-standard C.
i'll let you believe that
>>
>>53615626
Show me in the dictionary where it says old-school == pre-standard
>>
>>53611455
>>53612663
My first was 25 at usaa and 31 at amex for my second. P comfy
>>
>>53615649
>"old school C" == "old-school"
Some nice logic there
>>
>>53615626
>I bet you asre also into femdom.

What does femdom have to do with cuckoldry?
>>
>>53615648 (Me)
>Except that old school C means pre-standard C.
why do spergs keep making shit up, or is it just literally one sperg that keeps posting in /dpt/
>>
>>53615591
>"j" must be in the range of [i + 1, sort.size()).
Fix'd
>>
>>53615648
>>53615704
Butthurt german baby detected,
>>
>>53615718
i'm not even german, that's another thing you made up in your fragile sperg mind
>>
>>53615291
What makes it "theirs"? Because they share the same skin colour? Certain phenotypes?

Not only that, but it's only bad if one identifies as being "white". When one ceases to identify, when one ceases to place one's ego in "whiteness", one is liberated from the consequent suffering and worry, isn't he?

>>53615399
>Ever notice that 1-on-1 with a black/arab/etc person is usually fine, but they tend to go full-retard when in groups?

Do you not see the irony? Here we have the problem with group identification. One identifies as part of a group, places his ego in the group, declares the group to be part of himself - and consequently, he feels worry and suffering.

Furthermore, we see a fallacy arising. The fallacy is thus: you assume that the resultant behaviors of these groups of people (unsubstantiated, of course) is due solely to the genetics. For if it were not due to the genetics, you would not be talking about race but about culture, which can be learned and unlearned. If it were due partly to the genetics, you would be notice differing levels of "civility" in the populations - some with maximum possible civility as far as the genetics allows and some with minimum.

But because you have not alluded to this second component of the behavior of the groups you listed, I can only assume you are ignorant (not finding more information on the matter), lying (for the purpose of giving your argument more weight) or simply you believe that genetics ("race") is the sole cause of the behaviors.

I will not be cynical and assume the latter. We see that there are in fact people of the groups you listed who do behave in a civil manner - for example groups of black lawyers or Syrian Christians or Japanese people on a bus.

By counterexample, you have been found to have made a mistake in your reasoning. There are groups of "black/arab/etc." people who behave civilly.

Maybe you just like white ass.
>>
>>53615124
>And then I was planning on
>After that I was planning on
>And then I was planning on
>And then

I admire your ambition but you should really focus on one thing at a time buddy
>>
>>53615758
fucking retarded
>>
File: black_waifus.png (9KB, 377x461px) Image search: [Google] [Yandex] [Bing]
black_waifus.png
9KB, 377x461px
>>53615758
>you would be notice differing levels of "civility" in the populations

Which is true, outright. Ever notice how Africa is a garbage heap?

>Maybe you just like white ass.

You don't even know me you little weenie.
>>
>>53615460
I would agree with your statement but that's not allowed in Python.
>>
>>53615812
>African Women, ... Properties
>, ...
Let me take a wild guess
>, femdom, cuckoldry, ballbusting, CP, gay rape
Yep! Sounds like OSGTP to me.
>>
>>53615875

There's femdom with black women in it, but that's about it. Tell me you wouldn't let Skin Diamond abuse you, homo.
>>
>>53615694
nothing, but a lot of faggots in denial think that gay shit they get off to, like pegging and cuckoldry, has anything to do with femdom
>>
>>53615889
Sorry, I am actually a man, not a faggot like you.
>>
>>53615765
The reason I was planning on moving onto the other languages is that I've heard once you're learned one in a family (C, C++, Java, C#) the others come easily, I don't recall the name of that family of languages... procedural?
>>
I must be doing something wrong...
>EE
>3 years programming experience
>been applying to places for 3 weeks and I've only gotten a call from a recruiter
I used to think I would appreciate a rejection letter but it's just so soulless getting a standard form rejection letter.
>>
>>53615903
It does.
>>
>>53615903

No, this is just regular run of the mill femdom.

>>53615906
>I am actually a man

I have my doubts.
>>
I've been trying to install reddit on a server (DigitalOcean is so awesome) so that I can start making contributions. I've been a babby programmer for way too long, and I want to jump into something.

>inb4 :^)
>>
>>53615977
Also, I fucking hate software companies that don't keep their documentation up to date, or don't make it accessable in the first place.
>>
>>53615977
:^)
>>
>>53615925
>call their HR department, ask for their IT managers' number
>call IT manager, ask if he's looking for anyone in x jobtype or if he can refer you to someone else looking for workers in x jobtype
>if he's hiring, get interviewed
>if he's not hiring, get referral to someone who is
>repeat until hired
>>
Might be more of a /wdg/ question but are there any good alternatives to Selenium for scraping a website with Javascript elements in it? (i.e. scraping data off a non-static page)
>>
>>53616026
>Make sure to look him in the eye and give him a firm handshake
>>
>>53615925
Your resume must be/look like complete ass

Take that as advice. Take it to a professional m8.
>>
>>53615925
dunno senpai.
I'm a CS major who dicked around in school because I'm a piece of shit, and I ended up getting an embedded dev job.
Make your resume look prettier.
>>
An acquaintance of mine, let’s call him Mike, is looking for work after getting laid off from a contract role at Microsoft, which has happened to a lot of people I know. Like me, Mike has 11 years in industry. Unlike me, he doesn’t know a lot of folks at trendy companies, so I passed his resume around to some engineers I know at companies that are desperately hiring. My engineering friends thought Mike’s resume was fine, but most recruiters rejected him in the resume screening phase.

When I asked why he was getting rejected, the typical response I got was:

>Tech experience is in irrelevant tech

>“Experience is too random, with payments, mobile, data analytics, and UX.”

>Contractors are generally not the strongest technically
>>
>>53616147
hello hacker news
>>
>>53615441
t. Sjw
>muh feelings
>>
>>53616115
idk i'm using the same format I did when I graduated. 1/2 jobs I applied to I got callbacks.
maybe HR wants super detailed descriptions for people with work experience..
>>
How hard is it to build a neural network? Even like a retardedly simple one?
>>
>>53616192
float t(x){
return x;
}

optimizes x
>>
>>53616192
From scratch? Can be very finicky but not especially hard.

Using a library? Piss easy.
>>
>>53616062
All resumes look like ass

literally every single person who looks at your resume will have a completely different idea what a 'good' resume looks like

It is literally impossible to make a good looking resume.
>>
>>53612194
I see a number of problems. The crazy numbers you get are because C doesn't initialize anything for you. Since you don't give any values to the word length array, it contains garbage.
int lengthWordsArray[MAX_LENGTH] = { 0 }; // when an initalizer is given, all elements not initialized are set to zero


Next, you have a potential buffer overflow problem. Consider:
int lengthWordsArray[MAX_LENGTH];
.
.
.
if(wordLength <= MAX_LENGTH) { //<-- OOPS! Arrays are zero indexed!
// this allows the function to write one element pass the end of the array
// should be
if(wordLength < MAX_LENGTH) { . . .


You have the same problem with the for loop:
  for(int i = 0; i <= MAX_LENGTH; i++) //<-- goes one element pass the end
// should be
for(int i = 0; i < MAX_LENGTH; i++)


(continued)
>>
>>53616231
I wanna make a neural network just for the sake of making one. Like I don't care if it's complex or advanced. I'd write it in C++ - any good libraries for this?
>>
>>53616237

The main bugs, though, are where you put something into the word length array, and a comparison that prevents things from finishing:
    if(!isWhiteSpace(c)) {
++wordLength;
if(mode == OUT) {
mode = IN;
++wordCount;
if(wordLength <= MAX_LENGTH) { // <-- HERE! We set the word length after the first character
// we should set the word length AFTER we hit whitespace following letters
lengthWordsArray[wordLength] += 1;
}
}
} else if(mode == IN) { //<--BUG! Remember, mode will be OUT here when we hit our first whitespace character following letters
// this comparison prevents proper counting
mode = OUT;
wordLength = 0;
}
}

It should be more like:
    if(!isWhiteSpace(c)) {
++wordLength;
if(mode == OUT) {
mode = IN;
++wordCount;
}
} else { // no comparison should be here
mode = OUT;
if(wordLength < MAX_LENGTH) { // word length array updated here, before we reset wordLength
lengthWordsArray[wordLength] += 1;
}
wordLength = 0;
}


I suggest walking through each step of the loop, noting what the values of the various variable will be.
>>
>>53615366
More:
char NAME_array[2];
char NAME_i[1];

int main (int argc, char** argv)
{
int raw[] = { 5, 2, 4, 3, 6 };

Bounded<int, NAME_array> array(raw, 5);
value<int, NAME_i> i;

// loop goes outside of array bounds (9 > 5)
for (i = 0; i < 10; i = i + 1)
{
if (auto proof = pred<int,int,less_than>(i, array.length()))
{
std::cout << array.at(i, proof()) << std::endl;
}
}

return 0;
}
>>
>>53611310
What's the point honestly I don't get why people bother programming things that already exist, you could buy one or just use the internet for better weather reports.

Always this.

The only "programs" I've made have accomplished specific tasks that there exist no programs for or alternate options.
>>
>>53616253
>I want to make a neural network
>any good libraries
yeah, just
#inclıude "nn.h"
and you finished it!
>>
>>53615925
>I must be doing something wrong...
Maybe.

Double check that you don't have a shitty email address or "prepare your anus" profile pic. Google/facebook your name and double check that there's nothing bad about you or anyone else.

Afterwards, check resume itself.
>>
>>53616038
scrapy combined with beautifulsoup. Or you could just find a REST api to get the data out instead of scraping.
>>
>>53616275
>The only "programs" I've made have accomplished specific tasks that there exist no programs for or alternate options.
We're all so impressed.
>>
>>53616253
Tensorflow, friend.
>>
>>53616253
There's this thing called "Tensorflow". I hear it's really good at Go.
>>
>>53616312
You sound more butthurt than impressed.
My aim wasn't to impress anyone.
>>
>>53616304
scrapy sucks ass at getting dynamic content
>>
does anyone here use terminal ide on their mobile device?
>>
I've always wondered this - how the fuck are Libraries made, in terms of their actual SC? Is the code based off the syntax of the language they're written in, or is it custom and outside the syntax?

If it's built on the standard syntax, then are libraries just built for convenience?
>>
>>53616420
People do just because they can, but realistically for the love of fuck why would you
>>
>>53616327
>>53616318
Thanks, guys. This is also built for C++, right?
>>
>>53616436
> then are libraries just built for convenience?
yes
>>
>>53616467
So if I understand correctly, you could re-create the libraries because they use the same syntax?
>>
>>53616253
If you want to implement a neural network from scratch then any language will suffice. If you are ok with using neural networks from a library, you can use Torch/Lua or TensorFlow/Python.
>>
>>53616436
>Is the code based off the syntax of the language they're written in
Usually, but sometimes they have to go outside of their language to do certain things. Interpreted languages usually have parts of their library in their implementation language (usually C), and the C standard library requires small amounts of assembly to interact with the operating system.
>then are libraries just built for convenience?
Yes.
>>
>>53616336
>My aim
nobody gives a shit about your "aim"
>>
>>53616456
A bluetooth keyboard and an android device with screencasting to a TV makes for a great ssh programming setup.
>>
>>53616481
yes but generally they're well built and you don't want to waste time reinventing the wheel. also anyone reading your code might have a harder time if you use custom solutions for standard functions
>>
>>53616481
Libraries exist to make life easier or so you don't write something inefficient that should only be written one way. You could rewrite math.h if you wanted to. You'd most likely do it wrong, but you could.
>>
>>53616481
What do you mean by 'recreate'?
>>
>>53616511
Cry more buttbaby.
>>
>>53616536
>i don't belong
>>
>>53616481
You don't have to recreate them, friend. You can go read the source code right now.

Here's the Java source code for Java's String class:
http://grepcode.com/file_/repository.grepcode.com/java/root/jdk/openjdk/6-b14/java/lang/String.java/?v=source

Here's the source code for Swift's String class:
https://raw.githubusercontent.com/apple/swift/master/stdlib/public/core/String.swift
>>
>>53616517
>so you don't write something inefficient
>projecting
>>
>>53616568
wot
>>
>>53616514
>>53616517
>>53616518
What my original questions was whether Libraries are written in the same standard syntax as the language they're built for, or if it's a custom syntax that's modded into the compiler.

e.g. standard C++ syntax would be
cout << "library" << endl;


Whereas the library could introduce new functions that aren't part of the syntax like this:
write << "library" << endl;

I don't know if this makes sense.
>>
>>53616564
>java string
>public String()
> this.value = new char[0];

even empty string allocates an empty array. java newer stops to surprise me.
>>
>>53616587
yes, C++ io classes uses operator overloading to override << operator. you can write a custom class do the same thing.

of course if you are not using Java. no operator overloading for you.
>>
>>53616587
The last one could be part of the syntax if "write" is a stringstream. To answer your question, libraries don't hold any custom structure. They have to be accessed from your code, which means the libraries have to be in the same syntax. Make sense?
>>
Serious question: How do I write an AI, anons?
>>
>>53616648
Go through hell or use already developed AI algos.
>>
>>53616632
I didn't know whether or not 'write' was part of C++'s syntax; I just used that with the assumption that it wasn't.

>libraries don't hold custom structure
>the libraries have to be in the same syntax
Yes, this is what I was trying to work out. Thank you.
>>
>>53616648
>>>/sqt/
>>
>>53616662
So, what's "hello world" of AI?
>>
>>53616648
Depends what you mean by AI, I guess. Your best bet would be to build a neural network
>>
>>53616663
This is not the case in all languages. For example java does not allow operator overloading while its standard libraries can use such a feature.

>>53616674
minimax tic tac toe
>>
>>53616681
>>53616698
Ok, I'll give it a try.
>>
File: photons02.png (50KB, 640x480px) Image search: [Google] [Yandex] [Bing]
photons02.png
50KB, 640x480px
Finally my CA is working OK.
Writing rules for digital physics is not easy business!
>>
>>53617038
what is this
>>
new thread >>53617125
>>
New thread~

>>53617170
>>
>>53617141
>>53617213
Ebin
>>
>>53610924
Turn down the offer and say the pay is a little too low. If they're desperate enough, or they see that as confidence, then they'll up the offer.

If this happens, you bought yourself a dream job right out the gate.
>>
>>53616262

Thanks anon, I also noticed that if the final char isn't whitespace the length of the last word won't be added to my array, I just added this after the while loop:

if (mode == IN) {
//Our final word hasn't been added yet
++lengthWordsArray[wordLength];
}


Any better way of doing this or is it fine?
Also any good tools/best practices you could recommend for debugging?
>>
>>53617488
I'd say your approach is fine.

>tools/best practices
If you haven't already done so, change your compiler's settings to warn all, and treat warnings as errors. Modern compilers will notice the use of unitialized variables, and some may notice the array overrun. As for programmer logic errors, there really aren't any software tools that can help. I found the bug by going through, line by line, and thinking of what the values would be for each variable.

The debugger is very useful for this. If you haven't used it, try it on a program that you understand well, and note how it works. Debuggers generally allow you to watch the values of the variables you select, and step through your program's execution, line by line.
Thread replies: 359
Thread images: 38
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y / ] [Home]

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.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
If a post contains illegal content, please click on its [Report] button and follow the instructions.
This is a 4chan archive - all of the content originated from them. If you need information for a Poster - you need to contact them.
This website shows only archived content and is not affiliated with 4chan in any way.
If you like this website please support us by donating with Bitcoin at 1XVgDnu36zCj97gLdeSwHMdiJaBkqhtMK