/dpt/ - Daily Programming Thread

Previous thread: What are you working on, Cred Forums?

Other urls found in this thread:

stackoverflow.com/a/33874965
gcc.gnu.org/onlinedocs/gcc/Designated-Inits.html
washingtonpost.com/news/acts-of-faith/wp/2016/09/15/in-the-safe-spaces-on-campus-no-jews-allowed/
dailybruin.com/2015/09/16/submission-regents-must-condemn-anti-semitism-to-ensure-safety-of-jewish-identity/
articles.philly.com/2014-08-27/news/53248644_1_university-campus-student-government-theobald
edition.cnn.com/2015/03/10/opinions/kosmin-anti-semitism-campus/
akaribbs.mooo.com
blogs.msdn.microsoft.com/brada/2005/01/26/internal-coding-guidelines/
w3schools.com/js/js_object_prototypes.asp
i.imgur.com/h2kfGPp.jpg?1
opengl.org/wiki/Primitive#Point_primitives
github.com/Dwillnio/4chanThreadViewer/tree/master/pkg4chan/explorer
youtube.com/watch?v=uiJycy6dFSQ
youtube.com/watch?v=Gzj723LkRJY
twitter.com/SFWRedditVideos

Refactoring some Elm code. Statically typed functional languages make it so easy...

And Java implements lambdas using interfaces and classes too.
(j) -> i == j
is syntactic sugar for
new IntPredicate() {
boolean test(int j) {
return i == j;
}
}

