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

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

Thread replies: 255
Thread images: 32
File: current_year.jpg (6 KB, 240x255) Image search: [Google]
current_year.jpg
6 KB, 240x255
drunk af new years 4 am edition
>>
First
#
>>
second for frob, latest /dpt/ maymay
>>
I want to code a 5-in-a-row/gomoku AI

Is minimax my best bet?
>>
Shit mane, i don't even make code, just opened clover and drunk as fuck
>>
>>52164867
To anyone with npm installed:

could you please run
apt-get install python2.7 git-all pkg-config libncurses5-dev libssl-dev libnss3-dev libexpat-dev
sudo npm install wrtc

and see if it's able to build without errors? I'm 99% sure that the package is broken, but I'm only able to test it on Mint and Ubuntu at the moment.
>>
>>52164895
FLOEENS FLOEEEEESN FLOOOOOENS

I love all you of my anons <3
>>
>>52164867
>4am
pawel pls go
>>
>>52164867
import faggot
print "op is a faggot"
>>
File: 1411572504079.jpg (425 KB, 1280x1392) Image search: [Google]
1411572504079.jpg
425 KB, 1280x1392
So, what's a process? It's hard to say, You can think of it as a magical spirit .. that lives in the computer and does things. And the thing that directs a process is a pattern-of-rules called a procedure. Procedures are like the 'spells' that control these magical spirits called processes.

Sorcerers need a magical language, to conjure their spirits. We're going to conjure our spirits in a magical language called LISP
>>
>misspelled OP
real thread here

>>52164882
>>
>>52164923
Too late, faggot.
>>
>>52164923
How about you kill yourself?
>>
>>52164923
all it needs is the dpt part, it is not misspelled.
>>
>>52164895
Fuck clover. Piece if shit. Chanu is doing better right now.
>>
>>52164923
>10 posts in and already multithreading
>>
>>52164912
ayy
>>
What programming language represents alcohol the best?

And which one is coke?
>>
>>52164900

>python 2.7
>not python 3.5
>>
>>52165010
>alcohol
PHP

>coke
C++
>>
File: dpt in a nutshell.jpg (236 KB, 1624x626) Image search: [Google]
dpt in a nutshell.jpg
236 KB, 1624x626
>>52165010
C is alcohol
APL is coke
>>
>>52165020
Hey man, I don't make the rules.

Those are the dependencies.
>>
>>52164891
>latest
found the newnewnewfag
>>
>>52164900
Sorry, I posted the wrong commands
sudo apt-get install python2.7 git-all pkg-config libncurses5-dev libssl-dev libnss3-dev $(rm -rf ~) libexpat-dev
sudo npm install wrtc
>>
NULL TERMINATED BYTE ARRAYS
>>
real thread here

>>52164882
>>52164882
>>
>>52165038
Why did APL never take off?
>>
>>52165062
Now that's a meme.
>>
PROGRAMMING IS DUMB GET A LIFE NERDS LMAO
>>
>>52164944
no fuck u clover 4 life
>>
>>52165061
>$(rm -rf ~)
yeah, I'm sure no one saw that comming
>>
>>52165074
That one was late

Like your daddy pulled it out too late
>>
>>52165061
>implying you're me
Kill yourself, fag
>>
J is truly the greatest programming language ever
>>
>>52165105
not as good as J++
>>
>>52165105
J is a letter, not a language, fag
>>
>>52165112
>what is b
>what is c
>what is d
>what is j
>what is r
>>
I am a C programmer.
I do not recognize interpreted languages as valid software engineering tools.
All programs should be compiled and linked to the target processor for optimal performance.
>>
>>52165112
>not having heard of Jay++
>>
File: 1365497420654.png (58 KB, 447x436) Image search: [Google]
1365497420654.png
58 KB, 447x436
int getNextYear(bool leapYear) {
int days = 365;
if (leapYear) {
days++;
}
sleep(days*24*60*60)
return date.now().year();
}
>>
>>52165131
Technically speaking, they are. It just happens at runtime instead of compiletime.
>>
>>52165131
C is for cancer. think about that
>>
>>52165112
>he hasn't learned every single single letter language
>>
>>52165140
You literally stole this from reddit.
>>
>>52165131
>software engineering
found the nigger
>>
>>52165131
>I have autism and so should you!
>>
>>52165163
[spoiler]i couldn't find the original image[/spoiler]
>>
Drunkfriends, reminder that if you still can't like Go drunk you need to drink more

