Archive for April, 2008

05 Apr 2008

Released – TinySQL v2.0

No Comments Code Generation, Programming, SQL Server

I just released TinySQL code generator v2.0 with few bug fixes and a new feature of using separator tag for loop statement. You can now use {sap}{/sap} tags to place your separators inside loop.

Here is the example of using {sap}{/sap} tags in TinySQL template:

** Generate DATA Provider: UPDATE/v2.0
CREATE PROCEDURE [dbo].[usp_Update$table]{loop}
	@$field = $sp_type{sap},{/sap}{/loop}
AS
BEGIN
UPDATE dbo.$table WITH (ROWLOCK)
SET {loop}$field = @$field{sap},{/sap}
	{/loop}
WHERE --TODO
RETURN -1
END

And generated code from above template will be like:

CREATE PROCEDURE [dbo].[usp_UpdateAction]
	@Id = NUMERIC,
	@Action = VARCHAR(250),
	@ProjectId = NUMERIC,
	@IsNextAction = BIT,
	@IsWaitingFor = BIT,
	@WaitingForNotes = VARCHAR(1000),
	@RemindOn = DATETIME,
	@IsDefer = BIT,
	@DeferDate = DATETIME,
	@IsDone = BIT,
	@Sequence = INT
AS
BEGIN
UPDATE dbo.Action WITH (ROWLOCK)
SET Id = @Id,
	Action = @Action,
	ProjectId = @ProjectId,
	IsNextAction = @IsNextAction,
	IsWaitingFor = @IsWaitingFor,
	WaitingForNotes = @WaitingForNotes,
	RemindOn = @RemindOn,
	IsDefer = @IsDefer,
	DeferDate = @DeferDate,
	IsDone = @IsDone,
	Sequence = @Sequence
WHERE --TODO
RETURN -1
END

Download: TinySQL v2.0

You can also read my previous blog to learn more about TinySQL tool.
TinySQL Code Generator

Hope you will find this tool useful.

03 Apr 2008

iPhone – Scroll Bottom Bookmarklet

4 Comments iPhone

You can easily scroll to the top of the web page by just tapping on top bar (which has signal status, carrier name, time etc.) of iPhone but how about scrolling to the bottom of the page. If you are browsing any long web page then sometime it becomes really annoying to reach bottom of the page.

But from now onwards, you can simply tab on a bookmark and bookmarklet (or favelet) will scroll you to the bottom of the page. You just require adding this javascript code as bookmark:

Javascript Code:
javascript:scroll(0,document.getElementsByTagName(‘body’)[0].scrollHeight);

Link:
Scroll Bottom
To add “Scroll Bottom” bookmarklet, just drag above link into Safari’s Bookmarks Bar and then sync to your iPhone through iTune.

Following are some relative articles for bookmarks and syncing to the iPhone:
Syncing iPhone and iPod touch with your computer
iPhone: Using Bookmarks
17 powerful bookmarklets for your iPhone