What are you working on, Sup Forums? But more importantly what kinds of panties do you wear when programming?
Previous Thread:
/dpt/ - Daily Programming Thread
Other urls found in this thread:
en.m.wikipedia.org
maa.org
twitter.com
stop hacking me nerds
All GIS fields use python because ARCGis and QGis the 2 major GIS software use python.
thanks trapposter
>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.
what does Ruby senpai think about D?
Meant for
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?
just doing my part in encouraging better programming habits
I would kill myself
cute
As a cute boy who dresses as a girl, I can testify that picture is correct.
Java isn't even that bad. It's got a lot of fun libraries.
name some fun java libraries
...
she is pretty cute
10 / 10 would have white babies with
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
You may have a hard time doing that
any good guides for study spring framework?
>
>hard time
this is the idea
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
en.m.wikipedia.org
Here you go user.
>hard time
Java of course!
Its simple,powerful,and fast enough for most projects
Java is the best programming language!
what are your thoughts on Crystal?
inquiring minds &c.
She can't be as hard as all the abstract layers of Object Oriented Programming in Java
Weird language with some interesting features. I like the idea of a static if.
Needs to mature more, but an interesting idea in theory.
kys degenerate animefag
I recognise that thang.
>tfw only real intellectuals understand programming after years of mastering the craft
...
stop with this faggotry
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 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.
who's this
I invent a new language, even if I have to bootstrap with machine code.
Probably not Satania.
after reading about and doing programming logic I have gotten better at math. Anyone else the same?
Put your trip, Ruby.
>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
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.
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.
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
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
that's exactly right
read lockhart's lament to learn the magic of math: maa.org
pro tip: programming IS math
>I like the idea of a static if
C++17 also has this functionality (constexpr if)
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.
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.
>it still doesn't have designated struct initializers.
C only had them for like 20 years. Maybe C++21 will have them.
>C++
>C
Is this 1980?
What are you trying to say? Designated struct initialization was added in C99.
>oldest features in D
wow that's probably been there since ... 2000!
Whoops, I meant 2005
What's he's trying to say is that there's no reason to use obsolete languages.
How do I increment a struc character pointer
struct string {
char *ptr;
size_t len;
};
s.ptr
It's only been 12 years!
Back to /wdg/
excuse me?
Okay.
my favorite programming topic is advanced php topics
>there will never be a decent combination of Idris, Haskell, Lisp and C
you don't need any of that when you have Java my friend
...
allocate or increment?
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.
increment
lol
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 do
isPrime do
writeArray sieve j False
return sieve
primesToUA :: Int -> [Int]
primesToUA top = 2 : [i*2+1 | (i,True) 664579
No, programming is logic. Math uses logic but logic isn't math.
s.ptr += n; // n is some positive integer
s.ptr++; // increment by one
Looks to be O(n * sqrt(n))-ish.
>O(n * sqrt(n))
you're looking at it wrong
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.
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?
I don't see how stuff like inheritance and reading/writing files is mathy.
Java is the best programming language!
prove wrong
can you?
>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.
just use bitmaps :^)
Bitmaps is still maths
>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.
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.
Problem with Java is the Java-GTK programs are a pain in the ass to build.
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...
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.
what kind of retard would use java+gtk
Name one better alternative that doesn't look like am inconsistent trash with horribly crippled fonts
>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
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.
>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.
>they use math but that doesn't mean they are math.
Kill yourself retard.
>not just saying that you're in hurry and walking away
>using something means it is something
kys
has a/is a, is one of the most basic principles of OOP.
>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.
I had my memepad with my whole setup deployed. It was too late
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.
Yeah nice catch. Iterating from 2 up make sense if you're building a sieve of Erathostenes, but that other sperg isn't.