<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>Software Development</title><link>http://dfisla.uniblogger.com/category/44.aspx</link><description>Code or Die!</description><managingEditor>Daniel</managingEditor><dc:language>en-CA</dc:language><generator>uniBlogger Version 1.3.2005.22041</generator><item><dc:creator>Daniel</dc:creator><title>On chat bots that understand context in discussions</title><link>http://dfisla.uniblogger.com/archive/2006/04/05/7614.aspx</link><pubDate>Wed, 05 Apr 2006 22:05:10 GMT</pubDate><guid>http://dfisla.uniblogger.com/archive/2006/04/05/7614.aspx</guid><description>&lt;P&gt;I played with the OpenNLP librabry and it is a nice port of the java nlp library. (Natural Language Processing)&lt;/P&gt;
&lt;P&gt;I am toying with the idea of creating a chat bot that tries to extract the context of what is being discussed and formulate responses based on context instead of keywords only.&lt;/P&gt;
&lt;P&gt;Then the next step would be to train the bot by observing other people in discussions and learn how other people respond given certain context. For example, bank &amp; bills =&gt; sadness, stress, saving etc... bank &amp; payday =&gt; happiness, shopping, speding etc... I know it's a very crude example however this could work.&lt;/P&gt;
&lt;P&gt;The advantage here is that all contextual responses can be learned and do not have to be hard wired into the chat bot, even better, giving the bot the ability to learn and make meaningful transitions as context changes thoughout the discussion.&lt;/P&gt;
&lt;P&gt;Hmmm...back to work.&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;&lt;img src ="http://dfisla.uniblogger.com/aggbug/7614.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Daniel</dc:creator><title>Mozilla Thnderbird nightly builds</title><link>http://dfisla.uniblogger.com/archive/2006/03/22/7475.aspx</link><pubDate>Wed, 22 Mar 2006 14:39:35 GMT</pubDate><guid>http://dfisla.uniblogger.com/archive/2006/03/22/7475.aspx</guid><description>&lt;P&gt;&lt;A href="http://www.mozilla.org/developer/#builds"&gt;http://www.mozilla.org/developer/#builds&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Releases 3.0x alpha have some cool new features, improved new mail notification as well as RSS feeds support.&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;&lt;img src ="http://dfisla.uniblogger.com/aggbug/7475.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Daniel</dc:creator><title>C# String Formatting</title><link>http://dfisla.uniblogger.com/archive/2006/03/20/stringformatting.aspx</link><pubDate>Mon, 20 Mar 2006 10:20:50 GMT</pubDate><guid>http://dfisla.uniblogger.com/archive/2006/03/20/stringformatting.aspx</guid><description>&lt;P&gt;Great discussion at regarding String.Format(...) calls, it's a good summary and referrence for dates and other types.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blog.stevex.net/index.php/string-formatting-in-csharp/"&gt;http://blog.stevex.net/index.php/string-formatting-in-csharp/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;&lt;img src ="http://dfisla.uniblogger.com/aggbug/7448.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Daniel</dc:creator><title>On data sharing, thread safety and priority queues.</title><link>http://dfisla.uniblogger.com/archive/2005/07/28/2837.aspx</link><pubDate>Thu, 28 Jul 2005 11:47:12 GMT</pubDate><guid>http://dfisla.uniblogger.com/archive/2005/07/28/2837.aspx</guid><description>&lt;P&gt;Good article for basic understanding of thread safety and static utility methods. I think the article does a good job with data sharing examples.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://http://odetocode.com/Articles/313.aspx"&gt;http://http://odetocode.com/Articles/313.aspx&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;I would only add that it is not only important to watch out for data sharing between threads, but also access and sharing of I/O resources like db connections, files and sockets.&lt;/P&gt;
&lt;P&gt;One way would to use lock(obj){ ... } mechanism, where the system runtime will manage its own queue (serialized access), or another way would be to implement your own access queue mechanism.&lt;/P&gt;
&lt;P&gt;Implementing your own queue mechanism can give you advanced features, should you need to implement them, such as priority scheduling and better micro-level locking.&lt;/P&gt;
&lt;P&gt;By micro-level locking I mean the following. Let's say you have a function named 'SaveFile(...)' which uses lock(obj){...} mechanism to serialize access to a particulat file resource, it is possible to implement this in such a way that a unique lock object is used for each unique file name.&lt;/P&gt;
&lt;P&gt;Better, queue can be scanned/sorted by resource objects being accessed and allow concurrent queue processing as long as each work item in the queue processed is accessing a different resource.&lt;/P&gt;
&lt;P&gt;In essence, this turns one queue into a multi-queue mechanism where each shared resource has it's own queue. This greatly improves performance and would be similar to record-level locking mechanisms in databases, but instead could be applied to sockets, files, etc...&lt;/P&gt;
&lt;P&gt;Lastly, in such multi-queue system priority scheduling can be implemented where queue management code can select by weight or some other calculated heuristic how much time should be dedicated to each queue.&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;&lt;img src ="http://dfisla.uniblogger.com/aggbug/2837.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Daniel</dc:creator><title>Blog comment spam keeps on coming.</title><link>http://dfisla.uniblogger.com/archive/2005/06/23/1547.aspx</link><pubDate>Thu, 23 Jun 2005 12:02:48 GMT</pubDate><guid>http://dfisla.uniblogger.com/archive/2005/06/23/1547.aspx</guid><description>&lt;P&gt;Even with Captcha enabled, comment spam keeps appearing on blogs. Either spammers have the ability to do OCR on captcha text, which I doubt as I only found few academic papers how to do this and the required skill set and amount of tweaking for each site using captcha images, would be well beyond most spammers.&lt;/P&gt;

