[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: 37
File: hime on the front page!.jpg (94 KB, 500x701) Image search: [Google]
hime on the front page!.jpg
94 KB, 500x701
old thread: >>54987866

What are you working on, /g/?
>>
>>54996328
First for C#.
>>
First for Assembly
>>
i want practice my C
im thinking of writing a simple scheme interpreter

will this be good practice
>>
>>54996357
Get fucked, low-level nerd.

*drives off in high-level language that women are attracted to*
>>
File: 2016-06-09_18-51-05.webm (1 MB, 884x682) Image search: [Google]
2016-06-09_18-51-05.webm
1 MB, 884x682
All you people are too busy fighting over which languages are "memes" to use actual meme languages, well; not me.

I made fizzbuzz in befunge. Still learning it, but it seems fun!

55*4*01v
v35:+1<_@
* ^`\*4<
% >:55*^
!> #^" zzuBzziF"v
>| ^ ,,,,,,,,, <
v< > " zziF"v
>:5%!| ^ ,,,,, <
v!%3:< >" zzuB"v
> |
v8.: <
>4*,^ ,,,,, <
>>
>>54996374
pretty code
practically art
>>
File: 1456075074460.jpg (60 KB, 627x627) Image search: [Google]
1456075074460.jpg
60 KB, 627x627
http://gotnews.com/mexican-judge-gonzalo-curiel/
>>
>>54996575
>>54996529
please leave
>>
>>54996760
kys fag
>>
How do I return an array? I have this matrix multiplier:

template <typename T, size_t U1, size_t V1, size_t U2, size_t V2>
void mult (T (&A)[U1][V1], T (&B)[U2][V2])
{
if (V1 != U2) return void();

T output[U1][V2];

for (auto &i : output)
for (auto &j : i)
j = 0;

for (unsigned C1 = 0; C1 < U1; C1++)
for (unsigned C2 = 0; C2 < V2; C2++)
{
for (unsigned C3 = 0; C3 < V1; C3++)
output[C1][C2] += A[C1][C3]*B[C3][C2];
}

disp(output);
}


And it works fine, but all I can do is write out the array on screen. The answer is destroyed once the function ends, so I can't just pass a pointer back. What do?

(I would ask /sqt/, but nobody there can code)
>>
>>
>>54996373
This post better be bait.
>>
>>54996297
Why is this bad practice?
>>
File: snekfag.jpg (54 KB, 354x445) Image search: [Google]
snekfag.jpg
54 KB, 354x445
>>54996373
a high-level programmer is still a nerd just less intelligent, lower skilled, less attractive, just all around worse
>>
>>54996374
>what kinda language you want senpai?
>you know those ice cave puzzles in Pokemon Gold?
>say no more
>>
File: C switch hackery.png (5 KB, 376x214) Image search: [Google]
C switch hackery.png
5 KB, 376x214
>>54996819
The way I understand it, it undermines the switch cases.

Give a single good reason why you would write anything like this?
>>
>>54996856
>those ice cave puzzles in Pokemon Gold
those were fucking good

are they only in gold or in silver too?
>>
>>54996944
Are you 5?
>>
>>54996861
The way I read it is: Sometimes you want the result of something to depend upon the execution of gloop. Other times you don't want the result to be determined by the execution of gloop, so you jump to either arfle or barfle. It just looks clever to me.
>>
>>54996961
Are you an idiot?
>>
File: racket.png (15 KB, 502x126) Image search: [Google]
racket.png
15 KB, 502x126
>trusting FP in production
>>
>>54996328
I've taught myself a fair amount of C++, what should I do as a (relatively simple) project? I have finished the programming "challenges" from the book I downloaded, and while they do help me grasp specific concepts they don't really help me solidify my knowledge of the language.
Any recommendations?
>>
>>54996790
Allecate the memory on the heap and return a pointer.
>>
>>54997053
your mom?
>>
File: haskelel2.jpg (745 KB, 1920x1080) Image search: [Google]
haskelel2.jpg
745 KB, 1920x1080
>>54997089
LMFAO DELUSIONAL FP FAGS ON SUICIDE WATCH
>>
>>54997053
>ew eewww eeeeeewwwww
>the fag that wrote that should be hanged
There's an age limit for a reason
>>
>>54997243
>waaahhh he's not acting like a grown up like i am (trying to because i'm a 12 yo big boy playa)
>>
>>54997243
>big boys are happy in the presence of spaghetti code
wew lad
>>
>>54996861
I've once used this in a serialization procedure which takes an object and turns it into json.
It was structured like this:

string serialize(obj) {
for p in obj.properties:
serialized.append(typeHandler(p))
}
}


the typeHandler prodecure would check the type of a property and execute a serialization procedure based on it - if it's an object call serialize(), if it's a numeric value, serialize it etc.

typeHandler(prop) {
if prop.isObject() {
return serialize(prop.asObject());
} else if prop.isNumeric() {
return '"' + prop.toString() + '"';
} else if prop.isArray() {
for p in prop.asArray() {
serialized.append(typeHandler(p))
}
return serialized;
}
}


However if typeHandler encourntered an array, I could assume the type of every element within that array has the same type, therefore I only needed to determine the type once, and can then jump to the type I already determined:

typeHandler(prop, &type) {
switch(type) {
case -1: //type unknown, check types
if prop.isObject() {
type = 0
case 0:
return serialize(prop.asObject());
} else if prop.isNumeric() {
type = 1
case 1:
return '"' + prop.toString() + '"';
} else if prop.isArray() {
type = 2
case 2:
arrType = -1
for p in prop.asArray() {
serialized.append(typeHandler(p, &arrType))
}
return serialized;
}
}
}


That way I only have to check the type once, and can then use a jump table for successive calls.
>>
>>54997324
the compiled code for that is gonna look horrible
>>
>>54996861
>>54997324
That's one case where labels and goto is easier to read.
>>
Guys. Any good sites about practicing conversion between decimal, binary, and hexadecimal?
>>
>>54997627
gay
>>
File: delete your account.jpg (66 KB, 986x555) Image search: [Google]
delete your account.jpg
66 KB, 986x555
>>54996328
>anime
>>54996575
>trump-posting
delete your account
>>
>>54997324
>I could assume the type of every element within that array has the same type
But this is not necessarily true by any means, certainly not according to the JSON standard.
Do you really think it's worth the negligible performance increase to omit a type check or two and also make your code incorrect?
>>
File: 1465504939316.png (49 KB, 883x274) Image search: [Google]
1465504939316.png
49 KB, 883x274
>>54997682
>>
>>54997697
based
>>
>learn programming basics because it looked liked fun
>have a great time
>create a few useful utilities for myself
>since i'm 25+ and too late for this, it will never be a career; can't focus on it because of other "career"
>out of ideas what to do with my limited knowledge
>haven't touched programming in months, about to forget the few things i knew

Anyone else in a similar situation? Did you manage to escape it?
>>
>>54997697
BTFO
>>
>>54997706
what his image isn't showing is that hillary's tweet has over 200k likes and trump's reply has less less than 2k. it's over. hillary wins
>>
>>54997682
>History; made.
Is Hillary's biggest running point seriously that she's a woman?
I don't care for Trump but Hillary is pathetic
>>
File: azLM7op_700b.jpg (47 KB, 600x450) Image search: [Google]
azLM7op_700b.jpg
47 KB, 600x450
Taught myself html5 and css the past month, I wanna take it further so that I can get paid to do this.
Question is do I learn Javascript or C# next?
>>
>>54997750
obviously a reply is gonna have less likes than the main tweet idiot
>>
File: 1463860597347.jpg (47 KB, 621x502) Image search: [Google]
1463860597347.jpg
47 KB, 621x502
>>54997732
>limited knowledge
>you will never know this feel
>>
>>54997771
delete your account
>>
>>54997768
yes and she even tried to spin it like she wasn't a part of the establishment just because she's a woman

SJW ultra liberals are a minority and even if you wanted a female president, maybe not go with shillary, there are more important things in politics than what kind of genitals you have
>>
>>54997768
I'm voting for trump for sweet SJW and minorities tears.
>>
>>54996373
I know both high and low level.
>>
>>54997732

Yeah, just worked on my own little website, did a couple complicated projects involving math/ai and completed a uni course in Operating Systems (a hardcore one in C, not a babby "how to use the start menu")
>>
>>54996366

Any project is good practice.

Implement a graphical application.
>>
>>54997768
She's also campaigning pretty hard for all but abolishing the 2nd Amendment. For example, she wants to make it federally illegal for a father to give his gun to his son.
>>
>>54997635
F1C
15x16^2 + 1x16^1 + 12x16^0
3868
// to convert to hex
3868 mod 16 = 12
3868 / 16 = 241
241 mod 16 = 1
241 / 16 = 15

// end result
3868 => 15, 1, 12
F1C


And this works for conversions to any base system, not just hex.
>>
>>54997865
what about to a daughter?
>>
>>54997098
Tetris
Snake
Pacman
>>
>>54997884
All transfers in ownership of a gun, even in the event of the death of the original owner, would have required background checks and psychological evaluations.
>>
>>54997697
What a lazy comeback. Is he even trying? Feels like he was caught off guard.
>>
>>54997928
it was a joke, asspie. trump's not going to win in case you didn't notice so i hope you learn to accept whatever gun control she deems necessary. btw: delete your account
>>
>>54997931
how is "delete your account" witty at all and what would be a better comeback, dipshit
>>
>>54996971

The goal of writing software is not to befuddle anyone maintaining it (it could be you) it's to write a working product.

The problem is, once the product is released, management will shift the goalposts to something else, so your code ALSO has to extend to new scenarios. That code doesn't look like it extends easily.

A much easier way to write that EXACT logic, is to switch on mode, and have each case be a separate method/function. Using the stack is a bit less memory efficient, but will boil down to the same instructions to the processor, will do the same task, and will make people not hate you.
>>
>>54996328
When will cute anime girls become real?
>>
>>54997935
stay delusional fag

people are sick of the establishment, most bernie supporters prefer trump over shillary, trump will renegotiate the trade deals like bernie also wanted to
>>
>>54997966
>girl
>>
>>54997974
well according to twitter 2k agree with you while 200 million disagree. i wonder how the trump shills being paid to shitpost for him on 4chan will justify this
>>
>>54997098

A graphical form application. For shits and giggles, make it a resume builder, then hand it in as your resume (if you don't already have work).
>>
>>54997948
It's not that witty, it's just more so than trump's response.
>what would be a better comeback
I know it's you, Donnie. I'm not writing your next tweet.
>>
>>54998013
either you don't know how twitter works or you're this delusional or shilling this hard
>>
>>54998030
Trump. Can't. Win. How long will it take you to get it through your thick skull? You're fighting a hopeless battle. It's embarrassing. Give up
>>
>>54997935
>trump's not going to win
I think that Trump would be a shit president, but what the fuck makes you say that? He has done nothing but win so far when most people said he wouldn't get even a single delegate. He is consistently popular with everyone who the "experts" say should hate him.
>>
>>54998049
More republicans showed up to vote in the primaries and trump won unanimously in every state of the union.
>>
File: 1464369194514.gif (117 KB, 271x309) Image search: [Google]
1464369194514.gif
117 KB, 271x309
>>54998049
>>
>>54998049
Hillary. Can't. Win. How long will it take you to get it through your thick skull? You're fighting a hopeless battle. It's embarrassing. Give up
>>
>>54998055
if you take the current popular polls of him head to head with clinton in every state, and give him 5% on top of that in every state, he still loses by over a hundred delegates. trump's only popular in your NEET echo chamber and the only reason he won the primary is because he spent literally hundreds of thousands of his fortune campaigning. keep circlejerking over him with your neo-nazi cumskins while you can
>>
>>54998049
>oh gee a trump reply on a hillary tweet doesn't get as many likes as the hillary tweet
you're grasping at straws. you're deluded.
>>
>>54998089
>cumskins

hello pajeet
must feel bad to be a shitskin
>>
>>54998110
>>
>>54998089
>the current popular polls
his popularity is growing rapidly and he's barely even begun with his change in rhetoric to combat hillary vs appealing to republicans to beat cruz and all the others
>>
>>54998089
>delegates
Good thing the US election doesn't rely on delegates, then. Also, republican and democrat systems with delegates work completely differently, so it's absurd to even try to compare the two.
>hundreds of thousands campaigning
And Hillary spend literally millions from oil companies' bribes campaigning and slandering Bernie Sanders.
>>
>>54998089
>neo-nazi cumskins
sure is butthurt in here
>>
>>54997770
go js
>>
>>54996349
This post reminds me of how incredibly attracted to 2D I used to be.
I want to be a hormonal teen once again god damn.
>>54996374
>Befunge is a stack-based, reflective, esoteric programming language. It differs from conventional languages in that programs are arranged on a two-dimensional grid.
Fuck that's cool.
>>
File: help.jpg (102 KB, 593x441) Image search: [Google]
help.jpg
102 KB, 593x441
Does anyone know a good website translator?

from russian to english
>>
>>54997770
learn real programming. web dev is "easy" but you have no long term job security. learn java, or if you insist on falling for the meme, C#.
>>
>>54998263
google translate if you just want to more or less read some shit for free

fiverr if you need an actual translation without spending too much
>>
>>54998006
>boy
Even better.
>>
>>54998274
I already know java from my bachelor's degree, but everyone seems to want html/.net abilities.
>>
>>54998274
>learn java
Are you implying there's a place on earth where just knowing java will get you hired

i'm not meming i genuinly dn't know
>>
>>54998360
android uses java, so anything with android development
>>
>>54998316
ok well then i think you should learn C#, it's good to know multiple languages and you can go for the .net jobs as well
>>
>>54996861
Doesn't this just
if((mode==0||mode==1) && gloop(a,b)){ 
result=arfle(a,b);
}
else{ //covers the case 2:
result = barfle(a,b);
}
return(result);

There's no default case so the only valid values are [0,2].

Is maybe the point of writing it like that that you can easily split the different cases but you wanted to use the case 0 to use gloop(a,b) to check which case you go into?

So it should be more like
switch(mode){
case 0: if(gloop(a,b)){
case 1:
result=arfle(a,b);
break;
}
else{
case 2: //maybe we want multiple of them here aswell. I'd put the case before the result= if that's not the intent
result=barfle(a,b);
break;
}
}
return (result);


Or am i misinterpreting the code?
>>
>>54997872
What about converting on pen and paper?
>>
>>54998405
Thanks for the advice man
>>
>>54998410
Oops. first line should be :
if((mode==0&& gloop(a,b))||mode==1 ){
>>
>>54998431
That's the pen and paper method.
How do you think programmers write functions?
They write them out on paper and then convert it to a function.
>>
im actually working rihgt now. they pay me about 100$ a month for 5 hours of work/day but its okay because i live in the third world and thats like 3 times the minimum wage

im using php and i see why they say it's bad. these people dont know what the fuck they're doing. it just attracts retards
>>
>>54998251
Try it out, it's a fun time waster and my favorite esolang.

https://esolangs.org/wiki/Befunge
http://www.mikescher.com/programs/view/BefunUtils
http://www.mikescher.com/blog/2/Lets_do_Befunge93
>>
File: 1458942024464.png (335 KB, 1280x720) Image search: [Google]
1458942024464.png
335 KB, 1280x720
>>54998461
>php
>>
>>54998461
Are you good at whatever you do? Because I'd like some contact info for later. I really like the idea of outsourcing like this.
Do you have friends who do other stuff as well? Maybe you could put me in contact with them and you get some money for that.
>>
>>54998294
>>54998263
Does anyone know any other?
>>
>>54998448
Pardon my ignorance, but what does F1C and mod mean?>>54998461
>>
>>54998502
the absolute madman
>>
>>54996834
what about people who write in both high and low-level languages?
>>
>>54998569
F1C is a hex number
mod is modulo division
you remember in 2nd grade when division was simply getting the remainder?
That's what modulo is.
>>
>>54998549
iirc google play has a paid service where developers submit strings of text and random people translate them
>>
>>54996888
gold and silver were the same except for one dungeon each where you get the legendary bird pokemon.

they kind of reminded me of the walking puzzles in oracle of ages which were also really satisfying
>>
>>54996861
Basically, you write this kind of code because you think goto is evil.
>>
>>54998609
OK so actual pen and paper conversion is obsolete?
>>
>>54998641
Nobody says goto is evil except for webdev kids who still believe the meme about C being portable assembler.
>>
>>54998663
What the fuck are you asking even?

Go figure out how to do it on paper and then you'll figure it out how to write it in software.
>>
>>54998599
Race traitors desu
>>
>>54998684
huh, back the fuck off?
>>
>>54998684
I only asked about a site to practice physical conversion and you started going on about software conversion.
>>
>>54998664
I know, that's the kind of people who write that crap instead of

// assuming mode is a label value, but could be done differently
goto *mode;

mode_0:
if !gloop(a, b) {
goto mode_2;
}
mode_1:
return arfle(a, b);
mode_2:
return barfle(a,b);


>>
>>54997928
So you want psychopath jimmy to get a glock from daddy to go shoot up his school?
>>
>>54996790

Don't do >>54997105 unless you're looking for trouble.

Allocate the memory however you want but do it OUTSIDE the function and pass in a reference to the memory which the function fills the values of.
>>
>>54996328
Here are my problems:
>1: I have no projects
>2: I have no money
Would freelancing be good for me? I'm afraid my skill level won't be all that good enough to do shit on Upwork or Freelancer, but I've been doing this shit for like 3 years now.

What are the best freelancing sites?
>>
>>54998599
In the same source file? There's no way that will compile or assemble properly.
>>
>>54998784
uh
well technically you can use inline c in chicken scheme and inline assembly inside of that maybe.

but no, not normally in the same file
>>
>>54998717
it shouldn't be hard at all and not require practice if you understand how it works
>>
>>54998298
GOTO HIME
>>
>>54998717
>practice physical conversion
Anon you can probably understand the confusion since this is /dpt/.
Why would you ever not use a computer to do math? We humans are notoriously bad at it.
>>
>>54998502
Kek, I think I love that guy now.
>>
>>54998722
Damn that's some neat and easily readable code right there.
>>
>>54998770
>I'm afraid my skill level won't be all that good enough to do shit on Upwork or Freelancer
I'm always questioning myself like this.

But then I realize that if people agree to pay for it I'm good enough.
>>
>>54998502
>i don't need math in CS/CE
>>
Is it OK if I post gamedev progress here? I promise it won't be art stuff. It would be stuff like "look at how this nice system works now"
"my game now supports almost infinite worlds"
"look, asset streaming/reloading"
"live shader recompilation"
"how do I fix this quadtree?"
>>
>>54998967
that would probably be fine
>>
File: Rasmus Lerdorf.png (23 KB, 583x194) Image search: [Google]
Rasmus Lerdorf.png
23 KB, 583x194
>>54998502
He knows a lot about PHP then.
>>
>>54998502
i do it for the money
>>54998548
i think i'm good enough. i'll probably be able to do whatever i'm asked to, given that it isn't something very specific like cryptography or fancy statistics. yeah i know some third-worlders that know how to program too. i'm at [email protected]
>>
>>54999057
>[email protected]
Thanks. I'l save that for later. Maybe months or years (or far less) but I'l keep it.
>>
>>54999057
>ichinisanyongorokunanahachikyu
seriously? get a shorter email address
>>
>>54996328
>pythonista
>getting better at C
>mfw no more whitespace
if ( a ==


2 {
int b =
2;


// ass
}
>>
>>54999097
i only use that one on 4chan friend
>>
>>54999111
>>pythonista
*dibs bedora*
>>
>>54998784
Racket lisp has super-c, which lets you write inline C code. They also have modules for Algol 60 or 68 ECMA+JavaScript so you could inline those as well. The ECMAscript language is provided as a separate language on top of racket, so you'd have to wrap it in an explicit module expression if you wanted it inside of another file. You can evaluate JavaScript expressions using the other library with just the eval-script function it provides though.
>>
>>54999057
Which country are you in that that's a normal and memorable email address?
>>
What's the best language for someone who wants to make video games?
>>
>>54999216
if you just want to make video game's, learn an engine
>>
What's the equivalent of java System.out.print("string"); in python??

I mean, a print that doesn't cause a new line to form
>>
>>54999216
C++ and opengl/directx, GLSL/HLSL
>>
>>54999176
Danks
>>
>>54999216
JavaScript.
>>
>>54999216
What kind of video game? Since you're asking you don't know any language I'm assuming.
>>
>>54999216
Do you want to make video games or do you want to write a game engine?
>>
>>54999233
print 'hello',
print 'world'

will print hello world on same line
>>
>>54999209
nihon desu ne
>>
>>54999209
>Let's Count in Japanese!
>1 (ichi).
>2 (ni).
>3 (san).
>4 (shi or yon).
>5 (go).
>6 (roku).
>7 (hichi or nana).
>8 (hachi).
>9 (ku or kyu).
He's just a weeb. No one reasonable would make their email address [email protected]
>>
>>54999332
its just some address i made for some 4chan thing a while ago. whats the big deal..
>>
Newfag here
How do I print the highest numer in a set of n numbers?
I don't know how much is n until the program operator ends adding numbers to it.
>>
>>54999489
use a variable for the highest number
>>
>>54999489
You mean the maximum?
type max = yourarray[0];
for ( int i = 1; i < N; ++i )
if ( yourarray[i] > max )
max = yourarray[i];

Something like that. You first assume the maximum is the first number, then you go check for every other number whether it's bigger, if it is, then that's the new maximum etc.
>>
>>54996834
Could you call him a high level programmer? He made Python in C, so he's mainly a C person I'd think
>>
>>54999535
I'm not allowed to use for (...)
Is there any way to do it using a do while?
>>
>>54999639
No need for that outdated bullshit, it's current_year.

auto max = *std::max_element(array.cbegin(), array.cend())
>>
Why do webdevs try their hardest to force JavaScript for backend and applications programming?

Every time im forced to write JS for web scripting I feel dirty all over
>>
>>54999732
Because you're a retard who tries to be elitist by hating on JS? Kill yourself?
>>
>>54999743
>Kill yourself?

Why did you pose that as a question?
>>
Got a Samsung Gear S2 Smartwatch as a present. Now, I'm trying to write an app which show's me the nearest bus/train/tram-stations with departure times of the next few busses/trains/trams.

It's a Tizen system and the Online-API only returns JSON stuff. Using xmlhttprequests seems to only work only for XML stuff. A async call doesn't seem to work yet.
>>
>>54999639
>Is there any way to do it using a do while?
Of course there is. All a for loop is
for(a; b; c)
. a is initializing a variable before the loop takes place, b is the test to see if the loop should take place, and c is the action taken at the end of every loop. You can easy rewrite it as
a
while(b) {
...
c
}
>>
>Flex bison git asp.net jsf
I wrote this this last weekend, thinking i could play with all these tools before Monday. I just got my flex/bison project working.
>>
BeautifulSoup isn't searching my html properly
do I need to write my own html parser or are there any alternative modules for python?
>>
If your language doesn't have dependent types then it's basically not worth using.
>>
>>54999743
>bizarre scoping
>bizarre typing
>bizarre inheritance
>bad performance
What's not to like about JS?
>>
>>54999732
It's because they're incapable of learning anything else.

Prove me wrong webshits
>>
>>54999732
>/g/ loves sicp
>/g/ hates scheme's parenthesis heavy notation
>/g/ refuses to use a language that was explicitly designed by a scheme programmer to be scheme with a more "normal" c-like braces syntax because "it's popular with webdevs"
>>
>>54999984
>bizarre scoping
Maybe if you're retarded?
>bizarre typing
It's not a typed langage?
>bizarre inheritence
Inheritance isn't a feature of the language, so I don't know which butthole you pulled this from?
>Bad performance
V8 doesn't exist?

Thanks for confirming that you're a retard?
>>
>>55000107
Maybe, just maybe, /g/ is full of retarded shitposters while the actual programmers are off actually fucking programming?
>>
>>55000107
Eich wanted to give us Scheme in the browser, but he only had 10 days to work on it so we got the shitshow that is JavaScript instead. It's like Scheme in the way an aborted fœtus is like a baby.
>>
>>55000107
Nobody who learns JavaScript these days has any idea what functional programming is, they're just regurgitating the shit they learned from their coding bootcamps.
>>
>>55000142
That seems to be the case.
>>
>>55000126
>muh v8
Still not as fast as C or Java. AND IT NEVER WILL BE
>>
>>55000146
Just think, JS is what we're stuck with now. Forever.
>>
>>54999711
>using C++ in *current-year*
(apply max numbers)
>>
>>55000210
>parentheses
>>
>>55000244
>
>>
>>55000170
It's fast enough. Prove me wrong.
>>
>>54999743
Will someone post the image of how JS handles mathematics? I remember it include shit like "5 + '3' returns 53"
>>
>>55000244
5 curly brackets have been deposited in your poo account my friend, thank you for your everlasting support.

Sincerely,
Pajeet Enterprises
>>
>>55000287
No, different definitions of operators doesn't make them inherently inferior, and feeling irrational hatred towards them for being different is like hating black people. Are you an operator bigot?
>>
How long has this guy been trying to argue about javascript in /dpt/ now?
>>
>>54997732
>>since i'm 25+ and too late for this
it's not late.
>>
>>55000200
Highly doubt it. "Better-than-javascript" alternatives like typescript are becoming more popular and are backed by large companies and big bucks.
>>
>>55000305
'5' + 3 gives '53'
'5' - 3 gives 2
The language has no fucking consistency.
>>
>>55000330
How is typescript better?

It just seems like another obscure transpiler abstraction layer?
>>
>>54997732
Find interesting APIs and set up a server using a custom backend to pull and compile data. You can just use it to find comparisons or also use some interface to present the data. It would be a fun project and literally tons of APIs are out there.
>>
>>54997770
html and css aren't really programming.

Learn JS and try to learn something like node.js/express.js or angular.js as a stepping stone. Really I would recommend SICP or just K&R to start if you really want to get elbows deep in the bull's ass but if you want a comfy and fun experience learn JS.
>>
>>55000381
>obscure
Are you sure about that?
>>
File: jstruthtable.png (28 KB, 705x490) Image search: [Google]
jstruthtable.png
28 KB, 705x490
>>54999743
>>
>>55000330
It's still targeting JavaScript.
>>
>>55000406
>comfy
>fun
>js
No.
>>
File: feels good.jpg (92 KB, 680x497) Image search: [Google]
feels good.jpg
92 KB, 680x497
>when you spend days hacking together your custom mesh builder
>when it all comes together so all the "special cases" just turn into an if/else
>when you use mathematica to simplify the boolean conditions for culling vertices
>>
>>54996328
who is that girl?
>>
>>55000481
hime
>>
>>55000453
>you
>NEET
Yes.
>>
>>55000423
That's not bad. False the value of not the same as the word false in a string. Why would they be equal? False isn't "nothing", so its not equal to null. Null is undefined. Strings, like in C and other languages, are indexes, so the empty array just returns zero. That example is even given twice. It's a little quirky to have something that's empty return zero, but I get it. It's not any worse or weirder than lisp's "if it ain't nil, it's #true" and boolean short circuiting.

To be honest, that truth table looks very reasonable to me and I don't even use JavaScript. Some of you guys go out of your way to get mad about dumb shit.
>>
>>55000517
Ordinarily I would say no, but I quit my job last week, so I suppose I am indeed a NEET right now.

Gods, that was difficult to write.
>>
>>55000433
Hence the quotes.
>>
>>55000423
In a good language, the first one is false and the rest are compile-time errors.
>>
>>55000554
>That's not bad
'0' == 0
0 == ''
'0' != ''
Can you really say that this isn't that bad?
>>
>>54996373
/g/ 2016
>>
File: 1464411185004.jpg (118 KB, 673x673) Image search: [Google]
1464411185004.jpg
118 KB, 673x673
So I'm trying to do some shit in C++, and I'm trying to return an array from a function. I googled it and people talked about pointers and whatever.

What are pointers and how do I use them?
>>
>>55000726
A pointer is like a dick. it points
>>
>>55000726
I'd give you a few pointers but they might send you into disarray.
>>
whoops forgot my code tags

here's a problem
you can interpret a structure like this:

<large header>
<small header>
<text>
<text>
<text>
<small header>
<small header>
<text>
<large header>
<small header>
<text>
<small header>
<large header>
<small header>
<text>



which should obviously be sorted like this:

<large header>
<small header>
<text>
<text>
<text>
<small header>
<small header>
<text>
<large header>
<small header>
<text>
<small header>
<large header>
<small header>
<text>


in an XML file
how would you go about setting up a loop for nesting that? I'm completely lost

I mean one possible solution is a 2d array where you assign a label to each header or text and then interpret it later but that seems like there MUST be a better way to do it
>>
>>54997770
Dont post that picture you arent a programmer kys. You know fucking markup languages well done. Also no programmer ever thinks he is a god
>>
File: 666.jpg (51 KB, 394x379) Image search: [Google]
666.jpg
51 KB, 394x379
>see this thread
>'woah who is this semen demon?'
>reverse image search, doesn't work, search more
>turns out it's a fucking trap

Goddammit, /g/.
>>
>>55000726
>has to learn all about the C and C++ memory model just to write a function
You're in for a month of tedium before it clicks and your couple lines of code just werk. I'm sorry.
>>
>>55000406
Thanks for the tips
>>
File: 1449611751881.png (1 MB, 1702x2471) Image search: [Google]
1449611751881.png
1 MB, 1702x2471
>>55000726
A pointer is the location in memory of whatever it's pointing at. You usually shouldn't return a pointer from a function because the thing being pointed at will automatically be cleared from memory.
>>55000811
Pic related
>>
>>55000750
My friends and I used to joke about this.
>Bro if you run sizeof() on my pointer it will return a huge number.
>Wachhu doin faggot? Forming a linked list?
>I don't have a girlfriend. Owner of a dangling pointer.
>>
>>55000726
Its like a address to a house
>>
What should I learn first? Python or Javascript?
>>
>>55000914
neither you should kill yourself.
No but really why do you pick 2 memelangs?
>>
>>55000914
you should Never learn a shit language like javascript first if you're new to programming
>>
>>55000941
I would go as far as to say you should never learn javascript at all
>>
>>55000914
learn java
>>
>>55000914
Learn C++, then learn C.
>>
>>55000932
>>55000941
I know C java and Csharp
>>
So I just learned that my game engine supports custom DLL's for importing into games when they are compiled. This is fantastic because there is a use I really need form one that is very simple but the game engine I am using isn't capable of doing it. I need to get the window color, the thing you can change in the personalize settings on Windows. I have already gotten some help and source code and was able to make one that gets the ACTIVECAPTION color which prior to windows 7 I believe worked. However I need this feature for 8 and 10 in mind and on these platforms it only returns a light blue color.
I know VERY little about C++ so I was helping someone could lend me a hand. Here is my source for the DLL:
#include <windows.h>
#define DLLEXPORT extern "C" __declspec(dllexport)

COLORREF GetBrushColor(HBRUSH hBrush) {
COLORREF color = 0;
LOGBRUSH logBrush;
if (GetObject(hBrush, sizeof(LOGBRUSH), &logBrush)) {
color = logBrush.lbColor;
}
return color;
};

DLLEXPORT double GetCol(void) {
return GetBrushColor(GetSysColorBrush(COLOR_ACTIVECAPTION));
};

Ive read about using DwmGetColorizationColor to get it but I dont know how this works.
Any help would be appreciated :)
>>
>>55000959
Kys sanjeef you code-monkey faggot
>>
>>55000965
learn C++
>>
>>55000976
nice meme nathan
>>
>>55000986
no
>>
>>55000381
It's ES6/7 with static typing and enums.
>>
>>55000726
>>So I'm trying to do some shit in C++
>doesn't know about pointers
wut
there really are people like this? and I keep being sorry for myself for not knowing shit (data structures, some concepts and other shit)
>>
>>55001000
enjoy your fucking python and js then lmfao
>>
>>54998902
>Why would you ever not use a computer to do math? We humans are notoriously bad at it.
What are you smoking, optimization starts at the pen and paper math, then you write the program.

Think of calculating fibonacci numbers, you can either do some O(n^2) recursion shit or just use the proven formula that gives you O(1);
>>
>>55000726
learn java before you delve into the world of C++
>>
>>55000406
>angular.js
>comfy
The fuck are you on?
>>
>>55000965
go python then if you dont want to die off of cancer
>>
>>55001032
>optimization starts at the pen and paper math, then you plug it into mathematica, then you write the program.
FTFY
>>
Let me rephrase my question into something more specific.

I currently know Java, C# and C, I have developed a few projects and would like to build a website to show off my portfolio.

Should I build a website using Python or Javascript?
>>
Is there a way to rewrite this so that I don't get an uninitialized variable warning on compile?

template <typename T>
T SelectQuery(std::string QueryText)
{
T ReturnType;

try
{
// Get the value
otl_stream i(50000, // buffer size
QueryText.c_str(),
database
);

while (!i.eof())
{
i >> ReturnType;
}
}
catch (otl_exception& p)
{
PrintErrors(p, __LINE__);
}

return ReturnType;
};
>>
>>55000998
why thank you panjeet
>>
>>55000406
>this is what flaming web fags actually believe
>>
>>55000870
>return a huge number
wtf u on some kinda x128 architecture or something?
>>
>>55001037
I already learned some. Latest thing I learned about was inheritance after learning about ArrayLists.
>>
>>55001114
What happens if i is eof right from the start?
>>
>>55001183
a pointer is like a java reference, it points to a variable
>>
>>55001101
None you should build a website by using html, css, <insert server side meme here>, python/ruby on rails/js/any other popular lang/framework
>>
>>55001101
ask in >>>/g/wdg
>>
>>55001101
the front end should be in html and css for fuck's sake
>>
>>55001205
that shouldn't happen. even if it does happen its not a big deal
>>
>>55000971
i wish i could help you
>>
>>55001238
The front end should be C/C++ WASM.
>>
>>55001276
only if it's a game or someshit a basic website doesn't need js cancer
>>
>>54998717
>>54998569
Go learn about the modulus operator!

    static int[][] arrayToMatrix(int size, int [] arr){
int [][] matrix = new int[size][size];
for(int i=0,j=0;i<arr.length;i++){
if(i%size==0){
j++;
}
matrix[j-1][i%(size)] = arr[i];
}
return matrix;
}

How would you do it without mod in O(n)?
>>
File: DMUX_027.png (515 KB, 1600x865) Image search: [Google]
DMUX_027.png
515 KB, 1600x865
Got the vehicle physics going for my game, and got the tires drawn using Bullet Physics and Irrlicht. Now we are trying to get some basic networking going. Not sure why people hate C++
>>
Hi is anyone here? I have a question
>>
>>55001527
1+ month later and this is all you've got lol
>>
>>55001556
hello yes sir this is pajeet how may I answer question?
>>
>>55001560
Nice to know you are following our project! :)
>>
>>55001562
I am new to programming. I have begun to learn Java, I know the basic syntax now.

What project should I do first to get good?
>>
File: bait.png (122 KB, 625x626) Image search: [Google]
bait.png
122 KB, 625x626
>>54996861
>flat out ignores any sort of style guide
>"why is this language so ugly?"

0/10 apply yourself.
>>
>>55001573
A snake game might be fun, that is what I did
>>
>>55001573
Minesweeper is a fun one. Also Simon Says can teach you something about threading.
Thread replies: 255
Thread images: 37

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.