/dpt/ - Daily Programming Thread

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

Other urls found in this thread:

codeforces.com/problemset/problem/158/B
sijinjoseph.com/programmer-competency-matrix/
informit.com/guides/content.aspx?g=dotnet&seqNum=745
wttr.in/London'
twitter.com/NSFWRedditGif

Trying to get my C# program to automatically log in the user through AD.

WHO HASKELL HERE

I am configuring gnome sarcastically

This is pretty easy. Use impersonation.

codeforces.com/problemset/problem/158/B
program keeps either hanging or throwing exceptions
>tfw want to look up the solution but will feel like a failure

lisp better u trash

me

Why do people still buy programming books when every worthwhile library and language is well documented online for free?

How do I git gud like you?

>putStrLn
>not using IO
vomitchan.jpg

i was born gud

are you still doing that shit homework from yesterday?

why??

Are there any distributed systems jobs in Finland?

putStrLn is IO

No, that's the solution I gave him for Haskell

REPOSTING FROM LAST THREAD:

sijinjoseph.com/programmer-competency-matrix/

ARE YOU A BAD ENOUGH DUDE?

This just screams "THIS IS THE ONLY THING IM GOOD AT I'M GONNA MAKE COMPUTERS LOOK HARDER TO KEEP AWAY NOOBS".

I think they are trophies more than anything. Like hey I learned X language and I have proof. Plus it displays interest to visitors to talk about.

Anyone has good ideas for mathematical stuff to program?

proof assistant

How do I write a markov text generator?
I don't understand any of the articles on the topic.

I'm think how it works is you store all the possible first words and then for each word you store words that could follow it and each potential option has a probability based on how common it is. So the next word is picked randomly from the choices available and more common words are more likely to be picked so it might make sense.

Once the system works you feed in tons of data so that the probabilities are sort of right and you might get sentences that make some sense.

>rendering a total of 100 particle systems, each 100 textured particles totalling 10000 particles
>80fps on my shitty thinkpad

Graphics processors are just magic.

I wrote a thue interpreter and modified that to also look at transition probability (instead of being completely random).

Then I just fed it a rule set.

Wew.

trying to figure out how the internals of my """smart coffee maker""" so i can wire it up to a pi and make coffee whilst at my PC like the guy in the story did

how big is the minimal data set for sentences that arent retarded do you reckon?

Instead of replacing a billion years of mechanical knowledge with a computer, why not make coffee at your PC with a french press?

I am lazy
I want to setup a job to make me a coffee every morning without having to do anything but refill it and place a new cup afterwards

Does anyone actually like Bjarne Stroustrup's writing style ?

How does it compare to other C++ books in your opinion ?

No idea, but if you scrape a subreddit or an irc room or something then you'll have plenty of data

reading "The C++ programming language" feels like trying to cram K&R allover again, except 5 times that.

I always preferred going to cplusplus.com and just reading about individual key and sometimes not so key features. After doing that for a long time, I just skimmed through the Stroustrup book and didn't learn anything new.

Should I use github, gitlab or bitbucket? does anyone use github paid I'm not sure whether it's worth it just for private repos considering the other two provide it for free what do you guys think?

Just use bitbucket if you need private repos.

Here's a really easy-to-follow article with sample code:
informit.com/guides/content.aspx?g=dotnet&seqNum=745

>that painful phase of learning a language where you know the common syntax but still have to look up which modules to import/what arguments their methods expect/etc. because you haven't memorized them yet
>autocomplete doesn't help because it's a scripting language with dynamic typing
>could write the shit in 1/4th the time in a language where you know the standard library but that would defeat the purpose
Is there anything worse?

I need to geocode 200K physical addresses into lat/lng coordinates and my budget is 0.00 shekels. Google Maps API has a query limit of 2K requests per IP per day. In the past I was able to get a huge list of free proxy servers from the internet and feed it to my script that would basically rape the fuck out of Google servers with parallel proxified requests. Now, however, it seems like Google blocks 99.99999% of proxies. Wat do?

Truly markov chains are divine providence.

>Is there anything worse?
Yeah, this one time I got arrested in Beijing when I was so drunk I didn't know what species I was. I got beat up and yelled at in Mandarin for like 9 hours straight as I sobered up very slowly.

That was probably much worse.

>anime poster

Go is fun.

What's the best book for learning C++?

full code pl0x

>see something he dislikes
>goes into the thread
>types a reply
>solves a captcha
>all because he saw anime
man life must suck being triggered this easily

How do you abbreviate 'number'?

I often have variables that contain "number" but not sure how how to abbreviate. I've seen the following:

num_elements
number_elements
nmb_elements
no_elements
nb_elements


I personally see only the first 2 as valid options, but is there any standard or something? Advice pls

n_elements

gtfo with your fucking weeaboo shit
why the hell you can't put normal image

>no_elements

I would take access away from you from the repo and report you to GitHub

Why the hell can't you ask a question?

That... makes sense. Thanks

#mindblown

To keep away newfaggots like you.

reminds me of rotten.com

elem_count
elem_num

