Skip to main content

Posts

Flex ByteArray to Java ByteArray

While trying to import XLS files from Flex front-end, we needed to pass the file contents to Java middle tier, where Apache POI library was used to parse the contents. The Java method expects a Java ByteArray containing the file contents, but when we pass a Flex ByteArray to it, it throws error. To overcome this instead of passing Flex ByteArray, we should pass an Array of bytes, as depicted in following code snippet: public static function byteArrayToArrayOfBytes(ba:ByteArray):Array {     var arrayOfBytes:Array = [];     ba.position = 0;     while(ba.bytesAvailable > 0)         arrayOfBytes.push(ba.readByte());     ba.position = 0;     return arrayOfBytes; } public function onFileSelectionComplete(fileReference:FileReference) {     var payload:Object = new Object();     payload.byteArray = byteArrayToArrayOfBytes(fileReference.data);  ...

Flex: ToolTip on Spark DataGrid Rows

We can use Spark DataGrid's showDataTips and dataTipFunction properties to show customized tool tips on the rows. An example showing this: <?xml version="1.0" encoding="utf-8"?> <s:Application initialize="onInitialize()" xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark"> <fx:Script> <![CDATA[ import mx.collections.ArrayCollection; import mx.utils.StringUtil; private static function fnDataTip(item:Object, column:GridColumn):String { var toolTip:String = item[column.dataTipField != null ? column.dataTipField : column.dataField]; if (toolTip == null || StringUtil.trim(toolTip) == "") toolTip = ""; if (item.hasOwnProperty("toolTipComment") && item.toolTipComment != null && item.toolTipComment....

Insert code snippets in Blogger using Prettyfy

If you want to insert code snippets with syntax-highlighting in your blogs on Blogger.com, then you can use google-code-prettify . There are other syntax highlighting solutions out there, but this allows to do this very simply. The steps are: Click on "Theme" (in LHS of blogger home page) or "Design" (in upper RHS corner). Click on "Edit HTML" button. Search for <head> tag in the html. Insert following line after meta tags in head tag: <script src='https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js?lang=scala&amp;lang=yaml&amp;lang=bash&amp;lang=xml&amp;lang=sql&amp;skin=sons-of-obsidian' type='text/javascript'></script> For me it is just before <title> tag. Add onload property to <body> tag: <body class='container' onload='prettyPrint()'> Here I have used " Sons-Of-Obsidian " style, you can use any of the available themes . ...

Unable to connect Adobe Flash Debugger in Google Chrome

The reason for it is that Google Chrome browser (32-bit) includes Adobe Flash Player built-in. To install and use an alternate version of Flash Player/Debugger: Download and install the appropriate system plug-in. Type "about:plugins" into the address bar at the top of a Chrome browser window. Click "Details" at the top right corner of the page. Find the "Flash" (or "Shockwave Flash") listing for the integrated plug-in on the page and click the corresponding "Disable" button. Find the "Flash" (or "Shockwave Flash") listing for the system plug-in on the page and click the corresponding "Enable" button. Close all Chrome windows and restart the browser.

Import root certificate in Windows

Following are the steps to import a digital certificate into the trusted root certification authorities folder: Click Start, click Run, type mmc, and then click OK. Click File, and then click Add/Remove Snap-in. On the Standalone tab, click Add. Select Certificates, and then click Add. When prompted, select Computer account, and then click Next. On the Select Computer page, select Local computer (the computer this console is running on), and then click Finish. In MMC, expand Certificates – Local Computer, and then expand Trusted Root Certification Authorities. In the details pane, right-click and point to All tasks, and then click Import. On the first page of the Certificate Import Wizard, click Next. In the File name dialog box, type the name and location of the file containing the root CA's digital certificate, and then click Next. On the Certificate Store page, click Place all certificates in the following store, ensure that the Certificate store dialog box shows Trust...

Procedure for name and date of birth change (Pune)

For change of name, the form (scribd) is available free of cost at Government Book Depot (Shaskiya Granthagar), which is located near Collector’s office, next to Saint Helena's School. The postal address is: Government Photozinco Press Premises and Book Depot, 5, Photozinco Press Road, Pune, MH, 411001. Wikimapia link Charges for name or date of birth change, in the Maharashtra Government Gazette: INR 120.00 per insertion (for two copies of the Gazette) For backward class applicants: INR 60.00 Charges for extra copy of the Gazette: INR 15.00 per copy (two copies are enough, so you may not want to pay extra for extra copies). Backward class applicants are required to submit a xerox of caste certificate of old name as issued by the Collector of the District concerned. Once the form is duly submitted, it normally takes 10 to 15 days for publication of advertisement in the Maharashtra Government Gazette. The Gazette copy reaches to the address filled in the form within nex...