« Previous month (Apr 2007) | Main | Next month (Jun 2007) »
http://blogs.sun.com/insidemyhead/date/20070627 Wednesday June 27, 2007

Mirage - Open Source CMS Based on JSR-170 Standards

I have started the Mirage Project at java.net today. Check it out here

Mirage is an open source project which aims to deliver a professional open source content management system based on the content repository Java Content Repository (JCR) viz. JSR-170.

The project deliverables will be in terms of several individual smaller sub projects some of which may be delivered via some different but related java.net project. The deliverables from this project will be consumed by the OpenPortal project to provide CMS functionality to the portal product. The current plan is to provide in terms of deliverables :


 More information will be available on the Mirage web site soon along with source code!



Posted by insidemyhead [Sun] ( June 27, 2007 12:25 AM ) Permalink | Comments[2]
http://blogs.sun.com/insidemyhead/date/20070626 Tuesday June 26, 2007

Dynamic JavaScript Loading

While developing a custom jMaki widget we came across a problem in which we needed to load a javascript dynamically from another javascript file. There are atleast 2 ways I know this can be done. Here is one such method.

 

function jsinclude( jscriptfile )
{

// create a script node
var s = document.createElement('script');
s.src = jscriptfile;
s.type = "text/javascript";

// add it to the node called 'SOMEPARENT'.. it could be the HEAD node of the html page as below....

document.getElementsByTagName('head').item(0).appendChild(s);
}

Calling this function in your javascript you can load as many JS files as needed and embed them into your current DOM tree as follows :


jsinclude('dojofunctions.js');




Posted by insidemyhead [Sun] ( June 26, 2007 09:21 AM ) Permalink | Comments[4]
http://blogs.sun.com/insidemyhead/date/20070625 Monday June 25, 2007

A Solution: Playing with numbers

Consider the original binary bits, keep the bits in pairs of 2 for beginning. 

First set each 2-bit field equal to the sum of the two single bits that were originally in the field. Then sum adjacent 2-bit fields, putting the results in each 4-bit field, and so on. The original problem (summing 16 bits) is divided into two problems (summing 8 bits), which are solved separately, and the results are added. The strategy is applied recursively, breaking the 8-bit fields into 4-bit fields, and so on.

So solving the above problem, the original number is 0xCF39. Write it down as binary keeping adjacent bit together as below.

11 00 11 11 00 11 10 01


As indicated earlier, sum up the pairs above (binary) and put the results back in the individual two bit fields as follows.

10 00 10 10 00 10 01 01


Now combine these numbers in blocks of 4 as follows and repeate the process of summing the two two bit numbers and putting the result back in the 4 bit fields as below.

1000 1010 0010 0101
0010 0100 0010 0010


Next, repeat the process by pairing the numbers in blocks of 8 and adding the two 4 bit numbers and placing the result back in the 8 bit block as below.

00100100 00100010
00000110 00000100


And lastly repeat the process by adding the two 8 bit numbers above and placing the result in the 16 bits as below and that is the sum of all the

1's in your original number i.e 0xCF39


0000000000001010   ----> Decimal 10.


The above strategy makes the original problem of summing 1's in a 16 digit number complete in 4 discrete steps. Point to note is that each of these steps of determining adjacent bits and summing them at each step can be done in parallel. Hence making the operation an order 4 operation ( i.e Log 2 (16) = 4 steps ).

 It should be easy to write this recursive loop in any decent high level language... give it a shot!
 



Posted by insidemyhead [Personal] ( June 25, 2007 11:40 AM ) Permalink | Comments[0]
http://blogs.sun.com/insidemyhead/date/20070621 Thursday June 21, 2007

Playing with numbers.

Consider that you have a 32 bit machine and you have a number such as say Hex CF39. How would you go about counting the number of 1's in the binary representation of this number? In other words, the binary representation of CF39 is 1100111100111001. What is needed is a way to count the number of 1's in this number i.e the answer should be 10.[ Your 32 bit machine doesn't have an instruction that can do this :-) ]



Posted by insidemyhead [Personal] ( June 21, 2007 10:06 AM ) Permalink | Comments[1]
http://blogs.sun.com/insidemyhead/date/20070612 Tuesday June 12, 2007

The Future, The Semantic Web

Recently at work I came across a young colleague who had done some work during his bachelors on semantic web and I kind of got involved in that discussion. During that conversation a few more folks joined in and I realized that not many were aware of the our current "not-so-semantic web". Hence this became the topic of my today's blog.

So what exactly is the "semantic web"? Let me try and explain with an example. Suppose I am wanting to buy a camcorder and I did research on the web for the camcorders and I come across the following things from different sites:


Even if I knew little or nothing about camcorders and its features, I can make a pretty good idea of what the web sites are talking about and what they mean when they say the things they say. But if a piece of software went through the exact same pieces of text mentioned above, it will really have problems in understanding the really straightforward language concepts.

This brings us to the main concern, people are really good at "interpreting" meaning, or semantics, from written language, and software is pretty bad at it. So when search engines go through blobs and blobs of text, what is missing is some standardized way for us to mark up our web content to help the software recognize the semantics of the content. If it is possible to mark up our web content in some way to associate the correct semantics of the page, then it helps us  move the Web beyond the current index/search/read paradigm that we are stuck with currently. And that is what is meant by "Semantic Web", on which currently there is a huge amount of research going on.



Posted by insidemyhead [Sun] ( June 12, 2007 10:14 AM ) Permalink | Comments[0]