This Blog Has Moved

10 באוקטובר 2011

Please find its new home at omervk.wordpress.com.The blog has been made read-only, but will not be deleted for now. All of the content has been replicated to the new blog, so you can continue the discussion on the older posts there.I would like to thank weblogs.asp.net for being my home these past few years.Omer
אין תגובות

The Anti-Social Network

17 בנובמבר 2009

(I’ve returned from my trip a few months ago, but didn’t have enough to blog about; hopefully, this is my returning to a semi-regular posting schedule; also, I’ve decided to veer off .NET in some of my posts, focusing on more issues that I like to talk about and offer my opinions on) (Update: This article is now featured in Hebrew in Gal Mor’s blog “Holes in the Net”) Social networks have been flourishing in the past few years, and have let us reach more people than we could before them. I, personally, use both Facebook...
תגיות: , ,
אין תגובות

Hiatus

23 בפברואר 2009

In 15 days’ time, I’ll be taking off on a four months long trip around the world. I’ll be hiking and travelling my way through Japan (March-May), the United States of America (May-July) and the Netherlands (July). I’ve been planning this trip for a long time now, since I came back from Japan for the first time in August 2007 (the photo on the right was taken near the Tsurugaoka Hachiman-gu Shrine in Kamakura), and have taken a long leave from work to accomplish it. What this means is that from March 10th you can expect a long...
תגיות:
2 תגובות

Circumventing the KB957543 .NET 3.5 SP1 Regression Bug

29 בינואר 2009

A couple of days ago I hit a regression bug in .NET 3.5 SP1, in which when you have a generic class that implements ISerializable and has static variables – you can not serialize it using a BinaryFormatter without your application either hanging (x86) or raising an exception (x64 – a TargetInvocationException containing an OutOfMemoryException). This only happens if you use a reference type as a generic argument. It’s already well known, but I have yet to find a workaround documented anywhere. You could simply install the hotfix, but well, I wouldn’t if I were you – it...
תגיות: , ,
אין תגובות

Let SQL Server Tell You Which Indexes to Rebuild

5 בינואר 2009

When index fragmentation becomes too high, indexes will be very inefficient. Other than planning a good index design, you should rebuild / reorganize your indexes every once in a while. SELECT 'ALTER INDEX ON . ' + CASE WHEN ps.avg_fragmentation_in_percent > 40 THEN 'REBUILD' ELSE 'REORGANIZE' END + CASE WHEN pc.partition_count > 1 THEN ' PARTITION = ' + cast(ps.partition_number as nvarchar(max)) ELSE '' END FROM sys.indexes AS ix INNER JOIN sys.tables...
תגיות:
אין תגובות

SQL Server Management Studio 2008 IntelliSense Doesn't Recognize Special Characters

I just filed a new bug with Microsoft Connect. I certainly hope this one doesn’t get shrugged off like many of my other bugs did. Want to reproduce it yourselves? Just create a table with a character that can only be valid inside the context of brackets (like a comma or braces) and then try to select from it. Don’t keep the CREATE clauses in the same query window or it might just work. See the screenshot below. This is very frustrating because this means that not only is there no IntelliSense for these objects,...
תגיות:
אין תגובות

Adobe AIR and Hebrew Fonts

24 בדצמבר 2008

(I’ve noticed quite a few people were having this problem, so I decided to blog about it. This might have to do with all non-English fonts, but I experienced it only with Hebrew) The only reason I use Adobe AIR is for the Twitter application Twhirl. However, I noticed the Hebrew text was incorrectly displayed (word order was reversed). I did not find a solution for this online and the guys at Twhirl didn’t know what to make of this. After toying with a few of the options, I finally found the answer –...
אין תגובות

MSBuild Script to Compress All JavaScript Files in a Project

18 בדצמבר 2008

I’ve got one project in my solution which has a lot of JavaScript files and they keep on coming. We’ve been using the YUI Compressor for quite a while and it’s proven an effective tool. After a lot of time of fiddling with the project’s MSBuild script, I came up with the following: <Target Name="BeforeBuild"> <MakeDir Directories="compressed\%(Content.RelativeDir)" Condition="(%(Content.Extension) == '.js') And (!(Exists('compressed\%(Content.RelativeDir)')))" /> <Exec Command="java -jar yuicompressor-x.y.z.jar --type js -o compressed\%(Content.Identity) %(Content.Identity)" Condition="%(Content.Extension) == '.js'" /> <CreateItem Include="compressed\%(Content.Identity)" ...
תגיות: ,
תגובה אחת

Your Mouth Says Windows-1255, But Your Eyes Say ISO-8859-1

I recently wrote an engine that gets XML files stored at our clients’ servers using HTTP requests. One of our clients decided to serve the XML file with one encoding and encode the file itself with another. This posed a problem to XDocument. The client decided to encode their XML using the Windows-1255 encoding (Hebrew), noting the encoding correctly in the XML’s declaration, but served the file stating the ISO-8859-1 (Latin) encoding. This meant that I couldn’t just use XDocument’s normal Load method to load directly from the stream because XDocument looks at the HTTP headers and takes...
תגיות:
אין תגובות

HTML to JavaScript HTML DOM Converter

One of our products demands converting quite a large amount of HTML to equivalent scripts, written in JavaScript that create said HTML. Looking around the Internet, I found no tool that will automate this process for me, so I went ahead and created this simple little application. I've written it using HTML Agility Pack and Simple CSS Parser. It’s hardly perfect and might incorrectly reference attributes, but I’ve tweaked it long enough for it to work, I’m guessing, 95% of the time. The source is not yet included (I want to set it up as a project...
תגיות: ,
אין תגובות