/dpt/ - Daily Programming Thread

What are you working on Jow Forums?
Previous:

Attached: 1475546193270.jpg (641x870, 383K)

Other urls found in this thread:

pastebin.com/GeJQXShM
github.com/fmtlib/fmt)
bugs.python.org/issue34605
braveclojure.com/
interactivepython.org/courselib/static/thinkcspy/index.html
archive.org/download/TerryADavis_TempleOS_Archive/fan media/audio/TAD Hymns (MIDI)/
ccarh.org/courses/253/assignment/midifile/
theregister.co.uk/2018/09/11/python_purges_master_and_slave_in_political_pogrom/
twitter.com/SFWRedditVideos

first (you) me

How similar to swing is gtk?

First for WebAssembly

Attached: LA.png (831x651, 19K)

Hello Graph-lords.
I'm using Neo4j and am not sure how best to model the schemas for my use case.
I am scraping from an arbitrary number of services, which provide overlapping information.
The goal of the project is to provide "the most accurate" or "most complete" information using the aggregated data from each scraper.

One requirement that I have set is that in the final aggregated product, I should be able to know where the information came from.
So I would have a copy of the original data and a new aggregated result.

Naturally I would have some kind of `original -> aggregated` relationship which would easily tell me which originals are involved, but not which property came from which original.
How would you guys create this relationship?
Is duplicating data inevitable?
How would you ensure that each property is only "coming from" exactly one original?

Honestly the only reason I'm not using SQL is because I expect room for a lot of unusual queries that I can't predict beforehand.

Fantasy football user here. app is working perfectly. big thanks to you pajeets who helped out.

pastebin.com/GeJQXShM

any ideas for my next project?

thank you for posting a programming related image

Attached: 1508208478450.png (824x792, 408K)

If I were to fail a fizzbuzz test on a whiteboard, what level of programming would I be on?

Attached: Screenshot from 2018-09-12 17-13-21.png (3840x2160, 481K)

Shit tier

So what I'm thinking of is something like this:
class OriginalData(StructuredNode):
name = StringProperty()
foo = IntegerProperty()
bar = ArrayProperty(IntegerProperty())

class AggregatedData(StructuredNode):
name = RelationshipFrom('OriginalData', 'RETRIEVED_FROM', cardinality=One)
foo = RelationshipFrom('OriginalData', 'RETRIEVED_FROM', cardinality=One)
bar = RelationshipFrom('OriginalData', 'RETRIEVED_FROM', cardinality=One)

etc.
You gotta do an extra traversal for each field you wanna retrieve but what can you do. It would be the same in SQL.

Community college, Intro to Programming I, first week

op is Cute++

Nothing. :(

Just got done with my project for class, just waiting for next one.

I'm nervous to share my Github but I need stars (╯•﹏•╰)

Attached: k-kawaii.png (1280x727, 1.05M)

>made a simple lua to sepples eventing system based on Qt signals
probably made a bunch of mistakes but I’m at the point where i just cannot find relevant textbooks anymore

Share your github and I will give you a

Or well, SQL would let me use multiple foreign key fields, but you're supposed to normalize shit anyways.

I'll fork your dongle repo, femboy

Attached: 1467374445263.jpg (395x329, 66K)

What's the Java's equivalent of File("fname", "r+") in java? I want to open a file in append mode, if the file doesn't exist it will create a new one.

Attached: 1536461729789.png (1152x561, 691K)

printf("Name: \"%s\", Value: \"%d\"\n", foo.name, foo.value);
vs

cout

What the fuck?
You can put
code tags inside of code tags?

That's not cout's fault, C++ lacks a string formatting API (for example github.com/fmtlib/fmt)

whats fizz buzz?

why wait? make your own

Attached: playhaven-developers-640x480.jpg (640x480, 75K)

rtfm, you lazy nigger

i wish i had a mentor :(

>

I can be your mentor so long as you agree to sit on my lap uwu

just ask your question faggot

>reusing OP art

You just gave me an idea: crowdsourced mentoring. It would be like Quora but with white people

Share your github so I can report you for pedophilia to the police

*poos on your service*

Attached: 1512935747019.jpg (399x370, 40K)

nobody here ever helps me they just meme

probably because you're doing something incredibly stupid but you're too dense to see past the memeing

Janitor-tier, because that's sub 100 IQ type shit, if you're getting interviewed, you probably attempted to learn programming of some sort, but you were too fucking stupid to ingrain the very basics.

Is this programming?

'''
Run from a folder of images. First arg specifies glob pattern.

Script will thumbnail each image and save the result in the
`thumbs` folder (folder will be created if nonexistent)
'''
import glob
import os

from PIL import Image

def thumbnail(files, size):
if not os.path.exists('thumbs'):
os.mkdir('thumbs')

for f in files:
name, ext = os.path.splitext(f)

try:
im = Image.open(f)
except OSError:
# not an image file
continue

print('Thumbing {}...'.format(f))

im.thumbnail(size)
im.save('thumbs/{}_thumb{}'.format(name, ext))

if __name__ == '__main__':
import sys

pattern = sys.argv[1]
width = sys.argv[2]

files = glob.glob(pattern)

size = (int(width), 9999)
thumbnail(files, size)

no, this is python

no this is a script

What a tragedy this was

Trimming through all the info was the hardest part as a beginner, and I'm not done yet.
I soon realized that sites like codecademy are good just to learn the basics.

>apply for job
>Sorry this is a no tattoo company
>later look up who they hired
>it's a blue haired piercinged roastie with massive sleeve and face tattoos
Fuck jobs

>apply for job
>they call back
>don't answer

agreed.

>got through the first chapter of K&R
wew lad

Attached: 1.png (634x367, 248K)

I didn't show up for yesterday's lecture in Linux so I have no idea how this script is supposed to work. I don't know much shell scripting btw so I don't know what #$ means.
It's implied that this script can convert hex to decimal in 3 different ways, but where's the input?
if [ $# -eq 0 ]; then
echo You need to provide a hexadecimal number as argument:
echo E.g: $0 FF
exit 1
fi

# dc - an arbitrary precision calculator
echo 16i 2o $1 p | dc

# octave - A high-level interactive language for numerical computations
echo "dec2bin(hex2dec ('$1'))" | octave -q

# python - an interpreted, interactive, object-oriented programming language
echo "print bin(int('$1',16))" | python

Attached: 46a.png (645x729, 97K)

void drawPyramid(char symb,int n){for(int i=1,k=0;i

the input is implied to be given the form of arguments like typing in "myscript.sh poopoo peepee" in the terminal

the $1 represents the second (1th in a 0-indexed array) argument

aaaah so I just write ./hex2dec 24F right?

based

sue them for discrimination

yeah

bugs.python.org/issue34605
>For diversity reasons, it would be nice to try to avoid "master" and "slave" terminology which can be associated to slavery.
>Guido van Rossum: I'm closing this now. Three out of four of Victor's PRs have been merged.
Thank you, Guido.

scala or clojure?

clojure braveclojure.com/

Attached: braveclojure.png (900x900, 104K)

is there any reason to pick one over the other

One is a lisp, the other isn't

That's an argument for Scala desu senpai.

Sites like codecademy and w3schools are just trash in general and completely worthless.

You can't rely on websites that claim to teach you anything; they're profit motivated and their only interest is in abusing search engine optimization to get those sweet sweet ad bucks

In the interest in getting "started", your primary focus should be understanding control flow, breaking down larger problems into smaller problems, and understanding the tools you have at your disposal; variables, data types, literals, functions, etc.

I recommend you just run through this online textbook and skip all of the videos (no surprise they suck)
interactivepython.org/courselib/static/thinkcspy/index.html

After you're done with that textbook, you'll know enough basic programming to go onto the internet and understand the real sources of information that everyone uses: StackOverflow questions, blog posts, etc.

How can I extract the content of a midi file to plain text?
I want to play temple OS hymns on servomotors.
archive.org/download/TerryADavis_TempleOS_Archive/fan media/audio/TAD Hymns (MIDI)/
I'd like to get the different frequencies and the timing.

Attached: 1526741747155.png (3200x3800, 35K)

Only if you're a pleb

Is the increased prevalence of people with girly anime avatars, and overall grown up men acting girly online a sign of Freudian castration at play?
These people apparently feel guilt for their sexual desires, so they feel castrated by the society.
Could explain where the whole million genders mental illness comes from from the psychoanalytic standpoint.

use the first link from google

Check the midi specs
Write a cript acordingly
But probably there already is a python lib for it

It's already in plain text bunghole
ccarh.org/courses/253/assignment/midifile/

Attached: in-this-moment-i-am-euphoric-not-because-of-any-19266409.png (500x445, 107K)

The thing that makes me confident is that so far I've been able to solve every problem I faced.
I'll keep that bookmarked but right now I need to focus and get good at PHP/Laravel asap. 67563421 on the docs and got a book called 'Laravel Up and Running'. Laracasts isn't bad but videos are full of unanswered questions, their feedback is poor.

I want to eliminate my map for keeps.

Laravel sucks learn fucking go or something

Who thought "slave" is an acceptable technical term to begin with.

fucking wh*te people

I'm not going to pass on a job because you don't like Laravel.
I can learn other stuff on my free time.

Sounds like you're learning laravel in your free time kiddo

damore too. they repeated his talking points!

>Middle English: shortening of Old French esclave, equivalent of medieval Latin sclava (feminine) ‘Slavic (captive)’: some South Slavic peoples had been reduced to a servile state by conquest in the 9th century.
>Slavs are an Indo-European ethno-linguistic group
>White people is a racial classification specifier, used mostly and often exclusively for people of European descent
you're right

you're a delusional moron if you don't realize how ineffably ignorant you are

>bored out of my mind at work
>start "programming" in excel

It's surprisingly refreshing trying to, say, draw an n radius circle into cells without being allowed to use cycles

>That's not cout's fault
I don't get your point.
Are you saying this somehow makes cout not shit?
Fuck off. cout is trash and will always be trash. We need a type safe extendable zero cost string formatting library.
>inb4 fmtlib etc
I said zero cost.

Performing any sort of IO action is very costly anway so it really doesn't matter.

I am, but in order to get a job and get my feet into this world.
So time is tight right now and I can't afford to start learning more stuff even if I want to.

You have NOT seen the absolutely SHIT codegen fmtlib causes just to support third party user types.
Even if it is relatively fast, it's fucking HUGE and I refuse to bloat up my executable with all that fucking shit when it could just be a few lines of assembly instead.
And no, if you think all IO goes to some non volatile storage or to the terminal, you're a fucking idiot. I could be writing to a memory backed buffer or piping to another process which would be much more affected by huge and slow formatting facilities.

lol keep on brother

you have to learn shit all the time. if you're the guy that wasn't sure where to go after basics, just start a project. you won't realize both how much you know and don't know until you try to build something.

i try to use wget to
-download a page
-all it's resources to view it properly
-all images which are linked on that page, but not any links linking to html pages

does someone know the correct command for that?

I want to mirror Jow Forums threads

Is Smalltalk just yet another /dpt/ meme language like Haskell and Idris or is it actually worth it, guys?

Attached: 7f9.jpg (657x527, 34K)

>Haskell and Idris are meme languages
Fucking frogposters mang

dumb frogposter

if you need to ask, it is

why is it using the current working directory instead of taking the directory as an argument, perhaps defaulting to the cwd in the event of no directory being specified?

No, Smalltalk is actually historically important, Haskell and Idris are completely irrelevant.

It's good that it existed, but you'd never use it for anything useful.
It's like the various lisps. Something full of good ideas that are useful in other places.

Trying out graphics in a console program.

Attached: graphics.jpg (1429x470, 211K)

theregister.co.uk/2018/09/11/python_purges_master_and_slave_in_political_pogrom/
surely this can't be true Jow Forumsirls

lmao, can't wait to see someone complain about "python" being too phallic to be inclusive and yet another microagression from the patriarchy we live in :^)

Anons, I have the string to parse. Like, "12+34+567+8+90", I want to implement the function which extracts the next number each time the function is called.
nextNumber(); // 12
nextNumber(); // 34
etc
Should I just move the iterator until the end? What if we reach the end, should I move it to begin in order to make it circular?

Attached: IMG_20180911_144739.jpg (538x594, 69K)

I have been achieving world peace

What a fucking retard.

the smalltalk experience is unique, its interactive environment is still unparalleled.

the people of smalltalk where at the frontier of software engineering from ~1980 to ~1995. class based oop, design patterns, test driven development, ... all this came from the smalltalk scene. because of this, the culture of practicing a __sane__ software engineering is much stronger in the smalltalk community than in the others.

...

You are absolutely right that building shit is the best way to learn and that's my short term objective.
What I meant is, when I started, I started doing tutorials, a lot of them, that supposedly thaught you x but they just covered the basics so right now I'm trying to not focus on so much stuff but actually learn it properly.
I learned more in a week with freecodecamp CSS projects and JS algorithms challenges than I did with any course.