Tuesday, December 1, 2009

The Sound The Hare Heard


Been so busy worrying about cords to cut, I've been falling behind in my role as sensei. Here's a collection of Buddha readings. On top of the page is the story about alcohol. "The Sound the Hare Heard" is somewhere in the middle of the page: THUD!

The sound the hare heard is also a collection of songs from various indie singer-songwriters. Good for long evenings that extend to dawn, the full moon reviving the cords I've tried hard to cut. Sigh!

Tuesday, September 22, 2009

Sunday, June 14, 2009

WAMP

lamp then wamp

traditionally you have to install the server first before php. tested the installer package and the WAMP server was running in a breeze.

Now Gugu & i can start writing php tags already. Hello world!

Friday, June 5, 2009

Best Practice

In many cases, the record pointer moves when commands are issued.

Best to commit needed field values to memvars before new commands are issued. Not always necessary but it is best to make a HABIT of using memvars.

Friday, May 15, 2009

Timnah nosmas

Philistine
riddle --> 30 sets of clothes
2-timer married a friend
another 1000 killed

Gaza, Delilah
"secret" of strength
gouged eyes
2 columns down

alternate take
whence the wonder bread
another take
i'll have alcohol instead

Incremental Search

combobox, keypress, lostfocus


#DEFINE DELKEY 127
LPARAMETERS nKeyCode, nShiftAltCtrl
LOCAL cDisplayValue
IF nKeyCode = DELKEY
cDisplayValue = ALLTRIM(THIS.DisplayValue)
IF LEN(m.cDisplayValue)=1
cDisplayValue = ""
ELSE
cDisplayValue = LEFT(cDisplayValue,LEN(cDisplayValue)-1)
ENDIF
ELSE
cDisplayValue = ALLTRIM(THIS.DisplayValue)+CHR(nKeyCode)
ENDIF

THISFORM.LockScreen = .T.
DO CASE
CASE EMPTY(m.cDisplayValue)
THISFORM.grdcust.recordsource = " "
CASE THIS.Value = "(All)"
SELECT country AS location,* FROM CUSTOMER;
INTO CURSOR Custs
thisform.grdcust.recordsource = "Custs"
OTHERWISE
SELECT country AS location,* FROM CUSTOMER ;
WHERE UPPER(ALLTRIM(Customer.Country)) = UPPER(m.cDisplayValue);
INTO CURSOR Custs
thisform.grdcust.recordsource = "Custs"
ENDCASE
THISFORM.ResetCombos(THIS)
THISFORM.LockScreen = .F.


lostfocus

LOCAL cDisplayValue,cSqlStr,cCountryName
cDisplayValue = ALLTRIM(THIS.DisplayValue)
THIS.SelLength = 0
IF EMPTY(m.cDisplayValue)
RETURN
ENDIF

THISFORM.LockScreen = .T.

IF THIS.Value = "(All)"
SELECT country AS location,* FROM CUSTOMER INTO CURSOR Custs
thisform.grdcust.recordsource = "Custs"
ELSE
SELECT country AS location,* FROM CUSTOMER ;
WHERE UPPER(ALLTRIM(Customer.Country)) = UPPER(m.cDisplayValue);
INTO CURSOR Custs
thisform.grdcust.recordsource = "Custs"
IF _TALLY #0
cCountryName = ALLTRIM(Custs.Country)
IF ATC(m.cCountryName,THIS.RowSource) = 0 AND !EMPTY(m.cCountryName)
THIS.RowSource=THIS.RowSource+","+m.cCountryName
ENDIF
THIS.Value = m.cCountryName
ENDIF
ENDIF
THISFORM.ResetCombos(THIS)
THISFORM.LockScreen = .F.

Saturday, April 11, 2009

My Chat Room

Codes to jump to Top or Bottom. New chat room at the bottom.

TopBottom

Badge

My Facebook Badge. Click to view my profile. No picture. Very little info. Only to demonstrate badge linking.


