Saturday, September 17, 2011

Things to do after installing Ubuntu 11.04

1. Unity or gnome classic

After installation Ubuntu 11.04 starts up with Unity style.
If you not like Unity style, switch back to gnome classic.

Here's how to:
At the bottom of login screen there is a tab, from where you can choose the style you want.

2. Install updates

Just type in terminal:
sudo apt-get update && sudo apt-get upgrade
 
 

Thursday, September 8, 2011

Html layers containing Flash swf object

Today, i bumped into a problem. I was trying to make 2 layers, one containing an swf object. The swf object displays on top of all layers regardless of z-index.
So i googled around and found that the transparent parameter must be set to the object.


Example:
   

Sunday, July 17, 2011

PHP Function to Check URL

The following PHP function is used to check if the URL exists. This php function will monitor the http requests and returns the header information. This function is very useful when you are validating the given URL

function checkUrl($url) {
$root = _getRoot($url);
$ctx = stream_context_create(array(
'http' => array(
'max_redirects' => 5, // allows 4 redirects :/
'timeout' => 5,
)
));
$fp = @fopen($url, 'r', false, $ctx);
$ret['success'] = false;
if (! $fp) {
return $ret;
}
$ret['locations'] = array();
$ret['metaData'] = stream_get_meta_data($fp);
fclose($fp);
// analyze HTTP headers
foreach ($ret['metaData']['wrapper_data'] as $line) {
if (preg_match('@^Location: (.*)$@i', $line, $m)) {
if ($m[1][0] === '/') {
// root-relative URI
$m[1] = $root . $m[1];
} elseif (strpos($m[1], '://') >= 4) {
// full URL
$root = _getRoot($m[1]);
}
$ret['locations'][] = $m[1];
}
if (preg_match('@^HTTP/1\.[01] 200@i', $line, $m)) {
$ret['success'] = true;
}
}
return $ret;
}

function _getRoot($url) {
list($proto, $url) = explode('://', $url, 2);
list($host) = explode('/', $url, 2);
return $proto . '://' . $host;
}



var_export(checkUrl('http://microsoft.com/ie'));

// outputs

array (
'success' => true,
'locations' =>
array (
0 => 'http://www.microsoft.com/ie',
1 => 'http://www.microsoft.com/ie/',
2 => 'http://www.microsoft.com/windows/internet-explorer/default.aspx',
),
'metaData' =>
array (
'wrapper_data' =>
array (
... abunch of HTTP headers
),
'wrapper_type' => 'http',
'stream_type' => 'tcp_socket/ssl',
'mode' => 'r+',
'unread_bytes' => 3478,
'seekable' => false,
'uri' => 'http://microsoft.com/ie',
'timed_out' => false,
'blocked' => true,
'eof' => false,
),
)



Check these out

http://hungred.com/how-to/php-check-remote-email-url-image-link-exist/

http://w-shadow.com/blog/2007/08/02/how-to-check-if-page-exists-with-curl/

Saturday, July 16, 2011

Cool WEB

http://pelfusion.com/tools/26-worth-knowing-php-tools-resources-for-web-developers/
http://www.webdesignerdepot.com/2011/07/30-creative-qr-code-business-cards/
Create Rounded Corners with CSS3 Border-Radius Property

247 Hand Drawn Web Icons Free for Download

http://www.webappers.com/2011/03/24/css-modal-box-without-javascript-or-images/

http://www.webappers.com/2011/02/24/tutorial-on-how-to-send-text-messages-with-php/

http://www.webappers.com/2011/02/17/how-to-create-css-drop-shadows-without-images/

http://www.webappers.com/2011/02/15/avactis-2-with-visual-css-editor-visual-layout-editor/

http://www.webappers.com/2011/02/10/html5-game-framework-for-touchscreens-browsers/

http://www.webappers.com/2011/01/24/jquery-file-upload-with-upload-progress-bar/

http://www.webappers.com/2011/01/17/videojs-html5-video-player-with-pure-css-skins/

http://www.webappers.com/2011/01/07/how-to-work-with-new-web-technologies/

http://www.webappers.com/2010/11/24/20-things-i-learned-about-browsers-and-the-web/

http://www.webappers.com/2010/11/18/offline-learning-pack-for-jquery/

http://www.webappers.com/2010/11/09/ajax-file-uploader-with-progress-bar-drag-drop/

http://www.webappers.com/2010/10/21/how-to-create-html5-forms/

http://www.webappers.com/2010/10/06/add-notes-to-any-images-with-jquery-notes/

