Search This Blog

12/28/09

How to Back Up and Restore the Registry

Before you edit the registry, export the keys in the registry that you plan to edit, or back up the whole registry. If a problem occurs, you can then follow the steps how-to restore the registry to its previous state.


How to Export Registry Keys

Click Start, and then click Run.

In the Open box, type regedit, and then click OK.

On the File menu, click Export.

In the Save in box, select the boxs at the bottom the bottom according to weather you want to export all or only selected branches of the registry.

Next select a location in which to save the backup .reg file. In the File name box, type a file name, and then click Save.


How to Restore the Registry

To restore registry keys that you exported, double-click the .reg file that you saved.

Get your music easily

put this string in google search:

?intitle:index.of? mp3

You only need add the name of the song/artist/singer.
Example: ?intitle:index.of? mp3 jackson

Another good way of finding MP3s (or other formats) is using Google and typing the following:

parent + directory + mp3 + OR + wma+ #dido#

Replace #dido# by whatever artist you wish to find, for example:

parent + directory + mp3 + OR + wma+ #Lamb#

You should get plenty of dirs with MP3s or WMA files (you could add OGG, etc, to the query). Cheers.

I personally tested these and got wonderful results..give it a try

Auto End Tasks to Enable a Proper Shutdown

This reg file automatically ends tasks and timeouts that prevent programs from shutting down and clears the Paging File on Exit.

1. Copy the following (everything in the box) into notepad.


QUOTE
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management]
"ClearPageFileAtShutdown"=dword:00000001

[HKEY_USERS\.DEFAULT\Control Panel\Desktop]
"AutoEndTasks"="1"

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control]
"WaitToKillServiceTimeout"="1000"


2. Save the file as shutdown.reg
3. Double click the file to import into your registry.

NOTE: If your anti-virus software warns you of a "malicious" script, this is normal if you have "Script Safe" or similar technology enabled.

Tutorial 4: Moving Object in a Circuler Path

I hope u got the rectanguler movement right. Now we are moving to the circular path that uses the simplest of trigonometry that we did in the tutorial n angles.
To start with as usual draw anything and convert to movieclip. Select the clip and attach the follwing actionscrpt.I'm going to explain it later.

onClipEvent (load) {
var radius = 100;
//setting radius
var speed = 5;
//setting speed
var xcenter = Stage.width/2;
//setting center of rotation
var ycenter = Stage.height/2;
var degree = 0;
//setting degree to start with
var radian;
}
onClipEvent (enterFrame) {
degree += speed;
radian = (degree/180)*Math.PI;
this._x = xcenter+Math.cos(radian)*radius;
this._y = ycenter-Math.sin(radian)*radius;
}



Test your movie. Your clip is rotating around the center of the stage at a radius of 100 with a speed of 5. We can always add something to it to improve and u can always try that.Wait for the tutorials to come.

DirectX explained

Ever wondered just what that enigmatic name means?

Gaming and multimedia applications are some of the most satisfying programs you can get for your PC, but getting them to run properly isn’t always as easy as it could be. First, the PC architecture was never designed as a gaming platform. Second, the wide-ranging nature of the PC means that one person’s machine can be different from another. While games consoles all contain the same hardware, PCs don’t: the massive range of difference can make gaming a headache.


To alleviate as much of the pain as possible, Microsoft needed to introduce a common standard which all games and multimedia applications could follow – a common interface between the OS and whatever hardware is installed in the PC, if you like. This common interface is DirectX, something which can be the source of much confusion.

DirectX is an interface designed to make certain programming tasks much easier, for both the game developer and the rest of us who just want to sit down and play the latest blockbuster. Before we can explain what DirectX is and how it works though, we need a little history lesson.

DirectX history

Any game needs to perform certain tasks again and again. It needs to watch for your input from mouse, joystick or keyboard, and it needs to be able to display screen images and play sounds or music. That’s pretty much any game at the most simplistic level.

Imagine how incredibly complex this was for programmers developing on the early pre-Windows PC architecture, then. Each programmer needed to develop their own way of reading the keyboard or detecting whether a joystick was even attached, let alone being used to play the game. Specific routines were needed even to display the simplest of images on the screen or play a simple sound.

