Ali Özgür - The Pragmatic Developer

My Amazon.com Wish List

RecentComments

Comment RSS

Downloads

Original project is here

Modified binaries: IIS_LogAnalyzer_Bin.rar (360.01 kb)

Patch file : Indihiang_LogAnalyzer_FTPSupport.patch (170.94 kb)

Screen Shots

 

 


 

Note for Vista Users

Modified version creates a TempDir under the application installation folder and downloads files there. Vista does not allow regular user to create directories under Program files so if you install the application under Program Files , right click on the Indihiang.exe, click Properties and check "Run this program as an administrator" option found in Compatibility page.

 


aliozgur posted on October 7, 2009 10:47

Yesterday I visited Rob Conery's blog and the post about commercial SubSonic support options made me think again about the open source philosophy. In my opinion Rob must decide in which category of Open Source is SubSonic located.

  • Is it a real open source project as defined by OSI
  • Is it an open source project in a way ASP.NET MVC is

If SubSonic is in the first category, I believe NHibernate is in that category, Ayende’s commerical support offering is not acceptable. Since bug fixes are included in that offering and Rob or Ayende are commiters that would not sound right to the community.

If SubSonic is in second category and Rob decide that SubSonic is open source but main official release is maintained and owned only by him or a company that commericial support offering would be ok.

Perfect Examples

Following OSS examples are very well suited to define my objection

Linus Torvalds does not offer bug fixes as a commerical support for the official Linux kernel. He does not because he is the main authority, and the unpaid authority, who decides if a bug fix or patch be applied to the official release of the kernel. (I do no think he has the time to review all submitted patches but he in a way organized the inner workings) But we all know that Suse and RedHat offer bug fixes and patches for their own distribution, which is understandable and valid. I do not mind the way RedHat or Suse patches and bug fixes are applied to the official kernel releases.

Another example is the Mozialla Foundation. If NHibernate had a non profit foundation as Mozilla and the foundation offered commercial support via kind of Mozilla Corporation that would be OK too. And I want to remind you that Mozilla like foundations do not distribute share profit to any third parties.

Questions

  1. As far as I know NHibernate is not copyrighted to anybody or any entity. So may other contributors claim copyright for the bugs they introduce which may cause some complications?
  2. The material itself and the functionality that material provides is not paid in OSS projects. Does offering commercial bug fix support right for the official release of the project cause the material to have some sort of monetary value, since fixing bugs is commercialized which means introducing bugs may be commercialized too?
  3. What if I, as a non commiter to NHibernate project, wanted to offer commercial bug fix support too? Do you think that project leads would allow me to be a committer just beacuse of that even if I'm not qualified to be a commiter? Shall I interpret Ayende as monopoly in NHibernate community context? Don't you think that being a virtual/possible monopoly conflicts with the open source?
  4. If an OSS is not copyrighted to anybody or any entity, do you think that OSS project leads hold legal rights to decide whom to let in or kick out?


Posted in: General Development  Tags:
aliozgur posted on August 14, 2009 12:32

For a while I'm trying to align a technology toolset for Web 2.0 development. Recently I decided to go with Microsoft .NET technologies and JQuery.

Here are the tools I'm provisioning to utilize

  • ASP.NET MVC and JQuery
  • ADO.NET Entity Framework
  • WCF
  • May be ADO.NET Data Services and ADO.NET Dynamic Data

