/dpt/ daily programming thread

old thread

what are you working on Sup Forums?

Other urls found in this thread:

strawpoll.me/11767105
bttracker.debian.org:6969/announce?�H_ g`d�Xy���d} �R&peer_id=mememememememe&port=6883')
youtube.com/watch?v=c2MiyZx8MTY
collinoswalt.com/12
discord.gg/SN6HZ
twitter.com/NSFWRedditVideo

i think im bouta write an extension for gnome3 to fix this fucking title bar for windows. stupid arrow pisses me off i keep clicking it on accident

apparently you can use fucking javascript to mod gnome3. pretty nifty

strawpoll.me/11767105
just gonna post this here :)

please stop posting anime on a tech related discussion board.

vote PHP

that's not anime, that's edward

Please cry more

trying to build a bit torrent client. The problem is I can't figure out what it means by getting the sha1 hash of the bencoded file.

Some code I got -

d = bencoder.decode(torrent.read())

hashcontents = bencoder.encode(d[b'info'][b'pieces'])

new = hashlib.sha1(hashcontents).digest()

link = urllib.parse.quote(new)
print(link)
print(d[b'announce'])

send_to = requests.get('bttracker.debian.org:6969/announce?�H_ g`d�Xy���d} �R&peer_id=mememememememe&port=6883')
while True:
new_socket.listen(5)


Anyone have experience interacting with trackers? To my understanding they're supposed to give me a response with an encoded dictionary that will give me some peer addresses.

>gnome3

Was a mistake

gtk3 is a pile of shit I'll give you that but it does have some nice features. and somehow it's the least buggy DE for me. Less buggy than XFCE, LXDE, MATE and Unity.

vote C or die

also
L O N D O N
O
N
D
O
N

>forgot pic
I'm a worthless nigger

should i prioritize 1920x1080 over 1366x768 for a programming laptop? i cant spend too much i was gonna spend around 640€ on something like this

i3 6100h
940mx
8gb ram
250gb SSD
1080p screen

is this okay or am i over rating higher res screen for coding?

btw the classifieds where i live are pure trash

Could someone post the image where it shows a person programming in C # and in the other comic shows programming in Java and a monster appears?

Thanks advance!

RAMBLA' LONDON

sounds like some black british rapper

youtube.com/watch?v=c2MiyZx8MTY

ditch the GPU and get a 1080p screen with decent CPU
Also, must be lightweight, have keyboard backlight and 9+ hours battery life

Which color of striped sock improves your programming skill the most?

t. anonymous swedish shitposter

res screen is VERY important.

And ditch the gpu if you are not gona play anything and go for higher battery life.

Tough you might also regret at some point why your piece of crap laptop doesn't run even the oldest game, so think ahead.

>res screen is VERY important.
1360x768 werks fine for me desu. maybe if you have some eyeball disease it's important you freak

He could always play Thief and Deus Ex.

Rainbow.
t. the sole user that dislikes this brilliant bit of board culture

poopy poopie poo butthole tranny butt nugget stinky butt hole poo fumes

Good post

your arguments won't change the fact that your butthole does and always will stink, tranny

it will never smell like a pussy

int independence; // declaration of independence

That's moronic.
Only knowledge and experience improve the programming skill.

wow, what a bunch of crap.

>implying independence wouldn't be a function
int independence();

Working on my terminal emulator, found there was a panic when I cat a JPEG by mistake, so I started catting /dev/urandom, found 5 panics, fixed them.

/dev/urandom has been going for few hours, didn't crash yet, need something better.

Trying to install docker to run american fuzzy lop against it, hopefully it will find more.

Why does no one use D? It seems like C++ except everything fixed.

because no one wants the D

if test are intended to test code, then who test the test? and the test of the test? and so on?
>but muh agile

It ended up being worse with all the stringly typed mixin bullshit.

>american fuzzy lop
whats that?

but those socks will get you a job

How so?

Because C may stand for cunt, while D may stand for dick. I ain't homo.

So I've been almost only using visual studio so far, but now I'm in need of cross platform building so I'm thinking it's time to learn some sort of tool for this. What do you recommend? Cmake? GNU Make? I'm mostly interested in ease of use, I don't want to spend hours configuring the toolchain rather than actually code.

