Reset an old Nokia Mobiles

Posted in Uncategorized on August 20th, 2010 by phoenixdigital

Some useful sites for factory reset of old nokia phones.

I am normally reluctant posting up my IMEI code but this site actually worked when trying to reset an old Nokia 3100.

http://nfader.su/

and

http://www.bhatt.id.au/blog/nokia-mobile-phone-service-codes-activate-hidden-features/

Tags: , , , ,

Useful Android Applications

Posted in Android on August 18th, 2010 by phoenixdigital

System Settings
Curve Fish – Widget to put phone in silent/vibrate mode

Other
Flash Player – Hi Steve Jobs

Admin/Modding Utilities
ROM Manager – Allows quick swapping of firmwares
Titanium Backup – Backup of EVERYTHING (Required Root)
Root Explorer – File Explorer

GPS Apps
Runkeeper – Great App for tracking your excercise

Games/Entertainment
Unblock Me – Great Puzzle Game
Galcon – Strategy Game (Multiplayer)

Data Visualisation with Javascript or Flash

Posted in HTML & CSS, JQuery, Javascript on July 21st, 2010 by phoenixdigital

Great little time line viewer and other cool visualisations.

http://www.simile-widgets.org/

Serializing Mail Messages

Posted in C# Programming on July 13th, 2010 by phoenixdigital

Useful classes for serializing mail messages

http://nayyeri.net/how-to-serialize-a-mailmessage
and
http://gopi.codeplex.com/

Import/Export MySQL databases and other commands

Posted in MySql on June 16th, 2010 by phoenixdigital

Just a quick reminder of how to backup and restore MySQL databases.

1
mysqldump --opt -u [user_name] -p [database_name] | gzip > [backup_file].dump.gz

To restore

1
2
gzip -d [backup_file].dump.gz
mysql [database_name] < [backup_file].dump

To create a database

1
2
mysql -u root -p
create database [the_database_name]
Tags: , , , , ,

Javascript inArray functionality

Posted in Javascript on June 15th, 2010 by phoenixdigital

Some useful examples of prototyping functions in javascript. As well as an efficient method of searching the contents of an an array for a particular value.

From http://stackoverflow.com/questions/237104/javascript-array-containsobj thanks to Damir.

As others have said, the iteration through the array is probably the best way, but it has been proven that decreasing while loop is the fastest way to iterate in JavaScript. So you may want to rewrite your code as follows:

1
2
3
4
5
6
7
8
9
function contains(a, obj) {
  var i = a.length;
  while (i--) {
    if (a[i] === obj) {
      return true;
    }
  }
  return false;
}

Of course, you may as well extend Array prototype:

1
2
3
4
5
6
7
8
9
Array.prototype.contains = function(obj) {
  var i = this.length;
  while (i--) {
    if (this[i] === obj) {
      return true;
    }
  }
  return false;
}

And now you can simply use the following:

1
2
alert([1, 2, 3].contains(2)); // => true
alert([1, 2, 3].contains('2')); // => false
Tags: , , ,

.NET Execution Order

Posted in C# Programming, VB .Net Programming on June 6th, 2010 by phoenixdigital

When a page is loaded the execution order is

1
2
3
4
5
Page_Init(object sender, EventArgs e) {}
Page_Load(object sender, EventArgs e) {}
Page_DataBind(object sender, EventArgs e) {}
Page_PreRender(object sender, EventArgs e) {}
Page_Unload(object sender, EventArgs e) {}

http://support.microsoft.com/kb/305141

Tags:

C# Primitive Types

Posted in C# Programming on June 3rd, 2010 by phoenixdigital

Useful lookup of variable types available in c#

C# Type .Net Framework (System) type Signed? Bytes Occupied Possible Values
sbyte System.Sbyte Yes 1 -128 to 127
short System.Int16 Yes 2 -32768 to 32767
int System.Int32 Yes 4 -2147483648 to 2147483647
long System.Int64 Yes 8 -9223372036854775808 to 9223372036854775807
byte System.Byte No 1 0 to 255
ushort System.Uint16 No 2 0 to 65535
uint System.UInt32 No 4 0 to 4294967295
ulong System.Uint64 No 8 0 to 18446744073709551615
float System.Single Yes 4 Approximately ±1.5 x 10-45 to ±3.4 x 1038 with 7 significant figures
double System.Double Yes 8 Approximately ±5.0 x 10-324 to ±1.7 x 10308 with 15 or 16 significant figures
decimal System.Decimal Yes 12 Approximately ±1.0 x 10-28 to ±7.9 x 1028 with 28 or 29 significant figures
char System.Char N/A 2 Any Unicode character (16 bit)
bool System.Boolean N/A 1 / 2 true or false

Javascript escape all single and double quotes

Posted in Javascript on May 31st, 2010 by phoenixdigital

Global replace of ‘s and or “s

1
2
    value = value.replace(/\'/g, "&#39;");
    value = value.replace(/\"/g, "&#34;");
Tags: , , , , ,

Retrieve rows where count of linked items greater than zero

Posted in MSSQL on May 30th, 2010 by phoenixdigital

Say you have two tables where one is linked to the other by it’s ID or CODE and you only want to retrieve a list of Table1 items which have linked Table2 items. You also want to get the count of Table2 items for each.

Table1
id(int)
title(varchar)
another_id(int)

Table2
id(int)
table1_id(int)
title(varchar)
date_added(date)

1
2
3
4
5
6
SELECT t1.id, t1.title, count(t2.id)
FROM Table1 t1
JOIN Table2 t2 ON t2.table1_id = t1.id
WHERE t1.another_id = 32
GROUP BY t1.code, t1.title
HAVING count(t2.id) > 0

Now say you want a list of Table1 with the most recent Table2 item ONLY

1
2
3
4
5
6
7
8
SELECT       t1.*, t2.*
FROM         Table1 t1
INNER JOIN   Table2 t2
ON           t2.table1_id = t1.id
LEFT JOIN    Table2 t2later
ON           t2.table1_id = t2later.table1_id
AND          t2later.date_added > t2.date_added
WHERE        t2later.table1_id is null

Ref

Tags: , ,