Tuesday, July 26, 2011

Blender Ops, MVC, and More Monkeys


I got a lot done last week. I'll do my best to keep this blog entry short. Let's get to the week in review.

Blender Addons - Blender Operators and CMS
String It got a point upgrade. It now has hook support so that the objects that the generated curve runs through actually attach to the objects themselves. Also, demo videos for this and my other scripts got posted to Youtube this past week. As an extra challenge, I wrote an operator that syncs rotation of multiple selected objects. This last script gave me good practice on modal ops but it probably won't make it to the site.

As Blender Addons grows, a cms system becomes more appealing. This and my web hosts support for it justified a local Joomla installation. However, it'll be awhile before a CMS switchover actually happens. Design issues need to be addressed first and it's not a trivial task. In the long run, it'll be worth it because the tools for managing and organizing content are pretty useful.

Game PD – MVC and the Javascript Bug Hunt
After spending time reviewing advanced PHP concepts, it became apparent that MVC style code layout could be done easily in Game PD. In Java web applications, it's pretty obvious what belongs in a data class, a controller servlet, and a JSP page. However, with the right amount of discipline and a few well placed require statements, you can have the same benefit in a PHP project too. This project now has the advantage of MVC style organization with none of the XML hassle.

A Javascript bug in the project taught me an important lesson about functional programming. Page navigation died when page reloads happened. The root cause turned out to be a function being accidentally passed to another function rather than it's result. It was a good debugging challenge and it served as a cautionary lesson about the kinds of traps you can fall into with this style of programming if you aren't careful.

JMonkey – The Red Ball
My latest baby step back into Java was a JMonkey project where I rewrote some code to turn a blue cube into a red sphere. What struck me as interesting was it felt like familiar territory already covered in tutorials I did on Python development for Blender. It was pretty easy stuff so I have to give credit where it's due. JMonkey, so far, is pretty friendly to newcomers.

In Summing Up
So between Blender Addons, Game PD, and JMonkey, my development endeavors have effectively evolved into a 3 projects. A lot got done and there's a lot more coming down the pipe. My backlog, as it stands, has 8 serious items to tackle and it's time to get to it. I look forward to sharing more next week.

Sunday, July 17, 2011

A Cookie, A Monkey, And A Linked List


Blender Addons has a ways to prove itself. Five add-ons is a good start but there's still much to do. Here's what's been happening.

Particle Tracer
Particle Tracer is an add-on I wrote that uses particle locations to create curves. The order and/or chaos in the end result reflects the intention or degree of skill the user has when configuring a particle system. It's a good script for creating simple curves that look like flailing noodles or something fancier if that's what's desired.

JMonkey Investigation
JMonkey is a compromise. When I code unpaid and open source, it's computer graphics and Python and PHP are the right fit for what I do.  However, I'm also looking for paid work.  When tech recruiters say they want Java and .NET, they mean it.  The idea of accepting programmers from other languages doesn't fly. Since JMonkey is both Java-based and generally known and respected in the open source graphics community, I went with it.

My first impression is it's good. You can get a Netbeans based environment with all the libraries you need to start. The “Hello World” it gives you for a default project comes with a 3D cube you can interact with. Judging by the demo videos, it has a lot of good capabilities. There might be future projects in this.

Linked List Challenge
A famous interview question asks “How would you write a function to iterate backwards through a singly linked list in C?”. Most interviewees from entry-level to kernel hackers get it wrong and get eliminated for it. I wonder if they should.

The first thing I take issue with is the candidate is asked to do it in C. Most people's programming background is pretty high-level which would make C seem pretty intimidating.  Candidates should be focused on the problem without being distracted by the syntax of the language and C often makes that task needlessly more difficult.  Candidates should be allowed to use either pseudo-code or their comfort language to tackle these sorts of questions.

I wrote a Python function to solve the problem in 10 minutes which brings up the second issue I have with it. It's easy to solve the problem if you can think recursively. Recursive thinking comes easy if you do a lot of functional programming.  I use that kind of thinking frequently in the Python and Javascript code I write.  

However, I suspect most good enterprise and business developers manage just fine without functional or recursive thinking in their daily work.  It doesn't apply in every situation.  Most of the time, it doesn't even apply in the context of the job the candidate is interviewing for.

Cookie Setting in Uncle Squirrely
I decided I wanted Uncle Squirrely to remember what game ordering and platform they were last on when they left the app and came back later. It was a good excuse to get into cookies.

I had the cookie setting happen on the server side. I let a JQuery plugin handle the job of reading cookies and turning the data into a GET request. This meant the server-side didn't have to worry about how the data was coming in. It was a pretty simple yet interesting experiment overall.

And That's It
Another satisfying week done. I'm looking forward to the next one and you'll hear from me again soon. Cheers to all.

Monday, July 11, 2011

Junior/Mid-Level and Independent

