/dpt/ - Daily Programming Thread

old thread: What are you working on, Sup Forums?

Other urls found in this thread:

pastebin.com/3trwadwa
en.wikipedia.org/w/api.php?action=query&list=categorymembers&cmprop=title&cmlimit=500&cmtitle=Category:Gay_men's_choruses
algomation.com/algorithm/quick-sort-visualization
youtube.com/watch?v=QM1iUe6IofM
twitter.com/NSFWRedditGif

learning lisp ironically

nice pic but this thread's a tad early

she is the cutest

>she

Doesn't really matter.
The only people who actually care are the nerds who want to pick the OP image.
Is there really anyone else that has reasons to complain?

first for Java

First for D

because it's a waste of a bit of a thread and it puts another in the archive, plus it leads to thread wars

How are you enjoying this year's advent of code?
Here's my day 3 pt 2.
int valid_triangle(int *arr)
{
if (arr[0] + arr[1] > arr[2] &&
arr[0] + arr[2] > arr[1] &&
arr[1] + arr[2] > arr[0])
return 1;
else
return 0;
}

int main(void)
{
char *ins = get_filebuffer(DAY(03));
int sides[3][3] = { { 0 } };
unsigned col = 0, row = 0;
unsigned valid = 0;
char *tok = strtok(ins, " \n");
while (tok != NULL)
{
sscanf(tok, "%d", &sides[row++ % 3][col % 3]); /* vertical */
if ((row % 3) == 2)
col++;
if (!(row % 3) && !(col % 3))
{
unsigned i; /* flatten array */
for (i = 0; i < 3; i++)
{
int arr[3] = { sides[i][0], sides[i][1], sides[i][2] };
if (valid_triangle(arr))
valid++;
}
}
tok = strtok(NULL, " \n");
}
printf("Valid triangles: %d\n", valid);
free(ins);
return 0;
}

Please stop using an anime picture on a tech related discussion board

>plus it leads to thread wars
See
>The only people who actually care are the nerds who want to pick the OP image.

>because it's a waste of a bit of a thread and it puts another in the archive
Autistic reason really. Memory is cheap and it's not even ours.

it's not about memory

Ask gook to write in rules about forbidding using anime pictures on the site, if you want so.

what're some must have features for my IRC bot?

SASL so you don't ruin it for everyone else in private channels

After 4 months of failure is it time to suck up my pride and apply to one of those disability recruitment agencies?

I have a hard time applying for jobs because of a speech impediment that makes me sound retarded. Of course, I quickly confirm that suspicion by immediately forgetting all the programming terminology I need to know

D as in Dick

Can someone please help me understand the Quick Sort algorithm? I know it's meant to be basic shit, but I'm terrible.

I've got a rough one that I wrote, but it was mostly copying other people.I just about understand the algorithm itself, but don't quite get how to implement it. I know it recursively sorts smaller and smaller arrays until the main list of numbers is in order, but that's about all I can grasp.

Here's my shitty attempt: pastebin.com/3trwadwa

Because only faggots want the D

...

I was planning on being the only one using the bot

You don't use programming languages for unintended purposes, do you?

Use the api to pull stuff from Wikipedia then process accordingly, for example

en.wikipedia.org/w/api.php?action=query&list=categorymembers&cmprop=title&cmlimit=500&cmtitle=Category:Gay_men's_choruses

What do you mean?

he's probably gonna say something stupid like
>using C in 2017

What do you mean by infinite/inversed loop?
Is it one/both of the for loops in the constructor?

Sry I'm really slow at learning.

Yep, you failed!

Red's not going to house 1.

I managed to get working an algoritm to recreate the SNES Mode7 perspective. Is not the real deal Baseball, but it accomplish the goal.

The logic is basically project 3D to 2D (x/z and y/z), grab the color of a certain pixel of a 2D map given the previous calculation, then display that color on screen.

Max_X= //Get width of the screen;
Max_Y= //Get height of the screen;

HORIZON=90;
FOV=300;

While(TRUE)
{
for (X=0; X < Max_X; X++)
for (Y=0; Y < Max_Y; Y++)
{
PX=X;
PY=FOV;
PZ=Y/HORIZON;

SX=PX/PZ;
SY=PY/PZ;

//Grab the color of a pixel
COLOR= //GrabColor(SX,SY);

//Display the color on screen

//PlaceColor(X,Y,COLOR);
}
}


Is not optimized, but looks neat BTW.

no bully

The only winning move is not to play. The puzzle has no solutions.

I don't believe you. I'm already playing life anyway

var gay = "Haskell"

>var
Disgusting.

>Posts on Sup Forums.org
Clearly you're not doing very well at life either

Please friends I beg of you

