Rajgad,trekking experience

June 29, 2009 by saumya

Well,this is not the first time I have trekked but this  is obviously this seemed to be the first time to trek after such a long period of time.  The journey was quite safe and sound. We started off from Thane in the midnight,reached Pune in the morning. Then with multiple vehicles’ shifting  from one to another and walking quite a distance finally reached the foot of the mountain containing the Rajgad Fort. While waiting for another 2 of our group members we lost a sever amount of morning time. Keeping our guts alive we have started to climb around 10.30AM with the sun high on the sky. While all of us were expecting rain and packed up our bags with all the rain protecting materials,the weather had a different story to tell. Taking a lot of small to mid size breaks through out the climbing, finally reached  the top around 1.30 PM.

While the climbing up was a bit more stressful than usual because of sun,but no rain came in favor of us as we never found any slippery path to lead us to trouble. Once reached top the weather was cold and cloudy. It almost started raining within an  hour,by that time we had placed ourselves inside the temple. Cooked the lunch,took some rest and started to go around  the hill,to visit the forts.

The night stay in the temple was shared with around 70 people from different teams. We cooked  the dinner and had to manage with less Dal than Rice. Then the morning was awesome with noodles in the breakfast and then moved around for visiting some different forts. And then the climbing down started.

Overall, it was a cool journey. Everyone of us were perfectly fit throughout the trek. There were spots, which we had to climb almost 70 degrees slope and on the side of the hill. These were spots which had only rocks in it and you have to make your mind before climbing up/down.

Made some cool new friends. Knew some friends in depth. Got an experience for life time. And finally get my old  dream of visiting  places rolling.

Thank you guys for making me a  part of the trekking team.Looking forward to keep up with you guys.

:)

PDF2SWF : Auto conversion from PDF to SWF

June 25, 2009 by saumya

I never thought I will be converting some PDF files into SWF anytime. But the time has come and I was doing the same for past some days. Well,while deciding for the tools and technology I always thought FlashPaper is a good option. Surprisingly for me FlashPaper is dead now ! In the beginning days I always asked myself why FlashPaper was created from Macromedia ?! But then situations come up,where one has to fall back to flash technology. Well, with the death of FlashPaper, I lost hope, then found Scribd. Awesome, they do the same thing online and have a rich set of API exposed for developers to do the same. Unfortunately, for security reasons my option only include softwares which can be used in-house.

Well, then I came across SWFTOOLS. An opensource library of tools for SWF. One of the tools is PDF2SWF. As the name suggests, it converts a complete PDF to SWF. It not only just converts PDF to SWF but also maintains all the links in the PDF in the generated SWF. Thats a pretty nice job. It has a GUI too for those who want to use it. Personally I found the command line of this tool to be awesome. There are a large number of options available while converting from PDF to SWF. By default once the SWF is created it starts running as a presentation in a default timer. There is an option to put “stop()”  action in each frame(as each page becomes one frame),nice and sweat. The default conversion gives a nice default viewer to navigate to different pages,zoom in/out and scrollbars. One can customise the default viewer to make ones one viewer too.

The only thing which hurt me is the SWF produced in a AVM1 Movie,though SWFTOOLS says that the latest version produces AVM2 movies,but it is not. To make an AVM2 movie I just passed in the flashplayer version 10.0 in one of the command line options.That gave me an AVM2 movie. For my custom player, I just went ahead and loaded the movie with an “Loader” and since its AVM2,I typecast it to a “MovieClip” and then started controlling it through AS3.

I am expecting more from the tool and the first expectations is, it should produce an AVM2 movie. The method to add a viewer should be more easier.

Over all, the tools are just freaking cool. All the best to the SWFTOOLS. Hoping to see this project mature.

Lastly below are the options one will get while firing up PDF2SWF from command line. I have just copied the help from PDF2SWF from my command line to put it here.

Usage: pdf2swf [-options] file.pdf -o file.swf