http://www.webappers.com/2010/10/01/240-flag-icons-in-every-size-you-need/

http://www.webappers.com/2010/09/23/pure-css-progress-bar-with-javascript-for-animation/

http://www.webappers.com/2008/11/11/free-glossy-modern-web-browsers-icons-download/

http://www.webappers.com/2010/09/08/open-source-wysiwyg-html-editor-using-jquery-ui/

http://www.webappers.com/2011/06/10/html5-drag-drop-image-file-uploader-jquery-plugin/

http://www.webdesignshock.com/news/css3-guide-features-properties/

http://www.webdesignshock.com/news/gradients-property-css3/

http://www.webdesignshock.com/news/css-class-id-single-sprite/

MUST


http://webdesigneraid.com/7-html5-videos-to-learn-for-beginners/

http://www.webresourcesdepot.com/15-must-have-bookmarklets-for-web-designers-and-developers/

http://dev.opera.com/articles/view/custom-html5-video-player-with-css3-and-jquery/

http://www.photoshoplady.com/the-100-most-popular-photoshop-tutorials-2008/

http://www.pageresource.com/

http://designtutorials4u.com/15-must-have-resources-for-web-designers/


WhAT are

Friday, July 15, 2011

HTML clocks using JavaScript and CSS rotation

The two clocks below are just HTML. There are no Adobe Flash files or my beloved <canvas> going on, just regular <div> and <img> tags. The way it works is by taking those images in an { overflow: hidden } <div> and rotating them, via JavaScript, using the proposed CSS transform property.

HTML clocks using JavaScript and CSS rotation

Wednesday, May 18, 2011

3.3 - Konstruktor es Destruktor

Egy osztaly konstruktorai harom kategoria sorolhatok

- alapertelmezett(implicit)
- masolo(copy)
- mas konstruktor

3.2 - Statikus tagok

Az alabbi pelda szemlelteti a statikus tagok deklaraciojat, definiciojat es hasznalatat.

#include 
using namespace std;

class InstanceCounter{
 private:
  static int counter; //Deklaracio
  int i;
 public:
  InstanceCounter(int _i=0) : i(_i){counter++;}
  ~InstanceCounter(){counter--;}
  static int getCounter(){return counter;}
};

int InstanceCounter::counter=0; //Definico

int main(){
 cout<<"Peldanyszam" << InstanceCounter::getCounter() << endl;
 InstanceCounter o1 o2 o3;
 cout<<"Peldanyszam" << InstanceCounter::getCounter() << endl;
 InstanceCounter * p = new InstanceCounter(10);
 cout<<"Peldanyszam" << InstanceCounter::getCounter() << endl;
 delete p;
 cout<<"Peldanyszam" << InstanceCounter::getCounter() << endl;
 return 0;
}

3.1 - Implicit parameterek

Pelda:
Datum(int ev=0,int ho=0, int nap=0){
// stb
}

3.0 - Osztalyok es Objektumok

Minden programozas nylev rendelkezik egy alapertelmezett tipushalmazzal es lehetoseget biztosit ennek felhasznaloi tipusok altali kiterjesztesere.
C nyelvben felhasznaloi tipust a struct  kulcsszoval vezethettunk be.
C++ nyelvben a struktura tipus is atalakul, nemcsak adattagokat, hanem metodusokat is tartalmazhat. Az osztalydeklaracio a class  kulcsszot es az osztalynevet tartalmazza. Pelda: class Alma;
Az osztalydefiniciot 2 forrasallomanyba szokas elhejezni. A fejallomanyban (.h) az osztaly definicio, az adattagokat illetve a metodus deklaraciokat tartalmazza es a metodusok definicioit egy C++ forrasfajlban szokas elhelyezni, ugy ahogyan a Stack modul eseteben is tetunk.
Pelda: datum.h
class Datum{
 private:
  int ev, ho, nap;
 public:
  Datum(int _ev, int _ho, int _nap);
};

Egy osztaly tagjai haromfele lathatosaguak lehetnek
- privat (private)
- vedett (protected)
- nyilvanos (public)

2.6 - Kivetelkezeles

Ma mar minden programozasi nyelvben jelen van. Tulajdonkeppen egyfele hibakezelez altalanositasanak is tekintheto.
Olyan hibakat oldhatunk meg vele, amit helyben nem lehet megszuntetni.
Egyik nagy elonye , hogy a hagyomanyos kodot es a hibakezelo kodot szetvalassza.
A C++ nylevben a kiveltelesemenyt jelenzni lehet egy primitiv tipusu valtozo segitsegevel.
class Error{...};
void f(){
   if(feltetel){
     throw Error()
   }
}

