Graphics in Turbo C/C++

Turbo C has a good collection of graphics libraries. If you know the basics of C, you can easily learn graphics programming. To start programming, let us write a small program that displays a circle on the screen.

    To run this program, you need graphics.h header file, graphics.lib library file and Graphics driver (BGI file) in the program folder. These files are part of Turbo C package. In all our programs we used 640×480 VGA monitor. So all the programs are according to that specification. You need to make necessary changes to your programs according to your screen resolution. For VGA monitor, graphics driver used is EGA.BGI or VGA.BGI.

Here, initgraph() function initializes the graphics mode and clears the screen. We will study the difference between text mode and graphics mode in detail latter.

Initializes the graphics system.Declaration:
void far initgraph(int far *graphdriver, int far *graphmode, char far *pathtodriver);Remarks: To start the graphics system, you must first call initgraph.

initgraph initializes the graphics system by loading a graphics driver from disk (or validating a registered driver) then putting the system into graphics mode.

initgraph also resets all graphics settings (color, palette, current position, viewport, etc.) to their defaults, then resets graphresult to 0.

*graphdriver: Integer that specifies the graphics driver to be used. You can give graphdriver a value using a constant of the graphics drivers enumeration type.

*graphmode : Integer that specifies the initial graphics mode (unless *graphdriver = DETECT). If *graphdriver = DETECT, initgraph sets *graphmode to the highest resolution available for the detected driver. You can give *graphmode a value using a constant of the graphics_modes enumeration type.

pathtodriver : Specifies the directory path where initgraph looks for graphics drivers (*.BGI) first.  If they’re not there, initgraph looks in the current directory.  If pathtodriver is null, the driver files must be in the current directory.  This is also the path settextstyle searches for the stroked character font files (*.CHR).

closegraph() function switches back the screen from graphcs mode to text mode. It clears the screen also. A graphics program should have a closegraph function at the end of graphics. Otherwise DOS screen will not go to text mode after running the program. Here, closegraph() is called after getch() since screen should not clear until user hits a key.

If you have the BGI file in the same folder of your program, you can just leave it as “” only. you need not mention *graphmode if you give *graphdriver as DETECT.

In graphics mode, all the screen co-ordinates are mentioned in terms of pixels. Number of pixels in the screen decides resolution of the screen. In the example 1.0,  circle is drawn with x-coordinate of the center 200, y-coordinate 100 and radius 150 pixels. All the coordinates are mentioned with respect to top-left corner of the screen.

Basic Shapes and Colors:

Now let us write a program to draw some basic shapes.


Here is the screenshot of output:

Here, circle() function takes x, y coordinates of the circle with respect to left top of the screen and radius of the circle in terms of pixels as arguments. Note that, in graphics, almost all the screen parameters are measured in terms of pixels.

Function outtextxy() displays a string in graphical mode. You can use different fonts, text sizes, alignments, colors and directions of the text that we will study later. Parameters passed are x and y coordinates of the position on the screen where text is to be displayed. There is another function outtext() that displayes a text in the current position. Current position is the place where last drawing is ended. These functions are declared as follows:

void far outtextxy(int x, int y, char *text);
void far outtext(char *text);

Circle, arc, pieslice are declared as follows:


  •  void far arc(int x, int y, int stangle, int endangle, int radius);
  •  void far circle(int x, int y, int radius);
  •  void far pieslice(int x, int y, int stangle, int endangle, int radius);


  • arc draws a circular arc in the current drawing color.
  • circle draws a circle in the current drawing color.
  • pieslice draws a pie slice in the current drawing color, then fills it using
    the current fill pattern and fill color.


  • (x,y): Center point of arc, circlew, or pie slice
  • stangle: Start angle in degrees
  • endangle: End angle in degrees
  • radius: Radius of arc, circle, and pieslice

Here, stangle and endangle are in degrees starting from the +ve x-axis in the polar coordinate system in the anti-clockwise direction. if stangle is 0, endangle is 360, it will draw a full circle. Refer this figure for clear idea: For the details of current color, fill color and fill patterns, refer the sections Lines and Colors.

Another basic shape that we come across is a rectangle. To draw a border, use rectangle with the coordinates of outline, to draw a square use rectangle with same height and width. drawpoly() and fillpoly() are two functions useful to draw any polygons. To use these functions, store the coordinates of the shape in an array and pass the address of array as an argument to the function. By looking at the output of the previous program, you can understand what drawpoly is. fillpoly is similar except that it fills in the shape with current fill color.


  • void far rectangle(int left, int top, int right, int bottom);
  • void far drawpoly(int numpoints, int far *polypoints);
  • void far fillpoly(int numpoints, int far *polypoints);


  • rectangle draws a rectangle in the current line style, thickness, and drawing color.
  • drawpoly draws a polygon using the current line style and color.
  • fillpoly draws the outline of a polygon using the current line style and color, then fills the polygon using the current fill pattern and fill color.


  • (left,top) is the upper left corner of the rectangle, and (right,bottom) is its lower right corner.
  •  numpoints:  Specifies number of points
  • *polypoints: Points to a sequence of (numpoints x 2) integers. Each pair of integers gives the x and y coordinates of a point on the polygon.

