[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: 336
Thread images: 32

File: 1443500977688.png (835KB, 1200x1080px) Image search: [Google]
1443500977688.png
835KB, 1200x1080px
What are you working on, /g/? But more importantly what kinds of panties do you wear when programming?
Previous Thread: >>59040172
>>
stop hacking me nerds
>>
>>59045009
All GIS fields use python because ARCGis and QGis the 2 major GIS software use python.
>>
>>59045009
thanks trapposter
>>
>>59045013
>My first year in college (electronics engineering) starts in two weeks

My advice is to just focus on studying and having a social life/hobby. Too many people already flunk out of EE year 1. You won't make it to the programming modules if you drop out of your first semster.
>>
File: 15822597.jpg (5KB, 370x334px) Image search: [Google]
15822597.jpg
5KB, 370x334px
what does Ruby senpai think about D?
>>
>>59045030
Meant for >>59044994
>>
File: 1445491241968.jpg (282KB, 1879x1966px) Image search: [Google]
1445491241968.jpg
282KB, 1879x1966px
>>59045009
Spread the truth
>>
php and Java are the only last two programming languages left on earth

So now you must choose would you rather program in Java or php?
>>
>>59045043
just doing my part in encouraging better programming habits

>>59045066
I would kill myself
>>
>>59045063
cute
>>
>>59045009
As a cute boy who dresses as a girl, I can testify that picture is correct.
>>
>>59045066
Java isn't even that bad. It's got a lot of fun libraries.
>>
>>59045093
name some fun java libraries
>>
File: 12830560110.jpg (251KB, 1066x1094px) Image search: [Google]
12830560110.jpg
251KB, 1066x1094px
>>59045066
>>
>>59045115
she is pretty cute

10 / 10 would have white babies with
>>
>>59045051
You may be right. I've been told a lot of people simply don't make it there, despite how relatively easy it is to get in.

So, lets say i 'ditch' the learning.. not saying to go arduino tier, but making simple things and building up good habits in the process. Maybe simple scripts to do works faster or display some functions in the way i want them to. Is there hope for that? Or i should just wait in order to not bite more than i can chew
>>
>>59045131
You may have a hard time doing that
>>
any good guides for study spring framework?
>>
>>59045131
>
>>
>>59045148
>hard time
this is the idea
>>
>>59045141
I'd recommend studying and brushing up on your math and physics because EE is all heavy math and physics and if you really want learn fundamentals of a programming scripting language since it's not that brain draining and will help you in the future
>>
>>59045131

https://en.m.wikipedia.org/wiki/Bailey_Jay

Here you go anon.
>>
File: 1385139347936.png (143KB, 332x394px) Image search: [Google]
1385139347936.png
143KB, 332x394px
>>59045148
>hard time
>>
>>59045066
Java of course!

Its simple,powerful,and fast enough for most projects
>>
Java is the best programming language!
>>
>>59045167
what are your thoughts on Crystal?
inquiring minds &c.
>>
>>59045148
She can't be as hard as all the abstract layers of Object Oriented Programming in Java
>>
>>59045054

Weird language with some interesting features. I like the idea of a static if.

>>59045213

Needs to mature more, but an interesting idea in theory.
>>
>>59045009
kys degenerate animefag
>>
>>59045054
I recognise that thang.
>>
File: smart.png (299KB, 680x598px) Image search: [Google]
smart.png
299KB, 680x598px
>tfw only real intellectuals understand programming after years of mastering the craft
>>
File: 1483936609934.png (1MB, 1702x2471px) Image search: [Google]
1483936609934.png
1MB, 1702x2471px
>>
File: 002.jpg (35KB, 876x287px) Image search: [Google]
002.jpg
35KB, 876x287px
>>59045009
stop with this faggotry
>>
>>59045141
If you are free go borrow some books about programming and see which one you like. I recommend Python cause it is not really syntax heavy and you get to learn about basic concepts about programming. You will get the more computer stuff in EE anyway when you are forced to do microprocessor stuff. I know I did.

But what >>59045183 he said. If you have time, go brush up your maths and physics. EE is really maths and physics heavy. You will flunk out if you aren't good in maths.
>>
>>59045239
who's this
>>
>>59045066
I invent a new language, even if I have to bootstrap with machine code.
>>
>>59045263
Probably not Satania.
>>
after reading about and doing programming logic I have gotten better at math. Anyone else the same?
>>
>>59045009
Put your trip, Ruby.
>>
>>59045215
>java is hard
>>
is there a good book on just bitwise operations and algorithms? I can do boolean math on paper, but I am shit at it in programs
>>
>>59045098
I think I meant classes. The file class is cool because you can write a directory file search program pretty easily, same with jswing or whatever the gui window thing is called. You guys just hate anything that makes programming more accessible.
>>
>>59045372
You don't need a book. Just think of a byte as an 8 long array, etc. Everything is very easy to reason about that way.
>>
>>59045302
Same. I think the issue is that math is taught so shit at schools that when you finally get to learn math in a new way it makes a lot more sense
>>
>>59045417
It does you don't even understand I have had the shittiest math teachers from elementary to high school and horrible math professors but until I found one really good math tutor I finally understood math properly

For math you need a strong math base foundation from a good math teacher to become good at it
>>
>>59045417
that's exactly right
read lockhart's lament to learn the magic of math: http://www.maa.org/external_archive/devlin/devlin_03_08.html

pro tip: programming IS math
>>
>>59045222
>I like the idea of a static if
C++17 also has this functionality (constexpr if)
>>
>>59045436
Wait till you see the beauty in maths. That is one hell of a bunny hole. Suddenly stuff like click and you understand how out of league you are compared to famed mathematics. Literal autism.
>>
>>59045475
Nice to see that C++ is catching up to one of the oldest features of D. In 2017. Hopefully.
Eh fuck it, it still doesn't have designated struct initializers.
>>
>>59045550
>it still doesn't have designated struct initializers.
C only had them for like 20 years. Maybe C++21 will have them.
>>
>>59045550
>C++
>>59045564
>C
Is this 1980?
>>
>>59045576
What are you trying to say? Designated struct initialization was added in C99.
>>
>>59045550
>oldest features in D
wow that's probably been there since ... 2000!
>>
>>59045602
Whoops, I meant 2005
>>
>>59045592
What's he's trying to say is that there's no reason to use obsolete languages.
>>
>>59045009
How do I increment a struc character pointer

struct string {
char *ptr;
size_t len;
};
s.ptr
>>
>>59045623
It's only been 12 years!
>>59045650
Back to /wdg/
>>
>>59045664
excuse me?
>>
>>59045674
Okay.
>>
my favorite programming topic is advanced php topics
>>
File: gensokyo.jpg (256KB, 1000x1502px) Image search: [Google]
gensokyo.jpg
256KB, 1000x1502px
>there will never be a decent combination of Idris, Haskell, Lisp and C
>>
>>59045690
you don't need any of that when you have Java my friend
>>
File: 1484950301696.jpg (146KB, 432x529px) Image search: [Google]
1484950301696.jpg
146KB, 432x529px
>>59045705
>>
>>59045661
allocate or increment?
>>
File: Screenshot_2017-02-21_00-10-43.png (21KB, 562x338px) Image search: [Google]
Screenshot_2017-02-21_00-10-43.png
21KB, 562x338px
Today I learned about the importance of optimization and proper implementation of algorithms:
num = 600851475143
lst = []
for i in range(2, num):
if i % 2 != 0 and num % i == 0:
rng = range(2, int(i ** 0.5) + 1)
if not any(i % m == 0 for m in rng):
lst.append(i)
print(max(lst))

For anyone who knows math, can you guess how long this will take to find the primes? Even printing(i) into > millions seems to take a while.
>>
>>59045723
increment
>>
>>59045738
lol
>>
>>59045738
import Control.Monad
import Control.Monad.ST
import Data.Array.ST
import Data.Array.Unboxed

sieveUA :: Int -> UArray Int Bool
sieveUA top = runSTUArray $ do
let m = (top-1) `div` 2
r = floor . sqrt $ fromIntegral top + 1
sieve <- newArray (1,m) True -- :: ST s (STUArray s Int Bool)
forM_ [1..r `div` 2] $ \i -> do
isPrime <- readArray sieve i
when isPrime $ do -- ((2*i+1)^2-1)`div`2 == 2*i*(i+1)
forM_ [2*i*(i+1), 2*i*(i+2)+1..m] $ \j -> do
writeArray sieve j False
return sieve

primesToUA :: Int -> [Int]
primesToUA top = 2 : [i*2+1 | (i,True) <- assocs $ sieveUA top]


length $ primesToUA 10000000
>664579
>>
>>59045442
No, programming is logic. Math uses logic but logic isn't math.
>>
>>59045740
s.ptr += n; // n is some positive integer
s.ptr++; // increment by one
>>
>>59045738

Looks to be O(n * sqrt(n))-ish.
>>
>>59045785
>O(n * sqrt(n))
>>
>>59045772
you're looking at it wrong
>>
>>59045009
Has anyone else done buildyourownlisp.com?
It looks like it'll be worth the time investment, and it might be nice to have something to show to employers when I graduate in a few months.
>>
>>59045738
Why do you need the to declare rng? instead of using

if not any(i % m == 0 for m in range(2, 2, int(i ** 0.5) + 1):


Why are you not using list comprehension if you are making a list?

Why are you creating a list and then finding the max from the list?

Why not just create a single variable and compare it with every new i and if it is bigger, store it in another variable?
>>
>>59045800
I don't see how stuff like inheritance and reading/writing files is mathy.
>>
Java is the best programming language!
>>
prove >>59045827 wrong

can you?
>>
>>59045825
>reading/writing files is mathy.
Alright Einstein. How is a image compressed when using a .png compared to .jpg. Do you think opening a .png and .jpg is the same? How about creating a .png vs a .jpg.
>>
>>59045844
just use bitmaps :^)
>>
>>59045854
Bitmaps is still maths
>>
>>59045844
>picking one of the most math-heavy areas
Just because it can use math doesn't mean it is math. The vast majority of math the average programmer does is no harder than basic BEDMAS.
>>
>>59045860
No fucking shit. The underlying concept is still heavily stepped in mathematics retard. Just cause you don't understand the underlying principals, doesn't mean everyone is a code monkey like you who don't bother understanding what they are typing.
>>
>>59045827
>>59045839
Problem with Java is the Java-GTK programs are a pain in the ass to build.
>>
>>59045738
>>59045800
You're factoring num right?
As for the big O, here's my reasoning:
1 you do num iterations in the outer loop
2 inside of that you have "any" that iterates over sqrt(i) elements (way too much btw)
3 any will terminate early when it finds a divisor, but that doesn't count since it's worst-case complexity
4 You have Σ[i=2,n] i**0.5. After that I don't know. Maybe one can't argue it's less than O (n**1.5)? Exponents don't distribute on addition...
>>
>>59045874
So then tell me, how is reading/writing to a text file math?
How is printing text to the screen math?
Read a database with calculus.
>>
>>59045877
what kind of retard would use java+gtk
>>
>>59045888
Name one better alternative that doesn't look like am inconsistent trash with horribly crippled fonts
>>
>>59045886
>So then tell me, how is reading/writing to a text file math?

What do you think your text file looks like when it on your HDD? You think your HDD writer wrote in english language on a piece of paper on your harddrive?

>How is printing text to the screen math?
How does your CPU know what to print on screen? Does your CPU know english? Do your VGA/DVI/HDMI know english which it then tells your monitor to display?

GTFO retard
>>
>lounging around my community college campus wondering what I'm doing with my life
>one of my classmates from public speaking shows up
>starts talking with me
>fucking why
>he asks me what I thought of his "about me" presentation
>lied and said it was cool
>he goes on about his future and how he wants to study computer science and shit
>I ask him what knows and does right now
>he says he knows how to build computers
>I told him that will not help with programming or computer science
>he says he knows but goes on about he's so far ahead
>I start sperging out and telling him he's going to fail and that's he's retarded for thinking the way he does
>he starts getting angry from my attitude and asks why I'm being such a dick
>start projecting my failure on him
>after probably 3 or 4 minutes of ranting and autistic screeching I stop
>realize what I did and apologize
>he asks if I want to go get pizza with him now
>no fucking way
>he gets angry again and leaves
I'm not sure what's worse: me being an idiotic sperg or that guy's ignorance
>>
>>59045817
Both of you are complete retards

1 If you want to avoid making a list, just replace
lst.append(i)
work
yield i
, wrap the fire loop in a function, and call mac on the result of calling this function. No need to reinvent max.

2 max is useless. Since i is increasing, the last value will also be the biggest.
>>
>>59045910
>things are stored in binary so it must be math
'no'
Math is as relevant to programming as mechanical engineering, they use math but that doesn't mean they are math.
>>
>>59045935
>they use math but that doesn't mean they are math.
Kill yourself retard.
>>
>>59045921
>not just saying that you're in hurry and walking away
>>
>>59045943
>using something means it is something
kys
has a/is a, is one of the most basic principles of OOP.
>>
>>59045932
>2 max is useless. Since i is increasing, the last value will also be the biggest.

Check this retard out. If that was the case might as well run the range in reverse and kill it on the first positive.
>>
>>59045949
I had my memepad with my whole setup deployed. It was too late
>>
>>59045969
Programming is based on maths. It is fundamentally human language converted into maths that your CPU understands. Because at the lowest of all level, programming is basically telling a bunch of transistors with AND/OR/NAND/NOR/NOT gates how to fire and in what order. That is programming. If you didn't already figure this out, you should off yourself cause you are fucking retarded.
>>
>>59045970
Yeah nice catch. Iterating from 2 up make sense if you're building a sieve of Erathostenes, but that other sperg isn't.
>>
>>59045995
>Programming is based on maths.
I am not following your dialog but maths have nothing to do with programming. Math is different, it's science.


Programming is fiction.
>>
>>59045690
Rust
>>
>>59046015
>Programming is fiction.
Go take a course in Assembly. It is clear you are a simple code monkey.
>>
>>59045995
>programming is basically telling a bunch of transistors with AND/OR/NAND/NOR/NOT gates how to fire and in what order
Telling objects to do things based on [logic] in a certain order isn't very mathy.
>>
>>59046051
Seems like you're just looking too deeply at it and seeing things that aren't there. Doing your first assembly class?
>>
>>59046053
Next you are going to tell that describing how objects accelerate based on [logic] isn't very mathy either. Fuck off retard. Do you even know what Math is?
>>
>>59046051
>Go take a course in Assembly.
>Assembly is supposed to embody programming
>Middle school tier maths is something worth mentioning
It is clear that you are an unemployed undergrad who took CS because your were too afraid for physics. Why didn't you take liberal arts?
>>
>>59046072
>>59046065
>Assembly isn't programming
>Implying existing language weren't built based on assembly

Oh my check these retards out. I bet you think you think your CPUs runs on shaman magic.
>>
>>59046085
Many languages base on C today, if not higher.
>>
>>59046068
>Next you are going to tell that describing how objects accelerate based on [logic] isn't very mathy either.
But that uses a set formula, it's not constantly updating to make objects do things.
>>
>>59045817
>Why do you need the to declare rng?
I though it looked disproportional to the rest of the code.
And for the rest of your points, you can probably guess why
>>59045785
>>59045880
I'm trying to solve Project Euler #3.
This code I stole from SE finds the highest prime in milliseconds, using factorization theorem:
n = 600851475143
i = 2
while i * i <= n:
if n % i:
i += 1
else:
n //= i
print(n)

While my butchered implementation of brute-force trial division has to iterate through multiple ranges of hundreds of billions..
>>
>>59046085
>existing language weren't built based on assembly
You really really sound like a butthurt undergrad that tries to fit in
>>
>>59046107
And you don't even sound like you have taken a single course in maths beside Calc 101.
>>
>>59046085
Considering how you misconstrued both our posts, seems like one of us hit a mark.
>>
>>59046115
haha
>>
>>59046120
Struck a nerve?
>>
Who is /templatemeta/ here?
>>
File: 1455950055870.jpg (32KB, 300x470px) Image search: [Google]
1455950055870.jpg
32KB, 300x470px
>>59046127
wooh that edge
>>
>>59046138
>Cares enough to post a reaction pic
Life must suck as a wageslave
>>
>>59045009
This OP is cancer.
>>
>>59046146
So you're not even employed?
Yeah, definitely just started your first assembly class.
>>
File: 1455761170589.jpg (100KB, 960x960px) Image search: [Google]
1455761170589.jpg
100KB, 960x960px
>>59046146
C'mon undergrad I want more of that edge
>>
>>59046104
You simply didn't understand the question being asked
>>
File: 1463100397265.jpg (1MB, 1973x5000px) Image search: [Google]
1463100397265.jpg
1MB, 1973x5000px
I stopped taking math classes after trig in high school. Can I still be a programmer?
>>
>>59046159
You can't be employed as well since you think reading and writing files isn't "maths".

>>59046162
The 2 retards band together because they ran out of arguments. Wonderful.
>>
>>59046167
Easily, just avoid research and the mathy fields like 3d/physics/statistics.
Most programming doesn't actually use that much math.
>>
>>59046167
You can become a code monkey like these 2 >>59046159
>>59046162
>>
>>59046174
>reading and writing files is maths
hahaha

more please
>>
>>59046188
>reading and writing files is maths
Check this retard out. Apparently your harddrive stores files in english.
>>
>>59046167
Yes. Most, if not all CS toddlers are basically engineering/maths/physics rejects
>>
>>59046104
Doing Euler is good.

>factorisation theorem
wtf? I don't see a theorem with that name there.


That solution is very pleasant to look at. Do you understand it? If not work on that.
>>
>>59046199
oooh maath so much symbols :D

who said C(((S))) toddlers can't entertain?
>>
why the fuck do people still use c++
>>
>>59046219
>Math is only symbols
Woah
>>
>>59046199
Check out this retard, apparently just because you use math in the process it makes the entire process math.
Is shopping math?
>>
File: alg-laughing-jpg.jpg (32KB, 750x543px) Image search: [Google]
alg-laughing-jpg.jpg
32KB, 750x543px
>>59046227
I am looking for your next statement of "wisdom", junior
>>
>>59046232
Hey retard, how do you think your CPU runs? Just curious. Or do you think it is electricity guided by magic?
>>
>>59046239
>Reaction image
>Muh trivial insult
Predictable
>>
>>59046225
legacy
and it's power
>>
>>59046245
>it uses math so it must be math
woah...
like, am I math?
1+1=2
I just used math, man I must be math!
>>
File: portrait-laughing-man-11252024.jpg (28KB, 400x267px) Image search: [Google]
portrait-laughing-man-11252024.jpg
28KB, 400x267px
>>59046245
>talks about CPU
Can you name some 7400 series ICs?

>>59046258
Please don't stop posting, my child
>>
>>59046271
>Wants me to name CPUs
>As if it is evidence about how CPUs work
More evidence of a brainlet.
>>
>>59046225
>>59046261 This + autism, people aren't going to give up their favourite languages so easily when they invested years->decades into learning them.
>>
>>59046245
It's guided by physics. Maxwell equations.
>>
>>59046266
>It uses Math
>So it is not Math
Thinking man question
>>
>>59046278
CPU has several units for different purposes: registers, ALU, decoding and so on.
>>
File: 502-34.jpg (17KB, 480x360px) Image search: [Google]
502-34.jpg
17KB, 480x360px
>>59046278
what is a signed magnitude binary?
>>
>>59046284
Good. So you said Maxwell equations so you must have figured out Math is a language to describe occurrences that happen around us right?

Guess what is also a language to communicate with CPUs?
>>
>>59046279
I guess that's what happens when you make a language with a bunch of useless exclusive features that people autistically latch on to.
>>
>>59046294
That's some terrible logic.
Math uses math, it's math.
Non-math uses math, it's not math.
Answer my question, am I math? I used math right there so according to your logic I must be math. You, who (presumably) programs, must be math too.
>>
File: images.jpg (5KB, 300x168px) Image search: [Google]
images.jpg
5KB, 300x168px
>>59046294
>guys look, I just added two integers in my assembly class so much math hurr

lol
What is a ripple counter?
>>
>>59046309
It's boolean logic, usually, may be written in hexadicemal format for human convenience. Analog signal processing however doesn't use discrete maths.
>>
>>59046323
>>59046335
Math is a language used to describe occurrences around us. You see acceleration all around us, that is described as F = MA. Every occurrences around us can be translated fundamentally to an equation in math. Programming is an extension of maths in describing how a CPU is going to run.

>>59046347
>Analog signal processing however doesn't use discrete maths.
Because Analog signal uses other forms of maths like Sin and Cos.
>>
Oh come on, CS babby I was having so much fun

Dare I say, you can't draw me a shift register? You have so much knowledge about CPUs, right?
>>
>>59046377
I am talking to a retard reading shit off wikipedia and trying to be smart.

>Only ask question cause he has no answers
Must be hard being retarded
>>
>>59046373
You didn't answer my question.
>>
>>59046309
>Math is a language to describe occurrences that happen around us right?
Probability theory describes calculating of random events.
>>
>>59046383
>shit off wikipedia
Digitial fundementals 101 haha

hey what is 2's compliment of 1101?
>>
>>59045943
wow nice argument you sure got him

according to you, every retard that uses computer must know math because hey, when you turn on the computer LOTS OF MATH HAPPENS
>>
>>59046384
You haven't answered any so I won't bother entertaining a retard
>>
stop fighting everyone :(
>>
>>59046393
>Only ask question cause he has no answers
It is entertaining watching you shit yourself
>>
>>59046373
>Because Analog signal uses other forms of maths like Sin and Cos.
It uses differential equations in general with a time differential. And usually it's not sin and cos, it's usually in complex notation, Euler's formula.
>>
>>59046404
I've answered plenty, you're just autistically avoiding everything screaming "IT'S MATH! IT'S MATH!".
>>
>>59046418
And there is laplace transformation, fourier transformation, signal convolution. What is your point? Another branch of maths is not maths?
>>
>>59046416
You are not him, are you?

Okay I'll be easy now..

>>59046383
What's the difference between DRAM and SRAM?
>>
>>59046430
>I've answered plenty
You answered none.
>>
>>59046445
Ignoring me doesn't mean I don't answer.
Are humans math?
>>
>>59046433
How is information stored in RAM in the first place?
>>
>>59046454
>Are humans math?
Move your hand. Can that be described in a mathematic formula or was that magic?
>>
>>59046457
What's the difference between information and data?


hahahahah
>>
>>59046431
Yeah, these transforms has a general name, 'integral transforms'.
>>
Sweed jesus
>These are the children that circlejerk about video cards in speccy threads and pretend they know ANYTHING about it
>>
>>59046467
So you're literally saying humans are math?
Being described in math != is math by the way.
>>
>>59046469
What is the fundamental building blocks for information and data?

hahahaha
>>
>>59046479
Register switches define a "building block" of a data.

but answer >>59046469 please lol
>>
>>59046478
Math the language to describe natural occurrences you fucking moron. What IS math according to you?
>>
>>59046495
That just means math is a description, that does not make that object math.
Again, has a/is a.
>>
>>59046491
Wrong
>>
>>59046509
lol
>>
>>59046509
Do you know what a register switch means actually
>>
>>59046505
What makes an object math.
>>
>>59046509
Where are you?

What is a Z-state?
>>
>>59046517
Do you?

>>59046511
Saying lol doesn't make you right
>>
>>59046521
Objects aren't math.
Even according to you they aren't math, "[it's] a language to describe natural occurences", note the "to describe".
Saying everything is math is as retarded as saying everything's english.
>>
>>59046164
No, my code works. It finds the prime factors of 13195 (5, 7, 13, 29), just inefficient for large numbers for (now) obvious reasons.
>>59046205
>I don't see a theorem with that name there
https://en.wikipedia.org/wiki/Fundamental_theorem_of_arithmetic
It works by repeatedly dividing out the smallest prime factor to end up with the final largest prime
>>
>>59046533
Claiming wrong does not make you right, CSbabby hahah
>>
>>59046544
Spotted the real CSbabby here.
>>
>>59046477
Really makes you think
>>
>>59046548
>CS
I'd kill myself twice before even thinking about IT science
>>
>>59046535
That is because programming is a language you fucking moron.
>>
>>59046554
Not like you have a choice.
>>
what programming language is the best for attracting cat girls?
>>
>>59046557
Programming has languages, it isn't a language.
How haven't you dropped out yet? You're having so much difficulty with has a/is a.
>>
>>59046576
Java, makes you suicidal so you can finally see those sexy sexy cat girls. They'll be torturing you for all of eternity but that still counts right? I'm sure you're a massive M anyway.
>>
>>59046577
Okay then if programming isn't a language. What is programming. Do note I am using language in it's literal form as in communication. Not different languages like C, C++ etc.
>>
>>59046609
Programming is an abstract concept that uses commands to tell the hardware what to do. Programming itself doesn't communicate, it's the abstract idea of communication, the languages use that idea.
>>
>>59045550
write a fucking constructor
>>
>>59045690
I don't actually like rust but that is probably the best you're going to get
>>
>>59046635
imperative programming uses commands, your beloved Shitskell isn't imperative
>>
>>59046635
Programming is instructing your compiler what instruction to produce for the CPU
>>
>>59046650
compiler can do it itself
>>
>>59046635
>Programming itself doesn't communicate
No fucking shit.

>abstract idea of communication
>Programming is an abstract concept
How is you communicating a set of instructions to your CPU in any fucking form "abstract"?

>the languages use that idea.
Programming is the subject of communication with CPU. Languages is how you communication.
>>
>>59046130
I'm working on a numpy-esque ndarray library at template time
>>
>>59046671
Your compiler changes your beloved language into actual mathematically based instructions that a CPU can understand.
>>
>>59045009
I'm learning D. And I'm loving it
>>
>>59046683
Just stop it dude you end up sounding funny
>>
>>59046673
>How is you communicating a set of instructions to your CPU in any fucking form "abstract"?
Because "programming" relies on a programming language to do things, that makes it pretty fucking abstract.
>>
>>59046692
Says the guy who thinks programming is an abstract form of communication. Is posting on 4chan abstract as well?
>>
>>59046044
>>59046647
No
>>
It's funny how IRCs are much constructive and mature

>>59046704
I wasn't even him
>>
>>59046683
You mean logic-based instructions.
>>
>>59046700
https://www.vocabulary.com/dictionary/abstract
Look under adjective. Not only would you fail CS, you would fail english.
>>
>>59046710
yes
>>
>>59046710
Nothing wrong with Rust but memes
>>
>>59046716
Yes transistors inside a CPU fundamentally work based on logic so their instructions must also be logically. The formation of such instructions uses maths. So really it is mathematically instruction based on logic gates.
>>
>>59046718
>Use the adjective abstract for something that is not a material object or is general and not based on specific examples.
Fits the bill quite well. Programming is just the idea of using software to communicate with hardware, again, you need a language to actually communicate,
>>
>>59046683
If you don't think type theory is math you are actually retarded. Also, there is some unreal math involved in some optimizations. GCC uses isl to do integer convex optimizations for rewriting loops.

> inb4 you don't know why integer convex optimization is harder than real convex optimization
>>
>>59046650
>>59046673
>>59046683
programming languages target abstract machines and remain defined without physical hardware. concrete compiler implementations are what target actual hardware, and that's another story entirely. programming is the theoretical application of programming languages. a program can be written in an abstract language for which no concrete implementation exists. doing so would still be programming
>>
>>59046714
>It's funny how IRCs are much constructive and mature
That's because on IRC it's really easy to just ignore trolls and all future messages by them. On /g/ you can hide a single post. No clue why we don't have color user IDs yet.
>>
>>59046716
No. They're not logic based, sequences of 1 and 0 adjusted to some protocol of an instruction format, opcodes and other shit. They can use for example an instruction for proprietary h.264 decoder block in a cpu.
>>
>>59046735
The rust community is fucking cancer. They love to jump all over any C bug and act like if you rewrite all the world's software it rust we will live is some fucking utopia. They forget that they are running an OS written in C, using a windowing system written in C and a browser written in C++.

They also poke at C++ from 1999 and pretend it is indicative of modern C++.
>>
File: 1478728918015.jpg (156KB, 1000x990px) Image search: [Google]
1478728918015.jpg
156KB, 1000x990px
ITT: autistic stretching over 9000
>>
>>59046758
>No. They're not logic based
It literally boils down to logic gates that get electricity passed through them.
>>
File: 1442978012236.jpg (118KB, 900x641px) Image search: [Google]
1442978012236.jpg
118KB, 900x641px
>>59046767
dumb frogposter
>>
Don't get why people hate on java so much. Spring Boot is pretty secks.
>>
>>59046758
you are fucking delusional. your definition of logic is a non-starter because according to you nothing is logic.
>>
File: faggot.png (91KB, 620x600px) Image search: [Google]
faggot.png
91KB, 620x600px
>>59046772
eat shit
>>
>>59046777
Because Java represents the point when programming stepped out of its parent's basement and out of stuffy university Math labs. Abandonment complex and all that.
>>
>>59046767
Kiil yourself frogfag
>>
>>59046771
Evaluation of instructions by a CPU is based on logic, instructions are not based on logic, their sequence is based on a communication protocol.
>>
>>59046777
java makes it impossible to write expressive code. writing java all day would suck the enjoyment out of programming. The jvm is amazing tech and I think java is very good for large orgs where they want to limit the damage any single incompetent engineer can do. I see java as a clamp function on talent; no single dipshit can ruin the project but exceptional engineers cap out quickly. I think Scala is a cool use of the jvm where you can get the stability of the java ecosystem while allowing you to write expressive code.
>>
>>59046754
4chan enables idiots by letting them hide behind the mask of pseudo anonymity. That's why chan boards are so full of non constructive shitposts and spams

>>59046765
Have you been to a Rust IRC ever? That's the most friendly and well behaved community I came across and they helped me a lot in understanding so many concepts. The IRC channels are busy and full of new and old programmers helping each other out.

>They love to jump all over any C bug
Rust would, in fact, prevent more than half of Linux's bugs in the present and past times.

> They forget that they are running an OS written in C
What does that mean? There are many projects in Rust and some even made OSes on that Language. Are you saying that Rust should be silent towards C's lack of safety concepts? Also you are running Javascript and python as well.
>>
File: Screenshot 2016-10-04 23.27.17.png (670KB, 1920x1080px) Image search: [Google]
Screenshot 2016-10-04 23.27.17.png
670KB, 1920x1080px
Is there even a point to using the threading module in Python instead of the multiprocessing module?

Seems like multiprocessing will be a lot faster and result in true parallelism because of the limitations caused by GIL

When would you ever use threading over multiprocessing?
>>
>>59046777
i have several examples of standalone spring boot client-server apps that do different things and i want to make an app from where i can execute them at will, with different configurations and such.

how should i design that? i was thinking that i might use the state pattern, but each of the apps is a MVC so i don't know

i have no idea what i'm doing
>>
>>59046827
My point is that they have an absolutist mentality. They ignore the fact that there is a large stable stack written in C and C++ which they depend on every day. I haven't been in the rust IRC so it may just be a vocal minority.
>>
>>59046827
>Also you are running Javascript and python as well.
Just to extend:
Never seen a Rustfag go on autism spree by shitting on JS and Python and pretend to be an 1337 programmer. It's ALWAYS a C fag.

Ironically C is much easier to learn and use because C enable retard programmers to use it
>>
>>59046861
I like OpenCV C++ matrix implementation.
>>
>>59046810
>tfw java purposely dropped some useful features because they're scared of retards using it wrong
Is it so much to ask for unsigned ints and operator overloading?
>>
>>59046777
The fact that you feel obliged to use a framework to do anything in Java despite its already huge standard library tells not that much about the language itself, but more about its surrounding environment. Layers and layers and layers of abstraction that never seem to end up stacking themselves. The business worldview embedded in programming.

I must check those trips though.
>>
>>59046851
Code that cares about parallelism will release the gil wherever possible. For example, numpy releases the gil whenever it does anything expensive. multiprocessing incurs serialization costs to let processes communicate; threading does not. If you are interested in a real use for threading look at dask's multithreaded task scheduler. It is faster than the multiprocessing scheduler and the sync scheduler.
>>
>>59046867
I like what Linus Torvalds said about C++ and C. And why he chose C for git. C is also used in BSD, Windows and OSX kernels.
>>
Anyways I am leaving 4chan. Enjoy your trash threads with zero discussion but politics and philosophy instead of being constructive.
>>
>>59046885
I see why operator overloaded was not added. It has too much downside risk. It helps slightly when you are familiar with the code and the concepts; however, when people fuck it up it is really bad. Java optimizes for programmers of various levels being able to work productively on a shared codebase. That means cutting out "cute" operator overloads like 'ostream& operator<<(ostream&, const T&)'.

The unsigned thing is shitty though.
>>
>>59046914
Do you think if Linus were to make another kernel he would have picked Rust?
>>
>>59046916
k bye
>>
>>59046916
Do you have any alternatives? I don't like consumer tier threads and gaymers here.
>>
>>59046926
no way in hell. Linus is too pragmatic for that shit. git is partly in C because it was made for the development of the linux kernel, also written in C. You don't want to alienate a huge amount of great contributors because of muh ideals when you are trying to solve real problems.
>>
>>59046885
>Java uses signed bytes
FILES

EXIST

DATA STREAM

GRAH MAD!!!
>>
>>59046951
When Linus started his kernel, it was his pet project. There were no co developers.
I just think Rust is a better tool than C ootb
>>
>>59046926
A kernel is nearly exclusively unsafe code. And writing data directly to memory addresses is a huge pain in the ass in Rust.
>>
File: 1485951215266s.jpg (7KB, 250x214px) Image search: [Google]
1485951215266s.jpg
7KB, 250x214px
>>59046895
Yeah, I figured the advantage of threading would be less interprocess communication overhead (because of shared memory space between threads) but I couldn't really think of a case in my problem domain where I'd want that over actual parallelism from multiprocessing -- especially when a task is CPU bound

I guess you're right that it'd be good for a usecase involving libraries that are optimized to release the GIL in a threadsafe way. I'll have to check out dask because that code might provide the canonical example of when to use threads over processes.

Thanks
>>
>>59046984
I am the person who said I did not think Linus would have used Rust; however, I don't agree with this post. There is a lot of code which could be written in a safe way with Rust in a kernel while some low level pieces would be unsafe. This is sort of like when you are working in Haskell and you write the core data structures and algorithms with pure functions and then compose them to solve domain problems in a monadic fashion. Unsafe works in a similar but inverted way. You write the primitive interactions in unsafe blocks and then wrap that up in safe code.

I still don't think you would want to use rust for a kernel because you then rely on the compiler's optimizations for correct code. I say this because in the context of a soft-realtime system like a kernel, speed is part of the definition of correct. The compiler is not perfect at eliding copies and range checks; however, programmers aided by static analysis tools can avoid unneeded checks or lift them out of the hot path when needed.

A thing a lot of people forget is that there is a large body of C and C++ static analysis tools. The fact that many people don't use these is a problem, but that doesn't mean we replace the language. It means we should use these tools!.

>>59046969
But if were starting again today he would probably consider the landscape and see that C still has the highest volume of competent systems developers and tooling and and use it. I believe he intended to make Linux a public, collaborative project from the start. I don't think he anticipated the success it has, but he wanted it to be collaborative from the start.
>>
>>59047056
what is your use case? IO bound code like waiting on a socket also releases the gil so threading can still show big wins for web servers.
>>
>>59046984
>A kernel is nearly exclusively unsafe code.
Not true, see https://github.com/redox-os/redox . Specifically https://doc.redox-os.org/book/introduction/unsafes.html :
> A quick grep gives us some stats: the kernel has about 70 invocations of unsafe in about 4500 lines of code overall.
>>
>>59047079
near real-time CV/OCR using tesseract/OpenCV, so lots of CPU-bound numpy calculations
>>
>>59047204
Threading should be fine. I use python for financial simulations and trading and threading is fine. Numpy is very disciplined about releasing the gil. Also, if you need to dip into C or C++ yourself you can release the gil before doing you matrix operations. You would probably be very interested in dask.array though.
>>
>>59045690
if you have idris, you already have the good parts of haskell
>>
>>59045738
Please please please, for the love of god, refactor your code into functions. Even if you only use them once, a good function name is better than any comment.
>>
File: 1453653416676.jpg (73KB, 500x500px) Image search: [Google]
1453653416676.jpg
73KB, 500x500px
>>59047228
Kore wa bait desu ka?
>>
>>59047267
>not commenting every function so you have a good function name AND a good comment
>>
>>59047286
you haven't used idris have you
>>
>>59047293
Idris has a lot of flaws that Haskell didn't
>>
>>59047309
which are? Idris deprecates haskell
>>
>>59047314
>Idris deprecates haskell
No it doesn't
>>
>>59047314
Explain
>>
>>59047286
>ローマ字
>>>/r/ibbit
>>
>>59046104
The key idea is that the smallest prime factor of a number can't be bigger than its square root. So if the index gets bigger than the square root of the number, the number is prime. That gives the algorithm a quadratic speedup.

The other aspect is dividing by the factors you find to make the number you are factoring smaller. This gives a big speedup if the number you are factoring has many small factors (and nothing if it is prime).
>>
>>59047350
>korere
whoops, i fucked that up
>>59047339
これわbaitですか
>>
>>59047204
you can try TensorFlow for OCR
>>
File: 1459376936517.png (118KB, 330x390px) Image search: [Google]
1459376936517.png
118KB, 330x390px
>>59047350
remove yourself from this thread, plebbitor.
>>59047362
i don't know why you think this post isn't also butchering what you were trying to say
>>
>>59047372
>butchering what you were trying to say
did you want katekana for bait?
>>
>>59046095
And what do you think C is based on
>>
>>59047381
no, i want you to either write in English or to not make basic mistakes
>>
>>59047423
C was scribbled down onto stone tablets by moses

>>59047428
such as
>>
>>59047423
FORTRAN?
>>
>>59047435
such as not butchering basic grammar.
>>
>>59047423
C is based, let's leave it at that.
>>
>>59047423
on itself.
>>
>>59047450
still not hearing any arguments
it was perfect grammar
>>
>>59047423
The original design for C came from B, which came from BCPL.
The person you replied to is a fucking idiot, though.
>>
>>59047438
ALGOL may be.
>>
>>59047465
'わ' instead of 'は' is by no means perfect grammar. you have to be a literal retard to claim that it is.
>>
>>59047486
は and わ are the same
>>
>>59047495
So
はい
and
わい
Are the same?
Keks were had
>>
>>59047486
>>59047495
Wait no, は is ha isn't it?
>>
>>59047495
what language are you talking about? it sure as fuck doesn't sound like japanese
>>
>>59047511
only when it's not a subject particle. which it is in your retarded sentence.
>>
>>59047523
well I typed wa, blame windows 10
>>
>>59047525
which you shouldn't have typed.
>windows 10
>>>/r/ibbit
>>
>>59047528
Why shouldn't I have typed it?
It's still wa. You don't say kore ha.
You shouldn't have complained, you just made everything worse

fucking weeaboo
>>
Hey guys, am I using Julia right?

function fib(n)
([1 1; 1 0]^n)[1,1]
end
>>
>>59046636
http://pastebin.com/s0DdJTE9
Yeah, just write a fucking constructor right? retard.
>>
>>59047535
>Why shouldn't I have typed it?
because IMEs aren't smart enough to deduce whether or not it's supposed to be a subject particle
>It's still wa. You don't say kore ha.
it is, but you're not speaking right now, you're typing.
>You shouldn't have complained, you just made everything worse
oh yes, who cares about things like "the truth"
>fucking weeaboo
are you one of them 'new' 'fags'?
>>
>>59047563
>Syntax: C++
Is no way is that valid C++.
That is actually one of the key features that is present in C but lacking from C++.
>>
File: 1487182103897.jpg (58KB, 818x1024px) Image search: [Google]
1487182103897.jpg
58KB, 818x1024px
>>59047565
stop antagonising me!
i made one character mistake!
>>
>>59047536
Well, you're certainly using a good algorithm for computing Fibonacci numbers, and using matrix exponentiation for basic tasks is idiomatic in Julia/Matlab. So... yes? Assuming returning a possibly-overflowing 64-bit int is what you intended.

You could optimize that fib function by expanding the matrices into normal variables, and writing the equivalent of the exponentiation by squaring yourself. But it would be less readable, and Fibonacci numbers overflow for fairly small inputs anyway so there's no point in micro-optimizing.
>>
>>59047588
>stop antagonising me!
why is that?
>i made one character mistake!
i do not forgive a mistake and i rarely forget one.
>>
File: 1485089311561.gif (74KB, 480x270px) Image search: [Google]
1485089311561.gif
74KB, 480x270px
>>59047613
>>
File: updater.png (198KB, 618x447px) Image search: [Google]
updater.png
198KB, 618x447px
Is there a way to make a wxWidgets program look like pic related. I think it's just a borderless window with a background image, but I'm not sure.
>>
>>59047536
Fibonacci numbers must be the best examples of how huge of a speedup you can get by picking a proper algorithm.

The naive algorithm runs in exponential time. The optimal (for exact computation) algorithm runs in log time.That's not one but two exponential speedups for a really basic problem that can easily be explained to pretty much anyone.
>>
>>59047575
It's valid C++ you fucking faggot since it compiles in my standard C++ compiler.
The key point here is all the fucking zeros. In C you can omit all those and the compiler will initialize them to zero for you so that you don't bloat up your fucking code with all those pointless fucking lines that the compiler could EASILY fucking take care of itself but the retarded fucking C++ committee are too fucking busy jacking each other off.

In case you still don't understand, this is what the file could look like in C:
http://pastebin.com/RqfWMLu1

Also, not supporting designated initializer lists for structs is also a fucking retarded idea.
I thought C++'s philosophy was to allow the programmer to use any fucking programming style they want!
>>
I hate niggres.
>>
>>59045690
>combining functional and low-level languages
I don't think that's going to work.
>>
>>59047660
racket can do systems programming
>>
>>59047660
you could exclusively use manual memory primitives in haskell but ghc wouldn't optimise
>>
>>59047653
>Compiler extensions are part of the language
You are a complete fucking idiot.
If you allow that sort of shit when discussing languages, every meaningful thing you can say flies out of the window.
I could implement a compiler that has all of the features I want and just happens to also accept valid C, and claim that C has basically everything.
>>
>>59047286
korewa zombie desu ka?
>>
Can't wait until fp is taken seriously.
>>
>>59047692
haskellfag here
You might be waiting a while
>>
>>59047692
will neve be taken srs lol
>>
>>59047692
>tfw even javascript fags are doing fp and taking over it
>>
>>59047684
CXXFLAGS = -std=c++14 -Wall -pipe -ffreestanding -nostdlib -fno-rtti -fno-exceptions -fno-sized-deallocation -fstack-protector -Os -fno-omit-frame-pointer -masm=intel -march=i686 -I$(INCDIR)/

>-std=c++14
There's no extensions you fucking moron, it's standard C++14. But good job on being retarded.
>>
Computer graphics, we have to draw a line using the midpoint algorithm. Not that complex at all, right?

But somehow my line keeps coming out as totally different from the one the (professor-given so presumably reliable) DDA line and I totally don't understand why. I've looked it up on ten different sites by now, tried everything, and found no reason why this doesn't work.

DrawMidPointLine(CG1_Line Line, RGB_Color color)
{
int x0 = Line.X0(), y0 = Line.Y0();
int x1 = Line.X1(), y1 = Line.Y1();
int dx = x1 - x0, dy = y1 - y0;
int incE = 2 * dy;
int incNE = 2 * (dy - dx);
int d = (2 * dy) - dx;
int y = y0;
for(int x = x0; x < x1; x++){
canvas->putPixel(x,y,color);
if(d > 0){
d += incNE;
y++;
}
else
d += incE;
}
}
>>
>>59045690
Rust is probably the closest candidate. Low level access like C, a strong type system with pattern matching like ML-family languages, and syntax tree macros like Lisp.

>>59047660
Actually, you should see Erlang's facilities for bit-twiddling. It's pretty great. I could definitely see domain-specific low-level functional languages work. General purpose languages that are low level in more ways than one are a bit harder.
>>
>>59047721
Why don't you like AT&T asm?
>>
>>59047721
I'm not going to claim to know whatever that clusterfuck of a language contains, and especially the shit they keep adding in the new version, but if it's valid, why does clang provide a warning for this "valid" feature?
If it really is valid, please posts a link to the section of the C++ standard describing the feature.
>>
>>59047754
https://gcc.gnu.org/onlinedocs/gcc/C_002b_002b-Extensions.html#C_002b_002b-Extensions
>>
>>59047753
Same reason why I don't like eating shit out of the toilet.
>>
File: tumblr_o12jyoBbYi1t3uwllo1_400.gif (262KB, 384x288px) Image search: [Google]
tumblr_o12jyoBbYi1t3uwllo1_400.gif
262KB, 384x288px
So many books that teach you programming in an object oriented paradigm.

Why aren't there any books that teach a new learner Functional programming from the get go?
>>
>>59047780
Stop fucking around, and admit that you're wrong.
>>
>>59047785
https://github.com/torvalds/linux/blob/master/arch/x86/kernel/head_64.S

Companies who eat shit in your terms
https://www.linuxfoundation.org/members/corporate
>>
>>59047795
That wasn't me.
Fine, I admit that I may be wrong, but then why would clang only WARN you even when -Wpedantic is on?
>>
>>59047790
You could try the Haskell book (or the wikibook)
>>
>>59047813
Because I asked for warnings, not errors.
Wpedantic is for shit which breaks standards-conformance, which this feature certainly is.
>>
>>59047806
>Companies who eat shit in your terms
>https://www.linuxfoundation.org/members/corporate
Yeah and? What, you didn't already know that?
>>
>>59047819
>wikibook costs $60
How about I stick to D?
>>
>>59047836
(Haskell book) There's a free pdf online somewhere

The wikibook is free
>>
>>59047829
Bon appétit.
>>
>>59047824
Well then that just supports my original point even further.
>>
>>59047872
>>59047872
>>59047872
>>59047872
next thread
>>
If your code doesn't compile with -Wall -Wextra -Wpedantic -Werror, your code isn't good.
>>
>>59047882
If your code compiles with -Wall -Wextra -Wpedantic -Werror, it doesn't do anything.
>>
>>59047882
... unless you're programming on a microcontroller where the warnings that come up are simply wrong.
>>
Thread with /dpt/ in the catalog so people can actually find it:
>>59048165
>>59048165
>>59048165
>>
File: nubtask.png (37KB, 673x876px) Image search: [Google]
nubtask.png
37KB, 673x876px
im a nub:

why the fuck do i get: Y Y L L E L M D

class Top
{
public void f( Object p ) { System.out.print("Y "); }
public void f( Bottom p ) { System.out.print("Z "); }
}
class Middle extends Top
{
public void f( Top p ) { System.out.print("C "); }
public void f( Middle p ) { System.out.print("D "); }
public void f( Bottom p ) { System.out.print("E "); }
}
class Bottom extends Middle
{
public void f( Object p ){ System.out.print("L "); }
public void f( Middle p ) { System.out.print("M "); }
}
class Test
{
public static void run()
{
Object om = new Middle();
Top tt = new Top();
Top tm = new Middle();
Top tb = new Bottom();
Middle mb = new Bottom();
Bottom bb = new Bottom();
tm.f( tm );
tm.f( tt );
tb.f( tt );
tb.f( om );
mb.f( bb );
mb.f( om );
mb.f( new Middle() );
new Middle().f( mb );
}
}
Thread posts: 336
Thread images: 32


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