i am rommel

Starting to write my own history

Archive for the 'Science' Category


   Oct 25

How to Resize Multiple Images using Photoshop CS 2

Before publishing your photos to your favorite social networking site (Facebook, Friendster, etc), you’ll probably want to resize and reduce the quality so its faster to view and download from the web. Photoshop CS2 has a very nice feature that you can do that for multiple files.           Here are the [...]

Read the rest of this entry »

   Oct 21

Capturing Images from Videos

Once in a while you want to capture video frames and store it as images. Let say from the movie you find your favorite actress wearing a very sexy dress and you want to print and make as poster and post in your room (obsessed). And if you open the file using Windows Media Player [...]

Read the rest of this entry »

   Oct 15

Concatenating Rows in SQL Server

In QuickSaas project that I’m working with, there is the scenario there that I need to concatenate all 5 rows and return only single row. Here are example SQL scripts of concatenating rows into a single column Let say you have the following table values below And you want an output similar to below You [...]

Read the rest of this entry »

   Oct 15

Download music using Google

Okay peeps, I’m sure most of you know how to use Limewire and Bittorrent these days. But, I’ll bet you haven’t used Google to perform a quick Mp3 search for the nagging song that’s been stuck in your head all day. The truth is that Google can be used to conduct a search for almost [...]

Read the rest of this entry »

   Oct 13

Reading data in XML and Simple RepositoryPattern

When I’m doing some unit testing in QuickSaas project, I try to use XML as repository of sample data. In this example, I am going to read data from external XML file and a simple implementation RepositoryPattern. We have a customer class with the following properties namespace DemoApp.Model { /// /// Represents a customer of a [...]

Read the rest of this entry »

   Oct 13

Email Validation

So won’t the real email validator please stand up, please stand up, please stand up? Check this site for real email validation. http://haacked.com/archive/2007/08/21/i-knew-how-to-validate-an-email-address-until-i.aspx I usually implement this in my BlastSuites project

Read the rest of this entry »

   Oct 02

Display the duplicate values query

This is simple trick to get all rows with the same column value. Let say your boss needs you to display all records with duplicated Invoice Number/Sale Number (I don’t know why this happens). Sale Number Sale Date Customer Id Sale Amount 1000 01-Jan-2008 QA-0001 200.32 1000 01-Jan-2008 QA-0002 210.32 1001 01-Jan-2008 QA-0001 200.32 1001 [...]

Read the rest of this entry »

   Oct 02

Extensions in C# and a BUG in IEEERemainder

Topics here Entensions in C# IEEERemainder BUG Converting a number into a words including the negative and decimal places of a number Support for Filipino a language Converting a number to a word is an old school programming knowledge, but what’s new here is the use of extension to double, float, int, etc so that [...]

Read the rest of this entry »

   Oct 02

The power of MERGE in SQL Server 2008

The common master-detail scenario in 1 hit is the code below. This is for my future references CREATE PROCEDURE [dbo].[MergeAtRiskRiskCondition] — Add the parameters for the stored procedure here @AtRiskId INT, @AtRiskRiskCondition XML = ” AS BEGIN BEGIN TRY BEGIN TRANSACTION –XML FORMAT –<Root> — <AtRiskRiskCondition AtRiskRiskConditionId="0" AtRiskFactorId="0" ResolvedDate="" /> — <AtRiskRiskCondition AtRiskRiskConditionId="0" AtRiskFactorId="0" ResolvedDate="" [...]

Read the rest of this entry »

   Oct 02

Xml and SQL Server 2008

Xml manipulation in SQL Server 2008 is a breeze. DECLARE @CardInfo XML ; SET @CardInfo = N’<CARDINFO> <CARD> <ID>1</ID> <ID>2</ID> </CARD> <STATUS>1</STATUS> <PURPOSE>1</PURPOSE> <CARDVALUE>120.32</CARDVALUE> <ACTIVATIONDATE>20090101</ACTIVATIONDATE> <EXPIRATIONDATE>20100101</EXPIRATIONDATE> <PRODUCTID>1</PRODUCTID> <PACKAGEID></PACKAGEID> <SESSIONID></SESSIONID> <SEMESTERID></SEMESTERID> </CARDINFO> <REASON>For A Change naman</REASON>’     SELECT x.node.value(’(.)[1]‘, ‘int’) CardID, x.node.value(’(/CARDINFO/STATUS)[1]‘, ‘int’) StatusID, x.node.value(’(/CARDINFO/PURPOSE)[1]‘, ‘int’) PurposeID, x.node.value(’(/CARDINFO/CARDVALUE)[1]‘, ‘DECIMAL(18,2)’) CardValue, x.node.value(’(/CARDINFO/ACTIVATIONDATE)[1]‘, ‘DATETIME’) ActivationDate, x.node.value(’(/CARDINFO/EXPIRATIONDATE)[1]‘, ‘DATETIME’) [...]

Read the rest of this entry »