migrating away from coffeescript

Sadly, its' time to let go of coffee and change with the time. I'm rewriting it all for ES7, taking advantage of better async stuff. It's too bad cause I loved coffeescript's syntax so much.


Creating a multi-emulator machine

Chache loves old Sega games but I grew up in a Nintendo house so I built an multi-emulator machine.

Get some hardware, install Lakka and boot up

You'll need an old PC, laptop, or even a RassberryPi, anything you can install linux on. I'm using my ancient but trusty Asus EEE PC.

Lakka is a linux distro which is mostly just the RetroArch frontend. You could also install LibRetro on an existing linux system through aptitude, but I wanted to do the full OS install.

booting.

Troubleshoot

The first real problem I had was that, by default, my pokey machine couldn't render the complex background of the menu quickly. The result was a nearly unuseable. But by turning off the option Settings > Menu > Menu Shader Pipeline to "off", navigating the menu was much faster. Next, I changed Settings > Menu > Show Advanced Settings to "On", so that I could access "Settings > Video > Monitor Index." Changing this to "2" allowed me to use the VGA connection, rather than the built-in screen.

For the nerds, you can also do this through the command line. First obtain the IP address of the Lakka machine

adam@babbage ~/Downloads sudo arp-scan --interface=en0 --localnet
Password:
Interface: en0, datalink type: EN10MB (Ethernet)
Starting arp-scan 1.9 with 256 hosts (http://www.nta-monitor.com/tools/arp-scan/)
192.168.1.1     00:25:9c:66:c5:8d       Cisco-Linksys, LLC
192.168.1.100   70:73:cb:e9:d1:7e       Apple, Inc.
192.168.1.113   00:26:18:41:d9:65       ASUSTek COMPUTER INC.
192.168.1.111   6c:ad:f8:7d:3c:6b       Azurewave Technologies, Inc.
...

From this, we see the Asus netbook is online at address 192.168.1.113. Next, I used ssh to access the machine. Hint: the username and password are both "root." Yes, this is terrible but I didn't set it up this way!

adam@babbage ~/Downloads ssh root@192.168.1.113
root@192.168.1.113's password:
###########################################
# Lakka - The DIY retro emulation console #
# ...... visit http://www.lakka.tv ...... #
###########################################

Lakka (unofficial) Version: devel-20161002110423-r21593-g03241bf
Lakka git: 03241bf2ccf3fbf6f71d04489e02ae3cee8565e1
Lakka:~ #

and voila, you have a very simple linux command line. From here, you must first stop RetroArch

Lakka:~ # systemctl stop retroarch

then you can edit .config/retroarch/retroarch.cfg, with vi or nano. For example, you might change the setting called video_monitor_index from "0" to "2." After saving the file, restart RetroArch.

Lakka:~ # systemctl start retroarch

Connect and sync controllers

controllers.

I use Xbox wireless controllers with a charging cradle. Just plug the receiver into the usb of the netbook, press the button and the Xbox button on the controller themselves. They connected right away and I had no problems at all.

Download ROMs

mm2.

Get all your ROMs together and use scp to move the files onto the netbook. Again, use arp-scan to first obtain the IP address of the Lakka machine.

scp -r * root@192.168.1.113:roms/

Now by returning the the Main Menu, you can select Main Menu > Load Content, you run your ROMs.

Enjoy!

At this point, your system is basically done. I've not been able to load any n64 or playstation games, but all the older systems, including Sega Genesis and arcade seem to work just fine. Just hit "VGA" on the remote and grab a controller!

further work

Write playlists

The menu is pretty difficult to navigate, so it would be nicer to have playlists of games. Lakka makes some crude attempts to generate playlists for you but it's pretty lacking. SSH into the machine and use vim to edit the file in /playlists as described here and lists of games will appear on the root menu.

Boxart

Lakka can be configured to download the boxart for games.

Thoughts

When I first booted Lakka, I couldn't accomplish anything because of the lag caused by the background pattern. Considering my netbook has about the stats as a RassberryPi, I think the contributors should set Menu Shader Pipeline to "off" by default.

It would be really nice to be able to edit the files from the Finder. You should be able to pick up the filesystem in the sidebar of your file browser. Sometimes this worked, but mostly didn't.


Philosophy of Music Design in Games - Fez


Removed typebase and pdf rendering

I removed typebase and also markdown2pdf. My resume is now rendered to PDF by the browser.


Something he’d found and lost so many times

It belonged, he knew – he remembered – as she pulled him down, to the meat, the flesh the cowboys mocked. It was a vast thing, beyond knowing, a sea of information coded in spiral and pheromone, infinite intricacy that only the body, in its strong blind way, could ever read.” ― William Gibson, Neuromancer


Meteor: the first month

There's an exciting new stack for optimistic developers called Meteor and I've had the great pleasure of focusing on learning it for the past months. This is what I've learned.

Meteor is framework based on the high-minded ideal of isomorphic javascript, which is a fancy way of saying, "It's javascript, on the server too!" I find this notion absolutely titilating, though I'm sure other's are heaving at the very thought. Ok, that's fair. But give it a chance! It's an incredibly flexible technology and with a little bit of experience, you'll find that Meteor is a fantastic tool for building prototypes which evolve into mature software. Meteor is production ready and the time to dive in is now!

The basics

Meteor is not like Rails.

I'm a RoR guy. I bet if you are reading this, there's a good chance that you cut your teeth on Rails. Forget all of it.

Meteor does not use HTTP to communicate between the server and client. Rather, it uses Websockets and the Distributed Data Protocol (DDP) to create magical, reactive variables which map Mongo documents to the view.

Meteor uses Collections to store individual documents but by publishing and subscribing to other collections over DDP. This feels weird, at first, but it's actually quite natural.

The server publishes some orders


Meteor.publish 'validOrders' ->
 Orders.find {'valid': true}, {userId: 0}


Meteor.publish 'myOrders' ->
 Orders.find {'userId': Meteor.userId()}

and the client subscribes

Meteor.subscribe 'orders'
Meteor.subscribe 'myOrders'

Hence, the client has access to a subset of all Order documents. You can even limit not just a set documents, but rather whitelist and blacklist certain attributes. This is an important distinction. The client now has access to

And this subscription is now reactive and those order directly map to HTML through you handlebars templates. And the client is usually requesting a subset of records based on a query.

Template.example.helpers
 orders: ->
  Orders.find({active: true})

Therefore, the documents which are shared are the overlap between these 2 subsets- those published by the server and those queried from a helper.

Of course, if you are a beginner, you've got the autopublish package installed and every document is simply available to the client. That's fine for now but don't leave it in your app forever.

A similar package to look out for is the insecure which allows the "client to write to the database". It think this is a bit of a mischaracterization, because the client can't ever "write to the database", only call Meteor Methods. The insecure package simply implement this niavely- you'l want your version of the same methods to have more security

Overall, the impression upon me is very different from Rails. Rails is about strict separation of logic and view, with a controller to handle the details of http. Meteor is less "opinionated" but it forces you to deal more directly with details in a less abstract way. You need to understand the underlying technology, rather than Rails's curated DSL's. Out of the box, Meteor enforces no MVP, though you could implement such. Be careful, because without those rails, it's easy to tangle your logic and your implementation!

Meteor is backed by a mongo db and loves JSON

Adios SQL! I've personally always despised SQL. I get it, sort of, but it never felt natural. Mongo is a breath of fresh air. Not only is every document a plain JSON object, queries are also JSON. Yes, you can have a schema, if you want. Yes, migrations are an real consideration and you have to manage joins yourself.

Meteor requires yet another package manger.

It is, however, a very nice and necessary.

It uses a lot of RAM

But RAM is cheap, so it's not a big deal most of the time.

But it's still just js

Let's face facts: node's asynchronous support is overhyped. Sure, it powerful but the community is fragmented on how to support asynchronous operations. Promises, threads, futures, generators, etc are absolutely overwhelming and bewildering. Meteor does it's best to shield you from these concerns but you'll still have to tackle these complex issues at some point.


Status update

Of course, you can see for yourself by tracking the commits on github! And if you wanted to see what's next on my todo list, check out the issues.

Finally, I bumped the version to 0.1.0, which according to SemVer I should have done already.


Dogs

This is a picture of my dogs.


Soylent, day to day

Ever since I backed Soylent on Kickstarter, I've been a little obsessed with the stuff. Well, "obsessed" might not be the right word... "consumed" might be a better. "Evangelical" has been tossed around. Seriously, a day does not go by when I do not attempt to bring some poor soul into fold. If someone asks what biege slurry I'm gulping down, I launch into a full scale attack to win the hearts and minds of "fooders" and turn them into "Soylentarians."

What's in it?

Mostly sugar. Maltodextrin to be specific. Sugars are molecules in the form of a chain. Shorter chains are the sugars you are most familiar with. Table sugar, HFC's glucose, sucrose and fructose fall into this category. Long chains are your breads, pastas and rice- all the starches. Maltodextrin is "medium" length, so it doesn't taste very sweet. Your body "burns" these sugars more slowly than candy-sugar but faster than pasta-sugar. Next comes oats and brown rice flour. These provide your protein and fiber. Everything else is your vitamins and minerals. Lastly, don't forget the oils! We need oil in our diet and every daily allotment of Soylent includes a vial of oil.

Strangely, Soylent is missing 100% a crucial ingredient- salt!. This only matters if you eat Soylent and Soylent alone or you run marathons. Ordinary food, even when supplemented by Soylent, provides more than enough salt. I think they skimped on this to improve the taste.

How do you get it?

Order it online. You can get 1 weeks, 2 weeks or 4 weeks worth of Soylent at a time. If you buy the subscription, you get a discount. If it's your first order, it's going to take a long time. Go complain about it on the forums but it won't do any good. It took me a year and half to get mine! But after your first shipment, latter orders arrive much faster.

How do you make it?

Each daily serving of Soylent is a bag of powder and a vial of oil. Put the powder in the pitcher and add water. Shake until well mixed. Add the oil and shake again. Serve chilled. Each pitcher is 2000 calories- the FDA recommended amount of everything. I divide it up into 2 meals and snack, in 3 of those shaker bottles, so it's not unusual for me to eat nothing but Soylent and coffee.

What's it taste like?

I would not be ungracious if I said Soylent tastes a bit like Play Do. Not in a bad way though. It's slightly sweet but more than anything at all, it's utterly bland. There's a distinct texture which has been described as "silty." I don't find it unpleasant but others do. I don't understand this at all- my best guess is that it's a subconscious bias.

What's it like living on Soylent?

Well, first, I don't live on Soylent alone and I don't recommend anyone try. Living on Soylent alone would be a sad existence. It's also more dangerous than even I dare to tread. Though I consume more than 50% of my food as Soylent, I'm still wary about the long term effects. But more than that, food is good and after eating Soylent for breakfast and lunch, by dinner I want sweet, salty, spicy food! I can't stress this enough. After the blandness of Soylent, "real" food tastes extraordinary. Your taste buds get reset and you can't help but ruminate on your food. The tastes and textures are so much more pronounced, even boring foods like toast are exciting. But our modern foods are absolutely bursting with sugar, salt and fat and with a fresh palette spicy chicken wings, Doritos, chocolate and Dr Pepper will absolutely blow your mind! It's like eating again for the first time.

Another big change is that you have more of your most important resources- time and money. If you were like me, you were spending up to $20 a day on food and over an hour of time shopping, cooking, eating and then cleaning up after. On Soylent, you can make all 3 meals in 60 seconds, for less than 10 bucks. There are days when the dishwasher is full of nothing but the pitcher and shaker bottles.

What are the downsides?

The worst problem is well documented on the forums- Solent Farts. It's advised that you gradually increase your Soylent intake, as to give your gut a chance to adjust. Otherwise you can expect some really explosive gas. "Fart" really is an insufficient term- I had tremendous gas, so much so that it hurt my abdomen digesting Soylent. GasX and Beano are prescribed but theres quite a few solutions floating around the forums. Thankfully, these symptoms subside eventually. I haven't had any gas at all after v1.3 but your mileage may vary.

Another problem is one of will power. Like I said, Soylent makes you appreciate the sensation of eating real food. Soylent nourishes the body but not the soul. If your not careful, you will find yourself walking out of the grocery store with a pint of ice cream, spicy Doritos and soda cause it tastes that darn good. And you'll find it easier to rationalize to yourself, because you ate 2 solid healthy meals. This is alleviated by forcing yourself to cook. The Soylentarian lifestyle affords you much more time, money and energy to devote to real food, when the modd strikes you. Use your newfound resources to learn to cook again. At my house, we have 5 roommates but we try to eat dinner together. It's an important human ritual, one I didn't appreciate until it was gone. Cooking can be fun and rewarding. Eating can be an aesthetic experience. Both should be social opportunities.

Lastly, you will run into anti-Soylentarians. There's a lot of them in Portland and I'm sure you know the type. Nutrition-istas and Food Babes everywhere will grimace with horror as you down your Soylent. Just smile back and direct them to the forums, where all manner of nutritional arguments are held.