doT.sYs

November 16, 2009

DOJO Key Links

Filed under: Scripting Language, AJAX

A lot of sites, blogs and forums have emerged nowadays, you might find yourself cluttered with information that doesn’t really solved your DOJO needs. It is always a good practice to keep one solid reference that you can come back every time you stumble into your codes.

Here are useful links that might help you begin and work around with DOJO.

DOJO API

DOJO FORUM

October 5, 2009

7 Ways to gain healthy workforce

Filed under: All Around Work

I am reposting an article ( 7 Habits To Win In Office Politics ) that was originally from lifehack.org authored by Lawrence Cheok, but with my own interpretations.

I found this post helpful and factual and thought that it might also get you to work around on hard times in your own office or workforce. Everything that is posted in here is purely objective, thus you may agree or not agree on points that i might find essential. However, there is always a room for discussions and exchange of views, you may post comments or share more ways that you think should be included in this list.

Way # 1. Be aware you have a CHOICE

In all circumstances, disputes and disagreements arise without caution that can break or make your career. You just have two options when this comes your way, be sober and drool over the situation or get over it and move forward. It is up to you to choose the right feelings for the situation, staying long in aggression is not a good idea neither being numb about it. Be wise enough to control your feelings since this is the hardest to control, it might get out of way.

Way # 2. Know what you are trying to ACHIEVE

When you know what is you goal, even conflicts may arise as long as everyone has its fixed mind to reached a same goal, you will find that at the end of the day everybody has a POINT and had CONTRIBUTED on their own way to accomplished what all of you wanted to achieve .

Way # 3. Focus on your CIRCLE OF INFLUENCE

You might often complain on such given constraints, yet you must cling on more possitive sides when working. Keep thinking of good things why you are still working and never be a victim of helplessness.

“What tangible results do bitching really accomplish? In most instances, none.” Lawrence Cheok

Way # 4. Don’t take SIDES

Know your principles and trust your own assessments, in case you need to decide on things that has colliding point of views from your different bosses, tap your shoulder and be confident to stand on all of them try to convey your own ideas without taking sides yet still maintaining a good channel of communication.

Way # 5. Don’t get PERSONAL

Never go personal. Reserve yourself and save further damage in your relationship. Insults on personal things can cause grave offense and a real blacklist in his list of good employees and possible promotions.

Way # 6. Seek to UNDERSTAND, before being UNDERSTOOD

“The reason people feel unjustified is because they felt misunderstood.” Lawrence Cheok
Don’t be so consumed with your own personal gratification that everyone must understand you, why not try to get out of that shell and start understanding them instead. It is always a two way channel, if they feel that you understood them, everntually they will try to understand you too.

Way # 7. Think WIN-WIN

Get rid of the idea that when someone wins somebody else loses. When you try hard to think of ways that everyone can win, you’ll find things are a lot easer. All six ways boils down to this application it will be a WIN-WIN situation if you learn to practice all those above mentioned.

September 14, 2009

Web Publisher *grrr

I’ve done minimal programming stuffs for two months now. It is a sign that things are not going too well, I miss squeezing juice of logic from my brain from time to time (*sad). I miss using programming IDEs and having headaches due to overtime work. Weird huh? Yes, I guess I am.

Maybe you’re wondering what I have been up to, here is a gist of what my work is like for the past two months.

I’ve been maintaining the company corporate web site, cool isn’t? big time! Sounds fun and interesting and seems to have tons of programming stuffs to be done right? But you’re wrong. In the beginning of the project we all thought that we’ll be doing a lot of programming jobs and expecting to encounter complicated codes especially dojo scripts (my knowledge in dojo is the reason why I was chosen to be part of the project). But to my dismay, the company uses a web publisher that allows any key employee to update the content anytime as they desire but not the layout and other technical details of the site, because that task belongs to us, the maintenance team.

We change layouts, files, flash even pictures and sometimes fix *text bugs. Read it right, yes we often edit text contents, which I previously mentioned can be done by any marketing stuff. It has never been my pleasure to design, it’s not my inclination I guess, yet I’ve been doing design edits for pete sake! I’ve been changing menu and page layouts, resizing pictures, doing a new flash file, and the like and all to be uploaded in that web publisher. Where the hell is PROGRAMMING in that?

My usual know-how about websites are done coding all throughout the site, yet by using this *certain web publisher, less codes are needed, you only deal with xml files (you don’t need much logic in it). To non-IT, the tool is a great help, even fantastic, the tool was created in Java, reliability and functionality is not a question. But to programmers like me it is a pain in the ass. I’ve noticed numerous things that can be easily done when you code it. Plus the publisher took a lot of time for development, aside from its slowness, you need to checkout the files if is already existing and checkin an edited one or the latest file or simply import a new file, but that does not end there, you still need to promote it from three stages (WIP, Staging, Active) and finally publish it. See what I mean? Four key steps that you need to do. *haist it just simply bores me.

Ahhh d***! I need to stop complaining *sigh. I guess I just miss my programming days.

*Cheers to all programmers!

July 29, 2009

Apache Solr and Nutch

I have not post for quite a long time since my last post. I’ve been busy doing the new project I am now into. As a sweet fruit of labor, I would like to share some knowledge I have gained in this new venture.

I was assigned to the global IT projects together with two more colleagues. A lot of new technologies that we need to cope up with, especially dealing with the critical and gem departments of the company - marketing and sales, every detail is scrutinized and case studied thoroughly. Quality and reliability of the system is the top most importance of the development. A portion of everything done is the server configuration and optimization; this is to aid the system for the search management and site hits. The standard tools used by the company are Solr and Nutch working together pretty well, thus we end up studying these technologies.

A brief description:

Apache Solr - is an open source enterprise search server based on the Lucene Java search library, with XML/HTTP and JSON APIs, hit highlighting, faceted search, caching, replication, and a web administration interface. It runs in a Java servlet container such as Apache Tomcat. [Wikipedia.org]

NUTCH - is open source web-search software. It was built on Lucene Java, adding web-specifics, such as a crawler, a link-graph database, and parsers for HTML and other document formats. [Lucene.apache.org]

It is coded completely in the Java programming language, but data is written in language-independent formats.
Nutch has a highly modular architecture allowing developers to create plugins for the following activities: media-type parsing, data retrieval, querying and clustering.
The fetcher (”robot” or “web crawler”) has been written from scratch solely for this project. [Wikipedia.org]

In general, Solr and Nutch harmoniously work together as it is both in-house software of Lucene project. Solr generally is responsible for the search and return capability of the system. If the user first searched an item, Solr technology is the one responsible for caching the search and the returned results. It has great API for JSON, XML as the format of the returned results. Other than caching, Solr have also these following features :

• Uses the Lucene library for full-text search
• Faceted navigation
• JSON, XML, PHP, Ruby, Python and custom Java binary output formats over HTTP
• HTML administration interface
• Replication to other Solr servers
• Extensible through plugins
• Distributed Search
• Caching

On the other hand, Nutch acts as the crawler, a mimic of the “goolge crawler” and other search engine crawler (im totaly a big fun of google. *grin). After hitting the search button, nutch would look for the search item into the entire web application and indexed its location and return its details to Solr if it is found.

To incorporate these in your web application, download the latest release of Solr and Nutch, and install it to your server and follow the configuration guidelines for each. Viola! Your system would have its own search engine with no sweat! *wink

May 7, 2009

Prototype, Dojo, Script.aculo.us (JavaScript Framework)

These three famous Javascript frameworks are certainly in the top list of every web developer. They are a proven help in developing dynamic and creative web portals. Without their birth, how in the earth “google” could produce a fanstatic portal such as “igoogle” ( hhmmmm have you thought of it? ).

Now, if you are just starting to explore the usage and advantages of either of these frameworks, let me give you a little hint of the best tool to use in your application (*wink).

Advantages …

1. AJAX Function

All of these frameworks enable you to deal with AJAX with ease and they are also cross-browser compliant. Besides simple requests, they also provide various ways to handle the response from the server, either through XML, JSON or plain text. My advise here, if you only need a way to use AJAX functions and customized UIs is not a concern, use the primitive framework – prototype. Prototype is the best tool to use as it is just a one file function compared to the other two customized, bulky in size frameworks, and if you are the type of developer who codes their way to customize, prototype is the most flexible.

Sample Code

