-->

3 Awesome MUST HAVE utilities for developers

maqk® by Maqk | 10:54 PM

Enough of code, lets see what can ease out our jobs, enhance our routines, and make us more productive.I am always looking around for automation freebies and I think I am good at google :). Of course there are tons of freebies out there but not all of them are useful at the same level. This also depends on your approach, how smart you think and your over all personality.

I have come up with 3, yes 3 good utilities each of them is a must have for any QA, Developer or techy personal. No more time wasting words, straight away Name, Description and location lolz

  • Clipx - smart clipboard manager. Ctrl + Shift + V loads a light weight list of 25 slots of last 25 clipboard objects. And surely it can hold the last 25 t-sql snipets that you were just playing with. Imagine keeping all of them in your control, and using any of it anytime. I have already become so addict towartds it. THe greatest thinks is that it keeps snapshots, files, folders, any thing that clipboard supports so far in my experience. A MUST HAVE No doubt, download it here -http://bluemars.org/clipx/clipx-1.0.3.8-setup.exe
  • AutoHotKey - Well alot of my sql snipets come from it since it can catch the keystrokes and replaces your configured value for it. But thats not even half of waht it can do for you. Define complex keystrokes to do things with your system, open programs, do alot. However I have used it as a smart text replacer and it has really started serving me awesomely. I type large favorite urls by just typing short aliases. One can even use it for email templates etc, depends how smart you are to use ;). Get it here - http://www.autohotkey.com/download/ 
  • Folder Guide - Folder lookup plugin - Loads when File Open dialog appears or in context menu and provides a list of your selected folders. Clicking on them opens or redirects to that folder. Simply Astonishing if you are used to of Folders and file management. However I believe folder guide may slow your machine provided lots of folders configured to appear in the list. Get it here - http://www.freeware365.com/download/FGSetup.exe
So what are you waiting for, go for them, they are gonna turn your life into HELLLLL coooool, lolz :)

DotNetNuke Community v05.04.04 Project Starter Kits

maqk® by Maqk | 2:51 PM

I know its a rather strange type of comeback to my long-no-post and long-ignored blog, and you know what, I was really not busy all those days AT ALL, really no..... just the lazy me, but sure its not going to continue like that cause I have some interesting posts coming about JQuery and DNN of course which is currently the main focus for the next month or so.

Now to the subject, over the past 2-3 months, I was looking for something that should have been too much available to every1. But I have to really dig into websites and apps to get it really.

What I was looking for were the DotNetNuke starter kit for VS2005 and above. But I could not really get it. Whatever you google, say "DotNetNuke 4 project templates" or "DNN4 starter kits" or whatever. I surely would have tried above 20 searches, and yes I found really good sites, and groups talking sense, but at the end of the page, I got nothing near to what I was looking for. It was totally strange for me, I could not believe all my efforts were going in vain and I was doing so much just for a starter kit.

Consider this page for instance: http://www.dotnetnuke.com/Community/Blogs/tabid/825/EntryId/453/DotNetNuke-4-3-Starter-Kit-and-Item-Templates.aspx

which is an official DNN page and it is all about the starter kit, but the linkfor the download provided: http://www.dotnetnuke.com/About/Downloads/tabid/125/Default.aspx redirects to the official DNN Download page. But this page even is not featuring any DNN starter kit downloads.

I was just going to lose faith over this but after lots of idiotic efforts really I finally got it. But to make life really easier and faster for you guys, I am sharing..........

DotNetNuke® Community Edition 05.04.01 Starter Kits

The above is the setup file for Project Starter Kit for VS2008 which will give you is illustrated in the following screenshots;



A DNN compiled module template for both vb / c#

and a new web site (vb only) based on DNN Framework

Also after searching smarter, I came across this link which will more authentic source: http://dotnetnuke.codeplex.com/releases/view/44102#DownloadId=119156

Enjoy development ;)

VB.Net 2008 - Change Desktop Wallpaper from code

maqk® by Maqk | 2:46 AM

Initially, some fun - So the history behind this micro utility is, I bought Dell 15 Studio, Vista eXperience, DreamScene made me more deskTopCrazy, saw Windows 7's random wallpaper changer, searched one for Vista, downloaded apps didn't work , hence decided to make one.

NOTE: The scope of this blogpost is limited to the main API Call that sets a new Wallpaper. The whole utility, its code and details will be posted later in another blogpost. So fingers crossed.

Now for work, its a simple user32.dll API Call to the method, "SystemParametersInfo"

<dllimport("user32.dll", )="" entrypoint:="SystemParametersInfo">_

