Saturday, May 22, 2010

iPhone unlock

Firmware: current version 3.1.3, can be jailbroken easily now. Unlock has nothing to do with jailbreak. If update the firmware, baseband will be automatically updated.

Baseband: control the GSM frequency. This is how Apple lock iPhone to stop people use it under other GSM network rather than AT&T. Due to T-mobile has similar frequency, locked iPhone can be used under T-mobile some how. The latest baseband 5.12.01 hasn't been unlocked yet (except some videos on YouTube), so hacker need to downgrade it to 5.11 to unlock iPhone. However, the latest bootloader 5.9 has fix the bug which allows people downgrade baseband from 5.12.01.

Bootloader: it is a hardware, can't be upgrade/downgrade unless modify the iPhone hardware, just like the camera. Only the bootloader before 5.9 has the bug to allow people downgrade baseband. However, most of the new iPhone 3G/3GS is using the bootloader 5.9.

Friday, May 7, 2010

Loading UserControl Dynamically in UpdatePanel

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajax" %>

<asp:updatepanel id="pnl1" runat="server">
<contenttemplate>
<asp:placeholder id="plh1" runat="server"></asp:PlaceHolder>
</contenttemplate>
</asp:UpdatePanel>

private string LastLoadedControl
{
get
{
return ViewState["LastLoaded"] as string;
}
set
{
ViewState["LastLoaded"] = value;
}
}

private void LoadUserControl()
{
string controlPath = LastLoadedControl;

if (!string.IsNullOrEmpty(controlPath))
{
plh1.Controls.Clear();
UserControl uc = (UserControl)LoadControl(controlPath);
plh1.Controls.Add(uc);
}
}

protected void Page_Load(object sender, EventArgs e)
{
DotNetNuke.Framework.AJAX.RegisterScriptManager();

string controlPath = string.Empty;

if (Settings.ContainsKey("ddl1"))
controlPath = Settings["ddl1"] + ".ascx";
else
controlPath = "Expired.ascx";

LastLoadedControl = controlPath;
LoadUserControl();
}

Comparison of Android vs iPhone vs Nokia vs BlackBerry vs Windows Mobile 7

