conditional

IE conditional statements do not work with JavaScript disabled? [SOLVED]

I have a page with IE conditional comments in head section, nothing fancy just: <!--[if IE 7]> <link rel="stylesheet" href="css/IE7.css" type="text/css" /> <![endif]--> As I'm at work ;) didn't have a chance to setup testing page yet, but long story short it works as expected when JavaScript is on. When JS is off IE dosen't seem t...

Creating a new variable from a conditional operation on 3 old variables in R

Hi, I have a dataset in R, which contains the results of a rapid diagnostic test. The test has a visible line if it is working properly (control line) and a visible line for each of the two parasite species it detects, if they are present in the patient sample. The dataset contains a logical column for each test line, as follows: (dat...

Conditional composite key in MySQL?

Hi So I have this table with a composite key, basically 'userID'-'data' must be unique (see my other question http://stackoverflow.com/questions/2026379/sql-table-semi-unique-row) However, I was wondering if it was possible to make this only come into effect when userID is not zero? By that I mean, 'userID'-'data' must be unique for no...

htaccess conditional statements based on server name/path

Is it possible to write some conditional "if" statements in htaccess based on the server name/path? I know I can use <IfModule> but that doesn't solve the problem when the development and production server are identical. thanks ...

making the home page require Auth (CakePHP)

Hello, I just started to learn CakePHP and i'm trying to make the homepage (views\pages\home.ctp) only available to logged users, so if an unlogged users enter to the homepage they should be redirected to Users controller, where it prompts for user data, using Auth Component. Where I can set the "controller" for the homepage? please co...

Quantity Conditional

Here's one that's got me stumped. Working in PHP5. I am building a store application for a client that makes use of a web service from a larger agency as he is a broker. This web service requires that items for purchase by end users be of a certain quantity or else the order will be considered ineligible for purchase. I must make dro...

as3 conidtional statement not working

Hey, In my code here: var manTimer:Timer = new Timer(1700,5); manTimer.addEventListener(TimerEvent.TIMER, moveMan); function moveMan(e:TimerEvent):void { var manX:Tween = new Tween(man, "x", Regular.easeIn, man.x, man.x - 100, 1.5, true); } function startMan(e:MouseEvent):void { manTimer.start(); var manX:Tween = new Tween...

Order of evaluation of conditionals in actionscript 3.0 (Flex)

var btn:Button; if(btn != null && btn.label != '') { mx.controls.Alert.show("d"); } In the above if clause, is it guaranteed that the first condition(btn != null) will be evaluated before the second condition? ...

PHP Conditional logic, specific order?

Hello everybody, I have a conditional statement which goes thusly: if ($_POST['password'] == $_POST['repeat'] && $_SESSION['type'] == "admin") But let's say I also want the conditional to evaluate true to users with type "superuser" (instead of "admin"). So I could, for example, write: if ($_POST['password'] == $_POST['repeat'] && $...

Combining two or more CSS selectors with a boolean condition

Is there a way to combine two or more CSS selectors using a boolean condition - and, or, not? Consider this <div>: <div class="message error"> You have being logged out due too much activity. </div> Could I select only those elements that contain both the classes for instance? Something along the lines of div.message && div.erro...

How to make Ruby variable that will evaluate to false in conditional expressions

I want to make my variable (a proxy object) evaluate to false when used in conditional sentences. I know I can use .nil? and even var == nil but I think that's not good enough. What I am trying go do is to: if myproxy # not only myprroxy.nil? or myproxy == nil, but just that # myproxy's backend object is not nil else # myproxy's bac...

Conditional where clause in Mysql

How to use Conditional where clause in Mysql? Select * from table where SubId='1' and null Is it right? I want to display records with subId=1 and rows with subId null Any suggestion... ...

Conditional join in Mysql select statement

I have two tables tbl_studentapplicationdetails and tbl_studentqualification... My second table contains studentId and qualificationId... Now i want to join two tables to get list of students with their qualification... NOTE: Some students may have two or three qualification.... And my query is select distinct t1.dStudent_id,t1.dStuF...

Can one make an assignment on conditional statement in php?

Can you make an assignment on conditional statement in php as so: if(siteName_err = isValid("sitename", $_POST['sitename'], false)) { $siteName = $_POST['sitename']; } ...

How can I disable logging in Ruby on Rails on a per-action basis?

I have a Rails application which has an action which is invoked frequently enough to be inconvenient when I am developing, as it results in a lot of extra log output I don't care about. How can I get rails not to log anything (controller, action, parameters, complection time, etc.) for just this one action? I'd like to conditionalize i...

Does Ruby support conditional regular expressions.

Just a language feature question, I know there's plenty of ways to do this outside of regexes (or with multiple regexes). Does ruby support conditional regular expressions? Basically, an IF-THEN-ELSE branch inside a regular expression, where the predicate for the IF is the presence (or absense) of a captured group in the expression. I...

mysql conditional insert - if not exists insert

Is there a query that will just check for the record and if it doesn't exists insert? I don't want to on duplicate update or replace. Looking for a one query solution, looked at other answer but not really what I was hoping for. Table: name|value|id ------------------ phill|person|12345 pseudo query: IF NOT EXISTS(name='phill', valu...

PHP Optimize Function in Loop

I am micro-optimizing this function and have a bit of a problem where inside a loop I am checking if a value outside of the loop is 0, if so call function and similarly in the function it calls. How would I refactor it so there is no conditional logic (which is slow) inside these loops. foreach($this->layer[$l]->objs as $obj) { //H...

Add conditional stylesheet into the Drupal's Chameleon theme

This is really urgent. I need to add a conditional stylesheet for IE6. However, in the chameleon theme there isn't any page.tpl. I download the conditional stylesheet module but it doesn;t work. I'm using Drupal 6 btw. ...

VHDL conditional generation from makefile

I have a vhdl design that needs adapting to different variants. It would be nice to be able to generate the configurations from a makefile. The makefile for the generation of one project is ready and working. I want to avoid having different very similar files for different projects. The only differences between the projects are a coupl...