/dpt/ - Daily Programming Thread

Lets get productive edition.

Previous thread: What are you working on Jow Forums?

Attached: reading_sicp.jpg (500x573, 49K)

Other urls found in this thread:

github.com/RedGuyyyy/sd2snes/tree/sa1?files=1
hackage.haskell.org/package/named-0.2.0.0/docs/Named.html
github.com/Mark-Weston/libdragon
github.com/Mark-Weston/platformer
haskell.org
learnyouahaskell.com/chapters
github.com/mrehkopf/sd2snes?
sd2snes.de/blog/
coursera.org/learn/machine-learning
opensecuritytraining.info/Training.html
hackage.haskell.org/package/base-4.11.1.0/docs/Data-Traversable.html#v:traverse
hackage.haskell.org/package/base-4.11.1.0/docs/Data-Foldable.html#v:traverse_
my.mixtape.moe/pymlll.mp4
staff.ustc.edu.cn/~bjhua/courses/security/2014/readings/anti-disas.pdf
crackmes.one
youtube.com/watch?v=606QlJ6uud0
twitter.com/NSFWRedditGif

We're almost halfway through the work week. What have you accomplished so far user?

/vr/ here. Can anyone here compile this code for us?

github.com/RedGuyyyy/sd2snes/tree/sa1?files=1

It will allow us to play games like mario rpg on our flash carts, people that know how to do it don't want to for the community because "they'll get a max influx of bug reports" or "its disrespectful not to wait for the guy that made it to distribute it himself" (WTF? then why upload the source?)

I want Shinka to beat me with a copy of SICP while I read TAOCP.

New version of named is out, now with implicit params:
hackage.haskell.org/package/named-0.2.0.0/docs/Named.html

Thanks for using an anime image, OP

Attached: karen learn haskell.png (1280x719, 906K)

i wanna hack gaems.
What is some good tools? Decompilers? Something to watch memory? Wireshark good enough for traffic?

Writing a script to kill myself. Using an arduino and serial communication to off myself at a random interval

Attached: 1462065813506.jpg (471x449, 24K)

not implicit, i mean optional

I'm interested in learning Haskell, what do you think are some good resources to get started?

Making 5 levels a day for my game.
github.com/Mark-Weston/libdragon
github.com/Mark-Weston/platformer

Attached: output2.webm (1366x768, 2.3M)

Haskell book, or the wikibook
Try the 5 minute intro on this haskell.org
(it's not a *real* Haskell REPL)
Use stack (NOT haskell platform) to install haskell, if you decide to try it

looks super cool
like meat boy

When I studied programming languages at uni, our professor recommended this guide: learnyouahaskell.com/chapters

Attached: Screenshot_20180216_144029.png (1024x768, 311K)

Hey guys, absolute Java newfag here, and I have a question I need to ask. Okay, so I'm using Treehouse, and alongside their tutorials I'm using IntelliJ because Treehouse's compiler sucks.

The issue happens when it comes to I/O. In Treehouse's compiler, an input works like this:

String name = console.readLine("What is your name? ");

console.printf("My name is ");

Then you enter your name, and execute. But in IntelliJ, the 'console.readLine' thing gives an error. I know there is something used called 'scanner.newLine()' in IntelliJ, but that isn't working either.

Am I just a brainlet?

this is good too

there is a "README" file under the "src" directory that explains it. it's a very involved process that involves a lot of tools and hardware that Jow Forums likely won't have available. my advice is to be a dick, threaten to report the people who are doing it to the feds if they don't help you out. it's the price they pay for stealing, remind them that nothing in the world is truly free.

RSQRTSS

By the way, user, why don't you implement closed-world levels?

Attached: Screen_Shot_20180714_at_11.50.45_AM.png (1440x900, 1.86M)

Is there something specific about that repo over github.com/mrehkopf/sd2snes? Because that has a link to sd2snes.de/blog/ with downloads.

it exploits the floating point implementation on older cpus to create a mild optimization for calculating lighting effects. newer computers use the gpu for that and have a better implementation for floating point math so the sqrt hack no longer works the way it's supposed to. people only think it's good code because it's hard to understand, but the moment you learn how floating point math was implemented you realize it's a shitty hack with a very limited use. it's /v/ tier retardation.

>github.com/mrehkopf/sd2snes?

yes, it has SA-1 chip support. So games like Super Mario RPG can be played.

I wouldn't be so hasty. As with most things, there is probably some corner case where following the best practices will fuck you up.

x86 has the craziest goddamn shit

What do you mean by that? Like putting walls around a level?

Does anyone else have an Arduino Due that squeals when you plug it in, then stops squealing if you spam the reset button? It still works fine, but I'm worried something is broken.

can i join

Attached: 1424718072856.jpg (600x637, 57K)

wasn't arduino deprecated by raspberry pi?

learnyouahaskell can be good for backup or as a short reference, but it is not detailed enough to be your only source

The Haskell book is amazing. It takes a lot of time but it's so good. I'm going through it now and it's honestly better than pretty much all of my uni text books that I've read.

there is supposedly a pdf somewhere

>Does anyone else have an Arduino Due that squeals when you plug it in
Sounds possessed. I would try dousing it with some holy water.

>can i join
Sure, I plan on releasing schematics and the source once it is completed.

Attached: 1496159127521.jpg (1071x1068, 637K)

I found an outdated version as pdf. It makes me a bit embarrassed, it's so well written I feel like I should pay for it. It's pretty expensive though, 59 dollars is a lot for a book. Might still buy it tho

Books are super expensive, it's crazy.

Libgen.io has you covered for 99% of English books

No. Arduino doesn't boot a full operating system and has more PWM pins.

Attached: 1475131659820.jpg (236x262, 13K)

My square root approximation has an error of around 30% on first estimate. Is that good?

Damn Haskell is such a shitty language.

Sounds shitty as fuck. How large of numbers are you trying to approximate? With beatty sequences and with languages arbitrary floating point precision you can get exact values for fairly large numbers.

Attached: 1484678423922.gif (500x245, 1011K)

He's not wrong.

Anyone got the pdf for "Haskell Programming from first principles" that they could share?

>2017 edition is almost 2000 pages
fuck me

I want to get into machine learning. I was thinking of a starting project of interpolation of anime. I'd probably want to use C so I guess openCV is a good option? I have no idea how to even begin the actual machine learning though. Any suggestions or resources you'd recommend?

Try libgen
It's really big, a lot of it is on lambda calculus too.

My initial reaction was exaggerated. Previous versions were like 1000-1200 pages long, it seems they added some stuff but most of it is more whitespace and larger font.

Why are you writing your own square root approximation?

sounds like a space leak :^)

