Category Archives: Software - Page 2

A statement can change the life

This makes very generic sense – this is about my experience in terms of software programming.

My team was facing big pain to solve a very small – simple looking issue. Everything was logically simple and correct.

In flex 3, I disabled TextInput something like under:

objTextInput.enabled = false;

After that I tried to change color through stylesheet (CSS) and it did not work. Contradictory I was able to change font-family and font size of the same component in same fashion, and was working fine.

Changing to objTextInput.enabled = true; worked perfectly fine as expected!

What can I consider this as? A bug in Flex 3 SDK or bug in my understanding? 😉

Masking with customized / polygon shape

A typical requirement to create custom closed shape was a big pain till now at my workplace. Many were working to create some run time changeable shape and through that, mask an image. I achieved this; finally, after visiting a blog and a forum for Flash programming. Also, my colleague Mayur helped to organize once I was ready and I explained like Proof of Concept.

For custom shape, you will require a reference to public property of any DisplayObject / UIComponent – that is graphics (flash.display.Graphics)

Now is the real crux.

The next steps work just like you draw something on paper (or Canvas)

// Create and initialize Sprite object
var spriteObj:Sprite = new Sprite();

// Clear graphics
spriteObj.graphics.clear();

// Define style of line (border of the shape)
spriteObj.graphics.lineStyle(1, 0xff00ff);

// Start filling with a selected color
spriteObj.graphics.beginFill(0x00ff00);

// Move to a position to start from (without actually drawing)
spriteObj.graphics.moveTo(x, y);

// Draw a line / curve or anything that is supported by graphics
// This may be used in a loop or recursive manner to draw lines / curves passing through n points
for(...;...;...)
{
	spriteObj.graphics.curveTo(handlerX, handlerY, x, y);
}

// End filling process, just like you put pen aside!
spriteObj.graphics.endFill();

// Define a new canvas and initialize it
var canObj:Canvas = new Canvas();

// Add the just created Sprite object as a raw (not direct UIComponent child) child
canObj.rawChildren.addChild(spriteObj);

// Use over image as a mask, if required
imgComp.mask =  canObj;

Wireless Security – a 5 star need of today

Market is flooding with a lot many wireless devices, for home and business applications. Also, many wireless devices, especially wireless routers / access points are available at attractable prices.

Many of us purchase them, set up them, and often forget the rest – once we get it functioning.

But, setting up primary security is a very next step after setting the device and testing it.

Recent terror attacks was a red signal for many wi-fi home users.

Here is a brief idea, how we can set up primary but essential security with the available wireless router.

  1. Change default user name and password, few routers do not support change in user name. Default user name is generally admin in most cases. Use combination of aLpHaNuM3R1C (alphanumeric) and $peC|@l (special) characters as password. Keep password as long as possible to avoid break by bruit force technique. Providing sp a ce (spaces) in between password character increases strength in most cases.

  2. Once password is tightened, now it’s time to reduce number of maximum (possible) users. In DHCP settings, generally a lot – like 100 of users can be connected. If in actual situation, say there can be maximum of 2 users at a time, keep maximum user figure as 2, or keep IP allocation in such a fashion that the DHCP will be in position to allocate only 2 IPs, even if more attempt to connect. Of course, disabling DHCP, and allowing only manual configuration, is always best practice, since it is difficult to guess the settings by hacker, if IP allocation is made smartly.

  3. Now, actual security comes into picture. Disable SSID broadcast, unless it is very important. This makes it difficult to identify network name in wireless coverage area without smart tools. You may also reduce connection idle time and other router specific features to reset connection with client device such as laptop or PDA in case of idle time.

  4. Keep the SSID difficult to guess. Always change default SSID of your router.

  5. MAC filtering is another and important feature. MAC is a universally unique number of any network equipment. Typically for known usage, set MAC filter with allow policy viz. Allow devices to be connected only with mentioned MAC numbers, reject rest. Of course, MAC spoofing is possible through few tools, however for an attacker, it is very difficult to guess correct MAC without touching the device, without making single connection, or unless the user reveals it. :p

  6. Next in picture comes software enabled security, typically Keys. Define and set different set of keys and use appropriate method of key to set up and avoid unauthorised access to network. This will deny network connectivity to the client in case it is just standing before the network door. Without a key, the router does not allow access. Of course, few techniques and few weak key algorithms are there, those can be broken. 🙁 But, combination of all mentioned techniques, here, is a fruitful solution to increase security.

  7. Port(s) blocking and service(s) disabling is also helpful, feature available in most of today’s routers.

