Posts

Showing posts from 2013

Troubleshooting Hadoop - A useful slideshare

Hadoop World 2011: Hadoop Troubleshooting 101 - Kate Ting - Cloudera from Cloudera, Inc.

Task tracker disallowed by Job tracker - Cloudera CDH 4.5 VM

When I loaded Cloudera's VM to explore hadoop, I was unable to start Tasktracker. The following error showed up. Task tracker disallowed by Job tracker org.apache.hadoop.filecache.TrackerDistributedCacheManager:Cleanup .. Java.lang.InterruptedExcpetion: sleep interrupted Solution: The problem is gone by restarting JobTracker first and then starting tasktracker. Even if you are still seeing the issue, please follow the below discussion. The solution suggested in this thread is editing the /etc/hosts file. An easier and cleaner work around is to fix your /etc/hosts file Using VMWARE fusion and Centos 6.2 x64, I noticed the hosts file lists localhost first. 127.0.0.1   locahost localhost.localdomain localhost4 localhost4.localdomain4  Rename it to this 127.0.0.1   localhost.localdomain localhost4 localhost4.localdomain4 localhost https://groups.google.com/a/cloudera.org/forum/?fromgroups#!topic/cdh-user/PRy7GynUI6U

Eclipse Indigo won't start on Ubuntu 12.04

Error:  java . lang . UnsatisfiedLinkError : Could not load SWT library . Solution: ln - s / usr / lib / jni / libswt -* ~/. swt / lib / linux / x86 / Reference: http://stackoverflow.com/questions/10165693/eclipse-cannot-load-swt-libraries/10251453#10251453

How Get $Site.CurrentSiteUrl in formula editor

If we want to see the current site url in HYPERLINK function of formula editor, this is how it should be done.  LEFT($Api.Partner_Server_URL_260, FIND( '/services', $Api.Partner_Server_URL_260)) Reference:  http://salesforce.stackexchange.com/questions/3816/how-do-i-get-the-base-url-in-the-formula-editor

Useful GIT & Nano Commands

Git commands $ git branch * master $ git branch -a * master origin/1-2-stable origin/2-0-stable origin/2-1-stable origin/2-2-stable origin/3-0-unstable origin/HEAD origin/master $ git branch -r origin/1-2-stable origin/2-0-stable origin/2-1-stable origin/2-2-stable origin/3-0-unstable origin/HEAD origin/master $ git remote show origin * remote origin URL: git://github.com/rails/rails.git Remote branch merged with 'git pull' while on branch master master Tracked remote branches 1-2-stable 2-0-stable 2-1-stable 2-2-stable 3-0-unstable master $ git ls-remote --heads origin 5b3f7563ae1b4a7160fda7fe34240d40c5777dcd refs/heads/1-2-stable 71926912a127da29530520d435c83c48778ac2b2 refs/heads/2-0-stable 2b158543247a150e8ec568becf360e7376f8ab84 refs/heads/2-1-stable b0792a3e7be88e3060af19bab01cd3d26d347e4c refs/heads/2-2-stable d6b9f8410c990b3d68d1970f1461a1d385d098d7 refs/heads/3-0-unstable f04346d8b999476113d5e5a30661e07899e3ff80 r...

Installing Latest Version of Node.JS in Ubuntu ( Less Than 13.04)

sudo apt-get update sudo apt-get install -y python-software-properties python g++ make sudo add-apt-repository -y ppa:chris-lea/node.js sudo apt-get update sudo apt-get install nodejs Reference:   https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager#ubuntu-mint

How to create a chart using Open XML SDK in Word 2010

Creating a Chart in Open involves two steps, as the data is stored at two locations.  Chart Cache Embedded Package - This is nothing but an Excel Sheet Thus, populating the data in Cache is not enough. We should also create corresponding Excel Sheet. Below is the sample code. The code is verbose as I was using Open XML productivity tool to arrive at this. Full source code can be found at  https://github.com/pradeepkumargali/GenerateWord-OpenXML   Main Class: ChartPart chartPart2 = mainDocumentPart1.AddNewPart<ChartPart>("rId7"); GenerateChartPart2Content(chartPart2); //Used to generate a dummy excel sheet out of a predefined blob - Look at "private string embeddedPackagePart2Data" EmbeddedPackagePart embeddedPackagePart2 = chartPart2.AddNewPart<EmbeddedPackagePart>("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "rId1"); GenerateEmbeddedPackagePart2Content(embe...

Chatter Unfollow Test Class Failures

Recently, we noticed all test failures in one of our test classes. The test class was written in 19.0. The problem being SOQL's were not returning records and all the assertions were failing.  Assertion Failed: Expected: 2, Actual: 0 The fix turned out to be very simple. We fixed the error by updating the APEX class version to 29.0

Android SalesforceSDK - Make Mobile Layout More Responsive By Using Load Spinner

Image
I noticed that layout-xlarge in Android Salesforce SDK has a nice loading spinner and header bar. So I have changed the layout appropriately. As part of this effort, I have modified or copied drawables,colors etc. from xlarge  resources. There are no code changes required. I am attaching the resources folder for the same. Replace the res @  ....forcedroid\native\SalesforceSDK  with the contents of the following zip https://docs.google.com/file/d/0BwilPq-bDpVPM1pyMGFiMy1WSUk/edit?usp=sharing  

Chrome Extension - Interactive Scraper

Image
This is my attempt to write an Interactive Scraper. See the Robot Icon In Browser Action Icons How to use? 1. From browser, you can choose the DOM element to scraper time to time.  Click On Capture detail 2. Data is persisted in Indexed DB of Background Page.  3. Data can be viewed or deleted by clicking "View" link from Add-In. This is implemented using Data Tables (table plug-in for jQuery ) 4. Once configured, you can run the scraper by clicking on "Roll" button. It will take you through all the URL's and collect text from DOM path and capture a screen shot for your future reference.  Development Challenges:   I have faced a few development challenges while developing this.  1. Chrome Synchronous Message Passing: I faced this problem when trying to load the URL's in a tab one after another. After the URL is loaded, the scraper should collect the text from the DOM and update it in database. There are ...

Native Vs Hybrid

There are three ways to deliver an application on Mobiles – 1. Native – Built on Native Mobile Platform 2. HTML 5 – Works in browser 3. Hybrid – Built with HTML5, Can access native features It is clear that user spend 80% of their time using Apps on mobile. That is four times more than the time they spend in browsing. Hence, browser based HTML 5 application is not the preferred way to deliver your mobile application. We have two options left before us. One, build a native application using the mobile OS platform (ex: Android or iOS). Second, use your HTML5 skills to quickly build an application and make it work as a native app on all platform using build frameworks such as PhoneGap. Many have tried to compare and contrast Native and Hybrid. In this article I will summarize the analysis I have done over this subject matter.  After going through lot of articles and presentations, a presentation from propelics appealed to me. It is unbiased and to the point. Below are the...

Sample: Posting a Comment with a File Attachment

In SFDC Apex Code Developer, a sample to post a comment with file attachment using Chatter Apex (ConnectAPI) is given. But, the code is not copy paste-able. You may see the following error for  messageInput.messageSegments.add(textSegment); System.NullPointerException: Attempt to de-reference a null object The correct code looks as below.  String communityId = null; String feedItemId = '0D5x0000000azYd'; ConnectApi.CommentInput input = new ConnectApi.CommentInput(); ConnectApi.MessageBodyInput messageInput = new ConnectApi.MessageBodyInput(); //Added messageInput.messageSegments = new List<ConnectApi.MessageSegmentInput>(); ConnectApi.TextSegmentInput textSegment; textSegment = new ConnectApi.TextSegmentInput(); textSegment.text = 'Comment Text Body'; messageInput.messageSegments.add(textSegment); input.body = messageInput; ConnectApi.NewFileAttachmentInput attachmentInput = new ConnectApi.NewFileAttachmentInput(); attachmentInput.description ...

Why my custom prerequisite is saying it is corrupt?

Error: Verifying file hash Error: Setup has detected that the file '.....XXXXX.msi' has either changed since it was initially published or may be corrupt. Solution: Option 1: Uninstall .NET 4.5 and work with .NET 4.0 only Option 2:   Sign your package files with a code-signing certificate to avoid a defect introduced in .NET 4.5 References: http://stackoverflow.com/questions/13073915/clickonce-prerequisite-error-published-installer-may-be-corrupt http://msdn.microsoft.com/en-us/library/ms165429.aspx

Updating SourceData/ Data Source of the Pivot Table

Image
Errors:  1. Run time error '1004' Cannot Open PivotTable source file https://....[servlet.FileDownload?]... 2. Data source reference is not valid 3. Can not use web data source as pivot data 4.  Run-time error '-2147024809 (80070057)' Item with specified name wasn't found 5.  Error: Cannot open PivotTable source file ‘[filename[x].xls]SourceData’ 6.  Exception from HRESULT: 0x800A03EC   at System.Dynamic.ComRuntimeHelpers.CheckThrowException(Int32 hresult, ExcepInfo& excepInfo, UInt32 argErr, String message)    at CallSite.Target(Closure , CallSite , ComObject , String )    at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)    at CallSite.Target(Closure , CallSite , Object , String )    at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1) Solution: We have spend a day searching around for the solution. We ...