Author Archive

Updating Blog

by admin | September 5, 2008 | In Updates No Comments

In the process of updating Wordpress to the latest version, since in the few months there's a security flaw in my previous version. It's been serious because Google flagged my site as having malware, I never noticed this since I've updated Firefox into version 3 which has an notifier on sites that are having malware. The attacker use an xmlrpc to edit post in my Wordpress Blog, having an iframe calling a suspicious site that automatically been called when my site is loaded.

Also in the process of changing the site design.

Cleaning up

by admin | September 3, 2008 | In Updates No Comments

Been busy this following days, swamped by request and a conflict in my schedule. There's a lot have been change and lot have been learned. One is the use of right tools in my development process. If not carefully reviewed and look upon it will result in a mess.

One is using Firefox addons, I've installed Skype and upon installation it updated Firefox 3 to have add-ons showing Skype and replacing some kind of formatting in phone numbers. Once in FCKEditor and editing content, the editor gets the layout and the style formatting. You will not see it Firefox but when the client views it on another browser it will result in missing images.

Another is using Google Toolbar highlighting feature, FCKEditor will get it's style formatting once in the editor area.

As of yesterday there's a new browser from Google which they named Chrome and the rendering engine is based on webkit which is from KDE and Safari also uses webkit. The enhancement of the javascript engine, they named it V8, it is worth noticing in AJAX extensive sites, like in Gmail and other Social Networking Sites.

The experience is very good not only for the techies but also for the average internet user, my wife got curious and used it in accessing her friendster account. She was very pleased about the loading time and the large screen without the clog like she is used to in Internet Explorer. I have been encouraging her to use Firefox for nearly a year and without success she didnt switch using it as her default browser. But in Chrome she like it very much.

Before you freaked out because you cannot see images on friendster.com and call Smartbro support representative. Then the support rep would tell you the problem is on the friendster.com domain and not on their servers.

Well the real truth is the problem is on SmartBro's DNS servers. My friend Mike posted an article that the DNS has been hacked, visit here.

Just change your DNS servers to a working one:

69.64.155.148
121.1.3.208
121.1.3.199
121.1.3.250
168.95.1.1

I've written a small C program, which would determine the maximum name length of directory and filename. I found out that there are different constants on different machines and OS.

Here's one for windows:

 
/* Language: C */
#include <stdio.h>
 
#include <unistd.h>
 
#include
<limits.h>
 
main(){
 
 printf("Maximum path size is %d\n", PATH_MAX);
 printf("File max is %d\n", FILENAME_MAX);
 
}
 

Here's a version on Linux:

 
/* Language: C */
#include <stdio.h>
 
#include <unistd.h>
 
#include
<limits.h>
 
main(){
 
 printf("Maximum path size is %d\n", PATH_MAX);
 printf("File max is %d\n", NAME_MAX);
 
}
 

Heres for the POSIX compliant OS

 
/* Language: C */
#include <stdio.h>
 
#include <unistd.h>
 
#include
<limits.h>
 
main(){
 
 printf("Maximum path size is %d\n",POSIX_PATH_MAX);
 printf("File max is %d\n", _POSIX_NAME_MAX);
 
}
 

Editing post

by admin | May 21, 2008 | In Updates No Comments

To my avid readers, as you would notice there are some codes on my blog post. As not to get confused I'll be including a language description to some post, so not the readers may not guess in what particular language it has been written.

A day in C++ and MYSQL

by admin | May 20, 2008 | In Updates No Comments

It has been an end to my C++ class last Sunday, which I've enjoyed the 5 weeks training. Thanks to my trainor who is not so selfish in sharing his knowledge to his students. Kudos to Ernest Bercilla, a full time applications trainor of ITTC.

Mostly all of the languages I've learned it was just self taught, actually this was my first time acquiring a knowledge in a programming language on a training. Well as day one in my class, my objective was to write C++ code to connect to the MYSQL API, which I did now because of the foundation that I've learned during the training.

Here's the steps, how I've used MySQL API, my C++ Ide is codeblocks
1. download a library from http://devpaks.org/ , find the ones for mysql under database.
2. extract the package, am using 7-zip, so DevPak files is supported.
3. create a mysql folder under the C:\Program Files\CodeBlocks\MinGW\include
4. copy the include from the content of libmysql to the folder that has been created.
5. set the library and point it to the location of libmysql.a

6. To test create a database and a table name.

Here's my sample code:

 
/* Language : C++ */
 
#include <windows.h>
#include <iostream>
#include <mysql/mysql.h>
 
using namespace std;
 
