kenegozi.com

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

   
2007 Jul 30

Merging with TortoiseSVN

tagged as: tools

Assuming you have a main "trunk" in your subversion repository, and that you are actually working on a different branch.

You'd need to merge your changes from your branch to the trunk so other team members would be able to use your code. You'd also want to be able to merge from the trunk to your branch, to be able to use your teammate's code.

The thing you should bear in mind while you merge, is that the actual merge process is actually working by generating a patch (using diff) and applying this patch on the target.

a quick note: It is very much recommended that you have committed all changes to the target of the merge, into the repository, so it would be easy to revert if something went wrong.

So:

Merging from a branch to the trunk

a. Go to the trunk folder on your filesystem, right-click->tortoise->merge.

b. You want the changes between the current trunk revision and your branch's current revision to be applied on the trunk, so you choose:
From: your trunk, revision HEAD
To: your branch, revision HEAD.

I know, the terminology is confusing, as you want to "update" from the trunk to the branch's state, but remember that you want the diff(erence), or in other words, the changes that will take the trunk FROM it's current state, TO your branch's state.

screenshot:

 branch to trunk

now you have a merged trunk on your workstation. Make sure that everything compiles and that tests are green, and commit.

Merging from the trunk to a branch

a) Go to your branch's folder, right-click->tortoise->merge;

Now, you want the changes between the last trunk revision that you have on your branch, to the newest revision of the trunk. To find out that last trunk revision that you have on your branch, go to your branch's folder, right-click->tortoise->show-log, and look for it. If you are a good reader you'd easily find it since you have mentioned the revision numbers of your merges in the commit remarks, as you are kindly recommended)
A screenshot from the branch's log:

Branch log

I need to check if I have merged my branch to the trunk on a later point. I'll do that using the Trunk's log (trunk folder, right-click->tortoise->show-log):

Trunk Log

Indeed. It seams that my branch is in sync with the trunk at revision 918

b) Now you fill
From: your trunk, revision "last revision you have"
To: your trunk, revision "new, wanted state" (usually HEAD).
in my example, the last trunk version I have merged into my branch is 902, so that's the screenshot:

trunk to branch

I know, terminology sucks again. You probably thing "from trunk to trunk? Is he crazy?" well, again, you want to get the changes that was made TO THE TRUNK, and apply them to your branch. Remembering that this is actually a patch that will get applied make anything clear again.

now you have a merged branch on your workstation. Make sure that everything compiles and that tests are green, and commit.
Recommendation: write down in the commit's remark, the revision number of the trunk (the current HEAD before the merge) for next time.

My thanks to this page, and to Lee Henson who have pointed it out for me, and helped my grasp the whole merge==diff'n'patch thing.

2007 Jul 28

A Sign That I'm Starting To Like NHQG Too Much

tagged as: tools | nhibernate

Today I noticed that piece of code on my working copy:

Repository.Blog.FindOne(Where.Blog.Id == blogId)
2007 Jul 23

IronRuby - First look

tagged as: aspview

That one is just a link to ScottGu's post on IronRuby.

Now I really need to make sure AspView can handle more languages, as I see IronRuby a natural candidate to be hosted within the AspViewEngine.

If I only had some more free time ...

