About credit cards

I recently called a credit card company to learn about the some of the details that they will not disclose.  These are the details that I have collected.

Q:  If I miss a payment, will my interest rate go up?
A:  If you default twice within 6 months, your interest rate will go up by an amount decided by the credit card issuer.

Q:  If I withdrawl cash from my credit card, will I be charged interest immediately?
A:   Interest will be charged as soon as the cash comes out of the machine. (Most banks)
A2:  Interest will be charged 30 days after the date of cash withdrawl.  (Some banks)

Q:  I am a few days late paying my bill.  Will I get charged interest and a mark left on my Equifax and Transunion credit center?
A:  There is a 7 day grace period after the due date.  If the payment is received after the 7 day grace period, you will get charged and the credit center will be notified.  It is not possible to have the default payment removed from your records.

Q:  If I lose my credit card, will I get charged for unauthorized transactions?
A:  No, you have to notify us that the card was stolen and tell us which transactions are false.

menu.lst

This post is used by http://aprivatebeach.com/blog/2010/05/upgrading-ubuntu-8-04-hardy-to-10-04-lucid/ to edit the GRUB.  It seems there are two versions of the GRUB that maybe installed, therefore, I have provided both with tips on how to modify them.

In order to edit this file, one will have to hold down the Alt key and press the F2 key.  In the text box that appears, one will have to type gksu gedit /boot/grub/menu.lst

If one wishes to use the command prompt instead, replace gksu with sudo.

I have highlighted the stuff that one may want to edit in bold.  For a more detailed description of the lines bolded, please look at http://aprivatebeach.com/blog/2000/01/grub-cfg/.

# menu.lst – See: grub(8), info grub, update-grub(8)
#            grub-install(8), grub-floppy(8),
#            grub-md5-crypt, /usr/share/doc/grub
#            and /usr/share/doc/grub-doc/.

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify ‘saved’ instead of a number. In this case, the default entry
# is the entry saved with the command ‘savedefault’.
# WARNING: If you are using dmraid do not use ‘savedefault’ or your
# array will desync and will not let you boot your system.
default        0

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout        10

## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
#hiddenmenu

# Pretty colours
#color cyan/blue white/blue

## password [‘–md5’] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line)  and entries protected by the
# command ‘lock’
# e.g. password topsecret
#      password –md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret

#
# examples
#
# title        Windows 95/98/NT/2000
# root        (hd0,0)
# makeactive
# chainloader    +1
#
# title        Linux
# root        (hd0,1)
# kernel    /vmlinuz root=/dev/hda2 ro
#

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
##      kopt_2_6_8=root=/dev/hdc1 ro
##      kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=UUID=748059b1-aaed-47bd-a36f-8160e2fabf68 ro

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,8)

## should update-grub create alternative automagic boot options
## e.g. alternative=true
##      alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
##      lockalternative=false
# lockalternative=false

## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=quiet splash

## should update-grub lock old automagic boot options
## e.g. lockold=false
##      lockold=true
# lockold=false

## Xen hypervisor options to use with the default Xen boot option
# xenhopt=

## Xen Linux kernel options to use with the default Xen boot option
# xenkopt=console=tty0

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
##      altoptions=(recovery) single
# altoptions=(recovery mode) single

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
##      howmany=7
# howmany=all

## specify if running in Xen domU or have grub detect automatically
## update-grub will ignore non-xen kernels when running in domU and vice versa
## e.g. indomU=detect
##      indomU=true
##      indomU=false
# indomU=detect

## should update-grub create memtest86 boot option
## e.g. memtest86=true
##      memtest86=false
# memtest86=true

## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false

## should update-grub add savedefault to the default options
## can be true or false
# savedefault=false

## ## End Default Options ##

title        Ubuntu 10.04 LTS, kernel 2.6.32-23-generic
root        (hd0,8)
kernel        /boot/vmlinuz-2.6.32-23-generic root=UUID=748059b1-aaed-47bd-a36f-8160e2fabf68 ro quiet splash
initrd        /boot/initrd.img-2.6.32-23-generic
quiet

title        Ubuntu 10.04 LTS, kernel 2.6.32-23-generic (recovery mode)
root        (hd0,8)
kernel        /boot/vmlinuz-2.6.32-23-generic root=UUID=748059b1-aaed-47bd-a36f-8160e2fabf68 ro  single
initrd        /boot/initrd.img-2.6.32-23-generic

title        Ubuntu 10.04 LTS, memtest86+
root        (hd0,8)
kernel        /boot/memtest86+.bin
quiet

### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below from the Debian
# ones.
title        Other operating systems:
root

# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
title        Windows Vista/Longhorn (loader)
root        (hd0,0)
savedefault
makeactive
chainloader    +1

Gregorian calendar that extends from CustomCalendar

