/dpt/ - Daily Programming Thread

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

Other urls found in this thread:

codesend.com/view/5b47ef46add8349bc909f8b201e0a862/
lisp-lang.org/success/
twitter.com/SFWRedditVideos

Rewriting the Linux kernel in Haskell.

More a question then anything else:
Trying to write a bot for an android game because I like to learn to write bots.

How am I supposed to decode the traffic?
I got an emultor installed the app, opend wireshark and filterd all the traffic.
That's seemed logic to me but what about now.
I got a lot of encrypted stuff.

Any idea and sugesstions?
Currently trying to write a bot for Dragon and Knights but I really don't care which game desu

a unionfind algorithm to find the connected component with the input of a .txt filled with all existent edges and printing all unions out.

the code is absolutely ridiculous, and programming felt like i'm experiencing a car crash i can't avoid, it kept getting worse and worse. not to mention it doesn't work. well

codesend.com/view/5b47ef46add8349bc909f8b201e0a862/

Have you taken the brown pill yet, mateys?

it's a tough pill to swallow!

Why

I dont know where to start.

0 CS and Coding experiencd

write a HolyC interpreter

I'm working on you're mom if you catch my drift.

>taking a class on C
>have to download a program
>have to compile helloworld
>gcc helloworld.c
>gcc not found

10/10 I fucking quit

goodbye

i dont understand what im doing wrong here

Set PATH

Try PHP

what

Add gcc to PATH system environment.

yeah i dont...

Maybe you should listen in class.

How about you Google it?

>Not a very useful one.
How do you know? What's something you think is useful that couldn't be done safely?

>These's only safe or unsafe, no in-between. And it only takes a single unsafe (or FFI call) block anywhere to invalidate the guarantees of the entire program.
Of course, but because you are developing the program you don't have to think of the program as just one indivisible thing. Like I said, any code outside of an escape hatch cannot be the source of a bug and can be aggressively optimized. Either it's the code inside the escape hatch itself that is wrong, or the assumptions and promises made at the boundaries of the escape hatch that are wrong or not kept. Of course, it is possible to empirically check that the boundary conditions are maintained using assertions that may be taken out in a release build.

what eclectic programming language combo would a man like this have? I don't know anything about programming but I figure it wouldn't be something popular like python or java, obviously it would be exotic and awe-inspiring like a haskell/perl guru

Linux is the past not the future, look into libOS or rumpkernel.org or how the Mach microkernel works (Hurd). You want to build userspace libraries that act like a full kernel but have no privs so can be distributed which is the point of rumpkernel ect.

>Linux
C

Check it out guys, totally aced my job interview, they offered me the position, plus 20% more than what they were originally offering.

#include
#include

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

Also, logically, if a piece of code has no unsafe block, even if it calls a function that itself has an unsafe block, that function is an assumption. If you form a deduction from an assumption to a conclusion, the deduction itself is correct independent of the validity of the assumption.

Do it in x86

Really excellent stuff user.

Why is there hardly any documentation on using the gpio pens in C++ for the orange pi

>How do you know? What's something you think is useful that couldn't be done safely?
Anything implementing fundamental memory management structures and functionality, demand paging for example.

Why do you think that can't be done safely?

How similar is C and Python?

Not at all similar.

They are driven by interrupts and shared global states.

Should I tell potential employers whether I live in New Jersey?

Only because the OS is designed that way. If we're talking about using the OS, then you just have to give the API an appropriate type, and if we're talking about writing an OS, then you don't implement something that stupidly in the first place.

The corollary of course being that the soundness of your proofs says nothing about whether the program does what you actually wanted it to do.

How many times do I have to repeat the same thing?

Anyone have advice for a final year CS student? Should I just be focused on doing the course work and then get really pay attention to a specific language + field in CS and learn things on the job or should I do that out of school?

School's kinda mentally draining and I find the lack of motivation to do anything outside of school, since it occupies me fully, obviously.

It's the way the CPU works.
The point is that you can't model it safely in any language, the only way you can guarantee correctness is by careful manual state management.

Okay, so the way the CPU is designed. Not something you implement yourself nevertheless, just something you have to provide a suitable API for.

Take electives you're interested in
Forget about learning specific languages and industry bullshit, that's all on the job training for the most part.

The vast majority of CS grads are recruited during grad year to be parachuted directly into some Silicon Valley corp

>Take electives you're interested in
Currently taking an introduction to statistics and chemistry course, I guess its fine but pretty indifferent about it

>The vast majority of CS grads are recruited during grad year to be parachuted directly into some Silicon Valley corp
Firstly I'm in NewZealand so I don't know if its any different but could you teach me how to life? I seriously don't have the faintest idea of what im supposed to do in my final year in school, do I just like send out my CV to random companies saying im a soon-to-be-graduate and in hopes that they ask me to work for them after an interview or something?

Idk anything about life

The point of low level systems languages is to implement those APIs.

Um.
Do you have gcc?
What distro are you using?
>inb4 windows

How do I into web dev?
I always did systems stuff, but it's hard to find work for systems people, and when you do get some work they always have you doing something that's not systems related.
So I need to do gay web shit, maybe I can even be one of those legendary "full-stack" developers.

>School's kinda mentally draining and I find the lack of motivation to do anything outside of school, since it occupies me fully, obviously.
It's that way for most people.
Now let me ask you motherfucker.
ARE YOU MOST PEOPLE?

>>/wdg/