(Note that it's a call for people who can make it happen. AspView is OSS, so you can give it a shot)

2007 Jul 23

Javascript Debugging in VS2005, VS2003 and InterDev is a no go AFAIC

Regarding my last post on the matter, Justin has commented with:

Javascript debugging has been around since VS2003.
It's not the most obvious or straight forward as in VS2008, but it's pretty easy.
The "Script explorer" window in VS2005 lets you see all the files downloaded for a certain browser process Visual Studio is currently attached to. From those files you can set a break point.
So yes, it wasn't easy, but it isn't ground breaking either.

Josh took it one step further mentioning Visual InterDev.

I consider myself a rather sophisticated user, especially when it comes to IDE of any kind.

However, I did not use Javascript Debugging in VS2005 and VS2003, for the simple reason that it was not easy enough, and did not give me enough knowledge of the runtime vars etc. while using it.

When I started .NET-ing, I've had no VisualStudio license, and no idea about SharpDevelop. So I used notepad + csc.exe + WinDbg.exe . It's workable, but it sucks. Just like JS debugging in VS.

Since javascript runs in the client, on the generated markup files, and not on the server's templates (aspx, whatever), it's not as useful as FireBug's ability to set a breakpoint on a proper client html file.

Now, quoting from ScottGu's post:

f you add/remove/update the breakpoint locations in the running HTML document, VS 2008 is also now smart enough to perform the reverse mapping and update the breakpoint in the original .aspx or .master source file on the server.  This makes it much easier to get into a nice edit/debug/edit/debug flow as you are iterating on your applications

As I said - my main reason to move to VS2008 is it's multi-target support, and js intellisense. Sure, I can get js intellisense with a lot of cool non-MS tools, but I want to have a single IDE window per solution.

The easier js debugging IS ground breaking for me, as it seams that I'll be able to use it for debugging js in IE, a thing I'm not currently doing with VS since I don't like it so much.

2007 Jul 20

To Disable, Or Not To Disable (Comments)

tagged as: miscellanea

I used to get a lot of spam through pingbacks/trackbacks, so I turned them off. Actually, on my current blog engine, they are not even implemented.

Reading this post from Joel Spolsky, I am thinking about disabling comments altogether (I do not get many, anyway), so if anybody would like to comment, she'll send me an email (to 'blog at mydomain-name') or use a "contact me" form, and if it will be something worthwhile, I'll do a followup post with the important comments that my alert reader has sent me.

What you think? (you can say that in an email, and even through a comment ;) )

2007 Jul 20

Javascript Debugging Made Easy, Even In Internet Explorer

tagged as: visual studio | client-side

This is why I'll be switching to VS2008, if That was not enough.

As Scott keeps reminding us, it (VS2008) will be able to target multiple runtimes, so we can keep using that against .NET 2.0 and .NET 3.0, no need to adapt 3.5 yet. (I wonder about targeting Mono from VS 2008 ...)

Until now, the JS debugging in VS was not too nice. Sure, I can use FireBug, and thanks to PrototypeJs I have almost no browser compatibility issues. However, sometime IE behaves strange, and I havn't found any decent way to breakpoint into js in IE.

2007 Jul 12

MonoRail / AspView talk on August 15th

tagged as: castle | monorail | aspview

I'm going to give a talk about MonoRail (and AspView, of course), on the next C# UserGroup meeting, at Microsoft Israel offices in Raanana.

 

If you're interested in a solid MVC implementation for web development, that leverages all the goodies of ASP.NET, without the complications of WebForms - this talk is for you.

 

I'll brief over "what is MVC" , and then will demonstrate some of MonoRail's features that can help you build web applications in a way that is easy, expressive, testable and fun. I'll also demonstrate how to create a full MonoRail/AspView application from scratch, using trunk versions, as this is something that many people ask for on the Castle dev and user lists, and on my email's Inbox, too.

 

If you have any ideas/question about MonoRail or AspView, that you'd like me to address during that talk, please drop a comment here or to my email, and I'll try to make room for that in my talk.

 

Admission is free, and you may attend without reserving a place.

However, the group admins kindly request that you notify them if you plan to attend so that they can be sure to have enough chairs and FOOD!

 

Contact them through the usergroup's webpage.

 

See ya.

2007 Jul 9

Presenting you: the Egozimpsons

tagged as: personal

It seams that everybody is making their Simpsons themed avatars lately.

 

So, I present you with the Egozi family's Simpson pic.

 

I was sorry that we could not make Simpsons Cats for our kitties, so we settled for putting cats on our shirts ...

 

Egozi_Simpson

 

See if you can guess who's who.

 

Liked it? Grab yourself one, right here

2007 Jul 8

Checkbox Grids in MonoRail

tagged as: asp.net 2.0 | castle | monorail | aspview

Referring Jon Galloway's post, here is my 5-minute-scracth-up-somthing that includes no hacking at all:

 

 

The Controller:

    public class GourmetController : SmartDispatcherController
    {
        [AccessibleThrough(Verb.Get)]
        public void WineMatch()
        {
            PropertyBag["matches"] = FoodAndWineMatchRepository.FindAll();
        }
        [AccessibleThrough(Verb.Post)]
        public void Update([DataBind("matches")]FoodAndWineMatch[] matches)
        {
            FoodAndWineMatchRepository.UpdateAll(matches);
            RedirectToAction("WineMatch");
        }
    }

 

The View:

<%@ Page Language="C#" %>
<%@ Import Namespace="Gourmet" %>
<%
    FoodAndWineMatch[] matches;
