Dec
17
2008
2

How to install OpenOffice.org 3.0 in Linux Mint

This is pretty simple in the linux mint. (You usually already have OpenOffice.org 2.4 which comes by default, so this is more like an upgrade procedure)

You add the OpenOffice deb repository as this is not yet available from Ubuntu reps and do a mintUpdate which will quickly tell you what is ready to be updated. Here we go.

Step 1 – Add openoffice.org repository. To do this first open Synaptic Package Manger, Go to Setting>Repositories. Click new which will add new repository at the end of list. Add the following details as shown in screenshot for the new repository entry. Then press ok to save.

add-repository-mint1

Step 2: Open mintUpdate (Menu>Administration>mintUpdate) and click on Refresh, Which will now show all the updates for open office. Click installl updates

Written by Kishore in: Uncategorized | Tags: , , ,
Jul
17
2008
0

Retrieve items from Browser Cache (Firefox, Opera, IE)

Have you ever had to work on a live site and while uploading the changes something goes bad with whatever and your live copy gets deleted and that’s the only copy you have at the moment. (This can happen easily if you are using those file manager tools provided by hosting accounts which edit files in browser)

Anyway the quickest solution would be to get the files from the browser cache. If you have been testing the site simultaneously. I had to do this recently and it saved me lot of time and embarrassment. So here is how you can do it ….

On Firefox 3 (My favourite browser)

Type about:cache in address bar and voila you get access to all the cache. The view is functional and easy to use.


On Opera 9.5(Increasingly competing for my favourite browser spot, can even do that with one plugin like Firebug)

Type opera:cache in address bar and voila you go.. the best cache browser in the industry. Opera has some more cool features like SpeedDial.. anyway you can discover all that yourself by downloading it.

On IE 7. This takes just a bit longer. Click on Tools>Internet Options>Browsing History>Settings>View Files.. pretty logical huh!

Anyway it does the job…

Written by Kishore in: browsers, web development | Tags: , , , , ,
Jul
13
2008
0

A particular session variable’s value disappearing from $_SESSION in PHP

A particular session variable’s value disappearing from $_SESSION in PHP… ??

Just check to make sure you DON’T have register_globals turned On. This took me a few hour’s to figure out..

Example scenario..
Form Bean class

class FormBean
{
public $email;
public $name;
}

page1.php

$form = new FormBean();
$form->email = "someone@something.com.au";
$_SESSION['form'] = serialize($form);
header("location:page2.php");

page2.php

$form =NULL;
if(isset($_SESSION['form']))
{
$form = unserialize($_SESSION['form']);
}
echo $form->email;

Expected to print “someone@something.com.au” right. Usually it does. If it doesn’t and you see that all other session variables are intact except ‘form’, then it’s time to look at your ‘register_globals’ setting. One of my client uses this pretty lax hosting which had this on what it has done is ….

page2.php

$form =NULL; //This sets the form bean to NULL.. wherever it is stored. Throughout the entire website. (Even IN $_SESSION)

if(isset($_SESSION['form']))
{
$form = unserialize($_SESSION['form']);
}
echo $form->email;

So the lesson learnt for me was… Just check to make sure register_globals is Off whenever you switch to new hosting.. coz that is pure EVIL.

How you can turn it off.. There are two different ways.

  1. ini_set
  2. .htaccess

This also makes me feel that PHP’s OOP implementation is either misleading , buggy or at least fundamentally different to other OOP languages like Java or C#.

Consider this in Java:
FormBean.java

class FormBean
{
public String email;
}

TestFormBean.java

class TestFormBean
{
public static void main(String[] args)
{
FormBean form1 = new FormBean(); //Create new form bean
form1.email = "someone@something.com.au"; //populate form bean

FormBean form2 = form1; //Assign created form bean object to another reference variable
form1 = null;

System.out.println(form2.email);

//would still print "someone@something.com.au"
//i.e. Just setting one reference to NULL won't kill its object instance.

}
}

I have tested similar code with PHP though… I have only realised register_globals seems to affect the ways objects and their references are handled. Like setting one reference of an object to NULL killing the object instance, which essentially renders all my other references useless.

Written by Kishore in: php, web development | Tags: , ,
Jun
20
2008
0

Eclipse/RAD debugger timing out before starting server

Is your RAD/Eclipse Java debugger timing out before starting the server?

Have a gazillion projects in RAD/Eclipse which all have to be deployed in server for debugging all the time like I do?

There is an easy way to increase RAD/Eclipse debugger timeout.

  1. Go to Windows > Preferences > Java > Debug
  2. Increase both “Debugger time-out” and “Launch time-out” value to be much larger. Try values like 180000/360000 respectively for time-out values of 3 and 6 mins.

Full article at IBM

http://www-1.ibm.com/support/docview.wss?rs=2042&context=SSRTLW&context=SSJM4G&context=SSSTY3&context=SSCGQ7C&context=SSDV2W&uid=swg21212755&loc=en_US&cs=UTF-8&lang=en

Written by Kishore in: eclipse, java | Tags: , ,
Jun
12
2008
1

Recursively Delete files within all sub directories in DOS

Ever wondered how to delete files matching a certain patten from within all sub-directories in DOS (aka Windows).

Simple

At your command prompt type simply DEL /S *.ext
eg:
To delete all .bak files within D:Workspace

D:workspace>dels *.bak

But be careful.. there is no confirmation dialog.

Written by Kishore in: dos, tech | Tags: , , ,

Powered by WordPress. Theme: TheBuckmaker