Essentially, the game programmers were talking directly to your PC’s hardware at a fundamental level. When Microsoft introduced Windows, it was imperative for the stability and success of the PC platform that things were made easier for both the developer and the player. After all, who would bother writing games for a machine when they had to reinvent the wheel every time they began work on a new game? Microsoft’s idea was simple: stop programmers talking directly to the hardware, and build a common toolkit which they could use instead. DirectX was born.

How it works
At the most basic level, DirectX is an interface between the hardware in your PC and Windows itself, part of the Windows API or Application Programming Interface. Let’s look at a practical example. When a game developer wants to play a sound file, it’s simply a case of using the correct library function. When the game runs, this calls the DirectX API, which in turn plays the sound file. The developer doesn’t need to know what type of sound card he’s dealing with, what it’s capable of, or how to talk to it. Microsoft has provided DirectX, and the sound card manufacturer has provided a DirectX-capable driver. He asks for the sound to be played, and it is – whichever machine it runs on.

From our point of view as gamers, DirectX also makes things incredibly easy – at least in theory. You install a new sound card in place of your old one, and it comes with a DirectX driver. Next time you play your favourite game you can still hear sounds and music, and you haven’t had to make any complex configuration changes.

Originally, DirectX began life as a simple toolkit: early hardware was limited and only the most basic graphical functions were required. As hardware and software has evolved in complexity, so has DirectX. It’s now much more than a graphical toolkit, and the term has come to encompass a massive selection of routines which deal with all sorts of hardware communication. For example, the DirectInput routines can deal with all sorts of input devices, from simple two-button mice to complex flight joysticks. Other parts include DirectSound for audio devices and DirectPlay provides a toolkit for online or multiplayer gaming.

DirectX versions
The current version of DirectX at time of writing is DirectX 9.0. This runs on all versions of Windows from Windows 98 up to and including Windows Server 2003 along with every revision in between. It doesn’t run on Windows 95 though: if you have a machine with Windows 95 installed, you’re stuck with the older and less capable 8.0a. Windows NT 4 also requires a specific version – in this case, it’s DirectX 3.0a.

With so many versions of DirectX available over the years, it becomes difficult to keep track of which version you need. In all but the most rare cases, all versions of DirectX are backwardly compatible – games which say they require DirectX 7 will happily run with more recent versions, but not with older copies. Many current titles explicitly state that they require DirectX 9, and won’t run without the latest version installed. This is because they make use of new features introduced with this version, although it has been known for lazy developers to specify the very latest version as a requirement when the game in question doesn’t use any of the new enhancements. Generally speaking though, if a title is version locked like this, you will need to upgrade before you can play. Improvements to the core DirectX code mean you may even see improvements in many titles when you upgrade to the latest build of DirectX. Downloading and installing DirectX need not be complex, either.

Upgrading DirectX
All available versions of Windows come with DirectX in one form or another as a core system component which cannot be removed, so you should always have at least a basic implementation of the system installed on your PC. However, many new games require the very latest version before they work properly, or even at all.

Generally, the best place to install the latest version of DirectX from is the dedicated section of the Microsoft Web site, which is found at www.microsoft.com/windows/directx. As we went to press, the most recent build available for general download was DirectX 9.0b. You can download either a simple installer which will in turn download the components your system requires as it installs, or download the complete distribution package in one go for later offline installation.

Another good source for DirectX is games themselves. If a game requires a specific version, it’ll be on the installation CD and may even be installed automatically by the game’s installer itself. You won’t find it on magazine cover discs though, thanks to Microsoft’s licensing terms.

Diagnosing problems

Diagnosing problems with a DirectX installation can be problematic, especially if you don’t know which one of the many components is causing your newly purchased game to fall over. Thankfully, Microsoft provides a useful utility called the DirectX Diagnostic Tool, although this isn’t made obvious. You won’t find this tool in the Start Menu with any version of Windows, and each tends to install it in a different place.

