Oren Eini

CEO of RavenDB

a NoSQL Open Source Document Database

Get in touch with me:

oren@ravendb.net +972 52-548-6969

Posts: 7,640
|
Comments: 51,262
Privacy Policy · Terms
filter by tags archive

Suse Linux Eval?

time to read 1 min | 66 words

I want to play a little with Mono on Linux, so I went to Suse homepage to get the latest distribution, and I see there an Eval version and an FTP version. The only difference that I can see between the two is that there the eval version has only 1,000 packages with it and the FTP version has 3,500.

What is the story here?

Downloads Change

time to read 2 min | 210 words

I got a lot of complaints about corrupted files from my server. I always managed to get the files and verify that they were fine, but I kept getting emails from people saying that there is a problem. I recently started using the Cuyahoga download module and I suspect that this is the case. Cracking open the code and looking at what is going on there didn't give a clue. It seemed to be doing all the right things.

There are two reasons for using a download module:

  • You want to know the number of times a file was downloaded.
  • You don't want people to be able to direct download the file.

I'm using the download module for the first reason, I don't really care about the second one. So I just changed the implementation to use Response.Redirect(), which should cause a normal download. I hope this will fix the issue. Cuyahoga is a pleasure to work with, the changes I needed to make were localized and very easy to discover. I'm certainly happy that I'm using it.

time to read 1 min | 141 words

I found out what the problem was, dasBlog uses the "Max. Days in Main RSS Feed" for the various API as well. I just changed that value to 1000, run the script again, and then watched how my entire category system reorganize itself. Total run time for the script was 40 minutes. Add to that some more time considering how to solve the problem, learning how to use Xml-Rpc.Net, checking dasBlog source to see why I can't get all the posts, etc and that is ~2 hours.

If I would've tried doing this by hand I would still be hard at work :-)

I also changed the layout ofthe blog page a little, since the categories aren't nearly as long anymore, I pushed them up a bit.

time to read 4 min | 632 words

Did you know that dasBlog has a hierarchal categories with a beautiful way to represent them? I didn't until I visited Oren Ellenbogen's blog and saw how his categories looked. My immediate response was "Me Too! Me Too!", so I set out to learn the secret.

Turns out that this isn't such a big secret after all: Oren* told me that it's simply a matter of seperating the categories with '|'. There is also some css magic that goes along with it, but looking at Oren's site with the WebDeveloper Extention for Firefox quickly showed what I needed. (#1 tool for anyone who wants to develop for the web, in my opinion).

I changed a single post category, and it worked! Now I wanted to change all the rest of them. Hierarchal categories are the new thing, I hear, so I certainly wanted them for my blog. Ever for the old posts. The trouble is that I currently has over 600 posts. (When did I manage to post so much?) And I wasn't feeling like spending the rest of the weekend pouring over each and every one of them changing the categories. I immediately setup to find a programmatic solution to the problem.

The first thing I thought about was that dsaBlog has a programming interface using the Blogger API, but I never worked with it. I googled for a little bit and found the Xml-Rpc.Net library, which incidently comes with a blogger API sample. But apperantly the Blogger API doesn't let you update the categories of a single post, at least not in any way that a very curosry will show. The MetaWeblog API does however, so I used that. I compiled newtelligence.DasBlog.Runtime.Proxies\BloggerAPIClientProxy.cs to an assembly I named dasBlogger.dll (I could've also used the dasBlog assemblies, but it would've taken time to build them, so I just compiled it seperatedly).

I tested it and it worked! Then I had the really hard part, thinking about how to map my categories to hierarchal structure. Here is the code I ended up with, very simple to write and understand. But it doesn't work.  The problem is that dasBlog only return the last 30 posts, no matter what value you pass to it. I'm going to email Scott about it. Pursuing the source for dasBlog, I didn't see where this functionality is controled.

import System
import CookComputing.XmlRpc
import newtelligence.DasBlog.Runtime.Proxies

user = "Ayende Rahien"
password = "Ayende Rahien's Password"