To draw a closed polygon with N points, numpoints should be N+1 and the array polypoints[] should contain 2(N+1) integers with first 2 integers equal to last 2 integers.

Let us study more about shapes latter. Here is some idea about colors. There are 16 colors declared in graphics.h as listed bellow.

BLACK:                  0
BLUE:                     1
GREEN:                  2
CYAN:                       3
RED:                          4
MAGENTA:              5
BROWN:                   6
LIGHTGRAY:           7
DARKGRAY:            8
LIGHTBLUE:            9
LIGHTGREEN:        10
LIGHTCYAN:          11
LIGHTRED:             12
YELLOW:                14
WHITE:                    15

To use these colors, use functions setcolor(), setbkcolor() and setfillstyle(). setcolor() function sets the current drawing color. If we use setcolor(RED); and draw any shape, line or text after that, the drawing will be in red color. You can either use color as defined above or number like setcolor(4);. setbkcolor() sets background color for drawing. Setfillstyle sets fill pattern and fill colors. After calling setfillstyle, if we use functions like floodfill, fillpoly, bar etc, shpes will be filled with fill color and pattern set using setfillstyle. These function declarations are as follows.


  •  void far setfillstyle(int pattern, int color);
  • void far setcolor(int color);
  • void far setbkcolor(int color);


  • setfillstyle sets the current fill pattern and fill color.
  • setcolor sets the current drawing color to color, which can range from 0 to getmaxcolor.
  • setbkcolor sets the background to the color specified by color.

The parameter pattern in setfillstyle is as follows:

 Names Value Means  Fill With…
EMPTY_FILL 0 Background color
SOLID_FILL 1 Solid fill
SLASH_FILL 4 ///, thick lines
BKSLASH_FILL 5 \\\, thick lines
HATCH_FILL 7 Light hatch
XHATCH_FILL 8 Heavy crosshatch
INTERLEAVE_FILL 9 Interleaving lines
WIDE_DOT_FILL 10 Widely spaced dots
CLOSE_DOT_FILL 11 Closely spaced dots
USER_FILL 12 User-defined fill pattern

Here is an example program with colors, pixels, bar, cleardevice etc. stdlib.h is used for random number generation. We have a function random(no), it returns a random number between 0 an no. The effect is by drawing random radius, random color circles with same center and random pixels. kbhit() function(defined in conio.h) returns a nonzero value when a key is pressed in the keyboard. So, the loop will continue until a key is pressed.

Thank you for reading!

Make Content look Impactful with different Web Design Techniques

One of the unanimous truths of the web world is that content is the king. However, in order to present this content in the best possible manner, it is important to implement contemporary web designs in the website. A content marketing strategy is incomplete without powerful web design as the World Wide Web is full of information and a website can scores good only if the relevant information is portrayed in unique pattern. Even professional web content writers can’t deny the fact that website designing forms an integral part of content marketing. Mentioned below are the famous website designing trends that compliment content marketing strategies, have a look.

Implementation of Responsive Website Design

The present day generation has shifted from PCs to tablets and Smartphones and thus it is important that a website adjusts its dimensions as per different devices. With Responsive Website Design, one can create a web portal that fits well in all devices. This helps the website in enhancing its reach to the targeted market. The increasing use of tabs and Smartphones for browsing internet has led to the popularity of responsive design. If a website fails to fit in the gadget of the prospects, they take half a minute to switch to another portal.

Conveying Message via Embedded Videos

Embedded videos are one of the latest web design trends prevailing in the cyber space. Visitors today want everything quickly; they don’t have time to go through the entire text and there comes the role of videos. Videos are interactive and conveying information via this medium is best for getting a hold on the visitor’s attention.

The Magic of Special Effects

As mentioned before, it’s all about presenting the information in a unique pattern and what can be better than a pinch of special effects. The best part is that with the emergence of CSS3 and HTML5, it has become easy to embellish the website with feature of visual effects. Lightbox, slideshows and interactive buttons are a few effects that can be implemented to enhance the content marketing strategy of a web portal.

Use of Minimalist and User-friendly Design

