Skip to main content

Posts

Batch File - Bulk Renamer

Below is the batch-file code to systematically rename all the files present in the folder according to the given condition. .: C.O.D.E :. @echo off&set /a cnt=0 for %%a in (*.jpeg) do call :PROCESS "%%a" goto :EOF :PROCESS rename %1 "IMG_%cnt%.jpg" set /a cnt+=1 .: S.T.E.P.S :. Step-1 : Open a Notepad. Step-2 : Copy the above code and paste it in Notepad. Step-3 : Save the file as "bulk_renamer.bat" . Step-4 : Put the  bulk_renamer.bat file inside the folder that is having the files which needs to be renamed. Step-5 : Run the  bulk_renamer.bat file by double clicking on it. Note: This batch-file should be present inside the folder where rest of the files that needs to be renamed are present. Remark: Modify the script and condition as per your requirement.

Naming Conventions for common Team's File

Earlier, I'd posted an article  Naming Conventions for Flash Designers . In continuation of that idea, here is another efficient way of doing the say job. According to this method of naming convention, let us first understand how to make a tag. The tag can be created as <name-intials><number-of-times> .  Here name-initials contains the initials of the user's name and number-of-times contains the number of times the user has worked on that file. For example,  AK1 for Abhishek Kumar worked for first time, DC5 for Dulani Chandni worked for fifth time, etc. Now the creater first creates a file and name it as per the tag creation rule. Then another person works over the same file and he'd suffix his tag in the name of that file. Again the creater re-works over that file. This time creater would increment the number-of-times part in his tag-initials. Similarly any other person who'll work on this file will suffix his tag in the filename. So, the filename w...

Code of Ethics from Superstitious Beliefs!

Have you ever wondered how normal events turn into superstition or moral codes? Here is a short story by Paramahamsa Nithyananda . In an ashram in India, its master used to hold his puja worship every morning. Now, the master had a pet cat. The cat was very curious and used to jump and play around. It got in the way of the master and his disciples during the daily worship. It never allowed them to finish their worship peacefully. Gradually the cat, in all its playfulness, became a big nuisance. The master had grown quite fond of the cat and did not want to get rid of it. Since he did not want his daily worship disturbed, he asked his disciples to cover the cat with a basket before he began the worship. That day, the worship was peaceful. The master asked his disciples to continue the same way next day. Covering the cat with a basket during their daily worship soon became a part of their routine. Unexpectedly one day the master died. The disciples continued the tradition estab...

AS3: Override in Actionscript 3

To understand the working of override keyword in Actionscript 3, follow the article. Create a blank .fla file and name it Main.fla . Then fill in  Document class input box, by typing  Main  in it . This will connect the Main.as file with the  Main.fla file. Main.as package {   import flash.display.MovieClip;   /**    * ...    * @author Abhishek Kumar    */   public class main extends MovieClip   {     public function main()     {       var oBase:CBase = new CBase();       oBase.method();       var oChild:CChild = new CChild();       oChild.method();       var oClone:CBase = oChild as CBase;       oClone.method();     }   } } CBase.as package {   public class CBase  ...

Long trip over a bike

My younger cousin brother is crazy about bikes. Few weeks back he told me about his plan to visit his hometown. I said "Ok! What's the big deal?". Then he told me "over a bike". Since he is staying in Gurgaon while his hometown is Madhubani, which is around 1250 km from Gurgaon. So after listening this I was like "Oh My God! Are you sure?". He was quite determined, so I asked about how he'll be going to execute this. But as I guessed he had no plan. Though his excitement was visible over Facebook, as he was asking for suggestions on his wall. Since nobody else has ever did this before, he wouldn't got much suggestion though everyone wished him luck. Finally he included his friend in his trip. And I sighed as two can better care themselves. As per their plan, in fact, no-plan they were gone over a trip and to my expectation they finished it well. As he called me about his exciting journey of 2 days. Though I knew they'll do it even tho...

App Inventor Versus Scratch

Google has launched it's latest innovative solution for mobile applications. Now you may think what so special about it? Well, it is special because now it is not required to be a programmer to develop a mobile application for Android operating system. With the help of this latest App Inventor, any non-programmer can develop a mobile application. The idea is quite innovative, as it uses blocks instead of textual code to create an application. Though this idea is not so unique, since another language named Scratch, that is meant for kids, was launched in Dec, 2007 by Lifelong Kindergarten Group at the MIT Media Lab. Scratch has been developed keeping kids in mind. So it was made to teach programming language to kids in a very simple way. And to make it so, all the complexity have been removed. Hence, the result were blocks of hidden wrapped codes. It seems that Google has taken this idea further and made it more general purpose. In fact, it looks more useful, if it can be used...

AS3: Function to resize an image

/** * Function to resize an image **/ function resizeImage (id, ReqWidth, ReqHeight) {   id.scaleX = 1;   id.scaleY = 1;   var OriginalW:Number = id.width;   var OriginalH:Number = id.height;   var new_width:Number = 0;   var new_height:Number = 0;   if (OriginalW<=ReqWidth && OriginalH<=ReqHeight)   {     new_width = OriginalW;     new_height = OriginalH;   }   else   {     if (OriginalW>ReqWidth)     {       new_width = ReqWidth;       new_height = Math.floor(OriginalH * (ReqWidth / OriginalW));// 149*(119.30/149) = 83.51       if (new_height > ReqHeight)       {         new_width = Math.floor(new_width*(ReqHeight/new_height));         new_heigh...