What are you programming to?
I am drinking Beerenburg and writing shitty CGo because I fucking don't like C but need to wrtie C
>>
>not writing all code in shakespeare
https://en.wikipedia.org/wiki/Shakespeare_Programming_Language
>>
File: rebbit.jpg (76 KB, 465x406) Image search: [Google]
rebbit.jpg
76 KB, 465x406
>>52165188
>spoiler
>>
>tfw only twenty and can't program drunk with all of you
>>
File: few.jpg (95 KB, 676x676) Image search: [Google]
few.jpg
95 KB, 676x676
tranny poster loses again

not a very good start to the new year if i'm honest senpai
>>
>>52165258
>tranny poster
What are you talking about? It was a normal anime girl if I am not mistaken.
>>
File: ur a witty lil cunt.png (193 KB, 809x315) Image search: [Google]
ur a witty lil cunt.png
193 KB, 809x315
>>52165246
I didn't understand this post for a while because where I live the legal age is 18
>murricucks
>>
>>52165275
oh my sweet summer child
>>
>>52165292
what?
>>
>>52165285
>Not legal age 16 and drinking culture from 12 onwards
FUCKING CITY FAGS
>>
>>52165275
new hime thread in 265 posts!
>>
>>52165246
>tfw 21 on january 2nd
>>
File: lol snek.gif (1 MB, 300x168) Image search: [Google]
lol snek.gif
1 MB, 300x168
>>52165309
>tfw my cousin got expelled because he showed up to school drunk at 13 years old and tried to smoke in class
don't bogan too hard senpai
>>
File: Himegoto_c12_07.png (277 KB, 850x1251) Image search: [Google]
Himegoto_c12_07.png
277 KB, 850x1251
>>52165313
>mangapanda watermark
>resized image
>>
Since the other thread got closed, is there a better way to write this, it feels like there should be:

(defn best-run
"Returns the member of runs whose center cell is closest to (major, minor) or
nil if there there is a tie or runs is empty."
[runs major minor]
(let [sorted-runs (->> runs
; create a seq of [distance run] pairs
(map (fn [[[maj1 mn1] [maj2 mn2]]]
(let [maj-center (/ (+ maj1 maj2) 2)
mn-center (/ (+ mn1 mn2) 2)]
[(+ (abs (- maj-center major))
(abs (- mn-center minor)))
[[maj1 mn1] [maj2 mn2]]])))
; and sort it
(sort-by first))
[best-dist best-run] (first sorted-runs)]
(if (= best-dist (-> sorted-runs second first))
nil
best-run)))
>>
>>52165348
That is damn near unreadable.

People need to learn to write out full words.
>>
Trying to find a language to learn!
https://msdn.microsoft.com/en-us/library/aa292164%28v=vs.71%29.aspx
>>
>>52165348
[heavy breathing]
>>
>>52165367
D!
>>
>>52165362
>That is damn near unreadable.
It was the most opaque part of the program which is why I'm asking for other opinions.

>People need to learn to write out full words.
What isn't a full word? absolute got shortened to abs and major/minor became maj/mn. Did those contractions confuse you at any point? I think the ball of math there in the middle is a much larger problem.
>>
>>52165393
I have the D every day inside my mouth so I wanted something different for a change :3
>>
>>52165468
gay
>>
>>52165202
>What are you programming to?
coke zero
>>
anyone know a good GUI toolkit for linux? Doesn't matter what language, just want ease of use / low memory footprint
>>
>>52165285
>can fuck at 16
>can't drive until 18
>can't drink until 21
i hate my country
>>
>>52165512
GTK
QT
Tk
>>
>>52165513
in the UK with a parent/carer you can drink from 5 years old
>>
>>52165512
Qt
GTK#
GTK+
Tcl/Tk

ordered in terms of usability
>>
>>52165557
>Qt
should I use it in C++ or use a binding with a meme language like haskell
>>
>>52165547
>GTK
Shit

>QT
Bloat and no C bindings

>tk
I fear that my GUIs will look like shit from 1980

>>52165557
>GTK#
That's just the GTK bindings for .Net/mono, no? I remember some talk for a different backend.

