/dpt/ - Daily Programming Thread

No Edition Edition

What are you working on my dudes?

Other urls found in this thread:

youtube.com/watch?v=uqsZa36Io2M
en.wikipedia.org/wiki/Ncurses
ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-042j-mathematics-for-computer-science-fall-2010/
youtu.be/uqsZa36Io2M?t=1h33s
tutorial.math.lamar.edu/
twitter.com/NSFWRedditGif

I am not a computer scientist.

Embedded Fuck Python General

Who could come up with such a shitty language?

More Computer Science PhD applications!

What would you tell someone who thinks they suck at programming and can't understand anything?

best scripting language

I'm working on Python homework. About to an hero

Python is awesome. Stop talking crap.

They aren't trying hard enough.

First for GL can suck a cock

They should be patient, and they should be reading HtDP because it actually teaches HOW to program (not just tells you what elements comprise a program in language X).

Why do people keep designing languages that are riddled with the mistakes of the past, like weak or dynamic typing, or OOP?

No it isn't.

youtube.com/watch?v=uqsZa36Io2M

>python
>high performance

I would ask what it is that draws you to programming. You really shouldn't go into a profession just because everyone else is. You should find something you enjoy, that you are capable enough at doing that you can make a living off of it. Alternatively, find a job that will allow you the free time to work on your hobbies while still supporting you. Programming can be fun for many, but you shouldn't force yourself into it.

>lying
why would you do this

kys shitty web dev

I speak only truth.

ball pythons > the python language

Is this a critique of Python or of Django

you always forget to put link to the old thread, dumbfuck

how about use some fucking words instead of linking an hour long video on youtube

>2016±1
>not reading research papers to become a better code monkey

Both.

Python doesn't give you the tools necessary to program effectively.

A language is neither performant or not

An implementation may or may nort be

Can we bring a racial discrimination lawsuit against Google, then?

hognose > ball python

what is missing ?

Your definition of "effectively" is skewed.

Lazy evaluation
Typeclasses

Referential transparency

>dudes
I sexually identify as a bumblebee, you.shitlord

Take that into account next time

A shame that such fine creatures are now associated with a terrible programming language.

Oh hey, Ruby has lazy evaluation... but only when you explicitly ask for it.

Fuck Python it's much too useful.

Shut up.

Attract Normies.

How much math do I need to know to be better than the typical pajeet?

How much to be rainman tier problem solving?

def palindrome_check(string_to_check):
string_reversed = ''
for x in range(len(string_to_check)-1, -1, -1):
string_reversed += string_to_check[x]
if string_to_check == string_reversed:
return True
else:
return False

print (palindrome_check(""))


I know the "-1, -1, -1" reverses the string, but how does it work?

golang backend service

This is a terrible method.

People, for the most part, design languages that they would like to use. It doesn't matter if you don't like weak or dynamic typing or OOP, it's what they like that counts. Inevitably, some people will use those languages because those are features that they personally enjoy as well.

So in other words, it has strict evaluation?

Is CLRS the best algorithms textbook?

Is there anything better?

I know, but uni forces me to learn that way. [::-1] is a lot easier and works by [begin:end:step], but I have no idea how -1 -1 -1 works
Putting -1 in the end means it starts reading backwards, what do the other -1's do?

start and end

You're not writing unsafe code user, are you?

atom or sublime

Correct. But enumerable objects can be transformed into a "lazy" enumerable object that will more or less lazy evaluate every message they receive except for I think the :first method, which forces evaluation on the first n elements. Ruby can get the primary benefits of lazy evaluation without forcing it on everything.

range(start, stop, step)

Start element was length - 1, since everything is 0-based.
Stop is -1. This is a non-inclusive range, so this means that the last element is 0.
Last -1 means that it decrements each time.

On a side note, I don't like Python's non-inclusive ranges. In Ruby, the range 1..5 includes 1,2,3,4, and 5. It makes sense. In Python, range(1,5) includes 1,2,3, and 4, but not 5.

Whats the best GUI package for python? I want something very nice and easy to use, I don't expect it to be as easy and nice as C# but I'll take what I can get

a curses wrapper, I'm sure there's one for python

>tfw when you write a function you don't fully understand and it just werks

def gcd(a , b):
if b == 0:
return a
else:
return gcd(b, a%b)


feels good, man.

I'm perfectly fine with tkinter.

So apparently python is actually really fucking useful when working on linux software (like half of it is in python for some reason). What's the best book to start learning it from?

now it's making sense, thanks guys.

Serious question about python:

If you ignore performance, is there any reason not to use python for everything. I mean obviously if you're a computer scientist, you use more, but I'm just a pleb.

Is there anything I cannot do with python?

are you literally retarded?
that shit couldn't be simpler

I also just realized it's basically the same as start/end/step method as [::-1] but I'm a fucking idiot
prolly because it's 5 AM

I'm learning Python at my uni and they highly recommend the book "perkovic introduction to computing using python"
I didnt'read it myself so take my advice with a grain of salt.

At the moment, low level stuff like drivers can't be written in python. Neither can kernels, or truly embedded programs. There is a python compiler for arduino, though, if I'm not wrong.

>he still uses python over ruby

it's fucking 2017 for christ's sake

Curses wrapper? could you explain im not too sure I understand what youre trying to tell me

How does it deal with making things look pretty?

