Skip to content

Remote Desktop – mstsc – hide the ribbon completely

When you are working with remote desktops using mstsc (in windows), sometimes the blue ribbon at the top is really annoying especially when you are working with multiple browser/explorer windows on the remote machine. To hide the ribbon:

Uncheck the following option. You can then use Ctrl+Alt+Break to switch between local/remote sessions

Credits: http://superuser.com/questions/300115/how-to-shrink-the-remote-desktop-connection-bar-in-windows

Installing EBImage package for R (using RStudio) in Ubuntu

The EBImage is a package used for image processing & analysis from R. To install EBImage package,

source(“http://bioconductor.org/biocLite.R”)

biocLite(“EBImage”)

But it has a dependancy on tiff (the previous step might throw an error stating that tiff is unavailable – common.h:5:18: fatal error: tiff.h: No such file or directory)

Solution:

1. Go to Synaptic (Ubuntu software center)

2. Search for libtiff4-dev and install.

Then go back to RStudio, and run the command

biocLite(“EBImage”)

Note:

This package also depends on rJava. So rJava package has to be installed before EBImage. Refer here for more details.

Installing rJava package in RStudio on Ubuntu

Installing and configuring rJava package is slightly tricky when compared to other packages.

I was able to install with ease on Windows with just install.packages(). (my JAVA_HOME env. variable took care of all the java settings)

In Ubuntu, it was throwing the following error:

Error : .onLoad failed in loadNamespace() for ‘rJava’, details:   call: dyn.load(file, DLLpath = DLLpath, …)

The reason is that it is expecting JAVA_HOME to be set to jre, rather than a jdk. I had my jdk installed at /opt/jdk1.6.0_45 (and my JAVA_HOME was pointing to this dir)

I set it to /opt/jdk1.6.0_45/jre within RStudio (I didnt want to change it globally) using

Sys.setenv(JAVA_HOME=”/opt/jdk1.6.0_45/jre”);

Then I executed the javareconfigure using

sudo R CMD javareconf

Then, I installed rJava from RStudio using,

install.packages(“rJava”);

sql – significance of null in “not in”

The common problem in queries that we encounter while checking for negative conditions  is the null value.

Consider the following eg.

select * from employee e where e.location not in (select location.name from location where location.region=’Asia’)

The expectation is that all the employees who are currently not in Asia should come as the query result.

But it fails on two cases: when any of the records in the sub-query is a null, and when the employee.location is null for a particular employee. (of course the second case is debatable, whether that record should come or not)

In both the above cases, the evaluation of the condition is false as the values being compared contains null values.

There are several work-arounds possible like handling the null condition separate, using not exists etc.

This link explains how not exists serve the purpose.

zero string length for empty strings in oracle

Somehow I was able to observe some surprising inconsistencies in string length function in Oracle.

select length(null) from dual;

returns you a null, which is expected. But for an empty string

select length(”) from dual;

also returns a null, which is expected to be zero.

Hence an important aspect that has to be considered while performing string operations.

More details:

http://www.adp-gmbh.ch/ora/misc/null.html

http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:5984520277372

SQL Pattern Matching – like

Problem: To find all the records in a table, where a particular field value is “entN” where N is any digit.

Solution (SQL Server 2005, 2008) :

select * from table where field like ‘ent[0-9]’;

Solution (Oracle 10g):

select * from table where field regexp_like (field, ‘ent[0-9]’)

Business Objects 3.1 – Web services Consumer SDK (.net) – WSE 3.0

I was trying to run the sample application which displays a BusinessObjects (WebI) report using the Webservices Consumer SDKs. (C# .net)

I got a strange error called constructor exception (Error: WSE 99999)

I had to download and install WSE 3.0 addon (Web Services Enhancements), which fixes this.