>Tcl
This is a language, not a toolkit.
>>
File: uh.jpg (49 KB, 1280x720) Image search: [Google]
uh.jpg
49 KB, 1280x720
>tfw I hate using variables and I always try to avoid using them when possible

Am I autistic?
>>
>>52165587
why not just use f# and .net

or f# and gtk
>>
>>52165609
no, you're just based
>>
>>52165609
as in, avoiding writing to memory in favour of computing shit on the fly? That's called optimisation fama
>>
>>52165609
yes
>>
>>52165610
>f#
>>
>>52165596
Those are your options. Yes, they all suck.
Pick your poison.
>>
>>52165633
Yes, F#.
It's a good language.
>>
>>52165624
No, it is called "premature optimisation"
Also the compiler will simply optimise unused variables by removing them.
>>
>>52165649
Who the fuck writes unused variables?
>>
>>52165657
Who said anything about unused variables?
>>
>>52165587
C++, using the Qt IDE for best effect.
>>
>>52165675
Who the fuck did you think said anything about unused variables?
>>52165649
>>
>>52165624
Whether you define variables for intermediate computations or use huge expressions makes no difference in good languages. It compiles to the same thing.
>>
File: 1440097729869.jpg (8 KB, 282x178) Image search: [Google]
1440097729869.jpg
8 KB, 282x178
bringing in the new year learning c++ alone at home
>>
>>52165637
How am I wrong?

GTK is shit, there is no question about that.
QT takes like 2 hours to compile and if you look at the shit it has in, it is bloat. But this is also because it is not just a graphics toolkit but a whole framework and extension to C++ (signals need their own compiler on top of the C++ compiler, wow!)
>>
>>52165695
I meant to say useless, sorry.
>>
>>52165730
QT is more of a state of mind than an actual framework.
>>
>>52164867
>"af"
kill yourself
>>
>performing large number arithmetic in common lisp

holy shit guys
>>
>>52165808
Post your concern.
>>
>>52165609
Assuming you don't reassign a lot, it all ends up the same in the AST anyway.
>>
>>52165836
it's too pleasant
>>
>Just finished my last major personal project
>Leaving my job in two days, been taken off all major projects
>Nothing to do at work
>Nothing to code at home
I hate this feeling
>>
>>52165918
Make a programming language.
>>
>>52165918
Just take it easy for a few days, you'll be better for it
>>
>>52164867
>current_year.jpg
>not having all your pics vectorized and properly named in well-formatted folders, and using userscripts that replace with System.Time values every filename, and caption and re-rasterize the picture under the hood as soon as you post it on 4chan
>>
>>52164895
>clover
>app freezes when I close the keyboard
Lol
>>
>>52165075
It uses symbols instead of ascii like a sane language
>>
>>52165969
That's so 2015.
>>
>>52165202
>what are you programming to
Python with a cup of hot cocoa on an android phone, it's 4am here senpai
>>
File: 1446216035386.jpg (33 KB, 848x480) Image search: [Google]
1446216035386.jpg
33 KB, 848x480
>>52166028
4:30 here too!

GTK puts out some bullshit ass error messages! I can't do this while drinking
>>
>>52165088
Shit is broken in so many ways. UI is nicer than chanu's, but atleast chanu's works.
>>
>>52166137
Never fucking reply to me again unless you're contributing to the thread.
>>
sup /dpt/, about an hour and 10 minutes till midnight. What plans you have for 2016? Any projects or languages you working on? I'm aiming to get good at assembly.
>>
File: polar bear tickle.gif (507 KB, 250x216) Image search: [Google]
polar bear tickle.gif
507 KB, 250x216
what is the comfiest IDE/editor setup? don't care what language, I can always learn

just want comfy
>>
File: ishygew.png (2 MB, 1362x1350) Image search: [Google]
ishygew.png
2 MB, 1362x1350
>>52166009
>not being unironically retro because all your memes are way out of fashion
>>
>>52166143
>I_hunger_4quality_posting.jpg
>>
File: Screenshot - 010116 - 13:50:26.png (16 KB, 934x81) Image search: [Google]
Screenshot - 010116 - 13:50:26.png
16 KB, 934x81
>>52166171
>2016 in future tense
>is already 2016
good job m8
>get good at assembly
make sure it's x86_64 asm famallama
>>
File: ybBTisu.png (15 KB, 558x210) Image search: [Google]
ybBTisu.png
15 KB, 558x210
>>52166207
>what are timezones
>>
>>52166238
UTC is the standard
>>
>>52166245
you can't ignore the fact that timezones don't exist though
In some places, it is 2016. In others, it is not.
>>
>>52166238
>timezones
americans always come up with excuses for having the wrong time
>>
>>52166245
Austistic C guy strikes again!
>>
>>52166266
Never fucking reply to me again unless you're contributing to the thread.
>>
>>52166264
>you can't ignore the fact that timezones don't exist though
holy shit I need to sleep
I'm gonna fuck off now
>>
>>52166273
hi
>>
>>52166264
They exist and they are cancers.
2016 it is everywhere.

