[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: 43
https://www.youtube.com/watch?v=fPoq316yM40

O shit waddup

Previous thread: >>54565804

What are you working on, bois?
>>
Do any of you contribute to GitHub projects? If so, could you tell us how you got into it.
>>
have people started adopting swift for things other than iOS dev or was it DoA
>>
How do you test client-side network code for a proprietary server? Do you implement the server's logic yourself?
>inb4 formally proving your Haskell code correct
>>
Arduino/C++

From a for loop I got the int variable i. In this example it is 1.

String name = "Timer" + i;
Serial.println(i);
Serial.println(name.c_str());


Result is:

1
Timer

Why does this sheit not work?
>>
>>54569303
>see bug
>fork repo
>make fix
>submit pull request
>>
>>54569320
it's SHIT
>>
What is the best freelancing platform?
>>
What is everyone working on? I'm just curious on what other anons are doing
>>
>>54569351
I didn't ask if it was good, I asked if it's being used
>>
>>54569342
>Why does this sheit not work?

"Timer" is a string literal and *i* is an integer.
You can't add an integer to a string like that.
>>
What do you guys think about Qt
>>
>>54569303
>find reddit bug
>fork repo
>fix bug
>make pull request
>6 months later it gets accepted
>>
>>54569342
you need to use itoa
>>
>>54569364
An NLP library

>>54569369
Better than gtk
>>
>>54569367
no one uses it
>>
File: 1463341698900.jpg (248 KB, 755x1341) Image search: [Google]
1463341698900.jpg
248 KB, 755x1341
Reminder /dpt/
>>
>>54569278
So I did an exercise for this algorithm book I'm reading, where I had to do a postorder traversal of a binary tree using a stack
Spent about 2 hours trying to get it to work before I stumbled upon the recursive method that didn't even need a stack
http://pastebin.com/dLqmdp3j
>>
>>54569369
the only reason to learn C++
>>
>>54569423
Which one is the one next to C#? And the one before R?
>>
File: thbfamlmao.jpg (18 KB, 499x499) Image search: [Google]
thbfamlmao.jpg
18 KB, 499x499
>mfw /g/ can't even average 2 ints in C
>>
>>54569462
old meme
>>
>>54569368
Digging further into the Arduino documentation I have found an easy but weird fix. From the website:

For example:

int sensorValue = analogRead(A0);
String stringOne = "Sensor value: ";
String stringThree = stringOne + sensorValue;
Serial.println(stringThree);

results in "Sensor Value: 402" or whatever the analogRead() result is, but

int sensorValue = analogRead(A0);
String stringThree = "Sensor value: " + sensorValue;
Serial.println(stringThree);

gives unpredictable results because stringThree never got an initial value before you started concatenating different data types.


So what I've done is:

name = "Timer ";
name += i;


Might look weird but works fine.
>>
File: 1449617343165.jpg (331 KB, 517x768) Image search: [Google]
1449617343165.jpg
331 KB, 517x768
>>54569462
double average(int a, int b) {
return (a + b) / 2;
}


lmao ez kys
>>
>>54569475
That makes sense because ""Sensor value: "" evaluates to a const char*, not a String which does overload the + operator.
>>
>>54569488
Overflow, bubby
>>
File: 1388132962996.gif (839 KB, 450x402) Image search: [Google]
1388132962996.gif
839 KB, 450x402
>applying for entry level engineering positions at Amazon, Expedia, and some other companies
>never been in big interviews like this
>feel like I am going to get destroyed by just the phone interviews

how do I prepare for this and not be a nervous shit?
>>
>>54569515
You appear to be correct.

name = String("Timer ") + i;


Has the correct effect. Nice, thanks.
>>
>>54569528
>how do I prepare for this and not be a nervous shit?
alcohol, xanax or both
>>
>>54569528
Yeah drink a pint.
>>
>>54569396
I guess I'll have to learn perl then, assuming it's not a dead language too
>>
>>54569528
Expect failure. Learn from failure. After a while you know what questions they'll ask and how to win an interview. Patience is key
>>
>>54569447
Next to C# -> F#
Before R -> Scala (JVM)
>>
>>54569729
Cool, thanks.
>>
>>54569754
You shouldn't take anything you see on here seriously. The warning doesn't apply just to /b/. I mean Ruby is in the top tier, shit's obvious.
>>
>>54569664
>>54569602
>>54569610

so I have applied to 4 positions right now and am going to apply for a lot more when I get home in 6 days.

basically I should assume that I won't get a job at Amazon or expedia?
>>
>>54569342
is serial a file you can write to?
fprintf (serial, "Timer %d\n", i);
>>
>>54569812
Serial is the terminal on my computer screen. Or a Bluetooth transceiver for all it matters.
>>
>>54569785
I know. I was merely thanking you for helping me out. Those logo's I hadn't seen before and It wasn't obvious what they meant. I also disagree with the image, considering both C++ and C# are at the top.
>>
>>54569278

OSHIT ITS DAT BOI WADDUP WAAADUPPPP

O SHIT OOS HIIIT


SOHO OSSHIT SHIT SHIT SHIT DAT BOI DAT OBI

DA

DAT BOI DAT BOI

IS THAT WHAT YOU WANTED ME TO SAY? FUCKING STUPID FUCKING STUPID PIECE OF SHIT FROGPOSTER, GET BENT
>>
has anyone here read Computer Systems, A Programmer’s Perspective? does this book teach enough asm to write programs in it, or just uses some instructions here and there to help in explaining the architecture?
>>
>>54569515
Yick fuck. C++ is evil.
>>
>>54569812
'Serial' is a static object that contains methods for doing serial communication between the Arduino and a terminal.

Kid thinks Arduino development libraries are a special language. He can solve his problems by just learning C++, but he obviously isn't trying. Don't help him.
>>
>>54569858
I learned a good amount of ASM in that book, but the book isn't for ASM. It's about low level stuff, as it also covers malloc, shells and I think it has a proxy lab. Also in the course I took with the book, we did buffer overflows, a little reverse engineering, and cache optimization.
>>
>>54569826
>device
>not a file

smiley_with_caret_nose.jpeg
>>
>>54569897
String literals are 'String' in C++11 and higher, but he's probably using the Arduino IDE which doesn't allow you easily change the language standard from the default specified by GCC (C++98).
>>
>>54569934
carrot*
>>
>>54569858
http://csapp.cs.cmu.edu/
Here's the book site. You can probably get a gist of the topics it covers. I enjoyed the course that was based on the book.
>>
Java is a top tier programming language. C# fags can suck it.
>>
>>54569974
Okay.
>>
>>54569359
etsy
>>
>>54569974
Blub programmers everybody!
>>
>>54569974
this
>>
>>54569974
found the nigger cattle pajeet
>>
>>54570039
nice meme
>>
File: larry page.jpg (14 KB, 350x350) Image search: [Google]
larry page.jpg
14 KB, 350x350
>>54570049
Indian Microsoft certified C# technician pajeet detected
>>
>>54570125
[spoiler]both are pajeet tier[/spoiler]
>>
>>54570135
as if hasklel isn't garbage lol
>>
>>54570135
Only 1 is used at Google, Amazon, Netflix, NASA, etc
>>
>>54570178
there are many alternatives to C# and Java that aren't functional
>>
>>54569934
was_just_saying.ino
>>
>>54570062
You know it. :^)
>>
>>54570283
>using the smiley with a carat nose
>>
How much longer with Perl be a desirable language to know?
>>
>update vuze
>it has ads
fuck off
what's next, pirating your torrent client?
>>
>>54570432
What does that have to do with programming?
>>
>>54570452
your mom
>>
>>54570432
... also piracy is robbery on the high seas.
You're thinking of copyright infringement.
>>
File: 1416728001010.jpg (28 KB, 460x346) Image search: [Google]
1416728001010.jpg
28 KB, 460x346
Is this less trashy now?

