I want to get a complete list of everyone who has ever committed to a file, is there a command (blame with some arguments, maybe) do that nicely?
Thanks
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"?
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?
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
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.
I need the behaviour of sql2005 where function OBJECT_NAME takes two arguments obj id and db id, while sql2000 takes only obj id so the execution must be in the context of the database to which inspected object belongs to. Solution must be possible to implement in a function, so it can be used in a select query.
call.addParameter("String_1", QNAME_TYPE_STRING,ParameterMode.IN);
I want to invoke web service and I'm lost in the request/response thing.
I have WSDL and I wonder how I can put the requested arguments and read the response.
What does "String_1" means? its name of what?
Please help me,
Thank you in advance
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
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
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.
Digital Mars D seems to be very good programming language in a lot of ways, but my only problem with it is the amount of time wasted writing arguments to the compiler in the command line at the old fashion way. Is there any good IDE for D?
Thanks in advance!
How do you run Scheme programs from the terminal in linux(ubuntu)? Also how to accept arguments from the command-line in a Scheme program?
Edit: Im using the DrScheme implementation.
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):
**
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?
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?
When and where do you put type annotations in Clojure code? Obviously when performance counts. But are there rules by which you can live of when (only when doing Java Interop?) and where to add them (function definition arguments)?
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).
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?
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.
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,
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
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
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)
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?