SVN Checksum Errors
I haven’t touched my SVN repository in a long time. Now when I try to create a new branch and check it out I get a checksum error.
Looking around a bit suggests that this can be caused by SVN bug or hardware issues. Either way I need to find out how to repair the file.
Too late now but my next post should be a description of how to solve this problem.
SVNServe
I always forget how to do this so I thought I would post about it.
svnserve -d –listen-host www.kountr.com -r .
So That is the Real Value
I was just playing with some changes, poking around in the dark and the whole SVN workflow felt really combersome. I was worried that maybe I had introduced too much process for such a simple operation. And then it hit me. It is 12:44am and I need to go to bed, but I am in the middle of changes, changes to the live site.
Publish the trunk version to the webserver and I am good to go to bed. I’ll return to my poking around in the dark tomorrow. I love my branches.
Good night.
Merging a Branch to Trunk with SVN
I have a lot of faith in SVN. And once again things seem unintuitive. I like unintuitive cause it leads me to believe that someone really smart fought against the status quo to find the RIGHT solution, not the comfortable solution.
I am using TortoiseSVN. When you merge you apply a patch (the diff between two revisions) to a current working copy. So here is what I am doing.
I have a checkout from trunk and one for my bug fixing, call them A and B respectfully. I will apply the diff (B-A) to A. Then I can commit the changes in A back to the repository.
Here goes nothing!
That didn’t work.
Okay, Tortoise has some great new features that don’t work for me because I have a server running pre-1.5. I get an error message about not being able to retrieve “mergeinfo”. I use a shared server so it isn’t as easy as upgrading. IT IS EASIER.
I use the most dangerous looking merge option in the first panel of the merge wizard; “Merge Two Different Trees.” This allows me to do exactly what I described earlier.
I got help from these two sources;
SubVersion Workflow
I have a lot to write about on this topic but for now, at this late hour I just want to capture the workflow I am planning on using.
- Create a branch with svn copy.
- Check out this branch
- Make changes
- Commit changes to branch
- Export branch to webserver
- Test
- Make further changes
- Once satisfied merge branch to trunk
- Deploy trunk
IE, setAttribute, and Style
I was using setAttribute to set the style attribute for some AJAX action on the site. It worked great in Firefox but when we tested on IE7 it did nothing.
I found some great information here.
It is all working now.
Great to See People Using the Site
I was following up on some links today and came across someone using Kountr.
http://grammar.quickanddirtytips.com/
I bumped into GrammerGirl on twitter and she gave us some great feedback after trying out the site. You can thank her for the reintroduction of uppercase letters on the site.
We can all use a little help with our writing, go check out her podcasts and her new book, set to launch in a matter of days.
Big Change for Users
We started Kountr, simple. When first asked for persistent features we opted to use sessions and client side cookies to achieve these features. The Your Kounts and Your Recent sections were achieved this way.
Recently we added the notion of users. When you joined we would sweep up all the kounts you “owned” and make this right in the database. For the last couple weeks I have been trying to maintain these two seperate systems for ownership of kounts.
Bugs and new feature requests have pushed me to remove the cookie based system. Now if you want to own your kounts, then you need to join the site. It is just about the easiest site to join. Provide a username and email and you are immediate joined and logged in. We email your password for the next time you need to login.
If you join Kountr and would like to take ownership of your kounts, just send us some feedback, which kounts, and we will make it right.
We appreciate your patience during these bumpy changes and hope you will enjoy and be inspired by the new features we are developing.
I Just Knew
I have had a data model for all of a week, maybe. And I want to replace it all. It just doesn’t scale. I have three ways to deal with the three different security related features I have implemented. So tonight I will do the biggest DB mod and data migration I have done to date. This will be a tough one. I’ll try to keep some notes going here as I go along.
Step one, take down the site.
Most important technical thing I learned this week;
INSERT INTO table_name ( col1, col2, … ) SELECT ( col1, col2, … ) FROM table_name2;
This is just what I needed for my data migration. I am normalizing the DB so I needed to move partial data from one table to another. This saved my life. I might actually get to bed before 2 am now.
Second best technical thing I learned this week;
UPDATE table_name SET col = other_table.col2 FROM other_table WHERE …
So awesome! Inline Datamigration is a total possibility.
Third;
SELECT * FROM table1_name t1, table2_name t2 where t1.col1 = t2.col2;
I am such a SQL newb.
Fourth, a ringer really, I learned this last week but didn’t blog about it.
Django model managers are awesome. They enable you to create much cleaner code. Basically you can move any DB related processing into the manager so that your views are written at a higher level. I will write about this more in the future.
I went live, had a couple issues, but overall that was a pretty smooth data migration. Quick lessons learned once the site was live;
- manager functions are not accessible by instances
- don’t forget to include new models in your view files
- the filter function cannot take expressions, not sure I am properly understanding how this works
This was a pretty good evening. Started the migration around 10:15pm, it is 1:15am now and I am heading to bed. I have tested the site for 10 minutes but I need some real QA after I do something as big as this.
My next step will be to move iKount, and Privacy over to this new model. Then I will implement the visibility functionality with the same model. Some other cool features are just on the horizon.
Django’s “order_by”
Django is awesome for all of the “we’ve already done it so you don’t have to” features. So I am always caught off guard when it falls short.
When you have a QuerySet you can use order_by to order the set before display. This is really handy. Unfortunately, you cannot instruct it to ignore the case of the strings. Debugging this problem was even harder because I stored the strings in the DB as they were entered by users, but only display them in all lowercase on the website. I couldn’t figure out why the list was in two parts, both sorted correctly.
As a fix, I have set the strings to lowercase before they are written to the DB, and gone and changed the current ones to all lowercase. The SQL looks something like;
update table set column=lower(column);
Overall not a huge problem, but it would be pretty slick if Django allowed you to do;
Count.objects.filter(…).order_by(‘name’, ‘ignorecase’
Hope I saved you some anguish.