#include <stdlib.h>
#include <string.h>

#include "../include/log.h"

typedef struct Entry Entry;

struct Entry {
Entry *prev;
Entry *next;
char *text;
};

struct j9_Log {
Entry *first;
Entry *last;
char *name;
};

Log *log_init(const char *name) {
Log *self = malloc(sizeof(Log));
self->first = malloc(sizeof(Entry));
self->first->prev = NULL;
self->first->next = NULL;
self->first->text = NULL;
self->last = self->first;
self->name = malloc(strlen(name) + 1);
strcpy(self->name, name);

return self;
}

void log_push(Log *self, const char *text) {
Entry *entry;

if (!self->first->text) {
entry = self->first;
} else {
entry = malloc(sizeof(Entry));
entry->prev = self->last;
entry->prev->next = entry;
entry->prev->prev = self->last->prev;
}

self->last = entry;
entry->next = NULL;
entry->text = malloc(strlen(text) + 1);
strcpy(entry->text, text);
}

char *log_name(const Log *self) {
return self->name;
}

char *log_list(const Log *self, const int newln) {
Entry *tmp = self->first;
char *ret = malloc(strlen(tmp->text) + (newln ? 1 : 2));
strcat(strcpy(ret, tmp->text), (newln ? "\n" : ""));

while (tmp->next) {
tmp = tmp->next;
size_t size = (strlen(ret) + (strlen(tmp->text) + (newln ? 1 : 2)));
(size >= (strlen(ret) * 4)) ? ret = realloc(ret, size / 4) : realloc(ret, size * 2);
strcat(strcat(ret, tmp->text), (newln ? "\n" : ""));
}

return ret;
}

void log_free(Log *self) {
while (self->last->prev) {
self->last = self->last->prev;
free(self->last->next->text);
free(self->last->next);
}

free(self->last->text);
free(self->last);
free(self->name);
free(self);
}
>>
>>54570710
>self->first = malloc(sizeof(Entry));
>self->first->prev = NULL;
>self->first->next = NULL;
>self->first->text = NULL;
self->first = calloc(1, sizeof(Entry));


