/dpt/ - Daily Programming Thread

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

Attached: 1566771131326.png (1000x1143, 1.16M)

Other urls found in this thread:

chibialiens.com/8086/
deadlockempire.github.io/
aop.cs.cornell.edu/index.html
cs.cmu.edu/~15210/pasl.html
twitter.com/SFWRedditImages

A propositional logic solver in Haskell in order to learn Haskell.

First time I have worked on a website in over a decade (first as hobbyist now a desperate wagie trying to market his skills). I found django extremely easy to use and extremely well documented. I find javascript to be an absolute dumpsterfire that I am having a hard time motivating myself to learn at all, since there seems to be no clear measure of proficiency. It seems like a bottomless pit for your time.

>What are you working on, Jow Forums?
trying to think of a project, preferably a simple one
gonna try that Interception interface from the previous thread, I gotta try faking keyboard inputs
need something to do so I can practice c++ too

>>>wdg

Your favourite language was written in C

Attached: 1446439298699.png (500x400, 4K)

*C++

Name 1

Does dependent typing allow you to enforce typeclass laws such as id x = x?

how to learn to code drivers and kernels?
know some C and currently reading advandced linux programming, read that it was a necessary step to get into low level programming

All major C compilers are written in C++

Does anyone know any guides for 8086 assembly? I'm stuck on the part of getting an assembler and a linker.
Do I need DOSBox for this? Are there any alternatives?

Sure.

chibialiens.com/8086/

lmao this site design, love it

Java

Attached: young-intelligent-indian-man-walking-on-street-in-slow-motion_4emxioxcx__F0000.png (1920x1080, 1.97M)

Say what you will about the design, but this website is faster and less bloated than 95% of sites out there.

Sir, Based Indian Gentlemens, Sir.
>DurgaSoft, Java Master.

Nice image

bring back flash websites!

C

lol yeah I recently came across it when looking into mega drive development. I'm still in awe that it's a very recent site and not a relic from decades ago

What’s the fastest way to get a coding job? I am a complete beginner with no relevant experience.

Am I misusing mutexes on line 10/11 where I just lock and immediately unlock? I want to ensure that "first" is never printed after "second", but I don't care if "first" is printed or not.

void t1() {
pthread_mutex_lock(&mut);
go = true;
pthread_cond_signal(&cond, &mut);
pthread_mutex_unlock(&mut);

// do other stuff

go = false;
pthread_mutex_lock(&mut);
pthread_mutex_unlock(&mut);
printf("last\n");
}

void t2() {
pthread_mutex_lock(&mut);
while (!go) pthread_cond_wait(&cond, &mut);
printf("first\n");
pthread_mutex_unlock(&mut);
}

Just got a phone call. Meeting with the CEO of a small company next week.
First job after university.
I-it uses Java Spring please send help..

If it doesn't work out I'm pivoting to sysadmin..

Attached: 1561488847748.jpg (560x672, 64K)

yes.
deadlockempire.github.io/

>… in the divine language of C#.
Stopped reading right there.

I'm learning PHP and then Laravel

I love programming in C and do things with it,but I really need money and I'll learn Java this semester,so webdev it is
I failed you Jow Forums I'm sorry
And I'm rewriting an old Rust project in C in the spare time I have

This doesn't _really_ answer your question, but in those kinds of situations, you should probably use atomic_bool or atomic_flag instead.
They were introduced in C11 and are available in .

how do I convert a string (or anything larger than a single int/short) to network byte order and back?

forgot to mention that I'm using C++

finished structuring data for the log file processing challenge from previous threads but my wifi connection is dog shit on debian.
Guess I'll zpaq and upload later from home.
the general strucutre is 10/10/5 folder strucutre making up a total of 610 folders where the deepest five folders contain 100 log files each for a total of 50K log files.
the log files are basically just 2500-16000 lines of indexes 1-6 that can be replaced with the json objects (~30 bytes each) using sed later because otherwise it would result in 14 GiB instead of the current 800MB.
a test run on 50K log files sized 13.8GiB (HDD ~5K rpm) using idiomatic C# to enumerate all files, parse all lines, and write the filtered lines to output.json took 11min20sec clocktime

Is program verification a meme? Does anyone actually do that?

How do I come up with a topic for my thesis?

Attached: 1564240929208.png (621x595, 237K)

My cousin smoked some weed and came up his thesis, 102/110 was his final grade

Came up with*

I can't forgive you but it's because you use shitlangs like C not whatever you're blabbering about.

Okay now that's friggin epic

That's rich coming from a language written in sepples.

>language
>written