One can avail custom web design services for incorporating minimalist and user friendly outlook for the website. Yes special effects and videos do leave an impact on the viewers, but the more professional the content looks the more prospects turn into leads. One live example of minimalist and user friendly design is Tumbler. It’s simple, it’s professional and thus attracts maximum amount of targeted audience.

Increasing the Role of Social Media Integration

The rising popularity of social media is not hidden from anyone. Social media is one of the biggest players of internet marketing and therefore it is important to use it wisely. The use of share buttons is not new; it’s just that with the spinning wheel of time its use is increasing.

This makes it crystal clear that getting proper website design is as important as availing professional web content writing services. Irrespective of the device on which the user is browsing a website, he always wants a beautifully laid down content to please his eyes and comfort his knowledge hunger. With these new emerging wed designs, it will become easy for the websites to serve exactly what their visitors expect from them.

Finding the Right License Scheme for your Software

Software companies rely on license fees for their revenues. A number of different licensing schemes are available and each type has its advantages. The exact choice of licence scheme will depend on the target user and their way of deriving utility from the software. Below, you will find a detailed explanation of six types of license schemes. As a producer or consumer, knowledge of these different forms will assist you to choose what is right for your personal or organizational licence

1. License by user
License by user infers that only one person has authorization to use the particular software. The user may use different devices but no other user is allowed to use the same software. If there are many employees in an organization, everyone has to get their own license. License per user works well with web-based software that does not tie a user to a particular physical location.

2. License by installation
This is different from the license by user because it does not restrict the number of users that can use the software. Instead, it restricts the usage of the software to only one device. If the software installation happens on a laptop or a tablet and the licensing also happens for that device, then any person who accesses the device will be able to use the software. Sellers prefer this license model when they expect very little mobility of the user and the software. The scheme works best for software bought for personal use.

3. License by client
When the software deployment takes place in a server environment where there are many server-clients, sellers may opt to licence by client. In this case, all devices that connect to the server to use the software will need a license. In addition, it is common for sellers to issue a license for the server that clients connect to, in the organization.

4. No license fees
Sometimes software can arise out of a voluntary effort and the creators may not have an inclination to earn from their work. In other cases, companies choose to not to sell their software license in the hope that, they will recoup their production costs when they provide paid support. Most open source software use a no license fees scheme.

5. Licence by developer
Just as some businesses only deal with other businesses, some software only works by assisting other software developers to create solutions for their customers. Development tools and libraries are critical software development components. The person using these tools may be compelled to acquire a developer license; however, the resulting software sold to end users will not be part of the license by developer.

6. License by site
Sometimes an organization has many employees with a high staff turnover. It does not make economic sense to buy every staff a user license. In addition, some employees might be working remotely and therefore need more than the license by installation, since they use more than one device. Such organizations and businesses can opt to acquire site licenses if the software seller offers them. The license by site allows anyone within the unit that qualifies as the site, to use the software. In most cases site can mean a physical local or an organization. For example, with organization as the site, the license may allow everyone who is an employee to access to the software irrespective of his or her location.

The exact limits of the rights of usage given by a specific license will always depend on the license scheme used. By following the description of each license scheme listed above you will be in a good position to select what will work best for your organization. The right license affords you the support that you need to keep your devices and organization secure. For sellers, choosing the right license scheme gives you the right options of marketing your software to clients.

Levenshtein Distance Algorithm with C++

Those with some courses or computer classes may understand better. For example,

  • If source string is “transform” and the target string is “transcend”, then the distance is 4 because the last four letters “form” will each be substituted respectively with “cend”.
  • If one string is “string” and other is “song”, then distance is 3 (I replacement, 2 deletions)
  • If one string is “gotcha” and other is also “gotcha”, this distance is zero because no transformations are needed. The strings are already identical.

The greater the Levenshtein distance, the more distinct the strings are.

Levenshtein distance is named on its inventor, the Russian scientist Vladimir Levenshtein, who devised the algorithm in 1965. The property is also called edit distance sometimes.

The Levenshtein distance algorithm is widely used for:

  • Spelling check
  • DNA analysis (surprised??)
  • Plagiarism detection (You may hate it or love it ;) )
  • Speech recognition

The Algorithm Steps

Step Description
1 Set n to be the source string with a length equal to s
Set m to be the target string with a length equal to t
If n = 0, return m.
If m = 0, return n.
Initialize a matrix with 0..m rows and 0..n columns.
2 Let the first row elements be equal to 0,1,…,n (in order)
Similarly assign the first column to 0,1,…,m
3 Loop through each character of s (i from 1 to n).
4 In a sub-loop, iterate each character of t (j from 1 to m).
5 If s[i] and t[j] are equal, the cost is 0.
If s[i] doesn’t equate to t[j], the cost is 1.
6 Assign to cell d[i,j] of the matrix to be equal to the minimum of:
a. The value of field immediately above, plus 1: d[i-1,j] + 1.
b. The value of field immediately to the left plus 1: d[i,j-1] + 1.
c. The value of field diagonally above and to the left plus the cost: d[i-1,j-1] + cost.
7 After the processing steps (3, 4, 5, 6) are complete, the distance is that stored in the cell d[n,m] in the end.