The easiest way to use it is to open the Start Menu’s Run dialog, type in dxdiag and then click OK. When the application first loads, it takes a few seconds to interrogate your DirectX installation and find any problems. First, the DirectX Files tab displays version information on each one of the files your installation uses. The Notes section at the bottom is worth checking, as missing or corrupted files will be flagged here.

The tabs marked Display, Sound, Music, Input and Network all relate to specific areas of DirectX, and all but the Input tab provide tools to test the correct functioning on your hardware. Finally, the More Help tab provides a useful way to start the DirectX Troubleshooter, Microsoft’s simple linear problem solving tool for many common DirectX issues.

BandWidth Explained

Most hosting companies offer a variety of bandwidth options in their plans. So exactly what is bandwidth as it relates to web hosting? Put simply, bandwidth is the amount of traffic that is allowed to occur between your web site and the rest of the internet. The amount of bandwidth a hosting company can provide is determined by their network connections, both internal to their data center and external to the public internet.


Network Connectivity

The internet, in the most simplest of terms, is a group of millions of computers connected by networks. These connections within the internet can be large or small depending upon the cabling and equipment that is used at a particular internet location. It is the size of each network connection that determines how much bandwidth is available. For example, if you use a DSL connection to connect to the internet, you have 1.54 Mega bits (Mb) of bandwidth. Bandwidth therefore is measured in bits (a single 0 or 1). Bits are grouped in bytes which form words, text, and other information that is transferred between your computer and the internet.

If you have a DSL connection to the internet, you have dedicated bandwidth between your computer and your internet provider. But your internet provider may have thousands of DSL connections to their location. All of these connection aggregate at your internet provider who then has their own dedicated connection to the internet (or multiple connections) which is much larger than your single connection. They must have enough bandwidth to serve your computing needs as well as all of their other customers. So while you have a 1.54Mb connection to your internet provider, your internet provider may have a 255Mb connection to the internet so it can accommodate your needs and up to 166 other users (255/1.54).


Traffic

A very simple analogy to use to understand bandwidth and traffic is to think of highways and cars. Bandwidth is the number of lanes on the highway and traffic is the number of cars on the highway. If you are the only car on a highway, you can travel very quickly. If you are stuck in the middle of rush hour, you may travel very slowly since all of the lanes are being used up.

Traffic is simply the number of bits that are transferred on network connections. It is easiest to understand traffic using examples. One Gigabyte is 2 to the 30th power (1,073,741,824) bytes. One gigabyte is equal to 1,024 megabytes. To put this in perspective, it takes one byte to store one character. Imagine 100 file cabinets in a building, each of these cabinets holds 1000 folders. Each folder has 100 papers. Each paper contains 100 characters - A GB is all the characters in the building. An MP3 song is about 4MB, the same song in wav format is about 40MB, a full length movie can be 800MB to 1000MB (1000MB = 1GB).

If you were to transfer this MP3 song from a web site to your computer, you would create 4MB of traffic between the web site you are downloading from and your computer. Depending upon the network connection between the web site and the internet, the transfer may occur very quickly, or it could take time if other people are also downloading files at the same time. If, for example, the web site you download from has a 10MB connection to the internet, and you are the only person accessing that web site to download your MP3, your 4MB file will be the only traffic on that web site. However, if three people are all downloading that same MP at the same time, 12MB (3 x 4MB) of traffic has been created. Because in this example, the host only has 10MB of bandwidth, someone will have to wait. The network equipment at the hosting company will cycle through each person downloading the file and transfer a small portion at a time so each person's file transfer can take place, but the transfer for everyone downloading the file will be slower. If 100 people all came to the site and downloaded the MP3 at the same time, the transfers would be extremely slow. If the host wanted to decrease the time it took to download files simultaneously, it could increase the bandwidth of their internet connection (at a cost due to upgrading equipment).


Hosting Bandwidth

In the example above, we discussed traffic in terms of downloading an MP3 file. However, each time you visit a web site, you are creating traffic, because in order to view that web page on your computer, the web page is first downloaded to your computer (between the web site and you) which is then displayed using your browser software (Internet Explorer, Netscape, etc.) . The page itself is simply a file that creates traffic just like the MP3 file in the example above (however, a web page is usually much smaller than a music file).

