find . -name *.JPG -exec rename 's/\.JPG$/\.jpg/i' {} +It won't work on Mac though (a Mac user offered this one):
for i in `find . -name '*.JPG'`; do mv $i ${i/%JPG/jpg}; done
Thought it might be worth remembering :)
find . -name *.JPG -exec rename 's/\.JPG$/\.jpg/i' {} +It won't work on Mac though (a Mac user offered this one):
for i in `find . -name '*.JPG'`; do mv $i ${i/%JPG/jpg}; done
class a {
function first() {
echo 'a:first ';
}
function second() {
echo 'a:second ';
self::first();
}
}
class b extends a {
function first() {
echo 'b:first ';
}
function third() {
echo 'b:third ';
self::second();
}
}
$objB = new b();
$objB->third();
b:third a:second a:firstbecause self does not care about the object instance.
self::first()with the line
$this->first()the output will change to what you might have expected in the first place:
b:third a:second b:first
>>> a = [{}]*3
>>> a[0]["bbb"]=1
>>> a
[{'bbb': 1}, {'bbb': 1}, {'bbb': 1}]
>>> a=[]
>>> for i in range(3):
... a[i]={}
>>> a
[{}, {}, {}]
>>> a[1]["bbb"]=1
>>> a
[{}, {'bbb': 1}, {}]
>>> c = [None]*5
>>> for e in c:
... e = {}
...
>>> c
[None, None, None, None, None]
>>> c[2]={}
>>> c[1]={}
>>> c[2]["aaa"]=3
>>> c[1]["bbb"]=4
>>> c
[None, {'bbb': 4}, {'aaa': 3}, None, None]
>>> c[1]["aaa"]=5
>>> c
[None, {'aaa': 5, 'bbb': 4}, {'aaa': 3}, None, None]
function getDateParam($format="Y-m-d h:m:s") {$timestamp = ....
class MyHumbleDerivedClass {function getDateParam() {
if ($derivedObject->getDateParam()<$timestamp) {4. Enjoy.
// think that it should work
}
>>> '"Isn\'t," she said.'Does it mean there is no way to have both single and double quotes in a Python literal???
'"Isn\'t," she said.'
result = '"Isn\'t," she said.'would produce the expected
print result
"Isn't," she said.after all :)