The Code for C++

Win32 Multithreading and Synchronization


This tutorial will explain how to create and manage multiple threads in Windows. This is an advanced tutorial; the reader should be familiar with Win32 programming.
The need for responsive user-centric programs is a good reason to create programs that use multiple threads. By creating multiple threads, a program can seem to do many things at once (on a computer with more than one CPU, the program actually will do many things at once). For example, a word processor could have one thread that handles the painting of the processor’s window while another thread saves the document being typed every few minutes while yet another thread actively monitors the document for spelling errors all without forcing the user to wait while each task is completed.


On a single CPU Windows machine, all threads are kept track of and given a slice of processor time (usually a few milliseconds). Windows will cycle through the list it keeps, pausing and resuming each thread. Once a thread has used up its time on the processor, Windows will pause the thread, record its CPU registers (along with some other data), and, after restoring all its data, activate the next thread. Each thread has two priorities: base and dynamic. The base priority can be changed, however, it cannot be changed to have a priority higher than that of the parent thread. Dynamic priority is the same as the base priority, however, it can be raised or lowered by Windows. Windows chooses which thread to run next based on the thread’s dynamic priority. Naturally, threads with a higher dynamic priority run first.


Initially, every program gets one thread, known as the primary thread, which is created by the Windows Object Manager. The primary thread can be used to create child threads. To create another thread callCreateThread. CreateThread takes the following parameters:

If the first parameter is passed as NULL, the thread will get the default security descriptor. The second parameter allows you to set the initial stack size, you can pass 0 to give the thread the default stack size. The third parameter is a pointer to the function the thread should start executing. The fourth parameter holds any arguments you want to pass to the function. You can pass either a 0 or CREATE_SUSPENDED to the fifth parameter. If it is 0, the thread starts running as soon as it is created. If the value is CREATE_SUSPENDED, the thread will be created suspended and will not start running until you call ResumeThread. The last parameter is a pointer to a DWORD which will hold the unique ID of the thread, after it is created.

If a thread was created with the CREATE_SUSPENDED flag, you will want to call ResumeThread to start using it. ResumeThread takes the following parameter:

hThread is the handle received by CreateThread. To suspend the thread again, call SuspendThread:

Once again, hThread is the handle received by CreateThread.

While a thread is suspended, you may want to raise its base priority and then wake it again. A thread with a higher priority will get more processor time. To change a thread’s base priority, call SetThreadPriority:

nPriority can be one of seven values:

THREAD_PRIORITY_LOWEST Two levels below process
THREAD_PRIORITY_BELOW_NORMAL One level below process
THREAD_PRIORITY_ABOVE_NORMAL One level above process
THREAD_PRIORITY_HIGHEST Two levels above process

To retrieve a thread’s base priority level, call GetThreadPriority:

After you are done using a thread, you may want to terminate it. To do this, call ExitThread. ExitThread followed by a CloseHandle is the graceful way to shut down a thread. To immediately stop a thread, callTerminateThread. The specs of each function are:

Windows automatically calls ExitThread when a thread ends its function. dwExitCode is the exit code you want to pass. The exit code can later be retrieved using GetExitCodeThread:

The following is an example of how to use threads.


Picture this: a word processor program creates two threads, one to read a file and another to write to a file. Everything is fine at first, the first thread waits for the second to finish writing to the file before reading it. The two threads work happily, everything is fine as long as the writing thread always writes first. But one dark day, the reading thread reads the file before the writing thread writes to the file and the program fails. This is known as a race condition because both threads race to finish their file operation. The program will always fail if the reading thread wins the race. A race condition is the result of bad synchronization. Another problem is the dreaded deadlock. In a deadlock, both threads will wait for each other to finish but neither thread will finish until the other finishes first, causing them to become locked. The solution to this problem is to use one, or more, of the synchronization objects provided by Windows.

To gain ownership of any of the synchronization objects, a thread can use WaitForSingleObject, WaitForSingleObjectEx, WaitForMultipleObjects, or WaitForMultipleObjectsEx.

WaitForSingleObject allows a thread to suspend itself while it waits for ownership of one of the synchronization objects.

