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

/dpt/ - Daily Programming Thread

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 340
Thread images: 39

File: nene.jpg (279KB, 1280x720px) Image search: [Google]
nene.jpg
279KB, 1280x720px
"I want to make videogames" edition

What are you working on, /g/?
Previous thread:
>>61378912
>>
>>61385654
>ywn be as good as nene at programming
>>
>>61385678
i don't give a fuck as long as i get paid
>>
Please stop this gay ass stutter posting you fucking spastic nonce
>>
@Compiler
inline my function for me, thanks
>>
>>61385762
I really hope your language of choice allows you to force inline things.
>>
>>61385762
The compiler knows better about whether the function should not be inlined.
>>
Any clojure lads, use Figwheel?
Seems neato.
>>
Reading the Haskell Wikibook.
>>
Gentlemen, take note: this is what an arbitrary command execution vulnerability looks like:

elsif msg.match(/PRIVMSG (\w+) :(.*)\r\n\z/)
from = $~[1]
body = $~[2]

# here we will use the console if the message contains colours! ^.^
puts "#{from}: #{body}"
end


Now you might think to yourself: "Wait a second, there's nothing wrong with that. They're just printing arbitrary text received from the Internet onto a terminal that may or may not support ANSI escape sequences." Yes, and that is exactly why the program is vulnerable.

https://marc.info/?l=bugtraq&m=104612710031920&q=p3
>>
>>61386068
Is there any webshit security reads you recommend?
>>
>>61386068
+1
>>
>>61386094

Off the top of my head, no. But as some general security advice, sanitize the fuck out of everything, and trust nothing.
>>
>>61386118

>T-There is no escape s-sequence that can't be fixed with reset >.<
No, I mean depending on the terminal it's used on, arbitrary code could be executed by means of the ANSI escape sequence. While the article I linked is a bit old, and the specific terminal vulnerabilities mentioned have been patched since then, there is still the potential for them to be compromised in other ways. It's a potential attack vector if you have any vulnerabilities in your terminal emulator.
>>
File: selenium.png (8KB, 772x99px) Image search: [Google]
selenium.png
8KB, 772x99px
Anybody has an idea how to check this radiobutton with selenium ? It has no id name or class to really identify it by so it seems a bit tricky.
>>
File: tethering.gif (2MB, 581x433px) Image search: [Google]
tethering.gif
2MB, 581x433px
>"I want to make videogames" edition

Well this is awkward. Question is vidya related.

I'm working on a game where the player "tethers" to a robot with a rope. We've created a verlet fixed constraint to make the rope and keep the player and the robot connected. Problem is, there's a lot of drag that gets introduced when this happens.

If I change the compensation so that the player is not affected by the fixed constraint system, the player doesn't suffer any drag, but then the player can move beyond the ropes range if the robot is locked into the ground (for puzzle reasons), which defeats the purpose.

As a temp solution, we've given the player a movement multiplier while tethered, which works, but feels real strange to play with. I was wondering if /g/ knows a better way to go about it?

[spoiler]inb4 >unity[/spoiler]
Here's the verlet calculations:

void UpdateLink(ref Vector3 _linkA, ref Vector3 _linkB, float _compSpeed)
{
Vector3 delta = _linkB - _linkA; //get offset
float deltasqrlength = delta.sqrMagnitude; //get sqr magnitude for faster distance checking

if (deltasqrlength > 0 && deltasqrlength > maxDist * maxDist)
{
float deltaActualLength = delta.magnitude;//get the actual distance for calculation purposes

//calculate the distance the segment needs to move to
float diff = (deltaActualLength - maxDist) / deltaActualLength;
_linkA += delta * _compSpeed * diff;
_linkB -= delta * (1 - _compSpeed) * diff;
}
}
>>
File: 00066086.jpg (17KB, 400x300px) Image search: [Google]
00066086.jpg
17KB, 400x300px
A demoscene prod for Assembly 2017. A friend of mine does the music track and I code, direct etc.

https://github.com/luutifa/openglpractice
>>
File: d3e5154175966a18938c44e334861257.jpg (125KB, 736x1097px) Image search: [Google]
d3e5154175966a18938c44e334861257.jpg
125KB, 736x1097px
I need some faggot to help me find a solution for my school work. Will you be that faggot? [spoiler]i have cute feet[/spoiler]
>>
>>61386451
I don't care about your feet.
>>
>>61386298
ok I figured it out, for anyone interested I simply did it with find_element_by_css_selector was pretty straight forward

 elem=self.browser.find_element_by_css_selector("#input_attached_optvar_use_prenumber > div[class='left'] > label[class='custom-radios'") 
>>
>>61386495
what's selenium and what do you use it for?
>>
>>61386451
Post soles and I will help
Are you a boy or a girl?
>>
#include <iostream>

template <int A, int B, int C>
class foo {
public:
static void print () {
foo<A, B - 1, C - 1>::print ();
std::cout << 15 * A + (6 * B + 10 * C) % 15 << std::endl;
};
};

template <int A>
class foo<A, 0, 0> {
public:
static void print () {
foo<A - 1, 4, 2>::print ();
std::cout << "fizzbuzz" << std::endl;;
};
};

template <int A, int B>
class foo<A, B, 0> {
public:
static void print () {
foo<A, B - 1, 2>::print ();
std::cout << "fizz" << std::endl;;
};
};

template <int A, int C>
class foo<A, 0, C> {
public:
static void print () {
foo<A, 4, C - 1>::print ();
std::cout << "buzz" << std::endl;;
};
};

template <>
class foo<0, 0, 0> {
public:
static void print () {};
};

int main () {
foo<6, 0, 1>::print ();
return 0;
}
>>
>>61386516
it's basically a framework that automates stuff you do in the browser. so it basically clicks through websites for you, can input text and check boxes basically everything you can do to a webpage.

