Uncategorized

Learning Android (or, not)

Wednesday night some friends and I sat down armed with our G1s and laptops to write some code for Android. If you haven’t looked at Android yet, it’s got this whole Java framework you get to learn on top of your rusty Java. It’s been about two years since I even looked at any Java, and most of my evening was spent trying to convince Eclipse and SDK to play nicely together on my computer.

Since Android is so deeply seated in its own framework even though it’s Java you can’t just throw any old Java application on it and expect it to run. This seems a little contrary to Java’s big cross-platform compatibility promise. But since I’ve always found that to be a horrible lie anyway, I don’t really care. So I’m learning Android, and it looks a lot like Java.

The Android SDK includes an Android emulator so you can play with it even if you don’t own an Android phone, and while it’s dog slow to boot it works pretty well. You can set which version of the OS you want to run (1.5 is supposedly coming out this month), although damned if I know how; I just followed the instructions in the Hello World tutorial.

I have to say that this is the longest process from start to Hello World I’ve ever gone through. And that’s my main beef with Java. It seems like every project has 1000 classes and I spend half my time on a wild goose chase trying to figure out what a given line of code is doing. This is exactly the sort of thing I can’t stand about highly OO PHP projects like Magento. Even doing simple stuff feels really really bloated. With Android you can hello world in your code, but really what you’re supposed to do is load your strings up in an XML file, and then load the layout into another XML file, and then some depths of the framework I haven’t read up on magically know to throw this on the screen. Ugh. Maybe this is something I’d appreciate if I did much GUI programming in other languages?

Anyway, so we got through Hello World, and then I lost patience with both Eclipse and the Android framework. I closed Eclipse, and when I restarted it had apparently forgotten all about the Android SDK. I’m sure this is due to some error on my part, but given that it took me 20 minutes to convince Eclipse to install the SDK the first time I didn’t feel like doing it again.

The XML file for your gui is kinda neat, but the documentation is not particularly well laid out. After setting up my little sample XML file with attributes like “layout_width” and “layout_height” I naturally wanted to know what other attributes I could play with. Can I make it pink? Can I make the text an inch tall? The answer to all these things is of course “yes” but first you have to find the list of available attributes, and then you have to figure out what class you’re dealing with (TextView in this case) and then you have to find out all of its parent classes, and then compare all thath against the documentation which you can really only sanely traverse with CTRL+F because apparently they didn’t feel like organizing things with nice hyperlinks.

I’m sure that the Android documentation is totally fine for someone who is used to working with Java frameworks, but frankly I avoid most frameworks at all costs. This might be because I work mostly with PHP, and in PHP a framework is just one more slow broken thing you have to debug. So I’ll keep plugging away at Android, but it’s going to take a lot more reading than I have the patience for this week.

Business, Uncategorized

Getting Legit

Today was spent filling out forms, paying fees, and otherwise transforming Everything Tiny from a fly-by-night sole proprietorship to a legitimate LLC. I’ve waited until this long for a couple reasons…. for one I’m moving to New Jersey on Sunday, and it seemed stupid to set everything up in New York just to have to move it all in a few months. Secondly I wasn’t really sure if the whole thing was going to work, and didn’t want to fork over a ton of time/energy just to have to cancel it all next month. But after processing another wholesale order I figured it was time.

Here’s what I did:

Professional Printing

Up until now I’ve been printing my own packaging. When your packaging design changes every week, it just doesn’t make sense to have hundreds professionally printed. But I’ve finally got something I plan on sticking with for a while, so I went and ordered some nice glossy pre-cut matchbook covers (for the basic Tinysaurs) from overnightprints.com. I’ve heard mixed reviews for them – it sounds like if you use them long enough they’re bound to screw up irreparably – but I’m chancing it for now.

Federal Employee ID Number

I don’t have any employees now, but if things keep going they way they have been (fingers crossed) I’m going to need at least a part-time employee soon. So I went and got myself a FEIN. It took all of 5 minutes on the IRS website.

New Jersey LLC Registration

I’m now an official LLC, and can get a business checking account! The LLC forms were a little more in-depth than the IRS forms, and a little harder to fill out. I think the hardest part was figuring out what industry I’m in. Manufacturing? Arts and entertainment? Retail? Since my plan for this year is to do mostly wholesale and not retail, I went with manufacturing. There were some sub-codes for independent artisans, so I went with that.

