Programming :: Saving Serializable Object Within It's Own Class
May 12, 2011
I found out how to save an object using Serializable in JAVA, the standard however how can I set up my MainVariableList to have a function/method saveobject so it saves the object within it's own class, the below code compiles, however when I run it reports an error on startup but works, basically what do I use for the red line, how do I tell it what object is passed to the class?
View 1 Replies
ADVERTISEMENT
Mar 9, 2009
I have created a simple test class - Mortgage, with the class declaration in the .h file and the class's methods defined in the .cpp file. (mortgage.h && mortgage.cpp, respectively) Straight up C++ 101 as far as I can tell. I instantiate the class in the main() function, which is defined in practice.cpp. Using Geany on Ubuntu, both the practice.o and mortgage.o files are created, but then I get a linker error: undefined reference to class::functionName
I get it for each function. If the mortgage.cpp file is foremost in the editor when I click "build", then I get the undefined reference to main() error, if practice.cpp is foremost (where the main() function is) then I get undefined reference to Mortgage::Mortgage(), and all the rest of the functions defined for that class. How do I get the linker to know where my object files are so it will link them in? Or is the problem somewhere else entirely?
View 8 Replies
View Related
Jan 6, 2010
I am using slackware 13 and openldap 2.4
with webmin.
whenever I start my server i get following error "root DN missing".
when I try to create root DN I get error "unable to create object class".
where do we define object classes?
View 5 Replies
View Related
Aug 17, 2010
Currently I have a single openldap server version 2.3.32 preforming authentication on our databases as well as e-mail and other assorted programs. When we get a high volume of users, sometimes the users can not be authenticated for new e-mail sessions and what not. We have traced it back to being that our current single ldap server can not authenticate them all in a timely manner. We decided that we would put up a new ldap server and replicate the changes to it, then upgrade the older server version and replicate back to it so that both would have a current up to date copy of our configuration, and we would do a master/slave type setup.
Trying to replicate between the old server and the new server is not currently working. Here is the issue: when we try to import the schema's from the older server we get this error: slapadd: dn="cn=Domain Users,ou=Groups,dc=mydomain,dc=com" (line=247): (65) no structural object class provided I can not seem to find any information on google that shows this exact error? if this isn't detailed enough let me know what else I should post.
View 1 Replies
View Related
May 24, 2011
When I start evolution from the terminal I get this: (evolution:3265): GLib-GObject-CRITICAL **: Object class EMFolderTree doesn't implement property 'paste-target-list' from interface 'ESelectable' The program still starts though. I am fairly new to Ubuntu.
View 2 Replies
View Related
Mar 1, 2010
Only ones I can think of seem overly complex, and I'm sure there is a simple solution I am overlooking. I have a class, it has a member who is an object. This object needs to be able to represent an object of different types.
[code]...
Where "surface" could be several different types, which will be set during execution. Hope this is clear enough. I have tried using templates but am getting "data member cannot be a member template". Either I have incorrect syntax, or am not implementing it right. another solution would have one class containing definitions of all possible shapes, But this would take up extra memory. Other solutions I thought of seem too round-about, and seems there is a simpler solution that I have overlooked.
View 8 Replies
View Related
Feb 12, 2011
im trying to build a simple program for my C programming class, this is the source code
#include <stdio.h>
int main()
{
int length, width, length, height, area, perimeter;
perimeter = width + length + height;
area = width * length + heigth;
[Code]...
i dont see any error (you might)but every time i run it it runs but after it asks me to input for the width i do it but it doesn't take me to the length, it just stays blank until i input another value in the same place for the width, it asks me for 4 inputs in total i don;t know why, and after i run it different times it gives me different values for the perimeter and are. how can I fix this?
View 5 Replies
View Related
Mar 7, 2010
Groovy is an object-oriented programming language for the Java platform. I do not have experience in Java, only perl and shell scripts. Recently I have been asked to maintain a software written in groovy (also to make enhancements). So can I learn groovy without knowing java language. or isit I have to learn java before venturing into groovy.
View 1 Replies
View Related
Mar 12, 2010
I have a problem with compiling vdrift-2009-06-15 using scons. As the source that i obtained only supports scons i cannot use make. the error that i get when i try to compile it in GNOME Terminal is: scons: Reading SConscript files ... scons: warning: The Options class is deprecated; use the Variables class instead.
File "/home/mohit/Download/vdrift-2009-06-15/SConstruct", line 9, in <module>
scons: warning: The BoolOption() function is deprecated; use the BoolVariable() function instead.
File "/home/mohit/Download/vdrift-2009-06-15/SConstruct", line 13, in <module>
Checking for C++ header file asio.hpp... (cached) yes
Checking for C++ header file boost/bind.hpp... (cached) yes
Checking for C++ header file GL/gl.h... (cached) yes
Checking for C++ header file GL/glu.h... (cached) yes
Checking for C++ header file SDL/SDL.h... (cached) yes
[Code]........
View 4 Replies
View Related
May 18, 2010
I'm struggling with the issue of passing a vector of a class to itself, here's what state its in now... (tried many variations, but without direction).
Code:
#include <iostream>
#include <string>
[code]...
View 2 Replies
View Related
Apr 9, 2010
I am trying to make a periodic boundary condition type function, using an existing class given to me in lecture notes, but am having some trouble! Effectively, I am trying to make an array such that, for a point in any row of a 2D matrix ("Matrix(i,j)"), the command "next_i[i]" will return "(i+1)%L", where L is the number of data points in the row. This will enable me to select a point to the right of any point in the matrix: "Matrix(next[i],j)"
[Code]....
View 1 Replies
View Related
Apr 8, 2011
Is is possible to use a class inside a struct? I keep getting segmentation fault with this code:
Code:
struct my_struct {
unsigned count;
std::string msg;
[code]....
View 3 Replies
View Related
Mar 15, 2011
My new guy has created several functioning webpages on his machine with TOMCAT 6 with Sun JDK, yet our machines use TOMCAT 5.5 with Open JDK, which his webpages don't show. Do you have any idea how to make them work? The error showing in a browser:
Code:
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception org.apache.jasper.JasperException: Unable to compile class for JSP:
[Code]...
View 2 Replies
View Related
May 10, 2011
I've had to do some code in java, a language I'm very much unfamiliarly with so please excuse my incorrect use of terms. The basic outline of my problem is I create a class object as a local within a swing button function it works fine. If I create it as a global ( with I think I need to do ) within main, then prototype it with the other swing objects at the bottom of the file when it is called it causes a host of problems. I think the easiest way is to show it.
View 2 Replies
View Related
Mar 10, 2010
Okay so I'm working on a program here as I'm learning java,I have an array that is initialized with 5 objects that are hard coded. I have made a GUI that takes the input needed and creates an object with those values.I need to add that object to the ArrayList that I have previously made.Okay, so I have three classes, guiclass.java, main.java and gladiator.java Objects are made and defined in "gladiator".Main contains my public static void main section, launches my gui, creates my five hard coded objects, creates my ArrayList and adds my five hard coded objects to the ArrayList.Now, I need to add the object that I generated in the guiSection [action Listener]to the ArrayList that I created in my main class's public static void main string... section. Problem is my arraylist "cannot be resolved" from guiclass.
View 13 Replies
View Related
Sep 18, 2010
I am looking to write a function to return an MD5 hash in Java but I don't want to us the MessageDigest class as I am using the J2ME framework which doesn't include it.
View 3 Replies
View Related
Sep 30, 2010
How can I handle the situation below so that the "Fatal Error" message is not shown. It would be ideal if I could supply a default class to be used. I'd prefer to not use: ini_set() to supress the errors but actually be able to "handle" the error.
Code:
<?php
class MyClass
[code]....
View 2 Replies
View Related
Feb 24, 2009
I have a application in C++, and now I have two class. MyDialog is the class that main function launch. In MyDialog class there are four elements and when I click over theese elements, there is a MousePressEvent that launch other class, Touchpad class. So, in some moments, I have loaded two class. My question is, how can pass a value from Touchpad class to MyDialog class, when I close (destroy) Touchpad class. In a few words, is it possible to communicate values between class?
View 5 Replies
View Related
Sep 3, 2010
i need to implement a Set class(like in stl) using a vector.Here is my code that doesnt work corectly:
Code:
#include <iostream>
#include <vector>
template<class T>
class Set
{
[Code]....
View 2 Replies
View Related
Oct 19, 2010
How can I implement c_str() for a string class?
View 2 Replies
View Related
Mar 23, 2010
Is it not possible to declare a vector inside a C++ class ? Have a look at the following code:
Code:
#include <stdio.h>
#include <iostream>
#include <malloc.h> // malloc
#include <strings.h> // bzero
[code]....
View 2 Replies
View Related
May 9, 2011
This is a really specific question, but maybe someone can help. I'm debugging someone else's code, and they call a UDPWriter and specify an IP address and port, and I'm trying to make sure this multicast traffic goes over a certain port. How can I determine which port the UDP defaults to and change it?
It's confusing to me because I'm not familiar with all the layers the OS sends traffic through before it goes through the interface. Is there maybe some simpler way to tell the OS to send multicast traffic over both interfaces?
View 2 Replies
View Related
May 23, 2010
i'm a bit stuck playing with the following class setup for glut. The actual issue is with the function pointers.Basically the following code is the opengl redbook cube example slightly modified.
View 2 Replies
View Related
Apr 27, 2011
I'm writing a binary search tree class to insert records and I'm stuck on the following error:
Code:
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: ld returned 1 exit status
Here is the code for my class:
[Code]...
I really don't know how to approach this, I thought that everything was working fine but I have no idea what is wrong. Also, for clarification, main() is in a different .cpp file that #includes "tree.h"
View 13 Replies
View Related
Jan 5, 2011
I have a JApplet class I have copied to both a windows and a linux server. When I open up a webpage with the applet in it in my browser from both servers (http://server1/....) I can only get it to work from the Windows server. The Java console on my PC pops up complaining it cannot find the class file on the Linux server. Has anyone experienced anything like this before and how have you solved the problem?
View 1 Replies
View Related
Mar 11, 2011
I'm trying to teach myself python (from Learn Python the hardway e-book) but am struggling to grasp the concepts of Classes etc. Part of exercise 43 is to rewrite the game / create a new game with classes for each room etc. So I'll show you my code so far and explain at the bottom my problem
Code:
#ex43a.py
from sys import exit
[code]....
View 2 Replies
View Related
Jun 27, 2010
how to overload the subscript operator ([]) for a list class?
Code:
template <typename T>
class list
{
public:
struct node
[Code]...
View 1 Replies
View Related
Sep 7, 2010
I have some c++ code and want to generate class diagrams using some tool which would scan the c++ code and generate diagrams. Is there any such open source tool to be used on linux machine?
View 1 Replies
View Related
Mar 9, 2010
Here's what I'm trying to do: I'm attempting to create a Worker program which is to be called in a Coordinator program. The worker program needs to add two numbers from the argv and return the sum of those numbers. Basically my problem is some sort of syntax and I'm fairly new to this scripting stuff. Here's what I have:
#!/bin/bash
# Worker class for the program Coordinator
int worker(int argc, char *argv[] {
int sum = 0;
sum = atoi(argv[1]) + atoi(argv[2]);
printf("I am child with PID %d", getpid());
printf("sum=%d
", sum);
fprintf(atoi (argv[3]), sum, 4);
exit(sum); }
Here's the errors:
~$./worker 2 4
./worker: line 4: syntax error near unexpected token `('
./worker: line 4: `int worker(int argc, char *argv[]'
View 5 Replies
View Related
May 18, 2010
This is a bit of revision for the OU course M257
Code: Select all import java.util.*;
public class FindDupes {
public static void main(String[] args) {
Set<String> orig = new HashSet<String>();
Set<String> dupe = new HashSet<String>();
for(String a: args)
if(!orig.add(a))
dupe.add(a);
orig.removeAll(dupe);
System.out.println("words " + orig);
System.out.println("dudes " + dupe);
}
}
for some reason it will compile but not run on debian lenny complains it can't find the main class but it compiles and runs without problem on Fedora 12.
View 6 Replies
View Related