Me, Myself and Mayvelous
2 May
I learnt something new today. I needed to make a release which includes lots of changes to DB over 3 months period and needed a quick way to figure out which staging db objects to move across to the production.
I wished many times to list storedprocedures by last modified date but stupid enough never Google it and just did the painful way of noting down and scripting them. Then I face the problem of all those script files keep piling up over the period of time and lost track of which scripts have been executed or not.
Today I’m in a bit of sensible mode and did a quick googling and found this useful script, so I’m posting here for later reference.
Listing last modified storedprocedures
select name, create_date, modify_date
from sys.procedures
order by modify_date desc
Listing last modified tables
select name, create_date, modify_date
from sys.tables
order by modify_date desc
Listing db objects by type and date
SELECT *
FROM sys.objects
WHERE type in ('P', 'U')
AND DATEDIFF(D,modify_date, GETDATE()) < 90
Type “P” is for storedprocedures and “U” for tables. More on available Types: http://msdn.microsoft.com/en-us/library/ms190324.aspx
Now that I know which objects have been last updated, I can do the DB script very easily by just selecting those objects. Sweet isn’t it?
4 Feb
I was checking out this Silverlight Pivot Viewer where you can browse through 10yrs worth of MSDN Magazines; found it pretty neat fast loading interface but it’s annoying when you select an article and click either “Read Article” or “Download Code” link, it redirects you to the article page on the same viewer page. And when you want to go back, you have to relaunch the viewer and reenter the search criteria again. I wish they make the article links open in new window so we can still keep viewer open.
Below are the screenshot of the article page cloud based on the search criteria I entered and the zoom in view of it.
Anyways, it’s good that we can search all MSDN articles using this thing quite easily so I’m pretty satisfy with it.
5 Jan
I learn something new today (I’m sure most of you already know, but I just found out). I didn’t know we can use html tags such as div, span etc as html server controls. I do know if you want to convert html controls into server control, you just have to add runat=”server” element but using div container as server control is a different story.
I normally use literal or panel server controls to show or hide the confirmation messages. But in this code, the div tag can act as a panel control by declaring it as HtmlGenericControl.
In the front-end you add id and runat=”server” elements to the div tag.
<fieldset> <h3>Registration Validation</h3> <div id="divValidated" runat="server"> Your account has been validated. You may now log in. </div> <div id="divNoAccount" runat="server"> No matching account. If it has been over 30 days since you registered your account will have been deleted. Please sign up again. </div> <div id="divNoNeed" runat="server"> Your account has already been validated. </div> </fieldset>
In the back-end you declare it as HtmlGenericControl.
protected System.Web.UI.HtmlControls.HtmlGenericControl divValidated; protected System.Web.UI.HtmlControls.HtmlGenericControl divNoAccount; protected System.Web.UI.HtmlControls.HtmlGenericControl divNoNeed;
Voila, you got your div panel with all those member variables you can make use of. So here is a little info on HtmlGenericControl.
Use this class to represent an HTML server control element not directly represented by a .NET Framework class, such as <span>, <div>, <body>, or <font>.
Caution
This control can be used to display user input, which might include malicious client script. Check any information that is sent from a client for executable script, SQL statements, or other code before displaying it in your application. ASP.NET provides an input request validation feature to block script and HTML in user input. Validation server controls are also provided to assess user input.
HtmlGenericControl Class
HtmlGenericControl Members
Pretty cool isn’t it? Well, I didn’t know that and now I know.
6 Oct
Saw this over at “In search of simplicity, quality and tranquility in software engineering“; a series of posts on SDLC – Software Development Lifecycle. Thought a good series to follow and read it over the weekend. Love the graphics on each post!
- SDLC – Software Development Lifecycle … what’s the point? (part 1 of many)
- SDLC – Software Development Lifecycle … closer look at basics (part 2 of many)
- SDLC – Software Development Lifecycle … exploring common models (part 3 of many)
- SDLC – Software Development Lifecycle … agility strikes back with energy (part 4 of many)
- SDLC – Software Development Lifecycle … is prototyping part of the good, the bad and/or the evil? (part 5 of many)
- SDLC – Software Development Lifecycle … analyzing the battle ahead (part 6 of many)
- SDLC – Software Development Lifecycle … designing the blueprint (part 7 of many)
- SDLC – Software Development Lifecycle … testing, the moment of truth (part 8 of many)
- SDLC – Software Development Lifecycle … flashback, component-level design principles (part 9 of many)
- SDLC – Software Development Lifecycle … Visual Process & Estimating (Guessing) Software Deliverables
- To scrum or to Run … that is the agile question? (new)
- —
14 Feb
Back in 2007 I posted a study notes post where I was planning to post about DotLucene and have forgotten about it. The other day I found these notes in my Google Notebook. Instead of lost and forgotten in my Google Notebook, it’s better to share here so someone can make a good use of it. These are just links and notes dump that I found over various sites. I hope I didn’t forget to add the link back references for all the notes.
[ # ] Lucene.Net is a source code, class-per-class, API-per-API and algorithmatic port of the Java Lucene search engine to the C# and .NET platform utilizing Microsoft .NET Framework.
Lucene.Net sticks to the APIs and classes used in the original Java implementation of Lucene. The API names as well as class names are preserved with the intention of giving Lucene.Net the look and feel of the C# language and the .NET Framework. For example, the method Hits.length() in the Java implementation now reads Hits.Length() in the C# port.
In addition to the APIs and classes port to C#, the algorithm of Java Lucene is ported to C# Lucene. This means an index created with Java Lucene is back-and-forth compatible with the C# Lucene; both at reading, writing and updating. In fact a Lucene index can be concurrently searched and updated using Java Lucene and C# Lucene processes.
23 Oct
I came across this “C# Yellow Book” by Rob Miles, MVP and a lecturer in the Department of Computer Science at University of Hull, and thought of sharing.
I think this would be good introductory reading for those of us learning C#
The C# Book is used by the Department of Computer Science in the University of Hull as the basis of the First Year programming course.
Download: Rob Miles CSharp Yellow Book 2008.pdf(1.4M)
I rolled his blog also; he posts pop quizzes every now and then.
21 Oct
I was trying to deploy a .NET 2.0 application using ClickOnce Deployment the other day.
I had all the IIS settings configured and folder paths entered correctly.
When I clicked ‘Publish Now’, I got an error message that made me wonder if I needed to reinstall Visual Studio.
Cannot publish because a project failed to build.
Could not find required file ‘setup.bin’ in ‘C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Engine’.
My first reaction was oh damn, I don’t want to reinstall whatever it is that’s broken.
My second smarter reaction was to google the error
Found this post on MSDN forums.
Basically, it was AVG Antivirus 8.0 that incorrectly identified and quarantined a required file as a Trojan.
AVG Free marked the file C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Engine\setup.bin as a Trojan horse BackDoor.VB.DIY
Simply select the file and click the ‘Restore’ button from AVG’s Virus Vault. (So glad I havn’t been emptying my vault!)
Once that little error was corrected, it was a simple matter to click ‘Publish Now’ again and I was happily on my way to my first ever ClickOnce Deployment!
I’m glad it wasn’t a serious problem requiring reinstalls.
Some days, I wonder if I want to keep an antivirus program running on my computer.Scratch that thought I lend my flash drive out to other people sometimes so it wouldn’t be a good idea to have no protection.
I don’t need much protection as I am careful in my mail box and I rarely visit websites out of google’s domain.
Google Reader gets me everything I want to read anyway.
I trust myself but you just can’t trust people’s machines.