/dpt/ - Daily Programming Thread

What are you working on, Jow Forums?

Previous thread:

Attached: smalltalksyntax.png (1305x741, 200K)

Other urls found in this thread:

go.googlesource.com/proposal/ /master/design/go2draft.md
en.cppreference.com/w/c/types/integer
pastebin.com/uFfsezjL
learn.adafruit.com/adafruit-feather-32u4-bluefruit-le/pinouts
learn.adafruit.com/custom-wireless-bluetooth-cherry-mx-gamepad/software
en.wikipedia.org/wiki/Trie
github.com/tuckerpo/real-time-cv-filters
twitter.com/SFWRedditGifs

Working on my 6th Form project which has turned into a sweet paid deal with lower school with annual payment. Considering taking a gap year to see how far I can take it since high demand in other schools for this type of software.

Attached: 902.jpg (680x544, 33K)

dumb frogposter

i started learning Python

Attached: 1532392666364.jpg (1158x1200, 296K)

True I am

>stacks
>queues
>lists
>linked lists
I hate programming. Why nobody told me about this?

Just wait until you get to B-trees, user.

Attached: Idle.jpg (400x307, 29K)

linked lists aren't real programming.

Should've read a book first

You shut your whore mouth

Attached: haskell logo.png (1200x847, 24K)

Rate my SQL style:

select
d.id [Device ID],
d.desc [Device Description],
s.name [Setting],
s.value [Value]
from setting s
join device d
on d.id = s.deviceid
where d.id in (
'a4646df',
'ce5674'
)
order by d.desc, d.id

Those are pajeet-tier easy.

Congratulations! Python is a fun language, and you will be effective in no time.

Does anyone have any python book recommendations for someone coming from C++?

they're all useful though

the only things i dislike about programming are trees and vectors (to a lesser extent)

>made yet another web scraper script, this time to download a bunch of rare anime episodes in my native language
>episode titles contain spoilers
>the filenames are the titles, my program outputs the name of the current file being downloaded
>have to try hiding everything but the episode number when checking the download status
>realize i'm running away from the output of my own fucking program

Attached: 1453157679313.png (526x544, 12K)

>vectors
But why?

And trees are such a general and useful concept I'm not quite sure why you would dislike them. Do you just not understand them?

see this? it really easy to read it, but if you are starting to read music, it is hard
I am suffering (with both)

Attached: 20180828_175059.jpg (1932x2576, 821K)

You do realize Kabuto Kouji doesn't actually die in lava? Spic-kun

>tfw Haskell

wrong, faggot.
you'd never guess the anime.

Haven't You Heard? I'm Sakamoto

I've only taken a couple of into courses of programming. Only took me a couple of days to learn and implement data structures. Try this: write a program in C that grabs a file off a webserver and saves it on your computer using linked lists. This isn't hard.

ok, I will follow your advice. Thank you!
faggot

>engineering
>5 classes in a semester
what school do you go to where you don't have to take 6? Anyways, you'll be fine, those group project/design courses are easy (and actually fun if your team isn't retards), calc 1 is 50% identical to your calc class from HS, and some new stuff, reg ex class should be relatively easy, and maybe even fun, the systems and circuit board class will be interesting, and the difficulty will be based on the effort you put in, since those types of classes tend to be lab heavy

>This isn't hard.
Stop saying this.
It's such an unnecessary, nonconstructive thing to say.
It might have been easy for you, it might not have because of selective memory, either way it might be difficult for someone and putting them down for it is just not cool. At the same time, nobody cares that you think it's easy, it only makes you look like an asshole.

Still, understanding both basic data structures and elements on your sheet are steps required to grasp even more complicated, yet useful and beautiful, structures, both in music theory and programming. In music you should play it to understand how it sounds, at least in the beginning. In programming you should implement data structures yourself to understand how they work, at least in the beginning. Do not despair and keep working at it. There's literally no other way.
unless you decide to be a whiny cunt and just complain on Jow Forums instead of improving yourself, in which case - fuck you

Attached: b urself.jpg (805x556, 116K)

Where are you studying? Sounds somewhat similar to what I did last year

>Stop saying this
This isn't your elementary school. In the real world, liberal mindsets are garbage. Go cry about it to your mom, faggot. No one owes you anything. Don't expect to have your handheld. Move to france, if life is too hard for you.

Modern python cookbook

Not being an asshole is being a liberal?
Man you must be fun to be around.

Looks good. I personally would do like this, but only if there more than 4 columns, with just 4 columns I wouldnt bother with new rows, same goes for the IN() part, with just 2 I wouldnt put them into seperate rows
Main different form yours is the capitalization of keywords so its easier to part them out of the query, and the comma before the string in the IN() part so that it would be harder to accidentally delete it.

SELECT d.id AS [Device ID],
d.desc AS [Device Description],
s.name AS [Setting],
s.value AS [Value]
FROM setting AS s
JOIN device AS d ON d.id = s.deviceid
WHERE d.id IN
('a4646df'
,'a4646df'
,'ce5674')

ORDER BY d.desc, d.id

You are

U

N

E

M

P

L

O

Y

E

D

hm, the spacings looked better in notepad, oh well

Thanks for the feedback. Fair points. I try to omit optional keywords where I can as part of optimizing for readability, which is also why I don't like prefixing commas or capitalizing keywords. But I don't have a problem with either personally and find your style usable.

No, expecting to be treated like a baby is liberal. No one owes you anything. i.e. You're not going to be president of the US. Sorry, I'm such an asshole.

>Self-employed
FTFY

fucking called it

fucking kek, do you fix computers for allowance?

Okay, whatever. Congrats?

Nope, I provide telephony, and ERP.

you guys actually got me into reading!

what's some good stuff to learn AI?

erp = erotic roleplay

so you're a phone sex operator

Help, I'm a brainlet. Is this how I do it?
unsigned int popcnt_inverse(unsigned int cnt) {
if (cnt > 32) return 0xFFFFFFFFu;
return 0xFFFFFFFFu >> ~(-33 + cnt);
}
I mean it works, but is this the best way?

EXACTLY! BTW, not everyone in this thread is a sissy.

go.googlesource.com/proposal/ /master/design/go2draft.md

Apologize

personally I like capital SQL syntax, and always using square brackets on columns and tables

SELECT
d.[id] AS [Device ID],
d.[desc] AS [Device Description],
s.[name] AS [Setting],
s.[value] AS [Value]
FROM [setting] AS s
JOIN [device] AS d
ON d.[id] = s.[deviceid]
WHERE d.[id] IN (
'a4646df',
'ce5674')
ORDER BY
d.[desc],
d.[id]

I find the brackets around table & column names needlessly verbose unless they are escaping reserved keywords or something. Using the brackets exclusively around plain-language column aliases is a helpful cue to the reader when they're checking how the data maps to some other object or structure IMO.

unsigned int isn't guaranteed to be the same size on all systems.
use types from this en.cppreference.com/w/c/types/integer

SELECT
d.[id] AS [Device ID]
, d.[desc] AS [Device Description]
, s.[name] AS [Setting]
, s.[value] AS [Value]
FROM
[setting] AS s
JOIN [device] AS d
ON d.[id] = s.[deviceid]
WHERE d.[id] IN
(
'a4646df'
, 'ce5674'
)
ORDER BY
d.[desc]
, d.[id]

SELECT
d.[id] AS [Device ID]
, d.[desc] AS [Device Description]
, s.[name] AS [Setting]
, s.[value] AS [Value]
FROM
[setting] AS s
JOIN [device] AS d
ON d.[id] = s.[deviceid]
WHERE
d.[id] IN
(
'a4646df'
, 'ce5674'
)
ORDER BY
d.[desc]
, d.[id]

reason I do it is because I've run into columns and tables with spaces in the name. Also I've had the need to build query strings programmatically. Always encapsulating my DB's, tables, and columns means I can never have an issue. Same reason I do all caps for syntax, inline SQL becomes readable without highlighting

Hello Miscrosoft SQL Server Management Studio

pastebin.com/uFfsezjL

What's a good open-source library for doing 3D mechanical simulations? I'm building robots and want to test them out before printing so I can use machine learning to optimize the design.

Attached: 1498777327838.jpg (985x1400, 1.37M)

Gmod

>Microsoft SQL Server Management Studio
you got me

based

Learning Haskell because I'm bored and burnt out. Tired of having to write boring sql for work and don't want to work on web development.

So hopefully this keeps me interested.

>tfw losing motivation to keep making things

non-neet anons: I'm 21 and am only entering college next year. is age a problem when it comes to being hired?

AIDS

I'm sorry to hear that. Hope you like syntax.

>coming from C++
I see you love buckets of pointless syntax. The problem you'll have with python is the One Right Way philosophy whereas sepples loves giving you fifteen ways to accomplish something under the mistaken premise that a sufficiently smart compiler will manage to optimize that shit fucking language.

no one gives a fuck

Did you get raped by a curly bracket or something?

>When you try to use an NSA open source analytic tool for your research, but Docker fails to build because one of its dependencies depends on a Ruby gem that doesn't exist in the gem repository. So you try to run the project without Docker, only to find it fails immediately because of a syntax error - an unmatched parenthesis caused when some programmer half-assed commenting out some function call that was split across multiple lines. So you fix his fuck up and install all of the Python packages required by his imports and the program fails to run again, but this time, it's because of a java.lang.ClassNotFoundException.

Attached: ModernSoftwareDevelopment.gif (320x236, 2.93M)

chad programmers write their own libs.
virgin programmers import libs from the net.

Going to study pathfinding algorithms so beginning with making nodes and connections. Next up is showing the distance between the connected nodes!

Attached: nodesandconnections.webm (1698x932, 1.52M)

yeah, make it so when you click, instead of checking if you're ON the point it simply gets the closest point to your cursor
It'll make your life way easier. Also way don't you generate a random graph?

that's a good idea I'll definitely do the round to closest thing. I'm doing it manually and not randomly because I want to mess around with things and make it customized because eventually it'll go into a grand strategy games and the nodes will be provinces

Well at least load a predefined graph from your code that you can modify at runtime so you don't spend 5 min creating one from scratch.

how should i quit my job

What's this for? Just experimenting? Linked Nodes?

Scala is such a frustrating language to try to do anything interesting in.

#include
#include
int main(){
char path1[50];
char path2[50];
FILE* plist1 = NULL;
FILE* plist2 = NULL;
char input1[61];
char input2[61];
char seq1[5000];
char seq2[5000];
int a,b;


printf("type in file 1 path: \n");
scanf("%[^\n]%*c", path1);
printf("type in file 2 path: \n");
scanf("%[^\n]%*c", path2);

plist1 = fopen(path1, "r");
plist2 = fopen(path2, "r");
a=0;
while(fgets(input1, 61, plist1)) {
if(a==0){
a++;
continue;
}
if(strcmp(input1,"")==0){
continue;
}
strcat(seq1,input1);
printf("%d %s\n",a,input1);
a++;
}
printf("%d %s\n",a,seq1);
return 0;
}


How come this doesn't skip the blank lines like it is supposed too?

Attached: this.jpg (437x355, 31K)

Employed Haskell programmer reporting in

Attached: 1474325315193.jpg (636x616, 44K)

Do you ever feel bad for OOPsies?

Whatever happened to OSGTP, Ruby, and nv?

nevermind just don't bother sorry

Writing a microkernel for what I hope will eventually be a distributed OS

I'm a wordpress programmer.

Can I join this thread?

no, dumb webshit

Nice F dur Tonleiter you got there

Just want to learn about pathfinding and will eventually apply it to a game where an army will traverse across provinces (nodes)

I have a C test in a couple weeks, and my knowledge of it is mediocre at best.
Do I read K&R? If not, then what should I do?

?
If actually meant the disease then yes Im AIDS

good to know, thanks user. I intend tô be a good developer anyways

Is it worth it to use Qt to develop desktop applications in this day and age? Looks like the fastest way excluding webshit and Java.

Couple weeks are enough I think. K&R as a reference, for more in depth I guess C Programming A Modern Approach is okay. What is it about?

>What is it about?
Huh, wish I knew. It's for the army.
I've read that there will be 25 questions for every topic (C being one of them) but that's not official info by any means.

I'm working on a mitmproxy clone written in Rust in a feeble attempt to learn Rust.

t. zoomer who can't type

Scheme is the most elegant dynamic language in existence.

>scheme is the cleanest piece of shit in the toilet
alright then.

I'm trying to use GPIO input from A0-A5 on the Adafruit Feather 32u4 Bluefruit LE:
learn.adafruit.com/adafruit-feather-32u4-bluefruit-le/pinouts

I'm using this code:
learn.adafruit.com/custom-wireless-bluetooth-cherry-mx-gamepad/software

I got it to work except for the added GPIO. I realize they are different. How do I add input from A0-A5? Can I use pin 0 and 1?

Any help would be appreciated. If there is a different board with similar capabilities that would also be helpful.
Thanks.

Attached: untitled.png (2339x1654, 792K)

Foreground extraction and real-time mean shift. Been shilling my repo all over ribbit to tons of updoots but not a single contributor. Kill me.

>for the army
In what sort of sense? Like you'll be writing code while enlisted? Sounds like ass

Because you didn't finish college
I bet you don't even know about
>binary trees/red black trees
>treis
>doubly linked lists
>hash tables
>graph theory

>tries

What, are you fucking retarded?
en.wikipedia.org/wiki/Trie

>treis
What, are you fucking retarded?

Try to say more than one word at a time, and you'd have success conveying your thoughts

github.com/tuckerpo/real-time-cv-filters
This is the repo in question btw. If anyone of you know anything about computer vision specifically within the opencv2.x framework using python I would appreciate some feedback/contributions.

Okay, how's this: didn't you mean tries, you mongoloid nothing? Try using your brain if you want spell correctly or not come off as an overly aggressive and overly arrogant retard.

Attached: benshakiradestroysobaba.jpg (236x862, 53K)

What's the best way to learn practical assembly? I've done some x86 and can make stuff like the thing below, but the amount of resources that actually go over making programs (i.e., not just opcode references) seems limited.


section .data
running db 'Running',0xa
period db '.',0xa
done db 'Done.',0xa

BYTE_BUFFER times 10 db 0 ;a buffer to be used by int_to_char

section .text
global _start

_start:
mov r12,500

mov rdi,running
call print

countdown:
mov rax,r12
call print_int

sub r12,1
cmp r12,0
jne countdown
jmp exit

print:
push rdi
call strlen
mov rdi,1
pop rsi
mov rdx,rax
mov rax,1
syscall
ret

print_int:
call int_to_char
mov rax,1
mov rdi,1
mov rsi,r9
mov rdx,r11
syscall
ret

strlen:
xor rax,rax
.strlen_loop:
cmp BYTE [rdi + rax],0xa
je .strlen_break
inc rax
jmp .strlen_loop
.strlen_break:
inc rax
ret

;converts integer to string
;takes int in rax
;returns pointer to string in r9
int_to_char:
mov rbx,10
mov r9,BYTE_BUFFER+10;store the number backwardes with LSB at 10 and decrementing to reach MSB
mov [r9],byte 0 ;store null terminating byte in last slot
dec r9;dec buffer index
mov [r9],byte 0xa;store break line
dec r9;dec index again
mov r11,2;r11 will store the size of the string in the buffer.
.loop_block:
mov rdx,0
div rbx;get LSB by dividing by 10. LSB will be remainder and stored in dl.
cmp rax,0 ;if rax (quotient) is 0 then that means we have reached the MSB
je .return_block
add dl,48;convert each digit to ASCII
mov [r9], dl;store ASCII value in memory with r9 as index
dec r9;decrement our index
inc r11; increment size of buffer to accomodate the new data
jmp .loop_block ;loop
.return_block:
add dl,48
mov [r9], dl
dec r9
inc r11
ret

exit:
mov rax,60
mov rdi,0
syscall

write a compiler for a small but not too small subset of C.