Pages

Monday, May 23, 2011

Blogger VS Wordpress

Images from iconfinder.com

One reason to stay in Blogger community is about monetary matters. If you aim for free blogs/ sites/ online presence with good - looking pages (not just a page, but really good - looking pages), then BLOGGER is your best shot. I have tried wordpress and I didn't like their theme update rule because, primarily, I'm broke. In wordpress, you have to buy the domain first to upload a custom theme that you made or downloaded. Since I cannot afford this kind of treatment and settings, I deleted all my blogs there. I cannot stand to edit the CSS, though I could, it will take time. Blogger, on the other hand, is where you can freely manipulate the layout of your blog. This is what FREE is all about.


Here are some links to great blogger themes:
http://www.deluxetemplates.net/
http://www.bloggertheme.net/

Wednesday, May 18, 2011

Emergency Load from Smart (SOS Emergency Smart Call)

 
I found out that SMART Communications offers a feature that you may use if you need an emergency load while reading Smart Extraordinary Featured Story this day. This feature is called SOS Emergency Smart Call. I wonder why they didn't advertise this when it's very helpful in many circumstances. As the name suggests itself, you may do an emergency call to SMART when you ran out of load The call will end in an instant and you'll be able to receive a text message from Smart telling you that you've been loaded with 4 pesos. Sadly, you cannot choose the amount to load, it's just 4 pesos, but, hey, if you really need a load and there's no where else to find one, this will be more than enough. The amount will be deducted from you the next time you buy electronic load for your number. :)

I repeat, call *767 from your SMART phones and you'll be loaded with FOUR (4) pesos.


***

Wednesday, May 4, 2011

How to maximize frame or window in Java (JFrame)

There are multiple ways but I recommend these lines of code:
        GraphicsEnvironment e = GraphicsEnvironment.getLocalGraphicsEnvironment();
        Frame fr= new Frame();
        fr.setMaximizedBounds(e.getMaximumWindowBounds());
        fr.setExtendedState(main.getExtendedState() | JFrame.MAXIMIZED_BOTH);
        fr.setVisible(true);

The code above will maximize your frame/window without hiding the taskbar (at the bottom part) in your screen except if you used undecorated frame. Any maximizing will hide your taskbar. This is according to my own experience but if you found ways to against it, please post it as  a comment. Thanks :)

Sunday, April 17, 2011

Yahoo! Mail is upgrading

 The new Yahoo! Mail interface

I just received a service announcement email from Yahoo! that asks me to upgrade to the newest version of Yahoo! Mail. For the past 8 years, I've been using the original version but I think it's time to move to the newest. There has been an invitation to upgrade last time but I did not continue because I kinda don't trust the version. It doesn't mean that I trust the version now, especially when I saw that it's still in Beta, but uh - the email said that all Yahoo! Mail users will be asked to upgrade. That means, they will eliminate the old versions, totally scrap them out. I just agreed to upgrade, thinking that there could be technical issues that they'd like to address. Like, maybe, the older version eats up a lot of space in their database, or they saw some security loopholes that they already fixed,etc.

Whichever the case, I already upgraded my account and there's no going back. Somehow I liked it. I just hope they're not going to mess up with my mails. XD

P.S. HOW TO CHANGE YOUR MAIL SKIN/ THEME

The upgrade comes with an ORANGE theme. To change this, just click OPTIONS on the upper left part of your page and click THEMES.
Select from a limited list of themes and click DONE.

I understand that there's not much to choose from for now but I expect that after the Beta version, there will be a variety and more exciting themes that we could try out.

---

Sunday, April 10, 2011

How to arrange/ sort/ list words/ sentences alphabetically in MSWord 2007

1. Highlight the items whether in TABLE or in LIST.
2. Select Home from the menu tab then click SORT button
3. Select SORT options using your preference then click OK button.


- That should work - :D

Friday, March 25, 2011

How to enable Save and Quit Tabs in Firefox 4


I was more than excited to install a new version of firefox when I heard that they already released the community - driven development of the fourth version (firefox 4). After quite some time of enjoyment with the browser's graphics and ergonomics, I found out that they DID NOT enable the window prompt to SAVE TABS. When you close the browser, all you get is a notification to CONFIRM that you are really closing the tabs.

For me this is a great BOO-HOO! I live with my tabs; When I close the browser I want to see them again the next time I open it. Good thing I found a relatively good (but not user - friendly) solution and it goes like this:

Step 1: Type about:config in the address bar. Click "I'll be careful, I promise!" button.
Step 2: Type browser.showQuitWarning in the filter tab that you will see. This will show you one row of result of browser.showQuitWarning set to false.
Step 3:  Double click the row. The Value column should have true value. Like this:

