Unknown Runtime Error in Internet Explorer while using innerHTML
This is one of those awesome “features” of the Microsoft browser. One which can send web developers of the deep end.
Seems this error may happen due to several reasons:
- You are trying to put a block-level element inside an inline element like a div element inside a p element (see source 1)
- You are trying to set a table’s innerHTML (see source 2)
- You are trying to put a form element inside an element that is itself inside another form
In my case i chose to replace the original form completely or avoid using the form tag in these situations. All together this seems like a design problem as situations like this should not occur in the first place.
Note that if you run into trouble with the prototype Ajax functions you might want to set the onException option in order to see what is really happening. Though in this case the exceptions isn’t particularly helpful since it only states : Unknown Runtime Error
Update:
If this happens to you when using prototype ajaxupdater, create your own ajaxreplacer that replaces the div instead of trying to set innerHtml.
Sources:
Extreme Exception Programming – Catch Every Exception and Work Around It
try{list = (ArrayList<MyObject1>)session.getAttribute(TEMPORARY_LIST);}catch (ClassCastException e){if(add.getMyObjectCurrentItem()) != -1)try{list = add.getOtherList().get(add.getMyObjectList()).getMyObjectList();} catch(IndexOutOfBoundsException e2){try{list = add.getOtherList().get(add.getMyObjectList()-1).getMyObjectList();<} catch(IndexOutOfBoundsException e3){//Move On}}}
Cygwin with Tabs using Console(and still portable)
I recently found a way to use tabs with cygwin wich reduces the clutter in your taskbar. You can easily use Console to achieve this, unfortunally the instructions around the web assume your cygwin is installed in the default manner (not portable, not using rxvt as an emulator) so those of you using my instructions to set up a portable cygwin instalation will have a hard time getting Console to work with cygwin.
To use Console just make sure to set up the shell execution path to call /bin/bash and not rxvt.
In the spirit of keeping things portable you need to do the following:
- just edit your bat file and edit the last line:
%WD%\bin\run %WD%\bin\rxvt.exe -geometry 140×40 -sl 1500 -fn “Courier New” -bg black -fg grey -sr -e %WD%\bin\bash –login -i
to
%WD%\bin\bash –login -i
- move all Console files to the cygwin folder (same folder as CygwinPortable.exe)
- make sure the path defined in the Console settings is relative(If you have trouble doing this just edit the console.xml file by hand):
Shell: “\App\Cygwin\cygwin.bat”
Startup Dir: “.”
Console changes some of the window behavior but you can work around that by changing the settings:
- Mark Settings>Behavior>copy on select
- Mark Settings>Behavior>Clear selection on copy
- Settings>Hotkeys>Select Rename Tab on the list > hit the clear button (this will make sure you can use the bash history)
- There might be some mouse configurations i forgot that you can change.
Links :
No GTK# version when creating new project in MonoDevelop
I’ve recently had to do a full reinstall of my development environment and ran into to some issues with monodevelop.One of these issues appeared when i tried to create a new gtk# application solution. MonoDevelop didn’t detect any gtk# versions on my system.
I had this same issue on the first time i installed mono develop on my fedora box so this time i knew what i was looking for.
Installing monodevelop with yum from fedora repositories isn’t enough to get you started on developing gtk# 2.0 apps. You are going to need to install one other package : gtk# 2.0 development. Just run : yum install gtk-sharp2-devel and this will solve your problem.
Cygwin Portable – (some) Linux power on a USB for Windows
The Cygwin tools are ports of the popular GNU development tools for Microsoft Windows. They run thanks to the Cygwin library which provides the POSIX system calls and environment these programs expect.
With these tools installed, it is possible to write Windows console or GUI applications that make use of significant parts of the POSIX API. As a result, it is possible to easily port many Unix programs without the need for extensive changes to the source code. This includes configuring and building most of the available GNU software (including the packages included with the Cygwin development tools themselves) as well as lots of BSD tools and packages (including OpenSSH). Even if the development tools are of little to no use to you, you may have interest in the many standard POSIX utilities provided with the package. They can be used from one of the provided Unix shells like bash, tcsh or zsh, as well as from the standard Windows command shell if you have to for some sad reason.
From Cygwin FAQ
If you google Cygwin Portable you will find several solutions:
- Cygwin on portable storage devices (Devin Sezer)
- Cygwin Portable Project
- A Guide to Building a Portable Cygwin « fuzzix
The one that actually worked for me came from the SourceForge project called CygwinPortable. This version is designed to work with the software bundle PortableApps, but you could use it yourself outside the bundle (see bellow).
To install this software under the bundle just extract the zip file into your PortableAps folder, and on the gui launcher click on Options->Refresh App Icons. You will see two icons appear : one launches cygwin the other launches the setup.
I had some issues getting it to work as i wanted:
Subversion information
it seems the project mantainer packaged the software with svn files, you will need to remove all .svn folders from the exploded contents. I used SVN Cleaner for that.
Outdated setup.exe
The project seems to be unmaintained for some time now. Since that time a new version of cygwin came out which changed how setup.exe and setup.ini work. If you want to update or install new Cygwin packages you will need to download setup.exe from the cygwin page (see bellow for links) and replace the file cygwinsetup.exe in CygwinPortable\App\Cygwin\setup\ with the download one, i would advise you to replace it with a renamed version of the one download if you are using Portable Apps since the portable Apps link runs the original exe file. After doing this you can update and install new cygwin software without a hinch.
Cygwin is locked to the drive you updated it on
After i updated some packages on my cygwin my shell window changed into a normal cmd dos windows, which besides being ugly had the huge disadvantage of not allowing me to copy and paste with a single click. I set out to find a solution and it came in the form of rxvt. %Explain rxvt%. The problem was in my cygwin.bat file.
If you go into CygwinPortable\App\Cygwin you will find a file named cygwin.bat. This batch file is responsible for starting up cygwin. For some reason this file will be changed when you update your cygwin version and (after the setup) it will look something like bellow:
@echo off F: chdir F:\Software\Bin\PortableApps\CygwinPortable\App\Cygwin\bin bash --login -i
the above just runs bash.exe from your cygwin bin dir. And worse it just locked your instalation of cygwin back to the current computer (see the two lines bellow @echo off).
In order to solve this all you have to do is open the cygwin portable zip file you downloaded and replace your cygwin.bat with the one provided in there. This will be able to determine the folder you are running CygwinPortable.exe from and open up your rxvt window.
For those of you wanting to use cygwin outside the PortableApps bundle all the above steps apply, but unfortunally there is some other work you need to do:
- All you need to work with cygwin is the folder “CygwinPortable\App\Cygwin” so pull that out
- To run cygwin you will need to execute the cygwin.bat file inside that folder. But this file is configured to be run by the CygwinPortable.exe file and not on its own. So to get it to run on is own you will need to change the first line of the script to
for /F %%A in ('cd') do set WD=%%A
Notice i only removed the last part of the line which was telling the batch file where the cygwin base folder was. Since with Portable Apps we run CygwinPortable.exe the base folder would be the file execution folder (\CygwinPortable\) plus “App\Cygwin”. But when running the batch file directly the base folder becomes the batch file execution folder. Ok this part was confusing, if you have any doubts let me know and i’ll revise this part
Enjoy your new powers.
External Links:
Oracle Number to Java Object
Recently i needed to know what should be the JAVA Object to use when mapping against an oracle database.
You can easily find alot of documentation on these mappings by searching google, but if you need to convert data types in the form of Number(p,s) (where p is precision and s is scale) you will have alot more trouble.
I ended up finding a reference to some old bea documentation(which got thrown offline when oracle took over bea) in an objectmix thread. So i put it here if anyone ever needs it:
Column Definition Returned by getObject()
NUMBER(P <=3D 9)
IntegerNUMBER(P <=3D 18)
LongNUMBER(P >=3D 19)
BigDecimalNUMBER(P <=3D16, S > 0)
DoubleNUMBER(P >=3D 17, S > 0)
BigDecimal
Links :
- ObjectMix Thread
- Old Bea Docs (offline)
Why I Hate Weblogic Integration
This is a running post, as i go along with my current task of trying to use WLI i’m pretty sure i will be adding items to this list:
- WorkShop – What a bloated and buggy piece of crap. This is probably the worst part till now.
- I guess its too much to ask for a software to give reasons for not working but eh, here are some i have found:
- Don’t put your workspace on a path with spaces or strange letters(like ó)
- If trying to create to create a task plan workshop refuses to responde to next your trying to create the plan in the wrong folder
- I guess its too much to ask for a software to give reasons for not working but eh, here are some i have found:
- Transformations – grrrrrr… trying to debug these things is the worst thing i’ve had to do. want to know why? because i can’t…
- It’s really hard to understand why we should even use this crap, and why do people around the world actually consider this as added value….
Extending EJB3 Objects
Small and fast tip.
In order to be able to extend an EJB Entity object (be it a main object or a primary key embbedable) you need to write the MappedSuperclass anotation in the super class.
The following is taken from hibernate documentation :
@MappedSuperclass public class BaseEntity { @Basic @Temporal(TemporalType.TIMESTAMP) public Date getLastUpdate() { ... } public String getLastUpdater() { ... } ... } @Entity class Order extends BaseEntity { @Id public Integer getId() { ... } ... }
Some other notes taken from the documentation :
- Properties from superclasses not mapped as @MappedSuperclass are ignored;
- The access type (field or methods), is inherited from the root entity, unless you use the Hibernate annotation @AccessType;
- Any class in the hierarchy non annotated with @MappedSuperclass nor @Entity will be ignored.
Read the documentation to understand it fully : http://docs.jboss.org/hibernate/stable/annotations/reference/en/html/entity.html chapter 2.2.4.4
Please note that even though i’ve used the Hibernate documentation as a reference this anotation also exists in javax.persistence so it can be used with JPA