[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: 319
Thread images: 25

File: DPT.png (389KB, 934x1000px) Image search: [Google]
DPT.png
389KB, 934x1000px
Old thread: >>56837732

What are you working on /g/?
>>
First for anime boobs.
>>
>>56842215
>First for anime boobs
>Doesn't post anime boobs
>>
File: wtf.png (557KB, 934x1000px) Image search: [Google]
wtf.png
557KB, 934x1000px
Can you please change it up at least once in a while?
>>
>>56842194
how do I describe myself if I do python, programmer, coder or scripter
>>
How do you post code in the white box? Do you just upload a .c file?

>inb4 newfriend
>>
File: 1469545947703.jpg (3MB, 4032x3024px) Image search: [Google]
1469545947703.jpg
3MB, 4032x3024px
>>56842194
post your workspace station
>>
What is the best functional language to get into FP for someone that never done FP.
I know in order of skill:
Java, c++, python
(love python though)
>>
why is this>>56842194 only 389 KB and >>56842233 is 557 KB
>>
>>56842247
read the sticky, newfriend: >>51971506
>>
>>56842247
Yes, upload the file through where you normally upload an image
>>
>>56842247
read the sticky, newfag
>>
>>56842254
Haskell

or ocaml/F# if you're still an imperative oop baby
or lisp if you're a dynamicfag
>>
>>56842263
>>56842270
>>56842268

Thanks friendos. :^)
>>
>seen these threads for years upon years
>if I had started programming back then I'd be OK/decent by now

/blog cya guys
>>
>>56842275
What do you think about Scala?
I know Play framework supports it, so that's a big plus for me.
>>
>>56842325
Imagine someone took a really nice FP language then took a massive sweaty Java dump on it
>>
>>56842321
Start now.

>>56842249
Can you even see anything with a font that small.
>>
Sonar software that makes a 3D map through mic's sound for MS. Pretty big team.
>>
>>56842351
prettty cool

how do the sensors work exactly, is it like a bat?
>>
>>56842351
give more information
>>
Since WDG is dead...

NodeJS is giving me a case of the cancer.
Are there any non-cancer alternatives? I just want to make a webserver users can log in to, and be served some data through ajax calls or whatever.
Is there any way to do this without requiring 27 npm modules? Do I have to use PHP?
>>
>>56842419
>Do I have to use PHP?

why not? why are you using nodejs? because its cool and trendy?

fuck outta here
>>
>>56842242
"Script Child", or something of the sort
>>
>>56842419
>Since WDG is dead...
Fuck off
>>
>>56842419
>implying there are only two backend technologies out there
Ever heard of python, rails, java, C#, *insert almost any language here*?
>>56842441
But why so harsh? /wdg/ is always dead, and you rarely can have a normal conversation there. I think /dpt/ and /wdg/ should be the same thing, since the subject is very similar. Web programming is programming after all.
>>
Should I just be using vectors all the time in C++? Seeing as I can't make an array an attribute (no really wtf)
>>
File: the end of -thinking-.jpg (138KB, 1000x1500px) Image search: [Google]
the end of -thinking-.jpg
138KB, 1000x1500px
>>56842496
>webshit is programming
>>
>>56842496
>But why so harsh? /wdg/ is always dead, and you rarely can have a normal conversation there. I think /dpt/ and /wdg/ should be the same thing, since the subject is very similar. Web programming is programming after all.
No
No
No
No

I hate you and everything you believe
>>
>>56842496
>I CANNOT HANDLE BANTER
>>>/g/wdg
>>
>>56842513
>banter
I wasn't joking
>>
GAS THE WEBSHITS

DPT NOW
>>
>>56842547
no false flags
>>
>>56842507
Arrays in most modern languages are pretty much useless (with very few exceptions), so yes.
>>56842511
>>56842512
>>56842513
Can you please elaborate?
Prefferably using arguments and not /b/ tier "kys" type responses?
>>
>>56842496
>Ever heard of python, rails, java, C#, *insert almost any language here*?

Well that's why I'm asking. I have heard of those technologies but I can't make an informed decision myself. Rails I know is just as much of a clusterfuck as nodejs. ASP.NET is probably too enterprisey?
>>
>>56842563
/dpt/ and /wdg/ are not remotely similar
Nobody in /dpt/ wants to join with /wdg/
Nobody in /dpt/ wants /wdg/ here
>>
>>56842351
Don't you need stereo audio for that?
>>
>>56842563
>Arrays in most modern languages are pretty much useless (with very few exceptions), so yes.
Been trying to force the issue because lolfaster thinking it will matter one day, guess I'll just stop doing that.
>>
>>56842564
I would suggest python.
Rails I never used but heard mixed opinions.
C# and Java, yeah for 'simple' websites (i. e. not big, complicated systems) probably too enterprisey.
>>
>>56842254
Java, C++ and Python all support functional styles, like higher order functions. If you've never used any of that, you should.

If you want to learn FP, +1 for Haskell. It's uncompromisingly pure and will not fool you into thinking you know FP because you've copy-pasted Java code into a scala editor.

If you need to use FP in practice right now and you don't care so much about learning, Scala is better for the same reason.
>>
>>56842574
You still didn't give any argument.
I seriously don't get it. What difference does it make if the frontend of an application is a desktop GUI or Web page?
>>
>>56842564
Just chose something. Once you start working, you'll figure out what your pain points are and can switch to something you like better.
>>
>>56842638
GUIs don't count either
>>
>>56842638
>You still didn't give any argument.
It's easy to see how a blind person might think that
>>
How to find non-cucked open source projects to work on?
>>
>>56842638
Webdev is usually just a mish-mash of spaghetti code, with people usually not learning what's going on, just following tutorials or modifying other people's code until it does what they want. The /dpt/ is more of a discussion of the act programming than /wdg/ is.
>>
>>56842648
I did. I chose nodejs. My pain points are the five thousand node modules you need to install to do anything, and the fact that they're all running on god knows what version and nothing is compatible with anything else. The documentation is shit, and the writeups from people significantly more patient than me who have managed to configure everything correctly are all outdated and use some unspecified version of everything. That's why I'm here.
>>
>>56842564
ASP.NET is fine. It's like PHP with a (much) better backing language. It's not enterprisey at all, quite the opposite.

The problem with it is that it really only runs on Windows*.

* Don't try to argue against this unless you actually host a modern ASP.NET site on mono right now.
>>
in my required assembly language class

