Tuesday, February 18, 2014

iOS7 TDD w/ OCMock and Xcode5 Linker problem: -ObjC

I'm setting up a new project, using CocoaPods and a couple of libraries (TestFlight, OCMock, AFNetworking, et al). While CocoaPods may not work well with private repos among public repos, I find it quite useful, especially if someone else wants to join my project quickly.

The biggest pain points I had were linking, which means unless I know in advance that linkers need to be forced for each individual library, I'll get some obtuse error, like:

ld: file not found: -ObjC
clang: error: linker command failed with exit code 1 (use -v to see invocation)

What that really means is I needed to update the flag in my specific project to  -all_load.

Know how to do that? I didn't originally, but finally figured it out. Under the specific project I'm targeting (my tests in this case), in Build Settings -> Linking, I look for the "Other Linker Flags" and make 1 teensy change:

remove '-force_load'
add '-all_load'

That's it!

Oh, and if you're referencing any old OCMock tutorials, please don't use SenTestingKit.framework. You don't even need a header file for test. Just use the following inside your main class:


Now OCMock works great and my code works. Now to write some tests!

Thanks to this blog's comment for helping: Nick Hart

Tuesday, January 7, 2014

Google Glass - getting started

I'm a developer, and sometimes I get to explore new technologies. In 2014, I get to be a Google Glass Explorer. No, I'm not the first to this game, and there are several others out there, and heck, Google might release a newer product in the next week that would make what I just got obsolete, but right now I'm learning the ropes on my device. I've only been allotted a little bit of time, but in that time, I've learned a few things that I'm sharing for my own edification (and feel should've been included in a setup guide, or something, but was just left to explore/discover on my own).

Simply going to http://glass.google.com doesn't yield anything useful because you don't even have a login there. Oh, and it redirects you to http://www.google.com/glass/start/. That's not intuitive nor helpful, not to mention there is no login...Ok??

Simple stuff:

  1. Get the app
  2. Pairing with a device
  3. Connecting to a WiFi Network
    • https://glass.google.com/u/0/myglass
    • Getting to this site wasn't intuitive either. Just going to glass.google.com was to see a large advertisement, but nothing about logging in and viewing my app. 
  4. There's a community 
  5. Search for posts
    1. inside the community, it'd be helpful if there was a stack-overflow style search, question and answer view.

Google, next time please at least give me some directions to get the basics down. Even my iPad had these initial things available. Better to over-communicate than assume your audience knows what to expect. If you want common users to understand and learn how to use your device, you need to make it as intuitive as possible. Nothing of my experience has yet to be intuitive.

Even a simple directive to point me here https://support.google.com/glass/?hl=en#topic=4363345
would have made a world of difference. Honestly, there has to be a better way to launch this product so that dorks like me don't have to hunt. If I wanted that, I'd go learn Unix. I want to use Glass to be more productive, and so far it's been a PITA. Let's work together to make this better. Deal?

Friday, October 25, 2013

Shell script to download files from anywhere

As the title suggests, this is just a simple script I figured out for downloading files. The list of urls for downloading are located in an xml document that I'm parsing, storing briefly, looping through and downloading what I wanted to a predetermined location (though that could be modified for user input).

Script:

read_dom () {
    local IFS=\>
    read -d \< ENTITY CONTENT
}

while read_dom; do
    if [[ $ENTITY = "xmlTag" ]]; then
echo $CONTENT
if [[ $CONTENT != "null" ]]; then
wget -Nrkpl 0 $CONTENT -nd -Pdownloads
fi      
    fi
done < listOfXML.xml > temporaryXMLPage.txt

echo "File cleanup"
rm temporaryXMLPage.txt

source:
http://stackoverflow.com/questions/893585/how-to-parse-xml-in-bash
and
http://stackoverflow.com/questions/15407884/javascript-download-images-from-url


Tuesday, October 1, 2013

Using Drush to deploy themes and modules to multi-sites on CentOS

Previously I discussed setting up multi-site on CentOS, now, using Drush, we can also download, enable, and set themes and modules for individual sites.  The default Drupal7 site gets all the glory of files downloaded to it, but the individual sites should be the ones showing the updates.

Steps to use Drush:

1) cd /var/www/vhosts/drupal7/sites/your.alternative.site
get into the correct folder that you want to have the theme enabled
2) drush dl theme
This is the last part of a url available from drupal, i.e. drupal.org/project/omega would use omega

