post

Name of Country and their 2-Character Alphabetical Country Codes as PHP Key-Value array


Name of Country and their 2-Character Alphabetical Country Codes as PHP Key-Value array

March 2, 2009 at 00:43 – Files Under Programming, Uncategorized

 

Its quiet a tedious job when it comes to developing a dropdown input field in which the user have to select a county, as part of their address, Nationality, etc. Think if you have several of this fields in your form. When you want to change you have to change each and every one. More over, if you have to select one option depending upon user input or some database value, your will either have to have ‘if’ statement in every ‘<option>’ tag or use javascript to select the option when the page loads. As I am a lazy guy, decided to have an array containing the names of the countries as values and the 2 digit alphabetic country codes as key. Now you can see how easily you can add change and manipulate these select field.…

post

Online Photo Retouch With MugTug Darkroom


MugTug Darkroom is an online browser based application to retouch your photos. Its a simple application that gives your the basic features to retouch your photos. You can either upload a photo from your local disk or specify a url to an image (for example from picasa or flickr). Once you have finished editing your photo it can be download it to your local disk or save it at MugTug.

This application is very handy for people who travelling and have no access to an photo editing software. The application is cross browser compatible and hence accessible on Windows, Mac, Linux or any other OS that support the popular web browsers.…

post

USB Art Exhibision


Some very ingenious ideas that turned USB connectors into Art work. Images form such an exhibition.

Very creative. If it were a real USB drive, it will have a key lock access protection.

 

Male and female USB connectors. Perfect ring for couple.

 

 

One day we might have syringes that will inject date into human body.

 

You won’t forget the your USB drive if you tie your necktie.

 

Tin Can telephone

 

Connectivity around our waist

 

 

 

USB Razor?

 

Door Handle. Probably you need the encrypted password inside the USB for the door to open

 

Plug and dial telephone

 

 

 

Plug in your USB drive and step on delete to format the drive. He he

 …

post

Light weight, Opensource, Project Collaboration Software


Collabtive is a Project Management/Collaboration software that I have recently stumbled on. Its an open source, Light weight web application. What attracted me the most about this application is its elegant design. This is what many other applications in the same category is lacking. It has got all the essential features. Major features include:

  • Projects, Milestones, Tasks
  • Basecamp import
  • Timetracking, Reporting

Even if you are not dealing with a large project, it will be a good idea to use ‘Collabtive’ to define your mile stones and stick to the time frame.
A live demo of the application is available at http://collabtive.o-dyn.de/demo/

 

 

Main Page. Briefing on all activities

 

Projects

 

 

 

Project Calendar, an over view

 

Project Milestones

 

 

Documents and Files related with the project…

post

Things You Can Cook With The Microwave Oven

LG 28 L Convection Microwave Oven (MC2886BRUM, Black): Amazon.in ...

When you live a busy life and you don’t have time to cook at home, the microwave oven becomes indispensable. You can use it to warm your coffee or fast food, and you can even cook more recipes than you imagined using this versatile utensil in your kitchen.

    1. Quesadilla – fast and cheap. Pour some cheese on the tortilla chips and put them in the microwave. You can even add sauces for a unique taste.
    2. Baked potatoes – wash the potatoes and sting them with a fork. Cover them in a paper towel and put them in the oven. You will know what to do when the fork easily passes through the potato.
    3. Two eggs omelette – make sure they are well scrambled and put them in the oven until they are done
    4. Cake – how about a nice cake with the microwave? Many recipes can be ready in 10 minutes!
    5. Frozen vegetables – put the frozen vegetables in a bowl and leave them in the oven for a few seconds – you will have the ingredients for a delicious salad in minutes!
    6. Mashed potatoes – if you don’t like to cook, you can buy mashed potatoes made especially for the microwave
    7. Bacon – take a few slices of bacon, put them on a paper towel and put them in the microwave for a few minutes. You can make some great sandwiches with these and the paper towel will absorb the unhealthy fat.
    8. Popcorn – simple and easy to do, ideal for long Netflix sessions or other moments of relaxation.
    9. Pasta – you can even make pasta in the microwave! Put a bowl of water inside and leave it until the water boils. Remove the bowl, add the pasta and put the bowl inside again. Wait for a few moments, and there you go! The pasta is ready.
    10. Pizza – there is special pizza for microwave or you can even put your ingredients on a slice of bread.

  1. Corn – you can put corn into a wet paper towel and in the microwave at maximum power for three or five minutes until it becomes soft. You can eat corn with salt or butter.
  2. Dry plants – the microwave can be used if you want to dry plants, and it is the fastest method to do this. The plants maintain their flavour and the water is evaporated fast. Put a single layer of plants on a paper towel on maximum power and leave it like this for a minute. Make sure the plant won’t burn.
  3. Lemmon juice – if you want to get more lemon juice from a lemon, put it in the microwave for 10-20 seconds and leave it to cool. Cut the lemon in half and you will get more juice than the usual. You can do the same with orange and grapefruits.
  4. If you need to peel tomatoes or avocado, you can leave them in the oven at medium power for 5-10 minutes, until they make a crust. It will be a lot easier to peel them after.