A before buy tip – do not be trapped in marketing blues….. The salesperson will mostly encourage to buy best (in features and price too!) device. Go for a device which is good enough for security measures, and not really more that what you want – say wireless coverage area. If the need is max. 90 feet, a router with coverage up to 100 feet is best, no need to offer a chance to neighbor hacker, by purchasing a router with 150 feet coverage range! Of course, your needs are the best judge to decide suitable product, not always the sales person!! Buy and set the device in center area of its potential use, to utilise the covered radius area of connectivity.

Flexible Eclipse

Flex SDK is Free & Open Source but Flex Builder is neither free nor open source.

I googled if there is any way to use Flex SDK with Eclipse (because Flex Builder is built on Eclipse too) for development purpose.I found 2 useful results; Of course I haven’t tried yet.

http://cfsilence.com/blog/client/index.cfm/2007/3/26/Setting-Up-Eclipse-For-Flex-2
http://www.darronschall.com/weblog/archives/000182.cfm

Digital v/s Optical zoom

Today we are crazy about gadgets. But very few of us know very few of true features and manipulated features.

PMPO is a buzzword for hype. Actual measure of an audio system (or hi-fi system) should be considered in RMS watts, not PMPO. We are attractive to high figures of PMPO.

Similar is the case with zoom – enlargement.

Today a lot many varieties available for different ranges of digital cameras, even shopkeepers are unknown to the basic difference between digital and optical zoom.

Many articles are available on internet to clarify difference.

However recently I had gone through an advertisement by famous camera brand Olympus. This will probably be like a picture is equals thousands of words!

Optical Zoom

Optical Zoom

So, the basic difference is that when you say digital zoom, it means that the picture has that much depth – in other words, you can enlarge them up to certain limit after taking photo, using some software. Lesser the digital zoom, lower will be the quality of image after enlargement. In short this is considerable factor after picture is stored. For more clarity just remember those attempts when you tried to make a big picture from a small photo using some software. And you perhaps end up with blur image with large size. Pixel (no of horizontal & vertical lines in a frame) is the measure for that.

On other hand, optical zoom has relation with the moment when you want to take picture. Higher zoom gives you benefit of taking photo from higher distance.

Also, too high range is not always good. It may happen that you fail up on your own camera when you want to cover a wide (not far!) area with close distance.

DSLR (digital SLR) or SLR camera is a type of camera that really teaches and shows real photography skills. Every minute and manual setting is possible – whether its aperture or shutter speed or even flash light effects at some extent, focal distance and many more….!

My father is learning how to operate and play with his newly purchased D60 from Nikon. I hope and wish to learn after he gets good grip over it. 🙂

Setting up Subversion under windows