// kivetel lekezelese

try{
   f();
}catch(Error){
 // kiveltelkezelo blokk
}
Pelda: stack.h
#ifndef stack_h
#define stack_h
using namespace std;
 class Staxk{
  public:
   class Stack_Overflow{};
   class Stack_Underflow{};
   virtual void push(char)=0;
   virtual char pop()=0;

 };

 class Array_Stack : public Stack{
  private:
   char *s;
   int top;
   int max_size;
  public: 
   Array_Stack(int max_size);
   Array_Stack(const Array_Stack&);
   ~Array_Stack();
   void push(char c) throw (Stack_Overflow);
   char pop() throw (Stack_Underflow); 
 };
$endif

A fenti Stack osztaly egy absztrakt osztaly amely csak tipusdefiniciokat es fugvenydeklaraciokat tartalmaz, tehat tamogatja az absztrak adatipusokat, mivel nem ad meg semmi informaciot az adatok abrazolasara, illetve a muveletek implementaciojara vonatkozoan.
Az ilyen absztrakot osztalyokat feluleteknek is nevezzuk, mert feluletet biztositnak mas osztalyok szamara.
Erre epitjuk fel az Array_Stack konkrek osztalyt, amely az absztrakt osztaly konkret leszarmazotja lesz.
Az osztalyunknak ket konstruktora van az elso parameter nelkuli, a masodik a masolo konstruktor.
A C++ nincs automatikus szemetgyujtes ezert szuksegunk van a destruktorra, amely az objektum dinamikus helyfoglalasat semmisiti meg.

Pelad: stack.cpp

#include "stack.h"
#include 
using namespace std;

Array_Stack :: Array_Stack(int _max_size){
 max_size = _max_size;
 s = new char[_max_size];
 top = 0;
}

// masolo konstruktor
Array_Stack :: Array_Stack(Array_Stack & _as){
 this->max_size = _as.max_size;
 this->s = new char[max_size];
 this->top = _as.top;
}

// destruktor
Array_Stack :: ~Array_Stack(){
 //cout<<"\nDestructor: "<< this->max_size<<"\n";
 delete [] s;
}

void Array_Stack :: push(char c) throw (Stack_Overflow){
 if(top >= max_size) throw Stack_Overflow();
 s [top++] = c;
}

char Array_Stack :: pop() throw (Stack_Underflow){
 if(top == 0) throw Stack_Underflow();
 return s[--top];
}


A fenti kod a Stack_Array osztaly metodusait implementalja.
Pelda: test_stack.cpp
#include 
#include "stack.h"
#include 
using namespace std;

int main(){
 Array_Stack as(100);
 try{
  printf("\n%c", as.pop());
 }catch(Stack :: Stack_Underflow x){
  //cout<<"Stack_Underflow"<<"\n";
 }
 return 0;
}

2.5 - Dinamikus helyfoglalas

A dinamikus helyfoglalas futas kozben tortenik a memoria heap (halom) szegmenseben.
A valtozok kezelese ebben az esetben a programozo felelossege, a helyfoglalast a new , new[] operatorok vegzik mig a felszabaditast a delete, delete[] operatorok.

Pl:
int *a = new int; // helyfoglalas egyetlen egesz szamnak
*a = 10;
delete a; // felszabaditas

int *t = new int[10] // helyfoglalas egy 10 elemu egesz szamokbol allo tombnek
for(int i=0; i<10; i++)
   t[i]=10;
delete [] t; //felszabaditas

Van egy Datum osztalyunk, keszitsunk belole peldanyokat.
Datum *d = new Datum();
delete d;

// ebben az esetben kotelezo hogy letezen a Datum osztalyunknak
// parameter nelkuli konstruktora
Datum *td = new Datum[10];
delete [] td;

// a masodik megoldas letrehozni egy mutato tombot
// es abban egyenkent inicializalni az elemeket
int i;
Datum **d = new Datum *[10];
for(i=0; i<10; i++)
   d[i] = new Datum(2005,10,i+1);

for(i=0; i<10; i++)
   delete d[i];

delete [] d;

Tuesday, April 5, 2011

How To Use Phoenix Service Software To Recover Dead Nokia Phones

