ryePDX

Adventures in technology

Life streaming and ryepdx.com

I was reading a few tech articles today and watching some cool videos when I realized I consume way more tech knowledge than I disseminate. I started thinking about whether it would be possible to disseminate as I learn, whether I could expedite that process. This converged with what I’d been reading about (data rot and the loss of historical artifacts to neglectful storage techniques) and an idea that has been tugging at the corners of my mind since I was in grade school: personal historical documentation, the idea that my experiences and environment could be preserved indefinitely for the benefit of future historians. On top of all this I encountered an article last night about “life streaming.” It talked about Storytlr which, as far as I could tell from the brief glance I gave it last night, amounted more or less to a feed aggregator.

My long shift in the CS lab was today and I forgot to bring the charger for my laptop. I started playing on the whiteboard instead and this is what I came up with:

Life streaming

  • Phase 1 – the immediately achievable
    • Browser plugin for Chrome & Firefox (my browsers of choice) which tweets and social bookmarks pages I like at the press of a button. Option to comment as I share. Tweets should be tagged with “#visited” or something. (I have a feeling this functionality might already be out there, but I’ll have to check.)

      Also allow for the upload of the set (i.e, no duplicate URLs) of my browser’s history at the end of the day, minus all my visits to Gmail and Facebook.

    • Use Shazaam and my laptop’s microphone to automatically tweet what I’m listening to. (Tagged with “#listening_to”)
    • Publicly accessible SVN repository (or at least a public folder) for non-proprietary code I’m working on. Integration with Drupal (or Storytlr, if I make the switch), maybe with TRAC or SourceForge as a middleman for categorization and ease of use purposes.
    • SVN for written works, possibly with “time travel” slider in a Drupal/Storytlr module.
       
  • Phase 2 – the possible future:
    • Integration with the soon-to-be-released Courier to allow you to flip through anything I write in that particular notebook.
    • Armband/glasses cam and mic with “point of interest” button to mark video data for expediting/automating the creation and upload of video blogs.
       
  • Phase 3 – the future fantastic:
    • Shazaam integration with armband/glasses for real-time and portable “what I’m listening to” data.
    • Add GPS to armband/glasses to record location information. Could be used to automatically create 3D models of surroundings via PhotoCity-like software.
    • Book recognition via cover (front or back, image recognition or ISBN extraction) or example text extrapolated from image via OCR and identified via Google Books. Could allow automation/expediting of a “What I’m Reading” function.
    • Speech recognition in armband/glasses for on-the-fly (if possible) creation of todo lists and appointments.
    • Movie recognition for “What I’m Watching” feature.
       
  • Notes
    • Twitter to be used as an event alert service, using hash tags for categorization. (i.e, #read, #wrote, #coded, #updated, etc.)
    • Organizing all the data which will be produced may prove to be an enormous challenge, especially as life streaming gets smarter. A way to zoom in and out to various levels of detail may be useful, as would some kind of search engine capable of handling multimedia information.

Magic Parser vs. SimpleXML

Recently a client hired me to create a PHP script to populate a MySQL database based on data in a series of XML files. A simple enough task, but the client had recently spent $80 on a product called Magic Parser and so wanted me to use the tool in my code. While I am sure the expenditure would have been worth it had the task been different, I was not at all impressed with Magic Parser’s performance with this particular task.

When I’m parsing through XML code I really want a tree-like structure. Magic Parser returns everything in a flat array, with tag names separated by slashes. For example:

A

would return

Array([FOO]=>”", [FOO/BAR]=>”A”)

This causes problems if there is more than one tag with the same name. For example:

A
B

They work around this by sending three arrays to the callback function:
Array([BAR]=>”A”)
Array([BAR]=>”B”)
Array([FOO]=>”", [FOO/BAR]=>”A”)

This actually makes it harder to process the XML than if I were using SimpleXML, as SimpleXML would return:
SimpleXML Object([bar]=>Array([0]=>”A”, [1]=>”B”))

In SimpleXML I would just have to cycle through the array attached to the “bar” property of the SimpleXML object. With MagicParser I have to figure out if it’s sending me a “BAR” array or a “FOO/BAR” array.

The moral of the story is that if you just want to parse XML data, give Magic Parser a wide berth and stick with something like SimpleXML. It does the job better, it’s free, and it’s part of PHP’s default installation.

Interesting article

I just read this article on programming and I thought it would be worth sharing. Since I work with strings a lot most of this wasn’t really new to me, but I did find it interesting since at Fox we do use Java as one of our introductory languages (the other being Python.)

It’s about the need to understand what goes on at the low level of the machine in order to write good high level software. It uses string processing as an example.

http://www.joelonsoftware.com/articles/fog0000000319.html

My world view has salespeople in it.

I have been trying to make money online for over two years now. I succeeded with FriendBlastr and then proceeded to fail with everything else after that. FriendBlastr, I now see, was an outlier. It worked not because I was good at what I was doing but because the market was so hot. I had a few good ideas that certainly helped, but I do believe my approach was all wrong. Looking back I suspect I could have made more money than I did because of a fundamental flaw in my world view.

In my world view I believed I was an individual agent disconnected from all the people around me. I wouldn’t have articulated it that way but my actions revealed that was my mindset. With FriendBlastr I did all the marketing, programming, and maintenance by myself. I did hire somebody for short period of time but I dictated all their actions and found I didn’t save all that much time. I just finished reading some ad copy that made me realize that as a sole proprietor it should not be my goal to be my company’s sole employee. The man writing the ad copy mentioned in the course of his discourse that his company grew from 12 employees to 48. What was interesting to me was that he seemed to assume that it was normal to have employees. Turns out the world is interconnected. Go figure, huh? :-D

What I mean by that is I can’t pretend that I am not reliant on others for my success. While I can realize some level of success on my own (vis a vis FriendBlastr) I must necessarily grow my “company” by growing my network of professional contacts. It is this network of professional contacts which will enable me to collaborate on larger projects than I would be able to handle my own. Furthermore they will allow me to realize things which I have not the skills for. For example, in running FriendBlastr I was able to realize that marketing is not my forte. It is, at the least, something I need to work on. In the meantime it would appear that I am better off involving marketers in my efforts.

I’ve also realized that the content providers are not necessarily the ones who make the most money. My entire attempt to make money online has been marked by my refusal to be anything less than a content provider. In reality it seems that the ones who sell other people’s products are much more likely to be cashing big checks. I do believe that the content providers on the Internet outnumber the salespeople. This could be for a number of reasons, though the most likely seems to be a close connection between the Internet and the content centric technical community, but it seems to be that the ones who make money are the ones who can convince people to buy. This means that most of the moneymaking schemes listed in the books online and pushed in various webinars are simply different permutations of the same concept: be salespeople. This means that the most important, basic knowledge one can obtain is how to be a good salesperson. Unless you know that it won’t matter what Google tips you know or what technical knowledge you have because the most basic purpose of sales is to persuade people. Because it just so happens that persuading someone is a lot easier when you present them with the product that they need, that will make their life better, we spend lots of time and energy doing market research and learning how to present people with products. None of that will matter, however, if after reaching our target audience we cannot persuade them to buy. Thus we must learn how to persuade people. Everything else is just environment.

What’s really interesting to me is the fact that as a sales person I can choose any company with a product I like and sell it. I can make money without having a product, without having to provide support, without having to maintain a product. It takes a lot of the work load off of me as an entrepreneur and essentially allows me to engage in obtaining multiple streams of income. While I can’t deny that it will take a lot of work, it still seems like a highly viable path to success. I admit that I’m tempted toward it and will perhaps pursue it at one point, but in the meantime I still have other projects to finish. At the very least I now know to involve good salespeople in my future pursuits.

Running away from Mono

I may have spoken too soon in that last post. It turned out there are a few very problematic bugs in the WinForms library that are keeping my application from running properly. While I realize that converting everything over to GTK# would probably solve my problems, the proposition is not one I am at present willing to undertake. Thus it seems I am back to developing solely for Windows on the whole. I do have plans to try porting the application to Java at some point though. Apache’s HttpClient class looks rather promising and I theorize that the AOT compilers available for Java will essentially make Java what I had hope Mono would be: a way of deploying an application to multiple platforms from a single code base.

I ran into two bugs that doomed my project. The first was the one which freezes your program if a delegate launched from an event handler tries to call MessageBox.Show(). Once I figured out that I just had to put the delegate in a new thread to keep things moving, it seemed I was back in business.

Since I was doing this all as part of a login form which was supposed to return to a larger form after execution, I had the larger form calling ShowDialog on the login form. Turned out that calling this.Hide() on my login form from the thread mentioned above closed the form as expected but failed to return control to the parent form. Thus my program was essentially frozen. This caused me some consternation, but I figured I could just have the login form construct and call the main form instead of the other way around. Sadly I neglected to realize that creating a form from a thread would cause the form in the thread to be disposed of after the thread finished execution. That was the last straw for me. It’s not so much that these bugs are insurmountable: given time I could easily work around these foibles. The problem is that I don’t know how much else about WinForms is broken. Plus I looked on the bug tracker and saw a few bugs that were over a year old, which didn’t exactly inspire confidence in me. While I suppose this is an open source project and I could in theory fix it myself, I simply don’t have the time to do so. I want something reliable that works like I expect it to. Thus I find myself pushed towards Java for my cross-platform needs.

I’ll keep you posted on my trials and travails.

Porting to Mono

I came across an error while porting to Mono. It read: “Unhandled Exception: System.Resources.MissingManifestResourceException: Could not find any resources appropriate for the specified culture or the neutral culture.”

This is the long-winded story of how I solved the problem.

I’ve been developing in C# with Visual Studio for somewhere around two years now. I really like Visual Studio and .NET makes life so much easier. However recently I’ve become acutely aware of the folks who cannot run my programs because they are on Linux or OS X. I know Java’s cross-platform and I’m fairly familiar with it, but there’s still the matter of running a virtual machine on the client’s box and actually converting all my code from C# to Java. Though they are similar enough, my code depends rather heavily on .NET and I really wasn’t looking forward to porting.

Then I thought to myself: “You know, I’ve been hearing some really good things about Mono.” After doing some research I decided to give it a try.

For those of you who have not heard, Mono is an open source, cross-platform implementation of .NET. It essentially allows one to port .NET code from Windows to Linux and OS X with more or less ease, depending on how far into COM objects and Win32 calls you’ve delved. The closer you stay to .NET proper the easier the conversion. In my case I was able to open my Visual Studio 2005 solution in MonoDevelop and compile right away. There was, however, one error and it’s for this reason I’m writing.

The error I got was “Unhandled Exception: System.Resources.MissingManifestResourceException: Could not find any resources appropriate for the specified culture or the neutral culture.”

There are apparently a number of reasons this error could arise. In my case it was because for one reason or another my Resources.resx file was not being properly linked to the requesting form. I was trying to load an image from Resources.resx into an ImageBox control on a form called mainForm.cs.

I never figured out why Mono didn’t like what I had in the first place, which was: this.logo.BackgroundImage = global::FriendBlastr_Stingr.Properties.Resources.logo;

I did manage to get it working though. All I did was copy the resource (in my case this just meant everything between the opening and closing data tags for that resource; in your case it might mean the assembly tags as well) from Resources.resx to mainForm.resx. There was no reason for that resource to be global anyway, so no harm no foul. Then I changed the line of code previously mentioned to:
this.logo.BackgroundImage = ((System.Drawing.Image)(resources.GetObject(“$this.logo”)));

(Note that I also changed the name of the resource in mainForm.resx from “logo” to “$this.logo” for consistency’s sake.)

Now it works like a charm! :-)

Happy Holidays

To everyone out there: may the holiday season be a time of happiness for you!

I’m TERRIBLE at blogging!

I don’t write nearly enough. I think it’s because I tend to put way too much on my plate and then forget about the things I’ve been meaning to do. Has it really been ten days since I wrote last?

I finished reading Snow Falling on Cedars. Excellent book. I would recommend it if you haven’t read it yet. I’m now starting on China Miéville’s Unlundun. The prose is a lot different from Guterson’s. Way less detailed, not as rich. It’s like going from a rich chocolate lava cake to an Otter Pop. Somehow I feel a little unsatisfied. However, I must be fair: the two books were written for completely different audiences. Where Guterson obviously had an adult audience in mind, Miéville wrote for young adults.

The book is still an enjoyable read, but it leaves me in a quandry as I revise Waterdeep: who am I writing for? I seem to gravitate more towards a young adult/trade paperback feel, but there was something about Snow Falling on Cedars that entices me. Makes me want to write deep, rich prose. It put me in a different frame of mind, just through the force of its texture and weight. I’m tempted now to do the same with my own novel.

Happiness

I’m sitting in my apartment drinking lemongrass green tea and listening to my friends, Jon and Felix, playing some of Jon’s music. They’re prepping to open for one of Cindy’s drama productions.

Life is happy. :-)

Plug: Jon has a website over at http://primotivnation.blogspot.com/

NaNoWriMo is over!

I started out November 1st and stuck with it until I’d finished the first draft my novel, Waterdeep. It takes place in the same universe Connelly’s story does, but at an earlier point in time. All in all it clocked in at 50,193 words. Now to write the second draft! I’m already seeing places where it can be tightened up and fixed. I’ve got a thick stack of paper on which every word has been printed. Soon a smattering of notes will line the margins, I’ll start making outlines, and I’ll be on my way to an even better version.

Which brings me to the next bit: I’ve been writing short stories within my universe to kinda’ help flesh things out. Unfortunately I’ve also started trying to publish, so the most I can give here are short little snippets. I’ll keep you posted on the places that publish me though, for sure!

And now, here’s the little image I got for completing NaNoWriMo. I needed a place to put it and here’s just as good as any. :-)