So far, I am planning to simulate a CAD system on a city bus. I am in the beginning phases of it which is just to basically create the voice. I at this point have no experience with creating voice objects. My question is, how would I create a voice object to read off the following messages?  import java.util.*; import java.io.*;  public class message {   public static void main(String[] args) {     Scanner input = new Scanner(System.in);     String message = "";     System.out.print("Please enter a number between 1 through 5");     int num = input.nextInt();     if (num == 1)       message = "Please do not use profanity on the bus";     if (num == 2)       message = "Help us get you there faster. If able, please use the rear exit";     if (num == 3)       message = "Please remember, seats are not for feet.";     if (num == 4)       message = "Thank you for using headphones, also please keep your cell phone conversations quiet.";     if (num == 5)       message = "Please do not speak with the driver while the bus is moving.";     System.out.println(message);   } }   So far, I set this up to print it on the LED display, I am trying to figure out still how I would incorporate the voice into this system for it to say the messages whenever I select one. Any help would be appreciated.
120735
I'm now in search for a Java Text to Speech (TTS) framework. During my investigations I've found several JSAPI1.0-(partially)-compatible frameworks listed on , as well as a pair of Java TTS frameworks which do not appear to follow JSAPI spec (, ). I've also noted that currently no reference implementation exists for JSAPI.  Brief tests I've done for FreeTTS (first one listed in JSAPI impls page) show that it is far from reading simple and obvious words (examples: ABC, blackboard). Other tests are currently in progress.  And here goes the question (6, actually):   Which of the Java-based TTS frameworks have you used? Which ones, by your opinion, are capable of reading the largest wordbase? What about their voice quality? What about their performance? Which non-Java frameworks with Java bindings are there on the scene? Which of them would you recommend?   Thank you in advance for your comments and suggestions.
110820
I'm currently making a callout to a 3rd party vendor and I'm getting a huge response. What is currently messing me up is this section:   "MessageSeq":13,"Description":"config file: config-qa1.txt\"","MessageTS":"2014-02-17T14:46:58","MessageLevel":4,"IsSystemMessage":false   As you can see here, the portion at the end of the Description value is ended with backslash double quote. If I attempt to parse this via the JSONParser I get an exception. Does anyone have an recommendations on how to resolve this?  Exception Message:  System.JSONException: Unexpected character ('"' (code 34)): was expecting comma to separate OBJECT entries at [line:1, column:3699]  Updated with sample Code   public class ResponseWrapper{     // fields from JSON to auto map     public Integer messageSeq;     public String Description;     public String messageTS;     public Integer messageLevel;     public Boolean isSystemMessage;     // parsing fields     private ResponseWrapper theResponse;     private JSONParser parser;      public void parse(String jsonString){         parser = JSON.createParser(jsonString);         parseJSON();     }      private void parseJSON(){            while (parser.nextToken() != null) {             if (parser.getCurrentToken() == JSONToken.START_OBJECT) {                 theResponse = (ResponseWrapper)parser.readValueAs(ResponseWrapper.class);                            }         }     } }  String responseString = '{"MessageSeq":13,"Description":"config file: config-qa1.txt\"","MessageTS":"2014-02-17T14:46:58","MessageLevel":4,"IsSystemMessage":false}'; system.debug('\n\nBEFORE\n' + responseString); ****Place code in here to test such as ReplaceALL*** ResponseWrapper parser = new ResponseWrapper(); parser.parse(responseString);
34848
I used to use the implicit call of toString when wanting some debug info about an object, because in case of the object is null it does not throw an Exception.  For instance:    System.out.println("obj: "+obj);   instead of:  System.out.println("obj: "+obj.toString());   Is there any difference apart from the null case? Can the latter case work, when the former does not?  Edit: What exactly is done, in case of the implicit call?
102897
Anyone working on the Android ('gPhone') have or know of a place where I can find a good ORM tool for it? The code is written in Java, and the database is SQLite. What I would like to find is a tool that given the object definition, can auto-generate the tables and the CRUD functions (that would be awesome), or, barring that, a tool that can take the table definition, the object definition, and auto-generate the CRUD functionality. The rub is that all of this must happen within the Android framework, which has its own conventions as to how database access works.
81129
I have an ArrayList that I want to output completely as a String. Essentially I want to output it in order using the toString of each element separated by tabs. Is there any fast way to do this? You could loop through it (or remove each element) and concatenate it to a String but I think this will be very slow.
96218
I came across this code and wanted others to provide their point of view... is it good or bad ? ;)  Class ReportClass {  public string ReportName {get; set;} }   Then it was used as follows in code:  displayReport(ReportClass.ReportName = cmbReportName.SelectedValue.ToString())   That is about the simplest form example I can give you. Quetion is... why can't I find examples ? What would this be called? Is this just asking for trouble?  EDIT: I'm referring to the inplace assignment. Which I wasn't aware of until today
37382
I'm a C++ guy learning Java. I'm reading Effective Java and something confused me. It says never to write code like this:  String s = new String("silly");   Because it creates unnecessary String objects. But instead it should be written like this:  String s = "No longer silly";   Ok fine so far...However, given this class:  public final class CaseInsensitiveString {     private String s;     public CaseInsensitiveString(String s) {         if (s == null) {             throw new NullPointerException();         }         this.s = s;     }     :     : }  CaseInsensitiveString cis = new CaseInsensitiveString("Polish"); String s = "polish";    Why is the first statement ok? Shouldn't it be   CaseInsensitiveString cis = "Polish"; How do I make CaseInsensitiveString behave like String so the above statement is OK (with and without extending String)? What is it about String that makes it OK to just be able to pass it a literal like that? From my understanding there is no "copy constructor" concept in Java?
17591
I have a project which enable to execute commands with the voice, .  How can I publish it on the ubuntu's software center?
53621
I have an idea of how to get started, but not sure where to go from there.  Since I am using two 3-8 decoders to develop a 4-to-16 decoder, I want to use 4 inputs out of the two 3-8 decoders.  So I'll use all three of the first and the first of the second, and connect the last two inputs to ground, since they won't be used.  Any pointers on where to go from here are appreciated.
117520
How to write an algorithm in an article in \documentclass{clv2}, can anybody send me a working model with dummy algorithm, because I guess \caption is creating problem. I want to send it to Computational Linguistics journal by MIT press but it is giving lots of errors.
83954
I'd like to know how this text gets adapted onto these 3D models. Could it be a PNG  which gets mapped. Or is this text pre planned how it would be layout onto the model? what's the method involved in this technique? Would the text layout need to be the same ratio done with a graphic editor like Photoshop or Illustrator? and have the mesh modelled in the same metric unit so the text can later fall correctly in place? All information is appreciated, unfortunately my college instructors are really lame in giving information....  Thank you.
106842
Hello guys I'm try to make some games that have more to it than just simple high score scrolling shooters etc.  I'm trying to design my own systm of handling narrative. I want to be able to place NPC's in the game world, with scripts attached to them. Some of the NPC's would just have n random greetings. Others will be mission givers and will offer you a quest of sorts. (The quest could be go speak to Bob in the pub, or it might be bring me the Holy Grail and Crown Jewels, or something in between).  I've wracked my brain for a long while over this but sadly keep slipping back to the only way I know how, which is to manually code all the strings that people can say and have a horrible web of if statements and other such insanity to give me a rudimental dialogue system. Its not good enough even with just a few characters, but if I had dozens/hundreds of characters it would be even worse.  I've read lots about it already but I'm still very confused when I start trying on my own project. I've read that Json/XML might be the way to go and that I can add custom markups in the Json text to call methods in my code, but I dont even know if this is right and if so how I can do it.  The back of my brain is screaming at me that there is a simpler way to do it, but I've sat here for a very long time without managing to think of ideas.  Here is a diagram I drew which pretty much shows the flow of how I want my NPC to behave. If anyone can see this and then tell me how they might do something like this that would be fantastic!! (note: if Json is the correct advise, please give me a exact example of how exactly to format the Json in order to check the bools I mention in my flowchart - thanks!):    note: The circles denote an output from the data as Text for the dialogue system. The bools will need to be checked against by the data file to see which output to give (hope that makes sense and is possible)
35138
I am an electronic engineer so I am thinking about this from an electronics outlook.  How does the addressing system work, As I see it, the nervous system is small parallel branches attached to larger "serial" lines (spinal cord).  The serial line is then attached to the brain, but how does it then figure out where the message came from and then get the message back to the place it came from.  If I were to build a robot I would have an addressing system with each message and maybe some kind of error checking to make sure the messages don't become corrupted, but as it's not an electronic system I don't see how the brain could possibly do this. unless it is a fully parallel system and there is a single wire going from every sensor back to the CPU..
99201
Is there a way to change text during an animation? Something like a readout that could show distance traveled. And have it displayed on the screen of the animation.
49900
I need help with a script for a very simple car that uses transform.Translate:  public class car1 : MonoBehaviour {      public PauseMenu pause;     [Space]     public Car_Script car_s;     public float speed;     public GameObject car;      void FixedUpdate()     {          if (car_s.InCar == true)         {             if(pause.isPaused == false)             {                 if (Input.GetKey(KeyCode.W))                 {                     car.transform.Translate(Vector3.forward * Time.deltaTime * speed);                      if (Input.GetKey(KeyCode.A))                     {                         if (speed &lt;= 0)                         {                         }                         else                         {                             if (speed &gt; 0F &amp;&amp; speed &lt;= 50F)                             {                                 car.transform.Rotate(Vector3.down, 2F);                             }                             else if (speed &gt; 50F &amp;&amp; speed &lt; 90F)                             {                                 car.transform.Rotate(Vector3.down, 1.3F);                             }                             else if (speed &gt; 90F)                             {                                 car.transform.Rotate(Vector3.down, 0.9F);                             }                          }                     }                     if (Input.GetKey(KeyCode.D))                     {                         if (speed &lt;= 0)                         {                         }                         else                         {                             if (speed &gt; 0F &amp;&amp; speed &lt;= 50F)                             {                                 car.transform.Rotate(Vector3.up, 2F);                             }                             else if (speed &gt; 50F &amp;&amp; speed &lt; 90F)                             {                                 car.transform.Rotate(Vector3.up, 1.3F);                             }                             else if (speed &gt; 90F)                             {                                 car.transform.Rotate(Vector3.up, 0.9F);                             }                          }                     }                 }             }         }     } }   Whenever I drive the car it immediately goes through walls.   I have colliders on everything. The car has mesh colliders set to convex.   I've searched around quite a bit for answers and it seems that a common one is using rigid bodies. But whenever I even put a rigid body on the car, it flies out into the sky.
58025
I simply want one command block to test for the time of day or night (e.g. time = 18000) and output a message in the chat to everyone if that time returns true.  I was trying a simple set-up with two command blocks and a comparator in the middle, but I'm a beginner and am obviously missing the correct syntax (especially to test for a particular time of day, and if true, then trigger the say "message" block).  ETA: Kudos to @Ben for the Daylight Sensor/Redstone idea, but I'd really prefer a Command Block solution for the above, since my plan is to output several messages during the day and night cycle at very specific times in the world. Thanks.
118025
For a lab exercise I have to design a 2-input sequence and Im struggling with the state diagram, as It has 2 inputs, i've designed it with one input before. the sequence to be detected is 1032 which can be written as:      \$ A_{0} \text{ |  0 0 1 1} \$   \$ A_{1} \text{ |  1 0 1 0} \$   So how should I go about designing this state diagram?