<?php
require ‘CustomCalendar.php’;
/**
* Description of gregorianCalendar
*
* @author David
*/
class CustomGregorianCalendar extends CustomCalendar {

private $months = array();
private $daysOfWeek=array();
/* number of days in every month.
* Thirty days hath September,
* April, June, and November.
* All the rest have thirty-one,
* Excepting February alone,
* Which hath twenty-eight days clear,
* And twenty-nine in each leap year.
*/
/**
* Creates a Gregorian calendar for the year given.<br>
*
* @author David
* @param integer $y
* Takes a 4 digit year to create a calendar for.
* @return nothing
*/
function __construct($y=’2010′) {
print “finished gregorian funciton”;
$daysInMonth = array
(“SEPTEMBER”=>30, “APRIL”=>30, “MAY”=>30, “NOVEMBER”=>30,
“JANUARY”=>31, “FEBRUARY”=>28, “MARCH”=>31, “APRIL”=>31,
“JULY”=>31, “AUGUST”=>31, “OCTOBER”=>31, “DECEMBER”=>31);
$this->daysOfWeek = array
(“SUNDAY”,”MONDAY”,”TUESDAY”,”WEDNESDAY”,”THURSDAY”
,”FRIDAY”,”SATURDAY”);
/* Number of days in each month if not a leap year */
$this->months = array(“JANUARY”, “FEBRUARY”, “MARCH”, “APRIL”, “MAY”, “JUNE”,
“JULY”, “AUGUST”, “SEPTEMBER”, “OCTOBER”, “NOVEMBER”, “DECEMBER”);
$this->setDaysInMonth($daysInMonth);
/* February has 29 days in a leap year */
if($this->isLeapYear($y)) {
$daysInMonth[$months[1]]=29;
}
parent::__construct($y, $daysInMonth);
$this->setFirstDayOfMonths($y);
}

/**
* Determines if year is a leap year.
*
* @author David
* @param integer $year
* Returns true if year is a leap year and false if it is not.
* @return bool
*/
/*
* if year modulo 400 is 0
* then is_leap_year
* else if year modulo 100 is 0
* then not_leap_year
* else if year modulo 4 is 0
* then is_leap_year
* else not_leap_year
*/
function isLeapYear($year) {
/* Year is a leap year */
//        if (!($year%400))
//            return true;
/* Year is not a leap year */
//        if (!($year%100))
//            return false;
/* Year is a leap year */
if (!($year%4))
return true;
/* Year is not a leap year by default */
return false;
}

/**
* Determine on what day of the week the 1st of month starts at.<br>
* returns first 3 letters of day of week.
*
* @author David
* @param integer|string $y,$m
* $y=year of calendar to work with<br>
* $m=first 3 letters of month we are working with<br>
* @return string
*/
function startOfWeek($y, $m=”january”) {
$d=1;
$findDay;
$monthCodes= array
(“January”=>6, “February”=>2, “March”=>2, “April”=>5,
“May”=>0, “June”=>3, “July”=>5, “August”=>1,
“September”=>4, “October”=>6, “November”=>2, “December”=>4);
/*
* 1.  Take the last 2 digits of the year and add a quarter onto
* itself. (04 + 1 = 5)
* 2. Get the corresponding code for the month.
* (January = 6, February = 2, March = 2, etc.
* See month codes for details). July = 5
* 3. Take the day. (=13)
* 4. Add the numbers together (5 + 5 + 13 = 23)
* 5. Take away 7 (or multiples of 7) until a number from 1-7
* is left. (23 – 21 =2)
* 6. This number corresponds to the day of the week.
* (1 = Monday, 2 = Tuesday, etc.) In this case 2 = Tuesday
*/
$findDay=(($y-2000)+(floor(($y-2000)/4)));
$findDay+= $monthCodes[$m]+$d;
if ($findDay>7)
$findDay %= 7;
if($this->isLeapYear($y)) {
if((strcmp($m,”january”)==0)||(strcmp($m,”february”)==0)) {
$findDay-=1;
}
}
return $this->daysOfWeek[$findDay];
}

/**
* Given the year, this function will find the day that the 1st
* lands on for every month.  Week starts on Sunday.  The list is
* stored in Calendar.php as a string and can be retrieved using
* getDayOfWeekStart($m) where $m is month we are looking for.
* @param integer $y
* $y is the 4 digit year stored as an integer
* @return nothing
* @author David
*/
function setFirstDayOfMonths($y) {
$month=array();
foreach($months as $v) {
$month[$v]=$this->startOfWeek($y, $v);
}
$this->setDayOfWeekStart($month);
}

function getMonths() {
print(“in getMonths”);
return $this->months;
}

/**
* Given the date in year, month, day format, this function will determine
* if the date submitted is valid.
* @param string $year, $month, $day
* @return boolean
* @author David
*/
function validDate($year, $month, $day) {
$numberOfDays=1;
if ($month==$months[1]) {
if ($this->isLeapYear($year)) {
$numberOfDays=29;
}
else
$numberOfDays=28;
}
else
$numberOfDays = $this->getDaysInAMonth($month);
if ($numberOfDays>=$day)
return true;
return false;
}

function getDaysOfWeek(){
return $this->daysOfWeek;
}

function convertToArmyTime($hour){
return $hour+12;
}

function convertMonthToNumber($m){
return array_search($m, $this->months)+1;
}

function splitDate($date, $search){
print ‘got here’;
$chunks = explode(‘-‘, $date);
if ($search == ‘year’)
return $chunks[0];
if ($search == ‘month’)
return $chunks[1];
if ($search == ‘day’)
return $chunks[2];
return “error”;
}
}
?>

