Enabled directory index means that if someone access to any folder which don't contains index.php , index.html, index.htm or any other default file defined in DirectoryIndex in apache configuration then all files in that folder will be listed in browser if you try to visit that page.
Often director...
To run multiple processes e.g. an Apache web server together with an SSH daemon inside the same container you can use supervisord.
Create your supervisord.conf configuration file like:
[supervisord]
nodaemon=true
[program:sshd]
command=/usr/sbin/sshd -D
[program:apache2]
command=/bin/bash...
type
TIntegerList = class(TList<Integer>)
public
function Sum: Integer;
end;
...
function TIntegerList.Sum: Integer;
var
Item: Integer;
begin
Result := 0;
for Item in Self do
Result := Result + Item;
end;
If we have this dictionary:
set alpha {alice {items {}} bob {items {}} claudia {items {}} derek {items {}}}
And want to add "fork" and "peanut" to Alice's items, this code won't work:
dict lappend alpha alice items fork peanut
dict get $alpha alice
# => items {} items f...
The lists form a monad. They have a monad instantiation equivalent to this one:
instance Monad [] where
return x = [x]
xs >>= f = concat (map f xs)
We can use them to emulate non-determinism in our computations. When we use xs >>= f, the function f :: a -> [b...
--dataset schemas must be identical
SELECT 'Data1' as 'Column' UNION ALL
SELECT 'Data2' as 'Column' UNION ALL
SELECT 'Data3' as 'Column' UNION ALL
SELECT 'Data4' as 'Column' UNION ALL
SELECT 'Data5' as 'Column'
EXCEPT
SELECT 'Data3' as 'Column'
--Returns Data1, Data2, Data4, and Data5
One potential implementation of Redis as a backend caching utility is the django-redis-cache package.
This example assumes you already have a Redis server operating.
$ pip install django-redis-cache
Edit your settings.py to include a CACHES object (see Django documentation on caching).
CACHES ...
One potential implementation of Redis as a backend caching utility is the django-redis package.
This example assumes you already have a Redis server operating.
$ pip install django-redis
Edit your settings.py to include a CACHES object (see Django documentation on caching).
CACHES = {
'de...
In Emacs M-x slime will start slime with the default (first) Common Lisp implementation. If there are multiple implementations provided (via variable slime-lisp-implementations), other implementations can be accessed via M-- M-x slime, which will offer the choice of available implementations in mini...
Reflection is useful when it is properly used for right purpose. By using reflection, you can access private variables and re-initialize final variables.
Below is the code snippet, which is not recommended.
import java.lang.reflect.*;
public class ReflectionDemo{
public static void main(St...
Compare two Strings ignoring case:
"School".equalsIgnoreCase("school"); // true
Don't use
text1.toLowerCase().equals(text2.toLowerCase());
Languages have different rules for converting upper and lower case. A 'I' would be converted to 'i' in English. But in Turkish a 'I' ...
Let's say you have this line of code:
printf("Hello, world!\n");
Now say you want to change the text to "Program exiting."
CommandBufferMnemonicci"printf("¦");change in the ".Program exiting.\n<esc>printf("Program exiting.\n");
To check if a required gem is installed, from within your code, you can use the following (using nokogiri as an example):
begin
found_gem = Gem::Specification.find_by_name('nokogiri')
require 'nokogiri'
....
<the rest of your code>
rescue Gem::LoadError
end
However, this can ...
While in insert mode, you can use <C-r> to paste from a register, which is specified by the next keystroke. <C-r>" for example pastes from the unnamed (") register.
See :help registers.
You can use the (optional) delimiters attribute to specify which characters are used as separators in the list.
<cfloop list="ColdFusion,HTML;XML" index="ListItem" delimiters=",;">
<cfoutput>
#ListItem#<br />
</cfoutput>
<...
List comprehensions are a syntactic construct to create a list based on existing lists.
In erlang a list comprehension has the form [Expr || Qualifier1, ..., QualifierN].
Where qualifiers are either generators Pattern <- ListExpr or filter like integer(X) evaluating to either true or false.
Th...
By default, plot() creates a new figure each time it is called. It is possible to plot on an existing axis by passing the ax parameter.
plt.figure() # create a new figure
ax = plt.subplot(121) # create the left-side subplot
df1.plot(ax=ax) # plot df1 on that subplot
ax = plt.subplot(122) # c...