A web page may be very small or large depending upon the amount of text and the number and quality of images integrated within the web page. For example, the home page for CNN.com is about 200KB (200 Kilobytes = 200,000 bytes = 1,600,000 bits). This is typically large for a web page. In comparison, Yahoo's home page is about 70KB.


How Much Bandwidth Is Enough?

It depends (don't you hate that answer). But in truth, it does. Since bandwidth is a significant determinant of hosting plan prices, you should take time to determine just how much is right for you. Almost all hosting plans have bandwidth requirements measured in months, so you need to estimate the amount of bandwidth that will be required by your site on a monthly basis

If you do not intend to provide file download capability from your site, the formula for calculating bandwidth is fairly straightforward:

Average Daily Visitors x Average Page Views x Average Page Size x 31 x Fudge Factor

If you intend to allow people to download files from your site, your bandwidth calculation should be:

[(Average Daily Visitors x Average Page Views x Average Page Size) +
(Average Daily File Downloads x Average File Size)] x 31 x Fudge Factor

Let us examine each item in the formula:

Average Daily Visitors - The number of people you expect to visit your site, on average, each day. Depending upon how you market your site, this number could be from 1 to 1,000,000.

Average Page Views - On average, the number of web pages you expect a person to view. If you have 50 web pages in your web site, an average person may only view 5 of those pages each time they visit.

Average Page Size - The average size of your web pages, in Kilobytes (KB). If you have already designed your site, you can calculate this directly.

Average Daily File Downloads - The number of downloads you expect to occur on your site. This is a function of the numbers of visitors and how many times a visitor downloads a file, on average, each day.

Average File Size - Average file size of files that are downloadable from your site. Similar to your web pages, if you already know which files can be downloaded, you can calculate this directly.

Fudge Factor - A number greater than 1. Using 1.5 would be safe, which assumes that your estimate is off by 50%. However, if you were very unsure, you could use 2 or 3 to ensure that your bandwidth requirements are more than met.

Usually, hosting plans offer bandwidth in terms of Gigabytes (GB) per month. This is why our formula takes daily averages and multiplies them by 31.

12/27/09

Tutorial 3:Moving an Object in a Rectanguler Path

After knowing the basic flash co-ordinate system, now we are going to move an object in a rectangular path, the easiest one among the closed paths.
Let's assume the co-ordinates of the end point of the rectangle are (x1,y1),(x2,y1),(x2,y2) and (x1,y2) respectively.I hope that u can do a little arithmetic to find out the width and height of the rectangle and place it properly on the flash stage.If u can't ask me.
Draw an arrowhead so that u can see the rotation at each point and convert it to a movieclip. No need to give an instance name as we are going to place the action on the clip itself. Select the arrowhead and press F9 to bring in the script panel and attach the following script...


onClipEvent (load) {
// initialize the coordinate variables
var x1:Number = 200;
var y1:Number = 100;
var x2:Number = 500;
var y2:Number = 300;
//u can always change the numbers to create rectangles of
//different widh and height
// initialize two other variables
var i:Number = 0;
var j:Number = 0;
//set the speed
var speed:Number = 10;
//set the initial position of the arrow
this._x = x1;
this._y = y1;
}
onClipEvent (enterFrame) {
// set the conditin to move
if (this._x>=x1 && this._y<=y1) { this._x = this._x+speed; this._y = y1; this._rotation = 360; } if (this._x>=x2 && this._y>=y1) {
this._x = x2;
this._y = this._y+speed;
this._rotation = 90;
}
if (this._x<=x2 && this._y>=y2) {
this._y = y2;
this._x = this._x-speed;
this._rotation = 180;
}
if (this._x == x1 && this._y<=y2) { this._x = x1; this._y = this._y-speed; this._rotation = 270; } }

here is the movie


Test your movie.
Try to understand the conditional logic that is all important here.Questions and comments are welcome.

12/17/09

Tutorial 2: Angles explained

Angles



In Flash, positive angles are measured from the x-axis and are rotated in a clockwise

direction as shown in Figure 1. Angles of rotation are measured in degrees (0 to

360). Negative angles (0 to –360) are measured in a counterclockwise direction from

the x-axis. The rotation of an object is about its registration point.




Figure:1 Measuring angles in Flash




Unfortunately for many of us and especially those working with ActionScript, there is another unit of angle measurement called radians. A long time ago, some Greek wasthinking about circles and said to himself, “Suppose I have an arc of a circle that isequal in length to the radius of the circle. I’ll call the angle that the arc makes a radian.I wonder how many of those make up half a circle. Wouldn’t it be nice if the number were a whole number?


Figure2: One radian of a circle



It certainly would have been nice if three or four made up a semicircle but alas, it was

not to be. It turned out that a little more than three radians make up a semicircle. The

Greeks found that the number is about 3.14159 and is often written as the Greek let-

ter p. Flash refers to this number as Math.PI so that you don’t have to remember it in

order to use it.

“That’s interesting,” you may be thinking, “but why should I care about any of this?”

The reason is that while most of us feel comfortable measuring angles in degrees, the

folks who write software such as Flash prefer to measure angles in radians. So, like it

or not, we often need to bounce back and forth between degrees and radians.

The following equations provides the necessary formulas that you will need for converting from one to the other. Note that there are 360 degrees or 2p radians in a circle. Try to learn them

if you can or write them down on your hand or just refer to these equations when you

need them.


Degrees to radians: angleInRadians = angleInDegrees * ( Math.PI/180 )

Radians to degrees: angleInDegrees = angleInRadians * ( 180/Math.PI )




In the next tutorial we'll move an object in a rectanguler path.That's easy.



 





12/14/09

Tutorial -1: Coordinate Systems

Action scripting in flash requires something more than the knowledge of the language. For any type of movement controlled by action script there is some math and some physics involved and one must have a clear understanding of it. Don’t worry it is never a lot at the beginning but something we can’t avoid and I think better we start with some basic math and some basic trigonometry. Let’s Start with the coordinate systems…… This is the first thing that a new learner has to understand

Coordinate Systems

Coordinate systems provide a way of laying out and measuring space. Probably the most common are Cartesian coordinate systems, named after the French mathematician and philosopher Rene Descartes(“I think, therefore I am”). If you have ever used a grid, you are already familiar with them. A Cartesian coordinate system is simply a set of equally spaced horizontal and vertical lines (a grid), with a horizontal axis called the x-axis and a vertical axis called the y-axis. The left graphic in Figure 1 shows a standard coordinate system. The monitor screen provides a convenient place for such a coordinate system, and we will refer to these as the screen coordinates.

Fig 1: Examples of Cartesian Coordinate Systems

Flash Coordinates and Screen Coordinates

Flash also uses a Cartesian coordinate system, shown in the right graphic of Figure 1, albeit one which is a little strange until you get used to it. In order to position objects in Flash, we will need to use Flash coordinates rather than screen coordinates. The origin or (0,0) point in the screen coordinate system is typically located in the center of the Flash Stage, and it is often convenient to use this. The origin of the Flash coordinate system is located in the upper-left corner of the Stage as shown. The main difference in the two systems is the vertical y-axis. In the screen coordinate system, positive y-values are up, while in the Flash coordinate system, positive y-values are down. To see what the transformation from the screen coordinate system to the Flash coordinate system is, let’s look at a simple example. Figure 2 shows a corresponding point in both coordinate systems.



Fig 2: Screen Coordinates and Flash Coordinates

So we can simplify it as

· If any object is moving from left to right it’s X-value is increasing

· If it is moving from right to left its X-value is decreasing.

· A downward movement means increase in Y-value

· Upward movement means decrease in Y-value.

· For any negative value of X and Y the object is placed outside the stage at the left or top respectively.

· For any positive value greater than the width and height of your stage the object will be placed outside the stage at right or at the bottom respectively.

Simple enough ha!