Technology Articles

The science of today is the technology of tomorrow. Browse Technology related articles.

Dot. NET Articles

Browse the Dot.NET technical articles.

Web Design & Development

Browse Web Design & Development Articles which includes Technologies of Drupal, Joomla, CodeIgnitor, JQUERY, CMS, etc.

Health Articles

Browse Health Tips & Articles

Showing posts with label Technology. Show all posts
Showing posts with label Technology. Show all posts

Wednesday, May 4, 2011

Handling Multiple Images Upload - PHP Mysql

First you need to create File Upload form,

Use the following html form,
<form method="post" action="" enctype="multipart/form-data">
Choose a file to upload : <input type="hidden" name="MAX_FILE_SIZE" value="100000"><input name="uploadedfile" type="file">
</form>

Tuesday, May 3, 2011

SSH and Screen - Useful Tips

Screen is very useful in running processes despite losing connection to remote server connected with SSH. The detached process could be attached to the terminal and we could continue the work at later stage. This will show you how to use screen utility.

On Debian and Ubuntu, you just run the following command to install screen.
apt-get install screen

Friday, February 11, 2011

World's First Programmable Nanoprocessor

While Studying at University, I had an opportunity to take up Nanotechnology as a Subject for my Final Year. I was also part of the Team which put up the First Nano Stall in Sri Lanka. Coming to the topic, No Microprocessors, Its *Nanoprocessors*.

Monday, October 11, 2010

Apache log4cxx framework - Example using Pthreads - Part Two

This blog post is continued from Apache log4cxx framework - Part One

This post comprises of a simple Configuration file and how it can be incorporated to a c++ code file for using the log4cxx framework.

Add the following simple xml Configuration file and name it as "MyLog4CxxConfig.xml"

<?xml version="1.0" encoding="UTF-8" ?>
 <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"> 

Sunday, October 10, 2010

Php Mysqli extension

The MySql Improved Extension, a.k.a mysqli is faster more improved version of existing mysql. It is available in PHP 5 or later versions. The source code of mysqli is available at ext/mysqli. For further information click here.
A simple example how to connect and insert temp data to database 'mydb' and table 'mytable'.
Lets add DbConnector.php first,

Apache log4cxx framework - Part One

I happened to work with Apache log4cxx, a logging framework for c++. This framework offers lot of capabilities from simply outputting a log message to console, writing to log files, socket streaming and database logging. Best thing that i love about this framework that it is Thread safe.

Apache log4cxx, You can download it here

Log4cxx comprises of three main parts,


1) Public Class Logger
- Top level entry point of Logger

Friday, April 23, 2010

How to TripleDES encrypt decrypt data? - Part Two


This post has reference to part one of this Article.

Inside our "TripleDESCrypt" class, lets implement another method to read the MD5 HashKey generated from the Secret Key from the User. This method will load the TripleDESKey.xml file and returns the HashKey in String format.

How to TripleDES encrypt decrypt data? - Part One


In this post, a simple demonstration of how TripleDES Encryption algorithm can be implemented using System.Security.Cryptography namespace in .NET will be explained.

First of all, we need to create a XML file where we will be storing our Special Key. This Key will be used for both Encryption and Decryption not like RSA. DES is symmetric key encryption algorithm.

Monday, April 19, 2010