%>
<%
    IDictionary @checked = DictHelper.CreateDict("checked='checked'");
%>
<form action="Update.aspx" method="post">
<table>
    <tr>
        <th>Food Name</th>
        <th>Cabarnet</th>
        <th>Zinfandel</th>
        <th>Pinot</th>
    </tr>
<%int i = 0; %>
<%foreach (FoodAndWineMatch match in matches)  { %>
    <tr>
        <td>
            <span><%=match.FoodName%></span>
            <input type="hidden" name="matches[<%=i%>].FoodName" value="<%=matches[i].FoodName%>" />
        </td>
        <td>
            <%=FormHelper.CheckboxField("matches[" + i + "].MatchesCabarnet", matches[i].MatchesCabarnet?@checked:null)%>
        </td>
        <td>
            <%=FormHelper.CheckboxField("matches[" + i + "].MatchesZinfandel", matches[i].MatchesZinfandel?@checked:null)%>
        </td>
        <td>
            <%=FormHelper.CheckboxField("matches[" + i + "].MatchesPinot", matches[i].MatchesPinot?@checked:null)%>
        </td>
    </tr>    
<%++i; } %>
    <tr>
        <td colspan="4">
            <input type="submit" value="Save" />
        </td>
    </tr>
</table>
</form>

 

And the mocked "domain objects":

    public class FoodAndWineMatch
    {
        private string foodName;
        private bool matchesCabarnet;
        private bool matchesPinot;
        private bool matchesZinfandel;

        public FoodAndWineMatch() { }
        public FoodAndWineMatch(string foodName)
            :
            this(foodName, false, false, false) { }
        public FoodAndWineMatch(string foodName,
                                bool matchesCabarnet,
                                bool matchesPinot,
                                bool matchesZinfandel)
        {
            this.foodName = foodName;
            this.matchesCabarnet = matchesCabarnet;
            this.matchesZinfandel = matchesZinfandel;
        }

        public string FoodName
        {
            get { return foodName; }
            set { foodName = value; }
        }

        public bool MatchesCabarnet
        {
            get { return matchesCabarnet; }
            set { matchesCabarnet = value; }
        }

        public bool MatchesPinot
        {
            get { return matchesPinot; }
            set { matchesPinot = value; }
        }

        public bool MatchesZinfandel
        {
            get { return matchesZinfandel; }
            set { matchesZinfandel = value; }
        }
    }
    public static class FoodAndWineMatchRepository
    {
        private static FoodAndWineMatch[] _matches = null;
        public static FoodAndWineMatch[] FindAll()
        {
            if (_matches == null)
                _matches = new FoodAndWineMatch[] {
                new FoodAndWineMatch("Salmon"),
                new FoodAndWineMatch("Steak"),
                new FoodAndWineMatch("Chicken"),
                new FoodAndWineMatch("Chocolate")
            };
            return _matches;
        }
        public static void UpdateAll(FoodAndWineMatch[] matches)
        {
            _matches = matches;
        }
    }

 

No hacking needed. Controller code is short and intuitive.

Oh. No postback for every client click ...

 

I especially liked one of the comments on Jon's post:

I love ASP.NET because of tricks like this that the developer can use.

Well, I do not like WebForms because it makes me "do tricks" (or hack) instead of bringing business value.

So I do not mean that Jon's "hack" is bad. That's what you have to do when you're WebForm-ing. I just say that there are other web development frameworks (actually, all but WebForms) that are more suited for reasonable html generation and for dealing with the http protocol.

2007 Jul 6

To boldly go, where Center is called Centre, and trains run late but will get you anywhere

tagged as: aspview

As I said, I'm starting a new thing, and this post would be about that.

This week I joined a super cool startup called Music Glue.

It's a London UK based company, that is going to change the way music is being tunneled from the artists to the listeners. I cannot really tell to much about the business model, but you can go into the site (we actually have a working site, even though very much cut down yet, having the really neat features still in testing). It's located at (surprisingly) www.musicglue.com

They guys here are the kind of the British folks that I thought I'd meet. I won't spend much on the technical abilities of the team, just enough to say that for the first time in a very long period, I am actually surrounded by people who knows more than I am, and that is a great thing, as I can learn so much, and have learned a lot during the four days I've being here.

But I will talk about the other stuff. The amount of beer I've digested during the last week is comparable to the outcome of a small country, translating a pint to a cent.