post

Customize and Print Websites To Your Requirements With Print-What-You-Like

Have you ever had experience of print a website and getting a totally messy output? Most often what we need from a website is certain information but if we print it we get all the adds and menus printed out. Print What You Like is a solution for this. This is an online application that lets you customize what you want to print from a website. You can individual pick-out portions of the site and have it removed, resized, saved etc.

 

It also gives the option to remove background, images and borders in the site. It allows user to change the site font from a list of popular web fonts. The font size can be adjusted as well. If you have made a mistake don’t worry, it lets you undo and redo. Mouse over the website image and it automatically houselights the border of the component the mouse is over. Clicking highlights the entire html element under the mouse and brings up a popup menu from which we can choose a couple of options like Isolate, Resize, Remove, Widen, Save Clip and Select More.

post

How to Create and Handle an Array of Models or Objects in Codeigniter


In most object oriented programming situations we want to dynamically create varied number of instances(objects) of a specific class. Therefore its impossible to rely on predefined variable. The best solution is to use an array to hold the objects dynamically created.

Those of who are not familiar with codeigniter (CI) framework might ask why is it so difficult to populate an array with objects. In php its as simple as assigning a value to an array. In codeigniter the object class are called models and they can only be loaded with the CI load function. Once loaded, the loaded model/class becomes available(global) through out the controller class. This limitation makes it difficult to create an object as an array element.

Conventional PHP way of creating array of objects

/*
USER is class (a model in codeigniter). Not shown here.
*/

foreach($_REQUEST[‘users’] as $userid){
$usersArray[] = new USER($userid);
}
//example of using it
foreach($usersArray as $theUser){
$theUser->show();
}

Codeigniter work-around for creating variable number of objects dynamically

The code below creates a list of objects from a form post. You might be creating it differently.

/*
USER is a model
*/
foreach($_REQUEST[‘users’] as $userid){
$objectName = ‘u’.$userid; // each object is given a distinct name
$this->load->model(‘USER’, $objectName); // load the model with a distinct name
$usersArray[] = $objectName; //store the object/model names in an array.
}

‘u’ is included in case the userid does not start with an alphabet or an underscore. The custom model name must be in line with PHP variable naming conventions and rules.

This is an example of how you would be using the objects. The most important line of code is the 2nd line. In normal case the property within an object is called without the ‘$’ sign. Here what the compiler would do is to take the value withing the variable $this->theUser and the value is considered as a variable.

foreach($usersArrayas $theUser){
$this->$theUser->show(); // the value of the variable is considered as a variable. So its like a variable inside a variable
}

for example:
if ‘$this->theUser’ has the value ‘u1234′ then ‘$this->$theUser’ will be equal to ‘$this->u1234′.

If you have any questions to doubts feel free to ask me in the comment section. If You have a better solution or idea please be kind enough to share it.…

post

Russia Developes Fifth Generation Fighter, PAK-FA (T-50) to Counter US F22 and JSF (F-35)


The Sukhoi PAK FA ( Future Frontline Aircraft System), is a fifth generation fighter aircraft being developed by Sukhoi OKB for the Russian Air Force.

 