UPC Codes

I plan on selling my stuff at some medium-sized retailers, some of whom use barcode scanners with their checkout. To get my stuff to work with their systems I need UPC barcodes on all my stuff, and each one has to be unique per product. I did a whole bunch of research… it’s expensive! You can register with GS1, but it ends up being abour $1000 to start, and then an extra few hundred dollars a year. I’m sure to a major manufacturer that’s nothing, but to me it’s pretty steep, so I decided to purchase barcodes for a reseller for the time being.

There are some drawbacks to purchasing from a reseller. First off, they’re not really your barcodes. They’re someone else’s barcodes, with someone else’s prefix, and they’ve been sold to you. For smaller retailers this isn’t a big deal. If you’re planning to sell your stuff to Wal-Mart or Target, this may cause problems. You also have to do research on your reseller – there was a change in GS1’s policies and only companies who registered with GS1 before August 2002 can resell UPCs. It’s really hard to find objective information because of course all the people providing it want you to buy from them.

Business Cards

Business Cards for real!
Business Cards for real!

So far business cards have been sort of an afterthought. Usually the night before a show I’ll think “Oh shoot, business cards!” and run some off on my home printer. I finally got my act together and had some printed up not only for me but also for my sales rep, Katherine (that’s right, I have a sales rep. You’re jealous).

Overall it was a busy day. I gave my business debit card quite a workout, and my books probably will look a little sadder this month than I thought, but most of it is one-time expenses I won’t have to worry about ever again. I rewarded myself with a bike ride through Liberty State Park with Chris, and we found that the Liberty Science Center is only a 5 minute bike ride away from home! This means we can go see films in IMAX and planetarium shows whenever we want. Now Chris is cooking dinner, I’d say it was a pretty good day.

Uncategorized

I’m so tired I forgot to title this.

I’m not kidding. I originally published this article sans title. This past week has been brutal. I’ve been getting ready for the craft show and my move to Jersey, and it’s been uphill. Things are mostly running smoothly now, but I’m tired. I just saw that it’s 9:45 and thought really? It’s only 9:45? Feels more like 11:45. So it’s gonna be an early night for me. Tomorrow will be spent frantically packing everything up for Richmond, and Saturday I head down to Philly to drive to RVA with Sara aka girlscantell.

I’ll quit whining and share this artist I found through an ad on Indie Craft Shows:


I have to say I really love Etsy seller (and RIT Chemistry student) beadworkbyamanda‘s nerdy jewelry. I’ve seen a lot of circuit board jewelry over the years, but this is the first that’s been nice enough I’d actually want to wear it outside of the hackerspace. She’s also got some rings which look equally awesome. Almost all of her stuff is sub-$20 which is a steal.

Uncategorized

Top 10 (or 6) Apps for the Tmobile G1

Last week I finally broke down and got a G1. Of course since I ordered it over the phone to get the maximum sweetest discount it had to be shipped, and just got here yesterday.

I spent most of the day playing with it, although I did somehow managed to get 60+ Tinysaurs packed in that time. I searched online for suggestions on good apps to grab, and found the suggestions to be really lacking. Really, gizmodo? An app to locate cab companies is on your top 10? For as often as I need a cab (almost never) I can just google it when the time comes. Really none of the top 10s I was finding had apps I cared about in the least.

So here’s my top ten list of apps to round out the G1.

  1. Toggle WiFi. It does exactly what its name implies. The WiFi connection can drain the battery a bunch when it’s on and not being used, Toggle WiFi gives you a one-tap option to turn it on/off.
  2. PDANet. This is a combination G1 app and PC app that makes it stupidly easy to tether your PC to your G1’s tasty 3G connection via USB. You don’t have to root your phone and since it’s USB instead of wifi both your laptop’s and your G1’s battery will be happier on long trips without a power source.
  3. ConnectBot. SSH client for the G1. SSH everywhere!
  4. NewsRob syncs up with your Google Reader account (which I’ve just started using in the past couple weeks) and can make articles available for offline reading. So I will finally have something to do on the subway besides play Zuma when I leave my DS at home.
  5. Twidroid is a twitter client for Android. So I can compulsively check my friends list whenever I want. I set it to update every 30 minutes in an effort to curb my addiction.
  6. Bubble. It’s a level. For your phone. We seem to have lost all of the actualy water-in-a-tube levels at NYC Resistor, so it’s all iPhones and G1s to align things. Hey, want to climb our homemade stairs to our loft? Oh, why not?

