Search Results

Search found 1108 results on 45 pages for 'silly rabbit'.

Page 1/45 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • SpringSource rachète Rabbit Technologies, société à l'origine de la solution AMQP Rabbit MQ

    Et une acquisition de plus pour SpringSource ! Non content d'avoir déjà une bonne assise dans le domaine de messaging en employant plusieurs commiter sur ActiveMQ, SpringSource rachète aquiert Rabbit Technologies. Rabbit Technologies est la société derrière RabbitMQ, qui est une implémentation d'un serveur AMQP. Ce protocol, contraitement à JMS qui n'a pour objectif de fournir une API d'accès, à pour but de standardiser tout le système de messaging allant des différents mode de transmission au format de messages. Grâce à cela, tout serveurs compatibles AMQP peuvent commiquer entre eux, indépendamment du langage dans lequel ils sont implémenté ou le système sur lequel il tourne.

    Read the article

  • What's the point of Rabbit MQ? [duplicate]

    - by bad_boy
    This question already has an answer here: When to use Advanced Message Queuing Protocol like RabbitMQ? [closed] 2 answers First of all, let me say, I have no problem following tutorials. The problem is that I don't understand why even Rabbit MQ is ever needed. And there's no such explanation on tutorials - they only show what to do and how to use, but not when its usage is the case. Can you explain this? Why would you want to use Rabbit MQ? To solve what problem?

    Read the article

  • Trouble installing Rabbit VCS for nautilus

    - by Ranhiru Cooray
    I am using Ubuntu 11.10 and following instructions mentioned here to install Rabbit VCS. I added the PPA properly, did a sudo apt-get update and ran sudo apt-get install rabbitvcs-core rabbitvcs-nautilus rabbitvcs-thunar rabbitvcs-gedit rabbitvcs-cli There were dependency issues and I googled a bit and found out that I need to install RabbitVCS only for nautilus as that is the default file manager for Ubuntu. So I ran the install commands separately for rabbitvcs-core, rabbitvcs-gedit and rabbitvcs-cli. Now my understanding is that those are installed properly. However when I run the install command for rabbitvcs-nautilus, I still get a dependency issue. ranhiru@ranhiru-HP-HDX16-NoteBook-PC:~$ sudo apt-get install rabbitvcs-nautilus Reading package lists... Done Building dependency tree Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies: rabbitvcs-nautilus : Depends: nautilus (< 1:3.0~) but 1:3.2.1-0ubuntu2 is to be installed Depends: python-nautilus (< 1.0~) but 1.0-0ubuntu2 is to be installed E: Unable to correct problems, you have held broken packages. How do I solve this?

    Read the article

  • Silly Developers, VirtualBox Is For Sysadmins!

    - by rickramsey
    That's one of my favorite bumper stickers. (Well, along with the sticker placed upside down on Jeep windows that says "If you can read this, roll me over.") I don't object to the "silly boys" sticker because, in my humble opinion, girls look much cuter in Jeeps than guys do. But as Ginny Henningsen points out, a similar sentiment can be applied to Oracle VM VirtualBox. While writing her other sysadmin-related articles for OTN, Ginny horsed around with VirtualBox so much that she fell in love with it. Not as a developer, but as a sysadmin. Read why she thinks it's such a great sysadmin tool: My New Favorite Sysadmin Tool: Oracle VM VirtualBox Here are some of Ginny's other articles: How I Simplified Oracle Database Installation on Oracle Linux Best Way to Update Software With IPS Best Way to Automate ZFS Snapshots and Track Software Updates Best Way to Update Software in Zones - Rick Ramsey Website Newsletter Facebook Twitter

    Read the article

  • Techie Land Silly Questions

    - by GeekAgilistMercenary
    Ok, it is time for an off the cuff, random, oddball, just for fun blog entry.  Two questions for the readers in Internet Land. Question #1:  If you did not have to work, had a few dollars stashed away so that you could live comfortably and do whatever you wanted, what would you do?  Would you still code?  Would you still create?  What would you create?  Would you be able to stay idle? Question #2:  Based on whatever you did with your free time, what would you title yourself?  Chief Potato Masher, Pencil Pushing Writer o’ Stories, or Coffee Endeavorer o’ Tastiness? There are a million possibilities, I would love to know what you would call yourself, so please do leave a comment or three. I will have my answers later in the week.  So stay tuned and help me out with some comments.  You can bet it will include something along the lines of what I already do, but I'll keep it a secret until then.  : )  Feel free to check out the original entry here to leave a comment.

    Read the article

  • The Linux Foundation Store: Linux gets silly

    <b>Cyber Cynic:</b> "...the Linux Foundation, the non-profit organization dedicated to growing Linux, has launched a new Linux merchandise store featuring a line of exclusive and original T-shirts, hats, mugs and other items that reflect "geek culture.""

    Read the article

  • How do developer get rid of silly requirements?

    - by sugar
    Hmm ! First of all let me give you the note of the requirement. So that you can have idea what kind of problem I am facing. Words From Project Manager : Hey ! Sugar, I am assigning you a task for developing a framework. This framework is supposed to be developed for all iOS application. Please go through brief of the required framework. It should be able to detect the thickness of my Thumb. It should be able to detect whether User is using thumb or Fingers If user is using thumbs/Fingers, Framework should calculate the size of thumb/fingers. Once size is been calculated, all elements of user interface should arranged & resized automatically. ( not specified how & where as its framework - it should be smart enough to arrange automatically ) If thumb size is larger elements should get arranged near by center area of iPad/iPhone If thumb size is smaller elements should get arranged near by corners of iPad/iPhone If thumb size is larger, fonts of all elements should get smaller. ( assuming = aged person ) If thumb size is smaller, fonts of all elements should get larger. ( assuming smaller thumb = low aged person ) Summary : This framework is required for creating user-friendly user-interfaces programmatically. We need to develop a very developer-friendly framework. Framework should be developed in such a way that we can use in as many projects as needed. Well, I am a developer. What I want to have as an answer is as follows. How to describe them - the way of they thinking is bit ridiculous ? How do I explain them - we can better concentrate on developing actual projects ? How do I convince them - that this kind of things even if possible, is not recommended to develop such things ? How do I say politely, gently & respectfully NO to this ? What should I say, So that they can not point at my experience ? ( e.g. you are 3 years experienced guy & you must have abilities to develop such things ) Feeling horror. Please help. Thanks in advance, Sugar. Note : Please help me to tag this question properly. I am stuck & this is real situation. Frustrated & tensed. You guys might have faced such requirements from TopLevel. requesting you to help with your experience. Well ! I came to know that - those TOPLEVEL guys don't have any idea of iPad, iPhone, Apple etc. I would do one thing. Sir, before we go further for framework development. It is strongly recommended to read Apple Human Interface Guidlines.

    Read the article

  • 12c - Silly little trick with invisibility...

    - by noreply(at)blogger.com (Thomas Kyte)
    This is interesting, if you hide and then unhide a column - it will end up at the "end" of the table.  Consider:ops$tkyte%ORA12CR1> create table t ( a int, b int, c int );Table created.ops$tkyte%ORA12CR1>ops$tkyte%ORA12CR1> desc t; Name                                                  Null?    Type ----------------------------------------------------- -------- ------------------------------------ A                                                              NUMBER(38) B                                                              NUMBER(38) C                                                              NUMBER(38)ops$tkyte%ORA12CR1> alter table t modify (a invisible);Table altered.ops$tkyte%ORA12CR1> alter table t modify (a visible);Table altered.ops$tkyte%ORA12CR1> desc t; Name                                                  Null?    Type ----------------------------------------------------- -------- ------------------------------------ B                                                              NUMBER(38) C                                                              NUMBER(38) A                                                              NUMBER(38)Now, that means you can add a column or shuffle them around.  What if we had just added A to the table and really really wanted A to be first.  My first approach would be "that is what editioning views are great at".  If I couldn't use an editioning view for whatever reason - we could shuffle the columns:ops$tkyte%ORA12CR1> alter table t modify (b invisible);Table altered.ops$tkyte%ORA12CR1> alter table t modify (c invisible);Table altered.ops$tkyte%ORA12CR1> alter table t modify (b visible);Table altered.ops$tkyte%ORA12CR1> alter table t modify (c visible);Table altered.ops$tkyte%ORA12CR1>ops$tkyte%ORA12CR1> desc t; Name                                                  Null?    Type ----------------------------------------------------- -------- ------------------------------------ A                                                              NUMBER(38) B                                                              NUMBER(38) C                                                              NUMBER(38)Note: that could cause some serious invalidations in your database - so make sure you are a) aware of that b) willing to pay that penalty and c) really really really want A to be first in the table!

    Read the article

  • Rails: Passing new child object placeholder (build) to parent view

    - by Meltemi
    I've got 2 classes of objects... Magician has_many Rabbits and Rabbit belongs_to Magician. When viewing a Magician (show.html) I'd like to list all the associated Rabbits and then have some blank fields with a submit button to add a new Rabbit. To do so I build a new rabbit (associated to the current magician) in the Magician's show method (below). Edit2: found way to make it work but not sure if it's the "Rails way"? see comments inline (below): If I build the rabbit in Magician's show method then when show is rendered an empty (and invalid) rabbit ends the list before the new rabbit form fields are then shown. If I build it in the view itself then everything works & renders correctly. I was led to believe that we should not be doing this type of stuff in the view...if so, what's the proper way to address this? #/app/controllers/magicians_controller.rb class MagiciansController < ApplicationController respond_to :html, :json def show @magician = Magician.find(params[:id]) @rabbit = @magician.rabbits.build # <=== build here and empty rabbit gets # included in @magician.rabbits when they're rendered... # but is NOT included in @magician.rabbits.count for some reason?!?!? respond_with(@magician) end ... end #view/magicians/show.html.haml %p %b Name: = @magician.name %h2 Rabbits = "There are #{pluralize(@magician.rabbits.count, "rabbit")}" = render @magician.rabbits, :target => @magician %h2 Add a rabbit: - @rabbit = @clown.rabbits.build -# <=== build here and everything SEEMS to work = render :partial =>"rabbits/form", :locals => { :parent => @magician, :foreign_key => :magician_id, :flash => flash } Edit1: Adding generated html from partial as per request: <p> <b>Rabbit:</b> <b>Color:</b> | <b>ID:</b> <a href="/magicians/2/rabbits" data-confirm="Sure? A bunny will die" data-method="delete" rel="nofollow">Kill Rabbit</a> </p> And I suppose you probably want to see the partial that generates this: %p %b Rabbit: = rabbit.name %b Color: = rabbit.color | %b ID: = rabbit.id = link_to("Kill Rabbit", [target, rabbit], :method => :delete, :confirm => "Sure? A bunny will die")

    Read the article

  • firefox addons and their silly news tabs

    - by jettero
    Something like 30% of the addons I have in firefox update every other week and feel the need to pop open a tab about how awesome they are and all the cool things they changed. I just don't care at all and I'm very annoyed by these news tabs. When firefox opens, I want to see my home page. I've been looking for an addon to disable or kill them before I even have to look at them. Rather like addblock-for-addons. Short of finding a plugin that disables them, I'm seeking information about common interfaces so I can try to figure it out on my own. I'm wondering if I could do it in greasemonkey somehow. For example, is there something common about the url for the tabs?

    Read the article

  • Flushing a queue using AMQP, Rabbit, and Ruby

    - by jeffshantz
    I'm developing a system in Ruby that is going to make use of RabbitMQ to send messages to a queue as it does some work. I am using: Ruby 1.9.1 Stable RabbitMQ 1.7.2 AMQP gem v0.6.7 (http://github.com/tmm1/amqp) Most of the examples I have seen on this gem have their publish calls in an EM.add_periodic_timer block. This doesn't work for what I suspect is a vast majority of use cases, and certainly not for mine. I need to publish a message as I complete some work, so putting a publish statement in an add_periodic_timer block doesn't suffice. So, I'm trying to figure out how to publish a few messages to a queue, and then "flush" it, so that any messages I've published are then delivered to my subscribers. To give you an idea of what I mean, consider the following publisher code: #!/usr/bin/ruby require 'rubygems' require 'mq' MESSAGES = ["hello","goodbye","test"] AMQP.start do queue = MQ.queue('testq') messages_published = 0 while (messages_published < 50) if (rand() < 0.4) message = MESSAGES[rand(MESSAGES.size)] puts "#{Time.now.to_s}: Publishing: #{message}" queue.publish(message) messages_published += 1 end sleep(0.1) end AMQP.stop do EM.stop end end So, this code simply loops, publishing a message with 40% probability on each iteration of the loop, and then sleeps for 0.1 seconds. It does this until 50 messages have been published, and then stops AMQP. Of course, this is just a proof of concept. Now, my subscriber code: #!/usr/bin/ruby require 'rubygems' require 'mq' AMQP.start do queue = MQ.queue('testq') queue.subscribe do |header, msg| puts "#{Time.now.to_s}: Received #{msg}" end end So, we just subscribe to the queue, and for each message received, we print it out. Great, except that the subscriber only receives all 50 messages when the publisher calls AMQP.stop. Here's the output from my publisher. It has been truncated in the middle for brevity: $ ruby publisher.rb 2010-04-14 21:45:42 -0400: Publishing: test 2010-04-14 21:45:42 -0400: Publishing: hello 2010-04-14 21:45:42 -0400: Publishing: test 2010-04-14 21:45:43 -0400: Publishing: test 2010-04-14 21:45:44 -0400: Publishing: test 2010-04-14 21:45:44 -0400: Publishing: goodbye 2010-04-14 21:45:45 -0400: Publishing: goodbye 2010-04-14 21:45:45 -0400: Publishing: test 2010-04-14 21:45:45 -0400: Publishing: test . . . 2010-04-14 21:45:55 -0400: Publishing: test 2010-04-14 21:45:55 -0400: Publishing: test 2010-04-14 21:45:55 -0400: Publishing: test 2010-04-14 21:45:55 -0400: Publishing: goodbye Next, the output from my subscriber: $ ruby consumer.rb 2010-04-14 21:45:56 -0400: Received test 2010-04-14 21:45:56 -0400: Received hello 2010-04-14 21:45:56 -0400: Received test 2010-04-14 21:45:56 -0400: Received test 2010-04-14 21:45:56 -0400: Received test 2010-04-14 21:45:56 -0400: Received goodbye 2010-04-14 21:45:56 -0400: Received goodbye 2010-04-14 21:45:56 -0400: Received test 2010-04-14 21:45:56 -0400: Received test . . . 2010-04-14 21:45:56 -0400: Received test 2010-04-14 21:45:56 -0400: Received test 2010-04-14 21:45:56 -0400: Received test 2010-04-14 21:45:56 -0400: Received goodbye If you note the timestamps in the output, the subscriber only receives all of the messages once the publisher has stopped AMQP and exited. So, being an AMQP newb, how can I get my messages to deliver immediately? I tried putting AMQP.start and AMQP.stop in the body of the while loop of the publisher, but then only the first message gets delivered -- though strangely, if I turn on logging, there are no error messages reported by the server and the messages do get sent to the queue, but never get received by the subscriber. Suggestions would be much appreciated. Thanks for reading.

    Read the article

  • Silly c# array question

    - by XO
    Element 0 value: TimeEntries[0] = "False,S,16:00,21:00"; Element 0 is assigned to: timeLine = USER.TimeEntries[i]; I want to perform a .Split() on timeLine but it must be a string. What's the easiest way to go about this? Thanks

    Read the article

  • Silly CSS ref problem.

    - by Lucifer
    Hi All, I am having a very weird problem. I cannot for the life of me figure it out. The code for my page (at the moment), is this: <link rel="stylesheet" href="assets/css/default.css" /> But, why does it not load the stylesheet? When I move the stylesheet into the same location as the index.html page, and then change the references to it to point to the root dir, it works again? It never wants to work if the stylesheet is any more than 1 directory deep. Is this normal? Or should it still work?

    Read the article

  • Is this trivial function silly?

    - by Chas. Owens
    I came across a function today that made me stop and think. I can't think of a good reason to do it: sub replace_string { my $string = shift; my $regex = shift; my $replace = shift; $string =~ s/$regex/$replace/gi; return $string; } The only possible value I can see to this is that it gives you the ability to control the default options used with a substitution, but I don't consider that useful. My first reaction upon seeing this function get called is "what does this do?". Once I learn what it does, I am going to assume it does that from that point on. Which means if it changes, it will break any of my code that needs it to do that. This means the function will likely never change, or changing it will break lots of code. Right now I want to track down the original programmer and beat some sense into him or her. Is this a valid desire, or am I missing some value this function brings to the table?

    Read the article

  • Silly Objective-C inheritance problem when using property

    - by Ben Packard
    I've been scratching my head with this for a couple of hours - I haven't used inheritance much. Here I have set up a simple Test B class that inherits from Test A, where an ivar is declared. But I get the compilation error that the variable is undeclared. This only happens when I add the property and synthesize declarations - works fine without them. TestA Header: #import <Cocoa/Cocoa.h> @interface TestA : NSObject { NSString *testString; } @end TestA Implementation is empty: #import "TestA.h" @implementation TestA @end TestB Header: #import <Cocoa/Cocoa.h> #import "TestA.h" @interface TestB : TestA { } @property NSString *testProp; @end TestB Implementation (Error - 'testString' is undeclared) #import "TestB.h" @implementation TestB @synthesize testProp; - (void)testing{ NSLog(@"test ivar is %@", testString); } @end

    Read the article

  • General ORM design question

    - by Calvin
    Suppose you have 2 classes, Person and Rabbit. A person can do a number of things to a rabbit, s/he can either feed it, buy it and become its owner, or give it away. A rabbit can have none or at most 1 owner at a time. And if it is not fed for a while, it may die. Class Person { Void Feed(Rabbit r); Void Buy(Rabbit r); Void Giveaway(Person p, Rabbit r); Rabbit[] rabbits; } Class Rabbit { Bool IsAlive(); Person pwner; } There are a couple of observations from the domain model: Person and Rabbit can have references to each other Any actions on 1 object can also change the state of the other object Even if no explicit actions are invoked, there can still be a change of state in the objects (e.g. Rabbit can be starved to death, and that causes it to be removed from the Person.rabbits array) As DDD is concerned, I think the correct approach is to synchronize all calls that may change the states in the domain model. For instance, if a Person buys a Rabbit, s/he would need to acquire a lock in Person to make a change to the rabbits array AND also another lock in Rabbit to change its owner before releasing the first one. This would prevent a race condition where 2 Persons claim to be the owner of the little Rabbit. The other approach is to let the database to handle all these synchronizations. Who makes the first call wins, but then the DB needs to have some kind of business logics to figure out if it is a valid transaction (e.g. if a Rabbit already has an owner, it cannot change its owner unless the Person gives it away). There are both pros/cons in either approach, and I’d expect the “best” solution would be somewhere in-between. How would you do it in real life? What’s your take and experience? Also, is it a valid concern that there can be another race condition the domain model has committed its change but before it is fully committed in the database? And for the 3rd observation (i.e. state change due to time factor). How will you do it?

    Read the article

  • What is there so useful in the Decorator Pattern? My example doesn't work

    - by Green
    The book says: The decorator pattern can be used to extend (decorate) the functionality of a certain object I have a rabbit animal. And I want my rabbit to have, for example, reptile skin. Just want to decorate a common rabbit with reptile skin. I have the code. First I have abstract class Animal with everythig that is common to any animal: abstract class Animal { abstract public function setSleep($hours); abstract public function setEat($food); abstract public function getSkinType(); /* and more methods which for sure will be implemented in any concrete animal */ } I create class for my rabbit: class Rabbit extends Animal { private $rest; private $stomach; private $skinType = "hair"; public function setSleep($hours) { $this->rest = $hours; } public function setFood($food) { $this->stomach = $food; } public function getSkinType() { return $this->$skinType; } } Up to now everything is OK. Then I create abstract AnimalDecorator class which extends Animal: abstract class AnimalDecorator extends Animal { protected $animal; public function __construct(Animal $animal) { $this->animal = $animal; } } And here the problem comes. Pay attention that AnimalDecorator also gets all the abstract methods from the Animal class (in this example just two but in real can have many more). Then I create concrete ReptileSkinDecorator class which extends AnimalDecorator. It also has those the same two abstract methods from Animal: class ReptileSkinDecorator extends AnimalDecorator { public function getSkinColor() { $skin = $this->animal->getSkinType(); $skin = "reptile"; return $skin; } } And finaly I want to decorate my rabbit with reptile skin: $reptileSkinRabbit = ReptileSkinDecorator(new Rabbit()); But I can't do this because I have two abstract methods in ReptileSkinDecorator class. They are: abstract public function setSleep($hours); abstract public function setEat($food); So, instead of just re-decorating only skin I also have to re-decorate setSleep() and setEat(); methods. But I don't need to. In all the book examples there is always ONLY ONE abstract method in Animal class. And of course it works then. But here I just made very simple real life example and tried to use the Decorator pattern and it doesn't work without implementing those abstract methods in ReptileSkinDecorator class. It means that if I want to use my example I have to create a brand new rabbit and implement for it its own setSleep() and setEat() methods. OK, let it be. But then this brand new rabbit has the instance of commont Rabbit I passed to ReptileSkinDecorator: $reptileSkinRabbit = ReptileSkinDecorator(new Rabbit()); I have one common rabbit instance with its own methods in the reptileSkinRabbit instance which in its turn has its own reptileSkinRabbit methods. I have rabbit in rabbit. But I think I don't have to have such possibility. I don't understand the Decarator pattern right way. Kindly ask you to point on any mistakes in my example, in my understanding of this pattern. Thank you.

    Read the article

  • Javascript for loop with variable

    - by Jascination
    I'm doing some simple javascript learning at the moment and I'm stuck on how to solve this problem. (the basic form comes from Code Academy). The task is to create 3 rabbit objects, each with a different adjective as an attribute. Then, print describeMyself() for each rabbit. Instead of repeating myself 3 times, I'd like to find a way to solve the problem with a for loop to make it more streamlined/challenging for myself. Here's what I tried: function Rabbit(adjective) { this.adjective = adjective; this.describeMyself = function() { console.log("I am a " + this.adjective + " rabbit"); }; } var rabbit1 = new Rabbit(fluffy); var rabbit2 = new Rabbit(happy); var rabbit3 = new Rabbit(sleepy); for (i=1; i<=3; i++){ ("rabbit"+i).describeMyself(); } Obviously, the ("rabbit"+i).describeMyself() is wrong. I want the loop to create "rabbit1", "rabbit2" and "rabbit3". What's the proper syntax here?

    Read the article

  • Compiling C lib and OCaml exe using it, all using ocamlfind

    - by Magnus
    I'm trying to work out how to use ocamlfind to compile a C library and an OCaml executable using that C library. I put together a set of rather silly example files. % cat sillystubs.c #include <stdio.h> #include <caml/mlvalues.h> #include <caml/memory.h> #include <caml/alloc.h> #include <caml/custom.h> value caml_silly_silly( value unit ) { CAMLparam1( unit ); printf( "%s\n", __FILE__ ); CAMLreturn( Val_unit ); } % cat silly.mli external silly : unit -> unit = "silly_silly" % cat foo.ml open Silly open String let _ = print_string "About to call into silly"; silly (); print_string "Called into silly" I believe the following is the way to compile up the library: % ocamlfind ocamlc -c sillystubs.c % ar rc libsillystubs.a sillystubs.o % ocamlfind ocamlc -c silly.mli % ocamlfind ocmalc -a -o silly.cma -ccopt -L${PWD} -cclib -lsillystubs Now I don't seem to be able to use the created library though: % ocamlfind ocamlc -custom -o foo foo.cmo silly.cma /usr/bin/ld: cannot find -lsillystubs collect2: ld returned 1 exit status File "_none_", line 1, characters 0-1: Error: Error while building custom runtime system The OCaml tools are somewhat mysterious to me, so any pointers would be most welcome.

    Read the article

  • (Not So) Silly Objective-C inheritance problem when using property - GCC Bug?

    - by Ben Packard
    Update 2 - Many people are insisting I need to declare an iVar for the property. Some are saying not so, as I am using Modern Runtime (64 bit). I can confirm that I have been successfully using @property without iVars for months now. Therefore, I think the 'correct' answer is an explanation as to why on 64bit I suddenly have to explicitly declare the iVar when (and only when) i'm going to access it from a child class. The only one I've seen so far is a possible GCC bug (thanks Yuji). Not so simple after all... Update - I messed up one line of the original copy and paste - corrected. The @property call was missing (nonatomic, retain) but is a red herring - STILL NEED AN ANSWER! Thanks. I've been scratching my head with this for a couple of hours - I haven't used inheritance much. Here I have set up a simple Test B class that inherits from Test A, where an ivar is declared. But I get the compilation error that the variable is undeclared. This only happens when I add the property and synthesize declarations - works fine without them. TestA Header: #import <Cocoa/Cocoa.h> @interface TestA : NSObject { NSString *testString; } @end TestA Implementation is empty: #import "TestA.h" @implementation TestA @end TestB Header: #import <Cocoa/Cocoa.h> #import "TestA.h" @interface TestB : TestA { } @property (nonatomic, retain) NSString *testProp; @end TestB Implementation (Error - 'testString' is undeclared) #import "TestB.h" @implementation TestB @synthesize testProp; - (void)testing{ NSLog(@"test ivar is %@", testString); } @end

    Read the article

  • Game logic dynamically extendable architecture implementation patterns

    - by Vlad
    When coding games there are a lot of cases when you need to inject your logic into existing class dynamically and without making unnecessary dependencies. For an example I have a Rabbit which can be affected by freeze ability so it can't jump. It could be implemented like this: class Rabbit { public bool CanJump { get; set; } void Jump() { if (!CanJump) return; ... } } But If I have more than one ability that can prevent it from jumping? I can't just set one property because some circumstances can be activated simultanously. Another solution? class Rabbit { public bool Frozen { get; set; } public bool InWater { get; set; } bool CanJump { get { return !Frozen && !InWater; } } } Bad. The Rabbit class can't know all the circumstances it can run into. Who knows what else will game designer want to add: may be an ability that changes gravity on an area? May be make a stack of bool values for CanJump property? No, because abilities can be deactivated not in that order in which they were activated. I need a way to seperate ability logic that prevent the Rabbit from jumping from the Rabbit itself. One possible solution for this is making special checking event: class Rabbit { class CheckJumpEventArgs : EventArgs { public bool Veto { get; set; } } public event EventHandler<CheckJumpEvent> OnCheckJump; void Jump() { var args = new CheckJumpEventArgs(); if (OnCheckJump != null) OnCheckJump(this, args); if (!args.Veto) return; ... } } But it's a lot of code! A real Rabbit class would have a lot of properties like this (health and speed attributes, etc). I'm thinking of borrowing something from MVVM pattern where you have all the properties and methods of an object implemented in a way where they can be easily extended from outside. Then I want to use it like this: class FreezeAbility { void ActivateAbility() { _rabbit.CanJump.Push(ReturnFalse); } void DeactivateAbility() { _rabbit.CanJump.Remove(ReturnFalse); } // should be implemented as instance member // so it can be "unsubscribed" bool ReturnFalse(bool previousValue) { return false; } } Is this approach good? What also should I consider? What are other suitable options and patterns? Any ready to use solutions? UPDATE The question is not about how to add different behaviors to an object dynamically but how its (or its behavior) implementation can be extended with external logic. I don't need to add a different behavior but I need a way to modify an exitsing one and I also need a possibiliity to undo changes.

    Read the article

  • When writing a game, should you make objects/enemies/etc. have unique ID numbers?

    - by SLC
    I have recently encountered some issues with merely passing references to objects/enemies in a game I am making, and am wondering if I am using the wrong approach. The main issue I have is disposing of enemies and objects, when other enemies or players may still have links to them. For example, if you have a Rabbit, and a Wolf, the Wolf may have selected the Rabbit to be its target. What I am doing, is the wolf has a GameObject Target = null; and when it decides it is hungry, the Target becomes the Rabbit. If the Rabbit then dies, such as another wolf killing it, it cannot be removed from the game properly because this wolf still has a reference to it. In addition, if you are using a decoupled approach, the rabbit could hit by lightning, reducing its health to below zero. When it next updates itself, it realises it has died, and is removed from the game... but there is no way to update everything that is interested in it. If you gave every enemy a unique ID, you could simply use references to that instead, and use a central lookup class that handled it. If the monster died, the lookup class could remove it from its own index, and subsequently anything trying to access it would be informed that it's dead, and then they could act accordingly. Any thoughts on this?

    Read the article

  • Regex for finding an unterminated string

    - by Austin Hyde
    I need to search for lines in a CSV file that end in an unterminated, double-quoted string. For example: 1,2,a,b,"dog","rabbit would match whereas 1,2,a,b,"dog","rabbit","cat bird" 1,2,a,b,"dog",rabbit would not. I have very limited experience with regular expressions, and the only thing I could think of is something like "[^"]*$ However, that matches the last quote to the end of the line. How would this be done?

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >