[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
/hpt/ - Hourly Programming Thread
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 158
Thread images: 20
File: BlYgNggCEAAjcvT.jpg (56 KB, 599x384) Image search: [Google]
BlYgNggCEAAjcvT.jpg
56 KB, 599x384
Didnt see one in the catalog. How long before you reach CS Grad tier?
>>
>>51913376
I guess I reached that in ~'09?
>>
>>51913376
Shouldn't the /dpt/ be renamed to something like "The 8-hour programming thread", or "The thrice-daily programming thread"?
>>
File: 1438034901598.png (17 KB, 133x89) Image search: [Google]
1438034901598.png
17 KB, 133x89
bool even(int x)
{
return x&1;
}
>>
File: hvEnMpK.png (80 KB, 694x732) Image search: [Google]
hvEnMpK.png
80 KB, 694x732
Just reached functional tier so not too long.
>>
>>51913522
>pic
kekd at the succinct
>>
Checking into NVidia's cuDNN to see how easy it would be to integrate with my Gutenberg parser.
>>
>>51913635
Unless you need extremely high-performance convolution, cudnn isn't very useful.
>>
>>51913681
my corpora is > 113,000 English books w/ many millions of words so yea.
>>
>>51913700
And how is convolution going to be of any use to you you fucking mong?
>>
>>51913718
>wat is NLP

mostly discovering similarity/associative mapping.
>>
File: 161017757_44042348.jpg (67 KB, 590x632) Image search: [Google]
161017757_44042348.jpg
67 KB, 590x632
>>51913423
lel, k tard. it's [daily programming] thread, a thread about your daily programming, and not programming daily thread. reading comprehension is a thing.
>>
>>51913718
"RANDOM" DISPENSATION


ZOOOOOM

VROOOOOOM

BAP BAP BAP TIGGAH TIGGAH TIGGAH TIGGAH
>>
File: Hackerman.png (3 MB, 1860x1036) Image search: [Google]
Hackerman.png
3 MB, 1860x1036
>>51913376
Opinions on perl? Want to pick it up for bioinformatics stuff.
>>
>>51913728
>nlp
>convolution
Oh, so you were just pretending all along. Well I sure fell for it.
>>
>>51913729
>"I'm the sole arbiter of the vagaries of the English language."
>>
>search for dpt
>old thread, no new one
>create new one
>see this
Now we have 3 you dongus
>>
>>51913746
Enlighten us on all the great research work you're doing currently in AI friend.

At least I'm working it.
:D
>>
>>51913743
Perl? For bioninformatics? You will go crazy. Pick up python and/or R instead.
>>
>>51913780
I am a PhD student at MIT in machine learning. Fuck off.
>>
>>51913846
So, no research happening for you then?

Here's one for ya' mebbe it'll give you some tips:
http://arxiv.org/pdf/1404.7296v1
>>
>>51913846
Hey me too! Let's meet for lunch
>>
>>51913871
I like how there's literally no convolution in this model. It really shows how serious you are.
>>
>>51913522
Can I get a job?
(define (av)
(lambda (x)
(define (av-helper x y z)
(if (null? x) (/ y z)
(av-helper (cdr x) (+ y (car x)) (+ z 1))))
(av-helper x 0 0)))
>>
>>51913881
Sure. Where do you want to meet?
>>
>>51913908
>Can I get a job?
>(/ y z)
>0 0
no, redo it
>>
>>51913914
I was just kidding, I'm not an MIT student ;_; Sadly.
>>
>>51913933
Rip. A /g/ meetup could be fun (beside the autism).
>>
>hourly programming thread
>daily programming thread
srsly faggots?
>>
>they fell for the machine learning meme
haha nerds
>>
http://arxiv.org/pdf/1408.5882v2

>>51913996
Minutely programming thread?
>wat next microseconds?
>>
>>51913927
>0 0
do you even functional. It works on everything but the empty list. What value would you like for me to return on the empty list sempai.
Exception handling for things like this usually go onto the user.
>>
Well, once you seriously made your way through Clean Code and every single page of Introduction to algorithms you are ahead of 90% of all graduates.
>>
>>51914008
It's no different than having a ledger or a schedule, anon...

Come on, man...
>>
>>51914021
>he fell for the college meme
haha nerd
>>
>>51914015
I would expect 0.
And calling it like this
((av) '(1 2 3))


Is not very neat.
(define av
(lambda (xs)
(if (empty? xs)
0
(/ (foldr + 0 xs) (length xs)))))


then you can call it with:
(av '(1 2 3))


You CS student learning racket?
>>
File: 1275371232650.jpg (100 KB, 680x979) Image search: [Google]
1275371232650.jpg
100 KB, 680x979
http://arxiv.org/pdf/1404.2188v1

>>51914008
>not embracing the AI future
>>
>>51913522
Is this a better solution to this than >>51913908
I dont really see the need for the lambda other than to curry.
>>
>>51914055
>he thinks machine learning has to do with artificial intelligence
>>
>>51914076
I do indeed friend. One of many, many artifacts involved in a reasonable approach to a solution.
>>
>>51913996
See >>51913769
>>
>>51914057
yea lambda makes no sense at all in this task, but that is what CS tasks normally do.
>>
>in a processing course
>final project
>never learned how to read numbers from a text file and insert it into a float array (or convert)
Help
>>
>>51914127
learn2java
>>
>>51914094
Well theres plenty of uses for currying a function.
>>
>>51914127
>read numbers from a text file
>insert it into a float array (or convert)
done
>>
>>51913948
Not him but I think it'd end up like the /b/ meetup
>>
>>51914159
then use the curry function from racket.
>>
>>51914176
Thank god I have no clue what you mean by that.

I'd rather do that wrong too.
>>
>>51914196
The whole point of racket is to teach you not to be dependent on built-in functions.
>>
>>51914009
>shit performance except in the single-sentence binary-labelled case where it is barely better than other models
Wow.
>>51914055
>worse results than the previous paper that was referencing this paper and comparing to it anyway
>still can't match non-cnn approaches
Impressive.

Do you even read your shit papers before you post them? C'mon son. There's a reason nobody serious uses convolution for texts. It's great for vision but they suck for text.
>>
File: Learning.jpg (242 KB, 1366x768) Image search: [Google]
Learning.jpg
242 KB, 1366x768
Just started learning Java, I'm writing this and I don't see spaces between numbers and text, despite coding them in. Is it just the IDE I'm using? Check pic.

class faggot {
public static void main (String args[]) {
int var1;
int var2;
var1 = 9000;
var2 = var1 * 100;
System.out.println("OP can take" + var1 + "dicks in his ass!");
System.out.println("OPs fag index is" + var2 + "cumshots!");
}
}
>>
File: 3Jss11Ql.jpg (71 KB, 640x507) Image search: [Google]
3Jss11Ql.jpg
71 KB, 640x507
>>51914223
>>
>>51914237
im not dependent on them, I use them where it shortens my code.
>>
http://research.microsoft.com/pubs/214617/www2014_cdssm_p07.pdf

>>51914271
sounds like a great time heh.
>>
>>51914147
>>51914162
Disregard, I got it.
>>
>>51914271
Toppest kek.
>>
>>51914054
But that solution makes the point of the lambda non-existent since its the same as
(define (av xs)
(if (empty? xs)
0
(/ (foldr + 0 xs) (length xs))))
>>
thinking of emailing stallman.

He replied me once.

what should I ask him about?
>>
\documentclass[12pt]{article}
\begin{document}
\LaTeX\ is a document typesetting sytem developed by Donald Knuth. It is free software.
\end{document}
>>
>>51914310
thats the joke!
it just said "use a lambda expression..." and i did it!
>>
>>51914292
The purpose of this paper is literally just to augment DSSM with convolution. It does not compare to any SOTA models of the time and doesn't compare on significant tasks either.
Just stop posting anytime.
>>
>>51914255
put a space after take and before dicks. Same with is and cumshots.
>>
http://arxiv.org/pdf/1103.0398v1

>>51914325
Find out if the pepper is still green anon.
>>
>>51914054
>using length
Absolutely disgusting. Good touch with foldr though since not too many people know how to use it.
>>
>>51914352
I did, but it still prints out as
>take9000dicks

Gonna try double spacing.
>>
File: JUST-.jpg (194 KB, 991x609) Image search: [Google]
JUST-.jpg
194 KB, 991x609
>>51914373
>>51914352
Didn't work ;_;
>>
String[] nums;
float[] hours;
void setup()
{
size(400, 400);
}

void draw()
{
background(0,255,0);
}

void hours()
{
nums = loadStrings("numbers.txt");
hours = new float [nums.length];
for(int i = 0; i < nums.length; i++)
{
hours[i] = float(nums[i]);
println(hours[i]);
}

It's running but it won't print anything. Why is that?
>>
>>51913423
Why not just change it to /pgg/ - Programming General?
>>
>>51914365
(define (length xs)
(foldr (lambda (ayy l) (+ l 1)) 0 xs))

i hope you are happy now.

And yea, if fold/map/filter arent your friends you will always wonder why your code is so long/shit.
>>
>>51914416
Because we don't want webdev faggots who think they're programmers in here.
>>
>>51914416
how about /atg/ - anime traps general?
>>
>>51914416
good idea. how about just /prg/.
>for that matter, /prog/
>>
>>51914426
>webfag hates webfags
>>
>>51914451
good one bro
back to your functional faggotry you go, glorified scripter.
>>
>>51914449
/r/programming?
>>
>>51914362
Now you're getting desperate. Unlike the previous models, which were statistically significantly worse than the competition but could actually keep up, this model at its best performs like absolute garbage compared to the benchmark models chosen, which themselves aren't even the best models listed in the comparison.

I'm through with you at this time. Go get your butt soothed with some cream before you come back.
>>
>>51914416
I prefer /pg13/ programming general for the 13 years old or younger.
>>
>>51914408
Nevermind, another fucking dumb mistake
>>
>>51914437
>tfw my time with /g/ will soon draw to a close
>surprising i've waited this long...

>>>/lgbt/
>>
>>51914255
yeah cause you didn't put any spaces between your numbers and text...
>>
>>51914417
Well Id say its better to be able to write the functions yourself and then use them.
>>
>>51914458
>mad for getting called out
>>
>>51914408
Is println defined? Isn't it System.out.println?
>>
>>51914499
Im a fucking retard, my bad.

("Like this " + right? + " there we go")
>>
File: princess.jpg (60 KB, 602x824) Image search: [Google]
princess.jpg
60 KB, 602x824
>>51914496
>still in the closet after all this time on /g/
>>
>>51914528
not negating that, but if you always implement a length function (without fold) when you actually only need an average function, i would call you autistic.
>>
>>51914054
>You CS student learning racket?
Is there any other reason to learn racket? One would not willingly learn functional programming.
>>
>>51914547
Yeah. Spaces need to be in the strings
>>
>>51914567
>reason to learn racket
there's none
>>
>>51914550
Hey, if they want you, they're welcome to it friend.
>>
>>51914567
If you want to program for oculus rift or be cool like Carmack.
https://www.youtube.com/watch?v=ydyztGZnbNs
>>
>>51914567
>One would not willingly learn functional programming.
hm sure anon.
>>
>>51914567
>racket
>functional programming
Racket is based on the bloatware paradigm.
>>
>>51914683
BLOAT
O
T
N
E
T
>>
>>51914617
Functional programming is for cucks.
>I could fuck my wife
>But that's not thread safe. Instead, we'll just stand next to each other while I imagine fucking my wife
>Also, my wife is probably being fucked by some other guy anyway.
>>
>>51914483
you literally just forgot to call the function you made. Which reminds me, don't forget to keep track of which functions are mark-up for Processing and which one's are actual functions from the Java back-end on that thing.
>>
>>51914567
>>51914617
>>
File: Capture2.png (2 KB, 313x99) Image search: [Google]
Capture2.png
2 KB, 313x99
Can anyone please help and tell my why this shows when I installed 2.6.4? I used railsinstaller prior to that and then overwrote the existing git folder.
>>
>>51914724
>I could fuck my wife
i dont have one...
>>
>>51914724
cucks
u
c
k
s
>>
>>51914683
racket is a language for teaching programming. The bloat is to remove the focus from semantics..
Are you one of those faggots who think assembly is the only way to go.
>>
>>51914746
Yen signs replace backslashes when you change your locale to Japanese which you did to play your gross, pirated adult games you sick pervert.
>>
>>51914799
Assembly isn't really the way to go anymore. At all. It limits you to a single architecture. Unless it's x86/x86_64, will be obsolete one day, and your hard-learned services won't be of use anymore.
>>
>>51913743
I do some bioinformatics work, and while you don't have to knows Perl, many tools and libraries are written in it, which you likely will have to use. I get along fine using Python, but learning Perl wouldn't hurt.
>>
Alright /g/, it's been fun. I've been here for a bit over 10 hours now. I think it's time to turn in. The sun is out. UIghhh...the sun...

jk

sleeping anyways.

Fuck you mod, suck my CoC
>>
File: indians2.png (7 KB, 530x130) Image search: [Google]
indians2.png
7 KB, 530x130
>>51914057
>>51914159
>>51914196
I legitimately thought this was something something indian programmers
>>
>>51913376
> /hpt/
please don't make this a thing.. :(
>>
Recent college grad here. I have projects, but either their scope was too big or I just never bothered to finish them. I only have retail work experience, which is pretty much useless. I only know the basics of C, C++, Python, HTML, C#, PHP, Lisp and Lua. The language I'm best with is Java, and even then, I don't know everything about it. Any recommendations on how to get a job? What libraries/frameworks should I learn? Should I continue to learn Java since I'm most familiar with it? It's not my favorite language.
I applied to a couple places but haven't heard back. Besides being discouraging, it's worrying. I need to get serious about this.
>>
>>51915080
Learn to eat curry and shit in streets correctly, then smear your shit all over your face until it retains a permanent coloration. Apply anywhere, any salary you want.
>>
>>51915050
Why did you reply to the currying post
>>
>>51915105
Indian curry's actually pretty good.
>>
>>51915080
>can you reverse a list in place
>compare two trees
>sort a petabyte of integers
>>
>>51915167
Probably; probably; I doubt I can do that efficiently.
Thanks, I'll try all of this shit out to see if I can do it. Maybe not so much as a petabyte though.
>>
>>51915122
see
>>51915105
>>
>>51915142
I know. I actually like american indian-style curry. It's great!
>>
>>51914255
how will you learn anything if you just copy the code from a book
>>
>>51915520
How are you this stupid?
>>
>>51914255
      System.out.println("OP can take " + var1 + " dicks in his ass!");
System.out.println("OPs fag index is " + var2 + " cumshots!");
>>
Can everyone just migrate to /dpt/?
>>
>>51915808
No :)
>>
>>51915808
only if you sing to me
>>
>>51914384
This is why I use romhustler
>>
how do I code the inclined slopes in Donkey kong from the NES?

I'm sure it's not AABB.
>>
File: combine_images.jpg (80 KB, 1093x348) Image search: [Google]
combine_images.jpg
80 KB, 1093x348
what did i do wrong by translating this pseudocode to python?
instructionsSch = frozenset(["set", "step", "piece", "color", "quantity", "page", "img", "width", "height"])

rSch = frozenset(["A", "B", "C", "D", "E"])

instructionFD = [
(frozenset(["set", "step"]), (["page"])),
(frozenset(["set", "step"]), (["img"])),
(frozenset(["img"]), (["width"])),
(frozenset(["img"]), (["height"])),
(frozenset(["set", "step", "piece", "color"]), (["quantity"]))]

rFD = [
(frozenset(["A", "B"]), (["E"])),
(frozenset(["A", "D"]), (["B"])),
(frozenset(["B"]), (["C"])),
(frozenset(["C"]), (["D"]))
]

def cover(alpha, f):
x = alpha
while True:
o_xlen = len(x)
n_xlen = 0
for fd in f:
beta = fd[0]
c = fd[1]
cset = frozenset(c)
if beta.issubset(x):
x = x.union(cset)
n_xlen = len(x)
if n_xlen == o_xlen:
break
return x

def key(k, u, f):
kset = frozenset(k)
if len(u) == 0:
return k
else:
x = frozenset([])
for c in u:
cset = frozenset([c])
uDifC = u.difference(cset)
kUnion = k.union(uDifC)
coverSet = cover(kUnion, f)
if c not in coverSet:
kUnionC = k.union(cset)
# keyUnion = key(kUnionC, uDifC, f)

# optimization
optCoverSet = cover(kUnionC, f)
uDifCover = u.difference(optCoverSet)
optKey = key(kUnionC, uDifCover, f)
x = x.union(optKey)
# x = x.union(keyUnion)
else:
keyU = key(k, uDifC, f)
x = x.union(keyU)
return x

print "\nset of all candidate keys:"
# print key (frozenset([]), instructionsSch, instructionFD)
print key (frozenset([]), rSch, rFD)
>>
>>51916399
woah is this my chance to be useful?

http://higherorderfun.com/blog/2012/05/20/the-guide-to-implementing-2d-platformers/

also, i think all new post should go to the actual /dpt
>>
>>51916523
Fuck off, shill. This thread is way cooler.
>>
File: Interviewer.jpg (17 KB, 350x244) Image search: [Google]
Interviewer.jpg
17 KB, 350x244
>alright, for this next part, I want you to go up to the whiteboard and write a function that determines the Endianness of the system it's running on
>you can write it in any language you feel comfortable with, but you only have 10 minutes
wat do?
>>
>>51916549
int i = 0xF0
printf("%d\n", i);
>>
>>51916549
int i = 1;
char *j = (char *) &x;
if (*j == 1)
printf("little endian\n");
else
printf("big endian\n");
>>
>codeeval
>click on groups
>suggested groups for you
>/G/
what the fuck
>>
File: pradeepmyboy.png (84 KB, 694x732) Image search: [Google]
pradeepmyboy.png
84 KB, 694x732
>>
>>51916608
B O T
N E T
>>
>>51916608
The master jew knows
You should run for your life
>>
>>51916608
>>51916638
actually I made it. It's full of indians whom I hope are not on /g/.
>>
>>51913522
#ruby
a.inject(0) { |r, e| r += e }.to_f / a.length
>>
>>51913522
import Data.Ratio
import Data.List

avg :: [Integer] -> Ratio Integer
avg l = sum l % genericLength l


ez pz
>>
>>51917121
>>>/trash/
>>
>>51917121
Ah they want me to use a lambda.

import Data.Ratio
import Data.List

avg :: [Integer] -> Ratio Integer
avg = (\l -> sum l % genericLength l)
>>
>>51917141
>hating Haskell
?
>>
>>51917159
\hsart\<<<
>>
>>51917175
oh wow, haskell truly is art.
>>
>>51917175
Good place for Cfags.
>>
I'm past that; I am edge lord master of all Syntax. I will out optimize even your most minimized codes. My self built language and compiler will leave even your shit tier waifu wet. Believe me OP I am a forced to be reckoned with
>>
Why won't this out put the result?
public class GalToLit {
public static void main (String args[]) {
double gallons, liters;
gallons = 10.0;
liters = gallons * 3.7854;
System.out.println(gallons + " gallons is " + liters + " liters.");

}
}


Doesn't out put anything.
>>
>>51917216
You need to convert the ints to strings depending on the language that is.
>>
>>51917182
lmbo
functional faggotry has warped your small fragile mind.
>>
Got an email on my Github email address from a guy doing a survey about how programmers communicate/and collaborate with other programmers. All nice and cool, until I came across this question:
>What is your gender?
The following options are available:
>[ ] Female [ ] Male [ ] Other
That severely triggered my autism, so I replied to his email with the following:
>I won't fill out the survey because of the following question: 'what is your gender?'. I won't bother explaining, but I think you get the point.
He replied back to me:
>We ask for that because gender diversity / lack thereof could be an interesting insight to report. We also provide an "Other" option. What would have been preferable in your opinion?
Any suggestions on what to write back?
>>
>>51917260
Male or Female. End.
Then call him a SJW cuck.
>>
>>51917256
Haskell is enlightening. In many cases it allows you to think of a problem from a different vantage point.
Sometimes it does become a hindrance, however that way it can force you to design your problem in a clean manner.
>>
>>51917300
>design your problem
s/problem/solution
>>
>>51917260
>[ ] Female [ ] Male [ ] Other

Is that it? That's pretty tame desu man. Get a grip.
>>
>>51917240
Java. Should be printing. Double lets me use non-int values so I'm not sure if the mistake is on my part or what.

>>51917260
Write this:
>Only a fool would care about gender diversity when it comes to programming. I didn't know that gender reflected my coding ability, I didn't know that having a dick could mean not getting hired, and I sure as hell didn't know that acting like a pretentious land whale could mean me getting a job if I shout "MISOGYNY!" Oh wait. I did know. I just chose to not give a shit, because a collective of mentally incompetents ultimately wont affect the quality of the programs I write unless I let them. Don't email me again.

public class fuckOff {
public static void main {String args[]) {
System.out.println("I don't always hire people but when I do I make sure they have vaginas");
System.out.print();
System.out.println("Because having a vagina evidently means you're a god at coding");
}
}


>>51917321
The reply is what made it worse. Stop. You know you're shit posting.
>>
>>51917260
This shouldn't matter at all in a survey. Maybe he just wants to find out how many freaks there are on his mailing list so he can remove them.
>>
>>51917273
>>51917321
>>51917363
>>51917409
I let someone else do the talking, so I sent the guy the following link: http://esr.ibiblio.org/?p=6918.
>>
>>51917260
Should have acted offended that he even asked the question, call him sexist and whatnot.
>>
>>51916635
int fac(int n){ 
if (n == 1)
return 1;
return n * fak(n - 1);
}

should probably use long double
>>
File: Untitled.png (14 KB, 668x290) Image search: [Google]
Untitled.png
14 KB, 668x290
>>51917363
It prints on my IDE
Thread replies: 158
Thread images: 20

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.