Posts

Hacking the development : Building by Definition

Hacking the project development !! I have been thinking lately, I personally do lot of projects outside my job, some ones are merely CRUD application over the web and some are novel applications. Philosophy :) The best way to do a job is not to repeat the same things again. I like products and I like components which we can re-use which can save hours setting up and starting things. Some of the best "on-the-fly" tools like 'Spring-ROO ' miss the personalization of things we want on the web development projects. For example, ROO can create a spring web project structure but what about wiring them with UI, customized UI templates to load the data. Input forms which just mimic the DB we have. So there should be a silver bullet customized to our needs where it can just create all the layers of the web project. After working around for more than several years in lots of personalized projects, I would hate myself to copy a piece of code from other project and pu...

The beginning: Some people are strangers to themselves

   May be not a new thing but certain things in life feels new and rejuvenating like rain, flowers, morning sun . They are always there, we have seen them million times but still we feel good everytime. So certain things in life always keeps us lively. New made goals, new perception about life, a new job,  a day before wedding always keep us excited and we are on the toe to start the new thing.  As days pass by, we see ourselves in confusion as our new made goals or job or a wedding don't contribute what exactly we wanted to do. So this is when the reality strikes, the reality can be good about learning our own self, and yet we don't see our weekness inside, instead we blame it in our colleagues, company, spouse, children etc.,   Ego is the supremacy which breaks / builds a person, the fear of failure and the fear of the inner-self make ourselves to out grow our fear temprorarily, but this w...

FCKeditor v2.4.3 Firefox "script stack space quota is exhausted" fixed !

Hi all, I was uploading a document of about 10 MB doc in FCKeditor v 2.4.3 from server. In IE it works fine but for the Firefox v>2.0 , I was getting this strange bug "script stack space quota is exhausted" . Thought it was inherent firefox problem , But why did FCKeditor caused it ? After reading the code and having some inline tests , I found that the following code in fckeditorcode_ie.js FCKeditor start function caused this problem, /* Buggy regex match for body contents*/ /* Results in "script stack space quota is exhausted" for large documents*/ var G=A.match(FCKRegexLib.BeforeBody); var H=A.match(FCKRegexLib.AfterBody); if (G&&H){ var I=A.substr(G[1].length,A.length-G[1].length-H[1].length); A=G[1]+' '+H[1]; if (FCKBrowserInfo.IsGecko&&(I.length==0||FCKRegexLib.EmptyParagraph.test(I))) I=' '; this._BodyHTML=I; }else this._BodyHTML=A; };...

Good to be back.

Reasons for my inactivity for past few months, Reason 1: Have been involved in lots of projects. Reason 2: Have been involved in hours of learning. Reason 3: Have been involved in self-building and introspecting myself. Reason 4: Found how a small dream can grow so much in span of months of hard-work and persistence. What's the good news ? Not being posting for a long time ?? :). Just joking . Good News is that there are lots of small things in store to share with you all. Now I feel good to be back. So Keep checking.

HTML Search Text and Highlight

Jumping straight to the solution: //modified search function 1. function searchtext(inputText, searchString) { 2. 3. 4. //building RegExp object for the search text g-global match,i-ignore case 5. var myregexp = new RegExp ( searchString , "gi"); 6. 7. //custom replace function just to highlight the match word in the html source 8. var myNewString = inputText . replace( myregexp, 9. function ( matchTxt,key,txt) { 10. return "<span style='background-color:red;>'" + matchTxt + "</span>"; 11. } ) ; 12. 13. //return the new highlighted text 14. return myNewString; 15. 16. } I think going through the code will be just self explanatory as the solution is straight-forward.But did you see some weird implementation ? Bingo! you found it :) It's the custom replace function. Let's get dirty with some syntax explanation and we will be soon back with the ex...

Bits and pieces: Detecting browser event closing in Javascript

Bits and pieces: Detecting browser event closing in Javascript

Detecting browser event closing in Javascript

I've been working on a feature where the user must be prompted to take up certain action when he leaves a page by closing the browser window or by clicking an external URL,though I searched for the best possible solution but unfortunately couldn't find one. The first thing that got my attention is the browser's "onbeforeunload" event and here is the implementation of it, window.onbeforeunload=confirmExit; function confirmExit(){ return "Do u want to close this page?" } So here the user will be prompted when he clicks the close button of the browser and when the user clicks "cancel" in prompt, it stays the same page.So far works fine. When testing is on the way , suddenly problems getting piled up and I need to reconsider the solution above, since the requirement is to "prompt the user only when he leaves the current domain (website)" and here for the above code, the user is prompted whenever...

Java - Interesting Stuffs

I am just still an admirer and constant learner of JAVA, So here are some interesting stuffs .I will try to constantly update once I come across some interesting things (atleast to me:) ), To resurrect an object(to make the object alive again) instead of reassigning in the object in finalize method "create a clone" Java Object are created in heap while in C++ ,they are created in Stack Object persistence can be done using object serialization and DATA ACCESS OBJECTS(DAO) Making an object alive in finalize method is useful when we use JNI for a c++ class and do it with a "termination condition"(when there is a code to check whether all the object references in the program has been made null) during garbage collection. System.gc() may or may not run finalize() of for the orphans (object that holds no reference) but Runtime.runFinalizersonExit(true) and System.runFinalizersonExit(true) will surely make the objects ready for the garbage collected. Java supports only pa...

Fckeditor - removing tool bar items

I was working around for a couple of days to enable a feature were we can remove the tool bar items depending upon some permissions like hiding Style and Bold for a particular user group. I don't find any feature in-built in the FCKeditor to do this , so thought of trying some hack on it. The possible workaround I tried was this, In the FCKeditor the editor/fckeditor.html page loads up all the configurations while start-up , so we can possibly remove the tool bar items for a specific Toolbarset before creating it.Here is how I did it. In LoadToolbar() function in the fckeditor.html page I added the following lines, function LoadToolbar() { var oToolbarSet = FCK.ToolbarSet = FCKToolbarSet_Create() ; var removeToolBarSet=FCKURLParams['RemoveToolBarSet'] || ''; if ( oToolbarSet.IsLoaded ) StartEditor() ; else { oToolbarSet.OnLoad = StartEditor ; //get the current tool bar from the URL and look up in the FCKConfig.js hyCurrentToolBar=FC...

The HaCkERdOm-A ViEw

Image
" Hacker Emblem ". It's an article which changed my perception about technology Vs Life !!! .I am bit got attached to the world of hackers and their culture.( P.S Hacker is one who build systems and the Cracker is one who breaks it ) It's all about the world of fascinating technology!!.. The Words I found in this link http://catb.org/~esr/faqs/hacker-howto.html by Eric Steven Raymond captured most of my interests .I thank Eric for this wonderful page. He has explained about who is an hacker and what he should do to be labelled as hacker(this label is not stick by him but by others reputation on his work!!). Now as a first step I have decided to learn all and everything about linux,python(the most simple and wonderful language I have ever seen 'coz I have some previous exp. in this language but not fully) and JAVA(the most respected language by me, once I thought this is my life and still it is) now have to move forward with it by learning v1.5 .. and ...

TeChNiQuEs-DiStRiBuTeD

Hey folks, I like to share what I learn and Where I went wrong . I like to be more out of box in programming and I am very much interested in mile stone technologies and softwares.I like to share more about Fckeditor,eclipse PDE,Mozilla extensions,Python cool stuffs and much more.. K see you then within a short while .. have fun..