I don't like this.
>>
>>56842700
Assembly is fun, I wish my Uni had a class for it
>>
>>56842688
I'm very out of the loop. What are my chances of hooking up some affordable ASP.NET hosting nowadays? Do I need a dedicated windows box for $100s a year with all the pains of configuring it that comes with it?
>>
>>56842684
Try php. It was pretty comfy for me. Although it's a shitty language in itself, it's an established language for server side scripting.
OR you could try out some other language you wanted to try out. Most other languages use web frameworks on top of the language itself so it might suffer from what you don't like. PHP was made for web so it pretty much just works.
>>
>>56842718
Is this real life?
>>
>>56842663
>>56842664
Still no argument.
>>56842680
Ok, that's a fair statement I actually agree with, I see where the hate comes from now. Thank you for actually putting anything into this conversation.
>>
>>56842684
>>56842724
I guess it would be: PHP is easier to get into webdev (very straightforward), but python is just a much better language (with far more use cases so it might come in handy in the future).
>>
>>56842718
are you trying to make me feel dumb
>>
>>56842810
What you learned or done in the class? I've had fun with mine too.
>>
>>56842829
no we just started learning and he doesn't explain very well and I'm having trouble following, lol.
>>
>>56842810
no, just hungry for quiche
>>
>>56842810
Yes
>>
File: download.png (4KB, 189x266px) Image search: [Google]
download.png
4KB, 189x266px
Hi /g/entoomen

I'm wanting to start studying to gain some sort of qualification or certification for c/c++/c#

Are there any worth my time doing?

Preferable it will be study at home or weekend to fit around a normal job/routine.

Some one please point me in the right direction, I plan on doing some freelance coding on my spare time as a secondary income stream. I have already learned a lot of C# and i'm currently self studying C in a linux enviroment.

cheers mates.
>>
>>56842507
>I can't make an array an attribute
wut
>>
>>56842419
>I just want to make a webserver
That's the reason why PHP and SQL exists!
>>
Where da sticky? /new/ here but I don't see it
>>
>>56842908
>>56842263
>>
>>56842908
go to www.4chan.org/g/ first post is the sticky.
>>
>>56842908
>>>/g/catalog
Literally the board sticky.
also code tags are [code /code] with [] on both sides
... dumbass
>>
File: sketch-1475182806704.png (391KB, 2560x1303px) Image search: [Google]
sketch-1475182806704.png
391KB, 2560x1303px
>tfw legit working on getting a big boy job
>>
How do I make it so that instead of looping in the while loop and printing "TOP" "TOP" "TOP" over and over again, it only prints out "TOP" or "BOTTOM" etc... if it changes?

int main(void) 
{
int t, b1, b2, b3, b4; //t for time, b1-b4 for buttons
double ax, ay, az, gx, gy, gz; //Accelerometer and gyroscopic data in x,y,z

while (TRUE)
{
scanf("%d, %lf, %lf, %lf, %lf, %lf, %lf, %d, %d, %d, %d", &t, &ax, &ay, &az, &gx, &gy, &gz, &b1, &b2, &b3, &b4 );
printf("Echoing output: %d, %lf, %lf, %lf, %lf, %lf, %lf, %d, %d, %d, %d \n", t, ax, ay, az, gx, gy, gz, b1, b2, b3, b4);
printf("At %d ms, the acceleration's magnitude was: %f\n", t, Mag(ax, ay, az));
if (Mag(ax, az, ay) <= .085) //Only prints values if controller is still
{
printf("Orientation is: ");
Orientation(gx, gy, gz);
}
if (b1 == 1) //Exits code if TRIANGLE is pressed
{
return 0;
}
}

return 0;
}

double Mag(double ax, double ay, double az) //Finds the magnitude of the acceleration vectors
{
double magnitude = 0.0;
magnitude = sqrt(pow(ax, 2) + pow(ay, 2) + pow(az, 2));
return magnitude;
}

int Close_To(double tolerance, double point, double value) //Determines if "value" (gx, gy, gz) is close enough to "point" using "tolerance"
{
if ((point - tolerance) <= value && (point + tolerance) >= value)
{
return 1; //If so, return true
}
else
{
return 0; //If else, return false
}

}

void Orientation(double gx, double gy, double gz) //Determines the orientation of the controller using gyroscope data
{
double tolerance = 0.15;

if (Close_To(tolerance, 1.0, gx))
{
printf("RIGHT\n");
}
else if (Close_To(tolerance, -1.0, gx))
{
printf("LEFT\n");
}
else if (Close_To(tolerance, 1.0, gz))
{
printf("BACK\n");
}
else if (Close_To(tolerance, -1.0, gz))
{
printf("FRONT\n");
}
else if (Close_To(tolerance, 1.0, gy))
{
printf("TOP\n");
}
else if (Close_To(tolerance, -1.0, gy))
{
printf("BOTTOM\n");
}
}
>>
>>56842956

>I live outside of the US, can I apply?

>No. Right now, we are only placing the candidates in the US.
well thanks for nothing.
>>
>>56842999
Save the variables each iteration and compare them the next iteration.
Something like this:

while(TRUE) {
// skip this iteration if same values as last iteration
if (prev_ax == ax && prev_ay == ay) continue;

...

prev_ax = ax;
prev_ay = ay;
}
>>
>>56843036
Thanks! However I don't think solves my problem (unless I'm being a retard)
>>
>>56842262
The background on >>56842233 is transparent.
>>
>>56842999
Fuck, ignore the deleted post, I wasn't paying attention.

Use a boolean to keep track of the last state and only print if it changed.
>>
>>56842718
assembly is the most boring way to develop software.
>>
k&r ex1-18

What do yo think?

#include <stdio.h>

#define MAXCHAR 256

/* Remove trailing blanks and tabs */
int main()
{
int c, nc, nb;
char line[MAXCHAR];

nc = nb = 0;

while((c = getchar()) != EOF) {
line[nc] = c;

if (c == ' ' || c == '\t') {
++nb;
} else {
if (c == '\n' && nb > 0) {
nc = nc - nb;
line[nc] = '\n';

if (line[nc - 1] == '\n')
--nc;
}

nb = 0;
}
++nc;
}

if (nb > 0)
nc = nc - nb;

line[nc] = '\0';

printf("%s", line);
return 0;
}

>>
>>56843059
except ax,ay,az,gx,gy,gz are all being read in from a controller, and I'm only using them to determine an orientation, then printing the orientation. Could I do something like this and somehow check on controllerState to not print if controllerState = previous controllerState?

