kenegozi.com

<form id='kenegozi' action='post'></form>

   
2006 Sep 27

Good Agile, Bad Agile

tagged as: miscellanea

UPDATED:
The linkes that was reported broken are now fixed. I hope.

Steve Yegge has done it again.

I mean, he is starting another war, after the one he started on his notorious post: "Execution in the Kingdom of Nouns".

Now he's after the Agile stuff.

You can agree with him, or disagree, but you must accept that:

a. He is a very funny writer,

b. He has a point. If you think the opposite way, you should be familiar with his arguments, in order to know yours better,

c. It seams great to work for Goggle, eve though he insists that he's not working as a recruiter.

I'd warmly advise on reading his blog rss-ly, so you won't miss any of his witty stuff.

2006 Sep 25

Using Windows Live Writer for the first time

tagged as: miscellanea

 

on dasBlog 1.8 it didn't work for me for some reason, so now I'm tetsing it on 1.9.

The features are cool. It's nice to work offline on my desktop, but have all of the css as I'm writing directly to the blog's page.

I've downloaded a few Code Highlight Formatters plugins. The one that seams less buggy is Highlight4Writer. It's Nice, and I could easily edit the template it's generating, to add a div with class=Code so it'l get the nice CSS I've applied for code blocks.

This is a test: 

class Test { void JustASimple(string test) { to = test; ThePlugin(); } }

EDITED: It's buggy, too. all of the line brakes and spaces was removed when I moved to Html View and back. I'll have to find another one.

Now I'm testing CodeFormat from ThinkStar.de

 

   1:  class ThisIs
   2:  {
   3:      void JustAnother(string test)
   4:      {
   5:      }
   6:  }

A lot better. I've added some stuff to my theme's style.css file, like removing padding and marging from <pre> tags, and applying all of Code class attributes to the generated CodeFormatContainer class. I like the line numbering option, too.

Trying some aspx stuff:

   1:  <asp:TextBox runat="Server"></asp:TextBox>

less cool, but still works.

I'd like to teach it Boo and brail. Hope to have a little time for that.

 

Now I'll add an image and test the upload ability:

Ken Egozi - That's me !

Like a charm, and note the nice drop shadow.

tags: ,

2006 Sep 25

Voidclass2 theme on dasBlog 1.9 - fix for the comments

tagged as: miscellanea

I'll describe here the fix I've applied to the VoidClass2 theme, that was supplied with dasBlog 1.9, and that I use here.

The problem: When viewing a post with it's comments, the comments and the comments box (where you can add new comments) are hidden way down the scroll. You click on "view comments" and you see only the post, until you'll scroll a bit downward.

The reason: The theme uses css positioning instead of table positioning, and the sidebar (the one with the blogroll, categories view, etc.) is floating *over* the main content area. The good thing is that when the sidebar has ended, there is a lot more room for the content, but since the comments are taking a 100% width of the content area, and there is no room (since the sidebar takes some room), the comments are pushed down below the point where the sidebar ends.

The solution:

