Techno Curry http://www.premsweb.com Most recent posts at Techno Curry posterous.com Fri, 24 Feb 2012 07:22:43 -0800 Filtering a tree that uses an array collection http://www.premsweb.com/filtering-a-tree-that-uses-an-array-collectio http://www.premsweb.com/filtering-a-tree-that-uses-an-array-collectio I was looking for a way to filter a tree in a specific way by keeping the parent nodes even if it doesnt match the filter criteria when I ran into this. It provides exactly the solution I needed. I think there may be an alternative method but this works pretty good for me.
http://www.kalengibbons.com/blog/index.php/2009/01/filtering-a-flex-tree-using-an-arraycollection/ 

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/562006/010100010404010301200710105383ee9054fa752fed00bae9.jpg http://posterous.com/users/5AvBYiAy0xXP Prem Radhakrishnan Prem Prem Radhakrishnan
Wed, 04 May 2011 13:06:00 -0700 How to secure your PDF files using ColdFusion http://www.premsweb.com/how-to-secure-your-pdf-files-using-coldfusion http://www.premsweb.com/how-to-secure-your-pdf-files-using-coldfusion
At 39 Degrees North we had a requirement to have PDF files on our website that was only for viewing and not for printing or anything else. I posted this question to the Indiana University web community and had two major suggestions , one was using Adobe Acrobat to secure the files (the cheaper solution costing about 750$ ) and the more expensive LiveCycle services from Adobe. The cheaper solution was good for our purpose. What I did not discover until later on was that ColdFusion can do exactly the same thing that Adobe Acrobat can do using the cfpdf tag and since we already had ColdFusion it was free which is better than  cheap. I wanted to share that code. Its nothing fancy just a page with a form where you can put the directory with the PDF files and the same page processes all the PDF files in that directory and secures it providing only view access.

Heres a sample PDF protected using this method http://egis.39dn.com/eGISClark/PlatsEncrypted/Pleasant_Run.pdf 

<cfsetting requesttimeout="7200"/>
<cfif structKeyExists(form, "directorylocation")>

<cfif directoryExists(form.directorylocation)>
<cfset counter = 0/>
<cfdirectory action="LIST" directory="#form.directorylocation#" name="dirlist" filter="*.pdf">

<cfloop query="dirlist">
<cfset counter = counter + 1/>
<cfoutput>
<cfoutput> #counter#</cfoutput>