(in main)
if (Mag(ax, az, ay) <= .085) //Only prints values if magnitude of controller is still
{
printf("Orientation is: ");
Orientation(gx, gy, gz);
}


void Orientation(double gx, double gy, double gz) //Determines the orientation of the controller using gyroscope data
{
double tolerance = 0.15;
int controllerState = 0;

if (Close_To(tolerance, 1.0, gx))
{
printf("RIGHT\n");
int controllerState = 0;
}
else if (Close_To(tolerance, -1.0, gx))
{
printf("LEFT\n");
int controllerState = 1;
}
else if (Close_To(tolerance, 1.0, gz))
{
printf("BACK\n");
int controllerState = 2;
}
else if (Close_To(tolerance, -1.0, gz))
{
printf("FRONT\n");
int controllerState = 3;
}
else if (Close_To(tolerance, 1.0, gy))
{
printf("TOP\n");
int controllerState = 4;
}
else if (Close_To(tolerance, -1.0, gy))
{
printf("BOTTOM\n");
int controllerState = 5;
}
}
>>
>>56843080
Ignore this, I'm an idiot.
brb killing myself
>>
>>56843133
nc -= nb
>>
>>56843079
i don't see why that would make any difference

the color and transparency are constant in both cases
>>
>>56843145
Well good thing this is an anonymous image board.
Otherwise we would make fun of you for the rest of time.
>>
>>56843236

You are right, but that operator hasn't been introduced yet.

Trying to do it from zero to please my "do it by the book" autism.
>>
>>56843137
That's the gist of it yeah. The reason this is giving you some trouble is because you don't have proper separation of concerns. You do some printing in main and some in Orientation. Let the menu/ui part (in main) consern itself with printing stuff. Let Orientation consern itself with calculating the orientation. Imagine if you instead had

char* Orientation(double gx, double gy, double gz) 
{
double tolerance = 0.15;

if (Close_To(tolerance, 1.0, gx))
{
return "RIGHT\n";
}

... etc.


Then you could easily
        if (Mag(ax, az, ay) <= .085) //Only prints values if controller is still
{
char* orient = Orientation(gx, gy, gz);
if (orient != last_orient) {
printf("Orientation is: %s", orient);
}

last_orient = orient;
}
>>
What are some porn related programming tasks
if any of you have done anything interesting please share
>>
>>56843339
scrapping /b/ threads looking for facebook pictures
>>
is /wdg/ dead rn
>>
>>56843362
already done something with scraping, just imagefap
>>
File: 1462501025009.jpg (52KB, 592x754px) Image search: [Google]
1462501025009.jpg
52KB, 592x754px
>>56843321
Damn this just made everything click for me. Thanks a million.
>>
>>56843339
A porn site I browsed let you sort by age, boob size, ass size, etc, but you couldn't do a more advanced search other than a single column sort. I wrote a scraper to grab all of the models and their attributes and dumped a .csv file. Now I can find the 21 year old chubby blondes with giant asses with no problem.
>>
>>56843405
And what are you waiting for to share ?
>>
>>56843405
Wow, this sounds amazing. It'd be like having those character sliders in video games, but with pornstars.
>>
>>56842194

It's possible to get an adv here ? if yes{

Computer Science student on 2nd year, in need to get a new computer. im pretty much thinking about getting an MacBook Air due to it's lightweight, easy to take to classes. BUT i also do some photoshoots and filmmaking for hobbie. Any adv ? At start i was thinking getting 2 machines, but it will be a little bit pricey i think.
}
>>
>>56843405
hey that's a cute idea

there's tons of sites that have pornstar bios, you could very easily make a program where you input stats and it returns a list of the girls that fit the criteria

you can make a toy query system even and even make rules and shit
>>
>>56843453
Thinkpad all the way. Got a really nice one for around 1200 but I know you can get ones for cheaper. Super durable, sick keyboard, and better OS
>>
>>56843405
>in 10 years time every male will be an expert in SQL
>>
>>56843453
Get an MBPr. The better screen will help. No reason to get 2 laptops. What would the second one have been anyways?
>>
Webdev here, JS or plain html?
>>
>>56843504
Why are you even asking this question? You should know based n what you're going to do
>>
>>56843497

I was thinking about a iMac and a mbAir

>>56843468

hmm, ill take a look on em, but i'm kinda have a hipster spirit on me... wanna look good...
>>
>>56843504
Haskell
>>
>>56843536
r-right... I mean... this thread isn't about asking questions... Well... I was always being rejected by anyone including 4chan... I'm sorry for the disturbance... I'll end my life. :(
>>
>>56843545
>hmm, ill take a look on em, but i'm kinda have a hipster spirit on me... wanna look good...

you already knew what you were going to buy before you asked the question

fuck off drone
>>
>>56842419
Give Ruby a try. That's what all the hipster programmers are using, and if you get good at it and don't mind doing fucking web development for a living you can make decent money writing it too.
>>
>>56842321
Learn Racket.
>>
>>56843578
You should have been more specific. I myself prefer pure HTML before relying on JS. Of course, when I use JS, I also don't go and use JQuery to bloat my page. Or Bootstrap. I roll my own.
>>
>it's called ruby on rails
>there are no rails

I'm calling my fucking lawyer
>>
>>56843584

c'mon, don't get mad, i said i'll take a look, there's a chance...
>>
>>56843578
Sob sob 4chan doesn't care about me.

If you really want to learn web development, follow a tutorial and learn the absolute basics about how HTML/CSS/JavaScript work together to make web pages.

Then, work on a small project on your own. It's SUPPOSED to be shitty and useless, but you'll learn. If you have issues you don't know how to fix, google them first and if you really can't find an answer then ask a specific question.

If you're willing to spend a few dozen hours and actually put in the work necessary, even a complete retard can learn how to make a website.
>>
>>56843578
>>>/g/wdg
>>
>>56843635
This.
My website is pretty much just paragraphs. and links.
>>
>>56843609

Ruby is a nice language, but Rails is a bloated shitpile. You're better off without it.
>>
>>56843339
Plenty of good web scraping practice to be had there family
>>
>>56843635
>>56843606
>>56843569
>>56843536
Oh... Actually my question is: Would you prefer pure HTML website or are you fine with Ajax loaded content?
>>
>>56843656
Companies are big fans of bloated shitpiles though, so if you want to make stupid amounts of money learn Rails and join a Ruby consultant firm.>>56843609
>>
>>56843670
Whichever makes better use of Haskell
>>
>>56843670
If the purpose of your website is simple, like a personal homepage or something that just displays data/images/whatever, then a static website is going to be best because it's fast and simple and easy to maintain.