Step 4: Close the about:config tab.
That's all! Give it a shot, I hope it helps!


---


Sunday, August 22, 2010

How to remove events not used in NETBEANS

You might want to remove some events that are not used anymore in your NetBeans file project. You cannot just delete it from the code editor because NetBeans lock it, indicated by the gray color of the line of codes.
Here's how to remove those unused codes:

1. Go to the GUI builder, the Design view of your file.
2. Right click and select Properties. The default open tab is the Properties list. Select the Events tab.

3. You would see events list and what handlers these events are associated.

4. Choose the event you'd like to delete by selecting the [...] button.



5. A new dialog will pop up. Select the handler then click Remove button.

Monday, July 26, 2010

How to change any date format to DATE datatype in MySQL (Insert or Update)

 ----

Use this function:  STR_TO_DATE('date', 'format')

This accepts two parameters: date and format where date is the input raw date you want to change and format is the corresponding format relative to date that you want to change.

For example:
INSERT INTO table(date_field) VALUES(STR_TO_DATE('December 8, 2010','%M %d,%Y'));

Note: table is the name of the table in database and date_field is the name of field in DATE datatype.

The statement above shows 2 parameters date as 'December 8, 2010' and format '%M %d, %Y'. The format is the exact format of the date, so that the mysql knows from what format will it convert the date  to DATE datatype format which is '%y-%m-%d'.

Other valid examples are:
INSERT INTO table(date_field) VALUES(STR_TO_DATE('12-31-2004', '%m-%d-%Y'));
INSERT INTO table(date_field) VALUES(STR_TO_DATE('12/31/2004', '%m/%d/%Y'));
UPDATE table SET date_field =  STR_TO_DATE('Dec 31, 2004', '%b %d, %Y');

----

Thursday, July 15, 2010

How to disable edit cell in JTable (especially in NetBeans)

Put this in your code:

table = new javax.swing.JTable(){
    public boolean isCellEditable(int rowIndex, int colIndex) {
        return false;   //Disallow the editing of any cell
    }
};

where table is the name of your JTable.

For NetBeans users:
1. select the table GUI, right click, select Customize Code
2. Your code should look like this:

How to Select All textfield/ password field Java

--start--
Sample code:

     int i = textfield.getText().length();
     textfield.setSelectionStart(0);
     textfield.setSelectionEnd(i);


Put this in the action or wherever you want it. Replace textfield variable to the name of your textfield. I'm not sure but this might work for JTextArea and JTextPane too.



--end---

Tuesday, June 15, 2010

How to redirect Back to previous page PHP

Put this in your code:



that is a javascript code.


As for me, I embedded it to my php file like this:

if(!checkEverything()){ // a function that contains checking of fields.
SCRIPT HERE* //redirects Back to the previous page with values still in the form
    }else{
    displayAll(); // a function that displays all
}


Note: I cannot add the script as it is because blogspot reads the script and the effect is redirecting you to your previous page. As an alternative I put it as image :)

Hope this helps. It worked 100% for me :)

Friday, May 14, 2010

How to remove JTextArea line around rectangle (border)

 code:

textarea.setBorder(null);

In NetBeans:
1. Click the text area
2. Go to Properties
3. Scroll to Other Properties
4. Go to border then select (No Border)
5. Put this in your constructor:
jScrollPane1.setBorder(null);
This is because NetBeans automatically creates scrollpane to your text area and its border is visible until you set it to null.
6. Run the file to see the result.
It worked for me just fine :)

Thursday, May 13, 2010

How to resize ImageIcon - Java

Please make reading a habit :)

 This was my problem before. After  days of searching, I combined the codes of my search items and came up with this:

-- start of function. I put it inside a function --


//gets the directory of the file
//this means that the file name is where the directory is plus the folder pictures plus the filename
//which is hold by the string named idnumber

idnumber = "CO00001";
dir_pic = System.getProperty("user.dir"); 
dir_pic = dir_pic+"\\Pictures\\"+idnumber+".jpg";

//you could simply put the path of the image in dir_pic variable

//We should have an image first.
//For me, I open the image from my directory
File file = new File(dir_pic); 
image = ImageIO.read(file); //reads the image

//this sets the image to an Image Icon
ImageIcon icon = new ImageIcon(image);

//we start to scale here
//first get the image from ImageIcon
Image img = icon.getImage();
//then scale it; I scaled it to 120x120
//please check the documentation for parameter listing if u dont want SCALE_SMOOTH
Image newimg = img.getScaledInstance(120, 120,java.awt.Image.SCALE_SMOOTH); 
newIcon = new ImageIcon(newimg); //we now have new icon - scaled by 120x120

