[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: 346
Thread images: 46

File: dpt.png (717KB, 1000x793px) Image search: [Google]
dpt.png
717KB, 1000x793px
prev: >>61156820

What are you working on, /g/?
>>
>>61162895
First for C
>>
>>61162909
fpbp
>>
File: 1447379211630.jpg (32KB, 572x303px) Image search: [Google]
1447379211630.jpg
32KB, 572x303px
>read old-timey programming book
>no dicking around, straight to the point
>learn assembly in 8 hours
>read modern programming book
>authors constantly rehashing the same XKCD "jokes"
>graphics everywhere that server no purpose besides being """bad ass"""
>MEMES
>no real information
>>
File: 7waACCy.jpg (293KB, 1280x720px) Image search: [Google]
7waACCy.jpg
293KB, 1280x720px
>>61162895
thanks for using an image that respects personal freedom!
>>
>>61162930
You're choosing shitty books meant for people to "read" and claim they know x language.
>>
>>61162930
If they actually teach you what they know how can they sell more books?
It's better for the whole academic literature industry if they keep teaching to a minimum.

Same goes for universities. What they need to teach you is how to publish. Because that's how they get rated.

I don't see why you'd go to either of these if you wanted to learn. That's silly.
>>
>>61162998
>tfw the only diference between his garbage toon girls is the haircut
ayy lmao.
>>
File: 7ba.png (126KB, 500x320px) Image search: [Google]
7ba.png
126KB, 500x320px
>>61162930
a lot of modern texts suck and this is STEMwide. don't fall for the publisher jew.
>>
anzuchang is not a loli
>>
File: 1493306834231.jpg (66KB, 419x249px) Image search: [Google]
1493306834231.jpg
66KB, 419x249px
>>61163034
>>
>>61162930
Mind sharing the book on assembly?
>>
>>61162930
>>61163128
Another guy interested in it here.
>>
>>61162930
Honestly I agree... I'm going through SICP rn and I'm honestly surprised how much they can fit in a chapter.
>>
>>61162930
>>61163128
>>61163137
I'm not interested. Don't bother posting it.
>>
>>61163009
>keep teaching to a minimum
Better yet. If they teach the wrong things they can later 'correct' you (with other misinformation. That way they can keep the illusion of learning going for a long time.
Best field to do this in is software engineering where there's already a very large confusion about good practice. If you just stick to the old practices that have already been proven horrible at least a decade a go the chances that a person knows about it is small and it can be presented as 'time proven'.
It's amazing what society has been created here. Anons old books are clearly inferior. He learned assembly programming in 8 hours. What a waste!
>>61163128
>>61163137
No. Whatever he used is bad.
Use this: http://shop.oreilly.com/product/9781593272074
760 pages for assembly programming.
>>
File: z80.png (473KB, 716x1018px) Image search: [Google]
z80.png
473KB, 716x1018px
>>61163128
>>61163137
Probably not what you were hoping for
>>
File: old_hag_langs.png (173KB, 600x355px) Image search: [Google]
old_hag_langs.png
173KB, 600x355px
>>61162909
Good post.
>>
>>61162930
They had to dumb the books down to appeal to women, trannies, and individuals of color.

Expecting these people to actually learn and master a subject is racist, anon.
>>
>>61163066
Yeah, she's 2000 years old! Totally not pedo btw.
>>
>>61163228
>old hag langs
rude
>>
File: 1485473684854.png (408KB, 824x792px) Image search: [Google]
1485473684854.png
408KB, 824x792px
>Writing C library
>Use C11 features in public headers
>Sepplesfags can't use it
>>
>>61163692
Good.
>>
What is the K&R of C#?
>>
>>61164067
http://www.shalusharma.com/how-to-use-the-indian-squat-toilet/
>>
If you want to learn assembly just read this, it's not that hard.
>>
>there are people ITT who don't wear programming socks while koding
What's your excuse?
>>
I'd like to make a roguelite game, but not sure which would be the better starting point for an engine. Any anons have any ideas?
/v/ rarely has threads open for me to ask, otherwise I'd ask there since it'd be more appropriate.
Thanks for any help!
>>
>>61164067
CLR via C#
>>
File: 1464671963708.webm (1MB, 720x404px) Image search: [Google]
1464671963708.webm
1MB, 720x404px
>>61164169
Socks won't protect you from this shit, m8
>>
>>61164180
>>>/vg/agdg
>>
>>61164212
Oh cool, didn't realise /vg/ was a thing, thank you.
>>
>>61164227
Welcome to 4chan, I guess.
>>
>>61163307
That's because straight cis white men don't read anymore.
>>
>>61164169
>What's your excuse?
I've got cute feet.
>>
>>61164207
Spiders are friends :(
>>
File: 1464046749326.webm (3MB, 720x404px) Image search: [Google]
1464046749326.webm
3MB, 720x404px
>>61164389
I'll fuck you up, m8
>>
>>61164413
what is this
>>
>>61164413
I don't think that's a spidey.
>>
>>61164389
I also agree with this to some extent. If you hate bugs, leave the spiders alone.

If there's too many spiders, kill them but that also means there's too many bugs to feed them.

Decisions and stuff. At least spiders don't buzz in your ear.
>>
>>61164413
>>61164421
>>61164430
I was correct. It's a different order of arachnid.
It's called an "African tailless whip scorpion" or Amblypygi.
>>
>>61164421
Whip spider

>>61164472
They're arachnids, they're spiders
>>
does it worth to use netbeans to learn java or should i use eclipse/intelliJ?
>>
>>61164472
>>61164480
pretty sure its a hologram m8
>>
>>61164481
I personally think Netbeans is crap. Too bloated and with an ugly interface. Eclipse is much more tolerable (though take my input with a grain of salt, as I hated learning Java in general).
>>
>>61164481
No IDE will make you learn java. That's all in your brain problems.
>>
>>61164481
vi you fool
>>
>>61164500
i'll try eclipse then, because netbeans is crashing all the time on my pc
>>
>>61164480
>They're arachnids, they're spiders
You're unironically trying to say scorpions are spiders right now. That's like saying Debian is Arch.
>>
>>61164555
You're unironically trying to say spiders are scorpions right now. That's like saying Arch is Debian.
>>
>>61164555
>>61164628
POLYMORPHIC ARACHNIDS
>>
File: spiderposting.jpg (76KB, 680x649px) Image search: [Google]
spiderposting.jpg
76KB, 680x649px
>>61164555
>>61164628
You're unironically trying to spiderpost. I'm on to both of you.
>>
>in 1978, the Unix kernel consisted of less than 10,000 lines of C code plus some inline assembly

How many lines of code is the Linux kernel currently?
>>
>>61164821
Linux isn't Unix but I think close to 2 million.
>>
>>61164821
15+ million, apparantly. I pretty sure most of the code is for drivers.
>>
>>61164846
I don't think the drivers count. Anyway linux wouldn't the place to look for anything of this sort. I'd go for NetBSD.
>>
File: 1477319531145.jpg (14KB, 142x250px) Image search: [Google]
1477319531145.jpg
14KB, 142x250px
>>61164821
ya, but how many games did unix have in 1978?
>>
>>61164877
How many games does unix have today?
>>
>>61164888
su say
su do
>>
File: computers.png (1MB, 1920x1080px) Image search: [Google]
computers.png
1MB, 1920x1080px
Why haven't you learned Haskell and then moved on beyond it yet /dpt/?
>>
>>61163307
Sorry but no.
The idiotification of our society serves one purpose only: For companies to decrease wages and still produce the same shit.
Look at the current tech market, for example, it's always the same stuff in different packages.
>>
>>61164965
Because I can't figure out what comes after abstracting abstractions which are abstractions of abstract things.
>>
>>61165008
realistically we're just talking in terms of language features, predominantly the type system
>>
>>61164965
Serious:
Do you think learning a declarative pure functional programming language like haskell is worth it when I'm very unlikely to be able to use the declarative and or pure functional style in serious code?
Does it get me anything? I already make pure functions where I can, that's simply good practice. But the declarative bit I'm not sure would help me at all.
>>
>>61164968
Yes anon, I'm sure the vibrant diversity being government funded into higher education has nothing to do with it
>>
>>61165008
It's obviously abstracting the abstract abstractions of abstractions of abstract things.

What are you retarded?
>>
>>61165046
Declarative, strongly typed pure functional programming will change your life

>unlikely to use it in serious code
It depends entirely on what you're writing.

If you are writing embedded or high performance code, then any form of abstraction is detrimental, and manual memory is a necessity.
This is something Haskell is terrible at.

You likely already use functional programming in limited areas - all major languages have been progressing forwards on this front.
>>
>>61165046
>>61165085
You can write very high performance haskell code - depending on what you're doing, in some cases code can be optimised to C speeds - and you can do manual memory, but it wouldn't be as good as doing it in C, and it wouldn't be particularly Haskell-y. Even if the entire thing was manual memory, GHC would still include the GC with it.

You can foreign call C code, and have a fast C layer and a Haskell layer that performs most of the logic and provides any interfaces.

So to some extent, you can still program at that lower level.
It's obviously faster than interpreted languages, fast code probably runs at Java speeds, autistic super-optimised code can approach C but there'll always be an overhead.
>>
You may not even consider posting in /dpt/ until you have implemented the State monad yourself.
>>
>>61165074
It would be the same if the government were encouraging all straight white cis human-identifying boys to learn to 'code'. The entire sector would dumb down.

Stop trying to force the issue and let the people who are interested in programming just do it. There are two women on my team at work, they're as good as the men, but they didn't get into programming because a celebrity or politician encouraged them to. They got into it because they wanted to make computers do stuff.
>>
>>61165172
data State i j a = State { runState :: i -> (j, a) }

sRet :: a -> State i i a
sRet x = State (\s -> (s, x))

sBnd :: State i j a -> (a -> State j k b) -> State i k b
sBnd sx sf = State $ \i ->
let (j, x) = runState sx i
in runState (sf x) j

sGet :: State i i i
sGet = State (\i -> (i, i))

sPut :: j -> State i j ()
sPut x = State (\_ -> (x, ()))

sMod :: (i -> j) -> State i j ()
sMod f = State (\x -> (f x, ()))
>>
>>61165172
imagine thinking functional matters
>>
>>61165240
imagine not being able to implement a trivial monad instance
>>
>>61165231
tippity top coding, my man
>>
Can furries program?
>>
>>61162895
>hates pedophiles
>owns a picture of one
>>
>>61165261
not him but
>muh "moan ads"
>>
File: mlgtux.png (191KB, 365x335px) Image search: [Google]
mlgtux.png
191KB, 365x335px
>>61164965
I don't learn languages that can't go fast.
It is seldom-questioned common knowledge that gotta go fast.
Pic related
>>
>>61165335
imagine not being able to pronounce monad correctly
>>
>>61165347
Doesn't matter how fast your code is if it's wrong
>>
>>61165349
>imagine not being able to pronounce monad correctly
>pronounce monad correctly
>nounce monad corr
>ce monad co
>monad
>muh "moan ads"
>>
>>61165354
It isn't wrong though
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <unistd.h>
int main(int argc, char **argv) {
srand(time(0)*getpid());
unsigned const rainbow[5] = { 4, 6, 2, 3, 1 },
colors = 5,
width = 40, height = 40,
stability = 20000, seam = 4,
nminlive = 2, nmaxlive = 2,
nminnew = 3, nmaxnew = 8,
delay = 50000, fresh = 50;
unsigned seaming = 0,
grid_a[width*height],
grid_b[width*height],
*grid_w = grid_a;
unsigned const *grid_r = grid_b;
for (unsigned i = 0; i < width*height; i++) {
grid_a[i] = 0; grid_b[i] = 0; }
for (;;) {
for (unsigned y = 0; y < height; y++) {
for (unsigned x = 0; x < width; x++) {
unsigned n = 0, f = grid_r[y*width + x],
*g = grid_w + y*width + x, h = 0;
printf("%c[3%d;1m%c%c", 0x1b,
rainbow[colors - 1 -
(f ? f - 1 : f)*colors/fresh],
(f ? '#' : ' '),
(x == width - 1 ? '\n' : ' '));
for (unsigned i = 0; i < 9; i++) if (i != 4) {
unsigned nx = (x + i%3 - 1 + width)%width,
ny = (y + i/3 - 1 + height)%height,
j = ny*width + nx;
if (grid_r[j]) n++;
if (grid_r[j] > h) h = grid_r[j]; }
if (f && (n > nmaxlive || n < nminlive)) *g = 0;
else if (!f && n >= nminnew && n <= nmaxnew)
*g = (h ? h - 1 : 0);
else *g = (f ? f - 1 : 0);
if (seaming) {
*g = (f ? 0 : fresh);
if (!(rand()%seam)) seaming = 0;
} else if (!(rand()%stability)) seaming = 1; } }
clock_t then = clock();
while (clock() - then < delay);
printf("%c[0m%c[%dA%c[%dD", 0x1b, 0x1b, height, 0x1b, width);
if (grid_r == grid_a) { grid_w = grid_a; grid_r = grid_b; }
else { grid_r = grid_a; grid_w = grid_b; } } }
>>
>>61165356
>nounce
>nonce
People who hate Haskell confirmed to be paedophiles
>>
>>61165370
>muh "pedal files"
>>
File: chill.png (11KB, 293x283px) Image search: [Google]
chill.png
11KB, 293x283px
>>61165370
>People who hate Haskell confirmed to be paedophiles
>who hate Haskell confirmed to be
>hate Haskell confirmed
>te Haskell con
>Haskell
>muh "hash cool"
>>
File: 1424329161140-1.png (118KB, 539x497px) Image search: [Google]
1424329161140-1.png
118KB, 539x497px
>2 years into CS degree
>still don't how to define abstraction
>>
>>61165484
as soon as you define it, you make it concrete, and that means you don't understand abstraction
>>
>>61165484
replace it with the word modular
>>
>>61165347
this is the cancer that's killing our industry. stop trying to optimize junk that doesn't need it, you end up writing awful code that's 1% faster than great code. the tradeoff isn't worth it
>>
>>61164207
It happened to me once, it was fucking scary, pro tip: never pop the arachnoid.
>>
>>61164207
babies spiders can't do anything to ya.
if anything, they'll eliminate other pests in your house.

you might see a sharp increase in spider webs though.
>>
>>61165777
>1% faster.
Right. Except that's not what writing some basic optimization gets you.
https://youtu.be/GPpD4BBtA1Y
At 36:26 he starts showing how you practice optimization on an arbitrarily picked integer sequence from the integer sequence encyclopedia. The first few steps takes virtually no time at all to do on top of your original implementation. It's a good watch but the results are that the final step was 1.6*10^6 times faster. The step I'm thinking about that takes a few minutes was ~500000% faster. (5k times faster)
This isn't rare. This isn't algorithmic optimization. This is basic optimization.

And I'm sick of having to wait on SUPERCOMPUTERS to do things as fast as they did them in the 90s. Leaving me waiting. Whoever writes user space apps are terrible people. I hate you with a passion.

Stop encouraging people to write painfully slow code unless you have malicious intent.
>>
File: next.png (135KB, 1366x768px) Image search: [Google]
next.png
135KB, 1366x768px
>>61162895
Should I click next?
>>
>>61165952
Considering there isn't a next button, probably not
>>
>>61165952
I'm too impatient so I'd just deselect what I think I don't need but honestly with MS products trusting them is vital because that's the only way you can guarantee things work.
>>
>>61165952
>>61165960
install*
>>
>>61165952
>Literally getting cucked
>51.23 gigabytes for a glorified text editor
I cannot fathom winfags.
>>
File: 1458102071557.png (269KB, 450x488px) Image search: [Google]
1458102071557.png
269KB, 450x488px
>>61165863
>oy vey, you anti-spidite! spiders are totally harmless, you should import millions of them into your house!
t.notta spiderberg
>>
>>61165973
>Guarantee
Sorry, got a bit excited there. Your chances are better.
>>
>>61165991
>>>/pol/
>>61165990
It's way more than just a text editor but yes it's excessive for any development software really.
Not that hard drive space is that valuable anyway. Just poor form to throw that on your users.
>>
File: wyNGEbm.png (344KB, 764x476px) Image search: [Google]
wyNGEbm.png
344KB, 764x476px
>>61165777
But anon, gotta go fast.
Pic related: sonic the hedgehog in a maid uniform except that instead of sonic the hedgehog it is a trap
>>
>>61165884
great and interesting but not relevant to the topic of optimizing by picking a "fast language"
>>
File: tenor.gif (56KB, 300x300px) Image search: [Google]
tenor.gif
56KB, 300x300px
>>61166020
>a "fast language"
But anon, fast languages really are fast languages when you gotta go fast.
>>
>>61166020
Well his translation from JS (V8 I believe) to C gave him a 34 times boost.
I'd be very happy if a process that took a minute on my computer took 2 seconds.
I agree that language choice isn't the most important but if you don't implement the performance intensive parts in a language that is meant for that stuff you're gonna be very slow. But there's a lot of not so slow languages. Java isn't that slow even.
>>
>>61165347
>>61166012
>>61166069
>angry frogposting C-brainlet has come to shit up the thread
>posts literal /v/-tier memes
>no one is surprised
>shiggy
>>
>>61166120
Why do you assume this is about C? I'm not that guy. And I'm the only one who mentioned C in this. And it was just incidental because the video I posted he happened to use C.

Can you stop being such an ideolog and participate in a constructive manner?
>>
>>61166104
>JS
get out of here, nobody thinks "i need to write an app ... should i implement in JS or C? they're really pretty much equivalent, but C is faster..."
that's a strawman
>>
For writing mult(int a, int b) without using *, is abs() cheating?
>>
>>61162895
Not sure why but this is my favorite dpt image.
>>
>>61166215
If you use anything other than ++, < and while, you are cheating
>>
>>61166161
>strawman
You said the language choice shouldn't be made with regard to the performance characteristics.
Even if I'm being favorable here and saying that you exclude stupidly slow languages JS certainly isn't the one you'd exclude first.
http://benchmarksgame.alioth.debian.org/u64q/fannkuchredux.html
JS is approx 1/10th the speed of C here.
It's entirely within reason someone could write something serious in JS and end up being super slow (because of how unpredictable performance is in these high level languages from the programmer pov the variance from situation to situation is very high so someone might even be lulled into false security).
People choose JS for all kinds of things now. It's not rare for applications to be written with Node JS.

A strawman would be if you had constrained your statement.

Regardless of all of this. The same would apply all over the place and between different language choices. JS or Ruby? Rust or C++? D or Haskell?
Just because this example happened to be 34 times faster (after optimizing mind you, who knows how bad it'd be without it) doesn't mean the point isn't valid.

Stop being such a worthless sack of shit and learn your craft.
>>
File: something34.png (4MB, 1920x1080px) Image search: [Google]
something34.png
4MB, 1920x1080px
What books should I read to improve my programming?
>>
>>61166274
>books
See
>>61163009

Don't expect anyone to know.
>>
>>61166274
SICP
>>
>>61166274
SCIP
>>
>>61166274
Read manga instead of books
>>
>>61166307
Watch anime instead of reading manga
>>
>>61166311
>implying there's a difference besides frame rate
>>
Why do people use Python?
>>
>>61166336
cuz dey dum bruh
>>
>>61166336
Not sure. There was a period long after the languages inception where people started pushing it hard as a great language. It doesn't really have any upsides aside from its popularity.
>>
>>61166274
Sicp
Limux from scratch
>>
>>61166336
pro-python propaganda
>>
>>61166336
just works, popular, keeps bullshit to a minimum
>>
Android's file hierarchy differs somewhat from typical Linux distros, and is poorly documented. Where the fuck is the device file for the GPS so I can read from it in a Ruby script? I've found 2 Ruby libraries for dealing with a GPS unit, one of which reads from a serial port at /dev/ttyUSB0 (which doesn't exist on my phone), and one of which reads from a GPS daemon listening on port 2947 (which also doesn't exist on my phone).
>>
>>61166696
>... ... why can't i do this in ruby ... ...
because it's a shit language
>>
>>61166712

It's because this platform is poorly documented and they want you to do everything through the goddamn Java APIs.
>>
>>61166745
> bla bla excuse bla
because it's a shit language
>>
>>61166752

It's not a language fault. If I knew where the fucking file was, I could do it in Ruby with no problem. XDA Developers is saying it should be in /data/gps or /system/etc/gps, but that the file varies based on the Android version and platform (why is this the case?). Nonetheless, it is not in any of these locations on my phone. Also, why did I need to use root to ls /data?

Fuck's sake, they could have just slapped a mobile interface on top of a proper Linux userspace, and this would have been the best possible mobile OS, but noooooo. They had to make things hard for programmers.
>>
>>61166845
because
it
's
a
shit
language
>>
>>61163189
You had me going for a second but then you had to post that garbage assembler book.
I read it, it barely even touches assembler, it's all explained in the context of the author's specific homerolled macro-assembler that resembles a retarded C more than anything else.
What a worthless book.
>>
>>61166852

It's
Not
A
Language
Fault
I
Couldn't
Do
This
In
Python
Or
C
Either

Just
Name
Any
Language
Other
Than
Java
And
I'd
Be
Having
The
Same
Problem
>>
>ntoskrnl.exe leaking 1.795GB
The death of windows cant come faster. I just want to stay on comfy debian
>>
>>61166891
Is it written in haskell?
>>
>>61166907
Depends, was that 1.8GB in total or 1.8 GB per second?
>>
>>61166907
ntoskrnl.exe (Short for Windows NT operating system kernel,) also known as kernel image, provides the kernel and executive layers of the Windows NT kernel space, and is responsible for various system services such as hardware virtualization, process and memory management, thus making it a fundamental part of the system. It contains the cache manager, the executive, the kernel, the security reference monitor, the memory manager, and the scheduler.[1]
>>
File: Screenshot_20170630-232353.png (133KB, 1920x1080px) Image search: [Google]
Screenshot_20170630-232353.png
133KB, 1920x1080px
Not selecting the nuclear option to begin with was my first mistake.
>>
There has to be a better way to loop though a list using a function, right?
counter = 0
proxy = list(range(30))

def gen():
global counter
if counter <= len(proxy)-1:
ret = proxy[counter]
counter += 1
else:
counter = 0
ret = proxy[counter]
return ret

for x in range(50):
print(gen())

I think what I'm looking for might be a generator but from what I've seen doesn't exactly do what I want.
>>
>>61166355
>>61166301
>>61166298
>three people give my the same one answer
Is this book a meme?
Or is it seriously worth reading?
>>
Fucking lists in lisp man,
Doing SICP and attempting to implement reverse (using accumulate)

(define (accumulate op initial sequence)
(if (null? sequence) initial
(op (car sequence)
(accumulate op initial (cdr sequence)))))
(define fold-right accumulate)

(define (reverse-r sequence)
(fold-right
(lambda (x y) (list y x) ) ;Part I'm having trouble with
nil sequence))

(define test-list (list 1 2 3 4 5))
(display (reverse-r test-list)) (newline)


While the code above *does* reverse the values, it does so with nested lists
Output: (((((() 5) 4) 3) 2) 1)


What sort of lambda expression should I be thinking about? I've thought about doing (cons (car (cdr y)) x), but it won't work because eventually I get to an empty list (resulting in a 'contract violation' when I do car/cdr)
>>
>>61167039
Only if you want to learn Lisp or a flavor.
>>
File: SICP - Simplicity.png (673KB, 1280x720px) Image search: [Google]
SICP - Simplicity.png
673KB, 1280x720px
>>61167039
It's worth reading. You learn to do the eight-queens problem by the middle of chapter 2, build a symbolic derivative engine, and create a compiler/interpreter

It's very dense, but definitely watch the online lectures on youtube for supplemental help.
>>
>>61166976
>fed_GPS_logs.txt

>>61167006
Not sure what you're getting at, are you looking for something like this? If you don't need indices, you can just loop through proxy directly
proxy = list(range(30))
def myfun(arr, i):
pass
for i in range(len(proxy)):
myfun(arr, i)
>>
>>61167044
SICP is no more about LISP than astronomy is about telescopes
>>
>>61167083
t. hasnt actually read it
1.1.2 Naming and the Environment
A critical aspect of a programming language is the means it provides for using names to refer to
computational objects. We say that the name identifies a variable whose value is the object.
In the Scheme dialect of Lisp, we name things with define. Typing
(define size 2)
>>
>>61167061

Nah, this is what I'm looking at:
gpsfiles.txt
gps-0.0.1.gem
gps-0.0.1
/data/data/com.termux/files/usr/lib/ruby/gems/2.4.0/gems/gps-0.0.1:
/data/data/com.termux/files/usr/lib/ruby/gems/2.4.0/gems/gps-0.0.1/config:
/data/data/com.termux/files/usr/lib/ruby/gems/2.4.0/gems/gps-0.0.1/lib:
gps
gps.rb
/data/data/com.termux/files/usr/lib/ruby/gems/2.4.0/gems/gps-0.0.1/lib/gps:
/data/data/com.termux/files/usr/lib/ruby/gems/2.4.0/gems/gps-0.0.1/lib/gps/receivers:
gpsd.rb
/data/data/com.termux/files/usr/lib/ruby/gems/2.4.0/gems/gps-0.0.1/script:
/data/data/com.termux/files/usr/lib/ruby/gems/2.4.0/gems/gps-0.0.1/spec:
gpsd_spec.rb
/data/data/com.termux/files/usr/lib/ruby/gems/2.4.0/gems/gps-0.0.1/tasks:
gps-0.0.1.gemspec
me.danielbarnett.addresstogps.14.png
gpsone_d
/data/misc/location/gpsone_d:
qmux_gps
/dev/socket/qmux_gps:
f_gps
f_gps
/sys/devices/virtual/android_usb/android0/f_gps:
/sys/devices/virtual/android_usb/android0/f_gps/power:
gps.conf
android.hardware.location.gps.xml
libgps.utils.so
gps.msm8974.so
>>
File: .png (92KB, 1843x931px) Image search: [Google]
.png
92KB, 1843x931px
>>61167061
Uh, it needs to increment every time it's called then loop back around.
I'm about to combine these scripts and use actual proxies to try and brute force an overdrive library.. heh
>tfw everything I write is garbage
>>
>>61167093
The first chapter introduces you to scheme because they use it to teach you concepts.
Dumb nigger.
>>
>>61167042
use append
>>
Maybe libgps.utils.so is this?

http://www.catb.org/gpsd/libgps.html

If so, I can just write a native extension for Ruby to talk to it.
>>
File: 20170628_131032.jpg (1MB, 3264x1836px) Image search: [Google]
20170628_131032.jpg
1MB, 3264x1836px
Started a new laravel installation for a pharmaceutical distribution Network. You know easy stuff
>>
>>61167153
Youre still learning second class with anything not scheme/lisp.
A book that teaches with X, IS focused around X. Regardless if you can take any general concepts away.
>>
>>61167107
I'm just saying he's using a case sensitive search, which is probably a bad idea for an acronym.

>>61167042
You're getting snickerdoodled here. To properly construct a reversed list using fold right, you have to reach inside your list and replace the terminal () with (y ()). That's why he's saying to append here. >>61167166 But that takes quadratic time since you have to iterate through the list to append. See https://stackoverflow.com/questions/26017352/why-can-you-reverse-list-with-foldl-but-not-with-foldr-in-haskell

>>61167123
Okay, so you don't want to iterate over it with a fixed set of counter values, you just want the counter to increment around and around when it's called. My understanding is in this situation people usually do
def gen():
gen.counter = (gen.counter+1) % len(proxy)
return proxy[counter]
gen.counter = -1

Also I changed your code to use modulus.
>>
>>61167178
Can't you just compile ruby to the jvm/use an ffi mechanism? I'm sure it'd be easier than whatever you're trying to do.
>>
>>61164207
that looks like something out of a nightmare
>>
>>61167296
>Also I changed your code to use modulus.
Very nice. Clever too.
>>
Please insult my programming ability
public class PrintPrimes {
public static void main(String args[]){
for (int num = 2; num <= 100; num++){
if (isNumPrime(num) == true){
System.out.println(num);
}//if
}//for
}//main

public static boolean isNumPrime(int num){
boolean isPrime = true;
for (int div = 2; div < num; div++){
if (num % div == 0){
isPrime = false;
}//if
}//for
return isPrime;
}//isNumPrime
}//class
>>
File: 1484433191584.png (376KB, 940x720px) Image search: [Google]
1484433191584.png
376KB, 940x720px
>>61167566
pretty good 4/5
>>
>>61167566
Inconsistent as fuck. You will never make it.
>>
>>61166857
>it's all explained in the context of the author's specific homerolled macro-assembler that resembles a retarded C more than anything else.
seriously? 800 pages of this shit?
>>61166891
the fastest way to help windows die is to develop ransomware
>>61167006
>global counter
what in the actual fuck
>>61167187
>php
>for a pharmaceutical distribution Network
jesus fuck, i am confident that the apocalypse is coming and it's these dumb code monkey's fault
>You know easy stuff
holy shit this is the dumbest post i've read today
>>61167296
>gen.counter
holy fuck this is getting too retarded
>>61167566
>java
>no spaces between function name and parens
>no spaces between closing parens and curly bracket
>explicit == true checks
>comments touch preceding code
>// touch comment text
>comments for what scope you are closing

literal 0/10, i suggest you try gardening
>>
>>61167641
>>no spaces between function name and parens
Why the fuck would you do that?
>>
>>61167566
You wouldnt need to comment your scope if you just used
{

}


On one statement ifs, why not just
 if (num % div == 0) isPrime = false;

or
 if (num % div == 0) 
isPrime = false;


same with your isnumprime if though since its long id do the second
>>
>>61167673
>Why the fuck would you do that?
yeah that was a brain fart, there were so few spaces that i got confused, i never put a space there in my code

>>61167682
>You wouldnt need to comment your scope if you just used
statistically that style of brackets causes more errors, it was on a blog of a static analysis company, i'll see if i can find it.

also, you would'nt need to comment your scope if you used any decent editor that highlights your scope when you are touching a bracket

>On one statement ifs, why not just
because that's really dumb and causes many errors. placing the brackets are just two additional characters and a line more, but makes it impossible to make the relatively common mistake of adding another line to the "block", again, the stats were in the same blog post
>>
>>61167682
>You wouldnt need to comment your scope if you just used
>{
>}
I know I just hate the amount of space that takes up
>>
>>61167727
>causes errors
>causes errors
They really dont.

and your scope is literally one line.

>>61167734
Better than trying to wade through the jungle of
-------------{
} {

}

But since youre already using java, you dont value your life to begin with.
>>
>>61167566
public class PrintPrimes {
public static void main(String args[]) {
for (int num = 2; num <= 100; num++) {
if (isNumPrime(num))
System.out.println(num);
}
}

public static boolean isNumPrime(int num) {
for (int div = 2; div < num; div++) {
if (num % div == 0)
return false;
}
return true;
}
}
>>
>>61166857
>you had me going
Anon. I'm sorry to tell you but this was 100% intended to be blatant and obvious role play as some madman who thinks literature shouldn't teach you shit.
Of course I recommend a terrible book. It's God awful. I actually don't know of a worse book meant to teach you programming. Most books are just poor at teaching. This one just doesn't do it.
>>
>>61167641
>>explicit == true checks
What's the alternative?
>>
>>61167791
if x == true:
stuff

if x:
stuff
>>
>>61167791
If you have a bool type you don't need to ever compare its equality to true. If you compare its equality to false that's the same as negation.

Implicit in an if statement is that the true branch (if block) execute when the conditional is true and the false branch (else block) execute when the conditional is false.

But it's all just code style preference.
I don't see a problem with it. You worry a little about the person's sanity for doing it and then you move on. It makes you look dumb but there's no negative impact of it I can think of.
>>
When it comes to writing back-end stuff that connects to a DB, what's the preferred way of storing the DB username and password which the scripts use to connect?

I've been hardcoding that stuff for personal projects, but I don't think that would fly in a professional environment.
>>
>>61167768
>But since youre already using java, you dont value your life to begin with.
What exactly is wrong with java tho?
>>
>>61167892
Not that guy but anon you will find that even simple questions can have books worth of answers.
>>
>>61167892
Slow.
antiquated.
required OOP.
verbose.
The JVM.
Non-controllable GC.

To start with.
>>
extern crate futures;
extern crate hyper;
extern crate tokio_core;
use std::io::{self, Write};
use futures::{Future, Stream};
use hyper::Client;
use tokio_core::reactor::Core;
let mut core = Core::new()?;
let client = Client::new(&core.handle());

let uri = "http://httpbin.org/ip".parse()?;
let work = client.get(uri).and_then(|res| {
println!("Response: {}", res.status());

res.body().for_each(|chunk| {
io::stdout()
.write_all(&chunk)
.map(|_| ())
.map_err(From::from)
})
});
core.run(work)?;


I didn't think Rust was a meme, but wew lad.
Using curl it's a bit better.

extern crate curl;

use std::io::{stdout, Write};

use curl::easy::Easy;

// Print a web page onto stdout
fn main() {
let mut easy = Easy::new();
easy.url("https://www.rust-lang.org/").unwrap();
easy.write_function(|data| {
Ok(stdout().write(data).unwrap())
}).unwrap();
easy.perform().unwrap();

println!("{}", easy.response_code().unwrap());
}
>>
>>61167641
I wish people like this would just leave. I'll bite, though.
>holy fuck this is getting too retarded
What's your suggestion, then?
>>
>>61167042
Take the Common Lisp pill m8.
(defun reverse (list)
(do ((l list (cdr l))
(res NIL (cons (car l) res)))
((null l) res)))
>>
>>61167928
Closer than C++ than Ruby, Python, PHP, CommonLisp...
The GC is so uncontrollable no mobile game has been written on it...
>>
>>61167928
>Slow.
>antiquated.
>required OOP.
>verbose.
>The JVM.
>Non-controllable GC.
So why does any of that matter for such a small program as >>61167566?
What specifically would be bad about learning basic programming using java?

>verbose
In what ways is java more verbose than say C#?
>>
>>61165484
If else blocks are just abstracts for labels and jumps.
>>
File: ponder.png (499KB, 653x700px) Image search: [Google]
ponder.png
499KB, 653x700px
So I know Ruby doesn't have first class functions in the way other (better) languages do, but how in the h*ck do I apply a lambda to a singular value without defining any placeholder variables?

What is the Ruby equivalent of
((lambda (x) (* x x)) 5)
?

also I am aware of
5.instance_eval {|x| x * x}
but as far as I can tell, I can't store code blocks as values in a hash table, where I can do so with lambdas. I just want a hash table full of anonymous functions.
>>
>>61168070
Labels are just abstractions for instruction addresses.
>>
>>61167956
void main()
{
import std.net.curl : get;
import std.stdio: writeln;

get("dlang.org").writeln;
}
>>
>>61168077
Ok, it looks like
hash['key'].call(arg)
would apply a lambda from a hashtable to an arg
>>
>>61168077
You want a lambda or a Proc.
Then use .call to actually call it.
>>
Are there books like this for other languages?
Is Land of Lisp any good?
>>
>>61168092
Nice
>>
File: C-kHxzRXsAATgkI.jpg (151KB, 1271x1219px) Image search: [Google]
C-kHxzRXsAATgkI.jpg
151KB, 1271x1219px
>not sure how to do something pretty complex and unusual
>have an idea, google it to see if it's reasonable
>the biggest program in the niche you are working on does the exact same thing

this is a nice feel
>>
File: Python loop.png (19KB, 660x238px) Image search: [Google]
Python loop.png
19KB, 660x238px
Can someone explain to me why Python doesn't just use a C-like for loop?
>>
>>61168190
Iterators are the more common case in Python.
>>
>>61168190
Because the iterator pattern lets us iterate over anything, even sequences of things that are computed as late as possible
>>
>>61168190
It's a hot """feature""" that most memelangs have: lack of simple for loops.
>>
>>61168077
I don't know Ruby but after a few minutes looking online it sure seems like you get essentially the exact same thing. Apparently functions aren't first class but there exist callable Proc objects, which lambdas produce. They support lexical scope, meaning you get closures and everything.

Don't really see what's wrong with that. Maybe it's one of those things where under the hood it ends up being shit, (Java "lambdas" are fucking garbage for that) but so far I can't see the seams yet. Certainly for a trivial case like this one it's indistinguishable.

lambda { |x| x*x }.call(5)
>>
>>61168232
name a single use case where a simple for loop would be clearer than a python-style for loop or while loop. use python syntax in your answer
>>
>>61168213
That doesn't answer my question
>>61168228
How is that relevant?
>>
>>61168190
Because almost everything is a collection or tuple in python, because it's a bad inefficient language.
>>
>>61168232
Actually, it's lack of more complicated for loops. For loops accept iterables and it, not a bunch of statements in magic slots. Though I think it's annoying that they don't support traditional for loop syntax too, I just think your argument's retarded.

>>61168271
He's saying that as a higher level language, iteration in python typically consists of manipulating higher level containers, often with functions.
>>
>>61168295
and that's it*
>>
>>61168038
size = 50
new_l = [proxy[x % len(proxy)] for x in range(size)]


And bonus code

size = 50
factor = math.ceil(size / len(proxy))
extra = len(proxy) - size % len(proxy)
new_l = proxy * factor
new_l = new_l[:-extra]
>>
Daily working on a "group" project where my group does nothing except ask me to explain what I did from time to time. But when I say what has been done and what still has to be done and suggest that they do something, they vanish. At this point I am even afraid of them helping because they seem so fucking clueless.
>>
>>61168329
post code plox
>>
>>61168328
He already said he wanted the function call to keep track of what index to use rather than some outer iteration (which is actually what I initially suggested, not that you read it).

>>61168329
When the skill level difference is big enough, in my experience it's less significantly less work to just do it yourself.
>>
>>61168351
def gen(proxy, iterations):
for i in range(iterations):
yield proxy[i % len(proxy)]

for val in gen(proxy, 50):
print(val)
>>
>>61168390
You've broken the type signature of gen both in the parameters and the return type. That generator terminates - you're required to feed gen the number of iterations known in advance. And if he did change his code to to use this generator the way he calls gen in multiple places in his code, it will be biased towards proxies with lower indices in an unpredictable manner.

You could solve this by making a nonterminating generator and calling next on it instead of gen() in the same locations:

def makeGen():
for i in itertools.count():
yield proxy[i % len(proxy)]
>>
>>61168190
def loop(cond, *vars):
[vals, nexts] = map(list, zip(*vars))
while cond(*vals):
yield vals
vals = list(fun(*vals) for fun in nexts)

# for (int x = 0, y = 2, z = 4; x + y <= z; ++x, ++y, ++z)
for [x,y,z] in loop(lambda x, y, z: x + y <= z,
(0, lambda x, y, z: x + 1),
(2, lambda x, y, z: y + 1),
(4, lambda x, y, z: z + 1)):
print x, y, z
# 0 2 4
# 1 3 5
# 2 4 6

/autism
>>
>>61168472
makeGen is just itertools.cycle
>>
>>61165367
what it was supposed to do, furendo?
>>
>>61168529
I didn't know about cycle until now, thanks. With itertools.cycle as a builtin, the best way is to cycle the proxies and replace gen() with next on the cycle iterator.
>>
>>61168472
I'm genuinely curious, can you provide any source that generates shouldn't terminate? Or violating the signature type? I agree that your function is better, but I don't agree with anything you said before that.
>>
File: bursting lel.jpg (36KB, 778x599px) Image search: [Google]
bursting lel.jpg
36KB, 778x599px
>>61168500
>pythonbabbies need 4 (four) lines for an actual for loop
>>
>>61168563
>can you provide any source that generates shouldn't terminate?
Not exactly what I'm saying. It's fine for a generator to terminate - I'm saying this particular one shouldn't terminate. Because if it terminates, you're forced to use another generator, which resets the counter to 0. This means that if proxy is of say, length 49, one proxy will be used twice as often as all the others.
>Or violating the signature type?
What I'm saying here is, in the original code gen() takes 0 parameters and returns a proxy, whereas in the generator gen(proxy, iterations) takes 2 parameters and returns an iterable of proxies. So, since it was given the same name as the original gen and offered as a solution, I considered it a type mismatch. Maybe a little hasty on my part since you offered a usage example (albeit that doesn't match with the guy's code), but I was in kind of a sour mood since the post that started this whole thing >>61167641 was so mean-spirited.
>>
File: 1493561022817.jpg (94KB, 771x720px) Image search: [Google]
1493561022817.jpg
94KB, 771x720px
>>61168573
Who are you quoting?
>>
Rate my code to generate all the valid permutations of n sets of parentheses.

def cross(A,*B):
return [a+b for a in A for b in cross(*B)] if B else A
def genp(n):
if n==0: return ['']
return [s for k in range(n)
for s in cross(['('], genp(k), [')'], genp(n-1-k))]
>>
>>61168944
>memesnek
0/10
>>
>>61168952
>rates the language
>>
>>61168952
>>61168971
>>61168835
>>
>>61162895
I wanna learn android programming just because I know Java. Where do I start?
>inb4 dont learn android
>inb4 learn another language
I already know MATLAB and C++ so I think I'm alright in that aspect.
>>
MyClass( MyClass other );
HMMMMMMMMMMMMMMMMMMMMMMM
>>
File: gay community.jpg (38KB, 323x559px) Image search: [Google]
gay community.jpg
38KB, 323x559px
>>61168835
>>61168976
>newfag can't into greentext
>>
>>61169010
>he doesn't know
>>
https://github.com/wewman/gelbash

I will fix this shit next week.
>>
>>61169138
Oh fuck, you use it like this

sh gelbash.sh tag1 tag2 tag3 ... 


But I'll write these later.
>>
I`d like to work in programming because I enjoy solving logic problems but I'm not sure what program to learn for what kind of job and how to apply a language to that job ,so I'd like to ask what kind of programming pays the most?
>>
>>61168652
I'm sorry, i'm >>61167641 (You) and i'm having a shitty day... in another situation i'd have offered constructive criticism in all my replies instead of just being an ass. hope you're having an otherwise nice day
>>
File: fatso is confuse.png (148KB, 354x313px) Image search: [Google]
fatso is confuse.png
148KB, 354x313px
>>61169085
Whom are you quoting?
>>
THE definitive poll.
http://www.strawpoll.me/13329432
http://www.strawpoll.me/13329432
http://www.strawpoll.me/13329432
http://www.strawpoll.me/13329432

>>61169165
the one where you get to dress like a qt girl
>>
>>61169165
Quantitative finance, maintaining legacy business software, or make the next angry birds
>>
>>61169138
>>61169156
That's cool anon, nice work.

>>61169194
No problem; to tell the truth, I've done the same thing before and people have called me out, too. Everyone has their off days.
>>
>>61169249
Thanks. I have a 4chan downloader too I did the other day.
>>
>>61169243
Do I need a CS degree for these or are there other ways to show that I'm qualified enough to get to the interview ?
>>
>>61169156
>gelbash
Go back Sunjay
>>
>>61169332
What?
>>
>>61169235
Who?
>>
I have this big ass function with lots of "sections". Should I split them off into separate functions? Slap on "pragma region" around? Just leave it as it is, with comments showing the divisions? I'm thinking splitting off funcs wouldn't be a great idea since they don't really get reused, they only make sense together.
>>
>>61169450
>Should I split them off into separate functions?
If the function is over around 60 lines I would.
>>
>>61169466
It's [spoiler]almost 700[/spoiler]
>>
>>61169476
fug
we need code tags on /vg/ and spoiler tags on /g/
>>
>>61169476
Overgrowth dev or Yandere dev?
>>
>>61169496
anon dev
>>
File: 1462970641659.png (754KB, 736x715px) Image search: [Google]
1462970641659.png
754KB, 736x715px
>>61169450
Big functions aren't necessarily a bad thing. Some things you need to do is just a long laundry-list of shit, and forcing the reader to jump around between functions isn't necessarily going to make it easier to read. But then again, if you have dozens of variables in scope, it doesn't make it easier to read either.
Really, there is no right answer when it comes to code style. Just do what you think is right.
>>
>>61164481
intellij
>>
>>61169306
You need to be competent, and able to demonstrate it.
>>
>>61169450
Learn functional programming
Then define function by their intended function
>>
File: J. L.jpg (74KB, 374x421px) Image search: [Google]
J. L.jpg
74KB, 374x421px
>>61165484
that's because you understand language too well to fall for the definition meme
>>
File: 1493344523232.jpg (39KB, 533x352px) Image search: [Google]
1493344523232.jpg
39KB, 533x352px
>>61169662
What is an ``functional programming"?
>>
>>61169678
programming that emphasizes fun
but it's wrong, because programming is work, not fun
>>
>>61169674
>meme
>>>/v/
>>
>>61169686
>because programming is work, not fun
Wrong.
>>
>>61169703
away with you, vile beggar
>>
>>61169686
programming is a art.
>>
I am starting to lose focus. I am starting to waste time reading news on politics,world and other stuff. What do I do? I mean I know its important but I could have spent that time with computers and becoming better.
>>
Let's say I have a function that randomly will spit out a boolean so that my already threaded worker can pile it ontop of his job

Now, how is the best way to share data to a threaded function that will receive it without warning. I've always done a queue but that never felt right.

Just did some reading on namespaces, they seem like the holy grail to this type of thing or am i getting too excited?

Doing this in python 3.

def worktodo(barbool):
while(True):
if barbool:....
else:....

t1 = threading.Thread(target=worktodo, args=([ ]))
t1.start()

def foo():
for i in range(100):
if random.randint(1,2)%2==0:
else:return false


Yeah I know above code can be done more concisely, just making it easier to see it out and making example on the spot. Passing logic to a threaded worker like that is what i'd like to do cleanly.
>>
>>61169787
>in python
Stopped reading right there.
>>
>>61169733
>>61169686
Programming is an absolute art. I'm amazed anyone in the field can disagree. It's really the pinnacle of what it means to design something and the flexibility you have.
>>
>>61169786
Find something interesting.
>>
>>61168140
How did it help you? Would you recommend it?
>>61168985
Bump
>>
File: disgusting.jpg (14KB, 240x320px) Image search: [Google]
disgusting.jpg
14KB, 240x320px
>>61168985
>Java
>MATLAB
>C++
there's no hope anon, you're permanently brain damaged.
>>
>>61169786
If you don't feel motivated, play a programming game, or learn ancillary skills like mathematics or statistics.
>>
>>61169828
That book the good anon posted is without a doubt the best introduction/programming book. It will teach you where the automation gets so powerful so quickly. The guy made it free too, what a good guy. Actually i'll just fucking donate to him, a few bucks is well worth it.
>>
>>61169733
>>61169811
Wrong. Programming is a ticket to make money for retards.
>>
>>61169870
I program everyday in pure hobby and money is the least of my concerns. The best in the field aren't the ones chasing the money you retard.
>>
>>61169842
Since it's permanent why don't you recommend something
>>
>>61169851
Hmm interesting can you give me some examples of automations? I mean I have read the site but it's different to see what an actual learner learned
>>
(defn f [lst]
(map first (filter #(= (mod (first %) 2) 1) (zipmap lst (range)))))

Exception in thread "main" java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Number, compiling:(solution.clj:1:1)

wtf, there's no single string to be found in the code
>>
>>61169994
What does the #(= do?
>>
>>61170013
Shorter version of the code:
(defn f [lst]
(map first (filter #(odd? (first %)) (zipmap lst (range)))))

#() is a lambda function. You can access parameters using %.
>>
>>61170013
>What does the #(= do?
That's the neckbeard smiley
>>
>>61170029
ah, thanks.
>>
File: 1427759847682.gif (8KB, 645x773px) Image search: [Google]
1427759847682.gif
8KB, 645x773px
>>61169787
a-anyone out there?
>>
>>61168985
You don't know how to program until you know how to program imperatively, functionally and with objects.
>>
>>61170129
gib starting point then please
>>
I need to process a large array with multiple threads as quickly as possible in c++. What is the best way to do this?
>>
>>61170181
use the experimental std::transform or std::foreach with parallel execution policy
>>
>>61170129
>he hasn't transcended the paradigms
>>
Still working on my 3d loli mmorpg.

Is unity3d in C# any good? I would like to maybe make a mobile app in xamarin and unity for it too
>>
>>61170129
What is an ``functionally"?
>>
i'm looking up all the top C/C++/Assembly repos on github... lots of interesting stuff.
>>
>>61170329
Oh?
>>
>>61170220
>Is unity3d in C# any good
It's the norm.
>>
>>61167566
I vomited. Thanks.
>>
>>61170220
post pics
>>
>top 5 repos on github are javascript
>>
>>61170614
Solution: Stop using CoChub
>>
>>61169138
I added some documentation.

What downloader should I make next?

I'm doing this to practice bash by the way.
>>
>>61162895
Guys noob here
They say python has a lot of libraries. Who made those libraries? The creators of the language?
>>
>>61169994
clojure was a mistake
>>
>>61170780
>Who made those libraries?
anyone, python has good third-party lib support because its stupidly popular
>>
>>61170780
Everyone who uses Python. A popular language means more people can make useful utilities for other people to use.
>>
>>61170780
People dumb enough to use python
>>
>>61170824
>>61170800
>>61170796
Thanks
But can I access them if I'm.not online? What if these libraries have shit code?
>>
>>61170852
>What if these libraries have shit code?
Any Python code is shit by definition.
>>
>>61170852
use your package manager.
And youre already using a shit language.
Dont expect speed or power from python.
Its purely a high-level middli-man language to ducktape together programs youre too lazy to properly implement.
>>
File: CSDA.jpg (54KB, 376x475px) Image search: [Google]
CSDA.jpg
54KB, 376x475px
>>61163213
we did Z80 in a course at my uni
it's really fucking easy to learn this shit
what I would recommend not relative to assembly but for getting a better understanding of how computers actually work at the most lowest level is book pic related
>>
>1990's: Programming in BASIC, C, VB
>2000's: Program low level industry-specific languages for automation
>2010's: Functional programming with wolfram language for scientific applications
Supposing I'm to write a desktop program, what language is robust, fast, productive, and non-shit today?
>>
>>61164091
lol'd
>>
>>61171004
define "fast"
>>
>>61166223
>using << is cheating
>>
>>61171038
not him but it's what you gotta go
>>
>>61171004
Every language is shit.
>>
>>61168533
a 2d cellular automaton with entropy and limited lifespan
>>
>>61171004
it depends
but c++
only thing is you have to actually be a good programmer to make it fast, robust and productive
>>
>>61171038
>define "fast"
That's a challenge, but let's assume C speed is the golden standard and that Java is shit
>>
>>61171004
>robust, fast, productive, and non-shit
Impossible.
All languages that are robust, fast, and productive are shit.
Prime example: C++, the most robust and productive of fast languages, but also the shittiest.
>>
>>61171121
Are you writing a video game?
If so, I'm not interested in helping you.
If not, you don't need C speed.
>>
>>61171058
I knows

>>61171119
>but c++
Thanks. I guess most of the new languages are just memes for poor coders.
>>
Please help, I was linked to here from >>/g/sqt/

>>61171089
>>61171099
>>
>>61171139
I'm developing estimators and optimization algorithms with applications in finance and industry.
>>
>>61171139
>he has not heard of a kernel
>he has not heard of a solver
>he has not heard of a prime number
>he has heard of a video game but thinks they cannot be important
>he has not heard of a deep neural network
>he has not heard of a genetic algorithm
>he has not heard of a cellular automaton
the current state of functionalfags
>>
>>61171171
Slow and shit languages like F# are big in the financial sector

>>61171184
>a kernel
Only if people plan on playing video games on your OS.

>a solver
Use a better algorithm.

>a prime number
You don't need primes that big.

>muh vidya
At last, here we have it.
This is your real "argument", masked behind all these non arguments.

>deep neural network
C-style languages are bad for this, they're von neumann

>genetic algorithm
You don't need C speeds.

>cellular automaton
You don't need C speeds.
>>
>linux repo is a 1.8GB download

I wonder how many bugs and vulnerabilities are still lurking in billions of keypresses of history
>>
>Try learning Rust
>Oh wow, this is much higher level than C
>Try creating dynamically sized arrays
>Doesn't work
Rust is really confusing.
>>
>>61171214
>You don't need C speeds.
this is the thing i have knowledge about and yes, not only you need C speeds, it would be better if you could evaluate your cost function on the GPU
>>
>>61171220
t. brainlet
>>
>>61171241
Yup. The only language I can fit in my head is C. Everything else feels way too fucking big.
>>
>>61171228
if you do it on the GPU then you definitely don't need C
>>
Does rust really not have dynamic arrays?
>>
>>61171220
>>61171272
Rust has vectors which can grow in size
>>
>>61168985
Pls respond
>>
>>61171288
So no, it doesn't.
>>
>>61171272
but system programming languages don't need dyanmic arrays :^)
>>
>>61171288
Yeah but you can't use vector[y][x] to access elements, can you? I wanted arrays because I like how concise the array syntax is.

>>61171294
1) Think of an app you'd like to make
2) Make the app
>>
>>61171319
>Yeah but you can't use vector[y][x] to access elements, can you?
yes you can https://doc.rust-lang.org/std/vec/
>>
>>61171319
>Yeah but you can't use vector[y][x] to access elements, can you?
I'm pretty sure you can do that in Rust. You can definetely do that in C++ and other high level languages too.
>>
>>61171214

>Only if people plan on playing video games on your OS.
see rest of post

>Use a better algorithm.
>he does not understand the purpose of a solver
>he has not heard of a theorem

>You don't need primes that big.
>he has not heard of cryptography

>At last, here we have it.
>This is your real "argument", masked behind all these non arguments.
see rest of post

>C-style languages are bad for this, they're von neumann
yeah but the speed is necessary

>You don't need C speeds.
>You don't need C speeds.
yeah you do

besides, for any kind of software at all, especially the kinds I've listed, a higher speed without a compromise of reliability means you can accomplish more per unit time, which is inherently good no matter how much you can accomplish per unit time already. time is limited, so a higher rate of accomplishment over time always means a greater allowance of accomplishment. it's really not so hard to understand
>inb4 "but programmer time tho"
>inb4 he needs greater expressivity because otherwise he shits out
>lol brainlet
>>
>>61171288
>still have to use push/pop
Rust is such a fucking meme language.
>>
>>61171361
>see rest of post
>see rest of post
>see rest of post
>yeah you do
>>
>>61171271
you can't always do it on the gpu, you often can't do it on the gpu, which is why you need C
>>
File: icon.gif (59KB, 384x384px) Image search: [Google]
icon.gif
59KB, 384x384px
>>61171271
>he doesn't do gpu programming in c
>>
File: ran's_DMRG.png (1MB, 900x1440px) Image search: [Google]
ran's_DMRG.png
1MB, 900x1440px
>>61171139
>you don't need C speed.
Not sure how many time I need to post this.
>>
>>61171345
>>61171355
Oh, that's nice. Thanks.
>>
Is lisp gud for an in-game scripting language?
>>
>>61171253
this is me
Is something wrong with us, anon?
>>
>>61171384
Until it's true.
In other words, forever, because it's false and that's how it will stay.
We always need C speed. Any compromise on what language we actually use is just a matter of varying degrees of "need."
>>
>>61171400
https://en.wikipedia.org/wiki/Game_Oriented_Assembly_Lisp
>>
>>61171411
>We always need C speed.
I agree with you. "This" refers to my picture, which requires either C/C++ or Fortran speed if you want to get anywhere. Same applies to higher-dimensional QMC sims.
>>
>>61170107
>Asking for help
>On /G/
Install Gentoo faggot
>>
>>61171445
please go back to r/4chan
>>
>>61171345
Would you perhaps know if there is a cool syntax trick to convert a 1D vector into a 2D vector?
>>
>>61169828
>How did it help you? Would you recommend it?
I actually haven't read it, but I've heard a lot about it, so I was looking for similar books for other languages.
>>
>>61171528
A 1D vector can be represented in 2 space.
>>
>>61171528
you can use vec![vec![]] for 2 dimensional vectors. For example
vec![vec!['a';3];3];

will give you a 3 by 3 2 Dimensional vector filled with a's
>>
>>61171654
That seems like a hack
>>
>>61171631
Yeah but multiplying stuff instead of just having a proper multidiemsnional vector kinda sucks.

>>61171654
I meant something like slice.split, which I just found in the docs. Thanks anyway.
>>
>>61171683
because it is.
char[3][2] arr = 'a';
>>
New thread:

>>61172149
>>61172149
>>61172149
>>
>>61165008
category theory
Thread posts: 346
Thread images: 46


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