I got trolled once because of the way my website looked. I must admit, it did age a bit, but at the time I built it, using ADO.NET, ASP.NET Webforms (ASPX) and Master Pages, it was a pretty cool and sophisticated website for it’s time. Here is a tribute to my old C# blog look […]
Read More →Archive for May, 2020
Adding a context menu to a treeview Part 2
In my previous post I showed you how I added a context menu to a treeview. I had a new requirement that wanted a treeview property to contain a flag that could be turned on or off and that the value be displayed in the context menu. First I added the menuItem to the XAML. […]
Read More →Adding images to a Tree View in WPF using C#
Like I’ve said before, once you find what your looking for, it is easy to find examples about how to use and implement it. I had this again while trying to add images to a treeview. The term I was looking for, while trying to find a solution was ValueConverter. In this solution I will […]
Read More →How to search a Lucene.Net index in C#
I used this code to perform a search of a Lucene.Net index. Lucene.Net.Store..Directory directory = Lucene.Net.Store.FSDirectory .Open(new DirectoryInfo(textBoxSearchIndex.Text)); Lucene.Net.Analysis.Analyzer analyzer = new Lucene.Net.Analysis.Standard .StandardAnalyzer(LuceneUtil.Version.LUCENE_29); Lucene.Net.Search.Searcher searcher = new Lucene.Net.Search .IndexSearcher(LuceneIndex.IndexReader .Open(directory, true)); Lucene.Net.Search.Query query = new Lucene.Net.QueryParsers .QueryParser(LuceneUtil.Version.LUCENE_29, “contents”, analyzer) .Parse(textBoxSearch.Text); Lucene.Net.Search.Hits hits = […]
Read More →Treeview with checkbox in WPF
On one of my projects I had to provide treeview selection functionality. I searched the internet and pulled everything I could into a this single resource. I wasn’t able to find 1 post that provided all the details and source code to do what I needed. Now there is one and if you find it, […]
Read More →Strings in C#
The String class in .Net has many capabilities. Below is a list of some string methods I use frequently in my development projects. Even when I have completed this list, I am sure it will over cover 5% of the capabilities within the String class. After reading this, I suggest you look over the MSDN […]
Read More →How and why I built a cluster of Raspberry Pi’s (Part 1)
Because it was there and because I could, well maybe not. It actually wasn’t very difficult because these instructions worked perfectly. Following them worked without a hitch, almost. There are few small hiccups but we made it through without much problem. It was rather time consuming to re-image all those disks for the 8 nodes. […]
Read More →Lucene.NET returns results only when using numeric values
I used this code to create a Lucene.Net 2.9.2 index. System.IO.DirectoryInfo indexFileLocation = new System.IO.DirectoryInfo(textBox1.Text); Lucene.Net.Store.Directory directory = Lucene.Net.Store.FSDirectory.Open(indexFileLocation); Lucene.Net.Analysis.Analyzer analyzer = new Lucene.Net .Analysis .Standard .StandardAnalyzer(LuceneUtil.Version.LUCENE_29); IndexWriter writer = new IndexWriter(directory, analyzer, true, IndexWriter.MaxFieldLength.UNLIMITED); foreach (IList item in dataToIndex) { Document doc = new Document(); doc.Add(new Field(“ID”, item[0].ToString(), Field.Store.YES, Field.Index.NO)); …. string contents = […]
Read More →Lucene.Net search with star (*) wildcard as first character
Using the star (*) as the first character of a Lucene.Net search is not supported by default. It will return null results if it is not turned on. To turn on the support for leading wild card characters you must set the SetAllowLeadingWildcard property to true. Then you will be able to use wildcard search […]
Read More →Creating a W3WP Memory dump on Windows Server 2003
On a web server with multiple application pools, there most likely will be multiple W3WP processes. Therefore, the first action to take when creating a memory dump of a W3WP worker process is to find which one you need to get the dump of. I wrote a short article on how to get a worker […]
Read More →