//I made a JLabel named label and put the image there
label = new JLabel(new ImageIcon(newimg)); 
//then put the label to a square panel
picpanel.add(label); 
label.setBounds(2, 2, 115, 105); //change the bounds according to your design


--- end of function ---

For questions, post a comment to this post... :)

Wednesday, March 24, 2010

Top Most Annoyance in Techie World

 ---

1. Most Annoying text editor - Microsoft Word 2007
Because it doesn't go with the proper numbering as i want it to! the previous version is better.
i put 1 then press tab space, it always changes into 4!!! darn!

2. Most Annoying Instant Messenger - Yahoo Messenger 9.0

3. Most Annoying eMail when it comes to attaching messages - Yahoo Mail

4. Most Annoying Cell phone - E touch
NEVER BUY ETOUCH PHONE. YOU'LL JUST GET STRESSED.
(Image from http://images02.olx.com.ph/ui/2/31/60/39063160_1.jpg)


----
..And guess what, I have these all.. zzz...

Friday, March 19, 2010

Joomla! BUGS! ERRORS!

It's so hard to install Joomla! I get so many errorsssss! It's pissing me off! At first I had "Error 1045" in my installation. Then I edited the sql code, changed all "TYPE = MyISAM" to ENGINE = MyISAM. After that I was able to install but when I went to the administrator area all I see is a blank page!

If it's this hard to user this CMS, someone kill Joomla community please!!!!

UPDATE:

I already know the bug. Joomla's database server has a conflict to my installed MySQL server. I now appreciate Joomla after really getting to know it. But the installation is really hard.

XAMPP phpMyAdmin Error 1045 Access denied for user

Description of error: This appears when you click the phpMyAdmin link from xampp home page. The error looks like this:

The using password: NO means that xampp configuration has no password to database server stored in it. The error could also be: Access denied for user 'root'@'localhost' (using password: YES). This error means xampp has a password for the database server but it is incorrect.

Solution:

1. Go to C:\xampp\phpmyadmin then open the config.inc or config.inc.php file


2. In line 20 you will see this: $cfg['Servers'][$i]['user'] = 'root';
Make sure that the 'root' there is the user to access your own database server. If not, change the 'root' to your own user name.



3. In line 21 you will see this: $cfg['Servers'][$i]['password'] = '';
This means that your database server doesn't have password save in it. If your database server has a password, type the password between the single quotes for example 'mysql'.

However, if there is a password stored like this: $cfg['Servers'][$i]['password'] = 'mysql'; then you have to change 'mysql' into the password your database server is using for example 'developer_password'

4. Clear your cookies then reload localhost


Hope this helps, I tried it and it worked.

Thursday, February 11, 2010

My case of: Jasper Report won't run

___________________________________________________________


We have a system that would print student profile, on our implementation we used the jar file to execute the system for our demo. Then we found out that one function is not working.

Case: when I clicked the JButton that triggers Jasper reporting, the preview of the document wont show up. It appears in other computers but some other pc units wont, too.

After how many trials, debugging and troubleshooting, we decided to install the IDE in the deployment PC. Then we saw the bug, at last.

Bug: No FONT installed. We used a font in the development environment where that font is not installed in the PC of the deployment environment. So that what kept our project delayed for a week. lol.


___________________________________________________________

Tuesday, February 9, 2010

My TOP 2 Netbeans IDE 6.7.1 Annoyance

1. When I type JOptionPane then hit the period "." key the available attributes should appear but as I type JOptionPane.showConfirmDialog and put 4 parameters, the last parameter won't auto complete anymore. I am supposed to put JOptionPane.YES_NO_OPTION, now I have to type every letter of it. So annoying for me.

2. The codes won't 'refresh' right away. Sometimes I have to run my program 3 times for my changes in the code to take effect. Soooo annoying.

Friday, December 11, 2009

Flow chart of Fibonacci Series - 1 1 2 3 5 ...

Fibonacci series (1 1 2 3 5 8 13 21 34 55 89 ... )

This is the flowchart. Sorry it doesn't look nice, I made it in Raptor and edited in MSPaint. Hope it helps. If you want the Raptor file please comment in this post. Thank You. :)
Click the image for a larger view.

Thursday, December 10, 2009

How to Check if Radio Button is Selected or Deselected in Java

***

I can't seem to find an easier way to do this, or perhaps this is the only way since RadioButton depends on the action listener. Here's my code:


private void radioButtonActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
count++;
int ans = count%2;
if( ans == 0){
//radio button is deselected
}else{
//radio button is selected
}
}



***