bugmenot 25 Posting Whiz in Training

no this is the only code .... i hav not specified anything else...
i have just given the data sources and data field properties to the texboxex in the form....
will i be able to run d program without changing the properties of the textboxes?

bugmenot 25 Posting Whiz in Training

hi guys,
i am using vb6 as front end and oracle as back end for my project.
i am using ADO to connect to oracle database.
can u please help me with the code.
my code is

Dim con As New ADODB.Connection
Dim str As String

Private Sub Command1_Click()
str = "Provider=MSDAORA.1;Password=tiger;User ID=scott;Data Source=oracle40;Persist Security Info=True;"
With con
.Open str
End With
con.BeginTrans
con.Execute "insert into PBS_NAMEADDRESS values('" + o_code.Text + "','" + o_name.Text + "','" + o_address.Text + "','" + o_city.Text + "','" + o_state.Text + "','" + o_country.Text + "')"
con.CommitTrans
Command1.Enabled = False
End Sub

when i run the program and try to enter the values the values entered previously r disappearing.
please help me . its urgent.
also tell me if there are any errors or is there any way to do it.
thank you.

bugmenot 25 Posting Whiz in Training

your add(), subtract(), multiply(), and divide() methods modify their arguments, without changing them back; i am not sure if this is what you want

i don't understand your reduce() method. it creates three new fractions (initialized to 0/0), then tests the denominators of two of them (which of course are both 0), and then sets the "count" field on a third (to 0 of course), and then the loop never runs. this code must be incorrect

also, the count field is used nowhere else and the sum field is never used; perhaps these shouldn't be instance variables

bugmenot 25 Posting Whiz in Training
bugmenot 25 Posting Whiz in Training

one reason why you might want to & 0xFF is that byte's are signed, so if "data" is a byte array, and some of the bytes are 128 or above, then they will be interpreted as being negative. and when they are promoted to integers or longs, they will still be negative (i.e. they will be filled with 1's on the left). if you want the byte to just take on a value between 0 and 255, then you can AND it with 0xFF.

bugmenot 25 Posting Whiz in Training

what is "execution via a webpage"?

bugmenot 25 Posting Whiz in Training

and what should the answer for "asu" be?

bugmenot 25 Posting Whiz in Training

Hi
Just point your browser to wwww.gotocode.com

bugmenot 25 Posting Whiz in Training

there are several problems with this

first, this is not how you write an equals() method; it needs to take an argument of type Object, in order to override the default equals() method

second, you really don't want to have your class compare equal to strings, because it violates the symmetry property of equality (i.e. the equality doesn't work the other way around); and also the way you wrote it an object of your type does not equal itself, which is bad

bugmenot 25 Posting Whiz in Training

This is in the wrong forum. This has absolutely nothing to do with Java. JavaScript and Java are completely unrelated. Please post in a correct forum.

bugmenot 25 Posting Whiz in Training

Need help sorting the array to get the highest number.

You do not need to sort to get the highest element. Sorting is expensive. Getting the highest element is easy. Just go through and keep track of the highest one seen so far.

bugmenot 25 Posting Whiz in Training

i had the same problem.
i went to internet options and deleted: temporary internet files, history, cookies and form data.
that fixed my problem.
hope this helps!!!

bugmenot 25 Posting Whiz in Training

Yeah, I'm having a similar problem with an ASUS mobo with a Pentium III processor. The power supply is working, HD is spinning, CD-ROM's are working, fan on CPU is running, etc. The power button on the front of the computer isn't working. I tried taking out the RAM and CPU and re-inserting them, no luck. I guess my next step is completely taking out all the hardware and reinserting it. A friend suggested it could be a bad video card or CPU but that seems weird, especially with a Pentium III, I've never had to replace a P3. Anyone have any similar experiences or input? Thanks in advance.

I'm having the same exact problem. I was opening my case for some reason put it back together and nothing displays on my monitor but all my fans and drives spin but my power LED does not come on. My email address is jayman1233@gmail.com

bugmenot 25 Posting Whiz in Training

if "\" were the separator, you would do

str.split("\\\\")

the reason is that the argument to split() is compiled into a regular expression; and characters which are special in regex need to be quoted

the backslash is also the escape characters for strings in general, and needs to be doubled

a better way is to use the Pattern.quote() method to quote strings, so you don't have to escape special characters, like

