There are quite a few of sharing widgets out there. Some offers amazing amount of sharing sites while some, like this one here, only shares a few. However, it has the cool drop down feature that I really like and the icons are really nice. Here’s a list of the sites you are able to share and bookmark with with this widget.

2 comments Posted by Wai Kit at 10:18 PM

Client Server Coding

(Saturday, June 26, 2010)

My first client server java coding:

   1: import javax.swing.*;
   2: import java.awt.*;
   3: import java.io.*;
   4: import javax.swing.border.*;
   5: import java.net.*;
   6: import java.awt.event.*;
   7:  
   8: class Server extends JFrame implements ActionListener
   9: {
  10:     private JTextArea jtaSend=new JTextArea();
  11:     private JTextArea jtaReceive=new JTextArea();
  12:     private JButton jbtSend=new JButton("Send");
  13:     
  14:     DataOutputStream output;
  15:     DataInputStream input;
  16:     
  17:     public Server()
  18:     {
  19:         jbtSend.addActionListener(this);
  20:     
  21:         try
  22:         {
  23:             ServerSocket server=new ServerSocket(8000);
  24:             Socket socket=server.accept();//wait connection from a client
  25:             System.out.println("connected to a client");
  26:         
  27:             output=new DataOutputStream(socket.getOutputStream());
  28:             input=new DataInputStream(socket.getInputStream());
  29:         
  30:             getContentPane().setLayout(new GridLayout(2,1));
  31:             JScrollPane scp=new JScrollPane(jtaSend);
  32:             scp.setBorder(new TitledBorder("Type your message here"));
  33:         
  34:             JPanel panel=new JPanel();
  35:             panel.setLayout(new BorderLayout());
  36:             panel.add(scp,BorderLayout.CENTER);
  37:             panel.add(jbtSend,BorderLayout.SOUTH);
  38:             getContentPane().add(panel);    
  39:         
  40:             getContentPane().add(new JScrollPane(jtaReceive));
  41:             setTitle("Server");
  42:             setSize(300,300);
  43:         
  44:             setLocation(20,30);
  45:             setVisible(true);
  46:         
  47:             while(true)
  48:             {
  49:                 jtaReceive.setText(input.readUTF());
  50:             }
  51:         }
  52:         catch(IOException ex)
  53:         {
  54:             ex.printStackTrace();
  55:         }
  56:     }
  57:  
  58:     public static void main(String[]args)
  59:     {
  60:         JFrame frame=new Server();
  61:     }
  62:  
  63:     public void actionPerformed(ActionEvent e)
  64:     {
  65:         try
  66:         {
  67:             output.writeUTF(jtaSend.getText());
  68:         }
  69:         catch(Exception ex)
  70:         {
  71:         }
  72:     }
  73: }
Takes in messages from a user and send it to the other. Incomplete code.

4 comments Posted by Wai Kit at 10:05 PM

No doubt the Night Sky 2.0 Blogger template by Ray Creations is one of the best templates I’ve ever seen. There are other templates by Ray Creations which are as good too. You can check out more of its works here.

However, there is a bug in the template. I find the end of my right sidebar cuts off and goes to the far left side of the screen in posts page (not main page) whenever I add widgets on the sidebar to the extent that the sidebar’s height exceeds that of the post’s.

I figured this is because the sidebar-bottom is made to float:left; margin-left:20px. So, whenever there is no post on its left for the sidebar to “hold on to”, the sidebar will eventually floats itself to the most left that it can find with 20px margin from the left.