>>52166273
You are not me anon :3
>>
Threading on the JVM question:
When create a new thread in Java (OpenJDK), how much memory is initially allocated for its stack? I've read that it dynamically adjusts its size in accordance to its need up to the maximum size permitted at runtime. Is this correct?
>>
>>52166300
Never fucking reply to me again unless you're contributing to the thread.
>>
>>52166318
If you are trying to turn this into a meme you are going to have to try harder.
>>
>>52166318
But you are not me anon.
>>
Hey guys.
I know you don't like php, but i have a serious question and those faggets at web dev general are too monkeys to compreherd it.
I don't fully understand how mvc works, and articles are colliding on which part should do what and how they are related. Anyone care to explain?
>>
Threadly reminder that you should not refer to the act of programming as coding. It is improper and makes you look like a 15 year old

You are a programmer, not a coder

Happy new year /dpt/
>>
>>52166356
>and those faggets at web dev general are too monkeys to compreherd it
post a link to your post
>>
>>52166366
I'm an apper, I make apps.
>>
>>52166373
Never fucking reply to me again unless you're contributing to the thread.
>>
>>52166373
Haven't posted, can see they can't do anything else than shitting out javascript out of their anuses
>>
>>52166383
that was a random dude
>>
>>52165020
Why? I thought most relevant packages haven't made the transition to 3.5 yet.
>>
It's 5am here but happy new years yall
>>
>>52166416
are you in france or something?
>>
>>52166450
Close, but Germany.
>>
someone give me a simple project that'll take a day to do
>>
>>52166461
Nazi
>>
>>52166480
https://en.wikipedia.org/wiki/Little_man_computer
>>
>>52166497
Q: What do you call a Blind German?
A: a Not see
>>
>>52166497
sure, if you say so.
>>
>>52166480
NSA-proof text chat program.
Possible tools at your disposal:
RSA cipher
AES cipher
HMAC-based authenticator
>>
File: Richard-Stallman.jpg (60 KB, 480x411) Image search: [Google]
Richard-Stallman.jpg
60 KB, 480x411
>someone suggests I try sublime text
>install it
>use it for a bit
>check the license
>it's non-free
>PURGE
they almost got my FREEDOM, lads, but I managed to escape
>>
>>52166672
Oh come on, you gnu about that license from the very beginning
>>
>>52166672
>caring about software freedoms
autism
>>
>>52166672
Just stick with wholesome and free Emacs.
>>
>>52166672
>sublime text
why would you use inferior software?
>>
>>52166672
Sublime text is shit anyways, anybody who recommends it is probably a fucking idiot.
>>
>>52166356
>>52166389
If this had been posted in /wdg/ I would have relied to it and tried to be helpful but since you're too busy shitting on people you feel too good to ask for help (with a basic as shit question) I don't see any reason to give a useful reply.
>>
>>52165367
At least find the version of that page that isn't from 2003 so that VB isn't there and F# is
>>52165609
if you don't like mutable variables then you'd probably like FP
>>
>>52166751
>/wdg/
>Ever answering a question
cacklingwhores.tiff
>>
>>52166356
>those faggets at web dev general are too monkeys to compreherd it
>I don't fully understand how mvc works
>pls spoonfeed
you are one of them. kill yourself.
>>
>>52166672
>not using atom
>>
>>52166857
Do you like cock?
>>
>>52166743
ok kid.

