Sunday, June 11, 2006

learn...

You can almost learn anything new by yourself all it takes is time. The trick is finding the right specs., right tutorial. The conceptual is learn or read to understand the basic concept before going into the detail. For example learn VNP, WiMAX read the some article to grasp and understand the concept how it works then when going into the specs. like 802.16 will easy to understand.
Here is the example:
Conception of wimax http://computer.howstuffworks.com/wimax1.htm
The real spec is http://ieee802.org/16/
Conception of wifi in local: /mnt/win/protocols/802.11tut.pdf
The real spec in local: /mnt/win/protocols/802.11.pdf

Conceptual is really good like talking about wimax
  • There is the non-line-of-sight, WiFi sort of service, where a small antenna on your computer connects to the tower. In this mode, WiMAX uses a lower frequency range -- 2 GHz to 11 GHz (similar to WiFi). Lower-wavelength transmissions are not as easily disrupted by physical obstructions -- they are better able to diffract, or bend, around obstacles.
  • There is line-of-sight service, where a fixed dish antenna points straight at the WiMAX tower from a rooftop or pole. The line-of-sight connection is stronger and more stable, so it's able to send a lot of data with fewer errors. Line-of-sight transmissions use higher frequencies, with ranges reaching a possible 66 GHz. At higher frequencies, there is less interference and lots more bandwidth
    So when reading wimax 802.16 in section PHYSICAL LAYER there are 2 frequencies: 2 GHz to 11 GHz and 10-66 GHz you will understand right away why there are 2 frequencies it takes me a while to figure out if you read the conceptual you will know right away.

    OR
    VPN
    Analogy: Each LAN is an Island
    Imagine that you live on an island in a huge ocean. There are thousands of other islands all around you, some very close and others farther away. The normal way to travel is to take a ferry from your island to whichever island you wish to visit. Of course, traveling on a ferry means that you have almost no privacy. Anything you do can be seen by someone else.


    This imply for everything including specs., coding... we need to understand the concept and specs it will easy to remember instead of learning by heart...

Wednesday, May 24, 2006

Mozilla Firefox 1.5.0.3

The world is depending on the information and most the information you need is on the internet. Therefore, the tools are critical to save time when wanting to find a piece of information is missing in the puzzle which helps you to do the job better. Who control the information on the internet will be the one will success (a hint from Bill Gate). Mozilla Firefox just does that, it is very fast to search the webs, find info from net then find info in the page, find info. on the web with the less keystrokes less interrupt let your ideas flow from one page to another page for example to search in the article just ctrl f or ctrl + most the key controls as same as other applications like photoshop, or MS word no need to learn a new keystroke control key. I mean that you search the web then you search the content in that page. Google does very good job in this. Larry P. said that the information now can be reached anyone in the globe, there is no different for one engineer sits in the San Jose, Cali and one engineer sits in Bangalore, India. I think the hint & idea from Bill G. and Larry are so correct. In the mozilla-firefox, the search engine is on the top, the bottom appears when needed not like the old browser like Netscape, IE each time find something in the article typing ctrl f and it appears in the middle of the page so you can not see the page. I am using mozilla 1.0 in linux then change to mozilla-firefox 1.0 and last night upgraded to mozilla-firefox 1.5.0.3 - this is a killer application on the net for me. When install just download the rpm it is easy to install no need to compile just a simple command: rpm -ivh firefox-0.10.1-0.1.1.fc1.test.i386.rpm
The final version http://www.mozilla.com/firefox/
No need to remember anything just on left top corner click on Google: mozilla-firefox it will bring to the site. This is why I try talking about the power of information. There is a ton of information you need for your job just search to find a right tutorial and you almost do everything by yourself especially for who is self learning. One thing I wish that the search box in top left should be wider, cache better (if you open the same page it should be faster) because it has been cache, and last file download seems often corrupt and stop without warning. When you install gets the error and do the file check that it is different from original. During download if the connection is down you have to download all over again it is time consume with large file it should remember when it left off and when connected again it should start whereis left off like other program Flashget...if it is incorperated into Mozilla Firefox it will great.
I think it is not because the modem or ADSL are slow but the application makes the browser runs slow. For example we can implement the fast TCP/IP for these applications instead of the old traditional TCP/IP. For more info. about using it http://mozilla.gunnars.net/firefox_bookmarks_tutorial.html
when you go through this tutorial about bookmark manager and other functions you are glad that
I am telling that it has many awsome features. And last, mozilla firefox is a smart browser (secure)it lets you know cookies/any spy adware/tracking adware/virus detection/detected live bookmark (dynamic website/RSS/XML) this allows to download multi news and you can view at one no waiting to download, see above link for tutorial.
So the race is on between IE and the others. Von Brown once said, "the innovation takes time" John F Kennedy once said,"we decide to go to moon not because it is easy but because it is hard".

