Monday, September 27, 2010

Where the heck is My Uploads on a Virgin Phone?

A bit off topic:

I wanted to upload some pictures from my cell phone with a Virgin Mobile pay as you go account and an option was to place the pictures into My Uploads. I could not find out where on the internet this place was.

After two hours of searching and finally resorting to calling customer support and being on hold for 20 minutes I got it:


The site states that:

"You will need a PXT password though. Just take a picture and send it to your online album or share it with a friend from your Virgin Mobile phone; once you do either, you'll be prompted to create your PXT password. After that, use that PXT password here to sign in."

However, I was not prompted for anything. Aggravating.

This combined with all of the missing links in the web site, difficult to find help information, and general vagueness makes me certain that I will not be signing up for a long term contract.


Update: I discovered the free BitPim utility which allows me to download pictures from my Samsung SPH-m300 using an inexpensive USB data cable I purchased from CellularPlasa on eBay for $4.

Tuesday, September 21, 2010

Importing UNIX Data into Oracle on a Windows Server

Importing data into an Oracle database can be a challenge at times. The Oracle loader utility (sqlldr) can be a bit problematic and does not allow you to view the data prior to importing it.
Creating an external table has the advantage of allowing manipulation of the data as if it was an actual database table. However, like sqlldr, data that is even slightly nonconforming to the expected format will cause a myriad of problems. Three common formatting problem are incorrect line terminators, inconsistent quotes, and embedded commas.
When a comma delimited flat file is exported from a UNIX database and transferred for loading into a Windows based Oracle database the text lines are terminated with 0x0A in UNIX and not the 0x0A 0x0D pair utilized in the DOS/Windows OS. Although many technical text editors will correct this for you or a program could be quickly written to make the changes this is, as the example below shows, not necessary.
Another problem often encountered is that the fields are randomly double quoted, and some contain commas internal to the field's data. Here is an example of a typically messy format to import. This is from a real life situation I was working on. All of the data in the example is, of course, altered for privacy:

100001,"7123 HIGHLAND DR","03/28/1965"," Mercer Island WA 98040","Morgan, Mary A", "","","63034630752", 14,1,"F","T","06/28/2000","",0,"","01/01/1999","N", "01/01/1999",""

100020,"5432 SOUTH 28TH ST","01/01/1951"," Mercer Island WA, 98040", "Burgess,Frank", "","2566400",ZPW345070938,64,1,"M",B,"02/23/2000","",0,"", "12/31/1799","P","12/31/1979",""

The external table definition used to load this data is:

CREATE TABLE some_data (
ACCOUNT_NUM VARCHAR2(10),
ADDRESS VARCHAR2(30),
BIRTH_DATE VARCHAR2(10),
CITY_STATE_ZIP VARCHAR2(40),
NAME VARCHAR2(30),
EMPLOYER_NAME VARCHAR2(30),
GROUP_NAME VARCHAR2(30),
ID_NO VARCHAR2(50),
PLAN_NO VARCHAR2(50),
VAR_REC VARCHAR2(50),
SEX VARCHAR2(2),
TYPE VARCHAR2(10),
UPDATE_DATE VARCHAR2(10),
EXD_ID VARCHAR2(30),
PCP VARCHAR2(30),
PCP_EFFECT VARCHAR2(30),
CANCEL_DATE VARCHAR2(10),
COV_DEP VARCHAR2(30),
EFFECT_DATE VARCHAR2(10),
ADDL_INFO VARCHAR2(50))
ORGANIZATION EXTERNAL
(TYPE oracle_loader
DEFAULT DIRECTORY ext
ACCESS PARAMETERS
(
RECORDS DELIMITED BY 0x'0A'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
MISSING FIELD VALUES ARE NULL)
LOCATION ('UNIX_DATA.DAT'))
REJECT LIMIT unlimited;

desc some_data

set linesize 121
col account_num format a10
col address format a20
col birth_date format a20
col city_state_zip format a20
col name format a20

SELECT account_num, address, birth_date, city_state_zip, name
FROM some_data;

Defining the record access parameters with
RECORDS DELIMITED BY 0x'0A'
stops the Oracle loader from seeing the file as one single record due to expecting lines to be terminated in the same manner as the host OS. If the data is a large file that exceeds the half MB limit, Oracle loader would simply produce an error.
The record access parameters
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
allows fields like "Doe,Jane R" to be correctly interpreted as a single field instead of two containing "Doe and Jane R" while not rejecting fields that do not have quotes.

