Monday, April 09, 2018

Lego Famicom Console

Built this from scratch Sunday afternoon


Not an easy task due to not enough shapes in white and red colour.


This is my first build using Lego

Fits the Retropie too. :)

Tuesday, April 22, 2014

How to change RedHat terminal/console/screen resolution

add an extra parameter
vga=791
at the end of the line started with kernel
 /boot/grub/grub.conf



More options
791 - 1024x768, 16 bit
792 - 1024x768, 24 bit
794 - 1280x1024, 16 bit
795 - 1280x1024, 24 bit


Working under Redhat Server6.4 kernel /vmlinuz-2.6.32-358.e16.x86_64 Source:
http://www.vincentverhagen.nl/2008/08/03/how-to-change-console-resolution-on-linux-rhel-centos-fedora-etc/

Thursday, July 28, 2011

Free Domain Name Providers

dot.tk
co.nr
co.cc
cz.cc
cu.cc
uni.cc

co.be

yourname.*.tf, such as yourname.net.tf

yourname.*.tc, such as yourname.com.au.tc



I have tried the co.cc and cz.cc, works very good. For co.cc, one account only can register two names, but cz.cc can do five max.


Friday, July 22, 2011

MySQL Basic II

My current version:
ji@ji-cada:~$ mysql --version;
mysql Ver 14.12 Distrib 5.0.51a, for debian-linux-gnu (i486) using readline 5.2


The path MySQL is installed:
/usr/bin/

display how many columns and rows:
ji@ji-cada:/usr/bin$ mysqlshow -u root -p -vv mysql

More info to display:
ji@ji-cada:/usr/bin$ mysqlshow -u root -p --status factory


add a database:
ji@ji-cada:/usr/bin$ mysqladmin -u root -p create mobileweb
or
login, then
mysql> CREATE DATABASE webdb


see how many database:
ji@ji-cada:/usr/bin$ mysqlshow -u root -p


change database:
mysql> use factory;
mysql> connect sakai;

show how table created
mysql> SHOW CREATE TABLE factory.Customer;
or
mysql> DESCRIBE factory.Customer;


See how many tables and databases:
SHOW TABLES;
SHOW DATABASES;



Alter a table property:
mysql> DESCRIBE Customer;


mysql> ALTER TABLE Customer MODIFY COLUMN Name VARCHAR(50) NOT NULL default '';
Query OK, 2 rows affected (0.01 sec)
Records: 2 Duplicates: 0 Warnings: 0

mysql> DESCRIBE Customer;


mysql> ALTER TABLE Customer CHANGE COLUMN Zip Postcode CHAR(10);
Query OK, 2 rows affected (0.00 sec)
Records: 2 Duplicates: 0 Warnings: 0

mysql> DESCRIBE Customer;


mysql> ALTER TABLE Customer ADD INDEX Postcode(Postcode);
Query OK, 2 rows affected (0.00 sec)
Records: 2 Duplicates: 0 Warnings: 0

mysql> DESCRIBE Customer;



Another way of insertion:
mysql> insert into Customer set Customer_Number = 3167, Name='Good Guys', Address='21 Garnet St', City='Lane Cove', State='NSW', Postcode = '3253';




Very fast way to copy data accross:

mysql> CREATE TABLE City ( City_Name CHAR(20) PRIMARY KEY);
Query OK, 0 rows affected (0.00 sec)

mysql> INSERT INTO City SELECT City FROM Customer;
Query OK, 3 rows affected (0.00 sec)
Records: 3 Duplicates: 0 Warnings: 0



Other commands:
TRUNCATE table1;
ALTER TABLE table1 AUTO_INCREMENT=1;


Manage user:
mysql> SHOW PRIVILEGES;


For other user:
mysql> SHOW GRANTS FOR webuser;

To see what user info, in mysql database:
SELECT user from user where host = 'localhost';

To create a user:
mysql> CREATE USER webuser IDENTIFIED BY 'webuser';
Query OK, 0 rows affected (0.00 sec)

Change password:
mysql> SET PASSWORD FOR 'webuser' = PASSWORD('newpass');
Query OK, 0 rows affected (0.00 sec)

Other commands:
GRANT: give permission to user, on particular table, action(SELECT, UPDATE, INSERT etc.), logging in from which domain.
REVOKE: remove permission.





A proper formatted version with table showing is here:

Monday, July 11, 2011

SQL database

25 May 2011
Basic MySQL info:

Path for my.cnf file:
ji@ji-cada:/etc/mysql$ cat my.cnf


mysql -u root -p

ID root
PS root

quit or exit to end.

Any command ends with ;

Table name is case sensitive, but column name, value in query are not case sensitive.
User name and password is case sensitive.


MySQL Query Browser

to start:


Mobile Web Dev

It is time to try some mobile web development.

Here is the platform and testing play ground.

Apache

CSS, Javascript

iPhone 4

http://viva.wranga.com.au/


FTP command:
basic
http://www.cs.colostate.edu/helpdocs/ftp.html
detail
http://www.nsftools.com/tips/RawFTP.htm
http://linux.about.com/od/commands/l/blcmdl1_ftp.htm


Certainly need more experience about Javascript, the whole logic to store data and UI are based on Javascript.


Here are some framework available for doing Mobile Web development,
Sencha Touch
jQTouch
iWebkit
iUI
a more general one is GWT, or Google Web Toolkit. It broadly focus on web page development rather Mobile Web

An article compare some of the framework, dated back early 2011

It seems jQTouch developer shifts to Sencha


Twitter API

Tuesday, April 29, 2008

Data Model

MDSYS.SDO_GEOMETRY
http://download-east.oracle.com/docs/cd/B19306_01/appdev.102/b14255/sdo_objrelschema.htm#i1004087

PL/SQL DATE CONVERT TO NUMBER
http://www.unix.org.ua/orelly/oracle/prog2/ch14_01.htm
http://www.unix.org.ua/orelly/oracle/prog2/ch14_02.htm
eg.
number_date := TO_NUMBER(TO_CHAR(date, 'j'));

Function-Based Indexes
http://download-east.oracle.com/docs/cd/B19306_01/appdev.102/b14251/adfns_indexing.htm#sthref597
Any top-level or package-level PL/SQL functions that are used in the index expression must be declared as DETERMINISTIC. That is, they always return the same result given the same input, for example, the UPPER function. You must ensure that the subprogram really is deterministic, because Oracle Database does not check that the assertion is true.

If you change the semantics of a DETERMINISTIC function and recompile it, then existing function-based indexes and materialized views report results for the prior version of the function. Thus, if you change the semantics of a function, you must manually rebuild any dependent function-based indexes and materialized views.