Jango Jukebox

Not autoplay. Never autoplay. Always leave the option to visitor whether to play the media or not. This will respect their bandwidths.


Friday, February 13, 2009

Cryptic

HKLM/S/Ms/Win/CVers/Expl/Advanced/Folder/Hidden/SHOWALL

Disable = 0
Enable = 1

Sunday, February 1, 2009

Tinumis

When I was a child, Sundays being the market day in our town in Norzagaray, our extended family would infrequently be feasting on Tinumis, the BulaqueƱo's heirloom blood stew. This is not the common Dinuguan, which I first met in Manila where I spent my high school days. Tinumis' soup base is not thick and there would be less liquid; and the meat is meat, not innards/offal. We use chopped young tamarind leaves, not vinegar. I remember climbing tamarind trees to gather a cup or two of young leaves. Of course there would always be Jalapeno pepper.

In our household, we would also extend the dish with sitao (string beans) or other neutral tasting vegetable (sayote or upo) so that more mouths could be fed. It appears now that we might be the only family which did so, as I have yet to learn of others who did the same with their Tinumis.

The pictures below are courtesy of Shalimar, a Filipina hopping all over Europe (from her wanderlust blog). The recipe is a frenchified tinumis. She used boudin noir (blood sausage) and vinegar, so it is technically dinuguan, but the look and texture is like our Tinumis.

Num2Word (Pt. 2) -- Spa

This one is from http://fox.wikis.com/wc.dll?Wiki~ConvertingNumberToWordsInSpanish~VFP

*Name: Convcant1
*Purpose: This routine converts a number in spanish words
*Input: number to be converted.(numero)
*Output: The number in spanish words (letra).
*Example: convertido=convcant1(12.5)
* ? convertido
* doce pesos 50/100 M.N.
LPARAMETERS Numero
STORE ALLTRIM(STR(Numero,12,3)) TO Cant1 && SE TOMA COMO MAXIMO NUMERO DE LONGITUD 9 CON 2 DeciMALES
Cant1= SUBSTR(Cant1,1,LEN(Cant1)-1) && para cortar y no redondear
STORE SUBSTR(Cant1,1,LEN(Cant1)-3) TO Cant2
STORE SUBSTR(Cant1,LEN(Cant1)-1,2) TO Deci
STORE MOD(LEN(Cant2),3) TO Residuo
DO CASE
CASE Residuo= 1
STORE '00' + Cant2 TO Cant2
CASE Residuo= 2
STORE '0' + Cant2 TO Cant2
ENDCASE
DO CASE
CASE LEN(Cant2)= 3
DO Converte WITH Cant2
Letra= ALLTRIM(Letra)
Letra= '('+Letra+ ' PESOS ' + Deci + '/100 M.N.)'
CASE LEN(Cant2)= 6
STORE SUBSTR(Cant2,1,3) TO Cant3
DO Converte WITH Cant3
Letra1= Letra + ' MIL '
STORE SUBSTR(Cant2,4,3) TO Cant4
DO Converte WITH Cant4
Letra2= Letra1 + Letra
Letra2= ALLTRIM(Letra2)
Letra= '('+Letra2 + ' PESOS '+Deci + '/100 M.N.)'
CASE LEN(Cant2)= 9
STORE SUBSTR(Cant2,1,3) TO Cant3
DO Converte WITH Cant3
Letra1= Letra +' MILLONES '
STORE SUBSTR(Cant2,4,3) TO Cant4
DO Converte WITH Cant4
Letra2= Letra1 + Letra + ' MIL '
STORE SUBSTR(Cant2,7,3) TO Cant5
DO Converte WITH Cant5
Letra3= Letra2 + Letra
Letra3= ALLTRIM(Letra3)
Letra= '('+Letra3+' PESOS ' + Deci + '/100 M.N.)'
ENDCASE
RETURN (Letra)