There's that great environment, and it is just a lot of fun to work with this guys (when I'm sober enough to feel anything), and I am looking forward for the next time we'll work side-by-side.

 

What am I talking about? What "next time"?

Well, as I said, Music Glue is located at London, and I live in Israel, so this is actually a relocation thing. Since my dear Sarit is in the middle of her M.A., we cannot move just yet, so during the next months I'll be going back and forth, working most of the time from home, and coming over to the office every now and then. Technologically it's a no brainer, thank to subversion/bugzilla/messenger/email, and all bunch of other stuff. On the personal side, that sure is not easy, and it is actually very hard to be away from Sarit and the cats for the whole week. When we'll eventually move to London, we would be harming our great relationship we have with our families and friends back home. I hope we'd find the powers to overcome those issues ... and with the help of a few beers, we might find some new friends ...

 

Now for THE question. Many people ask me how I got to this whole thing. Well, ever since I started blogging, and discovered the online .NET development community, I just came to know a lot of people. Running AspView, I have exposed some of my technical skills in a way that no resume or c.v. can. It happened to be that musicglue.com was the first commercial site aired, that is using AspView. So when the team needed a new blood, I was the obvious candidate. So my advice for people who are looking up to "improve" their visibility as great developers, ( as was already offered by Ayende and many others), is to contribute as much as they can to the community, starting with blogging, and preferably finding a cool open-source project and make it better. (by the way, AspView will gladly accept pathces ...)

2007 Jul 6

Summing up the last two and a half years - Bye bye SQLink

tagged as: castle | activerecord | aspview | hql | personal

It was absolutely brilliant.

I started to work for SQLink on late December 2005 as a Team Leader in the Web Projects Department.

Colleaged by Oren Ellenbogen, it has been a pleasure. Our department head, Moti, was doing the best he can to create a very likeable working environment, and all our developers were enjoing a workplace that enabled them to learn a lot. Oren and I were directing all kinds of sessions with the developers, showing them stuff about .NET and the CLR, from "what are nullables", through "What does the 'using' reserved word mean", to "how the GC is actually working".

We have built this great website called GotFriends, that gave the company a great new source for recruiting new employees, and actually is ground breaking in the Israeli HR world. Building that site, we've used many technologies to make it work smoothly with the company's inner legacy HR system, and with the aid of the SQL master Moran Benisty, it even worked in an efficient way, and coded in a maintainable manner.

Mixing WebForms and Monorail, CodeSmith based BLL with ActiveRecord/NH, ASP.NET WebServices (asmx) and POX/JSON services, it was a very fun thing to work on, in addition to the business benefit to the company.

 

However, a few months ago the Web Project Department was closed, and the company started a new R&D team, leaded by Elad, the company's VP of Business Development. We were two developers (Moran and I), and we worked on several initiatives that the CEO Tamir, and Elad, were cooking all the time. Those projects were all Community-Driven-So-Called-Web-2.0-Kinda-Websites. It was a real delight, and I got the chance to learn a lot about the business side of running an Internet related initiative, as both Tamir and Elad are experienced and intelligent, and the process of refining ideas, with those two, was a real treat.

 

They also gave me the freedom to make all the technology decisions, and they've had enough faith in me to allow me run the projects using MonoRail and AspView, and running Castle ActiveRecord for DB access. Actually, most of the drive behind creating AspView was actually driven by Elad and Tamir, as I've promised to do the best I can to make sure that future additions to the team won't need to learn Boo / Velocity in addition to learn the Monorail MVC and hql.

 

Which actually worked great. Moran has left the team about two months ago, and we've brought three new guys along (Ili, Ofir and last but not least, Itay), and they have seam to easily get control of all the "funky" technologies I've put in use in our projects.

 

Sadly enough, one of the initiatives has stalled just before airing, due to some business decisions. Then we started a new one, and in about 3 weeks we've had a working proof-of-concept, and I really hope that the site will air during August. I give the credit to the team, and to the use of MonoRail/ActiveRecord, as it's such agile and suits highly-changing-environment, as most web initiatives are.

 

A point of interest: This very blog's engine was actually a beta testing for some of the stuff we were using on our last project.

 

That's it folks. I wish the SQLink family all the best, and I'm going to keep an eye on the cool stuff the R&D team is doing, and hopefully I'll report on their success (which would be an AspView success too ...) right here on my blog.

Subscribe

Statistics

283
440

Related Books

Related Jobs

Related Ads

search page | Blog's home | About me