3) drush en theme
This enables the them for all sites. From what I understand, the files themselves get downloaded to the main drupal7/sites/all/themes/ directory. Somehow Drupal knows to find the themes for each individual site, which in the next step we set as the default. Setting it this way makes it available to all sites to enable themselves, but not as a default for all sites. If you'd like it to be exclusive just for your one site, and not maintained for the rest of them, you might have to just move it around or not use drush for that...not sure? ask on the forums.

4) drush vset theme_default theme
This sets the default theme for the site that you're in. This is awesome because it does it only for the specified site. Even if I set the Drupal7 default site default theme, it would have no impact on the other sites because they all get their own choices.

5) drush pm-list --type=theme
this last one is pretty neat because drush has some pretty cool project management tools. this one just lists out all of the themes available for your main installation, including the package it comes with, the name, status, and version.

Enjoy!

Monday, September 30, 2013

Drupal 7 multi-site install on CentOS6

Tricks to getting a multi-site Drupal7 installed on CentOS w/ Apache2, mySQL.

Follow these two posts, more or less. The biggest point of advice is that for each url that isn't a subdomain should point to the same url (i.e. your.alternative.site [192.168.10.1] v. original.alternative.site [192.168.10.1] v. original.alternative.site/different [192.168.10.1])

These are suggested reading sites, but none of them are exact, always referencing ubuntu or other linux distros...mine was a little different.

https://drupal.org/node/290768

https://drupal.org/node/138889#comment-2510252

https://drupal.org/node/1114158

http://www.seascapewebdesign.com/blog/how-setup-multi-sites-drupal-6-and-drupal-7

The most important thing is to have drush installed (mentioned in my other post). That makes installing everything else move quite quickly.

This doesn't have to be the same for everyone, but here are my steps:
1) cd /var/www/vhosts/drupal7 (if vhosts or drupal7 doesn't exist, create them)
2) drush dl drupal
before step 3, make sure to create the databases you need
pre-3a) mysql -u userName -p (this user is your sql admin user name, same or different from drupal db's)
pre-3b) create database YourMySQLDbName;
pre-3c) grant all on YourMySQLDbName.* to YourMySQLUserName@localhost identified by 'PasswordYouSet';
3) drush site-install standard --account-name=admin --account-pass=admin --db-url=mysql://YourMySQLUserName:PasswordYouSet@localhost/YourMySQLDbName
4) vi /etc/http/conf.d/drupal7.conf (make this if it doesn't exist yet)
5) paste the following in, save, then quit:

Alias drupal7 127.0.0.1

<Directory /var/www/vhosts/drupal7>
Options +FollowSymLinks
AllowOverride All
order allow,deny
allow from all
</Directory>

6) vi /etc/http/conf.d/00_drupal.conf (make this if it doesn't exist yet)
one thing I've learned about apache is that the apache configuration file works alphabetically, and this file is the configuration for all virtualhosts (which allows us to have the multi-sites installed correctly)
7) paste the following in, save, then quit:
NameVirtualHost *:80

<Directory /var/www/vhosts>
  AllowOverride All
</Directory>

<VirtualHost *:80>
   ServerPath /drupal7
   DocumentRoot /var/www/vhosts/drupal7
   ServerName drupal7
</VirtualHost>

8) apachectl restart

you should still be in the /var/www/vhosts/drupal7 directory
9) cp -a default/ sites/your.alternative.site/ (create it if it doesn't exist)
this should move over the files/ folder, settings.php and default.settings.php

10) chmod a+w sites/your.alternative.site/settings.php
&
chmod a+w sites/your.alternative.site/files

11) vi sites/sites.php
at the bottom of the file, you should add a line for each site you're installing. This hash is useful for finding the website and folders based on the apache setup (we'll get to that shortly).  Add the following:

$sites['nickname'] = 'your.alternative.site' (this is the folder path in drupal7/sites/your.alternative.site)

save and exit

12) now for your newly added site, we need to append info to the conf file so apache knows to redirect correctly to the sites.php file which will redirect to the correct folder which will show the correct site
vi /etc/http/conf.d/00_drupal.conf

at the bottom, add:

<VirtualHost *:80>
   DocumentRoot /var/www/vhosts/drupal7/sites/your.alternative.site
   ServerName nickname
</VirtualHost>

repeat for each new site

