Seeking explanation on the code below
public void addListEntries(List<ListEntry> list) {
for(ListEntry entry: list) {
addListEntry(entry);
The above method is from a sample program on using Java DB in desktop application. I need sombody to help explain the following:
(1) addListEntry(List<ListEntry> list)
the use of angular brackets in the specification of function parameter is new to me.
(2) for(ListEntry entry: list)
the for statement seem to depart from the definition of for statement as defined as follows: for(initialization;condition;increment)
Thank you
yosule
Both of those are new features in Java 5 (aka 1.5.0). You should google for Generics and for-each respectively.
The first is a way to specify what type the content of a Collection is (among many other possibilities, but that's probably the most common use).
The for-each loop is basically just syntactic sugar.
Similar Messages
-
Hi i need the explanation for the code below.
public class RMIClient_CipherKey
public RMIClient_CipherKey()
public boolean changeKey(String s)
int ai[] = new int[s.length()];
for(int i = 0; i < ai.length; i++)
switch(s.charAt(i))
case 65: // 'A'
ai[i] = 1;
break;
case 66: // 'B'
ai[i] = 2;
break;
case 67: // 'C'
ai[i] = 3;
break;
case 68: // 'D'
ai[i] = 4;
break;
case 69: // 'E'
ai[i] = 5;
break;
case 70: // 'F'
ai[i] = 6;
break;
case 71: // 'G'
ai[i] = 7;
break;
case 72: // 'H'
ai[i] = 8;
break;
case 73: // 'I'
ai[i] = 9;
break;
case 74: // 'J'
ai[i] = 10;
break;
case 75: // 'K'
ai[i] = 11;
break;
case 76: // 'L'
ai[i] = 12;
break;
case 77: // 'M'
ai[i] = 13;
break;
case 78: // 'N'
ai[i] = 14;
break;
case 79: // 'O'
ai[i] = 15;
break;
case 80: // 'P'
ai[i] = 16;
break;
case 81: // 'Q'
ai[i] = 17;
break;
case 82: // 'R'
ai[i] = 18;
break;
case 83: // 'S'
ai[i] = 19;
break;
case 84: // 'T'
ai[i] = 20;
break;
case 85: // 'U'
ai[i] = 21;
break;
case 86: // 'V'
ai[i] = 22;
break;
case 87: // 'W'
ai[i] = 23;
break;
case 88: // 'X'
ai[i] = 24;
break;
case 89: // 'Y'
ai[i] = 25;
break;
case 90: // 'Z'
ai[i] = 26;
break;
case 32: // ' '
ai[i] = 27;
break;
case 33: // '!'
case 34: // '"'
case 35: // '#'
case 36: // '$'
case 37: // '%'
case 38: // '&'
case 39: // '\''
case 40: // '('
case 41: // ')'
case 42: // '*'
case 43: // '+'
case 44: // ','
case 45: // '-'
case 46: // '.'
case 47: // '/'
case 48: // '0'
case 49: // '1'
case 50: // '2'
case 51: // '3'
case 52: // '4'
case 53: // '5'
case 54: // '6'
case 55: // '7'
case 56: // '8'
case 57: // '9'
case 58: // ':'
case 59: // ';'
case 60: // '<'
case 61: // '='
case 62: // '>'
case 63: // '?'
case 64: // '@'
default:
key = defaultKey;
return false;
if(ai.length > 0)
key = ai;
else
return false;
return true;
public String encryptLine(String s)
String s1 = "";
int i = 0;
for(int j = 0; j < s.length(); j++)
int k = s.charAt(j) + key;
if(k > 126)
k -= 95;
s1 = s1 + (char)k;
if(++i >= key.length)
i = 0;
return s1;
public String decryptLine(String s)
String s1 = "";
int i = 0;
for(int j = 0; j < s.length(); j++)
int k = s.charAt(j) - key[i];
if(k < 32)
k += 95;
s1 = s1 + (char)k;
if(++i >= key.length)
i = 0;
return s1;
private final int defaultKey[] = {
9, 27, 12, 15, 22, 5, 27, 10, 1, 22,
1
private int key[] = {
9, 27, 12, 15, 22, 5, 27, 10, 1, 22,
1Hi.
The first method is confusing as most of it doesn't do anything. You could replace it with a one liner. ;)
It returns true if and only if the string has one or more characters and none of those characters are one of the special characters. The special characters include digits but not letters such as [ ] { } \
The second and third methods implement a simple rotation encryption for up to 11 character strings. (Longer strings result in an ArrayIndexOutOfBoundException) -
Could someone show me the correct way to use the Vector in the code below?
Would someone mind explaining to me why I am getting a NullPointerException when I run the code below? I initialized the vector in the constructor so it should follow through the whole class right? What would be the right way to do it?
import java.util.Vector;
public class AlumniDirectory
private String faculty;
private static Vector alumni;
/** Constructor reads faculty Name and inits new vector **/
public AlumniDirectory(String facultyIn)
Vector alumni = new Vector();
faculty = facultyIn;
/** Method adds a new Alumni to the list **/
public void addAlumnus(Object o)
alumni.addElement(o);
/** Method removes a Alumni from the list **/
public void removeAlumnus(Object o)
alumni.removeElement(o);
/** Method searches for Alumni by last name and graduation year **/
public void searchAlumnus(String lastNameIn, int years)
// Code will go here eventually
}And probably you want a list of Alumni not a vector of Objects. So try this:
import java.util.List;
import java.util.ArrayList;
public class AlumniDirectory{
private final String faculty;
private final List<Alumnus> alumni = new ArrayList<Alumnus>();
/** Constructor reads faculty Name and inits new vector **/
public AlumniDirectory(String facultyIn)
faculty = facultyIn;
/** Method adds a new Alumni to the list **/
public void addAlumnus(Alumnus alumnus)
alumni.add(alumnus));
/** Method removes a Alumni from the list **/
public void removeAlumnus(Alumnus alumnus)
alumni.remove(alumnus);
/** Method searches for Alumni by last name and graduation year **/
public void searchAlumnus(String lastNameIn, int years)
// Code will go here eventually
}-Puce
Edited by: Puce on Oct 23, 2007 7:43 PM
Edited by: Puce on Oct 23, 2007 7:46 PM -
AS3 how to put the buttons always on top of the external swf in the code below?
how to put the buttons always on top of the external swf in the code below? I am beginner use to as3, can someone help me?
thanks, for all!!
var Xpos:Number = 110;
var Ypos:Number = 180;
var swf:MovieClip;
var loader:Loader = new Loader();
var defaultSWF:URLRequest = new URLRequest("swfs/eyesClosed.swf");
loader.load(defaultSWF);
loader.x = Xpos;
loader.y = Ypos;
addChild(loader);
// Btns Universal function
function btnClick(event:MouseEvent):void {
removeChild(loader);
var newSWFRequest:URLRequest = new URLRequest("swfs/" + event.target.name + ".swf");
loader.load(newSWFRequest);
loader.x = Xpos;
loader.y = Ypos;
addChild(loader);
// Btn listeners
eyesClosed.addEventListener(MouseEvent.CLICK, btnClick);
stingray.addEventListener(MouseEvent.CLICK, btnClick);
demon.addEventListener(MouseEvent.CLICK, btnClick);
strongman.addEventListener(MouseEvent.CLICK, btnClick);use:
var Xpos:Number = 110;
var Ypos:Number = 180;
var swf:MovieClip;
var loader:Loader = new Loader();
var defaultSWF:URLRequest = new URLRequest("swfs/eyesClosed.swf");
loader.load(defaultSWF);
loader.x = Xpos;
loader.y = Ypos;
addChild(loader);
// Btns Universal function
function btnClick(event:MouseEvent):void {
removeChild(loader);
var newSWFRequest:URLRequest = new URLRequest("swfs/" + event.target.name + ".swf");
loader.load(newSWFRequest);
loader.x = Xpos;
loader.y = Ypos;
addChildAt(loader,0);
// Btn listeners
eyesClosed.addEventListener(MouseEvent.CLICK, btnClick);
stingray.addEventListener(MouseEvent.CLICK, btnClick);
demon.addEventListener(MouseEvent.CLICK, btnClick);
strongman.addEventListener(MouseEvent.CLICK, btnClick); -
Workshop terminates intermittently with the code below. Help!
I need help/pointer to what is causing this nightmare. This thing terminates so often that its becoming predictable. I cant say of one thing am doing at the time of termination. It could just be in the middle of test run, or just plain old browsing or button click. Hopefully the info below can help since that's the only thing left on exit.
JVM terminated. Exit code=1 C:/bea/jdk150_11/jre/bin/javaw.exe
-Xms384m -Xmx768m
-XX:MaxPermSize=256m
-Dweblogic.home=C:/bea/wlserver_10.0 -Dosgi.install.area=C:\bea\tools\eclipse32\eclipse
-Dosgi.instance.area.default=C:/bea/user_projects/w4WP_workspaces/Untitled
-Dosgi.configuration.area=C:/bea/workshop_10.0/workshop4WP/eclipse/configuration
-Declipse.product=com.bea.workshop.product.wl.workshop
-Dosgi.splashPath=file: C:/bea/workshop_10.0/workshop4WP/eclipse/plugins/com.bea.workshop.product.wl_1.0.0
-DprodMode=preProduction-jar C:\bea\workshop_10.0\workshop4WP\startup.jar
-0s win32
-ws win32
-arch x86
-launcher C:\bea\workshop_10.0\workshop4WP\workshop4WP.exe
-name Workshop4WP
-showsplash 600
-exitdata 154_64
-vm C:/bea/jdk150_11/jre/bin/javaw.exe
-vmargs -Xms384m -Xmx768m
-XX:MaxPermSize=256m
-Dweblogic.home=C:/bea/wlserver_10.0
-Dosgi.install.area=C:\bea\tools\eclipse32\eclipse
-Dosgi.instance.area.default=C:/bea/user_projects/w4WP_workspaces/Untitled -Dosgi.configuration.area=C:/bea/workshop_10.0/workshop4WP/eclipse/configuration -Declipse.product=com.bea.workshop.product.wl.workshop
-Dosgi.splashPath=file: C:/bea/workshop_10.0/workshop4WP/eclipse/plugins/com.bea.workshop.product.wl_1.0.0
-DprodMode=preProduction-jar C:\bea\workshop_10.0\workshop4WP\startup.jarsHey Kal, am sorry this problem is still persistent but not as much: Here is a log. Hopefully someone can make meaning out of it:
# A fatal error has been detected by the Java Runtime Environment:
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x743bac38, pid=8104, tid=7020
# JRE version: 6.0_21-b06
# Java VM: Java HotSpot(TM) Client VM (17.0-b16 mixed mode windows-x86 )
# Problematic frame:
# C [COMCTL32.dll+0xaac38]
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
--------------- T H R E A D ---------------
Current thread (0x01b9a000): JavaThread "main" [_thread_in_native, id=7020, stack(0x00260000,0x002b0000)]
siginfo: ExceptionCode=0xc0000005, reading address 0x534d0f1c
Registers:
EAX=0x1ed7db2a, EBX=0x002147a0, ECX=0x1efd3046, EDX=0x00215980
ESP=0x002aeb3c, EBP=0x002aeb6c, ESI=0x534d0f00, EDI=0x534d0f00
EIP=0x743bac38, EFLAGS=0x00010202
Top of Stack: (sp=0x002aeb3c)
0x002aeb3c: 00215980 002147a0 743baa72 002f11e8
0x002aeb4c: 002aeb5c 00000000 00000005 743baa7d
0x002aeb5c: 00000000 00000000 00000263 1ed7db2a
0x002aeb6c: 002aeb94 743cc46e 00215980 534d0f00
0x002aeb7c: 00000000 00000002 002147a0 00215980
0x002aeb8c: 00000009 00000005 002aec18 743b9b55
0x002aeb9c: 5904b938 00000001 002147a0 00000003
0x002aebac: 00000000 002aec94 0000110b 00000000
Instructions: (pc=0x743bac38)
0x743bac28: c2 45 74 33 c5 89 45 fc 8b 55 08 53 56 8b 75 0c
0x743bac38: 0f b7 5e 1c 33 5d 10 89 55 d8 23 5d 14 75 12 8b
Stack: [0x00260000,0x002b0000], sp=0x002aeb3c, free space=13a002ae658k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C [COMCTL32.dll+0xaac38]
C [COMCTL32.dll+0xbc46e]
C [COMCTL32.dll+0xa9b55]
C [USER32.dll+0x186ef]
C [USER32.dll+0x18876]
C [USER32.dll+0x143cf]
C [USER32.dll+0x143f5]
C [swt-win32-3235.dll+0x1346]
J org.eclipse.swt.internal.win32.OS.CallWindowProcW(IIIII)I
J org.eclipse.swt.widgets.Tree.callWindowProc(IIII)I
J org.eclipse.swt.widgets.Control.windowProc(IIII)I
J org.eclipse.swt.widgets.Tree.windowProc(IIII)I
J org.eclipse.swt.widgets.Display.windowProc(IIII)I
v ~StubRoutines::call_stub
V [jvm.dll+0xf3abc]
V [jvm.dll+0x1865b1]
V [jvm.dll+0xf3b3d]
V [jvm.dll+0xfd5cf]
V [jvm.dll+0xff3f7]
C [swt-win32-3235.dll+0x2ac96]
C [swt-win32-3235.dll+0x1f0c1]
C [USER32.dll+0x18876]
C [USER32.dll+0x17631]
C [USER32.dll+0x17695]
C [swt-win32-3235.dll+0xba46]
J org.eclipse.swt.internal.win32.OS.SendMessage(IIII)I
j org.eclipse.swt.widgets.Tree.setSelection([Lorg/eclipse/swt/widgets/TreeItem;)V+144
j org.eclipse.debug.internal.ui.viewers.AsynchronousTreeViewer.doAttemptSelectionToWidget(Lorg/eclipse/jface/viewers/ISelection;Z)Lorg/eclipse/jface/viewers/ISelection;+490
j org.eclipse.debug.internal.ui.viewers.AsynchronousViewer.attemptSelection(Z)V+19
j org.eclipse.debug.internal.ui.viewers.AsynchronousViewer$1.runInUIThread(Lorg/eclipse/core/runtime/IProgressMonitor;)Lorg/eclipse/core/runtime/IStatus;+8
j org.eclipse.ui.progress.UIJob$1.run()V+51
J org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Z)Z
J org.eclipse.swt.widgets.Display.readAndDispatch()Z
J org.eclipse.ui.internal.Workbench.runEventLoop(Lorg/eclipse/jface/window/Window$IExceptionHandler;Lorg/eclipse/swt/widgets/Display;)V
j org.eclipse.ui.internal.Workbench.runUI()I+225
j org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Lorg/eclipse/swt/widgets/Display;Lorg/eclipse/ui/application/WorkbenchAdvisor;)I+11
j org.eclipse.ui.PlatformUI.createAndRunWorkbench(Lorg/eclipse/swt/widgets/Display;Lorg/eclipse/ui/application/WorkbenchAdvisor;)I+2
j org.eclipse.ui.internal.ide.IDEApplication.run(Ljava/lang/Object;)Ljava/lang/Object;+76
j org.eclipse.core.internal.runtime.PlatformActivator$1.run(Ljava/lang/Object;)Ljava/lang/Object;+219
j org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(Ljava/lang/Object;)Ljava/lang/Object;+103
j org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(Ljava/lang/Object;)Ljava/lang/Object;+29
j org.eclipse.core.runtime.adaptor.EclipseStarter.run(Ljava/lang/Object;)Ljava/lang/Object;+135
j org.eclipse.core.runtime.adaptor.EclipseStarter.run([Ljava/lang/String;Ljava/lang/Runnable;)Ljava/lang/Object;+60
v ~StubRoutines::call_stub
V [jvm.dll+0xf3abc]
V [jvm.dll+0x1865b1]
V [jvm.dll+0xf3b3d]
V [jvm.dll+0x1a0ebb]
V [jvm.dll+0x1a18d6]
V [jvm.dll+0x11f423]
C [java.dll+0x7127]
j sun.reflect.NativeMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+87
j sun.reflect.DelegatingMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+6
j java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+161
j org.eclipse.core.launcher.Main.invokeFramework([Ljava/lang/String;[Ljava/net/URL;)V+181
j org.eclipse.core.launcher.Main.basicRun([Ljava/lang/String;)V+107
j org.eclipse.core.launcher.Main.run([Ljava/lang/String;)I+4
j org.eclipse.core.launcher.Main.main([Ljava/lang/String;)V+10
v ~StubRoutines::call_stub
V [jvm.dll+0xf3abc]
V [jvm.dll+0x1865b1]
V [jvm.dll+0xf3b3d]
V [jvm.dll+0xfd385]
V [jvm.dll+0x104fdd]
C [javaw.exe+0x2155]
C [javaw.exe+0x8614]
C [kernel32.dll+0x51194]
C [ntdll.dll+0x5b495]
C [ntdll.dll+0x5b468]
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
J org.eclipse.swt.internal.win32.OS.CallWindowProcW(IIIII)I
J org.eclipse.swt.widgets.Tree.callWindowProc(IIII)I
J org.eclipse.swt.widgets.Control.windowProc(IIII)I
J org.eclipse.swt.widgets.Tree.windowProc(IIII)I
J org.eclipse.swt.widgets.Display.windowProc(IIII)I
v ~StubRoutines::call_stub
J org.eclipse.swt.internal.win32.OS.SendMessageW(IIII)I
J org.eclipse.swt.internal.win32.OS.SendMessage(IIII)I
j org.eclipse.swt.widgets.Tree.setSelection([Lorg/eclipse/swt/widgets/TreeItem;)V+144
j org.eclipse.debug.internal.ui.viewers.AsynchronousTreeViewer.doAttemptSelectionToWidget(Lorg/eclipse/jface/viewers/ISelection;Z)Lorg/eclipse/jface/viewers/ISelection;+490
j org.eclipse.debug.internal.ui.viewers.AsynchronousViewer.attemptSelection(Z)V+19
j org.eclipse.debug.internal.ui.viewers.AsynchronousViewer$1.runInUIThread(Lorg/eclipse/core/runtime/IProgressMonitor;)Lorg/eclipse/core/runtime/IStatus;+8
j org.eclipse.ui.progress.UIJob$1.run()V+51
J org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Z)Z
J org.eclipse.swt.widgets.Display.readAndDispatch()Z
J org.eclipse.ui.internal.Workbench.runEventLoop(Lorg/eclipse/jface/window/Window$IExceptionHandler;Lorg/eclipse/swt/widgets/Display;)V
j org.eclipse.ui.internal.Workbench.runUI()I+225
j org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Lorg/eclipse/swt/widgets/Display;Lorg/eclipse/ui/application/WorkbenchAdvisor;)I+11
j org.eclipse.ui.PlatformUI.createAndRunWorkbench(Lorg/eclipse/swt/widgets/Display;Lorg/eclipse/ui/application/WorkbenchAdvisor;)I+2
j org.eclipse.ui.internal.ide.IDEApplication.run(Ljava/lang/Object;)Ljava/lang/Object;+76
j org.eclipse.core.internal.runtime.PlatformActivator$1.run(Ljava/lang/Object;)Ljava/lang/Object;+219
j org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(Ljava/lang/Object;)Ljava/lang/Object;+103
j org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(Ljava/lang/Object;)Ljava/lang/Object;+29
j org.eclipse.core.runtime.adaptor.EclipseStarter.run(Ljava/lang/Object;)Ljava/lang/Object;+135
j org.eclipse.core.runtime.adaptor.EclipseStarter.run([Ljava/lang/String;Ljava/lang/Runnable;)Ljava/lang/Object;+60
v ~StubRoutines::call_stub
j sun.reflect.NativeMethodAccessorImpl.invoke0(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+0
j sun.reflect.NativeMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+87
j sun.reflect.DelegatingMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+6
j java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+161
j org.eclipse.core.launcher.Main.invokeFramework([Ljava/lang/String;[Ljava/net/URL;)V+181
j org.eclipse.core.launcher.Main.basicRun([Ljava/lang/String;)V+107
j org.eclipse.core.launcher.Main.run([Ljava/lang/String;)I+4
j org.eclipse.core.launcher.Main.main([Ljava/lang/String;)V+10
v ~StubRoutines::call_stub
--------------- P R O C E S S ---------------
Java Threads: ( => current thread )
0x5a577c00 JavaThread "org.eclipse.jdt.internal.ui.text.JavaReconciler" daemon [_thread_blocked, id=4008, stack(0x5afa0000,0x5aff0000)]
0x5a577800 JavaThread "Timer-4" daemon [_thread_blocked, id=2164, stack(0x58980000,0x589d0000)]
0x5a577000 JavaThread "Timer-1" daemon [_thread_blocked, id=7300, stack(0x5d770000,0x5d7c0000)]
0x5a576c00 JavaThread "Timer-0" daemon [_thread_blocked, id=4616, stack(0x5d720000,0x5d770000)]
0x5a5cc400 JavaThread "org.eclipse.jdt.debug: JDI Event Dispatcher" daemon [_thread_blocked, id=7220, stack(0x5d680000,0x5d6d0000)]
0x5a5c1400 JavaThread "ServerConnection" [_thread_in_native, id=2572, stack(0x5b160000,0x5b1b0000)]
0x5a5cbc00 JavaThread "Packet Send Manager" daemon [_thread_blocked, id=5512, stack(0x5d630000,0x5d680000)]
0x5a5cb800 JavaThread "Packet Receive Manager" daemon [_thread_in_native, id=2756, stack(0x5d5e0000,0x5d630000)]
0x5a5cb000 JavaThread "Worker-31" [_thread_blocked, id=8160, stack(0x5d590000,0x5d5e0000)]
0x5a796c00 JavaThread "Worker-30" [_thread_blocked, id=4656, stack(0x5d540000,0x5d590000)]
0x5a796400 JavaThread "Worker-29" [_thread_blocked, id=5840, stack(0x5d4f0000,0x5d540000)]
0x5a796000 JavaThread "Worker-28" [_thread_blocked, id=7660, stack(0x5d4a0000,0x5d4f0000)]
0x5a795800 JavaThread "Worker-27" [_thread_blocked, id=4304, stack(0x5d450000,0x5d4a0000)]
0x5a795400 JavaThread "Worker-26" [_thread_blocked, id=3152, stack(0x5d400000,0x5d450000)]
0x5a5c2c00 JavaThread "Worker-25" [_thread_blocked, id=8004, stack(0x5d3b0000,0x5d400000)]
0x583fb400 JavaThread "Process monitor" daemon [_thread_in_native, id=512, stack(0x5b090000,0x5b0e0000)]
0x5a315000 JavaThread "Input Stream Monitor" daemon [_thread_blocked, id=6880, stack(0x5aff0000,0x5b040000)]
0x5a318400 JavaThread "Output Stream Monitor" daemon [_thread_in_native, id=4208, stack(0x59b00000,0x59b50000)]
0x5a316000 JavaThread "Output Stream Monitor" daemon [_thread_in_native, id=6252, stack(0x587d0000,0x58820000)]
0x583f9c00 JavaThread "Worker-24" [_thread_blocked, id=7352, stack(0x5af30000,0x5af80000)]
0x5a317800 JavaThread "Worker-23" daemon [_thread_blocked, id=4120, stack(0x59b50000,0x59ba0000)]
0x5a5c2000 JavaThread "org.eclipse.jdt.internal.ui.text.JavaReconciler" daemon [_thread_blocked, id=3460, stack(0x58820000,0x58870000)]
0x5a5c2800 JavaThread "org.eclipse.jdt.internal.ui.text.JavaReconciler" daemon [_thread_blocked, id=6668, stack(0x5b040000,0x5b090000)]
0x5a318000 JavaThread "Worker-19" [_thread_blocked, id=1204, stack(0x59d20000,0x59d70000)]
0x5a316800 JavaThread "Worker-17" [_thread_blocked, id=7472, stack(0x59150000,0x591a0000)]
0x5a315400 JavaThread "Worker-16" [_thread_blocked, id=6464, stack(0x59100000,0x59150000)]
0x583fcc00 JavaThread "AWT-Windows" daemon [_thread_in_native, id=1392, stack(0x5ae60000,0x5aeb0000)]
0x583da400 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=6480, stack(0x59da0000,0x59df0000)]
0x5835d800 JavaThread "Java indexing" daemon [_thread_blocked, id=5632, stack(0x59cd0000,0x59d20000)]
0x560b0000 JavaThread "Start Level Event Dispatcher" daemon [_thread_blocked, id=5360, stack(0x563f0000,0x56440000)]
0x560aec00 JavaThread "Framework Event Dispatcher" daemon [_thread_blocked, id=7616, stack(0x563a0000,0x563f0000)]
0x56076400 JavaThread "State Data Manager" daemon [_thread_blocked, id=4336, stack(0x56350000,0x563a0000)]
0x01a89000 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=4440, stack(0x55f20000,0x55f70000)]
0x01a7ec00 JavaThread "CompilerThread0" daemon [_thread_blocked, id=3060, stack(0x55ed0000,0x55f20000)]
0x01a7dc00 JavaThread "Attach Listener" daemon [_thread_blocked, id=6620, stack(0x55e80000,0x55ed0000)]
0x01a7ac00 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=6308, stack(0x55e30000,0x55e80000)]
0x01a4f000 JavaThread "Finalizer" daemon [_thread_blocked, id=7464, stack(0x55de0000,0x55e30000)]
0x01a4a400 JavaThread "Reference Handler" daemon [_thread_blocked, id=7996, stack(0x55d90000,0x55de0000)]
=>0x01b9a000 JavaThread "main" [_thread_in_native, id=7020, stack(0x00260000,0x002b0000)]
Other Threads:
0x01a47800 VMThread [stack: 0x003b0000,0x00400000] [id=6328]
0x01aa3c00 WatcherThread [stack: 0x55f70000,0x55fc0000] [id=7052]
VM state:not at safepoint (normal execution)
VM Mutex/Monitor currently owned by a thread: None
Heap
def new generation total 314560K, used 145265K [0x03ba0000, 0x190f0000, 0x190f0000)
eden space 279616K, 45% used [0x03ba0000, 0x0b895cd8, 0x14cb0000)
from space 34944K, 49% used [0x16ed0000, 0x17fb6918, 0x190f0000)
to space 34944K, 0% used [0x14cb0000, 0x14cb0000, 0x16ed0000)
tenured generation total 699072K, used 86918K [0x190f0000, 0x43ba0000, 0x43ba0000)
the space 699072K, 12% used [0x190f0000, 0x1e5d1858, 0x1e5d1a00, 0x43ba0000)
compacting perm gen total 65024K, used 64937K [0x43ba0000, 0x47b20000, 0x53ba0000)
the space 65024K, 99% used [0x43ba0000, 0x47b0a6f0, 0x47b0a800, 0x47b20000)
No shared spaces configured.
Dynamic libraries:
0x00400000 - 0x00424000 C:\Program Files\Java\jdk1.6.0_21\bin\javaw.exe
0x77380000 - 0x774bc000 C:\Windows\SYSTEM32\ntdll.dll
0x76340000 - 0x76414000 C:\Windows\system32\kernel32.dll
0x756c0000 - 0x7570a000 C:\Windows\system32\KERNELBASE.dll
0x75b10000 - 0x75bb0000 C:\Windows\system32\ADVAPI32.dll
0x75dc0000 - 0x75e6c000 C:\Windows\system32\msvcrt.dll
0x75d50000 - 0x75d69000 C:\Windows\SYSTEM32\sechost.dll
0x772d0000 - 0x77371000 C:\Windows\system32\RPCRT4.dll
0x75c80000 - 0x75d49000 C:\Windows\system32\USER32.dll
0x761c0000 - 0x7620e000 C:\Windows\system32\GDI32.dll
0x76000000 - 0x7600a000 C:\Windows\system32\LPK.dll
0x75bb0000 - 0x75c4d000 C:\Windows\system32\USP10.dll
0x75c60000 - 0x75c7f000 C:\Windows\system32\IMM32.DLL
0x76210000 - 0x762dc000 C:\Windows\system32\MSCTF.dll
0x7c340000 - 0x7c396000 C:\Program Files\Java\jdk1.6.0_21\jre\bin\msvcr71.dll
0x6d8b0000 - 0x6db57000 C:\Program Files\Java\jdk1.6.0_21\jre\bin\client\jvm.dll
0x73bd0000 - 0x73c02000 C:\Windows\system32\WINMM.dll
0x75400000 - 0x7544b000 C:\Windows\system32\apphelp.dll
0x6d860000 - 0x6d86c000 C:\Program Files\Java\jdk1.6.0_21\jre\bin\verify.dll
0x6d3e0000 - 0x6d3ff000 C:\Program Files\Java\jdk1.6.0_21\jre\bin\java.dll
0x6d340000 - 0x6d348000 C:\Program Files\Java\jdk1.6.0_21\jre\bin\hpi.dll
0x76010000 - 0x76015000 C:\Windows\system32\PSAPI.DLL
0x6d8a0000 - 0x6d8af000 C:\Program Files\Java\jdk1.6.0_21\jre\bin\zip.dll
0x74f30000 - 0x74f46000 C:\Windows\system32\CRYPTSP.dll
0x74c70000 - 0x74cab000 C:\Windows\system32\rsaenh.dll
0x74e30000 - 0x74e47000 C:\Windows\system32\USERENV.dll
0x754d0000 - 0x754db000 C:\Windows\system32\profapi.dll
0x75450000 - 0x7545c000 C:\Windows\system32\CRYPTBASE.dll
0x6d6c0000 - 0x6d6d3000 C:\Program Files\Java\jdk1.6.0_21\jre\bin\net.dll
0x76630000 - 0x76665000 C:\Windows\system32\WS2_32.dll
0x76670000 - 0x76676000 C:\Windows\system32\NSI.dll
0x74ef0000 - 0x74f2c000 C:\Windows\system32\mswsock.dll
0x75040000 - 0x75046000 C:\Windows\System32\wship6.dll
0x732f0000 - 0x73300000 C:\Windows\system32\NLAapi.dll
0x74cb0000 - 0x74cf4000 C:\Windows\system32\DNSAPI.dll
0x71a20000 - 0x71a28000 C:\Windows\System32\winrnr.dll
0x71a10000 - 0x71a20000 C:\Windows\system32\napinsp.dll
0x719d0000 - 0x719e2000 C:\Windows\system32\pnrpnsp.dll
0x74900000 - 0x74905000 C:\Windows\System32\wshtcpip.dll
0x730f0000 - 0x7310c000 C:\Windows\system32\IPHLPAPI.DLL
0x730e0000 - 0x730e7000 C:\Windows\system32\WINNSI.DLL
0x71f60000 - 0x71f66000 C:\Windows\system32\rasadhlp.dll
0x72c10000 - 0x72c48000 C:\Windows\System32\fwpuclnt.dll
0x6d6e0000 - 0x6d6e9000 C:\Program Files\Java\jdk1.6.0_21\jre\bin\nio.dll
0x56620000 - 0x56672000 C:\bea\workshop_10.0\workshop4WP\eclipse\configuration\org.eclipse.osgi\bundles\249\1\.cp\swt-win32-3235.dll
0x76420000 - 0x7657c000 C:\Windows\system32\ole32.dll
0x74310000 - 0x744ae000 C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7600.16385_none_421189da2b7fabfc\COMCTL32.dll
0x77550000 - 0x775a7000 C:\Windows\system32\SHLWAPI.dll
0x765b0000 - 0x7662b000 C:\Windows\system32\comdlg32.dll
0x76680000 - 0x772c9000 C:\Windows\system32\SHELL32.dll
0x774c0000 - 0x7754f000 C:\Windows\system32\OLEAUT32.dll
0x75e70000 - 0x75f64000 C:\Windows\system32\WININET.dll
0x75c50000 - 0x75c53000 C:\Windows\system32\Normaliz.dll
0x757d0000 - 0x75905000 C:\Windows\system32\urlmon.dll
0x755a0000 - 0x756bc000 C:\Windows\system32\CRYPT32.dll
0x75540000 - 0x7554c000 C:\Windows\system32\MSASN1.dll
0x75910000 - 0x75b09000 C:\Windows\system32\iertutil.dll
0x63ae0000 - 0x63b01000 C:\Windows\system32\MSVFW32.dll
0x742d0000 - 0x74310000 C:\Windows\system32\uxtheme.dll
0x73ea0000 - 0x73eb3000 C:\Windows\system32\dwmapi.dll
0x562f0000 - 0x562f8000 C:\bea\workshop_10.0\workshop4WP\eclipse\configuration\org.eclipse.osgi\bundles\54\1\.cp\os\win32\x86\localfile_1_0_0.dll
0x725e0000 - 0x7261c000 C:\Windows\system32\oleacc.dll
0x566e0000 - 0x566f3000 C:\bea\workshop_10.0\workshop4WP\eclipse\configuration\org.eclipse.osgi\bundles\249\1\.cp\swt-gdip-win32-3235.dll
0x74140000 - 0x742d0000 C:\Windows\WinSxS\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.7600.16385_none_72fc7cbf861225ca\gdiplus.dll
0x754c0000 - 0x754ce000 C:\Windows\system32\RpcRtRemote.dll
0x75f70000 - 0x75ff3000 C:\Windows\system32\CLBCatQ.DLL
0x67740000 - 0x6776e000 C:\Windows\system32\mlang.dll
0x6d0b0000 - 0x6d1fa000 C:\Program Files\Java\jdk1.6.0_21\jre\bin\awt.dll
0x72640000 - 0x72691000 C:\Windows\system32\WINSPOOL.DRV
0x6d2e0000 - 0x6d334000 C:\Program Files\Java\jdk1.6.0_21\jre\bin\fontmanager.dll
0x68360000 - 0x68365000 C:\Windows\system32\msimg32.dll
0x72a90000 - 0x72a9d000 C:\Windows\system32\dhcpcsvc6.DLL
0x72a70000 - 0x72a82000 C:\Windows\system32\dhcpcsvc.DLL
0x5c530000 - 0x5cfae000 C:\Windows\System32\ieframe.dll
0x75460000 - 0x754bf000 C:\Windows\system32\SXS.DLL
0x753e0000 - 0x753fa000 C:\Windows\system32\SspiCli.dll
0x64340000 - 0x648f5000 C:\Windows\System32\mshtml.dll
0x6a3f0000 - 0x6a41a000 C:\Windows\System32\msls31.dll
0x749b0000 - 0x749b9000 C:\Windows\System32\VERSION.dll
0x74980000 - 0x749a1000 C:\Windows\system32\ntmarta.dll
0x75d70000 - 0x75db5000 C:\Windows\system32\WLDAP32.dll
0x64330000 - 0x6433b000 C:\Windows\system32\msimtf.dll
VM Arguments:
jvm_args: -Xms1024m -Xmx1024m -XX:MaxPermSize=256m -Dweblogic.home=C:/bea/wlserver_10.0 -Dosgi.install.area=C:\bea\tools\eclipse32\eclipse -Dosgi.instance.area.default=C:/bea/user_projects/w4WP_workspaces/Untitled -Dosgi.configuration.area=C:/bea/workshop_10.0/workshop4WP/eclipse/configuration -Declipse.product=com.bea.workshop.product.wl.workshop -Dosgi.splashPath=file:C:/bea/workshop_10.0/workshop4WP/eclipse/plugins/com.bea.workshop.product.wl_1.0.0 -DprodMode=preProduction
java_command: C:\bea\workshop_10.0\workshop4WP\startup.jar -os win32 -ws win32 -arch x86 -launcher C:\bea\workshop_10.0\workshop4WP\workshop4WP.exe -name Workshop4WP -showsplash 600 -exitdata 1ba4_64 -vm C:/bea/jrockit_150_11/bin/javaw.exe -vm C:\Program Files\Java\jdk1.6.0_21\bin\javaw.exe -vmargs -Xms1024m -Xmx1024m -XX:MaxPermSize=256m -Dweblogic.home=C:/bea/wlserver_10.0 -Dosgi.install.area=C:\bea\tools\eclipse32\eclipse -Dosgi.instance.area.default=C:/bea/user_projects/w4WP_workspaces/Untitled -Dosgi.configuration.area=C:/bea/workshop_10.0/workshop4WP/eclipse/configuration -Declipse.product=com.bea.workshop.product.wl.workshop -Dosgi.splashPath=file:C:/bea/workshop_10.0/workshop4WP/eclipse/plugins/com.bea.workshop.product.wl_1.0.0 -DprodMode=preProduction -jar C:\bea\workshop_10.0\workshop4WP\startup.jar
Launcher Type: SUN_STANDARD
Environment Variables:
JAVA_HOME=C:\bea\jrockit_150_11
CLASSPATH=.;C:\bea\modules\org.apache.ant_1.6.5\lib;C:\src\bea\workspaces\AlibrisDev;C:\src\bea\workspaces\AlibrisDev\AlibrisEar\EarContent\APP-INF\lib
PATH=C:\Program Files\Java\jdk1.6.0_21\bin;C:\software\apache-ant-1.8.1\bin;C:\oracle\product\11.2.0\client_1\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;c:\Program Files\Intel\WiFi\bin\;c:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files\NTRU Cryptosystems\NTRU TCG Software Stack\bin\;C:\Program Files\Wave Systems Corp\Gemalto\Access Client\v5\;C:\Program Files\Common Files\Roxio Shared\DLLShared\;C:\Program Files\Common Files\Roxio Shared\10.0\DLLShared\;C:\Program Files\SecureCRT\;C:\Program Files\Microsoft SQL Server\80\Tools\Binn\;C:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\Program Files\Microsoft SQL Server\90\DTS\Binn\;C:\Program Files\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies\;C:\bea\jrockit_150_11\bin;C:\bea\modules\org.apache.ant_1.6.5\bin;C:\Program Files\jZip
USERNAME=afamo
OS=Windows_NT
PROCESSOR_IDENTIFIER=x86 Family 6 Model 23 Stepping 10, GenuineIntel
--------------- S Y S T E M ---------------
OS: Windows 7 Build 7600
CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 23 stepping 10, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1
Memory: 4k page, physical 3099820k(957232k free), swap 6197876k(1597716k free)
vm_info: Java HotSpot(TM) Client VM (17.0-b16) for windows-x86 JRE (1.6.0_21-b06), built on Jun 22 2010 00:56:49 by "java_re" with MS VC++ 7.1 (VS2003)
time: Mon Aug 23 09:48:31 2010
elapsed time: 234282 seconds
Thanks! -
What will be the output of the following code? Can I get some detail explanation?
class A{
void show(){
System.out.println("A");
interface my{
public void show();
class B extends A{
B(my m){
m.show();
public void show(){
System.out.println("B");
public class test implements my{
public void show(){
System.out.println("test");
public static void main(String args[]){
test t=new test();
B b=new B(t);
b.show();
}ThanksWhat will be the output of the following code? Can I
get some detail explanation?Well, I guess you were not able to figure out HOW you got that output. Should have been a li'l more clear in your question. Never mind now... here is my understanding of the code.
1) The program starts at main()
2) creates an object for test called t (does nothing more than this since it does not have a constructor defined by you!!)
3)creates an object for B whose constructor takes an object argument of type my. you send t becuase test implements my.
4)calls the show method of m in the constructor.
5)now, where is the definition of show() for m? Its in test. So now, that show() is executed and hence "test" is printed first.
6)all done, it comes back to the main() to go to the next statement.
7)calls the show() of b.
8)this version of show asks to print "B" and hence the output.
Was this detailed explanation enough? I hope so... ;-) -
class ThreadA {
public static void main(String [] args) {
ThreadB b = new ThreadB();
b.start();
synchronized(b) {
try {
System.out.println("Waiting for b to complete...");
b.wait();
} catch (InterruptedException e) {}
System.out.println("Total is: " + b.total);
class ThreadB extends Thread {
int total;
public void run() {
synchronized(this) {
for(int i=0;i<100;i++) {
total += i;
notify();
}can anyone please explain me the code flow of this particular program n how does wait n notify work inb this..im a bit confused.thankx in adv.sowme wrote:
kajbj wrote:
sowme wrote:
its just an example to illustrate the use of wait and notify and i think i havent mentioned any word saying this code is a good one or safe to use ..but i would like to know why it is bad and unsafe.Total needs to be volatile. The main thread can otherwise print the wrong value. There's also a possibility that the program never terminates, and that can happen if thread B gets the lock before the main thread gets the lock. (That is, notify is called before the main thread has invoked wait).
but when will this happen that is thread B gets the lock before the main thred gets the lock?i dint understand can u please explain.The threads are sharing the cpu time, and thread B can start executing after the call to b.start(). Nothing says that the main thread will reach the syncrhonized block before thread b does.
Kaj -
Why the result of the code below comes out to be -" main initializer"
class A
System.out.println("intializer");
public sstatic void main(String [] args)
System.out.println("main");
A ob= new A();
}vin-gayatri wrote:
what is the difference between constructor and instance innitializer then???A constructor can take arguments. An instance initializer cannot. All instance initializers are always called for every new instance created, in the order they appear in the source code, before the body of any constructor is executed. You specify exactly one constructor to execute, and any constructor may or may not explicitly invoke one other constructor. -
DECLARE @FIRSTDATE date = '2014-07-06'.
I need to add time to this without initializing it on the first place. SO basically it should look like '2014-07-06 23:00:00'. As far as i know it can be done using something like dateadd().DECLARE @FIRSTDATE date = '2014-07-06'.
I need to add time to this without initializing it on the first place. SO basically it should look like '2014-07-06 23:00:00'. As far as i know it can be done using something like dateadd().
Assume you want to add minutes also: concatenate string date & time first, then convert to datetime.
DECLARE @FIRSTDATE char(10) = '2014-07-06', @FIRSTTIME char(8) = '23:40:20';
-- Combined date & time
SELECT [DateTime]=CONVERT(datetime, CONCAT(@FIRSTDATE, SPACE(1), @FIRSTTIME), 120);
GO
-- 2014-07-06 23:40:20.000
Datetime/string conversion:
http://www.sqlusa.com/bestpractices/datetimeconversion/
Kalman Toth Database & OLAP Architect
SQL Server 2014 Design & Programming
New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012 -
Can anybody tell me what is the problem in the code below?
package first;
class A {
A a;
A(){}
A(A aa){
this.a=aa;
String name;
void setname(String a){
this.name=a;
void bar(){
dostuff(a);
void dostuff(A a1){
a.setname("vahvah");
//a1=new A();
public static void main(String args[]){
A a2=new A();
A a1=new A(a2);
a2.bar();
System.out.println("name= "+a2.name);
}class A {
A a;
String name;
A(){}
A(A a){
this.a=a;
void setname(String a){
this.name=a;
static void dostuff(A a1){
a1.setname("vahvah");
//a1=new A();
String getName()
return name;
public static void main(String args[]){
A a2=new A();
A a1=new A(a2);
dostuff(a1);
System.out.println("name= " + a1.getName());
System.out.println("name= " + a2.getName());
dostuff(a2);
System.out.println("name= " + a1.getName());
System.out.println("name= " + a2.getName());
} -
I get an error ORA-00900 when I run the code below.please assist
CREATE OR REPLACE PROCEDURE ib_DistributeCashonInv IS
v_cust varchar(8);
v_ref varchar(10);
v_custcode varchar(8);
v_item_no varchar(10);
v_item_ref varchar(10);
v_item_date date;
v_doc_amnt float;
v_unall_amnt float;
CURSOR c_cust IS
SELECT d.customer, d.refernce
FROM tbl_distribute d;
-- WHERE d.status ='D' ---Items marked for distribution
--ORDER BY d.customer,d.refernce;
CURSOR c_cash IS
SELECT s.customer,s.item_no,s.refernce,s.dated,s.amount,s.unall_amount
FROM slitemm s
WHERE s.customer = v_cust
AND s.refernce = v_ref;
BEGIN
OPEN cursor c_cust;
LOOP
FETCH c_cust INTO v_cust, v_ref;
exit when c_cust%NOTFOUND;
OPEN c_cash;
LOOP
FETCH c_cash INTO
v_custcode,v_item_no,v_item_ref,v_item_date,v_doc_amnt,v_unall_amnt;
exit when c_cash%NOTFOUND;
DECLARE v_total_allocated FLOAT :=0.00 ;
BEGIN
SELECT x.customer,x.batch_item_no,x.transaction_item,x.allocated_amount,x.second_ref,x.item_type
FROM slxrefm x
WHERE x.customer = v_cust
AND x.second_ref = v_ref;
IF SQL%FOUND THEN
BEGIN
SELECT sum(allocated_amount)
INTO v_total_allocated
FROM slxrefm
WHERE customer = v_cust
AND second_ref = v_ref
GROUP BY customer, second_ref;
UPDATE slitemm
SET unall_amount = v_total_allocated,open_indicator ='O'
WHERE customer = v_cust
AND refernce = v_ref;
COMMIT;
END
ELSIF SQL%NOTFOUND THEN
EXIT
END IF
END
END LOOP;
CLOSE c_cash;
END LOOP
CLOSE c_cust;
EXCEPTION
WHEN OTHERS THEN
raise_application_error(-20001,'An error was encountered - '||SQLCODE||' -ERROR- '||SQLERRM);
END ib_DistributeCashonInv;looks like you have a bunch of syntax errors.
also you have a commit inside of a loop
/* Formatted on 11/23/2011 2:27:59 PM (QP5 v5.149.1003.31008) */
CREATE OR REPLACE PROCEDURE ib_DistributeCashonInv
IS
v_cust VARCHAR (8);
v_ref VARCHAR (10);
v_custcode VARCHAR (8);
v_item_no VARCHAR (10);
v_item_ref VARCHAR (10);
v_item_date DATE;
v_doc_amnt FLOAT;
v_unall_amnt FLOAT;
CURSOR c_cust
IS
SELECT d.customer, d.refernce
FROM tbl_distribute d;
-- WHERE d.status ='D' ---Items marked for distribution
--ORDER BY d.customer,d.refernce;
CURSOR c_cash
IS
SELECT s.customer,
s.item_no,
s.refernce,
s.dated,
s.amount,
s.unall_amount
FROM slitemm s
WHERE s.customer = v_cust AND s.refernce = v_ref;
BEGIN
OPEN c_cust;
LOOP
FETCH c_cust
INTO v_cust, v_ref;
EXIT WHEN c_cust%NOTFOUND;
OPEN c_cash;
LOOP
FETCH c_cash
INTO v_custcode,
v_item_no,
v_item_ref,
v_item_date,
v_doc_amnt,
v_unall_amnt;
EXIT WHEN c_cash%NOTFOUND;
DECLARE
v_total_allocated FLOAT := 0.00;
BEGIN
SELECT x.customer,
x.batch_item_no,
x.transaction_item,
x.allocated_amount,
x.second_ref,
x.item_type
FROM slxrefm x
WHERE x.customer = v_cust AND x.second_ref = v_ref;
IF SQL%FOUND
THEN
BEGIN
SELECT SUM (allocated_amount)
INTO v_total_allocated
FROM slxrefm
WHERE customer = v_cust AND second_ref = v_ref
GROUP BY customer, second_ref;
UPDATE slitemm
SET unall_amount = v_total_allocated,
open_indicator = 'O'
WHERE customer = v_cust AND refernce = v_ref;
-- COMMIT;
END;
ELSIF SQL%NOTFOUND
THEN
EXIT;
END IF;
END;
END LOOP;
CLOSE c_cash;
END LOOP;
CLOSE c_cust;
COMMIT;
EXCEPTION
WHEN OTHERS
THEN
raise_application_error (
-20001,
'An error was encountered - ' || SQLCODE || ' -ERROR- ' || SQLERRM);
END ib_DistributeCashonInv; -
Could anyone tell me whats the code means??
Hi,
Could anyone tell me explanation of the code below:
player1.placeArmy(world.southAmerica().territory1());
all I know is that it is calling the method of an objects. I am not really sure about whats inside the bracket. How could such argument have the dot notation format?
Furthermore, could anyone have some advices about references to the multiple classes code example??player1.placeArmy(world.southAmerica().territory1());player1 is a variable of some type. This type has presumably a method called placeArmy, which takes a parameter.
world is another variable of some type. This type has presumably a method called a method southAmerica(),
which returns a value of a type, which has a method territory1(), whose return value is provided as teh paramtere value to the method call mentioned above.
Another useful example as a food for thoughts could be:
Object o = new Integer(3);
System.out.println(o.toString()); -
How do you encode getmessage calls in the following code below?
Im trying to HTML/JavaScript ecode the getmessage calls in the code listed below. Can someone explain how to properly do this? The code below is a snippit from a program which is used to handle a failed authentication attempt. Thanks in advance for your help.
if(logger.isDebugEnabled())
logger.debug("Authentication Failure: " + exception.getMessage());
response.sendError(HttpServletResponse.SC_FORBIDDEN, "Authentication Failed: " + exception.getMessage());Do you want to format your message with HTML so you can show it in a error web page?
-
Report Problem need to fix the code
Hello Expert
I am new to apex, I was given a task to interpret the code and fix the problem.
This Apex application has a list of value where the user select the institution as a drop down list menu. After selecting the institution the main report below the drop down list will be populated based on the selection. The problem is that when the user insert record for standalone program, this insert don't appear on the report when the user select the instituion.
can someone look at the code below and explain to me line by line what it does and how can I twick it to solve this problem? I am cloue less and I need expert help
select dt.*
,case when dt.delivery_location is null then null
else htf.anchor ('javascript:void(0);'
,'<img src=#APP_IMAGES#location.png
title=''' ||dt.delivery_location || '''
alt=''' ||dt.delivery_location || '''
height=24 width=24/>'
end dl_hover
from (
select
CASE WHEN INDEP_DEGREE = 'Y' THEN
CASE WHEN Dt.DEGREE_ACRONYM IN ('AACC','ASCC') then
da.DESCRIPTION || ' with an Emphasis Area of ' ||
NVL(Mt.DESCRIPTION,cC.DESCRIPTION)
ELSE
nvl(dt.description, da.DESCRIPTION)
END
ELSE
CASE WHEN Dt.DEGREE_LEVEL IN ('V','A') THEN
nvl(dt.description, da.DESCRIPTION ) || ' with an Option in ' ||
NVL(Mt.DESCRIPTION,Cc.DESCRIPTION)
WHEN Dt.DEGREE_LEVEL IN ('E','C','Z','F') THEN
nvl(dt.description, da.DESCRIPTION ) || ' in ' ||
NVL(Mt.DESCRIPTION,Cc.DESCRIPTION)
ELSE
nvl(dt.description, da.DESCRIPTION ) || ' with a Major in ' ||
NVL(Mt.DESCRIPTION,Cc.DESCRIPTION)
END
END
degree_name
--,'???' emphasis_area
,nvl(mt.cip_code,dt.cip_code) cip_code
,nvl(mt.hours, dt.hours) total_credit_hours
-- ,dt.deactivated status
,case when nvl(mt.deactivated,dt.deactivated) = 'A' then 'Active'
when nvl(mt.deactivated,dt.deactivated) = 'D' then 'Deactivated'
when nvl(mt.deactivated,dt.deactivated) = 'T' then 'Terminated'
WHEN NVL(mt.deactivated,dt.deactivated) = 'I'
THEN 'Inactive'
else null
end status
--,dt.degree_level program_type
,dl.description program_type
,dt.coop_indicator coop_indicator
,nvl(mt.approval_date,dt.approval_date) approval_date
,nvl(mt.implemented,dt.implemented) implemented
,nvl(mt.implementation_date, dt.implementation_date) implementation_date
,nvl(mt.delivery_mode ,dt.delivery_mode) delivery_mode
,(select rtrim(replace(replace(xmlagg(xmlelement("C" ,c.cixxvext_name)).getclobval() ,'<C>' ,'') ,'</C>' ,'
 ') ,'
 ') C
from degree_transaction_details dtd
,cixxvext c
where (dtd.degree_transaction_id = case when INDEP_DEGREE= 'Y' then dt.degree_id else mt.major_id end )
and c.cixxvext_ext_site_cd = dtd.detail_value
and dtd.record_type= case when INDEP_DEGREE = 'Y' then 'DEGREE' else 'MAJOR' end ) delivery_location
,dt.degree_id degree_id
,'Comparison Report' comparison_report
,apex_util.prepare_url ('f?p=&APP_ID.:2:&SESSION.::&DEBUG.:2:P2_FICE_CODE,P2_DEGREE_ID:&P1_FICE_CODE.,'||dt.degree_id) edit_link
,apex_util.prepare_url ('f?p=&APP_ID.:4:&SESSION.::&DEBUG.:RP,4:P4_DEGREE_ID:'||dt.degree_id) cr_link
,dt.description
,mt.major_id major_id
,nvl(mt.online_percentage,dt.online_percentage) online_percent
,nvl(mt.last_inst_review,dt.last_inst_review) last_inst_review
from degree_transactions dt,
degree_acronyms da,
major_transactions mt,
degree_levels dl,
cip_codes cc
where dt.degree_id = mt.degree_id
and mt.cip_code = cc.cip_code
and dl.degree_level = nvl(mt.degree_level,dt.degree_level)
and dt.degree_acronym = da.degree_acronym
and dt.Fice_code = da.fice_code
and dt.degree_level = da.degree_level
and dt.deactivated in ('A','D')
and mt.deactivated in ('A','D')
and dt.fice_code = :P1_FICE_CODE
and dt.show_inst = 'Y'
) dt
order by dt.description nulls firstYou said:
"I was able to debug the code in SQL Developer." Does this mean that you:
ran the code, got results
then set indep_degree to 'Y' on a row in your database
ran the code again and saw the results you are looking for?
If true, your code is working and should operate the same in APEX.
So if your code is working, we need to understand what processes are running on the form and when they are firing.
Jeff -
Hi,
I am trying to run a long running process, by redirecting to the LongRunningView using the code below. But its throwing exception Can anyone please help
string strCurrentUrl = SPUtility.OriginalServerRelativeRequestPath;
strCurrentUrl = strCurrentUrl + "?ListName=" + strListName;
////Initiates the Excel Import
if (ObjdtExcel != null && ObjdtExcel.Rows.Count > 0)
ExcelImportJob objJob = new ExcelImportJob(strTabName, ObjdtExcel, strFileExt, SPContext.Current.Site.ID, SPContext.Current.Web.ID, strWorkflow, strListName);
objJob.Title = "Excel Import Job";
//// Redirect the user to another page when finished.
objJob.RedirectWhenFinished = false;
//// Specify if the user can cancel this.
objJob.UserCanCancel = false;
//// Specify the refresh rate of the job, here, the page polls every 5 seconds for completion.
objJob.MillisecondsToWaitForFinish = 15000;
//// Finally, start the job on a web.
objJob.Start(SPContext.Current.Web);
string strUrl = string.Format("{0}?JobId={1}&Source={2}", PROGRESS_PAGE_URL, objJob.JobId, strCurrentUrl);
SPUtility.Redirect(strUrl, SPRedirectFlags.Default, HttpContext.Current);
The exception being "Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack."
Arjun Menon U.KHi Arjun,
Any update?
Best regards,
Patrick
Patrick Liang
TechNet Community Support
Maybe you are looking for
-
bill
-
Activity Journal mapping in BAPI_ACTIVITYCRM_CHANGEMULTI
Hi All, I am trying to map the Activity Journal tab in the activity using the bapi BAPI_ACTIVITYCRM_CHANGEMULTI and the parmeter journal .But i could find only very less feilds in this structure. It will be great if some one could through some light
-
Для CS6 , дизайнеру одежды: 1) Как мне размножить (клонировать) фигуру-эскиз на одном холсте(например,чтоб было не 1 ,а 6 штук одинаковых и больше) и 2) как закрашивать одежду на этих клонированных эскизах,кот. на одном холсте,в разные цвета??
-
Do I need to use Key Chain if I upgrade to Maverick?
After upgrading to Maverick, I had serious issues with Key Chain recently and had to completely wipe clean my iMAC - is it necessary to add this if I upgrade or am I better off just staying with Mountain Lion?
-
No MIC mute option available.
Just installed the X-FI Xtreme Audio PCI-E board and started using my mic and the sound comes out through the speakers. Normally when doing this you're supposed to go into playback control and mute the mic but it's not listed there. If I go to option