Things to be kept in mind before installing Phoenix Service Software:
  1. Remove Nokia PC Suite, Nokia Software Updater, Nokia Care Suite, Nokia Modem Drivers, Nokia Connectivity Drivers.
  2. Remove all other Nokia stuff from your system through Control Panel>Add/Remove Programs.
  3. Restart your PC.
  4. Do not connect your phone before installing Phoenix software.
  5. Now ensure you have no antivirus software or any other software running on your pc or in the system tray while you are using Phoenix. You should turn them off while using Phoenix. Make sure your system hasn’t got any hanging problem.
  6. Turn off your screensaver.
  7. Charge your phone battery to at least 50%. Although flashing takes only 8-9 minutes.
Installing Phoenix Service Software:
  1. Download Latest Version Of Phoenix Service Software
  2. If you have older version, no need to uninstall it the latest version will automatically replace it.
  3. Install the software. Be patient, it may take some minutes to install all the components.
  4. Don’t run Phoenix software now.
  5. Connect your Nokia handset to your pc with USB cable in PC Suite mode.
  6. Windows will start installing the connectivity drivers as soon as you connect the phone. Let it install completely.
Installing Firmware Files:
  1. If your firmware file is in .rar format, first extract it using WinRar on desktop.
  2. On desktop you will find .exe file of your firmware file.
  3. Install the exe file. It will install it to default location of C:\Program files\Nokia\Phoenix\Products\
    Be sure you install updated firmware. You cannot downgrade your phone’s firmware in BB5 phones which includes all new Nokia phones including N-Series.
  4. Phoenix allows downgrading but your phone doesn’t allow it as your phone has some special security built into it. So no use of trying it. You’ll get an error message.
  5. You can reinstall your current firmware also if you have its package. It is supported. It can also sometimes solve little issues.
  6. You can get latest firmware files for your phone just search the net.
Flashing Procedure [Updating to latest firmware]:
  1. Open Phoenix Service Software.
  2. Connect your phone in PC Suite Mode.
  3. In Phoenix, click File>Manage Connections.
  4. Now click New.
  5. Now select the type of cable you are using. If you are using DKE-2, CA-53 [N-Series] cable, select USB.
  6. Click Next. It will find your product and say FOUND. If it doesn’t find any, you can try changing your cable type by clicking Back.
  7. Click Next and then Finish.
  8. Now your cable type [USB] appears in the connection list. Select it. Click APPLY and then CLOSE.
  9. Now select File>Open Product.
  10. A list of RM code will open. Select your phone’s RM code. Like RM-133 for Nokia N73. Click OK
  11. Now select File>Scan Product.
  12. Your phone’s firmware info will appear at the extreme bottom of the Phoenix window.
  13. Now go to Flashing>Firmware Update.
  14. A window will open.
  15. On that window click Browse button [the one with three dots].
  16. A window will open with various products and various regions. Choose the region or country of your choice according to the language pack you want to install.
  17. Click Ok.
  18. Click Refurbish.
  19.  
  20. Now your actual flashing has started. Don’t touch your phone or press any button until the flashing has finished. Also don’t touch your data cable and your computer system.
  21. At the end Phoenix will tell you to remove your phone as the flashing has finished.
  22.  
  23. Now wait for your phone to reboot into latest firmware.
  24. The flashing procedure takes 8-9 minutes, a lot faster than Nokia Software Updater.
Flashing dead phones [Which show only white screen on startup]

Note: You can install any firmware in dead phones whether it is latest and or the old one.
  1. The procedure is the same for flashing Dead phones.
  2. Start Phoenix. Connect your phone with USB Cable [phone is off at this time].
  3. Click File>Open Product. Select your RM code from the window that appears. Click OK.
  4. Click File> Manage Connections. Select No Connection. Then APPLY and CLOSE.
  5. Now straight away click Flashing>Firmware Update.
  6. A window will open. Click on Browse button [the one with 3 dots].
  7. A window will open with various products and various regions. Choose the region or country of your choice according to the language pack you want to install.
  8. Check the option “Dead Phone USB Flashing”.
  9. Click Refurbish.
  10. Flashing has started.
  11. After some seconds flashing will pause asking you to turn your phone ON.
  12. Press POWER button of your phone until backlight comes up.
  13. Flashing will proceed.
  14. Your phone will automatically start when the flashing finishes. After finish you can safely remove your data cable from handset.
Important Note: If you want to install another update to your phone after a new firmware is released, first remove the previous version you installed in C:\Program files\Nokia\Phoenix\Products\ Just delete all the contents of Products folder before installing a new firmware.

Thanx for info: me.dhillon [me.dhillon@gmail.com] member, DotSIS, originally this is his work. Thanx.