Search Results

Search found 6144 results on 246 pages for 'ignore arguments'.

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

  • Small Python optional arguments question

    - by ooboo
    I have two functions: def f(a,b,c=g(b)): blabla def g(n): blabla c is an optional argument in function f. If the user does not specify its value, the program should compute g(b) and that would be the value of c. But the code does not compile - it says name 'b' is not defined. How to fix that? Someone suggested: def g(b): blabla def f(a,b,c=None): if c is None: c = g(b) blabla But this doesn't work, because maybe the user intended c to be None and then c will have another value.

    Read the article

  • Automatically open files given as command line arguments in Python

    - by mk
    I have a lot of Perl scripts that looks something like the following. What it does is that it will automatically open any file given as a command line argument and in this case print the content of that file. If no file is given it will instead read from standard input. while ( <> ) { print $_; } Is there a way to do something similar in Python without having to explicitly open each file?

    Read the article

  • Passing arguments to UILabel [ 2 ] *

    - by DesperateLearner
    I'm trying to call a method of the below (Scroll animation class) type from a viewcontroller class. -(void)CreateLabel:(CGRect )frame andLabel:(UILabel *[NUM_LABELS])label andview:(UIView *)view; I got some errors when I tried passing the argument. Any suggestion on how to call this? This is how I called that method ScrollAnimation *newAnimation = [[ScrollAnimation alloc] init]; [newAnimation CreateLabel:CGRectMake(0, 50, 300,30) andLabel:animateLabel[NUM_LABELS] andview:self.view]; I have the error /Volumes/Red Drive/CarTransition/CarTransition/ViewController.m:120:66: Implicit conversion of an Objective-C pointer to 'UILabel **' is disallowed with ARC /Volumes/Red Drive/CarTransition/CarTransition/ViewController.m:120:66: Incompatible pointer types sending 'UILabel *__strong' to parameter of type 'UILabel **'

    Read the article

  • drupal views block arguments

    - by slimcady
    I currently have a view (Drupal 6 using Views2) that properly aggregates a custom content type (videos) and filters them for a page display. When I create a block display, it previews the results in live preview just great, but when i go to the page expecting to see the block it doesn't appear. I'm fairly certain the argument I'm attempting to pass it fails because when I select "Display all results" for "Action to take if argument does not validate:" the block shows up on the page just fine. Any advice definitely appreciated.

    Read the article

  • bash tools for parsing arguments

    - by BCS
    I have a bash script that uses a few variables (call them $foo and $bar). Right now the script defines them at the top with hard coded values like this: foo=fooDefault bar=barDefault .... # use $foo and $bar What I want is to be able to use the script like any of these: myscript # use all defaults myscript -foo=altFoo # use default bar myscript -bar=altBar # use default foo myscript -bar=altBar -foo=altFoo An ideal solution would allow me to just list the variable that I want to check for flags for. Is there a reasonably nice way to do this? I've seen getopt and I think it might do about 70% of what I'm looking for but I'm wondering if there is a tool or indium that builds on it or the like that gets the rest.

    Read the article

  • Free E-book - Ignore ASP.NET MVC at Your Own Peril: Lessons Learned from the Trenches

    - by TATWORTH
    Originally posted on: http://geekswithblogs.net/TATWORTH/archive/2013/06/22/free-e-book---ignore-asp.net-mvc-at-your-own-peril.aspxAt http://www.syncfusion.com/resources/techportal/whitepapers/aspnet-mvc, Syncfusion are offering a free E-Book "Ignore ASP.NET MVC at Your Own Peril: Lessons Learned from the Trenches"Using code examples and a side-by-side comparison with Web Forms, this white paper details:Separation of concerns: UI code and business logicAJAX and the server–side lifecycleJQuery & client-side scriptingPerformance issues and the impact on end–usersBrowser compatibility issuesI will in due course be doing a review of this book

    Read the article

  • Why does google does not ignore the word "languages", although I have set to ignore it in advanced search settings

    - by jitendra1234
    Why does google does not ignore the word "languages", although I have set to ignore it in advanced search settings. here is the term I am using in google search: -languages site:http://en.wikipedia.org/wiki/ and here is the first result where the word "languages" is still present, (you can do a quick crtl+F to find out) http://en.wikipedia.org/wiki/Walter_Bedell_Smith I am just curious to know why google have not ignored the word "languages"?

    Read the article

  • C# 4.0: Alternative To Optional Arguments

    - by Paulo Morgado
    Like I mentioned in my last post, exposing publicly methods with optional arguments is a bad practice (that’s why C# has resisted to having it, until now). You might argument that your method or constructor has to many variants and having ten or more overloads is a maintenance nightmare, and you’re right. But the solution has been there for ages: have an arguments class. The arguments class pattern is used in the .NET Framework is used by several classes, like XmlReader and XmlWriter that use such pattern in their Create methods, since version 2.0: XmlReaderSettings settings = new XmlReaderSettings(); settings.ValidationType = ValidationType.Auto; XmlReader.Create("file.xml", settings); With this pattern, you don’t have to maintain a long list of overloads and any default values for properties of XmlReaderSettings (or XmlWriterSettings for XmlWriter.Create) can be changed or new properties added in future implementations that won’t break existing compiled code. You might now argue that it’s too much code to write, but, with object initializers added in C# 3.0, the same code can be written like this: XmlReader.Create("file.xml", new XmlReaderSettings { ValidationType = ValidationType.Auto }); Looks almost like named and optional arguments, doesn’t it? And, who knows, in a future version of C#, it might even look like this: XmlReader.Create("file.xml", new { ValidationType = ValidationType.Auto });

    Read the article

  • How can I process command line arguments in Python?

    - by photographer
    What would be an easy expression to process command line arguments if I'm expecting anything like 001 or 999 (let's limit expectations to 001...999 range for this time), and few other arguments passed, and would like to ignore any unexpected? I understand if for example I need to find out if "debug" was passed among parameters it'll be something like that: if 'debug' in argv[1:]: print 'Will be running in debug mode.' How to find out if 009 or 575 was passed? All those are expected calls: python script.py python script.py 011 python script.py 256 debug python script.py 391 xls python script.py 999 debug pdf At this point I don't care about calls like that: python script.py 001 002 245 568 python script.py some unexpected argument python script.py 0001 python script.py 02 ...first one - because of more than one "numeric" argument; second - because of... well, unexpected arguments; third and fourth - because of non-3-digits arguments.

    Read the article

  • Mercurial/.hgignore - How do I ignore everything but the contents of a folder?

    - by Beibin
    I have a NetBeans project and the Mercurial repository is in the project root. I would like it to ignore everything except the contents of the "src" and "test" folders, and .hgignore itself. I'm not familiar with regular expressions and can't come up with one that will do that. The ones I tried: (?!src/.*) (?!test/.*) (?!^.hgignore) (?!src/.|test/.|.hgignore) These seem to ignore everything, I can't figure out why. Any advice would be great.

    Read the article

  • Named arguments (parameters) as a readability aid

    - by Damian Mehers
    A long time ago I programmed a lot in ADA, and it was normal to name arguments when invoking a function - SomeObject.DoSomething(SomeParameterName = someValue); Now that C# supports named arguments, I'm thinking about reverting to this habit in situations where it might not be obvious what an argument means. You might argue that it should always be obvious what an argument means, but if you have a boolean argument, and callers are passing in "true" or "false" then qualifying the value with the name makes the call site more readable. contentFetcher.DownloadNote(note, manual : true); I guess I could create Enums instead of using true or false (Manual, Automatic in this case). What do you think about occasionally using named arguments to make code easier to read?

    Read the article

  • Input to program without command-line arguments

    - by Core Xii
    Let's assume that there are no command-line arguments. How do you pass input data to a program? I'm thinking you'd write the input to a file with a specific name, such that the program knows to open and read it as input. However, how would one discover the name of that file? Usually, running a command-line program without arguments or with some standard help argument (e.g. \?) produces some instruction on how to use it. But given an environment with no command-line arguments, how does one discover how to operate a program?

    Read the article

  • How to grub-install ignore specific drive/partition

    - by gsedej
    Is it possible to use grub-install or update-grub to just search on specific disk/partition? (or ignore specific)? I installed Ubuntu 12.04 on my hard drive, but i wished to do some testing on it without harming current installation, so I "rsynced" root partition (the only) to the USB partition (ext4). I did fix /etc/fstab on USB partition. The problem is that when I do grub-install /dev/sdb (usb) GRUB seems to confuse when UUIDs. Whatever I chose in GRUB it always boot from disk. In grub in edit mode I see that in two "UUID" lines are not the same. If I retype UUID from "first" to second "line" it boots from USB (as I wish). Is there any other way than fixing /boot/grub/grub.cfg each time? EDIT: the GRUB generated good when I booted from USB and grub-install from there, but question is still if it's possible ignore drives

    Read the article

  • What's wrong with my svn:ignore pattern?

    - by boris callens
    I have the pattern svn:ignore datasheets/*/*.pdf It is supposed to ignore all pdfs that are at an arbitrary depth under multiple "datasheet" directories under the current root folder. As an example: say I have a dir structure like this Websites -web1 -dataSheets -AT -ignore.pdf -BE -NL -ignore.pdf -FR -ignore.pdf -ignore2.pdf -licenseAgreements -important.pdf -web2 -datasheets -etc In this example the pattern needs to ignore all the ignore.pdfs without ingoring the important.pdf too. The shown pattern still includes all my pdf files. I know there are a bunch of similar questions, but none of them seem to tackle the problem with the various hierarchy levels.

    Read the article

  • ignore certain buffers using iswitchb

    - by robUK
    Hello, GNU Emacs 23.1 I am using iswitchb. However, when I press c-x b I get a list of buffers. However, I don't want to display one like scratch, Messages, GNU Emacs, etc. Just the buffers I have opened myself. So I am looking for a way to ignore these buffers. This is what I have in my configuration. However, it doesn't ignore the buffers I don't want. Have I done anything wrong? ;; Setup iswitchb to select different buffers, ignore buffers to reduce list (iswitchb-mode 1) (setq iswitchb-buffer-ignore '("*scratch*")) (setq iswitchb-buffer-ignore '("*Messages*")) (setq iswitchb-buffer-ignore '("*GNU Emacs*")) (setq iswitchb-buffer-ignore '("*compilation*")) Many thanks for any suggestions,

    Read the article

  • How to ignore certain coding standard errors in PHP CodeSniffer

    - by Tom
    We have a PHP 5 web application and we're currently evaluating PHP CodeSniffer in order to decide whether forcing code standards improves code quality without causing too much of a headache. If it seems good we will add a SVN pre-commit hook to ensure all new files committed on the dev branch are free from coding standard smells. Is there a way to configure PHP codeSniffer to ignore a particular type of error? or get it to treat a certain error as a warning instead? Here an example to demonstrate the issue: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head> <body> <div> <?php echo getTabContent('Programming', 1, $numX, $numY); if (isset($msg)) { echo $msg; } ?> </div> </body> </html> And this is the output of PHP_CodeSniffer: > phpcs test.php -------------------------------------------------------------------------------- FOUND 2 ERROR(S) AND 1 WARNING(S) AFFECTING 3 LINE(S) -------------------------------------------------------------------------------- 1 | WARNING | Line exceeds 85 characters; contains 121 characters 9 | ERROR | Missing file doc comment 11 | ERROR | Line indented incorrectly; expected 0 spaces, found 4 -------------------------------------------------------------------------------- I have a issue with the "Line indented incorrectly" error. I guess it happens because I am mixing the PHP indentation with the HTML indentation. But this makes it more readable doesn't it? (taking into account that I don't have the resouces to move to a MVC framework right now). So I'd like to ignore it please.

    Read the article

  • Box2D: How to get the Exact Collision Point and ignore the collision (from 2 "ghost bodies")

    - by Moritz
    I have a very basic problem with Box2D. For a arenatype game where you can throw scriptable "missiles" at other players I decided to use Box2D for the collision detection between the players and the missiles. Players and missiles have their own circular shape with a specific size (varying). But I don´t want to use dynamic bodies because the missiles need to move themselve in any way they want to (defined in the script) and shouldnt be resolved unless the script wants it. The behavior I look for is as following (for each time step): velocity of missiles is set by the specific missile script each missile is moved according to that velocity if a collision accurs now, I want to get the exact position of impact, and now I need a mechanism to decide if the missile should just ignore the collision (for example collision between two fireballs which shouldnt interact) or take it (so they are resolved and dont overlap anymore) So is there a way in Box2D to create Ghost bodies and listen to collisions from them, then deciding if they should ignore the collision or should take them and resolve their position? I hope I was clear enough and would be happy about any help!

    Read the article

  • Ignore Partial Upgrade -- Google Earth Dependencies

    - by pyraz
    I'm running a 64-bit install of Xubuntu 12.04. It took me a little while to get Google Earth working. The 64-bit Google earth package requires some 32-bit gtk libraries provided by ia32-libs. However, when I ran a simulation to install ia32-libs and it's dependencies, it wanted to remove a ton of programs, including the xubuntu-desktop meta-package. As a work-around, I used getlibs to get the 32-bit libraries I needed, and then installed Google Earth with the deb package and the --ignore-depend option to dpkg. Awesome, Google Earth is installed and is working great! Now, however, Update Manager keeps complaining about a "Partial Upgrade", and apt-get won't let me install any new applications. It wants me to do a fix-broken install, but when I do a simulation of apt-get -f install I get some very bad news, they want to uninstall the Google Earth I just worked so hard to install! $> apt-get -f -s install Reading package lists... Done Building dependency tree Reading state information... Done Correcting dependencies... Done The following packages will be REMOVED: googleearth 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. Remv googleearth [6.0.3.2197+0.7.0-1] TL;DR The --ignore-depends passed to dpkg is not propagating to apt-get, so now I can't install any new applications until I uninstall Google Earth, because of it's missing dependencies (even though it works fine without them). How can I fix this?

    Read the article

  • How to get the Exact Collision Point and ignore the collision (from 2 "ghost bodies")

    - by Moritz
    I have a very basic problem with Box2D. For a arenatype game where you can throw scriptable "missiles" at other players I decided to use Box2D for the collision detection between the players and the missiles. Players and missiles have their own circular shape with a specific size (varying). But I don´t want to use dynamic bodies because the missiles need to move themselve in any way they want to (defined in the script) and shouldnt be resolved unless the script wants it. The behavior I look for is as following (for each time step): velocity of missiles is set by the specific missile script each missile is moved according to that velocity if a collision accurs now, I want to get the exact position of impact, and now I need a mechanism to decide if the missile should just ignore the collision (for example collision between two fireballs which shouldnt interact) or take it (so they are resolved and dont overlap anymore) So is there a way in Box2D to create Ghost bodies and listen to collisions from them, then deciding if they should ignore the collision or should take them and resolve their position? I hope I was clear enough and would be happy about any help!

    Read the article

  • Depending on fixed version of a library and ignore its updates

    - by Moataz Elmasry
    I was talking to a technical boss yesterday. Its about a project in C++ that depends on opencv and he wanted to include a specific opencv version into the svn and keep using this version ignoring any updates which I disagreed with.We had a heated discussion about that. His arguments: Everything has to be delivered into one package and we can't ask the client to install external libraries. We depend on a fixed version so that new updates of opencv won't screw our code. We can't guarantee that within a version update, ex from 3.2.buildx to 3.2.buildy. Buildy the function signatures won't change. My arguments: True everything has to be delivered to the client as one package,but that's what build scripts are for. They download the external libraries and create a bundle. Within updates of the same version 3.2.buildx to 3.2.buildy its impossible that a signature change, unless it is a really crappy framework, which isn't the case with opencv. We deprive ourselves from new updates and features of that library. If there's a bug in the version we took, and even if there's a bug fix later, we won't be able to get that fix. Its simply ineffiecient and anti design to depend on a certain version/build of an external library as it makes our project difficult in the future to adopt to new changes. So I'd like to know what you guys think. Does it really make sense to include a specific version of external library in our svn and keep using it ignoring all updates?

    Read the article

  • C++0x, How do I expand a tuple into variadic template function arguments?

    - by Gustaf
    Consider the case of a templated function with variadic template arguments: template<typename Tret, typename... T> Tret func(const T&... t); Now, I have a tuple t of values. How do I call func() using the tuple values as arguments? I've read about the bind() function object, with call() function, and also the apply() function in different some now-obsolete documents. The GNU GCC 4.4 implementation seems to have a call() function in the bind() class, but there is very little documentation on the subject. Some people suggest hand-written recursive hacks, but the true value of variadic template arguments is to be able to use them in cases like above. Does anyone have a solution to is, or hint on where to read about it?

    Read the article

  • Make flash ignore transparent wmode — always display opaque background

    - by Tometzky
    How to make flash movie (an advertising banner) ignore <param name="wmode" value="transparent">? There are some CMS systems which insert flash movies automatically with transparent wmode option. Flash Player ignores banner's background color, makes it transparent and displays it on web page background. I can workaround it using additional layer at the bottom with a large rectangle of desired color, but I think it is inefficient and inelegant. How to do this better?

    Read the article

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