Generic calendar

<?php
/**
* Generic calendar class.  Contains the variables
* and methods that are common to all calendar
* variations now and in the future.<br/>
* Variables:<br/>
* daysInMonth = array with month -> number of days pairs<br/>
* year = year the calendar is for<br/>
* dayOfWeekStart = what day does the 1st of January start at<br/>
*
* IMPORTANT: Method overloading is not possible. Therefore, getDays()
* and getDays($value) methods will crash program.
*
* @author David
*
*/
class CustomCalendar {
private $daysInMonth;
private $year;
private $dayOfWeekStart;

/**
* Set Calendar class with month->number of days value
* and the year.  Month is the first 3 letters of each month.
* Example January=jan, February=feb, etc… <br/>
* @param integer|array $y,$dim
* $y=year $dim=month-># of days pair
* @return nothing
* @author David
*/
function __construct($y, $dim) {
$this->setYear($y);
$this->setDaysInMonth($dim);
}

/**
* Set days in month with month -> day pairs<br/>
*
* @author David
* @param array $dim
* “first 3 letters of month” => # of
*  days in month pairs
* @return nothing
*/
function setDaysInMonth($dim) {
$this->daysInMonth=$dim;
}

/**
* Get all month -> day pairs<br/>
* return all months -> # of days pairs
*
* @author David
* @param none
* @return array
*/
function getDaysInMonth() {
return $this->daysInMonth;
}

/**
* Get days for a specific month only<br/>
* returns the # of days in the month specified
*
* @author David
* @param String $m
* first 3 letters of month to return the # of days
* @return integer
*/
function getDaysInAMonth($m) {
return $this->daysInMonth[$m];
}

/**
* Set the year of the calendar.
*
* @author David
* @param integer $y
* Year this calendar is for
* @return nothing
*/
function setYear($y) {
$this->year=$y;
}

/**
* Get the year of this calendar<br/>
* returns the year this calendar is for
*
* @author David
* @param none
* @return integer
*/
function getYear() {
return $this->year;
}

/**
* Get the day of the 1st of the month specified
* returns the day
* @param string $d
* $d is a string representation of the month
* @return string
* @author David
*/
function getDayOfWeekStart($d){
return $this->$dayOfWeekStart[$d];
}

/**
* Sets the variable dayOfWeekStart with the day that the
* 1st of each month lands on with $d being an array of
* month(key)=>day(value) pair.
* @param array $d
* @return nothing
* @author David
*/
function setDayOfWeekStart($d){
$this->dayOfWeekStart=($d);
}
}
?>

PHP open database

<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

/**
* Description of TestDatabases
*
* @author user
*/
function openDatabase() {
if($db = new PDO(“sqlite:/apacheWebsite/Calendar/database/database.data”)) {
$db->exec(‘CREATE TABLE calendar (id INTEGER PRIMARY KEY,
title TEXT, description TEXT, startDate TEXT,
startTime TEXT, endDate TEXT, endTime TEXT)’);
}
else print ‘could not create database’;
$db->null;

//   $result = $db->query(‘SELECT * FROM calendar’);
//   var_dump($result->fetchArray());
}

function insertIntoDatabase($record) {
if ($db = new PDO(“sqlite:/apacheWebsite/Calendar/database/database.data”)) {
$sql = “INSERT INTO calendar (title, description, startDate,
startTime, endDate, endTime) VALUES (:title,
:description,:startDate,:startTime,
:endDate,:endTime)”;
print ‘show data for title ‘.$_POST[‘title’];
$sth = $db->prepare($sql, array(PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY));
$sth->execute(array(‘:title’=>$_POST[‘title’],’description’=>$_POST[‘description’],
‘:startDate’=>$_POST[‘startDate’], ‘:startTime’=>$record[0],
‘:endDate’=>$record[1], ‘:endTime’=>$record[2]))
or die(print_r($db->errorInfo(), true));
}
else print ‘problem loading data into database’;
}

function retrieveFromDatabase($startDate) {
$db = new SQLite3(“calendar.data”);
print(‘SELECT * FROM calendar WHERE startDate = “2005-05-12″‘);
$result = $db->query(‘SELECT * FROM calendar WHERE startDate= ‘.'”‘.$startDate.'”‘);
while ($row = $result->fetchArray()) {
var_dump($row);
}
//        return $result;

}

//retrieveFromDatabase(“2005-05-12”);

?>