My Photo

Flickr

  • Photos on Flickr
    www.flickr.com
    This is a Flickr badge showing public photos from santiago_eric. Make your own badge here.

Netbook undergoes a OSX change - Part 2

Pc-gun So after being able to successfully load Mac OSX on "my" MSI Wind U120-024US, I had to take inventory and see what did and did not make the transition.

First order of business was to upgrade the Bios from .10C to .10F. MSI does a great job of getting you lost on its website. (I suspect Engrish may not be the native language of the web team. ) In any case, I finally tracked down the latest bios and , even better, the user manual .

This post gave very clear instructions on updating the 120 Bios. Creating the bootable USB drive for DOS was simple enough having had practice creating several by this point. I copied over the three files from the download and rebooted the Wind. On my first attempt I got "ERROR: Bios has no flash information available". According to MSI's FAQs that error is asking you to plug in the power cord. Because an message reading, "Please plug in the power cord" would be confusing. I did that and it worked on the second pass.

Next, I wanted to upgrade the OS to 10.5.7. I knew I might be pressing my luck but I pushed on anyway. The update itself went smoothly. After rebooting, the mouse and keyboard didn't work, but I expected that from some of the posts I had read. I hooked up my USB mouse and keyboard to install the necessary drivers. (BTW if you write your system password to a text file on the desktop prior to the update you can save yourself the need for the keyboard by just using the mouse to copy and paste when prompted for it.) Of course I made a huge mistake and used the 10.5.6 'Everything You Need 'package from the main wiki page. DON"T DO THAT. Installing the mouse/keyboard drivers and Realtek wireless worked. But, when I got to the part about updating the video ktext, I rebooted to a grey screen with funky black lines all over the place. More Zebra than Leopard. (That's a Mac pun, kids.) 

Well, I solved that mishap by hitting the "any" key (A 'lil tech support humor here. This is as funny as it gets, folks.) during the darwin boot screen, entering -x at the boot options prompt. This got me into safe mode and I was able to delete the ktexts I had installed and then restore the originals which had been given a .orig suffix. That's two hours of my life I won't get back.

Take two; I was able to find a package with all the relevant drivers for 10.5.7 on this post. Again I pressed my luck and decided to select the options for Realtek Ethernet and the Trackpad despite some allusions to issues by both the author and several posts. Living on the edge here. After getting caught in an endless reboot cycle, I realized that might not have been a good idea. Safe mode didn't work this time. So I booted into single user mode using the -s option at the Darwin prompt. Then I used the instructions here to delete the RealtekR1000.kext. If you get the read-only error like I did use the mount -rw -a command suggested in the first comment of that thread.

Take two point five; Ok booted successfully again. Now time to review the update items and see what does/does not work.

  • Video - Booted to 800 x 600 but a quick check of the display pref pane showed options for 1024 x 800. Awesome.
  • Network - Wireless still worked from my previous install. The Realtek RTL8187SE wireless drivers are also included in the MSi WindOSX86 Upgrade Pack v1.5. The wireless app pops up on every boot which is annoying. I used the Auto-Close for Realtek app suggested on the OS X post install tweaks and fixes post and that seems to have resolved that. As mentioned previously, Ethernet driver was a total bust. It turns out that the first driver package installed the RealtekR1000.kext driver to the location /System/Library/Extensions/IONetworkingFamily.kext/Contents/PlugIns/ which is for a retail install. The correct location is /System/Library/Extensions/. So essentially I had the same driver in two seperate locations. Booting into single user mode and deleting the first one fixed the errors and got the ethernet working perfectly. More details in this post.
  • Battery - The guage appears on the toolbar as expected. Calculates percentage and time albeit slowly. Fully charged with a 6-cell battery estimate was 3:50 battery life. I tried the VoodooPower app suggested on the aforementioned post and didn't see any significant change right away. However after comming out a sleep mode the battery guage showed 5:30. That's almost too good to be true. I left it on for a while and noticed issues with hiberate and random reboot requests. Went into single user mode and deleted the kext.
  • Sleep mode - Closing the lid puts the notebook into sleep instantly and hitting the power button brings it back just as quickly which is where my Windows laptop falls woefully short.
  • Audio - Integrated speaker works fine. Headphone did not. I had success with Chud/Audioee4Wind from the post install thread but I hated having to use script and swtiches to slect between the external speakers and headphones. VoodooHDA works much better and switches between the two automatically. You'll need to uninstall Audiee4Wind and delete the AppleAzilla.kext prior to installing it. Getting the external mic jack to work took a bit of fiddling with the settings in the Voodoo pref pane. I used the following; (Setting the recording level seems to be the critical piece. Other settings refine the quality.)
    • Speaker: PCM 100%, Speaker 100%, Mic 100%, IMix 25%, Recording Level 80%
    • Mic: Speaker 100%, Mic 100%, Input mix 25%
  • Camera - Need to hit Fn + F6 to turn it on. Had no luck with CamTwist. ManyCam worked like a charm with Skype. You have to set ManyCam to start on boot and set the camera in Skype preferences to ManyCam after it loads.
  • Trackpad -Worked fine after running the 1.5 upgrade pack. I decided to try installing Two-Finger scrolling but the mouse was nearly unusable afterwards. It did scroll, but only down and not up and even that took pressing rather hard. The cursor twitched and jumped all over the place. I made some attempts to use the FFscroll pref pane to tweak the settings (hard to do with a disfunctional mouse) but it never seemed to save the changes and half the time would not open at all. I'll leave that to braver souls than I.
  • Key Mapping - I wanted to use the windows key as the command key. System Preferences > Keyboard & Mouse > Modifier Keys. Changed Option Key to map to Command and Command Key to map to Option. Now I can Windows + C to copy and Windows + V to paste. Maybe I'll find a little sticker to label the key better.
  • Bluetooth - I don't know if this even comes with my model nor do I have anything to test it with.

Final Impressions: Getting this Mac clone set up took quite a bit more effort than I originally anticipated. Ironically, all this command line bios-changing driver error fixing blue screening reminded me of setting up a Windows machine. Which was not necessarily a bad thing. I learned quite a bit more about the Mac OS. I think with today's computers being much more like sealed devices, people learn less about what is under the hood and make these things work. I remember when my dad bought one of the first PC's. We turned it on and the screen blinked a cursor at you. It took my brother and I days to get just DOS running. These days computers are like cars; everyone knows how to drive, but they pay some guy big bucks just cause he knows how to change the wiper fluid. Not that I mind. I'm complaining all the way to the bank.

The bicycle thief

I've been looking for a cheap bike now that I have an apartment with extra space. Unfortunately, it's summer and every other Brooklynite has the same idea. Craigslist is awash with bikes for sale; so much so, it's overwhelming. Most of them re-painted junkers for $500. Now, I haven't ridden seriously since I was a teen and used to follow the Gimbel's Ride (as far as the huge hill by the Kenisco Dam anyway, leaving me to find my way home to the Bronx alone). So, I'm not exactly up to date on the world of cycling. (They can make bikes out of bamboo? For real? Wow. And they cost $2,700. Wha?!? But, its made of freakin' wood. Wow. It ain't easy being green.)

Bike_mugshot This led to a thorough (some would say obssessive) search of the interweb for sources of cheap bikes. Ebay was a bust. Someone on Yelp suggested police auctions. Another search revealed that the Toronto po-po have their own Ebay store. What's even better is that they have mugshots of the bikes in their lineup. "Number 4, please turn to left." Ah, trust the Canadians to make us laugh after a long day of fuitless Googling. Well... I laughed anyway. Though I'm probably gonna cry if I end up at the bike shop plopping down $600 for a Trek Soho S. Then I will have to depend on the Japanese to lift my spirts out of the doghouse. Te he. Dog pun. Ok, I need to step away from the computer now.

Netbook undergoes a OSX change

Mac-pc My girlfriend got a shiny white MacBook several months ago and I've been seriously sweating it. (I'm borrowing it right now) For one, it turns on in the time it take my crappy laptop to inform me that its from Dell. Don't get me started on trying to get XP to hibernate/sleep. I just leave it on 24/7 to save myself 30 minutes of "Loading..." hell each morning.

So when she decided to get a Netbook for her monthlong stay in South Africa, I jumped at the chance to make a mini mac clone. So I 'persuaded' her to buy a MSI Wind 120 after doing some Google research which cited that as one of the models well-suited for 'hack-a-mac'.

Working in the SAaS sphere for a few years now, I haven't done the whole fdisk, bios, etc thing in a while. Luckily there were a lot of posts on the MSI Forums to help.

I started by purchasing a 4GB USB drive, downloaded MSIWindOSX86.iso from the Pirate Bay, and started following the instructions at http://wiki.msiwind.net/index.php/Bootable_Flash_Drive_for_OSX_(using_a_Mac) 

  1. Using the MacBook, popped in the USB key
  2. Open Disk Utility app
  3. Click on destination USB
  4. Click on Partition
  5. In Volume Scheme pull down menu select 1 Partition
  6. Click on Options
  7. Radio Button Master Boot Record, click ok
  8. Format Mac OS Extended Journaled
  9. Apply
  10. When the formatting is complete, click Restore
  11. Mount the WindMSIOSX86.iso image (that means double click on it for us less Mac-literate) it will appear on the left sidebar of the Disk Utility now
  12. Drag the mounted WindMSIOSX86.iso to the ' SOURCE ' section
  13. Drag the usb drive partition to the ' Destination ' section
  14. Check ' erase destination ' click ok. Restore to USB will take about 10 minutes or so...
  15. Download the latest Chameleon EFI

OK the last step took me quite a while. Most forums mentioned the Chameleon DMG and direct you to the Developers site. But all I could find was the source code for the latest stable version 1.0.11 not the compiled package. I tried the 2.0 RC1 package but it kept stalling at the message "Writing Package Receipt. It took some searching to finally find a copy at FilesTube; Chameleon-1.0.11-installer.dmg.

  1. Double click the chameleon dmg to mount it, run through its prompts and install it to your flash / usb key - this makes it bootable.Make sure to change the target because it will default to your Mac's harddrive.

