/dpt/ - Daily Programming Thread

What are you working on, Jow Forums?

Previous thread:

Attached: 1534821778527.png (1200x1400, 502K)

Other urls found in this thread:

en.wikipedia.org/wiki/Tony_Hoare#Apologies_and_retractions
twitter.com/SFWRedditVideos

Don't forget the elegant explicit error handling

Attached: goper brainlet.png (185x272, 6K)

based op

Holy shit why is reading files in C so complicated, I just want to run through a txt files of prime numbers and check if the number I want is in there or not but this makes no sense.

explicit error handling is a good thing, faggot.

what's bad is that go lacks sum types.

post your library

Anons utter brainlet here who's just starting out. Can anyone explain to me how lines 3 & 4 will change the algorithm's running time (if it does change it) if j = i & k = j.
total = 0
for i = 1 to n
for j = i to n
for k = j to n
total = total + ai x bj x ck


Or when :

total = 0
for i = 1 to n
if ai >= 0 then
for j = i to n
if aj >= 0 then
for k = j to n
if ak >= 0 then
total = total + ai x bj x ck

Because C is very low level and is very old.

Right now I'm myself learning a bunch of "how to do basic tasks in C" and what you're describing is very simple.
A week ago I would have said "C is trash, that's why" but now took a bit of time to learn the basics and it's not so bad.

Are you counting lines from 0 or 1

lol no generics

count how many times each loop will run given a single value, say 10.

Only if you promise to no bully it.

Attached: 1525815827123.png (615x597, 301K)

Lol no derived types
Lol boost and stl
Lol overloading the constructor with heap allocated objects

everything is hard if you are retarded

Doing a 2D game in SDL.

I currently have a bouncing square.

Any good ebooks on the topic? I like to read up theory while I'm not at my PC.

>OP
Butthurt OOPsie edition, evidently

>OOPsie
no bully go on

Fair.

>OOPsie tears everywhere

Post yfw Java is syntactic sugar for C; Java is literally compiled to C so Java tards are using the language they hate
Post yfw monads are objects, so functards are using OOP and they don't even realize it
Post yfw Haskell was made for looking at and studying, not for programming

Also, post your programming redpills

Java is compiled to JVM bytecode and then may be JIT-compiled to machine code. At no point is it compiled to C.

Using monads is not OOP. Claiming that it is betrays a fundamental misunderstanding.

It seems that no matter how much you study, you will never learn.

I don't think I'm an OOPsie c# was my first language though.

Hash crack 2.0 sitting on top

Attached: Untitled.jpg (1920x1080, 404K)

As much as I welcome it, where's all this shilling against Go coming from?

throw the milo book out and you're good

>Java is literally compiled to C

Attached: 1507625364203.png (625x626, 55K)

b-but it's signed..

Attached: 1158591859984489.jpg (1191x670, 84K)

that makes it so much worse.
i know this is Jow Forums and all, but still.

>programming redpills
C is better for making tiny programs which need to be fast
OOP-langs are better for making large-scale programs which require a lot of maintenance.
C++ tries to be both like C and any other OOP-lang but is cumbersome to use effectively and makes abstractions difficult to get used to.
Python is an excellent scripting language that can be effectively used to make useful software, like youtube-dl.
"Studying" programming or computer science without an understanding of algorithms, standardisation and maintenance and at least a few good languages will make you no better at creating software than Rajesh "Copies JS from StackOverflow" Pajeet

the same place it's always come from: rust fanboys

:c

Does me having dinner with Lauren Southern and Stefan Molyneux last month when they came to Australia make it better or worse?

Attached: 1524085145704.jpg (1200x675, 82K)

>actually being an unironic kekistan alt-rightist

Attached: h12ey60yhfh11.jpg (960x934, 120K)

...

saved

Lacking (parametric) polymorphism is a big deal
Maki is prime Jow Forums material

Better but not in a good way

Attached: 3063.png (386x444, 67K)

>Maki is prime Jow Forums material
Idc take your gaymer memes to or

>t. nigga that came here after the election

This is also true.

I don't see why Rust and Go are always compared to each other. They don't share a domain, the only reason to mention them in the same sentence is that they both exist on opposite ends of the complexity spectrum.

>she doesn't know that ironic gaymer memes are anti-reddit and anti-/v/


Ps. nice trips

Newfag

Attached: Calculus of Maki Constructions.png (452x355, 312K)

