Project 24 – Voronoi Fracture + Using Open Source Libraries

For today’s project I played around with Voronoi fracture using an open source library on GitHub. Unfortunately I didn’t get the results I was hoping for as some of the math took longer to program than I had hoped. However, I still think that being used to using and being able to read open source libraries is very valuable. Kinda disappointed there was nothing to show for today either. Hopefully tomorrow is more fruitful

-Aaron

Project 22 – RemoteData in Elm

For today’s project I refamiliarized myself with a nice little helper library in Elm. RemoteDate. You can read the blog post on it here. But basically all it does is offers a nice data type to represent remote data and handle cases such as not requestedloading, error, and success. For the project I simply took Elm’s http example and extended it to use the RemoteData data type. You can see the results here.

-Aaron

Project 21 – PyGame Hello World

So I’ve had this idea for a visual art project for almost 4 years now and decided I should finally try and implement it. To do so I needed a simple drawing tool. So for today’s project I got acquainted with PyGame. I made a white box that bounces off the walls of the screen. PyGame seems pretty simple to use. Now to apply what I learned in this project to the project I’ve been putting off for 4 years 🙂

-Aaron

Project 20 – Solidity Global Variables

For today’s project I decided to try and build a naive lottery with a smart contract. Unfortunately it didn’t go as planned. I tried to use ethfiddle.com to write the smart contract as I did last time. However apparently global variables such as time and block hash are not handled properly in ethfiddle. My plan was to get a pseudo random number from the block hash and use work from there. Unfortunately block hashes are always zero in ethfiddle. I also tried using the block’s timestamp but this was also constant. Regardless, even if I had succeeded I would not recommend creating or participating in a lottery constructed in this way. Miners can choose whether they want to submit a hash or not so there’s opportunity to manipulate the randomness here.

That about sums it up for today, oh if you’re interested here’s the incomplete contract I was writing. Until tomorrow,

-Aaron

Project 19 – AaronCoin

I’m excited to announce the hottest new crypto currency – AaronCoin. Ok, not really but I did write an Ethereum smart contract for today’s project that, if deployed, would make AaronCoin a reality. You can check out the source here. I used a tool called EthFiddle to write it. I highly recommend checking this tool out if you’re interested in playing around a little with Smart Contracts. It goes without saying but don’t try using this as a currency. I did write it in less than 20 minutes after all 🙂

-Aaron

Project 18 – Metamask + a Solidity Hello World

For today’s project, I worked on familiarizing myself with writing Ethereum smart contracts. I read the white paper for Ethereum last year but I never got around to writing my own smart contracts. Today I submitted a hello world smart contract to a test network using Metamask. I’m impressed with the quality of of the tooling around Ethereum and smart contracts. Metamask specifically seems very well implemented. I will be playing more with Solidity, Smart Contracts, and Metamask in  the future.

That about sums it up for today.

-Aaron

Project 17 – Haskell Hello World

For today’s project I decided to dip my toe into Haskell, a functional language that Elm borrows a lot of syntax from. I did the traditional programmer thing and wrote a hello world program. I think it’s a little ironic to do a “hello world” message from a functional language since printing is a side effect but none the less that’s what I opted for. I played around a little and this is the program I ended up with at the end:

reversePrint = putStrLn . reverse

main = (reversePrint "Hello World")

The output is dlroW olleH in case you were wondering. The function composition operator (the dot between putStrLn and reverse) was new to me. It’s an interesting concept. Essentially you can use it to turn function pipelines into functions.

That about sums it up for today. I’ll probably be playing with Haskell a bit more here on future posts. See you then,

-Aaron

 

Project 16 – Maybes and Commands

Today is the start of my 3rd full week of daily projects. I’m going to try a slightly different blog post format here. The previous format felt too strict and time consuming.

Today I did a little Elm project with Maybe values and Commands. Maybe values are a very elegant way of handling nullable values relying on ADTs (Algebraic Data Types). ADTs are very common in strongly typed functional languages. Commands are how Elm handles updates that need side effects.

For today’s project I made a 6 sided die roller. The integer value is a Maybe Int because it starts off without having a value. Clicking the button to roll a die results in a side effect, the random number generation, so that is handled using a Command.

That about sums it up for today. Until tomorrow,

-Aaron

Project 15 – Elixir Applications And GenServers

The Plan

For today’s project I wanted to review using OTP in Elixir. I made a simple application that sends some messages around.

Post Mortem

There really isn’t much to show for today’s post since it was mostly just playing around with starting different processes and handling information passing between them. I don’t know if I’d call this one a success. I learned things but I feel like everything was way harder than it should have been.

Key Observations/Observations

  • Elixir has some of the worst error messages in any language I’ve worked with. It offers some powerful features so I really don’t want to give up on the language but it seems ridiculous to me. I keep hoping there’s a point where I’ll just “get it” and the error messages won’t be as much of a hitch.
  • I think I need to get a better understanding of OTP. I feel like I’m only scratching the surface of what it can offer.

That about sums it up for today. I’m writing this one on the train again so the post is going to have to be a bit shorter.

-Aaron