There is already a jQuery LighBox Module for Cuyahoga 1.6 but in my case I have a Cuyahoga 1.5.0 installed with some custom modules and can not use that module. Here are the steps you have to perform to use jQuery LighBox Plugin with a Cuyahoga 1.5.x installation.

  1. Dowload jQuery LighBox plugin from here.
  2. In your Cuyahoga installation root browse to js folder and create JQueryLightBox folder under that js folder
  3. Open jquery.lightbox-0.5.min.js file found in the downloaded package and replace
    • 'images/lightbox-ico-loading.gif' with '/images/lightbox-ico-loading.gif'
    • 'images/lightbox-btn-prev.gif' with '/images/lightbox-btn-prev.gif'
    • 'images/lightbox-btn-next.gif' with '/images/lightbox-btn-next.gif' 
    • 'images/lightbox-btn-close.gif'with '/images/lightbox-btn-close.gif'
    • 'images/lightbox-blank.gif' with '/images/lightbox-blank.gif'
    and save your changes
  4. Copy jquery.js and jquery.lightbox-0.5.min.js files found in the downloaded package to JQueryLightBox folder created in the previous step
  5. Create a folder named css under your Cuyahoga installation root and create JQueryLightBox folder under that css folder
  6. Copy jquery.lightbox-0.5.css found under css folder inside the downloaded jQuery LighBox package to JQueryLightBox folder created in the previous step
  7. In your Cuyahoga installation root browse to Images folder and copy the image files found in under images folder of the downloaded jQuery LighBox package to the Cuyahoga Images folder.
  8. In your Cuyahoga installation browse to Templates folder and find the ascx file under the current template folder you are using
  9. In the head section of your ascx file add these lines

  10.   <script type="text/javascript" src="../../js/JQueryLightBox/jquery.js"></script>
      <script type="text/javascript" src="../../js/JQueryLightBox/jquery.lightbox-0.5.min.js"></script>
  11.  At the end of the ascx file just before the closing of body tag add the following js code
  12. <script type="text/javascript">
    $(function() {
        $('a.lightbox').lightBox(); // Select all links with lightbox class
    });
    </script>

  13. Add links to your images to enable jQuery LightBox for your images. Here is the template link 
  14.  <a title="Title here" class="lightbox" href="Link to your original image file"><img border="0" alt="" src="Link to the thumbnail image file if you wish to use thumbnails, if not you can remove this img tag" /></a>
     
  15. See jQuery LightBox in action


Posted in: Cuyahoga  Tags:
aliozgur posted on June 2, 2009 16:59

After being named as Best General Database Tool by CodeProject readers PragmaSQL decided to publish a free Personal Edition.

You can download PragmaSQL Personal from here


Posted in: PragmaSQL News  Tags:
PragmaSQL was named as Best General Database Tool by The Code Project’s members.
Members were asked to rate their favorites on CodeProject. The Code Project staff then compiled the highest rated listings, awarding the highest ranked in each product category. The results reflect actual perceptions of what developers value. Each codeproject.com member decides which companies or products deserve recognition, based on in-the-field experience.  

Posted in: CodeProject  Tags:
aliozgur posted on May 18, 2009 16:46

Why?

Some time ago while I was working on a project, that was a top secret project so can not give more details Smile,  I realized that I've produced some sort of weird code that checks if an interval (Start,Stop integer value pair) intersects with another interval. Right after unit testing and commiting the code I felt like there is something wrong wih me. Here are the details

Nothing Fancy

Here is the code of my Interval structure. There is nothing fancy about this structure it is used to hold two integer values and performs range checking in the constructor to guarantee that start value is always smaller or equal to stop value.

public struct Interval
{
private int _startValue;
public int StartValue
{
get { return _startValue; }
private set { _startValue = value; }
}

private int _stopValue;
public int StopValue
{
get { return _stopValue; }
private set { _stopValue = value; }
}

public Interval(int startValue, int stopValue)
{
if (startValue > stopValue)
throw new TypeInitializationException("Interval",
new Exception("Provided start value is greater than the provided stop value."));

_startValue = startValue;
_stopValue = stopValue;
}

public bool IntersectsWith(Interval interval)
{
//TODO: Check if this intersects with the provided interval
}
}

 

Conventional Way

Conventional way of implementing that IntersectsWith method is to 1) write some if/else blocks or 2) to combine a single return statement  to cover all of the cases illustrated on the following image

My Problem

But somehow I did not choose the conventional implementation and I decided, in fact by reflex, to re-model Interval objects as rectangles with 1px in height , place them on xy coordinate system and check if two rectangles intersect or are tangent to each other. Here is my weird IntersectsWith implementation

 