Attached: 1566748182244.png (120x120, 11K)

try typescript, i found it to be a very similar to C#

I have decided, Anone. I'm going to learn JavaScript, just like you! Aren't you glad?

Attached: c1e48f86fd7abfc7ccbd61f21e55dcd2.jpg (756x1008, 91K)

You can't learn Javascript, you have to born into it

Knowing C is a prerequisite to being a good programmer

Sorry daddy,but I really love being spanked

i love hiten's art but am somewhat sad he's kind of eased off H stuff and instead focused solely on his patreon pixiv and official artbook releases. nothing comes close to M.A.N.A. would like to see a direct sequel

That's a stupid meme. The language is so simple it doesn't teach you anything you wouldn't learn from other languages.

Knowing C is a prerequisite to being an annoying clown who is impossible to work with because he writes shit like return -1; and object[] params

Attached: 1560191864733.gif (360x346, 170K)

return this.toReddit();

Ikr
For my future thesis I want to write my own language that can run on bare metal,or at least on something little,like a toy OS
Still have a long way to go,I've started uni like a year ago

You are right but your premise is wrong. You don't learn C to learn programming language constructs. You use C to learn machine-level code and its generation by optimizing compilers, performance evaluation and optimization, computer arithmetic, memory organization and management, etc.

Wut?
A string is a bunch of bytes, just send them in whatever order is expected.

yeah, but I'm using wchar_t so my characters are two bytes.

So? There's sepples, Assembly, Ada, and FORTRAN, and recently Rust too.

GCC isn't. The C compiler is self-hosted.

WRONG

Prove it. Last time I checked the C compiler was in C while G++ and shit like GnuFortran was in C++.

Does someone know a good guide for learning C++? I wanna be able to write modern C++ without relying on any libraries or legacy features, but I find it hard as most resources I find show different ways for donig the same thing.

This is the best introduction but you can't find the book online, gotta buy it. Even if you could, it uses a bullshit DRM plugin to play videos.
aop.cs.cornell.edu/index.html
After that, I haven't done this one but it's on my to do list: cs.cmu.edu/~15210/pasl.html

>without relying on any libraries
what do you mean? shit like boost or do you want to avoid even the standard library?

std is fine. I wanna avoid stuff like boost or the one Bjarne wrote.

Thanks!

Only in shitlangs that don’t have good Unicode support. A string should be a bunch of code points without a specific set of bytes until an encoding is chosen. Also network byte order is meant to be big endian.

>a bunch of code points
>until an encoding is chosen

>A string should be a bunch of code points without a specific set of bytes until an encoding is chose
No, a string should be an array of bytes.
What the fuck does a code point even mean without an encoding?

'network byte order' is a meme and only really makes sense for integers.
You know what order the reciever expects the wide chars in, so just send them in that order, no need to convert anything.

>What are you working on, Jow Forums?

Attached: image.webm (1152x648, 381K)

A code point is basically just an integer representing a Unicode character. It only needs to be associated with a set of bytes at the time of encoding. Unicode isn’t utf8, 16 or 32, those are just various ways of representing a sequence of Unicode chars.

What wm is that? Can you share dotfiles

>You know what order the reciever expects the wide chars in
Only if you literally wrote the receiver yourself. Which for most things you almost certainly didn’t.

>asm
Based.

You have no idea what you're talking about.

probably unitard user's model is
1. string literals are lists of code points, not arrays of bytes
2. any strings that enter the program are decoded into lists of codepoints: you can't open a file or perform a read without choosing an encoding, so you never have arrays of bytes that you need to perform a separate 'decode' step on
3. any strings that exit the program are serialized into bytes per the required encoding
this model can... sort of work.. to an extent. It's at least not insane. It works like laziness in Haskell works: if you're willing to pay the price to do the thing properly, you get nothing for it, but it at least doesn't blow up in your face.
the obvious problem with this model is that it's massively inefficient and that it's already been tried with Perl and Python. result: production daemons that just sling bytes around will randomly die 5 years into their use because Unicode is a moving target and we have pink alligator emojis now.
Nim has the better idea. Strings are arrays of bytes but it's very easy to treat them as unicode when you want.
>unitard doesn't even understand why he's being mocked
you're starting with literals in the program. any programmer's perspective is going to start with data entering the program. That data has to be decoded first. Saying "it's code points until you decide an encoding" is completely absurd.

>What wm is that? Can you share dotfiles
bspwm

XTerm*selectToClipboard: true

! special
*.foreground: #93a1a1
*.background: #3c3b37
*.cursorColor: #93a1a1

! black
*.color0: #5f5f5f
*.color8: #828282

! red
*.color1: #d96468
*.color9: #d98f93

! green
*.color2: #a2d964
*.color10: #b8d98f

! yellow
*.color3: #d9c964
*.color11: #d9cf8f

! blue
*.color4: #64a2d9
*.color12: #8f99d9

! magenta
*.color5: #9a64d9
*.color13: #b08fd9

! cyan
*.color6: #64d9d5
*.color14: #8fd9d5

! white
*.color7: #989898
*.color15: #c5c5c5

the quick reply box is more limited than the reply form at the top of the page. when you get errors like that, or when Jow Forums is fucking up like last night, just try the top of the page.

No language stores just Unicode codepoints. A string has to be encoded for your computer to store it. Your language is just hiding the detail of what coding it uses internally. Unless your language sucks, it should provide methods to explicitly convert a string to UTF8 or UTF16

I've written lots of code that talks to various slave devices I haven't written myself.

Does anyone know a resource that explains GL shaders for brainlets? I don't need anything too complicated, I just want to draw a 3d array as a bunch of points (fluid simulation).

All I’m saying is that a character set can map to more than one encoding, unicode being a good example of this. Shitlangs will represent strings with some kind of encoding as a ‘bunch of bytes’, but it doesn’t have to be that way. Smart modern languages support an internal string representation independent of the byte-representation used by an encoding. If you don’t understand that then you’re the problem causing scripts that ‘die randomly in 5 years’ because you’re fundamentally clueless about how character data is represented.

but what if I'm running the program on a computer with another byte order?

>a character set can map to more than one encodin
And that's precisely why you want strings as just a bunch if bytes you idiot.
That way you can easily extract whatever code point you want from these N bytes.
Slap the encoding on the type system and have the compiler make sure you can't fuck up.
There, strings solved.

Jesus christ dude you have no idea what you are talking about. Unicode strings are always encoded. If you are storing each codepoint in a 4 byte value, then guess what, that string is ENCODED with UTF-32. It doesn't make sense to talk about storing code points themselves, because Unicode wasn't designed that way. Every string has to be encoded.

I'm working on a bunch of C# exercises out of a textbook.

If you're sending and recieving byte by byte it doesn't matter.
You only get into trouble if you do shit like:
memcpy(&some_int, byte_buf, sizeof(int));
If you instead construct the int by shifting and oring you've already taken care of byte ordering by following whatever protocol you're communicating with.

Rust is the antithesis of the hacker ethos
Don't write safe code
Just write code

for my sins i have to write a couple things in python for work. someone tell me how to do, on one line, the equivalent of:

someDict.copy().update(someOtherDict)

because for some reason in this god forsaken language functions with "side effects" return null

don't write safe code write provably correct code

if there's even a single person here who is capable of writing something worthwhile in Coq/Agda/Idris i'd eat my hat

1+ 1 = 4

I'm not working, I'm wasting my time looking through reviews of various stuff I want to get to improve my workplace at home.

Jow Forumsentlemen, what wireless keyboard would you recommend? Should I shell out for a mechanical one?

>>> d1={1:"one"}
>>> d2={2:"two"}
>>> d3=d1.copy()
>>> d3.update(d2.items())

>using wireless anything
geniet van kanker

I've just begun making the network part of a simple chat program I'm making for educational purposes.
When a client connects, it sends the length of its name (a LPWSTR) gotten from lstrlenW(name) so that the server knows how long the clients name is. It then sends the name itself and the server outputs " has connected from " like it should.
This all works just fine when server and client is on the same computer, but when I moved the .exe over to another computer and tried to connect, the server outputted " has connected from ".
I think the name problem might be related to byte order, but I have no idea why the server says the client has connected from the server IP.

>on one line

>wireless keyboard
rm -rf (You)

it needs more research, particularly in proof generation for "obvious" facts. There's been some success in automating proofs that are truly just a matter of applying rewrites but anything more complicated than that will still trip up the system.

Also more libraries so you don't find yourself having to prove properties of hashmaps

why

Why? It's a requirement for good functional programmers to know how to prove their programs. The same thing applies to OOP programmers with UML diagrams and other bullshit I'm glad I don't know about

didn't someone prove that making large programs by assembling individually proven smaller programs doesn't make your large program proven? or something.

because it's fucking impossible to work with. have you ever tried? the furthest you can realistically take formal verification right now is something like LiquidHaskell. like said, more research is needed

god you fucks are useless. does it matter why?

anyway the answer turned out to be {**someDict,**someOtherDict}