If you want dynamic content, you're going to need to have some kind of JavaScript-powered thing.
>>
>>56843670
I would prefer pure HTML. I think Google does too if you care about SEO.
>>
>>56843339
How fucking pathetic can you be?
>>
>>56842671
Look for ones written in Racket.
https://github.com/lehitoskin/ivy.git
>>
>>56843707
Said a guy browsing 4chan
>>
>>56843707
what i just like porn
programming about things you like feels good
>>
>>56843284
no bully
>>
>>56843339
make porn games.
if youre lucky you could make quite a bit of money from it.
>>
>>56843690
>If you want dynamic content, you're going to need to have some kind of JavaScript-powered thing.

No. If you want dynamic content, generate it on the fucking server and serve my browser a nice, self-contained, "static" HTML document that I can view and save in its entirety without having to download and execute your buggy and slow JavaScript code along with 20MB of frameworks and libraries it depends on.
>>
Currently working on the ASCII Art challenge on codingame.com

the site has a lot better setup than the rather dry and boring practice sites i have experienced.
>>
>>56843609
there's a command line tool named "rails"
were you mad when you didn't receive a physical gem
>>
>>xxxxxxxx
Anyone use Lynx as their primary browser or this is just another meme?

>>56843848
I hate Javascript frameworks too (they were useful in the past with IE but are basically memes at this point), however raw vanilla Javascript is usually fine.
>>
>>56843934
>xxxxxxxx
I forgot 4chan censored passwords
>>
>>56843960
$z=398)
>>
>>56843916
Not him but I'm still waiting for my JavaBeansâ„¢ to make some sweet coffee.
>>
>>56843960
hunter2
>>
>>56843916
>were you mad when you didn't receive a physical gem

I'm still mad that scaffolding doesn't build REAL scaffolds.
>>
>>56843897
This site could be so much better though.
>Bloated
>Boring step by step multiplayer games
>Servers take years compiling 3 lines of C
>Terrible artistic theme

It's made in France so...
>>
File: pdf.png (25KB, 616x877px) Image search: [Google]
pdf.png
25KB, 616x877px
DOCLAY FizzBuzz:

REGISTER i ARABIC 1 1;
REGISTER mod3 ARABIC 1 1;
REGISTER mod5 ARABIC 1 1;

DEFAULTS
SET
WHILE = "${i} <= 100",
IF = "${mod3} = 3 && ${mod5} = 5",
MAKENODE = "LAST, <line>Fizzbuzz</line>",
REGRESET = "mod3 = 0",
REGRESET = "mod5 = 0",
ELSE, IF = "${mod3} = 3",
MAKENODE = "LAST, <line>Fizz</line>",
REGRESET = "mod3 = 0",
ELSE, IF = "${mod5} = 5",
MAKENODE = "LAST, <line>Buzz</line>",
REGRESET = "mod5 = 0",
ELSE,
MAKENODE = "LAST, <line>${i}</line>",
ENDIF,
ENDIF,
ENDIF,
REGINC = i,
REGINC = mod3,
REGINC = mod5,
ENDWHILE,
FONT = "Courier";

LAYOUT P4Page:
BODY body (10mm, 10mm, 215mm * 280mm);
EOLAY

EODOCLAY

fizzbuzz in a proprietary SGML stylesheet language

pic related, it produces a PDF
>>
>>56844124
Is this the new self-obscurificating language everyone talk about?
>>
How could i block direct access to video on my server?
Is it possible?
>>
>>56844178
>block direct access to video
u wat
>>
>>56844120
you know anything better ? I am just happy it gets me programming every day.
>>
>>56844188
block something like
mysite.com/folder/video.mp4
Can i block that?
So videos can be only played through player?
>>
>>56844120

What are you trying to say, buddy? Our lord and savior OCaml comes from France!
>>
>>56844208
So it doesn't use the native HTML5 player and people can just right click download it?
I guess you can just write your own player but not sure how effective it'd be.
>>
>>56844208
Can't you just change the permissions on the server?
>>
>>56844208
yes you'd have to disallow direct linking (i.e, inspecting packets to make sure they're going to a webpage rather than the direct .mp4 video)

Porn sites do this sometimes to prevent downloading their videos
>>
>>56844205
I haven't tried but this looks interesting:
https://screeps.com/

The rules are too complicated for me. I would rather have something simple that let more freedom to your creativity
>>
File: real life anime.jpg (117KB, 800x490px) Image search: [Google]
real life anime.jpg
117KB, 800x490px
What's the difference between a for-in and a for-each loop?
>>
>>56844339

If it doesn't let you cheat with clever programming techniques, then it's not even worth it.
>>
>>56842254
Clojure.
Since you're familiar with Java already, you'll have access to all the familiar Java libraries; interop between Clojure and Java is painless.
>>
>>56843260
The anti-aliasing doesn't need to be very good to look acceptable with a constant-colour background.
As soon as you have transparencies, the edges have to be extra sharp or the whole image looks like shit.
>>
>>56844397
Assuming you're talking about Javascript, for-in can list properties in objects.

>>56844414
It's javascript only actually...
>>
>>56844468
>It's javascript only actually...

Javascript is plenty exploitable.
>>
>>56844339
>https://screeps.com/
Looks pretty fun.
>>
Currently working on creating a web scraper using Python but every now and then I get blocked for too many requests to the server.

Is there any way to randomize my IP address after a set number of web requests? Otherwise, any other suggestions as to alternatives to circumvent blocking would be appreciated
>>
What's the difference of between
curl -o myfile myurl
curl myurl > myfile
>>
>>56844543
you cant continue downloads with the second one.
>>
>>56844537
Crawl one page from multiple servers at a time, not multiple page from one server.
>>
am i considered a developer if i just publish a shitty app on google play and make a few bucks off of it?
>>
File: 1474948227954.jpg (27KB, 499x499px) Image search: [Google]
1474948227954.jpg
27KB, 499x499px
what's the best way to pack resources in a binary file to be used in python?
possibly something that's not pickle

