|
||||||||||
| PREV NEXT | FRAMES NO FRAMES |
| Packages that use compbio.engine.client | |
|---|---|
| compbio.engine | |
| compbio.engine.client | |
| compbio.engine.cluster.drmaa | |
| compbio.engine.conf | |
| compbio.engine.local | |
| compbio.runner | Utilities commonly used by all runners. |
| compbio.runner._impl | |
| compbio.runner.conservation | |
| compbio.runner.disorder | |
| compbio.runner.msa | Wrappers for native executables for multiple sequence alignment (msa) |
| compbio.ws.client | A command line client and web services testing client for JAva Bioinformatics Analysis Web Services. |
| compbio.ws.server |
| Classes in compbio.engine.client used by compbio.engine | |
|---|---|
| ConfiguredExecutable
|
|
| Executable
Interface to a native executable. |
|
| Executable.ExecProvider
|
| Classes in compbio.engine.client used by compbio.engine.client | |
|---|---|
| CommandBuilder
|
|
| ConfExecutable
|
|
| ConfiguredExecutable
|
|
| Executable
Interface to a native executable. |
|
| Executable.ExecProvider
|
|
| PipedExecutable
This is a marker interface to indicate that the output of the process must be captured. |
|
| RunConfiguration
Value class for persisting ConfExecutable instances |
|
| SkeletalExecutable
|
| Classes in compbio.engine.client used by compbio.engine.cluster.drmaa | |
|---|---|
| ConfiguredExecutable
|
| Classes in compbio.engine.client used by compbio.engine.conf | |
|---|---|
| Executable
Interface to a native executable. |
| Classes in compbio.engine.client used by compbio.engine.local | |
|---|---|
| ConfiguredExecutable
|
| Classes in compbio.engine.client used by compbio.runner | |
|---|---|
| CommandBuilder
|
|
| ConfiguredExecutable
|
|
| Executable
Interface to a native executable. |
|
| Executable.ExecProvider
|
|
| RunConfiguration
Value class for persisting ConfExecutable instances |
| Classes in compbio.engine.client used by compbio.runner._impl | |
|---|---|
| CommandBuilder
|
|
| Executable
Interface to a native executable. |
|
| Executable.ExecProvider
|
|
| RunConfiguration
Value class for persisting ConfExecutable instances |
| Classes in compbio.engine.client used by compbio.runner.conservation | |
|---|---|
| CommandBuilder
|
|
| Executable
Interface to a native executable. |
|
| Executable.ExecProvider
|
|
| SkeletalExecutable
|
| Classes in compbio.engine.client used by compbio.runner.disorder | |
|---|---|
| CommandBuilder
|
|
| Executable
Interface to a native executable. |
|
| Executable.ExecProvider
|
|
| PipedExecutable
This is a marker interface to indicate that the output of the process must be captured. |
|
| SkeletalExecutable
|
| Classes in compbio.engine.client used by compbio.runner.msa | |
|---|---|
| CommandBuilder
|
|
| Executable
Interface to a native executable. |
|
| Executable.ExecProvider
|
|
| PipedExecutable
This is a marker interface to indicate that the output of the process must be captured. |
|
| SkeletalExecutable
|
| Classes in compbio.engine.client used by compbio.ws.client | |
|---|---|
| Executable
Interface to a native executable. |
| Classes in compbio.engine.client used by compbio.ws.server | |
|---|---|
| ConfiguredExecutable
|
|
||||||||||
| PREV NEXT | FRAMES NO FRAMES |


Copyright © 2021 Anatoly Rodionov
Authors: Anatoly Rodionov (anatoly.ya.rodionov@gmail.com).
| median/1 | Calculates list of numbers median . |
| sort_median/1 | Calculates list of numbers median; uses lists:sort. |
median(Lst::[number()]) -> number()
Calculates list of numbers median .
sort_median(Lst::[number()]) -> number()
Calculates list of numbers median; uses lists:sort. Added fot comparing with emedian.
Generated by EDoc


These are some of my cats favorite things
favorite toys
yarn
red dot lazer
socks
These are some of my cats favorite activities
favorite activities
sleeping
eating
sleeping
eating
sleeping
eating
Here is a page about cats!


This is an amateur attempt at mashing up The Guardian and a new, under-development API for environmental information. Enter a search term and it will find the most recent articles in The Guardian about it. It will then look for related items in the new environmental API.
The related items are the ones after the green buttons with tags that eventually show up. It may take up to 15 seconds for any results to show up, especially in Chrome. (Firefox loads results incrementally.) It's all very preliminary. — May 22, 2017


