Monday, June 22, 2015

How I Work

You know that Life Hacker segment called "How I Work" full of intelligent people sharing how they do productive things? I never read those. I should because I feel like a hypocrite writing a blog post with this title. I digress, the point of this post is to help my friends.

Several people have asked me how I do web development. I understand they are looking to find easier ways of doing it, and I want to help. The truth is: I'm about to disappoint you. I do it the hard way (but there are some awesome advantages).

Sunday, April 26, 2015

Sudoku from the Other Side

I also play in pen because I'm a glutton for punishment.
I do love Sudoku, and I play it too much. Not long ago (before this semester started kicking my butt) there were two things I wanted to play with: Local Storage and a Sudoku library.

This is what I came up with:

Sunday, March 22, 2015

Unscientific Soylent Test

I'm not a fan of the name, but I cannot knock
them on professional packaging.
Over spring break I decided to give Soylent a try. If you haven't heard of it check out this link to learn more. My original plan was to give it a solid scientific method-ing (could I be the first person to use "scientific method" as a verb?), but either because I'm busy, lazy, or a realist I opted for a simple approach.

Almost six months ago I ordered a week supply of Soylent. Version 1.4 is what arrived; which is nice because they ditched the little bottle of fish oil. Only powder from here on out. For the first batch I followed the instructions to the letter. Pour a whole package in the container they sent, added some water, shake the hell out of it, then added more water. By the second round of shaking I knew future batches were going in the blender. When I opened the bottle to check consistency it smelled horrible. Absolutely horrible. Had I wasted my money?

It is supposed to be refrigerated for at least two hours, but I let it sit over night. The most surprising thing, the next morningit had no smell. Maybe a faint difficult to describe "Soylent" smell, but not repulsive like before. It didn't have any taste, although a lifetime of spicy food brings my taste buds discernibility into question. I had heard people say it had a chalky texture--they're right. Imagine blending up sticks of sidewalk calk with water. A fine grit suspended in liquid.

I started using it regularly on Sunday and by Wednesday had figured out a pattern that didn't exclude real food. I make up half a bag with two bananas and an apple (estimate 1300 calories). Drink that through the day, then have a normal dinner. The drink is filling, some days I didn't eat much.

There is a chart of different additives I tried and short opinion of each. I've weighted myself at irregular intervals (see how unscientific this is going) and couldn't detect any significant gain or loss--less than 4 pounds difference. I can only guess my caloric intake and burn is unchanged. The only difference is I don't "eat" a lunch. Presumably this is healthy too.

Speaking of healthy, I had to admit the first few cups of Soylent were strange. One time I had a tightness in my chest and noticeable increase in heart beat. Another time I felt a little dizzy. I cannot say with absolute certainty these were caused by Soylent because I've felt these symptoms before. On the other hand they happened right after consumption. By the third day I felt great. My theory (or hope) is my body in shock from having healthy food for a change. My regular diet has an embarrassing Oreo ratio.

The downside to Soylent is I have a number of friends that like to cook and give me flack for my culinary laziness. Honestly, I kind of enjoy cooking the rare occasion I do it. I could potentially pursue that as a hobby if the world wasn't full of so many cool things to do. Soylent is a way to give me time to focus on other hobbies. Breakfast and lunch this week has been no more complicated than getting another cup of coffee. I lose about 10 minutes every evening making a new batch and washing the blender.

Soylent fills a need in the market for fast healthy food. Subway used to fill that spot, but they give so many options now healthy becomes opt-in. The worst part is I came up with a similar idea a long time ago (to be fair Futurama played a big role in that idea). The only difference is mine was more like cereal, and it had to taste good with water, milk, or beer.

Short list of things I tried to flavor Soylent with an opinion:

  • Two bananas per 1/3 of bag: very banana-y
  • Banana, apple, six frozen strawberries per 1/2 bag: not bad
  • Banana, apple, lots of frozen strawberries per 1/2 bag: not so good.
  • Two bananas, an apple per 1/2 bag: pretty awesome, apple adds a little texture
  • One banana, and two apples per 1/2 bag: too much texture
  • Two bananas, a pealed apple per 1/2 bag: not worth the effort
  • Four double stuffed Oreos per 1/6 bag: expectations where high but not bad (had to be tried--ridiculous amount of calories for the volume)

    Friday, January 30, 2015

    Some Backup Scripts

    I've been updating my backup procedure for Windows and learned some new tricks to share. My current backup procedure is the most horrible thing I could imagine. It copies and compresses all the files I care about and stores them on a NAS. It ignores some critical backup components:
    • Waste space, no incremental just a full copy of everything. This takes up a lot of space.
    • No daily archive. What if I want to recover a file I deleted 17 days ago from a networked directory? As of right now it cannot be done.
    • Compression sucks, for three reasons. 
      • First, it takes longer to do the backup.
      • Second, it is harder to search through.
      • Third, if the single massive zip file is corrupt the backup is useless.
    These are some serious issues I should deal with in my new solution. In addition to that I don't want to give up the power, flexibility, and--let's just go with--geek pride a scripted solution provides. Geek pride could be replaced with frugal, but to be honest some of this stuff is a little fun to figure out. Saving a dollar is a by product more than a motivator.

    Friday, December 12, 2014

    A Real Ajax Login System

    Dashed borders lets you know this is
    hard core web design.
    Demo | Source

    After a bit of Google searching, I could not find the login system I want. I would say 'fit my needs', but that's not accurate. There were tons that could fit the need, but I want a back end php system that allows a user to login by way of ajax calls. Specifically one that didn't require all my file names to end in .php. Is that necessary? No. Is that being picky? Probably. Is it fun to make it work anyway? Of course.

    There are plenty of php ajax style login systems and examples out there. I started with this one from 9lessons.

    I have no right to complain about other people's work, but wow this code is hard to read and inconsistent. It works though, so I chose to clean it up and start making changes.

    DISCLAIMER: I would like to note I am not a security expert. While I feel this system is decent enough, I cannot advise using it in a real application environment.

    Here is a demo, note all pages end in html. You can log in with demouser and password, but check out the registration. That's where most of the magic is.