Search Results

Search found 5279 results on 212 pages for 'optional arguments'.

Page 7/212 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • Bison input analyzer - basic question on optional grammer and input interpretation

    - by kumar_m_kiran
    Hi All, I am very new to Flex/Bison, So it is very navie question. Pardon me if so. May look like homework question - but I need to implement project based on below concept. My question is related to two parts, Question 1 In Bison parser, How do I provide rules for optional input. Like, I need to parse the statment Example : -country='USA' -state='INDIANA' -population='100' -ratio='0.5' -comment='Census study for Indiana' Here the ratio token can be optional. Similarly, If I have many tokens optional, then How do I provide the grammer in the parser for the same? My code looks like, %start program program : TK_COUNTRY TK_IDENTIFIER TK_STATE TK_IDENTIFIER TK_POPULATION TK_IDENTIFIER ... where all the tokens are defined in the lexer. Since there are many tokens which are optional, If I use "|" then there will be many different ways of input combination possible. Question 2 There are good chance that the comment might have quotes as part of the input, so I have added a token -tag which user can provide to interpret the same, Example : -country='USA' -state='INDIANA' -population='100' -ratio='0.5' -comment='Census study for Indiana$'s population' -tag=$ Now, I need to reinterpret Indiana$'s as Indiana's since -tag=$. Please provide any input or related material for to understand these topic. Thanks for your input in advance.

    Read the article

  • Invoke Haskell function with heterogeneous arguments?

    - by thurn
    I'm currently working on a Haskell project which automatically tests some functions based on an XML specification. The XML specification gives the arguments to each function and the expected result that the function will provide (the arguments are of many different types). I know how to extract the function arguments from the XML and parse them using the read function, but I haven't figured out how to invoke the function using the arguments I get out. What I basically want is to read and store the arguments in a heterogeneous list (my current thinking is to use a list of type Data.Dynamic) and then invoke the function, passing this heterogeneous list as its argument list. Is this possible? Modifying the functions under test is not an option.

    Read the article

  • Optional read from STDIN in C

    - by Yuval A
    My application is basically a shell which expects an input of type cmd [x], where cmd is constant and x is optional. So cmd 1 is legal as well as cmd by itself - then I assume a default parameter for x. I am doing this: char cmd[64]; scanf("%s", cmd); int arg; scanf("%d", &arg); // but this should be optional How can I read the integer parameter, and set it to a default if none is currently available in the prompt? I do not want the prompt to wait for additional input if it was not given in the original command. I tried several versions using fgetc() and getchar() and comparing them to EOF but to no avail. Each version I tried ends up waiting on that optional integer parameter.

    Read the article

  • Optional attribute values in MappedField

    - by David Brooks
    I'm new to Scala and Lift, coming from a slightly odd background in PLT Scheme. I've done a quick search on this topic and found lots of questions but no answers. I'm probably looking in the wrong place. I've been working my way through tutorials on using Mapper to create database-backed objects, and I've hit a stumbling block: what types should be used to stored optional attribute values. For example, a simple ToDo object might comprise a title and an optional deadline (e.g. http://rememberthemilk.com). The former would be a MappedString, but the latter could not be a MappedDateTime since the type constraints on the field require, say, defaultValue to return a Date (rather than a Date or null/false/???). Is an underlying NULL handled by the MappedField subclasses? Or are there optional equivalents to things like MappedInt, MappedString, MappedDateTime that allow the value to be NULL in the database? Or am I approaching this in the wrong way?

    Read the article

  • Optional parameters for interfaces

    - by bryanjonker
    Using c# 4.0 -- building an interface and a class that implements the interface. I want to declare an optional parameter in the interface and have it be reflected in the class. So, I have the following: public interface IFoo { void Bar(int i, int j=0); } public class Foo { void Bar(int i, int j=0) { // do stuff } } This compiles, but it doesn't look right. The interface needs to have the optional parameters, because otherwise it doesn't reflect correctly in the interface method signature. Should I skip the optional parameter and just use a nullable type? Or will this work as intended with no side effects or consequences?

    Read the article

  • Problem with optional arguments in C #defines

    - by imikedaman
    Hi, I'm having a problem with optional arguments in #define statements in C, or more specifically with gcc 4.2: bool func1(bool tmp) { return false; } void func2(bool tmp, bool tmp2) {} #define CALL(func, tmp, ...) func(tmp, ##__VA_ARGS__) int main() { // this compiles CALL(func2, CALL(func1, false), false); // this fails with: Implicit declaration of function 'CALL' CALL(func2, false, CALL(func1, false)); } That's obviously a contrived example, but does show the problem. Does anyone know how I can get the optional arguments to "resolve" correctly? Additional information: If I remove the ## before _VA_ARGS_, and do something like this: bool func2(bool tmp, bool tmp2) { return false; } #define CALL(func, tmp, ...) func(tmp, __VA_ARGS__) int main() { CALL(func2, false, CALL(func2, false, false)); } That compiles, but it no longer works with zero arguments since it would resolve to func(tmp, )

    Read the article

  • Using Sitecore RenderingContext Parameters as MVC controller action arguments

    - by Kyle Burns
    I have been working with the Technical Preview of Sitecore 6.6 on a project and have been for the most part happy with the way that Sitecore (which truly is an MVC implementation unto itself) has been expanded to support ASP.NET MVC. That said, getting up to speed with the combined platform has not been entirely without stumbles and today I want to share one area where Sitecore could have really made things shine from the "it just works" perspective. A couple days ago I was asked by a colleague about the usage of the "Parameters" field that is defined on Sitecore's Controller Rendering data template. Based on the standard way that Sitecore handles a field named Parameters, I was able to deduce that the field expected key/value pairs separated by the "&" character, but beyond that I wasn't sure and didn't see anything from a documentation perspective to guide me, so it was time to dig and find out where the data in the field was made available. My first thought was that it would be really nice if Sitecore handled the parameters in this field consistently with the way that ASP.NET MVC handles the various parameter collections on the HttpRequest object and automatically maps them to parameters of the action method executing. Being the hopeful sort, I configured a name/value pair on one of my renderings, added a parameter with matching name to the controller action and fired up the bugger to see... that the parameter was not populated. Having established that the field's value was not going to be presented to me the way that I had hoped it would, the next assumption that I would work on was that Sitecore would handle this field similar to how they handle other similar data and would plug it into some ambient object that I could reference from within the controller method. After a considerable amount of guessing, testing, and cracking code open with Redgate's Reflector (a must-have companion to Sitecore documentation), I found that the most direct way to access the parameter was through the ambient RenderingContext object using code similar to: string myArgument = string.Empty; var rc = Sitecore.Mvc.Presentation.RenderingContext.CurrentOrNull; if (rc != null) {     var parms = rc.Rendering.Parameters;     myArgument = parms["myArgument"]; } At this point, we know how this field is used out of the box from Sitecore and can provide information from Sitecore's Content Editor that will be available when the controller action is executing, but it feels a little dirty. In order to properly test the action method I would have to do a lot of setup work and possible use an isolation framework such as Pex and Moles to get at a value that my action method is dependent upon. Notice I said that my method is dependent upon the value but in order to meet that dependency I've accepted another dependency upon Sitecore's RenderingContext.  I'm a big believer in, when possible, ensuring that any piece of code explicitly advertises dependencies using the method signature, so I found myself still wanting this to work the same as if the parameters were in the request route, querystring, or form by being able to add a myArgument parameter to the action method and have this parameter populated by the framework. Lucky for us, the ASP.NET MVC framework is extremely flexible and provides some easy to grok and use extensibility points. ASP.NET MVC is able to provide information from the request as input parameters to controller actions because it uses objects which implement an interface called IValueProvider and have been registered to service the application. The most basic statement of responsibility for an IValueProvider implementation is "I know about some data which is indexed by key. If you hand me the key for a piece of data that I know about I give you that data". When preparing to invoke a controller action, the framework queries registered IValueProvider implementations with the name of each method argument to see if the ValueProvider can supply a value for the parameter. (the rest of this post will assume you're working along and make a lot more sense if you do) Let's pull Sitecore out of the equation for a second to simplify things and create an extremely simple IValueProvider implementation. For this example, I first create a new ASP.NET MVC3 project in Visual Studio, selecting "Internet Application" and otherwise taking defaults (I'm assuming that anyone reading this far in the post either already knows how to do this or will need to take a quick run through one of the many available basic MVC tutorials such as the MVC Music Store). Once the new project is created, go to the Index action of HomeController.  This action sets a Message property on the ViewBag to "Welcome to ASP.NET MVC!" and invokes the View, which has been coded to display the Message. For our example, we will remove the hard coded message from this controller (although we'll leave it just as hard coded somewhere else - this is sample code). For the first step in our exercise, add a string parameter to the Index action method called welcomeMessage and use the value of this argument to set the ViewBag.Message property. The updated Index action should look like: public ActionResult Index(string welcomeMessage) {     ViewBag.Message = welcomeMessage;     return View(); } This represents the entirety of the change that you will make to either the controller or view.  If you run the application now, the home page will display and no message will be presented to the user because no value was supplied to the Action method. Let's now write a ValueProvider to ensure this parameter gets populated. We'll start by creating a new class called StaticValueProvider. When the class is created, we'll update the using statements to ensure that they include the following: using System.Collections.Specialized; using System.Globalization; using System.Web.Mvc; With the appropriate using statements in place, we'll update the StaticValueProvider class to implement the IValueProvider interface. The System.Web.Mvc library already contains a pretty flexible dictionary-like implementation called NameValueCollectionValueProvider, so we'll just wrap that and let it do most of the real work for us. The completed class looks like: public class StaticValueProvider : IValueProvider {     private NameValueCollectionValueProvider _wrappedProvider;     public StaticValueProvider(ControllerContext controllerContext)     {         var parameters = new NameValueCollection();         parameters.Add("welcomeMessage", "Hello from the value provider!");         _wrappedProvider = new NameValueCollectionValueProvider(parameters, CultureInfo.InvariantCulture);     }     public bool ContainsPrefix(string prefix)     {         return _wrappedProvider.ContainsPrefix(prefix);     }     public ValueProviderResult GetValue(string key)     {         return _wrappedProvider.GetValue(key);     } } Notice that the only entry in the collection matches the name of the argument to our HomeController's Index action.  This is the important "secret sauce" that will make things work. We've got our new value provider now, but that's not quite enough to be finished. Mvc obtains IValueProvider instances using factories that are registered when the application starts up. These factories extend the abstract ValueProviderFactory class by initializing and returning the appropriate implementation of IValueProvider from the GetValueProvider method. While I wouldn't do so in production code, for the sake of this example, I'm going to add the following class definition within the StaticValueProvider.cs source file: public class StaticValueProviderFactory : ValueProviderFactory {     public override IValueProvider GetValueProvider(ControllerContext controllerContext)     {         return new StaticValueProvider(controllerContext);     } } Now that we have a factory, we can register it by adding the following line to the end of the Application_Start method in Global.asax.cs: ValueProviderFactories.Factories.Add(new StaticValueProviderFactory()); If you've done everything right to this point, you should be able to run the application and be presented with the home page reading "Hello from the value provider!". Now that you have the basics of the IValueProvider down, you have everything you need to enhance your Sitecore MVC implementation by adding an IValueProvider that exposes values from the ambient RenderingContext's Parameters property. I'll provide the code for the IValueProvider implementation (which should look VERY familiar) and you can use the work we've already done as a reference to create and register the factory: public class RenderingContextValueProvider : IValueProvider {     private NameValueCollectionValueProvider _wrappedProvider = null;     public RenderingContextValueProvider(ControllerContext controllerContext)     {         var collection = new NameValueCollection();         var rc = RenderingContext.CurrentOrNull;         if (rc != null && rc.Rendering != null)         {             foreach(var parameter in rc.Rendering.Parameters)             {                 collection.Add(parameter.Key, parameter.Value);             }         }         _wrappedProvider = new NameValueCollectionValueProvider(collection, CultureInfo.InvariantCulture);         }     public bool ContainsPrefix(string prefix)     {         return _wrappedProvider.ContainsPrefix(prefix);     }     public ValueProviderResult GetValue(string key)     {         return _wrappedProvider.GetValue(key);     } } In this post I've discussed the MVC IValueProvider used to map data to controller action method arguments and how this can be integrated into your Sitecore 6.6 MVC solution.

    Read the article

  • LDAP :Failed to find add in mandatory or optional attribute list

    - by Manju Prabhu
    I am trying to import an ldif file which has following content- DN: cn=myUser,cn=Users,dc=us,dc=oracle,dc=com objectclass: top objectclass: person objectclass: organizationalPerson objectclass: inetorgperson objectclass: orcluser objectclass: orcluserV2 cn: myUser givenname: myUser mail: myUser orclsamaccountname: myUser sn: myUser uid: myUser userpassword:: somepassword dn: cn=Administrator,cn=Groups,dc=us,dc=oracle,dc=com objectclass: person changetype: modify add: uniquemember uniquemember: cn=myUser,cn=Users,dc=us,dc=oracle,dc=com When I do this, LDAP throws follwing error javax.naming.directory.SchemaViolationException: [LDAP: error code 65 - Failed to find add in mandatory or optional attribute list.]; remaining name 'cn=Administrator,cn=Groups,dc=us,dc=oracle,dc=com' The user gets imported, but it is not added to the group(Group exists). What am i missing ?

    Read the article

  • How to get vm arguments from inside of java application?

    - by Dmitriy Matveev
    Hello, I need to check if some option which can be passed to JVM is explicitly set or is it have default value. To be more specific: I need to create one specific thread with higher native stack size than the default one, but in case then user want to take care of such things by himself by specifying -Xss option I want to create all threads with default stack size (which will be specified by user in -Xss option). I've checked classes like java.lang.System and java.lang.Runtime, but these aren't giving me information about vmargs. Is there any way to get information I need?

    Read the article

  • How do I embed an expect script that takes in arguments into a bash shell script?

    - by fzkl
    I am writing a bash script which amongst many other things uses expect to automatically run a binary and install it by answering installer prompts. I was able to get my expect script to work fine when the expect script is called in my bash script with the command "expect $expectscriptname $Parameter". However, I want to embed the expect script into the shell script instead of having to maintain two separate script files for the job. I searched around and found that the procedure to embed expect into bash script was to declare a variable like VAR below and then echo it.: VAR=$(expect -c " #content of expect script here ") echo "$VAR" 1) I don't understand how echoing $VAR actually runs the expect script. Could anyone explain? 2) I am not sure how to pass $Parameter into VAR or to the echo statement. This is my main concern. Any ideas? Thanks.

    Read the article

  • Redirecting via .htaccess to .php with arguments in current folder.

    - by Jengerer
    Hey, I'm trying to redirect something like foo/bar to ?foo=bar, so I can do www.mydomain.com/hey/foo/bar to www.mydomain.com/hey/?foo=bar, but I can't seem to get the syntax right. I tried the following: RewriteEngine on RewriteRule ^foo/(.*)$ ?foo=bar [NC] But this doesn't work. How would I accomplish this? I tried adding a forward slash behind the question mark, but that makes it link to the root directory. Thanks, Jengerer

    Read the article

  • How can I mix command line arguments and filenames for <> in Perl?

    - by Jimmeh
    Consider the following silly Perl program: $firstarg = $ARGV[0]; print $firstarg; $input = <>; print $input; I run it from a terminal like: perl myprog.pl sample_argument And get this error: Can't open sample_argument: No such file or directory at myprog.pl line 5. Any ideas why this is? When it gets to the < is it trying to read from the (non-existent) file, "sample_argument" or something? And why?

    Read the article

  • Why does my program not react to any arguments?

    - by Electric Coffee
    I have a simple test program in C++ that prints out attributes of a circle #include <iostream> #include <stdlib.h> #include "hidden_functions.h" // contains the Circle class using namespace std; void print_circle_attributes(float r) { Circle* c = new Circle(r); cout << "radius: " << c->get_radius() << endl; cout << "diameter: " << c->get_diameter() << endl; cout << "area: " << c->get_area() << endl; cout << "circumference: " << c->get_circumference() << endl; cout << endl; delete c; } int main(int argc, const char* argv[]) { float input = atof(argv[0]); print_circle_attributes(input); return 0; } when I run my program with the parameter 2.4 it outputs: radius: 0.0 diameter: 0.0 area: 0.0 circumference: 0.0 I've previously tested the program without the parameter, but simply using static values, and it ran just fine; so I know there's nothing wrong with the class I made... So what did I do wrong here? Note: the header is called hidden_functions.h because it served to test out how it would work if I had functions not declared in the header

    Read the article

  • In python, how do I drag and drop 1 or more files onto my script as arguments with absolute path? (f

    - by chromejs10
    I am writing a simple Python script with no GUI. I want to be able to drag and drop multiple files onto my python script and have access to their absolute paths inside of the script. How do I do this in Mac, Linux, and windows? For times sake, just Mac will be fine for now. I've googled this question and only found one related one but it was too confusing. I am currently running Mac OS X Snow Leopard. Any help is much appreciated. Thanks!

    Read the article

  • Avoiding new operator in JavaScript -- the better way

    - by greengit
    Warning: This is a long post. Let's keep it simple. I want to avoid having to prefix the new operator every time I call a constructor in JavaScript. This is because I tend to forget it, and my code screws up badly. The simple way around this is this... function Make(x) { if ( !(this instanceof arguments.callee) ) return new arguments.callee(x); // do your stuff... } But, I need this to accept variable no. of arguments, like this... m1 = Make(); m2 = Make(1,2,3); m3 = Make('apple', 'banana'); The first immediate solution seems to be the 'apply' method like this... function Make() { if ( !(this instanceof arguments.callee) ) return new arguments.callee.apply(null, arguments); // do your stuff } This is WRONG however -- the new object is passed to the apply method and NOT to our constructor arguments.callee. Now, I've come up with three solutions. My simple question is: which one seems best. Or, if you have a better method, tell it. First – use eval() to dynamically create JavaScript code that calls the constructor. function Make(/* ... */) { if ( !(this instanceof arguments.callee) ) { // collect all the arguments var arr = []; for ( var i = 0; arguments[i]; i++ ) arr.push( 'arguments[' + i + ']' ); // create code var code = 'new arguments.callee(' + arr.join(',') + ');'; // call it return eval( code ); } // do your stuff with variable arguments... } Second – Every object has __proto__ property which is a 'secret' link to its prototype object. Fortunately this property is writable. function Make(/* ... */) { var obj = {}; // do your stuff on 'obj' just like you'd do on 'this' // use the variable arguments here // now do the __proto__ magic // by 'mutating' obj to make it a different object obj.__proto__ = arguments.callee.prototype; // must return obj return obj; } Third – This is something similar to second solution. function Make(/* ... */) { // we'll set '_construct' outside var obj = new arguments.callee._construct(); // now do your stuff on 'obj' just like you'd do on 'this' // use the variable arguments here // you have to return obj return obj; } // now first set the _construct property to an empty function Make._construct = function() {}; // and then mutate the prototype of _construct Make._construct.prototype = Make.prototype; eval solution seems clumsy and comes with all the problems of "evil eval". __proto__ solution is non-standard and the "Great Browser of mIsERY" doesn't honor it. The third solution seems overly complicated. But with all the above three solutions, we can do something like this, that we can't otherwise... m1 = Make(); m2 = Make(1,2,3); m3 = Make('apple', 'banana'); m1 instanceof Make; // true m2 instanceof Make; // true m3 instanceof Make; // true Make.prototype.fire = function() { // ... }; m1.fire(); m2.fire(); m3.fire(); So effectively the above solutions give us "true" constructors that accept variable no. of arguments and don't require new. What's your take on this. -- UPDATE -- Some have said "just throw an error". My response is: we are doing a heavy app with 10+ constructors and I think it'd be far more wieldy if every constructor could "smartly" handle that mistake without throwing error messages on the console.

    Read the article

  • Implicitly including optional dependencies in Maven

    - by Jon Todd
    I have a project A which has a dependency X. Dependency X has an optional dependency Y which doens't get included in A by default. Is there a way to include Y in my POM without explicitly including it? In Ivy they have a way to essentailly say include all optional dependencies of X, does Maven have a way to do this?

    Read the article

  • jQuery UI Autocomplete plug-in pass in optional data for ajax call

    - by dev.e.loper
    I'm using jQuery UI Autocomplete plug-in. I'm giving it an URL to make an ajax call and retrieve data. I want to pass optional data parameters but not as part of URL. In the code they make a getJSON call and pass in 'request' parameter(which is an optional data parameter), however I don't see a way to get at this request parameter. this.source = function( request, response ) { $.getJSON( url, request, response ); };

    Read the article

  • External USB HD with -optional- mains?

    - by Stephen
    Hi, I'm Christmas-present-buying, and I'd appreciate recommendations for a USB HD with an optional mains power input. I've hunted, but can't find all the information I want (partially due to sketchy product specifications). Background: This is for a digital TV which I do not own, and so I'd like to get it correct first time. The TV has a USB port to allow recording straight to disk, but the manuals don't say how much power can be drawn through the USB port. The manual's instructions state, possibly generically, to plug the drive in before connecting to the TV. Ideally I'd like a small (2.5"?) drive which can draw power over USB, with an mains power input if it turns out the USB port on the TV doesn't offer enough juice. The ideal is to use one cable, two max. A powered USB hub would introduce too much clutter. I've spotted that the LaCie Petit drives have what appears to be an additional power input, but I'm not even sure from the specs what that is. And the device doesn't ship with a mains adapter. Suggestions?

    Read the article

  • External SATA drive does not work without the optional USB cable *also* connected

    - by Software Monkey
    I have Vantec NST-260SU external eSATA/USB drive enclosure (which came with an optional separate power supply) connected to a relatively new Windows 7 computer. The drive should work as a SATA drive with either the separate power supply or using a USB cable solely for power. I would prefer to use the external power supply because I have used all my rear USB ports. Now, if I connect both the eSATA and USB cable, then: The drive shows in the BIOS list of AHCI drives (and not in the list of attached USB devices). Everything I can see about it in Computer Management seems to show it as a SATA driver (for example, it shows as "Location 0 (Channel 5, Target 0, Lun 0)" like my other SATA drives (and not "on USB Mass Storage Device" like my USB flash-drives). It seems very fast, very much faster than my USB flash drives. However, if I disconnect the USB cable and attach the power adapter instead, the drive does not show in the BIOS list and cannot be seen by Windows. The power LED on the enclosure is lit, and the drive enclosure becomes warm after running for a bit, so I am sure it is receiving power. Does anyone know if this device requires both the USB and eSATA cable, and if so, why? Or is there possibly something I need to do to reset the enclosure to not need the USB - the install instructions are pretty clear that you must connect the SATA cable before connecting the USB cable in order for the drive to function as SATA, which I am sure I did. PS: I have reviewed the small manual which came with it, which has not been of help.

    Read the article

  • Regex with optional part doesn't create backreference

    - by padraigf
    I want to match an optional tag at the end of a line of text. Example input text: The quick brown fox jumps over the lazy dog {tag} I want to match the part in curly-braces and create a back-reference to it. My regex looks like this: ^.*(\{\w+\})? (somewhat simplified, I'm also matching parts before the tag): It matches the lines ok (with and without the tag) but doesn't create a back-reference to the tag. If I remove the '?' character, so regex is: ^.*(\{\w+\}) It creates a back-reference to the tag but then doesn't match lines without the tag. I understood from http://www.regular-expressions.info/refadv.html that the optional operator wouldn't affect the backreference: Round brackets group the regex between them. They capture the text matched by the regex inside them that can be reused in a backreference, and they allow you to apply regex operators to the entire grouped regex. but must've misunderstood something. How do I make the tag part optional and create a back-reference when it exists?

    Read the article

  • jQuery validate plugin radio with optional text

    - by timborden
    I'm trying to figure out how to validate a form element with a mix of radio inputs and a text input: <label>Question?</label> <input type="radio" class="mandatory" name="questions[1][]" value="1" />answer 1<br/> <input type="radio" class="mandatory" name="questions[1][]" value="2" />answer 2<br/> <input class="ignore" type="radio" id="questions[1][]" />Other (please specify)<br/> <input class="optional mandatory" type="text" name="questions[1][]" value="" /> I've figured out how to get the form to behave as expected (select and unselect) with the following code: $("input.optional").focus(function () { var this_name = $(this).attr("name"); $("input:radio").filter(function() {return $(this).attr('name') == this_name; }).attr('checked', false); $("input").filter(function() {return $(this).attr('id') == this_name; }).attr('checked', true); }); $(':radio').click(function () { var this_name = $(this).attr("name"); $("input").filter(function() {return $(this).attr('id') == this_name; }).attr('checked', false); $("input.optional").filter(function() {return $(this).attr('name') == this_name; }).val(''); }); I was hoping I could use the class "mandatory" to validate the mix of radio and text inputs: $("form .manditory").each(function () { $(this).rules("add", {required: true}); }); But it's not working as expected. With the radio (id="questions[1][]") selected, and the text input containing content, the form element is still flagged as invalid. Suggestions...maybe a better approach? Thanks in advance. UPDATE Sorry, I should have clarified that I'm using the validate plugin: $("form").validate({ ... });

    Read the article

  • LASTDATE dates arguments and upcoming events #dax #tabular #powerpivot

    - by Marco Russo (SQLBI)
    Recently I had to write a DAX formula containing a LASTDATE within the logical condition of a FILTER: I found that its behavior was not the one I expected and I further investigated. At the end, I wrote my findings in this article on SQLBI, which can be applied to any Time Intelligence function with a <dates> argument.The key point is that when you write LASTDATE( table[column] )in reality you obtain something like LASTDATE( CALCULATETABLE( VALUES( table[column] ) ) )which converts an existing row context into a filter context.Thus, if you have something like FILTER( table, table[column] = LASTDATE( table[column] ) the FILTER will return all the rows of table, whereas you probably want to use FILTER( table, table[column] = LASTDATE( VALUES( table[column] ) ) )so that the existing filter context before executing FILTER is used to get the result from VALUES( table[column] ), avoiding the automatic expansion that would include a CALCULATETABLE that would hide the existing filter context.If after reading the article you want to get more insights, read the Jeffrey Wang's post here.In these days I'm speaking at SQLRally Nordic 2012 in Copenhagen and I will be in Cologne (Germany) next week for a SSAS Tabular Workshop, whereas Alberto will teach the same workshop in Amsterdam one week later. Both workshops still have seats available and the Amsterdam's one is still in early bird discount until October 3rd!Then, in November I expect to meet many blog readers at PASS Summit 2012 in Seattle and I hope to find the time to write other article on interesting things on Tabular and PowerPivot. Stay tuned!

    Read the article

  • Allow any arguments for a given command with sudo

    - by Mark L
    I have the following sudo config entry which I added via sudo visudo: mark ALL = NOPASSWD: /usr/bin/lxc-ls* I can run lxc-ls with my user fine but I can't append any parameters without it demanding I prefix the command with sudo. $ whoami mark $ lxc-ls test-container $ lxc-ls --fancy lxc-ls: error: You must be root to access advanced container properties. Try running: sudo /usr/bin/lxc-ls Any idea how I can edit via sudo visudo to allow for any argument after the command? I don't want to prefix the command with sudo as I'm using a python library to execute the command and it's being funny about sudo prefixes.

    Read the article

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