LV 8 PDA doesn't compile with enums
Dear LV PDA users,
when compiling a VI that uses enum constants wired with a case input
the compiler crashes. Replacing the enum with a numeric constant
leads to a successfull compile any ideas why?
With kind regards
Martin Kunze
KDI Digital Instrumentation.com
e-mail: [email protected]
Tel: +49 (0)441 9490852
Hi TheProf,
Why not try and make your cluster simple(not complex).Maybe that is the problem...we had some issues with PDA module.
Have you tried to upgrade from 8.0 to 8.0.1 PDA module?? The latter took care of some bugs.
Hope you find this helpfull,Good luck.
Ohiofudu
CLAD
Certified LabVIEW Architect
Certified TestStand Developer
Similar Messages
-
Other Components Drawing Dashed Lines doesn't compile with Flex 4
The lib was created in 2006 so it doesn't compile with Flex 4.
The lib can be downloaded here http://www.quietlyscheming.com/blog/charts/dashed-lines/
When compiling I get this error:
Description Resource Path Location Type
1136: Incorrect number of arguments. Expected 3. GraphicsUtils.as /arrows/src/qs/utils line 66 Flex Problem
The line which doesn't compile:
stroke.apply(target);
How do I fix this error?I managed to compile the lib by rewriting the line:
stroke.apply(target, new Rectangle(), new Point());
But I don't understand what I have done.
All Rectangle and Point dimensions are 0, but I'm sure it shouldn't be this way. -
LV 8 PDA doesn't compile any more
Dear LV 8 PDA users,
I have a VI with some sub VIs containing some clusters with arrays
and array lusters.
Until last saturday everything works fine. Today I have tried to add some
more code and now it takes more than a quater of an hour and LV does
several million file accesses (seen with filemon) and after all it does nerly
nothing and the taskmanager shows 100% load and the processs causing
this load is the CLARM.EXE or with other words the ARM C-compiler.
The Project isn't realy big it seams that there is a Problems with complex
clusters.
Any ideas?
With kind regards
Martin Kunze
KDI Digital Instrumentation.com
e-mail: [email protected]
Tel: +49 (0)441 9490852Hi TheProf,
Why not try and make your cluster simple(not complex).Maybe that is the problem...we had some issues with PDA module.
Have you tried to upgrade from 8.0 to 8.0.1 PDA module?? The latter took care of some bugs.
Hope you find this helpfull,Good luck.
Ohiofudu
CLAD
Certified LabVIEW Architect
Certified TestStand Developer -
[SOLVED] dwm doesn't compile with moveresize function
I'am trying to compile dwm with moveresize function but I get this error:
dwm build options:
CFLAGS = -std=c99 -pedantic -Wall -Os -I. -I/usr/include -I/usr/include/X11 -DVERSION="5.7.2" -DXINERAMA
LDFLAGS = -s -L/usr/lib -lc -L/usr/lib/X11 -lX11 -L/usr/lib/X11 -lXinerama
CC = cc
CC dwm.c
In file included from dwm.c:254:0:
config.h: In function 'moveresize':
config.h:23:7: error: dereferencing pointer to incomplete type
config.h:23:34: error: dereferencing pointer to incomplete type
config.h:26:9: error: dereferencing pointer to incomplete type
config.h:26:17: error: dereferencing pointer to incomplete type
config.h:27:6: error: dereferencing pointer to incomplete type
config.h:28:6: error: dereferencing pointer to incomplete type
config.h:29:6: error: dereferencing pointer to incomplete type
make: *** [dwm.o] Error 1
Here's my config.h
/* See LICENSE file for copyright and license details. */
/* appearance */
static const char font[] = "-*-terminus-*-*-*-*-12-*-*-*-*-*-*-*";
static const char normbordercolor[] = "#454545";
static const char normbgcolor[] = "#454545";
static const char normfgcolor[] = "#C0C0C0";
static const char selbordercolor[] = "#C0C0C0";
static const char selbgcolor[] = "#454545";
static const char selfgcolor[] = "#FFFFFF";
static const unsigned int borderpx = 1; /* border pixel of windows */
static const unsigned int snap = 32; /* snap pixel */
static const Bool showbar = True; /* False means no bar */
static const Bool topbar = True; /* False means bottom bar */
/* moveresize */
static void moveresize(const Arg *arg) {
XEvent ev;
Monitor *m = selmon;
if(!(m->sel && arg && arg->v && m->sel->isfloating))
return;
resize(m->sel, m->sel->x + ((int *)arg->v)[0],
m->sel->y + ((int *)arg->v)[1],
m->sel->w + ((int *)arg->v)[2],
m->sel->h + ((int *)arg->v)[3],
True);
while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
/* tagging */
static const char *tags[] = { "term", "web", "fm", "im", "media", "float" };
static const Rule rules[] = {
/* class instance title tags mask isfloating monitor */
{ "Gimp", NULL, NULL, 1 << 5, True, -1 },
{ "Chromium", NULL, NULL, 1 << 1, True, -1 },
{ "MPlayer", NULL, NULL, 0, True, -1 },
{ "Wine", NULL, NULL, 1 << 5, True, -1 },
{ "Gpicview", NULL, NULL, 0, True, -1 },
{ "Pcmanfm", NULL, NULL, 1 << 2, True, -1 },
{ "Xarchiver", NULL, NULL, 0, True, -1 },
{ "Amsn", NULL, NULL, 1 << 3, True, -1 },
/* layout(s) */
static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */
static const Bool resizehints = False; /* True means respect size hints in tiled resizals */
static const Layout layouts[] = {
/* symbol arrange function */
{ "[]=", tile }, /* first entry is default */
{ "><>", NULL }, /* no layout function means floating behavior */
{ "[M]", monocle },
/* key definitions */
#define MODKEY Mod4Mask
#define TAGKEYS(KEY,TAG) \
{ MODKEY, KEY, view, {.ui = 1 << TAG} }, \
{ MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
{ MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
{ MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
/* helper for spawning shell commands in the pre dwm-5.0 fashion */
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
/* commands */
static const char *dmenucmd[] = { "dmenu_run", "-fn", font, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, NULL };
static const char *tdmenucmd[] = { "tdmenu_run", "-fn", font, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, NULL };
static const char *termcmd[] = { "roxterm", NULL };
static const char *mutecmd[] = { "amixer", "-q", "sset", "Master", "toggle", NULL };
static const char *volupcmd[] = { "amixer", "-q", "sset", "Master", "5-", "unmute", NULL };
static const char *voldowncmd[] = { "amixer", "-q", "sset", "Master", "5+", "unmute", NULL };
static const char *bgltupcmd[] = { "xbacklight", "-inc", "15", NULL };
static const char *bgltdowncmd[] = { "xbacklight", "-dec", "1", NULL };
static const char *displayoff[] = { "xset", "dpms", "force", "off", NULL };
static const char *suspend[] = { "sudo", "pm-suspend", NULL };
static Key keys[] = {
/* modifier key function argument */
{ 0, 0x1008ff12, spawn, {.v = mutecmd } },
{ 0, 0x1008ff11, spawn, {.v = volupcmd } },
{ 0, 0x1008ff13, spawn, {.v = voldowncmd } },
{ 0, 0x1008ff02, spawn, {.v = bgltupcmd } },
{ 0, 0x1008ff03, spawn, {.v = bgltdowncmd } },
{ 0, 0x1008ff59, spawn, {.v = displayoff } },
{ 0, 0x1008ff2f, spawn, {.v = suspend } },
{ MODKEY, XK_p, spawn, {.v = dmenucmd } },
{ MODKEY, XK_r, spawn, {.v = tdmenucmd } },
{ MODKEY, XK_Return, spawn, {.v = termcmd } },
{ MODKEY, XK_b, togglebar, {0} },
{ MODKEY, XK_j, focusstack, {.i = +1 } },
{ MODKEY, XK_k, focusstack, {.i = -1 } },
{ MODKEY, XK_h, setmfact, {.f = -0.05} },
{ MODKEY, XK_l, setmfact, {.f = +0.05} },
{ MODKEY|ShiftMask, XK_Return, zoom, {0} },
{ MODKEY, XK_Tab, view, {0} },
{ MODKEY, XK_c, killclient, {0} },
{ MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
{ MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
{ MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
{ MODKEY, XK_space, setlayout, {0} },
{ MODKEY|ShiftMask, XK_space, togglefloating, {0} },
{ MODKEY, XK_0, view, {.ui = ~0 } },
{ MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
{ MODKEY, XK_comma, focusmon, {.i = -1 } },
{ MODKEY, XK_period, focusmon, {.i = +1 } },
{ MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
{ MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
{ MODKEY|ShiftMask, XK_q, quit, {0} },
{ MODKEY, XK_Down, moveresize, {.v = (int []){ 0, 25, 0, 0 }}},
{ MODKEY, XK_Up, moveresize, {.v = (int []){ 0, -25, 0, 0 }}},
{ MODKEY, XK_Right, moveresize, {.v = (int []){ 25, 0, 0, 0 }}},
{ MODKEY, XK_Left, moveresize, {.v = (int []){ -25, 0, 0, 0 }}},
{ MODKEY|ShiftMask, XK_Down, moveresize, {.v = (int []){ 0, 0, 0, 25 }}},
{ MODKEY|ShiftMask, XK_Up, moveresize, {.v = (int []){ 0, 0, 0, -25 }}},
{ MODKEY|ShiftMask, XK_Right, moveresize, {.v = (int []){ 0, 0, 25, 0 }}},
{ MODKEY|ShiftMask, XK_Left, moveresize, {.v = (int []){ 0, 0, -25, 0 }}},
TAGKEYS( XK_1, 0)
TAGKEYS( XK_2, 1)
TAGKEYS( XK_3, 2)
TAGKEYS( XK_4, 3)
TAGKEYS( XK_5, 4)
TAGKEYS( XK_6, 5)
TAGKEYS( XK_7, 6)
TAGKEYS( XK_8, 7)
TAGKEYS( XK_9, 8)
/* button definitions */
/* click can be ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
static Button buttons[] = {
/* click event mask button function argument */
{ ClkLtSymbol, 0, Button1, setlayout, {0} },
{ ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
{ ClkWinTitle, 0, Button2, zoom, {0} },
{ ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
{ ClkClientWin, MODKEY, Button1, movemouse, {0} },
{ ClkClientWin, MODKEY, Button2, togglefloating, {0} },
{ ClkClientWin, MODKEY|ShiftMask, Button1, resizemouse, {0} },
{ ClkTagBar, 0, Button1, view, {0} },
{ ClkTagBar, 0, Button3, toggleview, {0} },
{ ClkTagBar, MODKEY, Button1, tag, {0} },
{ ClkTagBar, MODKEY, Button3, toggletag, {0} },
Last edited by Aakko (2010-05-30 18:21:30)ber_t wrote:A vanilla dwm compiles fine with your config.h. So I guess you're using other patches that rearrange the #include directive for config.h in dwm.c, e.g. pertag. If that's the case, you have to put the moveresize function in dwm.c and declare it before config.h get's included, just like any other function in dwm.c.
Yes I had dwm.c patched with pertag. Vanilla compiles fine. Thanks! -
Hi,
I created a WebService like this:
//MiaClasse.java
@WebService
public class MiaClasse {
public MiaClasse(){}
@WebMethod
public void mioMetodo(MioEnum mioEnum){
//MioEnum.java
public enum MioEnum {
CIAO, HELLO, HI;
and deployed it in Tomcat
I ran:
WSIMPORT -keep http://localhost:8080/axis2/services/MiaClasseService.MiaClassePort?wsdl
if I run client :
//Client.java
public static void main(String []args){
MiaClasseService serv=new MiaClasseService();
MiaClasse mclass=serv.getMiaClassePort();
mclass.mioMetodo(MioEnum.CIAO);
It throws :
javax.xml.ws.soap.SOAPFaultException: java.lang.NoSuchMethodException: MioEnum.fromValue(java.lang.String)
at com.sun.xml.internal.ws.encoding.soap.ClientEncoderDecoder.toMessageInfo(Unknow n Source)
at com.sun.xml.internal.ws.encoding.soap.client.SOAPXMLDecoder.toMessageInfo(Unkno wn Source)
at com.sun.xml.internal.ws.protocol.soap.client.SOAPMessageDispatcher.receive(Unkn own Source)
at com.sun.xml.internal.ws.protocol.soap.client.SOAPMessageDispatcher.doSend(Unkno wn Source)
at com.sun.xml.internal.ws.protocol.soap.client.SOAPMessageDispatcher.send(Unknown Source)
at com.sun.xml.internal.ws.encoding.soap.internal.DelegateBase.send(Unknown Source)
at com.sun.xml.internal.ws.client.EndpointIFInvocationHandler.implementSEIMethod(U nknown Source)
at com.sun.xml.internal.ws.client.EndpointIFInvocationHandler.invoke(Unknown Source)
at $Proxy17.createStorePermission(Unknown Source)
at clientWS.main(clientWS.java:27)
Can someone help me?Hi Sanjit,
I've tried this on multiple PCs and get the same problem everywhere.
See picture with IE11 and chrome.
Sincerely,
Davy -
Hi all,
today I tried to compile wine from source using the abs PKGBUILD. This fails in the late compiling process during making cdrom.o. I did not change anything. I just did 'makepkg' as a normal user in my private abs tree. This should not happen! Can anybody verify that?
I did this because I wanted to test a patch which should solve a problem in wine that I am experiencing. But I couldn't even compile the 'normal' source which I tried as a test before applying the patch...
http://bugs.winehq.org/show_bug.cgi?id=17269
HarveySnowman wrote:post the error message.
It compiles (for a loong time...) until this messages appear:
cdrom.c: In function »GetInquiryData«:
cdrom.c:2682: Error: »INQUIRY« not declarated (first use in this function)
cdrom.c:2682: Error: (each descriptor not declarated will be executed only once
cdrom.c:2682: Error: for each function in which it appears.)
make[2]: *** [cdrom.o] Error 1
make[2]: Leaving directory `/home/harvey/abs/wine/src/wine-1.1.32/dlls/ntdll'
make[1]: *** [ntdll] Error 2
make[1]: Leaving directory `/home/harvey/abs/wine/src/wine-1.1.32/dlls'
make: *** [dlls] Error 2
==> ERROR: Build failed.
I translated the error message from german so it may not be 100% correct.
@ngoonee
The makedepends are met as far as I can tell. BTW, for extra/wine there are even more dependencies than you mentioned. A PKGBUILD from the main repos should work without any changes as it is the same the developers are using for building the repo package.
And yes, I synchronized abs and reinstalled base-devel just to be sure everything is ok. The build machine is 32bit Arch. The testing repo is enabled and I did a pacman -Syu before compiling.
Harvey -
Compilation with packages is different in J2SE 1.4.1 ?
Hi there !
I've just installed J2SE 1.4.1_01 in my Win NT 4.0 computer.
Some of the files that belong to packages compiled just fine with JDK 1.2.2 but don't compile with J2SE 1.4.1_01.
The same is true when I try to compile Java2D in the demo\jfc directory.
In project NumberFormatTest I have the following classes:
=====================================================================
d:\MyPrograms\Java\NumberFormatTest\NumberFormatTestFrame.java
package NumberFormatTest;
import java.awt.*;
import java.awt.event.*;
import java.sql.*;
import java.text.*;
import java.util.*;
import tools.*;
public class NumberFormatTestFrame extends Frame
implements ActionListener, KeyListener, WindowListener
=====================================================================
d:\MyPrograms\Java\Tools\JCTextField.java
package tools;
import java.awt.*;
public class JCTextField extends TextField
=====================================================================
d:\MyPrograms\Java\Tools\JCDecimalTextField.java
package tools;
import java.text.*;
import java.util.*;
public class JCDecimalTextField extends JCTextField
d:\MyPrograms\Java>javac Tools\JCTextField.java
compiles OK
d:\MyPrograms\Java>javac Tools\JCDecimalTextField.java
does not compile successfully with the error,
Tools\JCDecimalTextField.java:67: cannot resolve symbol
symbol : class JCTextField
location: class tools.JCDecimalTextField
public class JCDecimalTextField extends JCTextField
pointing to the J in JCTextField
d:\MyPrograms\Java>javac NumberFormatTest\NumberFormatTestFrame.java
also doesn't compile with with "cannot resolve symbol" errors, when it tries to use JCDecimalTextField.
It seems to me that classes defined by me to extend another class defined by me (JCDecimalTextField) and inside a package (tools) aren't being found by javac.
However JCTextField is defined by me, extends TextField (from java.awt.*), is inside package tools and compiles OK.
This stuff didn't happen in JDK 1.2.2.
What the hell has changed with J2SE 1.4.1 ???
My PATH has C:\Program Files\jdk\bin (among other directories)
My CLASSPATH is
D:\MyPrograms\Java;C:\Program Files\jdk\lib\tools.jar;C:\Program Files\Java\j2re1.4.1_01\lib\rt.jar;.;
I strongly suspect that something has changed after JDK 1.2.2 in the way packages are handled by javac. I've tried searching in forums and other sun java documentation but couldn't find an answer to my problem.
Can anyone please help me ?
Any hint, suggestion or Internet site with appropriate documentation, would be highly appreciated as a means to end this 2 day nightmare.
Thanks in advance,
MGoncalvThis issue has already been solved.
J2SE 1.4.1 is case sensitive with regard to package directories.
My tools package files must in subdirectory tools (but not Tools).
This problem didn't happened with JDK 1.2.2
For more details please take a look at
Cannot resolve symbol
from Feb 10, 2003 11:46
by MGoncalv -
What's the deal with enums?
Hello,
I'm trying to familiarise myself with the new Java features that project Tiger (Java 1.5) will introduce. I come from a C++ programming background. I very briefly studied enums whilst I learned C++ and never used them in my programs, so I was, quite frankly, relieved when I learned that Java didn't support them.
But now it does.
I'm wondering, from a software design and engineering perspective, what benefit enums will add to the Java language and software engineering in general. I have read some pleas and arguments for enums. As I understand those arguments, proponents feel that minor ledgibility improvements to switch statements (which some OO programmers don't use on the basis that it weakens the object-orientedness through its goto-esque break statements) necessitate the addition of a whole other structure.
Out of curiosity, wouldn't it be more advantageous for Sun to put their efforts into supporting constant strings in switches in addition to primitive data types if people are so concerned with clarity?
I fail to understand what enums will do that constant string arrays or constant values cannot. I would like to think that Sun wouldn't add C++ features unless if there was a reason to do so, so I believe that there are good reasons to introduce this feature.
Please help clarify this confusion.
Thank you!Comments on the previous posting inline. Note: I'll go off on a few tangents, but try to always return to the issue of enums. The fact that I go off on tangents (related initially to an enum type example) should show that enums help eliminate numerous problems.
Fair enough, but wouldn't this accomplish the same thing in
a slightly wordier wayPretty much. But you still have the validation code in there yourself:
currentDirection = ( direction > 0 && direction < 5 ? direction : 0 );People can still accidentally enter an invalid value, and it won't get caught by the compiler. So, I could call set(Compass.WEST) and hope/expect that is equivalent to set(Direction.LEFT). This will only occur if both Compass.WEST and Direction.LEFT are the same int value. If they are not, then we are in trouble. Worse, still if Compass.WEST and Direction.RIGHT are the same value, the code will compile, and run without any illegal value flagging, but our traveller will go off in the wrong direction.
Error handling tangent: Given the implementation, the error handling is not performed in set, rather the illegal value is captured as a zero, which must be dealt with at a later time - say in a switch statement that calls get. This is not a good idea - it increases the "distance" between the error occuring (bad call to set) and the error being detected (if xInt != 0). The larger the distance, the harder debugging is. If you throw an exception in set the bug is immediately flagged. With enums, none of this should be necessary.
Implementation tangent: set, get and currentDirection are static. This is not a good idea - it only allows one direction. If you have multiple travellers, each would have a Direction object, but (sticking with constants) UP, etc. would still be static.
I keep the switch statement in my enum workaround, but I believe that
the second reply suggested that enum could altogether eliminate the
use for switch statements. How exactly would it do that?enum in its simplest form would not remove switch. However, using an extension of the type-safe enum idiom (i.e. the current Java approach to enums), you can embed direction specific logic in each of the "enum" members. If I understand the enum-spec correcly, this will also be possible with the Java 1.5 enum language facility.
So, for an example, sticking with the domain: Consider a class Location, with x and y elements, and a Direction. The non-OO, non-enum approach would be as follows:
class Location {
int x,y;
void move (final int direction) {
switch (direction) {
case UP:
--y;
break;
case DOWN:
++y;
break;
case LEFT;
--x;
break;
case RIGHT:
++x;
break;
default;
throw new RuntimeException("Invalid direction " + direction);
class Direction {
public static final int UP = 1;
public static final int DOWN = 2;
public static final int LEFT = 3;
public static final int RIGHT = 4;
}Note that I've deliberately been loose with my visibility. All logic is in Location, and Direction is dumb. If we go with a type safe-enum idiom, we get:
class Location {
int x,y;
void move (final Direction direction) {
if (direction == Direction.UP) {
--y;
} else if (direction == Direction.DOWN) {
++y;
} else if (direction == Direction.LEFT) {
--x;
} else if (direction == Direction.RIGHT) {
++x;
} else { // direction is null
throw new NullPointerException("null direction");
class Direction {
public static final Direction UP = new Direction();
public static final Direction DOWN = new Direction();
public static final Direction LEFT = new Direction();
public static final Direction RIGHT = new Direction();
private Direction () {} // the ctor is private to limit instances
}This code is a rewrite of the int approach, but is "type-safe". We've moved from switch to if as we can't switch on object references. Note: there is still error handling code, as you're not "null-safe" (I don't know what the Java 1.5 spec says about this)
Little else has changed - the responsibilities are still the same. We can address this by going OO, which removes the if (formerly a switch) statement, but does couple the classes.
class Location {
int x,y;
void move (final Direction direction) {
direction.move(this);
class Direction {
private final int xOffset, yOffset;
private Direction (final int xOffset, final int yOffset) {
this.xOffset = xOffset;
this.yOffset = yOffset;
public static final Direction UP = new Direction(0,1);
public static final Direction DOWN = new Direction(0,-1);
public static final Direction LEFT = new Direction(-1,0);
public static final Direction RIGHT = new Direction(1,0);
void move(final Location location) {
location.x += xOffset;
location.y += yOffset;
}This removes any conditional logic, embedding (constructor parameterised) logic within Direction. It also eliminates the "null-safe" check, as direction.move(this) will throw an NPE if a null is passed.
Also, I've read some things saying that enum reduces 'boilerplate'
code. What exactly does that and 'boilerplate' mean?The Direction class is an example of the type-safe enum approach currently used in Java. It has been enhanced with logic for movement. Even if I dropped this logic, there is still functionality worth adding to the Direction class - a toString method that returns one of "UP", "DOWN", etc (shown next); a way to serialize the object and retain reference equality - you have to write a readResolve method (not shown).
class Direction {
private final String name;
private Direction (final String name) {
this.name = name;
public static final Direction UP = new Direction("UP");
public static final Direction DOWN = new Direction("DOWN");
public static final Direction LEFT = new Direction("LEFT");
public static final Direction RIGHT = new Direction("RIGHT");
public String toString() {
return name;
}Once you've written this code for one type-safe enum, you've written them for them all. You copy-cut-paste, and rename the class/elements. All this code is predictable. It is "boiler plate". Now, if you gave me a compiler that generated all this code for me, when I present it with
enum Direction {UP, DOWN, LEFT, RIGHT}; then I've got something that reduces my boiler plate code to zip.... Enter the Java 1.5 compiler. -
Std::list::sort() doesn't work with custom class
The following example doesn't order a list the way I'd expect. Is this being done wrong? Sun Studio 12 (not update 1). Current patches as of Monday.
#include <list>
class CMyClass
public:
CMyClass(long a) : m_Sec(a) { }
bool operator<(const CMyClass* rhs)
return (m_Sec < rhs->m_Sec);
long m_Sec;
typedef std::list<CMyClass*> TLogList;
int
main(int argc, char* argv[])
TLogList logList;
CMyClass* name = new CMyClass(0x4A833E79);
logList.push_back(name);
name = new CMyClass(0x4A85E144);
logList.push_back(name);
name = new CMyClass(0x4A85E66F);
logList.push_back(name);
name = new CMyClass(0x4A85E66F);
logList.push_back(name);
name = new CMyClass(0x4A85B2C2);
logList.push_back(name);
name = new CMyClass(0x4A85D6EF);
logList.push_back(name);
name = new CMyClass(0x4A69F9AD);
logList.push_back(name);
name = new CMyClass(0x4A85DC92);
logList.push_back(name);
name = new CMyClass(0x4A817316);
logList.push_back(name);
name = new CMyClass(0x4A85DEEB);
logList.push_back(name);
name = new CMyClass(0x4A846329);
logList.push_back(name);
name = new CMyClass(0x4A85E39D);
logList.push_back(name);
name = new CMyClass(0x4A85D41D);
logList.push_back(name);
name = new CMyClass(0x4A89CC17);
logList.push_back(name);
name = new CMyClass(0x4A85DC19);
logList.push_back(name);
logList.sort();
TLogList::iterator logListIter = logList.begin();
TLogList::iterator logListEnd = logList.end();
for (; logListIter != logListEnd; ++logListIter)
CMyClass* name = *logListIter;
cout << hex << name->m_Sec << endl;
return 0;
which produces
4a833e79
4a85e144
4a85e66f
4a85e66f
4a85b2c2
4a85d6ef
4a69f9ad
4a85dc92
4a817316
4a85deeb
4a846329
4a85e39d
4a85d41d
4a89cc17
4a85dc19The program as you wrote it will sort the contents of the list. The list consists of the addresses of CMyClass objects, and after sorting, will contain those addresses in sorted order.
If you want to sort by the contents of the classes that are pointed to, you need to provide a comparison operator that compares the contents, and use the other form of the list::sort function that takes a comparison function as an argument. That is, add the function
bool comp(const CMyClass* l, const CMyClass* r)
return l->m_Sec < r->m_Sec;
}and change
logList.sort(); to
logList.sort(comp); This version of list::sort will not compile using the default libCstd, because it requires member templates in the library implementation. For more information about this limitation, refer to the C++ FAQ section on library compatibility.
[http://developers.sun.com/sunstudio/documentation/ss12u1/mr/READMEs/c++_faq.html#LibComp]
The revised code will compile with the optional STLport library, or with other 3rd-party libraries like Apache stdcxx. To use STLport, add the option -library=stlport4 to every CC command, compiling and linking. You cannot mix code compiled for the default libCstd with STLport code in the same program. -
Two parameters doesn't work with me !!!
at [ SET_VIEW_PROPERTY Built-in ] I execute all parameters without any problems except 2 parameters :-
First Parameter:-
DIRECTION
it's compiled okay , but at run time doesn't work at all.
Second Parameter:-
VIEWPORT HEIGHT, VIEWPORT WIDTH
at compiled with errors at design time .... i did:
SET_VIEW_PROPERTY('CANVAS9',Viewport Height, Viewport Width,0,0);
and
SET_VIEW_PROPERTY('CANVAS9',Viewport_Height, Viewport_Width,0,0);
but it insist to complied with errors ...... but the weird thing here is when i did that:
SET_VIEW_PROPERTY('CANVAS9',0,0);
it successfully complied but at run time give me:
FRM-41057: No such Property for Set_View_Property.
P.S: "CANVAS9" is Stacked Canvas , and I'm using DB 10gR2 , Developer Forms 32 Bit Version 10.1.2.0.2 (Production)
and Windows XP SP2 64-bitHi!
All forms properties are constants of type number.
So, if you set
a view property and make the mistake
to give 0 instead of the property, the form is compiled
successfully but at runtime there is no property 0.
Witch property you set with
set_view_property ( 'view_name', 0, 0 )h1. ?
You have forgot to tell forms which property you want to change
and the compiler does not check if there is a property with the value
0 at runtime. You just tell the name and the values. No property.
Regards -
Urgent Solution needed--Problem in JSP compilation with JDK 1.5 and JDK 1.6
Hi,
I m using JDK 1.5 and Tomcat 5.0 the problem is that after starting server when I m going to access my application at that time instead of displaying HomePage it directly display the blank page on screen.
After analyzing tomcat log I have found that there was a problem with JSP page compilation.
The exception logged in Tomcat Log is given below
An error occurred at line: 1 in the generated java file
The type Collection is not generic; it cannot be parameterized with arguments <? extends E>
Stacktrace:
* at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92)*
* at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)*
* at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:423)*
* at org.apache.jasper.compiler.Compiler.compile(Compiler.java:308)*
* at org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)*
* at org.apache.jasper.compiler.Compiler.compile(Compiler.java:273)*
* at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566)*
* at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)*
* at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)*
* at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)*
* at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)*
* at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)*
* at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)*
* at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:654)*
* at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:447)*
* at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:379)*
* at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:292)*
* at org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:424)*
* at org.apache.catalina.core.StandardHostValve.status(StandardHostValve.java:343)*
* at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:144)*
* at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)*
* at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)*
* at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)*
* at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)*
* at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)*
* at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)*
* at java.lang.Thread.run(Thread.java:619)*
After getting this kind of error I have analyzed my code furhter then I came to know that there was problem with static include tag.
In my jsp page I have used following line which is the main cause of error
<%@ include file="top.jsp" %>If I ommit this line then it is working properly.
Instead of static include I have used jsp:include also.
Still I m getting same problem.
We have to migrated from JDK 1.5 to 1.6 and Tomcat 5.0.28 to 6.0.14, still same problem is there.
We have tried a lot but didnt get success to overcome this problem.
If anybody having any solution then ur each reply will be appreciated.
Thanks in advance..........!!!!!!!
Edited by: JBOSS2000 on Jan 15, 2008 9:29 AMHi "mshanu" and "amit" Thanks for ur replies Here I m posting the code of "top.jsp"........!!!!
<%@ page errorPage="errordisplay.jsp"%>
<table cellpadding="0"
cellspacing="0" height=50 width=780>
<tbody>
<tr class="header">
<td class="logo"><IMG SRC="assets/Logo.gif" BORDER=0 ALIGN=top></td>
<td align="right"><span class="applicationtitle"><%@ include file="/contents/logo.htm" %></span><br>
<span class="companyname"><%@ include file="/contents/companyname.htm" %></span></td>
</tr>
</tbody>
</table>To include top.jsp I have tried
<jsp:include page="top.jsp" flush="true">
</jsp:include>
AND
<%@ include file="top.jsp"%>but none of this worked.
If I remove the include then It is working properly.
But I need inluded file too so that I am wondoring for the solution.
This problem seems very wiered to me. I dont know why it is happening.
This problem is started only when I used the TOMCAT 6.14.
Is it the bug of TOMCAT 6.14 or What somebody Plz help.
I got stuck here.........!!!!!!!!!!
It doesn't seem any problem with top.jsp. As per my thinking the problem is there in include due to that it doesn't compile the JSP page in Tomcat 6.0.
Earlier I am having same code running on the Tomcat 5.0.28 and JDK 1.5.0.
But problem occured when I have used Tomcat 6.x...!! -
I've just installed J2SE 1.4.0 and am having problems with the classpath. I've tried setting it as explained in the Help section on the java.sun site, however I still get the error message:
'javac' is not recognised as an internal or external command, operational program or batch file
How exactly should I go about setting the classpath and what is the format that it should take?I have a same proplem when compiling with Windows XP.
I set
PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32
Wbem;C:\j2sdk1.4.0_01\bin.Could you please tell me
more about this problem. Thanks a alot!Open a console window.
Type the following command
set
Verify that the PATH looks like what you think it does. If it doesn't fix it.
Then do this
cd C:\j2sdk1.4.0_01\bin
set PATH=.
javac -?
If you still get the same error then something is wrong with the install. Examine the bin directory. There should be a number of exe files in it including javac. -
Timer Class in jsdk 1.4 w2000 doesn't compile
Since this is based in the tutorial, shouldn't be a big deal but I spent the whole day looking for a solution. Please help!
The tutorial presents this program:
//1.3
import java.util.timer;
public class Problem {
public static void main(String[] args) {
final Timer timer = new Timer();
timer.schedule(new TimerTask(), 5000);
System.out.println("In 5 seconds this application will exit. ");
public class TimerTask implements Timer {
public void run() {
System.out.println("Exiting.");
timer.cancel();
My problem starts because java.util doesn't have the timer class:
Problem.java:2: Class java.util.timer not found in import.
import java.util.timer;
^
Now, JSDK 1.4 doesn't have timer as a package, but as a class, nevertheless, the instruction:
import java.util.*; // instead of java.util.Timer
doesn't compile because
Problem.java:10: Interface Timer of inner class Problem. TimerTask not found.
Problem.java:6: Class Timer not found in type declaration.
I think Timer should be expressed as abstract, but how?
I'm new in Java and feel a little frustrated...>
ProblemSolved.java:3: Class java.util.Timer not found
in import.
import java.util.Timer;
^
1 error
Then you are not using java 1.3. You are using something before that.
for the Timer and
javac IteratorDemo.javaIteratorDemo.java:1: Interface java.util.Iterator of
class IteratorDemo not foun
d.
public class IteratorDemo implements
java.util.Iterator {
^
1 error
And this suggests that you are using something before 1.2.
Just a thought...
Windows comes with the MS version of java, which matches something like 1.1.6. It is in the path. So does you path put the jdk path first or last? -
Ostringstream doesn't work with int
If you run this code compiled with gcc 4.2 (Xcode 3.2) you get an empty string. ostringstream doesn't convert int values to string!
Please, test this code with gcc compiler.
#include <iostream>
#include <sstream>
int main()
std::ostringstream stream;
stream << 45;
std::string str = stream.str();
std::cout << str; // empty output
return 0;
}Answered by Todd Heberlein on Xcode Mailing List:
+Here is the Chris Espinosa standard answer:+
+Project > Edit Target Settings, enter "GLIBCXX" into the search field.+
+Wherever you find GLIBCXX_DEBUG=1 or GLIBCXXDEBUGPEDANTIC=1, delete them.+
Todd -
Problem in compilation with very large number of method parameters
I have java file which I created using WSDL2Java. Since the actual WSDL has a complex type with a large number of elements(around 600) in it, Consequently the resulting java file(from WSDL2Java) has a method that takes 600 parameters of various types. When I try to compile it using javac at command prompt, it says "Too many parameters" and doesn't compile. The same is compiling successfully using JBuilder X . The only way I could compile successfully at command prompt is by reducing the number of parameters to around 250 but unfortunately that it's not a workable solution. Does Sun specify any upper bound on number of parameters that can be passed to a method?
... a method that takes 600 parameters ...Not compatible with the spec, see Method Descriptors.
When I try to compile it using javac at
command prompt, it says "Too many parameters" and
doesn't compile.As it should.
The same is compiling successfully using JBuilder X .If JBuilder produces a class file, that class file may very well be invalid.
The only way I could compile
successfully at command prompt is by reducing the
number of parameters to around 250Which is what the spec says.
but unfortunately that it's not a workable solution.Pass an array of objects - an array is just one object.
Does Sun specify
any upper bound on number of parameters that can be
passed to a method?Yes.
Maybe you are looking for
-
I am looking for a way to change the selection of movies based on who is watching. I have a huge video library on my mac, rated from G to R. Obviously we don't want our children watching anything other than G and PG. In the previous version of AppleT
-
How can i get my shuffle to show up as a device on itunes
My ipod shuffle neither shows up in "computer" in windows 7. There is also no indication on the itunes page showing that the device, the shuffle, is installed. The itunes has been reloaded. Result did not change. Have followed Apple instruc
-
Occasional problem opening HTML attachments to Calendar Events
Does anyone know why I sometimes get the following screen when tryint to open HTML links that I add as attachments to calendar events? Sometime the links work flawlessly and sometimes I get this screen which requires 4-10 "cancels" to remove from vi
-
OB55 Customer worklist REMADV IDOC Payment advice
Hello, We are using REMADV IDOC to enter payment advices for customer open items. We have for ex 3 customers A, B and C. Customer C is entered in Customer's master data A & B as the alternative payer. (company code, payment transaction tab). Customer
-
Acrobat Pro Calculating form fields lose functionality after enabling document for Reader
I have a problem that continues to come up increasingly. I thought I had found a work-around on some forums, but it is still causing trouble. Im hoping you can answer the question. I am creating a form that requires simple calculations (sum and add).