n_elements

but he's right, stop posting stupid shit that's completely unrelated to programming or technology

there are other boards for that shit

That also makes sense... Prefixing it with `elem` so I have all variables that pertain to `elem` starting with the same prefix.

Naming is so difficult

>cplusplus.com
>not cppreference.com

nigga please

>subreddit
He asked for non-retarded sentences, user.

>Power BI

Neat.

Going to look at embedding this into something.

me :3
the scoring is pretty cringey

cppreference.com always felt harder to understand. Except for rare cases like std::function.

I like the 'count' suffix. Fits in neatly with other suffixes:

elem_count
elem_index
elem_byte_size

Interdasting.

cplusplus.com is the one with the tutorial

it's pretty cool an short, it even teaches polymorphism in an accessible way

>Keras library
>model.fit(X_train, Y_train, nb_epoch=5, batch_size=32)

Why the fuck did they use nb_epoch instead of epoch_num when they use batch_size later sm.h

Indeed.

Obviously my HTML parsing needs some work, but I did this in like 20 minutes.

That actually introduced a race condition, so I scrapped it. The problem I have is bunch of goroutines waiting in something like
select {
case allocate

>it's

He's right though user, it is data

What is the algorithm to get a gf? I can't figure it out!

import Control.Monad
liftM2 (+) You GF

It's not computable on a turing machine

okcupid

Well, OkCupid has APIs, so I guess you could write an algorithm to aid in finding a gf.

Scratching my head so hard right now, QEMU emulates a PCI system where a generic VGA card (bochs) is added, OVMF firmware can see it and enable it but when I try to enable the device myself using assembly or enabling from linux it doesn't make itself available in the memory areas for PIO and MMIO, I am starting to think of quitting this and going back to webdev lol

I tried to read K&R. And I got completely lost at only the second example! I've never programmed before. I can only Hello World in C. Is there somewhere else I should learn it? Should I learn another language first instead and go back to K&R once I have experience?

dump that book and look for advanced C tutorials online, I recommend the GNU C reference manual, the people that recommend it want to be like their big bros on Sup Forums

C isn't a bad first language to learn if you are young. I would stick with it, re-read the pages you don't understand until you understand them, then ask questions if you are still stuck.

>if you are young
Is 20 years old considered young?

#!/bin/bash
# stats.sh
# needs lm_sensors

CPU_TEMP=`sensors | sed -n 's/Physical id 0:.*+\([0-9A-Z\.\°]*\).*(high.*$/\1/p'`
MEM_USED=`free -m | sed -n 's/Mem:[\t ]*\([0-9]*\)[\t ]*\([0-9]*\).*$/\2\/\1/p'`
WEATHER=`curl --silent 'wttr.in/London' | head -7`

echo "CPU temp: ""$CPU_TEMP"
echo "MEM: ""$MEM_USED"
echo "$WEATHER"

exit 0


i made a cool little script :)

Sure.

You might want to look into C Programming: A Modern Approach. K&R sorta assumes some familiarity with programming, so it might go too quickly for a complete beginner.

i ain't runnin dat

I'm not but still, thank you.
I remember I struggled a lot with The C Programming Language a couple of months ago, so I'll definitely check that out.

I have been programming for a year and a half when do you get good?

When you get a job or work on a team and actually have to meet deadlines.

Expertise is born from necessity. Someone has to plop something totally weird in front of you and say "Figure it out."

If you've been writing FizzBuzzes and shitty little personal utilities for a year and a half, you might as well have been standing still.

Okay so I'm writing a recursive search function that iterates through a filesystem from a specified beginning path and examines .mp3 file ID3 tags. It then moves those files into specific folders it creates, named for the artist name found in the ID3 tag. I'm doing this in Python.

My original attempt iterated through the filepath using a for loop around os.path.listdir() and then os.path.isfile() and os.path.isdir() as conditional statements inside it, but I've just run across os.walk(). I see that os.walk() is a recursive search function that iterates through the file system and returns a list of all the files in it.

Can someone here with experience in Python please tell me that I didn't just spend a few hours replicating a core feature in the python os library? Because that's what it's looking like. Fuck.

>When you get a job or work on a team and actually have to meet deadlines.
No.

>tfw i have been standing still for 10 years

the most complicated thing I wrote was an entire database application as a grocery store inventory

anyone have ideas for a cool project?

Make it OSS so I can help.

Write a Sup Forums scraping script and connect it to a rasberri pi hooked up to an anal vibrator. Whenever you get a (you) the vibrator will massage your prostate for 5 seconds.

>for loop
>recursive

No

Write your own function that does this recursively, you might learn something.
Hint: use tail recursion

First day on job, boss just asked me for a CRUD that work with mysql and accesible entirely by web, what to do?

why `commmand` instead of $(command)?

I just accidentally an entire Sup Forums

Make it.

>CRUD
which language

Write a CRUD that works with mysql and is accessible from the web, then.

Why the fuck are you asking this here?

I have a bunch of programming projects on my netbeans should I make a github and upload them all?

Do it and post link.

We won't bully.