The second parameter is the amount of time, in milliseconds, the thread is willing to wait for the object before it returns. If the second parameter is set to INFINITE, the function will not time-out. If the second parameter is set to 0, the function will try to gain ownership of the object and return immediately, even if it didn’t gain ownership.

WaitForSingleObjectEx is the same as WaitForSingleObject except, it adds one more option: alert if I/O operation completes.

If the last parameter is set to true, the function will return when an asynchronous I/O operation completes.

WaitForMultipleObjects allows a thread to wait for multiple synchronization objects at once. It can be set to return when any or all of the objects become available.

If the third parameter is set to TRUE, the function will wait for all of the objects to become available. If the third parameter is set to FALSE, the function will wait for any of the objects to become available, the return value of the function will be the index to the handles array to let you know which object that has been obtained.

WaitForMultipleObjectsEx is the same as WaitForSingleObjectEx, except it allows you to wait for multiple objects.


Like all other synchronization objects, a mutex is created by the Windows Object Manager. Mutex is short for mutual exclusion, meaning that only one thread can own it at a time. Think of it as a sort of ticket, any thread holding the ticket gets to access whatever is being protected by the mutex. While the thread is doing its job, all the other threads wait. Once the thread is done, it gives the ticket away and the next thread can do what it needs to do while the other threads wait.

To create a mutex call CreateMutex:

The first parameter can be passed as NULL to obtain the default access rights. If the second parameter is set to TRUE, the creator of the mutex will have ownership first. The third parameter is optional, it can be used to easily identify the mutex.

To release the mutex after doing whatever needs to be done, call ReleaseMutex.

Only the thread that owns the mutex can release it. To destroy the mutex, call CloseHandle with the handle to the mutex.


A semaphore is useful when you want to only allow a limited amount of threads to access a protected resource at a time. With a mutex, only one thread can own it at any given moment. With a semaphore, multiple threads can own it at a time. Consequently, any thread can also destroy the semaphore. To create a semaphore call CreateSemaphore.

The first parameter is handled the exact same as the first parameter of CreateMutex. The second parameter sets the initial count of the semaphore, usually it’s set to the same value as that of the maximum count. The initial count cannot be less than zero nor greater than the maximum count. The third parameter sets the maximum count which limits the number of threads that can own the semaphore. The last parameter is handled the same way as that of CreateMutex. After a thread gains possession of the semaphore the initial count is decremented one. If the initial count reaches 0, no more threads can gain possession of the semaphore. The initial count is incremented after a thread releases the semaphore.

To release a semaphore, call ReleaseSemaphore.

The second parameter sets by how much the count should be incremented, usually this is 1. The third parameter holds a pointer to a variable that will be filled with the previous count, after ReleaseSemaphore completes.

Critical Sections:

A critical section is very similar to a mutex. A critical section can only be owned by one thread at a time, however, a critical section cannot be shared between processes, a mutex can. Because of this, a critical section works more quickly. To create a critical section, call InitializeCriticalSection; to own a critical section, call EnterCriticalSection; to give up ownership of a critical section, call LeaveCriticalSection; to destroy a critical section, call DeleteCriticalSection.

All of the functions require a pointer to the critical section object. You declare one like this:

Any thread that is of the process that created the critical section can destroy the critical section.


An event object is useful when you want to alert threads of an action occurring, a button being pushed for example. An event object is sent to all waiting threads. Call CreateEvent to create an event; call SetEvent to signal an event; call ResetEvent to turn the signal off. When an event is signaled, all threads that wait for it will receive it; when the event is not signaled, the threads will wait. You can also call PulseEvent to quickly signal and unsignal an event. This is useful in releasing the waiting threads.

CreateEvent takes the following parameters:

If the second parameter is set to TRUE, the event must be reset manually. If the second parameter is set to FALSE, the event will return to its unsignaled state immediately after a call to SetEvent. If the third parameter is set to TRUE, the event will be created and set to the signaled state. The last parameter is an optional name for the object.

SetEvent, ResetEvent, and PulseEvent are all called in the same way:

hEvent being the handle returned from CreateEvent.

The combination of a mutex and an event is a good way to avoid deadlocks. The following is an example of using the mutex and event synchronization objects.

Mouse Programming in Turbo C++

Mouse can be used in text mode as well as in graphics mode. Usually it is used in graphics mode. Hence we must first change over to graphics mode. In our program the function initgraph() is responsible for switching the mode from text to graphics. DETECT is a macro defined in ‘graphics.h’. It requests initgraph() to automatically determine which graphics driver to load in order to switch to the highest resolution graphics mode. The initgraph() function takes three parameters, the graphics driver, the graphics mode and the path to the driver file.