Ok, that’s only 6. I promised a top-10 list, what gives? So far I’ve only got 6 I think are really essential. I’m still looking fora to-do list (TooDo looks a little too bulky and intense for me), a couple decent games, something to handle my google docs elegantly, and some sort of note/doodle pad. Any suggestions?

Uncategorized

Nuts Fear Humans

Image020.jpeg
I’ll spare you the business pontification today to share this sign, spotted at a Dunkin Donuts on Willoughby St.

If you can’t read blurrycam (thanks, phone) it reads:

WARNING!

Nuts and Coconuts have serious allergen reaction to some persons

So be considerate of the nuts and coconuts out there and don’t ingest them if you are an irritating person.

Uncategorized

You Know What You Should Do…

Lately it seems like the phrase I hear more often than any other is “You know what you should do…” followed by a suggestion for my business. Or one of my friends’ businesses.

I highly discourage anyone from starting a sentence with that phrase, especially when you are talking to a friend who is trying to build a company/product. It’s not that we don’t appreciate the interest, far from it, but 9 times out of 10 it’s something we’ve heard 50 times before. And more than that, telling people what they should do, even when you’re just offering advice, is annoying.

There are a few ways to avoid this and keep yourself on your self-employed friend’s good side. First and foremost is to refrain from offering unsolicited opinions. If they’ve got that glassy-eyed “oh god I’ve been working 60 hours a day and I still have 100 things to do” look, keep your suggestions to yourself. For the sake of peace. Even if it’s a good idea, the thought of adding one more item to the brainpile might just be too much. If you think you’re really onto something, offer to share them when the person feels up to it. Saying “if you’re interested later I’ve got a couple ideas for you” is a lot less imposing than “hey you should make those blue.”

The second option is to keep just change your wording. Don’t say, “you should…” say,  “have you considered…” The difference is subtle, but can make the conversation flow a lot smoother.

For example, a lot of people suggest that I should sell my Tinysaurs in natural history museum shops. This is a great idea, albeit not a new one. The thing is there are some high barriers to entry for those shops, and without an in through some social networking they’re pretty much unavailable to me. I’ve spent a while researching it and it’s been pretty frustrating. Changing the sentence to “have you considered selling these in museum shops” makes it much less awkward for me to say “yeah, but it turns out its pretty hard for someone at my level to get their stuff sold there.”

“Have you considered…” or “what if you tried..” is handy even if your suggestions are soilicited. It’s a small change in phrase, but can make a big difference to the ears of an entrepeneur who is swamped with ideas and only has two hands to execute them.

Uncategorized

Packing Packing Packing

In a little over three weeks I’ll be moving from my apartment in Brooklyn to Jersey City, NJ. This is relatively new information, until recently I’d planned to move at the beginning of June. But plans change and now I’m moving the last weekend in April. Hooray!

I hate packing. I hate packing a lot. Here is my packing “strategy”:
> 2 weeks from moving day: go through everything carefully, deciding what to keep, what to goodwill, and what to throw away. Organize things into carefully selected boxes of like items. Mark clearly on the side what’s in there “Audio Cables” or “Books.”

>  1 week from moving day: get a little lazier about the whole “like items” thing, packing whatever fits together in the box. Start to see boxes of “Shoes, office supplies, some embroidery floss.” Stop actually checking to see if the box of embroidery floss that’s been sitting on the shelf all year actually contains said floss. At this point I also come across items which got separated from the rest of their bretherin, and sit on my desk until I decide whether or not to open the box they belong in.

Less than one week from moving: Flail arms in frustration as remaining items do not wish to be organized. What category does a crochet Katamari fall under? What about this lego sculpture?! Chuck it all in any box. Who cares what it is or why I own it. I’ll figure it out when I get to the new place and unpack it. 9 times out of 10, this box  won’t get unpacked for at least a year, and may never get unpacked.