Help :(

>take first element of list
>get elements less than that
>get elements more than that
>re-arrange so that it's smaller < element < bigger
>recur on smaller and bigger

algomation.com/algorithm/quick-sort-visualization

That's very concise, thanks.

>when you spend 2 hours trying to build the latest libjpg-turbo on VS2015 and fix various missing legacy functions to make jpegview compile to make it close when you press esc when you're viewing a gif instead of pausing it
>the solution was to add legacy_stdio_definitions.lib in the linker options

>Microsoft Windows.bmp

At least I fixed an issue that have been annoying me for the last two years. Worth it, should have done it sooner.

pajeets btfo
youtube.com/watch?v=QM1iUe6IofM

Is Android Programming for Beginners a good book for me if I want to learn how to make apps? I know no java but have background in programming.

Only books. Fucking hate learning on the computer

Gotta love Open Source when you can just adjust something that you don't like.

I can't seem to find "The Pragmatic Programmer: From Journeyman to Master" in a hardcover copy.
It's like physical media wants to die.
Of course they probably have a larger profit-margin on digital book sales.
But I'm not gonna buy that.

why though?

Please someone explain this to me.

why not?

I have a physical copy of that book.
I don't recall it being difficult to find.

Yeah but I can only find paperback copies. I hate paperback.
I'd pay lots more for one. But I'm not paying 20$+ for a paperback.

because hardware acceleration an shit

>I hate paperback
>But I'm not paying 20$+ for a paperback
What the hell do you have against paperback? Most books are paperback.
Are you going to use it as a coaster or something?

It makes sense for Hime to be the thread mascot. It's right there in her name: Hime"GOTO"!

This stupid trap meme needs to stop.
Also, himegoto was fucking shit.

>Using a harmful mascot

>Are you going to use it as a coaster or something?
yes

Mistreating books is literally worse than hitler.
I bet you scrible in the margins and use a bright pink highlighter, too.

>Please stop using an anime picture on a tech related discussion board

Without Maki.

>What the hell do you have against paperback?
They're not as comfortable to read for me. The hardcover just feels way better.

Also there's aesthetic considerations. I mostly have hardcover books. I don't want to allocate more space to the paperbacks. They can go back to mexico.

>perverted blushing
Why do men always praise sluts?

>Men
You mean manchildren

HW acceleration in wayland is better and more efficient than in X11, now it's just a matter of drivers implementing it. All the FOSS drivers and proprietary nvidia driver (on non-optimus systems) work AFAIK

is there anyone here that actually looks like that pic because if so pls pm.

>pm
k

>Not having a Sup Forums Gold account

Here, try reading this beautiful elegant Haskell code
import Data.List
import Control.Arrow
import Control.Monad
import Data.Function

qs :: Ord a => [a] -> [a]
qs = fix (ap ((>>) . guard . not . null) . (`ap` tail) . ((uncurry (++) .) .) . (`ap` (partition . flip (

Good goys belongs to

>2016
Get out of here, you newfag.

You're probably not gonna find someone who has read the specific book you're asking about.
My guess is that an android book covers more than you need.
There's fairly good reasons why they're not that popular.
A infinite loop means that your loop never ends. That is often not what you want.
>inverted check
This means that user here thinks you're checking the opposite of what you intended. I'm not sure exactly what he's referring to.
>Sry I'm really slow at learning.
No it's just that nobody has introduced these things to you.

Anyway I think your issue is that you have an infinitely recursing function. walk through the program and think about each step.
If you look at Snackbar(...) it will always call Snackbar(...). So really onyl the first three lines are executed in the function because snackbar calls snackbar which calls snackbar which calls snackbar....

The computer can't do that forever. It runs out of memory because it has to remember where it should go back to when it's done with the function.

Also enable line numbers like I told you two-five days ago.

Who here /obfuscated/?

#include // To print a special message for my friends in the /dpt/

thanks for supporting Sup Forums

>newfag
Pls. I wouldn't have bough a pass at all, but I believed his lies.

I mean males of the human species. If we're to be specific.

>wasting 20 USD years just to bypass a captcha

It was worth it. I can block all botnet scripts from running here, and it's an boon to my shitposting efficiency.

I'd do it too if I could get bothered to buy some buttcoins.

Anyone interested in a private Sup Forums leaderboard for Advent of Code this year?

Step back, can't get spunk on the mink

but user, we're like 10 here and everyone know I'm the best

sure post the code

steven nigga you set yourself as user but you linked to your github lol

>To play, please identify yourself via one of these services:
>[GitHub] [Google] [Twitter] [Reddit]

Am I really introvert or is internet beyond saving?

So I am very uneducated in the realm of programming, but I would like to change that. What languages would be good for me to learn, taking into consideration future employability/desirability, and the fact that I barely have any programming experience. What are some good resources to get me started?

The latter.

just create a throwaway account i guess

My bad. Made a new account/leaderboard. 138736-c753c8e0

public boolean setPlayer()
{
Scanner in = new Scanner(System.in);
while(true)
{

System.out.println("Choose, (1)Rock, (2)Paper or (3)Scissors (-99 to quit)");
System.out.println("enter number: 1,2 or 3");
userChoice = in.nextInt();
if(userChoice != "-99")
return true;
else
return false;
}


why is if(userChoice != "-99") an error
how does one fix

yeah although I guess you just lost all your progress (at least on that leaderboard) since it counts total combined rather than just the most recent

anyway would be nice if we got some more people from here to join just for the fuck of it

nextInt returns an int
"-99" is a string

Have you declared it?

I did the first 5 problems about an hour ago, so it's not like I've lost a ton of progress.

fuck im retarded thanks

>Detroit Labs - Build beautiful mobile apps.
>muh """MD5""" haxor
>PHP
Seriously why is this supported by /dpt/? At best it's just a glorified IQ test.

Can I install Linux on a Sega Genesis?

>>Detroit Labs - Build beautiful mobile apps.

Just a sponsor.

>>muh """MD5""" haxor
It's just a joke, calm down autist.

>>PHP
?

Wageslave here

Is there any way to iterate through labels (For i = 2 to 100 objDoc.Label(i).Caption) in a Word document in Excel VBA?

>decide to look at what book nerds consider proper for books
>find this cute girl who prefers paperback
>she eventually starts fondling the hard, hard, cover of the book rubbing her nice hands up and down its rigid exterior
Too much. This is not what I'm supposed to be doing.

Hi! I'm Eric Wastl. I make Advent of Code. I hope you like it! I also made Vanilla JS, PHP Sadness, and lots of other things. You can find me on Twitter and GitHub.

His github is filled with scripts for mac and PHP projects.

--- Credits ---
Playing: You!