CInkv2 release postponed

Last weekend I was about to release CInk v2, but at the last moment I found a big bug in the way paths are implemented. Now the situation is quite tricky to solve. On top of that, now-a-days I find myself with very little free time. Anyway I will continue to work on it. My estimate is that now CInk v2 release is postponed by a month.

Site running on steriods or so I am told

I was told Nginx is superbly efficient and is the only way I can keep my server from being thrashed every two days. Yesterday I moved to Nginx. So far so good. If it runs fine for a week without issue then fine. Keeping my fingers crossed. Will post my Nginx configs then.

One more thing before I sign off. Apache processes are bloated since it has mod_php embedded in it. In case of Nginx you need to rung Php processes separately. So, in this case we must count the memory usage as the combined total of Nginx and Php. In many cases you will end up with the same memory size as that for Apache but there is a catch here.

Nginx processes have very low memory footprint and it can alone serve all the static files, very efficiently. This will cut down on a huge load since, on your WordPress powered blog too, there are loads of static files – images, Javascript, CSS, etc. Only the Php rendered page will tax the system, but hold on, here comes the second catch!

Your blog’s content doesn’t update every day or minute. So, why do we need to go to Php for each and every user and re-render the page again? Well we don’t need to. WP Supercache is a plugin for WordPress which does just that. It generates the static htmls of your pages and keeps them on the disk. Whenever you publish something then it will update the related static html. Cool isn’t it. What is cooler is then you can configure Nginx to directly pickup that generated static html from disk and serve it to the user, completely bypassing the bloated Php. 🙂 Only when it doesn’t find the needed static html file then it will need to go to Php to generate it.

What’s keeping me busy

Of course it is CInk. 😛 Ever since I started working on it, my world has now, kind-of wrapped around it. Oh, I am really fatigued now. Phew!

But anyway, why this post? I surely haven’t posted this to rant about myself. It is of course CInk and it is turning out to be quite something. I have been working on it to fill the features gaps between this and ContextFree. The only gaping hole left was that CInk version 0.1 didn’t support ‘paths’ at all. Well this weekend I have implemented that, well almost. Now CInk supports all path operations expect for ARCTO and ARCREL. I plan to implement them next weekend.

Along with Path support, I have improved the z-index handling. In version 0.1 of CInk, you might have noticed that for codes with z-index, the background color is applied at the end of the rendering process. Also if there are any event rules preset, like MOUSEMOVE and MOUSECLICK, then CInk would defer event handling until the main rendering completes. In fact for evented rules z-index was not even supported. I have fixed them now. Now it doesn’t matter if z-index is present or not, it would behave the same, although it could be injurious to yours browser’s health. In particular Firefox seems to struggle in this case.

I am now moving CInk to version 2.0. Why v2.0 and not v1.0? Glad you asked! I have thrown in a totally new capability in CInk which ContextFree or Algorithm Ink doesn’t have. Using texts.

CInk texts support

For texts the following commands have been introduced.

  • fn – Sets font name to use
  • fs – Sets font size. This is additive. So when multiple fs commands are encountered then their values will be added up as we progress. This allows us to create something where the texts will grow larger or smaller.
  • fu – Sets the font unit. This allows us to set the unit to be used with fs. This can be ‘px’, ’em or ‘pt’.
  • base – Sets text baseline. Won’t elaborate this right now but can be found out by Google.
  • align – Again won’t elaborate right now.
  • t – Aah! The prized command. This is the one which allows you to set the text that needs to be shown. This too is additive, so if you specify in a sequence – t A t B t C, then the net output will be the string ABC.
  • bkspc – This does the job of removing the last character, if there is any. So, if we modify the above  example to – t A t B t C bkspc, then the final text will be AB only.
  • e – This is like bkspc but instead of remove the last character it empties out the full text. So, whenever this is used the the final output will always be and empty string.
  • |t – This one is a genius! 🙂 I can’t help myself from putting so many exclamations and smileys. There goes one more. 🙂 This command should be followed by an integer. This value is then added to the last character’s unicode (decimal) value. So when the current string is ABC then a |t 1 will finally generate the string ABCD. This is because on adding 1 to unicode (in this case the ASCII) value of C, we get D. This D then gets clubbed together with the last string. Now this little buddy has one more trick up its sleeve. What do you expect will be the output of this – t ABC e |t 1 ? Well, it won’t be and empty string. It will be D! This because e and bkspc are, what I call, past-influential commands, because they are not supposed to influence the output of the future commands. In this example C‘s ASCII code is passed-on to |t even when it itself perishes. If C had not done that then |t would have been influence by past commands, making it hard to predict the output. So, now even if there is a e or bkspc on the left of |t then this doesn’t influence it.

There are few more goodies which I will throw-in here. You can use unicode characters for t. For characters outside the normal ASCII range you cannot directly write it as a parameter for t, but instead you need to give that character’s (decimal) unicode value in a special format – {uxxx}. Replace xxx with the unicode number. It can have any number of digits.

Now you might be wondering, at what point all these texts are actually printed and how do we control that? Well the answer is ECHO. ECHO is a shape primitive like CIRCLE, TRIANGLE, SQUARE and LINE (this will come in v2.0). So it behaves exactly like them, that is, when invoked do what is meant to do, in this case print text, using the transformation commands it is interested in. ECHO, like others, honours geometric and colour transformation commands, like hue, scale, flip, etc.

So, it’s time for an example.

//Delhi Belly by AppleGrew

startshape stacks
size {s 0.2 z -400 x -.5}

rule stacks {
   delhi {b 1 h 0}
   belly { y -1 b 1 h 200}
}

rule delhi {
   //Unicode for two Hindi characters.
   //{u2367} is called a "matra", which in
   //itself is not a letter but modifies the
   //sound of the other.
   stack {t "{u2338}{u2367}"}
   stack {t L x 1.5}
   stack {t H x 2.5}
   stack {t I x 3.5}
}

rule belly {
   stack {t B}
   stack {t E x 1}
   stack {t L x 2}
   stack {t L x 3}
   stack {t Y x 4}
}

rule stack {
   10* { z 1 x .05 r 1 h 10}
   ECHO {sat 1 r 1}
}

rule stack {
   10* { z 1 x .05 r -1 h 10}
   ECHO {sat 1 r -1}
}

rule stack {
   10* { z 1 x .01 r 1 h 10}
   ECHO {sat 1 r 1}
}

rule stack {
   10* { z 1 x .01 r -1 h 10}
   ECHO {sat 1 r -1}
}
Output

Note: You need to have Firefox 4+ or Chrome to see the output below. It is not tested on any other browser.

New place, new face

As I reported before, I have moved to “cloud” based hosting from eApps. Moving to “cloud” was no easy task, and more than once it knocked the lights out of me. After many tussle and numerous tickets, rackets, hair uprooting exercises and under the hood tweaking, I guess now I can rest easy.

To celebrate this occasion and to save myself from further boredom of using the old theme, I have moved to this new theme. Hope you enjoy this. 🙂

OOh, BTW, the Bengali tag line under the banner is the literal translation of Apple and phonetic transformation of Grew. So, the Bengali text should be read as – Aaa-pel Gru. 😉