Posts tagged Tips
Add SyntaxHighlight to Windows Live Writer in Preview mode
Feb 7th
Windows Live Writer (shorter: WLW) is one of the most popular blog authoring tool that I also happen to like and use. And I say this because of its features – I especially enjoy the Preview tab. But what it really lacks is previewing the ENTIRE page – it will get only the html and some css. So no Syntax Highlighting of my code? Let me tell you how I solved this issue.
As a blog writer I searched for something that could allow me to write the articles offline and then upload them in WordPress. I also tried WordPress built-in editor, but the editing box is so small that I couldn’t use it too much.
The most important feature for me is that it retrieves the blog theme and has a preview function that provide you the same look on editor window. So you will be able to write a post with a preview. But when having a more complex theme, using JQuery or Prototype, you will discover that you don’t get any more the same look and feel as in the blog. This is partially ok for editing, but sometimes it is really bad – especially if you’re a programmer and add a lot of code in your page. On blogs there is a solution to show the code with syntax color, but in the Windows Live Writer I couldn’t find one suitable plug-in that does this.
How to add a Webslice
Sep 15th
It is very nice and user-friendly to have Webslices on your website. It improves the user experience by allowing visitors to be up to date with the latest content that you provide, assuming that it is fitted to this presentation style. Since my BNR exchange rates page was this kind, I pursued in adding a Webslice especially for it.
Adding a webslice to your website is simple. After you read the main specifications or my previous article, you’ll understand the concept behind: first you signal to the browser that you have a special part of your website by setting to a container element the class “hslice”:
<div id="BNRExchange" class="hslice">
<div style="display: none" class="entry-title">
<img id="image" alt="Radu Poenaru's weblog gives you BNR Exchange rates" src="http://www.radupoenaru.com/bnr/images/radupoenaru.jpg" width="128" height="128" />
<p>
Cursul oficial BNR
</p>
</div>
<p>
<a style="display: none" href="http://www.radupoenaru.com/bnr/bnr.php" rel="entry-content">
<a style="display: none" href="http://www.radupoenaru.com/bnr/bnr.php" rel="Bookmark" target="_blank">
<span style="display: none" class="ttl">5</span>
</p>
<div id="updateTrigger" class="entry-content" runat="server" />
........ your content that you want surrounded by the green webslice part ..............
</div>
SyntaxHighlighter – how to use it and brushes available
Sep 4th
![]()
The brushes used by SyntaxHighlighter are in separate syntax files named brushes. The following can be used to format the <pre class=”brush: brushname”> that you want to use.
Brushes () in alphabetical order:
| Brush name | Brush aliases | File name |
|---|---|---|
| ActionScript3 | as3, actionscript3 | shBrushAS3.js |
| Bash/shell | bash, shell | shBrushBash.js |
| C# | c-sharp, csharp | shBrushCSharp.js |
| C++ | cpp, c | shBrushCpp.js |
| CSS | css | shBrushCss.js |
WordPress- how to implement Syntax Highlighting
Sep 3rd
Create GUID in Visual Studio 2005
Dec 21st
From time to time you need to create a GUID (Global Unique IDentifier) in order to mark your dlls. Looking in my Visual Studio 2005 I saw that this command wasn’t available in any tools menu, nor in the Customize toolbars one as a shortcut to a command.
After a quick digging on MSDN site I found this. It is written in Microsoft style – a lot of information, but no solution. It just mentioned something like ”hey, we have something that you want, but guess what – we don’t have it any more”:
-
On the Tools menu, click Create GUID. The Create GUID tool appears with a GUID in the Result box.
So I started creating my own Create GUID command.
Happily, the Microsoft team provided the tool in the <visual studio install>\Common7\Tools\ directory. Usually, the <visual studio install> dir is C:\Program Files\Microsoft Visual Studio 8.
Actually, there are 2 tools for creation of GUIDs:
- GUI interface: <visual studio install>\Common7\Tools\guidgen.exe
- Console line tool: <visual studio install>\Common7\Tools\uuidgen.exe
At first look, uuidgen seemed the winner. Running uuidgen in command line revealed the needed parameters:
I proceeded to setup the Create GUID command. From Visual Studio 2005 menu > Tools > External tools you can add and setup a new command to an external tool. The setup window is straight forward for experts, but new guys can be impressed by it.
Clicking on Add button will create a new element in the list, called [New tool 1]. This name will be overridden by whatever you write in the Title text box. Next, the command text box will be filled with exact path to the tool. Clicking the ellipsis button, you’ll be sent straight to Tools dir, where you can easily find the tool required. As arguments I put the ‘c’ value which means that the output will be upper case UUID (as you can see in the previous image).
And when clicking OK, the corresponding name, as in my case Create GUID appears in the Tools menu, just above the External Tools menu.
But surprise, when I clicked the menu button, the command prompt flashed and nothing happened.
After a brief investigation, I figured out that the tool worked, but it’s output was retained in the command prompt window. This closes immediately after the tool runes successfully, outputting the GUID.
What to do ? I switched to the next tool, Guidgen. This was simply accomplished by changing the command to the corresponding tool name and removing the argument.
So after clicking on Visual Studio 2005 menu > Tools > Create GUID I got this window, in which I checked, as you can see, Registry format and then click on Copy button. Then clicking on Exit you dismiss the tool. By pasting the Clipboard content into a class, you will get this :
{949213E9-0658-4546-B3D1-F41C0475E805}
Good luck with the implementation!
Gallery.live – only for Internet Explorer ??
Nov 17th
If you want to improve your Windows Live Writer experience in blogging by adding some interesting plugins, you’ll be pretty disappointed if you use another browser than Internet Explorer.
First I tried first to enter into Writer gallery with Firefox 3, which is my default browser, on http://gallery.live.com/results.aspx?c=0&bt=9&pl=8 … but surprise !
Below is the same web address, but in IE 7.
Later edit:
If you “insist” to use Firefox, the actual entry point in Windows Live writer plugin website is : http://gallery.live.com/results.aspx?bt=9&pl=8&ds=1&la=en&tier=0&st=3&p=1&c=0
Windows Vista Updates Download
Nov 12th
In Windows Vista you are constrained to use the default tool,Windows Updates, which is set to download only the files which need to be updated, by example if xxx.dll exists in Microsoft’s database as a bigger version and needs to be updated, then only this file will be downloaded from the Microsoft servers.
What if you need to reinstall your computer and you don’t have Internet connection available? Sometimes when you don’t know where your work will ask you to be, is better to have all updates archived safely and closely to you, on your harddrive. More >
Customize your Gmail web interface
Nov 7th
Google has been the most improving mailing web interface that I know. Having a whooping 2 GB storage space when launched, he slapped over the face all his competitors, whom at that time had 4- 5 MB of storage space. Now is 7.5 GB and increasing.
The interface is very clean and intuitive, but not lacking the good looking ( example of bad looking is Squirrel Mail who looks obsolete, due to the right angle corners, opposed to the round corners approach in Gmail). Also the code completion for emails, the spell checker and other goodies makes this interface the most interesting in my opinion.
Recently, I learn about something that is quite hidden in Gmail interface: the plugins.
These can be activated by going into Settings in your Gmail mail account, click on Labs tab and search the desired plugin. In order to add it’s functions on the interface, you must activate first by checking the Enable option. It will be applied as soon as you click ‘Save Changes’ button on the bottom of the page.
|
I have activated the following plugins:
Give it a try! |
svn: Your file or directory is probably out-of-date
Sep 15th
One of the most tedious bugs in Subversion, ever, is this one. If you want to commit changes to your working copy, and the response of svn is :
svn: The version resource does not correspond to the resource within the transaction. Either the requested version resource is out of date (needs to be updated), or the requested version resource is newer than the transaction root (restart the commit).
If you stick with standard advice, trying to update your working copy you’ll find out something interesting: Nothing is out of date! You just can’t commit!!!
One solution that I found, but I don’t know all the consequences of doing this so DON’T BLAME ME if you lose important local properties in your repository is the following :
1) Go to the directory in your working copy that contains the problem file.
2) Delete .svn/all-wcprops from there.
That’s it. Commit and be happy. PS: All I can say is that this has not crashed any of my working copies yet.