/dpt/ - Daily Programming Thread

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

Attached: DPG.png (180x193, 39K)

Other urls found in this thread:

unix.stackexchange.com/a/6302
nim-lang.org/docs/db_sqlite.html#open,string,string,string,string
youtube.com/watch?v=0yXwnk8Cr0c
youtube.com/watch?v=Gv2I7qTux7g
github.com/BemusedGod/yuki
twitter.com/SFWRedditImages

I love Ada and no one will ever stop me.

Rust for retro-hipster boomers

You're all larpers. Every real programmer indents his code.

Attached: C0B131F4-A2A2-4989-9216-00C24B42877D.jpg (750x236, 28K)

I don't think so. It provides a lovely strong typing system and the syntax is more friendly for english rather than symbol hell.

Attached: 1530991338510.png (680x521, 94K)

post yer code

Attached: lol.png (920x820, 209K)

you are a tree in a forest, standing up and saying "damnit! Isn't anyone else here a tree???"

i indent when indentation is necessary to improve readability
sometimes it isn't
sometimes it is
python is gay

Im playing with the color components of the pixels to store archives in png files.
Testing if Jow Forums don't fuck with the alpha channel.

Attached: alphastore name:archive2.tar size:2784768bytes.png (950x1000, 2.64M)

>C
cringe

is nim ever going to not be shit
will crystal ever get a windows port/non hacky parallelism

Ada and Rust are really not all that much in common. Ada allows for memory management like C. It doesn't let you do everything like C but it's a lot more freedom than Rust. Aside from the safety checks and maybe the type system Ada and Rust do for like arrays and shit I don't think they are alike at all.

nim's alright. what's your criteria for it not being shit?
an oddity of Ada is that it's much more normal for callers to provide the memory that a callee wants to use, so lots of instances of dynamic allocation just don't happen.

why don't other books try to make you feel like a wizard like SICP? it makes learning feel fun to think that I'm a wizard

How hard is to make some program that polls some process' RAM?

How do you guys get motivation in between your day jobs? I write garbage enterprise code all day long, and want to work on my side gig but its such a fucking drag man

Attached: tired2.png (1022x731, 643K)

I prefer the Little Schemer model desu. Constantly asking questions and you can answer them or read the immediate answer, and you're done with the book and have learned something. no need to play dressup and pretend.
trivial on Linux if you work with procfs.

I don't.
the only programming I've done outside of work in the last 2 years was one short script I wrote to buy a 3900x off newegg

trivial in a good os
unix.stackexchange.com/a/6302

it's not so bad in windows either
just call ReadProcessMemory after you do OpenProcessToken and AdjustTokenPrivileges

not portable

you can't do it in a portable way

funny meme, but portability is not relevant here
even if reading the memory were portable, you'd still have to write platform specific code to make use of the data you've read

I work as a brick layer and do programming as a hobby. Works out well.

Attached: 1529337671886.jpg (923x713, 62K)

I don't need something portable.

