Nov 5, 2010

Web page not opening even though Wifi and Internet is connected

I faced some problem like this last week. I opened my laptop after 2 days. I went my home in Kolkata 2 weeks back, and after returning I didn't get time to spend some time with my lappy. Finally when I opened, I was unable to connect to the internet. In the system tray wifi icon was glowing and it shows computer is connected to Wifi network. But no webpage was opening. I tried different browsers. Nothing worked. I tried to ping some IPs and all the packets were lost. I tried to ping local IPs like 192.168.1.1 and same result was shown. This seemed to me unusual. Even if you don't have internet connection, you'll be able to ping this IP if you're connected to Wifi network.

Finally I tried IP Config and I was my local IP is 192.168.0.1. I was sure it's showing something which is unusual. I opened the TCP/IP connection properties of Wifi Internet connection. It was showing that the IP address is manually assigned to my system (the option was selected). I reset the option and changed to "Automatically Obtain IP" option and it started working.

PHP serialize() Function

serialize

(PHP 4, PHP 5)

serialize — Generates a storable representation of a value

 Description

string serialize ( mixed $value )

Generates a storable representation of a value

This is useful for storing or passing PHP values around without losing their type and structure.

To make the serialized string into a PHP value again, use unserialize().

 Parameters

value

The value to be serialized. serialize() handles all types, except the resource-type. You can even serialize() arrays that contain references to itself. Circular references inside the array/object you are serializing will also be stored. Any other reference will be lost.

When serializing objects, PHP will attempt to call the member function __sleep prior to serialization. This is to allow the object to do any last minute clean-up, etc. prior to being serialized. Likewise, when the object is restored using unserialize() the __wakeupmember function is called.

Note:

Object's private members have the class name prepended to the member name; protected members have a '*' prepended to the member name. These prepended values have null bytes on either side.

 Return Values

Returns a string containing a byte-stream representation of value that can be stored anywhere.

 Examples

Example #1 serialize() example

<?php
// $session_data contains a multi-dimensional array with session
// information for the current user.  We use serialize() to store
// it in a database at the end of the request.

$conn odbc_connect("webdb""php""chicken");
$stmt odbc_prepare($conn,
      
"UPDATE sessions SET data = ? WHERE id = ?");
$sqldata = array (serialize($session_data), $_SERVER['PHP_AUTH_USER']);
if (!
odbc_execute($stmt$sqldata)) {
    
$stmt odbc_prepare($conn,
     
"INSERT INTO sessions (id, data) VALUES(?, ?)");
    if (!
odbc_execute($stmt$sqldata)) {
        
/* Something went wrong.. */
    
}
}
?>

 Changelog

VersionDescription
4.0.7The object serialization process was fixed.

 Notes

Note:

Note that many built-in PHP objects cannot be serialized. However, those with this ability either implement the Serializable interface or the magic __sleep and __wakeup methods. If an internal class does not fulfill any of those requirements, it cannot reliably be serialized.

There are some historical exceptions to the above rule, where some internal objects could be serialized without implementing the interface or exposing the methods. Notably, the ArrayObject prior to PHP 5.2.0.

Nov 4, 2010

Sometimes in the dream...

Sometimes in the dream I think of you...

You're so shapeless, that I can't assume you...

The night, the sleep and the silence when prevails

It's me who voyage, or it's someone else...

Oct 21, 2010

আমার বাড়ির ঠিক পরেই শহরের পূর্বভাগ এসে শেষ হয়। মাঝে প্রায় ৪-৫ কিলোমিটার বিস্তৃত মাঠ আর জলা জমি। সারাদিন-এর খাতাখাত্নি

Sep 7, 2010

Their work is really hard

Thousands of Labors are working in my office. They are constructing two more buildings inside the premises. They don't know anything about Information Technology. Still, they are the building blocks of IT industry. Their nights are horrible, like a nightmare. Water pours into the holes of their roof, and here we sleep comfortably. We've to think for them. Their compensation is not sufficient for what they do.

Jan 20, 2010

My First Month's Experience in TCS Siruseri

Don't know whether, I'm fortunate or not. Believe me, I've never been to such a large branch of company ever before. How could I? This is my first job. But Siruseri branch of TCS is really enough for a fresher. Before coming here, my definition of a IT Industry was different. Some computers, some brilliant programmers, and a little bit of professional gestures - that's all. But here, in Chennai the work-force is really interesting. And even more interesting is, the numbness of these work-force. A flow of busy yet silent Engineers, making a few thing out of nothing. Why? If you reach this place, you won't ask.

I was worried about my skills in PHP-MySQL. I was really afraid that I knew a little bit of Java. Again my stream is Java here. But, finally in my base branch I discovered, I know 'English' a lot. I can speak flawless. And even I know how to make a few out of nothing. Now a days, I really laugh at my college days. I don't really know, why I was taught more than 5 programming languages and 20+ theory papers. I'll never be asked to write some code, though I'm a sallaried Enginner. Hope, you understand my point.

Again, I'll say, I'm happy. Here in Chennai, my company, TCS has got loads of projects. However, I don't know, what the word 'projects' stand for. In these days, I realised that, the word 'consultancy' is more ambiguous. As of now, I believe, it's an act of discussing the solutions to a problem. Don't take me wrong. I never meant, it's also implementing the solutions. I think, you've started realizing that, you should leave this page now. You're really free to do that. Why? Again why? Simple. You're a blog reader, not an IT Professional. You can change your to-do's anytime.