Search This Blog

Wednesday, February 8, 2012

Understanding Microsoft Windows and Timers


Windows is not a real-time operating system. Real-time operating systems have timer mechanisms that allow the system to make hard guarantees about when timer-initiated events occur and the overhead associated with them, and allow you to specify what behavior should occur when the deadline is missed -- for example if the previous execution took longer than the interval.
I would characterize the Windows timers as "best effort" when it comes to smaller intervals. When the interval is sufficiently long you don't notice that you aren't getting the exact interval that you requested. As you get closer and closer to the resolution of the timer (the frequency at which the timer runs), you start seeing the overhead as a percentage of the interval increase. Real-time systems take special care to minimize the software overhead, relying on more sophisticated and faster hardware solutions. The exact frequency of the Windows timer depends on the timing services that the underlying hardware provides and so may differ from system to system.
If you have real-time needs -- and doing something every 50ms may fall into that category -- then you may need to look at specialized hardware and/or a real-time OS.

Tuesday, June 7, 2011

C# Graphics Object


Introduction


The main object on which you will perform the drawings is called a graphic. In most cases, this object is not readily available when you need it: you must request it from the object on which you want to draw or you must create it. Both operations are highly easy.
Getting a Graphic Object

In GDI+, a graphic object is based on a class called Graphics. This class is defined in theSystem.Drawing namespace. Before drawing, you should obtain a graphic object. Fortunately, every Windows control, that is, every object based on the Control class, automatically inherits a method called CreateGraphics(), which gives you access to the graphic part of a control. The syntax of theControl.CreateGraphics() method is:
public Graphics CreateGraphics();
As you can see, the CreateGraphics() method returns the Graphics object of the variable you call it from. Here is an example of getting the Graphics object of a form:
private void button1_Click(object sender, EventArgs e)
{
Graphics graph = CreateGraphics();
}
Another technique you can use to get the Graphics object of a control is to call theGraphics.FromHwnd() static method. Its syntax is:
public static Graphics FromHwnd(IntPtr hwnd);
Remember that this method is static. The argument passed to it must be a handle to the object whoseGraphics object you want to access. Every Windows control has a handle called Handle. Here is an example of using it to get the Graphics part of a form:
private void button1_Click(object sender, EventArgs e)
{
Graphics graph = Graphics.FromHwnd(this.Handle);
}
If you are using the Paint event of a window, it provides a readily available Graphics object from itsPaintEventArgs argument. You can access the Graphics object as follows:
private void Form1_Paint(object sender, PaintEventArgs e)
{
e.Graphics . . . 
} 
The Process of Drawing

Getting a Device Context

As mentioned above, before drawing, make sure you have a Graphics object, which depends on your approach to drawing. To actually perform the drawing, the Graphics class provides various methods adapted for different shapes. Each method used to draw something has a name that starts with Draw... Also, each method that is used to draw a known shape requires a Pen argument. Therefore, when drawing, your first decision will be based on the shape or type of figure you want to draw.
Two other pieces of information are particularly important with regards to any figure or shape you will need to draw: its location and dimensions.
The Origin of an Object

To keep track of the various drawings, the object on which you draw uses a coordinate system that has its origin (0, 0) on its top-left corner. If you are drawing on a form, this origin is positioned just under the title bar to the left:
The origin of the coordinate system and its axes
How you specify the values of the starting point of a shape or figure depends on the shape.

Android - A beginner's guide

Introduction
This tutorial is a starting point for developing Android apps. It will explain the very basics of the Android SDK (Software Development Kit) and how to use it with Eclipse. To understand this tutorial, you don't need to have any knowledge about programming in Java, but it might be helpful for further programming to understand the basics of object orientated programming. This tutorial explains Android beginners how to create an Android Project in Eclipse, work with resources, and create some first code. Setup Eclipse and the Android SDK If you don't already have a running environment to develop Android apps, follow the instructions at this link. Hint: PATH means the Path Environment Variable. In Windows, you will find it under "Control Panel/System/Advanced System Settings/Environment Variables" in the lower list box. You can check what version of Java is installed, by going in the command line and typing java -version.

Covers the basics of Android application development (you don't even need an Android phone).
http://www.codeproject.com/KB/android/AndroidGuide.aspx


This message was created by The Code Project

Monday, June 6, 2011

Popular Operating Systems' Hardware Requirements


The hardware requirements on different Windows Operating Systems

Windows 7 Hardware Requirements:
·CPU 1GHz(32 bits OR 64 bits)。
·1GB Memory(32 Bits);2GB(64 Bits)。
·16GB Hard Drive(32 Bits);20GB Hard Drive(64 Bits)。
·Support WDDM 1.0 or higher DirectX 9

Saturday, July 3, 2010

A showcase of sites using HTML5 markup

Growing pains afflict HTML5 standardization: Listening to marketing messages from companies such as Apple and Google, one might think HTML5, the next-generation Web page standard, is ready to take the Net by storm.

Check this showcase of sites using HTML5 markup
click the link here ➠ http://html5gallery.com/

Friday, July 2, 2010

HTTP Secure (http vs https)

As opposed to HTTP URLs which begin with "http://" and use port 80 by default, HTTPS URLs begin with "https://" and use port 443 by default.

HTTP is insecure and is subject to man-in-the-middle and eavesdropping attacks which can let attackers gain access to website accounts and sensitive information. HTTPS is designed to withstand such attacks and is considered secure against such attacks (with the exception of older deprecated versions of SSL).

Wikipedia Referenced

Wednesday, June 30, 2010

New Features in HTML 5

Some of the most interesting new features in HTML 5:

  • The canvas element for drawing
  • The video and audio elements for media playback
  • Better support for local offline storage
  • New content specific elements, like article, footer, header, nav, section
  • New form controls, like calendar, date, time, email, url, search