str.split(Pattern.quote("*"));
str.split(Pattern.quote("\\"));

for "*" and "\" separators respectively

bugmenot 25 Posting Whiz in Training

what is "vector[j]" supposed to mean?

bugmenot 25 Posting Whiz in Training

Scanner.next() returns up to the next delimeter, which is a space by default

what do you expect it to do?

if you want to read the rest of the line, you can use the "nextLine()" method

bugmenot 25 Posting Whiz in Training

Okay so I've been getting A LOT of pos.tmp etc. files in my C: Drive and My Docs. I also have a Red X for the icon of my C Drive. I also have these "system messages":

System Warning:
Windows performed illegal operation. Your system files could have critical errors.
It could cause unpredictable or erratic behavior, freezes and crashes.
Fixing these errors can increase your computers's performance and prevent data your personal data loss.
Would you like to open System Troubleshooting center to fix the problem? (Recommended)

Your system could become unstable
A potential problem has been detected and Windows has been shutdown
buggy application to prevent damage to your computer.
****WXYZ.SYS - Address F73120AE base at C00000, DateStamp 36b072A3
Kernel Debugger Using: COM2 (Port 0x28f, Baud rate 192000)

SysFader: IEXPLORER.EXE - Potential Application Error
The instruction at "0x01d62739" referenced memory at "0x02354e50".
The memory could not be "read. Click OK to terminate.

Important - Potential Errors found in the system
During a scan of files at system startup,
potential errors in the system registry were found.
p-07-0100 irql: 1f SYSVER 0xff00024
NT_Kernel error 1256
KMODE_EXCEPTION_NOT_HANDLED

I had this problem yesterday morning. I googled the problem, and ran Vundofix which seemed to have fixed the problem yesterday morning. This computer was working all fine until about an hour ago, it came back. I ran Vundofix again and it's not fixing the damn thing now. …

bugmenot 25 Posting Whiz in Training

Allright, check this out... run it a couple times too... not done yet, but I'm likin it

import Image
import ImageDraw
import random

sizex= 1440
sizey = 900
im = Image.new("RGB", (sizex, sizey))





def triangles(point, reps, tmaker, h):

      tmaker.line((point[0], point[1]))
      tmaker.line((point[1], point[2]))
      tmaker.line((point[0], point[2]))
      
      x1 = (point[0][0] + point[1][0]) / 2
      y1 = (point[0][1] + point[1][1]) / 2
      
      x2 = (point[1][0] + point[2][0]) / 2
      y2 = (point[1][1] + point[2][1]) / 2
       
      
      x3 = (point[2][0] + point[0][0]) / 2
      y3 = (point[2][1] + point[0][1]) / 2
        
      point2 = ((x1, y1), (x2, y2), (x3, y3))

      h += 1

      if h <= reps:

            triangles((point[0], point2[0], point2[2]), reps, tmaker, h)
       
            triangles((point[1], point2[0], point2[1]), reps, tmaker, h)

def draw2(image):
 

      return ImageDraw.Draw(image)      
reps = random.randint(0,10)
point = ((0, 700), (500, 500), (350, 0))            
size = point[1]
tmaker = draw2(im)

for i in range(1000):
      rndcol = (random.randint(1,255),random.randint(1,255),random.randint(1,255))
      triangles(point, reps, tmaker, 0)

draw = ImageDraw.Draw(im)
draw.line((0, 0) + im.size, fill=(0,89,0))
draw.line((0, im.size[1], im.size[0], 0), fill=(45,67,0))
#end triangle 1




def draw3(image):
 

      return ImageDraw.Draw(image)      
reps = random.randint(0,10)
point = ((0, 700), (1000, 1000), (350, 0))            
size = point[1]
tmaker = draw2(im)

for i in range(1000):
      rndcol = (random.randint(1,255),random.randint(1,255),random.randint(1,255))
      triangles(point, reps, tmaker, 0)
   
draw = ImageDraw.Draw(im)
draw.line((0, 0) + im.size, fill=(0,89,0))
draw.line((0, im.size[1], im.size[0], 0), fill=(45,67,0))

#end triangle 2

def draw4(image):
            return ImageDraw.Draw(image)      
reps = random.randint(0,10)
point = ((500, 500), (1000, 1000), (350, 0))            
size = point[1]
tmaker = draw2(im)

for i in range(1000):
      rndcol = (random.randint(1,255),random.randint(1,255),random.randint(1,255))
      triangles(point, reps, tmaker, 0)
   
