Search Results

Search found 2641 results on 106 pages for 'conditional compilation'.

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

  • Conditional formatting

    - by djerry
    I have a rather annoying format I need to implement. There are 2 cells, both containing a date (cell A and B). B contains a date (24-06-2011). Cell B should be colored if cell A is between a date range, based on cell B. So if cell A lies between cell B - 7 days and cell B - 11 days, then it should be triggered. So with numbers: If B is 24-06-2011 then the range (which is not in any cell in the spreadsheet) is 13-06-2011 until 17-06-2011. If the date in cell A (let's say 14-06-2011) is in that range, cell B should be colored. Any ideas?

    Read the article

  • Conditional blocks of code in linux bash

    - by Arek
    Nearly everybody knows very useful && and || operators, for example: rm myf && echo "File is removed successfully" || echo "File is not removed" I've got a question: how to put a block of commands after && or || operators without using the function? For example I want to do: rm myf && \ echo "File is removed successfully" \ echo "another command executed when rm was successful" || \ echo "File is not removed" \ echo "another command executed when rm was NOT successful" What is the proper syntax of that script?

    Read the article

  • COnditional mount in LInux

    - by o_O Tync
    I have a mount point — let it be /media/question — and two possible devices: a physical HDD and a remote NFS folder. Sometimes I plug the device in physically, in other cases I mount it via NFS. Is there a way to specify both of them in fstab so that executing mount /media/question will preferably choose physical volume, and when it's not available — NFS?

    Read the article

  • Conditional `mount` in Linux: dev or nfs

    - by o_O Tync
    I have a mount point — let it be /media/question — and two possible devices: a physical HDD and a remote NFS folder. Sometimes I plug the device in physically, in other cases I mount it via NFS. Is there a way to specify both of them in fstab so that executing mount /media/question will preferably choose physical volume, and when it's not available — NFS?

    Read the article

  • WordPress Conditional: Only show if current page title is equal to post meta

    - by Wade D Ouellet
    Hey, I am calling a bunch of posts under a certain post type in WordPress which works but I am trying to add a conditional that will check first if those post's custom meta field (labeled "disc") is equal to the current post's title. Here is what I have but this conditional does not seem to work: <?php $pages = get_posts('numberposts=9999&post_type=song&post_status=publish&order=ASC&orderby=date'); $i = 1; foreach( $pages as $page ) { $content = $page->post_title; if( empty($content) ) continue; $content = apply_filters('the_content', $content); ?> <?php if(get_post_meta($page->ID, "p30-disc", true)=="the_title()") { ?> <tbody class="vevent"> <?php if ($i%2===0) { ?><tr class="gigpress-row gigpress-alt"> <?php } else { ?><tr class="gigpress-row"><?php } ?> <td><?php echo $page->post_title ?></td> <td><?php echo get_post_meta($page->ID, "p30-length", true); ?></td> <td><a href="http://itunes.com/<?php echo get_post_meta($page->ID, "p30-itunes-song", true); ?>">BUY</a></td> </tr> <tr class="gigpress-info"> <td colspan="3"><?php echo $page->post_content ?></td> </tr> </tbody> <?php $i++; } } ?> When I simply echo "get_post_meta($page-ID, "p30-disc", true)" or "the_title()" it spits out their proper values, which are equal, so obviously something is just wrong with that conditional. Thanks, Wade

    Read the article

  • std::conditional compile-time branch evaluation

    - by cmannett85
    Compiling this: template < class T, class Y, class ...Args > struct isSame { static constexpr bool value = std::conditional< sizeof...( Args ), typename std::conditional< std::is_same< T, Y >::value, isSame< Y, Args... >, // Error! std::false_type >::type, std::is_same< T, Y > >::type::value; }; int main() { qDebug() << isSame< double, int >::value; return EXIT_SUCCESS; } Gives me this compiler error: error: wrong number of template arguments (1, should be 2 or more) The issue is that isSame< double, int > has an empty Args parameter pack, so isSame< Y, Args... > effectively becomes isSame< Y > which does not match the signature. But my question is: Why is that branch being evaluated at all? sizeof...( Args ) is false, so the inner std:conditional should not be evaluated. This isn't a runtime piece of code, the compiler knows that sizeof..( Args ) will never be true with the given template types. If you're curious, it's supposed to be a variadic version of std::is_same, not that it works...

    Read the article

  • CruiseControl failing view compilation with Asp.net MVC 2 RTM

    - by Robert Koritnik
    Tehnologies: - CruiseControlNet - Asp.net MVC 2 RTM - enabled view compilation The problem is UrlParameter.Optional setting. I can't seem to make it work when I use this setting inside a view. When I compile inside Visual Studio, everything works fine, but when CCNet uses MSBuild to compile it it fails with following error: errorCS0103: The name 'UrlParameter' does not exist in the current context pointing to the line inside my view where this parameter is set on: Html.RenderAction(...) that sets certain route parameter(s) to optional. I tried adding <%@ Assembly name="System.Web.Mvc" %> at the top of my view, but it didn't work either. It works of course when I disable view compilation, but that's not really an option. And I also don't want to set my optional parameters to string.Empty. Anyone has any hint on this?

    Read the article

  • conditional operator in C question

    - by Seephor
    I just have a quick question about the conditional operator. Still a budding programmer here. I am given x = 1, y = 2, and z = 3. I want to know, why after this statement: y += x-- ? z++ : --z; That y is 5. The values after the statement are x = 0, y = 5, and z = 4. I know the way the conditional operator works is that it is formatted like this: variable = condition ? value if true : value if false. For the condition, y += x-- , how does y become 5? I can only see 2 (2 += 0) and 3 (2 += 1)(then x-- becomes zero) as possibilities. Any help is much appreciated. :)

    Read the article

  • Java conditional operator ?: result type

    - by Wangnick
    I'm a bit puzzled about the conditional operator. Consider the following two lines: Float f1 = false? 1.0f: null; Float f2 = false? 1.0f: false? 1.0f: null; Why does f1 become null and the second statement throws a NullPointerException? Langspec-3.0 para 15.25 sais: Otherwise, the second and third operands are of types S1 and S2 respectively. Let T1 be the type that results from applying boxing conversion to S1, and let T2 be the type that results from applying boxing conversion to S2. The type of the conditional expression is the result of applying capture conversion (§5.1.10) to lub(T1, T2) (§15.12.2.7). So for false?1.0f:null T1 is Float and T2 is the null type. But what is the result of lub(T1,T2)? This para 15.12.2.7 is just a bit too much ... BTW, I'm using 1.6.0_18 on Windows. PS: I know that Float f2 = false? (Float) 1.0f: false? (Float) 1.0f: null; doesn't throw NPE.

    Read the article

  • Mathematically Find Max Value without Conditional Comparison

    - by Cnich
    ----------Updated ------------ codymanix and moonshadow have been a big help thus far. I was able to solve my problem using the equations and instead of using right shift I divided by 29. Because with 32bits signed 2^31 = overflows to 29. Which works! Prototype in PHP $r = $x - (($x - $y) & (($x - $y) / (29))); Actual code for LEADS (you can only do one math function PER LINE!!! AHHHH!!!) DERIVDE1 = IMAGE1 - IMAGE2; DERIVED2 = DERIVED1 / 29; DERIVED3 = DERIVED1 AND DERIVED2; MAX = IMAGE1 - DERIVED3; ----------Original Question----------- I don't think this is quite possible with my application's limitations but I figured it's worth a shot to ask. I'll try to make this simple. I need to find the max values between two numbers without being able to use a IF or any conditional statement. In order to find the the MAX values I can only perform the following functions Divide, Multiply, Subtract, Add, NOT, AND ,OR Let's say I have two numbers A = 60; B = 50; Now if A is always greater than B it would be simple to find the max value MAX = (A - B) + B; ex. 10 = (60 - 50) 10 + 50 = 60 = MAX Problem is A is not always greater than B. I cannot perform ABS, MAX, MIN or conditional checks with the scripting applicaiton I am using. Is there any way possible using the limited operation above to find a value VERY close to the max?

    Read the article

  • Django conditional template inheritance

    - by Ed
    I have template that displays object elements with hyperlinks to other parts of my site. I have another function that displays past versions of the same object. In this display, I don't want the hyperlinks. I'm under the assumption that I can't dynamically switch off the hyperlinks, so I've included both versions in the same template. I use an if statement to either display the hyperlinked version or the plain text version. I prefer to keep them in the same template because if I need to change the format of one, it will be easy to apply it to the other right there. The template extends framework.html. Framework has a breadcrumb system and it extends base.html. Base has a simple top menu system. So here's my dilemma. When viewing the standard hyperlink data, I want to see the top menu and the breadcrumbs. But when viewing the past version plain text data, I only want the data, no menu, no breadcrumbs. I'm unsure if this is possible given my current design. I tried having framework inherit the primary template so that I could choose to call either framework (and display the breadcrumbs), or the template itself, thus skipping the breadcrumbs, but I want framework.html available for other templates as well. If framework.html extends a specific template, I lose the ability to display it in other templates. I tried writing an if statement that would display a the top_menu block and the nav_menu block from base.html and framework.html respectively. This would overwrite their blocks and allow me to turn off those elements conditional on the if. Unfortunately, it doesn't appear to be conditional; if the block elements are in the template at all, surrounded by an if or not, I lose the menus. I thought about using {% include %} to pick up the breadcrumbs and a split out top menu. In that case though, I'll have to include it all the time. No more inheritance. Is this the best option given my requirement?

    Read the article

  • Conditional CSS file doesn't override regular CSS

    - by dmr
    I am using conditional comments to link to a css file (let's call it "IEonly.css") if the IE version is less than 8. I am trying to override some properties in the regular css file. Strangely enough, IEonly.css will set new css properties correctly, but it won't override the properties in the regular CSS file! (I am trying to make this work for IE7). Help!

    Read the article

  • Why doesn't the conditional operator correctly allow the use of "null" for assignment to nullable ty

    - by Daniel Coffman
    This will not compile, stating "Type of conditional expression cannot be determined because there is no implicit conversion between 'System.DateTime' and ''" task.ActualEndDate = TextBoxActualEndDate.Text != "" ? DateTime.Parse(TextBoxActualEndDate.Text) : null; This works just fine if (TextBoxActualEndDate.Text != "") task.ActualEndDate = DateTime.Parse(TextBoxActualEndDate.Text); else task.ActualEndDate = null;

    Read the article

  • Web SITE publishing, dynamic compilation, smoke & mirrors

    - by tbehunin
    When you publish a web SITE in Visual Studio, in the dialog box that follows, you are given an option to "Allow this precompiled site to be updatable". According to MSDN, checking this option "specifies that all program code is compiled into assemblies, but that .aspx files (including single-file ASP.NET Web pages) are copied as-is to the target folder". With this option checked, you can update existing .aspx files as well as add new ones without any issue. When a page, that has either been updated or newly created, is requested, the page gets dynamically compiled at run-time and is then processed and returned to the user. If, on the other hand, you didn't check that checkbox during the publish phase, the .aspx files get compiled, along with the code-behind and App_Code files in separate assemblies. The .aspx files are then completely overwritten with a line of text that says: This is a marker file generated by the precompilation tool, and should not be deleted! You obviously can't edit an existing page in this scenario. If you were to ADD a new .aspx file to this site, you would get a .Net run-time error saying that the file hasn't been precompiled. With that background, my questions are these: Something must be able to determine that this website was published to be updatable (allow dynamic compilation) or not. If it was published as updatable, it must also be able to determine whether a file was changed or added, so it can do a dynamic compile. Who makes those determinations? IIS? ASP.NET worker process? HOW does it make those determinations? If I had the same website published in both of those scenarios, could I make a visual determination that one is updatable and the other is not? Is there some bit I can look at in the assemblies using Reflector to make that determination myself? In addition to answering those questions, what also might be helpful would be information on the process flow from when a resource is requested to when it starts being processed, not necessarily the ASP.NET Page Lifecycle, but what happens BEFORE ASP.Net worker process starts processing the page and firing off events. The dynamic compilation appears to be smoke and mirrors. Can someone demystify this for me?

    Read the article

  • Will IE9 support conditional comments?

    - by greim
    I thought I remembered reading somewhere that IE9 would not be supporting them, but now after searching I can't find any indication that this is true. Is anyone aware of a definitive statement, either way, about whether Microsoft will be supporting conditional comments in IE9?

    Read the article

  • Static compilation in the .NET world

    - by AngryHacker
    I'll be writing a small desktop app for a client that has WinXP machines and they won't be installing the .NET framework (at least not for me). So my choices are limited to either C++ or VB6, neither of which sound great. I remember reading back in the day that Mono came up with a static compiler, but recently the only thing I could find is Miguel de Icaza's entry on static compilation for a game engine for the purposes of running the app on the iPhone - not what I had in mind. Are there any products out there, free or commercial that will allow me to statically compile my .net 3.5 winform app? Thanks

    Read the article

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