Tinkering with sed, I have manage to try using regular expressions using backreferences using the most common \N where N is the number of position inside the parenthesis. Searches and replaces the zoo.color to zoo['color'] or zoo.animals to zoo['animals']: cat zoo.js | sed -E "s/(zoo)(\.)([a-zA-Z0-9]*)/\1['\3']/g"|less \1 = is the characters inside the first parenthesis w/c is the zoo \3 = is the characters inside the third parenthesis which involves alpha-numeric -E will interpret as regular expressions as extended (modern) regular expressions rather than basic regular expressions (BRE's) Another example, you can use this for replacing such a string let say, in a SQL statement, example SQL string: CREATE DEFINER=`mysqluser`@`%` FUNCTION `total`(cost DOUBLE, income DOUBLE, lng2 DOUBLE) RETURNS double And you wanted to remove DEFINER=`mysqluser`@`%` and allow FUNCTION to be a dynamic string so you'll just need to catch tha...
I found ShellEd when googling for any shell editor. It was trouble at first because there's no how-to that directs me, where I expect to have a direct link that I can copy-en-paste to my Eclipse for installation. So what I did, I download ShellEd (as of this writing file version ShellEd-Update-2.0.0_M3.zip) from sourceforge.net and install, as required, the Linux Tools . After installing Linux Tools, I then locate thru archive the ShellEd zip file and install it successfully. It works good and I feel satisfied with this cool tool to be embedded in eclipse. The sample attached shell script is from JBoss twiddle. It does supports syntax highlighting, intellisense which is cool. Hope this helps.
I'm kinda confused what exactly does "granularity" or "grain"means in database world. So I just understand that this means "it's a measure of level of details of your data in a database". It's how you could get a minimal grains of your data or how you could get a detailed information of your data that's make sense. From Wikipedia, it means, Data granularity The granularity of data refers to the fineness with which data fields are sub-divided. For example, a postal address can be recorded, with low granularity , as a single field: address = 200 2nd Ave. South #358, St. Petersburg, FL 33701-4313 USA or with high granularity , as multiple fields: street address = 200 2nd Ave. South #358 city = St. Petersburg postal code = FL 33701-4313 country = USA or even higher granularity: street = 2nd Ave. South address number = 200 suite/apartment number = #358 city = St. Petersburg state = FL postal-code = 33701 postal-code-add-o...
Comments