public bool IntersectsWith(Interval interval)
{
  Rectangle r1 = new Rectangle(StartValue, 0, StopValue - StartValue, 1);
  Rectangle r2 = new Rectangle(interval.StartValue, 0, interval.StopValue - interval.StartValue, 1);

  return r1.IntersectsWith(r2) || (r1.X + r1.Width == r2.X) || (r2.X + r2.Width == r1.X);
}

 

Questions to myself

  • Is this weird implementation is a result of too much analytical thinking?
  • Is this weird implementation is a result of too much abstract modeling I have to do to perform my job well?
  • Shall I see a therapist?
  • Is this weirdness a common pattern among developers?
  • Shall I ask this as an interview question? And what shall I do with people implementing this method like me and not like me?
  • How will my colleagues feel when they have to read my wierd IntersectsWith implementation?
  • Shall I be ashamed of myself? 

Code

WeirdIntersectsWith.rar (23.00 kb)


Posted in: .NET Development , General Programming   Tags:

I'm currently working on some small projects and an enterprise level case study project where I decided to use SubSonic which is a lightweight open source ORM for .NET led by Rob Conery. I can say that SubSonic is really lightweight and is really easy to use, but as might be expected has some minor configuration overhead. SubStage developed by Eric Kemp is a must have if you are using SubSonic, but this tool lacks a very important feature IMHO. All your subsonic related project configuration is kept inside a predefined MasterStore.xml file which means you only have a single file for all your subsonic projects. In this scenario it is not easy/handy to attach your substage configuration to your project source code.

To overcome this problem I modified SubStage source code (built against SubSonic 2.2) and added "Load Master Store" and "Save Master Store As" File menu items. I posted the patch to Eric Kemp but I do not know if the patch will be applied in newer version so I publish both compiled SubStage and the Subversion Patch file.

Downloads

SubStage_2.2_With_MasterStore_LoadSave.rar (1.69 mb)

SubStage_Patch_AliOzgur.patch (242.82 kb)


Posted in: .NET Development , C# , SubSonic  Tags:
aliozgur posted on January 30, 2009 13:10

The sample Ruby code has no syntax errors. What does the code through lines 3-5 mean? And what is printed to the screen/console?

Any Suggestions ? Smile

 

class Sample
  attr_writer :name
  attr_reader :name do
     "Mr. " + @name
  end
end

s = Sample.new
s.name = "Ali"
puts s.name

 


Posted in: General Development , Ruby  Tags:
aliozgur posted on January 26, 2009 09:11

Based on my previous article Artem Smirnov[^] posted a question about how to test a Repository(DAL) method in a project using Nhibernate as ORM. Here is his question

"I wanted to unit test a similar, but more common, problem: a Repository method. I.e., create a test Order for a particular date, and test that the FetchOrdersByDate method returns this order if the date matches. My guess was that I could just create an Order, attach it to the session without saving it to the database, then somehow stub the database and make NH fetch it from the cache. After doing a lot of search, I discovered that this is impossible, so I had to hit the database for every test. Given that NH looks extremely flexible, i.e., Interfaces everywhere, this is kind of strange.."

Here is my answer

The problem related to testing a Repository method is a very common one and people suggest different solutions to this problem. Here are some of them

* Mock your Repository method by using a Mocking library or by hand. But this suggestion is not valid all of the time. If you have native SQL or use NH Transformers to produce DTO's mocking is not an option.

* Use an in-memory database like SQLite for your tests. But if you have native sql or develop against a legacy database or use part of a legacy database you can not follow this approach

* Take script of your production database and create an empty test database. Run your tests against the test database. This method also have some drawbacks, to name few, tests take longer to run, you have to keep your test database up to date with the live one, you have to deal with some phantom objects not directly managed by your domain ( for example your domain contains Instructor class just for integrity reasons and you do not have code to deal with Instructor instantiation because you do not actually need this piece of function. But somehow you have to create Instructor objects for testing). You can solve the first two problems with Continuous Integration, but the later can be tricky to solve. However this last approach has one big outcome, that is, you will likely have failing tests if something goes wrong with your database.

I personally tend to follow the last approach for NH specific testing and write pure unit tests otherwise. 


Posted in: .NET Development , C# , NHibernate  Tags: