/dpt/ - Daily Programming Thread

What are you working on, Jow Forums?
Last bread :

Attached: fc10591037b632d8ed85fb16223adfb652d74f3e.gif (500x281, 134K)

Other urls found in this thread:

thedailywtf.com/series/tales-from-the-interview
github.com/gcc-mirror/gcc
softwareengineering.stackexchange.com/questions/20988/why-is-python-written-in-c-and-not-in-c
twitter.com/AnonBabble

Haskell > C > Python >>>>>>>>>>>>> Rust

Thank you for using an anime image.

Give us a qrd on Haskell, why do you like it? What do you make with it?

I love python

Have you tried Eta and if so, how does it compare to Haskell?

What is your favorite code editor?
Why is it not spacemacs?

spacemacs is for lazy faggots that cant smart enough to write elisp code

you can get package in bare emacs you have no excuse for not building your custom setup

Haskell!

not everyone can spare the time to learn everything

spend days-months putting together a completely unique configuration that you will need to maintain forever. you have to fix everything yourself.
vs.
using a prepackaged configuration which does everything you need to and is maintained a community of users who can fix bugs before they become your problem.

the former is for neets, the latter is for professionals

Spacemacs is slow bloated trash, more so than base emacs. At least computers are so fast that base emacs seems skinny and runs fast

>you can get package in bare emacs you have no excuse for not building your custom setup
I have heard of several people who had custom setups for many year, but happily switched to spacemacs despite that.

>learning a language just to customize your editor
if only i had this level of free time

evil-mode is great, though. Much better than vile or the worse vi modes.
No need to use the 'friendly' keybindings or anything else from spacemacs.

Emacs has a package manager. You can just download packages and never touch your .emacs except for some little system specific configuration stuff that you would have to do with spacemacs anyways. If you want you can make some custom keybindings in your .emacs, which are piss easy to do and won't break in future versions of emacs, so they require no maintenance

How much does solving recurrences help with actually programming effectively with recursion?

never heard of the term. Just get The Little Schemer and go through the exercises with a language with TCO.

relatively speaking, isn't that the easiest part of learning emacs?

mathlet?

Trying to figure out how to use the bluetooth adapter as a serial port in Android. So far it hasn't been a terrible experience, considering this is my first Android program.

Why C above Python? Python is usually the better tool for the job.

You don't have to learn it, until you want to make use of the ability to program your own cursor movement functions or indentation or fancy editor commands or fancier highlighting. You can even just use emacs keyboard macros most of the time without ever touching elisp.

Why don't language authors give their languages unique names to make it easy to search for information about them?

Attached: snarly cat.jpg (745x586, 76K)

Working on a VPK parser so I can make my own multi-threaded tracerays in Source Engine games

i just want a canvas to draw shit on it, plot functions and make it interactive with buttons and images.
is there anything like that for js that doesnt make the computer shit the bed?

Python, C, C++, Java.
>And maybe VisualStudio.

Attached: 98F46252-4714-4ECF-ADD0-62A9DF6EFEED.jpg (480x360, 15K)

C gives you more flexibility in your implementation.

html5 canvas with basic JS?



canvas = document.getElementById("canvas");
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
context = canvas.getContext("2d");
context.drawsomeshit(..)

Is it possible to get an internship after you already graduated with a CS bachelor's degree?

You'll have to interview anyway, might as well apply for FT job

nah, companies are generally extremely moral and they would feel bad about receiving work from people they're not compensating, so they're very strict about letting that happen.

What do you think the expectation difference is between an intern and an entry level FT dev with no internship experience?

Related, what should you know for an entry level programming job in C#, C++, and MySQL?

You're doing it wrong. You need 7 different nested frameworks for that.

trying to use python's playsound to make a simple sound player, but when i tried to use the function i got this error:

File "/data/data/com.termux/files/usr/lib/python3.7/site-packages/playsound.py", line 91, in _playsoundNix
import gi
ModuleNotFoundError: No module named 'gi'


how do i install this module?

pip install gi

is it possible after you've graduated with a CS master's degree

Attached: natsuru.jpg (225x350, 47K)