You're not checking malloc's return value anywhere.
If you think that all your reasonable thing your program should do is exit if malloc fails (malloc failing is usually a sign that something is REALLY wrong), you can write your own utility function to simplify the error checking logic:
void *xalloc(size_t size) {
void *ptr = malloc(size);
if (!ptr)
exit(EXIT_FAILURE);
return ptr;
}


>self->name = malloc(strlen(name) + 1);
>strcpy(self->name, name);
If you're fine with non-standard functions, use strdup, or you could implement it yourself.

>tmp = tmp->next;
>size_t size = (strlen(ret) + (strlen(tmp->text) + (newln ? 1 : 2)));
>(size >= (strlen(ret) * 4)) ? ret = realloc(ret, size / 4) : realloc(ret, size * 2);
>strcat(strcat(ret, tmp->text), (newln ? "\n" : ""));
This block of code looks horrible. Try to clean it up.
>>
>>54570494
sperg
>>
>>54569320
Yes
IBM are pushing it for their server stuff

It's a better Go, but I'd still rather use F#
>>
File: golang.png (1 KB, 196x196) Image search: [Google]
golang.png
1 KB, 196x196
why is golang an meme?
>>
File: 1374460484248.jpg (210 KB, 555x555) Image search: [Google]
1374460484248.jpg
210 KB, 555x555
I'm for now busy with reading through Emacs Lisp's Reference Manual and still comparably far at the start. Would you say that an obarray is essentially just Elisp's technical implementation of name spaces? Or even better, how wrong would that statement be exactly?
>>
>>54571189

It turned Pike queer.
>>
>>54571252
that was just one picture, in all keynotes he looked and talked normal
and still married to his wife
>>
>>54571189
you only need it if you are running a large company (>20 employees)
>>
File: 1463359403635.png (889 KB, 1440x1781) Image search: [Google]
1463359403635.png
889 KB, 1440x1781
>>
>>54571307
what was the deal with the picture then
>>
>>54571372
maybe it was at an event or something
>>
>>54571367
10 but it's horrible to write that way
>>
>>54571318
What might you use in a smaller company? Why not Go?
>>
File: eclipse.png (68 KB, 300x300) Image search: [Google]
eclipse.png
68 KB, 300x300
Should I learn C++? It seems like a pretty commonly used language and I'd like to expand my knowledge. I am relatively new to programming, I know a significant amount of Java, Javascript, and HTML (I know its not a programming language), but not much else.
>>
>>54569462
int avg =a/2+b/2;
>>
>>54569974
>not using Scala instead of Java if you have to touch the JVM.
>>
>>54571508
kys
>>
File: 1441417058260.jpg (401 KB, 802x609) Image search: [Google]
1441417058260.jpg
401 KB, 802x609
>>54571372

Got caught wearing the outfit and had to play it off.
>>
>>54571440
>eclipse

look up intellij idea
>>
>>54571401
>10

It's 58.
>>
File: out.webm (3 MB, 393x300) Image search: [Google]
out.webm
3 MB, 393x300
>Made shaders update as I save the file.
This is great.
>>
>>54571405
Go is simple, it works well in big companies because it makes adding new people to the projects easier. They can see what you are doing since the complexity of the language is very minimal.

Go can be used in a smaller company, but since you know the people well enough and you aren't bringing new people along, you can get away with using more expressive languages.

Have a read
http://jimplush.com/talk/2015/12/19/moving-a-team-from-scala-to-golang/
>>
File: yeeaaaahhhhhh.jpg (8 KB, 480x360) Image search: [Google]
yeeaaaahhhhhh.jpg
8 KB, 480x360
>>54571521
>>54571508
sure is a bit... shilly in here
>>
>>54571527
Let x = 2
6 / 3x

That's 4 to you?
>>
what is swift good for besides iOS?

>inb4 swift is shit and you're a fag
>>
>>54571562
server applications, linux command line apps, OS X apps, etc
>>
I recall watching some marketing content concerning a new profiler Intel (i think) had made. It looked pretty darn sweet.

I don't remember what it's called.
>>
>>54571536
This is pretty dope. What resource are you learning to do shaders with? I need to upgrade to using opengl 3.

And how much of a performance bump should I expect in using shaders over the gl2 style texture coord VBAs?
>>
>>54571527
there is no right answer because it's shitty ambiguous murriburger notation, you could make a case for 10 because 2(3) is written with parens instead of like 2*3 and because the spacing suggests that 2(3) is grouped on its own
>>
>>54571580
>there is no right answer