On C its absolute trash. ifstream and ofstream objects on C++ makes it easier though. One thing that might come handy is that MS Excel recognizes .txt with columns separated by tabs.

I'm a pro-Israel Jew ex nurse bi sexual cross dresser who had my model ex gf spend 2 hours doing makeup so I could eat dinner with Lauren while cosplaying as Lauren.

Also I was charged last week for beating the shit out of a 200lb Rugby player. I would post a picture of me with Lauren looking like Lauren but my phone got smashed in the fight and these two pictures are the only pictures out of thousands that I still have. I showed the phone shop my phone earlier today and they said once my new one arrives they will be able to transfer all my data over so I'm not going to lose all my pictures.

I think I posted here yesterday with my charge sheet didn't I? If I had lost all my pictures I would have cried for weeks.

Anyway. So. Uhm. Are you sure I'm alt-right?

>inb4 b&

Attached: yupyup.png (651x664, 771K)

are all those brainlets in /dpt/ doing trivial novice shit in C the same people as 3 years ago or do you guys just keep tricking newfags into learning that garbage?

>Australian
>ex-nurse

Hahaha laughing at small penises hahaha
YOU MUST PAY

>stop doing what you like doing, do what i like doing
n.. no, user.

>not anime op
trash

Attached: 1532552347927-vr.jpg (9999x9999, 1.73M)

Dumb animeposter

"I call it my billion-dollar mistake. It was the invention of the null reference in 1965. At that time, I was designing the first comprehensive type system for references in an object oriented language (ALGOL W). My goal was to ensure that all use of references should be absolutely safe, with checking performed automatically by the compiler. But I couldn't resist the temptation to put in a null reference, simply because it was so easy to implement. This has led to innumerable errors, vulnerabilities, and system crashes, which have probably caused a billion dollars of pain and damage in the last forty years." - en.wikipedia.org/wiki/Tony_Hoare#Apologies_and_retractions

>pic
that is someone's son

Attached: 1530231470533.png (399x322, 42K)

So are you and you're an even bigger disappointment.

I'm building a clock. It kind of works now. Not perfect.
I maybe need to implement a PID controller for my clock. Only got super simple error correction right now.

Attached: itjustworks.webm (1280x720, 427K)

I have no idea what's going on, but it looks cool

Shhhh.

I spent 2 grand to eat dinner with Lauren and Stefan my father is extremely proud of what I've accomplished especially when you consider I dropped out of school at age 11.

Attached: 1528412190954.jpg (750x1000, 93K)

Does anyone has a study guide for computer science with online courses? The one I found is really outdated with most links being dead.
I can't post it because Jow Forums accuses it as spam.

The guy is an idiot. Null is a convenient value to use for indicating "this is a bad pointer".

Imagine if someone said "my billion dollar mistake was ending strings with \0"

He did a speech on it, and I though he was going to mean void pointers, but no, he literally means using null as a pointer value is a problem somehow.

I'm so much smarter than any of you faggots that it isn't even funny lmao

Attached: 1528100525629.jpg (258x360, 29K)

found the brainlet that got his ass fucked by C's big dick

anyone know of any good programming IRC out there?

>IRC

Attached: 1532631429517.jpg (724x540, 136K)

>those fucking manly hands

eww

Attached: 1532287956677.jpg (583x572, 38K)

dumb frogposter

they're still around - #python on freenode is active

...

>I'm so much smarter than any of you faggots that it isn't even funny
>lmao
>laughing my ass off
>it isn't even funny
????
What did he mean by that?

First for helicopter rides

I don't want to ruin my ivory towers with shitty g kids

>Australia
HAHAHAH

use grep

I wish that was my son.

You should use Maybe if something can be missing/bad.

I'm trying to emigrate to Norway :(

I have Israeli and British citizenship but Britain sucks and Israel is a desert.

I want to live in a log cabin, alone, in the snow with 3 of these giant maine coon kitties.

Attached: maine-coon-cats-4__605-640x854.jpg (640x854, 97K)

Not programming related.

>I have Israeli citizenship
Unironically kys, thanks

>Israeli
can't you work for Mossad (national intelligence agency of Israel) ?

Catladies will be expelled from Britain

Please /dpt/ let's talk about programming, not crossdressing or LARPing or OOP.

Share your OOP success stories.

what are the implications of comonads for GUI development

I got rid of it once and was much happier

The costate comonad is particularly applicable in that domain, codo-notation however would take things to the next level

>collects garbage
lmao i hope you didn't need that computing time kiddo

>codo-notation however would take things to the next level
big if true

Wow, I had the same experience. Congrats user.

...

>Not programming related.
Fine, pic related is a project I've been working on for a week.

The giant steel dildo looking thing is an automatic lockpick, it can pick a deadbolt 8 tumbler with 4 security pins in less than 10 seconds. Your front door is not safe.

The raspberry pi is running ParrotOS and is hooked up to a home made electromagnetic pulse generator with a 1000KV inverter which is powered by a 9v battery and triggered through the audio in the raspberry pi.

The idea is. Pop the lock on a telecommunications hub near my house and plant the PI behind the network stack, once powered and connected it will automatically crack the WIFI network and connnect meaning I can SSH into it.

Once I SSH into it I will jack the communications hub and play with the data or try and crack admin passwords which could give me access to a 100+ Gbps network.

The microphone you see attached is used by a program I wrote which detects noise, if nose is detected it notes that. Once SSH'd I'll have access to the microphone and at any time I can play audio resulting in an electromagnetic pulse which will destroy the PI.

Am I cool enough for /dpt/?

Nty.

That would be cool but I don't want to live in a desert.

Attached: WIN_20180822_03_44_29_Pro.jpg (1920x1080, 332K)

What is man supposed to use when here's just no good statically typed and compiled language?
>sml
no good implementaion
>ocaml
sml with shitty syntax, also does not support native threads
>lisp
not even statically typed, pretty much locking yourself to one implementation
>c
decent but manual memory management is annoying in prototyping phase
>sepples
cluster fuck that no sane person would touch
>d
can't decide if it wants to have gc or no
>rust
better stay away from it because it attract lot of crazy hipsters, also uglier than sepples
>any jvm/clr lang
requires huge vm
>go
Rob Pike is faggot, also no macros
>haskell
generates garbage 1GB/s
>chapel
cannot use libraries that was compiled with it...
>ats
Jesus Christ
fun{
a:t@ype
} list_length
{n:nat} ..

Please /dpt/ let's talk about programming, not crossdressing or LARPing or OOP.

>C
>Decent
lmao

Idris

>decent but manual memory management is annoying in prototyping phase
or well you could just leak in your prototypes

>generates garbage 1GB/s
Only if you suck at writing it. Perhaps you should stick with C

>I don't see why Rust and Go are always compared to each other.
They're both intended to replace C++. The go people routinely call go a "systems language", and they've done some good work making the GC not suck.

Do you even interfaces?

>GC
>systems language
Pick one.

>interfaces are parametric polymorphism
>interfaces are sum types

Attached: brainlet.png (645x729, 56K)

Interfaces are less useful than parametric polymorphism.

>Pick one.
I'll see your snark and raise you a docker

80% of the way there and a simple implementation.

Rolling for fun. Also, leetcode has lots of fun exercises that are a little more advanced / abstract than these if anyone needs something to do.

Attached: challenges.png (3840x2160, 1.07M)

interfaces without any kind of parametric polymorphism are pretty fucking worthless 2tbhq desu with you fampaitachi ne

Attached: #.gif (540x304, 2.37M)

I'm looking for a perfect coding environment. The language per se doesn't matter as long as the combination of language+environment shows some features:

1. "Mainstream" editor with modern UI. Nope, I don't want to be stuck with ancient Emacs/Vim. Don't get me wrong, I use Vim every day and I like it in some special use-cases, but I'm not willing to use it as my main tool.

2. All the "standard" editor features like "go to definition", "replace symbol", "find occurrences" etc.

3. Easy execution of the file contents. Per-file basis, per-line basis, per-expression basis — anything is acceptable. I don't want to open terminal and enter "$INTERPRETER_COMMAND $PATH_TO_FILE", I just want to evaluate what I have in the current window and see the result.

4. Pleasant for testing. It should at least show green/red test indicators, show test failure messages and give a clickable link that takes me to the failed test.

5. Support for generative testing. Yes, I've already told about tests, but I've seen environments where everything breaks as soon as you introduce some property-based tests — e.g. VSCode+jest, Cursive+defspec — so I have to put it as a separate point.

6. It shouldn't break 10 times per day. It's hard to be productive in an unstable environment.

Is there anything that fits the bill?

Attached: vscode_inline.gif (594x366, 54K)

>docker
Nope