Skip to main content

Posts

Oracle Materialized Views

In the time I was feeling tired of writing blog(you know, no comments, no click), someone clicked my ads and I actually earned about $2 today. I hope you find something fun and for whatever reason, thank you. You gave me the power to continue my blog :) I've being using Oracle for about 10 years, I never realized there is something called Materialized Views until I chat with my supervisor today. So, what is Materialized Views? From the help center: A materialized view is a database object that contains the results of a query. The FROM clause of the query can name tables, views, and other materialized views. Collectively these objects are called master tables (a replication term) or detail tables (a data warehousing term). This reference uses "master tables" for consistency. The databases containing the master tables are called the master databases. In my understanding, it's a just a snapshot at the time people run the query statement. I also noticed other item...

Learning Dojo: Scripting Widgets

What Exactly is a Widget? Dijit components are handy encapsulations or user interface functionality. That's what made Visual Basic's component based technology so appealing twenty years ago. Widgets are components in the abstract sense, but what are they from a coding standpoint? So far, we have a vague idea, at least for the declarative case, that a widget is a snippet of HTML with a dojoType, like this: <div dojoType="dijit.layout.ContentPane" href="http://localhost/too/many/slashes.html" ></div> There are four main ways to get a widget refrence: You can set the jsId= attribute in the tag, which creates a global JavaScript variable with that name You can use dijit.byId(id). This is sueful if you had set the id= attribute on your widget You can use dijit.byNode(nodeVariable) when you don't have the id attribute but you have the DOM node itself. You can usually get the node with dojo.query Similarly, dijit.getEnclosingWidge(node...

Learning Dojo: Compression

By default, build compresses any packaged resources and does not compress any other resources. Both of these behaviros can be controlled by the command-line options layerOptimize( for packaged resources) and optimize( for all other resources). The possible values for these options are as follows. "" Don't compress shrinksafe: Use Dojo-Rhino to delete whitespace and comments and shorten variable names shrinksafe.keeplines: Same as shrinksafe, but keep newlines. packer: Use the Dean Edwards packer. Whenever build compresses a resource, it writes both an uncompressed version to module-name.js.uncompressed.js and a compressed version to module-name.js Compressing javaScript Resources with Dojo-Rhino Dojo-Rhino walks a Rhino-generated parse tree and dumps compressed JavaScript code. The compression function can be called from the command line to compress an individual file. This technique for compressing JavaScript is both powerful and safe. Since the  routines...

Learning Dojo: Defining Classes with dojo.declare

JavaScript doesn't explicitly include the concept of classes, yet the core language can be used to build object systems that work similarly to those found in languages that include native support for object-oriented programming(Java, Ruby and the rest). Building a calss definition system is a lot of work. Fortunately, Dojo does this for you. dojo.declare defines class definition machinery, complete with single-inheritance, mixins, two-phase construction, and several other features. Since javaScript is a dynamic language, it can generate code on the fly that can be consumed immediately. The way using in JavaScript:  A good understanding of core JavaScript language concepts is required to use Dojo's class definition machinery effectively. Let's review a few concepts before start. Prototypes and prototypal Inheritance. Every object in JavaScript includes a reference to anther object termed the first object's prototype. Since the prototype is another object itsel...

Learning Dojo: Dojo Remote Scripting

Native Remote Scripting There are three well-known methods to implement native remote scripting: Using an XMLHttpRequest(XHR) object Dynamically loading an iframe element Dynamically loading a script element XHR (XmlHttpRequest) XHR is easy to use naively but hard to use correctly. Some of its many weirdisms include the following: An unfamiliar syntax. Many developers simply copied and pasted XHR code snippets but had no idea what the code was doing. That makes debugging... ehhhh, not so fun. Poor handling of content types. Though XHR is supposed to speak XML fluently, you colud hand back valid XML from the server and still get a head-scratching " Not valid XML" message from XHR. No help in creating the parameter string. You had to do all the URL encoding yourself, or perhaps you didn't do it at all.. and the first & in a textbox broke your application. Dojo's remote scripting facilities enable a client-side script to communicate with a server...

Learning Dojo: Improved Form Controls

Validating Fields Client-side data validation is win-win: it helps you by keeping the data clean and helps the user by giving immediate, targeted feedback. We need some data cleaning, so let's start with the fields on the Personal Data tab. First start with a regular <input> or <textarea> tag. Add a dojoType= arrtibute of dijit.form.ValidationTextBox. Then add validations and filed-cleansing attributes: <label for="first_name">First Name:</label> <input type="text" name="first_name" id="first_name" dojoType="dijit.form.ValidationTextBox" trim="true" propercase="true" required="true" size="30" missingMessage="You must enter your first name" /><br/> And don't forget to add dojo.require to the header: dojo.require("dijit.form.ValidationTextBox" ); These extra attributes do an incredible amount of work: required="tru...

Learning Dojo: Laying Out the Form

Let's take tab for example: <script> dojo.require("dojo.parser" ); dojo.require("dijit.layout.ContentPane" ); dojo.require("dijit.layout.TabContainer" ); </script> </head> The two components we need, again, are as follows: A dijit.layout.ContentPane, which holds one "tabful" of data. Each ContentPane has a lable that appears on the tab.  A dijit.layout.TabContainer, which holds a group of ContentPanes. <div dojoType="dijit.layout.ContentPane" title="Personal Data"> <label for="first_name">First Name:</label> <input type="text" name="first_name" id="first_name" size="30" /><br/> <label for="last_name">Last Name:</label> <input type="text" name="last_name" id="last_name" size="30" /><br/> <label for="middle_initial"...