/dpt/ - Daily Programming Thread

What are you working on, Jow Forums?

Old thread:

Attached: machine_learning.jpg (318x960, 59K)

Other urls found in this thread:

github.com/enfiskutensykkel/ssd-gpu-dma/tree/latency-bench-rewrite
programiz.com/python-programming/property
twitter.com/SFWRedditGifs

First for λ

>What are you working on, Jow Forums?
I'm rewriting my latency and bandwidth benchmark program to support more fine-grained queue control. My proof of concept with hosting I/O queues on remote GPUs worked, so I'm going to run some benchmarks in a PCIe cluster after I'm done with the rewrite.

github.com/enfiskutensykkel/ssd-gpu-dma/tree/latency-bench-rewrite

a chess game

When will ADA finally have a stable version that can be used in production for web development?

Attached: Beta-Testing.jpg (391x348, 29K)

you forgot reduction

how do I capture the /sci/ part in the string below, while still matching the whole thing, whether /sci/ is present or not?
With /sci/ potentially being any board
>>>/sci/123

I can match the whole thing, but so far could not figure out how to get the capture group working in this case
.*?(\/[a-z]+\/)?.*?


I can remove the '?' after the capture group so it always looks for that part, but then it would no longer match non-crossboard deadlinks
.*?(\/[a-z]+\/).*?

I'm looking to get into programming but I have no idea what kind of project/problem I want to solve. Any cool things for beginners to do?

Looking into Python2 multiprocessing;
Can i spawn as many Process(es) as i want and Linux handles it for me, or am i actually limited by cores/hyperthreads?

search for that roll number challenge thread, should have enough project for you to do

Pretty sure that there's a limit to the amount of processes that the kernel can manage.

cat /proc/sys/kernel/pid_max

If you want to be anal about it then I also didn't specify an evaluation order.

Thanks mate, given that it actually starts to utilize all my cores, i was thinking of limits of 4 / 8 maybe 16. Thanks anyway.

Evaluation order isn't that important unless you want confluence

How do I find a company to sell my high performance fizzbuzz to?

depends if the date is a multiple of 3 or 5

well I guess I can make it work by just being more specific
(?:>)+(\/[a-z]+\/)?\d+

or is there a better way?

$ ulimit -a|grep 'max user processes'

And reductions aren't important unless you want to manipulate your terms in any meaningful way. Your point being?

Old fella is unironically right

char* s = "string"
The questions is: s == &s[0]?

Beta reduction is critically important for understanding the lambda calculus, especially since you brought it up as understanding programming.

yes

>bitmaps are stored upside down
>tore upside down graphics to speed up loading

This is legit. Is this for work, hobby, or an academic project?

Finally decided to read SICP, I'm really enjoying the emphasis on math.

&s[0] is &(*(s + 0)), &*e == e, and (e + 0) == e, thus &s[0] == s

>defensive programming

Attached: 1419338409005.jpg (1024x576, 107K)

offensive programming

writing tests for ecommerce api at my job.
doing nothing personally.

A good resource for downloading IT books? I managed to find the 'Introductory XUL' I had been looking for, but it's the 5th edition, whereas the book is on its 7th already. Not exactly a big issue, but still.

I recommend buying them on /t/.

Actually you can just google the title and there will be a pdf on the first page.

1) read a tutorial book to learn basic syntax and solve some Jow Forums level problems

2) pick a coding problem website similar to your interest hackthebox/codwars/projecteuler

3) once you've done enough shit tier problems and understand the kind of things you can accomplish solve your own and everybody else's problems for money

>his function accepts only one data type

Attached: tenor.gif (310x366, 142K)

Thanks user. Is Automate the Boring Stuff a good tutorial to start with?

>functions should be O(1) for minorities and O(n) for white males

I finished a timezone converter (from JST to your browser timezone) for myanimelist. "I made" is kind of.. I imported moment.js and wrote a bunch of js shit to convert the timezones

Attached: 1530677303542.png (353x386, 115K)

Getting a weird error when trying to rename columns of a dataframe in Python:

df.columns = header_list

ValueError: cannot reindex from a duplicate axis

how do I cycle through 2 Sets at once in java? I want to print the elements of the same index together

What causes it?

How do I into SQL?

First you need an SQL.

Then you take it, and you into yourself there.

Slowly, otherwise there will be bruises.

>mfw when there is such a thing
>mfw offensive progamming is basically the equivalent of manspreading in code for everyone to see your balls

Attached: 1347018139754.png (679x427, 15K)

Will I need a helmet?

>What are you working on, Jow Forums?
Tic Tac Toe game with C++/SDL2 and webdev shit

I have no clue what to make for my portfolio and I'm scared I won't get an internship for Summer 2019.

Attached: 71K0UQnJsJL._SL1500_.jpg (1500x1500, 208K)

Finalizing my Haskell program.

are you removing any potentially useful features

remember to use unsafePerformIO

It has not features. You feed it some URLs and it starts downloading stuff. That's it.
I'm fixing warnings from GHC -Wall and reducing code duplication.
I already use that on my tests.

soooo you made curl?

Importing all of moment.js' bloat just for simple timezone conversion? Look at how they do it, copy what you need, give credit. Don't pollute the web.

No, an RSS feed downloader.