Going Virtual

VT Can Really Help - XP and Vista Together - With Linux

I was frustrated that it was problematic to run Ubuntu and Vista and XP on my laptop (I am a consultant and need to have the ability to develop in several platforms) when I realized that I could add Oracle VirtualBox into Linux (or Vista but I usually use Linux) and run XP. Note that only XP Pro SP3 (which I have) allows virtualization to run under it, not Home. Vista also does not allow running a virtual machine if it is the Home or Business version, only if Enterprise and Ultimate and it's the same for Windows 7.


XP runs so well on my HP 6830s with a P8400 Duo that I can't tell that it's a virtual machine. I'm thinking about creating a second virtual machine that runs Windows 7.


Oracle VirtualBox is a free product (with source code) that, as far as I have found, allows most popular OS versions to run as a virtual machine and allows multiple OS versions as the host. I would suggest using Linux as the host OS. It does not have restrictions and seems to run faster in my experience.

When virtualization becomes more mainstream maybe Microsoft will reconsider. Consumers are not going to pay for the highest cost OS just to sand box their kid's activities (my nephew trashed my mother's computer with downloads and games a while ago) if another OS (Linux most obviously) will allow you to do anything.

Microsoft's Requirements When Creating a Virtual Machine

Help and Discussion about virtualization at Intel

Oracle VirtualBox

How to Fix a Grub2 Selective Boot after Destroying It

This is a copy of an article. It is not plagiarized - I do not claim to have written it. This is simply copied here so I always have it as a reference and others may have it too. This was the best explanation I found and it took a long time to find it. The original posting in the forum is gone - as I expected. It has shown up in another forum now and it will also be gone at some point. I did not edit out the extraneous banter or correct the spelling in respect to the original author who is unknown but I thank him/her. 

From http://www.ubuntu-inside.me/2009/06/howto-recover-grub2-after-windows.html and now http://ubuntuforums.org/archive/index.php/t-1752186.html


I clobbered Grub - now what?

My Grand Unified Boot-loader was failing to be able to load Windows XP and I restored the Windows boot by copying the NTLDR and ntdetect.com from the install disk and using the fixmbr and fixboot commands. Now I can't boot Linux.

The problem probably was that the Ubuntu 10.04 LTS upgrade reset GRUB2.

I found this solution and it works:

Today i destroyed my Grub2 via installing windows on my notebook which i write blog posts.(I quit smoking , so i have to play some games : ) No rush). It may be hard to recover it since there are not much (i did not find anything) howtos around the net about recovering Grub2.Here is the step by step guide to recover it :

You will need a LIVE cd if you are going to recover an Ubuntu Box.Download Ubuntu Jaunty, Karmic whatever you want.Open the system with Live CD (I assume you are using Ubuntu Live CD).Press Alt+F2 and enter gnome-terminal command.And continue by entering :

$sudo fdisk -l

This will show your partition table.Here is my table to understand it better :

/dev/sda1 29 8369 66999082+ 83 Linux
/dev/sda2 * 8370 13995 45190845 7 HPFS/NTFS
/dev/sda3 13996 14593 4803435 5 Extended
/dev/sda5 13996 14593 4803403+ 82 Linux swap / Solaris

Now i will mount Linux (sda1 here), i have no external boot partition as you can see.(IF YOU HAVE external one, do not forget to mount it! )

$sudo mount /dev/sda1 /mnt
$sudo mount --bind /dev /mnt/dev
$sudo mount --bind /proc /mnt/proc

The following command is optional (it copies resolv.conf)

$sudo cp /etc/resolv.conf /mnt/etc/resolv.conf

Now chroot into the enviroment we made :

sudo chroot /mnt

After chrooting, you do not need to add sudo before your commands because from now, you will run commands as root.

You may want to edit /etc/default/grub file to fit your system (timeout options etc)

#nano -w /etc/default/grub

Play with the options if you want.(But do not forget to give grub-update command if you saved it ;) )

Now install/recover Grub2 via :

#grub-install /dev/sda

command.However you may get errors with that code like me.If so please use this command :

#grub-install --recheck /dev/sda

Now you can exit the chroot, umount the system and reboot your box :

#exit
$sudo umount /mnt/dev
$sudo umount /mnt/proc
$sudo umount /mnt
$sudo reboot