Posts

Showing posts from June, 2013

Common APEX And Visualforce Errors And Solutions

Problem :   no viable alternative at character   Solution : Make sure you don't mention enclose Strings with double quotes. quotes should be enclosed in single quotes. Opportunity.Description__c='ABCD'   NOT  Opportunity.Description__c="ABCD" Problem : Returning PageReference doesn't redirect to detail page Solution (Possible): Make sure DML statement insert or update is done before preparing and returning page reference.  insert request; PageReference pPage=new ApexPages.StandardController(request).view(); pPage.setRedirect(true); insert request; return pPage; Problem:  Incorrect code coverage OR Comments are considered for code coverage. OR Strange issues with code coverage.  Workaround: The solution to this problem is clearing the test Results log at the path http://xyz.salesforce.com/07M  where xyz is salesforce instance (ex: cs1,ap1 etc) or Go to Setup>Develop>Apex Test Execution>View Test History> Clear Test Results

How to save a rendered PDF file as Attachment?

Problem : How to save a rendered PDF file as Attachment ?  Solution:  Use getContent() method of  PageReference. Sample code can be found at  http://blog.jeffdouglas.com/2010/07/14/attach-a-pdf-to-a-record-in-salesforce/

Uninstall SQL Server: Unable to find SQLEXPRESS in the dropdown

Image
Problem:  After following the following document to uninstall SQLEXPRESS instance on Windows 7 http://msdn.microsoft.com/en-us/library/ms143412.aspx ., I couldn't find SQLEXPRESS in the drop down. But, it is listed in the available instances.  Solution:   I followed the stackoverflow answer.  http://dba.stackexchange.com/questions/13683/remove-an-instance-of-sql-server-2008-r2-after-reinstalling-sql-server-2008 Step 1: Go to services and delete the folder where SQLEXPRESS's MSSQLSEVER service is running.  Step 2:  Try to uninstall SQL Server from control panel (follow  http://msdn.microsoft.com/en-us/library/ms143412.aspx )  Now the drop down shows SQLEXPRESS instance as well. 

How to see the descriptions of all user defined columns in a database

 select         st.name [Table],         sc.name [Column],         sep.value [Description],         st.[type]     from sys.tables st     inner join sys.columns sc on st.object_id = sc.object_id     left join sys.extended_properties sep on st.object_id = sep.major_id                                          and sc.column_id = sep.minor_id                                          and sep.name = 'MS_Description'                                          where st.type='U'

Hooking Pocket Sphinx Into Android

In 2011, I have hooked Pocked Sphinx into Android using NDK. The following post has helped me a great deal. http://swathiep.blogspot.in/2011/02/offline-speech-recognition-with.html I was the first one to thank the writer. I think the post still holds good. The current demo can be found @ http://sourceforge.net/p/cmusphinx/code/HEAD/tree/trunk/PocketSphinxAndroidDemo/ Swig folder can be found @ http://sourceforge.net/p/cmusphinx/code/HEAD/tree/trunk/pocketsphinx/swig/edu/cmu/pocketsphinx/ Sometime I may again try porting pocketsphinx to my mobile.