Here is the original extract from the template:

   1:  #sidebar-bottom {
   2:    width: 240px;
   3:    height:40px;
   4:    padding-right: 0px;
   5:    background: url(http://lh5.ggpht.com/_qYQcA5cg1OY/SsMdZU-8OAI/AAAAAAAAAG8/fRV84_un7sQ/rightsidePanelbottom.jpg) no-repeat right bottom;
   6:    float: left;
   7:    margin-left:20px;
   8:    overflow: hidden;      /* fix for long non-text content breaking IE sidebar float */


To fix this:
  1. Go to Design >> Edit HTML.
  2. Remember to always backup your template first before you do any changes in your HTML.
  3. Search for “sidebar-bottom” using your browser’s search function and you should see codes resembling the above extract.
  4. Change line 6: float: left; to float: right;
  5. Change line 7: margin-left:20px; to margin-right:11px;
  6. It should look like this:
       1:  #sidebar-bottom {
       2:    width: 240px;
       3:    height:40px;
       4:    padding-right: 0px;
       5:    background: url(http://lh5.ggpht.com/_qYQcA5cg1OY/SsMdZU-8OAI/AAAAAAAAAG8/fRV84_un7sQ/rightsidePanelbottom.jpg) no-repeat right bottom;
       6:    float: right;
       7:    margin-right:11px;
       8:    overflow: hidden;      /* fix for long non-text content breaking IE sidebar float */
  7. Click on Save Template and you’re done.
Note: I’m no HTML expert whatsoever. I did this fix by experimenting the template in Adobe Dreamweaver and by changing the codes one by one, retrying, re-fixing and refreshing the pages over and over again. It’s hard work. Try this fix at your own risk. I shall not be hold responsible for any damages caused in your blog for using this fix. Like what I said, I’m no HTML expert so there may be other solutions to this but this is the only one that I found that works. If you are going to post this somewhere please inform, credit me and post a direct link to this page.

0 comments Posted by Wai Kit at 1:23 PM

Today I'm gonna teach you how to add a Tweetmeme retweet button with counter to blogger. There are actually other retweet counter services such as Backtype and Topsy but I prefer Tweetmeme cuz it's the most popular around and I like its color and looks.


Here's how:

  1. First thing's first, before you make any customizations with your HTML, Save a Template of it first.
  2. Then, tick on the box to Expand Widget Templates.
  3. Replace [TwitterUserName] with your Twitter username and copy this code.
       1:  <!-- TWITTER RETWEET BUTTON START -->
       2:  <script type='text/javascript'>
       3:  tweetmeme_source = &#39;[TwitterUserName]&#39;;
       4:  tweetmeme_url = &#39;<data:post.url/>&#39;;
       5:  </script>
       6:  <script src='http://tweetmeme.com/i/scripts/button.js' type='text/javascript'/>
       7:  <!-- TWITTER RETWEET BUTTON END -->

  4. Search for this code:
       1:  <data:post.body/>

  5. Paste it before this if you want the button to be above your post and after it if you want it well, after it. Basically the code represents the body of the post.



And, you're done!
Happy tweeting!

0 comments Posted by Wai Kit at 10:52 PM

For those of you who's not really into using Adobe Photoshop to add watermark to your photos or is just simply too lazy to use one, here's one of the simplest way to do the job.

PicMarkr
PicMarkr lets you to add custom watermark (image or text) to your images online and free. It is useful when you need to protect your copyrights or if you want to add comments
to your photos


Just follow the 3 simple steps in the website.

Step 1: Upload your photos. You can choose whether to upload it from your local computer or grab from Flickr, Facebook or Picasa.
Step 2: Customize the watermark. You can choose from the different alignments, write the text to display and its presets.
Step 3: Well, you're almost done. Just download the photos to your computer or upload them.

Pretty convenient, eh?

2 comments Posted by Wai Kit at 7:43 PM

Among some of the interesting things that I've found out upon blogging is the sharing widget. A sharing widget is a widget in the form of a button that can let you share a specific post in your blog at ease. It makes the sharing process easier by just clicking on the button. Today I'm gonna share with you on how to add a Digg share button with counter on your blogger.


Here's how:
  1. First of all, as a rule of thumb, before you make any customizations with your HTML, Save a Template of it first.
  2. Then, tick on the box to Expand Widget Templates.
  3. Copy this code. and paste it in your HTML.
       1:  <!-- DIGG BUTTON START -->
       2:  <script type='text/javascript'>
       3:  digg_url = &#39;<data:post.url/>&#39;;
       4:  </script>
       5:  <script src='http://digg.com/tools/diggthis.js' type='text/javascript'/>
       6:  <!-- DIGG BUTTON END -->

  4. Search for this code:
       1:  <data:post.body/>

  5. Paste it before this if you want the button to be above your post and after it if you want it well, after it. Basically the code represents the body of the post.

    And, you're done!
    Happy digg-ing!




3 comments Posted by Wai Kit at 12:48 AM

I found this nice little twitter widget which will display your status updates on your website. It's kind of neat.

0 comments Posted by Wai Kit at 1:52 AM

Zoom Facebook Photos by Mouseover

(Friday, June 11, 2010)

Facebook. Almost every living creature on this planet has one. It has become so popular nowadays that it has started to become like an international identity card. I gotta say I love Facebook for the many applications and the user friendly interface. However, viewing the images is horrendously troublesome and time consuming. I don't like the repeating process of having need to click in to people's profile, then photos section, then album, then pictures, bla bla bla just to get its original photo. And those thumbnails on Facebook wall are so tiny that I had to squint. What I'm trying to say is, it's bad. Why can't it just pops up in its original form when I mouseover it? Now, THAT is convenience.

3 comments Posted by Wai Kit at 10:57 AM

 
Copyright 2005-2007. Hello Wiki designed by Fen, Blogger Templates by Blogcrowds. Wai Kit Says logo designed by Wai Yen.