Jump to content

fizzlesticks

Member
  • Posts

    1,196
  • Joined

Everything posted by fizzlesticks

  1. The quotes in the text aren't normal quotes, they're unicode. You can't treat them as normal characters.
  2. run % "chrome.exe" ( winExist("ahk_class Chrome_WidgetWin_1") ? " --new-window " " --incognito " : " " ) url If you don't have a windows already, you use the second part of the ternary which you defined as just " ". It should be something like run % "chrome.exe" ( winExist("ahk_class Chrome_WidgetWin_1") ? " --new-window --incognito" : " --incognito" ) url
  3. The integer version of Random.Range has an exclusive upper bound. When you're trying to place the last element all the the locations are already taken and you end up in an infinite loop.
  4. require is part of Node.js, not JavaScript and js.do doesn't support Node.js code.
  5. You can't just cast from char to int. A char of '0' has a value of 48, not 0. If 0 and 1 are the only things in the file you can do something like ham[ i ] = (input == '0') ? 0 : 1; I have no idea how you're getting -52, try printing out the input as you read it in to see if you're reading things in correctly.
  6. You're also reading in an int which will end up reading the entire line an possibly overflowing. You should be reading in character by character and converting each char to an int (assuming I get what you're trying to do.)
  7. You're reading everything into the same place, overwriting the old value each time.
  8. Your first test code should fail with the same error, you can't cast an Animal to a Dog unless the thing pointed to by the Animal is actually a Dog and in your case it isn't. As M.Yurizaki said, Dog dog; is a declaration, you can't use dog until it has something assigned to it. Any attempt to do anything with it should result in a compile time error. And allocating the memory you need to store the object in. The only way to use a method without a fully constructed object is by declaring it static. And with a static method you call it by using the class name not an instance of the class. So if Bark() was static you would do Dog.Bark() //correct Dog dog; dog.Bark() //compile time error Dog dog = new Dog(); dog.Bark() //compile time error
  9. It failed because 'a' isn't a Dog so you can't convert it to one. You lied to the compiler to get your program to run, don't do that.
  10. That fixes the error you were getting, I don't know enough Qt to tell if what you're doing is correct. Trying running it to find out.
  11. No. imagedepth should be an int.
  12. If you change imagedepth to an int it doesn't have a depth() function anymore. You need to replace imagedepth.depth() with just imagedepth.
  13. Again, image.depth() returns an int not a QImage.
  14. The line you say the error is in. ui->depth->setText(QString("Color Depth: ").arg(imagedepth.depth())); you don't have a variable called imagedepth in the original code.
  15. image.depth() returns an int, so depth should be an int. The error you get after that is because it looks like you copy/pasted "depth" in the middle of image.depth() instead of replacing it. It should either just be "depth" or "image.depth()".
  16. No it doesn't. If Dog overrides a "Speak" method from Animal, and you do "a.Speak" you still call the Dog version of Speak that has access to all of Dog's members.
  17. Only true in C++-like languages that allow you to have direct access to objects (as opposed to a pointer to object.) In languages like Java where everything is a pointer, you can do Dog dog = new Dog(); Animal a = (Animal)dog; Dog dog2 = (Dog)a; without losing any information. You won't have access to Dog's methods or variables while it's an Animal but they're all still there and you can convert back to a Dog without losing anything.
  18. Yes, it's the PATH variable. It tells your program where to search to find the jvm.dll and java.dll it needs. The first parameter to voce::init() is the Java class path. It tells the JVM where to find the Voce .jars you're using. "." means the current directory.
  19. Please post your actual code, not something that looks kind of similar.
  20. #include <thread> #include <chrono> #include "voce.h" int main() { voce::init(".", true, false, "", ""); voce::synthesize("fizzle sticks"); std::this_thread::sleep_for(std::chrono::seconds(1)); voce::destroy(); return 0; } You'll need to: add "<Java jdk dir>/include" and "<Java jdk dir>/include/win32" to your c++ include path link with "jvm.lib" found in "<Java jdk dir>/lib" add "<Java jdk dir>/jre/bin" and "<Java jdk dir>/jre/bin/client" to your system path have the Voce .jar files next to your .exe (or change the first parameter to voce::init) I think that's all...
  21. In C++ they're called member functions. edit: Not that it really matters.
×