GIS for Society
In March of 2014, as part of my bachelor’s degree, I took part in the course GIS for Society. This was one of my favorite courses. Ever. On this page I'll give an incomplete summary of the interesting things I learned. Last updated in August 2017.
In general
With less than 20 participants, GIS for Society was a very personal and interactive course. Whilst most courses at the Wageningen University are very green and nature-oriented (which I see as a good thing, don't get me wrong), this course looked into the direct application of GIS into modern society. It was a very broad course, ranging from ArcMap applications (like network analysis) to theoretical background on current GIS developments (like integration of personal GPS-data in Google Earth, and comparison of open and closed source software). Due to its broad range of topics and the personal touch, and of course the exciting final assignment, this has so far been my favourite course at the Wageningen University.
Three parts of this course that I want to discuss are:
- GreenRoads app – in which we had to invent a GIS-app for modern society.
- Pros and Cons of Open Source GIS software - in which I had to write an essay on open source vs closed source.
- Everyone Likes Amsterdam – in which we had to visualize a figure by collecting geo-data in Amsterdam.
GreenRoads app
One of the first assignments was to come up with a financially viable idea for a smartphone app with GIS-integration. Though we didn’t have to develop the app, we had to think everything through; it should be of added value for society, (in)directly increasing the Quality of Life. Together with two fellow students, I came up with the idea of GreenRoads. This app would calculate routes from A to B, with options for traveling by car, bicycle, and foot, as well as several public transport options. Just like any other popular route guidance app.
However, the renovating idea of this app would be to focus on emissions of greenhouse gasses; a user would be able to right away see the environmental impact of his/her travel. By choosing the Greenest Road, the user would collect tokens, which could in turn be exchanged for discount on green products, like organic coffee, or for green actions, like planting a tree or adopting a penguin. Apart from these real-life rewards to collecting tokens, the process of collecting the tokens (and of course medals/rewards along the way) should be a reward on its own, like with any other addictive ‘game’.
The logo that we created for the GreenRoads app.
The financial profit should be found in deals with the organic product owners, who get a lot of publicity and new customers through giving a small discount based on tokens. These companies should pay a fee to join in on the app.
The pitfall of this idea is still how to check if the chosen route is also followed. Besides that, the main focus should be to give users insight in the different emission footprints per transportation method. Though other apps already give
insight in this, GreenRoads would give the possibility to store cars with specific preferences, so that the comparison would be more accurate.
Open Source GIS software - essay
Another assignment was to write an essay on the pros and cons of open source GIS software and -data.


魔术常量
PHP 向它运行的任何脚本提供了大量的预定义常量。不过很多常量都是由不同的扩展库定
义的，只有在加载了这些扩展库时才会出现，或者动态加载后，或者在编译时已经包括进
去了。
有八个魔术常量它们的值随着它们在代码中的位置改变而改变。例如 __LINE__ 的值就依
赖于它在脚本中所处的行来决定。这些特殊的常量不区分大小写，如下：
几个 PHP 的“魔术常量”
名称 说明
__LINE__ 文件中的当前行号。
文件的完整路径和文件名。如果用在被包含文件中，则返回被包含的文件
__FILE__ 名。自 PHP 4.0.2 起，__FILE__ 总是包含一个绝对路径（如果是符号连
接，则是解析后的绝对路径），而在此之前的版本有时会包含一个相对路
径。
文件所在的目录。如果用在被包括文件中，则返回被包括的文件所在的目
__DIR__ 录。它等价于 dirname(__FILE__)。除非是根目录，否则目录中名不包括
末尾的斜杠。（PHP 5.3.0中新增） =
__FUNCTION__ 函数名称（PHP 4.3.0 新加）。自 PHP 5 起本常量返回该函数被定义时的
名字（区分大小写）。在 PHP 4 中该值总是小写字母的。
类的名称（PHP 4.3.0 新加）。自 PHP 5 起本常量返回该类被定义时的名
字（区分大小写）。在 PHP 4 中该值总是小写字母的。类名包括其被声明
__CLASS__ 的作用区域（例如 Foo\Bar）。注意自 PHP 5.4 起 __CLASS__ 对 trait
也起作用。当用在 trait 方法中时，__CLASS__ 是调用 trait 方法的类
的名字。
Trait 的名字（PHP 5.4.0 新加）。自 PHP 5.4 起此常量返回 trait 被
__TRAIT__ 定义时的名字（区分大小写）。Trait 名包括其被声明的作用区域（例如
Foo\Bar）。
__METHOD__ 类的方法名（PHP 5.0.0 新加）。返回该方法被定义时的名字（区分大小
写）。
__NAMESPACE__ 当前命名空间的名称（区分大小写）。此常量是在编译时定义的（PHP
5.3.0 新增）。
参见 get_class()，get_object_vars()，file_exists() 和 function_exists()。
User Contributed Notes 18 notes
===============================================================================
the difference between
__FUNCTION__ and __METHOD__ as in PHP 5.0.4 is that
__FUNCTION__ returns only the name of the function
while as __METHOD__ returns the name of the class alongwith the name of the
function
class trick
{
function doit()
{
echo __FUNCTION__;
}
function doitagain()
{
echo __METHOD__;
}
}
$obj=new trick();
$obj->doit();
output will be ---- doit
$obj->doitagain();
output will be ----- trick::doitagain
===============================================================================
Note a small inconsistency when using __CLASS__ and __METHOD__ in traits (stand
php 7.0.4): While __CLASS__ is working as advertized and returns dynamically
the name of the class the trait is being used in, __METHOD__ will actually
prepend the trait name instead of the class name!
===============================================================================
There is no way to implement a backwards compatible __DIR__ in versions prior
to 5.3.0.
The only thing that you can do is to perform a recursive search and replace to
dirname(__FILE__):
find . -type f -print0 | xargs -0 sed -i 's/__DIR__/dirname(__FILE__)/'
===============================================================================
The __CLASS__ magic constant nicely complements the get_class() function.
Sometimes you need to know both:
- name of the inherited class
- name of the class actually executed
Here's an example that shows the possible solution:
";
}
function say_b()
{
echo "'b' - said the " . get_class($this) . "
";
}
}
class derived_class extends base_class
{
function say_a()
{
parent::say_a();
echo "'a' - said the " . __CLASS__ . "
";
}
function say_b()
{
parent::say_b();
echo "'b' - said the " . get_class($this) . "
";
}
}
$obj_b = new derived_class();
$obj_b->say_a();
echo "
";
$obj_b->say_b();
?>
The output should look roughly like this:
'a' - said the base_class
'a' - said the derived_class
'b' - said the derived_class
'b' - said the derived_class
===============================================================================
A lot of notes here concern defining the __DIR__ magic constant for PHP
versions not supporting the feature. Of course you can define this magic
constant for PHP versions not yet having this constant, but it will defeat its
purpose as soon as you are using the constant in an included file, which may be
in a different directory then the file defining the __DIR__ constant. As such,
the constant has lost its *magic*, and would be rather useless unless you
assure yourself to have all of your includes in the same directory.
Concluding: eye catchup at gmail dot com's note regarding whether you can or
cannot define magic constants is valid, but stating that defining __DIR__ is
not useless, is not!
===============================================================================
Since namespace were introduced, it would be nice to have a magic constant or
function (like get_class()) which would return the class name without the
namespaces.
On windows I used basename(__CLASS__). (LOL)
===============================================================================
Just learned an interesting tidbit regarding __FILE__ and the newer __DIR__
with respect to code run from a network share: the constants will return the
*share* path when executed from the context of the share.
Examples:
// normal context
// called as "php -f c:\test.php"
__DIR__ === 'c:\';
__FILE__ === 'c:\test.php';
// network share context
// called as "php -f \\computerName\c$\test.php"
__DIR__ === '\\computerName\c$';
__FILE__ === '\\computerName\c$\test.php';
NOTE: realpath('.') always seems to return an actual filesystem path regardless
of the execution context.
===============================================================================
What eyecatchup and I posted are good one-liners, but they are fundamentally
flawed. Magic constants cannot be defined in a backward-compatible manner in
PHP code because the value of a magic constant is defined at run-time based on
the current context.
__DIR__ is defined relative to the current file. If you define it in one file
using the method that I or eyecatchup posted, then the value is dependant upon
the location of the file where it is defined.
Example:
* directory structure:
/dir/other/other_dir.php
/dir/define_dir.php
/dir/same_dir.php
/parent_dir.php
* /dir/define_dir.php
* /dir/same_dir.php
* /dir/other/other_dir.php
* /parent_dir.php
*** OUTPUT: PHP 5.2.17 ***
same_dir.php:
function: /dir
__DIR__: /dir
other_dir.php:
function: /dir/other
__DIR__: /dir
parent_dir.php:
function: /
__DIR__: /dir
As you can see, only when the running script is in the same directory as the
file that defines __DIR__, will __DIR__ have the correct value.
You could use the following function:
And call it like so wherever you would use __DIR__:
Magic constants are fickle creatures.
===============================================================================
Further clarification on the __TRAIT__ magic constant.
traitName(); //PeanutButter
?>
===============================================================================
As pointed out by david at thegallagher dot net[1], you can NOT use the defined
() function to check if a *magic* constant is defined. Often seen, but will
not work:
Now, raat1979 at gmail dot com[2] pointed out a solution to check if a magic
constant is defined or not (which actually works reliable). Thanks to dynamic
typecasting in PHP, if a constant lookup fails PHP interprets the given
constant name as string (note that a notice is thrown nonetheless. thus, use
"@" to suppress it).
Meaning we can check for all constants - including magic constants (eg __DIR__)
- as follows:
However, what is wrong in raat1979 at gmail dot com's note[2] is this comment:
> "remember that because they are MAGIC constants defining __DIR__ is
completely useless"
In fact, you *can* define magic constants (as long as they haven't been defined
before, of course).
Based on all I've read and tested today, here is my code I use to make the
`__DIR__` magic constant work with all PHP versions (4.3.1 - 5.5.3):
= 4.3.1) can use the magic __DIR__ constant now..
// Demo (outputs and VLD opcodes) here: http://3v4l.org/bm6e1
?>
[1] http://us2.php.net/manual/en/language.constants.predefined.php#107614
[2] http://us2.php.net/manual/en/language.constants.predefined.php#113130
===============================================================================
Magic constants can not be tested with defined($name)
when __DIR__ is not defined and you use it anyway php assumes you meant
'__DIR__' and throws a notice.
because of this assumption we can do:
===============================================================================
You cannot check if a magic constant is defined. This means there is no point
in checking if __DIR__ is defined then defining it. `defined('__DIR__')` always
returns false. Defining __DIR__ will silently fail in PHP 5.3+. This could
cause compatibility issues if your script includes other scripts.
Here is proof:
Output:
__DIR__ is NOT defined
__FILE__ is NOT defined
PHP_VERSION is defined
PHP Version: 5.3.6
===============================================================================
Further to my previous note, the 'object' element of the array can be used to
get the parent object. So changing the get_class_static() function to the
following will make the code behave as expected:
HOWEVER, it still fails when being called statically. Changing the last two
lines of my previous example to
...still gives the same problematic result in PHP5, but in this case the
'object' property is not set, so that technique is unavailable.
===============================================================================
__DIR__ is actually equivalent to realpath(dirname(__FILE__)).
Here's a modified version of the one-liner eyecatchup at gmail dot com[1]
wrote:
Their version also works on PHP 4.0.6, but doesn't use realpath. __DIR__ is an
absolute path to the current file.
[1] http://www.php.net/manual/en/language.constants.predefined.php#113233
===============================================================================
Note that __FILE__ has a quirk when used inside an eval() call. It will tack on
something like "(80) : eval()'d code" (the number may change) on the end of the
string at run-time. The workaround is:
$script = php_strip_whitespace('myprogram.php');
$script = str_replace('__FILE__',"preg_replace('@\(.*\(.*$@', '', __FILE__,1)
",$script);
eval($script);
===============================================================================
Note that __CLASS__ contains the class it is called in; in lowercase. So the
code:
class A
{
function showclass()
{
echo __CLASS__;
}
}
class B extends A
{
}
$a = new A();
$b = new B();
$a->showclass();
$b->showclass();
A::showclass();
B::showclass();
results in "aaaa";
===============================================================================
Using __METHOD__ always return class name the function belong to. But in some
cases (like to make log output), if class B1, B2, B3 inherit class A and call a
method of class A, you may would like to see into log which class among B1, B2,
B3 is calling.
For example you would like to see:
B1::commond_method_inside_framework
and not
A::commond_method_inside_framework
because you know that common_method_inside_framework is inside common inherited
class A.
To solve this, replace __METHOD__ with get_class($this).'::'.__FUNCTION__
class A
{
function commond_method_inside_framework()
{
echo "This is class " . get_class($this).'::'.__FUNCTION__.' '.
__METHOD__.' '."\n";
}
}
class B1 extends A
{
function commond_method_inside_caller()
{
echo "This is class " . get_class($this).'::'.__FUNCTION__.' '.
__METHOD__.' '."\n";
}
}
$a = new A();
$a->commond_method_inside_framework();
$b = new B1();
$b->commond_method_inside_framework();
$b->commond_method_inside_caller();
?>
Result will be
This is class A::commond_method_inside_framework
A::commond_method_inside_framework
This is class B1::commond_method_inside_framework
A::commond_method_inside_framework
This is class B1::commond_method_inside_caller B1::commond_method_inside_caller
===============================================================================
__CLASS__ has caused me some confusion before. If you extend from a class that
calls __CLASS__ in a function, __CLASS__ will refer to the parent class and
not the extending class.
This is class " . __CLASS__;
}
}
class B extends A
{
function sayClassFromObjectB()
{
echo "
This is class " . __CLASS__;
}
}
$b = new B();
//I expect it to output "This is class B".
$b->sayClassFromObjectA(); //Outputs "This is class A"
//I expect it to output "This is class B".
$b->sayClassFromObjectB(); //Outputs "This is class B"
?>