Forget condos and strip malls. Domain names, the real estate of the Web, have been delivering far greater returns. How some of the savviest speculators on the Net are making millions from their URL portfolios.
Opera & page body margin
body { margin: 0px; }
In IE & Firefox there will be no margin for the page.
In Opera there is still the spacing. Why?
Because Opera has in its default styles, just as the
CSS2 specification suggests (see appendix A)
body { margin: 0px; padding: 8px; }
To have no spacing between page body & borders:
body { margin: 0px; padding: 0px; }
HOWTO: clear bash history?
[root@ ~]# history -c
Get CPU information
Sample Output: Make: AMD Opteron(tm) Processor 244 Speed: 1792.558 Count: 2 Hyperthreaded: No
View & sort existing RPM packages
rpm -qa --qf '%{SIZE} %{NAME}\n' | sort -nr | less Sample Output: 186925230 kernel-source 184937329 kernel-source 74392320 rpmdb-redhat 44488420 emacs 42509842 glibc-common 41262406 libstdc++-ssa-devel 31483893 frontpage 27851009 perl 25825586 comps 23352847 kernel 23219902 libgcj-ssa-devel 22570875 kernel 21628214 rpm-devel 21543354 kernel-smp 20757085 kernel-smp 18808196 gcc-gnat 17833551 MySQL-server 17596278 ant-libs
wget, login & cookie
If you need to sign into a site and download a file automatically with wget, here is a shell script for that:
COOKIE_FILE=cookie.txt
LOGIN_URL=”http://example.com/login?username=xxxx&password=xxxx”
login() {
echo “Signing in….”
wget –save-cookie cookie.txt $LOGIN_URL
return
}
print_usage() {
echo “Usage: $0 [URL]”
return
}
if [ $# -eq 0 ] ; then
print_usage
exit 1
fi
if [ ! -r $COOKIE_FILE ] ; then
login
fi
wget –load-cookie cookie.txt “$1” -O output.file
phpESP 1.8 – Poll/Survey Script – DB Design
— # types of questions
CREATE TABLE question_type (
id INT UNSIGNED NOT NULL AUTO_INCREMENT,
type CHAR(32) NOT NULL,
has_choices ENUM(‘Y’,’N’) NOT NULL,
response_table CHAR(32) NOT NULL,
PRIMARY KEY (id)
);
— # table of the questions for all the surveys
CREATE TABLE question (
id INT UNSIGNED NOT NULL AUTO_INCREMENT,
survey_id INT UNSIGNED NOT NULL,
name CHAR(30) NOT NULL,
type_id INT UNSIGNED NOT NULL,
result_id INT UNSIGNED,
length INT NOT NULL DEFAULT 0,
precise INT NOT NULL DEFAULT 0,
position INT UNSIGNED NOT NULL,
content TEXT NOT NULL,
required ENUM(‘Y’,’N’) NOT NULL DEFAULT ‘N’,
deleted ENUM(‘Y’,’N’) NOT NULL DEFAULT ‘N’,
public ENUM(‘Y’,’N’) NOT NULL DEFAULT ‘Y’,
PRIMARY KEY (id),
KEY `result_id` (`result_id`),
KEY `survey_id` (`survey_id`)
);
— # table of the choices (possible answers) of each question
CREATE TABLE question_choice (
id INT UNSIGNED NOT NULL AUTO_INCREMENT,
question_id INT UNSIGNED NOT NULL,
content TEXT NOT NULL,
value TEXT,
PRIMARY KEY (id),
KEY `question_id` (`question_id`)
);
— # access control to adding data to a form / survey
CREATE TABLE access (
id INT UNSIGNED NOT NULL AUTO_INCREMENT,
survey_id INT UNSIGNED NOT NULL,
realm CHAR(16),
maxlogin INT UNSIGNED DEFAULT ‘0’,
resume ENUM(‘Y’,’N’) NOT NULL DEFAULT ‘N’,
navigate ENUM(‘Y’,’N’) NOT NULL DEFAULT ‘N’,
PRIMARY KEY(id),
KEY `survey_id` (`survey_id`)
);
— # this table holds info to distinguish one servey response from another
— # (plus timestamp, and username if known)
CREATE TABLE response (
id INT UNSIGNED NOT NULL AUTO_INCREMENT,
survey_id INT UNSIGNED NOT NULL,
submitted TIMESTAMP(14) NOT NULL DEFAULT ”,
complete ENUM(‘Y’,’N’) NOT NULL DEFAULT ‘N’,
username CHAR(64),
PRIMARY KEY (id),
KEY `survey_id` (`survey_id`)
);
— # answers to boolean questions (yes/no)
CREATE TABLE response_bool (
response_id INT UNSIGNED NOT NULL,
question_id INT UNSIGNED NOT NULL,
choice_id ENUM(‘Y’,’N’) NOT NULL,
PRIMARY KEY(response_id,question_id),
KEY `response_id` (`response_id`),
KEY `question_id` (`question_id`)
);
— # answers to single answer questions (radio, boolean, rate) (chose one of n)
CREATE TABLE response_single (
response_id INT UNSIGNED NOT NULL,
question_id INT UNSIGNED NOT NULL,
choice_id INT UNSIGNED NOT NULL,
PRIMARY KEY(response_id,question_id),
KEY `response_id` (`response_id`),
KEY `question_id` (`question_id`)
);
— # answers to questions where multiple responses are allowed
— # (checkbox, select multiple)
CREATE TABLE response_multiple (
id INT UNSIGNED NOT NULL AUTO_INCREMENT,
response_id INT UNSIGNED NOT NULL,
question_id INT UNSIGNED NOT NULL,
choice_id INT UNSIGNED NOT NULL,
PRIMARY KEY(id),
KEY `response_id` (`response_id`),
KEY `question_id` (`question_id`),
KEY `choice_id` (`choice_id`)
);
— # answers to rank questions
CREATE TABLE response_rank (
response_id INT UNSIGNED NOT NULL,
question_id INT UNSIGNED NOT NULL,
choice_id INT UNSIGNED NOT NULL,
rank INT NOT NULL,
PRIMARY KEY(response_id,question_id,choice_id),
KEY `response_id` (`response_id`),
KEY `question_id` (`question_id`),
KEY `choice_id` (`choice_id`)
);
— # answers to any fill in the blank or essay question
CREATE TABLE response_text (
response_id INT UNSIGNED NOT NULL,
question_id INT UNSIGNED NOT NULL,
response TEXT,
PRIMARY KEY (response_id,question_id),
KEY `response_id` (`response_id`),
KEY `question_id` (`question_id`)
);
— # answers to any Other: ___ questions
CREATE TABLE response_other (
response_id INT UNSIGNED NOT NULL,
question_id INT UNSIGNED NOT NULL,
choice_id INT UNSIGNED NOT NULL,
response TEXT,
PRIMARY KEY (response_id, question_id, choice_id),
KEY `response_id` (`response_id`),
KEY `choice_id` (`choice_id`),
KEY `question_id` (`question_id`)
);
— # answers to any date questions
CREATE TABLE response_date (
response_id INT UNSIGNED NOT NULL,
question_id INT UNSIGNED NOT NULL,
response DATE,
PRIMARY KEY (response_id,question_id),
KEY `response_id` (`response_id`),
KEY `question_id` (`question_id`)
);
— # populate the types of questions
INSERT INTO question_type VALUES (‘1′,’Yes/No’,’N’,’response_bool’);
INSERT INTO question_type VALUES (‘2′,’Text Box’,’N’,’response_text’);
INSERT INTO question_type VALUES (‘3′,’Essay Box’,’N’,’response_text’);
INSERT INTO question_type VALUES (‘4′,’Radio Buttons’,’Y’,’response_single’);
INSERT INTO question_type VALUES (‘5′,’Check Boxes’,’Y’,’response_multiple’);
INSERT INTO question_type VALUES (‘6′,’Dropdown Box’,’Y’,’response_single’);
— # INSERT INTO question_type VALUES (‘7′,’Rating’,’N’,’response_rank’);
INSERT INTO question_type VALUES (‘8′,’Rate (scale 1..5)’,’Y’,’response_rank’);
INSERT INTO question_type VALUES (‘9′,’Date’,’N’,’response_date’);
INSERT INTO question_type VALUES (’10’,’Numeric’,’N’,’response_text’);
INSERT INTO question_type VALUES (’99’,’Page Break’,’N’,”);
INSERT INTO question_type VALUES (‘100′,’Section Text’,’N’,”);
JSCookMenu 1.4.3 Bug
File: JSCookMenu.js line 178 Old: hasChild = (item.length > 5); New: hasChild = (item.length && item.length > 5);
Purpose: avoid warning because _cmSplit is parsed as an object and
does not have length property
Updated: JSCookMenu updated to 1.4.4 with a quick fix for a bug
for _cmSplit checking.
Passing Arguments to a JavaScript Function
Firefox 1.5 returns “Warning: deprecated arguments usage”
Solution: “var argv = arguments;”
Reference:
http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Functions:arguments
“The arguments object is a local variable available within all functions; arguments as a property of Function can no longer be used.”