let's say i have a project using multiple images that i don't want to leave around and i want every image packed into one file instead
>>
>>56844606
if by publish you mean you created it. then yes 100%. a lot of people talk the talk but never make anything, so you would be ahead of the population.
>>
>>56844578
Problem is that I'm scraping thousands of pages specifically from one website, so I don't think I can do that. I tried implementing a 60 second delay when the program catches a 500 error but still no luck.
>>
>>56844644
i really just took an apk and changed the shit in smali and asset files. then read the directions in google sdk and followed the instructions on how to publish it. it checked out fine.
>>
How do I convert a runtime assert to a compile-time static assert?
I need it to stop compiling if someone screwed with the member order of an enum type.
>>
>>56844644
>Implying we're people and not AI
>Implying this website isn't a one-to-one discussion with NSA
>Implying the population exists
>Implying implications
>>
von neumann was a god
>>
>>56844698
I'm still am, you fucking retard. A god can't die.
>>
>>56844757
i wonder if he hated gypsies
>>
>>56844773
There wasn't so many gypsies back then, now, to tell you the truth, I don't really care.
This other dimension is much cooler than your shithole and I can cuck Alan The Little Gay Bitch all the way.
>>
>>56844698
mfw people are von neumann machines of another species
>>
>>56844617
Easiest method would be to get a zip-like library and create an archive where you can store your images as you would store them in a directory.
>>
>>56844617
Tar is pretty standard, but consider just sticking with multiple files.

If you've got a ton of shit that gets updated and stored to disk at shutdown (state, binary resources, cache, etc), and you need to load based on complicated criteria, consider SQLite.

You can also just concatenate them all into a single binary file, and store the offsets and lengths separately or at the start of the file. That's more-or-less tar.
>>
i am going to learn c++, i am as of now installing anjuta and am reading the c++ programming language book
what are some tips for a noob l
>>
>>56844846
>Burn C++ book
>Learn C
>>
>>56844757
>>56844792
Church fixed circles around you
>>
i've never seen such hate for c++
you guys are alright
>>
Trying to figure out why my hash-dron collider won't work... ? Fuark
>>
>>56844862
This isn't hate. It's about protecting your mental health and preventing your lifetime from being sucked into a oversized circlejerking blackhole.
>>
>>56844801
>>56844833
thank you
>>
>>56844873
why are you passing an argument to md5
what
>>
>>56844873
Idk. I don't use that shit. Read the docs, especially that there is a proper error message there.

https://docs.python.org/3.6/library/hashlib.html#hash-algorithms
>>
>>56844925
>>56844936
Found the error. Had to tell py var i should be a string with utf-8 encoding before converting from hex. Time to wait and see how long it'll take to crack my pass.
>>
#include <iostream>

int main()
{
int v[]={1,2,3,4,5,6};
for(auto x : v)
std::cout << x;
return 0;
}

x doesnt name a type
what am i doing wrong
>>
Maybe I should re-think my variable names ...
tok->key.key = key;
>>
>>56844210
nigga u really learning OCaml now?
>>
>>56845053
nvm figured out i need c++11
>>
>>56845097
he hates haskell because it's too perfect and challenges his worldview
>>
>>56845083
still better than
t->k.c = f; 
>>
>>56845114
>haskell [...] too perfect

Sure, let me know when somebody is actually using software written in Haskell.

Nerd!
>>
>>56842194
I'm trying to get pip installation to work on my project, I've been fucking with this pypi website for like 2 hours straight, can anyone tell me what happens when you try to

pip install calcupy

or
pip3 install calcupy


I don't understand what I'm doing wrong and why python packaging is so fucking complicated
https://github.com/nick-gits/calcupy
>>
>>56845163
>i-it's not like I like haskell or anything! baka!
>>
>>56845175

reeeeeeee
>>
>>56845043
you're messing with us right
>>
Can your statically typed language do this?
data Fix f = Fix { unfix :: f (Fix f) }
cata f = f . fmap (cata f) . unfix
ana f = Fix . fmap (ana f) . f
>>
File: 4FRcu5G.jpg (111KB, 671x900px) Image search: [Google]
4FRcu5G.jpg
111KB, 671x900px
If I'm storing URLs in a trie for the purpose of making a web crawler that doesn't double-visit pages,
1. is a trie even a good data structure for this? I assume it is, given its nature and
2. Should I be storing by URL (I.E. a branch would look like >4chan.org > g > thread > 56842194) or should I be storing by character (I.E. a branch would look like 4>c>h>a>n>o>r>g>........)

I'm leaning towards a trie with url-based branches since it makes the most sense to me but I wanted to make sure I wasn't falling into a weird gotcha
>>
>>56845267
Thank god it can't.
>>
>>56845267
>non-termination
>>
>>56845267

My language does not support catamorphisms or anaphormisms.
>>
>>56845348
i don't think your language supports polymorphic recursion either
>>
File: 1469011019713.jpg (29KB, 600x456px) Image search: [Google]
1469011019713.jpg
29KB, 600x456px
>people use exceptions
>>
>>56845319
>trie with url-based branches
You're gonna have
Level 1: root
Level 2: every domain in the world
Level 3: maybe 10-20 pages per domain

If you're aiming for any kind of efficiency you'll have to do better than that.
>>
>>56845390
I'm not planning on having it search the entire web, the plan was to have it target a single website + all subdomains, subdirectories, and alternate servers (so imgur.com, irc.imgur.com.... etc)

The ultimate goal is to see if I can mine data out of blogs on tumblr
>>
>>56845371

