/dpt/ - Daily Programming Thread

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

Other urls found in this thread:

45.32.80.36/board.cgi
docs.oracle.com/javase/7/docs/api/java/lang/String.html
twitter.com/NSFWRedditImage

everything

Fuck off I'm not doing your homework.

that looks god fucking awful

First for OOP

>"""silver bullets"""

Fuck off this programming fap meme

Fighting werewolves aren't we you homoerotic faggot?

any of you have any experience with machine learning?
how hard is it to make a captcha solver?

I added support for pages to my simple CGI commentboard written in C!
45.32.80.36/board.cgi

Now you don't have to load 10000 posts on every pageload!

>tfw binary multiplier implementation worked first try
>keep throwing things at it and it keeps returning the correct answer
i don't trust it

im not clicking that shit LA cuck

...

>How many jobs have you actually applied for anyway?
About as many as I can find. Indeed, etc. I'll look into the GitHub thing. I've made it to the first phone interview a couple of times but my autism gets in the way and I throw all interview etiquette out the window.

Doesn't help I live in the worst possible place to get a developer job.

How should I start setting up a portfolio? What are things people look for in a portfolio specifically? Obviously if I'm applying for a job using ebedded C programming they don't want to see PHP websites. Or do they like a healthy balance?

in Java, what's the difference between:
str
string
String
?

one of them is a datatype

you live in east central Indiana, too?
howdy, neighbor!

oh wow i live in india too

pretty sure "str" isn't a thing, and i don't think "string" is a thing either. String is the class for strings

yes

public class Main {
public static void main(String[] args) {
Scanner userInput = new Scanner (System.in);
str commonName = new str;
System.out.println("What do most people call you?");
commonName = userInput.NextLine();
am i using the wrong one here?

docs.oracle.com/javase/7/docs/api/java/lang/String.html

Stop advertising.

No, South Carolina

String commonName = new String();
...
commonName = userInput.nextLine();

don't spoonfeed, it just makes them keep clogging up the threads and keeping us away from anime/trap discussion

post ur sexy legs wit them socks then bb

str Common Name = new[] Strink;


ftfy

my dik iz big

i dont own socks sorry, here's me though. guess what my favorite language is

trying to create a full, non-toy compiler for my programming language and it's hard.
no end in sight

gorgeous state! not too far from ATL
maybe search for jobs there that will let you telecommute, but if they need u onsite, u can get there

friend of mine lives in NH employed by rackspace in TX. she only goes to TX 1-2 times/year

Sounds like a good idea. Thanks for the suggestion.

String is a datatype.
string or str can be the name of the String object you are creating but the name can be anything you want

String str = "";
String string = "";

Is anybody here learning R? I'm doing the free course on coursera from JHU, but I'd like another source to learn as well. Help?

why are you learning R?

>tfw mario.c compiles

If you're having trouble with the interview itself watch interview videos and tips etc.

God spped

oh god I'm doing it
I'm making an animated chinese rock carving and I have no idea what the fuck compilers would be when it comes to objects cute grills would use

I made that user's fraction math program in Python. It actually works afaik and I think I've done it fairly cleanly. Critiques?


n0 = input('Input your first fractions numerator: ')
d0 = input('Input your first fractions denominator: ')
n1 = input('Input your second fractions numerator: ')
d1 = input('Input your second fractions denominator: ')

print ('Your fractons are {}/{} and {}/{}, what would you like to do with them?'.format(n0, d0, n1, d1))

user_choice = input('You can choose to divide, multiply, add or subtract these fractions: ').lower()

def simplify(num, den):
for i in range(min(num, den), 0, -1):
if num % i == 0 and den % i == 0:
num = num / i
den = den / i
return ('{}/{}'.format(num, den))

def fractionMath(user_choice):
if user_choice == 'divide':
num = (int(n0) * int(d1))
den = (int(d0) * int(n1))
elif user_choice == 'multiply':
num = (int(n0) * int(n1))
den = (int(d0) * int(d1))
elif user_choice == 'add':
num = (int(n0) * int(d1)) + (int(d0) * int(n1))
den = (int(d0) * int(d1))
elif user_choice == 'subtract':
num = (int(n0) * int(d1)) - (int(d0) * int(n1))
den = (int(d0) * int(d1))
print ('If you {} {}/{} and {}/{}, your unsimplified answer is: {}/{}'.format(user_choice, n0, d0, n1, d1, num, den))
print ('Your simplified answer is: ', simplify(num, den))
print ('Your decimal answer is:', num/den)


fractionMath(user_choice)

thank you!

Let LLVM handle all of your backend shit. That will at least make things a little easier.

>Your fractons are 15/5 and 5/1, what would you like to do with them?
>You can choose to divide, multiply, add or subtract these fractions: lmao
>Traceback (most recent call last):
> File "lmao.py", line 35, in
> fractionMath(user_choice)
> File "lmao.py", line 30, in fractionMath
> print ('If you {} {}/{} and {}/{}, your unsimplified answer is: {}/{}'.format(user_choice, n0, d0, n1, d1, num, >den))
> UnboundLocalError: local variable 'num' referenced before assignment

Does the 'p' in "dpt" stand for Pajeet?

What's the coolest thing you've ever programmed, /dpt/?

I wrote a name generator that takes a bunch of input data, builds a statistical model, and then generates names that could reasonably fit into that data.

I fed it a bunch of african-american names and got this:
Liatonta
Qunanima
Lajan
Linesha
Tondeen
Sha
Lantand
Tarickickararel
Kekan
Kekes
Lenandr
Tys
Lanar
Kat
Andea
Kique
Dedei
Kaya
Denik
Tays
Tori
Dan
Jaqual
Daranie
Nimatinylina
Keshan
Qua
Toryalauane
Lickis
Tyrqui
Majashata
Ryl
/code]

You could probably clean up the output dialog a little

tfw I can't lmao my fractions

I'm a psychologist, doing cognitive experiments, and I want to really know the statistics I'm using. At school they taught us SPSS, but that's just clicking buttons without really knowing what's going on. I want to understand the 'behind-the-scenes'. Does that make sense?

Do you consider yourself to have a low, average or high interpersonal IQ?

Ummm why do those names have to be "African-American" names?

My wife's son is white (ugh) and she named him after his father Jamal.. Just sayin'

That's fucking hilarious

lel, I'd say average to high. Most of my friends come talk to me about their issues and shit, I'm a good listener.

wanna have sex? :^)