When you compare two objects of custom classes (my question is for AS3 but I'm also curious about C# and Java) with an == operator, does it compare every element of that class?

Would it be faster to compare an element of the class (unique ID int) instead?

OOP IN LOO

>And Java implements lambdas using interfaces and classes too.
That's functional programming, not OOP.

Also,

what happens if you do
(j : FooClass) -> new BarClass()

in Java, what is that equivalent to?

Im setting up mingw cmake and shit on wangblows so i can test on winshaft... I dont know what I'd do without cygwin and chocolatey

>it's completely unnecessary to do it this way as opposed to function pointers, but the point is to illustrate capability

So I figured out some of the framelimit stuff since last thread. I've got
while (programIsOn)
{
auto start_time = std::chrono::high_resolution_clock::now();
// dostuff
const auto MAX_FRAME_TIME = std::chrono::nanoseconds(16666667);
auto delta_time = std::chrono::high_resolution_clock::now() - start_time;
if (delta_time < MAX_FRAME_TIME)
std::this_thread::sleep_for(MAX_FRAME_TIME - delta_time);
}
But the 16666667 seems like a super stupid way to store 1/60th of a second in nanoseconds. Anyone know of a better way?

no

thx

...

The point was never to illustrate capability. The point was to illustrate examples where a puristic OOP design doesn't cut it.

C++/Java lambdas/anonymous classes/functors and treating these as first class citizens and creating state capturing closures are arguably a concept derived from functional programming.

>state capturing closures
*currying

This isn't entirely true, see stackoverflow.com/a/33874965

nevermind

I'm currently taking a look at the akari-bbs source and came across some interesting syntax in the xss_sanitize function.
static const char *escape[UCHAR_MAX] = {
['\n'] = " ", /* change '\n' to '\r' */
['\"'] = """,
['\''] = "'",
[''] = ">",
['&'] = "&"
};

How exactly does this work, and is it standard syntax? Never seen something like that...

gcc.gnu.org/onlinedocs/gcc/Designated-Inits.html

Now that's a nice feature. Thanks for providing the link.

Haskell frontend for Processing.

Learning C# by implementing a simple card game.

I've shuffled the deck just fine, now I'm trying to cut the deck.

I've used this:
private Card[] Cards;
public void cutCards()
{
Card[] tempDeck = new Card[52];
Random rnd = new Random();
int randomCut = rnd.Next(0, 51);
int x = 0;
for (int i = randomCut; i < 52; i++)
{
tempDeck[x] = Cards[i];
x++;
}
for (int i = 0; i < randomCut; i++)
{
tempDeck[x] = Cards[i];
x++;
}
Cards = tempDeck;
}


But does that final "Cards = tempDeck" cause a memory leak?
Should I free the original Cards array before I assign it?

Since you're assigning Cards to a new thing I don't think you need to worry about nulling first. However I'm not an expert.

Since the array previously pointed to by Cards has no more references pointing to it, I'm sure it will get garbage collected.
From what I've read leaking memory in a garbage collected environment is not entirely impossible, but a lot more complicated than passing things around the way you do.

>"Cards = tempDeck"
is not valid syntax. You need a variable name.

Also, for some reason I'm getting 61.333fps with this. No idea what that's about.

Memory leaks can only occur when you've got a string of references somewhere where you don't expect it.
Say you've got an anonymous class: The anonymous class actually keeps the outer class from being collected, because it captures its scope. This isn't an issue, but you gotta keep in mind that as long as a small anonymous class is alive, a big outer class may be alive as well.
Trees for instance are a similar issue. Let's say you're leaking references to nodes and want to delete the tree. You null the root, thinking the GC will take care of it. However, any reference to a sub tree of the root will drag around the entire sub tree of that node reference as well, even though you didn't intend it.
There are no memory leaks in terms of forgetting to free something, but in terms of overlooking that you're still dragging around something.

>And then there is Annabelle McAllister who is raising up the dead...

Cards is a variable, not a type. See the top line.

I see. I'd prefer to manage it myself, mainly because I can't be positive that it has actually been cleaned up, but I guess just keep going until I realise there's an issue?

Or anyway I can be sure it does get freed?

float inaccuracy.

def y():
return niggerjews("y()")

;_; So jealous of programs that can run at a clean 60fps. Gonna go to bed and try to figure it out tomorrow.

Are you writing this in a language with GC?

Nah, that's C++.

I see. variables should be camelCase.

There's no memory leak because the previous values that Card had gets garbage collected.

Sorry to bother Sir but this throws the error:
NameError: name 'niggerjews' is not defined
???

So it should be "cards" for the variable name?

>variables should be camelCase.
vomited
kebab-case if possible, else snake_case

>variables should be camelCase.
I prefer CameltoeCase, you know, first and last word capitalised while there's a gash in the middle.

hisss hissss

its snek

> Racial slurs in filename.
Go back to your containment board you abominable ignorant racist poltard, we don't want OR need you here. That's NOT(want OR need) you retards, not (NOT want) OR (NOT need).

fuck off, camelCase is standard for C#. Always use what is standard for the language.

Shut up nigger

Nope, PascalCase is. camelCase is J*va OOPOO tier.

>being this buttblasted
:^)
>inb4 >using the smiley with a carat nose

> If you d-disagree with me y-you must be a b-black person... so there!
Nice argument skills stormtard, homeschooling has teached you well. Now hush with your autism tirades and let the adults discuss their business among themselves.

You started, you fucking nigger.

>teached

>teached
Sounds like public school didn't do you any good either.

>let the adults discuss their business among themselves
>Cred Forums
>adults

Still at it, I see. Of course it's a futile effort to try to change your ways, since they have burrowed into your mind for years and years as a result of failures in life, I'm just here to watch you chucklehucks break down.

>they
Who are "they"?

I've literally never seen PascalCase sued for variable names in a C# code base.

>wasting this much time on pointless shitposting to appease your ego

I can't tell if you're trolling or being serious.

> Oh, look mom, he made a spelling mistake in his post! That means anything and everything he says is stupid and can be ignored! I can forget about that lingering piece of conscience and doubt in my mind, because he made a typo!
Again the stormtard exhibits his only skill to the outside world, that of fixating on superficial exteriors and judging the book by its cover.

The jews, who else? They invented racism in order to make different races fight each other instead of uniting and rising up against them.

>spelling mistake
You made a grammatical error, not a spelling mistake. Teach is a strong verb, not weak.

>LEL HE MADE AN ARGUMENTAL MISTAKE, I'LL CALL HIM A STORMTARD HUEHUEHUE
kek

>he pointed out a mistake
>better call him a stormtard

Your ways. Learn to follow a sentence, you dumb poltard.

I am completely serious. I want you buffoons out of the civilized internet and back in your dark caveholes.

Being poltards whose only purpose is trolling and shitposting, it's understandable that you would expect everyone else to operate under that same mental framework.

But the reality is most people aren't like you, they don't exist merely to make noise and die out, or "pee in an ocean of pee" as you might say.

>Your ways.
What exactly do you think "my ways" are?

> Everything is da jooz' fault! They are the reason I'm such a loser and have no skills other than shitposting! Yeah, they're to blame, not me!
Keep being in denial, poltard. I'm sure it has worked out so well for all your loser life.

>I want you buffoons out of the civilized internet and back in your dark caveholes
>implying Cred Forums isn't one of these dark caveholes

I disagree with Cred Forums on almost everything and I'm not even racist. You're just flinging wild accusations around and calling everyone who replies to you a stormtard.

Your ways if being a dumb racist loser NEET that has failed in life and deflects that failure onto scapegoats and people different from you.

But Cred Forums is a "dark cavehole" for people like us. Why do you think we post anonymously?

>if

This one /r/ShitRedditSays cuckold is really upset.

Let's just watch the next few posts it makes.

But I'm neither racist nor am I a NEET and I never blame anyone for things that clearly are of my own doing...


???

Please shitpost in a different thread or board, this thread is about PROGRAMMING, not having USELESS ARGUMENTS.

Anybody else noticed, that this thread was a snoozefest until some Cred Forumscuck posted here and some other people reacted? About half posts in this thread aren't even about programming anymore.

>/dpt/
>programming
:carat)

>someone was actually asspained enough to make this

My sides are fucking gone after reading that image.

>USELESS
Hey, online arguments are never useless.

>> Racial slurs in filename.
Calm your tits tumblr.

> cuck
I see your attempts to pretend you aren't from pol by vilifying poltards (as they so richly deserve), but your word choice still manages to betray your true loser mentality. Go join the rest of your fellow losers ganging up on me.

That you, Danny?

Are you seriously implying that cuck is some secret code word racists use and not a Cred Forums meme that gets thrown around like "faggot" and "nigger" ?

Do you actually believe that anyone takes Cred Forums seriously?

It was literally a completely normal thread until tumblr showed up and was triggered because someone used the word "spic".

God damn

>a lefty autist was so buttblasted that he had to sperg out in a laotian space-nigger moving picture website
lmaoing @ your life :^)
>inb4 LEL STORMWEENIE HUAHUEHUAHUE

wow, I can ad hominem and strawman too!

Is this the fucking meme from /agdg/

Oh lookee here, it's not apparent from the thumbnail due to a glitch but it looks like we got ourselves a live Drumpfkin here. Are you going to suck your "God Emperor"s tiny orange dick too?

You do know that SJWs call themselves anti-semittes as a badge of honour right?

@56759055 (You)
>drumpfkin
>implying we give a shit

/dpt/-chan, daisuki~

Ask your much beloved programming literate anything (IAMA).

Thank you for using an anime image.

report and move on, folks

Yes, you're an ignorant racist loser if the only way you can deal with other people disagreeing with you is shouting our racial/sexist/homophobic slurs at them.

Links related:

washingtonpost.com/news/acts-of-faith/wp/2016/09/15/in-the-safe-spaces-on-campus-no-jews-allowed/

dailybruin.com/2015/09/16/submission-regents-must-condemn-anti-semitism-to-ensure-safety-of-jewish-identity/

articles.philly.com/2014-08-27/news/53248644_1_university-campus-student-government-theobald

edition.cnn.com/2015/03/10/opinions/kosmin-anti-semitism-campus/

>Drumpfkin
Please go back to r e d d i t or facebook.

Don't you notice how everyone is making fun of you and your raging leftist autism?

How is that different than dealing with people that disagree with you by calling them "stormtard", "poltards" etc?

Also
>shouting
This is an online forum. Nobody is shouting anything. Stop projecting.

Why is this SJW spammer still here?

This is the programming thread, not the whine about white people thread.

fuck off
>>>/global/rules/13

@56759072 (You :^))
>xe is this rattled

>@
Why are you doing that, it's annoying as fuck

@56759107 (:^))
To not give this faggot the (You)s he desires.

>LOL FULL RETARD XD
Do you watch the big bang theory too?

The difference is that black people and homosexuals did not actively wish to be black or homosexuals, their identity is just a part of who they are, whereas being an ignorant racist loser is conscious and deliberate.

>having your buttblast level increase 600%
Teбe cкoлькo плaтят чтoбы гoвнoпocтить?
How much do they pay you to shitpost?

Do you ever get tired of posting the same exact assdamaged images(you copied and modified) over and over and over again when things don't go your way on online image boards?

@56759118
This is Cred Forums, not Cred Forums, I think you clicked on the wrong board. To continue getting post and reply based monetary compensation, you must continue your posting on the Cred Forums "Politically Incorrect" board. Further posts in the Cred Forums "Technology" board will grant no reward.

> Look ta this funny face le God Emperor Drumpf is making !Isn't it funny???
You have no credence in talking about sense of humor, seeing as you possess the sense of humor of a 5 year old. The exact psyche of the people that would support Cheeto Jesus.

When someone calls someone "nigger" or "faggot" on Cred Forums, they are not actually referring to their skin colour or sexual orientation, you autistic fuck. They are referring to the behaviour and mannerisms of the poster. For example, the "-fag" suffix is commonly used on Cred Forums (gamerfag for example) but does not refer to homosexuals.

Do you understand Cred Forums culture at all?

>Cheeto Jesus XD
>drumpf XD
>LE BAZANGA XD
>LOL GOES FULL RETARD
>EPIC FOR THE WIN

Seriously go back to facebook and twitter already.

Я eщё paз cпpaшивaю, cкoлькo тeбe плaтят твoи мeнeджepы чтoбы пocтить бaнaльнyю бpeхню?
I'm asking this again, how much do your bosses pay you to post banal bullshit?

But you actively and consciously choose to post a tirade of "may may" images and get upset over a filename....

He's clearly not from here. He was supposed to shill Cred Forums with low tier character assassinations and strawman arguments.

>Do you understand Cred Forums culture at all?
He probably just got here today with his folder of butthurt facebook images.

He has no idea how this website works.

> Cred Forums culture is spouting off racial slurs relating to black or homosexual people in relation to bad mannerisms, as if to imply those people are badly mannered.
That's still damn racist, and if you cannot see that, you're further proving the fact that you are a racist buffoon and need to go back to your containment board for buffoons just like you.

>Cred Forums is racist

Then fucking leave.

Holy shit.

> Forced @ meme.
> Random accusations of shilling at everyone that disagrees with you.
So typical of a poltard. But you know, the real shills are you retards polluting every nook and cranny of this site with your inane drivel and spreading your ignorance, not the few sane people willing to point out your pol shilling.

@56759192 (Are) (You) (Frustrated?)
>LET'S JUST CALL HIM RACIST HUAHUEHUAHUE

@56759215 (You) (Are) (This) (Rattled) (:^))
>he's butthurt that some people are not giving him (You)s

No, *you* leave. *You* go back to the hole specifically designed to isolate and fence off retards like you.

>I'M AN EPIC /R/SHITREDDITSAYS SJW FIGHTING AGAINST EVIL Cred Forums
>I WON'T ACTUALLY GO ON Cred Forums THOUGH I'M TOO SCARED

>I WILL HOWEVER SHITPOST ANGRILY IN PROGRAMMING THREADS ON Cred Forums THOUGH

You're clearly acting like a newfag right now. "newfag" does not mean that you recently came out of the closet or anything, it means that you're acting like you recently discovered Cred Forums.

The whole point is to be offensive, not racist. It's just that racist slurs seems to trigger people more than anything else, like it triggered you right now.

Cred Forums and a bunch of other chans have always been this way, as a counter-movement to the online censoring and forced "safe spaces" that began online in the early 2000s.

If you don't understand that "nigger" on Cred Forums in 2016 means something else than "nigger" did in 1960, I feel bad for you.

@56759215
You're copypasting responses now. Nowhere did I say my position on anything, how do you KNOW I disagree with something?

Braindead tumblrinas need to leave.

This is a PROGRAMMING THREAD, jackass.

>everyone in the thread hates you
>you tell them to leave

It doesn't work like that.

@56759235
>using ad hominems constantly
Jesus Christ, you are very """good""" at arguing :^)

>*You* go back to the hole specifically designed to isolate and fence off retards like you.
That is literally the purpose of Cred Forums.

I never intend to go to pol, because I'm not an ignorant loser. I want to rid *this place* of you ignorant losers and make *you* go back to the place you belong, and that's why I post here, not on pol.

Why are you using @ symbol?

Not him, but can you just quote properly. The "hurr durr I'm not giving you any (You)'s" meme isn't funny and I'm having a hard time following which posts you're actually referring to.

Is this a valid use of gotos in C?
int
file_read(File *file, uint16_t *data, size_t pos, size_t size)
{
FILE *fp;
uint8_t *temp;
size_t read;

if (file == NULL || data == NULL)
return -1;

fp = fopen(file->name, "r");
if (fp == NULL)
return -1;

temp = malloc(size);
if (temp == NULL)
goto err_fclose;

fseek(fp, pos, SEEK_SET);
read = fread(temp, 1, size, fp);
if (read == 0)
{
goto err_free;
}

fclose(fp);

for (size_t i=0; i

Because he is a retard who believes typing one symbol as opposed to another will magically prevent me from getting through to his mind. Poltards are quite prone to believing in voodoo like that.

Your tirade belongs on Cred Forums, not on /dpt/. We're supposed to discuss programming, not how evil and stupid racists are.

I'm reporting you for derailing the thread with offtopic shit.

>goto
oh boy, here we go

>I want to rid *this place*
HAHAHAHHA
Oh god your crusade is pathetic.

You're outnumbered a hundred to one and everyone hates you.

You're basically spamming the board with shit nobody cares about at this point.

Everyone is making fun of you for being an autistic 12 year old that claims everyone is Cred Forums.

@56759271
>wasting time whiteknighting to supposedly "GET RID OF THESE NASTY PEOPLE, MUH FEELINGS"
Sorry pal, please whine to where you came from.
Just use Ctrl+F and copy the post number into it, sans the @.

> He disagrees with me, oh noes! Oh wait, if I report him he may go away!
So typical of you stormtards to just close your ears to everyone you disagree with.

>I'm getting through his mind

You're spamming the thread, being made fun of by everyone and you will be banned very soon.

Yes, if it was a function that wasn't main. There is no actual reason to close file descriptors and free memory when exiting (other than to get valgrind to stop complaining), because the OS does this when your program terminates.

@56759299
You did actually break the rules, faggot, you started it first, see

He'll get banned soon if the mods are awake.

>Just use Ctrl+F and copy the post number into it, sans the @.
That's too much effort, especially because I have to use my mouse to select the number and copy it instead of just hovering over the >> link.

No, I'm not reporting you for disagreeing. I'm reporting you for being offtopic and hijacking a programming thread.

Someone's feeling (You) deprived. They love the red ! icon on their tab.

:^)

>retard
So it's okay to look down on people with intellectual disabilities? You ableist fuck.

kys

Trump will make programming great again.

He's going to make JavaScript static typed and ban Java from being taught in schools.

>They love the red ! icon on their tab.
What? Which browser or user script does this?

>That's too much effort
In my opinion, that's better than properly quoting him and giving him (You)s and maybe money.

The only pathetic crusade I know of is the poltards swearing they will rid the world of black people, Jewish people, homosexuals and everyone else they disagree with.

Stock Cred Forums does this. Changes the favicon.

@56759341
>he's shitposting on somewhere he's not supposed to be about something that's not supposed to be here
Get out with your banal bullshit mate.
tumblr.com
reddit.com
Whine there.

>strawman after strawman after strawman
report and move on

@56759339
Now I'm getting angry at you for actually believing that people get off by seeing (you) and getting paid to lurk 4chins.

Both are memes you dumb shit.

>implying they don't deduct @s

>Stock Cred Forums does this. Changes the favicon.
It doesn't in Chrome (on Linux or on Mac)

(((56759360)))
>what is ctr
>what are shilling companies
It's a meme, yes, but it's a necessary one.

>>what is ctr
I don't know actually, what is ctr?

>>what are shilling companies
They pay people to astroturf on review websites and/or defend glorious Russia against degenerate western influence, not to post on an obscure board on Cred Forums where maybe 40 different users see it.

>The only pathetic crusade I know of is the poltards swearing they will rid the world of black people, Jewish people, homosexuals and everyone else they disagree with.

Wow who gives a shit.

What does this have to do with programming?

You're making everyone support Cred Forums by being extremely autistic.

You know there's actual bots that copy posts with get the most replies, right?

It happens for me on palemoon/chromium on windows.

Hillary's spent over $1m on creating a Hillary Internet Defense Force

>he doesn't know what ctr is
Basically, it's short for Correct the Record, a super PAC that specializes in shilling for Democratic Presidential Candidate Hillary Clinton.

>tfw your internet bf is asleep but you woke up early
ughhhhh might as well do some programming :/

>Jewish people
See Your beloved black lives matter movement hates jews and doesn't think the holocaust happened.

Thanks

>You know there's actual bots that copy posts with get the most replies, right?
Well, I'd think these bots would use posts from Cred Forums then, and not the daily programming thread where 40 people tops actually lurk.

I'm afraid you came to the wrong thread then.

odds use vc++
evens use g++

shit...

what now......

>tfw not sure whether I should hate arabs because they are brown or like them because they joined in on our struggle against the jewish elite

>You know there's actual bots that copy posts with get the most replies, right?
But user, this is how we managed to make Tay racist. If we stop doing this, AI bots will not see the light behind the jewish deceit.

use TurboC++

Can somebody explain what akari-bbs is? I don't browse /dpt/ very often

It's pure cancer.

see akaribbs.mooo.com
So far it's a Cred Forums-like yet text-only board named (and styled) after an anime character.
The source is available on github and I find it (the source) quite interesting, see

Someone created a chan-like website in C and named it akaribbs, the end.

Thanks.

see >>>/akari/11189

Why do liberals have to ruin every thread with their anti-trump posting?

they know they're losing

Since every language is shit according to /dpt/, what would dptlang look like?

>Why do wasps have to be such dicks at the end of Winter?
They know they are dieing. It's only natural.

Haskell

>Designated
THE LOO

Why do comonads enjoy so little usage?

generals were a mistake
-moot 2015

Well, I guess the dust has settled. Who /graphics/ here?

camelCase for local variables, member variables, and parmeters. PascalCase everything else.

blogs.msdn.microsoft.com/brada/2005/01/26/internal-coding-guidelines/

The whole "PascalCase for properties" thing was a misfire, I think.

>misfire
C# in a nutshell

and the sex lives of those who use it

i do camelCase for functions and underscores for variables LOL

>LOL
XD

that's what I said.

I like it

C# is great

>and the sex lives of those who use it
I can only speak for myself, but yeah, that's accurate : (

I really feel like donating to the valgrind devs.
Saved my life yet again.

I just wish there was an option to whitelist your project instead of having to blacklist every library you use.

>imperative programming
why?

C# is mostly good, and there's only a few mistakes.

>I like it

Well, you're wrong. I bet you like static using statements.

>there's only a few mistakes.
What ones?

>Well, you're wrong.
Always helps me tell if something is a field or a property pretty easily.

>I bet you like static using statements.
Of course, what's wrong with static?

Why do web devs have to ruin everything?

Hi /dpt/
I don't post much but I hope you're all having a very nice day

#56760188
>frogposter

Do not reply to this faggot.

Because some of us actually work with real hardware with real world constraints.

>code review and product testing happens, on something that isn't even close to being done
>boss finds a few bugs I haven't gotten to fixing yet
>he ends by saying he loved what I had done, and that he was impressed how solid it was overall
>tfw you don't know if he really thought that or if he's just being nice

w3schools.com/js/js_object_prototypes.asp

I am thoroughly confused.

my dad just called me fat :/

Time to lose weight then fatty >>/fit/

>there are people who still use OOP in current year

OOPfags are killing programming.

even

Since we're already funposting.

What's the appeal of formatting urls like this: domain.tld/api/method/parameter/order/date instead of the old way: domain.tld/api?method=foo&order=date ?
I get that URI queries are fucking ugly, but you're not seeing or handcrafting them anyway.
On both the client and server side exist mature and well tested code bases to handle the queries, while this path bullshit has to be matched with flimsy regex:

Server - nginx:
location /api {
set_unescape_uri $arg_foo;
echo $arg_foo;
}


Client - python requests:
requests.get("doman.tld/api", params={"foo": "bar", "id": 4})


I'm sure apache and JS work in similar ways. Is it just the usual webdev faggotry "Change for the sake of change" or am I missing something?

ugh i dont need fit to tell me how to lost some fat... its obvious

I want to make a simple platform game. Should I use a game engine? Which language are good for this?

You're going to have to lose it some day man. And when you do you'll regret not doing it earlier. I believe in you user :3.

>there are fat NEETs on this board who write their fizzbuzz-tier programs in C
kys

odds do some pushups
evens shitpost for another hour
0 go take a shower

1. Are you sure that they all run "at a clean 60fps"?
2. Advanced engines definitely have much smarter ways of dealing with fps, you use the most primitive way to count it.

Read about REST.

GTFO

>trying to start bot for website
>open up firefox to get POST data like always
>submit, page changes, post data lost
What do? How do I retain that data?

>baby did his first sdl script
gratz

just did 20 pushups now its time to program xD

usually you have middleware that handles the matching. most of that is pretty well tested at this point i think
i don't think rest is as extreme as you say. the path shouldn't need to handle every single parameter. there's some hierarchical (this seems like a good thing) way to specify a resource and then you interact with that

Okay /dpt/, let's make an AI programming game/contest!

What are the rules?

swift is the best language

whites only

>Implying niggers know programming

Dumb objectfag

You know programming don't you?

Fuck. I keep seeing really cheap computer parts and I really want to build a gaming desktop. But I really want to be mature and not play video games. I've never had a gaming desktop though.i.imgur.com/h2kfGPp.jpg?1

Where's the programming in this post?

What maximum texture size should I target for my game engine?
This big textures will be used only for the background tiles of the map.
Should I go for 2048px or 4096px is better?

>Unity if you want to waste your life
>HTML/CSS/Javascript if you are a faggot
>C if you are fat
>C++ if you are an asshole

Do it with Rust + Vulkan

8192

You should allow whatever texture size is supported by the hardware.

Computer parts require programming

of curs i kno progaming fagushit i code html snek

>buy shit off ebay
>who //prog// here

...

> le current year maymay XDDDD
>>Cred Forums

My serious thought about the problem with OOP:
it's too far from real mathematics and too far from the machine binary as well. You are getting the worst of every worlds.

into the you go my friend

lel, k tard.

It's not even SDL. :^)

Thanks for correcting the record.

2 guns have been confiscated and deposited into a smelter.

It's too far from real OOP too

I'll try to implement it, also what is a good performance for the rendering?
I have an old pc and right now I can show 2000 sprites before the fps goes below 60.

pair programming

In Android Studio, when I click 'run,' a new window pops up.

I want it to close the previous window, as it creates the new one.

What do?

Hey guys,

Did you know that Java and C# are basically the same language?

Giving up is always an option

C# evolved from Java. All Java's shity mistakes are fixed.

in the same way that blacks and asians are the same species

I don't know why I post on this board

If I had friends I wouldn't need this place

Wrong. C# inherited almost all of Java's shortcomings. A completely unimaginative language.

fug

It fixed generics, has good lamda support, unsigned integers, easy native interop, less verbose. Hard to fault desu.

It's comfy as fuck.

F# is even better.

>C# evolved from Java.
"""
Osborn:
I've been looking at press stories about C# [pronounced "See sharp"] and notice that many of them seem to lead with the observation -- or perhaps the theory -- that C# is either a clone of or a Microsoft replacement for Java. If you could write the headlines, what would you like people to say about the language?

Hejlsberg:
First of all, C# is not a Java clone. In the design of C#, we looked at a lot of languages. We looked at C++, we looked at Java, at Modula 2, C, and we looked at Smalltalk. There are just so many languages that have the same core ideas that we're interested in, such as deep object-orientation, object-simplification, and so on.

One of the key differences between C# and these other languages, particularly Java, is that we tried to stay much closer to C++ in our design. C# borrows most of its operators, keywords, and statements directly from C++. We have also kept a number of language features that Java dropped. Why are there no enums in Java, for example? I mean, what's the rationale for cutting those? Enums are clearly a meaningful concept in C++. We've preserved enums in C# and made them type-safe as well. In C#, enums are not just integers. They're actually strongly typed value types that derive from System.Enum in the .NET base-class library. An enum of type "foo" is not interchangeable with an enum of type "bar" without a cast. I think that's an important difference. We've also preserved operator overloading and type conversions. Our whole structure for name spaces is much closer to C++.

[...]
"""

Not really.

pair programming what ?

Hard to tell without your computer config, the used programming language and api.

daisuki~

F# is unimaginative too.

Neither C# nor F# supports anything beyond the most simple abstractions, just like Java.

Java generics are less broken than C# generics.

The sanitizer is missing ['`'] = "`"

Just another unimaginative OOP language.

It's not just your average joe's snake oil, it's extremely snaky oil

what do you guys think of go

>Neither C# nor F# supports anything beyond the most simple abstractions
Thats true. Though more advanced langugaes have their own problems. C# is a great get-shit-done langugae as it is.

>Java generics are less broken than C# generics.
Go on..

>more advanced langugaes have their own problems
such as

Terrible language.

>C# is a great get-shit-done langugae as it is.
I find it hard to 'get shit done' when I'm constantly having to repeat myself in code.

>Go on..
Parametricity (although Java goes on to shit itself by allowing reflection)

>Hard to tell without your computer config, the used programming language and api.

HD6750, E5700, C++ and SDL2.
No OpenGL, just normal SDL2 calls.

Many programmers don't understand them therefore they're bad

what is the /dpt/-approved language/framework for website backends
you guys hate js, ruby, python, php, and java

C

Haskell

>webdev
Fuck you

JS is a front-end language and a terrible one at that. Don't ever use it on the backend. I don't care if that means you have to learn another language (oh how terrible you poor thing).

There is no good language for web development

Where can I find some programs to edi in visual studio 2015 and see how they work. I'm mostly interested in seeing how people use the desgin tab for things and how things there work.

webasm

are you rendering the same texture x 2000 ?

Nobody actually uses VS, why do you think they give it away for free?

Poorer ecosystem. Less target platforms, smaller community etc.

Yes, each x is a character that moves on the screen.

>javascript

>Parametricity
How do you mean?

What should I use then?

TypeScript front end, F# backend.

If you want better performance, use OpenGL and opengl.org/wiki/Primitive#Point_primitives

Those are all the same thing, and all caused by this line of thinking

Participating in competitive programming in a bit as a noob. Wish me luck that I don't completely bomb the whole thing and at least get like 2/8 correct.

What line of thinking? I don't care what causes that problem, when i pick a language i have to deal with that shit.

I'm not going to use ocaml for mobile development when F# was much much much better support for such shit. I can't ignore that fact despite ocaml being technically better as a language.

vim/emacs

Haskell has loads of great libraries on hackage

F# sucks, though.

I'll do it later if I'll need to render more than 2000 things at the same time, the last time I tried OpenGl I gave up.

I know. Other langugaes have many many more.

no

i have some projects that need websites
you are using a website

people seem to be successfully using node for asynchronous/distributed stuff. i know erlang has great support for this too but it doesn't get nearly as much attention, it seems to me

yes

>Other langugaes have many many more.
[citation need-

Oh, you mean all those retarded OOP libraries like .NET that do nothing but wrap and wrap and wrap shit.
You don't mean actual features.

The goal of OOP is to procrastinate actual programming as long as possible.

pls r8 github.com/Dwillnio/4chanThreadViewer/tree/master/pkg4chan/explorer
>inb4 why didnt you use a json library

no. F# is good

the only excuse java has for the java virtual machine always running is portability.
C# isn't very portable, unless you're counting mono, but .NET is always there, abstracting for no reason at all.

All the disadvantages of java with none of the advantages. Welcome to microsoft's backyard.

You'll get much faster development if you use Haskell or Scala or Clojure or Scheme or CL

People who use node only do so because they're incapable of learning a second language

are you that comma split/parser user from yesterday?

nodejs' way of doing concurrency is terrible

Lame

>Oh, you mean all those retarded OOP libraries like .NET that do nothing but wrap and wrap and wrap shit.
how is that not a feature?

>The goal of OOP is to procrastinate actual programming as long as possible.
Exactly. That why it's good for getting shit done.

yeah

nope, I'm afraid it isn't

it only seems like it's good if you've never seen any other functional language

>he's still parsing context free languages like regular languages
kys

Though they are kind of wack in java, doesn't it have those strongly typed enums?

No, it is. I've seen other langugaes and I still know it's good :^).

>how is that not a feature
FileReader(Reader(Stream(Console(

I'd like to get into pen testing. What are the 5 most important languages to learn?

F# is the same as what happens whenever any dysfunctional language decides to take a feature from a functional language, they always take the most rudimentary, limited, first-order approximation of it and it ends up being almost useless.

How do you guys find things to work on? I've done most of the programming challenges and want to make something useful now, but there is just nothing I can think of.

>learned few words that sound buzzy
Okay fag, tell me difference between context free grammar and regular one, also elaborate your main point

Depends - what sort of pens? Biros? Fountain pens?

What's that got to do with a strong library ecosystem?

English, C, intel x86-64 ASM, lambda calculus, coq

>the last time I tried OpenGl I gave up
Why?

Useful? Hmm you know how there is always mess in file system. Make sorting program. So everything is in its place. Videos in proper folder, books in their own etc...

But F# isn't any of those things. That's why it's great.

make a game

That's what you mean by a "strong library ecosystem"

Take .NET's libraries and divide that by 5 because of OOP nonsense
Then divide it by 20 because of the verbosity of coding in the language

Now you have the equivalent haskell

Php, java, hindu, windows batch scripting, light grasp on english

it has no support for higher-kinded types

so it can only do extraordinarily basic abstractions

so it's shit

Yeah, it would be nice to have those I agree.

But it's still great.

I can use langugaes with those features, but then i lose the wide quality platform support and strong library ecosystem.

any jvm language would fit that, on the other hand you get jvm... so who knows

okay, but why would i divide by 5 or by 20? What has verbosity got to do with the usefulness of the libraries?

Find something that you like to do often. Whether it be a certain game, an activity, or just really anything. Make something small that relates to your pick, and slowly expand on it.

What also works is just following up on random ideas in your head and seeing where they end up. I had a random thought after uni about a program that would randomly throw you around the system, and I ended up making it after I got home.

>wide quality platform support
>strong library ecosystem
You're literally just repeating the sell talk now
Got any real reasons?

>But it's still great.
It's not, though, and you've just admitted it. It's the least imaginative 'functional' language out there. It would be better if it didn't exist, because right now it serves to pull people toward it instead of to better languages, and people come to think that functional programming is as shit as F# makes it.

Not him, but an instance of a cfg that isn't regular is a language like c

Too many things to learn.
With SDL2 I can pretty much write my own stuff, with OpenGL I have to write what OpenGl wants.

There's no JVM language as good as F#. And JVM is pretty shit for mobile development, which I'm fond of.

I just told you
Divide by 5 because of the OOP bullshit, like the example I gave
Divide by 20 because of how poor the abstraction is

Scala's on JVM, but with type annotations as verbose as Java

Those are good things for productivity.

>It's not, though, and you've just admitted it.
No, i explained why it's great. The ecosystem is part of that.

>Too many things to learn.
You don't have to use most of the functionality OpenGL provides.
>With SDL2 I can pretty much write my own stuff, with OpenGL I have to write what OpenGl wants.
What do you mean?

Scala, despite its many, many problems, is far better than F#.

maki for you

Huh isnt whole android based on java? I dont know how more mobile you can go

>Those are good things for productivity.
"strong library ecosystem" and "wide platform support" are just abstract base classes with no inheritors

>can only express the most basic abstractions in it
>it's great lol

Not having to repeat yourself in code is also a good thing for productivity, and it's something that no .NET language currently has.

I mean that it's a lot simpler to use.

I don't see how that "OOP Bullshit" is bad. Simple .NET wrappers for other libraries are useful as fuck.

>Scala
Scala is monstrously fucked up. It's worse than Java by a long shot.
youtube.com/watch?v=uiJycy6dFSQ

otherwise I'd probably use it.

Java is pretty shit for iOS development.

Which are useful as fuck.

I agree. But the ecosystem is far more important than having extra DRY code. I guess that's my opinion, but it seems to be true too.

He's a bit of a dunce mate

>I don't see how that "OOP Bullshit" is bad

What's the more advanced ways? Update every 16ms OR if something has actually changed, then update?

Haskell has an absolutely fantastic ecosystem. It might not have as many libraries, but the ones it does have are immensely powerful and couldn't even exist for most other languages. Would you rather have a single silver spoon or a choice of a dozen plastic spoons?

Oh, and although Paul has ranted about Scala's problems several times, he has also said he thinks it's probably the best language around right now.

a context-free grammar is more complex than a regular one.
a context-free grammar may contain recursive structures.
parsing a strict, flat subset of a context-free grammar like a regular grammar is possible, but not recommended and easy to get wrong (e.g. if a structure always has exactly 0

is setting a 256bit random char token in a cookie/database secure enough to give access to a page?

>worse than Java
False. You can use Scala as 'Java without semicolons', so it cannot be worse than Java.

If your complaint is that you cannot always read others' Scala code, then maybe the fault is with you and you should go read a book.

OpenGL is much more powerful.

im not that user, but okay maybe you didnt just remember buzz words.

Whenever i have to use jvm for whatever reason i just use scala at least its succint...

If it's 2D, GameMaker or C++ with OpenGL or SFML (there's a few other proper engines, but GM is friendly for beginners, if a bit retarded, but if you get the hang of it and realize it's shortcomings then C++ with OpenGL or SFML is the way to go, there's a book specifically for SFML around.
Don't touch Unity and I think Unreal is overkill for a beginner platformer.

Run the bot as an external process.
Niche language. Very good for servers and surrounding infrastructure, like CLI tools and peripheral services.
Go.

why not sdl alone? It should do the trick for normal 2D games, also in sdl2 textures are hardware accelerated so it wont be as slow as sdl1

Go is absolute garbage. Don't recommend it for anything ever again. Educate yourself.

>using a non-monospaced font for programming
>java
>all those o(n) and higher methods called back to back while parsing

Thanks

Constructive criticism, friend. Have a (You)!

go was literally designed for people who aren't capable of using other programming languages.

What do you recommend to use for fucking backend? Choice is pretty much java, python, ruby and horse shit php

...

Go gets products and coproducts the wrong way around at the very heart of its API design.

Scala

>using a non-monospaced font for programming
>java
k
>all those o(n) and higher methods called back to back while parsing
How should I do that better? Are you critisising the methods themselves, i.e. they are inefficient?

> LE EPICCC ARGUMENT MAN MAYMAYYY xDDDDDDD
welp, time for you to fuck off 2 >>Cred Forums

user () suggested SDL, which I have 0 idea about, I just know that OpenGL can be a pain, and that setting up SFML was incredibly easy, just need to link every library it has when compiling the game. Look at SDL too if you go the C++ route.

Please educate yourself. There are plenty of options for backend. I used to work as a backend web developer in C++.

wtf I love ctr now

>OpenGL can be a pain
OpenGL is fun.

>want to write a code
>decide to use go
>need to use a fibonacci heap
>need to use it for more than one type in different places
>oh shit, I cannot do that
>welp better copy and paste the implementation for each type
>oh fug, there is a bug in it
>I hope I didn't miss an implementation when copying and pasting the fix

>wrong way
Still not very descriptive.

Anybody tried pic related desk mounts for monitors or know of any really good ones?

I will consider it, thank you

Are there any good frameworks for cgi with c++? That would be awesome

It is perfectly descriptive. Go's APIs use products where they should use coproducts.

Not programming related, fuck off retard.

Well, it depends on what your definition of good is. There are some FastCGI frameworks, but after having worked with mod_wsgi, I would say that FastCGI is pain.

We used IIS in my old job, there's a FastCGI framework for C++ and IIS called Blackbox at least, but it's 20 years old and not many use it.

Use interfaces and define methods on the passed type.
Unless you can expand on why you think you opinion is right or point me to an article explaining this, your arguments do not look much more than "X does Y wrong, because I said so".

ASP.NET.

/dpt/ hates webdev in general.

I humbly submit that you ought to learn more about programming before replying to me.

Still no explanation on why X is wrong.

Why would you use a product when what you have is a coproduct? It's madness.

The difference between madness and innovation is social acceptance.

Any hardware programmers here?

But this isn't that. This is trying to put a square peg in a round hole. It's insisting that 1 + 1 = 1 x 1.

How long does it take to become good at programming?

I can do basic C and with a small amount of googling can probably achieve most things with it.

But soon as I hit OO, I get so confused!

And you still have not explained how X is wrong.

I have, you just don't realize it.

Probably about 10 years

>2016
>nobody has programmed a yuki

>Device that allows monitors to be rotated to portrait mode for better programming setup isn't programming related
Lel

By that logic, a discussion about office chairs and desks also belongs in this thread.

dont forget floorings, walls, roof, clouds, sun, food, air, water, pizza, anime

>anime makes you a better programmer
I like you.

i need to take control of my life

Why do people keep creating build systems that are inferior to autotools/make?

STOP IT YOU SHITS
THE OLD STUFF WORKS
YOUR NEW STUFF DOESN'T

scons > autotools > autoconf > cmake > make

I agree, and to tell me how to into hardware programming

I thought it was just crossdressing?

first step is for me to lose the 20 lbs i gained the last 3 months

There's no reason to not do both. Making cupcakes for your sweet boyfriend while crossdressing and cosplaying as his waifu increases your programming skills by a factor of at least 23%. It's scientifically proven.

I never watch any programming related vids, it's an unfortunate case.

CAN you recommend me any videos I can watch on my programming downtime (while eating dinner, usually).

I usually just watch (more listen actually) to speeches given about some topic.

watch the video that changed programming forever
youtube.com/watch?v=Gzj723LkRJY

can someone give me an easy project to practice my C?

make an AI so that you don't feel as miserable and lonely you dumb fucking shit fuck you

Cred Forums image scraper

Object Orientated help please.

I'm trying to implement a poker game in C#.

I have a deck class that creates a deck, shuffles and cuts the deck and can also deal out cards.

I'd like to then deal a card to a player that I create. And then be able to print the cards that have been dealt to that player.

So far I've managed to deal the hand to the player by passing the Card object to the player.

However, when I want to print the card that the player has, I try and print by calling the Deck class and passing the cards.

But the compilation fails as the player class can't see the Deck class.

Is that correct?

Make the linux du command with the user being able to use the h and s flags.

:(
is it cheating to use wget?

Probably.
C sockets aren't too bad, but if you want to make it easy, you could use libcurl

sdl2 already uses opengl, tard

Yeah, it would be mostly listening if it was during dinner.


Got any vid recommendations?

new thread when ? :3

>Card class
>Deck class
>Player class
>OOP

In case you're interested in mathematics, I'd recommend Project Euler.

That doesn't work, you cant specify the types of lambdas specifically.

Madness? This is Sparta!

how do you pronounce euler?

yew-ler?

>player class can't see the Deck class
Not sure if I understood that right but couldnt you just pass a reference to the deck class in the players constructor

oiler

oy-ler

Player Class:
using System;
namespace Poker
{
public class Player
{
private String name;
private Card[] hand;

public Player(string playerName)
{
name = playerName;
hand = new Card[2];
}

public string getName()
{
return name;
}

public void addCardToHand(Card newCard)
{
if(hand[0] == null)
{
hand[0] = newCard;
}
else
{
hand[1] = newCard;
}
}

public Card[] printHand()
{
return hand;
}

}
}


Snipper of Deck class to print hand:
public void printHand(Card[] card)
{
for (int i = 0; i < 2; i++)
{
Console.Write("Suit is: {0,-10}", Enum.GetName(typeof(theSuit), card[i].get_suit() - 1));
Console.Write("Value is: " + Enum.GetName(typeof(theFace), card[i].get_faceValue() - 1));
Console.WriteLine("");
}
}


And main game class:
using System;

namespace Poker
{
class MainClass
{

public static void printNamedHand(Player name)
{
Console.WriteLine(name.getName() + "'s hand is:");
Deck.printHand(name.printHand());
}

public static void Main (string[] args)
{
Deck Deck = new Deck();
Deck.shuffle();
Deck.printCards();
Deck.cutCards();
Console.WriteLine("Cards now being cut\n\n");
Deck.printCards();
Player player1 = new Player("Just_Steve");
player1.addCardToHand(Deck.dealCard());
player1.addCardToHand(Deck.dealCard());
printNamedHand(player1);

}
}
}


On the Deck.printhand call, I'm getting "Object reference is required to access non-static member" error.

jewler

>yew-ler

Because printHand() is not static.
You can only call methods in the form of Class.Method() if they're static, if they're not static you need to instantiate the class and use that object to call the method.

oiler

the public void printHand(Card[] card) method doesnt access any of Deck's fields/variables right?
So you should make it static in this case
I dont really get how youre calling the method atm anyway the printHand() method doesnt really make sense to me

No, I think I know what I've done.

Deck.printHand() is going to the class, not the object Deck. I've basically done a terrible naming scheme that the class and object have the same name,

That's right isn't it?

Wait you can Objects the same as their class in C#
LMAO
yeah I think thats it try and fix it

Oh in case you overlook it, you need to pass your deck object to printNamedHand(Player name) as an argument and call printHand() with that otherwise it still wont work

Apparently so. I only realised after I noticed the colouring that the keyword was was blue (for a class) instead of white for the object.

By passing in the deck object to the printHand method, it now works right.

Thanks guys. I'm sure I could implement this in a much better way, still learning.

can confirm it does in firefox and chrome on both, but only if you have the page autorefresh

from random import choice
print(choice(range(00,99)))

Wrote this to pick randomly.

>00

>but only if you have the page autorefresh
Ah, that would explain it I guess.

It's the first number in the list, dipshit.

maed a nu bret:

1. You can use 0.
2. range defaults to starting with 0.
3. Also you have a bug in that 99 will never be returned.
4. You're a shit.

what if you get 101..........

to the user who suggested project euler
i am stuck on number 3

(The prime factors of 13195 are 5, 7, 13 and 29.

What is the largest prime factor of the number 600851475143 ?)

how can i solve this with a 32bit cpu (600851475143 > uint32 max)

Use 64bit integer?

Fatass

Programming quick sort in mips

Upgrade your computer