I want to rename all nested directories named "foo" to "bar" - I've tried the following with no joy:
find */ -name 'foo' | xargs svn move {} 'bar' \;
Thanks
In class Foo I'd like to include method Bar under certain conditions:
module Bar
def some_method
"orly"
end
end
class Foo
def initialize(some_condition)
if !some_condition
"bar"
else
class << self; include Bar; end
end
end
end
Is there any cleaner (and clearer) way to achieve the include in the method without having to do it inside the singleton class?
In C# one can define a type member constant like this:
class Foo { public const int Bar = 600; }
The IL shall looks like this.
.field public static literal int32 Bar = int32(600)
How can I do the same within Visual F# / FSharp?
I tried this to no avail:
[<Sealed>]
type Foo() =
[<Literal>]
let Bar = 600
URI.extract claims to do this, but it doesn't handle matched parens:
>> URI.extract("text here (http://foo.example.org/bla) and here")
=> ["http://foo.example.org/bla)"]
What's the best way to extract URLs from text without breaking parenthesized URLs (which users like to use)?
How does a member set inside an action...
$this->foo = 'bar';
...become a variable accessible from a template...
echo $foo; // bar
I would like to know how it is achieved at a framework level.
There is a lot of documentation on how to use Symfony, but I've not managed to find much about how it all fits together behind the scenes (class structure/inheritance etc).
Thanks in advance for your help!
How would I do something like below?
[
'foo'
['bar', 'baz'],
[
'one',
['two', 'three']
]
].each { |word| puts word }
# I want this to return:
foo
bar
baz
one
two
three
Is there any difference between these two methods of moving a file?
System.IO.FileInfo f = new System.IO.FileInfo(@"c:\foo.txt");
f.MoveTo(@"c:\bar.txt");
//vs
System.IO.File.Move(@"c:\foo.txt", @"c:\bar.txt");
I'm trying to resolve two URIs, but it's not as straightforward as I'd like it to be.
URI a = new URI("http://www.foo.com");
URI b = new URI("bar.html");
The trouble is that a.resolve(b).toString() is now "http://www.foo.combar.html". How can I get away with that?
Say I got:
class X_
{
public:
void do() { }
}
class Y_ : public X_
{
}
And I have this function:
void foo(X_ whatever)
{
whatever.do();
}
Can I send a "Y_" object to the foo function, would this work?
I just realized that I could have tested this myself :)
If I understand it correctly this means
extern void foo();
that the function foo is declared in another translation unit.
1) Why not just #include the header in which this function is declared?
2) How does the linker know where to look for function at linking time?
Using jQuery what provides for faster object construction:
With the HTML code
$('<dd class="foo baz" id="bar"> foobar </dd>')
Or with the pure object/method variant
$('</dd>').addClass('foo').addClass('baz').id('bar').text('foobar')
I'm not sure how the internals work, feel free to supply a high level summary.
Should my multithreaded application with read only properties require locking? Since nothing is being written I assume there is no need for locks, but I would like to make sure. Would the answer to this question be language agnostic?
Without Lock:
Private m_strFoo as new String = "Foo"
Public ReadOnly Property Foo() As String
Get
return m_strFoo.copy()
End Get
End Property
With Lock:
Private m_strBar as new String = "Bar"
Public ReadOnly Property Bar() As String
Get
SyncLock (me)
return m_strBar.copy()
End Synclock
End Get
End Property
Something like this:
http://perl.plover.com/yak/regex/samples/slide083.html
In other words I want to match successfully on { { foo } { bar} } but not on { { foo } .
I see it's possible in perl, and in .NET. Is it possible in emacs regex?
Hi there,
Is there a way to change the name that displays on the AppStore, rather than the name associated with the credit card/apple ID associated with the developer programme?
For example, if my name on my credit card was foo, and the name on the apple ID was foo, but I actually want the name displayed on the AppStore (i.e. next to my App's name and details) to be bar.
BTW: The programme is individual.
Many thanks,
Jack
I am fiddling around with JBOSS's Web Services, and I have created the following:
http://127.0.0.1:8080/IM/TestService?wsdl
Now I need to access Web Methods from that Web Service from JavaScript.
Say I have a web method named foo in TestService, how do I make an ajax call to it?
I tried accessing the method via http://127.0.0.1:8080/IM/TestService/foo, but I'm getting an HTTP Status 404.
In Windows the Dropbox client uses python25.dll and the MS C runtime libraries (msvcp71.dll, etc). On OS X the Python code is compiled bytecode (pyc).
My guess is they are using a common library they have written then just have to use different hooks for the different platforms.
What method of development is this? It clearly isn't IronPython or PyObjC. This paradigm is so appealing to me, but my CS foo and Google foo are failing me.
I want to find the token's name passed by augment into a function.
class Norm
{
const STR_NORM = 0;
const INT_NORM = 0;
}
function foo($Arg1, $Arg2 = NULL)
{
getConstName($Arg1); # Should Return STR_NORM;
return $Arg1, $Arg2;
}
echo foo(Norm::STR_NORM);
Is there any way to impalement getConstName via the PHP Reflection API?
On a standard linux set up, where can I add a directory to the @INC variable?
In the /etc/profile file, I added:
export PERLLIB=$PERLLIB:/foo/bar
export PERL5LIB=$PERL5LIB:/foo/bar
Thanks
I want to find all nodes in a xml file that have a certain tag-name, lets say "foo".
If those foo-tags have them thelves child nodes with node-name "bar", then I want to remove those nodes. The result should be written to a file.
// remove this one
// don't remove this one
Thanx for any hints. As the tag indicates, I would like to do this with python.
Based on this answer
http://stackoverflow.com/questions/469913/regular-expressions-is-there-an-and-operator
I tried the following on http://regexpal.com/ but was unable to get it to work. What am missing? Does javascript not support it?
Regex: (?=foo)(?=baz)
String: foo,bar,baz
In Javascript, if an object has lots of properties that are functions:
var obj = { foo: function() { ... },
bar: function() { ... },
...
}
then how can you get an array of names of those functions? That is, an array
["foo", "bar", ... ]
thanks.
Given a ParameterInfo p from this:
void foo(int modopt(IsLong) n);
p.GetOptionalCustomModifiers() returns a System.Runtime.CompilerServices.IsLong; however, if the method signature happens to be:
void foo(out int modopt(IsLong) n);
It does not. Is there a work around for this?
If we have three functions (foo, bar, and baz) that are composed like so...
foo(bar(), baz())
Is there any guarantee by the C++ standard that bar will be evaluated before baz?
I load scripts using luaL_loadfile and then lua_pcall from my game, and was wondering if instead of loading them into the global table, I could load them into a table named after their filename?
For example:
I have I file called "Foo.lua", which contains this:
function DoSomething()
--something
end
After loading it I want to be able to access it like:
Foo.DoSomething()
Thanks!
I have the following interface in Java
public interface IFoo
{
public abstract void foo();
public void bar();
}
What is the difference between foo() and bar()?
When should I use abstract?
Both seem to accomplish what I want unless I'm missing something subtle?
Update Duplicate of Why would one declare a Java interface method as abstract?