/dpt/ - Daily Programming Thread

Old thread: What are you working on, Jow Forums?

Attached: 1542326569607.jpg (650x832, 187K)

Other urls found in this thread:

quackit.com/python/reference/python_3_escape_sequences.cfm
twitter.com/NSFWRedditVideo

megumin a shit

Megumin is very cute! I love Megumin.

I am developing a whiteboard with the smoothest roller-skate wheels so that it can be rolled into a tech interview elegantly and swiftly

nobody cares

they're not so bad

Wrote a script to help rsync because it doesn't recognize moved files.

you're waifu a shit

My new software company got its first contract, so im working on some WordPress plugin for a client. Simple shit but it's nice

Same goes to all the other comments in /dpt/? You are being hyperbolic

nobody cares

I am trying to find good problems that'll increase my insight and algorithmic abilities.
also, data structures that'll improve my implementation skills.

nobody cares?

I didn't write it for you.

write something for me, onii-chan

What int data type would I use to calculate very large numbers such as 1060 ^ 530? Everywhere I look says unsigned long long int but that doesn't work.

based and nihilismpilled

BREAKING DISCOVERY: SAMEFAG

an unbounded, arbitrary precision integer type

What are you developing user? What kind of plugin?

worst girl paedo bait

Trying to write a GIF decoder on a 16 bit PIC microcontroller. It's surprisingly difficult when you don't have enough RAM to do LZW normally.

read

read

nobody care about your samefaging vro

Get an arbitrary precision library like GMP.

excuse me

Grovel in front of your PC as an apology.

wa la
def time
start = Time.now
yield
duration = Time.now - start
end

def bench(n = 1000)
res = n.times.collect { time { yield } }
return "avg #{n}:\t" + (res.inject(&:+) / res.length).to_s
end


That's 1604 digits. You need an arbitrary precision/bignum library, or some really long longs.

i have a string in python
'0x310x380x300x330x360x300x330x380x300x350x31'

i want to change all the 0xs to \x (working with hex numbers) like this'\x31\x38\x30\x33\x36\x30\x33\x38\x30\x35\x31'