draw = ImageDraw.Draw(im)
draw.line((0, 0) + im.size, fill=(0,89,0)) …
bugmenot 25 Posting Whiz in Training

just interpolate each component?

bugmenot 25 Posting Whiz in Training

never mind fixed it, check this out, I like it I think it's getting kinda cool, but I need more randomness

import Image
import ImageDraw
import random

sizex= 1280
sizey = 800
im = Image.new("RGB", (sizex, sizey))

def sierpinski(data, steps, update_image, k):


      
      update_image.line((data[0], data[1]))
       
      update_image.line((data[1], data[2]))
       
      update_image.line((data[0], data[2]))
      
      x1 = (data[0][0] + data[1][0]) / 2
      
      y1 = (data[0][1] + data[1][1]) / 2
      
      x2 = (data[1][0] + data[2][0]) / 2
      y2 = (data[1][1] + data[2][1]) / 2
       
      
      x3 = (data[2][0] + data[0][0]) / 2
      
      y3 = (data[2][1] + data[0][1]) / 2
        
      data2 = ((x1, y1), (x2, y2), (x3, y3))

      k += 1

      if k <= steps:

            sierpinski((data[0], data2[0], data2[2]), steps, update_image, k)
       
            sierpinski((data[1], data2[0], data2[1]), steps, update_image, k)
def draw2(image):
 

      return ImageDraw.Draw(image)      
steps = 6
data = ((0, 500), (500, 500), (250, 0))            
size = data[1]
update_image = draw2(im)


for i in range(1000):
    rndcol = (random.randint(1,255),random.randint(1,255),random.randint(1,255))
    sierpinski(data, steps, update_image, 0)
   
draw = ImageDraw.Draw(im)
draw.line((0, 0) + im.size, fill=(0,89,0))
draw.line((0, im.size[1], im.size[0], 0), fill=(45,67,0))

              









#end of triangles code







def DrawBox(C):
    numbx = random.randint(100, 1440)
    numby = random.randint(-900, -100)

    newx = numbx + (random.randint(30, 100))
    newy = numby + (random.randint(30, 100))
    
   
    draw = ImageDraw.Draw(im)
    draw.rectangle([(600,100),(800,800)], fill=(45,0,0), outline=(random.randint(1,255),0,0))
    draw.rectangle([(300,100),(400,600)], fill=(0,89,0), outline=(random.randint(1,56),0,0))
    draw.rectangle([(500,600),(800,900)], fill=(0,0,156), outline=(random.randint(45,45),0,0))
    


for i in range(1000):
    rndcol = (random.randint(1,255),random.randint(1,255),random.randint(1,255))
    DrawBox(rndcol)
   
draw = ImageDraw.Draw(im)
draw.line((0, 0) + im.size, fill=(0,89,0))
draw.line((0, im.size[1], im.size[0], 0), fill=(45,67,0))

  
    

im.save('background.png', 'png')
im.show()
bugmenot 25 Posting Whiz in Training

OK, so heres my code, check it out, let me know what you think, I'm trying to embed a serpenski triangle into it, and the program isn't crashing but it isn't displaying and I'm not sure why, if you can tell me it would be greatly appreciated. Also, I need to know how to make the location of the geometric shapes randomly generate their positions and colors each time they generate. Thanks for looking guys, any help is appreciated.

import Image
import ImageDraw
import random

sizex= 1280
sizey = 800
im = Image.new("RGB", (sizex, sizey))

def sierpinski(data, steps, update_image, k):


      
      update_image.line((data[0], data[1]))
       
      update_image.line((data[1], data[2]))
       
      update_image.line((data[0], data[2]))
      
      x1 = (data[0][0] + data[1][0]) / 2
      
      y1 = (data[0][1] + data[1][1]) / 2
      
      x2 = (data[1][0] + data[2][0]) / 2
      y2 = (data[1][1] + data[2][1]) / 2
       
      
      x3 = (data[2][0] + data[0][0]) / 2
      
      y3 = (data[2][1] + data[0][1]) / 2
        
      data2 = ((x1, y1), (x2, y2), (x3, y3))

      k += 1

      if k <= steps:

            sierpinski((data[0], data2[0], data2[2]), steps, update_image, k)
       
            sierpinski((data[1], data2[0], data2[1]), steps, update_image, k)
      
      
             