Once the driver has been loaded, initgraph() sets up the numeric values of the graphics mode chosen in the variables gd and gm respectively. Here we are assuming that the driver files are in the directory ‘c:\tc\bgi’. Hence the path passed to initgraph() is ‘c:\tc\bgi’

The various mouse functions can be accessed by setting up the AX register with different values (service number) and issuing interrupt number 51. The functions are listed bellow.

Interrupt Service Purpose
51 0

 Reset mouse and get status
Call with AX = 0
Returns:  AX = FFFFh If mouse support is available
Ax = 0 If mouse support is not available

51 1

 Show mouse pointer
Call with AX = 1
Returns: Nothing

51 2

 Hide mouse pointer
Call with AX = 2
Returns: Nothing

51 3

 Get mouse position and button status
Call with AX = 3
Returns: BX = mouse button status
Bit   Significance
0     button not pressed
1     left button is pressed
2     right button is pressed
3     center button is pressed
CX = x coordinate
DX = y coordinate

51 4

 Set mouse pointer position
Call with AX = 4
CX = x coordinate
DX = y coordinate
Returns: Nothing

51 7

 Set horizontal limits for pointer
Call with AX = 7
CX = minimum x coordinate
DX = maximum x coordinate
Returns: Nothing

51 8

 Set vertical limits for pointer
Call with AX = 8
CX = minimum y coordinate
DX = maximum y coordinate
Returns: Nothing

 Let us consider a program which makes use of the above functions.

  The above program makes use of the following functions:

  • callmouse();
  • mouseposi();
  • mousehide(); 
  • setposi();

In this function AX is set to “1″. When this function is called in main() it displays the mouse pointer. The position of the pointer can be changed by using the mouse.

In this function AX is set to “2″.When this function is called in main() it hides the mouse pointer. This function is useful while drawing  figures, first the mouse pointer is kept hidden, then the figure is been drawn and again the mouse pointer is been called.

In this function AX is set to “3″. This function returns the position of the mouse pointer. It contains three parameters,they are xpos,ypos,click. xpos and ypos returns the position of x co-ordinate and y co-ordinate respectively. Click is the integer variable which returns the values 1,2,3 corresponding to the button pressed on the mouse and 0 for buttons being not pressed. If any key is pressed kbhit returns nonzero integer; if not it returns zero.

In this function AX is set to “4″. This function sets the mouse pointer to specific position . CX is been loaded by x co-ordinate of the mouse pointer and DX is been loaded with the y co-ordinate of the mouse pointer.

    Let us consider another program

The above program makes use of the following functions:

  • Horizontal();
  • Vertical(); 


In this function AX is set to “7″. Its sets the horizontal barrier for the pointer which restricts the mouse pointer to pass that limit. CX is been loaded with the minimum x co-ordinate and Dx is been loaded with the maximum x co-ordinate.

In this function AX is set to “8″.Its sets the vertical barrier for the pointer which restricts the mouse pointer to pass that limit. CX is been loaded with the minimum y co-ordinate and Dx is been loaded with the maximum y co-ordinate.

How Google Make Their Data Centers Better

Every second of the day, people all over the globe troll the Net with Google’s search engine, log into their Gmail accounts or use a host of other Google products. This means that the servers in the Google data centers are buzzing with activity 24/7 to support loads of services simultaneously. While they constantly look to develop their software, with programming luminaries like Jeff Dean producing innovative ways to handle immense data loads, the search engine leader has surged ahead of the competition on the hardware front too with innovative technology that uses fewer servers and serves more users while consuming less energy.
From simple to sophisticated strategies, Google shows the way for other industries to adapt best practices in running not just data centers but entire businesses. The company serves as an exemplary business model for running super-efficient systems and processes across its data center

Efficiency is Key
High performance with less energy is Google’s strategy to reduce the environmental impact of the company, as well as the users of its products and services.  Its data centers consume only half of the energy used by conventional data centers. This is achieved through smart engineering to provide as robust a platform to work from as possible.

Among other sensible practices, Google has custom servers, runs its operations at 80 degrees F, and takes advantage of outdoor air for cooling. With energy-efficient processes, Google has minimised its energy usage down to 12% for non-computing tasks, such as power conversion and cooling. The greater share of energy consumption is directed to power the equipment that services Google products and searches.

Renewable Energy Sources
Currently, over one third of Google’s operations are powered by clean, renewable energy sources. The company has contracted with renewable energy producers over the long term to purchase power from wind farms close to some of its data centers.

Google has also committed to projects that tap into renewable energy, investing over $1 billion in rooftop solar energy and extensive wind power sources. These initiatives have a potential capacity exceeding 2 GW, which can supply far more energy reserves than the enterprise requires. They can generate a total power equivalent to the energy consumption of over half a million homes.