</cfoutput>
<cfif isPDFFile(#dirlist.directory#&"\"&#dirlist.name#)>
<cfpdf action = "protect" 
  source = "#dirlist.directory#\#dirlist.name#" 
  newOwnerPassword = "PASSWORDHERE" 
  permissions = "None" 
  encrypt = "AES_128" 
  overwrite = "yes"
  destination= "#dirlist.directory#Encrypted\#dirlist.name#"
  >
</cfif>
</cfloop>
<cfelse>
<cfset error = "Invalid Directory " & form.directorylocation />
<cfabort showerror="#error#">
</cfif>

<cfelse>
<cfform name="InputLocation" action="" method="post">
<cflayout type="vbox" >
<cflayoutarea>
PDF Directory: <cfinput name="directorylocation" type="text" />
</cflayoutarea>
<cflayoutarea>
<cfinput name="submit" type="submit" />
</cflayoutarea>

</cflayout>

</cfform>
</cfif>

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/562006/010100010404010301200710105383ee9054fa752fed00bae9.jpg http://posterous.com/users/5AvBYiAy0xXP Prem Radhakrishnan Prem Prem Radhakrishnan
Fri, 15 Apr 2011 10:58:00 -0700 Spark Tree with a three state CheckBox http://www.premsweb.com/spark-tree-with-a-three-state-checkbox http://www.premsweb.com/spark-tree-with-a-three-state-checkbox

In my last blog post I talked about the Spark Tree from Maxim . When I was looking for a Spark Tree my final objective was to have a Spark Tree with a custom renderer that involved a three state checkbox. A checkbox that could show selected, unselected and "intermediate" states. After googling a bit I decided it was a good exercise to build on from scratch in Spark using Skins. It turned out to be much easier than I thought so I decided Ill share the full sample code here. 

This sample is a Spark Tree from Maxim http://kachurovskiy.com/2010/spark-tree/ that has a Custom Renderer with a 3 state checkbox that indicates when a child element is selected. I have also included a custom class for the Data which controls the child elements and parent elements states. This is just a sample so the code is a bit messy, since I did all the clean up in my main project after I established proof of concept. 

Here is the sample with view source enabled. Spark Tree with Checkbox renderer

Capture

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/562006/010100010404010301200710105383ee9054fa752fed00bae9.jpg http://posterous.com/users/5AvBYiAy0xXP Prem Radhakrishnan Prem Prem Radhakrishnan
Wed, 13 Apr 2011 14:35:00 -0700 Spark Tree Component http://www.premsweb.com/spark-tree-component http://www.premsweb.com/spark-tree-component

First off thank you to Maxim for posting a really great Spark component. It was when I was trying to wrestle with a custom renderer for an mx tree that I started looking to see if someone had developed a Spark Tree component. Not only did I find a great component but it was free to use. Maxim has created this Spark Tree component by extending the spark List component and made it really easy to integrate into your project. One of my struggles with mx tree was that when you created item renderers that had varying height, the scroll bar would keep jumping around depending on what nodes you had expanded and collapsed. The great thing about the Spark Tree component from Maxim is that it extends the list with and by setting useVirtualLayout to false you can render all the nodes at once eliminating the varying size scrollbar. It is also extremely easy to implement your own itemrenderer by using the DefaultItemRenderer as a template. 

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/562006/010100010404010301200710105383ee9054fa752fed00bae9.jpg http://posterous.com/users/5AvBYiAy0xXP Prem Radhakrishnan Prem Prem Radhakrishnan
Fri, 01 Apr 2011 11:28:56 -0700 ArcCatalog and opening XLSX files http://www.premsweb.com/arccatalog-and-opening-xlsx-files http://www.premsweb.com/arccatalog-and-opening-xlsx-files If you have an .xlsx file you want to use in ArcGIS but do not have Excel 2007 installed, you will need to install the 2007 Office System Driver. It can be downloaded from the Microsoft Download Center. If you do not have any version of Microsoft Excel installed, you must install that driver before you can use either .xls or .xlsx files. If you have Excel 2010 installed, you must still install the driver.

http://www.microsoft.com/downloads/details.aspx?FamilyID=7554F536-8C28-4598-9B72-EF94E038C891&displaylang=en

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/562006/010100010404010301200710105383ee9054fa752fed00bae9.jpg http://posterous.com/users/5AvBYiAy0xXP Prem Radhakrishnan Prem Prem Radhakrishnan
Wed, 21 Jul 2010 12:25:08 -0700 ArcGIS Sever , lsass.exe , secure map services and proxy service http://www.premsweb.com/arcgis-sever-lsassexe-secure-map-services-and http://www.premsweb.com/arcgis-sever-lsassexe-secure-map-services-and We run a production ArcGIS server environment with a large number of secure services and we noticed that the lsass.exe process was consuming large amounts of memory increasing in size as much as 4G+ and bringing the server to a stand still.  "lsass.exe" is the Local Security Authentication Server. It verifies the validity of user logons to your PC or server. Lsass generates the process responsible for authenticating users for the Winlogon service. The definition taken from http://www.neuber.com/taskmanager/process/lsass.exe.html . This is a known issue in ArcGIS Server and ESRI has a workaround for this in KB article 37566 http://resources.arcgis.com/content/kbase?fa=articleShow&d=37566 . If you are running a proxy service for your secure services however, the proxy service fails as soon as you implement this workaround. The problem is that you are turning off impersonation for your SOAP and REST services and by doing this , ArcGIS Server cannot access the role database (SQL Server aspnet) credentials anymore. The solution is very simple , you have to grant the ArcGIS Web Services account in step 1 of the workaround in the article , access to the aspnet db so that the particular account can access the role store. And wallah, your proxy service is good to go again.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/562006/010100010404010301200710105383ee9054fa752fed00bae9.jpg http://posterous.com/users/5AvBYiAy0xXP Prem Radhakrishnan Prem Prem Radhakrishnan
Wed, 30 Jun 2010 14:29:00 -0700 HTTPS Data access from HTTP content http://www.premsweb.com/https-data-access-from-http-content http://www.premsweb.com/https-data-access-from-http-content

In order to access HTTPS data (requests) from HTTP pages (or Flash movies i.e. swfs ) set the cross domain policy as such.

<cross-domain-policy>
<allow-access-from domain="*" secure="false"/>
</cross-domain-policy>

The domain in the example is specified as * but you can restrict the domain as needed.

 

Adobe artilce with a detailed cross domain file specification http://www.adobe.com/devnet/articles/crossdomain_policy_file_spec.html

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/562006/010100010404010301200710105383ee9054fa752fed00bae9.jpg http://posterous.com/users/5AvBYiAy0xXP Prem Radhakrishnan Prem Prem Radhakrishnan
Mon, 14 Jun 2010 13:11:29 -0700 Missing scales in the Navigation Slider in ArcGIS Flex http://www.premsweb.com/missing-scales-in-the-navigation-slider-in-ar http://www.premsweb.com/missing-scales-in-the-navigation-slider-in-ar One of the most frustrating things that we faced while adding multiple cached services to the Map component is that we found that sometimes we were not able to see the larger scales of map services even though we knew that they existed. And after much experimentation by one of my co-worker we discovered that the Navigation Slider picks up the scales from the first service that is added to the map. So if you add the service with the largest scales first you will be able to get the correct scales on the Navigation Slider . In fact its not just the navigation slider but the whole map refuses to go the larger scales with a service with a lowest lower scale is added first.
Hope this is helpful to someone else!

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/562006/010100010404010301200710105383ee9054fa752fed00bae9.jpg http://posterous.com/users/5AvBYiAy0xXP Prem Radhakrishnan Prem Prem Radhakrishnan
Thu, 10 Jun 2010 12:04:25 -0700 Flex Remoting with ColdFusion over SSL http://www.premsweb.com/flex-remoting-with-coldfusion-over-ssl http://www.premsweb.com/flex-remoting-with-coldfusion-over-ssl When I was implementing SSL for all my Flex web applications , the problem that I found was regardless of what I did from the Flex application, the remoting was always being accessed via http and not https as I meant it to be. Here is a good article describing the problem and the possible solutions from Joshua Curtiss http://blog.crankybit.com/flex-remoting-over-ssl/

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/562006/010100010404010301200710105383ee9054fa752fed00bae9.jpg http://posterous.com/users/5AvBYiAy0xXP Prem Radhakrishnan Prem Prem Radhakrishnan
Fri, 21 May 2010 07:10:53 -0700 Facebook Privacy Scanner http://www.premsweb.com/facebook-privacy-scanner-19 http://www.premsweb.com/facebook-privacy-scanner-19

This website provides an independent and open tool for scanning your Facebook privacy settings. The source code and its development will always remain open and transparent.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/562006/010100010404010301200710105383ee9054fa752fed00bae9.jpg http://posterous.com/users/5AvBYiAy0xXP Prem Radhakrishnan Prem Prem Radhakrishnan
Mon, 17 May 2010 10:15:00 -0700 HTTP Utility from Flex Pasta http://www.premsweb.com/http-utility-from-flex-pasta http://www.premsweb.com/http-utility-from-flex-pasta Useful utility class that uses External Interface to get HTTP parameters

http://www.flexpasta.com/index.php/2008/03/15/getting-url-parameters-host-name-port-in-flex-actionscript/

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/562006/010100010404010301200710105383ee9054fa752fed00bae9.jpg http://posterous.com/users/5AvBYiAy0xXP Prem Radhakrishnan Prem Prem Radhakrishnan
Sun, 16 May 2010 21:30:05 -0700 Few useful GMail resources - Tips , Tricks and Hacks http://www.premsweb.com/few-useful-gmail-resources-tips-tricks-and-ha http://www.premsweb.com/few-useful-gmail-resources-tips-tricks-and-ha http://lifehacker.com/161399/hack-attack-become-a-gmail-master

http://botw.org/articles/gmail-hacks.htm

http://webworkerdaily.com/2009/06/18/using-gmail-aliases-for-better-orginization/

http://www.makeuseof.com/tag/1-awesome-gmail-tip-you-dont-know-about-seriously/

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/562006/010100010404010301200710105383ee9054fa752fed00bae9.jpg http://posterous.com/users/5AvBYiAy0xXP Prem Radhakrishnan Prem Prem Radhakrishnan
Thu, 13 May 2010 07:02:22 -0700 ColdFusion ORM Tutorial http://www.premsweb.com/coldfusion-orm-tutorial http://www.premsweb.com/coldfusion-orm-tutorial This is a great article by Bob Silverburg and John Whish http://ria.dzone.com/articles/coldfusion-orm

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/562006/010100010404010301200710105383ee9054fa752fed00bae9.jpg http://posterous.com/users/5AvBYiAy0xXP Prem Radhakrishnan Prem Prem Radhakrishnan
Wed, 05 May 2010 08:04:04 -0700 File Recovery http://www.premsweb.com/file-recovery http://www.premsweb.com/file-recovery Every one of us has deleted some (or a lot )  files accidentally at least a few times and then went around searching for a cheap way to recover files. No more searching for cheap cause I found Pandora Recovery which is a free software to recover files that are not in your recycle bin anymore. I also have a bad habit of using "Shift+Delete" which basically bypasses the bin and just deletes your files , well last night I made one of those mistakes and after searching some options came across pandora and I have to say I was very impressed. Not only did it recover almost everything and I mean about 98% of the files but also it was very quick , as in less than 5 mins. I hope this is useful to others

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/562006/010100010404010301200710105383ee9054fa752fed00bae9.jpg http://posterous.com/users/5AvBYiAy0xXP Prem Radhakrishnan Prem Prem Radhakrishnan
Mon, 03 May 2010 12:19:45 -0700 Trying Posterous for the first time :) http://www.premsweb.com/trying-posterous-for-the-first-time-9 http://www.premsweb.com/trying-posterous-for-the-first-time-9 Well I found that one of my friends was using posterous. I stopped updating my blog a while back coz I just dont have enough time to do it anymore and maybe if this is as easy as it sounds I will start blogging again. So here goes nothing

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/562006/010100010404010301200710105383ee9054fa752fed00bae9.jpg http://posterous.com/users/5AvBYiAy0xXP Prem Radhakrishnan Prem Prem Radhakrishnan
Sat, 01 May 2010 21:36:00 -0700 Overcoming lock / renaming issues when rebuilding a featureclass http://www.premsweb.com/overcoming-lock-renaming-issues-when-rebuildi http://www.premsweb.com/overcoming-lock-renaming-issues-when-rebuildi

