[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: 34
File: dpt.jpg (20 KB, 332x332) Image search: [Google]
dpt.jpg
20 KB, 332x332
What are you working on, /dpt/?

Old thread: >>52261903
>>
>she
>>
File: 1449431549787.png (59 KB, 562x573) Image search: [Google]
1449431549787.png
59 KB, 562x573
Can't wait
>>
>>52269646
> be me
> try to escape /b/ due to trap threads
> end up in /g/ with a trap thread
> i literally cant even
>>
File: ruff ruff victory.jpg (29 KB, 450x504) Image search: [Google]
ruff ruff victory.jpg
29 KB, 450x504
>>52269646
Not this fucking faggotry again.
>>
>>52269676
This.

Stop putting Haskell shit in the OP.
>>
>>52269646
I would love that my girlfriend liked Haskell like her.
>>
>>52269676
that dog looks like a midget
>>
Eighth for Java
>>
God damn she's hot
>>
File: a ruff victory.jpg (65 KB, 500x368) Image search: [Google]
a ruff victory.jpg
65 KB, 500x368
>>52269697
welcome to /dog petting thread/
shitpaws need not apply
>>
First for Java is shit amirite
>>
>>52269692
>her
>>
File: le lol over lisp.png (162 KB, 571x307) Image search: [Google]
le lol over lisp.png
162 KB, 571x307
>>52269545
* (defmacro sign (x)
`(let ((y ,x))
(if (= y 0)
0
(/ y (abs y)))))
SIGN
* (defvar a -1)
A
* (sign a)
-1
* (sign (incf a))
0
* (sign (incf a))
1
* (sign (decf a))
0
* (sign (decf a))
-1

literally lolling @ blubfags right now
>>
>>52269729
delete this
>>
>>52269739
see >>52269750
>>
>>52269768
OK rajesh
>>
File: le autism acronym.png (51 KB, 338x288) Image search: [Google]
le autism acronym.png
51 KB, 338x288
>>52269768
>>
File: ruff victory.jpg (58 KB, 620x465) Image search: [Google]
ruff victory.jpg
58 KB, 620x465
>>52269790
>>52269776
>>
>>52269650
It's a girl.
It just has a dick.
Why is that so hard to understand?
>>
>>52269808
Even you call it an it. Nice try.
>>
File: sussman shig.jpg (71 KB, 500x375) Image search: [Google]
sussman shig.jpg
71 KB, 500x375
>>52269808
>she
i shiggery didgeridoo
>>
poltards need to go back to their containment board
>>
>>52269913
You first, trapfag.
>>>/b/
>>
>>52269650

yes, she, as in girls
>>
>>52269808
>Jayley
>"She"
It's a man baby, a very gay man
>>
If I got a math degree, how useful would it be to help me get good at programming/CS?
>>
>>52269808
>girl
>XY chromosomes
Choose one.
>>
>>52270401
>not a girl
>implements IFuckable
choose one
>>
>>52270458
>Him
>Not a man
You better up read that code son, Girl inherits IFuckable from humanoid like Man.

I guess print(anon.sexuality) turns out with a "faggot"
>>
>>52270489
>all men implement IFuckable

now who's the faggot
>>
>>52270458
I don't follow you. My point was that XX and XY are held constant and define sex.

Do you change the values of your constants?
>>
>>52270520
At least my denial attribute isn't equal to my virginity's like yours.
>>
>>52270529
My point is that you can't into OOP.
>>
struct token_list {
struct token *data;
size_t len;
size_t max;
};

struct token*
get_token(struct token_list *list)
{
if (list->len >= list->max) {
if (list->max >= SIZE_MAX - 1) {
return 0;
}

size_t newmax = list->max == 0 ? 1 : list->max * 2;

if (newmax < list->max) {
newmax = list->max + 1;
}

struct token* newdata = (struct token*)realloc(list->data, newmax * sizeof (struct token));

if (!newdata) {
return 0;
}

list->data = newdata;
list->max = newmax;
}

return &list->data[list->len++];
}


Rate my growable array.
>>
>>52270529
Girl is not a sex.
>>
>>52269808
>It's a girl
>It's
Shitlord.

But seriously, just because it has tits does not make it a woman.
>>
>>52269646
https://github.com/Shrooms/Musique-Libre
>>
>>52270529
>and define sex.
society and the legal system seem to disagree.

You might as well be giving out to people for calling gnu/linux "linux" because it's not your own personal definition for that word.
>>
>>52269646
kill yourself
>>
>>52269729
epic meme xD
>>
just fucking nuke all of google and all web dev shit

i just missed an auction because gjewgle chrome lagged out on me

takes more than a minute to confirm a bid lmfao kill yourselves
>>
>>52271169
what'd you bid on
>>
>>52269729
I agree
>>
File: htt.webm (1 MB, 852x480) Image search: [Google]
htt.webm
1 MB, 852x480
Ask your beloved programming literate anything.
>>
>>52271169
Next time use sniper software. Don't blame chrome for your shitty internet connection.
>>
>>52271314
What a slut
>>
>>52271314
>tfw a woman will never rape you so sensually
>mfw no faces saved
>>
>>52271314
Guy looks like he's going to die or something.
>>
>>52271291
a pair of panties

>>52271346
i don't even think there's sniper software for this auction site. it's not my internet connection at all, just that i have too many tabs open. closed down two windows yesterday and it ran okay but then i had more tabs for today and it lagged like shit. could be the site too because i could refresh the page and view the bidding history with it loading within seconds. when i have more than 500 MB memory available it shouldn't take a full minute to click on a confirm button after already having refreshed the page and entered a bid.
>>
>>52270458
>>52270489
>>52270520
>oop mandates you to be bisexual
this is why you need expressive type systems faggots
>>
>>52271427
>just that i have too many tabs open
and your blaming chrome for that?
>>
Any new developments in the functional world? Is Haskell still the only language anyone cares about? Is its package system still underdeveloped? Did lens go mainstream?
>>
>>52269808
If you have sex with it, it makes you gay. It's a guy
>>
>>52271449
i could have this many tabs open 10 years ago and it would run just fine

modern browsers and modern web dev is cancer
>>
>>52271427
Make one then you entitled fuck
>>
>>52271491
MOODS
>>
Threadly reminder that:

Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently. Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now. If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!
>>
File: le lisper.jpg (27 KB, 576x538) Image search: [Google]
le lisper.jpg
27 KB, 576x538
>>52271509
No.
>>
>>52269646
please stop this programming trap meme
thanks
>>
File: disgusted batsy.png (569 KB, 1204x885) Image search: [Google]
disgusted batsy.png
569 KB, 1204x885
>>52270001
>manface
>manshoulders
>manwaist
>manhands
>manhips
>manlegs
>manpenis

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>she, as in girls
>>
>>52271500
i really don't think i'm asking too much if i think a web browser with an additional half a GB memory available to it should take less than a minute to click on some javascript button and that an ebay-owned website that charges fees out the ass should be able to respond in time
>>
If you don't use "using namespace std;" then you're a fucking hipster
>>
>>52271576
It's a no-no in header files.
Acceptable in cpp files
>>
>>52271576
kill yourself
>>
>>52271529
Yes.
>>
>>52271576
>I have never written anything larger than 2 files: The post
>>
>>52271509
I like the anti-python manifesto too, friend :)
>>
>>52271576
#include <stdio.h>
#include <stdlib.h>

#define you "faggot"
#define cpp "shit"
>>
>>52271576
>c++
>>
Thats a man, baby
>>
>>52269808
>>52269646
https://u.pomf.is/mijoiz.webm
:^)
>>
>naming it C++ instead of ++C
See, this is where it all went wrong for Stroustrup
>>
>>52269729
java made you
>>
>>52271509
Half of that is bullshit:

alright, whatever, beauty is overrated
>everyone has to write boilerplate because babby can't keep up with the rules
buzzword is better than buzzword
buzzword is better than buzzword
flatness really is better than nested
density arguments are for weenies
whoop de fucking doo
special cases exist because not all rules are universally applicable
false dichotomy
true
true
it depends
lel
time is not a debate
ok
or, it may be so obvious, it's an overrated wrapper for shit that can just be called directly
ok
>>
>not programming everything in Assembly
>>
>>52271450
>Did lens go mainstream

Yes.
>>
>>52271608
this. python doesn't follow the "python philosophy"
>>
>>52262310
read -p "please input salt:" salt
read -p "please input text:" text
echo "Your password is
$(echo "$salt$text" | md5sum)"

Does this do what you want it to do?
>>
#include <stdio.h>
#include <math.h>

int main(void)
{
float a, b, c, x;
printf("\nformat is (a/b)=(c/x), program calculates x.\n");
printf("Enter a:\n");
fflush(stdout);
scanf(" %f", a);
printf("\nEnter b:\n");
fflush(stdout);
scanf(" %f", b);
printf("\nEnter c:\n");
fflush(stdout);
scanf(" %f", c);

x = ( b * c ) / a ;

printf("\nfor (%f/%f)=(%f/x),\nx equals %f\n", a, b, c, x);

return 0;
}

how can i fix this so that it doesnt segfault after you enter the first value
>>
File: britneyspears.jpg (237 KB, 853x1280) Image search: [Google]
britneyspears.jpg
237 KB, 853x1280
>>52271753
i did some stuff in x64 assembly, performances were good but it doesn't worth it.
>>
>>52271840
Why are you using fflush everytime? I'm sure that's the reason
>>
>>52271874
if i don't then when i run it, nothing will print untl after you enter your value.
>>
>>52271840
I don't remember the semantics of scanf, but shouldn't it be scanf(" %f", &a); ?
>>
import Shitpost.Util.*;

if (thread.contains("Python")) {
this.text("Consider suicide senpai");
this.attach(smugpepe.png);
this.post()
}
>>
>>52271840
>int main(void)

C scrub here
I always just use main()
I don't declare it as a certain type (obviously it'd be int because it returns 0 or other integers upon an error), nor input the 'void'
Is this valid?
>>
>>52271914
>no semicolon
maybe coding ain't UUUU
>>
>>52271932
>coding

die
>>
>>52271890
format is (a/b)=(c/x), program calculates x.
Enter a:
1.7

Enter b:
2.3

Enter c:
5.9

for (1.700000/2.300000)=(5.900000/x),
x equals 7.982353

Strange, works on my machine with all the fflush()'s commented out. Also don't forget that you need to pass the address of each variable to scanf
>>
>>52271788
It's pretty hilarious really, python doesn't just not follow its owned philosophy, it outright goes against every single one of its tenets.
>>
>>52271753
I'd rather program in assembly than C anytime, but fuck writing in assembly when there's OCaml!
>>
>>52271908
no it works, when i put 'float a[8], b[8], c[8], x'
and have x=0, it works and shows x as 0.000000 like its supposed to. i wish my first c program would just werk tho.
>>52271917
i just do it because if i dont then my compiler gives me a warning
>>52271984
on the mingw shell it doesn't work without the fflushes. if it works for you then that means i have successfully made my first c program, for someone at least yay
>>
>>52271457
gay: (of a person, especially a man) homosexual.
homosexual: (of a person or animal) sexually attracted primarily to other members of the same sex. being either a male androphile or a female gynephile.
androphile: one who is attracted to masculinity or to men.

1. Having sex with a member of the opposite sex does not necessarily mean you are attracted to them. If an alpha male does it as a display of dominance, does that make them homosexual?
2. Someone who is attracted to masculinity and men by definition would not be attracted to someone, regardless of sex, who looks like a feminine woman.
>>
>>52272059
That's because a[] means the same thing as &a. Try to use &a.
>>
>>52272063
>If an alpha male does it as a display of dominance, does that make them homosexual?
Yes
>>
>>52269646
Who's that fine young lady?
>>
File: yoda-bait.jpg (146 KB, 500x378) Image search: [Google]
yoda-bait.jpg
146 KB, 500x378
>>52272111
>>
>>52272059
put
scanf(" %f", &a);
[/code[
instead of what you have now for each scanf(). scanf() needs to be passed the address of the variable you are storing the value in which is what the & operator is for. It works when a is an array because a is storing the address of the first element.
>>
>>52271700

underrated.
>>
>>52271984
wait how do i pass the address of each variable to scanf? with the & symbol?
>>
>>52272170
Yes.
>>
File: vim.png (47 KB, 663x120) Image search: [Google]
vim.png
47 KB, 663x120
>It takes a week to learn a fucking text editor.
what's wrong with you autists.
>>
>>52272170
That's what the & operator does, it returns the address of the variable instead of the variable's value.
scanf(" %f", &a);


You'll learn why when you get to pointers.
>>
>>52272193
>It takes a week to learn a powerful tool
What's wrong with you autist.
>>
you guys are my hero thanks
>>
>>52269646
Please use an anime image next time.
>>
File: 1433989626811.jpg (63 KB, 686x576) Image search: [Google]
1433989626811.jpg
63 KB, 686x576
Anyone has a decent article/guide on how, when and how commonly threading should be used?
>>
File: itsbeautiful.png (4 KB, 313x167) Image search: [Google]
itsbeautiful.png
4 KB, 313x167
>>52272197
it works with the fflushes btw
i officially made my first program w00t
>>
>>52272271
>how
futures
>when
always
>how commonly
the commonliest
>>
>>52272271
At 310 posts. No anime image. No trap image. Proper subject and "What're you working on, /g/ (or /dpt/)".
The only proper way to thread tbqh.
>>
>>52272275
G E N T O O
E
N
T
O
O
>>
File: 1450611285385.jpg (64 KB, 640x761) Image search: [Google]
1450611285385.jpg
64 KB, 640x761
Thankfully nothing but it's back to uni in just over a month
>>
>>52272275
Good job m8
>>
>>52272098
>sexually ATTRACTED primarily to other members of the same sex.

Nice reading comprehension, faggot.
>>
>>52272271
Depends on the software.
>>
>>52272315
I propound the extraordinary idea that nobody with a sound mind engages in homosexual activity with being attracted to the same sex.
>>
>>52272295
The last 10 post should be dedicated for voting on the image.
>>
>>52270601
>no replies
;_;
>>
>>52272349
*without
>>
>>52272366
I recognize the trip, but not the name. Who are you tripfag?
>>
>>52272315
in today's society there is not really any valid use case for willingly having homosex without being non-heterosexual unless perhaps if there's compensation involved
>>
>>52272250
please kill yourself
>>
>>52272358
That's means it's good. Be happy about it.
>>
>>52272271
Anywhere it makes sense.

For example, in one of my applications I'm making calls to a remote database. This can take anywhere from a fraction of a second to 30 seconds.

You don't want to make the GUI non-responsive, so you thread out the database call.

This applies to long-running calculations and expensive I/O as well.
>>
>>52272349
>sexually attracted PRIMARILY to other members of the same sex.

Again, reading comprehension.
>>
>>52272433
You must do nothing in the GUI thread. Everything must be done in another thread.
>>
>>52272434
unironically being sexually attracted to the same sex is pretty gay lad
>>
>>52272387
A hacktivist extraordinaire, Arch Linux evangelist, C aficionado
>>
>>52272309
yes i've tried it, its great.

anyways whats up with the hate against using // to comment shit instead of /* -- */
>>
>>52272447
Are you saying you *shouldn't* or you literally *can't*?

For example, in a C#/WPF application, if you have a window with code behind, it is one single thread.
>>
>>52272470
/* */ is more portable. Single line comments weren't introduced until C99.
>>
>>52272567
>C99
That was 17 years ago
>>
>>52271448
If you're doing OOP you like men and do crossprogramming
>>
File: g advice seeking.png (7 KB, 390x274) Image search: [Google]
g advice seeking.png
7 KB, 390x274
>>52269646


Hello /g/.
so i'm learning programming. I'm currently learning on Pascal ( that's the only language taught in my high school and it got me started). And I realized i'm relatively good at programming and i love doing it. so I started learning more advanced stuff, solving problems daily on codeforces.com ,france-ioi.org and dmoj.ca and i realized how behind am I compared to other participants from around the world.
so how to a better programmer /g/ ? should I switch language? (i can already program simple stuff on C) but I think focusing on algorithms and improving my problem-solving is more important than a better language?
what algorithms should I study? what resources do i need (tutorials, e-books, websites) ?
how and when did you become a better programmer anon? what general advice do you have for me?
thank you c:
>>
>>52272552
shouldn't
>>
>>52272552
you can do a little bit on the UI thread
>>
>>52272627
I really liked Robert Sedgewick's Algorithms book
>>
>>52272627
>pascal
>2016

Just upgrade to Python 3 or Ruby, your pick. It's more useful.
>>
>>52272647
It's always a bad habit. You can not guarantee that your little bit won't hung and block your application.
>>
>>52272663
>python
>an upgrade
pick one
>>
>>52272663
>>52272627

Pascal is really good to learn algorithms since its syntax is pretty legible tqbh.
>>
>>52272671
It's not a bad habit. You can do whatever you like on the UI thread so long as it doesn't cause it to block. Anything that has a reasonable chance of blocking should be done asynchronously.
>>
>>52272767
>>52272671
Yes, that's why I was explaining this here: >>52272433

I consider a 'long-running calculation' anything longer than a fraction of a second.
>>
>>52272767
>so long as it doesn't cause it to block
That's a thing you can not guarantee.
>>
>>52272810
>That's a thing you can not guarantee.
Of course you can you moron. It doesn't take much to write code I know won't take more that 16ms to complete on the targeted systems.
>>
What resources / books for getting into network programming would you guys recommend?
>>
>>52272872
https://beej.us/guide/bgnet/
>>
>>52272872
I enjoyed
Computer Networking: A Top-Down Approach
>>
>>52272810
There's many things you can do on the UI thread that are guaranteed to not block the GUI significantly except in the case of a major hardware/OS malfunction.
>>
#include <stdio.h>

/* 2 ^ 15 = 32768 and the sum of its digits is 3 + 2 + 7 + 6 + 8 = 26. */
/* What is the sum of the digits of the number 2 ^ 1000? */

int digits[999];
int carry();

main()
{
int i, j, result = 0;

for (i = 1; i < 1000; ++i)
{
digits[i] = 0;
}
digits[0] = 2;

for (i = 0; i < 1000; ++i)
{
for (j = 0; j < 1000; ++j)
{
digits[j] = digits[j] * 2;
}
carry();
}

printf("%d\n", result);
return 0;
}

int carry()
{
int i;

for (i = 0; i < 1000; ++i)
{
if ((digits[i] % 10 == 0) & (digits[i] != 0))
{
digits[i] = 0;
digits[i + 1] = digits[i] / 10;
}
else if (digits[i] > 9)
{
digits[i] = digits[i] % 10;
digits[i + 1] = digits[i] / 10;
}
}

return 0;
}


Why is the answer it spits out 2? The sum of all the digits in 2 ** 1000 should be much more than that...
>>
>>52272908
Euler?
>>
>>52272919
Yes..
>>
>>52272908
>digits[j] = digits[j] * 2
Is one of these supposed to be digits[i]?
>>
>>52272908
Set a breakpoint and step through your code, one line at a time.

Observer the various variables as they change, obviously step out of the 1000-time iteration after you check a few runs.
>>
>>52272939
Nope. The nested for takes digits[0] through digits[999] and doubles them. The outer for simply repeats that 1000 times.

>>52272944
Will try.
>>
Should I buy an iPad mini?
>>
>>52271314
I don't get this, are you supposed to be wanking to this?
Like, right as it's airing on TV and shit?
Sounds really inconvenient, since you don't know when the scenes will come up on a live broadcast. And if you miss it, you'll regret it.
If there's a really good scene going on, but the situation is risky, like someone sleeping next to you, would you be compelled to drop your pants and go at it?
>>
>>52272662
I will download it . thanks

>>52272760
That's the reason why I didn't switch to C.


I'm not interested in learning a new language as learning the algorithms themselves . what algorithms, specifically, should i learn next ?

also h-how do i write code in white boxes in replies?
>>
>>52272886
>>52272891
Thanks, will check them out
>>
>>52273008
If you need to ask, the answer a no.
>>
>>52272627
Algorithms and data structures are only a part of programming (frankly, I hardly ever use algorithms at work). Design and architecture are also important, and if you ever want to build something worthwhile or program professionally, you're also going to have to learn to read the code of others, to write code in a manner that's readable to someone other than yourself, to collaborate and exchange knowledge with your peers, or, as the cool kids call it, KTâ„¢ (Knowledge Transfer) etc.

There's also some practical stuff that's not always very advanced, but important:
version control (git is sort of the lingua franca of VCS, so start with git)
debugging (sometimes it's easy, sometimes it's difficult)
build systems (GNU make is popular on Linux, MSuild has some traction on Windows, CMake is a meta-build system of sorts that generates build scripts for several build systems)
>>
>>52273048
but i need to spend money anon! what should i buy?
>>
>>52273019
that kind of japanime is not made for masturbating but for humor and is intended for 14-18 boys.
>>
>>52273070
A Surface Bookâ„¢
>>
>>52273021
>also h-how do i write code in white boxes in replies?
[.code][./code]

without the dots, obviously
>>
>>52273070
Donate to charities.
>>
>>52273021
Look up for "Algorithms, fourth edition" by Sedgwick and Wayne, which is what >>52272662 recommended.

>>52273063
>Software engineering
Patterns are good but a pain in the ass sometimes
>>
>>52273019
That's the fun of ecchi, anon. You must always be ready, and you must always have backup poon for when the scene ends.
>>
>>52273019
>I don't get this, are you supposed to be wanking to this?
Strip clubs must really confuse you too anon.
>>
File: logo.gif (6 KB, 133x63) Image search: [Google]
logo.gif
6 KB, 133x63
Daily reminder that Free Pascal is a free and libre open source compiler for the Object Pascal language. It's fast, very portable, and features an IDE with the best interactive GUI builder around.
Learn more at:
http://www.freepascal.org/advantage.var
>>
>>52270601
What are you doing? The function is called get_token so why do you grow the list? And you return the next element after a realloc, which will be garbage. Did you mix up your insert and remove?
>>
File: 1451403150671.jpg (44 KB, 500x269) Image search: [Google]
1451403150671.jpg
44 KB, 500x269
Just started learning JavaScript, why is it so despised? I'm not far enough into it to fully know it yet
>>
>>52273129
Yeah, strip clubs are fucking retarded.
Why would you pay to sit in a dark room watching a middle aged woman in a bikini dance in front of you?
It's such a retarded concept, only white people could come up with it.
>>
>>52273021
Greedy algorithms, knapsack problem, divide and conquer, sorting algorithms (wikipedia has a huge template of sorting algos)
Recursivity, backtracking algorithms, memoization (note the lack of an 'r', it's not a typo), dynamic programming (DP is quite fun IMO), tail-call recursion.
Graph traversal (in-order etc.), shortest path algorithms, travelling salesman problem

Also, algorithms often go hand-in-hand with data structures. Check out RB-trees, for example.
>>
https://github.com/0xBA5/termtube
Thinking about removing my comments. They're shit to write and are pretty useless.
>>
>>52273168
broken "this" scoping
insanely loosely typed
dynamically typed
and a few other small crappy design decisions.

Besides that it's not that bad.
>>
>>52273168
Wait till you try and manipulate the DOM without using a third party library like JQuery, anon.
>>
>>52273109
I assume most beginners only know of 'programming', so when talking with them I don't pay much attention to the differences between programming, CS, SE etc. Either way, I expect most programmers to want to make something eventually, and things like debugging skills and version control are helpful to everyone.
>>
>>52273215
yeah
considering it was designed in a few weeks it's pretty good
then again, utf-8 is the best encoding in existence and was designed in pmuch a single evening
>>
>>52269659
sladar would rekt pudge easily, you know
>>
>>52273138
>the best interactive GUI builder around
That's not how you spell Blend.
>>
>>52273138
Is this the typical Pascal UI? kek
>>
>>52273229
Isn't that a problem with the DOM and not JavaScript itself?
>>
>>52273245
the "learn programming" meme that it's being sold nowadays is what you mean. You learn how to code but not things like recursion, actual computer science, debugging, software engineering, optimisation, version control, assembly, etc.

It's mostly a "make a website/app and become rich" approach.
>>
>>52273288
Looks pretty dank.
>>
>>52273311
>debugging
Only dilettantes use debuggers.
>>
>>52273168
Personally, I don't like its retarded comparison and conversion rules, and its horrible function syntax, which is only readable when you don't pass them by value and define inline callbacks etc.

>>52273215
ES6 provides proper this scoping and block scope now.
>>
>>52273376
>ES6 provides proper this scoping and block scope now.
yeah, i know. it's nice
>>
>>52273070
>i need to spend money
good goy
>>
>>52273251
An encoding is a bit easier to design than a programming language.

Sure, you can create a programming language in a day, but not one that's going to be nice to use.
>>
File: 1429462170190.png (6 KB, 377x330) Image search: [Google]
1429462170190.png
6 KB, 377x330
>ES6
>>
>>52273070
Buy me some liquor.
>>
>tfw ken thompson and rob pike are so based that they are able to invent utf-8 in a single evening
>>
>>52273542
And yet almost all encodings except for utf-8 are shit.
>>
>>52273554
why would they not spend more time on it to refine it

at least sleep on it and you can get some more ideas
>>
>tfw want to learn javascript but have no projects in mind to develop
>>
File: godsofprogramming.jpg (100 KB, 600x600) Image search: [Google]
godsofprogramming.jpg
100 KB, 600x600
>>52273554
cpu engineers used the same technique for ISA with arbitrary length instructions since ever.
>>
File: splash_logo.png (90 KB, 450x300) Image search: [Google]
splash_logo.png
90 KB, 450x300
>>52272627
Do NOT listen to the detractors, Pascal is an amazing language for both a beginner and an experienced programmer working on personal projects.
Really, really good for a beginner.
Fast compiler, so you don't have to wait to see if the program works.
Designed to catch most run-time errors at compile-time, so the compiler will tell you exactly what you did wrong.
Teaches good programming practices by design, such as refactoring: being unable to declare variables anywhere you want encourages breaking up your programs into smaller procedures.
Similar to C, but not similar enough where you'd get away with copy pasting code, which means you can learn from C tutorials, and really LEARN from them, instead of copying.
Libraries are easy, just put them in the same folder as your source code and you're done.
Extremely straightforward project structure.
No makefiles and other bullshit.
GUI builder!

And all of that with the benefit of being fast and portable.
>>
>>52273606
>that image
triggered
>>
>>52273581
Evidently because no refinement was needed.
>>
>>52273641
>taking the b8

It's like you're new here
>>
>>52273606
>this image

TRIGGERED!
>>
>>52273583
MMO with neural networks that has its own in-game cryptocurrency.
>>
>>52273171
Only non whites go to clubs autisticly
>>
What's the point of associating traps(not the interrupt/exception thingy in CPUs) with programming in these threads?
>>
>>52273780
derailing
>>
>>52273171
not that i go to strip clubs but i think you might be gay or a manchild anon

you get visual stimulance and you can get a lapdance too where they grind against your crotch. and at least in some clubs you can get VIP service where you're alone with the stripper and get to have actual sex with them
>>
>>52273215
>>52273376
Is node.js all that its hyped up to be?
>>
>>52273577
> And yet almost all encodings except for utf-8 are shit.
Most of the other common encodings are unibyte, which you can't really get wrong.

Most of those which aren't are more compact than UTF-8 (which mattered when memory and even disks were measured in kilobytes) and/or have better compatibility with existing standards (many of the "shit" encodings were complicated by constraints such as a "a single flipped bit must not result in the escape sequence which causes the market-leading tape punch to start a two-hour-long self-test").
>>
>>52273780
it's the jews that are shilling their white genocide agenda
>>
in c++, what is the least processor intensive way to change variables based on elapsed time?

so after each minute, a stat decreases. ill be tracking a dozen stats like this.
>>
>>52272063
Oh i see where the "no homo" expresion used on /fit/ came from
>>
>>52273849
>jews
>white
>>
>>52273829
I understand it's easy to integrate libs and stuff, but is filled with callback soup. Also, there are other languages beside Javascript that have implementations targeting Node:

http://calculist.org/blog/2015/12/23/neon-node-rust/
>>
>>52273859
kek
>>
File: 1448380553493.jpg (203 KB, 900x506) Image search: [Google]
1448380553493.jpg
203 KB, 900x506
>>52273871
jews aren't white. jews are actively trying to destroy the white race through forced mass immigration and fag shilling.
>>
>>52273858
Performance of that is going to be so insignificant that it doesn't matter. Easiest way is probably to store each stat fractionally, and decrease it a little bit each tick such that after a minute, it's gone down one level.
>>
>>52273858
whenever a stat changes make it add task in some queue somewhere and have a separate thread look at the queue and run the tasks
>>
>>52273802
I see.
>>
File: Bait.png (220 KB, 387x545) Image search: [Google]
Bait.png
220 KB, 387x545
>>52273899
>>
>>52273849
>>52273871
>>52273894
/pol/ pls go.
>>
>>52273829
i think most of the hate towards node is do with using JS on the server side when there are better languages available.
>>
>>52273780
No idea but it feels so right.
>>
File: 7a4.png (171 KB, 450x290) Image search: [Google]
7a4.png
171 KB, 450x290
>>52273924
>>
Learning opengl and it has some truly ugly, disgusting syntax desu
>>
>>52273858
What I'd do is: in my ''game loop'' on every iteration I'd check a timer variable to get me the number of seconds since the loop began, once it hit 60, I'd adjust all my stats and reset the timer.

Suppose you could go with something like thread.wait() but that's ill-advised (I think)
>>
File: vulkan_lava.jpg (88 KB, 800x500) Image search: [Google]
vulkan_lava.jpg
88 KB, 800x500
>>52273945
It'll all be over soon

And if you don't care about hardware support (i.e. you can use the latest version), the APIs have been improved significantly (the old ones are still there, of course, just deprecated)
>>
>>52273933
JS is actually faster than Python. if people are fine with using Django, then what's wrong with node?
>>
>>52272063

>If I have sex with a man does that make me gay?

Yes
>>
>>52273945
it'll be fine when you get to know it better. just keep in mind that it's a state machine and you're toggling between different states and issuing simple commands. use named variables and not just numbers.
>>
Node.js is good if you're comfortable with

1) Callback hell
2) JavaScript in the server side

I used it, it has a shit tonne of libraries and functionalities; but those drawbacks are big tbqh
>>
>>52273954
i was messing around with a waiting function, whats the disadvantage?
>>
Do you program better under the influence of alcohol or cannabis?
>>
>>52273963
I don't think JS specifically doesn't even have to be relevant. Node supports asm.js iirc, and there are compilers that target it.
>>
>>52273963
>JS is actually faster than Python.
python is also not such a great serve side language
>if people are fine with using Django, then what's wrong with node?
JS
>>
>>52273962
I do care about hardware support, since I'm not making the next CryEngine, there's no reason to not make it available on as much hardware is it can run on.

Which means I'll have to stick to 3.3 even after vulkan comes out because AMD didn't add vulkan support to their older cards like Nvidia did :^(((
>>
>>52273933
most of the hate towards node is directed at the fact that it advertizes itself with "good" concurrency (which most of the people using JS actually believe since they haven't touched languages that are actually good at concurrency) when callbacks are one of the worst possible ways to do concurrency.
>>
>>52274025
Under the influence of stoner rock
https://www.youtube.com/watch?v=_o8Qqfu1pwQ
>>
>>52273995
Does the CB hell have workarounds (promises, whatever)? Also, any success with, say, Coffeescript, or alternatives?
>>
>>52274066
DUDE WEED
>>
>>52274062
What better ways are there (I mean features, not languages)?
>>
>>52274066
Love that album, anon
>>
>>52273145
It's a memory pool of tokens, it returns a reference to a token for assignment.
>>
>>52274070
promises are nice, when shit supports it. Coffeescript helps too
>>
File: eee.png (241 KB, 645x363) Image search: [Google]
eee.png
241 KB, 645x363
What books do you recommend senpai?
>>
>>52274123

Encyclopedia
>>
>>52274123
Lolita
>>
>>52274095
communicating sequential processes
avoiding mutability entirely instead of just between concurrent instances is also a valid approach, but has other slight drawbacks
>>
>>52274047
>because AMD didn't add vulkan support to their older cards like Nvidia did :^(((
You mean because it just so happened that Vulkan works on hardware as early as Fermi for Nvidia but only as early as GCN for AMD.
>>
>>52274123
>the manga guide to data structures
>the manga guide to programming

why don't these exist yet?
>>
>>52274150
I've never heard of CSP before, looks interesting.
>>
>>52274174
Does the manga feature a trap programmer?
>>
Working on a game engine to hone my c++ skills, using the sfml2 library.

Currently stuck on movement, everything works as intended but it cannot register two key presses at anyone time,

such as up and left to move diagionally...

struct PlayerMovements
{
PlayerMovements(float vx, float vy)
: velocity(vx, vy)
{
}

void operator() (Player& player, sf::Time) const
{
player.SetVelocity(velocity);
}
sf::Vector2f velocity;
};


this is my main process of handling movement but I cannot figure out how to edit it to include another function for jumping.
>>
>>52274174
Nobody would read it. I want my algorithms and data structures as dense as possible. Other developers I've met are the same. Watch anime when you don't want to be productive.
>>
>>52273138
Thank you anon, I'm going to try it out right now!
>>
>>52274109
Oh, I see. Why do you need to store them sequentially, instead of just mallocing for each token you need? Performance?
And I don't understand this part
        size_t newmax = list->max == 0 ? 1 : list->max * 2;

if (newmax < list->max) {
newmax = list->max + 1;
}

What's the if for? The only way for
newmax < list->max
to happen is if
list->max
is negative. Or is it in case of overflow?
Thread replies: 255
Thread images: 34

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.