categories = {
"Ayende.Utilities" : "Programming | Utilities",
"Blog" : "Website | Blog",
"Boo" : "Programming | Boo",
"Boo On Rails" : "My Projects | Brail",
"Books" : "Culture | Books",
"Brail" : "My Projects | Brail",
"Bugs" : "Programming | Bugs",
"dasBlog" : "Website | Blog | dasBlog",
"Evil" : "Miscellaneous | Evil",
"eXtreme Programming" : "Programming | XP",
"Humor" : "Humor",
"Miscellaneous" : "Miscellaneous",
"Movies" : "Culture | Movies",
"Music" : "Culture | Music",
"NHibernate Query Analyzer" : "My Projects | NHibernate Query Analyzer",
"Programming" : "Programming",
"Rhino Mocks" : "My Projects | Rhino Mocks",
"Website" : "Website",
"Windows" : "Programming",
"Writings" : "Culture | Writings"
}
log = IO.File.CreateText("log.txt")
dasBlog = BloggerAPIClientProxy()
dasBlog.Url = "http://www.ayende.com/Blog/blogger.aspx"
posts = dasBlog.metaweblog_getRecentPosts("",user, password, 999)
start = DateTime.Now
for post in posts:
try:
for i in range( len (post.categories) ):
newCategory = categories[ post.categories[i] ]
if newCategory is null:
print "'${post.categories[i]}' is an unknown category"
continue
post.categories[i] = newCategory
if len(post.categories) == 0:
post.categories = ("Uncategorized",)
dasBlog.metaweblog_editPost(post.postid, user, password, post, true)
print "Updated post: ${post.title}"
except e:
print "Error updated post: ${post.title}"
print e.Message
log.WriteLine(e.ToString())
log.WriteLine("--- --- ---")
print "Took ${DateTime.Now - start}"

 * Last time I checked there were more than 8,500 people in Israel named Oren, and 7 named Oren Eini (none of them is related to me, btw).

Funny quote

time to read 1 min | 95 words

I just read this post; it's a review about an apperantly bad magazine* which contain this quote:

 For all this wonderful material, you'll never guess the price tag. Come on, guess it. I thought so. It's 69 silver ones an issue!! I can get a book for that kind of dough. With thoughts in it.

I just made me burst out laughing, but I seem to do it a lot today.

time to read 1 min | 91 words

I'm reading some programming forums in Hebrew right now. And I can't help but cringe at the syntax that I see there. Hebrew is writen right to left (as is only proper), while code and the most common terms are written left to right.

The result is that there is a pretty ugly mesh of right to left & left to right text, add in some more terms that was translated to Hebrew and you'll start to get a headache just reading a single question.

time to read 3 min | 423 words

I have a problem doing AST manipulation at run time, sometimes the code work, and sometimes it doesn't. I know what cause the error, and I can fix it for one scenario, but then the other scenario is borken. I'm pretty sure that I'm doing something nasty, but I don't know what. I'm trying to build a method and reference its arguments, but I keep getting errors when I try to test this.

I'm actually reading raw IL (at least it's better than ASMx86), trying to figure out some things that aren't going well. The problem I've have is with parameter indexing. I've a piece of code that generate other code, and it works if I'm passing it a method with 3 parameters, but not if I pass a method with 4 parameters. Actually, that is not a good explanation, I generate a method (at compile time, using the Boo Compiler AST) based on another method. I add two parameters to this method. The problem is what to do when I'm referencing those parameters. Since the IL reference them by index (ldarg.1, ldarg.s, etc) and not by name (that is for us humans), I'm getting problems about null reference methods on some cases (but only some). The logic I'm using is

Found it!

I started to write this question when I suddenly saw the difference between the two cases, there is something in the asking that makes me suddenly view the problem in a different light. As you can see above, I first thought that this is a problem with the number of the parameters a method has, but the issue was different altogther. One of the methods was static, the other an instance method.

First, some background, what is the difference between an instance and a static method? A static method can't use this, can't access non static resources, etc. It took me so long to figure this out because I didn't notice that one method was static and the other wasn't. An instance method actually get this as a hidden parameter. The practical meaning of this is that for instance methods parameter indexing starts with 1, while parameter indexing for static methods starts with 0. That was the reason for the problem, and after adding three lines, the code is working for both conditions.

Thinking about it, the second I realized that the difference between the method wasn't the number of parameters but the static/instance issue, it was obvious what was causing the problem. (Reading a lot of the IL code didn't hurt, either :-).) I guess I should be thankful that I've experiance in C++, otherwise I would likely still be scratching my head.

Brail 1.2

time to read 2 min | 209 words

A new release of Brail, this time featuring:

  • Calling subviews with parameters:
    OutputSubView(“something”, {“val”:value, “one”:other} )
  • Output methods (temp name) for:
    [Html]
    def outputEncodedHtml():
        return “something < or > the other”

    Supported attributes right now is Html / MarkDown / Row.

Some cool stuff there to make the framework more flexible. Check it out here

FUTURE POSTS

No future posts left, oh my!

RECENT SERIES

  1. API Design (10):
    29 Jan 2026 - Don't try to guess
  2. Recording (20):
    05 Dec 2025 - Build AI that understands your business
  3. Webinar (8):
    16 Sep 2025 - Building AI Agents in RavenDB
  4. RavenDB 7.1 (7):
    11 Jul 2025 - The Gen AI release
  5. Production postmorterm (2):
    11 Jun 2025 - The rookie server's untimely promotion
View all series

Syndication

Main feed ... ...
Comments feed   ... ...