Yet another old post from my previous blog

When you want to rebuild a featureclass programmatically that is in use from lets say a SQL table you have two options. One is to create a new featureclass and rename it to the new one after the old one is renamed to a different name. This requires exclusive locks that may not be available and cause the program to crash. The other option is to delete all the features through IFeatureClass interface which can be really time consuming.

There is another alternative, using direct SQL to truncate the three tables that are associated with a featureclass. This does not require any exclusive locks and can be done while the featureclass is in use. Also it is cleaner and much faster.

Below is the code to truncate a featureclass in C#

  public void TruncateFeatureclass(IFeatureClass pFeatClass, IWorkspace pWorkspaceSDE)
        {
           
            IDataset pDataset;
            pDataset = (IDataset)pFeatClass;
            IWorkspace pWorkspaceData;
            pWorkspaceData = pDataset.Workspace;

            string strFCName;
            strFCName = pDataset.Name;
            int lngPosDot;
            lngPosDot = strFCName.IndexOf(".");  //InStr(strFCName, ".");
            string strOwner;
            string strName;
            string strdbName;
            string ownDotName;
            strdbName = strFCName.Substring(0, lngPosDot);//Left(strFCName, lngPosDot - 1);
            ownDotName = strFCName.Substring(lngPosDot + 1, strFCName.Length - lngPosDot - 1);
            int lngPosDot2;
            lngPosDot2 = ownDotName.IndexOf(".");
            strOwner = ownDotName.Substring(0, lngPosDot2);

            strName = ownDotName.Substring(lngPosDot2 + 1, ownDotName.Length - lngPosDot2 - 1); //Mid(strFCName, lngPosDot + 1);

            IFeatureWorkspace pFeatWorkspace;
            pFeatWorkspace = (IFeatureWorkspace)pWorkspaceSDE;

            IQueryDef pQueryDef;
            ICursor pCursor;
            IRow pRow;
            pQueryDef = pFeatWorkspace.CreateQueryDef();
            pQueryDef.Tables = "sde_layers";
            pQueryDef.SubFields = "sde_layers.layer_id";
            pQueryDef.WhereClause = "sde_layers.owner='" + strOwner.ToUpper() + "' and sde_layers.table_name = '" + strName.ToUpper() + "'";
            pCursor = pQueryDef.Evaluate();
            pRow = pCursor.NextRow();

            long lngLayerId;
            lngLayerId = Convert.ToInt64(pRow.get_Value(0));

            pWorkspaceData.ExecuteSQL("TRUNCATE TABLE " + strFCName);
            pWorkspaceData.ExecuteSQL("TRUNCATE TABLE F" + lngLayerId);
            pWorkspaceData.ExecuteSQL("TRUNCATE TABLE S" + lngLayerId);
        }

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/562006/010100010404010301200710105383ee9054fa752fed00bae9.jpg http://posterous.com/users/5AvBYiAy0xXP Prem Radhakrishnan Prem Prem Radhakrishnan
Sat, 01 May 2010 21:35:00 -0700 Creating Theissen Polygons in ArcMap http://www.premsweb.com/creating-theissen-polygons-in-arcmap http://www.premsweb.com/creating-theissen-polygons-in-arcmap