&lt;P&gt;Looking at the IP logs it is clear most comment spam comes from overseas where human labour costs are low and it may be worth while to pay someone to manually defeat captcha measures. What I think is needed is some kind of classification system, like Bayesian filtering, similar to what DSPAM, BogoFilter and SpamAssassin are using. 
&lt;/P&gt;
&lt;P&gt;I have most of the code developed based on Paul Graham's (&lt;A href="http://www.paulgraham.com/spam.html"&gt;http://www.paulgraham.com/spam.html&lt;/A&gt;) 'Plan for Spam' thesis. I think such symptoms will, or already do, affect any public online systems such as Wikis and Forums. &lt;/P&gt;

&lt;P&gt;Ultimately, only some automated classification moderation system will do, in addition, with some human supervision to fix false positives.&lt;/P&gt;&lt;img src ="http://dfisla.uniblogger.com/aggbug/1547.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Daniel</dc:creator><title>Log4Net</title><link>http://dfisla.uniblogger.com/archive/2004/12/10/134.aspx</link><pubDate>Fri, 10 Dec 2004 20:04:09 GMT</pubDate><guid>http://dfisla.uniblogger.com/archive/2004/12/10/134.aspx</guid><description>&lt;P&gt;One of the essential .Net tools I've found is log4net logging framework. (&lt;A href="http://logging.apache.org/log4net/"&gt;http://logging.apache.org/log4net/&lt;/A&gt;)&lt;/P&gt;
&lt;P&gt;I've use it in everything from console apps, windows forms, web forms and dll libraries. A typical use scenario would for a .Net dll library would go like this.&lt;/P&gt;
&lt;P&gt;Let's say we have executable named &amp;#8220;uniBlogger.Drivers.exe&amp;#8221; which is a console application in C#.&lt;/P&gt;&lt;BR&gt;
&lt;P&gt;1. Create .log4net log file named &amp;#8220;uniBlogger.Drivers.exe.log4net' with contents:&lt;/P&gt;
&lt;P&gt;&lt;?xml version="1.0" encoding="utf-8" ?&gt;&lt;BR&gt;&lt;log4net debug="false"&gt;&lt;/P&gt;
&lt;P&gt; &lt;appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender"&gt;&lt;BR&gt;  &lt;param name="File" value="log-data\uniBlogger.Drivers-log.txt" /&gt;&lt;BR&gt;  &lt;param name="AppendToFile" value="true" /&gt;&lt;BR&gt;  &lt;param name="MaxSizeRollBackups" value="10" /&gt;&lt;BR&gt;  &lt;param name="MaximumFileSize" value="1MB" /&gt;&lt;BR&gt;  &lt;param name="RollingStyle" value="Size" /&gt;&lt;BR&gt;  &lt;param name="StaticLogFileName" value="true" /&gt;&lt;BR&gt;  &lt;layout type="log4net.Layout.PatternLayout"&gt;&lt;BR&gt;   &lt;param name="ConversionPattern" value="%d [%t] %-5p %c [%x] - %m%n" /&gt;&lt;BR&gt;  &lt;/layout&gt;&lt;BR&gt; &lt;/appender&gt;&lt;BR&gt; &lt;root&gt;&lt;BR&gt;  &lt;level value="ALL" /&gt;&lt;BR&gt;  &lt;appender-ref ref="RollingLogFileAppender" /&gt;&lt;BR&gt; &lt;/root&gt;&lt;BR&gt;&lt;/log4net&gt;&lt;/P&gt;
&lt;P&gt;2. Add the following code into the &amp;#8220;AssemblyInfo.cs&amp;#8221; file in the project:&lt;/P&gt;
&lt;P&gt;using log4net;&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;// Load the configuration from the 'uniBlogger.Drivers.exe.log4net' file&lt;BR&gt;[assembly: log4net.Config.DOMConfigurator(ConfigFileExtension="log4net", Watch=true)]&lt;/P&gt;&lt;BR&gt;
&lt;P&gt;3. Create the &amp;#8220;log-data&amp;#8221; subdirectory, in the directory where the executable resides.&lt;/P&gt;&lt;BR&gt;
&lt;P&gt;4. For every class you want to participate in logging include the following member handle:&lt;/P&gt;
&lt;P&gt;using log4net;&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;// LOG4NET&lt;BR&gt;  private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);&lt;/P&gt;&lt;BR&gt;
&lt;P&gt;5. For every method you want to participate in logging include the following code:&lt;/P&gt;
&lt;P&gt;public bool CheckProfileGeneral(){&lt;BR&gt;   &lt;BR&gt;   string sql = "";&lt;BR&gt;   &lt;BR&gt;   MySqlParameter[] p = &lt;BR&gt;   {&lt;BR&gt;    BlogIDParam&lt;BR&gt;   };&lt;/P&gt;
&lt;P&gt;   if (LOG.IsInfoEnabled) &lt;BR&gt;   {&lt;BR&gt;    LOG.Info( " class: " + this.GetType().FullName + &lt;BR&gt;     " method: " + System.Reflection.MethodBase.GetCurrentMethod().Name +&lt;BR&gt;     " MySqlParameters: " + LogMySqlParams(p));&lt;BR&gt;   }&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;&lt;BR&gt;
&lt;P&gt;6. That's it! Remember you can make generic calls the the log API via LOG.Error(...), LOG.Warn(...), LOG.Info(...) and LOG.Debug(...) function calls. You get to control which log levels get filtered down via the XML lo4net config file and the log level setting.&lt;/P&gt;&lt;img src ="http://dfisla.uniblogger.com/aggbug/134.aspx" width = "1" height = "1" /&gt;</description></item></channel></rss>