$ python -m pip install gi
Collecting gi
ERROR: Could not find a version that satisfies the requirement gi (from versions: none)
ERROR: No matching distribution found for gi

Attached: 1561122440558.jpg (480x360, 37K)

do you need to use pip3 on your distro?

python came with 3.7 when i installed it

Lisp is the most powerful programming language.

why do web servers need to store session details in a separate database? i.e. redis, memcached, riak, etc?
what problems does it solve and what benefits does it give?

You asked this question yesterday. Go read the responses again.

can you find a company that wants free labor?

tfw i'll unironically be the Jow Forums falling for the stem meme meme working at a place that doesn't require qualifications with a masters

There is nothing immoral about giving an opportunity to someone who really wants one.
As for not paying, it's not as if bringing on new people is a risk-free process. Both the intern and the company take a calculated risk.

Literally no internship in technology is going to be unpaid unless you're the office bitch and get the boss's coffee. A position can only be unpaid if the company demonstrates that they're losing money by having you there.

Comments like that reveal what kinds of jobs you do

Attached: clamp.jpg (2801x2202, 842K)

what the fuck

It's the thing I hate the most about C, honestly. If I were to name a language, I would name it something like j7X.

Here in the US, they clamp early or immediately. No oxygenated blood flow or iron stores for you kiddo.

And this is why I use Vim, to avoid this shit

It amazes me how these things are known by prehistoric people. I mean, looks like they only have one shot to do it right, and if they never got it right mankind will never be here.

My new language will be called C@#$%^&*()=+[]\

the human placenta is amazing. It's the fiercest placenta on the planet. Women are not impregnated by sperm so much as they are ruthlessly invaded (briefly conquered) by the placenta summoned by their fertilized eggs.
To bring it to Jow Forums, imagine if you were programming an AI to ensure births. Most animals have the strategy "if the birth fails, eh whatever, the mother's still around and can do it again". The human strategy is "fuck the mother. EVERYTHING FOR BABY"

Perfect

Sup /dpt/, I just went to a programming interview and did so horribly that they just told me “no” halfway through. I spent the rest of the day sitting at the airport. Do you have any similar experiences to share so that I feel less horrible about myself?

Soooooo, anything that's not systems fuckery.

Or embedded

wholesome and catholic
>giving your life to create another one

Or where speed matters (like CPython itself, kek)

nope

I hate interviews to the point that I've now performed more of them than I've taken myself.
The only really bad interview I had was for a job I didn't really want, but since I hadn't actually *planned* to not get the job, it was still excruciating to sabotage myself so badly.
How did your interview go so badly?
>What''s your name
heil hitler!
hah ha just kidding. I'm from the chans.
...
how are you?
>write a loop to print out the numbers from 1 thru 10
a what?
a 'loop'? Sorry I'm not that familiar with this particular technical term. Can you explain it in other words? I'm sure I know what you mean, I just must know it with other jargon.
>here's an O(N^2) algorithm. Can you improve on it?
wow! what language is this?
C?
Yeah I put that on my resume but I've already forgotten how to do hello world in it.
hmm?
that code looks fine.

We're supposed to believe that you say heil hitler during an interview and the guy preceded to talk to you about O(N^2) algorithms?
>things that never happened

I fucked up worse than that, they asked me a simple math question at the start and I messed up on it even though I told them I studied advanced math classes in college

I think I'm getting really good at C++58
this ~ [1 0]
that ~ [0 1]
auto this =: _c 10
auto constexpr =:
_c !! constexpr that
auto + constexpr 1

>_main =: auto "Hello world"

no, I'm asking him how his interview went. Those are three separation options.
1. massive social awkwardness
2. massive cluelessness
3. idiocy + lying on the resume

What was the question?

The derivative of a simple function

to make yourself feel better, go through thedailywtf.com/series/tales-from-the-interview

C++'s ultimate form will just be a wildcard operator that expands to whatever program you are imagining

what was the function?

surely there's more than that.

The classical / monolithic design is that each server stores session data in it's own memory. Now, this design is okay for small applications. the problem is when you need to scale, i.e. serve millions of customers; there's no way a single monolithic server can cater to that without any downtime.