Machine learning is literally the worst. Trust me, you do NOT want to get into it.

I'm just bored and want to die user. I need to do something and I'm grasping at straws here. If you have suggestions please feel free.

This is the most popular online intro to machine learning afaik coursera.org/learn/machine-learning

thanks user

is Practical Reverse Engineering a good starting point for a Pythonlet to get in to disassembly & reverse engineering?

Attached: 41bsfQwP3iL._SX258_BO1,204,203,200_.jpg (260x325, 15K)

opensecuritytraining.info/Training.html Quality information here. Not sure about that book

Why was Python created when Lisp already existed?

What's the point of arduino when you can buy a big bag of microcontrollers for very little on aliexpress?

why was python created when perl already existed?

uint32_t, although it's not intended for serious use, just "user starts to write something based on a very vague idea and abandons it halfway through".
My idea was to use morton numbers, although for practical use I'm fairly sure x >> ((sizeof(x)*CHAR_BIT-_builtin_clz(x)) >> 1) is way, way better.
Fun.

Why was Python created when literal shit already existed?

Other graphics
>3d rendering, shaders, that kind of stuff
Low-level kernel stuff
>drivers
Embedded stuff
>make a 2fa hardware token with a microcontroller and a button that takes 3.5mm input from your computer to fill in new keys and emits USB output
Networking stuff
>write an implementation of some protocol, such as bittorrent or irc
Web stuff
>write an imageboard/bulletin board/comment system

Attached: 1505902730369.png (5198x2124, 2.46M)

If you cannot write traverse_ in a language then it is a poor language.

If you can write traverse_ in a language then it may be a poor language regardless.

should've specified traverse rather than traverse_

What the fuck is traverse?

Any language in which traverse_ can be written but traverse cannot be written is a poor language.

Any Gotard ITT?

Attached: 1512886705862.jpg (716x620, 257K)

hackage.haskell.org/package/base-4.11.1.0/docs/Data-Traversable.html#v:traverse
hackage.haskell.org/package/base-4.11.1.0/docs/Data-Foldable.html#v:traverse_

Oh my sweet young user

>Any language in which traverse_ can be written but traverse cannot be written is a poor language.
>tfw you have borderline

In a normal OpenGL scene where I'm only rendering a square using perspective projection can my model and view matrices both be identity matrices (i.e diagonal 1s)? That's how I have them now but I'm not getting perspective, it's just orthographic projection, but bigger...
Not sure if I fucked up on the projection matrix or left something out or what.
What do?
look at this shit: my.mixtape.moe/pymlll.mp4

Attached: CuiYEZAVUAI5_pf.jpg (1414x1000, 125K)

So what's the difference between this and map?

Fucking retard

what do you mean by this?

Attached: 1511639520191.png (331x404, 138K)

Look at the types, for one thing

You can implement a multiplayer mode where the goal is to clear the level before the other players.

Attached: das it mane.jpg (600x900, 53K)

Yes I think most of the languages has for loops

>Want to make grilled cheese sandwich
>out of butter and stores not opening for another 4 and a half hours
God fucking dammit how do you even code while hungry

streams in poolangs for instance make _ way easier
Traverse does applicative effects, it's (a -> f b) rather than (a -> b)

So it takes a and returns a function that returns b, instead of taking a and returning b, where b is f(a)?

i know how to cook curry
t. pajeet

Does anyone have a link for that open source android (as in cute humanoid robot) project? There was a general of it posted in Jow Forums at some point.