Public Shared Function SystemParametersInfo(ByVal uiAction As UInteger, ByVal uiParam As UInteger, ByVal pvParam As String, ByVal fWinIni As UInteger) As Boolean



End Function
I searched and found these resources guiding about this API, you may also google "vb.net set desktop wallpaper".

API Call Authentic Sources:
The 2nd link is a more accurate call to the API since this systax worked for me in Vb.net 2008

Details

In the API, the entry point for us is the method, SystemParametersInfo. This function is responsible for so many things, including setting wallpaper for us. A description from msdn is quoted as;
"Retrieves or sets the value of one of the system-wide parameters. This function can also update the user profile while setting a parameter". 

Parameters

This function takes 4 arguments, first one, the most important one is about the work this function is gonna do for ur, so we pass an integer constant, 'SPI_SETDESKWALLPAPER' containing a value of 20.

uParam:

If you google it, most probably the first descriiption you will get is;
"A parameter whose usage and format depends on the system parameter being queried or set. For more information about system-wide parameters, see the uiAction parameter. If not otherwise indicated, you must specify zero for this parameter."

I googled more and found that uParam is set 0 with GET Constant and with SET, the new value should be sent, however in my app, I used 0 and 1 and found a same result with no exceptions. If some one finds a more detailed exlanation, please provide me too. The explanation about these parameters are also limited because the subject function deals with lots of functionality, hence these variables depend on the context of use.

pvParam

This contains the complete filepath of our wallpaper / image file that we are to set as desktop wallpaper

fWinIni

Updates the Win.ini file. The source i used as  alead used 2 constants,

Private Const SPIF_UPDATEINIFILE = 1
Private Const SPIF_SENDWININICHANGE = 2


And the argument was passed as follows;
SystemParametersInfo(SPI_SETDESKWALLPAPER, 1, _WallPaperPath, SPIF_UPDATEINIFILE Or SPIF_SENDWININICHANGE)

see the italic text, they ised or in between the 2 variables. However in my testing, I used each of them individually and found no difference.

Sources:
I will return with my whole Rando Wallpaper changer in the next blog, till them, some additional functionality to be implemented to make it a complete product. See you then,

MAQK.

Catch cursor keys on the KeyDown event

maqk® by Maqk | 3:53 AM

Making KeyDown event work for Cursor Keys with controls on your form



Private Const WM_KEYDOWN As Integer = 256
Private Const WM_KEYUP As Integer = 257

Public Function PreFilterMessage(ByRef m As System.Windows.Forms.Message) _
As Boolean Implements IMessageFilter.PreFilterMessage

If (m.Msg = WM_KEYDOWN) Then
Dim keyCode As Keys = (CType(CType(m.WParam, Integer), Keys) And Keys.KeyCode)
'do your stuff with the key down here
'.....
Return True
End If
Return False

End Function

Private Sub FrmPortFolio_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load
Application.AddMessageFilter(Me)
End Sub

End Class

Problems faced when dealing with DateTime field


Handling DateTime fields is sometimes annoying for beginners. The reason is the stubborn DateTime field. Chk this out;

Select [yourDateTimeField] From [TableName]
e.g. SELECT PostTime FROM ddl_log (select master first)

As you can see, time string always comes with the date. This thing gets even more irritating when we want date in its simplest most common form.

The point is, how to get hold of this DatType and mould it in our desired shape?

Lets take it step by step. First you fetch datetime from Sql and you get a value like '2009-12-10 23:18:44.923'. Question arrises;

Is there any ONLY DATE field in SQL?

The answer is no. You might be able to make a custom field using User-defined Data Types feature of Sql Server. In case if you dont do that, we come to the next step;

What do I do for the existing date fields that come with additional and unrequired time values

The answer is you Format them.
T-SQL gives rich string formating, at the cost of loosing original data type (but no loss of value)

Try this

Select Convert(Varchar, getDate(), 101)

What happened?? Isn't that something you just needed for which you looked so hard and finally came to this blog lolz.

What happened is that you see a date with the desired output. You can put your datetime field name in place of 'getDate()'

This function is tremendous to get the date in your desired format. Run the following queries and observe the changes;

Select Convert(Varchar, getDate(), 110)
Select Convert(Varchar, getDate(), 113)
Select Convert(Varchar, getDate(), 112)

Theres more to get as we share with you all the parameters that changes the datetime field in various usefull formats;

Date Time conversaion Table


1

Select Convert(Varchar, getDate(), 0)

Dec 24 2009 10:19PM

2