-h , –help                    Print short help message and exit
-V , –version                 Print version info and exit
-o , –output file.swf         Direct output to file.swf. If file.swf contains ‘%’ (file%.swf), then each page goes to a seperate file.
-p , –pages range             Convert only pages in range with range e.g. 1-20 or 1,4,6,9-11 or
-P , –password password       Use password for deciphering the pdf.
-v , –verbose                 Be verbose. Use more than one -v for greater effect.
-z , –zlib                    Use Flash 6 (MX) zlib compression.
-i , –ignore                  Allows pdf2swf to change the draw order of the pdf. This may make the generated
-j , –jpegquality quality     Set quality of embedded jpeg pictures to quality. 0 is worst (small), 100 is best (big). (default:85)
-s , –set param=value         Set a SWF encoder specific parameter.  See pdf2swf -s help for more information.
-w , –samewindow              When converting pdf hyperlinks, don’t make the links open a new window.
-t , –stop                    Insert a stop() command in each page.
-T , –flashversion num        Set Flash Version in the SWF header to num.
-F , –fontdir directory       Add directory to the font search path.
-b , –defaultviewer           Link a standard viewer to the swf file.
-l , –defaultloader           Link a standard preloader to the swf file which will be displayed while the main swf is loading.
-B , –viewer filename         Link viewer filename to the swf file.
-L , –preloader filename      Link preloader filename to the swf file.
-q , –quiet                   Suppress normal messages.  Use -qq to suppress warnings, also.
-S , –shapes                  Don’t use SWF Fonts, but store everything as shape.
-f , –fonts                   Store full fonts in SWF. (Don’t reduce to used characters).
-G , –flatten                 Remove as many clip layers from file as possible.
-I , –info                    Don’t do actual conversion, just display a list of all pages in the PDF.
-Q , –maxtime n               Abort conversion after n seconds. Only available on Unix.

Happy Flashing :)

Getting the Classes from external SWFs

May 24, 2009 by saumya

When it comes to divide a flash application into separate swfs, its a whole new ball-game in AS3 than in AS2. In this particular case I think AS2 was rocking and simple. But then its as simple in AS3 as in AS2,one just need to change the thought process. First of all one must understand that whatever is happening in AS3 is an Object-Event process. Then everything seems clearer. So lets start the code part.

I have two SWF files, one is having audio library and one is my application FLA.In my audio Library FLA, I have two audio files in the library,with Class name as “saumya.audio.One” and saumya.audio.Two”. These two files are set to “Export for Actionscript” and “Export in Frame 1″. So this library FLA does not contain anything else except two “mp3″ in library with the above settings. Now lets publish the FLA to produce a SWF file. Let the file named “audioPackaging.swf”. We have the audio library in place. Now all that remains is access these classes from my main container or application SWF. There is another FLA, which is supposed to be the base container or the main application FLA. This file is supposed to load the audio library into it and play them. The process of loading is same as loading any other SWF,using “Loader” class.

Once”audioPackaging.swf” is loaded into the application SWF, we will get the “LoaderInfo” object from the complete event object. This “LoaderInfo” object is the key to get all the classes in the loaded SWF. We will go into detailed descrition once we see the code. Below is the code to load the SWF and then access the “LoaderInfo” object.

var l:Loader=new Loader();
l.contentLoaderInfo.addEventListener(Event.COMPLETE,onSongs);
l.load(new URLRequest(”audioPackaging.swf”));
function onSongs(e:Event):void{
trace(e.target);
var lf:LoaderInfo=LoaderInfo(e.target);
}

All the classes in an externally loaded SWF is loacated inside an object of “ApplicationDomain” class. This class is in the “flash.system.ApplicationDomain” package. Do not worry if the words seem alien to you. These are actually our new friends in AS3 :) . Now the good news is to find our friends we do not have to search anywhere! There is a property in “LoaderInfo” object which contains our friend “ApplicationDomain” and the property is called “applicationDomain”. Phew,there we go. The revised code now look like

import flash.system.ApplicationDomain;

var l:Loader=new Loader();
l.contentLoaderInfo.addEventListener(Event.COMPLETE,onSongs);
l.load(new URLRequest(”audioPackaging.swf”));
function onSongs(e:Event):void{
trace(e.target);
var lf:LoaderInfo=LoaderInfo(e.target);
var Two:Class=    (lf.applicationDomain.getDefinition(’saumya.audio.Two’))as Class;
var t:Sound=new Two();
t.play();
}

Now you can see we have a method in “ApplicationDomain” class which actually returns the Class definition object. If you still remember we have already assigned the class name to the second audio file in the properties pannel as “saumya.audio.Two”. Once we get the reference to “ApplicationDomain” object, its a matter of calling the method “getDefinition(’classDefinition’)” of this object and casting it as a Class. Thats all.We will have a proper Class definition now onwards. since we know that “saumya.audio.Two” is a “Sound” class, we can go ahead and play it like any other “Sound” class.