Technological Edge
Aside from the macro scale of operations, Google also takes micro matters seriously in its overall efforts to achieve energy efficiency. Each server is supplied with its own on-board, lead-acid battery, providing an uninterrupted power supply (UPS). The independent battery assigned to each server contributes to a backup power supply system that’s evenly distributed across a data center.

With an optimised efficiency rate of 99.9%, this distributed model is superior to the centralised UPS setups of standard data centers. During unexpected power outages, the backup system ensures the least disruption in web services, continuing the power flow that’s critical to web-based businesses.

Google engineers also keep current with the latest technological developments, such as the coaxial cable responsible for the digital signal carrier interface to the data centers.

Industrial Ventilation and Temperature
A well-managed industrial ventilation is vital to the efficient operations of data centers. Google ensures optimal conditions of air flow circulation by applying computational fluid dynamics and thermal modelling methods. With a professionally built containment plan, incidences of mixing hot air with cold air and hot spots are reduced. Vacant slots in a rack are provided with metal sheets or blanking plates.

Google has dispelled the misguided 70 degree F requirement in data centers. It successfully maintains its facilities at 80 degrees F, the temperature allowed for cold aisles by the majority of equipment manufacturers. Using water and air-side economisers enables higher cold aisle temperatures, which provides free cooling days and saves energy.

Google’s research and development teams employ practical solutions to maintain the most efficient, energy-saving systems in all its facilities and locations.

New Website? 4 Reasons to Ignore Analytics for a Few Months

For Website administrators, having and using a Web analytics application is an absolute necessity. That’s how the thinking goes, anyway. Most wouldn’t dream of starting a Website, producing content, and making strategic decisions about the direction of the site without referring to data from their analytics app. To do so would be anathema.

But isn’t it healthy to question common assumptions? Shouldn’t we be loathe to blindly accept the “analytics make the Web go ’round’ dogma?
For the critical thinking Web administrators among us, here are four reasons new Websites may not need to collect any data about visitors– at least for the first few months.

  1. You don’t have any traffic.
    Our first reason is the most obvious. If your Website is new, it won’t have any traffic anyway. And if you don’t have any traffic, there’s really nothing to monitor.

For the first few months of your site’s existence, you should focus on activities that create traffic where before there was none. Producing great content, engaging an audience on social media, and demonstrating thought leadership are things that will bring visitors to your site over time.

On the other hand, scrutinizing the modicum of data collected by an analytics application during your Website’s infancy will be a waste of time. There simply isn’t enough data from which to learn much of anything.

  1. It’s a distraction.
    So it’s your site’s second week of life, and you’re already fiddling with Google Analytics. Know what that means? It means you’re not engaging in more productive activities that would give you a reason to use the analytics application in the first place.

Remember: Learning from data can be time-consuming, and most analytics applications monitor a lot of stuff.  When you don’t have any traffic, the time you spend “analyzing” those metrics is little more than a distraction.
And when you’re distracted, you’re not doing things that help your site.

  1. It slows your site down.
    This will be true whether your site is new with no traffic or mature with ample traffic, but there’s just no denying it: Google Analytics slows your site down, even if only a little bit.
    When your site has lots of visitors, however, it’s ok that the analytics app slows it down. Knowing where your traffic comes from and how well it’s converting are worth the trade-off of having your site run a bit more slowly.

But when your site is new, why slow it down for the few visitors who do somehow end up there? There’s not enough traffic from which to glean helpful data, and you’re putting a damper on the overall experience for those first new visitors and, hopefully, those who will become your first subscribers.
It’s just not worth it.

  1. A lot of it is hype.
    Question: How do you know your site is successful?
    If you’re selling a product, you should have some buyers. If you’re selling a service, you should be getting some clients. If you’re blogging, you should have a growing subscriber list. And so it goes.
    If those things are happening, you know your site is successful. You don’t need an analytics application to tell you that. It’s just… obvious.

That’s why analytics is, to an extent, a lot of hype. Sure, most companies should develop an analytics strategy that includes tracking particular metrics, measuring conversion rates, and using data to make decisions. Many small businesses and single-owner operations should, too – especially when they’re getting a lot of traffic.

But if you’re getting the business, the inquiries, or the subscriber numbers you’re after without fiddling with analytics, then you’re doing a good job. Analytics can tell you things that help you improve those numbers over time. However, in the beginning, the push to make decisions based on data could leave you more confused than enlightened.

The solution? Take a measured approach to analytics. Use metrics when you need them, and ignore them when you don’t. In the end, you’ll enjoy less stress – and more success – than if you went along with the hype.