Edit the CommentViewBox.ascx file (on the blog's root):
1. Fixing the "add comment" area width - note the new width value (highlighted):

<TABLE class="commentViewTableStyle"
       id="commentViewTable"
       cellSpacing="1"
       cellPadding="1"
       border="0"
       runat="server"
       width="70%">
2. Adding a class to the comment area's div - the new stuff is highlighted:
<div runat="server" id="commentViewContent" class="commentViewContent">

Edit the style.css file from the theme's folder, and add the following text:

/* Fix by ken egozi - comments view didn't fit in the content area */
/* needs a fix in CommentsViewBox.ascx too, for the "add comment" section */
.commentViewContent {
   width: 70%;
}
Now it should be fine.

lemme know if it didn't work out for you.

2006 Sep 23

DasBlog 1.9 - (almost) working

tagged as: miscellanea

So I've had some issues with perrmisions.

I've had some issues with the forms authentication, I've changed the path attribute to /Blog and it screwed everything up. changed back to "/" and now it works.

I've have to do 3 more things, all related to the theme.

1. Setup the google analytics thingie into the hometemplate.

2. Fix the annoying thing with adding comments. I guess the textboxes are set to width=100% or something like that, and since the right colums seams to be floating and taking some room of the main div, the "add comments" section is pushed downward and it look "buggie" (hey, I wanted to add a comment but I see an empty content page. Oh, I should scroll down, Hmm Silly me.).

3. Do some styling.

I like this theme for it's relatively clean HTML and css based positioning.

2006 Sep 22

Finally - DasBlog 1.9 is out

tagged as: miscellanea

I've mention before that my current DasBlog installation isnt very stable. Some of my readers have complaints about slow responsiveness, problems with commenting and other stuff that do not work as smoothly as should.

I was on the verge of trying something else (.text or even implementing a light blogging engine as a MonoRails showcase), but I'll give DasBlog 1.9 a shot, since it has loads of features that I do not have the time to implement right now, and I do find DasBlog as a darn great piece of code.

You can find a detailed post on the matter at Scott Hansleman's blog.

So, my site can be unstable for the next few hours (days?) until I'll finish the upgrade (including the backup of the current folders, and uploading the new version on a 96kbits upload stream from Israel to the hosting farm located at Seattle, WA. I hope the files can swim all they way up there :) ).

Without furture ado - let's the upgrade begin

 

2006 Sep 21

0.999... equals 1

tagged as: miscellanea

Here's something for your mind to chew on for the weekend:

http://en.wikipedia.org/wiki/Proof_that_0.999..._equals_1

in other words:

output 'true' if 0.999.Equals(1)

btw, does this means that Boo == Bp?

2006 Sep 20

HtmlHelper vs. html tags

tagged as: castle | monorail

Should I use HtmlHelper?

take a look at this:

${HtmlHelper.Form('/Home/Search.rails')}
${HtmlHelper.LabelFor('q','search:')}
${HtmlHelper.InputText('q', '', 50, 50)}
${HtmlHelper.SubmitButton('Search')}
${HtmlHelper.EndForm()}

and that:

<form method="post" action="Home/Search.rails">
   <label for="q">Search:</label>
   <input type="text" name="q" />
   <input type="submit" value="Search" />
</form>

Okay. So AjaxHelper is cool, and maybe FormHelper will have some Added Value in it, but I cannot figure out yet the benefits of using HtmlHelper, especially for non-data elements, such as <label>

If you have a good reason to use HtmlHelper, please enlight my.

 

2006 Sep 20

Brail and xml-ing the markup

tagged as: castle | monorail

I like XHTML more than I like HTML.

But IE doesn't think so.

He needs the markup to be *very* explicit about the web page being xhtml.

.xhtml isn't enough, and even not Doctype-ing.

No. he must have the optional <?xml version="1.0" ?>.

So I've added it to my Layout.boo file.

Boo?  Boom. Boo marks macros (such as <?brail ?>) with <? ?> blocks, and Boo doesn't recognize a macro with the name xml.

My current solution is to write:

<?brail
   output '<'
   output '?xml version="1.0" ?'
   output '>'
?>

I guess that adding a dummy xml macro would make the boo templates look nicer, but it is an ugly solution, and since (ugly & nice != nice), we need a better solution.

Maybe a change in Brail (on BrailPreProcessor.boo), to transform <?xml ... ?> stuff to it's "output" equiv, can be done.

2006 Sep 20

My presentation layer of choice: Brail over Castle's MonoRail

tagged as: architecture | castle | monorail

I've evaluated some methods to rail and to MVC in the .NET world, without using webforms.

The first method I tried was to treat aspx's kind'a like old ASP, no server controls, allowing multiple forms, no __VIEWSTATE __EVANTVALIDATION __UGLYHIDDENFIELD in the generated markup, and calling actions on the server, implemented as Controllers over ashx's, or directly linking to a new .aspx view (if no operation is required).
It allowed me to create super clean html, but it has it's limits, since I've had to implement a mechanism for MasterPages and UserControls, and that suck.
There is BooWebness. Seams like a great effort, and I like the natural .ashx approach, but I am not very into its whole framework there.

Then I've went after MonoRail.
Cool.
Has a lot out-of-the-box, including MasterPages(Layouts), UserControls(ViewComponents), Markup Helpers, AjaxHelpers, and a large community. Being part of Castle is a Big Bonus. I believe in Castle. I've been using Castle's ActiveRecord for a while and I find it almost too good to be true. So MonoRail fits well in Castle's world, so I'm into it.

Now I needed to choose a view engine.

NVelovity was disqualified for its discontinuesness, and the need to learn something new and narrow. Not to mention the fact that it's interpreted.

The WebForms hybrid just doesn't look too good.

Brail from Ayende is very nice. Learning Boo isn't like learning a new thing, since I've had a little taste of it in the past, and since it's .NET, and since it has a very readable syntax that any C#/VB.NET/Python/Perl/java/you-name-it developer can learn in minutes. Brail is a lovely name, and I can count on Ayende to keep developing it as much as it's needed.

So Brail over MonoRail it is.

Posts about the matter will come shortly.

2006 Sep 7

Inheritence in Castle's ActiveRecord

tagged as: c# | castle | activerecord

The reference I've used while learning to use Castl'e ActiveRecord implementation is the Blog/Post demos that can be found on Castle's site.

Let's look at the Type Hierarchy example, that can be found here.

It shows an implementation of a class diagram that look a little bit like this:
Class Diagram

Let's look at the code :

[ActiveRecord("entity"), JoinedBase]
public class Entity : ActiveRecordBase
{
   private int _id;
   [
PrimaryKey]
   public int Id
   {
      
get { return id; }
      set { id = value; }
   }
}

[
ActiveRecord("entitycompany")]
public class CompanyEntity : Entity
{
   private int comp_id;
   [
JoinedKey("comp_id")]
   public int CompId
   {
      get { return comp_id; }
      set { comp_id = value; }
   }
}

[
ActiveRecord("entityperson")]
public class PersonEntity : Entity
{
   private int person_id;
   [
JoinedKey("person_id")]
   public int PersonId
   {
      get { return person_id; }
      set { person_id = value; }
   }
}

But look what happens. since the Id property on entity is public and inherited to the subclasses, you get something like this:
Should I use .Id or .PersonId?

So there is a duplicate field here !!!. and it's not only a getter-setter thingie. It also have different private members.

My solution for this is to virtualize the base Id, and protectedize (hehe) the _id member, like this:

[ActiveRecord("entity"), JoinedBase]
public class Entity : ActiveRecordBase
{
   protected int _id;
   [
PrimaryKey]
   public virtual int Id
   {
      get { return id; }
      set { id = value; }
   }
}
[
ActiveRecord("entitycompany")]
public class CompanyEntity : Entity
{
   [
JoinedKey("comp_id")]
   public override int Id
   {
      get { return _id; }
      set { _id = value; }
   }
}
[
ActiveRecord("entityperson")]
public class PersonEntity : Entity
{
   [
JoinedKey("person_id")]
   public override int Id
   {
      get { return _id; }
      set { _id = value; }
   }
}

 
Now it makes more sence:
I should use .Id

 

And before you hit me with a big stick - I do know of ActiveRecordBase<T> . :) the above code is for demonstration purposes only, not to be Copy&Pasted to your Brand-New-Best-Erp-Ever-Made-And-Will-Make-You-Rich

2006 Sep 1

OOP vs. Functional languages - the epic story

tagged as: miscellanea

Argueable, but smart and funny.

If you're into Programming Languages, read this. You can agree or disagree, but it would open your mind. Even if you won't be convinced, you'd have better arguments to stay on your way.

btw, ppl there seam to imply that all the said arguments are valid for C# as well as Java, but I think that C#3.0 is going in the right way to be more dynamic, yet robust and strict enough to be standartized among different developers.

Subscribe

Statistics

387
835

The Lounge

Related Jobs

Related Books

search page | Blog's home | About me