is it Java?

if (age

>Kekan
>Kekes
kekd

Have you seen The sopranos?

what do think about Dr. Melfi?

Could you give details as to how you did it? I'm actually really interested. Also could you use reinforcement learning to get it to make better names, for example, you can say Lanar, Jaqual, Keshan etc are good and to generate more like them?

Pontificate us user. What is this statistical model? I've only ever bothered with markov chains.

how is it racist to laugh at stereotypical names? Literally everyone does that...nigger.

>builds a statistical model
how did you do it, just the principles of it

I've seen a couple of episodes, but I don't remember Dr. Melfi, desu.

Any help with my original R question?

I wanna learn R too for ML and AI but it seems very dense. The only people that seem to really get it are Data Sci PhD's, but I'm not entirely sure about that.

could attach to a GUI and have users select the top 5 names they'd name their kids. rerun the 'statistical model' after each use = more accurate lists

>nigger
Racist!

Don't you have to snitch on some github users?

sounds good. but i think you should show them a list of ten have them pick the best one, repeat until they are tired of it.

No?

Anyone here learning AI/ML?

Any good resources for that?

I do some neural network modeling in Matlab, it's pretty cool. But R is the best for stats in general, so I'd be getting stats + ML, two birds with one stone.

I'm not Data Sci level, but I am going balls-deep into a lot of stats classes.

What is dense, R or ML? Because Neural Network are just learning by error reduction, pretty simple.

The language R. I'm currently doing some basic ML stuff in Python and it's pretty fascinating.

I might be wrong, but R doesn't seem as complicated as C/C++. It's pretty similar to Matlab actually, you can get something running in just a few minutes.

add in usernames and boards

That's the coolest thing you've done?

Had an interview for a postdoc position and on top of generally doing very well I was asked the best question ever.

We were talking about how I would approach a particular problem and the professor in charge asked if I've heard of a certain program (really just a fancy parser for the sort of data used in such problems which also generates useful summaries).

I answered truthfully that I developed it. He seemed quite impressed.

I ended up getting the offer.

>be me
>do something
>blog about it on Sup Forums
>mfw

>mfw you have no face

that's impressive.

what tool?

>I developed it

how come you didn't put that on your CV/presentation letter?

>My wife's son is white (ugh)

newfag

what is the best way in C++ to compare 3 different numbers and assign the lowest number to an int using ternary operator?

Im trying to get 3 runner's times and assign the lowest to 1st place etc. etc.

Use the ternary operator to implement a min function and use that.

>falling for obvious bait

I'm just trying to do this in the main function because I haven't learned about making different functions yet

>from fractions import Fraction

if only there was a way to get the size of windows in ncurses

*dimensions

how do I make a page switching effect like in most ebook readers?

is there any easy tool to make an ebook reader app?

You would have to nest the ternary with another ternary
int a,b,c;
...
int lowest = a;
lowest = (lowest < b) ? b : ((lowest < c) ? c : c)

I hit a breakthrough in my current project and thanks to that i'm in the process of adding things i didn't originally plan on, and just making it more ambitious in general.

How fucked am i?

oh shit I goofed, that last c should be lowest.

>How fucked am i?

What? What a stupid question

>nest the ternary with another ternary

Mind brain just shit itself

Very very fucked. I have ~60 issues on Github that are all public TODOs made by me.

So there should be 27 possibilities right?

So I would have to right 3 ternary conditional statements with 3 possibilities?

>Racist
While global rule 3 does state that among other things, racist content should be kept on Sup Forums, the rule is lightly enforced, and nobody really gives too much of a shit about it. Shouting "racist" on pretty much any board here is fairly ineffective.

>is there any easy tool to make an ebook reader app?
Android Studio.

Is there a recommended book list? I'm trying to see what books I should get from my library besides the obvious ones.

I only wrote two ternarys there.

yeah, but how do I code that flipping page effect where you grab the page corner?