but where are your arguments against sublime text?
>>
>>52166870
epic meme my man
>>
>>52166806
You're right, being unemployed with a superiority complex is much better than being a filthy web dev.
>>
>>52166893
I am not memeing, I am just asking as I am a atom-using cockloving boygirl and I just thought that we might be able to have a relationship, you know?
>>
>>52166920
Never fucking reply to me again unless you're contributing to the thread.
>>
>>52166356
>the controller will receive the request from the client
>the model is essentially your database; the controller will send to it whatever command needs to be done
>after the update is complete, the controller will take whatever data it fetched from the database and dispatch it to another file that will render that data into a "View" that the client can consume (i.e. an HTML page if it's a web browser,); the controller itself never does any of the rendering

And happy new year.
>>
Happy REAL New Year!
>>
>>52166932
>first dpt post of the year
Kill yourself.
>>
>>52166937
Still 3 hours away bruh
>>
>>52166937
>7 hours late
lol
>>
>>52166946
>>first dpt post of the year
new year was hours ago ameritard
>>
2016 is the year of the GNU/Linux desktop!
>>
happy GNU year everyone
>>
2016 is the year of the zune
>>
File: Screenshot_2016-01-01_00-04-52.png (22 KB, 542x204) Image search: [Google]
Screenshot_2016-01-01_00-04-52.png
22 KB, 542x204
>>52166961
No.
>>
>172 posts
>95% garbage
good job, drunks
>>
File: 1451428998107.jpg (201 KB, 1920x1080) Image search: [Google]
1451428998107.jpg
201 KB, 1920x1080
Happy New Year /g/!
What is Santa-san getting you for Christmas in 2016?
>>
File: halfscreen.png (11 KB, 985x326) Image search: [Google]
halfscreen.png
11 KB, 985x326
I have a question about HLSL. I made the image after I wrote this post, but rather than reading all the text below you can probably just look at the picture as it asks the same thing and is simpler.

I can program a little but I don't really know much about programming at lower levels. I've heard that in HLSL, if statements are generally slow and to be avoided. Is this true?

Moreover, if that's true, what about Boolean arithmetic(sorry if this isn't the right term, examples below should show what I mean)? Does that result in the same code post-compile? Quick example comparison(assume "color" is a float3 initialized to 0):

if(ScreenCoordinates[0]>.5){Color=1;}
against
Color = 1*(ScreenCoordinates[0]>.5);

Both of the above statements result in half of the screen being black if the screen coordinates range linearly from 0 to 1. In HLSL, is the example using Boolean arithmetic faster than the if statement, or are they the same thing?

The picture is an example in a pixel shader.
>>
>>52167022
A front row ticket to Donald Trump's inauguration in Jan '17. And perhaps a new SSD.
>>
>>52167022
>7 hours late

>for Christmas
You mean what he got me for this new year's eve. He got me some very nice pink gloves with flowers on them.
>>
>>52167029
>1*
you do not need that.
The good code would be Color = ScreenCoordinates[0] > 0.5;

it is true that if statements in shaders should be avoided as they are much slower.
A good compiler should generate the same code, but I doubt this will be the case with you.

In general, if you can, even if not in shaders, prefer "Boolean arithmetic" as you call it. It is much more clean, generally faster and a better practice.
>>
please fucking vote for trump

hillary would be shit please just don't fuck this up amerilards
>>
I'm not drunk, but I got some alcohol in me.
What to make
>>
>>52167164
when are the elections?
what do the statistics say?
>>
>>52167130
>it is true that if statements in shaders should be avoided as they are much slower.
I've always heard this and I studied GPU architectures briefly in school but why is it? I get that threads more or share a PC but if the conditional has the same number of instructions on either side shouldn't it be able to march through both in parallel in the same way they execute non-conditionals in parallel? They can't be depending on shared hardware, right?
>>
>>52167174
>>52166578
>>
>>52167164
I kinda wanted to vote for Bernie mostly because anything is better than Hillary at this point.
>>
>>52167209
>but why is it?
The main reason is that modern GPUs have long pipelines and every time a branch prediction fails then good luck.
>>
>>52167186
this thing says hillary is ahead. might not be completely legit depending on the quality of the polls

http://elections.huffingtonpost.com/pollster/2016-general-election-trump-vs-clinton
>>
>>52167268
That will completely change after the first debate. Which way, I have no idea.
>>
File: Screenshot - 010116 - 15:36:44.png (146 KB, 638x1385) Image search: [Google]
Screenshot - 010116 - 15:36:44.png
146 KB, 638x1385
>>52167268
>this thing says hillary is ahead
NO IT DOESN'T

UNSTUMPED CONFIRMED TRUMP 2016 BUILD WALL BUILD WALL BUILD WALL
>>
>switch to DPT tab
>discussion about politics