PROCEDURE Converte
PARAMETERS CantID1
PUBLIC Letra
DIMENSION Cien(16),Diez(16),UnId(16),Espec(15)
Cien(16)= SPACE(1)
Cien(1)= 'CIENTO'
Cien(2)= 'DOSCIENTOS'
Cien(3)= 'TRESCIENTOS'
Cien(4)= 'CUATROCIenTOS'
Cien(5)= 'QUINIENTOS'
Cien(6)= 'SEISCIENTOS'
Cien(7)= 'SETECIENTOS'
Cien(8)= 'OCHOCIENTOS'
Cien(9)= 'NOVECIENTOS'
Diez(16)= SPACE(1)
Diez(1)= 'DIEZ'
Diez(2)= 'VEINTE'
Diez(3)= 'TREINTA'
Diez(4)= 'CUARENTA'
Diez(5)= 'CINCUENTA'
Diez(6)= 'SESENTA'
Diez(7)= 'SETENTA'
Diez(8)= 'OCHENTA'
Diez(9)= 'NOVENTA'
UnId(16)= SPACE(1)
UnId(1)= 'UN'
UnId(2)= 'DOS'
UnId(3)= 'TRES'
UnId(4)= 'CUATRO'
UnId(5)= 'CINCO'
UnId(6)= 'SEIS'
UnId(7)= 'SIETE'
UnId(8)= 'OCHO'
UnId(9)= 'NUEVE'
Espec(10)= 'DIEZ'
Espec(11)= 'ONCE'
Espec(12)= 'DOCE'
Espec(13)= 'TRECE'
Espec(14)= 'CATORCE'
Espec(15)= 'QUINCE'
STORE VAL(SUBSTR(CantID1,2,2)) TO Num1
STORE VAL(SUBSTR(CantID1,3,1)) TO Num2
STORE VAL(SUBSTR(CantID1,1,1)) TO Num3
STORE VAL(SUBSTR(CantID1,2,1)) TO Num4
IF Num3= 0
Num3= 16
ENDIF
IF Num4= 0
Num4= 16
ENDIF
DO CASE
CASE Num1 >= 1 AND Num1 <= 9
Letra= Cien(Num3) +SPACE(1)+ UnId(Num1)
CASE Num1 >= 10 AND Num1 <= 15
Letra= Cien(Num3) +SPACE(1)+ Espec(Num1)
CASE Num2= 0
Letra= Cien(Num3) +SPACE(1)+ Diez(Num4)
CASE Num2 # 0
Letra= Cien(Num3)+SPACE(1) + Diez(Num4)+' Y ' + UnId(Num2)
ENDCASE

Saturday, January 31, 2009

Convert Number/Currency to Words

This article is from http://support.microsoft.com/kb/259663