That's correct.
>>
>>56845267
no, but it can have an 8k hello world binary instead of a 1.8 one
>>
File: chihiro is dog.jpg (42KB, 410x530px) Image search: [Google]
chihiro is dog.jpg
42KB, 410x530px
Rate my assert hack!
#define crash_if(x) for(; (x); assert(!(x)))
crash_if((IMPORTANT_NUM % 2) != 0)
{
printf("OOPS THAT WASNT EVEN");
something();
}
...
$ ./test
OOPS THAT WASN'T EVEN!
test: test.c:42: abloo_bloo: Assertion `!(IMPORTANT_NUM % 2 != 0)' failed.
Aborted


The best part is you can use it like crash_if(expr); without the if statement because the semicolon ends the for loop.
>>
>>56845482
1.8 < 8000
>>
I'm writing C after years of Java

Doing anything with strings is so, so tedious in this language
>>
File: 1455758460481.png (304KB, 500x500px) Image search: [Google]
1455758460481.png
304KB, 500x500px
>>56845502
I would say the same for Java
>>
>>56845502
t. I don't know what string.h is
>>
>>56845525
I know what string.h is. String manipulation is still tedious.
>>
>>56845498

I don't follow. Can you write a proof?
>>
>>56845495
How is that better than
if (expr)
{
printf("oops that wasnt even");
exit(-1);
}
>>
>>56845380

Why not? They do what I need them to do, and in a reliable fashion.
>>
File: 1444688795718.jpg (854KB, 1920x1200px) Image search: [Google]
1444688795718.jpg
854KB, 1920x1200px
I'm trying to populate a linked-list from a text file. For some reason the link that I'm using as a beginning is getting populated along with the actual list. Anyone know why?


link data, head;// data will traverse, head will be the beginning
FILE *fpointer;
fpointer = fopen(argv[1],"r"); //opens file name passed in, read only
char singleLine[20];
while(!feof(fpointer))
{
char* test = fgets(singleLine,20,fpointer);// holds line that will populate list
if( i == 0)
{
head = malloc(sizeof(struct node));
head->item = fgets(singleLine,20,fpointer);//stores first line in head.item
head->next = NULL;
data = head;
i++;

}

else
{
data->next = malloc(sizeof(struct node));
data = data->next;
data->item = test;
}


}
fclose(fpointer);
data->next = NULL;
>>
You mean that everything points to singleLine, is that it?
>>
>>56845811
>char* test = fgets(singleLine,20,fpointer);
>head->item = fgets(singleLine,20,fpointer);
fgets just returns the buffer you passed in, and doesn't allocate any new space.
So every node you're creating has the same pointer to 'singleLine'.
>>
>>56845502
This is why you shouldn't use C.
You should *learn* C, but you shouldn't use it. It's a painful language for doing anything remotely high level (see: doing anything at all).
Lisp is best language
>>
>>56845502
What in particular are you finding tedious?
>>
>>56846011
>Lisp is best language

Not only that, but it existed BEFORE C and also did everything right. If only we'd put more faith in that jew McCarthy.
>>
>>56846070
Not him, but:
Rewrite the following 4-line Python script into C:
fh = open("file.txt")
for i,line in enumerate(fh):
words = len(line.split())
print("{} {} in line #{}".format(words, "word" if words == 1 else "words", i + 1)

That'd probably be atleast 20 LOC in C

>>56846138
;-(
I'm going to reinvent computers and do it correctly this time around
>>
>>56846011
> Lisp is best language
is that just a meme? or do you really mean what you say? I never understood why people like Lisp, on the other hand i never really looked at it as all the brackets gave me headaches. However im grateful that Haible developed libffcall because of Lisp (i have it replaced by a custom lib with similar functionality nowadays though)
>>
File: evil-laugh.webm (844KB, 1280x720px) Image search: [Google]
evil-laugh.webm
844KB, 1280x720px
MFW C/Lisp cucks devote their lives to making useless low-level garbage for free on github while i have a job with 80k starting after spending 8 months learning java
>>
>>56846173
Lisp does a lot of things right from the start, and then everything it doesn't get right you can just make a macro to implement literally any feature.
My current favorite language right now is Racket, it's a simple Lisp with excellent documentation and a ton of awesome tools. If you can find a single feature of Python or Ruby that Racket doesn't already have, it can probably be implemented with a few macros. It's honestly so comfy, it's everything I could ask for.
>>
>>56846182
>hating yourself and selling out to capitalism in a shitty code monkey Java job
Were you supposed to sound convincing?
>>
>>56846169
>I'm going to reinvent computers and do it correctly this time around

Best of luck.
>>
>>56846138

I'd be more inclined to use Lisp if I could find a viable use for it that I can't already do rather well with either C++ or Ruby.
>>
>>56846258
What are you making?
>>
>>56846258

I'd be more inclined to use it if I hadn't been brainwashed to program in C-likes. The brackets and semicolons have been seared into my brain.
>>
>>56846138
>dynamic typing
>parens everywhere
It's nice, but it hardly did *everything* right.
>>
>>56846277
>brainwashed to program in C-likes
>he thinks null termination and array decay are normal, acceptable things
That's so sad anon.
>>
>>56842419
Go (golang)
https://www.reddit.com/r/golang/comments/552gfp/go_has_spoiled_me/
it has some odd things, but, overall, it's just awesome
>>
>>56842680
>The /dpt/ is more of a discussion of the act programming than /wdg/ is.
have you tried actually reading these threads? it's always basic shit, "do my homework", "what language should I learn", "my lang > your lang", etc.
>>
https://docs.racket-lang.org/reference/concurrency.html
Racket even has the equivalent of Goroutines and Go channels
>>
>>56844663
you have to reset your requests.Session() object every so often
>>
>>56843670
https://en.wikipedia.org/wiki/Progressive_enhancement
>>
>>56846354

RITCHIE DID NOTHING WRONG! RITCHIE DID NOTHING WRONG! IT'S JUST THE WAY THINGS WERE!
>>
Why was null termination even used? It makes everything O(n) when it could be O(1) and it saves a negligible amount of memory compared to storing the string's length.
>>
>>56846503
>It was okay to enslave black people then, so it must still be okay now, right?
mfw C fags literally think like this

>>56846512
Back then, they thought that storing the length of an array alongside a pointer to its contents was too memory intensive. Yep. 4 extra bytes that could be put into a register was unacceptable overhead. Talk about premature optimization for christ's sake.
C could have been defined with tuples and first-class bounded array syntax and it literally would make the langauge 10x comfier to use, but C was literally designed to be easy to implement a compiler for. It's the biggest virus in computing history.
>>
>>56846398
You know what? That's probably a good idea.
I asked a quesiton earlier about ASP.NET that wasn't answered, but it applies to Go as well. How much is hosting a Go web application going to cost me?

>>56846512
It's the best (and worst?) of both worlds, in a way.
If you want to store the string's length you do it yourself and get your O(1).
>>
>>56846549
>if you want to store the string's length you do it yourself and get your O(1)
And then you have to rework the entire library ecosystem to work with your new custom array type, and you still have major troubles coping with strings that have nulls in them. Because an ascii string isn't ascii if it can't cope with nulls. Been there, done that, found it easier to abandon C altogether.
>>
File: gms_logo_en.gif (214KB, 640x480px) Image search: [Google]
gms_logo_en.gif
214KB, 640x480px
>>56845883
>>56845982
Thanks for pointing out where the problem was. I was able to fix it using fscanf and declaring the size of the array in the nodes. 1st week using c and I would have never been able to figure that out.
>>
File: Lanka 26.png (66KB, 265x293px) Image search: [Google]
Lanka 26.png
66KB, 265x293px
>tfw too stupid to understand Haskell
>>
>>56846169
#include <stdio.h>
#include <string.h>

int main()
{
char buf[256];
int i = 1, n = 0;
freopen("file.txt", "r", stdin);
while (fgets(buf, sizeof buf, stdin))
for (char *p = buf; p && *p; p += strspn(p, " \r\n\t\v"), ((p = strpbrk(p, " \r\n\t\v")) && ++n) || (printf("%d word%s in line #%d\n", n, n == 1 ? "" : "s", i++) && (n = 0)));
}

11 lines.
Only 1 statement per line.
3 lines are "trivial" (blank or '{', '}').
3 lines of language "overhead" (#includes, and int main()).
So 4 significant lines.
I can think of some ways to save even more lines, but that would require some changing some shit with how the program is called and some pointer conversion shit.
>>
>>56846512
None of BCPL, B, or C supports character data strongly in the language; each treats strings much like vectors of integers and supplements general rules by a few conventions. In both BCPL and B a string literal denotes the address of a static area initialized with the characters of the string, packed into cells. In BCPL, the first packed byte contains the number of characters in the string; in B, there is no count and strings are terminated by a special character, which B spelled `*e'. This change was made partially to avoid the limitation on the length of a string caused by holding the count in an 8- or 9-bit slot, and partly because maintaining the count seemed, in our experience, less convenient than using a terminator.
Individual characters in a BCPL string were usually manipulated by spreading the string out into another array, one character per cell, and then repacking it later; B provided corresponding routines, but people more often used other library functions that accessed or replaced individual characters in a string.
>>
>>56846613
>So 4 significant lines.
Mistyped. 5 significant lines*.
>>
>>56846169
python isn't a real programming language though but ok
>>
>>56846613
Meanwhile the Python example wasn't cutting absurd corners, and if it was, then it was only cutting out a single line (e.g. the ...if...else expression for appending the "s" in case of multiple words).
>>
>>56846549
>How much is hosting a Go web application going to cost me?
it compiles to a binary, so... feasibility depends on the server. I myself am running a website in redhat's openshift (uses amazon) for free.
if you ever manage to get lots of users, you'll save lots of resources (i.e., $$$)
my suggestion: start here https://tour.golang.org/
then read docs and some blog posts: https://golang.org/doc/ and if you need help, you can ask in that subreddit, or in https://webchat.freenode.net/?channels=go-nuts , or the mailing lists, etc.
Go is pretty easy to learn, except for a few things...
>>
>>56846587
>And then you have to rework the entire library ecosystem to work with your new custom array type
not really, most string functions work without knowing the size
and those that do need to know can be easily avoided by using something else.
>>
>>56846613
>>56846661
>stockholm-syndrome C fags this delusional
>>
>>56846661
>most string functions work without knowing the size
But they're O(n).
>>
>>56846672
Yes, I know my C example is 'shit'.
I just decided to interpret what he said a code-golf challenge (except for lines).
>>
>>56842194
How do you people stay productive?
Pomodoro? Trello? Distraction free setup?
I'm really stressing out on how little work I achieve on a day.
>>
>>56846685
Every basic string function in other languages (besides strlen) are O(n) or worse.
>>
>>56846706
They don't have to be.
>>
>>56846694
i have work as part of my routine. i don't work that many hours a day, but i work every day without fail
>>
>>56846613
Really? REALLY?
>>
>>56846710
You are incorrect.
>>
>>56846685
i mean they dont need to calculate the size at all.
they just keep going until they hit null.
>>
>>56846720
>>56846721
What are some functions that have to be at least O(n) even if you know the size?
>>
>>56846725
palindrome detector

