( Index )

Brief Information about the June '10 CSIG Meeting

DigClock2010 - A Large Digital Clock Screen Saver   by B. Arnold


See page bottom
for an update on

Welcome to the CSIG, a Special Interest Group of the ACGNJ. This is an exciting time for the C Language programming since Microsoft now has several different language compilers: C++, C++ Express, C-Sharp, and C-Sharp Express. These are all capable of creating Windows (tm) programs. (Some are FREE!)

Here's a brief synopsis of this month's meeting:

For this month I have tried to create a useful screen saver based on very simple C++ Dot Net Programming. Previously (see Dec 2009) the Analog Clock screen saver was based on special mathematically formulas that created the geometry of the graphics. In the program for this month, there are no caluclations at all. In fact, there is almost no code at all. The complete screen saver is designed within the IDE design panel. As such, the number of design permutations are enormous. During the design, you may easily change Fonts, Size, Color, Layout, and Features without changing the code.

Here's how it works:
Within the design form there are a number of text boxes. A timer generates a program interrupt and reads the system clock. The clock data is parsed and sent to each of the text boxes. The result is shown in the picture above. All of the different fonts are determined by the properties of the text boxes.

There are a number of ways to refer to Microsoft's latest compilers and code. Here's what Wikipedia says: The Common Language Infrastructure (CLI) is an open specification developed by Microsoft that describes the executable code and runtime environment that form the core of the Microsoft .NET Framework. The specification defines an environment that allows multiple high-level languages to be used on different computer platforms without being rewritten for specific architectures.

Microsoft .Net Framework 3.5, etc.
C++ 9.0, etc.
.Net 3.5, etc.
Common Language Infrastructure

Sample Code

// // TIMER TRIGGERED EVERY 250 MILLISECONDS // private: System::Void timer1_Tick(System::Object^ sender, System::EventArgs^ e) { sender;e; DateTime ^localNow = DateTime::Now; Face->Text = localNow->ToString("h:mm"); FacePM->Text = localNow->ToString("tt"); FaceDate->Text = localNow->ToString("dd"); FaceDay->Text = localNow->ToString("dddd"); FaceMonth->Text = localNow->ToString("MMMM"); Cursor->Hide(); Refresh(); } // // KEYBOARD HIT - QUIT // private: System::Void Form1_KeyDown(System::Object^ sender, System::Windows::Forms::KeyEventArgs^ e) { sender; e; Close(); } // // MOUSE HAS MOVED MANY PIXELS - QUIT // private: System::Void Form1_MouseMove(System::Object^ sender, System::Windows::Forms::MouseEventArgs^ e) { sender; e; static Point lastposition = Point(0,0); static bool firstime = true; int x,y; if (firstime) // Skip the calculation that follows. firstime = false; else { x = System::Math::Abs(e->Location.X - lastposition.X); y = System::Math::Abs(e->Location.Y - lastposition.Y); if (x > 10 || y > 10) Close(); } lastposition = e->Location; }

Addendum: Air Log Recorder

The Air Log Recorder presented earlier this year has presented an interesting problem. It is supposed to detect ALL network cards but on some computers it failed. The problem seems to be my code in the "Initialize Net Counters" procedure. I stopped searching after I found a card. I should have continued searching the whole array in case there were other cards. I have updated the code and given it the name Csig1002B.zip.

Background: Air Log Recorder

Air Cards are becoming extremely popular these days especially with the advent of Netbooks. They combine the features of a Wireless Network Card and a Modem in order to communicate directly from the PC to the Cell Phone Tower. As such, they provide Internet access, browsing, and file transfer without needing the normal land-based Internet provider. They can be built into the laptop or pluged-in via a USB or PCMCIA port.

That's all well and good but there is a "down side". A friend has an Air Card from Verizon and it costs him 60 dollars per month. And ... (wait for it) ... he is only allowed to download 5 Gigabytes! There is a surcharge if he goes over that amount. There is also a plan that costs 40 dollars per month but that only allows data usage of 250 Megabytes. Other phone companies have similar costs. So here's the problem: how do you keep track of your usage in order to control your cost?

The object of this program is collect data about your network send and receive usage. (There's a screen shot HERE.) The program displays a real-time account of the current daily network activity as well as the total usage during the current month. At the March meeting (HERE), I present a program to also graph the historic data that has been collected. (Note: be sure to place the program in your "Start Up" folder.)

Additional Comment:
If you don't have an AIR CARD, the application can be used to monitor any network traffic on your computer. For example, my local network has transferred over 400 MegaBytes of data today. The bar graph is a speedometer showing the instantaneous speed of the network.


Source Code Files

For help, email me at b a r n o l d @ i e e e . o r g
Back to C++ Main Page