rules

Same rules for multiple directories in Apache?

I have 2 subdomains which use the same rules, as seen below: <Directory /srv/project/sites/project.hu/htdocs/> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)\?*$ index.php?route=$1 [L,QSA] SetEnv config default,local Order allow,deny allow from 192.1...

Does Perl 6 make any promises about the order alternations will be used?

Given an alternation like /(foo|foobar|foobaz)/ does Perl 6 make any promises about which of the three will be used first, and if it does where in the documentation does it make that promise? See the related question Does Perl currently (5.8 and 5.10) make any promises about the order alternations will be used?. ...

Business rules for calculating prices

The business I work for is an on-line retailer, I'm currently working on a project that among other things involves calculating the customer prices for products. We will probably create a service that looks something like... public interface IPriceService { decimal CalculateCustomerPrice(ISupplierPriceProvider product); } public inte...

css selector rules --ruleset for all elements within a selector?

With at-rules, it's possible to have a ruleset for elements during that at-rule event (like printing, mobile devices, etc.) But what about just for a specific selector? I am working on a sub page of a larger site, and I have to use the master stylesheet for any of my pages. Sometimes a style rule just gets trumped by a rule from the ma...

How to prevent deletion of the first row in table (PostgreSQL)?

Is it possible to prevent deletion of the first row in table on PostgreSQL side? I have a category table and I want to prevent deletion of default category as it could break the application. Of course I could easily do it in application code, but it would be a lot better to do it in database. I think it has something to do with rules o...

Ruby & Rules Engines

Hi there, I'm looking for a simple way to let users define a set of rules to filter objects. Eg. let them define something like "notify me about a booking if booking date < 2009/04/30 AND value > 100.00" More or less: I'd like to have a Ruby rules engine with custom DSL. Is there a library offering that? Came across Ruleby, but it do...

[Apache] Unwanted mod_rewrite behaviour

I just did a fresh install of lamp stack on ubuntu and enabled the mod_rewrite module for my default website. What I want is something similar to the drupal's queries, when the whole query string is kept in one variable. For this purposes the following mod_rewrite code may be used: RewriteRule ^(.*)$ home.php?q=$1 [L,QSA] The problem ...

Rules based parsing for configuration files

What is the best method to implement a system for parsing a configuration file based on a set of rules? I would appreciate any pointers in the direction of best practices or existing implementations. Edit: I have not decided not choice of any specific language yet but I am comfortable with both Perl and Python. The files are something a...

Java date iterator factory, with rules specifying how to calculate the intervals

I am looking for a Java class where I can specify a set of date rules, such as "every 3rd sunday" and "the first occurrence of a monday every second month". I want to be able to get something like an infinite iterator out of it (.next() would return the next date matching the rules set). I think I'd be able to build it myself - but cale...

Need help converting apache .htaccess code to lighttpd url_rewrite code

Hi All, I have this custom written CMS built on XAMPP. I'm trying to test the same on lighttpd to benchmark the so-called performance gains... but am stuck at the rewrite rules. I use the default rewrite rules of WordPress in my .htaccess which hands all url parsing over to my script as long as there aren't any files or directories sa...

Postback or Callback?

I was wondering what to take into consideration when deciding between a full postback or a quick callback. There are two extremes: You could do it the "old" way, where every user action causes a full postback. Or you could conceivably ajaxify your whole web application so as to never cause a full postback. Both options don't seem to m...

Composite Strategy pattern - java - How bad is this code?

This question is kind of continuation to my earlier post: http://stackoverflow.com/questions/944824/visitor-pattern-implementation-in-java-how-does-this-look I got a bit confused while refactoring my code. I am trying to convert my visitor pattern (explained in the prior post) into a composite strategy pattern. I am trying to do somethi...

specialization in type classes using ghc

How can I make the genOut/String fire? module IOStream where import System.IO import System.IO.Unsafe class Out a where out :: a → String instance Show a ⇒ Out a where out = show outString :: String → String outString = id {-# RULES "genOut/String" out = outString #-} infixl 9 <<, ≪ (≪), (<<) :: Out a ⇒ IO Handle → a → IO Handl...

Make a radio button in an infopath form "read only"?

I'm making an InfoPath form which is tied to an Access database. I have a set of radio buttons where the user selects the software name corresponding to the form, but I store this in my database as a number (1, 2, or 3). In another view, I want them to be able to see the previously entered software name, but not be able to change this....

How do browser cookie domains work?

Due to weird domain/subdomain cookie issues that I'm getting, I'd like to know how browsers handle cookies. If they do it in different ways, it would also be nice to know the differences. In other words - when a browser receives a cookie, that cookie MAY have a domain and a path attached to it. Or not, in which case the browser probably...

Open Source Expression Engines (Java)

Are there any good open source expression engines for java? I am not looking for a rules engine (which implement conditionals and logic). I want to be able to define a number of "facts" and dynamically generate expressions based on these facts. For example: Say I have facts such as: Lemons=$5 IceCubes=$1 Cups=$2 ...

How can I force all derived classes to implement an abstract method or property?

An abstract function must be implemented by all concrete classes. Sometimes you want to force all derivative classes to implement the abstract function, even derivatives of concrete classes. class Base { protected abstract Base Clone(); } class Concrete : Base { protected override Base Clone(){...}; } class Custom : Concrete {} I wou...

InfoPath: Clear a form field and then set it to read only

I have a check box and a text field in my InfoPath form. When the check box is unchecked, I would like to clear the field content and then mark it as read-only. I created a conditional formatting to mark the form as read-only and then a rule to clear the field content. However, I found that every time I enable both of them, the rule wil...

mod rewrite rules

Hello. I want to make a rule that transform this URL: http://www.example.com/product.php?category=1&amp;product=5 Into http://www.example.com/brother-2035 (The product name can be retrieved from my mysql database and is "Brother 2035"). ...

How to import or create an Outlook 2003 rule (.rwz) with VSTO 2005?

I would like to automatically create an Outlook rule (move email containing something in subject to folder xyz) but dont know how to achieve this. Of course I can create the rule and export it to a .rwz file. This file can be imported manually, but how can I import it automatically? Can I import a rule through my VSTO 2005 Outlook (2003...