i try string.replace("0x, "\x") but it doesnt work
it worked with "\\x" but then i have two slashes.

i absolutely need it to be one slash because i am going to input this string into a method that only takes hex numbers like \x31

Cartesian Cubical Computational Type Theory will save systems programming

Should I post this to Jow Forumsprogrammerhumor?

Attached: SeussFinal2.jpg (640x480, 33K)

Look up escaping characters.

It definitely LOOKS sufficiently unfunny

thats very boomer of you

If I learn Ada, will Boeing give me a job?

He said he replaced '\x' with '\\x' but get's two slashes.

Maybe write a function that goes trough each char of the string and replaces all matching chars to desired ones?
Really don't know, never programmed in Python.

>no stddev

M A X T A R D

What's funny about it?

Nothing.

I'm pretty sure you're as stupid as he is. Read his post again, retard.

I want to make megumin's megupucci explode.

Get help.

Read it two times still didn't find any difference. Maybe I'm stupid.

I get it from your mom every day, it has gotten tiresome and she is overstretched.

>Maybe I'm stupid =^(
Now you're just making me feel bad. He doesn't know how escaping works. He thinks that because he's escaping '\', somehow it won't print right, even thought it does.

>I want to make megumin's megupucci explode.
>I get it from your mom every day, it has gotten tiresome and she is overstretched.
>>>/global/rules/2

nah he interpreted what i meant correctly. Using escape sequences gives me two slashes (only one is visible if you print the string). The problem is that it's not for printing but for feeding into a function that takes in hex values. Thats why i need only ONE \ because it forms an escape sequence \x that turns the integers after it into a hex value.

Why do you post a global rule which applies to your underage sensitivities but not my adult humor? You need to leave this site if you are too underage to grasp H.

Then do another string.replace
strng.replace("\\", "\");

Not cool but does it work?

I don't know how you check that in a type safe lang like python. I use C. I'm 99.99% sure that you're just escaping the backslash for replace function.

yeah i think the replace method is only capable of inserting a "\\" (which is code for a single backslash) i need to find another way but this is all part of an unconventional workaround so i may just drop it

>weird weeb into fetishizing anime
>i banged ur mom!
>adult humor
kys

That will fail. Python thinks you're escaping the last double quotation mark.

>noob so hard
dude, you're escaping the backslash. Try then look up escaping characters.

Don't give up user. Surely there is a way.

It's not my problem you are too underage for adult humor, that's why it's 18+ after all, because underage like yourself can't appreciate the intricacies of it.

How come you've arried at such a string with no way to get it in a program friendly representation?

>Don't give up user
I not the one having a difficult time understanding character escapes.

>Surely there is a way.
Yes, it's called C. Also, he could use the pack framework in python for raw byte manipulation.

u rude
def mean(ary)
return ary.inject(&:+) / ary.length
end

def bench(n = 1000)
res = n.times.collect { time { yield } }
avg = mean(res)
std_dev = Math.sqrt(mean(res.map { |x| (x-avg)**2 }))

puts "avg #{n}: " + avg.to_s
puts "std-dev: " + std_dev.to_s
end


It works in my memelang
>> '0x310x380x300x330x360x300x330x380x300x350x31'.gsub('0x','\x')
=> "\\x31\\x38\\x30\\x33\\x36\\x30\\x33\\x38\\x30\\x35\\x31"
>> puts '0x310x380x300x330x360x300x330x380x300x350x31'.gsub('0x','\x')
\x31\x38\x30\x33\x36\x30\x33\x38\x30\x35\x31

the program i imported in python needs an input like this
b'\x31\x32\x33\x34\x35\x36\x37\x38\x39'
i need to make a string like this (with a SINGLE backslash)

my string that i created from user input was
'0x310x320x330x340x350x360x370x380x39'
replace only adds \\. i can't use this

strng.replace("\\", "\")

because SyntaxError: EOL while scanning string literal

>strng.replace("\\", "\")
>That will fail. Python thinks you're escaping the last double quotation mark.
I told you... I'm growing tired of your of inability to understand.

Maybe because it's strng not string?

Also,
if str[i] == '0' && str[i+1] == 'x'
then
str[i] == '\\'
?
Also anyone feeling Christmas spirit? It's cold I like it Christmas is near

>Reinventing the wheel in python
Nice

dude i told u already I tried that in the beginng
i tried again
SyntaxError: EOL while scanning string literal

u can't use "\" with this method
strng is not a type it is a placeholder for the variable that i actually use

Last time: look up escaping characters.

yeah that's my fucking problem i give up
forget i asked this question im done thanks for thehelp everyone

quackit.com/python/reference/python_3_escape_sequences.cfm
i read that shit 100x time nigga

Man, you can't give up.
Come on. Are you always going to give up on your dreams user? Are you always going to say I'm qutting? Please, stop being such a quitter and work on this problem.

Integrating PortAudio in C/C++ for host-to-host real-time audio streaming.

Maybe try McDonald's.

Any plans for TLS/encryption?

kys, your parents would be relieved.

Hey guys I have this really neat idea that noone think of before... So basically we create a code that eats 0.0000000001 of each transaction and we link it to some oil tankers. Who's with me?

try a raw string

Underage pls, you are too underage for H.

He's not initializing the string himself. He's getting the hex string externally. I wouldn't respond to "them." I'm half convinced it's a troll.

H? Why do you assume I'm underage?

oh wait, I know what you mean
str.replace("0x", r'\')

I need to goto sleep.

insert function for doubly linked list,
2 threads for traversing, one from head the other from tail,
watch the world burn

Attached: 1513965600334.jpg (500x500, 150K)

Congratulations

Attached: py.png (800x800, 24K)

You have underage sensitivities and underage comprehension of programming.

>>> var3.replace('0x', r'\')
File "", line 1
var3.replace('0x', r'\')
^
SyntaxError: EOL while scanning string literal

Attached: file.png (361x85, 9K)

the b'...' means it's a bytes object
you need to convert the string to a bytes object. I'd say parse the string to a list of ints and call bytes() on the list.

this is for a CRC program where the input is EXTREMELY sensitive it has to be that
b'\x31\x32\x33\x34\x35\x36\x37\x38\x39'
format

i did that earlier but yeah i give up for real don't worry about it. might try another language

well if it wants bytes you won't get far with a string that looks like bytes. construct a proper bytes object from your input.

You're quite the repeatative retard, aren't you?

it works if i manually type in b'\x31\x32\x33\x34\x35\x36\x37\x38\x39'

it is constructing this from user input that is the problem. i thought i could simply insert it but it wont and i am not an expert on this shit. it can't be in the 0x310x32.... format either for some reason. it runs but comes up with a different result which is everthing in crc16 program

It's only logical to be repetitive towards mentally challenged people such as yourself since that's the only way to make them understand their follies.

Okay, retard. Keep jacking off to anime and sniffing used panties.

This is /dpt/, post programming or shut your flap.

I prefer sniffing your mother directly, thank you.
This is a devolved programming thread indeed, where incompetent people showcase their disgrace, such as yourself.

how are you passing the input to the crc?

>I want to make megumin's megupucci explode
>This is a devolved programming thread indeed, where incompetent people showcase their disgrace, such as yourself

>2 thread traversal
explain this

It is your own problem that you are so lacking in any programming talent that your sensitivities are more preoccupied with a megumin aficionado than with the task you are incapable of engaging in without making people laugh at your disgrace.

The epitome of autism. Enough of your off-topic bullshit.

You were the one who went off-topic, and kept going because you have nothing of value to give to the topic.

Can somebody post what's programming to them? I'll post my toughts.
I see it as a kind of puzzlework, where you can build the puzzle and each part precisely fits together. It's like a puzzle to be simple.

Attempting to make a machine understand human gibberish and act according to its demands.

reinventing the wheel

redpill me on java concurrency

telling retarded kid to do something