Friday, February 24, 2012

Oracle Database Fun and Games

I've been working with a number of Oracle databases lately and decide to post some of the tips and tricks that I found:

SQL Developer
Error when you connect to database:
"Status : Failure -Test failed: ORA-00604: error occurred at recursive SQL level 1ORA-01882: timezone region not found"
Solution: Edit the sqldeveloper.conf file and add the following line:
AddVMOption -Duser.timezone=GMT

Error, running out of RAM
Solution: Edit the sqldeveloper.bat file and change the following parameters as required:
-Xmx640M -Xms128M
You can also set the -XX:MaxPermSize setting in the sqldeveloper.conf file, but I have not had to increase this yet.

Start Database Script
Old but good article here -> http://tldp.org/HOWTO/Oracle-7-HOWTO-6.html
Basically you need to do this:
Start the listner: lsnrctl start listener
Start Enterprise Manager: emctl start dbconsole
Set the SID of the database: export ORACLE_SID=report
Connect to sqlplus: sqlsplus "sys as sysdba"
Run the startup command: startup

Get list of tables
select tname from tab

Delete all tables
select 'drop table '||table_name||' cascade constraints;' from user_tables; ref

Stop it from prompting you for input values due to the & character
set define off

Cool tool to create new database
dbca (ssh -X into the server and run this command)

Friday, February 3, 2012

Novell IDM Convert Structured Attribute


Every time I need to work with structured attributes on a driver I land up googling for that same page of how to convert a structured attribute to a string and vice verse. Thus to save time I decide to post a link to the forum   here

The meat of the what you need to do to convert from a structured attribute to a string and back again is below, just remember to replace the attribute and component names as required:

Output Transform (struct -> string):
<do-reformat-op-attr name="faxnumber">
<arg-value>
<token-xpath expression='$current-value/component[@name="faxNumber"]/text()'/>
</arg-value>
</do-reformat-op-attr>

Input Transform (string -&gt; struct): 
<do-reformat-op-attr name="faxnumber">
<arg-value type="structured">
<arg-component name="faxNumber">
<token-local-variable name="current-value"/>
</arg-component>
<arg-component name="faxBitCount">
<token-text xml:space="preserve">0</token-text>
</arg-component>
<arg-component name="faxParameters">
<token-text/>
</arg-component>
</arg-value>
</do-reformat-op-attr>

Wednesday, January 25, 2012

Why don't you run Linux? An absolute classic

Steve the super villain

Software testing

Lately I've been involved in a lot of software testing and came across this awesome article about it:

Top Five (Wrong) Reasons You Don't Have Testers

I find this guys blog very insightful and like the list of checks he recommends for software development:

Do you use source control?
Can you make a build in one step?
Do you make daily builds?
Do you have a bug database?
Do you fix bugs before writing new code?
Do you have an up-to-date schedule?
Do you have a spec?
Do programmers have quiet working conditions?
Do you use the best tools money can buy?
Do you have testers?
Do new candidates write code during their interview?
Do you do hallway usability testing?

Tuesday, January 24, 2012

My WSDL Cheat Sheet



Service -> ‘Java Class’

Operation -> ‘Java Function’ The Operation defines the name of the Operation and ties the request response messages together.

Port -> A service is assessable on a Port.  A Port has a unique name space and binding attribute. The Port specifies the service address. Web service can be exposed as SOAP or HTTP. The same web service can also be exposed by multiple Ports.
SOAP example:
<port name='WeatherSoapPort' binding='wsdlns:WeatherSoapBinding' >
<soap:address   location='http://localhost/demos/wsdl/devxpert/weatherservice.asp' />
</port>

HTTP example:
<port name='WeatherSoapPort' binding='wsdlns:WeatherSoapBinding' >
<http:address location="http://localhost/demos/wsdl/devxpert/weatherGET.asp"/
</port>

Message -> Normally two messages required i.e. input message and output message. Messages contain zero or more <part> elements. Sample messages below
<message name='Weather.GetTemperature'>
    <part name='zipcode' type='xsd:string'/>
    <part name='celsius' type='xsd:boolean'/>
 </message>

 <message name='Weather.GetTemperatureResponse'>
    <part name='Result' type='xsd:float'/>
 </message>rt name='WeatherSoapPort'

Binding -> ‘Ties it all together’ - specifies binding(s) of each operation in the PortTypes section

Sunday, January 15, 2012

More Holiday Photos

Cartoon effect on my camera

Dam on Table Mountain

Dam water

More dam water

Some people choose to ignore warnings

Nice bird

uShaka

uShaka
Swimming at Silvermine


Holiday Photos December 2011

Table Mountain

St James Beach - 26 December 2011
View of Constantia wine farms

View of Table Mountain from Milnerton - I like the panorama mode on my camera phone :)

Out at the Baxter for 'Some like it Vrot'

Sea Point

View from Hillcrest Berry Farm



Beware of the Prawns (only in Joburg)

Tuesday, November 15, 2011

Novell IDM (dirxml) - How to get the user DN in LDAP format

You can use the following Dirxml script to get the user DN in standard LDAP format:

<do-set-local-variable name="SlashDN" scope="policy">
<arg-string>
<token-src-dn/>
</arg-string>
</do-set-local-variable>
<do-set-local-variable name="userDN" scope="policy">
    <arg-string>
        <token-parse-dn dest-dn-format="ldap" src-dn-format="qualified-slash">
            <token-xpath expression='query:readObject($srcQueryProcessor, "",$SlashDN,"","")/@qualified-src-dn'/>
        </token-parse-dn>
    </arg-string>
</do-set-local-variable>

Tuesday, September 13, 2011

jQuery and IE8 not the best of friends

So I've been pulling my hair out with IE8 ... again. I wrote some code that was working like a charm in FF and Chrome:

$(this).val().trim().match(match)

Sadly this code did not work in IE8 and I got the following error:

"Object doesn't support this property or method"

Changing it to the below did the trick:

jQuery.trim($(this).val()).match(match)

Another part of my life wasted debugging IE issues :(

Wednesday, August 3, 2011

Some of my old IT Textbooks

Wow what a find! Was digging around the house and found some really old textbooks. Check this out. Love the story about the CPU.









Tuesday, June 28, 2011

My Favourtie LDAP Tool

Just had to post this one, else I land up Googling between 1000s of LDAP tools.

http://www.novell.com/communities/node/8652/gawors-excellent-ldap-browsereditor-v282

Saturday, June 25, 2011

One of my best CDs


http://www.kalahari.net/music/All-Comes-Round/19738/120249.aspx

Wow I forgot how good this CD was. It's really good to enjoy some old school SA music :)

Tuesday, June 14, 2011

Oracle Regex

Needed some regex to only leave a-z values.

This seemed to work for me:


select regexp_replace(ent_val,'[^a-zA-Z]','') from ac

Friday, May 20, 2011

Novell Null Driver vs Loopback Driver

FYI a loopback driver can perform a query operation. A null driver returns nothing to a query operation.

Also they are different drivers as they use different Java classes:

com.novell.nds.dirxml.driver.nulldriver.NullDriverShim

vs

com.novell.nds.dirxml.driver.loopback.LoopbackDriverShim

Followers