Hello again I'm working with the Poco internet library trying to understand it but I have come across some syntax that I don't quite understand. This may be a beginner question. Here it is: Poco::AutoPtr<Poco::Notification> pNf (_queue.waitDequeueNotification); I know AutoPtr's contain a count of how many objects reference the object being pointed to; and that only one object can hold ownership over the object. I do not understand what's going on here. Could somebody explain it to me?

Member Avatar
Member Avatar
+0 forum 2

it's a beginner's problem. I am trying to calculate sum of the first 15 factorials. I know int isn't large enough for the sum, so I used unsigned long long but it still didn't work. why?? Thanks for helping! #include <iostream> #include <cmath> #include <iomanip> #include <cstring> using namespace std; int main() { const int fac = 15; unsigned long long sum = 0; int start = 1; for (int i = 1; i <= fac; i++){ start = start * i; sum += start; cout << fixed << setprecision(0) << i << " " << sum <<endl; } }

Member Avatar
Member Avatar
+0 forum 5

Is there a data type that can allow a user to input a 25 digit number... because the largest data type for numbers that i know is long long int and uintmax_t which can only store 18 numbers (i'm not sure about this)... because my problem should allow a user to input 25 numbers... If a larger data type is impossible, is there another way??? (I'm a beginner to c++ and i'm really sorry if this question sounds stupid) :)

Member Avatar
Member Avatar
+0 forum 5

Hi every body, I tried to search for my own problem, I would think this must be popular issue but unfortunately I found no solution in Google. I tried to use `(boolean) session.getAttribute("IsValidUser")` to get the attribute of Session, but that caused error: org.apache.jasper.JasperException: PWC6033: Error in Javac compilation for JSP PWC6197: An error occurred at line: 8 in the jsp file: /WEB-INF/jsp/index.jsp PWC6199: Generated servlet error: inconvertible types required: boolean found: java.lang.Object So below is my JSP code: <%@page contentType="text/html" pageEncoding="UTF-8"%> <%@page session="true" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <%! boolean IsValidUser = false ; %> …

Member Avatar
Member Avatar
+0 forum 2

Hello, Can someone help me understand what is (if it is) the difference between `string* myStr` and `string *myStr`? Or any other type of definitions like that: `int* myValue` vs `int *myValue`, `char* myChar` vs `char *myChar`. The position of the "star" is confusing me. I only used pointers like this: `int *myInt`. I've also seen the star in the middle `int * myInt`. I tried google first, but shows a lot of non-related stuff. Thank you!

Member Avatar
Member Avatar
+0 forum 4

What are the different types of error in PHP?

Member Avatar
Member Avatar
+0 forum 5

In Assembly there's not going to be much insight on linked lists, B trees, arrays, etc. In fact those don't even exist at the bit level. Sure, they help solve some problems from all the way up to your compiled language syntax, but such symbols don't exist in machine code, which is logically simple, just, and basic in bulk of operations in the bit level(i.e. move this here, add this using two's complement, return this, compare that, do this **if** that, etc.). So if we realize that the closer we get to the architecture the lesser the abstraction gets, and …

Member Avatar
Member Avatar
+0 forum 2

A question that I came across: Q: Can you pass a double to a method when it's argument is a float? A: No. Regardless of the double value, a double-sized variable is too big to fit in a float, so it can't be implicitly cast. Doubt: Shouldn't narrowing happen implicitly?

Member Avatar
Member Avatar
+0 forum 2

Hey, I have a need to define a new type such as int,short etc. I have the class with all the base methods it must perform somewhat equivelant but different from the Integer class, Short class etc. However im not sure whether this is an interface i need to define. Id like to declare something like : newtype f = 1; in the same way an int is declared, but since i only have a class it means i have to do newtype f = new newtype(1); Can anyone link me or anything to how this is done?

Member Avatar
Member Avatar
+0 forum 1

I am trying to change the data type of a primary key in table A from INT(11) to CHAR(11). However, this primary key is a foreign key in tables B and C. SQL is giving me an error whenever I try to change the value type of the primary key. Here is the query that I tried: ALTER TABLE `CUSTOMER` CHANGE `CUSTID` `CUSTID` CHAR( 11 ) NOT NULL The error I am getting is #1025. Do I need to use a double nested query to change its data type in tables A, B, and C? I'm a bit lost here.

Member Avatar
Member Avatar
+0 forum 2

Hi All, I know this may seam odd but I'm getting an error navigating through a datagrid of an invalid cast. The trouble is it is of the same types!! I working on customising some Sage code and in the form there is a datagrid that is populated by a series of Sage.Accounting.Stock.TraceableSOPAllocationItems (a batched stock item allocated to an SOP). I want to give the user some further information on each item so they can decide which batch and bin to use. I want to go through each item in the grid and then go find this extra information …