The other day, a guy called to talk about a PHP developer position for an e-commerce site in Washington state. Washington is friendly territory for Amazon affiliates which makes it very appealing just on account of my own web sites. Having a solid background in PHP with no financial incentives certainly doesn't hurt as credibility goes. The qualifications matched beautifully. With a list made up of PHP, Javascript, CSS, SQL, and HTML, it would be difficult to be a more perfect match to my own skill set.

The only warning sign was getting an email before the official phone screen that the position required 5 years of PHP experience. Now experience is a funny duck. Any developer whose history is even remotely interesting will not spend 5 years working with one core language for all projects. My own experience was a delicious sandwich of server and client side technologies for all kinds of projects. Since PHP was what I started and ended with, you could call that language the bread I guess.

Here is something I find interesting. Back in college, a 3D site called I.L.B. Productions was my first personal web project which I did in PHP.  Fast forward to present day and you have Uncle Squirrely and Blender Python Tutorials which were my other two. Very little money was made on any of these projects but much fun was had. However, when it came down to the REAL phone screen, the woman I spoke with was not impressed enough with this or any of my non-PHP work to give me much consideration for the job. Experience with large scale e-commerce projects was a biggie and they wanted someone senior level for it.

Now there is a general rule that "senior developer" and "5+ years experience" of paid experience go hand-in-hand. My caliber is absolutely junior to mid so being judged as under-qualified for a "senior" role is fair. Part of the issue was because it was largely expected to be remote work and the client likes their junior and mid-level people to be physically there. So while relocation at this point in the job search is absolutely back on the table, senior is senior and there is no getting around that.

The "senior" vs. "junior" problem is interesting as job hunting goes. Dice.com searches show Connecticut has 26 senior developer job openings for every 1 junior position. The root cause of this situation is subject for debate. Still, this makes a layoff in the 2 to 5 year experience zone look like absolute death to such developers.

These are the challenges I face in the search for paid work. It's neither good nor bad but it is reality. So why on Earth do I still bang out code and throw that stuff out on the Internet if the odds are against me? Well, it's just plain fun. As for the job search itself, I like to quote Han Solo in Empire Strikes Back when he says...

"Never tell me the odds."

Sunday, July 3, 2011

Add-On Development and the New Mission

Non-Blender Project Updates
The past week has been interesting as projects went. I tackled some older web technologies in the form of a regular expressions project and some Apache configuration research focused around CGI. These are pretty old technologies but still very much worth knowing about.

More On String It
The bigger deal of the past week was completing a new version of “String It” and putting it up on my site. String It has an actual user interface as well as support for two spline types now. I posted about it on the Blender Artists forums and the response has been pretty positive.

More About the Change in the Mission
I've said before that Python app scripting tutorials don't work as a business model. There are some things that can work though. Developing and selling add-ons for 3D tools can work. Writing open source software can also work. If both of these business models can succeed, then combining the approaches to base a business on open source 3D add-ons might work too.

This is why the official mission of the site will be making open source add-ons for Blender. “Blender Python Tutorials” will be renamed to “Blender Addons” to reflect this new focus. The tutorials will stay for the time being because they do add value to the site. Those that come for the tutorials will find the add-ons with full source code provide useful examples to learn from. Those who don't care about programming will also benefit from those same scripts. It's a win for everybody.

The Coming Week
The coming week will focus on two tracks. On the web track, there is obviously some site work to be done. On the add-on track, there are some small improvements on String It planned. The API support for particle scripting also looks pretty promising and worth experimenting with at least. It should be interesting to see how it all works out.

Monday, June 27, 2011

Curves, Regular Expressions, and Blender Data Pages


This was a pretty busy week that saw a lot of victories and interesting developments on small projects and experiments. Here are some of the highlights of what happened.

String It
Last week saw the release of String It. String It is a Blender add on that generates curves that run through the center of selected objects. Right now, it just supports bezier curves though future revisions could support other spline types. Also, it might one day include support for automated hook modifiers to bound the the objects to the curves that run through them.

Regular Expressions Challenge
Repetitive work involving removal of Amazon anchor tags inspired a scripting project to automate those kinds of tasks. A practice challenge with regular expressions on an old copy of one of my PHP files was called for. The project ran into some problems. For example, what does one do if there are two sets of anchor tags on the same line being evaluated? An oversimplified expression might match both sets along with any text between them. It's interesting enough to merit further investigation.

Blender Data Pages
One of last week's projects confirmed that it is possible to have a server script invoke Blender in a way that lets the script print blend data on a web page. The project only required a PHP page, a blend file, and a few lines of Python. While it was easy to do, security concerns prevent me from making a full project for production. Still, the idea of something called "Blender Data Pages" does have a nice ring to it.

Generator for Uncle Squirrely
Usage of the any() function in Uncle Squirrely's database update script made the code cleaner. However, that meant evaluations on whether or not a game belongs in the database had to go into lists. Since every evaluation in the list has to be evaluated, that caused an efficiency hit. Sacrificing performance for code aesthetics was not a good trade off.

