Showing posts with label Just for fun. Show all posts
Showing posts with label Just for fun. Show all posts

Tuesday, June 9, 2009

Copy code as HTML on Visual Studio, easy way to copy code on blogspot

I just notice that blogspot has limited capability on doing blog for programming code. Copy and paste from word also won't work properly as blogspot will not tolerate some whitespace character generated by Word. Luckily, on the net I found something that can address this issue.

Guy Burstein, provide a link to Microsoft Visual Studio AddIns that will allow us to copy any code that we highlight within Visual Studio and paste it automatically as HTML code. This will be helpfull lot on writing a code blog on blogspot, eventough we have to use manual HTML code still and it's exclusively to Visual Studio :)

So, here are steps to doing this:

1. Obtain AddIns here

2. Extract it to your Visual Studio AddIns folder, it's should be under MyDocuments\Visual Studio 2008\Addins, if you couldn't find AddIns folder, then create new one

3. Open Visual Studio, click on Tools -> AddIn Manager


4. AddIn manager dialog will be opened, select to activate "Copy as HTML" AddIn


5. Now, you can select any code and when do right click, "Copy as HTML" will be shown

Below is the result :)


  195 Public ReadOnly Property Email() As String


  196             Get


  197                 Dim daUser As New UserTableAdapter


  198                 Dim ret As String = ""


  199                 Dim users() As String = {}


  200                 Dim i As Integer = 0


  201 


  202                 For Each row As SecurityApprovalRow In Me.Rows


  203                     If Array.IndexOf(users, row.UserId) < 0 Then


  204                         Array.Resize(users, i + 1)


  205                         users(i) = row.User.Email


  206                         i += 1


  207                     End If


  208                 Next


  209                 Return IIf(users.Length = 0, "", String.Join(";", users))


  210             End Get


  211         End Property





Nice isn't ? Try it, code with smile :)

Saturday, May 30, 2009

Flip your windows screen permanently

This one maybe not related with programming, but it may a funny trick that we could use to punk someone with. Okay, from Windows operating system (I use Windows XP SP2)  on working mode, means it's not locked state, pres Ctrl+Alt+[Any arrow], and your screen direction will follow arrow you are pressed, for instance to flip your screen 180 degree, press Ctrl+Alt+[down arrow] :)

 



So, say, you have someone that you crush on him/her, you can silently flip his/her screen, and then when he/she notice that something wrong with his/her monitor and get stuck on how to make it like it used to be, you may appear as hero who save the day ... code with smile.