Prerequisites:

  1. Subversion Binary (http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=91)
  2. TortoiseSVN (http://tortoisesvn.net/downloads)
  3. SVN Service Wrapper for Windows (http://www.lw-works.com/files/svnservice/svnservice-1.0.0.msi) – svnservice

Alternate to 1 & 2 – download 1 Click Setup (http://svn1clicksetup.tigris.org/)

Step 1

  1. Install Subversion binary.
  2. Make sure that the bin directory of Subversion is under PATH environment variable.
  3. Set any text Editor’s path as SVN_EDITOR environment variable. (e.g. c:\windows\notepad.exe)

Step 2

  1. Create code / document repository (the main destination or data centre!!)
svnadmin create "d:\codeRepo"
               Alternatively, you may also use explorer’s context menu to add selected folder as repository using TortoiseSVN.
  1. Go to the repository folder (e.g. codeRepo)
    1. Edit /conf/svnserve.conf file

Uncomment following:

                               [general]
                               anon-access = read
                               auth-access = write
                               password-db = passwd
    1. Edit /conf/passwd file

Uncomment following / specify allowed username & passwords:

                               [users]
                               harry = harryssecret
                               sally = sallyssecret
                               harit = harit’s password

Step 3

  1. Start svnservice
               svnserve --daemon --root "d:\codeRepo"
  1. Add new Project directory by
               svn mkdir svn://localhost/myproject
  1. Provide correct username & password (that is configured earlier)

Otherwise, use SVN repository browser to browse SVN repos. Right click provides rich set of options like adding new files/folders, delete, etc. etc. Use svn://localhost/myproject or similar as URL to browse.

Optional options!

  1. Setup svn-service to start at startup
               svnservice -install --daemon --root "d:\codeRepo"
               sc config svnservice start= auto
               net start svnservice
  1. Bind windows user for authentication (see source link 1 – http://www.stanford.edu/~bsuter/subversion-setup-guide/#svnserve-windows-user)

Please make sure that the svnservice is running correctly. Use Control Panel > Administrator Options > Services > Subversion (or whatever you named it) to verify. If the service is not running, it is the root of many problems.

This setup also works on network. You can access this repo through other machines connected through network. Each time you modify the files and commit, subversion will do authentication based on username and commit new version.

Major advantage of subversion – old (and deleted) files remain there in repository and can be retrieved back, so is perfect backup solution for code!

Sources for more advanced setup:

  1. http://www.stanford.edu/~bsuter/subversion-setup-guide/
  2. http://blogs.vertigosoftware.com/teamsystem/archive/2006/01/16/Setting_up_a_Subversion_Server_under_Windows.aspx
  3. http://blog.excastle.com/2005/05/31/mere-moments-guide-to-installing-a-subversion-server-on-windows/

WebApp wrapper – Mozilla Prism

Recently, I come to know a new project by Mozilla Labs – Named as Mozilla Prism

I am really impressed with the idea that started the project. These days, of course, slowly, desktop applications are being replaced by web applications. Still, internet connectivity is nightmare at some places. If this limitation is overcome, I guess future is web applications!

I have also experimented with Mozilla Firefox – about the plug-ins. There is a rich set of useful add-ons for your specific requirement. Platform (hardware & OS) may not be in consideration once we are used to with webApps.

Yes, Prism is on the way too. It basically frames particular URL, that provide webapp and make you feel like a desktop application, although it is using resources from URL you specified. (more on http://labs.mozilla.com/2007/10/prism/)

I have created simple shortcut for GMail, now although I use the webmail it gives feeling as if it were a desktop client. Of course, AJAX also plays important role for ‘my feelings’!

Here we go… http://labs.mozilla.com/projects/prism/

Security Tip : Prism is not sharing Mozilla Firefox or any other browser’s resources. So it hides history, passwords, cookies & session too. So I feel it quite secure. GMail opened with Prism won’t keep its session available for Firefox too.

Where did you receive email from??

A continuous email threat makes big challenge to identify where the email was sent from. It is very important to trace the location.

Yesterday night, I tried to explore basic things about email, like origin of email, forwarded reference, sender’s machine’s public IP etc.

Here is a basic and simple way to get this information extracted:

  1. eMail headers contain many valuable (for us) information that is not valuable for many end users.
  2. Usually any email client (like Mozilla Thunderbird) can reveal this. (Yes, open source rocks!!!)
  3. Go to View menu and click Show Headers to make the header of any email visible.
  4. Some information like Sender’s IP or received from IP is the key.
  5. Go to http://www.ip2location.com/ or http://www.apnic.net/ and find the location, service provider (ISP) from where the email was sent. These websites give simple details of location by providing IP.
  6. That’s it! We can at least trace machine’s public IP and location…..

Of course, this information is very primary. But I guess it is the first step of investigation. Just to test, I found that one of my friends from Pune sent me an email when he was in Ahmedabad, and he revealed it later!!!

Summary:

Email header > sender’s IP / received from IP > IP to Location query > Result!!!

Screen Magnifying Software

Here is an article/opinion about few softwares for computer screen magnification, for visually impaired. Many attempts have been made for such people, but I being one of them want to have another attempt, in case someone reads this and gets benefited.

December 16, 2007, Sunday

Sunday is considered to be a fun day after hectic week. And perhaps that’s Times Of India has a supplement titled TGIS (thank god, its sunday). The Sunday is a normal holiday since my final exams will be taking off from Monday!!

But, a thought sparked in my mind in afternoon. I heard about screen magnifying software. And; of course, tied before a year or two. I was not satisfied with the functionalities and performance. One of the reason might be my PC, that has the minimum configuration prescribed in that version. (I am sorry since I have forgotten the name of software).

The thought process leads me to re-search same softwares on Net. I googled out few keywords and found one very good link.

Here it is…

http://www.magnifiers.org/links/Download_Software/Screen_Magnifiers/Windows_Freeware_and_shareware/

I download few of freewares from that, but liked DesktopZoom most. It satisfied most of my requirements. Since it actually enlarges the current screen, the performance is bit poor. But I think its yet the best one. Very lightweight, and of course freeware!

 

It has rich set of functionalities and options to set hotkeys and magnifying level.I personally recommend going for such softwares instead of buying large sized licensed versions.

 

 

I also come to know about sourceforge.net initiative for the same. Here it goes…

 

http://magnifier.sourceforge.net/

 

Although I am not much satisfied with the functionalities of Virtual Magnifying Glass 3.3.1, I am mentioning here since I respect open source projects at most! I hope for project to complete (with newer version, of course) with great features.

 

Such softwares require practicing if someone wants to use in day to day life. Playing with mouse movements, screening the objects, understanding limitations with time. (some messages will not get captured in case they flash for few nanoseconds!!!!)

This opens a new window of thought to try something on Linux! Will share something if I will find something interesting!!

🙂

%d bloggers like this: