Tuesday, July 31, 2012

charge by USB port

http://plugable.com/2012/03/13/charging-your-ipad-or-iphone-with-a-usb-hub/
Great information about charging Apple stuff and USB power in general.

Slow Custom Settings

Something I noticed recently on the Salesforce.com UI - anything to do with the Custom Settings page seems to be much slower.  Even just bringing it up takes up to 12 seconds.  Saving a new record can take almost 20 seconds.  It's happening to both production and sandbox instances.  Right now it's just a feeling, but I did hear at least one other developer expressing the same.

Friday, July 27, 2012

How to fix a non-working SD card slot in a Dell Latitude E6510

Well, I didn't find the fix myself - I stumbled on it.  The slot stopped working at some point, and I shipped the laptop 4 times back to Dell, and they replaced every link on the hardware chain - slot itself, port interface card, connecting cable, and the main board - to no avail.  I was mighty frustrated, as you can imagine.

Today I was removing the Control Point software from Dell, as this thing tended to spin out of control and eat up all CPU cycles lately.  I have no use for it anyway.  During the uninstall process, a driver message popped up: "Ricoh SD Reader installed" (may not be the exact wording) - that's my long lost SD slot!  WTF?  It felt as if the Control Point somehow suppressed the driver/device, and with its removal, the long ignored function came back.  In any case, thank goodness for it!

During the painful troubleshooting with Dell, out of more than 5 technicians/support engineers, not one even mentioned anything related to the Control Point.  Go figure...

Thursday, July 19, 2012

Force apply date format in Excel

It's a nice tip to force apply new date format in Excel to a column.  Just changing the cell format wouldn't work, as that only gets applied when data is entered.  So this is basically a way to re-enter the data by using Notepad as the copy/paste intermediary.
http://en.kioskea.net/forum/affich-172180-unable-to-change-date-format-in-excel
You might wonder why don't just copy/paste in place?  That doesn't seem to work in Excel 2007 and beyond.

Wednesday, July 18, 2012

get MTP connection from Android device to work (correctly) on Windows XP

I'm probably not the only who got stuck in this unfortunate and awkward setup: having a state-of-the-art mobile device (in this case Samsung Galaxy Nexus) while still on an antiquated desktop O/S, which is Windows XP.  Who runs Windows XP on a brand new i5 2400 with 8 GB DDR3??  Guess that's story for another day.  Anyway, one problem with the setup is the USB connection between the two.  Android 4 (ICS) has adopted a new way of presenting itself to the PC: MTP.  As such PC would view it as a media player, and in turn seem to manager it with Windows Media Player (WMP).  Vanilla Windows XP has WMP 6, which came out at a time when the world knew no iPod.  Under its ignorant management, copying most files from PC to an ICS device was impossible - you'd be greeted with an unpassable "file type not supported" message, even though you thought you were just dragging files from one Explorer folder to another.  To solve this nuisance you'll need to upgrade your WMP.  I got WMP 11 installed and all became well for me - now I can copy any files (with only an easily dismissible warning message).  Thanks for the hint provided here, and hopefully another tortured soul between the past and the future would benefit from this tip.

Lone ranger's workbench

Just did a Force.com Workbench installation on XAMPP on Windows XP (!)  It went pretty smoothly.  XAMPP version 1.8-VC9 with Workbench 24.0.  The only glitch was with PHP SOAP client, as discussed here, about SSL support in the client.  The cure mentioned worked like a charm (I only had to uncomment php_openssl.dll).

Tuesday, July 17, 2012

Salesforce.com report folder information via API


Found this very useful information...  The Report object is mostly self-explanatory, but the Report Folder info is much less obvious without a little help.
http://boards.developerforce.com/t5/Apex-Code-Development/Get-list-of-reports-in-a-folder/td-p/274011

Wednesday, July 11, 2012

Testing Schedulable classes

Apex Developer's Guide has a sample on testing Schedulable classes.  This is what they say about when your stuff in the Execute( ) method actually gets run in your test code.

"...when you test scheduled Apex, you must ensure that the scheduled job is finished before testing against the results. Use the Test methodsstartTest and stopTest around the System.schedule method to ensure it finishes before continuing your test. All asynchronous calls made after the startTest method are collected by the system. When stopTest is executed, all asynchronous processes are run synchronously. If you don't include the System.schedule method within the startTest and stopTest methods, the scheduled job executes at the end of your test method forApex saved using Salesforce.comAPI version 25.0 and later, but not in earlier versions."

What not mentioned was, the execution seems to be done not through the regular "channel" if you will, because there's no record of the execution in the CronTrigger object.  Therefore if you do this verification after stopTest( ):

        ct = [SELECT id, CronExpression, TimesTriggered, NextFireTime FROM CronTrigger WHERE id = :jobId];
        System.assertEquals(1, ct.TimesTriggered);


you are going to get a failure because ct.TimesTriggered would be 0.  So far I don't think this subtle difference has an impact on actual testing needs, but who knows...

Thursday, July 5, 2012

Cron Expression for Apex Scheduler

Each Cron implementation can have its own variant of the Cron expression (to my surprise) so here is the one used by Force.com.

http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_scheduler.htm

Initially I thought the info was missing the "End Date" part, as that's required by the scheduler UI, but later realized if it's a finite run series specified by the Cron expression, the scheduler knows when to stop.  The UI parameter set on the UI is by design open-ended, so it needs an End Date to limit the run series.