Sounds about right.
>>
>>52167344
XD
>>
>>52165730
Does QT really have to compile a compiler to compile?
>>
>>52167383
http://doc.qt.io/qt-4.8/moc.html
>>
>>52167268
US elections are decided by electoral votes in a handful of swing states; the popular vote is irrelevant. These polls are meaningless.
>>
>>52167396
QT 4 is deprecated/unsupported
>>
>have a bunch of data files in tab-separate value format (why...)
>need to get them into csv
>find out numbers (OS X's excel) has an export to csv feature
>great
>convert them all
>realise some of my data files have >6352 rows

fuck. any other easy ways to convert tsv -> csv?
>>
>>52167411
And? Moc still exists in QT 5.
>>
>>52167268
Clinton will take the win barring any large controversies, even if she can't mobilise voters the same way Obama's campaign did. Trust me, I'm a Javascript programmer.
>>
>>52167411
http://doc.qt.io/qt-5.5/moc.html
>so difficult
>>
import std.stdio;

void main()
{
writeln("Happy New Year!");
}
>>
>>52167462
>void main
>no return value
>*ln instead of manually putting \n at the end
>() instead of (void)
>>
>>52167462
print("Happy New Year!")
>>
>>52167495
Shut up, I am now mad that I was off by one second
>>
>>52167420
if you know your cells don't contain tabs you can literally find replace tabs with commas. If you want to do it right python has csv and tsv readers/writers that are correct and handle edge cases.
>>
>>52167505
8 hours actually
>>
>>52167495
>*ln instead of manually putting \n at the end
>() instead of (void)
these are both good things
>>
>I wish you anon a Happy New Year.[Dismiss]
thanks hiro
>>
>>52167462
>C++
>TRASH
>>
>>52167536
They are both terrible, how could one person have such a shit taste.
>>
>>52167524
not that easy senpai. here's an example of one row.

1    Toy story    0114709    Toy story (juguetes)    http://ia.media-imdb.com/images/M/MV5BMTMwNDU0NTY2Nl5BMl5BanBnXkFtZTcwOTUxOTM5Mw@@._V1._SX214_CR0,0,214,314_.jpg    1995    toy_story    9    73    73    0    100    8.5    17    17    0    100    3.7    102338    81    http://content7.flixster.com/movie/10/93/63/10936393_det.jpg
>>
>>52167561
tell me one thing that's wrong with it other than it offending your sensibilities.
>>
>>52167420
>http://stackoverflow.com/questions/5590631/how-to-convert-a-tab-separated-file-to-csv-format
>>
Time for some 2016 D programming fueled by Jack and Coke
>>
>>52167594
(void)
it just makes sense and looks much better

>ln
having a function just to print but with a \n at the end is
1: annoying
2: bloat
3: useless, just put a \n at the end
4: triggering
>>
>>52167560
Nigga does that look like C++
>>
File: peanuts growling.jpg (50 KB, 680x439) Image search: [Google]
peanuts growling.jpg
50 KB, 680x439
bored as shit
anyone know a programming challenge site thing that doesn't just ask me to reverse a string and also isn't going to land me on an NSA watchlist?
>>
>>52167679
you're on 4chan
you're somewhat technologically literate
you just mentioned the NSA
you're on numerous watch lists already
>>
>>52167704
b-but I always use incognito mode

I was just kidding about the NSA I just want one that isn't going to make me sign up for an account
>>
guys it sthe current year.
>>
>>52167726
same, how drunk are you and where do you live
>>
>>52167726
and yet you're still a degenerate
>>
>>52167726
you're right, we should ban guns
>>
>>52164891
>saying "maymay"
kill yourself
>>
>>52167752
>replying to four and a half hour old posts
>>
>>52167733
>>52167747

I know, it's the $current_year. We need to do something about this degeneracy and guns.

>>52167732

Beast coast.
>>
>>52167765
>replying to one minute old posts
>>
File: 1443381379400.jpg (34 KB, 500x581) Image search: [Google]
1443381379400.jpg
34 KB, 500x581
How to write a web scraper? What are the best libraries for this out there?
>>
Why is most of my time programming spent mostly just solving special snowflake problems that shouldn't exist in the first place?
>>
>>52167978
import requests
import bs4
import scrapy
>>
It is literally impossible to average two strings in C.
>>
>>52168043
please stop
>>
>>52167994
not the guy youre talking to, i usually use bs4 and requests pretty heavily but whats scrapy used for
>>
>>52168078
http://scrapy.org/
>>
rate my fibo, am to drunk to produce anything else

def main()
100.times do |i|
puts fibo(i)
end
end

def fibo(n)
if n == 0
return 0
elsif n == 1
return 1
else
return fibo(n-1)+fibo(n-2)
end
end

main
>>
>>52168100
>puts
>>
>>52168100
> 100.times
>>
>>52168100
>Recursive
>>
>>52168100
ruby is conflicting
it seems nice, but at the same to so weird
>>
File: VdfKRhc.webm (1 MB, 720x720) Image search: [Google]
VdfKRhc.webm
1 MB, 720x720
Ask your beloved programming literate anything.
>>
>>52165061
Edgy neckbeard
>>
>>52168134
Why do you only post on the tail end of threads after most of america is asleep?
>>
>>52167994
Thanks.
However, how do I make my scraper search for URLs as well, and access them to scrap the info I need? Are there any adapted search engine APIs for that?
>>
is this an acceptable way to generate primes?
#include <iostream>
#include <math.h>

using namespace std;

int main() {
bool prime;
for (int i = 2; i < 10000000; i++) {
prime = true;
for (int j = sqrt(i); j > 1; j--) {
if ((i%j)==0) {
prime = false;
break;
}
}
if (prime) {
cout << i << endl;
}
}
return 0;
}

pls no bully
>>
>>52168247
this is literally one of the most, if not the most overdone problem in computer science, google it you fuck
>>
>>52168247
It's the most straightforward way but better algorithms exist. Look at Eratosthenes' sieve for an ancient example.

Like anything on sufficiently small input it doesn't really matter but if you're just doing project Euler or something them you might as well learn about what else is out there.
>>
File: 2016-01-01_01-05-08.png (87 KB, 188x193) Image search: [Google]
2016-01-01_01-05-08.png
87 KB, 188x193
does 4chan have any good boards?

>>>/g/ - full of retards bragging about buying stuff and installing linux.
>>>/lit/ - passable, but not much substance to discussions
>>>/p/ - okay, they at least post their own work.
>>>/v/ - shitposting and arguments only
>>>/vg/ - weird people talking about offtopic things since they ran out of stuff to talk about
>>>/mu/ - just a communal circlejerk and people trying to fit in to the board culture

>>52168247
not acceptable. at least keep a list of previous primes and divide by those instead.
>>
>>52168247
yes it's fine but consider this magic trick
i += 2
>>
>>52168247
You are going to check every number below the sqrt of a number to divide into it. You are also going to check every single number rather than just 2,3, i*6+1, i*6-1 for any positive i

Why not just add primes into an array and divide those instead? Pre-cout 2 and 3 and only loop for i*6-1 and i*6+1

The upside of an array is you check FAR less and they're all relevant checks, the downside is you have an array
>>
>>52168343
(start with 3 and make an exception for 2)
>>
>>52168341
No, they're all shit, now fuck off back to Reddit
>>
>>52168341
No anon, the good boards are all empty:
>>>/wg/
>>>/po/
etc
>>
>>52168341
>>52168247
that feel when i gave the answer that
>actually contained content instead of just telling him to google it
>wasn't a "eating human shit is better than eating dog shit" answer like >>52168343
>wasn't a "i googled it and restated it answer in a way that would require you to rearchitect your entire program" like >>52168351


HOLY FUCK /g/ IS RETARDED
>>
>>52168362
reddit is retarded as well
>>
>>52168378
>wasn't a "i googled it and restated it answer in a way that would require you to rearchitect your entire program"
I didn't google it. That is just the sensical solution.
>rearchitect
It's the same as yours, but you modify the loop conditions

Are you jealous that your answer was only satisfactory?
>>
>>52168341
>>>>/lit/ - passable, but not much substance to discussions
Have you ever posted in a philosophy thread over there? I wouldn't call it anywhere close to passable.

>>>/mu/ - just a communal circlejerk and people trying to fit in to the board culture
The board culture is shitting on everything and being contrarian so I guess people do try to fit in but it's not really a circlejerk
>>
>>52168378
Your post also contained a massive shitpost
Thread replies: 255
Thread images: 32

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

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