Lazy evaluation courtesy a generator function is the best of both worlds. Basically, all I needed to do was put all my evaluations in it's own function. If you put yield statements between evaluations, what you get is a function that can be iterated on the same as you would with a range function. It was easy to learn, easy to implement, and lead to lazy code that looked great. All projects should be that easy.

Other Little Things
In the near future, Blender PythonTutorials will be an add-on focused site. Moving the add-on scripts link to the top is one step toward that goal.

Last, but not least, I have a special lambda utility I like using for searching module properties.  The problem is I found myself rewriting it everytime I needed it. Finally getting around to putting it in my PYTHON_PATH reduced that typing to an short import statement. It also made the utility available both in and out of Blender related Python projects. It should have been done sooner.

As you can see, it was a pretty busy week. I learned a lot, put good stuff out there for users, and got inspired to explore other ideas. These are the things that make software development the worthwhile endeavor that it is.


Sunday, June 12, 2011

The Teacher is a Maker Now


The week's theme was on setbacks and moving forward in spite of them. Let's review what happened.

Broken Microphone
My microphone no longer records intelligible audio.  This killed the voice part of recording for the GUI and Panel Basics video tutorial.  Lack of money for new equipment forced a change of strategy.  Annotations acted as a substitute for audio.  Well-timed notes and speech bubbles made the video shorter. While these got the job done, I'm not sure more video tutorials with this limitation are worth it.  Because of the limited value of making new tutorials at all, I think I should call this latest one my last.  It's time to focus my efforts where they'll do the most good.

Losing Amazon Ads
There are no more Amazon ads on my site because I live in Connecticut.  My governor passed an affiliate sales tax law.  Amazon is now supposed to levy my state's sales tax if users arrive there via my site.  They didn't like it so they closed my account along with every other Amazon associate living in Connecticut.

This makes for an interesting problem.  To find a replacement affiliate program, I'd need something that dealt in books and computer hardware.  Also, they would have to be widely known and trusted.  Thirdly, they'd have to tolerate my state's affiliate tax.  That's a pretty tall order.  It's likely easier to figure out a business plan that doesn't need affiliate programs.

Moving Forward on Python Developments
The setbacks got me thinking more about writing code.  A better version of my animated mesh mangler now sits in the script section of my site.  I submitted my pyramid generator script to the Blender tracker for consideration in the next Blender release.  I've also started playing around with curves in the Blender API.  It'll be interesting to see how this all turns out.

What This Week Drives Home
The good thing about losing Amazon and my microphone is how it pushed me change priorities.  The transition from tutorial writing to development is complete.  For better or for worse, the teacher is a maker now.  Maybe the change was overdue.

Sunday, June 5, 2011

Thoughts on Python, Marketing, and the Future


I have a confession to make.  I'm a better programmer than I am a business guy.  However, much of the focus last week was on marketing, design, and the business angle of Blender Python Tutorials.  Here is some of what happened and the conclusions I came to.


Marketing and Design
Advertising is a key component to marketing with Blender Python Tutorials.  Failure of past ads to generate revenue lead to changing to an approach based on text ads instead of graphical ones. More layout improvements with respect to ads may also improve the situation. Time will tell how effective this will be. However, even if it fails, the site design is still improved over what it was.

Knowing one's audience is also an important part of marketing strategy.  Time with the Blender Artists forum helps me better understand the concerns of other script developers. My posts include a tag line that links to my site which helps drive traffic. However, I only post when I have an answer to give or something real to share. Otherwise, I lurk quietly and listen.

The Business Plan Is Wrong
My business plan focused on training on a specific case of software-embedded Python. The idea was to make ad money on tutorials and the occasional example script. It failed.  Some research as to why was in order.

Here's what I noticed. Python is embedded in a lot of software projects. Blender, Inkscape, GEdit, Houdini, and Gimp are a few that come to mind. Those projects reaped the benefit of hundreds of extensions and plugins. These improvements may not have happened to this magnitude had the developers not made the decision to embed Python into their code bases.

However, a few Google searches on tutorials for Houdini Python, Inkscape Python, and so on produced some interesting results. Results ranged from single blog posts to master classes. What I did not find were successful businesses based solely on script training for a specific application.

There is a reason for that. Once you know a programming language, any good developer will pick up what they need as the need arises. This isn't to say tutorials are a waste of time. However, most learning comes from looking at examples and API references, asking questions, and writing your own code.

The Future of Blender Python Tutorials
My time spent working on Blender Python Tutorials was worth it. The site is a good resource and I'm a better programmer for having done it. It's also my way to give back to the Blender community that made such an excellent 3D package free for me to use.

However, there is only so much further my tutorial site can go. There is still more Youtube work to be done. Aside from that, the focus will shift more to developing software that's useful and solves real problems. Come to think of it, there might be a business plan in that.