def draw(image):
 

      return ImageDraw.Draw(image)
 
steps = 6

data = ((0, 500), (500, 500), (250, 0))

size = data[1]

picture = Image.new('1', size, color="blue")

update_image = draw(picture)

sierpinski(data, steps, update_image, 0)
















def DrawBox(C):
    numbx = random.randint(100, 1440)
    numby = random.randint(-900, -100)

    newx = numbx + (random.randint(30, 100))
    newy = numby + (random.randint(30, 100))
    
   
    draw = ImageDraw.Draw(im)
    draw.rectangle([(600,100),(800,800)], fill=(45,0,0), outline=(random.randint(1,255),0,0))
    draw.rectangle([(300,100),(400,600)], fill=(0,89,0), outline=(random.randint(1,56),0,0))
    draw.rectangle([(500,600),(800,900)], fill=(0,0,156), outline=(random.randint(45,45),0,0))
    


for i in range(1000):
    rndcol = (random.randint(1,255),random.randint(1,255),random.randint(1,255))
    DrawBox(rndcol)
   
draw = …
bugmenot 25 Posting Whiz in Training
attribute[] attr=new attribute[no_of_attribute];

attr has no_of_attribute arguments

for(int i=0;i<no_of_entity;i++){

i goes from 0 to no_of_entity

for(int j=0;j<no_of_attribute;j++){

j goes from 0 to no_of_attribute

j is never used

System.out.println("The name of the attribute="+this.attr[i].name);

you access attr

but i might be bigger than the size of attr, which is no_of_attribute
because no_of_entity might be bigger than no_of_attribute

PoovenM commented: Good one on the debug! +2
bugmenot 25 Posting Whiz in Training

Math.pow takes two floating-point numbers and returns a floating-point number

maybe you want to convert it to an int first?

bugmenot 25 Posting Whiz in Training

on an unrelated note, you should look at System.arraycopy() to copy parts of arrays

bugmenot 25 Posting Whiz in Training

there are two lines of

Class.forName ("oracle.jdbc.driver.OracleDriver");

in your code

bugmenot 25 Posting Whiz in Training

Well the basic way of getting time in a program is to use

long x = System.getCurrentTime();

which returns the current time of the computer in milliseconds.

Anyone with a brain could figure it out from there! :p

there is no such method in my Java API

perhaps you are thinking of System.currentTimeMillis()

bugmenot 25 Posting Whiz in Training

there are two lines where you call that method; you caught the exception for the second one, but not the first

bugmenot 25 Posting Whiz in Training

(Using a BugMeNot account, hope previous people weren't jerks)

I've actually had a very very similar problem where Windows XP, being stuck at 32 minutes remaining and trying to figure out Network.

Disabling the onboard LAN worked like a charm (like a previous post mentioned). I also removed any network cards just in case, cause you know, it's Windows.

Good luck

bugmenot 25 Posting Whiz in Training

how about
#include <cstdlib>
instead of
#include <stdlib.h>

and have
using namespace std;

bugmenot 25 Posting Whiz in Training

your code does not make any sense

to declare a private field, you write "private <type> <name>;"

so your line doesn't make sense because "System.out.printIn" is not a type and there is no name

bugmenot 25 Posting Whiz in Training
char* ar2 = new char(strlen(ar));
array[top] = new char (strlen(ele));

oh my god, you are allocating one character, and then you are setting that character to the character that has the ASCII value that is the length of some other string

look at it

bugmenot 25 Posting Whiz in Training

usually the idea of arguments is that you would use them in your method, so you need to give it a name

bugmenot 25 Posting Whiz in Training

underneath, passing by reference involves passing the pointer to the thing being referenced; maybe this will give some insights into how it works

so in the example from above,

void foo( int val ) {
  val = 1;
}
void foo2( int &ref ) {
  ref = 1;
}
int main( void ) {
  int num = 2;

  foo( num ); std::cout << num << "\n";
  foo2(num ); std::cout<< num << "\n";

  return 0;
}

is equivalent to this in C:

void foo( int val ) {
  val = 1;
}
void foo2( int *ref ) {
  *ref = 1;
}
int main( void ) {
  int num = 2;

  foo( num ); printf("%d\n", num);
  foo2(&num ); printf("%d\n", num);

  return 0;
}

notice how the reference declaration is equivalent to a pointer declaration, except that every time you use the reference, it is dereferenced automatically without you having to use * explicitly like with a pointer; and whenever you call a method with a reference argument, or assign to a reference, you take the address of the variable, without explicitly using & like with a pointer

also note that in the C++ code above, this won't work:

foo2(5)

because the reference needs to have an addressable expression to point to

bugmenot 25 Posting Whiz in Training

Hi freddiecool and welcome to DaniWeb,

Not sure if this is your problem, but your variables should be initialised as private. ie:

private pryDialog pd = new pryDialog();
private int option = 0;

No, those are local variables inside the method. They do not have access modifiers like "private".

bugmenot 25 Posting Whiz in Training
bugmenot 25 Posting Whiz in Training

so you have a string with a number in decimal, and you want to parse it into an integer, and then print it back out into a string in hexadecimal?

you can use atoi() to convert the string into an int, and then use sprintf() with %x for hex to print it back out

bugmenot 25 Posting Whiz in Training

what does that even mean?
integer is a type
hexadecimal is a representation of integers
it doesn't make any sense to "convert"

bugmenot 25 Posting Whiz in Training

on linux, i would do

# g++ -o foo foo.cpp
# ./foo this is a test program
bugmenot 25 Posting Whiz in Training

how about you just store it as an integer which when divided by 20 yields your number?

iamthwee commented: nope -2
bugmenot 25 Posting Whiz in Training

True,

change

/bin/rm -i $x

to

/bin/rm -i "$x"

Thanks for pointing that out :)

, Mike

no, that's not it. a for loop splits on spaces, so if you have a file of name "foo bar", your code will first assign x to "foo", and then assign it to "bar" in the next iteration, but none of these are actual filenames.

bugmenot 25 Posting Whiz in Training

SOCKetS?

bugmenot 25 Posting Whiz in Training

that might not work well on filenames with spaces

anyway, why can't you just do something like this?

rm -i *.psd
bugmenot 25 Posting Whiz in Training

the exception tells you exactly what's wrong; you can't cast it, because it's not that type

what makes you think that it is a StreamConnection? and why do you need it to be?

bugmenot 25 Posting Whiz in Training

to override Amethod in Pigeon, it will have to be declared the same way as in Bird

virtual void Amethod(Bird *test2)

is Pigeon.Amethod() always going to be called on a Pigeon? What if it is called on a Bird?

You could just try to cast the Bird to a Pigeon.

P.S. I noticed that you didn't use pointers in the argument to Amethod. If you want to be able to take multiple types, you are going to have to take a pointer or reference as the argument.

bugmenot 25 Posting Whiz in Training

so i am assuming that Pigeon is a subclass of Bird?

I am not sure what methodA does; but it should probably return a Bird *, since that works for both Birds and Pigeons.

the print() method should be virtual in Bird, if you want it to be able to act differently for Pigeons

Pigeon should override those methods, so it can do something different

class Bird {
  virtual Bird *methodA(Bird *x);
  virtual void print();
}

class Pigeon : publid Bird {
  Bird *methodA(Bird *x);
  void print();
}

void DoSomething(Bird *ptr1, Bird *ptr2){
   Bird *myResult = ptr1->methodA(ptr2);
   myResult->print();
}
bugmenot 25 Posting Whiz in Training

how are you connecting them and what are you connecting them to?

bugmenot 25 Posting Whiz in Training

umm... have you used vi before? if not, there are other editors like emacs and nano etc. that might be simpler to learn

anyway, vi has two modes, the command mode and insert mode. it starts in the command mode, where you can move around and do commands. the command "i" goes into the insert mode. when in insert mode, pressing Esc will go back into command mode

bugmenot 25 Posting Whiz in Training

Hi, I have a linked list which I created in a function? I want to allow the user to enter a name for the linked list, and then after he/she can display the list by typing in the title. This is part of my code

struct llistt{
char str[100];  // where the strings will be kept
struct llistt *next
struct llistt *prev
}

typedef struct llistt node
bugmenot 25 Posting Whiz in Training

Hi I am a newbie to this kind of thing as well as to this site and I need some help!!! I have come very close to making the new PS Eye (SLEH-00201) camera work on my laptop, but I really have no idea what I'm doing.

This guy has done some work on fishing out the details for the camera's USB data. Try posting your message there.

bugmenot 25 Posting Whiz in Training

8 bit is to small to hold 16 bit, thats why they created 16 bit.