Monday, 23 May 2016

Adding BI4 designer.exe as a reference in Visual Studio on Windows 7

Recently I had been having massive problems trying to get designer.exe added as a reference in Visual Studio. I had installed the BI4 client tools, I could see it as an option to add as a reference but whenever I added it I got the following error...

A reference to 'BusinessObjects Designer 14.0 Object Library' could not be added. Could not register the ActiveX type library 'C:\..\win32_x86\designer.exe'.

I tried registering designer.exe via regsrv32.exe, I also tried registering designer.tlb, but nothing seemed to work.

After searching far and wide, I came across this stackoverflow post.

And after registering designer.tlb using regtlibv12.exe, I saw a new entry in the available references for BusinessObjects Designer 14.0 Object Library. The notable difference here is that the version number was listed as 14, whereas the original entry was listed as version 20. I added this and everything was good to go.

Specifically, what I did was

  • opened a cmd prompt (as administrator, but I'm not sure if this was necessary. 
  • cd to the business objects installation folder (C:\Program Files (x86)\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\win32_x86)
  • run the command
    • C:\Windows\Microsoft.NET\Framework\v4.0.30319\regtlibv12.exe designer.tlb
  • You should then see "Registration of designer.tlb successful." returned.
  • Add the reference in VS.

Thursday, 2 October 2014

Logging into postgresql database through powershell

Something I spend a while trying to figure out that may be of help to someone is how to provide a password when logging into a database using psql.exe.

When logging in, powershell just hung because when logging in at the command line, you are then prompted to enter the user's password.

The way around this is to set a temporary environment variable for the username you are logging in as in the powershell script. This will only exist for the duration of the running script.

$Env:PGPASSWORD = "YourPasswordHere"
$sqlScript = "C:\script_location\script.sql"
$executeCommand = 'psql.exe -d DBNAME -U USERNAME -f $sqlScript'
iex "& $executeCommand"

Friday, 5 September 2014

Having to open Excel spreadsheets twice

For as long as I can remember I have had an issue on my work laptop where if I open a spreadsheet, Excel will open but only the application. I then had to open the spreadsheet again in order to view it.

Most solutions I cam across said to uncheck the "Ignore other applications" setting in excel options but this didn't work in my case.

Today I came across this blog post by JClermont which has resolved my issue.

  1. First, open any folder in Windows XP.
  2. Click on the Tools menu, and choose Folder Options.
  3. From the dialog that pops up, click the File Types tab. You will now be presented with a list of all document types recognized by your computer.
  4. Scroll down to XLS, select it, and click the Advanced button. Now you'll see several "Actions" registered for Excel worksheets.
  5. Usually, Open is the default (indicated by being in bold). Select "Open" and click the Edit button.
  6. The main piece of data in here is the field labeled "Application used to perform action". This should point to your Excel executable, followed by some command-line arguments. Here's how it appears on my PC: "C:\Program Files\Microsoft Office\Office\EXCEL.EXE" /e "%1"
  7. It is very important to make sure that the %1 is surrounded by quotes. %1 is the variable representing the full path and file name of the document you are opening. If it contains any spaces, and this is not surrounded by quotes you will get a flurry of weird errors.
  8. "Use DDE" is normally checked. Now, make sure that "DDE Message" is empty. Click OK.
  9. Click OK back at the Edit File Type dialog. Click Close on the Folder Options dialog.

In my case, the "Application used to perform action" was missing the "%1" parameter.

Tuesday, 30 July 2013

Make chrome open a search from the address bar in a new tab (when you want it to)

Sometimes I want chrome to open a new tab for a search done in the address bar, but not all the time.

In order to do this without messing around with the chrome settings and making it a permanent feature, just press the Alt key before hitting return when you've entered your search into the search bar.

Wednesday, 3 July 2013

Fixing notepad++ file associations

I decided to move from using the ANSI version of notepad++ to the Unicode version but upon doing so I managed to royally screw up the file associations for files with the extensions .txt, .sql, .log etc.

The best I could manage was having them open with notepad.

Open with Notepad++ was missing from the right click context menu and when I tried to select a program to open text files with Notepad++ wasn't listed. Even when browsing to the location of the Notepad++.exe file this wouldn't work.

Turns out something got buggered in the registry settings.

For the key...

HKEY_CLASSES_ROOT\Notepad++_file\shell\Edit\command

this had been changed to some office type MS monstrosity.

I changed the value for the (Default) String and replace the file path to the path to where Notepad++ resides, in my case...

"C:\Program Files\npp\unicode\notepad++.exe" %1

note the "%1" refers to the file name being passed to the command.

This then allowed me to select Notepad++ from the open with context menu and then tell XP to remember the file association.

UPDATE: Something else stopped "Open with Notepad++" appearing so what I did was went through all registry keys searching for "Notepad++" and where an old file path appeared (I had paths for older versions of NPP appearing in "open with" shell commands) I replaced these with the correct file path for notepad++.exe.

Working ok now.

Thursday, 13 September 2012

Copy TOAD's Schema comparison sync script

TOAD does not allow you to copy the sync scripts created by it's schema comparison tool unless you shell out for the DBA Modules add in. All you can do is print it to a stupid xps file.

In order to get around this I created a small autoit script to copy the output to your clipboard.

Here is the code

Opt("WinTitleMatchMode", 1)

WinActivate("Toad for Oracle")

$Text=ControlGetText("Toad for Oracle","","[CLASS:TAdvToadSyntaxMemo; INSTANCE:1]")

ClipPut($Text)

If $Text Then 

   MsgBox(0,"pwnt","Copied to clip board")

Else

   MsgBox(0,"uh oh","Couldn't copy text. Has the schema comparison been run?")

EndIf

If need be, I might upload the compiled exe file.

Tuesday, 8 February 2011

I just received my first Arduino through the post. I went with the Arduino Duemilanove ATmega 328 which I bought on eBay from the seller arduino.hk who I can highly recommend. Their feedback speaks for itself.

I haven't had a chance to properly play around with it yet due to a house move but I will post something later on about it.

Friday, 31 December 2010

URemoteDesktop skipping 2 tracks on Rhythmbox

I downloaded an Android App called URemoteDesktop and when trying to skip a track on rhythmbox it skipped 2 instead of 1.

To fix this (Not sure if it buggers up something else so do this at your own risk), comment out the following lines in vd.sh.

xte "key XF86Back"
xte "key XF86Forward"

I'm guessing these are put in the if statement for programs that don't use XF86AudioPrev & XF86AudioNext.

Saturday, 13 March 2010

Streaming video from Ubuntu to Xbox 360 via BT Home Hub

Before my PS3 shit a brick and I replaced it with a Xbox 360, I tried to get Mediatomb streaming video from my Ubuntu machine to my PS3. Although it worked to some extent, there seemed to be a buffering issue. Videos would play for a few minutes then stop to load up more of the video.

While trying to set up uShare I came across the same problem. The obvious constant here was my router so while dicking around with the settings of my BT Home Hub I managed to solve the problem.

Here's what I did.
  1. Open the home hub's web page. The ip address should be 192.168.1.254.
  2. Click on Basic Config.
  3. Click on Wireless.
  4. Under "Wireless channel" change Channel selection to "Manual" and Channel to "11".
That's it. Give it a minute then crank up uShare.

Thursday, 11 March 2010

Using awk as a floor function

I was searching the internet trying to find out if awk had a floor function when I realised awk IS a floor function.



graham@graham-laptop:~$ x=3.5
graham@graham-laptop:~$ echo $x | awk -F. '{print $1}'
3
graham@graham-laptop:~$

You could always change $1 for $2 and it becomes a mod function.

Thursday, 4 March 2010

Selecting beginning of financial year in Oracle

I recently had to work out how to return the beginning of the financial year from an Oracle database. After trawling the internet, everything looked rather complicated for what I was after.



Below is what I came up with. It's pretty simple to change. If April is not the month you want to return, change the +4 at the end to the number of the month you want to return.



select trunc(add_months(sysdate, - (12 + to_char(sysdate,'MM'))+4),'MM')
from dual

Monday, 19 October 2009

OpenSSH for windows not recognising rsa authentication

It appears there is a bug in OpenSSH running on windows where it will not allow public key authentication.

To fix this simply edit sshd_config file in the /etc/ directory and change the strict modes line to show as

StrictModes no

Hopefully this saves some of you time.

Wednesday, 28 January 2009

Creating a launcher for FreeMind on Ubuntu

You've installed the FreeMind Software by using
graham@graham-laptop:~$ sudo apt-get update
graham@graham-laptop:~$ sudo apt-get install freemind

and you've exported your shell variables by using (if bash is your default shell, other wise substitute .bashrc for your shell startup script.)
graham@graham-laptop:~$ echo export JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun-1.5.0.13/ >> ~/.bashrc
graham@graham-laptop:~$ echo export PATH=$PATH:/usr/lib/jvm/java-1.5.0-sun-1.5.0.13/bin/ >> ~/.bashrc

but you would rather not have to type
graham@graham-laptop:~$ freemind
to start the software. (According to https://help.ubuntu.com/community/Freemind the launcher should appear under Applications->Office but mine didn't)

Lets face it, we like pointing and clicking on pretty icons. It makes you feel like a man.

First off, we need an Icon, and some kind guy called malefico andauer has created some. Here the are.




Save the image you want to use, I'm going to use the biggest one, into the directory where FreeMind has installed. Should be in /usr/share/freemind. As you will have to be a superuser to copy files to this location, type

graham@graham-laptop:~$ sudo cp /home/graham/Desktop/freemind_icon/48x48/freemind.png /usr/share/freemind/freemind.png

Once that's done, Right click on the Applications menu and select "Edit Menus".

I'm going to place FreeMind by kdissert (in Accessories) because I'm going to be testing both programs but you can put it wherever you want.

Click "New Item" and in the panel that appears type the following
Type=Application
Name=FreeMind
Command=/usr/share/freemind/freemind.sh
Comment=Mind Mapping Application

Then click ok.

If you want it to appear in your top panel, you can right click on the top panel and select "Add to Panel...". Then select "Custom Application Launcher" and enter the info above.

To select the icon, click on the spring button, click browse, then browse to /usr/share/freemind then click "Open". Select the icon then click "Ok".

That's your Launcher ready. Just click close and enjoy.

Thursday, 28 August 2008

Removing line feed characters from dos files for use in UNIX

Here are a couple of commands to remove line feeds from files created in windows for use in UNIX.
I had a list of usernames in a csv which I wanted to run an ldap search on however the line feed characters were causing this to mess up the command

To get around this you can either run

dos2unix current.csv newfile.csv

or you can open the text file in vi. The text file looked like this

johnhe02^M
paulke04^M
marymc04^M
elainp02^M
jimfor01^M
markad01^M
johnmc12^M


then basically open up your command prompt by pressing the colon key ":", and enter the following

%s/^M//g

Note to get the ^M character you hold down ctrl and press V and then M (V and M must be pressed while holding down ctrl)

Another way to acheive the same results as dos2unix is by using the flip command. Thanks to Jadu Kumar Saikia for pointing this out :o)

Wednesday, 2 July 2008

Online FTP client and file editor

The online ftp client, http://www.net2ftp.com/, I have been using for a while, to get around my works firewall and update my website is for some reason inaccessible. For anyone looking for an alternative, http://www.web2ftp.com/ is quite nice. I used to use it previously, and then the host shut it down due to misuse, which was the reason I started using net2ftp in the first place. It is not as feature rich as net2ftp, but it does what it says on the tin.

UPDATE (3rd July '08)
I tried to log in to web2ftp this morning and got the following error.

Web2FTP deactivated !!!Sorry, but we had to deactivate our free service Web2FTP.We have introduced new security functions as logging User actions, Ip-Numbers and blocking whole IP-Ranges from Asian and African networks, but some users continued to upload Phishing sites. We are working on a new solution for registered user.Leverkusen, 03.07.2008

Saturday, 21 June 2008

Setting up jUploadr for ubuntu

jUploadr is a nice little java application which allows you to upload photos to flickr, zooomr and any other photo sharing site you are a member of which allows api access. When you read the FAQs for linux, which are virtually non existent, it basically says that you have to run the application by typing the following into the command line.

./jUploader

This is a touch on the crappy side as many users may not be confident enough with command line working, It also means that you need to remember where you stored to directory and run cd to change to that directory.

It's much easier to add the application to the top panel and here's how you do it.
  • Download jUploadr for linux
  • Once you have extracted the contents of the tar file to your desktop, enter the following into your command line.
sudo mv jUploadr-1.1.2-linuxGTK-i386 /usr/bin/jUploadr-1.1.2-linuxGTK-i386

  • Note that jUploadr-1.1.2-linuxGTK-i386 should be changed to whatever the version you have is called. Run ls on your Desktop to find out and allow an easy copy and paste.
  • Right click on the top panel and select "add to panel"
  • Select "Custom Application Launcher"
  • The main bit here is to browse to the file "jUploadr" within the directory you just moved to /usr/bin.
  • Click on the little spring platform image and this lets you select the icon to chose. Navigate to the directory you just moved to /usr/bin and click open, you then have the choice of 3 image files to select.
  • There you go. Just click and this will open jUploadr.

Friday, 6 June 2008

Nominate Ubuntu for SourceForge's OSS award

SourceForge are holding their annual Community Choice Awards for open source software. I have nominated Ubuntu Linux. If you want to nominate Ubuntu as well, click the link below.



You can view last years winners and nominees here, http://sourceforge.net/community/cca07.

Thursday, 5 June 2008

Gmail displaying annoying error about full cache

When I upgraded to Internet Explorer 7, on Windows XP SP2, I started getting an error on gmail which says

Your browser's cache is full and may interfere with your Google Mail experience.

Since clearing my cache did not help in the slightest so I tried a few other things.


  • Tools > Internet Options > Advanced tab. make sure that “Do not save encrypted pages to disk” is unchecked.
  • Tools > Internet Options > Browsing History Settings, Change “Check for newer version of pages at every visit” to "automatically". This originally worked for me but then something happened on my laptop and then it started again.
  • The size of my cache was sitting at 1024MB so I lowered this to 250MB. (From Browsing History Settings again)
  • The final thing I tried ended up getting rid of the error. I added mail.google.com to the list of allowed sites.
  • Somewhere advised that deleting your temp Internet files and recreating it might help but I didn't try this, nor can I advise if it works.

If anyone has anything else that can be added please leave a comment and I'll add it in.

UPDATE: The message came back after adding mail.google.com to my list of allowed pop ups. After further rooting around I found that if you access gmail through https://mail.google.com/ using secure http the message disappears. As far as I'm aware you still need to go into your internet options on explorer and ensure that “Do not save encrypted pages to disk” is unchecked.

This poses a problem if you access your gmail through google toolbar however, google allows you to edit the xml behind the custom buttons such as gmail. Here's what you have to do in order to get your gmail button on your google toolbar pointing to https://mail.google.com/.

  • Click the settings button on your toolbar.
  • Click on "Custom Buttons"
  • Find the gmail option and click "Edit"
  • Click "Advanced"
  • Press ctrl + f and search for http://mail.google/ and change all instances to https://. There should be 3 urls you need to change.
  • If you like, you can change the message you get which tells you that you have new gmail. Search for or just and between the tags, put something like, "Hey bawbag! Check your email."

You can also do this "advanced edit" in forefox's google toolbar, however firefox doesn't cause gmail the confusion that internet explorer does.

UPDATE (again) - gmail now offers you the option under "settings", to always use https. Tick this option and this whole problem goes away which is good because the iGoogle gadget still takes you to the http: site.

Tuesday, 27 May 2008

Dogpile search gadget for iGoogle

While comparing Google with Dogpile I discovered that there was no dogpile search gadget for iGoogle so I created one.

Use this button to add the uk dogpile search gadget to your iGoogle page


Use this button to add the dot com version of dogpile to your iGoogle page.


Enjoy

Find out where spam came from using Gmail

When registering for an account on any online service it's always best to check the site's privacy policy to see what a site will do, or will not do, with the details you provide.

Personally I can't be arsed with all that fannying around so I just fire in my details and hope my spam filter is up for the challenge, and to be honest, Gmail's spam filter is very good. A way in which you can find sort this out is to sign up with your email address as username+sitename@gmail.com. So if I was a wary customer signing up for Blogger, I would enter mine as graham.macleod+blogger@gmail.com.

You can even have these filtered accordingly, by going into Gmail and select Settings, then Filters and Create a new filter. Add in the address which you signed up with into the To field, and on the next step select Apply the label and then create a new label, I.e. Blogger.

If any spam comes in, you can view which email address it was sent to and therefor tell which site's admin's balls you can go and break. Make sure you don't select Delete it at step 2 of the filter making process as you will still want to receive authentic emails from that site.

This doesn't always work and sites with more advanced registration processes may not accept it. It can't hurt though, unless you have had to enter a mountain of personal info and because an error was detected, you have to start again. But in that case, the website is shit and you should think twice about registering in the first place.