Author Archive
30
08
2008
Posted by: Colin in Flex, RIA
At work I use the FlexBuilder as an eclipse plugin. I’m a fan of eclipse so far, it has served me well in the past for Java development.
I tried using symbolic links (ln –s, also called symlinks or soft-links) to manage switching between branches, etc. Flex Builder didn’t like that.
I didn’t have any source attachment, I had to do a clean to actually rebuild the application, and other badness (Eclipse resource exceptions).
for example:
machine-name% ln -s project-trunk project
machine-name% ls -lha
…
lrwxr-xr-x 1 username DOMAIN\users 12B Jul 15 15:35 project -> project-trunk
drwxr-xr-x 2 username DOMAIN\users 68B Jul 15 15:35 project-1.2.3
drwxr-xr-x 2 username DOMAIN\users 68B Jul 15 15:35 project-trunk
What did I learn? Don’t use symbolic links with Flex Builder 3.0.
Hope It saves someone some pain. I’d guess something in the middle(OS Layer? Eclipse?) is actually walking the symlink inconsistently. No resolution to this issue yet. Is this the responsibility of the OS? Eclipse, Multi-platform code? Let me know if you see a fix for this.
While I’m at it — I also ran into this one http://bugs.adobe.com/jira/browse/FBE-186
2 Comments »
28
08
2008
Posted by: Colin in General
Why is everything so slow? Why does it take forever for the laptop to go to sleep?
Holy thrashing platters Batman — Firefox is taking up 1.25GB of Memory. I guess it is partially my fault. Having 126 Tabs open isn’t the nicest thing that you can do, but thats what I did during some intense research. After I brought it down to about 30 tabs, it still held 1GB. That is a little too much if you ask me.
I’ve been a fan of Firefox for a while. Its attractive because of its extensibility, flexibility, W3C dom, and rendering standards. I’ve been a fan of good add ons like greasemonkey, Firebug, Better Gmail, View Source Chart, Fullerscreen. I enjoy using these tools regularly.
I use IE7, and Safari 3, and rarely opera. Usually its just to make sure my css and javascript are cross-browser compatible. Each one has it’s strength’s and weaknesses. Obviously with Firefox, Memory usage is not its strength :-)
http://dotnetperls.com/Content/Browser-Memory.aspx
I’m hoping that Firefox 3 will help with the Memory usage. I hope they can adhere to a different model; Weak references please?
I’m also excited to see what the IE8 team is cooking up.
Update: I’m not so excited to see what IE8 is cooking up for Microsoft’s business plan. Firefox 3 is Doing great on Mac, Windows and Linux for me. Yea I wrote this a while ago, but thought it was still worth putting out there. I don’t use Opera or IE7 much anymore now that I am primarily on Linux (home) & OSX (work)
No Comments »
21
08
2008
Posted by: Colin in General
I’m trying to restart MySQL from the command line in Mac OSX. The GUI tool in the Preference Pane wouldn’t work for me, so its time to go back to the Command Line roots. I knew that there was a way to restart MySQL from the commandline, but I was looking in all of the wrong places, (no /etc/init.d/ or others). I fired off a few quick Web Searches with Google and found many hints.
Most of the articles I found online were not very helpful. They all contained information that didn’t work for me and OSX 10.5.3 with MySQL 5.0.51a MySQL Community Server (GPL). Maybe Mysql changed their installer recently, maybe its a Mac Update thing, but the I ended up finding the solution in a comment of this article. A comment by someone named Russell proved to be very helpful.
Basically it came down to knowing where to find these commands:
Start - sudo /usr/local/mysql/support-files/mysql.server start
Stop - sudo /usr/local/mysql/support-files/mysql.server stop
Thanks Russell - You rock!!
No Comments »
19
08
2008
Posted by: Colin in Flex, RIA
I recently ran into an issue where Flex Builder 3.0 wouldn’t let me debug and caused my whole System (OSX) to grind to a halt. It took me a while to get to the bottom of it, but I found the issue and addressed it.
Basically Eclipse had this error –over and over and over and ove…100+MB worth in the system.log
Aug 17 15:21:31 machine-name [0x0-0xc30c3].org.eclipse.eclipse[8730]: !ENTRY com.adobe.flexbuilder.debug 4 2 2008-08-07 15:21:31.716
Aug 17 15:21:31 machine-name [0×0-0xc30c3].org.eclipse.eclipse[8730]: !MESSAGE Problems occurred when invoking code from plug-in: "com.adobe.flexbuilder.debug".
Aug 17 15:21:31 machine-name [0×0-0xc30c3].org.eclipse.eclipse[8730]: !STACK 0
Aug 17 15:21:31 machine-name [0×0-0xc30c3].org.eclipse.eclipse[8730]: java.lang.NullPointerException
Aug 17 15:21:31 machine-name [0×0-0xc30c3].org.eclipse.eclipse[8730]: at com.adobe.flexbuilder.debug.breakpoints.FlexLineBreakpoint.findSourceFiles(FlexLineBreakpoint.java:388)
Aug 17 15:21:31 machine-name [0×0-0xc30c3].org.eclipse.eclipse[8730]: at com.adobe.flexbuilder.debug.breakpoints.FlexLineBreakpoint.instantiate(FlexLineBreakpoint.java:442)
Aug 17 15:21:31 machine-name [0×0-0xc30c3].org.eclipse.eclipse[8730]: at com.adobe.flexbuilder.debug.model.FlexDebugTarget.breakpointAdded(FlexDebugTarget.java:889)
Aug 17 15:21:31 machine-name [0×0-0xc30c3].org.eclipse.eclipse[8730]: at com.adobe.flexbuilder.debug.model.FlexDebugTarget$FdbThread.installDeferredBreakpoints(FlexDebugTarget.java:539)
Aug 17 15:21:31 machine-name [0×0-0xc30c3].org.eclipse.eclipse[8730]: at com.adobe.flexbuilder.debug.model.FlexDebugTarget$FdbThread.advanceStateMachine(FlexDebugTarget.java:570)
Aug 17 15:21:31 machine-name [0×0-0xc30c3].org.eclipse.eclipse[8730]: at com.adobe.flexbuilder.debug.model.FlexDebugTarget$FdbThread.access$6(FlexDebugTarget.java:544)
Aug 17 15:21:31 machine-name [0×0-0xc30c3].org.eclipse.eclipse[8730]: at com.adobe.flexbuilder.debug.model.FlexDebugTarget$1.run(FlexDebugTarget.java:646)
Aug 17 15:21:31 machine-name [0×0-0xc30c3].org.eclipse.eclipse[8730]: at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
Aug 17 15:21:31 machine-name [0×0-0xc30c3].org.eclipse.eclipse[8730]: at org.eclipse.core.runtime.Platform.run(Platform.java:857)
Aug 17 15:21:31 machine-name [0×0-0xc30c3].org.eclipse.eclipse[8730]: at com.adobe.flexbuilder.debug.model.FlexDebugTarget$FdbThread.eventLoop(FlexDebugTarget.java:626)
Aug 17 15:21:31 machine-name [0×0-0xc30c3].org.eclipse.eclipse[8730]: at com.adobe.flexbuilder.debug.model.FlexDebugTarget$FdbThread.run(FlexDebugTarget.java:687)
Aug 17 15:21:31 machine-name [0×0-0xc30c3].org.eclipse.eclipse[8730]: at java.lang.Thread.run(Thread.java:613)
A little googling turned up this article where the guy points to a setting in the mm.cfg. Issue resolved? Not so fast. My issue had similar symptoms but was not identical. After some trial and error I figured out that I had been building the SWFs in two different fasions: via ant and with Flex Builder. So it turns out that Flex Builder was finding the SWFs build by my build files and going into a recurring NPE fit. Flex Builder basically inundated the system.log to the point of no return. I could have waited for 2 days, but I chose to manually rotate the log myself (which took some googling to turn up the right solution).
Hopefully Flex Builder 3.0 has fixed this.
Symptoms:
Flex Builder hangs when setting a breakpoint (can’t debug – Eclipse and the system goes ‘out-to-lunch’)
Solution:
- Remove the duplicate swf’s or profiling versions
- Your machine still out to lunch? (syslogd) Then you will have to manually rotate your system log, since its too much for syslogd to handle.
sudo launchctl stop com.apple.syslogd && sudo mv /private/var/log/system.log ~/system.log.NPEFilled && sudo launchctl start com.apple.syslogd
(Stop syslogd, move the system.log file, start syslogd)
Reasoning:
Flex Builder goes into a flurry of recurring java.lang.NullPointerExceptions when trying to resolve the source attachment when there are multiple versions of the same swf. You won’t be able to debug or set a breakpoint. If you do, Your system log will be overloaded because of the massive onslaught of NPEs reported by Eclipse/Flex Builder. Syslogd tried to rotate the system log but it is just too large for it to handle after you’d let the recurring NPEs go on for a minute, so manually rotating the log seems like a good solution (got a better one?)
No Comments »
At the end of May (May 29th 2008), Amazon announced that Amazon Web Services Customers can now utilize "High-CPU Instances" on EC2. According to their specs, there are currently 2 versions of their "High-CPU Instances" as described below:
High-CPU Instances
Instances of this family have proportionally more CPU resources than memory (RAM) and are well suited for compute-intensive applications.
High-CPU Medium Instance
1.7 GB of memory
5 EC2 Compute Units (2 virtual cores with 2.5 EC2 Compute Units each)
350 GB of instance storage
32-bit platform
I/O Performance: Moderate
Price: $0.20 per instance hour
High-CPU Extra Large Instance
7 GB of memory
20 EC2 Compute Units (8 virtual cores with 2.5 EC2 Compute Units each)
1690 GB of instance storage
64-bit platform
I/O Performance: High
Price: $0.80 per instance hour
So the Extra-Large Instance has the computing Power equivalent to 20 EC2 compute units. This means that CPU bound problems get 2.5 times the performance for the same amount of money. In a post from earlier this year, I estimated that it would take 3,100,000 CPU hours to crack a 16384 bit RSA key pair based on stats I had found elsewhere. This came out to be about 38.75 hours (less than a couple days!!) with 10,000 instances and would cost a maximum of $310k (for an insanely large RSA key pair)ie an average of $160k to locate a specific pair. With the High-CPU instances, it would take approximately 15.5 hours to do the whole computing task from top to bottom. At 15.5 hours, it would cost $124k or an average of $62k. This definitely puts some CPU Bound computing jobs in closer reach of those who need it.
I could only imagine what this would do for CPU bound utilities like Video encoding/transcoding, weather pattern simulators, or large Rendering farms (among many other applications). I’d love the chance to work with a farm of machines again - Its like having a fleet of robots doing the work in a portion of the time that a traditional desktop could offer. Photogrammetry, hmmm… Videogrammetry…
Does anyone know of some good Linux based/open Photogrammetry software?
No Comments »
15
07
2008
Posted by: Colin in Flex, RIA
What?!? I was shocked to learn that the latest Flex framework / Actionscript doesn’t have an equivalent for a replaceAll() on String. I’m looking for a simple way to do replacements on a string. Most of the languages that I’ve worked with have such a method or a library to provide that functionality. PHP has the str_replace function, Java has a replaceAll() on java.lang.String, Python has it, C++ has libraries that readily provide this functionality, the System.String in the .NET framework(1.0,1.1,2.0, etc.) has a string#replace method, even in the RIA space, Silverlight has a replace method on System.String, as does JavaFX (java.lang.String).
After searching and reading for a while, the closest equivalent that I could find is a custom method that utilizes the split and join functionality like the following:
public static function StringReplaceAll( source:String, find:String, replacement:String ) : String
{
return source.split( find ).join( replacement );
}
The preceding function came from Base64.as from Jason Nussbaum’s blog post about Base64 encoding/decoding. Others have used similar functionality like this post on flexfanatic. Its definitely better than while loop.
I also found that it is possible to utilize a RegExp within the String#replace function as shown on SCRIBBLE IT. Basically the code would look like:
var str:string = "Somesilly String. silly!";
str.replace(new RegEx("silly", "g") " awesome");
With this pattern it can still be a one-liner, which should preform better than the split/join methodology, but I am still shocked that such a standard method isn’t in the framework. I am a bit surprised by this finding. is there a better way? A good StringUtil Library or something similar?
No Comments »
13
07
2008
Posted by: Colin in Groovy-Grails
This last April I did a presentation at the Twin Cities Code Camp on Microsoft Silverlight and SOA with a Grails server. I ended up writing a simple Grails application that used several web services to communicate to an in-browser Silverlight application. I specifically wanted to show a Silverlight application interacting with non Microsoft Technologies. I developed the Grails application on Linux on a different physical machine than what I used to develop the Silverlight application.
One of the Issues I ran into was that I was unable to make requests to the XML Web Services in the Grails application. It puzzled me for a minute until a quick Google search turned up a simple issue: I needed a crossdomain.xml policy file (or the clientaccesspolicy.xml). Flash/Flex users run into this all the time and thus most of what you will find is Flash centric. What is the crossdomain.xml file? Well its a way of restricting the domains that can access services. Its basically a white-listing of domains that are allowed to access the services. The browser and in-browser applications are supposed to respect the crossdomain.xml, and sometimes the Services (server-side) may protect themselves. You can think of it as a robots.txt for Web services.
Great, I knew what the problem was, now how do I fix it? I tried a few things, deploying to tomcat, but that didn’t work for me while I was actively developing the application. Once I understood a little more about Grails and Jetty, I realized that I could just modify the Jetty server that launched when invoking grails run-app. I simply had to add another context to Jetty, and bingo it worked. Here is what I did:
I found Grails’ RunApp.groovy script (the one that gets invoked on grails run-app) which was located at $GRAILS_HOME\scripts\RunApp.groovy. (%GRAILS_HOME%\scripts\RunApp.groovy for you Windows folk ). I had to simply create another context much like the Grails application context was being created. Here is a stripped down example of what RunApp.groovy looked like. (modifications in Bold)
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
/**
* Gant script that executes Grails using an embedded Jetty server
*
* @author Graeme Rocher
*
* @since 0.4
*/
…
grailsContext = null
rootContext = null
…
target( configureHttpServer : "Returns a jetty server configured with an HTTP connector") {
…
setupWebContext()
setupRootWebContext()
server.setHandler( webContext )
server.addHandler( rootContext )
…
}
target( setupRootWebContext: "Sets up the Secondary Root Context"){
rootContext = new WebAppContext("${basedir}/web-app-root","/")
}
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Most of the magic is in the rootContext = new WebAppContext("${basedir}/web-app-root","/") line. Notice that I had to create a new folder ‘web-app-root’ which resided alongside web-app (I think I used web-app for a while too). So this context responds to everything in the "/" domain which is the root of the site. Once I put my crossdomain.xml file in that folder, I could access http://localhost:8080/crossdomain.xml and the services were then accesible via Silverlight — Yay!
I’m sure there are better ways of doing this, but this is what I did to get the job done. Thanks to JT Dev for his most recent post, which reminded me that I was going to blog about this. I basically did Solution #2 in his blog post on creating multiple jetty contexts. Where was this post back in March? Thanks JT for tipping me off to the Static Resources Plugin!
2 Comments »
09
07
2008
Posted by: Colin in General
Big news today about a large security whole that affects the backbone of the Internet; DNS. The Domain Name System or DNS is basically what translates readable names like colinharrington.net to its corresponding IP address. It is cornerstone to just about everything that we do on the internet. This news is larger than the Debian, OpenSSL fiasco that I blogged about earlier.
I first came across this when I read this article which was posted to Digg.com.
When I first logged into Ubuntu, I was notified that there were very important security updates by the bright red warning icon in the gnome panel. I was quite happy not to have annoying balloon pop-ups or tricky log-out buttons that hijack the computer to automatically install important updates. The Ubuntu security updates notified me that I needed to update bind9-host, dnsutils, libbind9, among others.
We have known that DNS poisoning was an issue, but recent findings combining multiple attack vectors revealed a gaping security hole. It was interesting to note that this ‘bug’ was a design descision and had to be patched across the board. I guess design bugs can be quite hairy since its baked into everyone’s implementation. All major vendors have to patch this hole due to the design nature of this bug.
According to the initial article, The details of the attack will be revealed in 30 days "at the Black Hat security conference in Las Vegas". It is very interesting to note the current DNS issues that have made headlines recently. Apparently ICANN itself had lost its own domain name according to this story care of MSNBC. According to that article icann.com and iana.com were both hijacked. This sounds more like proof of concept work to me.
I am not an expert in this area but from the bit that I do know, the possibilities are scary; Naming authorities being compromised, man in the middle attacks, etc. What if someone were to gain control of major certificate authorities like VeriSign? It is a little scary to think about what someone could accomplish unknown to the user. Online Banking, Corporate Communications, Secure Service Bus communications, what if these could be spoofed into being sent to the wrong place, or *through* the wrong place?
This could very well make it into our history books. I guess we will know more in 30 days.
Here is some extra reading on the subject:
The initial article ended with these words: "This is about the integrity of the Web, this is about the integrity of e-mail," Kaminsky said. "It’s more, but I can’t talk about how much more." which sounds very similar to Rusty Ryan’s line in Ocean’s Twelve "Look, it’s not in my nature to be mysterious. But I can’t talk about it and I can’t talk about why."
No Comments »
02
07
2008
Posted by: Colin in Linux, Ubuntu
My experience in upgrading Ubuntu Gutsy Gibbon to Hardy Heron was a fairly smooth one. It was a straight forward process, The System Updater told me that there was a distribution upgrade. I followed the assigned steps and shortly had upgraded my whole system. The status bar was horribly in-accurate, changing from 4 minutes all the way to 54 minutes and back again in the matter of 30 seconds, but it was nothing that I haven’t seen on other operating systems.
The Installer maintained all of my current customizations (since they are in my home directory ~/ ). I was surprised to see that even my Compiz settings were all exactly how I had left them. I was happy that the Installer asked me what to do with merge conflicts in my /etc files, (samba.conf, php.ini, apache2.conf, etc.). There were only a few things that I had to tidy up
- Configuring the Launch Size of my Terminal window (Ubuntu Forums)
- blacklisting the pcspkr kernel module (by adding the line "blacklist pcspkr" to /etc/modprobe.d/blacklist - see ubuntuforums for more discussion)
I can now reliably use the standby functionality. I have a dual Monitor setup and it works well.
Is Ubuntu ready for mom? no, but its definitely on the right course! In my opinion, ubuntu is ready for the little brother, and the wife of a geek. It doesn’t test the Mom test, nor the Grandma test yet.
*Update* After a few months of using Hardy Heron, I have realized that Linux is my primary OS. I’ve taken the jump - its working out great. I still have some things that I would like to see ironed out a bit more, but its worth much more than I paid for it!!
It had been a while since I re-imaged. I finally got a chance to buy a larger hard drive for my laptop. I was suprised on how easy it was to get NTFS rw support with linux using NTFS-3G. I decided a while ago to give Windows and Linux each their own partitions along with a shared Data Drive now in NTFS.
So the Partition Table looks like this:
$ sudo fdisk -l /dev/sda
Disk /dev/sda: 200.0 GB, 200049647616 bytes
255 heads, 63 sectors/track, 24321 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x2d24c9d9
Device Boot Start End Blocks Id System
/dev/sda1 * 1 6266 50331613+ 7 HPFS/NTFS
/dev/sda2 6267 15150 71360730 7 HPFS/NTFS
/dev/sda3 15151 23942 70621740 83 Linux
/dev/sda4 23943 24321 3044317+ 5 Extended
/dev/sda5 23943 24321 3044286 82 Linux swap / Solaris
Here is a good article about setting up NTFS Support in Ubuntu. Linux is getting better every Day.
No Comments »
02
07
2008
Posted by: Colin in General
Yea I know… PHP. Please don’t shoot me. Its not as groovy as say … Groovy or Ruby, but it can get the Job done. I just found out how to configure PHP per virtual host. I guess I knew that it was possible, I just did not know how to do it. Tomorrow I’m planning on forgetting how to do it and have to look it up again, which is exactly why I’ll blog about it :-).
So Basically you can set specific PHP.ini settings in the virtual host definition. There are other ways of configuring PHP, but this one seems to be aligned to virtual hosts and is the right tool for the job I had to do.
PHP alania tipped me off to PHP.net’s article on the subject. It would look similar to:
<virtualhost>
DocumentRoot "C:\non\aya\business\public_html"
ServerName www.somesite.com
ServerAlias somesite.com
<directory>
Allow from all
php_admin_flag short_open_tag off
</directory>
</virtualhost>
Don’t forget that you could also configure PHP on the fly (while its running/executing) by utilizing the ini_set() function.
Happy PHP-ing!
No Comments »
|