Member Avatar
Member Avatar
+0 forum 4

[CODE] import javax.swing.*; import java.awt.*; import java.awt.event.*; public class Test extends JFrame implements ActionListener { JTextField t1=new JTextField(10); JTextField t2=new JTextField(10); JTextField t3=new JTextField(10); JTextField t4=new JTextField(10); JTextField t5=new JTextField(10); JTextField t6=new JTextField(10); JButton b1=new JButton("MakeReservation"); JButton b2=new JButton("DeleteReservation"); JButton b3=new JButton("searchReservation"); JButton b4=new JButton("printResrevation"); JButton b5=new JButton("clear"); JButton b6=new JButton("Exit"); JLabel l1=new JLabel("Reservation number "); JLabel l2=new JLabel("Room Number "); JLabel l3=new JLabel("OccupantsNumber "); JLabel l4=new JLabel("CstomerName "); JLabel l5=new JLabel("Duration "); JLabel l6=new JLabel("ArrivalsDay "); JTextArea A=new JTextArea(10,70); list List1=new list(); public static void main(String[] args) { Test t=new Test(); } public Test() { setVisible(true); setTitle("Grand Hotel Reservation …

Member Avatar
Member Avatar
+0 forum 1

hi I get an error, "has the wrong return type". it has something to do with "tim1.Tick += new System.EventHandler(tim1_tick);" Help me please. [CODE] Timer tim1 = new Timer(); DateTime huidigetijd = new DateTime(); private bool CheckTim1Start; public Wekker() { tim1.Tick += new System.EventHandler(tim1_tick); // tim1.Enabled = true; enable == start tim1.Start(); tim1.Interval = 3000; } public bool HuidigTijdzien { set { CheckTim1Start = value; if (CheckTim1Start) { tim1.Start(); } else { tim1.Stop(); } } } public DateTime tim1_tick(object sender, EventArgs e) { return huidigetijd = DateTime.Now ; }[/CODE]

Member Avatar
Member Avatar
+0 forum 2

[CODE]import java.util.Arrays; import java.util.Comparator; public class CameraInventory2 { // The main entry public static void main(String[] args) { // create the array Camera[] camera = new Camera[3]; Cam cam = new Cam(); camera[0] = new Camera(1, "Nokia", 20, 30.0, 8); camera[1] = new Camera(2, "Polaroid", 10, 21.0, 14.1); camera[2] = new Camera(3, "Canon", 15, 32.0, 17.8); Inventory invent = new Inventory(camera); // sort the inventory invent.sortProd(); for (int i = 0; i < invent.getSize(); i++) { // get the product Camera prod = invent.get(i); // display the product System.out.println("Item Number: " + prod.getItemNumber()); System.out.println("Product Name: " + prod.getName()); System.out.println("Number Of …

Member Avatar
Member Avatar
+0 forum 2

Someone gave me this challenge See how large a type is by storing powers of 2 in this list of types: float, double, long double. To determine if a number will fit, start with 1.0, double it, then divide by 2 to see if you get the previous number. For example, if a float is 4 bytes then (most likely) when the value reaches 2^127 and you double and halve it, you will not get 2^127, so 2^128 will not fit, so print the message 2^127 will fit in a float on this platform. Hint: The exponent to print out …

Member Avatar
Member Avatar
+0 forum 1

Hi all, I'm trying to design an application for a recruitment application. I have two types of users - a coordinator who works for an agency who logs in and posts jobs and searches for canidates. And a candidate who logs in and searches for jobs. I'm not sure if it is best to have one general user table with fields *Users* uid password email and then a table for coordinators *Coordinators* first name last name dob agency and then a table for candidates *candidates* professional license number first name last name dob address address line 2 town/city county post …

Member Avatar
Member Avatar
+0 forum 1

Hi, I have a list of base types which stores multiple derived types. The following code shows a simplified setup. [CODE]#include "Base.h" #include "DerivedA.h" #include "DerivedB.h" #include <iostream> #include <list> void main() { std::list<Base*> base; std::list<Base*> *basePointer = &base; for (int i = 0; i < 10; i++) { basePointer->push_back(new DerivedA); basePointer->push_back(new DerivedB); } }[/CODE] I iterate through this list using the iterator below: [CODE] std::list<Base*>::iterator baseItt = basePointer->begin(); baseItt++; [/CODE] Is there a way I can find out which derived type 'baseItt' is pointing to? I need this to help me with saving and loading in my program. Please …

Member Avatar
Member Avatar
+0 forum 7

I am writing a supplemental program for the software that came with a programmable robot. The DLL structure has about 6 DLLs that I can reference, with another set that I need to load at runtime. The ones I need to load at runtime have a class inside them that I need to create an instance of just to read some properties. The class is name 'cGame' but when I try: [CODE] Assembly asm = Assembly.LoadFile(path); Type t = asm.GetType("cGame"); [/CODE] t is null. I think the problem is that 'cGame' is derived from a class called 'cGame' in a …

Member Avatar
Member Avatar
+0 forum 3

I'm getting errors when I try to compile this code: [CODE]public class EmployeePayRoll { /*** Class Constants ***/ /*** Defaults ***/ public static final String DEFAULT_EMPLOYEE_NAME = "Employee"; public static final double DEFAULT_PAY_RATE = 10.00; public static final double DEFAULT_HOURS_WORKED = 40.0; /*** Minimums/Maximums ***/ public static final double MINIMUM_PAY_RATE = 7.25; public static final double MAXIMUM_PAY_RATE = 20.00; public static final double MINIMUM_HOURS_WORKED = 0.0; public static final double MAXIMUM_HOURS_WORKED = 168.0; /*** Instance Variables***/ private String employeeLastName; private double hoursWorked; private double payRate; /*** Constructors ***/ public EmployeePayRoll( String employeeName, double hours ) { employeeLastName = employeeName; hoursWorked …

Member Avatar
Member Avatar
+0 forum 3

Hello, I am looking into testing the performance of different numerical datatypes like double, integer, float, etc and see which one is the fastest. Is there a way to do this in C++. Time the time it takes to do basic arithmetic with numbers. Starting and end a timer within a function? Would this be easier in another languages? I am 13. Also what data types would you recommend testing? Thanks and any suggestion would be greatly appreciated!

Member Avatar
Member Avatar
+0 forum 3

I am creating an abstract data type for strings implementing the string functions but not using the string library. I have my .c file and my .h file below. The problem seems to lie in addMystring I have commented out the area's that seem to have the problem. when they are not commented out I have a segmentation fault. though, it should work, so I believe that theres something wrong with my resizing functions, though I cannot figure out what. If someone could tell me what I am doing wrong I would appreciate it! [CODE] # include <stdio.h> # include …

Member Avatar
Member Avatar
+0 forum 7

I have writen a code for adding (math +) two arrays. Actually, I have two arrays of a class I have also designed, that has two attributess, one of wich is an integer. I would like to sum (add element by element) one array on the other by adding the integer attribute of each element to the integer attribute of the other element. I have a compiling time error that says "unexpected type" in the line I mark with an "<===" Here is my code: [CODE] package practica_2010; package practica_2010; /** * Write a description of class PAGS here. * …

Member Avatar
Member Avatar
+0 forum 10

With the recent release of Visual Studio 2010, Microsoft has updated.NET and the C# language, both now at version 4. One of the new features of C# is the ability to handle dynamic types. But what exactly does that mean? Essentially, if you're very careful, you can use C# in a manner similar to languages such as Python or even Smalltalk. Normally, without dynamic types, the compiler does all your type checking for you and won't compile the code if there are typing errors. For example, if you have something like this in your C# program: [CODE]Myobj.SomeFunction(); [/CODE] the C# …

Member Avatar
Member Avatar
+5 forum 3

Hey all, I'm working on a program where I calculate powers of two upto 60. I've made my own formula for calculating it which is: 10^([value of log 2 here]*y), where 'y' is any power as big as, say, 31. So here it is: [code=python] two=0.301029995664 final=math.pow(10,(two*n))-1 [/code] Now... as the value of 'y' gets bigger and bigger, the numbers are displayed as, for example: 2.19902325555e+12 How do I make the prog display the WHOLE number instead of e+12 and stuff? Thanks a ton people...

Member Avatar
Member Avatar
+0 forum 11

Ordering objects is one thing that is changing as we will move to Python3 Python 2.6 gives interesting results [CODE]a=[1,'23',('a','b'),False,[[]],[],'bc',['ab','34'],45,'0',{},True] >>> sorted(a) [False, 1, True, 45, {}, [], [[]], ['ab', '34'], '0', '23', 'bc', ('a', 'b')] >>> print True==1 True >>> print False==0 True >>> print False=='' False [/CODE] Python3 has sense to give up but still gives interesting results [CODE]Python 3.1.2 (r312:79149, Mar 21 2010, 00:41:52) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> a=[1,'23',('a','b'),False,[[]],[],'bc',['ab','34'],45,'0',{},True] >>> sorted(a) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: unorderable …

Member Avatar
Member Avatar
+0 forum 1

The End.