Is tiobe index to be trusted?
>java first lol
>visual basic just the same rating as python
>assembler just beyond javascript

If your projects are small then GNU Make is easy as hell.
But if you're working on bigger things CMake will make your life a lot easier. Trying to use GNU Autotools is a nightmare.

just use CMake, it's easy to use and very powerful and you don't have to mess with the nightmare shitfest that is make

I wrote a gnu makescript that compiles all .c to .o and links projects with multiple main files by building a binary for each main with all the other mains excluded.

I haven't felt the need to update it because it works so well.

How easy is it to learn one if you know the other? Are they similar or entirely different?

If you know GNU Autotools well enough you could probably learn any build system fairly easily, but it really is a nightmare.
Makefiles are fine for small projects, any bigger and you should use CMake.
By Autotools I'm referring to not just Make, but also configure scripts and the like.

FUCKING
U
C
K
>LOSER

A fuzzer, look it up.

Which should I use: vim, gvim, or neovim?

In your opinion, what kind of coding quiz can be done to stop unskilled people getting the job due to biased HR department? we got three girls in this month and they can't do shit, but they can't neither be fired, because pussy.

I'm reading the GNU coding standards.

I was told that I should never assume an int is 32bit, and the only thing I could derive is that an int is

what role in the company do they have?

what do mean they can't do shit?

>Is tiobe index to be trusted?
No, it's pants-on-head retarded, depending on what you're discussing.

For example, it doesn't mirror the job market at all. If anyone uses tiobe as an indication of jobs, they might be retarded.

As for VB/Python, note that many colleges have dated CS101 classes that may still teach VB instead of C# or another suitable first language.

Back end developer. Our team write some low level API in pure C to be used to retrieve data. I can't add more details.
They genuinely can't do shit. Data structures are very important, but they can't even connect (not even implement) a radix sort with some function and so we end to make ours and their job while they go to the roof to smoking.

Good luck using a quiz like that, if your HR department is literally hiring your programmers without a technical interview done by you or your supervisors.

They'll say the quiz is sexist and racist if too few female/minority applicants are unable to complete it.

In any case, you should quiz the applicant not only on basic knowledge of a subject, but also their efficiency of finding the answer to something. In the past, I've had better results with candidates who were able to quickly research and solve a problem with some Googleing in the interview, rather than those who can spout off trivia and sort a linked list without a loop.

purple and pink
You get a 1.2x XP boost if your socks match your keyboard caps.

can't you complaint about it?

if you do their work what do they do all day !?

do they applied for a backend position or something else?

what the fuck

>note that many colleges have dated CS101 classes that may still teach VB instead of C# or another suitable first language.

To expand on this, that means there are many first-year CS students and krishnus and vishnus that are asking StackOverflow and Google questions about the language

>quiz is sexist and racist
They're not going to insinuate the idea that women are too stupid to take your quiz.

That would go against their narrative.

someone already complained, but he got 10 hours of salary as "fine" (why even fining someone who worries about the future of the company)

>30 tabs of winapi documentation open to make a 100 line program
xDDDDD

>100 line winapi program
FizzBuzz?

They're literally not allowed to dock your pay if you're a salaried employee because you're not allowed to receive overtime pay.

ultimate cuck

why don't you quit and find another job?

if you're a programmer you should find work just fine

I just want to access a device context and save a bitmap file.

because Italy

>This quiz has a strict emphasis on data structures. As we all know, things that are rigidly imposed and binary in nature tend to be a construct of the ruling class, which puts those who aren't white and male at a disadvantage.
>Please revise the quiz to include more measures of a good programmer, such as the ability to socialize and recognize non-binary sexual traits.

Also, pic semi-related.

Can I not unbind/redefine a variable in my erlang program? Can I only do it in the shell or a session with f(variable)?

Is that structure the NAP?

redpill me on c++

Computers only deal in absolute binary states, something cannot be both true or false at the same time.

Are you sure these people wouldn't rather work in a medium much more suited to creativity and non-binary expression, like playdoh and crayons?

im trying to get into programming by learning c++. currently im just reading chapters on this site learncpp dot com (i swear im not shilling) but the progress is p. slow and i keep forgetting lessons from past chapters. can anyone recommend me a way of learning programming that is more interesting than what im doing rn? sorry for bothering you Sup Forumsuys

it's shit

it's shit

Everyone is going to tell you it's shit

Skip over classes, you'll never need to use that 99% of the time.

Rust is better.

this isn't true at all
most computers only deal in bytes
"bools" in C have 256 possible values

solve a problem you are interested and keep a reference (not a tutorial) of the language

I remember I lernen C because I wanted to simulate the trayectory of a rocket, so full featured force fields on the object. That project alone in high school made me pass with perfect score the C exam at college without attending lessons.

>learncpp dot com
>p. slow
>rn
>sorry for bothering you
Please go back to whatever website you came from.

The most interesting way to learn is to actually create things. All you need is a basic understanding of how to create an application in your chosen language. Then, you can just Google what you're trying to do as you go.

C# is an easier first language to start with than C++, for what it's worth.

>suggesting shart instead of c++ for whatever reason

its good

but its hard as fuck

"no"

bools in C are literally typedef enum _Bool { false = 0, true } bool;

enumerated values are signed 32-bit integers.

Why use cut down C++ with GC instead of cut down C++ with FP and affine types and borrowing?

>= 0

and actually, you're wrong
bool is Bool_

>An object declared as type _Bool is large enough to store the values 0 and 1.

false and true are macros

stdbool is shit

Looks like you C cucks don't even have proper primitive types.
Why was C "tha best languege for tru hax00rs" again?

Using Swift for a project.
I'm trying to reuse a json parser I used on another project and can't seem to get it, any help?

It will throw bad json catch that I have set up.

here is my code

while self.i < 5{
if let json = try? JSONSerialization.jsonObject(with: data!) as? [String:Any],
//let results = json?[self.i] as? [[String:Any]],
let StudentId = json?["StudentId"] as? String,
let LastName = json?["LastName"] as? String,
let FirstName = json?["FirstName"] as? String,
let Major = json?["Major"] as? String,
let Year = json?["Year"] as? String,
let GPA = json?["GPA"] as? String{


here is sample of json
{"StudentId":"1121","LastName":"Smith","FirstName":"Pichael","Major":"CS","Year":"Freshy","GPA":"4.0"},{"StudentId":"1122","LastName":"Man","FirstName":"Fish","Major":"Yup","Year":"Senior","GPA":"1.0"},{"StudentId":"1126","LastName":"Brown","FirstName":"Bobby","Major":"Clown","Year":"Lol","GPA":"90990"},{"StudentId":"1128","LastName":"Test","FirstName":"Test","Major":"Test","Year":"Test","GPA":"1"},{"StudentId":"1130","LastName":"More","FirstName":"Some","Major":"Entries","Year":"Would","GPA":"Work"},{"StudentId":"1131","LastName":"Should","FirstName":"I","Major":"Have","Year":"Just","GPA":"Made"},{"StudentId":"1132","LastName":"To","FirstName":"Program","Major":"Auto","Year":"Add","GPA":"These Lol"}

lowest addressable unit of memory is a 8 bits, you're better off making a packed bitfield of 8 bools if this is important to you.

Name a language where bool's have two values

Agda

>language

Agda is a dependently typed functional programming language originally developed by Ulf Norell at Chalmers University of Technology with implementation described in his PhD thesis.

>Name a language where bool's have two values
Why would there be more than one value for bool in any language?

>>>>>>>>>>>>>>>>>>programming language

Now this is autism

c# discord invite please....

Does anybody know anything about demodulating discrete waves? I'm working on that right now instead of doing schoolwork:

collinoswalt.com/12

Please help me. Is lua a good first programming language to learn?

I already know markup langauges and bash scripting.

I am interested in lua specifically because there is a GPL game engine that uses it called löve

Lua is pretty dece.

discord.gg/SN6HZ

Lua is very, very comfy.

t. used to write wow addons