How to RSA Encrypt Decrypt Data (C#) ?


This post has reference to part one of this Article.

Inside our "Crypt" class, lets include two more methods.



How to Generate RSA Encryption keys (C#) ?


In this post, Simple Demonstration of RSA Encryption Algorithm will be explained.

Here, we are going to make use of the System.Security.Cryptography namespace.

Friday, March 26, 2010

How to convert Image format programmatically (.NET) ?


To convert an Image from one format to another, use the following Method.
Here, the known formats include, Bmp, Emf, Exif, Gif, Icon, Jpeg, Png, Tiff, Wmf etc.


Tuesday, March 16, 2010

WCF and HTTP Error 404.3


Once you create a WCF Service from Visual Studio 2008 and after publishing to IIS, when you browse your Service, you will receive HTTP 404.3 Error. But you will not find any discrepancies in IIS Configuration of the Service.


Friday, March 12, 2010

Using LINQ to SQL Template - Part Two


This post has reference to part one of this Article.

Create a new Class with the name "MyLinq". We are going to use the DataContextFactory Class which we created in Part One. Also assume in our database we have Table with name "User" and with the following Definition.

Thursday, March 11, 2010

How to convert Dictionary List to XElement


XElement represents an XML element. This post will describe about how to convert Dictionary to XML Format.

Assume you want the XML to be in the following format,
<paramlist><param><key>1</key><value>100</value></param><param><key>2</key><value>150</value></param></paramlist>
The Dictionary is having <String, String> Format with Two Entries inside as shown below.
<key, 1>
<value, 100>

Wednesday, March 10, 2010

Using LINQ to SQL Template - Part One


LINQ to SQL is a component of the .NET Framework version 3.5. Click to learn more about LINQ to SQL

First of all, in your Project or Website, add a new item from the "LINQ to SQL" template. This will create a file with extention ".dbml" and code behind files. Now from Server Explorer, drag and drop the required Tables from the DB. At this point, we will be able to save the Server Connection String to connect to the Database automatically. If its a Web application, it will be saved in web.config and for Windows Project, it will be saved in Settings.settings file.

Monday, March 8, 2010

How to use QueryString


Assume we need to pass certain Variable content between html or aspx pages, often the Request object of QueryString is used. QueryStrings are combination of {key=value} pairs joined by '&' and added to the html or aspx page Url. This blog will explain in simple terms how to use QueryString.

Sunday, March 7, 2010

How to send Email using Gmail SMTP Mail Server


Assume our requirement is to send email from sender@gmail.com to receiver@gmail.com. Here we are going to use the configuration settings of Gmail SMTP mail server. Click here to get the Details of Gmail SMTP Mail Server Configuration.


How to load XML File and convert to Dictionary


Assume you have a XML file with the following format.

<paramlist><param><key>1</key><value>100</value></param>
<param><key>2</key><value>150</value></param></paramlist>



Thursday, March 4, 2010

Mobile Web Development Tips (xhtml)

Web Developing for mobile is not the same as developing a website for PCs. I have summarized some tips which might help any beginner which i have found during Mobile Web Development.


px to em conversion
In mobile web, a pixel difference is also crucial as the website is viewed in Mobile which will have a small screen width of 176px/240px/320px etc. In the CSS the best practice is to use .em as it is directly proportional to font size. The below given link is very useful to convert px to em.

dotMobi
The .mobi top-level domain is the ICANN approved top-level domain specifically for mobile devices. A sample Mobile Web, http://www.domain.mobi


How to Convert Datatable to XML programmatically


Lets assume our requirement is to create a Data Table and convert it to XML format. Use the following block code for your purpose.

DataSet myDS = new DataSet();
DataTable dtMyTable = new DataTable("preview");

DataColumn myCol0 = new DataColumn("facility");
myCol0.DataType = System.Type.GetType("System.String");
myCol0.MaxLength = 256;
myCol0.AllowDBNull = true;

DataColumn myCol1 = new DataColumn("doctype");
myCol1.DataType = System.Type.GetType("System.String");
myCol1.MaxLength = 256;
myCol1.AllowDBNull = true;

dtMyTable.Columns.Add(myCol0);
dtMyTable.Columns.Add(myCol1);
dtMyTable.AcceptChanges();

DataRow myNewRow = dtMyTable.NewRow();
myNewRow["facility"] = "MyFacility Works Great!";
myNewRow["doctype"] = "MyDocType Field Does Too!";
dtMyTable.Rows.Add(myNewRow);
dtMyTable.AcceptChanges();

myDS.Tables.Add(dtMyTable);

myDS.WriteXml(Server.MapPath("~") + "\\sample.xml");