I use it to automate restarting the WLAN for my parents and also to automatically set up their phone in the router incase it doesnt work (which has happened before). I do that so I dont have to explain to my mom on the phone how to access her router configuration program and do all that on her own because she isnt good at that sort of stuff.
>>
>>61386551
Now do it in a non shit language
>>
this is the most shameful, autistic display I have ever witnessed
>>
>>61385654
how did she manage to turn a for-each loop into an infinite loop?
>>
>>61386586
>for-each
only shit languages have this
>>
>>61386596
>he enjoys manually writing
for (int i = 0; i < thing; i++)
[/code

instead of just
foreach(i; thing) 
>>
>>61386596
Agree, proper languages have map instead.
>>
>>61386613
>being this much of a brainlet
>>
Best way to make a small GUI for a python program ? Is Tkinter the way to go ? I really only need a Window with 2 or 3 buttons that call functions nothing more.
>>
File: Capture.png (3MB, 1884x887px) Image search: [Google]
Capture.png
3MB, 1884x887px
/dpt/ what browser should i use until Netrunner gets usable in 2050?
>>
>>61386613
It's a waste of time unless you know you need to execute sequentially.
>>
>>61386633
Its late and i wasnt paying attention.
>>61386660
>his foreach isnt flexible
>>
>>61386653
Firefox so you can prepare for Rust.
>>
>>61386670
Ive tried servo, buts its far from usable right now.
But i really dont want to support mozilla desu.
>>
>>61386650
Yep it's pretty easy
>>
File: snippet.png (27KB, 865x454px) Image search: [Google]
snippet.png
27KB, 865x454px
>>61386613
Or you could just use a snippet
>>
File: 1496114039510.jpg (136KB, 960x1280px) Image search: [Google]
1496114039510.jpg
136KB, 960x1280px
>>61386688
>Kate
>>
>>61386679
Chrome is botnet. Firefox is SJW. Pick your poison.
>>
>>61386700
>pleb
>>
File: code.jpg (168KB, 1177x831px) Image search: [Google]
code.jpg
168KB, 1177x831px
What language is this?
>>
>>61386795
C++
>>
>his language has more programmers than programs
>>
>>61386853
what did xir mean by this?
>>
Who here programs on ((linux))?
>>
>>61386893
>>>/pol/
>>
>>61386893
I program on GNU/Linux, not Linux. I don't believe Linux contains a compiler, or even a text editor.
>>
>>61386451
Where are the feet you fag? I am waiting
>>
>>61386795
sooples
>>
>>61386893
Linux is a kernel, faggot
>>
>>61386901
GNU/Linux is Linux.
In fact, as far as anyone except RMS and LT is concerned, GNU is basically Linux, and Linux itself is more specifically "the Linux kernel." Android isn't Linux because it's not GNU, it's "the Linux kernel" with Google shit instead of the "rest" of Linux. Whereas Mac OS and Hurd basically are Linux, because they're GNU.
>>
>>61386950
>Android isn't Linux because it's not GNU
?
>>
If I run this program from Eclipse everything works fine, it shows the UI and the buttons run my functions.

However if I just go into the explorer and run the main.py file it doesnt seem to do anything. What am I missing here ?

root = Tk()
root.wm_title("Router Config")
root.resizable(width=FALSE, height=FALSE)

class routerConfig():
def __init__(self):
print("router config loaded")

def restartWLAN(self):
#DO SOMETHING

def setupPhone(self):
#DO SOMETHING

def main():
cfg = routerConfig()

button_wlan = Button(root, text="WLAN neustarten", command=cfg.restartWLAN)
button_phone = Button(root, text="Telefon einrichten", command=cfg.setupPhone)
button_wlan.grid(row=3, column=3)
button_phone.grid(row=3, column=4)

root.mainloop()

if __name__ == '__main__':
main()
>>
>>61386893
I think (((Linux))) is the majority here
>>
>>61386950
>Android isn't Linux
>But MacOS is Linux
The sad part is, I don't know if you are joking, that's how low the standard of /g/ is
>>
>>61386970
what do you mean doesnt do anythinkg?
>>
>>61387017
console opens and instantly closes, UI doesnt get shown.
>>
>>61387028

because it isnt expecting any input from the user , so it closes
if you want it to stay open , add a
 input() 
somewhere
>>
>>61386964
The point I'm making is that as far as plebs who don't program are concerned, GNU is called "Linux," and Linux is called "the Linux kernel." In their eyes, GNU is so ubiquitous to Linux that anything which has GNU on it is Linux, and anything that doesn't isn't, kernel be damned. So Android is "a non-Linux OS on the Linux kernel" and Hurd is "Linux on a different kernel."
My thesis here is that in language, usage ultimately decides correctness. Screw accuracy to the developers' original intentions, we should be calling these things what everyone else calls them. Sorry RMS, your software is now officially called "Linux." Sorry LT, your software isn't well known enough to have a name of its own independently from RMS's software.
>>
>>61387016
I'm not. But I'm not an idiot either. Just a language realist.
See: >>61387051
>>
>>61387044
maybe I am understanding this wrong but isnt the point of root.mainloop() basically exactly that ? I thought that was TKinters way of keeping the window open and waiting for user input ?
>>
>>61387016
OSX is also BSD
>>
>>61387082
OSX is actually NT
>>
>>61387077
try this program
from tkinter import *
from tkinter import ttk

root = Tk()
loop = 0
block = BooleanVar(root, False)

while loop < 2:

print ('loop')

def user_data():
user_input = data.get()
print (user_input)
block.set(False)

lb=ttk.Label(root, text="Enter data")
data=ttk.Entry(root)
bt=ttk.Button(root, text='Ok', command=user_data)

lb.grid(row=0, column=1)
data.grid(row=0, column=2)
bt.grid(row=0, column=3)

block.set(True)
root.wait_variable(block)
loop += 1

print ('left loop')
root.mainloop()
>>
>>61387070
>I'm not an idiot either
Sure.
>>
>>61387087
NT is actually Multics
>>
>>61387095
see: >>61387051
>>
>>61386586
>using DK studio
absolute disgusting
>>
>>61387094
also doesnt show if I simply doubleclick the .py file. when I run it through Eclipse everything is fine though. any ideas why this is ?
>>
>>61387113
Yeah, it was a response to your mindless blabbering.
/g/ is dead.
>>
>>61387135
What was? What I just linked you to?
Because you'd be wrong. That was me as well.
>>
>>61387094
>>61387130
I have Python 2.7 and 3.5 on this computer so maybe it is running the wrong version by default ? can I somehow specify which version Windows should use for that script ?
>>
>>61387130
>also doesnt show if I simply doubleclick the .py file

you want the program to open the GUI when you click it two times?

on linux, you have to do
 chmod +x your_program.py 
>>
>>61386298
you can match on the i18n:id with the css selector
>>
>>61387147
maybe
import sys

if sys.version_info[0] < 3:
raise Exception("Python 3 or a more recent version is required.")
>>
>>61387141
>That was me as well.
I know, you have reached the peak of idiocy, congratulations on your second-to-none stupidity.
>>
>>61387130
to add to >>61387150
another thing you have to do if you want it to run when you double click it is add a shebang at the top
#!/usr/bin/python3

if you do both those things it should work
>>
>/g/ - Technology
>>
desu, most of the influx shitposting are normies or quasi-normies.

Hows your project, going, /dpt/?
>>
>>61387194
>>61387167
>>61387150
ok so what I did is instead of doubleclicking it I just opened the console, went into that folder and did

 python main.py 


and that works, so I pretty much know what the problem is now.
>>
>>61387298
no shit anon
>>
>>61387290
mostly finished
now in the eternal adding features phase
>>
Reminder that software, like anything, is properly called whatever the majority calls it, not what it's called by whoever made it.
For example, GNU is properly called Linux (whether it actually runs on Linux or not), and Linux is properly called the Linux kernel.
So sayeth the almighty plebs, and so it be the truth.
Spoken language is governed by majority rule with no regard to anything else.
Besides, Richard Matthew Stalin gave up his right to decide what Linux (reminder: that means GNU) is called when he declared it free-as-in-speech software.
>>
>>61387290
Haven't even started it, I can't resolve one of the inconsistencies in the design satisfactorily.
>>
>>61387329
What'd you make?
>>
>>61387338
irc bot in common lisp
>>
>>61387324
still told me that I am not running the wrong python version on it because
 python --version 
tells me it's 3.5 which it should be so it's not like this didnt tell me anything. but yeah the rest was kinda obvious.
>>
Isn't there some language where I disprove the need for certain logic branches in an algorithm?
I remember doing something like this before but searching turns up nothing.
>>
>>61387434
prolog?
>>
how do i learn heskel
pic relate
>>
>>61387540
https://en.wikibooks.org/wiki/Haskell
>>
>>61387540
>pic
What fucking autistic bullshit is this
Are you the rustfag who kept speaking in creepy nonsense poetry
>>
>>61387540
types
your posts indicate you already know how to spew 1 GB of garbage per second
>>
File: 1405247786630.jpg (23KB, 343x374px) Image search: [Google]
1405247786630.jpg
23KB, 343x374px
dpt it's happening, I've got my first developer interview on Monday.

Any advice would be greatly appreciated.
>>
>>61387697
be a good talker
>>
>>61387697
practice?
>>
>>61387697
Bring your urine jar; show it to them as proof of your dedication to programming.
>>
>>61387449
Yeah I guess it was prolog since that's the only logic language I know.
>>
What do you use a hash map for?
When did you last use a hash map?
What flavor of hash map do you use?
>>
>>61387739
do you think: "man this cooment is funny! i'm gonna post it for the lulz" before posting?
>>
>>61387766
>What do you use a hash map for?
Function on a compact space.
>When did you last use a hash map?
Last Thursday.
>What flavor of hash map do you use?
Mint.
>>
>>61387697
Show them you're passionate about programming.
>>
>>61387766
>What do you use a hash map for?
When I don't know the access pattern yet.
>When did you last use a hash map?
Today
>What flavor of hash map do you use?
Do you mean things like if you store the buckets locally or if it's a linked list? I store an array of keys separate from an array of values. How many values per hash i have varies but it's usually 5 with a fallback on a linked list.
Also associative array is probably the word you're looking to ask about.
>>
>>61387697
If you think you're talking to a HR person rely on your 'merits'. If you're talking to a programmer show how interested you are in whatever topic you feel familiar with that might come up.
Try to read the flavor of programmer too. There's pragmatic programmers who don't much care for your fancy algorithms but rather wants someone that's good at writing api and being able to deal with eventualities.
If you have an academic programmer they will ask you about the CS stuff. I don't know how to handle those other than being right and showing a slight sign of being a perfectionist.

But most importantly just don't be awkward.
>>
>>61385654
>"I want to make videogames" edition

Actually, I've been thinking of making an old-school text adventure for fun.

Any good strategies for incorporating large amounts of text in a program? I was thinking something like running all the text through some compression algorithm, including the compressed binary into my program, then extracting it into some kind of string lookup table during runtime.
>>
>>61387975
Maybe a good old Huffman coding is enough for you, maybe not.
>>
>>61386596
>maintaining state date for each iteration

satori is a long way off for you my son
>>
and the real question is: redux vs relay vs apollo vs .. ?
>>
>>61387975
I doubt the text will be problematically large. You can just append the executable with the data as is and have a marker for where the appended data starts. If you want a single executable solution.
The simpler option is just to have it come with a text file that you read in at load and string in the program reference.
But they're not significantly different in difficulty.
>>
File: KermitMFC.jpg (109KB, 743x574px) Image search: [Google]
KermitMFC.jpg
109KB, 743x574px
>>61387766
/dpt/ am I maximum retard?
>cannot comprehend hash maps
I get the concept, you have an array of pairs, you hash the lefthand side of the pair to get an array index, you go there, either your array is actually an array of lists of pairs and you add to the list or it's not and you start jumping around until you find an empty spot, in the latter case if the ratio of data to spots exceeds a certain threshold you grow the array and rehash all the pairs, right?
My problem is this.
Universal double hashing.
You need to pick two hash functions randomly from some pool of hash functions that are all valid.
How do you do that? How can you just up and pick two hash functions? Where do you even get the pool from? Writing one hash function seems hard enough.
And then, not only that, but they need to be coprime to the table length.
Do they?
Because I know in linear probing and quadratic probing that's a problem. But with hashing, wouldn't the coefficient be more unpredictable / pseudorandom? So would having it be a coprime actually be unnecessary?
And even if so, once again, how do you actually choose the hash functions? How do you define a whole pool of hash functions and then just choose two out of it?
Speaking of which, I've heard you should actually pick the two hash functions from two pools defined completely differently. Is this true and why?
Also, if the coefficient is completely unpredictable, what happens if an insertion operation fails? Let's say it hasn't even tried all the spots, it just fails anyway because all the spots it did try were occupied and then it just looped back around to the first spot it tried without having tried them all. The dreaded situation with linear and quadratic probing. Seems considerably less likely with double hashing, but still possible, no?
If that happens, should you just immediately grow the table, without regard to load factor?
Also, is there some point where if the load factor gets low enough, you should shrink the table?
>>
File: 1499648231270.jpg (30KB, 696x481px) Image search: [Google]
1499648231270.jpg
30KB, 696x481px
>>61387915
>>61387973

Thanks a lot boys.
>>
>>61388055
dumb frogposter
>>
>gitlab is down
AAAAAAAAAHHHHHHHH I wanted to push some changes I made.
>>
>>61388086
be sure to practice your fizzbuzz skills kid.
>>
Is this ``elegant''?

import os
import time
import sys

def _SLEEP(t):
return lambda: time.sleep(t)

def _SAY(s):
return lambda: os.system("espeak " + s)

REPS = 1

loop = [
_SAY("start ankidroning, my dude. " * REPS),
_SLEEP(60 * 5),
_SAY("stop ankidroning, my dude. " * REPS),
_SAY("start working on xpr, my dude. " * REPS),
_SLEEP(60 * 30),
_SAY("stop working on xpr, my dude. " * REPS),
_SAY("relax for 5 minutes, my dude. " * REPS),
_SLEEP(60 * 5),
_SAY("stop relaxing, my dude. " * REPS)
]

i = 0
while True:
loop[i % len(loop)]()
i += 1


>select the right captcha
>fucking normies don't follow exactly the instructions, make me fail it
>>
>>61387102
It's Mica.
>>
>>61387434
>Isn't there some language where I disprove the need for certain logic branches in an algorithm?
Literally ATS (or rather, ATS2).
>>
>>61388224
Not really,
my dude.
>>
File: 1.png (236KB, 884x589px) Image search: [Google]
1.png
236KB, 884x589px
>>61387975
It sounds like you're making this more complicated then it needs to be but it sounds interesting. For maximum autism I'd probably maintain a graph of strings. Then I'd split up the graph into chunks. And then on every state transition I'd check if you're close enough to the edge and if so then decompress the next chunk. Maybe try to figure out some strategy to attempt to keep likely chunks in cache.

glaros.dtc.umn.edu/gkhome/fetch/papers/mlJPDC98.pdf
>>
>>61388224
No, use itertools.cycle instead of the shitty loop you have. also use functools.partial instead of lambdas
>>
>>61388295
>itertools.cycle
cool
>functools.partial
why
>>
https://youtu.be/fHNmRkzxHWs?t=2707
Why is C++ so bad?
>>
>>61388314
>tfw this is PHP's fundamental data structure
>>
>>61388365
Ordered map?
associative arrays aren't the problem. It's the way C++ decided to spec them.
>>
>>61388374
But why?
>>
>>61388404
No clue.
>>
>>61388314
speaking of shitting on C++, what does /pgg/ think of Jai?

https://github.com/BSVino/JaiPrimer/blob/master/JaiPrimer.md

Though I think Johnathan Blow makes a shit games designer, he seems to be on top of his programming knowledge.
>>
>>61388468
I like it. I'm wet for arbitrary compile time code execution, but dpt seems to not like that
>>
>>61388468
>shit game designer
How. Did you not play the best puzzle game of all time?
I love his language. It has so many things I wish C++ had. And it compiles fast. Which is great.
>>
>>61388468
Most of it is good. I don't get how RTTI and reflection could help performance in any way, especially at it wants to be a "better C"; I believe there are better ways to achieve the same results, such as compile-time attributes.
>>
>>61388224
>"my dude" meme
>originates from "it is wednesday my dude"
>"it is wednesday my dude" is a frog meme
dumb frogposter
>>
>>61388560
>it compiles fast.
I'd say that's an understatement. It compiles a 50KLOC project in single digit seconds, *from scratch*. Compiling the whole thing. And I seem to remember that a significant portion of this is spent on the windows linker, and will be optimized away when he builds a linker.
>>
>>61388579
>RTTI
My understanding of it is that that's intended to work with the compile time execution/metaprogramming. But it'd be silly to constrain it to just compile time.
>compile time attributes
Why are these better?
>>
char* img_name = calloc(255, 1);
if(argc > 1)
img_name = argv[1];
else
img_name = "image.ppm";
FILE* instructions = fopen("instructions", "r");
FILE* image = fopen(img_name, "w");
freopen(img_name, "a", image);
free(img_name);

Why does this give me a runtime error?
*** Error in `./a.out': free(): invalid pointer: 0x0000000000401040 ***
Aborted (core dumped)
>>
>>61388626
You reseated the pointer. Use strcpy to copy the string from argv[1] to img_name.
>>
>>61388650
alright, thanks
>>
>>61388626
>img_name = argv[1]
You probably wanted a memcpy here.
Now you're trying to free the argv[1] if you pass the program an argument and free the static string "image.ppm" if you didn't.
I just wouldn't free in this circumstance. OS will clean it up. Freeing is a waste of time for 1 time allocations.
>>
>>61388659
Or just don't even bother allocating unless you want to keep a copy. You already have argv[1], just copy that.
>>
>>61388674
oh you're right, that would be better
>>
Should every function get a comment?
>>
>>61388719
No. Unless you're doing some doxygen stuff.
>>
>>61388626
Don't use calloc. Use malloc.
>>
>>61388798
He shouldn't be using either.
>>
>>61388811
You're probably right. I'm just piss off by that calloc function which usually must never be used.
>>
File: 1499120789580.jpg (198KB, 500x375px) Image search: [Google]
1499120789580.jpg
198KB, 500x375px
>>61387697
Just chill. Your skills will either be good enough or not. Not much you can do about that.

A large part of the interview process is to see your personality and if you are the kind of person that you would go and grab a beer with. If you pass the beer test even if your skills are subpar you have a higher chance of being hired over others as most ppl in tech industry are kinda autistic.
>>
>sweating oriented design

I do agree with him tho
https://www.youtube.com/watch?v=rX0ItVEVjHc
>>
>>61388908
He is a great sweaty guy, and I learned a lot from this talk.
Changed how I program.
I don't think about the structure of my program first anymore.
>>
>>61388908
>stressed to hell game developer
>game releases https://www.youtube.com/watch?v=qWJpI2adCcs
>Loses 40 pounds or something and looks way more collected.
Why do people wanna be game devs?
>>
>>61388979
>Why do people wanna be game devs?
Because you can work on something you like?
With many other programming jobs people don't really care about the product aside from a professional perspective.
>>
>>61389033
Yeah but at the cost of your health?
It'll probably cost him years of his life in the long run.
>>
>>61389056
Yes, even at the cost of health, finances or whatever else.
You have to make sacrifices for some things.
>>
>>61389084
>finances or whatever else.
I'm fine with that.
But health is important. I couldn't do that.
>>
File: IMG_0751.jpg (120KB, 750x750px) Image search: [Google]
IMG_0751.jpg
120KB, 750x750px
>>61385654
Any idea as to how difficult it would be to write a stock trading program? Not something advanced for making money off of nanoseconds or whatever, but just enough to automate so it can generally turn a small profit. Any recommended reading on the subject?
>>
>>61389113
You won't be able to outperform an etf. Whatever you do, high frequency traders located in servers meters from the exchanges already did, and better.
>>
>>61389113
How do you plan on getting the data?
>>
>>61387290
Slowly, but surely. I plan on giving it my attention for most of the day, but I always end up just programming for an hour or 2 before going to bed.

Currently making a bullshit mario clone in SDL to learn C++, get used to designing a programming before programming it, and attempt to follow some typical Design Patterns.
>>
>>61388908
>that old luddite that tries to argue with him
>that pythonista who makes an inane comment
>that sheer look of disgust on his face at the end
What a good talk.
>>
>>61389113
story on this image? im a little spooked desu senpai
>>
>>61389182
>those people who don't have a clue they're mainly working on x64/x86 processors thinking they have a super diverse set of platforms
It's disturbing. I don't blame people for hating C++ programmers.
>>
>>61388468
very promising

>>61389092
spoiler: you're going to die
>>
>>61388908
cppcon have some really good talks.
>>
>>61389113
Pretty difficult especially if you want to do it on the side. Firstly, it's hard finding inefficiencies (there are some markets where it's easier but you take on additional risk). Secondly, your fund is probably so small that the extra yield doesn't really make a difference (+0.5% surplus on 250k is about 1k). Thirdly, transaction costs will probably eat your surplus.

If you want to dip your toes in algotrading I can recommend quantopian.com
>>
>>61389412
This is not a normal talk.
>>
>>61388908
He could give this talk at nearly every conference and destroy the audience.
At least sepples fags have the ability to fall back to writing C/ASM.
>>
File: engineer_syllogism_2x.png (86KB, 1353x526px) Image search: [Google]
engineer_syllogism_2x.png
86KB, 1353x526px
>>61389418
>quantopian.com
I'm forcing myself to ignore this. I already know how it would end.
>>
>>61389296
She's blind and has a condition where the sun will really fuck her up, so she can't go outside at all, she lives in an apartment alone and her computer is her only connection to the outside world, or any stimuli at all for that matter
>>
File: 1469418388643.jpg (8KB, 250x238px) Image search: [Google]
1469418388643.jpg
8KB, 250x238px
>>61388908
>code is about data
>spends the rest of the talk on L2 cache misses
>>
>>61385654
Currently trying to go through K&R's C book, and I'm having trouble with bit manipulation:

unsigned getbits(unsigned x, int p, int n)
{
return (x >> (p+1-n) ) & ~(~0 << n);
}


I get what the ~(~0 << n) part does (makes the rightmost n bits 1), but I'm just a bit confused on the (p+1 -n) part. (the book says 'getbits(x, 4, 3) returns the three bits in positions 4, 3, and 2)
When p == n, you still shift x by one. Am I missing something here? Are bits 0-indexed?
>>
>>61389643
kek
>>
>>61389759
>Are bits 0-indexed?
yes
>>
>>61388979
some people unironically like fuckedup crunches, my homie from gamedev told me he "performs better when cornered" and comes out "battle-hardened" after

a light form of masochism or something, idk
>>
>>61389643
Caching is a big deal though

its a difference of gigbatyes for seconds to a few kbs just for a request
>>
>>61389643
>how that data is transmitted isnt important
>especially when working with shit hardware like consoles
>>
>>61389643
Dumb frogposter.
It's not just about cachemisses. It's a general idea about respecting the platform and not the software ether.
>>
Me and my friends have been asked to make a carpool app. For the selection of the itinerary, we want people to create something like this
>https://www.carpoolworld.com/carpool_list_cities.html?country_code=USA,US&ordered_by=popularity

How do we get the data?
>>
>>61390205
You need to start using a serverside programming language. You can't do that with plain HTML.
>>
>>61390205
Google maps or the facts?
>>
>>61389849
Alright... Thanks
>>
>>61386368
Don't know unity/much gamedev at all but... Isn't the problem that the robot's really heavy/has a high coefficient of friction relative to the player? So keep the player constrained by the rope but make it easier to pull the robot (from the robot's side, not the player) when it's not locked to the ground or otherwise caught on something.

If the robot needs that really high mass, it could be something that effectively boosts the force calculations when the player's pulling it (by adding to velocity manually or something similar)
>>
>>61390245
That's what we are going to do. We didn't decide which one to use yet though.
>>61390257
Google maps.
>>
Is there much more of a reason to shit on gamedev other than the community or 15 year old retards that want to make call of duty in a week? I worked on a game at a hackathon type event once and it was a pretty interesting and fun thing from a programming and problem solving standpoint.
>>
>>61390423
Maps has an API: developers.google.com/maps

On carpoolworld they use markers and polylines
>>
>>61390441
No, /g/ / /dpt/ hate games because theyre inherently windows.
Games are the most interesting programming, desu.
>>
>>61390441
I know a guy who worked for EA:

>low pay
>high stress
>long hours
>incompetent coworkers (most people have less than 2 years experience)
>terrible codebase
>>
>>61390474
>>>/v/
>>
>>61390509
I know a guy who worked for MS

>low pay
>high stress
>long hours
>incompetent coworkers (most people have less than 2 years experience)
>terrible codebase
>>
>>61390518
They stretch what you have to do the most next to kernel dev, and they require the broadest skill set.
>>
>>61390465
I see. Thanks.
>>
File: ?.gif (458KB, 256x256px) Image search: [Google]
?.gif
458KB, 256x256px
>>61390509
>>61390533
really activates the almonds
>>
Posted here earlier this week.

See >>61296443

TL;DR university programming 101 course gives all my stuff A+ 100/100 "Good Job!". I know I am not that good.

I am begging you /dpt/ please criticize my work. Please tell me how to improve. I am a shameful cargo cult programmer.

https://pastebin.com/cw4sajaQ

Requires http://mcsp.wartburg.edu/zelle/python/graphics.py
>>
>>61390834
Getting a A+ on programming 101 doesn't mean you're "that good". It means you're not hopelessly shit.
>This is where the shooting happens. Shooting ends when the user has Loosed all their arrows.
*loosed
>>
>>61390549
>>61390465
So, how can we specify parameters and add this to an app after getting the key?
>>
>>61390834
How do we know what the point is here?
>>
>>61390917
>Getting a A+ on programming 101 doesn't mean you're "that good". It means you're not hopelessly shit.

That's what I was trying to say. I am not good. I am bad. I want to improve.

>>61390937
Sorry. User shoots 5 arrows at a target, score the arrows, has to use graphics.py.
>>
>>61390965
What I'm saying is there is probably no room for improvement upon 101 exercises. You probably did it perfectly within the constraints of the task. Do something more complex if you want to improve.
>>
>>61390998
>101 exercises
110 actually, my bad, typo.

>You probably did it perfectly within the constraints of the task.
I realize I accomplished the objective, but (AFAIK) I had to abuse global to do so.
>>
>>61390834
It's pretty good for a beginner. Here's my critique:

Line 22: win is global. Would be nicer with dependency injection
Line 3, 12, 24, etc.: You can use docstrings instead (PEP 257)
Line 28, 29,41,45,66,68,74,76,78: get rid of globals
Line 32,35: return doesn't need brackets
Line 50-63: You could create a function which takes the arguments and draws the circles
Line 87: Don't use i for objects, use something more descriptive: target_object or whatever
Line 73: Given that you just count down from your arrows each iteration and you don't use them overwise you could write something like for _ in range(arrows):
Line 38: The main() is too long. A good measure is a function shouldn't be longer than your head
>>
File: verybigcock.png (31KB, 696x508px) Image search: [Google]
verybigcock.png
31KB, 696x508px
>>61389759
Fun assignment, anon.

Yeah, bits are 0-indexed. BTW, p is the n-th bit counting from the very right.
>>
>>61391052
>t. python programmer
Basically ignore this advice unless you program in python and surround yourself with brainlets.
>>
>>61391176
(defvar brain (let ()))
>>
Haskell or Idris for new development?
>>
>>61391205
C
>>
>>61391205
depends if you want to get anything done or not
>>
>>61391052
Thank you!

>Line 28, 29,41,45,66,68,74,76,78: get rid of globals
I'd love to get rid of them, but I get errors that I can't think of any other way to fix if I do. Case in point, if I don't call global for PoI under
while arrows != 0
I get a name error.

>Line 50-63: You could create a function which takes the arguments and draws the circles
Isn't that what .draw is doing?

>>61391176
Please, post your brain-chad advice.
>>
>>61391205
Neither
>>
File: 1499367493752.png (143KB, 500x700px) Image search: [Google]
1499367493752.png
143KB, 500x700px
>>61386378
I remember your name from this years mooc.fi programming course, how did it go, got a spot at Helsinki university or nah?
>>
>>61391220
I want correct code.

>>61391218
Not enough C developers around

>>61391251
What do you recommend instead?
>>
>>61391292
then use Idris
and write everything yourself
>>
>>61391228
>Please, post your brain-chad advice.
Don't program in python. Stop doing pointless object wrapping. Do your courses and look for a job instead of graduating from a worthless education that teaches you python. If you get a job you're way ahead of anyone in class just by having had a software job.
Yes, regardless of this being programming 101 this is true. Maybe you can't prove yourself to interviewers, but the experience will no doubt help.
>Isn't that what .draw is doing?
What he means is for you to make a function that does
def drawCircle(args):
circle([explode the args here]).draw()

So your calling sites can be
drawCircle(180, 180, 20, 'red', 8)

Instead of
ring = circle(180, 180, 20, 'red', 8)
ring.draw()


But frankly I'd just recommend you to not introduce another complication in your program and instead just call the draw function directly on the newly constructed object, also I wouldn't assign the objects symbols for no reason.
So write:
circle(180, 180, 20, 'red', 8).draw()

Though I don't use python. I'm assuming it can do this.
>I can't do without globals
I don't know enough python to help you get rid of them but pass them by reference to the function, if that means anything.
Otherwise don't worry about it. Just remember that in instances like this you'd rather not have globals.
>>
File: collision-detection.png (331KB, 942x2160px) Image search: [Google]
collision-detection.png
331KB, 942x2160px
>>61385654
Hey /dpt/ I wrote this AABB collision resolver for my minecraft clone. Any tips on improving it? I don't think there's any glitches but the code could be simplified. It doesn't really have a noticeable performance penalty at the moment, but cheap optimizations would be good.

Uploaded as an image because there's Lots
a Irritating Superfluous Parentheses.

Here's how it's used in the code
(let-list (x y z) (resolve-collisions-ordered boringworld x dx y dy z dz)
body ...)


>>61391043
Globals are not evil. Don't be dogmatic.
>>
>>61391355
>So write:
>
circle(180, 180, 20, 'red', 8).draw()

Actually looking at your code his suggestion is simply bad because you're later doing
 target = [bullseye, ring_4, ring_3, ring_2, ring_1]

Leave things as they are.
>>
>>61390834
Kind of mad nobody helped you last thread when you have been pretty nice, so I'm going to try to clean up some bits

https://pastebin.com/zwg4pXfk
>>
File: retard.jpg (12KB, 298x379px) Image search: [Google]
retard.jpg
12KB, 298x379px
If almost all programming languages are based on C, what is Rust written in?
>>
>>61391499
Rust is based on OCaml
>>
File: scr.png (149KB, 1680x1050px) Image search: [Google]
scr.png
149KB, 1680x1050px
>>61385654
>What are you working on, /g/?

Exploring the deepest, darkest corners of Racket (゚Д゚;)
>>
>>61391443
Also score check should be inside the circle class but I didn't fix that, I just tried to make a cleaned up version of the same code

>>61391407
Is most of the effort of lisp programming keeping track of lots of list operations that are inside your expressions, which would be basic syntax in many other languages? I thought I was a bad lisp programmer when I was writing my code but it looks like you do more or less the same kind of thing in yours
>>
Why is Python so popular?
>>
>>61391575
It just werks.
>>
>>61391499
Rust is written in Rust. It was originally written in OCaml.
>>
>>61391560
Generally the goal of lisp is to reduce algorithms to list operations, so managing your data structures is managing your algorithms.

My data structures are a little complex in this case because I wrote this in like 3 hours, and went through a lot of ways to resolve things.
>>
File: Screenshot-5.png (105KB, 1366x768px) Image search: [Google]
Screenshot-5.png
105KB, 1366x768px
>>61391544
What is the font you're using?
>>
Why is programming beyond the tty so much more autistic
Why can I not just have a standard library function that allows me to capture keyboard input directly and draw shit on a window
>>
>>61391355
Thank you.

>look for a job instead of graduating from a worthless education that teaches you python. If you get a job you're way ahead of anyone in class just by having had a software job.
I've had (non-programming) IT positions before. I don't think I'd have much luck landing a programming position with almost 0 payed programming experience.

>>61391443
Thank you.

>>61391575
IMHO friendly error messages for simple things. You can teach yourself the bare-basics from nothing but error messages.
>>
>>61391636
Just use SDL
>>
>>61391645
>Thank you.
Note:
>>61391416
If you didn't see it.
>>
>>61391628
audimat mono
>>
>>61391609
I see... but in Haskell you're more or less doing that as well and I've found the syntax/mechanics way more expressive for the same thing (currying by default, great pattern matching, lots of list related operators). Granted, it comes with a lot of other baggage as well, but my point is I think it accomplishes list processing itself a lot better than lisp does. Idk, I like the idea of lisp as someone who's interested in interpreters and compilers but I just can't see it as a practical language.

>>61391645
No problem buddy
>>
>>61391645
>You can teach yourself the bare-basics from nothing but error messages
That sounds like you'd just learn to avoid error messages, not the underlying concepts you need in order to program well.
>>
>>61391694
Do you see Haskell as a practical language?
>>
>>61391645
watch this btw
https://www.youtube.com/watch?v=OSGv2VnC0go
>>
>>61391738
>Do you see Haskell as a practical language?
For most user-facing purposes I don't think so either, but for reasons unrelated to list processing. What I'm saying is, one of the fundamental tenets of lisp is that you generally reduce algorithms to list processing. But, it seems like there are other languages out there that show that with some basic syntax additions that are incompatible with lisp that let you get whole lot more done by letting the compiler keep track of the list operations you previously had to write more complex expressions for.
>>
>>61391805
with some basic syntax additions that are incompatible with lisp, you can get*
>>
>>61391694
The baggage in my case is purity. The algorithm I posted in question is pure, but in general the program is incredibly impure, with lots of calls to impure, stateful embedded C. There's only one C call in that algorithm,
(finite_getblock f x y z)


There's over a million objects in a typical scene. I cannot do pure FP on that scene. I need something that plays nicely with C, because I have to use assignment in C for practicality, and because OpenGL forces me to use assignment.

In that code, I use zero of Scheme's equivalent of currying, SRFI 26: cut/cute, I'm not sure how pattern matching would help, although if it could, I'd be more than willing to install a pattern matching library and use it, and I'm not aware of any higher order functions that would simplify it.
>>
>>61391793

d = mempty
& at "matthew" ?~ "blue"
& at "rachel" ?~ "green"
& at "raymond" ?~ "red"

imapM_ (printf "%s --> %s") d
>>
>>61391793
>Beautiful, Idiomatic Python
What is this?
>>
>>61391852
python while autistically avoiding indicies
>>
File: bait but also true.png (17KB, 522x384px) Image search: [Google]
bait but also true.png
17KB, 522x384px
>>61391852
"beautiful python" doesn't exist
>>
>>61391830
What language is that, and is it just printing a zipped tuples?
>>
>>61391890
Where is OCaml.
>>
>>61391805
>with some basic syntax additions that are incompatible with lisp
I'm curious what these are.
>>
>>61391901
haskell with
printf from Text.Printf
Map from Data.Map
&, at, ?~, imapM_ from Control.Lens
>>
I'm trying to implement Luhns algorithm in Java. Everything was looking nice until I actually tried using a card number, it's too large for even a long. How do I workaround this? Enter it as a String and then add it to an int array or something? I don't remember having this problem when I did it in C.
>>
>he doesn't live code

https://medium.freecodecamp.org/lessons-from-my-first-year-of-live-coding-on-twitch-41a32e2f41c1
>>
>>61391958
Java has a BigInteger class, but there's no overloaded operators so it's awkward to do arithmetic with it.
>>
>>61391982
>he
>>
>>61391958
You're using base 10 right? Represent numbers as binary encoded decimal arrays.
>>
>>61391982
>NodeJS
nope
>>
>>61391982
>womemes
>live coding severely slows you down
>have to stop to answer questions or explain every 5 minutes
>depending on if you care about an audience, you cant get too technical

I honestly dont know how jblow does it, I think even he knows his audience are retards.
>>
>>61392016
pair programming has been proved to enhance code production. live coding is like 1:n pair programming. why aren't you live coding, anon?
>>
>>61392016
He feasts off of undeserved feelings of superiority. Well I guess he is superior to his retard audience, but that isn't impressive, so misplaced feelings of sublimity might be more accurate.
>>
>>61392038
>pair programming has been proved to enhance code production
lmao, no it hasnt.
Unless you're referring to "sharing project work", which is completely different from the retarded "One person drives, the other person navigates!" shit that project managers force on people.
>>
>>61392038
>have task
>delegate it to n threads but do so very naively
>not n times faster
>>
>>61392038
>meme studies
yeah and mob programming is the future.
>>61392051
makes sense given his ego.
Its kind of depressing hearing him get excited about something, ask for questions and realize its over everyone else's head.
>>
File: Capture.jpg (13KB, 622x53px) Image search: [Google]
Capture.jpg
13KB, 622x53px
>>61390834
Make a static "pointsWithinDistance(point1, point2,distance)" function here. There's too much going on in this function. Always try to keep calculations and messaging in separate functions if a calculation is more than a single +-*/%. Also you'll end up needing this function again in the future if you do any kind of graphics programming.

Other than that looks good. I don't know python though so I can't comment on syntax.
>>
>>61392068
>lmao, no it hasnt.

proved by Cockburn himself, the creator of agile development.

also,
"""
Guy Steele expresses similar admiration. Currently a research scientist for Sun Microsystems, he remembers Stallman primarily as a "brilliant programmer with the ability to generate large quantities of relatively bug-free code." Although their personalities didn't exactly mesh, Steele and Stallman collaborated long enough for Steele to get a glimpse of Stallman's intense coding style. He recalls a notable episode in the late 1970s when the two programmers banded together to write the editor's "pretty print" feature.

"We sat down one morning," recalls Steele. "I was at the keyboard, and he was at my elbow," says Steele. "He was perfectly willing to let me type, but he was also telling me what to type.

The programming session lasted 10 hours. Throughout that entire time, Steele says, neither he nor Stallman took a break or made any small talk. By the end of the session, they had managed to hack the pretty print source code to just under 100 lines. "My fingers were on the keyboard the whole time," Steele recalls, "but it felt like both of our ideas were flowing onto the screen. He told me what to type, and I typed it."

The length of the session revealed itself when Steele finally left the AI Lab. Standing outside the building at 545 Tech Square, he was surprised to find himself surrounded by nighttime darkness. As a programmer, Steele was used to marathon coding sessions. Still, something about this session was different. Working with Stallman had forced Steele to block out all external stimuli and focus his entire mental energies on the task at hand. Looking back, Steele says he found the Stallman mind-meld both exhilarating and scary at the same time. "My first thought afterward was: it was a great experience, very intense, and that I never wanted to do it again in my life."
"""
>>
var pointToCheck = hits[indexOfFirstHit];
var shortestDistIndex = -1;
var shortestDist = 10000;
for (var i = cornersInsidePoly.length - 1; i >= 0; i--) {
shortestDist = 10000;
shortestDistIndex = -1;
for (var j = 0; j < cornersInsidePoly.length; j++) {
var dist = vec2SqrDist(cornersInsidePoly[j], pointToCheck);
if(dist < shortestDist) {
shortestDist = dist;
shortestDistIndex = j;
console.log(j + " " + shortestDistIndex);
}
}
lineBeginning++;
pointsX.splice(lineBeginning, 0, pointToCheck.x);
pointsY.splice(lineBeginning, 0, pointToCheck.y);
pointToCheck = cornersInsidePoly[shortestDistIndex].copy();
cornersInsidePoly.splice(shortestDistIndex, 1);
}


So in the above code does anyone know why on eath i can't assign shortestDistIndex the value of j? Is it not valid syntax to use the loop variable for assignment inside the loop?
>>
File: 1499091887989.png (77KB, 295x324px) Image search: [Google]
1499091887989.png
77KB, 295x324px
>>61392173
Thanks, interesting story didn't hear it before
>>
A python script to download torrents for me. I have TPB functionality but I am looking to add support to search all major torrent sites.

>https://github.com/NotHawthorne/kfind
>>
File: IMG_0942.jpg (632KB, 1543x1200px) Image search: [Google]
IMG_0942.jpg
632KB, 1543x1200px
>>61392173
Stallmam/Steele erotica when?
>>
>>61392173
Sounds like he got raped or something
>>
>>61392198
Ofc you can use the loop variable for assignment in the loop.

are you getting an exception error?
>>
File: serveimage.png (232KB, 1368x469px) Image search: [Google]
serveimage.png
232KB, 1368x469px
How do I get a $150,000 to $250,000 job at Google? Someone at /pol/ mentioned TensorFlow. I already have a degree and know a few programming languages a little bit.

>>>/adv/18521156
>>
Would JavaScript be as popular if it weren't for web browsers?
>>
>>61391829
Yeah, I agree. I wish I knew about a programming language that had python like semantics but with strong typing, and easily supported haskell-style pattern matching/list processing with some kind of nice support for currying scenarios.

>>61391951
Well, that's kind of tough, since "incompatible" is a strong word, - pretty much whatever I say you could respond "no lisp can do that" since you can define whatever lisp functions/macros you want, that would confuse the next programmer until they learn how it works. Lisp is Turing complete too. But the problem is the language should be doing that for you. In some cases (like racket) that happens, but not in others. The syntax is still function calls so it doesn't visually identify the information you're extracting. And if you were to get put in that syntax it wouldn't be lisp anymore, thus the incompatibility.

Obviously when you look at it from a "what can you physically accomplish" level, it comes down to preference. Take let-list in his code for example - in Haskell, this comes as part of its pattern matching syntax for defining functions. It comes as part of the function signature rather than being unpacked at runtime and resulting in 2 levels of indentation. And you get the added benefit that since these would be tuples instead of arbitrarily length lists so you get more compile-time checks. (Granted, supposing he were using typed racket, he would get this too, but not many people do that, and the former points still stand.)
>>
>>61392318
keep googling stuff about python and google will eventually offer you a job.
>>
>>61392344
I've been googling lisp for ages and have never seen a job offer
>>
>>61392361
python, i said python
>>
>>61392366
Wait, are you actually not meming then
>>
>>61392366
but I don't like python
>>
>>61392265
>"We sat down one morning," recalls Steele. "I was at the keyboard, and he was at my elbow," says Steele. "He was perfectly willing to let me type, but he was also telling me what to type."

It started quite ordinarily. We talked about the problem at hand and Richard told me what to type. After about an hour the room warmed up a lot from the servers running and sitting so close together. I asked Richard if I can take off my shirt to stop sweating. He looked me in the eyes. I felt that our minds were melting. We only wanted one thing. I asked him if I should strip for him. He answered: "only if it's free"
>>
>>61392374
https://thehustle.co/the-secret-google-interview-that-landed-me-a-job
>>
If Python is named after Monty Python, does that mean it's a joke language?
>>
>>61392320
Not even remotely.
>>
>>61392390
they never finished the punchline
>>
>>61392389
Is this like a more subtle onion?
>>
File: google.jpg (143KB, 1640x1063px) Image search: [Google]
google.jpg
143KB, 1640x1063px
>>61392389
>tfw I got this before

They also ran some billboards ads some time ago
>>
>>61392377
https://youtu.be/jskq3-lpQnE?t=125

>>61392389
Nah I know about that. I was asking if >>61392318 was serious is all
>>
>>61392416
Did you solve it?
>>
>>61388224
>redundant lambda in faux-lambda

why
>>
>>61392438
Nah, I saw it, clicked on it, saw that it was some puzzle and left
>>
task for dpt
calculate how many meme
>>
>>61388313
>itertools.cycle
Good shit
>functools.partial
Makes your code longer and depend on an additional import
>>
File: 1441111724227.png (306KB, 345x366px) Image search: [Google]
1441111724227.png
306KB, 345x366px
>>61392421
Now that's some fine autism
>>
>>61392416
not sure to understand, they ask to generate e's decimals until 10 of them form a prime number
>>
How to improve your Python

https://www.youtube.com/watch?v=uqsZa36Io2M
>>
>>61392539
Yeah, 10 consecutive digits which are prime. It's a pretty fun problem
>>
File: 1500133319573.png (2MB, 1279x718px) Image search: [Google]
1500133319573.png
2MB, 1279x718px
>2017
>still using a shitty normie keyboard
even pewdiepie is ahead of you in the mechanical keyboard game
>>
>>61392318
https://medium.freecodecamp.org/why-i-studied-full-time-for-8-months-for-a-google-interview-cc662ce9bb13

Guy studies 8 months to get a job at google. Doesn't get it.
>>
>>61392421
>I was asking if >>61392318 (You) was serious

Yes, I am. If you have advice, please share it. >>>/adv/18521156
>>
>get phd in cs
>get job
>get stuck writing crud apps in go, python, and js
>>
>>61392528
How stallman is still alive is amazing.
Hes been fighting an increasingly losing war for decades now but hasnt given up.
>>
>>61392653
>get MS in infosec
>get job hacking mainframes with the NASA
>>
>>61392659
stallman vs reality and common sense isn't a war
>>
>>61392688
He may be deluded, but hes not Terry.
>>
>>61392318
TensorFlow is a complete meme. have fun specializing in machmeme """"learning"""" and within a decade all of what you've learned becomes useless
>>
>>61392700
>delusional man writes a kernel
>hoo dis
>>
>>61392318
$150-250k isn't as much as it sounds because it's in the bay area, you can barely survive on $100k
>>
File: IMG_0597.png (126KB, 350x212px) Image search: [Google]
IMG_0597.png
126KB, 350x212px
>>61392377
>>61392173
I began undressing for him, my heart was thudding in excitement. I felt breathless, heat began to rise to my cheeks and I blushed like a schoolgirl. "Do you like what you see?" I pleaded for an answer. I wanted -- no, I *needed* his approval. He nodded. My heart stopped for a moment. Feeling a rush of ecstasy at his reassurance, I got to my knees and began pulling his size 42 cargo shorts down. I asked him if I could suck his cock. He tensed up, I felt the mood shift immediately, what did I do wrong??? "I'd just like to interject for moment." RMS boomed loudly. "What you're refering to as cock, is in fact, cock/balls, or as I've recently taken to calling it, cock plus balls". I pressed on, driven by an insatiable thirst for him. He lorded over me. I wrapped my mouth around it. The session lasted 10 hours. Throughout that entire time, neither he nor I took a break or made small talk. My fingers and mouth were around his tumnescent member the whole time, he told me what to do and I did it. When I emerged outside, I was surprised to find it was now nighttime. Working with Stallman had forced me to block out all external stimuli and focus my entire mental energies on the task at hand. Looking back, I found the Stallman mind-meld both exhilarating and scary at the same time. It was a great experience, very intense, but I never wanted to do it again in my life.
>>
File: Hedonic-Treadmill.jpg (67KB, 614x409px) Image search: [Google]
Hedonic-Treadmill.jpg
67KB, 614x409px
>>61392612
I admire people who have really clear goals and follow them tbqh. For once, there isn't a company / organization I would love to work so much that I would spend 8 months preparing for an interview. Secondly, I'm a lot more adaptive. If my initial goal doesn't work out I adapt and change my goal a bit
>>
>>61392318
Google fucking created TensorFlow, why do you think they'd pay you that much doing a probably relatively if not absolutely poor job using something they're masters at.
>>
File: 123456.jpg (196KB, 1000x1500px) Image search: [Google]
123456.jpg
196KB, 1000x1500px
>>61392759
Very nice
>>
>>61390834
Is this 2.x or 3.x?
>>
>>61392769
so by pure coincidence when you're at your least happiness, bad stuff will happen and you will immediately start becoming happier?
>>
>>61392756
why not live an hour outside the bay area and commute to work
>>
>>61391704
>That sounds like you'd just learn to avoid error messages, not the underlying concepts you need in order to program well.
Hence "bare-basics". As in "at least it runs" basics.

>>61392816
3.x
>>
>>61392821
It also seems to mean that I can make good things happen by being happy. Hmmm
>>
>>61392821
Exactly. Nah, the theory is that you accustom to the good / bad stuff and return to your set point over time. Which is pretty neat because even if you say lose your ability to walk, sooner or later you will be as content as you were before
>>
>>61392870
then fix the chart
>>
Hey /dpt/, could use some advice. I have a friend that's trying to learn to code by doing a coding "boot camp" (I know, I know...) and they're really struggling with anonymous functions.

The problem I have is the only thing I know to do is to step way back and go all the way back to basic variable and function scope. But they're getting frustrated and really demotivated.

Do you guys have any examples, metaphors, or advice on advising my friend?
>>
>>61392912
Don't you need a degree as a prerequisite for most bootcamps?
>>
>>61392933
I dunno, maybe? He has an IT degree.
>>
>>61392945
I just thought he'd already know anonymous functions
>>
>>61392912
An anonymous function is a function without a name.
Anonymous function getting called by passing to another function:
iAm = (pre) => {
console.log(pre + ", I'm dead inside.")
}

iAm((name) => {
console.log('Hi ' + name)
})
>>
>>61392958
Forgot to define name, but you get the gist.
>>
Why do people use JavaScript to try to teach the benefits of static typing?
>>
>>61392912
Does he understand lambdas in general? Once you understand that, an anonymous lambda makes more sense.
>>
>>61392933
where'd you get that idea?
>>
>>61386068
>expecting security in an IRC client
However, where is that code an excerpt from? I'd figure any major project would know that you don't stdout un-sanitized shit onto the screen.
>>
>>61392984
You can't learn programming in a two month bootcamp unless you've already got a decent grounding in theory and the basics, like what you'd get from a CS degree
>>
>>61392956
Honestly the teachers are kinda shit, no fucking surprise. It's almost funny, he asked my opinion on coding bootcamps, I basically told him that I think you're better off saving your money and teaching yourself. My fear was that they wouldn't focus on some basic fundamentals, try and teach by rote memorization, and the students would fail to grasp the basics that make understanding things, well, like anonymous functions easier.

Surprise, surprise!

>>61392958
Yeah, that's what I've been trying. I'll use the example you gave though, maybe it'll help to show two identical (syntax aside) functions, one anonymous, one named, and how they're called/used...

>>61392976
Hmm, I'm not sure, I'll ask later today when we chat about this some more. But that will be a good place to start, thanks for the advice.
>>
>>61392912
Call them temporary functions instead.
>>
>>61393001
pretty sure you're wrong. boot camps cost thousands of dollars
>>
>>61393004
Oooh that's a good idea. I know he was getting caught up cause the teacher kept interchanging anonymous function, callback and closure while referring to the same thing.

But still, "temporary" might help.
>>
>>61393011
cost is not necessarily indicative of quality
>>
>>61393001
I think you might misunderstand what most "bootcamps" are. Most of them are "Come in, sit down, we're gonna write code for 8 hours, we're going to spoon feed you answers and give you just enough info to sound competent in an interview. What's accreditation? By the way, that'll be $40k kthxbai."
>>
>>61393041
Indicative of demand, which is indicative of market demand in the long term
>>
>>61393041
if you're stupid enough to be unable to learn a language on your own after getting a 4 year degree, you're probably too poor and in debt to afford thousands of dollars for a koding bootcamp. it's for people with no degrees
>>
File: just for you.png (31KB, 956x455px) Image search: [Google]
just for you.png
31KB, 956x455px
>>61392904
>>
>>61393038
Yea. Obviously it's up to interpretation. But it might help him understand why they're called anonymous functions as well. They're anonymous because they don't have a name. They don't have a name because we don't intend to, or indeed, can't, refer to them after we've defined to them. Unless we give them a name like in >>61392958.
>>
>>61393119
>>61393119
>>61393119
>>61393119
>>61393119
>>
>>61393125
Yeah for sure, I appreciate the suggestion. I'll give it a try tonight. Thanks again dude (and everyone else that gave advice too).
>>
>>61393054
>this one fucking retard who keeps posting supply and demand bullshit in /g/
>>
>>61385654
Working on a function to check if a subsection of a sudoku grid includes 1-9.

I can't for the life of me figure out.
>>
>>61393379
multiply and xor the numbers
>>
>>61392833
How's this? (comments redacted)

https://pastebin.com/Z2Ap93Ei
>>
>>61393562
What if im writing in javascript and i just started?
>>
>>61388468
spoiler: he has never called it Jai, that's only an inference based on the file extensions of his demos, which he constantly reiterates is nowhere near final and a very low priority for him at this point in time. I would bet $1000 that it won't be called Jai.

also I can't wait, Nim is the closest thing I can find to it in terms of allowing for complex compile-time metaprogramming
>>
>>61394001
>javascript
then you don't have integers (only double precision floats), i'm a bit rough on the number theory, but as long as you can put the relevant numbers in an an array and loop through them, then if you check if the product is (1*2*3...) and the sum is (1+2+3...) it might work
Thread posts: 340
Thread images: 39


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

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
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.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.