There literally is, because pemdas (or bodmas, or whatever you'd like to call it) applies here as it does anywhere else.

>>54571552

2(3) = 2 * 3, and in the case of division and multiplication, they are done left to right.
>>
>>54571567
So it can only render on apple products? that's fucking stupid, if entirely consistent with apple
>>
>>54571547
I'm just trying to save someone from the horrors of eclipse. I needed to do one good favor today.
>>
>>54571579
>And how much of a performance bump should I expect in using shaders over the gl2 style texture coord VBAs?
Wrong person to ask.
>What resource are you learning to do shaders with?
Also wrong person to ask. I'm learning this myself entirely pretty much. I started implementing a raymarcher from this
http://graphics.cs.illinois.edu/sites/default/files/zeno.pdf on shadertoy. Moved over to GLFW and GLEW now.


I honestly don't even know what I'd consider "learning shaders". Implementing different things? Understanding reflections?

I don't even know where to go to learn how to optimize them other than the basic branching is bad and don't pass too much stuff to the GPU all the time..
>>
>>54571616
k tard

it's clearly ambiguous, that's why it's a bait for arguments like this, the only acceptable way to write it is to write the denominator under a horizontal line or to use parens with explicit multiplication and even spacing
>>
>>54571668
>it's clearly ambiguous

No, it's not. You sound like a Java user.
>>
>>54571616
2(3) is not 2 * 3. It's 2 3's.

>>54571655
Oh by learning shaders I mean modern opengl in general, which is shader based.
>>
File: 1463360876055.jpg (162 KB, 500x500) Image search: [Google]
1463360876055.jpg
162 KB, 500x500
>>54571677
>>
File: wolfy.png (15 KB, 699x293) Image search: [Google]
wolfy.png
15 KB, 699x293
>>
>>54571677
stupid burger

6^2/2*3+4 is 58

6^2÷ 2(3) + 4 is fucking retarded
>>
>>54571681
>It's 2 3's.
Which is what 2 * 3 is, yes. Two threes
>>
>>54571703
are you sure you don't have assburgers
>>
>>54571729
epik my /b/ro
>>
>>54571736
kys
>>
>>54571717
Are you trying to suggest it's 58?

Isomorphism doesn't apply to order of operations.
>>
>>54571743
dat boi BTFO
>>
>>54571729
>guy wants to be correct
>Aspergers
Yeah there's a lot of Aspergers everywhere then.
>>
>>54571747
Yes
Wolfram agrees with me
>>
>>54571754
the way it's written in the pic is ambiguous, either intentionally as a bait or by chance due to burgers being fucking stupid, if you can't recognize that it's bait you probably have assburgers
>>
>>54571714
>stupid burger

Now you're insisting that parens are stupid burger notation?
>>
>>54571784
kys idiot
>>
>>54571756
Wolfram alpha is not the authority on math. It's interpreter is not intended to get "standard math" notation right. It's an input device.

Besides there ain't standard notation anyway. Ask a bunch of mathematicians what symbol to use for the function f(x) = 1.

t. actual mathematician
>>
>>54571779
>get it wrong
>f-fucking burgers!!!

If you are this trigger by parens, do not use lisp.
>>
>>54571779
>if you can't recognize that it's bait you probably have assburgers
>Things that commonly fool people are a sign of being abnormal
No I think you should consider if you have neurotypical issues.
>>
>>54571801
kys
>>
>>54571804
there is not one true answer, that's the entire point of the pic, to spark retarded arguments like this, like i said from the start >>54571401
it's horrible to write it like that
>>
you fucking spergs suck at life seriously
>>
>>54571820
>it's horrible to write it like that

You're horrible. 4chan is a "stupid burger" website, so you might want to fuck off to Krautchan where you belong.
>>
>>54569517
what about this? do i even need to cast the last case?
  3 double ave(int a, int b)
4 {
5 if (a % 2 == 1 && b % 2 == 1)
6 return a / 2 + b / 2 + (1.0);
7 else if (a % 2 == 1 || b % 2 == 1)
8 return a / 2 + b / 2 + (0.5);
9 else
10 return (double) (a / 2 + b / 2);
11 }
>>
>>54571851
'murrica is not an excuse to write math ridiculously sloppily
>>
>>54571842
You respond to everything with kys and constantly bitch about burgers. We're the spergs?

Of course this is all just an elaborate troll and you were pretending to be retarded eh? If this is you have bad tastes in hobbies.
>>
>>54571872
stay delusional, fucking idiot

you're the ones that took a bait image seriously
>>
>>54571622
What other langauges can do gui? Gtk is C only and Qt is C++

Rest use bindings to them, which you can probably expose to swift-c++
>>
File: programming challenges.png (302 KB, 1920x1080) Image search: [Google]
programming challenges.png
302 KB, 1920x1080
rollin
>>
>>54571867
What is this even.
The meme is:
(a+b+c)/3 -> a/3+b/3+c/3
>>
>>54571622
Up to people to make GUI Toolkits, c++ don't have any official Toolkits
>>
>>54571867
That's so overcomplicated. Just cast one of them to a double.
double ave(uint32_t a, uint32_t b) {
return (((double)b)+ a)/2;
}


>>54571880
How do you find this fun? Do you just work as as some wageslave and entertain yourself typing kys on 4chan in between customers?
>>
File: advice_didyouknow_en.png (67 KB, 946x448) Image search: [Google]
advice_didyouknow_en.png
67 KB, 946x448
>>54571870

Murica is an excuse to do whatever the hell I want. I think I'm going to go to Walmart tomorrow and buy some fishing tackle and a Mossberg 500.

God bless, y'all.
>>
>>54571924
you're the one who keeps replying, so ask yourself how this is fun
>>
File: 1463173521474.png (208 KB, 853x480) Image search: [Google]
1463173521474.png
208 KB, 853x480
what does /g/ think of this book?
>>
>>54571928
Walmart sells guns? Huh.

But are you actually a southerner or are yew appropriatin' mah language?

Southeastern Texas reporting.
>>
>>54571953
>Walmart sells guns? Huh.

They used to. Now they're all pussified after the mass shootings. A few of them still might.

>But are you actually a southerner or are yew appropriatin' mah language?

The latter. Though, where I live is full of rednecks and they DO say y'all. Never understood it, but it's life.

>Southeastern Texas reporting

I'm jealous. I live in a commie state. :(
>>
>>54571988
Illinois? B)
>>
>>54571988
they did here last time I went, although that was like a year ago since target is way closer
>>
https://lwn.net/Articles/687511/

