Sunday, May 30, 2010

Love for All, Hatred for None


Love for All, Hatred for None is a self explanatory message that the world really needs these days. There is a discussion around about the lack of tolerance and excess of extremist view. Conflict between expectations and views is natural but the best practice is to control your emotions and just protest in a reasonable manner, but never try to abuse anyone.

To follow this message you are not supposed to be Muslim, Christian, Jew, Hindu etc, but the only requirement is humanity. Just take a look at these links and find people that are following this message in true manner since long.






Thursday, May 27, 2010

HP OpenView Alternatives

HP openview is a network management system of Hewlett Packard.

Here are few alternatives for this...
Nagios: Open source monitoring system for mac, linux and unix platforms.

OpenNMS: Open source monitoring system for linux platform.

Few more

Network operations center (NOC)

Network operations center is a centralized management, monitoring and control over IP based networks, broadcasts and telecommunication networks.

NOC continuously examines/monitors the networks and raise automated alarm to specific users and modules as mentioned in configuration. IP based networks are monitored by using SNMP protocol (http://www.net-snmp.org/),but it also supports CORBA and other protocols.
For power and environmental devices, a middle layer device is required to let NOC communicate with these devices.




On the go changing network profile settings for different adapters

When you have to use different network adapters at home, office or other locations, you change network adapter settings manually.

Netsetman is a great utility to perform this task instantly, with this you may change adapter settings with a single click.




Windows Notepad Alternative

Microsoft windows notepad is a simple application to create and edit text files.


http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/app_notepad.mspx?mfr=true

Here is an alternative for this...
EmEditor: I must say it handles files with text like a pro. They claim this
"From writing to programming, differentiate yourself with a fast, lightweight, extendable text editor for Windows!"


Microsoft Outlook Alternative

Microsoft Outlook is an email client but it also has other features like calender, contact organizer, task manager etc.


Here are few alternatives for this...

Thunderbird

Pegasus Mail

Barca

GMail

Opera

Zimbra Desktop

Pimero

Postbox

Spicebird



Microsoft Visual Studio Alternative

Microsoft visual studio is a development environment by Microsoft for the development of different languages and platforms including Windows, Mobile, Win CE, silverlight etc.
It has a great interface with extensive features, intellisense and easy integration with various softwares.

http://msdn.microsoft.com/vstudio
http://en.wikipedia.org/wiki/Microsoft_Visual_Studio

Here are few alternatives for this...

Visual Web Developer Express: A free version of visual studio for windows platform that just supports the development of web applications for .net framework.
http://www.microsoft.com/express/web/

Visual C# Express Edition A free version of visual studio for windows platform that just supports the development of Winform C# applications for .net framework.
http://www.microsoft.com/express/windows/

SharpDevelop A free open source IDE for windows platform for the development of C# and VB.net applications for .net framework.
http://www.icsharpcode.net/opensource/sd/

MonoDevelop IDE for windows,mac and linux platform for the development of C#, Java, Boo, Nemerle,C, C++, VB.net and Python.

Wednesday, May 26, 2010

Microsoft Office Alternative

Microsoft office is a product of Microsoft. It has business applications like Word, Access, Excel, power point etc.
http://office.microsoft.com/en-us/default.aspx

This runs on windows platform and is a commercial product, you may find price information at http://office.microsoft.com/en-us/products/FX101211561033.aspx

There is an open source alternative available named "OpenOffice".
http://www.openoffice.org/

This runs on windows, linux, sun solaris and mac operating systems. It has another specific version for MAC OS called "neooffice".
http://www.neooffice.org/neojava/en/index.php

Find controls of specific type

Find all controls of specific type by providing main control and complete type name.

public static void FindAllControlsByType(Control MainControl, string TypeName, System.Collections.ArrayList FoundControls)
{
// make sure it is ok to procees
if (MainControl == null || FoundControls == null)
return;

// iterate and search for required controls
foreach (Control child in MainControl.Controls)
{
if (child.GetType().ToString().Equals(TypeName))
FoundControls.Add(child);

// it may have nested controls
if (child.Controls.Count > 0)
FindAllControlsByType(child, TypeName, FoundControls);
}
}

Network Printers Common/Cartridge OIDs

Name = .1.3.6.1.2.1.1.5.0
UpTime = .1.3.6.1.2.1.1.3.0
Description = .1.3.6.1.2.1.1.1.0

Last Error = .1.3.6.1.2.1.25.3.5.1.2.1
Printer Status = .1.3.6.1.2.1.25.3.2.1.5.1

Black Cartridge = .1.3.6.1.2.1.43.11.1.1.8.1.1
Black Cartridge Remaining = .1.3.6.1.2.1.43.11.1.1.9.1.1

Cyan Cartridge = .1.3.6.1.2.1.43.11.1.1.8.1.2
Cyan Cartridge Remaining = .1.3.6.1.2.1.43.11.1.1.9.1.2

Magenta Cartridge = .1.3.6.1.2.1.43.11.1.1.8.1.3
Magenta Cartridge Remaining = .1.3.6.1.2.1.43.11.1.1.9.1.3

Yellow Cartridge = .1.3.6.1.2.1.43.11.1.1.8.1.4
Yellow Cartridge Remaining = .1.3.6.1.2.1.43.11.1.1.9.1.4

Video Analytics Technology (Computer Vision)

Video Analytics helps us to use video for extracting data, gestures, behavior, objects, trends or attitude. It has a wide range of applications including safety and security

Security: Following can be used at Airports, Railway stations, schools, ATM terminals or any area you want to have control and security.

  • Head counting
    • In/Out flow at shopping malls, airports etc
    • Rush hours management
  • Face detection/recognition
    • Restrict unauthorized access
    • Attendance system
  • Gesture recognition
    • Standing, Running, Fighting etc
    • If throwing/leaving some object
  • Density detection
    • Monitor if group of people exceeds specific limit
  • Motion detection
    • Monitoring specific area/entrance
    • Motion direction monitoring
    • Person entering/exiting secure area
  • Object detection
    • Abandoned object detection (gun, knife, etc.)
    • Theft detection
    • If object is static for more than specified time
  • Intrusion Detection
  • Fire/Smoke detection

Traffic

  • Automatic Number Plate Recognition (ANPR)
    • Tolling
    • Security & Monitoring
    • Stolen vehicle tracking
    • Traffic rules voilation management
    • Car parks
  • Vehicle counting
    • Peak hours management
  • Vehicle classification
  • Vehicle speed detection
  • Vehicle presence management
    • Intersection management
    • Parking space management
    • Traffic jam alerts
  • Accident/Incident monitoring
  • Lane violation monitoring
    • Rapid lane change
    • Wrong lane
  • Pedestrian monitoring
  • Automatic vehicle Identification

http://en.wikipedia.org/wiki/Video_analytics

http://en.wikipedia.org/wiki/Computer_vision#Recognition


Monday, May 17, 2010

Rotate Image by angle without change in scaling and quality

Rotate image by specified angle and output will create a new graphics area on which input image will be placed as rotated but its size, quality and scaling is not changed.

This is helpful when you want to output image in enlarged size while containing input image with its original size.

This will also take care about different DPI sizes while rotation, as images generated from different operating systems have different DPI values. Following will also sync. this with existing DPI capabilities...

You may also provide background color for output image.



public byte[] RotateImage(string imgFile, float rotationAngle, Color BGColor)

{

Image img = Image.FromFile(imgFile);

Bitmap bmpTemp;

Graphics gfx4DPI = Graphics.FromImage(new Bitmap(100, 100));

bmpTemp = new Bitmap(Convert.ToInt32(img.Width * gfx4DPI.DpiX / img.HorizontalResolution), Convert.ToInt32(img.Height * gfx4DPI.DpiY / img.VerticalResolution));

gfx4DPI.Dispose();

Graphics gfxTemp = Graphics.FromImage(bmpTemp);

//now we set the rotation point to the center of our image

gfxTemp.TranslateTransform((float)(bmpTemp.Width) / 2, (float)(bmpTemp.Height) / 2);

gfxTemp.RotateTransform(rotationAngle);

//start actual here

Bitmap bmp = new Bitmap(Convert.ToInt32(gfxTemp.VisibleClipBounds.Width), Convert.ToInt32(gfxTemp.VisibleClipBounds.Height));

gfxTemp.Dispose();

//bmpTemp.Dispose();

Graphics gfx = Graphics.FromImage(bmp);

Rectangle bgImg = new Rectangle(0, 0, bmp.Width, bmp.Height);

SolidBrush bgBrush = new SolidBrush(BGColor);

gfx.FillRegion(bgBrush, new Region(bgImg));

gfx.TranslateTransform((float)(bmp.Width) / 2, (float)(bmp.Height) / 2);

gfx.RotateTransform(rotationAngle);

gfx.TranslateTransform(-1 * (float)(bmpTemp.Width) / 2, -1 * (float)(bmpTemp.Height) / 2);

gfx.ScaleTransform((float)0.99, (float)0.99);

//set the InterpolationMode to HighQualityBicubic so to ensure a high

//quality image once it is transformed to the specified size

gfx.InterpolationMode = InterpolationMode.HighQualityBicubic;

//now draw our new image onto the graphics object

gfx.DrawImage(img, new Point(0, 0));

gfx.Dispose();

return imageToByteArray(bmp);

}

private byte[] imageToByteArray(System.Drawing.Image imageIn)

{

MemoryStream ms = new MemoryStream();

imageIn.Save(ms, System.Drawing.Imaging.ImageFormat.Gif);

return ms.ToArray();

}

Enable/Disable System Inputs (Keyboard/Mouse)

If you want to enable/disable you system input including mouse/keyboard, you may use "BlockInput" from user32.dll

VB6
Private Declare Function BlockInput Lib "user32" (ByVal fBlock As Long) As Long
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
'call following where requierd
'this will block input for 5 seconds
DoEvents
BlockInput True
Sleep 5000
BlockInput False

C#
using System.Runtime.InteropServices;

[DllImport("user32.dll")]
static extern bool BlockInput(bool fBlockIt);


Console.WriteLine(BlockInput(True));
System.Threading.Thread.Sleep(5000);
Console.WriteLine(BlockInput(False));