How to Change DISQUS’s Threaded Comments to RTL

I discovered DISQUS a few days ago and tried to work with it on my local Orchard playground. The process of adding DISQUS to the featured blog was as easy as some clicks. There’s a module, you install it and disable the internal commenting system and it’s done. Based on the fact that I’m working on a site with Persian language as the primary content language, adding DISQUS needed a little tweak.

The threaded comments view are originally left to right. Ok, it’s the default for everything; almost every language is left to right except Persian, Hebrew, Arabic and Urdu from what I recall. So what if I want to have the threaded comments in my Persian website to look really right to left? In general terms you can find the best guidelines and tops and tricks on But what DISQUS does generating threaded comments needs attention.

Here are the possible actions one can take:

  1. DISQUS supports custom CSS. You can find the appropriate stylesheet classes and override them in “Appearance” menu in DISQUS admin panel. Make sure to put a !important at the end of each attribute.
  2. Alternatively you can add jQuery scripts on your site template to work this solution out on the client side. A partial approach looked like what you see in the following
// Find all li's which are children of the main comments part
// and reverse the left and right margines.
$("#dsq-comments > li").each(
var l = $(this).css("margin-left");
$(this).css("margin-right", l);
$(this).css("margin-left", "0px");
} );
// This list could continue...
$(".dsq-comment-message").css("text-align", "right");
$(".dsq-comment-message").css("direction", "rtl");
$(".dsq-comment-footer").css("direction", "rtl");
$(".dsq-comment-header").css("direction", "rtl");

I check the above script in FireBug and it worked so I just added this to my local site. I will be blogging more about this. Meanwhile I ask the DISQUS team to find a workaround for this RTL issue for such languages. Sometimes margin-left’s should change to margin-right’s.

C# Async Functions

I was reviewing the new C# specification and the changes that Async Functions made to my beloved language and saw the below section. The outcome has two impression, First it’s funny! Seeing 5 identical phrase in a series in a programming language expression is strange and funny, admit it. But other than that it is definitely complex. It shows all the grammatical and lexical efforts behind the scene for developing such robust and non-nonsense language. Thank you guys, I love the way C# is growing. Thanks.


The grammar of C# is extended as follows:



asyncopt anonymous-function-signature => anonymous-function-body

asyncopt delegate explicit-anonymous-function-signatureopt block

The async modifier is not allowed on method-declarations where the method-body is a ‘;’.

Note that async is a contextual keyword. In all syntactic contexts other than the ones above it is considered an identifier. Thus, the following is allowed (though strongly discouraged!):

using async = System.Threading.Tasks.Task;

async async async(async async) { }

Happy New Year

2011! Just like a flash 2010 passed in front of my eyes. It’s getting unbelievable the way I’m getting involved with the things happen arround me. Still I love the way my life is going on and technology is in the center of it.

I expect we are going to face a lot of new challenges and progresses. All the fellas from computer and science world, I hope you all a Happy New Year.

Toward the Async World

CPUs with multiple cores can run many tasks in parallel. Making the best out of this ability needs more efforts on design side through implementation, test, and profiling which with the introduction of .Net Parallel Extensions we have greater set of tools to starting thinking and living the parallel way.

Visual Studio 2010 also ships with F# as a first class language which should gain more attention in different ways. F# takes your hand and brings you to a very practical functional environment which on top of all of its features adjusts a new way of thinking about programming in particular and software development in general. F# also speaks a new language in parallel programming. Its simple and efficient way of implementing the parallel life helps programmers and system engineers to provide better software faster; maybe it’s unusual to say but programming in F# has a very similar taste of developing the agile way. Everything you build is the result of functions interaction; growing, extending and fixing the software is just doing the same to the functions. Therefore you just need to think about the functions of the system you are trying to build and build the essential functions that make it in whole.

It seems this aspect of F# (parallel abilities) is affecting other parts of the .Net framework. C# and VB are going to support the new async programming constructs built-in and therefore we are going to have a new road ahead in the parallel land. As a system engineer/software developer, people should reconstruct their building blocks inside their software repositories. We all have a huge amount of code here and there with the biggest overhead of taking care of parallelization (if available) which could be done in a more efficient and faster way. Many different parts of the programs could run in parallel now, which we may have been implementing the usual sequential way. If we think about our pockets and we need to compete in the market, I think we all should think again and think parallel.

This Async CTP is in its early stages but I’m sure it will become an uncontrollable giant facing every one of us. Take a look at it.

Isn’t it beautiful?

    bool isOdd(int n)
        return ( (n%2) == 1);
    int sqr(int n)
        return n*n;
        for(int i = 1; i <= 10; i++)    // I know this is stupid!
                printf("%d ", sqr(i));

[1 .. 10]
    |> List.filter (fun n -> n % 2 = 1)
    |> (fun n -> n*n)
    |> (printfn "%d")
Posted in F#. Tags: . Leave a Comment »

Getting Results the Agile Way!

Agile methods of building software are getting more popular each day. The literature is more mature and developed today than five/six years ago. Many software companies and the giants themselves have been successful in adopting their internal processes as well as building tools and patterns to support this methodology.

I’ve read lots of books on the topic but J.D. Meier‘s book is different. It’s more exciting when you could read the book online on this address. Thank you J.D.

F# and simulation strategies

Today I had a discussion with a friend in the field who was trying to find a resolution to his problem on simulating a data generation/acquisition network in which he could be able to produce millions of records of data simultaneously and submit them in a database. He was asking for my opinion about my programming language preference and the overall architecture of the system.

I had many ideas for him ready in my pocket about the architecture and even the object model suitable for the project but when it came to the point of programming language I just had a second thought. It was somehow strange for me not to shout out C# or C++.

As you may have noticed from my initial post in this weblog, it’s been a while I was exploring different aspects of F# which is amazingly beautiful, straightforward, succinct and functional. I guess this whole F# thing is playing my head; you know why? Because it took me about 8 hours to write down a prototype of my idea about my friend’s project and about half an hour to make it real. I’m so much excited about this and it’s killing me to check with him, cause I’m not sure if it’s ok to publish the code.

By the way, what took me to the point of implementing a “blah blah simulator” in F# was curiosity at first, but the precise functional attributes of F# with the help of its active pattern and agents ended up in heaven. You may follow this story on my next one or two posts here by the subject of “F# and simulation strategies”.

Hello, World!

I started a new life again! What am I doing? here’s the very short answer:

let greeting = “Hello, World!”
printfn “%s” greeting

I’ll get into more detail in my future posts.

%d bloggers like this: