/dpt/ - Daily Programming Thread

Previous thread - What are you working on, Sup Forums?

Other urls found in this thread:

cplusplus.com/doc/tutorial/
github.com/snwh/paper-icon-theme
archive.rebeccablacktech.com/g/thread/S54776509#p54777355
twitter.com/SFWRedditVideos

First for composable continuations!

That's a cute girl.

optimising my parser

Extracting some boilerplate into a 'toolbox' class that I can use in all of my projects.

>girl

Trying to figure out what the fuck is going on here.

I have nothing to work on, give an idea /dpt/

nth for brainfuck being greatest lisp clone

++++[++++>---++.-[--->+<
]>++.++++++.+++[->+++.++
+++++++++++.[-->++++++++
.[->++++.-[->+++.+[--
--->++.+++++++.--------.
-----------.+++.+++++++++++
++.[-->++.[-->++++.>>
>>,.[-]++++++++++.--[
-]+[[-]+>]

dank meme generator

Write an online video game in machine language.

You're talking about Monads?

Cellular automaton, make up your own neat rules.
Maybe a war type thing, where two armies start on each side and charge towards each other. Incorporate special units which have the ability to differ from the regular soldiers which just run straight forward.

Shouldn't you be in school?

Spent some time working on procfs parser and reverse engineering some old ass binaries that required me to bootstrap GCC 3 and now I have to do some webshit for work, shit sucks yo.

>Shouldn't you be in school?
I'm sorry, I forgot that we were not allowed to post playful replies on /dpt/. Do you want to downvote me and call a moderator to lock my reply chain for being off-topic, dear StackOverflow autist?

I'm working on a chip8 simulator. Right now doing testing to make sure everything works as expected

Anyone? Why aren't the red and yellow the correct size? They should be split right down the middle.

Playful reply, read, shitpost.

Shitposts are not intrinsically bad. They are part of our "culture", whether you like them or not.

Autism incarnate.
Follow the trail of redpills.

The redpills are just chocolate tic-tacs in the rabbit hole of retardation.

daily reminder: don't argue about C in the presence of the big dick playa unless you want to gag on a thick dick
the rape never ends, shits!

schools got out yesterday

you probably fucked your vertex positions. double check them.

try drawing your triangles 1 by 1 and see if they are correct

Can you control yourself long enough to form a coherent sentence, autist?

C is for women and Indians.

Real first-world men use better languages.

gtihub.com/deeepaaa/hachidori

notice me

>C
>Indians
lol hƿæt

Anyone know the best way to solo learn C++?

Any sites like codecademy which are particularly good or youtube series or..?

nice desktop icons
bad link

cplusplus.com/doc/tutorial/

cppreference
any book by bjarne stroustrup or scott myers
lots of practice

My vertex positions are there on the screen in viewportVBO2.

They are
-1.0f,1.0f,0.0f, 1.0f,1.0f,0.0f,
0.5f,1.0f,0.0f, 1.0f,1.0f,0.0f,
-1.0f,-1.0f,0.0f, 1.0f,1.0f,0.0f,

0.5f,1.0f,0.0f, 1.0f,1.0f,0.0f,
-1.0f,-1.0f,0.0f, 1.0f,1.0f,0.0f,
0.5f,-1.0f,0.0f, 1.0f,1.0f,0.0f,

0.5f,1.0f,0.0f, 1.0f,0.0f,0.0f,
1.0f,1.0f,0.0f, 1.0f,0.0f,0.0f,
0.5f,-1.0f,0.0f, 1.0f,0.0f,0.0f,


And my vertex shader attribute is attribute size: 3, vertex size: 6, offset: 0. With the other half being colours. The colour attribute is also in that image in that format.

fuck my life

github.com/deeepaaa/hachidori

And in your opinion is this the best way?Thanks I'll hunt for some books

Assuming you already know programming, just read "A Tour of C++"

Paper icon theme

github.com/snwh/paper-icon-theme

Oh wait, I fucking see it never mind. It's always a fucking retard mistake that never shows itself until you've shown other people your retardation.

>maintaining old and undocumented php code which uses undocumented C extensions and I don't have the C source code
Send help or kill me here, I just want out of this ride

Kind of, I'm a computer security and forensics graduate and I winged the programming modules, so I'm probably worse off as a result because I really should be starting for scratch and learn all the terminology and things again.

I need it for a few jobs I've applied for

Tell your employer its proprietary garbage and you refuse to work with it, for your own sake and the company's.

pic related: no it's not. Hoarders just don't want to help their neighbors. That's not good. Join us now.

output looks OK to me for those positions. your viewport is not correct, that is why red triangle so so narrow. (width should be half of its height) and you have a yellow rectangle.

what were you trying to do?

as i said, draw them one by one and see what did you wrong

This is supposed to give someone the average of the 5 numbers that are entered into the calculator but its not calculating correctly. Anyone know what's wrong?

It's okay I got it. 0.5 should have been 0.

It was a classic case of tard blindness.

What is order of operations?
It looks like you are dividing the last score by five, instead of summing all of them and then dividing due to the paren placement.

Also I miss VB.

>Anyone know what's wrong?
Yeah, you're not using Python.

>I got raped too many times
I know you did :^)

In that case, I'd go with "Programming -- Principles and Practice Using C++"
Also, be careful following online tutorials as alot of them teach outdated techniques that no longer apply to modern c++

Wrap all of your test scores in parenthesis.

You're dividing the last score by 5.

Goddamn, you're fucking dumb.

I just replaced one important std::vector with std::deque. Execution time went from 5.5 seconds to 0.08 seconds and that's in unoptimized build. Optimized timings went from 0.3 seconds to 0.05 seconds. I was prepared for a multi-hour battle to try and coax more speed out of the system, but all I did was change one line and that was it.

Again shows the importance of using the right data structure. deque cannot always replace vector, but if all you're doing is appending at the end and removing from the beginning and you need O(1) random access, then deque is for you.

>I miss VB
Went from that to C#.

I have never looked back. Fuck VB.

>I was prepared for a multi-hour battle to try and coax more speed out of the system, but all I did was change one line and that was it.
This is why you never optimize until you get the project solidified.

99% of optimizations are due to very small common-sense things, like doing a buffer, and then doing I/O, rather than I/O on a loop.

I suppose I mostly just miss BASIC in general. Just a nostalgia thing I guess.

>but if all you're doing is appending at the end and removing from the beginning and you need O(1) random access, then deque is for you.
wow, who would have though

>removing from std::vector's beginning
back to the python

the five scores are integers and the answer should be displayed as a decimal, such as 80.5

Holy shit, kill yourself if you can't read the thread or figure this out.

Two anons have told you EXACTLY what you are doing wrong.

Yes, that is all well and good. But you are not averaging.
You are doing
score1 + score2 + score3 + score4 + score5 / 5


And what you need is
(score1 + score2 + score3 + score4 + score5) / 5


I really hope this is clear enough, or you should go back to remedial math and learn about averages.

Sup /dpt/, what text editor do you guys like to use?
www.strawpoll.me/10508463/

Ed

Thanks man

Whoops, clicked on acme rather than atom
Captcha's fault

Working on an application that pulls data from db related to search query.

Can anyone help me out with this? Im trying to print out all the values from a list that are between two values. Here is my code so far.

searchq = 3001
#else:
#sys.exit()


nums = []

for r in results:
if 2400 < searchq and searchq < 3600:
nums.append(r['numbers'])
print nums < 2800

"nums < 2800" is a boolean expression, so it will print out either True or False.
for i in nums:
if i < 2800:
print i

Abstract algebra is pretty cool

Anyone know any really good resources for it, both mathematical and programming oriented?

I am actually trying to pull out the numbers from the list called:

r["numbers"]

So each result has a list of numbers and you want to print only those that are less than 2800?

Switched to Ubuntu because I want to learn sonething new and also I want my root rights.

>Windows 10 does not even allow you to upgrade a tablet's firmware. I had to use Win7 for it.

Also learning Java alongside with C# and C++.

correct, these are house numbers, so i want to print all of the house numbers that are greater then 2000 and less then 3000 for example.

So like this:
print([n for r in results for n in r['numbers'] if n < 2800])

>print([n for r in results for n in r['numbers'] if n < 2800])

THANK YOU!

That seems like a lot of languages to tackle at once, but maybe you're a quicker study than I am.

>be phd student
>spend two weeks writing and debugging a python script to process my data
>it managed to churn through all of it in five hours
>feel proud
>show it off to postdoc at the lab
>he proceeds to do the same thing in five minutes with essentially a Bash one-liner (several pipes and process substitution plus some extra lines, but the bulk of the work was a one-liner)
>it processes all the data in 30 minutes and produces the same results

what should I do I feel terrible now

the smug bastard just left

I had experience with C# before and it is very similiar to Java so it is easy. I picked C++ because my friends(yes they exists :^) ) and I agree that we pick up this one for a group project.

was your python script faster then the bash one-liner?

Phd
>Why

get good fag

You failed your reading tests growing up, didn't you?

he said 5 hours

oops, read that wrong

sorry :(

You have brought shame to /dpt/
Complete sudoku immediately

Saved. Will repost it every single thread from now on.

>a.set(i, j);

Why not just a[i] = j;?

ssshhhh

Wow, I would probably just kill myself.

You're doing God's work

java

That doesn't explain why two different forms of the same operation are happening.

Agreed, there's a a[j] = temp just below, so this means there's Java®
syntactic sugar for that, no? So why use it only half-assedly?

a[anything] would be invalid in java. there is no syntactic sugar.

Huh? What's happen

>using a vector as a queue
>queue did the job better
Who would've thought

error: array required, but ArrayList found

Okrite. Guess graduate meme was being retarded. ty

The code in the image was

No, it was literally ten times slower.

I want to be cool like postdoc-senpai.

please don't bully me friends I'm suffering enough as it is

I will spend this weekend rethinking my life choices

Still a bit stuck, im trying to now pull out the addresses that match the numbers in the range.

"""Search query"""
searchq = 2800
minnum = searchq - 100
maxnum = searchq + 100


"""Finds numbers between two"""
print([n for r in results for n in r['numbers'] if minnum < n < maxnum])


"""Pulls out address matching num"""
for r in results:
if n in r['numbers']:
print r['co_address']


output I am getting:
[2751, 2736]
3001 HENNEPIN AVE # 1310
[Finished in 0.198s]

The list [co_address] matches up with the numbers in [numbers]. How can I make it print out all the addresses within the two numbers listed above?

archive.rebeccablacktech.com/g/thread/S54776509#p54777355

On the bright side you probably made his day.

what do you guys look for in a secure chat system?

not needing to interact with people