The current prototype is Sukhoi’s T-50. The PAK FA when fully developed is intended to replace the MiG-29 Fulcrum and Su-27 Flanker in the Russian inventory and serve as the basis of the Sukhoi/HAL FGFA project being developed with India. A fifth generation jet fighter, it is designed to directly compete with Lockheed Martin’s F-22 Raptor and F-35 Lightning II. The T-50 performed its first flight January 29, 2010. Sukhoi director Mikhail Pogosyan has projected a market for 1000 aircraft over the next four decades, which will be produced in a joint venture with India, two hundred each for Russia and India and six hundred for other countries.

 

General characteristics
Crew: 1
Length: 19.8 m (65.9 ft)
Wingspan: 14 m (46.6 ft)
Height: 6.05 m (19.8 ft)
Wing area: 78.8 m2 (848.1 ft2)
Empty weight: 18,500 kg (40,785 lb)
Loaded weight: 26,000 kg (57,320 lb)
Useful load: 7,500 kg (combat load) (16,534 lb)
Max takeoff weight: 37,000 kg (81,570 lb)
Powerplant: 2× New unnamed engine by NPO Saturn and FNPTS MMPP Salyut of 175 kN each[36][44] Prototype with AL-41F1 of 147 kN each, definitive version with new engine >157 kN
Maximum Fuel weight: 10,300 kg (22,711 lb)

Performance
Maximum speed: 2,600 km/h (Mach 2.45) (at 17,000 m altitude) (1,615 mph (at 45,000 ft altitude))
Cruise speed: 1,300 – 1,800 km/h (808 – 1,118 mph)
Ferry range: 5,500 km
Service ceiling: 20,000 m (65,616 ft)
Rate of climb: 350 m/sec (1184 ft/sec)
Wing loading: 330(normal) – 470(maximum) kg/m2 (67(normal) – 96(maximum) lb/ft2)
Thrust/weight: 1.4
Maximum g-load: +10.0/+11.0 g

 …

post

Rolltop computer with flexible OLED, a concept device by orkin-design


Rolltop Computer, is a portable stylized computing device that can act as a laptop, tablet, eReader or even a TV. It reminds one of a roll able aerobic mat with a strap that you can be carry around. The device comes with a flexible OLED display which also handles multitouch. When fully rolled out, it ends up as a 17″ flatscreen display. Folded, it can be used as a 13″ notebook/tablet. A portion of the display is used as a keyboard and the rest as dispay screen.

rolltop_computer_orkin_concept_back_blokeish

rolltop_computer_orkin_concept_notebook_blokeish

The device is composed of two parts. The flexible OLED display and a tower, on which the display is rapped around. The tower contains the power adapter, speaker, webcam and the USB interface.…

post

CSS Fundamentals, Margin, Border and Padding


The very basic of CSS is to know the properties common to all elements. Margin and padding are 2 important properties that determine how an element is displayed on the screen. It is very important so know how these properties work on different elements under different circumstances. Margin, padding and border are all what surrounds an element. So what are the differences? Margin and padding are invisible where as border can have any color. Read each in details.

marginborderpaddinglarge
Margi

Margin is the invisible space that an element can have around it that spaces it from surrounding elements. It is the outermost among margin, border and padding. The margin area cannot contain anything. It acts more like an invisible insulator for the element. All four margins can be independently defined.
Border

Border is the next property after margin in terms of position. Border helps to insulate an element visually. The border can have any color unlike margin and padding or colorless by not defining the color or by defining the color as transparent. All four margins can be independently defined.
Padding

Padding is the innermost among margin, border and padding properties. Padding defines how other elements are placed within an element. The background of the element starts after the border and is visible in the margin area.
Width

If not specified the width of most elements are dynamic. It will be automatically adjusted to contain the contents. ‘div’ element occupy the entire width of the parent element. If the width is not defined for an element then the total horizontal space the element will occupy includes the margin, border, padding and width of the contents. That is, the width is automatically adjusted to accommodate the margin, border and width. If the width is defined then the element will grow out when margin and border are defined. So the total horizontal volume will be the sum of width, border and margin.

NB: Width property doesn’t effect some elements like span tag () and anchor tag ()…