/dpt/ - Daily Programming Thread

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

Other urls found in this thread:

archive.rebeccablacktech.com/g/thread/S56003424
youtube.com/watch?v=Pe8d2W2Ma98
akifhakannewworks.tumblr.com
twitter.com/NSFWRedditVideo

your mother

>Created before the bump limit
>Frogposting
Delete this stupid shit.

>wahhh i didn't get to post my fag shit

learning me a haskell

kék

>fag me gee

Wow look at all this conversation about programming in this programming thread!

Is this the meme thread?

...

>piling on
well done, pedoshit!

It's a fucking frogposter thread.
This thread is exclusively for shitposts, and no programming discussion.

you think this fag thread was better?

archive.rebeccablacktech.com/g/thread/S56003424

I'm working on a web crawler/data extractor using Java. I was using the Jsoup library to scrape HTML until I encountered some sites that are almost exclusively rendered using Javascript and that hide the goods till some user action occurs. Now I'm looking at headless-browser libraries as a way to get all screen elements to fill out fully so that I can scrape as needed.

neat, where is this code hosted?

ebin

what is the source of this?

New Game
now get out

nowhere, it ain't that valuable...
:^)

8==>~

Learning A*

thank you. enjoy your quality threads know as "/dpt/".

Not that A* yet...

Now watch me whip, watch me nae nae, watch me whip whip watch me nae nae

youtube.com/watch?v=Pe8d2W2Ma98

Source

Does anyone here program in Erlang?

>in update loop
>every tick, check if condition is true
>if so, call a function
>except I only want the function to be called once
>what do

Yes.
Anything is better than a frog.

Me too

set a flag

You mean like, a boolean? I could check if it's false, and then set it to true when I first call the function. That seems really hacky, though, is there not a better way to do it?

>>what do
Easy, stop abusing quotes.

I hope not.

set condition to false

Yeah what's the deal with Erlang?

kek

xd

akifhakannewworks.tumblr.com

wtf i love emacs now

Why is this thread full of favelabois talking about anything except programming?

This is what happens when you don't put anime girls in the op.

Because of a frog OP.

It draws the faggotry in.

Not the tolerable trap faggotry. The Sup Forums-tier faggotry.

stupid frog poster made the thread

>>>>girls

long swap_bits(long n, unsigned i, unsigned j)
{
// how?
}

send help gee

kind of hacky solution
n ^ ((n >> i ^ n >> j) & 1 ? 1

In c#, is it possible to pass multiple parameters to a list with just a .txt file via something like File.ReadAllLines? e.x.:

foreach (breed, location in dogShop)
{
dogs.Add(new Dog(breed, location));
}

Yes.

What does you text file look like?

Exactly like the example. Breed, Location per line so:
St. Bernard, Milwaukee
Welsh Corgi, Baltimore

There's probably a better way of doing it, but here's a quick and dirty one liner.

Thank you, resident c# wizard Pajeetslayer, for once again lighting the way.
(I like both)

Also, if you want to get really crazy, you can make a constructor that accepts a single string and attempts to separate it into the properties of the object.

PROTIP: Don't let anyone see you do some dumb bullshit like this.

public Dog(string _commaseparatedline)
{
Breed = _commaseparatedline.Split(',')[0];
Location = _commaseparatedline.Split(',')[1];
}

Then you can just do:
var ayy = ReadAllLines(@"C:\temp\cats are better.txt")
.Select(x => new Dog(x))
.ToList();

Note that my code requires the following in the header:
using static System.Console;
using static System.IO.File;

I just did my firs FizzBuzz. Can I be a game developer now?

No.

yes

but it is a application made in node.js though

Did you do it in one line?

automated shitposting so I can sage while doing actual work
pic related

Still better than anime

I didn't know they had threads like this on vg.
There are some interesting projects there.

I see you generating sentences based on a single simplistic grammar structure.

How is that "automated shitposting"? Doesn't even post to Sup Forums.

>open in Vi
>keep pressing shift j
>:wq

Gee, I made a one-liner

so it just prints sentences to the terminal?

really made me think

>make a constructor that accepts a single string and attempts to separate it into the properties of the object
Breed = _commaseparatedline.Split(',')[0];
Location = _commaseparatedline.Split(',')[1];


Holy lel. I bet you have some good stories.

Somebody the other day was spending like 20 quid on some book called continuous enterprise dev in Java

So I'm reading it now this shit is bollocks

I would be lying if I said I haven't seen worse in some of the code I've had to maintain.

Bonus points for when the god damn foreigners start making up words and using them in the code, like UpgradationImplimentator and Authentificationism.

so its good?

>copy paste synonyms of 3 words from thesaurus
>randomly pick elements from each list
>concatenate them together
really made me think

i was half-joking about being ready to make games, it's actually quite easy to get started with using a game engine, but if you want to get serious about making games you have many things you should learn, and not just programming-related things

That is a sexy color scheme. What's the name of it?

I don't really see the point in it, it just tells you to use the tools every Java dev does

It's literally Visual Studio's default dark theme.

What's the name of it?

>pretending you can cheat the captcha
You'd make gorallions senpai

If you have VS go look in the options. I guarantee you'll find it immediately.

What's faster, passing a vector through a function by reference, or calling getVector() (which also returns a reference)?

>he can't even change IDE themes
There's no hope, friend.

DOES
NOT
MATTER

seriously user, caring even ironically about such non-issues is plain retarded

click options
it's the first fucking thing

IT'S THE FIRST FUCKING THING REEEEEEEEEEEEEEEE

No idea whoch language you mean but getV has extra function call so pass by ref is better

If your function isn't being called hundreds of millions of times per second, it DOES NOT FUCKING MATTER.

The former although the difference is insignificant.

What VIM theme are you guys using?

gruvbox

The message comming out of a queue is wrong and it is mapping wrong somewhere and i cant find it and i dont want to go home feeling a failure like I did yesterday.

if your post is not programming related, go to /sqt/ or elsewhere please

that's fucking beautiful thanks

the former, the code is cleaner and it does matter for performance depending on what you're doing

You should always code as if your code is going to be scaled millions of times.

should i scale my fizzbuzz program?

I'm a noob learning could someone help me with conditionals inside a foreach loop I want to pick specific items out of an array.

post the fucking code you fucking faggot.

Learning power shell*

Yes, every CPU cycle of your FizzBuzz should be micro-optimized at the Assembly level.

Readability doesn't matter, you can always tell your programmers to just git gud.

$numbers = 10,20,30,40,50

$count = 0

write-host "ForEach selecting"

foreach($num in $numbers) {
if($num -lt 30){
$count++
}
}

write-host $numbers.length "took the test."
write-host $count "failed"

pause

c

> That seems really hacky, though, is there not a better way to do it?
It's the simplest way of doing what you described.

Do you guys hate frogposter :^)

hello rêddit

Yes it is. Anything but CP will do.