conditional

Conditional comment for 'Except IE8' ?

I'm using <!--[if IE 8]><![endif]--> for targeting IE8, but there's some JS that I want to load for all browsers EXCEPT IE8, what conditional comment should I use? Edit: I wonder if this would work: <!--[if lte IE 8]><![endif]--> Thanks ...

Javascript 'if' conditional not ... conditioning.

I'm checking a number of 'read more' links on my blog, and either hiding the link (for the first two posts), or hiding the content and keeping the link. I'm running the links' id attributes through an if ... else statement that looks like so: $(document).find('.contentclicker').each(function(){ var pt = $(this).parent().attr('id');...

Conditional Compilation in assembler (.s) code for iPhone - how?

I have a few lines of assembler arm code in an .s file. Just a few routines i need to call. It works fine when building for the device, however when i switch to iPhone Simulator i get "no such instruction" errors. I tried to compile parts of the .s file conditionally with what i know: #if !TARGET_IPHONE_SIMULATOR But the assembler do...

using conditionals in jquery

Hi, just trying to tie up a few loose odds and ends here. I have the following code: $(function(){ // start a counter for new row IDs // by setting it to the number // of existing rows var newRowNum = 2; var quantity = 1; // bind a click event to the "Add" link $("a").bind("click", function() { // increment the counter newRo...

What is a concise and robust way to write these statements in JavaScript?

I have an <iframe> that uses some variables that are set in an object literal in the parent document. These variables are optional; if they're set, I want to use their values, assigning them to a more succinct global variable; if not, I want to call the function error(). First of all, is this ternary operator statement valid and effecti...

Content Taxonomy along with Conditional Fields

I'm still young at Drupal.So please correct me wherever needed. I have a requirement wherein I want my content type to have my own fields (achieved with CCK), then I want one of the fields to be a selectable drop down and each drop down value should actually categorize them so that each type can come on separate page. This I managed wit...

Conditional uninstall of previous version in Wix

I'm doing an installer for an software used for debugging embedded ARM cores (OpenOCD) and this installer automatically removes the previous versions - that's simple. However, sometimes that would be desirable to have more than just one version installed (each version has it's own folder, so there's no conflict here) due to various (in-)...

How to access value outside If/else scope

I have a data that comes in pair like this: A: 100 B: 3.3 A: 210 B: 4.3 What I want to do with the code below is to sum value of each pairs: my $aval = ""; my $bval = ""; while (<DATA>) { chomp; if (/^A/) { $aval = (split(" ",$_))[-1]; } else { $bval = (split(" ",$_))[-1]; my $total = $aval ...

Conditional Statements Inside A Where Clause

I have a sproc that runs on many different servers. In the sproc I have a select statement that looks like the following. select * from my_table where id = @my_id and status in (1,3) However, for one of the databases I need the second part of that where clause to only be for statuses equal to 1. So essentially... select * from m...

How do I use conditionals to differentiate between Page and Subpage in WordPress?

I have been using conditionals to be able to tell if I'm on a page or a subpage of that page, but I cannot for the life of me get the code to do one thing if I'm on the master page,and another thing if I'm on a subpage of that master page. This is what I have been using so far: if ( is_page('3') || $post->post_parent == '3' ){} Does a...

target conditional library search paths xcode

I'm trying to condtionally link in. .a static libraries by defines. Is this possible in xcode? Basically trying to wrap library specific code in ifdefs so it can be excluded at compile time by setting flags. ...

rails find - condition on array of db-fields

I am stuck and I guess it is a syntax thing I just don't get: It's a one(category)_to_many(product) relationship. In my category model I have the columns pick1, pick2, pick3, pick4, pick5. Each of those holds the id of a product. In my category_controller I want to retrieve those in a find: @productpicks = Product.find(:all, :conditi...

DataMapper has n with conditions

Hello, By any chance is it possible to create a conditional association with DataMapper? For example: I want the User have n Apps just if that user have the attribute :developer => true something like this: class User include DataMapper::Resource property :id, Serial property :name, String, :nullable => false property :scre...

Help with a C# conditional statement dealing with Strings

In my attempt at dissecting a bit of C# I am afraid I do not understand either the goal or the logic of this bit of code: if (!string.IsNullOrEmpty(str2) && (Strings.UCase(Strings.Left(str2, 1)) != Strings.Left(str2, 1))) { return false; } I understand the first part is checking if str2 is "not null", however the secon...

#ifdef #ifndef in Java

Hi all, I doubt if there is a way to make compile-time conditions in Java like #ifdef #ifndef in C++. My problem is that have an algorithm written in Java, and I have different running time improves to that algorithm. So I want to measure how much time I save when each improve is used. Right now I have a set of boolean variables that a...

Conditional limit in mySQL query possible???

Hi everyone, i am faced with a decicion regarding handling threaded comments in our project... I have a simple MySQL table which holds all the comments. There are two types: parents and childs. Childs represent a reply to a parent or another child. My problem: -Comment (depth 0) -- Reply Child (depth 1) --- Reply to previous child (de...

How can I evaluate chained expressions from a string, in Perl?

I'm not really sure what to call these type of expressions, so an example would be easier... Is there a way in Perl to evaluate expressions like a < b <= c? I have a configuration file that allows the user to provide conditional expressions for certain actions. Rather than splitting the condition into two parts (as I would normally do...

How do I use a script's output in an Ant Conditional

I want to do something like the following <target name="complex-conditional"> <if> <exec command= "python some-python-script-that-returns-true-or-false-strings-to-stout.py/> <then> <echo message="I did sometheing" /> </then> <else> <echo message="I did something else" /> </else> </if> </target> How ...

Makefile: ifeq directive compares special variable to constant does not work

Hi're, I have a little issue with my Makefile. I want make to change commands regarding the working directory. I added a conditionnal directive to the rule testing the current target's directory ($(*D)). The thing is that make always goes to the second branch of my test, even when my file is in mySpecialDirectory and echo indeed prints...

Conditional Function for Start: setting in Ariel Flesler's SerialScroll

Site is Located @ beattrainsoundsystem.com/home I'm using serialScroll to animate a number of divs containing dancing characters, and using LocalScroll to animate the content divs. My issue is that when you try and load a URL with a hash ( for example beattrainsoundsystem.com/home#store) the character divs do not animate to the correct...