Why isn't your name here /dpt/
>>
>>54572030
>he does it for free
>>
>>54572030
why isn't yours?
>>
>>54572011

No. Jew Jersey, or New Jermany, and a litany of other shitty nicknames. :(

I really wish we could split into two states and the north could take their hyper-liberal regressive bullshit somewhere else.
>>
>>54572043
lol cuck
>>
File: B2CiPBhCYAAItKK.jpg (77 KB, 600x800) Image search: [Google]
B2CiPBhCYAAItKK.jpg
77 KB, 600x800
>>54572051

Please no bully. Every night I tell my guns a bedtime story before tucking them in. I need to move to a free state.
>>
anyone can give me advice?

im trying to learn python because fuck it

the gui is a pain in the ass what IDE can you recommend
>>
>>54571904
Rolling
>>
>>54572126
PYCharm
>>
>>54572114
>pistol grip
Eww.
>>
>>54572312

It's a Thompson, that's how they're all built. The only ones that didn't have pistol grips were the British BSA prototypes.
>>
What exactly is CPU pipelining and how does it work?
>>
>>54572416
Social construct made up by chip manufacturers to oppress branches in program flows.
>>
>>54571953
>Texas
>South

Georgia reporting in, the South ends at the Mississippi
>>
>>54571867
>doubles
Okay now average two 64-bit ints.
>>
why do people say a single weapon finished off the gem war
>>
With sdl how do I edit the border of the main window. Like I want something like spotifies border where its black.
>>
>>54572472
I used to live in South Carolina. That part of Texas is still the south. Not Dallas and not Amarillo. Not Austin. But that part is.
>>
File: Cosft.gif (4 MB, 380x285) Image search: [Google]
Cosft.gif
4 MB, 380x285
>>54572043
dude we fucking pay for all of your shit, man! North New Jersey is richer per capita than fucking Connecticut, even including the basically-Alabamans on the border with PA! Our beaches are better, our women are hotter, our beach towns are fiscally solvent-- hell, they're prettier too!
We got Bruce Springsteen, Paul Robeson, pic related, Frank Sinatra, John Nash, Thomas Edison, Albert Einstein. Who do you have? Joe Flacco? Get outta here conservifag, and take le "tells it like it is" manbaby and his friend le orange hate machine with you .
>>
How would you average n numbers in C++? How would you count the number of variables being averaged.
>>
>>54572802
Use Variadic functions/template
>>
>>54572802
Vector, accumulator and count
>>
>>54572772
>Who do you have?

Bruce Willis, John Forsythe, and.. uh.. that's about it.

Still, fuck your liberal bullshit. Tired of Swineberg and her mega-jew cronies ruining every little pro-gun thing that MPC and the other non-retards on the legislature try to do.

Go to hell.
>>
>>54571544
ty senpai
>>
>>54572802
did you do middle school math?
>>
Trying to make a basic unix shell and I can't seem to get chdir to work right. If I start at the home path I can navigate just fine but I cannot seem to change the directory to the parent.

So if I have home/exam/exam2 and I am currently in exam2 when the shell starts I can type "cd" and it'll go home but if I type "cd exam" it'll throw an error. I've double checked to make sure it's not a \n throwing me off. Am I retarded or just missing something?
>>
File: wtfJS.png (10 KB, 327x264) Image search: [Google]
wtfJS.png
10 KB, 327x264
Just started learning JavaScript.
>>
>>54573029
Did you fail english? Your reading comprehension is shit.
>>
>>54572472
East Texas is really south.
>>
>>54573041

don't even pay attention to this memery

I'm pretty sure compilers will protect you from this anyway, or atleast eclipse will
>>
File: Capture.png (48 KB, 817x743) Image search: [Google]
Capture.png
48 KB, 817x743
I keep giving up because I'm unsure

Please tell me: What language should I learn?

What do I want to do?

1. Build Apps for iOS/Android/Windows (basic apps like a marketplace/google api apps/flappy bird copy/etc)

2. Make interactive websites

3. Later on make shitty multiplayer games


Please help, as you can see I'm super cereal but I keep giving up because I don't know if this is the right thing for me.

Thanks
>>
Writing a VN interpreter for a gamedev project of mine.

Almost finished porting the 3rd day of F/SN's Fate route. I really needed something to stress-test it with and was too lazy to make my own assets.
>>
>>54573118
If those are what you want to do, learn HTML, CSS and Javascript. Those are the best for mobile apps, websites and shitty multiplayer games

For shitty multiplayer games you'll need to learn node.js later on. Good multiplayer requires shit like C++ or C#
>>
>>54573126
>>>/v/agdg
>>54573118
>>54573041
>>>/g/wdg
>>
>>54573118
Sounds like javascript is what you want: enjoy >>54573041.
>>
>>54573174
I meant >>>/vg/agdg, whoops
>>
>>54571988
They still sell guns here in liberal Washington.

>I live in a commie state
Which one?
>>
>>54573182
>>54573174
>>54573172


Thank you, I'll try my best.
>>
Why does LMC actually use characters for its machine code? As in, it uses the characters '9', '0', '2' for machine code for one instruction, rather than 902 the actual value, or better yet, 16 bits per instruction? It's pretty stupid I think, not that it actually matters

Should I have my assembly output the characters or a binary file for the actual values?
>>
>>54573229
It doesn't use characters. It uses 3 decimal digits.
>>
File: ???.jpg (43 KB, 600x597) Image search: [Google]
???.jpg
43 KB, 600x597
>>54572966
>non-retard
>on either aisle of the NJ assembly
>>
>>54573272

MPC is a pretty cool guy, though. He shits on commies daily.

I'm not a conservative, though, I just despise liberals.

>>54573219

Jew Jersey.
>>
File: IMG_20160417_161707.jpg (2 MB, 3264x2448) Image search: [Google]
IMG_20160417_161707.jpg
2 MB, 3264x2448
A website (laravel, materialize) running on a raspberry pi (apache and postgresql) where you can turn on/off lights, open/close doors from three house models

I-it's fun
>>
>>54573263
There's an error in your algorithm though. All that arithmetic is exact arithmetic. Change 2 to 2.0 and it should work.
>>
>>54573253
So If I were to open an LMC program file, I wouldn't see "902"?
Does it use four bits per digit? Are the extra 4 bits (to make 2 bytes per instruction) before or after the actual instruction?
>>
>>54573036
>
what if you type "cd .."
or "cd home/exam"
>>
>>54573309
so if your function isn't explicitly a double it won't be calculated as one? I guess that makes sense.

Don't understand why it would allow you to return something other than a double though
>>
>>54573301
That's really cool. A little internet of things.


The residents of those doll houses are going to have a bad day when the Chinese find out how to crack that website :^).

>>54573263
>deleting posts on an anonymous website
>>
>>54570910
self->first = calloc(1, sizeof(Entry));

I didn't even know that was possible with calloc.

>You're not checking malloc's return value anywhere.
I figured I'd spruce it up with file, line, and function macros.

#include <stdio.h>
#include <stdlib.h>

#include "../include/util.h"

void *j9_malloc(const char *fname, const int lineno, const char *fxname, size_t size) {
void *ptr = malloc(size);

if (!ptr) {
fprintf(stderr, "CRITICAL ERROR: malloc failure in (%s)::%s::%i\n", fname, fxname, lineno);
exit(EXIT_FAILURE);
}

return ptr;
}

void *j9_calloc(const char *fname, const int lineno, const char *fxname, size_t num, size_t size) {
void *ptr = calloc(num, size);

if (!ptr) {
fprintf(stderr, "CRITICAL ERROR: calloc failure in (%s)::%s::%i\n", fname, fxname, lineno);
exit(EXIT_FAILURE);
}

return ptr;
}

void *j9_realloc(const char *fname, const int lineno, const char *fxname, void *ptr, size_t new_size) {
ptr = realloc(ptr, new_size);

if (!ptr) {
fprintf(stderr, "CRITICAL ERROR: realloc failure in (%s)::%s::%i\n", fname, fxname, lineno);
exit(EXIT_FAILURE);
}

return ptr;
}


>strdup
Good idea.

>This block of code looks horrible. Try to clean it up.
k

char *log_list(const Log *self, const int newln) {
Entry *tmp = self->first;
char *ret = strcat(strdup(tmp->text), newln ? "\n" : "");

while (tmp->next) {
tmp = tmp->next;
size_t size = (strlen(ret) + (strlen(tmp->text) + (newln ? 1 : 0)));

if (size >= (strlen(ret) * 4))
ret = realloc_s(ret, size / 4);
else
ret = realloc_s(ret, size * 2);

ret = strcat(strcat(ret, tmp->text), (newln ? "\n" : ""));
}

return ret;
}


I'm unsure whether or not _s is implementation defined, but it seemed fitting.
>>
>>54573041

'' === '0'    // false
0 === '' // false
0 === '0' // false

false === 'false' // false
false === '0' // false

false === undefined // false
false === null // false
null === undefined // false
>>
>>54573263
it does integer division, seeing as both are integers, then converts the output to a double on the return. C++ lets you return in whatever type you'd like as long as it has a defined conversion to the return value.
>>
>>54573298

Wow! They don't make too many states worse than Jersey!
>>
>>54573405
>They don't make too many states worse than Jersey!

Please don't remind me. I'm going to go hug my guns several times.
>>
>>54573319
Yeah "cd .." worked so I guess it's functioning as intended.

I also am wondering how exactly execvp works. I have the shell set to accept user input > parse it into a char array > and then fork to create a child at which point whatever comand the user input gets processed. Now I just need to implement execvp to perform functions like "ls" but I'm not sure how execvp works
>>
>>54569364
Text recognition based on handwriting using python opencv. Ask me anything.
>>
>>54573107
>javascript
>compilers
>eclipse
>don't pay attention to how retarded the language is
PLEASE BE A RUSE
PLEASE BE A RUSE
PLEASE BE A RUSE
>>
>>54573727
What error is it showing?
>>
>>54573745
Undeclared identifier, but I figured out what the problem was. I forgot to use the standard namespace.
>>
i'm working on a basic simulation of predators and prey in C; but i have a conundrum

every tick each "animal" needs to update their stats
do i iterate through the animals in a function for each stat, or do i iterate through the stats in a function for each animal, which would eat less cpu time?

can't provide any code as i'm on my phone, but i can answer questions
>>
>>54573779
When in doubt, Pajeet it out.
>>
>>54573793
it isn't commercial, i'm just working on it in my spare time for fun
>>
>>54573795
oh nevermind
this is embarrassing
>>
>>54573795
T
?
>>
>>54573699

In languages that compile to JavaScript, such as CoffeeScript, some of the retardation of JavaScript is avoidable. For instance, equality comparison in CoffeeScript, whether with == or "is" will always compile to === in JavaScript, which is type safe.

That said, no language that compiles to JavaScript can truly get rid of all of its retardation. Hopefully, web assembly will make it so better languages will be available for use on the front end without using JavaScirpt's type system.
>>
How do I explain structs to a python "veteran"? He seems to have no concept of memory in a computer, but wants to 'grok C'
>>
anyone know a good library for generating music in python/java? kinda interested in messing around with some music theory concepts from a programming standpoint
>>
>>54573871
This is what you want to use. No, it's not _that_ Scala. http://www.huygens-fokker.org/scala/
>>
>>54573866
Make him learn what memory is.
A struct is literally just a compound type that is equal to the size in bytes of all it's member variables, and C uses these byte offsets to access struct members.
This is why you cannot make a stack-allocated incomplete type, because the compiler has no idea how many bytes to allocate.
>>
>>54573808
Alberto barbosa
>>
>>54569278
thank you for this high quality meme
>>
My goal for this summer is to program a web crawler and create a twitter bot that uses the crawled data. I'm going to be doing this in C++.

How hard are these goals?
>>
>>54574129
why c++?
>>
>>54574129
>C++
Nigga web crawling is network bound. C++ is the wrong choice. Choose your favorite interpreted language.
>>
rate my fizzbuzz (java)

num = Integer.parseInt(args[0]);

if (num == 0 ){
System.out.println("FizzBuzz");
}
if (num == 1 ){
System.out.println(1);
}
if (num == 2 ){
System.out.println(2);
}
if (num == 3 ){
System.out.println("Fizz");
}
if (num == 4 ){
System.out.println(4);
}
if (num == 5 ){
System.out.println("Buzz");
}
if (num == 6 ){
System.out.println("Fizz");
}
if (num == 7 ){
System.out.println(7);
}
if (num == 8 ){
System.out.println(8);
}
if (num == 9 ){
System.out.println("Fizz");
}
if (num == 10 ){
System.out.println("Buzz");
}
if (num == 11 ){
System.out.println(11);
}
if (num == 12 ){
System.out.println("Fizz");
}
if (num == 13 ){
System.out.println(13);
}
if (num == 14 ){
System.out.println(14);
}
if (num == 15 ){
System.out.println("FizzBuzz");
}
}


>>
>>54574144
Because I need to learn the language anyway

>>54574146
It's still possible though. What would you suggest? Python?
>>
>>54574129
The twitter bot part takes like an hour in c#.

So a summer to make the crawler seems fine.
>>
>>54574149
Solid work, although having both 15 and 0 in your 15-cycle is redundant. I recommend editing the code and using least-absolute residuals though.

>>54574164
Do you know python? Then use it.

I use Scheme as my interpreted language but that's me.
>>
>>54574172
I wouldn't even know how to automate posting with a bot? How exactly would that work? You would have to use twitter's API's or something.
>>
>>54574149

2/10 troll made me reply
>>
>>54574129
Write it in C with libcurl. On your part, easy mode is to set a maximum traversal depth and keep a list of all destinations of a given branch for basic loop avoidance.

>>54574146
This guy is also correct though.
>>
>>54574187
Yes you have to use twitters API.

Fortunately it is pretty straightforward to use.
>>
>>54574204
>C + libcurl

maximum comfy
you can even fuck around with downloading data into memory instead of writing to disk
>>
>>54574129
>goal for this summer
that shit takes like 5 minutes in python

here's a template for scrapin
also don't waste your time with C++ or C# or anything but a language that supports beautifulsoup because that shit will make your life so easy
http://pastebin.com/x05W0kur
>>
File: ya.gif (2 MB, 400x260) Image search: [Google]
ya.gif
2 MB, 400x260
>>54573905
>>
>>54574149

Your code is disgusting, inefficient, and wasteful. Learn how to program

for (int i = 1; i < 100; i++)
{
if (i % 15 == 0)
{
System.out.println("FizzBuzz");
}
else if (i % 5 == 0)
{
System.out.println("Buzz");
}
else if (i % 3 == 0)
{
System.out.println("Fizz");
}
else
{
System.out.println(i);
}
}
>>
>>54574266
Rude as h*ck
>>
File: herman cain.gif (2 MB, 360x332) Image search: [Google]
herman cain.gif
2 MB, 360x332
>>54574149
>if statement

Enjoy your botnet.
>>
>>54574266
>for (int i = 1; i < 100; i++)

what does that code do
>>
>>54574266
>>54574199
lol are these people for real?

there's no one here that's that stupid, right?
>>
File: 1454907903461.png (638 KB, 4760x4986) Image search: [Google]
1454907903461.png
638 KB, 4760x4986
>>54574277

pic related in your future

>>54574280

it's the beginning of the "for" loop, declaring an integer i, and while i is less than 100, execute the code in the block, and perform the i++ after the block is finished.
>>
>>54574279

>botnet

wat
>>
>>54574301
these people are being sarcastic you dumb fuck
>>
>>54573263
You're a fucking retard, but I guess I have too much expectations from a OSX user.

At least stop using emacs, as you put us to shame.
>>
>>54574327
that was visual studio SENPAI
>>
>>54574326

No way, I don't believe you
>>
File: sdwertf.gif (986 KB, 500x243) Image search: [Google]
sdwertf.gif
986 KB, 500x243
>>54574325
>meme arrows

It's like you want Google to fuck you in the ass
>>
>>54574352

>using double meme arrows to quote my posts

No John. You are the demons
>>
File: picimg.jpg (30 KB, 480x540) Image search: [Google]
picimg.jpg
30 KB, 480x540
>>54574370

>mfw my name is John
>>
>>54573818
yeah but he was discussing eclipse as a compiler for javascript
anyways, thanks for reminding me, i need to update my scheme->wasm compiler this week
>>
>>54574391
>scheme->wasm compiler
Which one? How's it's srfi support?
>>
>>54574386
mmm hey john
>>
>>54574386
dale around the world
>>
File: john_530_big.jpg (208 KB, 530x424) Image search: [Google]
john_530_big.jpg
208 KB, 530x424
>>54574425 hey

>>54574428 t. mista wouwdwiiiiiiiiiide
>>
>>54574411
>Which one?
just a toy thing i made in a few days to learn about WASM, but it was a while ago and the standard has changed a lot since then. i might put it on github after i update it to newer versions of WASM
>How's it's srfi support?
awful, cause i put it away after a few days. i only did a tiny Scheme subset that supports nothing interesting, basically. just wanted to figure out the basics of WASM at the time.
>>
>>54571904
Roll
>>
>>54571904
sure why not
>>
>>54569811
Imagine the person on the other side of the phone in their underwear
>>
Silly idea for a programming project: write an LLVM backend to target gbz80 (the version of the z80 ISA used on the Gameboy). Then use that to write a Gameboy game in Rust (Rust targets LLVM-IR). Bonus points: See if you can get it to run on a real Gameboy using a flash cart.
>>
I already asked this here before but didn't get an answer.

In ruby, I have an array of objects with a starting and an ending time (intervals) and I want to check if any of the intervals overlap with some other interval. I have the code to check if they overlap, but how should I loop it?

Something along the lines of
days.each do
intervals.each do
if the intervals don't have same id and they overlap, move them to a new array

Doing this in ruby.
>>
>started avg meme
>tfw you're the king of /dpt/
feel good man
>>
>>54574661
jesus fuck that is horrifying to even consider
>>
Going to fail my first programming assignment ever lads, need to create a word frequency dictionary in c++ using AVL trees and cant get the frequency int variable of the struct node to increment when it detects the word is already in the tree

SEND HELP
>>
interview in 12 hours
!
>>
>>54569423
>Ruby that high
the fuck
Thread replies: 255
Thread images: 43

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.