Subscribe To RSS Feed


Jeremy Dost's SharpBlog

Just another Sharpdot weblog

Archive for the ‘Uncategorized’ Category

When does 75 equal 61?

- Tuesday, August 31st, 2010 -

When it has a leading zero in actionscript 2 of course.

trace(Number("075"));
// ActionScript 3.0 75
// ActionScript 2.0 61

try it for yourself!

and then add this code somewhere to strip off those zeros

var movieLenStr:String = '0075';
trace(movieLenStr + ' does NOT equal ' + Number(movieLenStr));
while(movieLenStr.charAt(0) == '0') {
     movieLenStr = movieLenStr.substr(1);
}
trace(movieLenStr + ' does equal ' + Number(movieLenStr));

So just to finish the thought – the problem is that in AS2 it’s interpreting that leading zero as an octal number and therefore converts it differently. In AS3 it just ignores the zero. It’s all spelled out in the livedocs:

In ActionScript 3.0, the Number() function no longer supports octal, or base 8, numbers. If you supply a string with a leading zero to the ActionScript 2.0 Number()function, the number is interpreted as an octal number, and converted to its decimal equivalent. This is not true with the Number() function in ActionScript 3.0, which instead ignores the leading zero. For example, the following code generates different output when compiled using different versions of ActionScript

from this entry: http://www.adobe.com/livedocs/flash/9.0/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00000048.html

Posted in Uncategorized | No Comments »

Gigya

- Tuesday, August 10th, 2010 -

Testing something out with Gigya but stupid wywisyg isn’t letting me…

aaaaaaaaaaaaaaaa stuff

Posted in Uncategorized | No Comments »

Magento strenthened by major investment

- Wednesday, March 17th, 2010 -

Word came out Monday that Magento has it’s first major investment – $22.5 Million from an unnamed source. The speculation is that it’s from PayPal which would make sense because of a recent tightening of their relationship. Whoever the source is it means a brighter future during this growth period for online commerce and Magento plans to use the capital for mobile commerce and SaaS functionality so they’re hoping to ride that wave too it sounds like.

Here’s a more thorough write up and Magento’s official announcement. I was really impressed to see that the word “Magento” is now searched more than “eCommerce” which is a little mind-blowing by itself and interesting to compare the search trail for the old dog oscommerce. Hmm – maybe that includes a lot of people searching for magento the color?

Tags:
Posted in Uncategorized | 4 Comments »

Sneak peek at the redesigned google search layout

- Wednesday, November 25th, 2009 -

Cool! Google blogoscoped has a javascript tweak that will let you in to the redesigned google search layout. It’s nice and simple and worked for me. Check it out here.

The date filters are great. They look like they’ll be a big help when searching for tech solutions especially when you want to only see fixes and how-tos for the most current versions of wordpress / drupal etc. They are available already but it takes a few clicks to get to it so this makes it a whole lot easier. It’ll be nice to see this go live for real sometime soon.

Posted in Uncategorized | No Comments »

cPanel, RoR Passenger and PHP in bed together

- Thursday, November 19th, 2009 -

I spent quite a lot of time pulling my hair out over this one but finally was able to massage cpanel so that our ruby on rails site which uses mod_rails / passenger would ignore a specific directory that we wanted to run a PHP app ( Drupal ) in. You CAN run php by default but you have to go to the script explicitly – i.e. going to /drupal/index.php was ok but /drupal/ threw and error. So the problem was two fold – figuring out how to tell passenger to ignore that entire directory and then how to get this configured in cpanel in the ‘proper’ way.

At first I got bogged down trying to get it to work with some url rewrites in the .htaccess file. It seemed logical but it didn’t work because passenger does it’s thing before .htaccess even kicks in. Besides, the best approach is to bypass passenger completely for that directory – better for optimizing and is really more true to what we were trying to setup.

After digging I discovered the ‘PassengerEnabled’ directive! I know RTFM. Just set PassengerEnabled off for that directory and we’re golden.

Now how to fit it into cpanel but just for this domain? Not as simple as it sounds. Editing the httpd.conf is of course NOT the right solution. Cpanel does expose some parts of the apache configuration in the admin but it’s not vhost specific so again it would affect all sites when I just wanted to change one. RTFM again and you’ll see there are some manual ways to insert things directly into the vhost. You have to manually create a series of directories (the userdata one at the top of the chain is not there by default) and put an override file named anything.conf in the right place.

In my setup i created the file override.conf here:

/usr/local/apache/conf/userdata/std/<vhost account number>/<cpanel user name>/<domain name>/override.conf

And put this in it (/drupal is the folder i want to run php in).

<Location /blog>
PassengerEnabled off
</Location>