God damn I'm really stupid, but I'm trying to figure out Groovy and I have a question.

If I've written a class and have it saved in a separate file:

MyCoolClassWow.groovy

public class MyCoolClassWow{
// etc
}

How do I import that class into another .groovy script in the same directory? I tried doing it the python way:

mainScript.groovy
import MyCoolClassWow

MyCoolClassWow hacker = new MyCoolClassWow()


...but that gives me the "Unable to resolve class MyCoolClassWow" so obviously I'm not doing this correctly.

Do I just eval("myCoolClassWow.groovy") and do it that way? That works, but seems like the pajeet way of doing it.

Attached: iamnotgoodwithcomputer.jpg (480x376, 78K)

This is what python does to your mind.

considering doing something with purescript

y/n? has to compile into js anyways and it seems good for my task... any experiences?

What's wrong with Python?

So you don't know either, huh?

Python:
How can I turn a list that looks like this:
['1: Male', '2: Female']
into a dictionary?

Anyone ever considered data science work with the CIA or NSA? Seems like a good option after graduation where dmI dont have to move to Commiefornia or compete with an army of poos who work for minimum wage.

java books you can recommend? (and java/android dev one for further reading)

>male before female
TRIGGERED

genders = ['1: Male', '2: Female']

d = dict()
for elem in genders:
chunks = elem.split(':')
d[int(chunks[0])] = chunks[1].strip()

print(d)

Typically you wouldn't use a dictionary with keys that are numbers.

If you need to maintain the order, use a Tuple:

cisGenderList = ["1: Male", "2: Female"]
cisGenderTuple = ()

for gen in cisGenderList:
cisGenderTuple += (gen.split(':')[1].strip())

Hey guys, newfag here using Treehouse to help me.

Why isn't my 'if' statement working?
I should get a message saying I can't access the program since I've set the age below 13

Attached: TreeStory error.jpg (960x633, 43K)

should I use C or C++ for my games?

Attached: 268zj7.jpg (645x729, 26K)

What's 'consoleprintf'? Shouldn't it be 'console.printf'?

>consoleprintf
I'm not familiar with treehouse but maybe you need console.printf

Do you need to save your changes/recompile before running in that program? I think you'll also discover an error with "consoleprintf" when you do, as point out.

C++ is more forgiving for gamedev.

Missed that mistake, but I fixed it and it still doesn't run the loop

C is going to be a little harder until you get used to it, but better in the long run for performance.

Make sure you're recompiling the program before running it again.

you're missing a ) on the penultimate line

>def __init__(self):
man I have nothing against python in general but the oop syntax is the worst

Yeah, I feel dumb
Deleting my post and committing sudoku now

It's easy to let go of yourself and use non-performant shit with C++, so use C.

python sucks anyway so being bad at it is a virtue

Also of note:
1) You don't need to use str() on getWeight. print() will do just fine without it
2) By convention, class names are capitalized
3) Instead of getWeight, etc. consider either just letting people access self.weight directly or use the @property decorator. See programiz.com/python-programming/property

nothing stopping you from rewriting performance critical parts in a more efficient manner m8.

>What are you working on, Jow Forums?
studying anime to prepare myself for a haskell interview

this + haskell

Make sure you eat plenty of burritos.

What is so great about Haskell? I'm not b8ing or memeing, I don't know much about it and I'm curious.

Attached: 1520520003975.png (500x775, 416K)

Find a good framework or engine.
Godot's good.

bro you're gonna hate yourself. when don't use the parenthesis when defining your main function

def main:

Otherwise it looks like it should be good.

Also FUCK THESE FUCKING CAPTCHAS GOD DAMN

anime

text encryption algos....
i'm bored, don't judge me

>What are you working on, Jow Forums?
I am building a remote for my remote outlets. Though i have to rewrite most of it myself, because all available stuff is for arduino, which is too bloated for a attiny13.
On/off works. Now i just need to add 3 buttons and an on/off switch

Attached: rc.webm (1280x720, 408K)

please make kode review (pls only leave good comments on comporate wiki. thanks) ^_^

Attached: kode.png (1920x1056, 303K)

Redpill me on programming.

Trying to work out how I would find out the right number of handles for a connection pool.

its fucking shit

nothing really, it just caught on in the same way dark souls did of being this "mysteriously hard thing only the elites can do" according to brainlets.
When in reality haskell is slow language that never should have left academia. Most programs aren't inherently lazy, which makes writing them in haskell inherently wrong. And it lacks dependent types, which I think is a must for FPLs. As well as quickly turning into the C++ of the FP world with everyone writing their own subset as well as bolting on awful extensions (looking at you liquid haskell).

Learn Idris or Agda.
If you are interested in encryption and verified systems, look into F*

First thing. Loads of repetition in rc.c.
I'd be flagging that...

using haskell was the first time I went "so THIS is that good OOP shit".

Trying to learn how to host a server. It's either really hard to set one up or I'm just really dumb. I'm leaning towards the latter.

your mom

Why defines instead of constants?
Why not abstract send_uid and delay_ms into a static function that you pass the values to?
Why the magic 12 and 1000 numbers?
Why so much repetition in the send_& functions?

So it's just popular right now basically.
What do you mean by that? Isn't Haskell strictly functional?