Code completion in CounterClockWise? - clojure

I am a first-time user of CounterClockWise, the Eclipse plugin for Clojure, and it appears that code completion just won't work. I keep wondering whether the problem lies between my keyboard and my chair, but can't find a solution. I just installed CCW on Galileo build 20090920-1017 and MacOSX. Then I try to write some lines of clojure code, and no code completion widget comes up. I'm using the Java perspective. Am I missing something? I somehow hoped it would work out of the box, as I'm just starting with Clojure.
Many thanks in advance!
Costas

I'm using CCW 0.0.62.STABLE01 and code completion works. Press control space to bring up a list of possible items and as you type, the list is filtered. Press return at any point to accept the first item in the list or use the up/down arrows to select another item. Press esc to dismiss the list.

I found the answer here (http://www.chaomancy.com/blog/clojure-in-eclipse-part-2-counterclockwise-maven.html):
"But most of Counterclockwise's features come to life once you start a REPL. For Counterclockwise is really built around the REPL; without one running, things such as code completion will not work."

I dont see code completion in the ccw list of completed features though I dont know how well this feature list is kept up to date
edit: its now marked completed.

Related

How to make the tutorial from pepper work on setlanguage and dialogue?

its my first time working with pepper and i am working locally on my computer with no connection to a real pepper. I am trying to follow the steps from http://doc.aldebaran.com/2-8/getting_started/helloworld_choregraphe_dialog.html#helloworld-choregraphe-dialog .
I am getting the error messages:
[WARN ] behavior.box :getService:16
_Behavior__lastUploadedChoregrapheBehaviorbehavior_193854592:/Set Language_2: ALSpeechRecognition is not available, language setting
cannot be applied to recognition.
[ERROR] behavior.box
:onInput_onSet:49
_Behavior__lastUploadedChoregrapheBehaviorbehavior_193854592:/Set Language_2: Language English could not be set for one or more
services.
I tried following all steps in the tutorial and removed the german language which i originally intended to use. I have linked the modules correctly as well and would be really happy if you could tell me which mistake i need to fix in order to get it to work.
Thanks in advance and best regards
You most likely forgot to define the projects language.
Click on properties (on the left side of choregraphe, next to the blue cube) and then, on the window that just opened, click the languages of your choice on the right column. Since you are here, don't forget either to give an application id.
Setting the language has no effect on a virtual robot, because it as no TTS or ASR.
You can safely ignore the error or catch it, for instance by adding an onError output wired to the rest of your behavior.

How to know what is in a certain console position, when clicking it

I'm building a simple console checkers game and I'm currently trying to make it possible to move the pieces using the mouse. Currently, my board looks like the following image:
I've already managed to get the coordinates of anywhere I click on the console (using event handling from the windows.h library) but now I would like to know if there's anyway of checking if there is anything written (or any output) on the position I clicked, and if there is, to check what it is that was printed on that position, in order to know if I clicked on a piece or on an empty board cell.
If this is of any importance, I'm considering the pieces as being the character B or P rather than the whole square.
I don't know if providing the code I have would be of any help so I'm gonna post none of it for now, but if it is needed, I'll provide.
I'm just looking for any input regarding the possibility of doing what I asked, not actual code solutions. Thank you

Restarting a program with a key word - re looping?

So I've made a program in class for a project, this is done using C++, which is a menu system with one sub menu, to then deliver correct directions from one location to another,
this involved many else and if statements as well as a while loop. however, i'm wondering if it is at all possible to make it so if the user enters a particular string, to restart from the beginning of the program? such as a small function which is a re director to the top of the code again? so if the user messes up on the first menu, they can type 'back' in and go back to the previous menu?
it sounds easy, and its simple, but i'm having trouble with it, and don't know what the best way to approach this would be, despite how minor it is!
Any help is appreciated
thanks!

help with type of window dialog resource needed

I am writing a windows program (no mfc) and need to output a status line to the operator every few seconds or so. I tried using rich text boxes but after so many hours it seems to hang up. Does anybody have an suggestions on what I can use instead?
People mentioned that my buffers might have been exhausted. I thought I had planned for that. After I had about 1000 lines displayed I would take the first 500 and remove them using the select and cut options in rich text boxes. I still ran into the same problem.
This question appears relevant, and this one too. But they don't give any concrete recommendations for an alternative to rich text boxes.
You might try the Scintilla control (scintilla.org) which does not appear to have any hard limitations on text size. It has a permissive license. It is used by many text editors such as Notepad++, Notepad2, Code::Blocks, FlashDevelop. I haven't tried it personally but there from the documentation it looks easy to use it in a Windows API application. Of course, it might be overkill for your purposes.
If you keep appending to the text in the control every few seconds for hours then you are probably running into some memory constraint on the control or the process. I think you would have this problem with any control you choose given update frequence and how long you're running the program.
Have you considered implementing a simple circular buffer for the content of the text box? Say only keep the last hour's messages. You could maintain a separate log file for history if the operator needed to go back in time for hours.
I ended up writing my own control to do this, essentially duplicating the Output window in Visual Studio. It was a success, but it ended up being much more code than I thought it would be when I started - I insisted on features such as auto-scrolling when the cursor was on the last line, select/copy, bold text, etc. It was backed by a std::deque so I could limit the number of lines stored for the window.
Unfortunately the code belongs to a former employer so I can't share it here.

Keyboard input in games (for GLUT)

Almost every game use keyboard as input. I have been searching for 2 days on this topic and found quite much about it. Keyboards have many disadvantages, but main problems I found are different layouts and second that if you are pressing 3 keys at time, it can lead to corruption (row-column error). If you don't know what I'm talking about, keyboard is made as grid and it checks which row and column has connected. But if you press E,D (row 1,2 column 3)
and R (row 1, column 4), keyboard can show even F because it find it pressed(row 2, column 4 both pressed).
So I think we can't do anything about that second, but if anyone got idea how to solve it better then use keys that don't form L, I'd be glad :)
But my main problem are different keyboard layouts which is real pain. I'm slovak so Slovak layout of numbers look like this:
+ľščťžýáíé and with shift 1234567890, we also got QWERTZ but you can use QWERTY.
You all know how the English look like but just for sure:
1234567890 and shift !##$%^&*()
Most of time I'm using english one because I got used to it when programming. Anyway there are different people using different layouts. When you are making game that depend on which key is pressed, for example good old WASD pattern, you can't use that on french one which is AZERTY layout. It would be strange. Same as using numbers for choosing gun in action game. As you can see slovak would have to press shift to get it work.
I'm also using OpeGL. There is problem when you are mapping which keys are pressed. For example widely used solution to make map of 256 bools for each charakter, is suffering from SHIFT. You press a, SHIFT and release a you got: a down, A up. So I thought about binding some keys together, as A and a, 1 and !, but then I realized I'll just change layout and everything is wrong.
So what is solution for that? I think there is someone out there that is in game industry or made some game and had to solve this. Only solution that comes on my mind is to force english layout for UI (and choosen layout for chat).
After next searching I found what I need but I need cross-platform one:
virtual key codes
And next search revealed SDL key
Result: Don't ever start with GLUT if you go making games, use SFML or SDL
Thanks to everyone for helping me, there were more problems in this so idea of key binding/mapping, SDL and so on, each helped me alot.
If you're getting a "character" every time user presses something, then your keyboard routines aren't suitable for game input - only for text entry.
You need to use input routines that completely ignore keyboard layout switching and operate on some kind of raw keycodes (so when user presses shift+a, you'll know that shift is pressed and that "a" key is pressed, but you won't get "A" character). Also, routines should allow you to query if a key is pressed or not.
For windows that is DirectInput or XInput. For cross-platform this is libsdl and SDL_GetKeyState. And you'll need to provide keymapping options for the user. Glut probably isn't suitable for your task.
The common approach seems to be to ignore the problem. Worse-is-better in its early stage.
Unfortunately I'm using svorak keyboard layout so it really doesn't just work for me.
I've been approaching this same problem by binding into multiple keys on the keyboard. So that player jumps from both x and j -keys. It doesn't do so well in something that isn't shoot-jump -kind of game.
Nice stuff would be if you could just find row/col or some driver-near interface to your keyboard.
Some auto-keyboard configuration software would be neat though I've not yet seen anything like that. Maybe we should write one?
First up, separate keypresses from text entry. You shouldn't care what letter or number comes up when you press a key with shift as well - the operating system should handle that and generate an event you can use in the rare times you need the text. Usually, you should just look for the key press and any shift presses and act on those.
Second, load the bindings from keys to commands from a data file, rather than hardcoding it. Distribute default bindings for QWERTY and whatever default layout you have. If the data format is quite straightforward then people won't mind customising it to fit their keyboard and preferences. You can also add an in-game keybinding editor later.
This isn't really about OpenGL since by default that doesn't care about keypresses. Perhaps you are using an addon library or extension that handles keys for you - ensure that whatever you're using can give you individual key values and the state of shift/alt/ctrl independently, and that it also provides text input via an independent system.
Allow your users to define the keys to use for each action ...
or use the arrow keys .. that should be pretty universal :)
Turn the keyboard input into metadata, so you could allow users to configure at their will but also provide different keyboard shortcuts depending on the keyboard layout used in a config file .