/dpt/ - Daily Programming Thread

strawpoll.me/13008444

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

Other urls found in this thread:

github.com/torvalds/linux/commit/657831ffc38e30092a2d5f03d385d710eb88b09a
youtube.com/watch?v=jXhXDzyRH_A
strawpoll.me/13008435/r
enet.bespin.org/group__host.html#ga5567a95d7a45521dc9cba93a9066c940
ddili.org/ders/d.en/
twitter.com/NSFWRedditImage

Ban C
github.com/torvalds/linux/commit/657831ffc38e30092a2d5f03d385d710eb88b09a

youtube.com/watch?v=jXhXDzyRH_A

Obot is ANGRY (No pronouns). What the fuck is this train wreck?

Shes anti-black? But she is black!

So this is the power of diversity... wow...

anyone have any good resources to recommend for an in-depth look at python for programmers? ie not teaching hello world, but more about the language itself from a higher level

I don't understand this

void update() {
static auto startTime = std::chrono::high_resolution_clock::now();

auto currentTime = std::chrono::high_resolution_clock::now();
float time = std::chrono::duration_cast(currentTime - startTime).count() / 1000.0f;

// ...
}


The startTime doesn't change after the first time the method is called?

Local variables declared as static are only allocated once and retain their value for the duration of the program unless it's changed.

/dpt/ if I wear a cute black shirt will I program good?

startTime is static, so it should be initialized when the program starts, and never again.

Clothes do not make the programmer. Where whatever is comfortable.

If you want to become a good programmer, write programs, and read the source to other people's programs.

don't listen to this troll, thigh-highs are a MUST if you want to kode anything good.

>Where
WEAR*

Fuck I hate typos. Also, fuck cooldowns for posting, and cooldowns for deleting posts. I was having a good day and then I misspelled a word on the Internet.

>>> for i in range(1, 101):
... if i % 3 == 0: sys.stdout.write('fizz')
... if i % 5 == 0: sys.stdout.write('buzz')
... if (i % 3 != 0) and (i % 5 != 0): sys.stdout.write(str(i))
... sys.stdout.write('\n')
...
11

1
21

1
fizz4


uhh guys

I thought it was the cross-dressing aspect that was important? In which case thigh highs are no good for me.

You have to understand how this is for me. I've written every bug, I've fixed every bug. I've designed every language, I've ruined every language.

>But she is black
Ummm, no sweetie, just beaceuse zxe looks like an african-american doesnt mean zxe identifies as one, i mean i know that this is literally /gpol/ now but can you like not just assume things like that, its not helping anyone and your probably going to die alone

nice. thanks.

emem obot doesn't have pronouns you shitlord, you refer to emem obot as emem obot

meme robot

Hrm... if I type this into a python3 repl, I can duplicate this behavior. However, if I save this to a file and run python3, I get the correct behavior. If I run it on repl.it, whether I run the script or one line at a time, the correct behavior occurs.

Sounds like a bug in the python3 repl then?

i guess so. is there any other way to print without new lines?

root.grid_rowconfigure(2, weight=1)
root.grid_rowconfigure(3, weight=1)
root.grid_rowconfigure(1, weight=1)
root.grid_columnconfigure(1, weight=1)
root.grid_columnconfigure(2, weight=1)
root.grid_columnconfigure(3, weight=1)
root.grid_columnconfigure(4, weight=1)
root.grid_columnconfigure(5, weight=1)


Is there a less verbose way of doing this

Some of my functions return an error code, and return variables through passed reference variables. Is this bad practice?

obvious bait is obvious

>meme

Shit tier fizzbuzz

not

for i in range(1,101):
if i % 3 == 0 and i % 5 == 0: print('fizzbuzz')
elif i % 3 == 0: print('fizz')
else: print('buzz')

Python3 with Tkinter btw

nice meme you've got there

>meme

nice meme you've got there

Receive communion my children, as I present: The Fizzbuzz of the Christ

for i in range(1,100): print("fizzbuzz"[i*i%3*4:8--i**4%5] or i)

no, unless you're intentionally going against the standard language/project way of reporting errors. That's a pretty typical way of reporting errors in languages like C.

see

for i = 1; i

see

second should have been columnconfigure

I think I want to write a bittorrent tracker but, I only know python and my implementation would be slow as ass because python.
Should I learn C first or what?

don't call us, we'll call you

Redpill me on Google Amp, /dpt/

you missed the joke
>meme robot
i impersonated the meme robot specifically to reply to you
ask and ye shall receive

Does this whet your appetite any?

#include
#include