reverse
>>
>>56846710
Please explain how knowing the length in advance is going to make string copy, search, or comparison faster (in the big O sense).
All I can think of is maybe string concatenation with will be O(m) instead of O(n + m).
>>
>>56846738
Right, because those are very useful functions in practice.
>>
>>56846725
search for first occurrence of a substring
>>
>>56846742
compare
>>
a pure shitposting device using a Cortex M board that can only render 4chan, do JS-less captcha and show images with a 5 inch LCD
>>
>>56846749
analyze the strings of the posts you're replying to before you reply to them
>>
>>56846755
I suppose this is getting away from just plain algorithmic complexity, but if you know the size ahead of time you can do things like compare, copy, etc. in parallel.
>>
>>56846764
Yeah I realised that, so I deleted my post.
>>
>>56846749

Smart languages prefix the string with important information like size, whether or not it's a palindrome, the reverse of it, etc.

Sure, it ends up being a large space requirement, but that's fine.
>>
>>56842242
Programmer is fine. Only kiddies who've done their first tutorial in C++ or Java get elitist about "scripting vs programming". Unless the Python you are doing is a highly specific use in part of a greater system, then it's fair to call it programming.
>>
>>56846169
14 LOC in C89
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void) {
unsigned int i = 1, w;
char *t, l[1024];
FILE *f;
f = fopen("file.txt", "r");
while (fgets(l, 1024, f)) {
for (t = strtok(l, " "), w=1; t; w++, t = strtok(NULL, l));
printf("%d %s in line #%d\n", w, (w > 1) ? "words" : "word", i++);
}
return 1;
}

13 LOC in C99
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void) {
unsigned int i = 1, w;
char l[1024];
FILE *f = fopen("file.txt", "r");
while (fgets(l, 1024, f)) {
for (char *t = strtok(l, " "), w = 1; t; w++, t = strtok(NULL, l));
printf("%d %s in line #%d\n", w, (w > 1) ? "words" : "word", i++);
}
return 1;
}

Neither triggers any warnings in GCC.
>>
how do i make recursion trees?
>>
>>56842242
It's all programming. Whether you're scripting or developing a library/application/whatever depends on what you're making, not the language you use. That said, Python is good for scripting and not general development.
>>
>>56846853
Each call is a node. When you have a recursive call, you add a branch to that node from the current node.
>>
>>56846826
>#include <stdlib.h> but doesn't use it
>return 1;
>C99 warnings:
test2.c:9:40: warning: declaration shadows a local variable [-Wshadow]
test2.c:10:39: warning: variable 'w' is uninitialized when used here [-Wuninitialized]