>ARE YOU MOST PEOPLE?
N-no :(
but I get tired like most people...

I've educated myself a bit on the subject and now see how this works. The CPU triggers a page fault interrupt and the OS traps it. The OS trap needs to mutate some state, but it can only get this state through a global.

You can model that pretty easily by using linear capabilities. They have no run time representation (so you can say that a trap borrows the capability even though in reality a trap is just a side effect) but allow you to treat mutation of a static piece of state as transformations of immutables.

You either do not have GCC installed, or you do not have the path to the executable within the system path. When you run a program from the command line, it searches a list of folders specified by the system path for executables. If it can't find they program, it will report a command not found. It doesn't search the entire hard drive, because that would take forever, and could easily lead to finding multiple programs with the same name.

If you're in Windows, you're going to need to do two things:

1. Install GCC. This is usually distributed under the names MinGW-w64 or MSYS2. I would recommend MinGW-w64 for simplicity.

2. Find the path to the folder where gcc.exe is located, copy this at the end of the PATH environmental variable in your control panel. Note that your command line does not reload your PATH upon a change, so you'll have to start another instance of whatever command line program you are using.

You also shitpost like most people. Go to bed.

Or, you know. You could just do it the simple and sane way with a proper programming language like C or C++.

Not him, but it's 4:30pm in New Zealand.

Can I get an answer for this? mainly the second greentext

noob here learning python and i'm not liking it very much, pip can't install shit (so far i've only tried to install pygame and kivy and both gave me errors) and generally everything seems like.. wrong, maybe i'm just superficial but.. indenting instead of braces feels stupid, "self" in every method is silly, etc... should i continue to learn this language? only to expand my knowledge at least

Have you used any other languages before?

yep, c/c++, java, javascript and a little bit of ruby

It's understandable that you don't like Python then, I think.

There are lots of languages that are (in my opinion) more interesting than Python, especially given that you already know JS and Ruby.

Have you considered a Lisp, or a statically typed functional language?

I have a few of these

...

>you shouldn't bother with proving anything since you can't prove independently that the CPU does what it's supposed to do

i once wrote a little program in lisp for a school homework and i kinda liked it, maybe i should look deeper into it, what big apps have been made in lisp?

lisp-lang.org/success/

Mate, when you are working with low level crap like page tables, you need to be thinking low level, and not thinking high level. Leave your functional nonsense to userland applications.

There's nothing high level about proving something correct.

...

Then you go to bed.

You can enjoy your self-proving programs with 8MB executable size.

You can prove that C programs are correct.

Sure, but the C program itself isn't a proof.

So? It's called static verification for a reason. A language that combines programming with proving doesn't retain any of the latter after it is compiled.

How is that relevant?

Because the proving part doesn't affect executable size (or run time, or memory used) like you claim.

Not negatively, anyways. Proving can make optimization more effective if anything.

My problem is not with you wanting to prove correctness.
My problem is with your use of a high level thought process to approach an innately low level task. You should be thinking more concrete, less abstract.

What's high level about reasoning about access to resources?

Literally the opposite for me, I lack motivation to do anything inside of school.

Why won't death welcome me.

>You can model that pretty easily by using linear capabilities. They have no run time representation (so you can say that a trap borrows the capability even though in reality a trap is just a side effect) but allow you to treat mutation of a static piece of state as transformations of immutables.

Doesn't sound very low level to me.

Designing a processor now as a part of a larger project. The processor should be as simple as possible (low resource use is the largest goal), while retaining good throughput, and have completely deterministic operation.

Currently going for pipelined operation, no reordering, just bubbles. Opcodes that unpack into control line sets and a minimal number of instruction formats, so the decoder can be small as possible. ALU only has one adder, one logic unit (uses opcode to specify bitwise truthtable), one shifter, and one bit merge/bit select.

I have a few issues though... Multiplication and division is one. I know there are O (log(n)) algorithms that use only one adder, but the additional logic might blow up my LUT usage. I can't find a good way using the theory of its operation described in H&P.
The other issue is memory... there are ways to improve memory throughput or latency, but I'm not certain if that still applies to FPGAs and I'm not certain if I can make their operation deterministic.

Any ideas?

Why? If you're not thinking about a similar thing when you're programming with C then you're not going to do a very good job. This just codifies it in the language which means the compiler can check it and use it to optimize.

>Because the proving part doesn't affect executable size (or run time, or memory used) like you claim.

I never claimed that the proving part contributed to the executable size, it's just that all of the languages which combine programming and proving are complete garbage and have a tendency to produce billion MB executables for Hello World.

Not ATS. Well, the syntax is complete autistic garbage but the compiled programs are quite good.

A lot of kernel level shit tends to involve DMA and volatile variables, which don't really optimize well. The things to be thinking about are primarily going to be along the lines of "what memory address to I write to and when?"

damn im still unable to install libraries, it seems that with every new release something breaks... this is ridiculous

Me too thanks.

I'm not sure if such a program exists, but it's
a cute girl that will sit in the bottom right and broadcast what music you're currently playing in the frame between her hands. I'm still a noob, and the handle.exe provided by microsoft can't process japanese characters which was my whole purpose for it.

>java
Neat project though, have it be able to hook into foobar and I'll use it.

What is the essential list of GUI widgets?

That was the point I had been looking for so long, it should work with any program that plays music.

So basically just learn java

>it should work with any program that plays music

If you use C#, you can use the selected process' .MainWindowTitle. You can even have it so that the song title is selected by a user-provided regex. Then it'll work with any application.

Oh that is so cool, thank you for that information, I'll look into it.

kys nigger

It really is quite straightforward.

Glut tutorials are fun.

Outdated and Python shilling.

Whether you like it or not, whether it's good or not, everyone fucking uses it so what you think doesn't really matter desu.

careful you might give somebody a seizure
please exercise Seizure-Safe Graphics Programming (SSGP)

Writing an infix to postfix converter and a postfix evaluator in golang, linked lists and stacks are my new god.

Someone tell me what C++ project i can do that will look good on a CV/repository