- Upvotes Received
- 0
- Posts with Upvotes
- 0
- Upvoting Members
- 0
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
44 Posted Topics
Is there a way to install the latest cordova plugin in my project via the command line terminal Something along the lines of cordova plugin add org.apache.cordova.plugin @ 2.0.4 | |
Is there are an easier way of serializing a vector attribute of an object in c++ using sqlite3? | |
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 … | |
So I'm trying to remove 2 brackets from lines I'm reading from a file. For some reason when I run my program the characters in between the delimeters is removed. for example `greetings pe()ple` would end up as `greetings pe` I'm using a char array of delimiters. `char delimiters[] = … | |
So I'm trying to remove 2 brackets from lines I'm reading from a file. For some reason when I run my program the characters in between the delimeters is removed. for example `greetings pe()ple` would end up as `greetings pe` I'm using a char array of delimiters. `char delimiters[] = … | |
Suppose I have the following class in a header file //tray.h #include <vector> #include "Eggs.h" #ifndef TRAY_H #define TRAY_H class Tray{ std::vector<Eggs> dozen; public: Tray(); ~Tray(); std::vector<Eggs> getTray() const; }; #endif And the following class file //tray.cpp #include "Tray.h" #include <string> Tray::Tray(){ } Tray::~Tray(){ } How do I initialize the … | |
when compiling code from my main function ireceive the following error `error: conversion from 'rectangle*' to non0scalar type 'rectangle' requested` My code is quite simple; Here's my main function #include <iostream> #inclde "rectangle.h" using namespace std; int main() { rectangle rect = new rectangle(3,4); cout<<rect.area()<<endl; cout<<rect.perimeter()<<endl; return 0; } here's … | |
I'm almost giving up on this problem. How to convert an integer to it's hexadecimal equivalent. I'm not looking to printout the hexadecimal equivalent of the integer in printf() but for a hexadecimal number. | |
[Click Here](http://www.cs.fsu.edu/~hawkes/cda3101lects/chap7/F7.19.gif) | |
The sign-extend unit works for I-type instructions, what would be it's output for R-type instructions? 32 zeros? | |
Are these two instructions equivalent, i.e do they both do the exact same thing? `addi $s0,$s0,0` and `add $s0, $s0, $zero` | |
I recently moved both my eclipse and Android folder into the same location. I didn't know that this would mess up eclipse. My themes are gone and eclipse can no longer locate the Android SDK. I've looked for ways to fix this online but most of the answers involve reinstalling … | |
Eclipse throws an error whenever I start it up (see attachment). Any help is greatly appreciated. | |
Right now I'm typing in consolas, a favorite font among programmers but as soon as I submit this post, all that I've written will be in Arial. I'm sorry but, I hate Arial. I can't stand the narrow words. I almost always have to stop and examine each word individually … | |
Supposed I want to build a Queue using a LinkedList structure how would I go about doing this. I'm only allowed to use offer(), remove() or poll(), isEmpty() and size() methods, how do I implement a method to add items onto the queue? | |
I have a generic class that contains a compareTo() method I'm getting an error on the method it'self that goes something like; Name clash: the method compareTo(T) of type twos<T N> has the same erasure as compareTo(T) of type Compareable<T> but does not override it. How do I fix it? … | |
public class SongIterator<T,L> implements Iterator<Song<T, L>> {} | |
I'm implementing a generi method that's supposed to traverse a binary tree in PostOrder but when I attempt to use it, the Iterator doesn't work as It should when I attempt to use ot on a Binary Tree, can anyone spot my mistake in the code? Thanks. The method makes … ![]() | |
What is the difference between `CoffeeInterface<Beverage> cup1 = new Coffee<Beverage>()` and `Coffee<Beverage> cup2 = new Coffee<Beverage>()` `Coffee` is a class that extends the `CoffeeInterface` Is `cup1` an object or can it be used as one. Are there any differences betweeen `cup1` and `cup2`? | |
I have two classes A Dog class whose constructor does not accept arguments, `public class Dog<pet> extends Animal<pet>{}` whose constructor does not accept any arguments and `public class Animal<pet>{}` whose constructor accepts one argument public class Dog<pet> extends Animal<pet>{ public Dog(){ super(/*what should go here?*/); //Constructor accepts no arguments } … | |
I have two strings, `String one = new String("word");` `String two = new String("word");` Why does `System.out.println(one.equals(two));` Return true given that one and two are two different `String` objects. | |
Suppose I have the following generic classes; Queue<T> KellysCoffee CheckOut and the following generic interfaces QueueInterface OrderLineInterface Suppose I want `KellysCoffee` to extend Queue class and implement `OrderLineInterface` This is how I've done it private class KellyCoffee<Order extends Queue<Order>> implements OrderLineInterface{} Now when I try to implement `CheckOut` public class … | |
How's the result to this 7? void foo(int i){ if(i>1){foo(i/2);foo(i/2);}cout<<"#"<<endl;} | |
Node inside a linkedlist SomeInterface has an addLast() method that should add a node at the end of the list public LinkedList<T> implements SomeInterface<T>{protected class Node<T>{ privateT data; private Node<T> head,tail; protected Node(T data,Node<T>tail){ this.data=data;head=null;this.tail=tail;} private T getInfo(){return this.data;} private void setTail(Node<T>newTail){this.tail=newTail;} private void setLink(Node<T>newHead){this.head=newHead;} private Node<T> getLink(){return tail;} }} … | |
I'm trying to implement a hangman game using linked lists but not getting anywhere. I want guessed characters to be inserted in a Linked list of chars at a position that corresponds to the character's position in the word they are trying to guess.(See example at bottom.) For some reason … | |
would you just do @Override public boolean contains(T param){ return hashTable[function(param)]!=null; } | |
I have the following public class bucket<String,Integer>{ private Integer num; . . . public bucket(){ num=new Integer(100); } } Eclipse spits out an error saying that it cannot instantiate the type Integer. Why is it saying this? | |
Multiple generic arrays is it possible to create something like <String, Integer>[] a; If I wanted to create an array that stores objects of String and Integer? | |
import java.util.NoSuchElementException; import java.util.Stack; public class StackList<T> implements SomeList<E>{ /* Comments * only use offer(), poll()/remove, isEmpty(), and size() methods*/ private Stack<T> stack=new Stack<T>(); public StackList(){ Stack<T> stack=new Stack<T>(); stack=stack1; } public void push(T thing){ stack1.push(thing); } @Override public T pop(){ if(this.isEmpty()){throw new StackOverflowError();} return stack1.pop(); } @Override public void … | |
I'm trying to create a list stack that implements some interface called SomeList The list stack should only use stack with no links. the itnerface has a number of methods that I would like to implement. So for SomeList I have something like public interface SomeList<T>{public void plus(T something);public E … | |
This method is supposed to reverse a stack by making a new stack and pushing popped items from this stack to the revertStack and then returning the reverted stack. When I run some tests, it returns an empty stack in stead. Any clues? public LinkedStack<E> reversed() { LinkedStack<E> revertStack = … | |
Reverse method won't work This method is supposed to return a copy of a this object, reversed. So it creates a new stack called that such that when all the items from this are popped onto that, this will reference that and the `reversed()` method will return this. When this … | |
I'm having trouble pinpointing the exact definition of a generic linkedstack class Suppose I have public class LinkedStack<T> { //some variables //would this be right LinkedStack(){ } //for a generic constructor of type T for the LinkedStack class of type T? } | |
I have a stack method that's supposed to return a reversed *copy* of the this object. I need this to link this to that, the reversed copy of the this stack. Thanks public FancyStack<E> reversed() { FancyStack<E> that= new FancyStack<E>(); if(this.isEmpty()){ return this; } else{ while(top!=null) { revertStack.push(pop()); } } … | |
I have a generic LinkedStack class with a LinkedStack reversed method It creates a new LinkedStack say newLinkedstack and pushes items from the current stack by popping them. So at the end of the operation the current stack is left empty and newLinkedStack contains the same items/elements that were in … | |
Hi I'm trying to write a toString() method for a generic LinkedStack but I'm having trouble My class has two push methods. One pushes elements of some type onto the stack. It takes in some generic element and pushes it onto the stack. The other method takes in some generic … | |
Suppose I have a class with a constructor that takes in two strings is it okay to write the constructor this way? public class box{ private String s1; private String s2; public box(**String str1,String str2**){ s1=str1; s2=str2; } } Or can I just say public box(String str1,str2)? | |
consider public class awah{ private int x=0; private int y; private int w; public awah(int width){ w=width; } public void sety(){ y=(Int)(Math.random()*4);}//meth1 public int gety(){ return y; } public void setx (){ x+=this.gety(); } public int getx(){ return x; } public void showUpdate(){ System.out.println(x); } }//end of awah public static … | |
I use dr java for linux to run my code. I've been running into a bunch of errors recently while running this simple program. The code compiles fine but whenever I run the java file, I get the error; Static Error: Undefined name here's my code; (I've got two files, … | |
/*Ok I have code that's behaving unexpectedly The following program is supposed to print prime numbers for n1=100,n2=1000,n3=10000 and n4=100000 except that for n1=100, it prints the squares of primes less than 10. I can implement this same program in c++ and wouldn't get such output. I need another pair … | |
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? | |
Could some one point out what's wrong with the classes of this program? #include <iostream> using namespace std; class box { private: int height; int length; int width; public: box();//constructor int surface_area(); int volume(); void set_dim(int ,int, int); }; //implementation box::box(){ int height; int width; int length;} box::int surface_area(){ int … | |
#include <iostream> #include <string> using namespace std; double distance(double x[],double y[]){ return sqrt((y[0]-x[0])*(y[0]-x[0])+(y[1]-x[1])*(y[1]-x[1])); } int main(){ double d; double x[]={1,2}; double y[]={4,3}; cout<<distance(x[2],y[2])<<endl; //cout<<d<<endl; cin.get(); return 0;} why wont it work I also tried d=distance(x[],y[]); cout<<d<<endl; but it wont work either | |
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; … |
The End.