Search Results

Search found 4670 results on 187 pages for 'jvm arguments'.

Page 87/187 | < Previous Page | 83 84 85 86 87 88 89 90 91 92 93 94  | Next Page >

  • When should I use $ (and can it always be replaced with parentheses)?

    - by J Cooper
    From what I'm reading, $ is described as "applies a function to its arguments." However, it doesn't seem to work quite like (apply ...) in Lisp, because it's a binary operator, so really the only thing it looks like it does is help to avoid parentheses sometimes, like foo $ bar quux instead of foo (bar quux). Am I understanding it right? Is the latter form considered "bad style"?

    Read the article

  • php POST and non-english language passes empty

    - by haim evgi
    I'm trying to program a Hebrew site with a search option. I am using php 5 with Apache 2.2, on a Debian 5 (Lenny) with appropriate code pages enabled. I am using _POST to pass arguments to a script. If I pass English word to the script everything works, but when I use Hebrew nothing is passed through the POST function. When I use ECHO to show _POST, the variable is empty. What might be the problem?

    Read the article

  • In php, how to detect the execution is from CLI mode or through browser ?

    - by binoy
    Hi, I have a common script which Im including in my php cron files and the files which are accessing through the browser. Some part of the code, I need only for non cron files. How can I detect whether the execution is from CLI or through browser (I know it can be done by passing some arguments with the cron files but I dont have access to crontab). Is there any other way ? Regards Binoy

    Read the article

  • Fast ArgumentNullException with attributes. It is possible?

    - by Fraga
    Hi. Is there any fast way to verify null arguments via attributes or something? Convert this: public void Method(type arg1,type arg2,type arg3) { if (arg1== null) throw new ArgumentNullException("arg1"); if (arg2== null) throw new ArgumentNullException("arg2"); if (arg3== null) throw new ArgumentNullException("arg3"); //Business Logic } Into something like this: [VerifyNullArgument("arg1","arg2","arg3")] public void Method(type arg1,type arg2,type arg3) { //Business Logic } Ideas? thanks guys.

    Read the article

  • All possible permutations of a set of lists in Python

    - by Ian Davis
    In Python I have a list of n lists, each with a variable number of elements. How can I create a single list containing all the possible permutations: For example [ [ a, b, c], [d], [e, f] ] I want [ [a, d, e] , [a, d, f], [b, d, e], [b, d, f], [c, d, e], [c, d, f] ] Note I don't know n in advance. I thought itertools.product would be the right approach but it requires me to know the number of arguments in advance

    Read the article

  • Scala: is it possible to override default case class constructor?

    - by adam77
    Just wondering if this is possible. What I would actually like to do is check and possibly modify one of the arguments before it is stored as a val. Alternatively, I could use an overload and make the default constructor private. In which case I would also like to make private the default factory constructor in the companion object, how would I do that? Many thanks. Adam

    Read the article

  • DRY Ruby Initialization with Hash Argument

    - by ktex
    I find myself using hash arguments to constructors quite a bit, especially when writing DSLs for configuration or other bits of API that the end user will be exposed to. What I end up doing is something like the following: class Example PROPERTIES = [:name, :age] PROPERTIES.each { |p| attr_reader p } def initialize(args) PROPERTIES.each do |p| self.instance_variable_set "@#{p}", args[p] if not args[p].nil? end end end Is there no more idiomatic way to achieve this? The throw-away constant and the symbol to string conversion seem particularly egregious.

    Read the article

  • python programme.

    - by siva
    hi, i am siva this is frist time taken the python programming language i have a small problem please help me the question is **Write two functions, called countSubStringMatch and countSubStringMatchRecursive that take two arguments, a key string and a target string. These functions iteratively and recursively count the number of instances of the key in the target string. You should complete definitions for def countSubStringMatch(target,key): and def countSubStringMatchRecursive (target, key): **

    Read the article

  • Is frozenset adequate for caching of symmetric input data in a python dict?

    - by Debilski
    The title more or less says it all: I have a function which takes symmetric input in two arguments, e.g. something like def f(a1, a2): return heavy_stuff(abs(a1 - a2)) Now, I want to introduce some caching method. Would it be correct / pythonic / reasonably efficient to do something like this: cache = {} def g(a1, a2): return cache.setdefault(frozenset((tuple(a1), tuple(a2))), f(a1, a2)) Or would there be some better way?

    Read the article

  • LINQ Query returns nothing.

    - by gtas
    Why is this query returns 0 lines? There is a record matching the arguments. Deafkaw.Where(p => (p.ImerominiaKataxorisis >= aDate && p.ImerominiaKataxorisis <= DateTime.Now) && (p.Year == etos && p.IsYpodeigma == false) ).ToList(); Am i missing something?

    Read the article

  • Matching strings

    - by Joy
    Write the function subStringMatchExact. This function takes two arguments: a target string, and a key string. It should return a tuple of the starting points of matches of the key string in the target string, when indexing starts at 0. Complete the definition for def subStringMatchExact(target,key): For example, subStringMatchExact("atgacatgcacaagtatgcat","atgc") would return the tuple (5, 15).

    Read the article

  • Using RhinoMocks, how do you mock or stub a concrete class without an empty constructor?

    - by Mark Rogers
    Mocking a concrete class with Rhino Mocks seems to work pretty easy when you have an empty constructor on a class: public class MyClass{ public MyClass() {} } But if I add a constructor that takes parameters and remove the one that doesn't take parameters: public class MyClass{ public MyClass(MyOtherClass instance) {} } I tend to get an exception: System.MissingMethodException : Can't find a constructor with matching arguments I've tried putting in nulls in my call to Mock or Stub, but it doesn't work. Can I create mocks or stubs of concrete classes with Rhino Mocks, or must I always supply (implicitly or explicitly) a parameter-less constructor?

    Read the article

  • Execute a Application On The Server Using JavaScript

    - by Nathan Campos
    I have an application on my server that is called leaf.exe, that haves two arguments needed to run, they are: inputfile and outputfile, that will be like this example: pnote.exe input.pnt output.txt They are all on the same directory as my home page file(the executable and the input file). But I need that a JavaScript could run the application like that, then I want to know how could I do this.

    Read the article

  • Cannot mock class with constructor having array parameter using Rhino Mocks

    - by SharePoint Newbie
    Hi, We cannot mock his class in RhinoMocks. public class Service { public Service(Command[] commands){} } public abstract class Command {} // Code var mock = MockRepository.GenerateMock<Service>(new Command[]{}); // or mock = MockRepository.GenerateMock<Service>(null) Rhino mocks fails complaining that it cannot find a constructor with matching arguments. What am I doing wrong? Thanks,

    Read the article

  • JQuery UI popup elements not positioning correctly

    - by Okku
    I am using both JQuery UI Dialog and JQuery UI autocomplete both have the same erroneous behavior when they popup, the position is always 0,0! I have tried some different position arguments when popping up the dialog but non seems to help. Any clues? Is this a bug in the position calculation in JQuery? Or is this some css bug? Versions are 1.4.2 and 1.8.0

    Read the article

  • Adding nodes to drupal from remote site using ajax and post

    - by andersandersson666
    I'm trying to add nodes to my drupal site, from a campaignsite using AJAX request. I have set up a menu_callback item in my hook_menu, that checks if any $_POSTs are coming in, and it works if i make a form that has the action='http://mysite.com/menucallback/url', but i get nothing in response if i make the same request with ajax. I have access arguments set to 'access content'. If anyone knows what might be the problem, that would be very helpful. Thank you. /Anders

    Read the article

  • error in midlet while implementing command..

    - by garima
    hi I have imported import com.sun.lwuit.Command; import javax.microedition.midlet.; import javax.microedition.lcdui.; in my code but still the following errors are coming... exitCommand = new Command("Exit", Command.EXIT, 2); //line 1 textbox.addCommand(exitCommand); //line 2 Command.EXIT cannot be resolved.. The method addCommand(Command) in the type Displayable is not applicable for the arguments (Command)

    Read the article

  • Can a single argument constructor with a default value be subject to implicit type conversion

    - by Richard
    I understand the use of the explicit keyword to avoid the implicit type conversions that can occur with a single argument constructor, or with a constructor that has multiple arguments of which only the first does not have a default value. However, I was wondering, does a single argument constructor with a default value behave the same as one without a default value when it comes to implicit conversions?

    Read the article

< Previous Page | 83 84 85 86 87 88 89 90 91 92 93 94  | Next Page >