Saturday, May 20, 2006

XAMPP for apache, php and mysql

Download: http://www.apachefriends.org/en/xampp.html

XAMPP for Linux
The distribution for Linux systems (tested for SuSE, RedHat, Mandrake and Debian) contains: Apache, MySQL, PHP & PEAR, Perl, ProFTPD, phpMyAdmin, OpenSSL, GD, Freetype2, libjpeg, libpng, gdbm, zlib, expat, Sablotron, libxml, Ming, Webalizer, pdf class, ncurses, mod_perl, FreeTDS, gettext, mcrypt, mhash, eAccelerator, SQLite and IMAP C-Client.
XAMPP for Windows
The distribution for Windows 98, NT, 2000 and XP. This version contains: Apache, MySQL, PHP + PEAR, Perl, mod_php, mod_perl, mod_ssl, OpenSSL, phpMyAdmin, Webalizer, Mercury Mail Transport System for Win32 and NetWare Systems v3.32, JpGraph, FileZilla FTP Server, mcrypt, eAccelerator, SQLite, and WEB-DAV + mod_auth_mysql.

Tuesday, May 16, 2006

ActiveX vs. Java Applet

ActiveX is a technology developed by Microsoft. With an ActiveX-enabled browser (ie Internet Explorer only) ActiveX controls can be downloaded as part of a Web document to add functionality to the browser (similar to Java applets). In particular ActiveX enables seamless viewing of Windows files of all types, eg spreadsheets, and in combination with other technologies such as Java and scripting languages, makes possible the development of complex Web applications. ...

Does Active X works with Linux, I guess it is not because it is not windows, I tried Java applets for dialing to Netzero (ISP), it is all works for both linux and windows. Linux needs jre-1_5_0-linux-i586.bin and windows need C:\Program Files\Java\jre1.5.0_01\bin\npjpi150_01.dll

Linux:
download netzero.deb
cp netzero.deb /
cd /
ar -xv netzero.deb
gunzip data.tar.gz
tar xvf data.tar
Install java jre
cd /opt/nzclient
./runclient.sh

Create a file to get on desktop of cd ~/gnome-desktop links/associated to /java/jre-1_5_0/opt/runclient.sh
Click to dial from desktop of gnome.

Mambo, oscommerce, and weberp

These 3 packets supports everything you need from ERP to oscommerce. Mambo supports to dynamic web pages using content management systems.

Mambo <--> www (oscommerce) <---> webERP

oscommerce is good for back end and mambo is good for front end.
WebERP allows users to access ERP at any places. WebERP and oscommerce can share
the same database. So if the user buys an item, it issues an invoice that will go
to WebERP to generate quarter sales ---> for tax or income just one button.

DNS

- Buy a domain then go to domain names server set up IP address of your web hosting
This is standard zone - Fill the IP of web hosting usually 2 boxes:
Standard Primary: 63.247.87.178
(get from web hosting server IP which is dynamic IP
share among many users if you are mini reseller web hosting)
Standard Secondary: 63.247.87.179
- Go to WHM web host mangement (it is not control panel) set up the account using
that domain for example: www.objectlayer.com but only need to put objectlayer.com
Set up space needs for this website, bandwidth, username and password

- Go to control panel set up the rest: email address, database mysql, security...

that is all, when it works you are able to ping the website and it will reply
Run -> cmd -> dos command -> ping objectlayer.com (using ICMP)