when b == 0 your function terminates, else it calls itself (recursive function)

The thing is python is very good to use for small scale projects, if you want to do something quickly and know it will not scale then python is best. Python does not scale well in big projects because it is very slow

Are you fellow Balkanite?

>Is there anything I cannot do with python?
No, it's Turing-complete.

So is Brainfuck, but there's a reason you don't use that for serious programming.

I guess I should say, what math do I need to know?

You mean
emacs or vim

>living in the stone age

en.wikipedia.org/wiki/Ncurses

ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-042j-mathematics-for-computer-science-fall-2010/

no I'm Dutch

I probably have .pdf somewhere if you want

Oh I see, I'm looking for style points so this is not what I need, needs to be a proper gui

Math and CS/CE/EE go hand in hand.

The more math you know, the better overall at your programming and technical/algorithmic logic you'll be.

I mean, you should learn as much math as you do computer programming.

Unless you like being your average Takbir Fun Mobile Game™ code monkey

You don't understand the function or the algorithm? The algorithm is called euclid's algorithm for gcd, it's fairly simple.

>How does it deal with making things look pretty?
Its not pretty, but its effective.
I still have my first tkinter GUI program, its stupid as hell, but hey it works, it pulls live weather data for my city and refreshes it every 60s.

>implying old == bad

That said, would a math degree serve me well? In terms of "being a good programmer. It's something that always interested me, so more like a hobby and not as a career. My employer reimburses education costs and the most convenient schools nearby have decent 2 year math programs and nothing more than basic SQL/java/c++ as far as computers go, but I mean I can do that shit on my own time.

I see, speaking of retrieving data from a website and so on, how do these things works? I've been looking to do something simple like you are but I've never been bothered to.

>wtf do i need to buy a car for, i have a horse that i can ride

When performance doesn't matter, it generally tends to boil down to personal preference, available libraries, and platform support. If Python suits your style of writing code best, it'll probably be a good language for writing most programs, except when you need a specific library that either does not exist or is poorly implemented in Python. Personally, I find myself more productive in Ruby than any other language, so when performance is not an issue, I use Ruby.

Oh hush. There are rubyisms that Python programmers don't like, and pythonisms that Ruby programmers don't like.

It is not so much that you need a specific amount of math (although certain areas of computer science will need specific math subjects), but rather, that you should have a mathematical mind, and math should come easy to you. Making calculus a requirement in universities is just a helpful way of filtering out retards.

oh hey, i worked on this earlier today in think python.

def first(word):
return word[0]

def last(word):
return word[-1]

def middle(word):
return word[1:-1]

def is_palindrome(word):
if not first(word) == last(word):
return False
elif len(middle(word)) == 0:
return True
else:
return is_palindrome(middle(word))

I don't write much GUI, but when I did I used Tkinter. I have no complains.
If you want something more modern and conventionally pretty, try PyQt. It's a QT wrapper, which is multi platform(including mobile) and supports multi touch.

>would a math degree serve me well
>the hundreds of CS/CE uni students that say they're going to double major in Math, and then drop the math major after like two semesters
everytime

I don't know but I betcha it would if you plan on using "abstract algebra" and shit that you get towards the end of the line.

You really should just be pretty versed in math up to discrete mathematics and linear algebra. Those things are pretty important. But there's a point where math just gets too abstract for it to be super useful in programming.

Whatever floats your boat I guess.

>Making calculus a requirement in universities is just a helpful way of filtering out retards.
>tfw lazy in high school years with math and now i don't know how to catch up
Don't go easy on the math kids.

Not the person you were talking to.
You have to get the data from the site somehow. You will probably want to use urllib to download JSON data from an API or if it's not available, download the web page and extract the data with the soup library.

Read about beautifulsoup, requests or urllib modules(there are plenty of tutorials on yt if you are lazy).
Also you need to be familiar with HTML/CSS, because you need to extract data from CSS class.

youtu.be/uqsZa36Io2M?t=1h33s

This is pretty much where I am. The "you gotta copy paste without monads d00d" doesn't resonate with me because duck typing.

>not taking calculus in high school

I did, but I half assed it then stupidly took a year off doing nothing and forgot fucking everything.

That would be implying emacs and vim are outdated
(they're not)

tutorial.math.lamar.edu/
ok then relearn it

>wtf do I need a new car for, my current one is fine and the insurance is cheaper for it

>terminal TE babbies literally are scared of the future

it's hilarious really

I'll try.

And here you go implying new is better
Sublime doesn't even have good keybindings, why would I use that piece of trash?

are you >imblying vim has good keybindings?
emacs i can kind of understand, but vim's keybindings are literal dogshit

Calc I - Tom Apostol is a pretty good /sci/ meme.

Thanks mangs, I'll think about it some more.

But this is only possible if the people who have the data actually give the information to begin with right? Im assuming youre not actually taking the data from a website (idk lets say www.weather.com) but actually directly taking the data from www.weather.com's database right?

>API
What is this?

>API
>what is this

CS101 is down the hall and to the left famalam.

(PS: Like a big dictionary for programming syntax)

currently making an imageboard for eggman

and I'm also cloning agar.io to make a custom game for eggman

that maybe it's time to accept that you're simply not smart enough to understand programming. A bad analogy, but I think it makes my point: can you teach a dog calculus or a cat linear logic? No. because the cognitive capacity to understand these concepts just isn't there.