new Ajax.Request('your_url’,
  {
    method:'get',
    onSuccess: function(transport){
      var response = transport.responseText || \"no response text\";
      alert(\"Success! \n\n\" + response);
    },
    onFailure: function(){ alert('Something went wrong...') }
  });

Expandable Code

new Ajax.Request('your_url’,
  {
    method:'get',
    onSuccess: transport,
    onFailure: doError
  });

Functions “transport” and “doError” must be declared somewhere in your code. This way, codes are more flexible and expandable. Do something like this

function transport (x) {
          loadXML( x.responseText );
         …
}

2. Widgets

Script.aculo.us and Dojo are add-on libraries to the Prototype framework primarily for visual effects and interface behaviors. Several widgets, DOM utilities, and animations can be found here. These are actually the highlights of the outset of prototype where group of individuals created and customized the prototype framework to produce dynamic and ready to use widgets.

You can find various component animations in Script.aculo.us such as different effect combination, draggable objects, movie effect and etc. Click here for more reference and see their DEMOs.

To date, DOJO seems to be most useful for corporate websites. It can cater large dataset to be turned into a displayable grid without performance penalty. It also has the most wanted charting utility for your reports. It is fully internationalized, DOJO comes with translations supporting over 100 languages, even scripts like Arabic and Hebrew.

The latest tools I have used in DOJO are the TAB enabled div, drag and drop, and the package loading. All these helped me developed the site I wanted. Here are some sample screenshots and codes.

dojotab

The code

<div  dojoType=\"dijit.layout.TabContainer\" refreshOnShow=\"true\" style=\"height:450px;\">
<div dojoType=\"dijit.layout.ContentPane\" title=\"Equipment Registration\">…</div>
<div dojoType=\"dijit.layout.ContentPane\" title=\"Equipment Update\"> … </div>
<div dojoType=\"dijit.layout.ContentPane\" title=\"Configure\"> … </div>
</div>
 

draggable

Refer to the official DOJO site for more codes and demos.

I hope this post helped you somehow.

February 24, 2009

Oracle - Tips (add’l)

Filed under: Oracle, Database

You can select list of tables from all the different schemas in your oracle database, here’s how

SELECT all_tables FROM all_tab_columns;

or get all the table details

SELECT * FROM all_tab_columns;

January 21, 2009

Oracle Tips

Filed under: Oracle, Database

Here are some helpful tips to remember when dealing with oracle.

I. Use the “flashback technology” when you accidentally commit a mistake with your production data.
(altering entire table contents, corrupted table data, or worst dropping unintended table).

- First thing to do is to enable flashback on your database.

ALTER DATABASE FLASHBACK ON;

- Restoring database to its good state.

FLASHBACK DATABASE TO RESTORE POINT bef_damage;

- Restoring dropped table.

FLASHBACK TABLE [TABLE_NAME] TO BEFORE DROP;

- Restoring table to its good state.

FLASHBACK TABLE [TABLE_NAME] TO TIMESTAMP TO_TIMESTAMP('[DATE_TIME]');

II. Manipulate date and time display
Aside from to_date and to_timestamp functions , you could also alter the date and time display in your database through the use of this code below.

ALTER SESSION SET NLS_DATE_FORMAT = '[DATE_FORMAT]'

January 14, 2009

Oracle Split , Join , and DateDiff Functions

Filed under: Oracle, Database

Split, Join and DateDiff are just few Oracle functions that can aid you in data manipulation.

Function Definition

Split - split a result by “character specified (by default, comma)”
into multiple results.

e.g. “A,B,C” –> results 3 records of “A”,”B”, and “C”.

Join - join multiple records into one result by
“character specified (by default, comma)”.

e.g. “1″,”2″,”3″ –> results 1 record of “1,2,3″.

DateDiff - Differentiate two dates.

Function Code

create or replace function split(
          p_list varchar2,
          p_del varchar2 := ','
) return split_tbl pipelined
           is
          l_idx    pls_integer;
          l_list   varchar2(32767) := p_list;
          l_value  varchar2(32767);
    begin
          loop
          l_idx := instr(l_list,p_del);
          if l_idx > 0 then
             pipe row(substr(l_list,1,l_idx-1));
             l_list := substr(l_list,l_idx+length(p_del));
          else
             pipe row(l_list);
             exit;
          end if;
        end loop;
     return;
 end split;
create or replace function join
 (
       p_cursor sys_refcursor,
       p_del varchar2 := ','
)  return varchar2
      is
          l_value   varchar2(32767);
          l_result  varchar2(32767);
     begin
        loop
             fetch p_cursor into l_value;
               exit when p_cursor%notfound;
           if l_result is not null then
                l_result := l_result || p_del;
           end if;
               l_result := l_result || l_value;
        end loop;
      return l_result;
end join;
create or replace function datediff( p_what in varchar2,
      p_d1   in date,
      p_d2   in date ) return number
   as
       l_result    number;
   begin
        select (p_d2-p_d1) * decode( upper(p_what),  'SS', 24*60*60, 'MI', 24*60, 'HH', 24, NULL )  into l_result from dual;
	
return l_result;
end;
* Note : To use the split and join function, you must execute this code.
create or replace type split_tbl as table of varchar2(32767)

January 9, 2009

Re-blogging

Filed under: Uncategorized

This blog is active again with a fresh start, after i had trashed my previous blog i had come to my senses to re-create, focusing on technical and educational post and not mixing any petty stuffs. I am hoping to aid knowledge seekers specially students who need guide to do their homework. I will basically post all my technical experiences in IT and i am welcome for inquiries if my posts are not sufficient and need further explanations.

I am not trying to be so diplomatic :) , in truth , i wish to keep my knowledge where i could access it online which will serve as a repertoire of all new and old techie things in IT. In turn it will refresh my memory every time i will visit my blog or if i need to re-use techniques, i do not have a good memory :) i admit :) .

Cheers for my blog! Keep blogging! :D



Blog Redesigned by Karen Eve R. Eso