MySQL Pattern Matching

Regex… I hate regex. But there’s nothing I can do because it is most pretty useful for pattern matching. Like, say, getting all strings that start with a certain letter range like a to c. The way to achieve this is to use the MySQL keyword REGEXP or RLIKE. Take this example to match all string that starts with this letter range a to c.

REGEXP '^[a-c]‘

The ^ is used to match all strings that match within the letter range, in this example a, b and c. You can also add more letter options like

REGEXP '^[a-c, h]‘

which includes strings that match h as its starting character.

It aint easy at first. You’d need to read the MySQL documents to get yourself familiarized with the necessary characters that you would need to use in order to get the match that you want.

Like what you see? Buy me a cup of coffee. Or subscribe to my feeds.


(No Ratings Yet)
 Loading ...

Yahoo Mac Release 3 now has voice

I don’t care what other features it has … the only feature I’ve wanted for the Mac OS version was the group message and the voice call.. With Release 3, they’ve solved the voice call feature. Now I can call up my friends and talk to them. Cool! Disappointing that until now, the message to group feature still is not available. I wonder why they haven’t done this yet? Curious ….

Some new features though:

  • Stealth settings
  • Conferencing
  • “New IM” indicator in the OS X dock
  • Tabbed conversations
  • Message archiving
  • Stay connected from your mobile phone
  • Automatic updates

Like what you see? Buy me a cup of coffee. Or subscribe to my feeds.


(No Ratings Yet)
 Loading ...

I Dont Like HTML WYSIWYG Editors

For the fact that they generate dirty HTML code. It was a good experience to never have used an editor when I first learned HTML. It was purely all tags. Once editors started coming out, and the one that I frequently use is Microsoft Frontpage, the only thing that I find useful in them is creating nested tables. With that, I don’t have to worry about having incomplete ending tags. Other than that, I prefer clean HTML tag creation. These days, I am more into programming than designing, that’s why I don’t these editors. If I was more into designing, then I’d find programs like Macromedia’s Dreamweaver to be pretty useful.

Like what you see? Buy me a cup of coffee. Or subscribe to my feeds.


(No Ratings Yet)
 Loading ...

Google YouTube API Retrieving Video Feeds From YouTube Using Java

To retrieve list of video feeds from a user from Google, include the init() method from this post. Then use the method below to get the title of the video and the URL. This sample code retrieves the video feed list of the logged-in user. To retrieve the list of video feeds for other users, check the user guide.

public static Vector getUserVideos() throws Exception {
  URL feedUrl = new URL("http://gdata.youtube.com/feeds/api/users/default/uploads");
  VideoFeed videoFeed = service.getFeed(feedUrl, VideoFeed.class);
  String title = videoFeed.getTitle().getPlainText();
  List videoEntries = videoFeed.getEntries();
  Vector vect = new Vector();
  YouTubeVideoProperties ytvp = null;
 
  if (videoEntries.size() == 0) {
    System.out.println("This feed contains no entries.");
    return;
  }
 
  for (VideoEntry entry : videoEntries) {
    System.out.println("title="+entry.getTitle().getPlainText());
 
    YouTubeMediaGroup mediaGroup = entry.getMediaGroup();
 
 
    if (mediaGroup != null) {
      MediaPlayer player = mediaGroup.getPlayer();
      if (player != null) System.out.println("video url="+player.getUrl());
    }
  }
  return vect;
}

To get an image of the video thumbnail like what you in the YouTube site, get the String after this URL, http://www.youtube.com/watch?v=GET_THIS_STRING

Then use that same string to get the thumbnail image of the video using this URL, http://i.ytimg.com/vi/GET_THIS_STRING/default.jpg

It is always default.jpg so just change where I placed GET_THIS_STRING. Easy as pie.

Like what you see? Buy me a cup of coffee. Or subscribe to my feeds.


(1 votes, average: 5.00 out of 5)
 Loading ...