Storing session data to a common database solves the problem introduced by clustered environments: sessions must not be bound on a single server instance

i.e. You have server A, B and C, the client established a session on server A, but then server A went down.
If the server stores their sessions only on their own memory, then session data in server A is unusable until it goes back online.
By saving the session data to a common database, server B or server C can cater to the client's request because they can verify that its session is already authenticated

Now you don't want to store these session details in the same database as your main app data as it can grow very large and it requires a lot of read-write (user login, user updating their session details) which can affect performance. The usual design is that a fast dedicated memory-based database like redis, memcached is used.

If it was me, I was have just said "For whatever reason I can't remember the derivative for that function" and then proceeded to write what I could remember from the definition of the derivative using limits or talked about the general use of derivatives so that I wouldn't look like an idiot.

It was something on the level of not remembering what a limit even is

I also couldn’t think of good questions to ask and etc

Why is Python's interpreter written in C but C's compiler is written in C++? Python's a drastically more complex language than C. Is an enterprise grade interpreter really that much simpler than a compiler?

Can I get a quick rundown on python? I'm a C programmer by hobby and need to know python3 for a class.

Attached: images.jpg (300x168, 25K)

>Python's a drastically more complex language
it's got a shit interpreter that barely even tries. The whole design and rationale for the language stems from the long-gone era of regular and enormous improvements to CPU clock speed, so nothing mattered.
C is also shit but speed always really mattered for it, so its compiler works harder and the language offers (slightly) more in what can be done -- which then, is done.

Hissss slither

Easiest way to authorize certain roles to see aspx pages?
I'm using FormsAuthentication to get the Authentication from a User Table.

It's easy and has a massive standard library. If you like C's simplicity you'll probably appreciate Python since it has the simplest syntax out of the popular interpreted languages.

well my mantra is "don't betray yourself". It's OK if you're found wanting but what will really frustrate you is having been done in by yourself. And you can be your own worst enemy in lots of ways, the earliest is to not apply at all, the next-earliest is to not reply to recruiters or go to interviews. If you remove your own hostile action from the list of reasons to fuck up, you won't have as much to worry about, because (unlike you) the other party is not actually malicious. Interviewers are just trying to get a sense of your abilities so they can perform a sorting function.

thanks i will play with it

What's the complexity of the program got to do with the language it's written in? You do know that operating system kernels are written in C, right?

>@decorators
>__blah__ methods
>list comprehensions
>fucked up lambda syntax
>function/module scope instead of lexical scope
this a really stupid reason to pick languages but if you want simple syntax, Lua's obviously way and and Ruby's still much better than Python.

my productivity increases by 100% when im listening to anime music
wtf guys u said anime are bad?

can you understand the music?

I wouldn't know, I only listen to harsh noise

its good for prototype and nothing else
the moment you have to do advanced python shit (classes, lambdas, whatever) you are in for a bad day

no but why should i?
if i understand the music, half of my brain is parsing them

>>@decorators
Are freaking sweet
>>__blah__ methods
Nothing wrong with dunders
>>list comprehensions
Are freaking sweet
>>fucked up lambda syntax
Lambdas are non-pythonic anyways, you don't need them
>>function/module scope instead of lexical scope
This is a good thing, though. You are wrong.

Attached: 1475892526911.jpg (404x455, 34K)

>Is Python's retarded idiosyncratic scope wrong?
>no...
>no it's every other language on the planet that's wrong.

since you already know programming, the official tutorial should be fine

>is such a larper he's not even aware of other languages with Python scoping

Also, Wikipedia says that GCC is mostly written in C, and according to this Github mirror
github.com/gcc-mirror/gcc
the plurality is written in C

softwareengineering.stackexchange.com/questions/20988/why-is-python-written-in-c-and-not-in-c

>describe the Earth
uh most of it's lexical ocean
>nd the rest is dynamic continent
>NO RETARD
>YOU LARPER
>YOU DON'T KNOW THE EARTH AT ALL
>"OCEANS AND CONTINENTS"?
>WHAT ABOUT ?
well that's fucking stupid so it's easy to overlook.