Home » All
Space Shuttle Speed
How fast is a Space Shuttle?
By kingk (art. no 20)Space Shuttle Top Speed
Which is the Space Shuttle top speed?The Space Shuttle top speed is about 17 500 mph, 28 168 km/h.
The Space Shuttle top speed is 38 341 time slower than the light speed which is 671 080 888 mph.
C/C++ hex string to integer
How can i conver a Hex String to Integer in C++?
By kingk (art. no 19)Hex String to Integer C/C++
How to convert a C/C++ hex string to integer?There are no standard ansi functions to perform the data conversion from a hex string to integer.
The atoh function here listed can easily convert an Hex String to Integer.
int atoh(char * string, int size, bool reverse)
{
//By www.oldwildweb.com
unsigned int value = 0;
int char_val = 0;
int hchar_val = 1;
if (reverse == true)
for (int i = 0; i < size; i++)
{
if (string[i] == '0')
char_val = 0;
if (string[i] == '1')
char_val = 1;
if (string[i] == '2')
char_val = 2;
if (string[i] == '3')
char_val = 3;
if (string[i] == '4')
char_val = 4;
if (string[i] == '5')
char_val = 5;
if (string[i] == '6')
char_val = 6;
if (string[i] == '7')
char_val = 7;
if (string[i] == '8')
char_val = 8;
if (string[i] == '9')
char_val = 9;
if (string[i] == 'a' || string[i] == 'A' )
char_val = 10;
if (string[i] == 'b' || string[i] == 'B' )
char_val = 11;
if (string[i] == 'c' || string[i] == 'C' )
char_val = 12;
if (string[i] == 'd' || string[i] == 'D' )
char_val = 13;
if (string[i] == 'e' || string[i] == 'E' )
char_val = 14;
if (string[i] == 'f' || string[i] == 'F' )
char_val = 15;
value = value + (hchar_val*char_val);
hchar_val *= 16;
}
else
for (int i = size-1; i >= 0; i--)
{
if (string[i] == '0')
char_val = 0;
if (string[i] == '1')
char_val = 1;
if (string[i] == '2')
char_val = 2;
if (string[i] == '3')
char_val = 3;
if (string[i] == '4')
char_val = 4;
if (string[i] == '5')
char_val = 5;
if (string[i] == '6')
char_val = 6;
if (string[i] == '7')
char_val = 7;
if (string[i] == '8')
char_val = 8;
if (string[i] == '9')
char_val = 9;
if (string[i] == 'a' || string[i] == 'A' )
char_val = 10;
if (string[i] == 'b' || string[i] == 'B' )
char_val = 11;
if (string[i] == 'c' || string[i] == 'C' )
char_val = 12;
if (string[i] == 'd' || string[i] == 'D' )
char_val = 13;
if (string[i] == 'e' || string[i] == 'E' )
char_val = 14;
if (string[i] == 'f' || string[i] == 'F' )
char_val = 15;
value = value + (hchar_val*char_val);
hchar_val *= 16;
}
return value;
}
Usage example:
atoh("F0",2, true);
//Output: 240
grep recursive search
Linux grep recursive search
By kingk (art. no 18)Grep recursive search
How can I perform a recursive search with grep?Open a unix console and go into the folder where you want to search for with the cd command.
Now type
grep -R "string to search for" *
the -R argument means recursive search, the * is the file-name mask, you can for example search in all txt file with the mask *.txt.
Update Manager Hangs Ubuntu Debian
The update manager Hangs, how to solve
By kingk (art. no 17)Update Manager Hangs
The update manager utility is a very useful gui that allows to make the system up to date with an easy interface windows like. Sometimes it could hangs, to solve the bug you will have to run the upgrade commands manually logged as root on a linux console.Debian command:
apt-get update && apt-get upgrade
Ubuntu command:
sudo apt-get update && apt-get upgrade
Tags: Update manager hangs debian - Update manager hangs ubuntu
Php max get length
Apache and Php max get lenght
By kingk (art. no 16)Php max get length - Apache max Get Lenght
The max lenght of a GET variable is setted to 512 Bytes/Variable by default in all Php 5.x versions, while most browsers can support huge urls (with more than 2048 bytes depending on the browser version).To change the max get lenght parameter you can edit the related configuration file of Php5 under:
/etc/php5/apache2/conf.d/suhosin.ini
The lenght parameter is definited by the string:
suhosin.get.max_value_length = 512
The standard http url size is at least 8096 bytes, but most servers can use more.
Tags: Apache max Get Lenght - Php max get length - Max GET Lenght - Max Url Lenght
Warning session_start(): cannot send session cookie headers already sent by output started at
Common PHP errors
By kingk (art. no 15)Warning session_start(): cannot send session cookie headers already sent by output started at ...
This is one of the most common Warnings with CMS installations.Troubleshooting:
Check for those possible issues:
-File format (use always unix format with UTF-8 encode, choose those options with your favorite text editor)
-Do not leave blank space or chars before the ?php tag
-Don't use the ASCII file transfer mode with your FTP client, use the Binary mode instead.
FOX G20 gpio_dev Driver for kernel 2.6.38.3
How to enable the gpio_dev driver with FOX board G20 and the linux kernel 2.6.38.3
By kingk (art. no 14)FOX G20 gpio_dev Driver for kernel 2.6.38.3
This patch enables the gpio_dev driver in new Linux Kernels, the new driver use the unlocked_ioctl method instead of the old ioctl method (removed in new kernels), for more information about how the driver works visit the Acme System Gpio tutorial page (to use the patch in kernels newer than 2.6.38.3, replace the string: "2.6.38.3" with the correct kernel version in the patch file with any text editor).Linux commands
Download the kernel src
wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.38.3.tar.bz2
Extract the archive:
tar xvjf linux-2.6.38.3.tar.bz2
Open the kernel src folder
cd linux-2.6.38.3
Download the patch
wget http://www.oldwildweb.com/public/downloads/en/Linux/gpio-dev-kernel-patch-2.6.38.3
Apply the Patch
patch -p1 < gpio-dev-kernel-patch-2.6.38.3
Follow the Acme System Kernel compile tutorial: http://foxg20.acmesystems.it/doku.php?id=tutorial:compiling_the_linux_kernel_2.6.38.
Remember to Enable the GPIO Device as static module in the kernel configuration under: Device Drivers-> GPIO Support -> GPIO device support.
To avoid to recompile the kernel you can use the uImage and the lib files to upgrade your fox G20 SD.
Replace your uImage file with the new one in the kernelfs partition of your Fox G20 SD.
Replace all files under the /lib folder of the rootfs partition with new files.
On the next Fox G20 boot don't forget to use the comand
depmod -a
Kernel features:
-FAT32, NTFS, BTRFS, EXT2, EXT3, EXT4, ReiserFS and all other File System support.
-Moxa Uport1450 USB to 4 RS-232/422/485 devices (driver compiled as static module).
-All Acme Systems suggested features
Dev_gpio Kernel 2.6.38.3 patch
uImage.zip Kernel Image File
lib.zipDebian 64 bit squeeze how to install the Firefox flash plugin
How to install the Flash Plugin in Debian 64bit squeeze version
By kingk (art. no 13)Debian 64 Squeeze How to install the flash plugin for Mozilla Firefox 3.x, 4.0
1) Install the ia32-libs with the command
aptitude install ia32-libs
2) Download the flash plugin from: http://get.adobe.com/it/flashplayer/ (Select the .deb file for Ubuntu 8.04, save it somewhere).
3) use the command
dpkg -i --force-architecture install_flash_player_10_linux.deb
To install the plugin.
That's All!
Tags: How to install the flash plugin Debian 64 bit
Radiations conversion table
Radiations units, conversion table mRem REM to Sievert
By kingk (art. no 12)Radiation unit conversion table From mREM REM to Sievert
The Japanese nuclear disaster is a threath for all the countries that could be invested by radiation particles.
The only way to monitor the nuclear threath is the geiger counter: a type of particle detector that measures ionizing radiation. In order to use a Geiger counter you must be aware about radiation's measurement units. The standard is the Sievert.
The safe threshold for humans is of 80mREM/H or 800 uSv/h.
| xSv | 0.1 uSv | 1 uSv | 10 uSv | 100 uSv |
| xREM | 0.01 mrem | 0.1 mrem | 1 mrem | 10 mrem |
| xSv | 1 mSv | 10 mSv | 100 mSv | 1 Sv |
| xREM | 100 mrem | 1 rem | 10 rem | 100 rem |
Tags: mREM REM to Sievert mSievert uSievert - safe radiation threshold for humans healt
Multi-Client socket server example in C
Easy socket server example in C
By kingk (art. no 11)Easy Multi client socket server in C
In this article we have posted a very easy example of how to make a multi client socket server in C.
This software uses an array of no blocking sockets and a loop to manage connected clients.
The code is very simple to understand so we avoid to put comments on it
Multi Client Socket Server in CTags: Socket Client C - Multi Client Socket Programming C - Socket Programming C - Socket Server Programming C - A multi client socket server application example - Socket Server Linux - Socket Server Unix - Multi Client Server Unix Example - Socket Server Example Linux - Socket Server Programmin C - Multi Client C socket server Example - No blocking socket programming C - No blocking socket server example in C - No blocking Multi Client Socket server in C
Kill processes in C# .NET
A simple function to kill a proces by name in C# .NET
By kingk (art. no 10)With this simple function we can search for active processes and kill them in C# .net.
Usage: FindAndKillProcess("processname");
For example to kill the windows calc application it whould be:
FindAndKillProcess("calc");
//Required parameters:
using System.Diagnostics;
using System.ServiceProcess;
//Function code
public void FindAndKillProcess(string name)
{
Process[] processes = Process.GetProcessesByName(name);
foreach (Process proc in processes)
{
proc.Kill();
}
}
How is Italy
A funny video about how is italy and italians
By kingk (art. no 9)A funny video that will show some italian's habits.
Some are true other a little bit exaggerated.
Have fun!
Tags: How are italians - How italy is - How is italy
A Java Modbus server on TCP/IP example
Multi-client multi-thread Java Modbus Server on TCP IP example by Ugo Cirmignani
By kingk (art. no 8)The Modbus is a simple and free industrial protocol, there is an official (and very good) documentation about the protocol but there are no so many examples of how implement a Modbus server on tcp/ip.
In this article we provide a simple class to create a Java Modbus server on TCP/IP capable to use the Read Holding Register function.
The "Read Inputs Register" function can be used to read data from a Modbus server with a Modbus client, each register is composed of 2 bytes of data (by standard each register is a 16bit integer).
To use the class consider this example:
package simpleserver;
public class Main
{
public static void main (String args[])
{
try
{
ModbusServer mbs = new ModbusServer(502);
Thread t = new Thread (mbs);
t.start();
while (true)
{
System.out.println("The server is running..");
Thread.currentThread().sleep(10000);//sleep for 1000 ms
}
}
catch (Exception ex)
{
}
}
}
Java Modbus serverFree Google Sitemap Generator XML
A simple Freeware Google Sitemap Generator By Ugo Cirmignani
By kingk (art. no 7)This is a Free Google Sitemap Generator XML, is very usefull to improve your website indexing for the Google search engine.
For who are not aware about this topic a XML Sitemap is a list of all available web pages in a web site, this tool is able to generate xml sitemap files in just one click!
To send a sitemap to Google login in Google, go to the webmaster section and send the sitemap, your website indexing will be improved!
To use the software you have to:
1) Install it (The last .Net framework is needed by the application, if any error please download the last .Net framework from the Microsoft web site)
2) Open the main window and write the website url
3) Select the change frequency
4) Click on the Generate Sitemap button and wait
5) Save the sitemap file.
That's All
Author: Ugo Cirmignani
Free Google Sitemap Generator
Tags: Freeware Google Sitemap Generator XML - Google sitemap free - Google Sitemaps Free - How to generate a google sitemap - Improve website indexing - Google sitemap generator free
Html select with all usa cities
List of all usa cities in a html select form component
By kingk (art. no 6)Here's an html select with the list of all usa cities ordered by name.
HTML SELECT WITH ALL USA CITIESTags: All USA Cities - Html form with all usa cities
Copyright 2009