Select Convert(Varchar, getDate(), 1)

112/24/09

3

Select Convert(Varchar, getDate(), 2)

009.12.24

4

Select Convert(Varchar, getDate(), 3)

224/12/09

5

Select Convert(Varchar, getDate(), 4)

224.12.09

6

Select Convert(Varchar, getDate(), 5)

224-12-09

7

Select Convert(Varchar, getDate(), 6)

224 Dec 09

8

Select Convert(Varchar, getDate(), 7)

DDec 24, 09

9

Select Convert(Varchar, getDate(), 8)

222:19:31

10

Select Convert(Varchar, getDate(), 9)

DDec 24 2009 10:19:31:203PM

11

Select Convert(Varchar, getDate(), 10)

112-24-09

12

Select Convert(Varchar, getDate(), 11)

009/12/24

13

Select Convert(Varchar, getDate(), 12)

0091224

14

Select Convert(Varchar, getDate(), 13)

224 Dec 2009 22:19:31:203

15

Select Convert(Varchar, getDate(), 14)

22:19:31:203

16

Select Convert(Varchar, getDate(), 20)

22009-12-24 22:19:31

17

Select Convert(Varchar, getDate(), 21)

22009-12-24 22:19:31.203

18

Select Convert(Varchar, getDate(), 22)

112/24/09 10:19:31 PM

19

Select Convert(Varchar, getDate(), 23)

22009-12-24

20

Select Convert(Varchar, getDate(), 24)

222:19:31

21

Select Convert(Varchar, getDate(), 25)

22009-12-24 22:19:31.203

22

Select Convert(Varchar, getDate(), 100)

DDec 24 2009 10:19PM

23

Select Convert(Varchar, getDate(), 101)

112/24/2009

24

Select Convert(Varchar, getDate(), 102)

22009.12.24

25

Select Convert(Varchar, getDate(), 103)

224/12/2009

26

Select Convert(Varchar, getDate(), 104)

224.12.2009

27

Select Convert(Varchar, getDate(), 105)

224-12-2009

28

Select Convert(Varchar, getDate(), 106)

224 Dec 2009

29

Select Convert(Varchar, getDate(), 107)

DDec 24, 2009

30

Select Convert(Varchar, getDate(), 108)

222:19:31

31

Select Convert(Varchar, getDate(), 109)

DDec 24 2009 10:19:31:207PM

32

Select Convert(Varchar, getDate(), 110)

112-24-2009

33

Select Convert(Varchar, getDate(), 111)

22009/12/24

34

Select Convert(Varchar, getDate(), 112)

220091224

35

Select Convert(Varchar, getDate(), 113)

224 Dec 2009 22:19:31:207

36

Select Convert(Varchar, getDate(), 114)

22:19:31:207
Of course for the gurus and professionals, this might be a very ordinary post, dealing a very basic problem. But eventually for beginners like me, this is something which makes us halt for a while. And as I have experienced throughout my "Support" career , this would always come whenever setting a new machine for a web application on asp.net 2.0

Without any further delay, I am currently simply adding the 1 stop solution link to Microsoft website for the fix

http://support.microsoft.com/kb/555583
AJAX makes your UI more responsive, adding the richness in the application and Interactivity for the joy of end user. We have already moved from UI to User Experience now - Now we dont create UIs, we create Rich Interactive User Experience - FOr which one of the choice for the developers is AJAX. I will also highlight JQuery in t his regards but currently my focus is on AJAX.

I am implementing AJAX through MS AJAX Control Tollkit and AJAX Extensions. Not getting in any further techy details, the scheme is simple

We have a 'UpdatePanel', we have 'Triggers' and we have our code behind file whose code AJAX will call Aynchrosously.

At this point, I wanna tell you guys when i tried to start AJAX, it became so difficult for me because no resource on the internet actually defined straight away what this update panel has to do with AJAX. Actually i was a started from w3schools where you make the XmlHTTPRequest object, chk for browser compatibility, launch a request to a 3rd 'bridge' server page and then get your html result in your defined area. This was ok but not cool. Nothiung thats not pretty and also makes you work hard (for not much actually) is not cool i think.

So with all these contexts, whenever i tried to start AJAX control toolkit thing, I stucked in the update panel control not getting its purpose at all. More will be edited shortly, currently i have the following to share, yes once again, a link

http://webmaster-forums.code-head.com/showthread.php?t=885

At this page, you can get 10s of animated progress bars (gifs) to use with your update progress control. Along with thism i would like to mention the search  strings that are: 'progress', 'loading' and 'progess transparent'
top