>streams in poolangs for instance make _ way easier
Can they combine the effects? Anyway, noted, I'll use a different example next time. I was using it as something necessary but not sufficient. Scala can implement both and it's not a good language.

I don't know because I didn't read this book yet, but I advise you to read the book of beginners.re
You should also read about anti disassembly/debugging techniques, packer, crypter and protector stuff.
To make a good introduction in anti disassembly techniques, you should read the chapter 15 of "Practical Malware Analysis".
Here's a link: staff.ustc.edu.cn/~bjhua/courses/security/2014/readings/anti-disas.pdf

But the more important thing to do in Reverse engineering is to practice, so visit crackmes.one
This is a website where you can use your skills to crack some crackmes.

curry is good
t. britbong

class Functor t => Traversable t where
traverse :: (Applicative f) => (a -> f b) -> t a -> f (t b)

Given a function of type (A to F)
Return a function of type (T to F)
For any A, B, (Applicative) F
If you have f = Identity
traverse :: (a -> Identity b) -> t a -> Identity (t b)
Identity x is isomorphic x so
traverse ~:~ (a -> b) -> t a -> t b

I love curry but my cooking skills are only adequate for doing very basic things, like grilled cheese sandwiches or my special pasta, which is regular pasta but I forget the salt

youtube.com/watch?v=606QlJ6uud0

It grows on you. I can cook chicken and rice in 30 mins these days. I cook every night. It has become a daily routine now.

What does T mean? Template?

the first two lines (after code block) i'm trying to explain using C++ like syntax

Thanks, I will save that until I get an actual kitchen. Which might take a year or so.
I'm so limited in space I have to put hot pans on the floor when I want to take them off the stove.

good luck, user

Atom is a shit and I almost never use this computer for programming but fuck it's comfy sometimes

They're fundamentally different things. An Arduino is a little MCU with on-board programmer. It doesn't run an operating system, unless you give it an OS to run, I guess (see: Contiki, FreeRTOS), but it isn't gonna be pretty.

A raspberry pi is a small computer that IIRC runs on a multi-core CPU with off-chip memory, and enough RAM and processing power to run linux. Most arduinos don't even use a pipelined core, let alone multithreading.

The Due is an exception; the Cortex-M3 on board the ATSAM3X8E is pipelined and it has some pretty impressive features, but the raw computational power is still nothing in comparison to the hardware on a Pi.

The great thing about an Arduino is that it's dirt cheap (you can buy off-brand UNOs for like 10 bucks), and the bigger ones have way more IO with more customizability. If you shed yourself of the Arduino IDE, a Due is ridiculously powerful for how simple it is.

tried that, I haven't been to church since I was a kid but I guess I could try an exorcism?

That's fine for the little DIP uC's but there's plenty of chips that are a bit more serious than that.

I /could/ buy an Atmel SAM3X8E (the one on the DUE) on aliexpress, but it wouldn't be very useful unless I want to piss away a bunch of time soldering a LQFP100 package, then getting a programmer, then fucking with the programmer until it actually works... you get the idea.
With chips like this, you always buy them on a demo board, whether it's an arduino or not.

Also, for anyone looking to into Cortex-M, I suggest Infineon's XMC1400 bootkit. Works with J-Link and the XMCLib is a way better API than anything offered by Atmel. Just be prepared to dig through the corners of dead forums to find sample code.

Attached: Screenshot (7).png (3840x1200, 1.29M)

Thanks ill check these out

Java generics:

>The following code snippet without generics requires casting:

List list = new ArrayList();
list.add("hello");
String s = (String) list.get(0);


>When re-written to use generics, the code does not require casting:

List list = new ArrayList();
list.add("hello");
String s = list.get(0); // no cast


Haskell generics:

>Map each element of a structure targeted by a Lens or Traversal, evaluate these actions from left to right, and collect the results.

>This function is only provided for consistency, id is strictly more general.

traverseOf :: LensLike f s t a b -> (a -> f b) -> s -> f t
traverseOf = id

disgusting

What is the point of this post?

Also, what music do you guys listen to while programming? I enjoy acoustic stuff and twinkly emo bullshit.

I really, REALLY hated haskell when I first started using it. I still think the IO monad is fucking dumb, but the syntax behind the language surprisingly pleasant, if a bit jarring initially.

Attached: 1c7 (2).png (350x895, 195K)

id is a bad example because you can say it does whatever its input does

I can understand what top does. I can't understand what bottom does.

Someone pls? Want to contribute

Attached: serveimage.jpg (1000x750, 218K)

Don't ever listen to music while doing anything else. It just starts to feel like noise after 5 minutes.

It's a poor example. id is simply a function that returns its input. The input in this case happens to be (LensLike f s t a b) which is a thing that does the complex thing he described.

I always listen to music when I can. It helps me relax. Am /mu/tant though so maybe that's just me.

If you want music that isn't gonna feel like noise after 5 minutes, I may be able to assist you user

Attached: 1398898873057.jpg (1513x1513, 348K)