int main(int whatever, char **fuck_you) {
for (unsigned int i = 1; i

I'm still missing it

i'm not saying your code wasn't tryhard enough, i'm saying you're an idiot and it doesn't even pass the eyeball test to be a functioning fizzbuzz program

Someone must really like rust.

I'm not the Python poster.

void set_int(int* var, int val) {
while (*var > val) ++*var;
while (*var < val) --*var;
}

hey man rust is a fun game

nah you just came across like an aspie, and people knew that answering that way would make you lose your nut. see the similar poll i made minutes before you made yours with the opposite results
strawpoll.me/13008435/r

Write your own Sin and Cos in the language of your choice

do it in python first retard. If you cant do it in python there is no way you will do it in C.

prove it

r8 me fizzpuczy
int[2] euclidean(int x,int y)
{
int q = 1;
loop:
int r = y - x*q;
if(r > x)
{
q = q + euclidean(x,r)[0];
goto loop;
}
else
{
return {q,r};
}
}

int truncate(int x)
{
int n = 1;
while(euclidean(x,n*10)[0] > n*10)
{
n++;
}
return x - euclidean(x,n*10)[1]
}

int coprime(int x, int y)
{
if(x < y)
{
int r = euclidean(y,x)[1];
coprime(x,r);
}
if(x == 1 || y == 1)
{
return 1;
}
else
{
return 0;
}
}

void fizzbuzz(int x)
{
double pi = 4.0 * atan(1.0);
int n = truncate((int) (pi * 10)) / 10;
double sum = 0.0;
for(int s=1;s

isometric voxel engine, every pixel on screen is 1 voxel. everything is inter-sectional and has full 3d geometry, dynamic normal/depth mapping and a tool to take 2d pixel art and turn it into 3d voxel geometry

just trying to get some motivation to write a physics engine for it, and see if i can render at 1920x1080 without many issues. currently rendering at 960x540 and scaling by 2 due to render/data limits

Its the convention on c, although some libraries will have the error code as one of the parameters passed as pointer. The opencl standard api does it both ways.

fizzword = fn
(0, 0, _) -> "FizzBuzz"
(0, _, _) -> "Fizz"
(_, 0, _) -> "Buzz"
(_, _, n) -> n
end

fizzbuzz = fn (n) ->
fizzword.(rem(n, 3), rem(n, 5), n)
end

IO.inspect Enum.map(1..100, fizzbuzz)

Sounds like reasonable advice.
Thanks, user.

Anm I a Pointer?

>with the opposite results

Just going through with the Theano logistic regression tutorial

Did you learn anything useful? Or are you another one of those "I want to learn ML because it's the hottest new fad" fucking tryhards?

thank-you desu

Assuming Python3...
print("hello", end="")

I want this only in Malbolge.

No, Theano is so much more than ML, been thinking of writing a NLP optimizer later

Is Google basically an overhyped and overblown ad network? Everyone is talking about how hard it is to get a job here, but what do those geniuses actually do? They couldn't even make a new modern language for their OS, JetBrains made it

Wave, Glass, +, Go, Dart etc. Everything turns out to be a shite, yet google is still rich af, what kind of jewery is that?

well at-least their phone battery is charged, i was prepared to give an autistic REEEEEEE

>No pronouns
Nah, you've got pronouns. I'm not talking to you like I'm a cat monster from fucking oblivion

Nice little things about Rust: easy handling of endianness built-in with from_be, to_be, from_le, and to_le methods on integral types. These get inlined, so it's effectively equivalent to a bswap or nop operator in the language.

Don't forget the absolute most important and useful thing about them, and their defining feature: you can type in almost anything on their website and get like at least 60% of all the times anyone has ever brought that thing up.

Is there a word for inability to complete a project?

Is this the fizzbuzz thread?

for n in {1..100}; do
fb=
(( n % 3 )) || fb=fizz
(( n % 5 )) || fb=${fb}buzz
echo ${fb:-$n}
done

Why would endian matter? Just do stuff how Plan 9 does it.

It's very important when dealing with networking or any binary files in general.

>Project leader fell for the rust meme

I go to American University and let my tell you that this doesn't surprise me. This campus is filled with so many entitled piece of shits that want their safe space.

cucked

kek

Host byte order and network byte order may (note: almost always) differ.

never programmed before. what do?

continue not programming

what if i want 2 start pr0gramming?

23 btw

then start programming

>meme

how

...

start by opening your text editor

Read a book

Download a book
Read it

Anybody has experience with ENet? I am trying to decypher what ChannelLimit means here, but the only pieces of information I have are:

>size_t ENetHost::channelLimit
>maximum number of channels allowed for connected peers

>channelLimit the maximum number of channels allowed; if 0, then this is equivalent to >ENET_PROTOCOL_MAXIMUM_CHANNEL_COUNT

I am trying to port the old Cube Engine code base to the newest libraries for fun, but this documentation is not helping.
The old definition of the function enet_host_create did not have the channelLimit parameter.
enet.bespin.org/group__host.html#ga5567a95d7a45521dc9cba93a9066c940

Good luck :)

Tabs > spaces.

ddili.org/ders/d.en/

Camel case was a mistake underscores are superior

muh keystrokes

Study Machine Learning. If you cannot understand Machine Learning, then you are not cut out to be a programmer.

>muh

just paid $77 i don't have for an arduino started kit and a separate book on arduino

my stomach is literally growling as i type this, my internship money doesn't come in until june

>Machine """Learning"""