I had put this example for “Sound” as audio was and still is a painful part in flash application development. But the concept can be applied to any class definitions you may want to load dynamically or want to share as a separate SWF.

Happy Flashing :)

Its Application design,where innovation meets talent.

May 23, 2009 by saumya

I was thinking of putting this blog post a long time ago.Somehow I was not able to find the right subject for it.
When comes to application design its not about how good you can code a class.Yeah, I said how GOOD(its not the fix,its a good practice of code,not even mediocre) you code a class.First and foremost is a good coding practice.If you think you are a problem solver then try out good practice in code,the coding standards.This is the starting point of an application designer. Architecting a software is not just quick fixes. Its the foundation of a good building. I had come across many development firms and big corporates,where they only talk about get the things done.How?They simply do not know. I have seen talented developers are driving crazy by stupid managements.Huh,is it the future?!! As a result no innovation,no development growth as a team.
Read the rest of this entry »

Wapache : Making desktop application in PHP

May 16, 2009 by saumya

This one is kind of very handy if you want to create a desktop application which can have serverside processing in PHP. Though there are nattive libraries of PHP to create desktop application, but the problem here is distributing the application. If the application needs to be a desktop application and be distributable then there is no option we can have it running with PHP :( .

The good news is Wapache. A very nifty simple opensource framework on top of Apache server. Just copy it to any where and start running the exe in the bin folder.Voila, all your dynamic webpages will run in all the windows desktops. Wapache bundles an Apache server, PHP libray and internet explorer in it. The framework it self comes with the handy demo files which exposes all the properties we can play around with.Making a full screen window,making a chromeless window,defining size of create window are just some of the things Wapache can do. Just for an usage example, say we need database admin tools such as PhpMyAdmin or PhpPgAdmin to run in our machine. We already have Mysql or PgSql running, but then we need to install Apache and PHP to run the admin models! Just put “PhpMyAdmin” or “PhpPgAdmin” in the Wapache folder and link it in the index page.Whew, there you go!! Its that simple.

Though it would have been better if Wapache could serve to any  platform.I think this project needs a lot of deserved appreciation than it is getting now. A very well thought and well done project. Cheers to Wapache.

Windows 7, free for a year :)

May 6, 2009 by saumya

Microsoft has recently made a huge announcement regarding the Windows 7 release. Windows 7 Release Candidate is now ready to be downloaded from Microsoft’s site. They are providing the product keys also.  According to the announcement the RC will expire on June 1, 2010. So there is legally around one year to test the new operating system.The RC is also available in 2 flavors like 32bit and 64bit.

I have downloaded it yesterday and put it on my system. Though I have a 64bit AMD machine, I prefferred the 32 bit version of it as there are very few softwares available for 64bit till now !! After the download of the “iso” file one need to cut it in as DVD, so did I. Next is the installation. I must say, this is the best Windows installation experience for me ever. Just 3 clicks (I remember the windows 98 days, when it was said to be 3 click install !!  huh!) and the new OS is ready to go from there. First it will ask for upgrading or new install, then it will ask for partitioning (in a very nice display) and then install. Wait for some time and you are ready to go with your new Windows 7 OS. Next its the time to register the software. With the product code given at the time of downloading will be used while installing and once boot up, I tried to register it through internet. Everything went well and within minutes I was running with a legal Windows7. I am really happy to see the way Microsoft has taken the OS. This time the from the installation to the performance Windows 7 simply better than Windows Vista and I can say it even faster than Windows XP. I have not tested that with any testing tools but from the face of it. Tried and installed the trial version of Flash CS4 ( I got that in recent Adobe event :) ) in it, and it got installed with charm. Flash CS4 even performs faster in Windows 7 than Windows Vista and XP !! The look and feel of the Windows 7 is nice and soft. Ya, it feels soft and bright :) .

Overall the new operating system is cool and I am waiting for Microsoft to give the Windows Vista users a free upgrade to Windows 7 as I am running my laptop with a Windows Vista. Well, the free give away product numbers will continue till July 2009.

cheers :)

Flash 3D authoring with CopperCube

April 26, 2009 by saumya