C:\Documents and Settings\Administrator>ping objectlayer.com

Pinging objectlayer.com [63.247.87.178] with 32 bytes of data:

Reply from 63.247.87.178: bytes=32 time=153ms TTL=48
Reply from 63.247.87.178: bytes=32 time=163ms TTL=48
Reply from 63.247.87.178: bytes=32 time=171ms TTL=48
Reply from 63.247.87.178: bytes=32 time=159ms TTL=48

When you type www.objectlayer.com --> DNS to get IP --> web hosting and information
is stored here so if the browser asks for HTTP request will get HTTP response
Depend on request it could be GET, HEAD and POST. If the server could not find the page error 5xx (client 4xx)
Basically, web server responds to the request from web brownser usually is on the port 80 (HTTPs on port 443 for SSL) this service that the user need to pay web hosting service if they want to have it for their shopping on line.
HTPPs is working on oscommerce by submitting the predefined URL to credit card or banking under POST (Paypal using winsock), the result is again on the predefined on
the users' website. From the result code, the users (seller) can determ if the buyer can buy their products.

Thread vs. process

One difference: Threads within a process share a single address space, and can, with care (synchronization), access one another's variables. Processes run in different address spaces, and must use inter-process communications mechanisms to exchange information.
Processes Versus Threads


Other Terms:

Heavyweight Process = Process
Lightweight Process = Thread


Advantages (Thread vs. Process):

Much quicker to create a thread than a process.
Much quicker to switch between threads than to switch between processes.
Threads share data easily


Disadvantages (Thread vs. Process):

No security between threads: One thread can stomp on another thread's data.
For threads which are supported by user thread package instead of the kernel:
If one thread blocks, all threads in task block

Thread States (Example Java):

New = New: Placed on the ready list.
Blocked = Wait for an event
Runnable = Ready or Running
Dead = Exit


Thread functions: POSIX (Standard UNIX C/C++):

pthread_create(): creates a thread
pthread_exit(): kills itself
pthread_kill(): sends a signal to a specified thread
pthread_join(): waits for a thread to exit.
pthread_self(): returns thread id
synchronization functions


Java Implementation
http://objectlayer.blogspot.ca/2012/06/java-threads-for-hello-world.html
Define a class to contain a thread, by defining:
class Worker1 extends Thread OR
class Worker2 implements Runnable (Recommended)
The parent thread creates the object and invokes its start() function.
The start function creates the child thread and calls the object’s run() function.
Thread terminates when thread returns from run(), or stop() is called.

Types of Thread Implementations


User Thread Package

A package outside the OS creates and schedules threads.
Model: Many-to-one: Many user threads associated with one process.
Thread creation/management is faster than Kernel Thread support
However if one thread blocks, then entire process blocks. Thus all threads block.


Kernel Thread Support

The OS creates and schedules threads.
Model: One-to-one: Each user thread is associated with one kernel thread.
If one thread blocks, the kernel can schedule other threads.
If multiprocessor configuration, kernel can allocate threads of same process on different processors.
Example: Windows NT, Solaris, Digital UNIX

Many-to-Many Model: Combination of above

N user threads share M kernel threads (where N > M)
There may be a flexible and changing assignment of user threads to kernel threads.
Bound: User-thread is assigned permanently to kernel thread
Unbound: User threads share available kernel threads
Example: Solaris
----------------------deadlock vs. race condition
DeadlocksA deadlock occurs when one or more threads are permanently blocked from executing because each thread waits on a resource held by another thread in the deadlock. A thread can also deadlock on itself. The simplest case of deadlock occurs when process p1 gains access to data structure a and process p2 gains access to b, but p1 then waits for b and p2 waits for a.
A deadlock
occurs when one or more threads are stuck waiting for something that never will
occur.(advanced linux program p.82)
Race Conditions
A race condition occurs when two or more threads perform an operation, and the result of the operation depends on unpredictable timing factors; specifically, when each thread executes and waits and when each thread completes the operation.
The result is trouble. Because both processes see the same scull device, each will
store its new memory in the same place in the quantum set. If A stores its pointer
first, B will overwrite that pointer when it does its store. Thus the memory allocated by A, and the data written therein, will be lost.