Since we’re still more than three weeks away from moving, I’m opting for an unlisted option: procrastinate in any way possible. Offer to do favors for people. Have lunch at that really slow place around the corner. Scrub the sink. Catch up on Dollhouse. You know, things I really have to get done today, yup.

I hate packing.

Uncategorized

PHP Templating with mod_rewrite

There are lots of different methods of implementing design templating in PHP and I pretty much hate them all. So I came up with a new one, which may not be better than the others but at least it’s different.

The template markup is stored all in one file, creatively titled template.php. For organization I stuck it in my /includes folder.

Each content page is in a directory called /pages. So my login page is in /pages/login.php. The content pages don’t contain any calls to the template at all, they contain only the logic/output for that particular page.

The template page is called with a filename in the URL, i.e. template.php?page=login. This little peice of code hangs out near the top of the template page, before any HTML output (but after all the includes for various libraries / any session or cookie handling):

$page = $_GET['page'];

//output buffering is needed so we don't puke the contents of the page above the HTML headers
ob_start();
//Check to see if the file exists
if(file_exists($_SERVER['DOCUMENT_ROOT'].'pages/'.$page.'.php')){
//if so, require it
require  $_SERVER['DOCUMENT_ROOT'].'pages/'.$page.'.php';
} else {
//if not, returna 404 error
header("HTTP/1.0 404 Not Found");
exit;
}
//store the output of our page in a variable
$content = ob_get_contents();
//empty the output buffer
ob_end_clean();

You need to include the page in the template before the start of  the HTML output or else any cookie/session stuff in the page won’t work. Buffering the output lets you call the script now but not display its contents until later.

In the middle of our template markup, where we want the page content to appear, there’s a simple <code>echo $content</code> to place the output on the page.

Of course at this point if you want your template to show up you have to access everything through template.php. http://www.whatever.com/includes/template.php?page=login is not an attractive address. So I use mod_rewrite to hide it.

Putting these lines in my .htaccess file lets us use nice urls like “http://www.whatever.com/login.php”

RewriteEngine on
RewriteRule ^(.*)\.php include/template.php\?p=$1 [QSA]
RewriteRule   ^$  include/template.php\?p=index

The first line just turns on the rewrite engine. The second sends anything ending in PHP to the template page. The QSA flag passes the query string along with it, so mypage.php?id=foo will still pass ‘foo’ correctly.
The last line handles the index page redirect for us if they just come to the bare domain and not a particular page.

Additionally it’s a good idea to add a couple lines to not redirect files which are already in our root directory.

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l

If you are of the opinion that this is a terrible idea which should never be used, I’d love to hear why. I really doubt  I’m the first person to think of it, but I’ve never seen anyone else do it, so I’m wondering if there’s something terrible about it that I’m not aware of. I know there’ll be a performance hit with mod_rewrite, but pretty much every other CMS I’ve seen uses mod_rewrite to make their URLs pretty, so I’m not convinced it’s any worse than the other stuff that’s out there.

Uncategorized

Teaching Classes in New York

If anyone is in New York or the surrounding areas, I’m teaching some classes at NYC Resistor over the next month, hooray!

Needle Bed Learn To Use the Knitting Machine

Sunday, March 8, 1pm-3pm

Learn to knit on our super awesome knitting machines. The class will cover all the basic, troubleshooting, machine care, and how to shop for a machine of your own.

Beginning PHP

Saturday, Feb 21, 1pm-3pm

Learn the basics of PHP, one of the most popular languages for creating dynamic web pages and web applications. We’ll cover everything you’ll need to get your first script up and running, and where you can go from there.

Image Manipulation with PHP and GD

Sunday, March 15, 1pm-3pm

GD image libraries can be used with PHP to manipulate and create images on the fly in your web applications. Create thumbnails, crop images, draw graphs, and more from within your web application.

Small Object Photography

Saturday, March 28, 1pm-3pm

Learn how to take good photographs of small objects on a shoestring budget. You don’t need to spend a lot of money to take good photos of your projects / products / jewelry / etc. Learn about cameras, lighting, and make your own light tent.