And now one more hitch…

Running /scripts/verify_vhost_includes like it says to in the cpanel docs said that my vhost file had an error!!! It said PassengerEnabled was not a valid directive. I ended up just giving it a shot anyways and was pleased to find that it worked just fine! I suspect that cpanel just doesn’t know this directive becuase it is specific to passenger. So you run:

/scripts/ensure_vhost_includes --user=<cpanel user name>

to rebuild the vhosts file for this user and restarts apache and voila!

Whew

Tags: , , ,
Posted in Uncategorized | No Comments »

Bulk App Installers – just in time for a Windows 7 install

- Wednesday, November 4th, 2009 -

Thanks again lifehacker - Allmyapps and Ninite are 2 very handy looking bulk app installers that let you build a bundle all of the free apps you use and then install them all at once. We’re going to upgrade to Windows 7 sometime in the near future and this will come in handy.

Here’s the writeups on all my apps and ninite

Posted in Uncategorized | No Comments »

Drupal – the official national CMS tool

- Tuesday, November 3rd, 2009 -

I just read that the whitehouse.gov website is now running Drupal. What a amazing piece of news for Drupal and open source development in general. Kudos!

Here’s some more details… http://buytaert.net/whitehouse-gov-using-drupal

Tags:
Posted in Uncategorized | No Comments »

xkcd animated fun

- Thursday, October 29th, 2009 -

curse you wpmu for stripping away my object tag!

Here is the video…  http://www.youtube.com/watch?v=DHoDsZDMH_Y&feature=player_embedded

Posted in Uncategorized | No Comments »

Trying out Sugar on a Stick – you know – for the kids

- Sunday, October 25th, 2009 -

I saw this a little while ago and it looks like a great way for the kids to have a computer of their own. Yesterday we stopped in at the office and while we were there I grabbed the old laptop I had bought a while ago with them in mind. It’s a compaq presario running win 95 and doesn’t even boot right actually but the body is really sturdy so for $20 I thought it was the perfect kids first real laptop.

So today they both took a nap – in fact they’re right over there on the couch – and while they’re snoozing I thought I’d give this a shot. I went to the soas homepage ( http://wiki.sugarlabs.org/go/Sugar_on_a_Stick ) and followed the instructions there and am just waiting while the live usb creator does it’s thing ( https://fedorahosted.org/liveusb-creator/ ). That live usb creator looks like a great little thing by the way. can make your usb stick a live bootable linux os. I’m trying it on our 2GB usb stick from the office. if it works I guess I’ll have to get another one for work.

Ok great – looks like it’s complete – i’ll post later with an update!

UPDATE

Ok it’s a compaq presario 1694 and it’s running win 98 but it looks like it is booting up into windows after all! it’s not recognizing the usb drive though :P – looks like it wants a driver. need to add the usb to the boot options…

UPDATE 2

Things have stalled out mostly becuase the dang laptop is so old. it won’t run the stick because it wants drivers – win98 didn’t automatically handle drivers like things do now remember :P . there’s no ethernet jack – only a phone jack – so it’s proving difficult to get online and transfer files to it. Tried running a live ubuntu cd and that didn’t work – i think because it only has 64MB of RAM and the ubuntu live cd needs more than that. I mean this thing is so old it has a floppy disk drive in it. Not giving up though – i’m still hoping to get some newer version of linux installed on it to handle the usb drivers and then i should be in business. more to come!

Also, after digging into it more I think that the memory requirements for running

Posted in Uncategorized | No Comments »

Changing the password cmd line in Tortoise CVS

- Friday, October 16th, 2009 -

I ran into a problem where I needed to reset my CVS password. Usually you can just fetch a module list or try to checkout a module from the same repository and it will prompt you. That wasn’t working this time though – I suspect because I had to VPN to get to the repo.  So instead of that hack I had to actually learn how to do it the right way! Here’s what you do…

First – try to update the module and copy your error message as this has the paths you need already nicely figured out. You just need the top command part. Mine was:

In I:\projects\foobar\sourcecode\CoursePlatform: “C:\Program Files\TortoiseCVS\cvs.exe” -q -x update -d -P
CVSROOT=:sspi:jdost@foobar.org:/CVS

Next – in notepad or a text editor replace ‘update’ with ‘logout’

Then in a cmd prompt navigate to your module directory – “I:\projects\foobar\sourcecode\CoursePlatform” in the example.

Then paste and run the command minus that “In I:\projects\foobar\sourcecode\CoursePlatform:” part.

It didn’t return any messages but may be a switch for that or something. Anyways – next time you try cvs update it should prompt you to enter your password!

That’s it

Posted in Uncategorized | No Comments »