To create the ConvertCurrencyToEnglish() function, follow these steps:

  1. Create a new program and save it as ConvertCurrencyToEnglish:
  2. Copy and paste the following code to the new program:


  3. *FUNCTION ConvertCurrencyToEnglish
    LPARAMETERS tNumToConvert
    LOCAL Temp
    LOCAL NumToConvert
    LOCAL cPesos, cCentavos
    LOCAL nDecimalPlace, nCount
    LOCAL ARRAY aPlace[9]

    DO CASE
    CASE EMPTY(tNumToConvert)
    NumToConvert = "0"
    CASE TYPE("tNumToConvert") = "N" && Convert to positive character string
    *!* Check to see if the number is too big for VFP. If the number is too large, exit
    IF tNumToConvert > 9999999999999.99
    RETURN "**,***,***,***,***.**"
    ENDIF
    * Convert tnNumToConvert to a positive string, trimming extra spaces.
    NumToConvert = ALLTRIM(STR(ABS(tNumToConvert), 16, 2))
    OTHERWISE && Parameter is character based, make sure it is not negative.
    * Convert the number to a positive number.
    NumToConvert = IIF(LEFT(ALLTRIM(tNumToConvert), 1) = "-", SUBSTR(ALLTRIM(tNumToConvert), 2), ALLTRIM(tNumToConvert))
    ENDCASE

    * Find decimal place.
    nDecimalPlace = AT(".", NumToConvert)

    STORE "" TO cPesos, cCentavos, Result

    aPlace = ""
    aPlace[2] = " Thousand "
    aPlace[3] = " Million "
    aPlace[4] = " Billion "
    aPlace[5] = " Trillion "
    aPlace[6] = " Quadrillion "
    aPlace[7] = " Quintillion "
    aPlace[8] = " Sextillion "
    aPlace[9] = " Septillion "


    * If you find decimal place...
    IF nDecimalPlace > 0
    * Convert centavos
    Temp = LEFT(SUBSTR(NumToConvert, nDecimalPlace + 1) + "00", 2)
    cCentavos = ConvertTens(Temp)

    * Strip off centavos from remainder to convert.
    NumToConvert = ALLTRIM(LEFT(NumToConvert, nDecimalPlace - 1))
    ENDIF

    nCount = 1
    DO WHILE NOT NumToConvert == ""
    * Convert last 3 digits of NumToConvert to Pesos.
    Temp = ConvertHundreds(RIGHT(NumToConvert, 3))
    IF NOT Temp == ""
    cPesos = Temp + aPlace[nCount] + cPesos
    ENDIF
    IF LEN(NumToConvert) > 3 Then
    * Remove last 3 converted digits from NumToConvert.
    NumToConvert = LEFT(NumToConvert, LEN(NumToConvert) - 3)
    ELSE
    NumToConvert = ""
    ENDIF
    nCount = nCount + 1
    ENDDO

    * Clean up pesos.
    DO CASE
    CASE cPesos == ""
    cPesos = "No Pesos"
    CASE cPesos == "One"
    cPesos = "One Peso"
    OTHERWISE
    cPesos = cPesos + " Pesos"
    ENDCASE

    * Clean up centavos.
    DO CASE
    CASE cCentavos == ""
    cCentavos = " And No Centavos"
    CASE cCentavos == "One"
    cCentavos = " And One Centavo"
    OTHERWISE
    cCentavos = " And " + cCentavos + " Centavos"
    ENDCASE

    ConvertCurrencyToEnglish = cPesos + cCentavos
    RETURN ConvertCurrencyToEnglish
    ENDFUNC

    FUNCTION ConvertHundreds
    LPARAMETERS NumToConvert
    LOCAL Result
    Result = ""

    * Exit if there is nothing to convert.
    IF VAL(NumToConvert) = 0
    RETURN Result
    ENDIF

    * Append leading zeros to number.
    NumToConvert = RIGHT("000" + NumToConvert, 3)

    * Do you have a hundreds place digit to convert?'
    IF LEFT(NumToConvert, 1) <> "0" Then
    Result = ConvertDigit(LEFT(NumToConvert, 1)) + " Hundred "
    ENDIF

    * Do you have a tens place digit to convert?'
    IF SUBSTR(NumToConvert, 2, 1) <> "0" Then
    Result = Result + ConvertTens(SUBSTR(NumToConvert, 2))
    ELSE
    * If not, then convert the ones place digit.
    Result = Result + ConvertDigit(SUBSTR(NumToConvert, 3))
    ENDIF

    ConvertHundreds = ALLTRIM(Result)
    RETURN ConvertHundreds
    ENDFUNC

    FUNCTION ConvertTens
    LPARAMETERS MyTens
    LOCAL Result
    Result = ""

    * Is value between 10 and 19?'
    IF VAL(LEFT(MyTens, 1)) = 1
    DO CASE
    CASE VAL(MyTens) = 10
    Result = "Ten"
    CASE VAL(MyTens) = 11
    Result = "Eleven"
    CASE VAL(MyTens) = 12
    Result = "Twelve"
    CASE VAL(MyTens) = 13
    Result = "Thirteen"
    CASE VAL(MyTens) = 14
    Result = "Fourteen"
    CASE VAL(MyTens) = 15
    Result = "Fifteen"
    CASE VAL(MyTens) = 16
    Result = "Sixteen"
    CASE VAL(MyTens) = 17
    Result = "Seventeen"
    CASE VAL(MyTens) = 18
    Result = "Eighteen"
    CASE VAL(MyTens) = 19
    Result = "Nineteen"
    OTHERWISE
    ENDCASE
    ELSE
    * .. otherwise it's BETWEEN 20 AND 99.
    DO CASE
    CASE VAL(LEFT(MyTens, 1)) = 2
    Result = "Twenty "
    CASE VAL(LEFT(MyTens, 1)) = 3
    Result = "Thirty "
    CASE VAL(LEFT(MyTens, 1)) = 4
    Result = "Forty "
    CASE VAL(LEFT(MyTens, 1)) = 5
    Result = "Fifty "
    CASE VAL(LEFT(MyTens, 1)) = 6
    Result = "Sixty "
    CASE VAL(LEFT(MyTens, 1)) = 7
    Result = "Seventy "
    CASE VAL(LEFT(MyTens, 1)) = 8
    Result = "Eighty "
    CASE VAL(LEFT(MyTens, 1)) = 9
    Result = "Ninety "
    OTHERWISE
    ENDCASE

    * Convert ones place digit.
    Result = Result + ConvertDigit(RIGHT(MyTens, 1))
    ENDIF
    ConvertTens = Result
    RETURN ConvertTens
    ENDFUNC

    FUNCTION ConvertDigit
    LPARAMETERS MyDigit
    DO CASE
    CASE VAL(MyDigit) = 1
    ConvertDigit = "One"
    CASE VAL(MyDigit) = 2
    ConvertDigit = "Two"
    CASE VAL(MyDigit) = 3
    ConvertDigit = "Three"
    CASE VAL(MyDigit) = 4
    ConvertDigit = "Four"
    CASE VAL(MyDigit) = 5
    ConvertDigit = "Five"
    CASE VAL(MyDigit) = 6
    ConvertDigit = "Six"
    CASE VAL(MyDigit) = 7
    ConvertDigit = "Seven"
    CASE VAL(MyDigit) = 8
    ConvertDigit = "Eight"
    CASE VAL(MyDigit) = 9
    ConvertDigit = "Nine"
    OTHERWISE
    ConvertDigit = ""
    ENDCASE
    RETURN ConvertDigit
    ENDFUNC


  4. Save the program as convertcurrencytoenglish.prg
  5. To test this program, type the following line in the Command window, and then press ENTER: ConvertCurrencyToEnglish(1234.56)

  • NOTE: The largest number that this program accomodates is 9,999,999,999,999.99 due to product limitations.

    Monday, January 26, 2009

    Having them back


    Having a what they called "friends" in a long time is a treasure, but letting them go and giving up for the friendship, is a LOST. Now i realized that no matter how far, no matter how busy person you are, no matter what, you have to take care of it, because you can never have them back when its too late.

    Sunday, January 18, 2009

    Forgot Admin PW

    1. Log-on using Administrator as user with blank pw. This works 90% of the time. But some people put pw's on the administrator account, so you have to use other means.

    2. Reset the administrator pw to blank. This is done by using a bootable media (floppy, CD, or flash disk). Examples:

    a) EBCD (Emergency Boot CD). 18MB available at http://www.simtel.net/product.download.mirrors.php?id=80024. Read more details at http://ebcd.pcministry.com/

    b) There's a small Linux boot disk small enough to fit in a floppy and which resets the administrator pw to blank. Still looking for the site.

    c) Offline NT Password & Registry Editor (v080526 - May 2008) written by Petter Nordahl-Hagen, available at http://home.eunet.no/pnordahl/ntpasswd/bd080526.zip (less than 1.4 MB for floppy boot disk), and at http://home.eunet.no/pnordahl/ntpasswd/cd080526.zip (around 3MB for mini-CD boot disk).