Yet another 3d authoring tool for web 3d,CopperCube. Being on beta, its quite good on features and performance is kind of ok. The most notable feature is the ease of use and the swf size. Very easy to use and one can be productive right away. The swf filesize is also small,for 6 boxes with textures,lighting and a first person camera it came to 132 kb. The thing which hurt me is the performance on ie. My browser continuously crashed with one first person camera. Being on beta, I think these issues are to be there. Hopefully a stable compilation will come on the release version. Apart from that, actionscript is supported in it and the tutorial is cool to get started. For a longtime I was searching for a tool like this. The camera can be made to collide with the objects in scene,which is a very nice way to control without any code. Overall a must try for flash 3d game developers.

Get the out put files here.

Happy Flashing

Documentation Tool, NaturalDocs

April 21, 2009 by saumya

Designing a software and developing it, is might be one part of the game.But I believe without a proper documentation of a software, the product itself decays in time. I am very dissapointed to see people calling themselves developers (ohh no, very good, experienced developers) do not even know and do not want to know the necessity of documentation. One generally finds the words “fix it man.forget that comment,fix the code.who cares why?” from the know all, Mr Fixit and efficient guy in a typical flash development environment. Obviously we are here to do stuff but then imagine if the same code you are passing on to some guy would come to you without documentation, what would be your reaction to the situation.The general reaction of the typical Mr Fixit is “This is not my code. I am trying to understand some body’s F*$#ing code. This is not the way one should right the code”.
Give me a break, documentation is the key to make a product come out alive over and again with lot ease and good maintaince. For flash projects I always thought AsDoc holds a good palce. It does actually if you are a Flex developer. But what happens if your whole project is Flash only!! AsDoc can not understand “fl” package.Ohh no!Ohh yes. It does not understand the package at all.Then there are work arrounds.Why?! If Flash is a platform and eveything is a tool to produce the SWF, the Flash only projects should get equal advantage as Flex.
Well,then there are some pretty tools who can do the thing sweetly and nicely. NaturalDocs is an opensource project, which does the thing.It supports a lot of languages and produces documentation clean and sweet. It has option even to create a frame based documentation or a no-frame only HTML based documentation. It supports the standard JavaDoc type comments as well as natural english language type comments too. Over all I am happy and satisfied with NaturalDocs as I became productive in it within 15 minutes after download. I must tool for any kind of development documentation. Cheers to NaturalDocs.

Adobe CS4 Event,Mumbai

April 21, 2009 by saumya

Yesterday I had been to Adobe CS4 event at Mumbai.It was exciting and pleasure to be in the event. Met a few old pals and got to see new features coming in, in Adobe products. Good to see that Adobe is promoting OpenScreen project even in sales talks. Another interesting thing was Flash Catalyst. Though I am following up with Thermo for a long time,but seeing it in person is a different experience. Gumbo is another cool stuff shown in the presentation along with FlexBuilder 4 (though mentioned that the FlexBuilder 4 IDE is far from the actual release version,but I never expected to see “Fx” componenets). Then it was all Flash CS4 new features tour and Flash player 10 feature list. Over all it was an interesting place to be.

As far as the media server is concerned the most exciting feature came in with Flash Media Server 3.5 (FMS3.5) is dynamic streaming. Dynamic Streaming does the quality decission on the run time, it actually looks for the connection speed of users’ machine and stream the higher,medium or lower quality media ones respectively.

A concern about the 3D Authoring softwares

April 9, 2009 by saumya

Its almost 8 years since I saw Softimage for the first time. I was quite excited to see the features it had even then. I use to work only on 3dsmax and always thought why 3dsmax doesn’t have the features. Slowly the transformation happened. From Kinematix to Discreet to Autodesk, its a long journey from 3dstudio to 3dsmax. But the point here is not the transformation of max,but the way Autodesk is handling the 3D market. After 3dsmax, Maya and Softimage were a good competition. Then it was Alias-wavefront, which somehow gave-up and Maya came to Autodesk. After a longtime, out of curiosity I was searching for Softimage and completely astonished seeing Softimage is now from Autodesk!! Where is the competition?!! There is now,I think, only one professionally tough competitor, Lightwave. Personally I love 3dsMAX, but without competition Autodesk might come to a monopoly in 3D market. Then my current favorite, the Open Source 3D authoring tool Blender is coming up nicely. I hope the war will be with OpenSource.