13) Finally change the settings for the newest site added:
vi sites/your.alternative.site/settings.php

change the database information for your new site

14) now setup your site: your.alternative.site/install.php?

15) after setup, change the folder and file permissions back

16) pat yourself on the back, it's all done :) - maybe a drush script for multi-site would be useful?

Wednesday, September 11, 2013

Drupal 7 on OSX 10.8, with Apache 2.2, MySQL, and PHP 5

This post is more about my experience of using a local instance of Drupal on my OSX box. The following are links about resources I found extremely helpful. Basically, I installed 2 versions (Drupal 7.2 and , and you have to jump through some hoops because although OSX ships with Apache and PHP, you need to now enable some settings (via cmd line or other tools) in order to have web sharing activated again (the silly prompt from the Preferences Pane is now gone *insert_sad_face*)

SITES:

1) This one helped me get the AMP stack going on my box (it also had some good step by step instructions about using phpMyAdmin)
http://www.coolestguyplanettech.com/downtown/install-and-configure-apache-mysql-php-and-phpmyadmin-osx-108-mountain-lion#apache

2) Getting a few steps closer, this site gave me some more info about getting the info setup correctly for Drupal as well as AMP stack
http://drewish.com/2012/07/26/drupal-on-mountain-lion-os-x-10-8/

3) A few stack overflow links
http://stackoverflow.com/questions/1676688/php-mysql-connection-not-working-2002-no-such-file-or-directory
and
http://stackoverflow.com/questions/1819592/error-when-connecting-to-mysql-using-php-pdo

4) And I cannot forget the infallible directions from Drupal.org
https://drupal.org/documentation/install

5) and for good measure, once I installed phpMyAdmin, the help docs helped :)
phpMyAdmin/doc/html/setup.html#setup_script
and
phpMyAdmin/doc/html/faq.html

So almost all of this got me to the right place, though it took a few hours to get screens working, and the DB didn't want to initially work. Why? Well, because the pdo_mysql.default_socket was not commented out...huh? Yeah, it didn't make sense to me for a bit. I searched lord google for things about the following error messages:

Warning: PDO::__construct(): [2002] No such file or directory (trying to connect via unix:///tmp/mysqld.sock)

Yeah, that kind of message didn't help at all, until I started changing my php.ini file around, and realized that that specific line, though correct (in a couple different ways, might I add), was wrong. My uneducated guess is that pdo_mysql is for Unix only, and as I am on OSX, it was wrong. Just commenting it out made it all better, install scripts started running on both installs, cats and dogs started sleeping together, and donuts began raining from the heavens...Ok, the last two didn't happen, but still, I hope this helps someone else besides me.

Tuesday, September 3, 2013

Setting up Jenkins on CentOS

It's been a while since I needed to install Jenkins, but I'm getting to the point where I'd like my code in GitHub (eventually pushed down to my own Git server on my CentOS box, once I figure out SSH), to be checked against tests whenever commits are made. Jenkins is the most kick-ass CI tool I know about. Setting it up is relatively easy, and getting it to play with Github is a cinch.

I followed the following steps to get it mostly up and running:
http://www.andrewzammit.com/blog/installing-jenkins-ci-on-centos-6-x-tomcat-with-an-ajp-proxy/

The only thing I'm not completely sure about is AJP. This is something outside the realm of my experience, and if it breaks, or if I have to learn more, I will, but for now, I want my box to pull against my repo, and if there's a change, pull, run tests, notify developers (rinse, repeat).

The only issue I really ran into was that Jenkins didn't run on the default java I had installed, so a quick update to my CentOS java via:

yum install java-1.7.0-openjdk

And now I have Jenkins up and running on CentOS!

Next is to figure out some good ole VPN fun, and then SSH (or the other way around).

Monday, August 12, 2013

Writing tests: RSpec's reason for Lambda

Most of my tests have been using the standard test format:

it "should add the thing to the db" do
  post :message, :content => "yadda yadda", :id => @user.user_id
  response.should change(Message, count).by(1)
end

However I'm now learning about Lambda's, which there have been some great posts recently about (i.e. Blocks v Procs v Lambdas). Lambda's themselves are a mathematical convention for improving readability of a formula. In the case of RSpec, Lambda's allow me to test the function, and not the response, for a change in my database.

My previous example actually says that the response would be the reason that the count changed. But if I have an empty db, or want to display data in my db temporarily to demonstrate that the function is correct, I can use a Lambda to my benefit. It essentially wraps my code in the before/after, so I can just do the following:

it "should add the thing to the db" do
  lambda do
    post :message, :content => "yadda yadda", :id => @user.user_id
  end.should change(Message, count).by(1)
end

Overall, the 2nd version is checking that I created a Message based on the action inside the Lambda, versus the 1st version is looking at the response to change the action.

Sunday, August 11, 2013

Rails default JS files in application.html.erb to avoid defaults.js 404 error

Although Rails cannot let you post a DELETE action, it can pretend to do so with javascript. JQuery is the default js lib of choice for what I've studied so far, and in this post, a simple change in the application.html.erb allows my js file to be called correctly.

My Gemfile does have:
gem 'jquery-rails'

I tried updating my application.rb with a config.action_view.javascript_expansions[:defaults] = %w(jquery rails), but that caused Zeus to puke. No good :(

Instead, I made a slight change to my application.html.erb and was able to now magically have JS destroy for me (WIN!).

<%= javascript_include_tag "application %>

did the trick!

Thursday, August 8, 2013

Rails 4.0.0, local CI with RSpec, Zeus, and Guard, using PostgreSQL, deployed to Heroku

This post is an initial rambling about what I've been doing on some side projects. Aside from learning about Sinatra, and remembering my SQL-fu commands, I'm getting well acclimated to Heroku, re-enjoying Git, and having a blast working around concepts in RoR.

This is just a mini post about my experience with Hartl's exercises, but using Ruby 1.9.3-p194, rvm, Rails 4.0.0 to build the micro-post blogging engine.

Really, in summation, there were a few tricks that made this experience more painful than necessary.

I should also mention that due to other client work, I'm now on Xcode5 DP3. This is only relevant for the time being. Once iOS7 is out of beta and Xcode5 is RC, then maybe the command line tools will work better. For now, the nokogiri gem refused to install, and that's because the libxml2 and libxlts gems refused to install because something in the gcc from Xcode5 DP3 did not like playing well. That said, I could not run capybara or webrat to utilize have_selector("attribute", "value") in any of my rspec's. It was rather unfortunate, but kept me on my toes.

Basically, my gemfile (after the jump), has a couple of gems commented out b/c of the aforementioned Xcode differences. I did not use webrat (or capybara) or annotate-models. I did use PostgreSQL, which I found easier to manipulate, and though it required some config changes, allowed me to deploy to Heroku with no problems. Because of Heroku, and resetting the db, I had to put the faker gem in the normal list, and not development, b/c Heroku tried to use Faker for resetting the db :(

The one gem I did not anticipate ever having to add was the protected_attributes. Rails 4 removed the mass assignment of attributes for security, and there is plenty of good reason for it (just google 'rails protected_attributes, or 'rails 4 attr_accessible'). To follow Hartl's Rails 3 example in Rails 4, I used the protected_attributes and devise gems.

source 'https://rubygems.org'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.0'

# Faker for dev and heroku
gem 'faker'

# Strong protection
gem 'protected_attributes'
gem 'devise', '3.0.0.rc'

# gravatars
gem 'gravatar_image_tag'

# Pagination
gem 'will_paginate'

# Use postgres as the database for Active Record
gem 'pg'

# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0'

# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'

# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'

# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby

# Use jquery as the JavaScript library
gem 'jquery-rails'

# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'

# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 1.2'

group :doc do
  # bundle exec rake doc:rails generates the API under doc/api.
  gem 'sdoc', require: false
end

# Use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'

# Use unicorn as the app server
# gem 'unicorn'

# Use Capistrano for deployment

group :development do
  gem 'rspec-rails'
  gem 'guard'
  gem 'guard-rspec'
  gem 'zeus'
  gem 'factory_girl_rails'
  #gem 'annotate-models'
  #gem 'webrat'
end

group :test do
  gem 'rspec'
  gem 'zeus'
  gem 'factory_girl_rails'
  #gem 'webrat'
end
# gem 'capistrano', group: :development

# Use debugger
# gem 'debugger', group: [:development, :test]

Wednesday, July 31, 2013

Rails w/ IntelliJ IDEA and BASH

After spending a lot of time w/ IDEs, I realize why I don't like VIM (nor eMacs, Less, More, Pico, Nano, etc). They're great, if you can memorize all of the shortcuts, keyboard tasks, and integration modules, as well as editing techniques, etc. But frankly, I have a very strong knowledge of IntelliJ, and people like John Lindquist show how to kick ass even better in an IDE than other systems.

My workflow with BASH lets me run my CI with Guard (using Zeus server), psql development (thanks Heroku!), and irb/rails c for any quick tests. However for autocompletion (because the Ruby and Rails frameworks are sooooo freakishly huge, that I'd never remember any of it, but I can also dive into any definition simply with ctrl + click, I'm learning much faster (even without the mustachio).

A few years ago I had a client switch me from Eclipse to IJ, and I haven't looked back. Rails is super easy to setup, but so is Python, and Scala, and Javascript. All of which rock to be able to switch back and forth on, even have multiple windows for different projects open, and multiple terminals running different servers, doing lots of different tests.

</rant>

Monday, June 24, 2013

Importing a Python Django project into IntelliJ IDEA with the Plugin using virtualenv

I recently was importing a project that was created by another developer.  Before importing the project, I wanted to install a virtualenv for my python and Django version (it is kind of annoying that if you create a virtualenv for each project, you have to re-install libs like Django every time).  I came across this great post that got me where I needed to be on OSX.8: http://hackercodex.com/guide/python-virtualenv-on-mac-osx-mountain-lion-10.8/

That got me most of the way there, and during this time I became intimately closer w/ virtualenv.  However, the problem was the IntelliJ was not enjoying the Django, no matter what set for my settings and manager scripts...finally, with the right google-fu I found this question that got me mostly there: http://stackoverflow.com/questions/13994846/intellij-python-plugin-run-classpath

In OSX, in the project settings, select the module, and then select the parent folder of the Django module, and there you can see if you have the virtualenv listed as part of your dependencies.  Once I got that in place, suddenly I could see into all of my Django libs and build my project.  Win!

Thursday, May 24, 2012

Flashbuilder 4.6 and Flex 4.6 not allowing 'MX + Spark'

This is short and simple.  I just spent a frustrating hour trying to import a project on Flex 4.6, and kept getting error after error about Spark skins and components not being there.  I tried setting the build and compiler settings to 'MX + Spark' or 'Spark Only', but every time I set it and clicked 'Ok', it never kept my changes.  The selection kept reverting back to 'MX Only', and compiling against only MX components, so I never could even use s:Application (because Spark wasn't being recognized).

Fix: Redownloaded Flex 4.6 (soon to try Flex 4.8 from Apache using IntelliJ), and that fixed it.  Really simple, just replace the sdk, and now the switching worked again, all errors disappeared.

Yay!

Sunday, May 6, 2012

Previous SDKs


I have no idea how long you'll be able to download these for, but currently, you can still get Adobe Flex sdks by updating the url below:


4.5.1:
http://download.macromedia.com/pub/flex/sdk/flex_sdk_4.5.1.zip

(this works also: http://fpdownload.adobe.com/pub/flex/sdk/builds/flex4.5/flex_sdk_4.5.1.21328.zip)

If you want to change it to 4.6, just do this:
http://download.macromedia.com/pub/flex/sdk/flex_sdk_4.6.zip

If you want 3.x, just do the same exact thing:
http://download.macromedia.com/pub/flex/sdk/flex_sdk_3.5.zip

or 
http://download.macromedia.com/pub/flex/sdk/flex_sdk_3.6.zip


There probably is no way of knowing what is available, but until sourceforge gets fixed, this works...hope that helps someone looking for an older sdk.

Friday, April 20, 2012

Google AppScripts: Power, Beauty, and, well, actually, a lot of work still needed

I was lucky enough to be part of Google's AppScript hackathon in Chicago.  I enjoyed meeting several people in the hacking community, and learned a bit about what AppScript is all about.  Short story: JavaScript in the cloud, connecting calendar, email, spreadsheet, powerpoint, docs, forms, databases, and everything else together, relatively seamlessly.  Think of it as VBA for the cloud

Long story: We had several tutorials, got a basic idea of how to build class files with scripts in them, how to set some properties, trigger changes, send emails, and a few other odds and ends.  My initial attempt was to scrape Craigslist based on a search query, and post all results into a new spreadsheet page (sortable) based on the results and an xml template (I missed that api).  If I have time, I'll actually build it.

Honestly, debugging was horribly slow, writing the scripts wasn't easy, and the bouncing back and forth between pages to reload was relatively unfriendly.  If there was a way to test this on the command line, or even better, have a plugin to a real environment that could save the code locally and back up instantly (or when optimized), then I'd be a fan.

This can be a really powerful step forward for business analysts, interns, and other folks who don't know a lot about programming, and want to just connect apps together with simple functionalities.  Honestly, one of the cooler ideas I saw was someone using Flex mobile to write the app, storing the js code in StageWebView, and then running their form that way...I left before I had a chance to see it in action, but it sounded quite promising.

For anyone interested in trying this out, the website developers.google.com/apps-script has good documentation, but some of it is quite buried (or relies too heavily on GWT UI toolkit documentation).  That documentation could use some examples embedded with the code, but that's just my opinion of the docs.  Otherwise, there are plenty of scripts to help you get started with writing off a few quick innovative app ideas.  Hopefully you have time to work on something and show the world.  But for right now, it has some maturation to be more robust for full development.

Why everyone should avoid Adobe Connect

Aside from the fact that it sucks, support is by a bunch of people who, shall we say, aren't speaking clear American English, and do not actually understand the technical bits behind the system, including the SyncSwfEvent.  Anyways, after hours, days, and weeks, of screaming, yelling, and cursing, I can tell you that I will never recommend to any client to go forward with this product.  Its documentation is horrendous, and as I said, the support is even worse.  sorry for the rant, just angry at it...

Thursday, March 29, 2012

Polyglotting it

This is more of a ramble than a post on learning to do something...

Holy cow this railscast guy moves fast.  However I do find his tutorials quite interesting.  I moved through about 7-8 of these last night (http://railscasts.com/) and found some good gems in there (pun intended).

I spent a lot of time last year learning Rails 2.x, and Ruby 1.9.x.  Not that I'm becoming a professional rails dev (yet), I'm getting into it, especially because I want to be able to create my own servers and connect to my data source while avoiding Java and php (Scala not included cause I still like it).

I've spent a good amount of time with Rails, and while it is still maturing, using TextMate is awesome for debugging, git is hella better than SVN, and I become less dependent upon other systems/companies if I can roll my own.

Expect to hear more from my blog on other things I discover about the languages (Scala, Python, Ruby) I've been going through over the last 2 years, and their associated frameworks (Play, Django, Rails), as well as my foray into noSQL databases (Mongo).  Lots to learn, and lots to understand, but when things work, then I'm happier and more excited to build.

Cheers!

Thursday, February 9, 2012

Apache Flex Logo [sexy]!

Check out this awesome new logo:Now there is a lot to be done in Apache, and hopefully I'll be able to help contribute to the future of Flex. In the meantime, congrats to the team at Fuse Collective and Tomasz MaciÄ…g who created this piece of beauty!

I know there is some very positive energy around Apache Flex, and a bit of an uphill battle for the future of Flex, but let's keep the momentum going!



Monday, January 9, 2012

Javascript error in Flex: Why my html won't load my swf...oy!

Boy, I hate Javascript...actually I don't hate it, but I hate the errors it can throw.  Anyways, in this issue I explain why a spurious error actually was correct.  I haven't done much Flex 3 in a while, but a current client project asked me to stay within these bounds.  I checked out the code from CVS (ugh) and got everything up.  But when I tried to run the project, I never launched the swf in the html.  Finally I found the error.

Using FireBug, I found that the DetectFlashVer() wasn't firing.  Huh?

I checked the files, made sure I hadn't changed any configuation, double checked with the team that I all the code.  Everything was there, as they had it.

Only upon further investigation did I realize that I was missing the AC_OET.js and /history from my template.  This seemed strange in the beginning, but the client insisted everything was running fine for them.  I had to assume it was my configuration, trying to run Flex 3.5 from Flashbuilder 4.6, I must've been doing something wrong.

My only guess is that because AC_OET.js didn't exist a long time ago (I actually don't know when it was introduced to the SDK), when I tried to build the package, because it wasn't in the html-template folder, it wasn't going to just show up, and because the html template was probably based on the newer SDK, it was looking for the javascript, and because it couldn't find that, never loaded...

Case solved.

Old html:
if(DV(6,0,65)&&!hV){document.title=document.title.slice(0,47)....

New html:

var hasProductInstall = DetectFlashVer(6, 0, 65);

This made a big difference.  Hope this helps you.

Tuesday, December 13, 2011

Flex a Spoon, Flash some AIR, and stick around for a while


Hoyt’s last Chicago Flex preso and Labriola’s SpoonProject

Kevin Hoyt and Michael Labriola both were the guest speakers at our CFUG meetup (www.chicagoflex.org).  The great news is that this was the first time either of them had spoken together in the same room at the same time.  The sad news is, this will be the last time both of them will be together at CFUG to ever talk about Flex again.

If you are interested in watching the near 2-hour discussion, please go here: https://experts.adobeconnect.com/_a204547676/p7xqmnpakcd/?launcher=false&fcsContent=true&pbMode=normal

Otherwise:

First off, I want to discuss a few things that I feel will help clarify where I am coming from.  Often times I have discussions with multiple clients about what Flash is, how Flex fits in, and we can accomplish with AIR.  For this post (which is long – way too long perhaps, but long enough to see the point), I am going to just quickly reference and review, then I will discuss: Adobe’s PR (the reason for this meetup and me asking Michael and Kevin to come and talk); Adobe’s strengths, position, and vision for the future; The Spoon Project; Spoons opportunities and dilemmas; and my own 2 cents.

What is Flash?

Plain-speak: A plugin.  Want more information, check here: http://en.wikipedia.org/wiki/Flashplayer.  It is Adobe’s bread and butter when it comes to content management regarding video and video games.  More on that later.  For now, know that it is a highly evolved virtual machine (VM) that can execute code (AS3) for a rich and interactive experience.

What is Flex?

Plain-speak: A framework built on top of Actionscript 3.  It is a powerful tool for building applications, especially enterprise apps.  It has a terrific life cycle, amazing APIs, and is several years ahead of any other technology for delivering secure, robust, and data-driven applications

What is AIR?

Plain-speak: A desktop version of the web browser version of the flashplayer.  It has some much cooler APIs than the standard flashplayer, and because it isn’t sandboxed by the browser, you get a few other neat things.  Still, it’s mainly a desktop version of the browser version.

So?

Adobe’s PR (fubarred, snafu, or intended)

Adobe is great at one thing, making tools for creative people to create things.  In my experience as a developer, consultant, analyst, and everything else, I’ve learned that when it comes to businesses and software development, you get one of two things: an agency approach, or an enterprise approach.

As a quick definition, and agency approach is the short term.  These are products that don’t have much shelf life, are short lived in the wild, and even if they win an award will fade into obscurity soon.  The enterprise approach is the opposite.  While enterprise apps are notoriously slow to come to fruition, they last (what seems) forever.  Normally they are a 5-10 year package that sells for a large amount, and comes with upgrades, new features, and snazzy options as the life of the product wears on.

In the world of Adobe, Adobe has no clue how to deal with the enterprise.  They can only see one thing, and that is the bleeding edge.  As a four-plus billion dollar ($4,000,000,000+) a year company, Adobe makes most of it’s money on creative tools.  This means Creative Suite, Photoshop, and a few other choice applications is where Adobe makes its money.  It does it by selling tools, or packages of tools, to companies and users.  Since the inception of Flex, Adobe has never really figured out how to make money off of it.  Flex uses the flashplayer and AIR, but AIR and the flashplayer don’t need Flex.  In fact, one of the biggest complaints of Flex is the bloat it brings with its myriad libraries, download times can be severely impacted. Not to mention the speed of an application because it is using the Flex messaging framework.  These have been, and will be, hotly contested for some time to come. 

Regardless, Adobe never made (“real”) money by creating the framework.  It did make some money by consulting on projects, but the 25+ team members it has allocated to the sdk never generated revenue (unlike the large group of folks who work on Photoshop or AfterEffects, whose products do make money).  Flashbuilder does generate some revenue, but not at the same volume as the other products.  Adobe looks to start projects that can generate at least a hundred million dollars ($100,000,000) a year, and Flex never even came close.  Sure it might be a multi-million dollar venture, but is that worth the resources when those resources could be dedicated to a larger project and make more money somewhere else?  Adobe says, “Nope.”

So Adobe made the bold move and told the world it is no longer interested in developing Flash for mobile (completely unrelated to Flex), and making Flex completely open source, giving it, and its support to the Apache Foundation (http://blogs.adobe.com/flex/2011/11/your-questions-about-flex.html).  Make no mistake about it, Adobe will support the flash player, especially for the desktop, and it WILL support AIR.  AIR makes the flashplayer available everywhere that isn’t a browser, so video content and games have a way to live on.  And Adobe keeps its cash cow.

And don’t worry, Flex isn’t going anywhere too quickly, but we’ll get there in a bit.

The message from Adobe is messy, sloppy, poorly handled, but think of it like teenage angst, where the person has lost control of their emotions, and finally just said, “Enough! Enough! We can’t have it our way, we don’t want it any way!”  Adobe has not been able to capitalize on innovations that are not tools “creative” people need. 

Adobe’s position (including Natobi/PhoneGap)

So what does Adobe want to do going forward?  For starters, they have their Interactive Developer Evangelist team spearheading a PR campaign to tell all developers that HTML is the future.  Their message has become pretty consistent, with their twitter feeds basically dropping any mention of Flex.  They seem to ignore everything Flex, and stick with the standards of the future.  Let’s not get caught u p in rhetoric. Adobe is not interested in maintaining Flex any longer than it has to.  Flex is a dead weight to the hipster, creative, entrepreneurial type.  And Adobe cannot wait to release itself from that death grip.  To prove that it is over Flex, it bought Natobi, Typekit (http://blog.typekit.com/2011/10/03/adobe-acquires-typekit/), Efficient Frontier (), and a few other online real estate properties, pointing towards a desire to enter and again dominate the tool making process for online advertising (because the flashplayer hasn’t been there for the last decade).  From the 8/18/11 anouncement, Adobe is building up to be the leader of “…Content Authoring and Digital Marketing.” 

Enterprise applications are not either of those.

Adobe bought Natobi because Natobi created PhoneGap.  PhoneGap is a software application that essentially turns any application you create into an HTML5/JS/CSS application, wraps it in a pseudo-browser, and deploys like a native app.  So, for example, on iOS this is a standalone instance of Safari running on your device, and it appears to be a standalone, native app, but you are only seeing Safari rendering web pages that are considered the app.  The library works quite well, and for all intents and purposes, it acts just as good as a native application.  Adobe supports it and suggests you use it as well.  For them, this is the bleeding edge of technology, pushing mobile application development.

There is no Spoon?

During the 2011 Flex|360 conference in Denver, it was announced that the Spoon Project was taking off.  If you don’t know what Spoon is, read here: http://www.spoon.as/
Short take – it’s meant to help the Flex development team fix bugs faster.  It’s got an architecture of people and processes to resolve conflicts and promote fixes faster than Adobe’s Jira and engineers could handle. Spoon has PR, it has volunteers, it has a lot!

Spoon’s dilemma

It might actually conflict with the Apache Software Foundation (ASF).  This is not detailed out yet, and Spoon, Adobe, and ASF have some work to do to hammer out the details.  There are a lot of license agreements, IP rights, and whatever else a lawyer wants to earn fees to help disentangle Adobe from the Flex framework.  Spoon might be a problem only because it is a separate entity ready to run and fix problems, and Adobe is saying, “Actually, let’s let the big boys handle this.  We’re gonna give it to ASF, and see that they take good care.”  Nothing is set in stone yet, and Spoon may or may not be involved.  That is to be determined.

Future

If there’s anything that is certain right now, the Flash player and AIR are going to continuously be improved upon, upgraded, and pushed out to be as ubiquitous, easy to use, easy to get, and easy to update.  Adobe has a lot at stake to make sure these tools remain potent sources of DRM content providers, and will keep them up to date.  But Adobe also wants users to buy their products if they are making cutting edge products.  The amazing thing about HTML advertising is that you can’t disable it without disabling your browser.  With Flash, there were plugin disablers galore that allow users the ability to block any flash-related medium trying to load on your computer.  However, now with the advent of video and canvas in HTML5, unless you disable javascript on your browser, you can’t stop the ads from coming.  It is a marketers wet dream to know that’s where we’re going.  And guess what, Adobe is looking to blaze the trail by providing you with the latest and greatest tools to make them.  Adobe is not promising Apps, they are promising rich web pages, rich ads, rich user experiences.  It is cutting edge, but not anything with a long tail.  Flex is a long-tailed beast.

And just for a quick summation, here's Peter Elst's post about the exact same subject:

http://www.peterelst.com/blog/2011/12/13/flex-summit-updates-on-the-open-source-strategy-and-runtimes/

The Flex Summit has had some interesting notes and should help provide information about the future of this industry!