Whenever you try to change your NUMBER column to more specific scale like NUMBER(10,2) you end up with an error message:
SQL Error: ORA-01440: column to be modified must be empty to decrease precision or scale
There is a way out of this but it is a bit hacky. Let me know if there is a more elegant solution!
Following example also takes care of the situation when your column is not nullable.
[sql]
alter table MYTABLE add AMOUNT_TEMP NUMBER;
update MYTABLE set AMOUNT_TEMP = AMOUNT;
alter table MYTABLE modify AMOUNT NULL;
update MYTABLE set AMOUNT=null;
alter table MYTABLE modify AMOUNT number(10,2);
update MYTABLE set AMOUNT=AMOUNT_TEMP;
alter table MYTABLE modify AMOUNT NOT NULL;
alter table MYTABLE drop column AMOUNT_TEMP;
[/sql]
Directory ignore feature for svn and cvs in Eclipse Synchronize View is located in a straightforward place but still from time to time we tend to forget. I keep looking at SVN settings and synchronize View Menu but it is not there.
Here it comes:
Window->Preferences->Team->Ignored Resources
Faster is to simply type “ignored” into preferences quick search!
Here you can add patterns like “bin”, “build”, “target” etc so these will be ignored.
Please be aware that this kind of ignore patterns are not conceptually correct — ignored resources should be configured at the svn repository meta-info level!
New Eclipse 3.5M7 provides an interesting approach for confirmation dialogs. Previous “Yes, No, Cancel” has been replaced with “No, Cancel, Yes” options.
I wonder what is the reasoning behind it.. Read more (including screenshots) at Ivar blog.
Nice reading about MySQL future at Oracle is available at Michael Widenius blog. He is the founder of MySQL, was involved in successfully transferring MySQL business to Sun and left the company in the beginning of 2009.
Have you ever wondered how quickly one could get from installing a J2EE server to running a JSP page that fetches data from DB using modern persistency technology like JPA?
To find out we (me and Ivar) did a little test-drive using recently announced Glassfish Eclipse Bundle that contains Eclipse IDE with bundled Glassfish J2EE server, optionally JDK and a lot of integrated plugins to get you started quickly.
After cutting out all the downloading, startup etc delays we ended up with a surprisingly short 10min demonstration! It was interesting that we barely wrote any code or XML — see for yourself! Tricky part was initial setup to get all the jars and configurations right — must be followed pretty much the same sequence as in the video!
Ok, here it comes, have fun Probably adding a few annotations and audio would help?
yeah. long silence is gone, multiuser wordpress is finally configured and ready for action! What a challenge, finally ended up tweaking couple of cookie paths.
MU WP was part of the common blogging syndicate that we set up for fun between me, Ivar and couple of others at Techlipse.com.
Can you guess the output without running the code?
The relation to Eclipse is simply the fact that big part of eclipse.org is a great example of good test coverage built on top of jUnit. Plus, it was literally pulling my hair out in one of the eclipse-related testing-suites.
I stepped into this a few years ago while bug-fighting a test class that had unexpected initialization.
Pretty sure that many of you know the answer but definitely fun outcome!
As everyone can simply run this snippet yourself I won’t delay approving comments, I’ll just accept them whenever I get a free moment. This comment system here has captcha but additionally all comments must be approved manually.
import junit.framework.TestCase;
public class MyTest extends TestCase {
private static int count = 0;
{ count++; }
public MyTest() {count++;}
public void test1() { System.out.print(count); }
public void test2() { System.out.print(count); }
public void test3() { System.out.print(count); }
}
I’m sure some of us don’t always take this behavior into account
After figuring this out, SPECIAL fun is a bit modified case:
import junit.framework.TestCase;
public class MyTest extends TestCase {
private static int count = 0;
{ count=count*2; }
public MyTest() { count++; }
public void test1() { System.out.print(count); }
public void test2() { System.out.print(count); }
public void test3() { System.out.print(count); }
}
For this last snippet I think without running it you won’t figure it out At least I didn’t..
This means Ericsson ongoing support for open source and more importantly Google-backed Android platform.
Ericsson will be offering Android-based phones mid-2009. Excellent news! I’m glad to see strong phone manufacturer joining the Alliance. As I understand, currently only Nokia and RIM (blackberrry) from the “big players list” are missing from the alliance.
To come up with some speculations — Ericsson might try to base new phone on X1/Experia that runs with Windows Mobile and first reviews claim it to have slow user interface.
What is the smallest change to main method that makes it sysout “true”?
You are allowed to change ONLY the main method! Of course changing sysout line is out of question.
You can leave your answer in comments and I’ll publish/approve them together with the solution.
[java]
public class InstanceDemo {
public static void main(String[] args){
MyClass cl1 = new MyClass();
MyClass cl2 = new MyClass();
System.out.println(cl1.ocl==cl2.ocl && cl1!=cl2);
}
private static class MyClass extends java.util.ArrayList {
private final Object ocl = new Object();
}
}
[/java]
I’ll post the correct answer in 24h
UPDATE: Was not that hard afterall! ~45 correct answers.
Yes, clone() was the answer I was looking for:
[java]MyClass cl2 = (MyClass) cl1.clone();[/java]
Ed Merks surprised with a nice solution:
[java]
//Add this line as the first line of main.
class MyClass extends InstanceDemo.MyClass {
Object ocl = null;
}
[/java]
And a lot of people took the hard-core way:
[java]
Field field = cl1.getClass().getDeclaredField(“ocl”);
field.setAccessible(true);
field.set(cl2,cl1.ocl);
[/java]
I got this while trying to install new version of subclipse on top of eclipse rcp edition of ganymede release. Running eclipse with -clean didn’t help.
[code]
!ENTRY org.eclipse.equinox.p2.engine 4 4 2008-11-18 13:17:31.218
!MESSAGE An error occurred during provisioning.
!SUBENTRY 1 org.eclipse.equinox.p2.touchpoint.eclipse 4 0 2008-11-18 13:17:31.218
!MESSAGE Failed to prepare partial IU: [R]org.tigris.subversion.clientadapter.javahl 1.5.4.
[/code]
Then I thought – what the heck, not going to reinstall – and tried to update whole eclipse with P2. Worked nicely, all updated.
After that also installing full subclipse worked again, at least without errors.
BUT just installation. It didn’t actually work — it shows up as installed plugin in P2 manager — but not visible in Help->About->Plugin Details. Workspace .log is clean.
So, new eclipse re-install, here I come
This all probably started because I first tried to upgrade from older subclipse to 1.4.6 using p2 update manager. Usually I’ve been just reinstalling manually.
And I’m not even sure if it’s a P2 or subclipse update site issue. Some P2 internal cache trees maybe got screwed that -clean couldn’t reach.