/dpt/ - Daily Programming Thread

What are you working on, Jow Forums?

Last thread:

Attached: 1548278190239.png (550x783, 382K)

Other urls found in this thread:

dl.suckless.org/slcon/2013/slcon-2013-4-nsz-the_costs_of_abstraction.webm
learnxinyminutes.com/docs/haskell/
pastebin.com/Munt1iwf
insecure.org/stf/smashstack.html
twitter.com/NSFWRedditVideo

ive the same socks and skirt

neck yourself homo

reminder to not be nice to each other

nth for Nim!

Is your Haskell waifu still pure iff she cucks you in the IO monad?

>IO

Attached: 1548384107944.png (780x717, 455K)

Based

show butt.

I'm currently picking apart a java program and trying to transpile it to javascript
The transpiler is kicking up an error with (paramString2 != null) && (paramString2.equals("ja")) ? 1 : 0); but I'm not entirely sure sure why.

Attached: 3716b0bd961c54b70852efebfc48e119.png (2500x3400, 1.31M)

what does the error say?

You have an extra ) at the end.

error: not a statement

Sorry, I missed the first ( at the beginning

How do I into Haskell? Is the purple book actually that good? How long does it take to go through it all?

Well, are you doing anything with the output? Are you saving that 1 or 0 to any variable?

Reminder that C is the only serious programming language.
dl.suckless.org/slcon/2013/slcon-2013-4-nsz-the_costs_of_abstraction.webm

Attached: 6537af8c.jpg (400x530, 29K)

17th for Dlang

>suckless
Also ironic you have a talk with "cost of" in the name considering C has cost more human lives and money than any other language.

learnxinyminutes.com/docs/haskell/

I found the book a bit too verbose, but the exercises are a must if you want to really understand the concepts.
How fast depends entirely on you, but I wouldn't rush it.

>C has cost more human lives
How would you even measure that?

>all that stuttering
Kek, Suckass fags are so aggressive online, yet this is how weak and unimposing they look irl.
That said, dwm and st are actually quite good, so kudos to them for making them good DESPITE C, not because of it.

Agreed, ironic also considering that C itself is already a pretty fucking huge abstraction, especially on modern machines.
>abstraction in mathematics is free, in software it isn't
These faggots can't even realize that computer science is fundamentally the science of abstraction.

Thanks for the quick tutorial and the advice, I'm probably going to skim over the tutorial first to manage to get something basic done, then delve into the book.

Looking at the block it's used in I'm not entirely sure what it does. I assume the output is being used /somehow/, since it's used in the applet. I'm probably just being a brainlet.
pastebin.com/Munt1iwf

Doesn't seem to be doing anything.

Friendly reminder to use AppImages

AppImages > Snaps > Flatpaks

Attached: AppImages rock.jpg (868x6656, 724K)

Funny how the best method (source distribution) isn't even mentioned.

Suckless and C programmers don't know anything about abstraction, compilers, or performance.

Just use a container platform such as Docker of you want truly portable applications across *nix systems. It can do everything those 3 memes do amd much more.

>(source distribution)
I dread having to compile a large C/C++ project because 9/10, i get a fucking segfault even though the github says "PASSING: ALL"

That has its place, as gentoo show us

I'm currently playing it in the background, it's amazing how, despite the controversial title of the talk, he had barely said anything in almost 20 minutes.

Attached: my mom when she saw your post.gif (300x221, 589K)

Please do not group all C programmers together with suckless retards.

>The purpose of this table is not to show that AppImages is "better" than the other solutions
>AppImages
>Yes
>Yes
>Yes
>Yes

Attached: 1547068595310.png (597x579, 36K)

>eeeh
>uuhm
>eeeeehm
>uhm

I hate these "portable" memes. They are nothing but extra hassle.

Why am I getting all these bullshit errors, lads?
Semicolons don't come after method declarations, and how is 'public' an illegal start to an expression? I'm literally doing it exactly the same way the person in the video is, but she gets no errors.

Attached: Codecademy bullshit.jpg (1877x797, 123K)

Post the whole snippet.

Usually you get that kind of errors, because you've either closed too many brackets or too few.

I don't know how you guys deal with it. I don't have any background in programming but all I wanted to do was execute a program, but to do that it seems I had to install C++dev and then I have to install curl but curl just doesn't install with any simple activator and blah blah blah I have to copy some stupid certificate manually to a folder and fuck it I just quit.

So tired of needing this, this, this, and that just to do one thing. I can't deal with all the reading and "works on my machine" only guides. How the fuck do you guys not lose track of what you were even originally trying to do with all these prerequesite steps? So much wasted time...

Attached: skeletor.jpg (400x320, 22K)

OP here. It's also telling me that my 'else' statement is missing an 'if' even though I didn't intend an 'else if', I just intended an 'else'

It's okay, if you never compile your code she stays pure.

I usually just write "sudo pacman -S stuff", and it works. It just works.

What do I put on my github to get me a fucking job. Python or C, or C++

Hahahahahaha
The C virtual machine target, the PDpP, is not close to modern hardware at all.
Program in x86 and ARM assembly you little bitch or otherwise you might as well use slow high level trash like python that doesnt lie abouy being close to the metal.

l2read
It's a very basic syntax/typo issue you shouldn't need to query other people over.

Macs come pre-installed with every developer tool you'll ever need. The only catch is they're all five years outdated.

"string" or 'string'?

"string"
'char'

I miss having a macbook sometimes. Not for the hardware but for the OS.

I found "learn you a haskell" quite good as well, although it tries too hard to be quirky occasionally

Elementary OS is pretty nice.

I love my Macbook Air. I'll be sad to see it go someday.

I know C (more or less), Haskell and Java. What language would you recommend I learn next? I'm mostly doing this for fun

How can I make a shell script/python that sends packets to an address like ping, waits a second for the response, and if no response, kill the process

Python. It's a necessary language because it lets you make useful things in the span of a day.

Emacs or vim?

Attached: 1549404267604.jpg (500x775, 196K)

A GUI made in 15 minutes with Java Swing.

“Output”
‘No output’

Or, in the case of C

what are you NEETs circle jerking about today?

Attached: _LL.webm (668x660, 2.72M)

You should always allow the possibility of declaring strings "like this" because it's habit for most programmers.

can't deny the truth

Has Chi chan successfully become a meme?

They both occupy one character each.
One just looks bigger.

The appeal just hinges on which character you need to escape more.
And because I write the english language I need to escape ' 100x more. So " it is

What tech stack are the companies around you using? Put that.

Can someone please help me. I am trying to change the value of the return address, and I don't know why the 7fff part won't go away.

What I am doing is changing the value at 0x7fffffffd778, which holds the value of the saved rip, to 4. But if you look at the frame after I change the value, the saved rip is 0x7fff00000004 instead of 0x000000000004. Why is that happening?

Attached: Screenshot at 2019-02-06 20-29-28.png (913x304, 47K)

Lisp is the most powerful programming language.

don't call my wife a meme

Attached: 1547666600605.gif (440x458, 844K)

makes me want to replay metroid

The line before the else has no closing parenthesis.
So it's an else to no if.
When they say your else is missing an if it means it's missing previous conditional blocks. Not that you're supposed to fill in if to make an else if.
I didn't think this misunderstanding was possible but it's clear it is now.

I'm trying to understand dependent types.
More specifically, I don't understand how they can be used to determine program correctness.
So types are a restricted set of values.
Product, Sum, and Pi types are a specialization upon types, where a Pi (dependent) type is further restricted to an expression.

This does not tell me that you can prove program correctness.
This tells me that the type checker allows for complex programs to determine whether a value fits some conditions... but this is not any different from an ordinary program.

The same program you use to create a 'sorted' dependent type can be used to validate the 'sorted' state of a dynamically typed value.

So the difference is that dependent types can be used to write applications where types can bring their guarantees wherever they go.

But that is not program correctness--you can still have a logic error resulting in a different algorithm, and programming dependent types is known to be more difficult than regular programming, so who exactly is this helping to validate your program for correctness?

I unironically think I'm a genius.

Attached: 1514759890141.gif (150x150, 293K)

Why?

I know javascript

Ternary is an expression, conditionals require a statement.

Idris is excellent. It's like Haskell but even better. It's like the good bits of Scala if they worked.

>The same program you use to create a 'sorted' dependent type can be used to validate the 'sorted' state of a dynamically typed value.
This is just the issue of formal verification vs. testing.
>But that is not program correctness--you can still have a logic error resulting in a different algorithm
Correctness is always relative to a specification. The idea is that specifications are easier to get right than programs. In any case, testing is the same way.
>programming dependent types is known to be more difficult than regular programming
That's true, but there are benefits to formal verification. 100% test coverage is generally infeasible (especially when dealing with concurrency), but using logic you can intrinsically quantify over any and all states (which, incidentally, is the ability that dependent types add to a type system).

>if-then-else isn't an expression
what kind of horrible language is this?

>How the fuck do you guys not lose track of what you were even originally trying to do with all these prerequesite steps?
You have to write down your plans. It's the only way.

I'd recommend using radare2 if you're going to play around with disassembly and reverse engineering. It's specifically meant for that.

Pic related. It's radare2 running a C binary. The ;-- rip highlights the current instruction to be executed, the instruction is then shown in hex, and then in assembly. The current instruction is a return instruction. It will change the rip so that it points to the address stored at the rsp address. rsp points to 0x7ffddaa7e418 and up at the top of the screen you can see the memory dump at that address. Things are backwards but you can make out the stored return address "c411 a0c7 2f56" turns into the address 0x562fc7a011c4

If you're trying to change a return address you need to find out where it's stored in memory by looking at the stack pointer register (ex. rsp) and then changing the value stored at that address.

Attached: radare2.png (1366x768, 164K)

something about signed integers?

Most of them.

If then else is also an expression.
An expression *that takes a statement*

>An expression that takes a statement
????????????????????????????

It'll make sense when you hit your junior year. Don't worry.

Oh and here's a great article which gives a great explanation of the memory stack
insecure.org/stf/smashstack.html

Oh fuck yeah! Look at that fucking circle. Roundest fucking circle opengl ever saw. Hire me, Nintendo!

Attached: Screen Shot 2019-02-06 at 10.16.35 PM.png (216x218, 8K)

I was able to get it to work using long instead of int. Thanks for your suggestions.

On x86_64, pointers/addresses are 64 bits, so that makes sense.

I hate C and see it as a very flawed language and bash it every chance I get but it's the only language I choose to use for certain tasks. Does anyone else know that feel?

its a very nice circle, user, congrats

Thanks, I hope to refine my openglery enough to make an fps.

λ

>not using IDA

Amateur

Don't suppose you guys got any ideas how I could get this config file noticed? It's like right there but it doesn't see it. I don't really know much about all this but the code was written for python 2.7, and ConfigParser changed to "configparser" in 3, so I just changed all the parts with config to lowercase.

Attached: sfdsfsdfsd.png (1266x623, 82K)

Round enough for Animal Crossing on the GameCube desu

Appimages don't work, I couldn't get FreeCAD appimage to work in an obsucre distro, while flatpak worked perfectly

Snaps are easier to develop for, flatpak has more features and supports system themes and DPI settings. Good luck with that with appimage or snaps

USE ADA FAGS