Now you need to prep the MSI Wind. I didn't want to delete the recovery or windows partitions in case things went south. Luckily the Wind came with three partitions, recovery, OS_Install, and a third empty partition. I ended up creating a Ubuntu live bootable from a spare 1GB drive following the suggestion on this post; http://forums.msiwind.net/viewtopic.php?f=32&t=4701 and then deleting the third partition. I tried going through the next step leaving the space unpartitioned, but I couldn't get past the select a destination step in the Mac OS installer. So I went back and created and unformatted primary partition.

  1. Plug Flash / USB key into msi wind, boot from it (either change in bios or hit f11 for boot menu) 
  2. Run through the installer till you get to the select a partition screen. You'll see the recovery partition and windows partition with red exclamation marks on them meaning you can't use those. Open the Utilities menu and open Disk Utility. From here you can erase the unformatted partition and format it as  Mac OS Extended Journaled. (You may in fact have been able to delete and format the partition in one step saving yourself the previous boot from Ubuntu.)
  3. Close the disk utility. You should now have a new partition without the red mark and that you can select.
  4. Click next till you get to the install button. Before clicking that click the Customize button. Expand the options until you see Kernel. Uncheck that option. (I don't now why but a bunch of post mentioned this. I think it has to do with making your os able to handle updates)
  5. Run the install. It should take a few minutes and reboot your Wind automatically.

Now when my machine rebooted, I got a HFS+ error. Now the last post I cited suggested using Ubuntu to fix the boot flags. That didn't work for me. I ended up using the suggestion here

  1. Boot from bootable flash drive back into macosx installer
  2. Open Terminal from the Utilities menu
  3. At the command prompt type
fdsk -e /dev/rdisk0
flag 3
update
write
quit
reboot
  1. All 3 partitions will show in darwin bootloader, with osx the default.

Success!! My wind booted to Mac OSX with the gloriously satisfying intro movie. The next steps are to make sure everything works. Already I'm seeing some issues with the wi-fi. I'll post more as I figure it all out.

HTML WYSIWYG editor for fields in Salesforce using Visualforce

This is something I wanted to play around with ever since I first saw something similar demoed back in Dreamforce '07. To the best of my knowledge, there still isn't a native VisualForce component for this. My earlier effort was an Scontrol, but I really wanted to take advantage of VF's speed. So, here's my stab at it.

<!--- Proof of concept WYSIWYG Editor
references
http://dojotoolkit.org/book/dojo-book-0-9/part-2-dijit/
advanced-editing-and-display/editor-rich-text

-->

<apex:page StandardController="Account">
<apex:stylesheet
value="http://ajax.googleapis.com/ajax/libs/dojo/1.2.0/
dijit/themes/tundra/tundra.css
"/>
<apex:stylesheet
value="http://ajax.googleapis.com/ajax/libs/dojo/1.2.0/
dojo/resources/dojo.css
"/>
<script type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/dojo/1.2.0/
dojo/dojo.xd.js
"
djConfig="parseOnLoad: true"/>
<script type="text/javascript">
dojo.require("dojo.parser");
dojo.require("dijit.Editor");
</script>
<apex:sectionHeader title="Sample WYSIWYG editor
using Visualforce and Dojo"></apex:sectionHeader>
<apex:form id="editorForm">
<apex:pageBlock ><apex:pageBlockButtons >
<apex:commandButton action="{!save}" value="Save"
id="theButton"/>
</apex:pageBlockButtons>
<div class="tundra"
style="background-color: #f5f5f5;width:400px;">
<textarea id="editor1" name="editor1"
   dojoType="dijit.Editor" inheritWidth="false"
    name="tmpTextString"
   onBlur="document.getElementById('{!$Component.descript}')
    .value = dijit.byId('editor1').getValue(false)">
{!Account.description}
</textarea>
<apex:inputHidden id="descript"
value="{!Account.description}"></apex:inputHidden>

</div>
</apex:pageBlock></apex:form>
</apex:page>

The above code provides a working example (Note:check for line breaks when you copy and paste) of a inline editor that provides rich text formatting for the Account description field. I used the Dojo Toolkit. You'll see that it references javascript files stored on Google's Ajax API site. I would suggest uploading the library as a static resource instead.

To eliminate the need for a custom controller, I used javascipt to write the text from the editor field to the Account.Description field once the editor looses focus (onBlur). That way the standard controller save function takes care of the rest.

Grappler's Quest Results

Well my faithful reader(s) you've been waiting long enough for a follow-up to my last post. I went 1 for 1 in the Welterweight (160-169.9 lbs) Beginner division at the 2008 Northeast Championship of Grappler's Quest. I was happy with my first showing.

Lessons learned;

  1. Do not get on a 6 hour flight the day after a fight - my coach class flight to San Francisco was made all the more pleasant by a pulled hamstring. I also had the middle seat.
  2. Learn the points system - while 4 four minutes might seem like a long time compared to 3 minute Muay Thai rounds it flies by quickly. In my second match, I got absolutely whipped on points (20-0) because I didn't realize that regaining half-guard wasn't getting me anywhere. See also point 3.
  3. Move up a weight class - I dropped from 175 to compete as a Welterweight which in hindsight wasn't a great idea. The thought was that I'd compete at the higher end of the class (I weighed in only 4 ounces under the maximum for the division) and fight lighter guys. In reality, its all about the weight to strength ratio. A 5'10" person has a lower muscle to body weight percentage than someone of the same weight at 5'4". I came to this realization during my second match as my much much shorter opponent sat on my chest like a sack of meat. Getting back up to 180 as soon as possible.
  4. Pre-fight prep was perfect - The event went just like the karate tournanments I used to frequent; hurry up and wait. I arrived at 10am and fought at 5pm. Expecting this, I came prepared; warm gear to sit around for hours in a cold gym, iPod with Billie Holiday and slow jams to keep the adrenaline in check, time the warm-up as close to the match as possible, then queue the high tempo stuff and Go, Go, Go! Felt peaked and ready when the time cam to get on the mat.

There is some video which I hope to post and viciously critique. Until then.

Fighting this Saturday

The last few months have been fairly uneventful; work, train, sleep, rinse, repeat. So, to celebrate my recent birthday and see if all this training is paying off, I signed up to fight in the 2008 North American Grappling Championship of Grappler's Quest this Saturday.

Oct_nagc

I've done tournaments and inter-school heaters  before (mainly Karate and Muay Thai), but this will be my first Brazilian Jujitsu competition. I've only been practicing BJJ for a little over a year now. I'm a bit nervous and determined to not be either of the guys in this picture because ... well, one's a loser and the other one's getting choked out. Luckily, I'll have support from my teammates at Ronin Athletics and hopefully I'll have some pictures/video of my impressive victories. However, if I get schooled by some some punk dressed like a ninja ... then we will never speak of this again.

Video Tutorial: Rapid Salesforce Configuraton with Eclipse and Force.com

Eclipse_video I've used the Force.com IDE which is built on the popular Eclipse platform here and there since it was first released. Mainly to build Apex triggers and VisualForce pages in my developer org in preparation for the Summer '08 release. I also used it to copy some custom profiles between two orgs. But recently, someone mentioned to me that I could use Eclipse to add custom fields to both custom and standard objects. (I stress the latter because for all my Googling I came across only a single post on this.) Given how frequently I'm building out fields in Salesforce, I'm painfully aware of how the standard wizards (while great for general administrators) are much to slow for developers and consultants deploying multiple fields on multiple objects for multiple instances.

Using Eclipse makes field creation a cut and paste operation. It also allows you to work offline. Those two facts alone make it worthwhile, but you can also copy objects, profiles, VisualForce pages, Apex code, and more between orgs as simply as Ctrl-C...Ctrl-V.

Unfortunately, it took me a while to figure out how to do all this. Documentation is tremendous for the Salesforce app, but lacking for the IDE. So I decided to pay it forward once again and put together a video outlining the major steps for;

  1. Creating a Force.com Project in Eclipse
  2. Creating custom objects
  3. Adding standard objects to your project
  4. Adding fields to custom and standard objects

The key discovery was the format for fields in the Metadata API. The documentation only had a single example and the Eclipse help file had none. Simply put the fields are defined by XML tags as such;

    <fields>
        <fullName>Sample_Checkbox__c</fullName>
        <defaultValue>true</defaultValue>
        <description>Description</description>
        <inlineHelpText>Help Text</inlineHelpText>
        <label>Sample Checkbox</label>
        <type>Checkbox</type>
    </fields>

The IDE is not yet as mature as say, Dreamweaver. So while you'll get suggestions as to what tags are available as you start typing, it isn't smart enough yet to just paste in all the parameters needed for the type of field being inserted. This means you have to know that Picklists require a <picklistValues> tag. Or that <externalId> only applies to certain field types.

To save time, download my cut and paste cheatsheet of the custom fields and parameters you can use to cut and paste new fields in Eclipse.

Enjoy!

Google saves me from certain death

Toronto maze I was visiting Toronto this past weekend and spent a nice sunny day touring Toronto Island. I'm having a lovely time and I see a long row of hedges with a sign near an opening. Sure enough it turns out to an entrance to a maze straight out of The Shining. I'm game, so I go in meandering through the twists, turns, and dead ends. But, after 15 minutes I'm getting bored, hot, and attacked by mockingbirds left and right. So, before I start seeing any twins and rivers of blood, I whip out my trusty blackberry and bring up Google Maps Mobile. I get a fix on my location and start following the directional arrows to freedom.

Winning Combo for Non-profits: Salesforce + Google Apps

Google and Salesforce announced a new product today joining two of the best web-based tools into one suite. Check out this video for an overview of Salesforce + Google Apps, http://www.google.com/a/help/intl/en/admins/video/salesforce_video.html

At my former non-profit, I loved that Salesforce did not require an infrastructure to support. I kept eyeing my problem-prone Exchange server thinking, "Now if I can only get rid of you." Google Apps was a possibility but the migration was daunting and it didn't integrate with Salesforce as Outlook does. With the added value of integration, the payoff for migration becomes that much greater. Especially when you take into account that both Google and Salesforce offer product donations to 501c3 non-profits.

More info on Google apps for non-profits.
More info on Salesforce for non-profits.

Any startup or grassroots org without legacy systems shouldn't even think twice about a platform like this. No equipment. Low cost implementation. Free licenses.   

http://www.salesforce.com/products/google/get_started.jsp

WYSIWYG Editor in Salesforce Scontrols

Until Salesforce adds a native option for WYSIWYG editing controls for text areas (promote the idea) the only workaround is to create an Scontrol form that calls on other Javascript toolkits to handle this functionality.

Salesforce hosts the Dojo Toolkit but unfortunately there is a lack of definitive documentation on employing it in Scontrols. I wanted to create an scontrol that uses the Dojo Editior (http://dojotoolkit.org/book/dojo-book-0-9/part-2-dijit/advanced-editing-and-display/editor-rich-text) to give the user WYSIWYG controls for a text area.

Thanks to some assistance from fellows on the forums at developer.force.com I was able to put together a working prototype. Here is the working code;

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" 
"http://www.w3.org/TR/html4/strict.dtd">
<html>

<head>
<meta http-equiv="Content-Type"
content="text/html; charset=UTF-8">
<title>Editor Demo</title>
<style type="text/css">
@import "/js/dojo/0.9/dijit/themes/tundra/tundra.css";
@import "/js/dojo/0.9/dojo/resources/dojo.css"
</style>
<script src="/soap/ajax/10.0/connection.js"></script>
<script type="text/javascript"
src="/js/dojo/0.9/dojo/dojo.js"
djConfig="parseOnLoad: true"></script>
<script type="text/javascript">
dojo.require("dojo.parser");
dojo.require("dijit.Editor");
</script>

</head>
<body class="tundra">
<form method="post">
<textarea name="field" width="200px"
dojoType="dijit.Editor">
It was a dark and stormy night. Your story belongs here!
</textarea>
<input type="submit" value="Save" />
</form>
</body>
</html>

There still remains the javascript needed to load the data from a text area field into the editor on page load and the function for saving the edited text back to that field. Since that varies greatly depending on the object you are using, I leave that to you.