>C99 solution doesn't even work
>>
>>56846878
can you give an example? i watched so many videos about it my mind is blown and i'm not even sure what i can call a recursive tree
>>
>>56845165
Are you on windows? python is much easier on Linux
>>
>>56846893
Apparently my gcc is too old to have -Wshadow, and I just missed the rest because I used to do some overcomplicated malloc() magic and forgot to get rid of stdlib. How embarrassing.
>>
File: tegaki.png (4KB, 400x400px) Image search: [Google]
tegaki.png
4KB, 400x400px
>>56846904
def fib(x):
if x < 2:
return x
return fib(n - 2) + fib(n - 1)
>>
>>56846878
data Tree a = Leaf a | Node a (Tree a) (Tree a)

instance Functor Tree where
fmap f (Leaf v) = Leaf (f v)
fmap f (Node v l r) = Node (f v) (fmap f l ) ( fmap f r)
>>
>>56846942
Ew
>>
>>56846942
>Python
>tail recursion
RIP the stack.
>>
File: 1468432570889.jpg (71KB, 500x375px) Image search: [Google]
1468432570889.jpg
71KB, 500x375px
>>56846942
many thanks
>>
File: 390cadf63a[1].png (26KB, 625x441px) Image search: [Google]
390cadf63a[1].png
26KB, 625x441px
Can someone explain to my why the submitBTN_click1 counter isn't working?

>C# webform
>assigned integer count to 0
>upon submit button click, ++count and display text (as well as guess, which all works)
>it counter counts only from 0 to 1, then does not count beyond 1

I'm sure I'm overlooking something very simple.
>>
I have come to the realization that the most practical languages today are C++ and C#.

This is deeply troubling.
>>
>>56846971
that's not tail recursion
>>
>>56846971
That's not even actually tail recursive
>>
>>56846971
that's not even tail recursion
>>
>>56846958
Wow, anon, you're so smart and clever and attractive!
>>
>>56847058
I feel lik you're looking down on me
>>
File: axhost.png (16KB, 417x334px) Image search: [Google]
axhost.png
16KB, 417x334px
Fuck microsoft.
>>
>>56847072
For not answering the question and instead taking the mention of recursion and trees to make a binary tree in Haskell and bizarrely implement Functor for it. First of all, "recursion tree" is something different. Also, that Haskell is entry-level.
>>
>>56847083
GENTOO
E
N
T
O
O
>>
>>56846971
i used to make the same mistake you did when all i was told about tail recursion is that it's when the last thing is a recursive call. i realized what it was when i was reading SICP in my free time last summer and was drawing out a recursion tree
>>
>>56846853
>>56847084
just call a function more than once senpai
>>
OK what the fuck is a GOPATH, and why do I need to set it as an environment variable? That's a massive pain on windows. Can I only ever have one Go project active at the same time? Who comes up with this shit?!
>>
>>56847095
Well, it's true. That's what tail recursion is. However, the last thing in that function is addition.
>>
>>56846984
I haven't touched ASP.NET in like 8 years, but why would you expect your class instance to survive across round-trips?

Each request constructs your class anew. If you want count to survive, you need to store it somewhere durable like in a session or I think I remember a mechanism that serializes just that kind of state and puts it in a hidden form field. I forget what it was called.
>>
>>56846984
static int count = 0;
>>
>>56847108
You can set per-process environment variables even under windows. You just have to write a .bat wrapper.
>>
>>56847084
how else wuld you instance that tree?
>>
>>56847126
Why did you even implement Functor in the first place? That's what's bizarre. It has even less to do with the question.
>>
>>56847125
>You can set per-process environment variables even under windows. You just have to write a .bat wrapper.
??? Did no one stop to think for one second about how fucking dumb this is? Or am I missing something?
>>
>>56847108
>That's a massive pain on windows.
Windows key.
e-n-v, enter.
alt-n (to click on the New button)
GOPATH, tab
ctrl-v, enter, enter

That's not difficult.
>>
>>56847110
i know it's true, but it's not a useful explanation to people who don't know what it is. the novice sees the last thing written in the code is fib(n - 1) and assume that's the last thing that happens in the function
>>
>>56847123
>>56847115
kek, yeah all I needed to do was set count to static

thanks dudes
>>
>>56847138
Ask microsoft, not me. I'm not the one who decided to reinvent the wheel instead of reusing the elegant and powerful environment syntax from UNIX that literally every other major OS vendor implements.
>>
>>56847155
There's no more useful explanation because that is literally what a tail call is. If a recursive call is the last thing that happens (besides returning its value), it's a tail call.

The problem is thinking that the last thing written top-down, left-to-right is the last thing that happens, which has nothing to do with recursion. It's easier to see what the last thing to happen is if you're in a functional language, but it's not difficult to show that it's not a tail call in any language.
>>
>>56847108
>That's a massive pain on windows
>windows
you are >>56842419 and >>56846549, right?
I've never compiled Go code under windows... but I guess you are overreacting, m8. you do NOT need the compiler to run a Go program. also, it's not difficult to setup the compiler/toolkit.
anyway, you should use a linux VM, IMO. it won't take you a lot of time to setup one, install the Go toolkit and make a backup of the VM. also, it's really easy to cross compile a windows binary
>>
>>56847108
is it that hard? yikes
GOPATH lists directories where import should look for packages. you can put as many directories in there as you like
>>
>>56847155
That's because of "friendly" programming languages that use this stupid thing they call "infix notation". So confusing. Sexps are much clearer in that regard.
(+ (fib (- n 2)) (fib (- n 1)))

When put like this, not even a fool would think that the addition happens first.
>>
>>56847225
>better make everything more verbose because some retards can't parse infix
>>
>>56847225
>Sexps

are sexy.
>>
>>56847197
actually just read the top bit here
https://golang.org/pkg/go/build/
>>
>>56847190
>>56847197
Yes it was an overreaction based on a misunderstanding, my bad. I was already at the end of my patience from earlier. I could hve used a VM, I have one set up, I just felt like trying windows this time.
>>
>>56847225
fib 0 = 1
fib 1 = 1
fib n = ((+) `on` fib `on` (n-)) 2 1


What's the problem?
>>
NEW THREAD!

>>56847278
>>
>>56847263
The problem is that you are using closed recursion.

fib' r 0 = 1
fib' r 1 = 1
fib' r n = r (n-2) + r (n-1)

fib = fix fib'
fastfib = memofix fib'
>>
>>56847335
Why don't you reimplement this using a tree hylomorphism?
>>
>>56847361
Presumably that's what memofix does. I never gave the implementation.
>>
>>56842194
python script that scripts the use of cli h@k3r tool 1337! for use on pwn phone. Fucking hate typing on soft keyboard, Auto plz...
Thread posts: 319
Thread images: 25


[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.