/dpt/ - Daily Python Thread

What are you working on, /dpt/?

Previous thread:

Other urls found in this thread:

reddit.com/r/funny/comments/1beuyw/for_april_fools_day_i_decided_to_replace_hand/
tour.dlang.org/
wiki.dlang.org/Books
dlang.org/blog/2017/04/28/automem-hands-free-raii-for-d/
wiki.dlang.org/Libraries_and_Frameworks#Alternative_standard_libraries_.2F_runtimes
wiki.debian.org/FPGA/
twitter.com/NSFWRedditGif

nth for reimplementing pascal in WASM

Second for Go

Linking my post from the dead thread.

Fuck yourself

I'm learning Scala and I'm trying to find a more funcional way to program these if statements,where I store auxiliar vars to make a final division, is there a better way?
var sum: Double = matrix(col)(row)
var div: Double = 1
if (matrix.isDefinedAt(col-1)) {
sum = sum + matrix(col-1)(row)
div = div + 1
}
if (matrix(col).isDefinedAt(row-1)) {
sum = sum + data(col)(row-1)
div = div + 1
}
round(sum/div)
}

Rust has the potential to be a C++ killer in many domains where C++ is currently king, but whether it will achieve this is not yet certain

C++ will die anyways, it's too bloated

you're going to have to bait harder than that

>Rust has the potential to be a C++ killer
not in its current state.
It needs a syntax re-write.

Syntax is fine once you actually get used to it

>Syntax is fine
let ch = text.chars().nth(0).unwrap();

in rust if you pass a reference to an assignable object through a pipe to another thread and then try to use this reference yourself the program won't compile. how do rustfags defend this?

Sleep well, snek.

I'm playing with SDR#, seeing if I can read my electric meter remotely. Still in the feasibility stage. But then it'd be Arduino n' shit.

Yes, and?

The compiler is saving you from making terrible mistakes

Afraid of declarative programming?

why doesn't it tell me that instead of just not compiling?

im sure glad i dropped c++ to go to c++ with a gimmick

Why does Rust still not have a description of its memory model

Declarative programming is not a gimmick. It's an Art.

Just started learning Python (3 months in) at uni, doing science & data analysis stuff.

Wanna do a more fun project over the mid-year break as practice. Is something like a simple inventory manager for our tabletop RPG too ambitious?

>thinking rust's problem is declarative programming

you're a dumb physics major probably

Close, biology major actually. So even more dumb

how simple are you thinking?
what would it do that an excel sheet wouldnt do by itself

are you implying science and data aren't fun

CS faggots are mostly physics rejects

>python
Nope. Fuck this thread. I'll wait for the next one.

>waiting for a python thread to not be a python thread
? ? ?

A Rust program's memory consists of a static set of items and a heap. Immutable portions of the heap may be safely shared between threads, mutable portions may not be safely shared, but several mechanisms for effectively-safe sharing of mutable values, built on unsafe code but enforcing a safe locking discipline, exist in the standard library.

Allocations in the stack consist of variables, and allocations in the heap consist of boxes.
The items of a program are those functions, modules and types that have their value calculated at compile-time and stored uniquely in the memory image of the rust process. Items are neither dynamically allocated nor freed.

The heap is a general term that describes boxes. The lifetime of an allocation in the heap depends on the lifetime of the box values pointing to it. Since box values may themselves be passed in and out of frames, or stored in the heap, heap allocations may outlive the frame they are allocated within. An allocation in the heap is guaranteed to reside at a single location in the heap for the whole lifetime of the allocation - it will never be relocated as a result of moving a box value.When a stack frame is exited, its local allocations are all released, and its references to boxes are dropped.A variable is a component of a stack frame, either a named function parameter, an anonymous temporary, or a named local variable.

A local variable (or stack-local allocation) holds a value directly, allocated within the stack's memory. The value is a part of the stack frame.

The aim is to get better at python outside of pandas/numpy/matplotlib, which I use a lot in school. Which, for what it's worth, is pretty interesting.

decide on exactly how much functionality you want your program to have before you try making anything first

>CS faggots are mostly physics rejects
[citation needed]

LOL at EEs and physicists who carp about my job title, Senior Software Engineer.

"You're not an engineer!"

No, and you're not a [good] programmer. But guess what? I earn just as much as you, and using the degree I actually studied to get.

god damn you got triggered over something really small

In my uni, EE and Physics require the most grade point average. CS are literally mediocre students that are just a little bit better than IT.

EE and ME People laugh at CS

TRIGGERED

>Software """engineer"""

you're not going to win this argument. cs students are lowly regarded everywhere

>code artisans REEing over actual engineers calling them out
wwwwwwwwwwwwwwww

>Actually replying to baits

Explain why equivalent algebraic expressions may lead to different answers. Can you devise an interval-arithmetic package that does not have this shortcoming, or is this impossible?

Found the CS faggot.
Even CE folks laugh at you.

ITT: Programs in your language which can't be shorter in other languages.

I want to fuck her.

Shorter doesn't mean better. Readability counts as well

she wants to fuck you

If you want to post your haskell code just do it.

Physics niggers are maths rejects.

CE is essentially EE with some software shit thrown in, so I'd assume so

>god damn you got triggered over something really small
>TRIGGERED
Not triggered, I'vejust never heard that as GPA approaches 2.0, a physics major switches to CS. I *have* heard that applied to EEs and hotel and restaurant management.

>you're not going to win this argument. cs students are lowly regarded everywhere
I'm not arguing anything. I've just never heard of physic majors going into CS. I would imagine EE would be their easy degree.

>SE = CS
no

That means CS niggers are math reject rejects

im a month into learning it and I am so fucking bored. I really want to just code something that will actually be productive instead of just studying classes and data types. I bet the real projects hardly use simple shit like that.

>Electrical Engineer

Show us your license.

...

>Even CE folks laugh at you.
And I care because...?

>And I care because...?
I have no idea dude you tell us
You're the one getting triggered as fuck rushing to defend yourself over nothing

>>SE = CS
>no
Software Engineer = job title
Computer Science = degree
job title != degree

Java master race

It's not healthy to get triggered like this, user

Yeah this. CE reporting. We are WE until second semester junior. They take semiconductor and power electronics classes. We take communication theory and FPGA programming classes.

this is actually the worst language comparison meme i've seen yet

reddit.com/r/funny/comments/1beuyw/for_april_fools_day_i_decided_to_replace_hand/
>top voted comment
>THIS is why office shootings happen...
ahahaha reddit being based for once. fucking april fools pranksters

CE is much more limited than EE

>defend yourself over nothing
I have never heard of physic majors going into CS, that's all.

Post an insightful reply, and it dies. Post a personal observation and the crowd looses their collective shit. This is fun!

makes sense, it came from the installgentoo wiki

you have 30 seconds to explain why ruby is not the ideal language for 2d game development where the performance requirements are minimal and on the contrary the difficulty of the task is mainly about the art, area design, gameplay design, and story

GO

CS != SE
If you don't know that you either got a degree from a shitty uni or you got the wrong job.

same. ours is like a mix of cs and ee until 3rd year

>He uses 3rd party handwash

You're not being mommy's good boy.
No chicken tendies!

WE?

>FPGA programming classes
Sounds cool, wish we did the same in CS.

>it's the first image at the top of the page for the programming languages page
christ

He is right. It should be legal to kill people like that.


This, he was asking for it.

>We are WE until
>until
>implying you are not always YOU

Ruby is being shilled too much lately.
Post some example code to highlight how great it is.

>CS != SE
>If you don't know that you either got a degree from a shitty uni or you got the wrong job.
Are you disagreeing with the statement that CS!=SE? Can't tell from your shitty response.

>the performance requirements are minimal
t. never gone beyond a prototype

No

{SE}⊆{CS}

Political correctness is almost always wrong. You have your right to say anything so long as it does not promote violence.

Are you being retarded on purpose?

Why are people trying to play the "King of the castle" when ignoring the only real computer degree, CE?

CS ∪ (CS ∩ SE) ≈ CS

Why do people think you need a degree at all to program, /dpt/?

Today fucking captchas are pissing me off. Every square contains the object to be identified.

Beats me, tbqh

EE, dumb phoneposter here.

FPGA programming is honestly the hardest shit I've ever encountered.

Post-purchase rationalization

Kek

Yeah, okay, you are being retarded. Carry on.

>Every square contains the object to be identified.
Bruh scroll up and enable legacy captcha in the settings
captcha: serrans lease

Threadly reminder that dlang-chan has RAII; she's quite fast in execution and compilation; she's becoming fully memory-safe; and she's super duper cute! Say something nice about her, /dpt/!

>Tour
tour.dlang.org/
>Books
wiki.dlang.org/Books
>GC
dlang.org/blog/2017/04/28/automem-hands-free-raii-for-d/
wiki.dlang.org/Libraries_and_Frameworks#Alternative_standard_libraries_.2F_runtimes

The only thing that stops me from having fun with fpgas is this wiki.debian.org/FPGA/

>tfw getting payed to go to school

>enable legacy captcha
I do worse with those. T_T

Don't reply to it

I opened the picture hopping that she was lain. I am disappointed.

paid

Don't talk to yourself.

It's not that format strings are a bad optional feature it's that they mix code and data in an unfortunate way.
Solves trivial problems usually.
All that's required for them to be good is for there to be a string unpack method (hopefully at compile time where possible) which extracts the different arguments to their correct place.
But that's a messy system in realistic situations frankly.

I don't like features that help the easy problems. Clutters the languages a lot. Addressing the hard problems in a language is much more important. It could be done in string processing but I haven't come up with a good solution. Because hard problems are hard. Things like adjusting for internationalization is usually done through full string replacement. Which sets additional requirements on your font rendering and size adjustments. It works. But I wouldn't describe it as ideal.

Please don't post 3DPD cosplaying as Lain. It's a disservice to the queen of Sup Forums.