Author Archive

I have been a programmer for years - since the age of 13 (and now I’m 37). Being of this age group, one can almost immediately assume that I learned how to program on a Commodore 64 or other 8-bit computer of its era. I rarely hear about programmers who learned how to program on an Atari 800, though I do have a cousin who attempted it. I remember writing some code for the Apple IIe for my first high school computer class - using medium resolution graphics, I created an animated movie of a guy robbing a bank, and accidentall setting off an alarm. It ended with his car going off a cliff and exploding on impact, after a police pursuit.

As many programmers my age, I eventually learned C (Borland Turbo C++ was a great compiler for this purpose). This required some retraining. It was then that I realized that whatever programming language that I was going to learn in the future, they would all have some fundamental ways to handle input, output, conditions, functions, and loops. Once I realized this and approached a new language with this in mind, the first things I would set about learning were how to do these actions in the new language.

These days, the BASIC language that I now use is Visual BASIC .NET and VB 6.0 (notice that BASIC is rarely written in uppercase, anymore?). I had to write programs in Visual C++ for my online college classes, as well. Nonetheless, I now find myself at a crossroads of deciding whether to continue my career as a PHP web developer or start learning C#. There are not as many PHP job offerings in the market, these days, here in Michigan. Plus, as I work for an auto parts supplier, I think there is a strong possibility of some layoffs. I might be spared since I am the company’s only web developer, but it is still not a good situation to see fellow IT workers disappear from lay-offs.

I have done my best to keep up with learning new things. This past year, I spent my off hours programming for a Flash designer, writing applications that utilize Actionscript 3 and Flex 3. I also wrote some applications in JavaScript which I applied in my workplace - utilizing the Ext JS framework for DOM manipulation and AJAX. I also learned how to use Prototype and Scriptaculous, and am thinking about learning more Dojo and some advanced Actionscript. But I have to be careful with how I spend my time, because with impending doom approaching, I think I should sharpen up my understanding of C#. Nonetheless, I believe that my AJAX understanding will be very helpful, as I use C# for web applications. I have also considered learning how to write applications for mobile phones like the iPhone and Android.

So my recommendation for other programmers - always continue to learn new things, and be flexible and open to new technologies, at all times. Do not become complacent and believe that your current skills will always be enough to get you by, in the future. The current languages that seem to be sticking around in the marketplace are Java and C#. PHP, and Ruby on Rails seem to be coming in behind as languages that consultants will use. Flash/Flex, Silverlight, and Javascript AJAX libraires, will also become strong contenders as more businesses turn to focussing on Web UI or Rich Interface Applications (RIA). I am grateful for the time I spent learning Ext JS, utilizing the whole library and extending some of its classes. I am also grateful for learning Flex 3 this year. Now I think that C# and Silverlight will complete my “Jedi’ programming skills, and I’ll be ready for just about anything that comes my way.

Comments No Comments »

I typically use the PHP output buffer to either change the output going to a page, or retrieve the output and direct it to a file.

For example, consider the following:

  1. // start buffering the output
  2. <?php
  3. // echo a possible mysql_error if it exists
  4. // get the buffered output and clean/stop the buffering
  5. $buffered_output = ob_get_clean();
  6. // save the output to a logfile - append if file exists
  7. file_put_contents("mysql.log.txt",$buffered_output,FILE_APPEND);
  8. ?>

Comments No Comments »

I am so tired of looking at many regex (regular expression) examples for Javascript that look good, and are very verbose, but ultimately do not provide any code that can help you solve a real world problem!

Here’s a function that I use in conjunction with Ext-JS on some legacy templates. I take the search results from an Ajax call, feed the response string and do a search and replace on the HTML returned, to grab certain portions of the page I made the Ajax call to. I’ll have more examples about this type of usage in a future post, but hopefully many of you will find this get substring function using regex, simple and useful.

  1. function get_substring (s,pattern_obj)
  2. {
  3. // Note:  S = string, pattern is an optional object of start and end pair values
  4.  
  5. // see if pattern has been set - if not, use the default being and end
  6. if (!pattern_obj.begin || !pattern_obj.end)
  7. {
  8. pattern_obj.begin = "<!– begin –>";
  9. pattern_obj.end = "<!– end –>";
  10.  
  11. }
  12. var pattern=pattern_obj.begin;
  13. var re = new RegExp(pattern,"m");
  14. var m;
  15. re.multiline= true;
  16.  
  17. if (m = re.exec(s))
  18. {
  19.  
  20. } else {
  21. return false;
  22.  
  23. }
  24. var start = m.index+pattern.length;
  25.  
  26. var pattern=pattern_obj.end;
  27. var re = new RegExp(pattern,"m");
  28. re.multiline= true;
  29.  
  30. m = re.exec(s);
  31. if (!m) return false;
  32.  
  33. var end =m.index;
  34. var result= s.substr(start,end-start);
  35.  
  36. return result;
  37. }

Comments No Comments »

This weekend is crunch time for sure.  Its beyond crunch time - I have to get a photo gallery, user admin, user login, food menu, food admin,  and artist profile section done this weekend via Flex and Flash AS3.

Honestly, I’m not so sure about doing the front end components in Flex - I almost thing I can get the things working faster in Flash/AS3 than figuring out how to skin stuff.  The designs have been done in Flash, already.  I guess I can try to figure out how to import Flash symbols into Flex to get this accomplished, but import to what and how to do it, is the question.  This will be an interesting challenge.

Here is a good link to a blogger that knows his stuff: http://www.neatfilm.com/category/flex-3/

Anyway, sorry - no code or examples here yet.  I’m getting stuff prepped for the client.  I can probably put something basic together for us to start with here, at some point, but none of the client’s proprietary functions he’s paying me for (sigh).

Comments No Comments »

I often wonder what bloggers write on their very first post. Today I listened to the last podcast of a local radio show that used to post on MySpace, and thought that was pretty cool. Very dramatic. But I don’t think I need to go through all the drama - plus I don’t have a big production studio and 5 people to put something together. No, its just me, along with some extra effects that my 4 year old might add, if I’m not guarding the computer.

I have had this domain for years, wondering what I would ever do with it. I thought that one day I would start a software company with it. That idea has not quite panned out, so I’m going to finally just use it as a blog (after finally tearing down my Amazon listings page that used to be here). I looked over all my domains and figured it was time to get this one rolling, especially in the light of my new discoveries in Flex 3. There just aren’t enough of these type of sites to go around. I can only hope that I might have something good to contribute to the global community, or at least help perpetuate the technology which seems to be advancing at a pretty fast pace. Flex 4 will be here soon.

So to all who happened upon this lone post, until I get more content here, thanks for reading, and watch for more postings, soon.

In the mean time, enjoy this cool video on creating classes for Flex 3

Comments Comments Off