Tuesday, February 21, 2006

how to fix Warning: extract(): First argument should be an array

Re: [maxbear] Error using different template [In reply to] Can't Post

--------------------------------------------------------------------------------

It looks like the error is happening on this line:

--------------------------------------------------------------------------------
Code
--------------------------------------------------------------------------------

extract($TPL_GLOBALS[$template_set]);

--------------------------------------------------------------------------------


Which from the previous few lines, should only error if you don't have a globals.txt. You should be able to fix it by either creating an empty globals.txt file, or by changing the above line to:

--------------------------------------------------------------------------------
Code
--------------------------------------------------------------------------------

if (isset($TPL_GLOBALS[$template_set])) {
extract($TPL_GLOBALS[$template_set]); }
-------------------------------------------------------------------------------

in aboutsaigon/includes/templates.php

function fetch($file = null) {
global $INFO;
if(!$file) $file = $this->file;
if (isset($this->vars)) { // fix the warning
extract($this->vars);
}
ob_start();
include($INFO['templateFolder'].$file.$INFO['templateType']);
$contents = ob_get_contents();
ob_end_clean();
return $contents;
}
}

Wednesday, February 08, 2006

You can almost learn anything

You can learn C++/VB/Java there is a lot information on the internet, first thing you have to search the right document the one that you can read and understand and best practice for exercise that works then download and go step by step learn and practice it. The key important it must have the right document. If you are not satisfy with the documents find another one. You can almost learn anything in the internet as long as you have a fast internet.

Saturday, January 21, 2006

C++ vs. Java

- Java does not have pointer but instead has non primative variables that references
- Java avoids much of the direct programmer management of memory that causes so many bugs in C and C++
- Java does not have arrays which are references
- Java does not have functions that are outside the scope of a class
- Java's term for function is method
- Multiple inheritance and concept of virtual inheritance in C++. No multiple inheritance in Java. Can get around by user interface
- By default member of class are privates where Java a default member function/variables are visibility
- Platform independence in Java which is not in C++
- All member function in Java class are virtual by default, where C++ need specified
- Constructor can be called from other constructors using this() in Java, this is not in C++

Thursday, January 19, 2006

What is the Virtual Function ?

A virtual function is a member of base class that can be overridden by a derived class. If the virtual function is not overridden by the derived class, the base class definition is used.

// virtual members
#include
class CPolygon {
protected:
int width, height;
public:
void set_values (int a, int b)
{ width=a; height=b; }
virtual int area (void)
{ return (0); }
};
class CRectangle: public CPolygon {
public:
int area (void)
{ return (width * height); }
};
class CTriangle: public CPolygon {
public:
int area (void)
{ return (width * height / 2); }
};
int main () {
CRectangle rect;
CTriangle trgl;
CPolygon poly;
CPolygon * ppoly1 = ▭
CPolygon * ppoly2 = &trgl;
CPolygon * ppoly3 = &poly;
ppoly1->set_values (4,5);
ppoly2->set_values (4,5);
ppoly3->set_values (4,5);
cout <<>area() <<>area() <<>area() << endl; return 0; }
References:
http://people.msoe.edu/~tritt/clang.html#toc
http://www.cplusplus.com/

What is Polymorphism ?

Polymorphism is the capability to bind a specific derived class object to base class pointer at run-time.

what is the structure ?

C++ language has extended the C keyword struct to the same functionality of the C++ class keyword except that its members are public by default instead of being private.
Anyway, due to that both class and struct have almost the same functionality in C++, struct is usually used for data-only structures and class for classes that have procedures and member functions.
struct model_name {
type1 element1;
type2 element2;
type3 element3;
.
.
} object_name;

What is Class ?

A class is a blue-print or prototype defines the variables, functions/methods for an object.
class class_name {
permission_label_1:
member1;
permission_label_2:
member2;
...
} object_name;

What is object ?

An object is a software bundle of related variables and methods. Software objects are often used to model real world objects that we found in everyday life.
A class is the blueprint from which individual objects are created.
An object is an individual instance of a class.