behavior

Click behaviour - Difference in IE and FF ?!

Hey folks, i just came to the conclusion that a project i am currently working on might have a "logical" error in functionality. Currently I'am using server technology with PHP/MySQL and JQuery. Within the page there's a normal link reference with tag <a href="contentpage?page=xxx">next step</a> The pain point now seems to be the g...

Best practices to build a highly configurable software product.

Hello. I am working on a software product that can substantially change behavior based on the configuration & meta-data supplied. I would like to know best practices to architect / build a highly configurable software product. Considering that there are substantial number of configuration parameters, I'd like to look at something that w...

C++ Exceptions and Inheritance from std::exception

Given this sample code: #include <iostream> #include <stdexcept> class my_exception_t : std::exception { public: explicit my_exception_t() { } virtual const char* what() const throw() { return "Hello, world!"; } }; int main() { try { throw my_exception_t(); } catch (const std::exception& error) ...

Are ORM's counterproductive to OO design?

In OOD, design of an object is said to be characterized by its identity and behavior. Having used ORM's in the past, the primary purpose, in my opinion, revolves around the ability to store/retrieve data. That is to say, ORM objects are not design by behavior, but rather data (i.e. database tables). Case and point: Many ORM tools com...

Strange php behaviour on a gd function

Hi, i met a very strange PHP behaviour, i don't understand why it behaves like this. I'm using the imagesetbrush function in this way: class foo { function setbrush($image) { //$this->_resource contains the main image resource imagesetbrush($this->_resource, $image); } } ... $res=imagecreatefrompng("image.png"); $...

Wicket: stateless AJAX behaviors in stateful page without serialization

I have pretty stateful page with plenty of AJAX components. Most of these components have behaviors, which renders JavaScript code for calling AJAX requests to Java code. Because page isn't stateless, each request causes serialization of page. So far so good. But some of these AJAX requests doesn't change page ever, so serialization of ...

Client Web Browser Behavior When Handling 301 Redirect

The RFC seems to suggest that the client should permanently cache the response: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html 10.3.2 301 Moved Permanently The requested resource has been assigned a new permanent URI and any future references to this resource SHOULD use one of the returned URIs. Clients with link...

Rails Actionmailer Handling of Failed Messages

Hi, I'm using rails 2.2.2 on a linux box and am using a rake task to send some emails. It's a very simple script without error handling: 1.) Get emails to send 2.) Send email 3.) Mark emails as sent Right now, the port on the smtp server has been blocked temporarily so steps 1 and 3 are completing but not step 2. My question is, wh...

Constraining to parent container with MouseDragElementBehavior

Hi all, I just had a question regarding constraining a control's drag and drop movement to its parent canvas. I tried using the ConstrainToParentBounds property on the MouseDragElementBehavior, however, when this is used the drag must be done really slowly or the movement of the control is choppy or stops altogether. So I am attempting ...

Do views only perform the joins that they need to, or all joins always?

I am on an oracle DB. Lets say I have one view that joins to three tables. The view has two fields each. Each field only needs data from two of the three tables. If I query the view and return only one field, does the view still join to three tables or just to the two tables that it needs to calculate the field? ...

C# - foreach showing strange behavior / for working with no problem

Hi there. Today I coded a function that uses two nested foreach loops. After seeing, that it did not work like expected, i debugged it. But I dont see an error, and dont think a simple error can cause the behavior i have noticed. The part looks like this: foreach(MyClass cItem in checkedListBoxItemList.Items) { foreach(MyClass cActi...

Merge entries in CakePHP

Let's say I have a Model, for example User, and I want to merge two instances of this Model, say merge User2 into User1. Explicitly this is what I mean: If a field is already filled in User1, it should remain the same If a field is missing in User1 but is present in User2, it should be copied If SomeModel BelongsTo User, every instance...

Modifying Model data in beforeSave of Behavior when using saveAll

I'm trying to write a Meta behavior for a project I am working on that will allow me to assign custom variables/attributes to a model, similar to how you can create custom fields in a wordpress post. I have created a Meta behavior that binds the meta model to the model it is acting on and also has a beforeSave callback that loops throug...

In Ruby, how to implement global behaviour?

Hi all, I want to implement the concept of a Workspace. This is a global concept - all other code will interact with one instance of this Workspace. The Workspace will be responsible for maintaining the current system state (i.e. interacting with the system model, persisting the system state etc) So what's the best design strategy for...

AIX specific socket programming query

Hi All, Question 1 From SUSE man pages, I get the below details for socket connect options If the initiating socket is connection-mode, then connect() shall attempt to establish a connection to the address specified by the address argument. If the connection cannot be established immediately and O_NONBLOCK is not set for the fil...

Difference between array('Acl' => array('type' => 'requester')) and array('Acl' => 'requester') in CakePHP?

I'm following the ACL tutorial for CakePHP 1.3 and I was wondering if there is a functional difference between declaring a behavior like this: var $actsAs = array('Acl' => 'requester'); and like this: var $actsAs = array('Acl' => array('type' => 'requester')); ...

Cakephp, good ordering / sorting behaviour?

Hi, Does anyone know any good ordering and sorting behaviours for cakephp? The sort where I can have "Move Up", "Move Down", "Move to top" and "Move to bottom"? That sort of this. Thanks! ...

Cakephp, an elegant solution to quantities?

Hi, I have a shopping cart system in Cakephp, this table has all your usual maguffins: user_ids, product_ids, option_lists ect. It also has quantity. I currently have some awful nested loops to check if the record is the same as any in there, if so add one to the quantity. If not add a new cart item. This loop has to check associated ...

Is Behaviour supported on wpf in 3.5? I cannot see System.Windows.Interactivity in VS2010

Is Behaviour supported on wpf in 3.5? I cannot see System.Windows.Interactivity in VS2010 ...

WPF: Sort of inconsistence in the visual appearence of WPF controls derived by Selector class

Hello, focused items == selected items but selected items != focused items. Have you ever wondered about that? Do you specially style the backcolor of a focused/selected item ? I ask this question because a user has an enabled button because some customer items are selected. The user is wondering now "why the heck can I delete this ...