[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
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 255
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 (14 KB, 450x252) Image search: [Google]
Flat-File-Database.png
14 KB, 450x252
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 (3 MB, 720x405) Image search: [Google]
1458157421766.webm
3 MB, 720x405
>>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 (29 KB, 367x451) Image search: [Google]
256.jpg
29 KB, 367x451
>>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.
>>
File: 1a60199ebdb5404fdb84c92e7ac67ea7.jpg (480 KB, 1600x1500) Image search: [Google]
1a60199ebdb5404fdb84c92e7ac67ea7.jpg
480 KB, 1600x1500
>>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 (99 KB, 529x598) Image search: [Google]
haskelel.jpg
99 KB, 529x598
>>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 (110 KB, 638x313) Image search: [Google]
1419490405524.png
110 KB, 638x313
>>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 (87 KB, 390x352) Image search: [Google]
1458567993032.png
87 KB, 390x352
>>53611455
>mfw my first internship paid 35/hr
>>
File: 1395468415927.png (555 KB, 689x637) Image search: [Google]
1395468415927.png
555 KB, 689x637
>>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 (114 KB, 955x957) Image search: [Google]
Bait.png
114 KB, 955x957
>>53612684
>>
>>53611499
vectors are by far more versatile
>>
>>53612663
nigga where
>>
>>53612498
I am a trap lover but this board just makes me depressed.
>>
File: 20090204-075015_1233751454233.jpg (78 KB, 750x600) Image search: [Google]
20090204-075015_1233751454233.jpg
78 KB, 750x600
>>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 (18 KB, 340x340) Image search: [Google]
1456007784488.gif
18 KB, 340x340
>>53613030
>cvs
>>
File: 1422598919393.png (136 KB, 459x499) Image search: [Google]
1422598919393.png
136 KB, 459x499
>>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.
>>
File: webdevs cant fizzbuzz.png (229 KB, 537x783) Image search: [Google]
webdevs cant fizzbuzz.png
229 KB, 537x783
>>
>>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 (309 KB, 680x1671) Image search: [Google]
1458104179403.jpg
309 KB, 680x1671
>>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 (20 KB, 500x313) Image search: [Google]
1457475652595.jpg
20 KB, 500x313
>>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.
>>
File: Screenshot_2016-03-21-16-15-50.png (122 KB, 1080x1920) Image search: [Google]
Screenshot_2016-03-21-16-15-50.png
122 KB, 1080x1920
>>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 (135 KB, 600x551) Image search: [Google]
1456133419115.png
135 KB, 600x551
>>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 (86 KB, 261x226) Image search: [Google]
konata.png
86 KB, 261x226
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??
>>
File: jinx_by_adorael-d93ll15.jpg (509 KB, 636x900) Image search: [Google]
jinx_by_adorael-d93ll15.jpg
509 KB, 636x900
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 (107 KB, 932x651) Image search: [Google]
BUNBUUU.jpg
107 KB, 932x651
>>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 (165 KB, 788x1013) Image search: [Google]
1458596493021.jpg
165 KB, 788x1013
>>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 (1 MB, 1000x1400) Image search: [Google]
1458019263810.png
1 MB, 1000x1400
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 (11 KB, 480x360) Image search: [Google]
hqdefault.jpg
11 KB, 480x360
>>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 (658 KB, 2040x3160) Image search: [Google]
shut-it-down-jew.jpg
658 KB, 2040x3160
>>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 (46 KB, 509x667) Image search: [Google]
1396651518856.png
46 KB, 509x667
>>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 (26 KB, 250x247) Image search: [Google]
5028401.gif
26 KB, 250x247
>>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 (23 KB, 640x480) Image search: [Google]
cabug.png
23 KB, 640x480
>>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 (3 MB, 500x500) Image search: [Google]
c9e.gif
3 MB, 500x500
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 (78 KB, 1306x354) Image search: [Google]
the new furfags.png
78 KB, 1306x354
>>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
Thread replies: 255
Thread images: 38

banner
banner
[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.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.