Import from my old blog

Public Function CreateThiessenFC(pFeatureClass As IFeatureClass, pPoly As IPolygon, pFDS As IFeatureDataset) As IFeatureClass 'If (Not dbUtil.ResolveOutputFeatureClassName(txtOutput, sOutCat, sOutWSName, sOutDSName, sOutFCName, True)) Then ' If (dbUtil.GetErrorCode = 1) Then ' MsgBox dbUtil.GetErrorMessage, vbCritical ' End If ' Exit Sub 'End If 'Me.MousePointer = vbHourglass  Dim pGDS As IGeoDataset Set pGDS = pFeatureClass Dim pSR As ISpatialReference Set pSR = pGDS.SpatialReference  Dim pFields As IFields2 Set pFields = pFeatureClass.Fields  Dim pOIDField As IField Dim lOIDInx As Long lOIDInx = pFields.FindField(pFeatureClass.OIDFieldName) Set pOIDField = pFields.Field(lOIDInx)  Dim pOutFC As IFeatureClass 'Check the parameter of this function Set pOutFC = createDatasetFeatureClass(pFDS, "thiessen", esriFTSimple, esriGeometryPolygon, Nothing, Nothing, Nothing) 'This is the old one 'Set pOutFC = createDatasetFeatureClass(sOutCat, sOutWSName, sOutDSName, sOutFCName, esriGeometryPolygon, False, False, pSR)  Dim pTinEdit As ITinEdit Set pTinEdit = New Tin pTinEdit.InitNew pGDS.Extent  Dim pTinAdv As ITinAdvanced2 Set pTinAdv = pTinEdit  pTinEdit.AddFromFeatureClass pFeatureClass, Nothing, pOIDField, pOIDField, esriTinMassPoint  pTinEdit.Refresh ' get proper extent so default voronoi clip poly is ok   'Before converting to the theissen check for the bounding polygon   Dim pNodeCol As ITinNodeCollection Set pNodeCol = pTinEdit pNodeCol.ConvertToVoronoiRegions pOutFC, Nothing, pPoly, "", ""  'pTinEdit.SaveAs (sOutWSName & "\" & dbUtil.GetUniqueFileName(sOutWSName)) 'pTinEdit.StopEditing False  'AddFeatureLayer m_pApp, pOutFC  Set CreateThiessenFC = pOutFC  'Release the variables  Set pGDS = Nothing Set pSR = Nothing Set pFields = Nothing Set pOIDField = Nothing 'Set lOIDInx = Nothing Set pOutFC = Nothing Set pNodeCol = Nothing Set pNodeCol = Nothing  End Function

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/562006/010100010404010301200710105383ee9054fa752fed00bae9.jpg http://posterous.com/users/5AvBYiAy0xXP Prem Radhakrishnan Prem Prem Radhakrishnan