int main() {
    //connection params
    char *host = "localhost";
    char *user = "root";
    char *pass = "";
    char *db = "cardsauce";
 
    //sock
    MYSQL *conn; //pointer
    MYSQL_RES *res;//pointer
    MYSQL_ROW row;
 
    conn = mysql_init(0);
    if (!conn){
         cout << "sock handle failed!" << mysql_error(conn) << endl;
    }
 
    //connection
    if (!mysql_real_connect(conn, host, user, pass, db, 0, NULL, 0)){
        cout << "connection fail: " << mysql_error(conn) << endl;
    }
 
    mysql_query(conn,"SELECT * FROM users");
 
    res = mysql_use_result(conn);
 
    while (row = mysql_fetch_row(res)) {
        cout << row[0] << " " << row[1] << endl;
 
    }
 
    //closing connection
    mysql_close(conn);
 
    return EXIT_SUCCESS;
}
 

There's a new upgrade to my favorite PHP Editor, here's the latest improvements.

What's new?

Although we did not manage to do everything that was planned (as usually), a lot of work has been done and a lot of good stuff has been added.

Please note that some items apply only to the top of the range products, for example, PHP auto complete improvements apply to Rapid PHP 2008 and WeBuilder 2008 only.

+ Added Big: Secure FTP support
+ Added Big: Re-wamped, faster File Explorer
+ Added Big: CVS / SVN Support (via 3rd party clients e.g. TortoiseSVN and shell menu - TortoiseSVN icons are now visible and shell menus are accessible)
+ Added Big: Code templates
+ Added Big: HTML Tag block highlighting
+ Added Big: Missing HTML tag highlighting
+ Added Big: Highlighting of missing brackets
+ Added Big: Existing tag editing via dialog windows
+ Added Big: Right-click tag editing via dialog windows
+ Added Big: Realtime PHP & Ruby syntax check
+ Added Big: Ruby code explorer
+ Added Big: Ruby auto complete
+ Added Big: Code collapse based on code
+ Added Big: Better X-Ray (width, height, size labels, properties)
+ Added Big: Language Browser replaces Object and Markup browsers
+ Added: Reload from FTP command
+ Added: Auto close curly brackets (optional)
+ Added: Auto indent curly brackets (optional)
+ Added: Select between braces
+ Added: Gutter-click close to the left side (16 pixels) sets break-point for PHP files
+ Added: PHP auto-complete and function hints read also includes
+ Added: Allow HTML features in JavaScript code
+ Added: Clear all breakpoints
+ Added: Closing HTML tag auto complete
+ Added: Open file at cursor for PHP
+ Added: All PHP code can now be highlighted with solid background
+ Added: Focus inspector row based on selected CSS property
+ Updated: USB support is now more robust
+ Updated: Settings export now works better
+ Updated: Load parsers only as needed (0,2 sec load time increase on QuadCore, mor eon slow pcs)
+ Updated: Updated entities file / special character replacement
+ Updated: Removed "Editors", replaced with "Programs" + parameter support
+ Updated: New looks for the Welcome wizard
+ Updated: Replace tokens now can use single input multiple times
+ Fixed: Can now save hidden files
+ Fixed: Toolbars on Vista aero
+ Fixed: Problems with buggy FTP servers not understanding LIST -al params, now params can be set by user.
+ Fixed: Ctrl+A now works in find dialog
+ Fixed: Show hour-glass cursor while tidy works for long files
+ Fixed: Convert style blocks rel=stylesheet is now rel="stylesheet"
+ Fixed: Re-load file explorer on project edited to refresh file types
+ Fixed: Preview temp file for CSS is generated only preview pressed
+ Fixed: Editor now scrolls automatically when Backspace pressed and caret not far from edge
+ Fixed: Style block selection bug http://forums.blumentals.net/viewtopic.php?p=9306#9306
+ Fixed: Related styles now work with mixed case class names
+ Over 50 other fixes and improvements

During the weekends I have to change and move my sites to Hostgator , it's sad because three years I've been with my past host I think was good, due to the nature of my job I didn't monitor it very well. ( Just to wait for the check every month) , I didn't know that I can earn much more on a reliable host. I found out that my past host has been several times timing out when large request has been made.

I was in shock that a reliable makes a big difference, if you dont know what I am talking about signup with Hostgator and move a test site. Youll see the difference best of all it has a money back guarantee.

The domain which my cousin Jonathan and I co-managed was off line for about 2 weeks, he forgot to renew the domain. During this period we asked the philhosting.net support to solved our issue. Thus I use my paypal account to add funds to the reseller account, unfortunately on their website it does not update the added funds on the account. It took them about more than a week to resolve the issue.

In accessing radio button using javascript, it must be searched first on which boxed is checked to get the value.

 
/* Language : Ecma a.k.a. Javascript */
 
function get_radio_value(){
var oRadio=document.form_name.radio_name;
    for (i=0;i<oRadio.length;i++) {
     if (oRadio[i].checked) {
	  radio_value = oRadio[i].value;
     }
    }
}
 

MySQL versions 4.0 used a different timestamps rather than 4.1 and above.

Example:

Version 4.0 and below - 20080331152726
Version 4.1 and above - 2008-03-31 15:27:26

In order to protect files from viewing or downloading by using .htaccess

 
<Files *.ext>
Order allow,deny
Deny from all
</Files>
 

sometimes little things count much. ;)