/dpt/ - Daily Programming Thread

Old thread: What are you working on, Sup Forums?

Other urls found in this thread:

lxr.free-electrons.com/source/net/ipv4/tcp_output.c#L2776
discord.gg/yx7BdyY
wiki.python.org/moin/Why is Python a dynamic language and also a strongly typed language
twitter.com/SFWRedditVideos

(From Last Thread)


I have to sort a singly linked list composed of words from the entirety of War and Peace. My sorting algorithm works but I need to do the sort in under 20 seconds and I am nowhere close to it. Can anyone give me any hints?

sage this shit

If you absolutely have to use a linked list, you might consider mergesort.

If you can use an array instead, then do that and use quicksort.

I have to use a singly linked list (it's a uni assignment). I tried to use merge sort but failed horribly, I'll give it another go.

Rewriting all my Haskell programs to not use any IO as it is impure.

How will you get user input?

But then who will build roads?

Quicksort is great for arrays because it can operate in-place, but I seem to recall that mergesort suits linked lists well.

I am the user talking about scope and other things from the last thread. I think this may be a way to "restart" the conversation:

Could you define the concept of "scope" without using the word "block" (or equivalent expressions, no trolling please)?

user input is impure

Scope just means where that piece of information is valid. If it's outside of it's scope it is not valid in that area.

I'd love to replace the current IO representation with the operational monad specialized for a GADT of IO actions

So basically you are creating a box?

>area

but see, that's my problem, how do you "limit" this area? and upon doing so, have you not just defined a block?

What do you mean, "how do you limit this area"?

>Scope just means where that piece of information is valid.
This I understand and agree with.

>If it's outside of it's [sic] scope it is not valid in that area.
What thing are you referring to? A variable? If so, then you're saying that a variable has a scope, out of which it is not valid, correct? Then how do you identify this scope? Feel free to use a specific scope resolution policy (static or dynamic), but please give me a precise definition of how to identify that scope's limits. I suspect you will try to restrict the scope of a variable based on the language's syntax, but then you'll be defining blocks of code and I'm back to not understanding how you can separate the two concepts.

I won't, that's the point.

No, I'm creating a pure universe.

What is the worst spaghetti code that exists?

lxr.free-electrons.com/source/net/ipv4/tcp_output.c#L2776

>pycurl.error: (7, "Can't complete SOCKS5 connection to 0.0.0.0:0. (1)")
is there any particular reason pycurl shits itself like this when i try to connect through tor?

I'm using connection pooling in my express.js app.

When I normally handle requests, I have to close the database connection within the callback after I've finished handling the request. Does this need to be done in an app that utilises connection pooling? If not, why doesn't the app hang in a way it would if I neglected to close the database in an app that doesn't use connection pooling?

>is there any particular reason pycurl shits itself like this when i try to connect through tor?
0.0.0.0 on port 0 doesn't seem right....

Fucking weaboo piece of shit

how do you fags deal with frustration when something doesn't work and you can't find a solution?

Remember that flawed beings create flawed things, sometimes necessarily..
Unravel where, why, and how the flaws of a given system might be introduced.

More commonly, drop it and come back later. Very tired of the human species and consistent bullshit at every turn.
"I want to add this to x vector, should be fine."
>x.push_back(someshitoranoter);
>make
"Error: Fuck you and btw here's 10 pages of error messages that overwrite the part of your console line-buffer that actually matters."

With most other hipster languages adopting codes of conduct, are there any anti-sjw languages other than D?

Please stop talking this way about programming. Please.

I'm new to programming and I'm currently working through the book Learning Python the Hard Way.
The book recommends using notepad++ and for the most part it seems to be pretty easy to use.
How come vim and emacs are shilled so hard on here and how are they any different from notepad++?

Fuck off weaboo shitstin

I'm guessing you're a Rust user. How is that tranny dick treating you?

I'm a beginner but I learned python to be familiar with how a programming language works.
should I learn C or C++?

anyone here making passive income off their development? any tips?

I can program full stack but fuck me if I can think of a good idea.

Really, he's just as bad as SJWs he professes to detest.

Some of us just want to get shit done and choose a language based on its merits, not the politics of some of its users or creators.

C would still be C if Lenin had invented it.

Vim and Emacs both prioritize functional power over aesthetics or discoverability. They are an investment in the sense that they have powerful editing primitives, but they are indeed a little time consuming to learn to use. Basically, you can edit text from Vim and Emacs without ever leaving the keyboard.

both, don't get hung up on languages

i'm non-binary cis-gender and you're offending me

An app to find cats in photographs and create unfunny meme text

which should I learn first then

>C would still be C if Lenin had invented it
What the fuck does this mean?

Yes

C++ is a little complicated. You could do either and not be in a bad situation. I guess I'd say C just because there's some quality books CS books in general out there.

who gives a shit who the devs are and what they think a language is a language and if it works well you should use it.

Thanks for the explanation.
Do you think it would be worth trying to learn how to use one of those editors right now, or should I stick to notepad++ and then try one of them layer on?
I know for a fact that my dad is quite comfortable with vim so he could probably help me out if I ever don't understand anything.

Until you get banned and shunned from the entire community for accidentally triggering some cunt with blue hair

So what if that happens? You can still use the language.

Why do you need the damn community in the first place? It's a programming language not a bar

I would say yes. Just dive right in to whatever editor you like. You'll have to look up a lot of commands at first, but you'll eventually catch on and need to look up things less and less.

So basically you're looking for a hugbox? You won't get banned for talking about programming

I'm not sure you understand how sjws work. They will hunt you down until you either quit using the language or cease all public activity. You cannot apply logic to these creatures, and the only way to deal with them is to stay off their radar. Hence, you should choose a language that has a minimum of sjw activity such as C, C++, D, Nim, Haskell, etc.

They'll sue you for using their language to write a project that violates their code of conduct.

>he doesn't know about donglegate
I sort of agree with your point but you really can't assume that if you keep your head down and don't talk politics that you're safe

>Unravel where, why, and how the flaws of a given system might be introduced.
>"Error: Fuck you and btw here's 10 pages of error messages that overwrite the part of your console line-buffer that actually matters."
but why, why should I try to track down this bullshit, it's not worth the stress

;_;

m8...

Talk shit get hit (with a ban)

who gives a fuck

the only reason the community matters is to get your name out there and pad your resume, and if that's your goal you shouldn't be offending anyone anyways. The fuck else would you want to do in an "open source community"

What was donglegate? My understanding is someone made an innuendo out of the word dongle and refused to apologize but I admit I didn't look into it

quick sort should be good enough. I don't see any problems why it would be worse with linked lists. other than all those cache misses of course.

only if their license says that the programs written in their language have to abide to their code of conduct and I'm not sure that this ever happened. The code of conduct is only for the community.

Maybe he can't separate his political views from his job/hobby

You're not understanding. These people will find out where you work and complain until you're fired. I'm telling you, once you're on the shitlist it can only end in your complete destruction.

What's wrong with them doing that? It's their right to complain to your employer, and your employer has a reputation to preserve.

...

Pathetic.

Making weird ASCII graphics.

How so?

If I make an ass of myself, even when I'm off the clock, then my employer might decide to fire me. It's the way things are.

What's an efficient algorithm to get a gf?

>what's wrong with sjws? We should just let them keep doing what they're doing.
It's not about making an ass of yourself. They lie and exaggerate. Theh get you fired through mob rule, the employer thinks that a lot of people don't like you or what you're doing so they fire you even if really you said something completely benign and it triggered some hug box retard. It could happen to anyone.

Run around her in a circle, and share your carrots with her.

chloroform

So make and retain incontrovertible evidence of what actually happened, to present to your employer.

watch weird science, make your own gf

They won't care.
Their company's name is already receiving negative press, and it's your fault.

Pack your shit and get out.

Look m8 you can put your head in the sand, but the SJWs will still be there doing what they do.

They're a shitty employer, then.

Your a danger to their bottom line.
Any company will throw you out to the dogs to save face.

well no shit, but i cant see any likely cause

heres the relevant code, python3 btw
import argparse
import pycurl
from io import BytesIO
from bs4 import BeautifulSoup
from urllib.parse import urlparse
import os

#default settings
_proxy_url = "localhost"
_proxy_port = 9050
_page_increment = 12
_follow_redirects = True
_useragent = "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36"

def get_file(url):
buffer = BytesIO()
conn = pycurl.Curl()
conn.setopt(conn.WRITEDATA, buffer)
conn.setopt(conn.PROXY, _proxy_url)
conn.setopt(conn.PROXYPORT, _proxy_port)
conn.setopt(conn.PROXYTYPE, conn.PROXYTYPE_SOCKS5)
conn.setopt(conn.FOLLOWLOCATION, _follow_redirects)
conn.setopt(conn.USERAGENT, _useragent)
conn.setopt(conn.URL, url)
conn.perform()
rcode = conn.getinfo(conn.RESPONSE_CODE)
conn.close()
return rcode, buffer.getvalue()

You're using dynamic types, that never works.

Can we make a discord or something? I'm terrified that I'm going to teach myself bad habits but can't afford to go to school to get formally educated.

u wot m8?

If I want to focus on security. What should I get for my backend?

your what backend?

for a webapp? Go (golang)

What's a discord?

I'd say 6ft of concrete and 6in of lead lining, lots of steel reinforcing struts, and some ceramic outer plating, should be fairly secure

Dynamic types just don't work, they make refactoring impossible, and can't help you when you make a mistake because you might have wanted to change the type of that variable there, and maybe you just wanted the argument you missed to be null

discord.gg/yx7BdyY

A MOOC-site related. The security is due to the fact that some user might need to used their credit card. Ive only worked with Java EE and PHP so far.

>What's a discord?
It's a shitty voip/im app targeted towards gaymer types that's notable for having a web version of the app that requires no sign up or installation. Though I believe it uses flash for the web app's voip features if that's an issue for you.

senpai, its a

I've got bad news for you. Dynamic types can't be fast either

For the love of all that is holy, don't use PHP for anything handling financial transactions and credit card details

fast as in getting it working asap, if i wanted speed i wouldnt be writing in python

do you think he programs for an alt-right facebook page

But we've established that dynamic types don't work, so you can't get it working asap with them.

That's not programming, user. That's dick sucking

Ive heard bad things about php before. But why exaclty?

m8, just fuck off, python isnt even dynamically typed, its inferred

It thinks the link is spam, so search for 'php fractal bad design'.

wiki.python.org/moin/Why is Python a dynamic language and also a strongly typed language

oh, fair enough

still though, fuck off

sleep sort