tag:blogger.com,1999:blog-62217540800097046642024-03-21T10:33:54.892-07:00VRathore's Idea on Java and FlexAroma of flex with javavrathorehttp://www.blogger.com/profile/10898551813890109092noreply@blogger.comBlogger64125tag:blogger.com,1999:blog-6221754080009704664.post-7883366064855197062012-07-12T03:29:00.000-07:002012-07-12T03:30:57.574-07:00Interactive Charts in Andriod with Crosshairs and Data ToolTip<div dir="ltr" style="text-align: left;" trbidi="on">
Interactive Charts in Andriod with Crosshairs and Data ToolTip<br /><br />Making interactive chart on andriod is a tricky buisness , i had to face a lots of issues in one of my recent project to show interactive charts with crosshairs and data on crosshairs.<br />When i started with the project i used achartengine library which had lots of inbuilt charts , but it lacked crosshairs and user interactivity.<br />Then i started looking a afreechart, its a andriod version of jfreechart which had crosshairs in it, but it do not have developer guide as that is paid but it supported what i needed.<br /><br />Here are the screenshots of data interactive charts in my application.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrqOdzAaGZa_1xulcF2K6kuciLNabyZmS1-y4Tx-HrsR7_Dckohn5jnvxS2PYosQzg-lS9NMSyWH1bL9DFafzokUJsNKE3DTBPTZV9gSFTFljSSdiyPzvPVc8f9c5B3b2xxCkHCVi47wjj/s1600/SC20120330-113002.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="192" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrqOdzAaGZa_1xulcF2K6kuciLNabyZmS1-y4Tx-HrsR7_Dckohn5jnvxS2PYosQzg-lS9NMSyWH1bL9DFafzokUJsNKE3DTBPTZV9gSFTFljSSdiyPzvPVc8f9c5B3b2xxCkHCVi47wjj/s320/SC20120330-113002.png" width="320" /></a></div>
<br />I would love to help if some body get struck on the same like i did as its very annoying.<br />Cheers<br /><br />Varun Rathore</div>vrathorehttp://www.blogger.com/profile/10898551813890109092noreply@blogger.com6tag:blogger.com,1999:blog-6221754080009704664.post-91824352240828850202012-07-06T04:35:00.000-07:002012-07-06T04:35:10.662-07:00Ksoap2 Getting Values of Property or Attribute in Andriod<div dir="ltr" style="text-align: left;" trbidi="on">
Hi All,<br />
<br />
You can get the values and names of Attibutes and Properties in Ksoap2 SoapObject<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSSyo_EHSQyFvqBwCyCSxHruOphp4r2P5Ys5Pj4y0gPgDvmcIuHRf7lBimE_8SynvWPsb4RyRcNyFWBR1APKG6DRXN4PQnu4PjpOc3vD3EWrTFAck4X9H0cMeQAkeqdpleq95Z-oota_5W/s1600/soap.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSSyo_EHSQyFvqBwCyCSxHruOphp4r2P5Ys5Pj4y0gPgDvmcIuHRf7lBimE_8SynvWPsb4RyRcNyFWBR1APKG6DRXN4PQnu4PjpOc3vD3EWrTFAck4X9H0cMeQAkeqdpleq95Z-oota_5W/s320/soap.jpg" width="316" /></a></div>
<br />
// GETTING ATTIRIBUTE NAME AND VALUES IN KSOAP2 <br />
for (int i = 0; i < yourSoapObject.getAttributeCount(); i++) <br /> {<br /> AttributeInfo attInfo = new AttributeInfo();<br /> yourSoapObject.getAttributeInfo(i, attInfo);<br /> String attributeName = attInfo.name;<br /> String attributeValue = yourSoapObject.getAttribute(i).toString();<br /> }<br />
<br />
// GETTING PROPERTY NAME AND VALUES IN KSOAP2 <br />
for (int i = 0; i < yourSoapObject.getPropertyCount(); i++) <br /> {<br /><br /> PropertyInfo attInfo = new PropertyInfo();<br /> yourSoapObject.getPropertyInfo(i, attInfo);<br /> String propertyName = attInfo.name;<br /> String propertyValue = yourSoapObject.getProperty(i).toString();<br /> }<br />
<br />
Cheers<br />
Varun Rathore <br /><br /><br /> <br />
<br />
<br /></div>vrathorehttp://www.blogger.com/profile/10898551813890109092noreply@blogger.com0tag:blogger.com,1999:blog-6221754080009704664.post-61744943071271671272012-05-08T01:02:00.000-07:002012-05-08T01:02:00.239-07:00MySql Inserting Distinct Values in Table<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_uoZ6otbZLuMJQWJABM_VR2U_D5tUqtzUX1tEDGFwDr0yeNpINUg7woS2lMoz3kf-IcaYLUYeUM3guSwyhvY4KAkD4CXFrxsbAwkddyvZaZ2wsISM2yKOPjJ8G5zudlan9VO-lKXyE1A4/s1600/distinct-webpage-index.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="256" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_uoZ6otbZLuMJQWJABM_VR2U_D5tUqtzUX1tEDGFwDr0yeNpINUg7woS2lMoz3kf-IcaYLUYeUM3guSwyhvY4KAkD4CXFrxsbAwkddyvZaZ2wsISM2yKOPjJ8G5zudlan9VO-lKXyE1A4/s320/distinct-webpage-index.gif" width="320" /></a></div><div dir="ltr" style="text-align: left;" trbidi="on">
Way 1 - using <b>REPLACE </b><br /><br />REPLACE INTO `candidates`<br /> SET `candidate_id` = '000000146',<br /> `candidate_name` = 12345,<br /> `candidate_rollnumber` = 12678;<br />
If the record exists, it will be overwritten; if it does not yet exist, it will be created.<br />
<br />
Way 2 - using <b>INSERT IGNORE</b><br />
<b><br /> </b> INSERT IGNORE INTO `candidates`<br /> SET `candidate_id` = '000000146',<br /> `candidate_name` = 12345,<br /> `candidate_rollnumber` = 12678;<b> </b><br />
<b><br /></b><br />
Here, if the 'candidate_id' is already present in the database, it will be silently skipped (ignored).<br />
<br />
- Varun Rathore <br />
<br />
</div>vrathorehttp://www.blogger.com/profile/10898551813890109092noreply@blogger.com0tag:blogger.com,1999:blog-6221754080009704664.post-90676560785398465522012-04-29T22:38:00.000-07:002012-04-29T22:38:21.560-07:00Day of Month Suffix - st nd rd th<div dir="ltr" style="text-align: left;" trbidi="on">
Here is a simple way to put suffix for day<br />
<br />
String getDayOfMonthSuffix(final int n)<br />
{<br />
checkArgument(n >= 1 && n <= 31), "illegal day of month: " + n);<br />
if (n >= 11 && n <= 13)<br />
{<br />
return "th";<br />
}<br />
switch (n % 10)<br />
{<br />
case 1: return "st";<br />
case 2: return "nd";<br />
case 3: return "rd";<br />
default: return "th";<br />
}<br />
}
</div>vrathorehttp://www.blogger.com/profile/10898551813890109092noreply@blogger.com0tag:blogger.com,1999:blog-6221754080009704664.post-27624082827984520632011-09-29T08:07:00.000-07:002011-09-29T08:11:33.198-07:00Escaping Special Characters And White Space in SOLR in javaEscape Special characters in SOLR before Query <br />here is the function to escape the culprits<br /><br /> public static String escapeQueryCulprits(String s)<br /> {<br /> StringBuilder sb = new StringBuilder();<br /> for (int i = 0; i < s.length(); i++)<br /> {<br /> char c = s.charAt(i);<br /> // These characters are part of the query syntax and must be escaped<br /> if (c == '\\' || c == '+' || c == '-' || c == '!' || c == '(' || c == ')' || c == ':'<br /> || c == '^' || c == '[' || c == ']' || c == '\"' || c == '{' || c == '}' || c == '~'<br /> || c == '*' || c == '?' || c == '|' || c == '&' || c == ';'<br /> )<br /> {<br /> sb.append('\\');<br /> }<br /> if(Character.isWhitespace(c))<br /> {<br /> sb.append(" \\ ");<br /> }<br /> sb.append(c);<br /> }<br /> return sb.toString();<br /> }vrathorehttp://www.blogger.com/profile/10898551813890109092noreply@blogger.com0tag:blogger.com,1999:blog-6221754080009704664.post-34857422834313546222011-09-21T00:24:00.000-07:002011-09-21T00:31:20.549-07:00A partial block (3 of 4 bytes) was dropped in Base64 String<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWK2atUVFNynOIPyewu2UOcsZ-9xjBVpZWdCtPgTd4iMFoyHeaw6KSyXdhd0rowJ4UVkYS7hNo4fOv0QAc3tOdBlFiwtCVkkEuBss0CPZzlSEyth3yi8WUUu2XcyRoecM_x_sPj2k_unDM/s1600/encode.jpg"><img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 250px; height: 257px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWK2atUVFNynOIPyewu2UOcsZ-9xjBVpZWdCtPgTd4iMFoyHeaw6KSyXdhd0rowJ4UVkYS7hNo4fOv0QAc3tOdBlFiwtCVkkEuBss0CPZzlSEyth3yi8WUUu2XcyRoecM_x_sPj2k_unDM/s400/encode.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5654712153692692706" /></a><br />When you face such a issue just use<br /><br />Flex :<br />encodeURIComponent(String) in flex <br /><br />Java : <br />URIUtil.encodeQuery(String)<br /><br />Before posting the string in Browser as "=" and "&" in the String create issue while decoding String.vrathorehttp://www.blogger.com/profile/10898551813890109092noreply@blogger.com0tag:blogger.com,1999:blog-6221754080009704664.post-71060158934582500562011-06-30T21:37:00.000-07:002011-06-30T22:29:10.563-07:00Response Header with MVC interceptors in SpringResponse Header's in Spring can be easily set using org.springframework.web.servlet.support.WebContentGenerator as this is a abstract class so we use a direct known sub class for the same which is org.springframework.web.servlet.mvc.WebContentInterceptor , this Interceptor checks and prepares request and response. Checks for supported methods and a required session, and applies the specified number of cache seconds. <br /><br />Here is the Example, this should be under beans tag in your server-config.xml file<br /><br /><mvc:annotation-driven /> <br /> <mvc:interceptors> <br /> <bean id="webContentInterceptor" class="org.springframework.web.servlet.mvc.WebContentInterceptor"><br /> <property name="cacheSeconds" value="120"/><br /> <property name="useExpiresHeader" value="true"/><br /> <property name="useCacheControlHeader" value="true"/><br /> <property name="requireSession" value="false"/><br /> <property name="useCacheControlNoStore" value="true" /><br /> <property name="cacheMappings"><br /> <props><br /> <prop key="/**/*.html">2000</prop><br /> <prop key="/**/*.css">500000</prop><br /> <prop key="/**/*.js">2592000</prop><br /> </props><br /> </property><br /> </bean> <br /> </mvc:interceptors><br /><br />In CacheMapping attribute we can specify the cache time for different file types, as this increases the preformance of application.vrathorehttp://www.blogger.com/profile/10898551813890109092noreply@blogger.com0tag:blogger.com,1999:blog-6221754080009704664.post-10074409144127343372011-06-30T02:24:00.000-07:002011-06-30T02:40:30.995-07:00Gzip in Apache Tomcat - Faster Responses with Compression<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGxlIlrt7a-YMxc8PRxPZQepKfyGmHWN_gA1cq5WczhsC59vGvkdmz7BFYGQ7WHlROQsquwlMeS6paE7hBc74txihPqsF1A4bFGHyGOT9z4wSJ73aPi1TprkZ_SQib3Chcxyu_9nU6Tm9b/s1600/compression.jpg"><img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 400px; height: 300px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGxlIlrt7a-YMxc8PRxPZQepKfyGmHWN_gA1cq5WczhsC59vGvkdmz7BFYGQ7WHlROQsquwlMeS6paE7hBc74txihPqsF1A4bFGHyGOT9z4wSJ73aPi1TprkZ_SQib3Chcxyu_9nU6Tm9b/s400/compression.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5623945338932336162" /></a><br />Today's Browser have capability to support gzip content and uncompressed the content to plain text. The data comes from server to client in a compressed form with increases the performance many times as less data get transfered on network.<br /><br />Just go to Tomcat/conf/Server.xml file and replace the default node <br /><br /> <Connector port="8080" protocol="HTTP/1.1" <br /> connectionTimeout="20000" <br /> redirectPort="8443" ><br /><br />with follwing<br /><br /><Connector port="8080" maxHttpHeaderSize="8192"<br /> maxThreads="150" minSpareThreads="25" maxSpareThreads="75"<br /> enableLookups="false" redirectPort="8443" acceptCount="100"<br /> connectionTimeout="20000" disableUploadTimeout="true"<br /> compression="on"<br /> compressionMinSize="2048"<br /> noCompressionUserAgents="gozilla, traviata"<br /> compressableMimeType="text/html,text/xml,application/json"><br /><br /><br />Make sure you add the MIME Type which you want to add compression as follows <br />compressableMimeType="text/html,text/xml,application/json"<br /><br /># Tomcat handles the compression for the supporting brorwers and do not compress response in case the browser is from monolithic age :)<br /><br />- Varun Rathorevrathorehttp://www.blogger.com/profile/10898551813890109092noreply@blogger.com1tag:blogger.com,1999:blog-6221754080009704664.post-68986740716763182912011-06-21T02:05:00.001-07:002011-06-21T02:23:29.316-07:00PJson in Spring using JacksonJson (Cross Domain Issues)We can create pjson (json with padding) to achieve cross domain java-script call which is very important if data is coming from other domain.<br /><br />Here is what i did to get pjson from object.<br />I created a class MappingJacksonJsonpView extended it by AbstractView, now here is the trick<br />I overrided a method renderMergedOutputModel as follows:<br /><br /> @Override<br /> protected void renderMergedOutputModel(Map<String, Object> model, HttpServletRequest request, HttpServletResponse response) throws Exception<br /> {<br /> Object value = filterModel(model);<br /> JsonGenerator generator = objectMapper.getJsonFactory().createJsonGenerator(response.getOutputStream(), encoding);<br /> String callback = request.getParameter("jsoncallback");<br /> prefixJson = false;<br /> if (callback!=null)<br /> {<br /> prefixJson = true;<br /> }<br /> if (prefixJson)<br /> {<br /> generator.writeRaw(callback + "(");<br /> }<br /> objectMapper.writeValue(generator, value);<br /> generator.flush();<br /><br /> if (prefixJson)<br /> {<br /> generator.writeRaw(");");<br /> generator.flush();<br /> }<br /> }<br /><br />and make sure you put entry in your servlet.xml file<br /><property name="defaultViews"><br /><list><br /><bean class="com.views.utility.MappingJacksonJsonpView" />vrathorehttp://www.blogger.com/profile/10898551813890109092noreply@blogger.com1tag:blogger.com,1999:blog-6221754080009704664.post-59105703756418323032011-05-26T01:38:00.000-07:002011-05-26T01:41:33.021-07:00AS3 Signals - Faster Messages in AS3AS3 signals are free , very fast and relaible messaging tool, i have been using them from last 6 months , below are some features of Signals which are more superior than Events<br /><br />Dowload it from <a href="https://github.com/robertpenner/as3-signals/wiki">https://github.com/robertpenner/as3-signals/wiki</a>/<br /><br />Signal's Salient Features<br /><br /> Remove all event listeners : signal.removeAll();<br /><br /> Retrieve the number of listeners : signal.numListeners<br /><br /> Listeners can be added for a one-time call and removed automatically on dispatch:<br /><br /> signal.addOnce(theListener); // result: signal has one listener<br /> signal.dispatch(theEvent); // result: theListener is called, signal now has no listeners<br /><br /> A Signal can be initialized with value classes that will validate value objects on dispatch (optional):<br /><br /> // A Signal that will dispatch a String and an integer:<br /> progress = new Signal(String, int);<br /> //later:<br /> progress.dispatch(); // will throw ArgumentError <br /> progress.dispatch('The Answer'); // will throw ArgumentError <br /> progress.dispatch('The Answer', 42.5); // will throw ArgumentError <br /> progress.dispatch('The Answer', 42); // will succeed<br /><br /> <br />Varun Rathorevrathorehttp://www.blogger.com/profile/10898551813890109092noreply@blogger.com0tag:blogger.com,1999:blog-6221754080009704664.post-59707119002922501962011-05-25T23:58:00.000-07:002011-05-26T00:03:33.886-07:00Adobe AIR - Opening Main Appllication from Child WindowHi, I was trying to make the Main Application open and dock from a child window, here is the simple code to do this, it check if the Main application is not docked, if not if put that to front.<br /><br /> if(FlexGlobals.topLevelApplication.stage.nativeWindow.visible == false)<br />{<br /> FlexGlobals.topLevelApplication.stage.nativeWindow.visible = true;<br /> FlexGlobals.topLevelApplication.stage.nativeWindow.orderToFront();<br /> <br />}<br /> FlexGlobals.topLevelApplication.stage.nativeWindow.orderToFront();<br /><br /><br />-Varun Rathorevrathorehttp://www.blogger.com/profile/10898551813890109092noreply@blogger.com0tag:blogger.com,1999:blog-6221754080009704664.post-45689170318152242482011-05-17T23:07:00.000-07:002011-05-17T23:23:16.599-07:00Increasing Java Heap Size - Posting Bigger Files in Apache SOLRIn some cases we need to post bigger xml file in SOLR server for indexing, if you post the file directly you get OutOfMemoryExceptions to avoid such failure, we need to change the max memory size that the heap can reach for the JVM<br /><br />Here is the Command by which we can increase the heap size<br />java -Xms128m -Xmx8192m - jar <br /><br />So in order to post bigger files now we use <br />java -Xms128m -Xmx8192m - jar post.jar <*.xml><br /><br />The -Xmx argument defines the max memory size that the heap can reach for JVM.<br />The -Xms argument sets the initial heap memory size for the JVM.<br /><br />-Varun Rathorevrathorehttp://www.blogger.com/profile/10898551813890109092noreply@blogger.com0tag:blogger.com,1999:blog-6221754080009704664.post-14052064490733698582011-05-17T22:33:00.000-07:002011-05-17T22:40:19.842-07:00Apache SOLR , Deleting-Removing all data at one GoIf we need to remove/delete the indexed data from SOLR server here is a simple one line command which does the magic for you.<br /><br />java -Ddata=args -jar post.jar "<delete><query>*:*</query></delete>" <br /><br />-Varun Rathorevrathorehttp://www.blogger.com/profile/10898551813890109092noreply@blogger.com0tag:blogger.com,1999:blog-6221754080009704664.post-68588847408186018272009-11-30T22:32:00.000-08:002009-11-30T22:38:18.989-08:00Free Education To Freshers and Project Training<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjF0-nSekC7quqy1-qCZxxIAnY8Bb77pSL36knlVFA9t0mBC4b1KO2M7aPukKnEUJerX0ls-Ndclxs0aET2JGniTi18X8_8FIBcqgDowqvAJfAo3BdVqE3u1oXpa9gjZ_A1V0VOXDBrX-YY/s1600/pistol.jpg"><img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 250px; height: 200px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjF0-nSekC7quqy1-qCZxxIAnY8Bb77pSL36knlVFA9t0mBC4b1KO2M7aPukKnEUJerX0ls-Ndclxs0aET2JGniTi18X8_8FIBcqgDowqvAJfAo3BdVqE3u1oXpa9gjZ_A1V0VOXDBrX-YY/s400/pistol.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5410153230681548610" /></a><br />As the RIA worker i am starting on providing free education to college students and freshers on Flex/AIR and java development to prepare them for Interview and to open there mind on a rich development practices .. This will be a experimental step to educate newbies , I will be covering the basic application development methodologies and will help them create applications for their projects.<br />Please feel free to contact me at <br /><br />Varun Rathore<br />+919988178054<br />vrathore84@gmail.comvrathorehttp://www.blogger.com/profile/10898551813890109092noreply@blogger.com0tag:blogger.com,1999:blog-6221754080009704664.post-57025357193740733682009-11-29T21:15:00.000-08:002009-11-29T21:21:13.474-08:00Some Useful Flex AIR Skinning Resources<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYKy0MTQKarYjvWOqynbg8XbbxLAnQfIZWVUJHhN64l-ucZSD-GeCIbUeUVDwQSWYLhG9jD0e4tXqoN4cVs2pazDyhgJcWwxbh0jo0YAFw0yb6DexeNZI2_qEcx1GhjOyVCCcf9ZkpwXH5/s1600/30039.jpg"><img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 350px; height: 350px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYKy0MTQKarYjvWOqynbg8XbbxLAnQfIZWVUJHhN64l-ucZSD-GeCIbUeUVDwQSWYLhG9jD0e4tXqoN4cVs2pazDyhgJcWwxbh0jo0YAFw0yb6DexeNZI2_qEcx1GhjOyVCCcf9ZkpwXH5/s400/30039.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5409762178131054514" /></a><br />Check out some wonderful flex skinning resources at <br /><br /><a href="http://sites.google.com/a/flexets.com/usefull-infor/resources/flex-skinning">Cool Links to make cool looking Apps</a>vrathorehttp://www.blogger.com/profile/10898551813890109092noreply@blogger.com0tag:blogger.com,1999:blog-6221754080009704664.post-63250225771162035892009-11-29T20:38:00.000-08:002009-11-29T21:04:21.646-08:00A Great Window Utility - Windows 7 TuneUp<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjohh39bambg7o558KNXrXecvnxAqYCcNTh4NJyPsGy2O1gQAEMvbHC2qTGTirunVabXxKCETzLOE7OhH2LCQP852jWSqnFmtcWK4jsi23JHl9fIEJr3gSkdGMIyuX8mZAaaG2xB78Huv-e/s1600/small_screen.png"><img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 228px; height: 162px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjohh39bambg7o558KNXrXecvnxAqYCcNTh4NJyPsGy2O1gQAEMvbHC2qTGTirunVabXxKCETzLOE7OhH2LCQP852jWSqnFmtcWK4jsi23JHl9fIEJr3gSkdGMIyuX8mZAaaG2xB78Huv-e/s400/small_screen.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5409756928765185138" /></a><br />Windows 7 TuneUp is a great Window utility which makes you forget about PC maintenance and security, Loaded with many tools such as Registry Cleaner,Registry Defragmenter,Junk Files Cleaner, Duplicate Files Finder,Smart Uninstaller,Service Manager,Startup Manager and many more which help you get rid of all the maintenance problems for the system. I recomend this personally as it saved my sysytem from getting crashed and help me save my formatting time. <br />One of the coolest thing is its very easy installation and free support and service.<br />Check out this amazing software at <a href="http://www.windsty.com/products/windows_7_tuneupsuite/windows-7-tuneup.html">WINDOW 7 TuneUp</a>vrathorehttp://www.blogger.com/profile/10898551813890109092noreply@blogger.com0tag:blogger.com,1999:blog-6221754080009704664.post-73986825986382618462009-10-27T02:23:00.000-07:002009-10-27T02:49:57.659-07:00Invoking AIR Application using Batch File<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5vpQ6BS07dXL2kWcQiqrIoyvyckSZwzQMayezH4Es9OLa8q7GlitApHYzyVvbIBHkVePjRmLUPSBJ5EwApPzRtnnHiDq-3VjaEOLUFo422XqqgEh9kM8SobREPJgnMfoKB8xvo7CPyJO8/s1600-h/cardboard-box-open-lg.jpg"><img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 400px; height: 313px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5vpQ6BS07dXL2kWcQiqrIoyvyckSZwzQMayezH4Es9OLa8q7GlitApHYzyVvbIBHkVePjRmLUPSBJ5EwApPzRtnnHiDq-3VjaEOLUFo422XqqgEh9kM8SobREPJgnMfoKB8xvo7CPyJO8/s400/cardboard-box-open-lg.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5397214273000785218" /></a><br /><br />I am pretty sure if we are using a application which interacts with other application we need to invoke it using command propmt . Here is a simple way to invoke the application ..Also while invoking sometime we need to pass variables to the application as we do in flash vars.. <br /><br />First of all we need to set the environment variable for accessing the flex sdk in the system.. Add the following path to the sysytem path variable in your environment variable<br />C:\Program Files\Adobe\Flex Builder 3\sdks\3.0.0\bin<br /><br />Note : It should point to the sdk's bin location in mycase it resided in C:/ Drive .<br /><br />To Run the application we will use ADL(AIR Debug Launcher) using the following syntax:-<br />adl [-runtime runtime-directory] [-pubid publisher-id] [-nodebug] application.xml [root-directory] [-- arguments]<br /> <br />In my case i used the following line on my command prompt<br />F:\PROJECTS\Printing\bin>adl Printing-app.xml -- 321 0 active<br /><br />First i reach to the point where my application bin folder reside(having compiled swf and application descriptor file) then using adl to invoke my application-app.xml <br /><br />Note:-<br />After the application-app.xml i added -- and then i gave three arguments separated my space.<br /><br />In the application i can get the aruments as follows :-<br /> We listen the following function in the application invoke="onInvoke(event)"<br /><br />private function onInvoke(e:InvokeEvent):void <br />{<br /> var arguments : ArrayCollection = new ArrayCollection( e.arguments );<br />} <br /><br /><br />Here i get all the arguments in a arraycollection.vrathorehttp://www.blogger.com/profile/10898551813890109092noreply@blogger.com0tag:blogger.com,1999:blog-6221754080009704664.post-65968096123575589222009-10-11T22:20:00.000-07:002009-10-11T22:23:32.530-07:00Reading and Writing Browser Cookie in Flex<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbbpeZJJi4RgtDIVqHy29FRKbB2p0XeRI1yGPFcWd62oBR9wMtvbN80vA3E02ep3ShF1gJ1AaJ0IBzxnUug11_SRwtUVXVvKuDRCabCaPiLOSIeEfUtGGsO_cssNdb52xvTr-04eP0PVKf/s1600-h/cookie-bite-web.jpg"><img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 300px; height: 364px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbbpeZJJi4RgtDIVqHy29FRKbB2p0XeRI1yGPFcWd62oBR9wMtvbN80vA3E02ep3ShF1gJ1AaJ0IBzxnUug11_SRwtUVXVvKuDRCabCaPiLOSIeEfUtGGsO_cssNdb52xvTr-04eP0PVKf/s400/cookie-bite-web.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5391579812336931458" /></a><br />A browser cookie is a small piece of information sent by a web server to a web browser to be stored for future use. The data in the browser cookie will be sent back to the web server whenever the browser reconnects to the web site.<br /><br />Cookies are commonly used to store user preference information, such as web site options. Cookies are also used to store shopping cart contents. The most security-relevant use of browser cookies is when they are used to store authentication data, such as user names and passwords. <br /><br />To Read and write Cookie from a flex application we will use Javascript <br /><br /><br /> //Following function will set the cookie in the user browser<br />function setCookie(c_name,value,expiredays)<br /> {<br /><br /> value = document.getElementById('user').value;<br /> var exdate=new Date();<br /> exdate.setDate(exdate.getDate()+expiredays);<br /> document.cookie=c_name+ "=" +escape(value)+((expiredays==null) ? "" : "; expires="+exdate.toGMTString());<br /> }<br /> <br /> <br /><br /><br /> //Following function will return Cookie<br /> function getCookie(c_name){<br /> <br /> if (document.cookie.length>0)<br /> {<br /> c_start=document.cookie.indexOf(c_name + "=");<br /> if (c_start!=-1)<br /> { <br /> c_start=c_start + c_name.length+1 ;<br /> c_end=document.cookie.indexOf(";",c_start);<br /> if (c_end==-1) c_end=document.cookie.length <br /> return unescape(document.cookie.substring(c_start,c_end));<br /> } <br /> }<br /> <br /> return "";<br /> }<br /><br />For reading a cookie Visitor we will use the following line in Flex code:-<br />var visitorId : String = ExternalInterface.call("getCookie","Visitor");<br /><br /><br />Cheers<br />Varunvrathorehttp://www.blogger.com/profile/10898551813890109092noreply@blogger.com0tag:blogger.com,1999:blog-6221754080009704664.post-35374575341439518472009-08-26T22:00:00.000-07:002009-08-26T22:11:37.551-07:00Flex Challenge to know your acquisitions<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsiD9x2xdRNDfSV7iYrJ6afozbTEjTWJKNU1Jn4oxDel23LifIRqf5b8GlQx4zmWffSTMKCQVNhE6gqi51YYO9UcEWBgQhjAOWtUeaD1lQOD60v0TnK1UmXxfqJ65iJ9lbcA5QwkgijSwF/s1600-h/AppIcon.png"><img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 191px; height: 59px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsiD9x2xdRNDfSV7iYrJ6afozbTEjTWJKNU1Jn4oxDel23LifIRqf5b8GlQx4zmWffSTMKCQVNhE6gqi51YYO9UcEWBgQhjAOWtUeaD1lQOD60v0TnK1UmXxfqJ65iJ9lbcA5QwkgijSwF/s400/AppIcon.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5374504558969472786" /></a><br />Here is a good go-ahead step by Adobe india for flex developer to know their skills<br /><br />Check out the great application with a great challenge at<br /><br /><a href="http://flashahead.adobe.com/challenges/">http://flashahead.adobe.com/challenges/</a><br /><br />I finised the challange in less than 20 minutes. :)<br /><br />Cheers<br /><br />Varun Rathore<br /><br />http://www.vrathore.blogspot.comvrathorehttp://www.blogger.com/profile/10898551813890109092noreply@blogger.com0tag:blogger.com,1999:blog-6221754080009704664.post-37435158256976896462009-08-26T02:04:00.000-07:002009-08-26T02:16:09.457-07:00Using ShareThis in Flex-Flash<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigSARD3VvCtraD4AYokVjv1oqTe2mcbW7lE1s-Opty5jLGQbXmSMWKfRj0b3DONWLF8DyXWfqaYd2YgJxjPvi7u8YOEXK3TlHD-PMkTADPOJ9GLQKCg2rEKoJVgZZWXoTcrWjTweLzDw76/s1600-h/sharethis_logo_new.gif"><img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 151px; height: 38px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigSARD3VvCtraD4AYokVjv1oqTe2mcbW7lE1s-Opty5jLGQbXmSMWKfRj0b3DONWLF8DyXWfqaYd2YgJxjPvi7u8YOEXK3TlHD-PMkTADPOJ9GLQKCg2rEKoJVgZZWXoTcrWjTweLzDw76/s400/sharethis_logo_new.gif" border="0" alt=""id="BLOGGER_PHOTO_ID_5374198623799150850" /></a><br />Wondering when ShareThis would actually provide a .swf file to be loaded in the fash file in stead of calling a JavaScript function to open the ShareThispop in the new window.<br />First of all we need to go to sharethis.com publisher section and customize your widget, you will get a javascript code by registering your email address. Here is javascript code what i got :-<br /><br />script type="text/javascript" src="http://w.sharethis.com/button/sharethis.js#publisher=9f363e20-dc32-444d-a8c9-afd21615fd57&type=website&popup=true&embeds=true"><br /><br /><br /><br /><br /><br /><br />// ACTIONSCRIPT CODE<br /> private function shareThis():void<br /> {<br /> var url:String = "http://www.vrathore.blogspot.com";<br /> var title:String = "VARUN-RATHORE";<br /> ExternalInterface.call("ShareThis", url, title);<br /> }<br /><br /><br />Using a javascript code in the html file for opening the pop window<br />// JAVASCRIPT CODE<br /> function ShareThis(url, title)<br /> {<br /> url = window.location;<br /> var s = SHARETHIS.addEntry({<br /> url: url,<br /> title: title<br /> }, {button:false,popup:true});<br /> s.popup()<br /> return false;<br /> }<br /><br /><br />Cheers<br /><br />Varun Rathorevrathorehttp://www.blogger.com/profile/10898551813890109092noreply@blogger.com1tag:blogger.com,1999:blog-6221754080009704664.post-83522247045956748242009-07-13T23:53:00.000-07:002009-07-14T00:00:08.523-07:00Spring ActionScript Configuration in Flash/Flex/AIR application<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuEKC1Z8OXVBW6s1GqYXUoN1CGKEfLFUVFz_abL529lyR8zBh_hGjM1xVTVKVYDh7_Xf4M8eTWNit8C19hlOdGr516qFrRuvhDW-1cnEvUAlgd8ERpQBCaMYy9ybg8OEfrriKDlw0OS67x/s1600-h/Configuration.png"><img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 400px; height: 394px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuEKC1Z8OXVBW6s1GqYXUoN1CGKEfLFUVFz_abL529lyR8zBh_hGjM1xVTVKVYDh7_Xf4M8eTWNit8C19hlOdGr516qFrRuvhDW-1cnEvUAlgd8ERpQBCaMYy9ybg8OEfrriKDlw0OS67x/s400/Configuration.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5358207041057110050" /></a><br />Just as we use the applicationContext.xml in java application where we map the classes to the objecys in the context file and mapping the variables in the class files to the properties in the configuration file, we can use a simialr methodolgy in our flex application and get the changes to the variable by just changing in the configuration file , without building or refreshing the application.<br /><br />Here is the code sniplet which is used to achive the following :-<br /> // spring actionscript config<br /> var applicationContext : FlexXMLApplicationContext =new FlexXMLApplicationContext("config.xml");<br /> applicationContext .addEventListener(Event.COMPLETE, onApplicationContextComplete);<br /> applicationContext.load(); <br /><br /> protected function onApplicationContextComplete(event:Event):void<br /> {<br /> var appConfig : AppConfig = applicationContext.getObject("appConfig"); <br /> model.appConfig = appConfig;<br /> resourceManager.localeChain = [appConfig.locale]; <br /> <br /> }<br /><br /> // HERE model.appConfig is the actionscript class which i have mapped to the object in my configuration file.<br />AppConfig.as file is as follows :-<br />package com.infoswell.model.global<br />{<br /> [Bindable]<br /> public class AppConfig<br /> {<br /> // src path used as root to locate images, etc.<br /> public var srcPath:String = "";<br /> <br /><br /> // locale for menu config path <br /> // note: curently resource bundle properties locale from project compile options<br /> public var locale:String = "en_US"; <br /><br /> public function AppConfig()<br /> {<br /> }<br /><br /> }<br />}<br /><br /><br />The config.xml is as follows:-<br /><?xml version="1.0"?><br /><objects xmlns="http://www.pranaframework.org/objects" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"<br /> xsi:schemaLocation="http://www.pranaframework.org/objects<br /> http://www.pranaframework.org/schema/objects/prana-objects-0.6.xsd"><br /> <object id="appConfig" class="com.model.global.AppConfig"><br /> <!-- default locale --> <br /> <property name="locale" value="en_US"/> <br /> <property name="srcPath" value="testing" /><br /> </object><br /></objects><br /> <br />The swc file which is used in the application can be created as follows :-<br />First download the source using a subversion client from the following url:<br /><br />https://src.springframework.org/svn/se-springactionscript-as/<br /><br />Step into the ant folder and execute “ant” to see the options. You can create a debug enabled version, a release, documentation. I created the debug enabled version with the following command. Of course you do have to have ant on your path. Do not forget to change the build.properties. You need to change the FLEX_HOME parameter as described in the readme file that comes with the sources.<br /><br />ant compile-main-debug<br /><br />The swc file is created in the antbuild/compile/main/swc folder.<br /><br />Use the swc created in the project libs folder and use this extra ordinary feture to load configuration from outside.<br /><br />Cheers<br />Varunvrathorehttp://www.blogger.com/profile/10898551813890109092noreply@blogger.com0tag:blogger.com,1999:blog-6221754080009704664.post-23240598096198399002009-07-13T10:24:00.000-07:002009-07-13T10:43:51.700-07:00Ammaps in Flex<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwi4_WeP-YyObiIcDf0Jk3jvDqBm5SpPz8EuO0mqXPtnlZ8DZxTtcqqpE___0Eu9ZTQZIQV4t2nuuFXoUB_5ls7OZJCRdNOZlyh7M-p7JWs-Vw9L0czWMaKkvtFkPxNmPNQWlLr5s613j9/s1600-h/layout.png"><img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 400px; height: 198px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwi4_WeP-YyObiIcDf0Jk3jvDqBm5SpPz8EuO0mqXPtnlZ8DZxTtcqqpE___0Eu9ZTQZIQV4t2nuuFXoUB_5ls7OZJCRdNOZlyh7M-p7JWs-Vw9L0czWMaKkvtFkPxNmPNQWlLr5s613j9/s400/layout.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5358001776247965570" /></a><br /><br />Here is way to implement ammaps in flex , i used swfloader to add the ammaps in my application as follows <br /><br />var str : String = "assets/ammap.swf?settings_file=assets/ammap_settings.xml&data_file=assets/ammap_data.xml"<br /><br />swLoader.load(str);<br /><br /><mx:SWFLoader id="swLoader" height="400" width="80%" /><br /><br />where i kept all the required files(swf/xml) in assets folders of my application.<br /><br />Regards<br />Varunvrathorehttp://www.blogger.com/profile/10898551813890109092noreply@blogger.com1tag:blogger.com,1999:blog-6221754080009704664.post-61481359795259223882009-07-07T00:01:00.000-07:002009-07-07T00:10:19.072-07:00Making Sharper Flex Application with Sharper Fonts<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgha-FEs4cu1UyDhhushwsNdrxoTaC8Wfw1sdmojkXG7tmJ9iKOAWEJPzeCJRTgyndu4pyJwuPm-MS28_2suss1IOlureZmfq5pnH9KDeGg15YryE7vTqgBNpCCULDEiBdWuiuawI_ef5wG/s1600-h/font.jpg"><img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 330px; height: 49px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgha-FEs4cu1UyDhhushwsNdrxoTaC8Wfw1sdmojkXG7tmJ9iKOAWEJPzeCJRTgyndu4pyJwuPm-MS28_2suss1IOlureZmfq5pnH9KDeGg15YryE7vTqgBNpCCULDEiBdWuiuawI_ef5wG/s400/font.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5355612034516634994" /></a><br /><br />I am not a multi fan of using fonts in Flex , i had to put a very smaller font which was to be very sharp , Here is a example to add it , i tried it in my css but it can be done with setStyle Attribute too, here is the code sniplet and the result<br />Just define following in your css<br />@font-face<br />{<br /> src: url("../font/kroe0555.ttf");<br /> fontFamily: StandardFont;<br /> flashType: true;<br />}<br />Application<br />{<br /> color : #CCCCCC;<br /> focus-thickness : 0.4;<br /> font-size : 8;<br /> font-grid-fit-type :subpixel;<br /> font-sharpness : 1;<br /> font-anti-alias-type: normal;<br /> font-weight : normal;<br />}<br /> <br />Cheers<br />Varunvrathorehttp://www.blogger.com/profile/10898551813890109092noreply@blogger.com0tag:blogger.com,1999:blog-6221754080009704664.post-31580057304472591392009-07-04T00:54:00.000-07:002009-07-04T00:58:01.366-07:00A great Flex Map Component Mercator.swc<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6DN4OzKKMv7RFLzxh5VDoTrpPP7Jcg8S8kWctb_uiocT_fnYO5qo-fL4Ku-myMJfuZxBvddcgPYfMKV1oO309xbyh9P8_WdjhnXz-XCBxfx6tvCXwk12rtvzqLRl1_eyWm2wbxg7h3KVL/s1600-h/World.jpg"><img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 400px; height: 261px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6DN4OzKKMv7RFLzxh5VDoTrpPP7Jcg8S8kWctb_uiocT_fnYO5qo-fL4Ku-myMJfuZxBvddcgPYfMKV1oO309xbyh9P8_WdjhnXz-XCBxfx6tvCXwk12rtvzqLRl1_eyWm2wbxg7h3KVL/s400/World.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5354511028162022850" /></a><br /><br /><br />Mercator Flash/Flex Component from Manfred Weber is the coolest map componet i have seen with such a cool features, to zoom, get center, lattitude,longitude with additional markers and distance lines , i tried to create the map and within minutes i created a realy cool map with color and populating the map from a xml.The component contains all countries of the world and additional 8000 cities + the corresponding latitude and longitude<br /><br />Just I think he has not updated the SWC file for the markers...... i think he will do it soon check out the demo at <a href="http://dev.dschini.org/mercator-swc/demos.php">http://dev.dschini.org/mercator-swc/demos.php</a><br /><br />Cheers<br />Varunvrathorehttp://www.blogger.com/profile/10898551813890109092noreply@blogger.com1tag:blogger.com,1999:blog-6221754080009704664.post-74011886378985049552009-05-19T21:50:00.000-07:002009-05-19T21:56:28.232-07:00Security Error 2060:Security sandbox violation: ExternalInterface caller<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.iconarchive.com/icons/tpdkdesign.net/refresh-cl/System-Security-Warning-256x256.png"><img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 256px; height: 256px;" src="http://www.iconarchive.com/icons/tpdkdesign.net/refresh-cl/System-Security-Warning-256x256.png" border="0" alt="" /></a><br />Many a times we see such issues that we are not able to launch the application from html file and see the following error--- <br /><br />Security Error 2060: Security sandbox violation: ExternalInterface caller<br />file:///C:/Varun/myproject.swf<br />cannot access<br />file:///C:/Varun/myproject.html<br /><br />So to avoid such a error you need to make some changes in html template html<br />In the HTML template make sure that the parameter 'allowscriptaccess' is set to 'always' <br /><br />'allowScriptAccess','always',<br />param name="allowScriptAccess" value=“always" <br />if you are making a Object of swf from a flex application you can add the following parameter to the Object<br />swfObject.addParam('allowscriptaccess', 'always');<br /><br />Cheers<br /><br />Varun Rathorevrathorehttp://www.blogger.com/profile/10898551813890109092noreply@blogger.com1