Android (Open Handset Alliance)
* open platform
* can compile custom firmwares - good for hackers and other
* good framework, extended on each new firmware
* supports multitasking
* nice GUI - Eclipse
* development SDK is free
* easy to debug, can send logs to developers
* Android uses a version of Linux as its kernel (albeit tweaked by Google to fit Android needs and separated from the main Linux kernel tree), but it is not a conventional Linux distribution; it does not have a native X Window System, neither does it support the full set of standard GNU libraries like its system libraries (GNU C Library). This makes it difficult to reuse existing Linux applications or libraries on Android. Android does not use established Java standards, i.e. Java SE and ME. This prevents compatibility among Java applications written for those platforms and those for the Android platform. Android only reuses the Java language syntax, but does not provide the full-class libraries and APIs bundled with Java SE or ME. However, Myriad's J2Android, launched on 19 March 2010, allows seamless conversion of Java MIDlets into Android applications.
* programming language is Java but bridges from other languages exist (C# .net - Mono, etc)
* Android supports Java 1.5 and translates the byte code to its own custom Dalvik byte code optimized for mobile devices.
* for the hardcore programmers, Android offers the possibility of programming in C using the native dev kit NDK
* can run script languages like LUA, Perl, Python, etc
* can install third party applications from sdcard, random sites - not locked to a specific market
* applications can hook and override everything - email interface, SMS sending, custom keyboards, etc
* supports widgets
* can publish applications on the Android market instantly - initial one time registration fee is 25E
* user has access to the sdcard and can use it as a USB disk
* native Adobe Flash support after 2.1

Symbian (Nokia)
* opened Symbian and says the future will be QT and WRT - they will cut support to any other environment including J2ME
* Qt is a cross-platform application and UI framework. Using Qt, you can write web-enabled applications once and deploy them across desktop, mobile and embedded operating systems without rewriting the source code. (C++)
* One Developer License Qt Desktop Single Operating System $3 695
* QT runs on Maemo, MeeGo, BlackBerry, Symbian, Windows Mobile, desktop PC, consumer electronics, car entertainment, etc
* QT is available stand along IDE, or Integration/Add-in for Eclipse and Visual Studio
* WRT - web runtime - a cool feature that allows users to write applications in HTML, JS and CS. You build the app like a normal web page, and you interact with the phone platform/hardware using the WRT bridge. Just HTML, JS and CS. Very important: JS can call native code, but also the other way around. It seems you can call WRT JS with native code.
* supports Adobe Flash Lite
* nice GUI - Eclipse
* development SDK is free

MeeGo (Nokia and Intel)
* MeeGo applications are written in C++ using the MeeGo SDK, including Qt.
* nice GUI - Eclipse
* development SDK is free


iPhone (Apple)
* closed platform
* development kit costs
* programming language only allow Objective C (appeared in 1986)
* applications are not allowed to duplicate the iPhone functionality - ie no custom email interface, etc
* NO sd card
* third party applications can only be installed from the Apple store. publishing on the store is a very lengthy and tiresome process. Apple has many and bizarre rules. Many applications were rejected for strange reasons.
* no Adobe Flash support

WebOS (HP)
* hope HP will not kill the brilliant WebOS
* web program (Html, CSS, JavaScript)

BlackBerry (Research In Motion)
* Java native (J2ME) and web development
* the new OS 6 is coming


Windows Mobile 7 (Microsoft)
* break compatibility with WM 6.x
* programming environment is Silverlight and XNA
* no native programming ie no hooking and overriding keyboard, etc - they removed PInvoke
* nice GUI - Visual Studio 2010
* MS marketplace
* no Adobe Flash support


Windows Mobile 6.x (Microsoft)
* native C, C# with PInvoke

Bada (Samsung)
* The Bada operating system has a kernel configurable architecture, which allows the use of either the Linux kernel, or another Real-time operating system (RTOS) kernel. The Linux kernel is the preferred choice for smartphones, while RTOS is used for cheaper feature-phones, due to its smaller memory footprint.



Ref: http://adrianvintu.com/blogengine/post/Comparison-of-Android-vs-IPhone-vs-Nokia-vs-BlackBerry-vs-Windows-Mobile-7.aspx
http://en.wikipedia.org/wiki/Android_(operating_system)

GRUB 2 modification

/etc/default/grub

sudo update-grub




+++++++++++++++++++++++
http://ubuntuforums.org/showthread.php?t=1195275

Find kernel:
uname -a : print all information

uname -r : print the kernel release

uname -v : print the kernel version

uname -o : print the operating system

In Synaptic package manager, search "linux-image"

===================================

How to add a splashmage in GRUB2
http://members.iinet.net/~herman546/p20/GRUB2%20Splashimages.html

sudo apt-get install grub2-splashimages
sudo cp /usr/share/images/grub/*.tga /boot/grub/
gksudo gedit /etc/grub.d/05_debian_theme
scroll down in the file and find line 16 or 17
change the following code in line 16 or 17 from:
for i in {/boot/grub,/usr/share/images/desktop-base}/moreblue-orbit-grub.{png,tga} ; do

to replace 'moreblue-orbit-grub' with the name of the splashimage of your choice)
for i in {/boot/grub,/usr/share/images/desktop-base}/Windbuchencom.{png,tga} ; do

Ubuntu Sudo command

========sudo open file browser, and then Ctrl+H to show hidden files
gksu nautilus

========Clean up past installation of Flash:
sudo apt-get remove -y --purge flashplugin-nonfree gnash gnash-common mozilla-plugin-gnash swfdec-mozilla libflashsupport nspluginwrapper
sudo rm -f /usr/lib/mozilla/plugins/*flash*
sudo rm -f ~/.mozilla/plugins/*flash*
sudo rm -f /usr/lib/firefox/plugins/*flash*
sudo rm -f /usr/lib/firefox-addons/plugins/*flash*
sudo rm -rfd /usr/lib/nspluginwrapper


========install flash (Shockwave flash 10)
When you go to a site by firefox that requires flash you will see a bar appear with a button on the right side labeled “Install Missing Plugins”.Choose the Adobe version and click Next. You will then be warned that the Adobe Flash Player will download and install another application. This is okay. You will be required to enter your user password to continue.

OR

sudo apt-get install flashplugin-nonfree

========map iphone
mkdir /mnt/iPhone
mount.fuse.ifuse --afc2 /dev/hda /mnt/iphone/ -s

========current running kernel version
uname -r

========create symbolicLink dir1 into dir2
ln -s /dir1 /dir2

========list all of the usb devices
lsusb


========.tar.gz Source Installation/Compilation
tar -xzvf /home/bob/compressedfile.tar.gz
./configure
make
su
make install

========Binary install tar.gz
tar -xzvf /home/bob/compressedfile.tar.gz

========.Binary install tar.bz2
tar -xjvf /home/bob/compressedfile.tar.bz2


========Support RAR
sudo apt-get install unrar

========Install DEB OpenOffice
sudo apt-get remove openoffice*.*
tar -vxzf filename
cd OOo_inst_folder/DEBS
sudo dpkg -i *.deb
cd desktop-integration
sudo dpkg -i *.deb

Install Netbook remix to Desktop Ubuntu

sudo gedit /etc/apt/sources.list

ADD:
deb http://ppa.launchpad.net/netbook-remix-team/ubuntu intrepid main
deb-src http://ppa.launchpad.net/netbook-remix-team/ubuntu intrepid main
Save and exit the file.

sudo apt-get update
sudo apt-get install go-home-applet human-netbook-theme maximus netbook-launcher window-picker-applet

run:
netbook-launcher
maximus

Tuesday, May 4, 2010

iPhone CPU

Original & 3G: Samsung 32-bit RISC ARM 620 MHz underclocked to 412 MHz
3GS: Samsung S5PC100 ARM Cortex-A8 833 MHz underclocked to 600 MHz

Quote of the day

If you find a job you love, you never have to work a day in your life.
知之者不如好之者,好之者不如乐之者

最奢侈的事情

盯着时钟, 欣赏秒针一格一格的滑过...

Ubuntu auto mount NTFS drive by fstab, solve the can't be moved to trash problem

===step 1===
Find out uid and gid:
type id in terminal

===step 2===
modify file: /etc/fstab

/dev/sda2 /home/ProgDoc auto defaults,umask=007,uid=1000,gid=1000 0 0

===step 3===
symbolicLink (sudo)

ln -s /home/ProgDoc/Documents /home/username