JavaSysMon monitor = new JavaSysMon();
for (ProcessInfo p : monitor.getProcessTable() {
print(String.format("%s is using %s memory", p.getPId(), p.getBytes()));
}

not portable, it does literally the same as , you just hid it behind an abstraction

based
i saw a position for a bricklayer but there was some sort of acronym qualification required, seemed kinda crazy

fuck off dumb frogposter

I'm working through Emacs' Lisp manual and it looks so repetitive to type the entire list to modify it. I tryd using setq but a list defined that way can't be modified with car, cdr ect.
Is their a micro for lists or Im I look for something I dont need?

Attached: __hakurei_reimu_and_yakumo_yukari_touhou_drawn_by_amachi_osamu__406a24e835330b7c7990babb9f52f521.png (256x256, 34K)

Post the piece of code that first impressed you.

kys retarded frogposter

>it looks so repetitive to type the entire list to modify it.
what do you mean?

>their a micro

print(You)

i find its best to mix your work and hobbies. if you put in 40 hours as a soulless wageslave cube drone, best idea is to have a hobby that involves creative physical labor and vice versa

10 PRINT "what is your name?"
20 INPUT "", a$
30 PRINT a$; " sucks!"
40 END

+[-[-.---.>..>..>.

probably not the first but stuck with me the longest.
fibs = 0 : 1 : zipWith (+) fibs (tail fibs)

Interested in learning fhsarp, anyone knows the way to go to learn fsharp and functional programming?

fsharpforfunandprofit seems kids of messy

start with the f# tutorial, there's one as a template in visual studio, then go to the fsharp stuff on the microsoft website, THEN look at fsharpforfunandprofit

>tfw I'll probably be an old man by the time we migrate to java10 and get access to type inference
It's not fair, how can I keep writing FizzBuzzImplFactoryBuilderAsyncRequestType when I could be writing var?

user I hope you dont type all that out
just type the first few characters then tab complete the rest
or do what I do and leave the type out then hit alt enter and my ide will insert the type automatically

I want to make a paint program that can create, edit and save jpgs but i'm unsure about what language to use, a friend suggested c# + windows forms, but well, i honestly want to hear you guys opinion.

Come on, Anone... How is that you are still not finished with learning JavaScript? We should have been working on that project by now...

Attached: c04d6a3262f32286dc66616d511f99dc.jpg (684x1024, 133K)

I'm testing a private connection and server I'm implementing.
I'm transmitting from the server to "255.255.255.255" which transmits to all listeners. I'm able to receive the packets through wireshark (image on the left). However, when I try to receive packets using python's sockets, the call to "recv" hangs (image on the right).

Is there a reason for this?

Attached: Screen Shot 2019-08-13 at 1.50.28 PM.png (3070x328, 231K)

right click desktop, click create shortcut for the path type in paint.exe done

Start by finding a library, then choose the language which the library has bindings for and you are most comfortable with or most interested in learning.

no idea. I'd start digging by putting that python in a script and strace'ing the script.

I want to write a markdown2html program. How hard would it be? Can tools such as flex and bison help me here?

Attached: 1565437466999.jpg (1242x1252, 1.05M)

this is the kind of programming I like the most

piss easy, just use the language itself, don't bother with flex/bison

You're using the TCP API with an UDP socket.

Just write your own lexer and parser, it's a fun exercise.

With regexes you got half of the job already done.

dumdum question
Im writing a webapp that uses sqlite. Should i open/close the db every time i use it or leave it open all the time?

Attached: swap.png (943x845, 1.21M)

The stack trace only mentions the call to recv.
Hm... Interesting. From the small amount of searching I've done, the UDP version of recv is "recvfrom". When I tested it there wasn't really a difference in the behavior (it still hangs). Am I missing something?

Attached: Screen Shot 2019-08-13 at 2.18.13 PM.png (1398x1008, 186K)

That's a server though, you just swapped a client for a server, what in the fuck are you doing?

what do you mean "open?"
the typical solution is to have a set of connections, say 10 connections in a pool that are constantly open. when a thread needs a connection from the pool, it will ask for one, blocking until one is available. when it is done, it will release the connection back into the pool.

a more simple, but less performant, solution is to open a new connection for every request and close it at the end. be sure to make sure you close the connection at the end (even if an exception is thrown) or you'll saturate your database!

Several of the tutorials I saw online had a call to "bind" when talking about UDP clients.

Besides, the alternative didn't work either.

Attached: Screen Shot 2019-08-13 at 2.24.46 PM.png (1144x932, 128K)

by open I literally mean
nim-lang.org/docs/db_sqlite.html#open,string,string,string,string

>a more simple, but less performant, solution is to open a new connection for every request and close it at the end. be sure to make sure you close the connection at the end (even if an exception is thrown) or you'll saturate your database!

This is what im doing right now. So Its probably fine then

Attached: 681.jpg (184x184, 7K)

hungarian notation is fucking trash tier
not only does it restate the obvious but it increases verbosity to the point of retardation

Is it true that programmers employed by the US Department of War only use Ada?

there is no us department of war, so your statement is vacuously true

kek

>calling it the department of "defense"

It makes sense in large codebases with gorillion of not so obvious datatypes like winapi

Attached: hy8hye5ftxq01.jpg (540x403, 34K)

Redpill me hardcore on Swift, it looks pretty neat from afar

The most powerful programming language is Lisp. If you don't know Lisp (or its variant, Scheme), you don't know what it means for a programming language to be powerful and elegant. Once you learn Lisp, you will see what is lacking in most other languages.

No. The DoD asked for the creation of Ada to standardized all the languages they were using. In the end some projects went to Ada, some didn't. Now a days the DoD contracts out anyway and Boeing and Lockheed both have switched to SEPPLES.

youtube.com/watch?v=0yXwnk8Cr0c This guy explains it pretty well and was involved heavily with Ada.

These days I bet it's more used over in Europe than the US, but who knows since it's 99% proprietary secret shit you'll never know anyway.

Brit nyomiktól pedig elvették.

lol you got so mad you saved my post thanks m8
this is the ultimate (you)

10 print "8-bit guy"
20 goto 10

>she is programming in lang without ISO standard
shame tbhq

Making a roguelike,
anyone have some nice
colors and bitmap fonts to share?

Attached: rogue.png (635x150, 8K)

Attached: FF48C30E-1AAD-4458-872E-57B817F5F3AD.jpg (349x642, 52K)

>Making extensive use of recent language features to annoy your boomer project leader

Attached: Devilish_4a1cb5_6238404.jpg (470x595, 81K)

>MindGeek's system has faced criticism for the possibility that this information could be processed and mined for other purposes
szep jovo

>thinking the boomer cares about the project or you

Attached: 1565733167980s.jpg (98x125, 6K)

Thanks, I'll work on it as soon as I finish one more project (very short one desu). I'll use lex and bison btw, I want to get familiar with them.

oh stop you're flattering me

>learning about z/OS while working on one with challenges
>DB2 breaks on me
>end up having to dig up ancient history to figure out what to do to fix it
god damnit

Attached: why the fuck.jpg (1280x720, 51K)

dont think prefixing everything with lpsz helps in an age where you have IDEs that can display type information just fine

no one?

Why doesn't someone just make a C with inferred typing and templates? Having to rely on void* is dumb and should've died in the 70s.

try

It's called Zig. Here's a recent video on it: youtube.com/watch?v=Gv2I7qTux7g
andrew's changed stories from "Rust is too hard for me" to "oh yeah I love Rust it's a solid competitor ha ha stop asking me about it"

i thought you guys were big on bitmap programming fonts

Attached: standfordbunny.png (1464x777, 296K)

Can you stop shilling Zig on here. No one cares about that shitty language.

it's called Haskell

I'm not shilling it. People have asked about it, without knowing its name. You want a shill, look at

when I was on Linux i would use the font Yuki and Tewi

check it out

stop shilling Rust nobody cares about that shitty language

Kill yourself Andrew. No one cares about Zig or Rust here. Fuck offf already. Your language is shit and going nowhere.

is that wolfram

here's the link for one of them

github.com/BemusedGod/yuki

Attached: haskell.png (440x444, 10K)

>No one cares
People obviously care about Haskell. You can't ask a stupid question about it without getting the same answer a dozen times. Does that make Haskell an answer to
THE FUCKING QUESTION
? No it doesn't. But Zig is actually what he asked for. Take the stick out of your ass and choke on it instead.

what's the best book for learning javascript if you're new to programming?

Fuck off andrew.

It looks very nice but I have no idea what to do with bdf files