Our new Indie Games subforum is now open for business in G&T. Go and check it out, you might land a code for a free game. If you're developing an indie game and want to post about it,
follow these directions. If you don't, he'll break your legs! Hahaha! Seriously though.
Our rules have been updated and given
their own forum. Go and look at them! They are nice, and there may be new ones that you didn't know about! Hooray for rules! Hooray for The System! Hooray for Conforming!
SELECT * FROM posts WHERE tid = 'PA PROGRAMMING THREAD'
Posts
I'd disagree. Generally you have to iterate through the results either way. Mostly this is a UI attachment so iterating through it is to show it on the screen in some fashion. In this case it tosses it in a list view from an array.
But that's been changed .PerformAction() returns an array of objects and then I do :
I used a Scene (which is imported from org.netbeans.api.visual.widget.Scene) as a tabbed pane component. Mainly because I need to be able to drag/drop a widget into it. I've tested it, and it works. I'm able to put two tabs, each with Scenes and change the background color of each and they show up properly.
The problem now is adding to that Scene. I thought using tabbedPane.getSelectedComponent() would give me a Scene since that's the component inside. But it doesn't. This is the code I'm using:
System.out.println("CLASS: " + getJTabbedPane().getSelectedComponent().getClass());This outputs:
So I figure I could typecast the SceneComponent to a Scene, right? Nope. When I do that I get an inconvertable types error. Then I try to typecast it as a SceneComponent, but it doesn't know what a SceneComponent is. So I'm stuck. How do I get the original scene that is inside the tabbed pane?
I'm not sure what you mean. Are you talking about error checking?
In your case Scene and SceneComponent are both of "widget" type. Use that as the object you use to add a tab. Obviously you made your function accept a Scene type object right? Change that. This is the power of polymorphism.
//function to add widgets as tabs private void addTab(Widget TheWidget) { //add it to the window here? } public void DragDropPassEventThing(//yadda) { //somewhere else Widget tabWidge1 = new Scene("Tab1"); Widget tabWidge2 = new SceneComponent("Tab2"); this.addTab(tabWidge1); this.addTab(tabWidge2); }This way your function can take either of those types of components and use them as tabs.
This would work except I need scenes because I am going to be adding the Widgets TO that scene. Each tab will have it's own Scene with it's own Widgets on that scene. Scene is the parent of all the Widgets... Hopefully this makes sense. So far my SceneTabbedPane is working like a champ.
such as:
&filter[filters][0][value]=thing
Yeah I'm not sure what/why/how it's doing that, honestly.
I initially went with Jmock based on nothing more than google result listings, but a friend just introduced me to Mockito, which looks to be about 100x more streamlined, and more along the lines of Rhino.Mocks, which I use for my .Net work.
Anywho, just thought I'd toss that out for general informative purposes.
PS - Explaining why mocking and unit testing is in general a good thing for verification and validation to someone who has hobby coded, but nothing of any real size, since before I was out of diapers is surprisingly hard.
I just watched this talk on creating a bridge between Java bytecode and the .Net CLR. The main thrust is IKVM lets you use libraries from Java in .Net nearly seamlessly.
Keep an eye out towards the end for the presenter running Eclipse, on the CLR faster than the original Java-bytecode parent.
Yep. I looked at the API as well.
saw this and thought maybe a few of you could use it.
I said libary a lot... when I was around the age of 12.
I am sure it's not completely true, but you do an excellent job of making everyone you work with sound like a mouth breathing pants on head idiot.
With my deepest apologies
Hah. No comment.
Library::Library() { int numCards = 0; int numBooks = 0; std::vector<Book> booklist; std::vector<Card> cardlist; } Library::Library(std::string file1, std::string file2) { int numCards = 0; int numBooks = 0; std::vector<Book> booklist; std::vector<Card> cardlist; std::ifstream inBook, inCard; inBook.open(file1.c_str()); inCard.open(file2.c_str()); std::string title; std::string author; std::string ISBN; std::string status; std::string holderID; std::string name; std::string phone; std::string cardID; std::string bookID; do { if (!inBook.eof()) { getline(inBook, title); getline(inBook, author); getline(inBook, ISBN); getline(inBook, status); getline(inBook, holderID, '\n'); Book tempbook(title, author, ISBN, status, holderID); booklist.push_back(tempbook); numBooks++; }; } while (!inBook.eof()); do { if (!inCard.eof()) { getline(inCard, name); getline(inCard, phone); getline(inCard, cardID); getline(inCard, bookID, '\n'); Card tempcard(name, phone, cardID, bookID); cardlist.push_back(tempcard); numCards++; }; } while (!inCard.eof()); std::vector<Book>::iterator it; for (it=booklist.begin(); it<booklist.end(); it++) { std::cout << it->getTitle() << std::endl; std::cout << it->getAuthor() << std::endl; std::cout << it->getISBN() << std::endl; std::cout << it->getStatus() << std::endl; std::cout << it->getHolder() << std::endl << std::endl; }; }Sort of. By doing:
Library::Library() { int numCards = 0; int numBooks = 0; std::vector<Book> booklist; std::vector<Card> cardlist; }You're creating numCards, numBooks, booklist and cardlist as local variables in the constructor, not member variables of the class.
Compare with:
void testFunction( void ) { int localCopy; // This variable only exists in testFunction() }This is what you're doing. This is why you are seeing the vectors being destroyed after calling the constructor... and I suspect that you've made the same mistake in the member functions.
To use member variables instead of creating local variables:
Library::Library() { numCards = 0; // They already exist numBooks = 0; }assuming that you declared them in the Library class by doing something like:
class Library { public: // ... private: int numCards, numBooks; std::vector<Book> booklist; std::vector<Card> cardlist; };Thanks! That solves my main problem, and now I just have to write up the documentation and I'm done.
Plus, Lua is pretty fun compared to Java. It's at least a nice break.
Sure enough, Readability has an associated gem for their library (Readit); however, Readit assumes that you have an access token/secret before you start. I decided to try doing this with XAuth and I'm not sure what I'm doing wrong:
require 'highline/import' require 'yaml' require 'oauth' require 'readit' config = YAML.load_file("config/readability.yaml") uname = ask ("Username: ") passwd = ask ("Password: ") {|q| q.echo = false} consumer = OAuth::Consumer.new(config["-consumer_key"], config["-consumer_secret"], :site => "https://www.readability.com/api/rest/v1/oauth/access_token/") access_token = consumer.get_access_token(nil, {}, {:x_auth_mode => 'client_auth', :x_auth_username => uname, :x_auth_password => passwd})Running this and giving my username/password gets me:
I'm not sure what I'm doing wrong. That URL to readability's site seems to be right, and uname and passwd have the values I expect them to have before I make the get_access_token call.
Other than that, look at the line in the code it's specifying is causing the error to see what URL it might be trying to access and where that comes from is my advice.
http://0x10c.com/doc/dcpu-16.txt
Its a 16bit assembler spec for a new game Notch is apparently working on.