Why Your Business Needs An App

Mobile apps are a great way for a small business to stay competitive and to grow. Many customers of a business will access information and often make a purchase from a mobile device. This means any type of business that is not actively seeking these customers is missing the boat. Apps are easy to access and are an additional form of online marketing when used correctly. A well designed mobile app will help a business in a number of ways.

Local Targeting

The use of social media check-ins and providing customers with offers is one main purpose of a mobile app for a small business. The app can be used to provide information and specials when in proximity to a business. Customers will be using a smartphone or tablet when on the go. This means businesses with a mobile app can target customers who are in a local area.

Gather Feedback

Customers who use a mobile app are a source of information for a business. Data that is collected gives a business insight into aspects that are working or need improvement. This includes business marketing and any current online promotions that are being offered. Collecting data from a mobile app is easier than other types of data collection, such as surveys and website analytics.

Brand Awareness

The use of a mobile app is a great way to create brand awareness and expand its reach. Businesses with a mobile app often help the popularity of a brand due to positive influence. However, the app will need to be regularly updated to ensure customers retain interest so the brand does not become stale. Apps for a brand tend to show users things they need to didn’t know they needed.

Customer Relationships

The ability to leave feedback about a purchase or comment about a product is a great way a business is able to build customer relationships. Another aspect of the customer relationship is offering specials or discounts to subscribers or users as a reward for their interest and patronage. Special deals can also be offered by scanning a QR code or when making a specific purchase. A customer who has installed an app for a business on their mobile device will have it available at all times of the day. Mobile apps will allow a business to better connect with customers and differentiate themselves from competitors.

Business Evolution

The evolution of a business needs to include adapting to current trends. A mobile app is a new way that a business is able to generate additional revenue and profit. Mobile apps are a great way to create other avenues for marketing to consumers. If a business is not actively developing a mobile app, then the use of traditional marketing methods may be ineffective.

Push Notifications

Updates can be sent to customers through a mobile app anywhere they are and at any time. Reaching a customer via push notifications is similar to text message marketing. However, the difference is a push notification allows a user to quickly launch an app. A text message will not have the same functionality as push notifications. Messages can be sent about an upcoming event or other type of update.

Read More : Download iRoot Apk

Entertainment Factor

Many users of a smartphone or tablet computer enjoy playing games and using an app that will offer an interesting and fun experience. Apps for a business do not need to be straightforward or even mimic the functionality of a web page. If an app appears boring, then it will most likely be uninstalled. The best way to keep customers engaged is to provide a solution to a problem or provide a unique experience.

Social Media

The use of social media is the current trend among adolescents and adults. This means that an app for a business needs to interact with various social media platforms. One way to do this is to include the Like button for Facebook and a link to send a tweet to Twitter.

Yahoo’s Security Breach Grows Worse

In December 2016, Yahoo revealed it had been hacked back in 2013. It was reported at the time that this security breach by an “unauthorized third party” saw the user data associated with 1 billion accounts stolen. However, it turns out that this epic hack was even worse than Yahoo thought.

This hack didn’t just affect 1 billion random Yahoo users. Instead, it hit every single Yahoo account that existed in August 2013. And there were 3 billion of them at the time. Let that sink in for just a minute: 3. billion. accounts. Making it the largest data breach in history. That we know of…

The Most Epic Security Breach Ever Recorded

Since Yahoo first disclosed the hack Verizon has acquired the company. During that acquisition new intelligence was uncovered that clued Yahoo into the fact it had underestimated just how epic this hack was. Rather than “just” 1 billion users being affected, all 3 billion users were caught up in it.

Yahoo has subsequently sent out a notice revealing the truth. The company states it now believes that “all Yahoo user accounts were affected by the August 2013 theft”. And Yahoo, now called Oath, has drawn this conclusion “following an investigation with the assistance of outside forensic experts”.

Thankfully, although the size of the security breach has been scaled up significantly, the information stolen has remained the same. Which means that “names, email addresses, telephone numbers, dates of birth, hashed passwords […] and, in some cases, encrypted or unencrypted security questions and answers” were stolen.

However, Oath (formerly Yahoo) is ultra keen to stress that no “passwords in clear text, payment card data, or bank account information” was stolen from its servers. This should be of some comfort to anyone who had a Yahoo account in 2013. Which is probably most people reading this right now.

Please Follow Yahoo’s Common Sense Advice

Oath has created a full page of FAQs related to this data breach. And this provides the common sense advice the company suggests you follow in order to safeguard your information. Which basically amounts to changing your passwords and security questions and answers for any and all Yahoo accounts, and, crucially, all other accounts that share the same or similar information.




1 2 3 4 5 52