vbScript - Create a Log File Using vbScript Classes Before I retired I was responsible for most of the corporate data plumbing at our control centre. All of the plumbing was written in vbScript. As any maintenance programmer knows, log files are a vital key in identifying and fixing problems. Because I am basically lazy I don't like to code the same process over and over so I created logging code that could be included in any script. The scripts were run automatically on periods ranging from once every five minutes to once a week, or even as little as …

Member Avatar
+0 forum 0

Hi. Im trying this java program that's suppose to register the "staff"'s "car" and there's this boolean method that I don't know how to solve. There are 3 classes: Tester, Staff and Car. the boolean part is suppose to check if the staff has 1 or 2 cars registered and if it is null then assign car object to staff's Car. public boolean registerCar(Car car, String stickerNum) { if(car.getOwnerId() != null){ //not sure how to continue } return false; } if anyone is kind enough to help me out, much appreciated. thanks

Member Avatar
Member Avatar
+0 forum 1

Hi all, I have an array of objects that looks like this: object(stdClass)[2] public 'statuses' => array (size=97) 0 => object(stdClass)[3] public 'metadata' => object(stdClass)[4] public 'iso_language_code' => string 'en' (length=2) public 'id' => int 700797209428668416 1 => ... n => ... I a simply trying to iterate through the array of objects and access the 'id' property. The code I am using is: foreach($obj_array as $statuses) { foreach($statuses as $s) { //Store all IDs in Array $id_array[] = $s->id; } } However, I am getting the error: `Undefined property: stdClass::$id` I'm very new to working with classes, so I …

Member Avatar
Member Avatar
+0 forum 1

Here is my code: ` #include <iostream> #include <iomanip> #include <string> using namespace std; class Register { //Private members private: //Creating an array for all the Prices static double Price[]; //Declaring RegNUM and RecNUM int RegNUM, RecNUM; //Print out Item name in a loop static string items[]; //Creates a Receipt Structure struct Receipt { //Takes in the number of orders and stores items bought int Orders[5]; double Total = 0; }; //Creating a pointer (RecPTR) Receipt *RecPTR; //Public members public: //Register Constructor Register(int,int); //Member functions void getOrder(int); void RecRETURN(); //Operators Register operator+(const Register &right); Register operator=(const Register &right); }; //Setting …

Member Avatar
Member Avatar
+0 forum 4

The tools Hal’s sells are: Hammers: $10.99 Wrenches: $10.99 Levels: $19.99 Tape Measures: $4.99 Screwdrivers: $8.99 In order to make things easier in the long run you have decided to make a c++ program that takes in all the orders for each register and tallies them at the end of the day. Write a c++ program that does the following: Create a Register class that can store all of the receipts for the day and the totals for that register. This class could have the following member functions: Contructor(int) – Creates a number of receipts based on an integer that …

Member Avatar
Member Avatar
+0 forum 3

I can serialize an object if it's class definition has attributes. So if I have an object whose class does not have attributes, do I serialize the attributes importedi in it's class definition? For example; suppose I have the following class, #ifndef BREAD_H #define BREAD_H #include "EGGS.h"; #include "FLOUR.h"; class BREAD { public: BREAD();~BREAD(); //lame example std::vector<string> selectIngredient(std::vector<FLOUR>grocery); }; #endif How would I go about serializing attributes defined in the FLOUR.h class if incase I have to? Thanks in advance.

Member Avatar
Member Avatar
+0 forum 2

One of my assignments, that I already turned in, dealt with collecting a student's name and gpa, and storing the information in an array. Afterwards, we were asked to display the student's information in descending order based on their gpa. I was curious if anyone has any suggestions on improving the code. This is my student class: /** Define a class Student. Each student is defined by: * a string name * a floating-point GPA */ import java.util.*; import java.text.DecimalFormat; public class Student { private String name; private double GPA; //to enter the data for a new student public Student() …

Member Avatar
Member Avatar
+0 forum 2

class phpParser{ public $pageString; //some other properties and methods class software{ private $baseName; private $url; private $html; public initiateValues (){ $this->html = new phpParser (); } } // Now how to access properties and methods of phpParser class through software class member $html (which is actually object // of phpParser class). I think i should be something like this $mySoftware = new software(); $mySoftware->html->pageString; //this not work how i access please help me please urgently i am pending my work untill you //guys answer me

Member Avatar
Member Avatar
+0 forum 5

I have been programming for quite a while in Python but have just started to learn OOP properly. I find it really confusing and I don't really understand it. Especially the implicit self that python automatically passes. It just isn't clicking, really. May someone provide an easy explanation of what classes and objects are in general and how they are used in Python?

Member Avatar
Member Avatar
+0 forum 2

Oh boy They ust be tired of me now. My trouble: I have two ArrayLists of custom classes. ``ArrayList<Subject>` **a**` ``ArrayList<Student>` **b**` Within those custom classes are other custom classes which themselves have primitive data types as well as an ArrayList of other custom classes. It's a big circus going on. How do I XMLEncode those two ArrayLists, **a** and **b**, so that all the information within them branching all the way down, is saved? (Also, is it possible to save both of these to the same file please?)

Member Avatar
Member Avatar
+0 forum 4

Hello guys and gals :) I admit I don't know whether there is a way to create a dynamic array of objects. I have a task to read a file with the structure: body_id x_low x_high y_low y_high z_low z_high body_id x_low x_high y_low y_high z_low z_high body_id x_low x_high y_low y_high z_low z_high where <body_id> is a string and the rest are integers(coordinates). So depending on the body_id, I want to make an array of objects of the class Body with each object having the name <body_id>, containing the coordinates, BUT I want to do it on the first …

Member Avatar
Member Avatar
+0 forum 3

hellow guys please make me understand what is the advantage of using ado(active data object)over dao(data access object) please assist me to understand the difference

Member Avatar
Member Avatar
+0 forum 1

i am working on a room locator program, the feature includes the room location and the path that the searchee can take to locate the room. is there a way to move a control in a vb application just like what we see in flash applications? thanks for the ideas :))

Member Avatar
Member Avatar
+0 forum 2

Hello. I'm quite new to Java, but I've worked on Graphics before. I have a couple of questions which are: I want to make a night sky in Java with stars which randomly switch to big stars from small and back, repeating for a set time. I also want the changes of the star size to occur with opacity, so that they appeared to glisten. Another thing I want to consider is I want to create a crescent moon, which will get off of the screen in a smooth movement across the screen, replaced with a smooth movement of sun …

Member Avatar
Member Avatar
+0 forum 13

Hello! I've been busy passing exams, but now I'm free to code around again. So, in my usual style! **The goal:** I've been playing some Battlefield 3 during study breaks, and I've often been pissed off by BF3's autobalance mechanism. It's bad. Horrible. It makes me sad. I usually have to watch cat videos for an hour to recover from being autobalanced. But, it gave me the idea to code my own autobalancer! :D **The problem:** To me, my logic seems fine, but the code breaks when I try to call the methods and objects in my main class. **The …

Member Avatar
Member Avatar
+0 forum 16

Hey I'm trying to add pairs of numbers into an array by placing them into objects then putting the objects into the arrays but I seem to be having a problem with some part of my code. When I run the following example I just get the following back : [Example$Pair@1fc4bec, Example$Pair@dc8569, Example$Pair@1bab50a and so on...] can someone tell me why this is happening and how do I go about just printing the contents of the arraylist out correctly? import java.util.*; public class Example{ ArrayList<Pair> ar1 = new ArrayList<Pair>(); public static void main(String args[]){ Example example = new Example(); example.createArray(); …

Member Avatar
Member Avatar
+0 forum 10

Please bear with me, this is my first post So, I have this superclass called A. And I've 2 subclasses A1 and A2. A has attribute name. A has function toString(). A1 inherits name, and has attribute hair. A1 has a method toString() which goes: string A1::toString(){ string stringA= A::toString(); stringstream info; info<<stringA<<" "<<hair; return info.str(); } A2 is the same as A1, except that it has face instead of hair. it's toString goes info<<stringA<<" "<<face; In my main(), vector<A*> vector; Then, I have a function to add objects void addA1 (vector<A*> &vector) void addA2 (vector<A*> &vector) both use push_back, …

Member Avatar
Member Avatar
+0 forum 2

Okay, so my hurdle here is to Serialize a list that has a bunch of objects in them, write them to a file, and be able to open the file to load the list of objects back into a listbox. I've read the MSDN articles and browsed some Forums, but everything about this is way over my head, and I've never touched Serialization before. I've got everything laid out, I think, but some guidance would be greatly appreciated. // Main.CS using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.IO; using System.Linq; using System.Text; using System.Windows.Forms; using System.Runtime.Serialization; …

Member Avatar
Member Avatar
+0 forum 3

Hello guys! I'm a beginner in C++ programming and I've a (stupid, I think) doubt about how to pass an object's class into another class. Suppose we have these two classes: class A {...} class B {...} and I want to use an object from A into B. For example: class B { A ab; [methods prototypes that include the object ab] method_B (A ab); //for example ...} The question is, can I do this? Does it make sense, thinking about object-oriented programming? Or, I could define an A's object in main() and after that I would call a method …

Member Avatar
Member Avatar
+0 forum 2

hi i have been working on my project to create a store and i have to add items and sell items, and once i add items i store them into a textfile separated by commas, and i made the add item button work perfectly but i am having trouble with the sell button. import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.io.BufferedReader; import java.io.FileOutputStream; import java.io.FileReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintStream; public class text_feild implements ActionListener { JPanel titlePanel, buttonPanel; JButton button, Sell_button; InputStreamReader input_stream = new InputStreamReader(System.in); BufferedReader read_Buffer; FileOutputStream file_out_put; PrintStream print_stream; FileReader read_from_file; …

Member Avatar
Member Avatar
+0 forum 3

Hi I have trouble with implementing a dynamic two dimensional pointer array on allocating memory for it. I tried it this way but not sure if it's correct. The array should contain pointers to heap allocated **Integer** objects const int size = 10; Integer *** twoD; twoD = new Integer**(); for(int i = 0 ; i < size ; i++) *twoD[i] = new Integer(); for(int j = 0 ; j < size ; j++) twoD[i][j] = new Integer(); Any help will be appreciated!

Member Avatar
Member Avatar
+0 forum 5

Hi, I had an assignment where we had to fox a program and get it working correctly. I fixed 99% of the problems and the program runs correct. The only thing that is wrong is my insertionSort() method. It runs correctly, but in the wrong order. Currently its listing names in descending order, comparing the last names (if last names are equal then compares first names). I have been messing around with my loops for a while now and cant figure out how to switch the order which it runs the sort. The fix is probably something really small and …

Member Avatar
Member Avatar
+0 forum 2

So I’m working on an active directory restructuring project my manager has assigned me to do since the new company name change. Basically the meat and potatoes of it is making new OU containers in the Active Directory and throwing user, printers, computers, distribution and security group objects into their respectively named parent and child OU containers (separated by sites rather than by individual company names which it is/was originally). Last week when I tried to move a handful of computer objects into the new OU child containers I created, it knocked those computers off the domain and violated the …

Member Avatar
Member Avatar
+0 forum 3

class Account { Long accNum, pwd} public class Banker { public static void main(String r[]) { new Banker().go(); // do more stuff } void go() { Account a1 = new Account(); a1.accNum = new Long("1024"); Account a2 = a1; Account a3 = a2; a3.pwd = a1.accNum.longValue(); a2.pwd = 4455L; } } It says in solution when line 5, "//do more stuff" is reached, four objects are eligible for GC. Three I know is Banker(), Account() and Long("1024"). My doubt is which is the fourth one? It says in solution that "Account object has two *Long* objects associated with it". So …

Member Avatar
Member Avatar
+0 forum 2

Hello Everyone. I am having trouble creating new objects in a loop. I am using: DataType *Ptr = new DataType (); I use this in the beggining of the loop then end the loop with: delete Ptr; Each constructor and destructor gets called each time the loop is executed.... but for some reason the constructor is not seeding correctly. I have the Class constructor to be: 1. DataType:: DataType () 2. { 3. srand(time(0)); 4. } Which is to have a different seed when the constructor is called and give different sets of random numbers. For some reason it seems …

Member Avatar
Member Avatar
+0 forum 11

Hello, I'm currently working on a project and I need to get the values I need from the API server. I'm really new to working with objects and arrays alltogheter, can I have a little help and perhaps someone can provide a simple example on how I can do this ? The code I get when quering the API server is as follow: xmlrpcresp Object ( [val] => xmlrpcval Object ( [me] => Array ( [array] => Array ( [0] => xmlrpcval Object ( [me] => Array ( [struct] => Array ( [id] => xmlrpcval Object ( [me] => Array …

Member Avatar
Member Avatar
+0 forum 5

Do you need to implement a class in order for an object to access the class's functions/methods? When should you implement a class? When shouldn't you?

Member Avatar
Member Avatar
+0 forum 2

Main.java [CODE] package scrabble; import javax.swing.JOptionPane; import javax.swing.JDialog; public class Main { public static boolean isDoubloon (String word) { int count[] = LetterHist.letterHist (word); for (int i = 0; i < count.length; i++) if (count[i] == 2 || count[i] == 0) continue; else return false; return true; } public static void haveFunWithJOptionPane () { JDialog.setDefaultLookAndFeelDecorated(true); int response = JOptionPane.showConfirmDialog(null, "Do you want to test a word?", "Confirm", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); if (response == JOptionPane.NO_OPTION) { System.out.println("No button clicked"); } else if (response == JOptionPane.YES_OPTION) { System.out.println("Yes button clicked"); String testWord = JOptionPane.showInputDialog("Enter the test word:"); String tiles = JOptionPane.showInputDialog(null, "Enter the …

Member Avatar
Member Avatar
+0 forum 9

I wanted to write a simple program that uses classes but I've been running into errors. Anyone have a clue as to what is wrong with my code because I can't seem to figure it out. #include <iostream> #include <iomanip> #include <cmath> using namespace std; class cone{ private: double radius; double height; public: cone(); void setvolume();// double conevol(); }; //implementation void cone(){ double radius; double height; } void setvolume(double r,double h){ double radius=r; double height=h; } double conevol(double r,double h){ double vol=(1/3.0)*(3.14159265)*r*r*h; return vol; } int main(){ cone A; cout<<"The current volume of the cone is: "<<A.convol<<endl; A.setvolume(3.4,5.63); cout<<"The volume …

Member Avatar
Member Avatar
+0 forum 2

How do i get value from this return? Im looking to get the value of 2. array 79 => object(stdClass)[356] public 'parent' => int 8 public 'type' => string 'meta' (length=4) public 'name' => string 'limitcounter' (length=12) public 'value' => string '2' (length=1)

Member Avatar
Member Avatar
+0 forum 2

The End.