byobu(1) byobu byobu(1) NAME byobu - wrapper script for seeding a user's byobu configuration and launching a text based window manager (either screen or tmux) SYNOPSIS byobu [screen options] byobu-screen [screen options] byobu-tmux [tmux options] Options to byobu are simply passed through screen(1) or tmux(1). DESCRIPTION byobu is a script that launches a text based window manager (either screen(1) or tmux(1)) in the byobu configuration. This enables the dis‐ play of system information and status notifications within two lines at the bottom of the screen session. It also enables multiple tabbed termi‐ nal sessions, accessible through simple keystrokes. byobu currently defaults to using tmux(1) (if present) as the backend, however, this can be overriden with the byobu-select-backend(1) utility. Note that BYOBU_CONFIG_DIR=$XDG_CONFIG_HOME/byobu if defined, and $HOME/.byobu otherwise. STATUS NOTIFICATIONS byobu supports a number of unique and interesting status notifications across the lowest two lines in the screen. Each status notification item is independently configurable, enabled and disabled by the configuration utility. The guide below helps identify each status item (in alphabeti‐ cal order): apport - symbol displayed if there are pending crash reports; {!} symbol displayed on the lower bar toward the left, in black on an orange back‐ ground arch - system architecture; displayed on the lower bar toward the left, in the default text color on the default background color battery - battery information; display on the lower bar toward the right; - indicates discharging, + indicates charging, = indicates fully charged; when charging or discharging, the current battery capacity as a percent‐ age is displayed; the colours green, yellow, and red are used to give further indication of the battery's charge state; you may override the detected battery by setting BATTERY=/proc/acpi/battery/BAT0 in $BYOBU_CONFIG_DIR/statusrc cpu_count - the number of cpu's or cores on the system; displayed in the lower bar toward the right in the default text color on the default back‐ ground, followed by a trailing 'x' cpu_freq - the current frequency of the cpu in GHz; displayed in the lower bar toward the right in white text on a light blue background cpu_temp - the cpu temperature in Celsius (default) or Fahrenheit, con‐ figure TEMP=F or TEMP=C in $BYOBU_CONFIG_DIR/statusrc; displayed in the lower bar toward the right in yellow text on a black background; you may override the detected cpu temperature device by setting MONI‐ TORED_TEMP=/proc/acpi/whatever in $BYOBU_CONFIG_DIR/statusrc custom - user defined custom scripts; must be executable programs of any kind in $BYOBU_CONFIG_DIR/bin; must be named N_NAME, where N is the fre‐ quency in seconds to refresh the status indicator, and NAME is the name of the script; N should not be less than 5 seconds; the script should echo a small amount of text to standard out, standard error is discarded; the indicator will be displayed in the lower panel, in inverted colors to your current background/foreground scheme, unless you manually specify the colors in your script's output; BEWARE, cpu-intensive custom scripts may impact your overall system performance and could upset your system administrator! Example: $BYOBU_CONFIG_DIR/bin/1000_uname #!/bin/sh printf "\005{= bw}%s\005{-}" "$(uname -r)" date - the system date in YYYY-MM-DD formate; displayed in the lower on the far right in the default text color on the default background disk - total disk space available and total used on / directory; dis‐ played in the lower bar on the far right in white text on a light purple background; override the default directory by specifying an alternate mount point with MONITORED_DISK=/wherever in $BYOBU_CONFIG_DIR/statusrc disk_io - instantaneous read/write througput in kB/s or MB/s over the last 3 seconds; displayed in the lower bar toward the right in white text on a light purple background with a leading '<' sign indicating 'read speed' and '>' sign indicating 'write speed'; override the default moni‐ tored disk by specifying an alternate device with MONI‐ TORED_DISK=/dev/sdb, and override the default DISK_IO_THRESHOLD=50 (kB/s) in $BYOBU_CONFIG_DIR/statusrc distro - OS/distribution name of the release running on the current sys‐ tem as reported by lsb_release(1) or /etc/issue; displayed in the lower bar in bold black text toward the left on a grey background; you may override the detected release with DISTRO=Whatever in $BYOBU_CON‐ FIG_DIR/statusrc ec2_cost - an estimation of the cost of the current boot of the system in terms of the Amazon EC2 billing model; displayed in the lower bar toward the right in green text on a black background; there is a leading '~' to indicate that this is an estimation, and the monetary units are US Dol‐ lars '$'; if not running in EC2, this plugin is disabled unless EC2_ESTI‐ MATE=1 in ~/.byobu/statusrc entropy - a count of the system's current entropy in bytes; displayed in the lower bar toward the right in yellow text on a dark grey background; there is a leading 'e' to indicate 'entropy' raid - note very prominently if there is a RAID failure detected, in red blinking text on a white background; the term 'RAID' notes that there is something wrong with the RAID, and if there is a rebuild/resync in progress, the percent complete is also shown rcs_cost - an estimation of the cost of the current boot of the system in terms of the Rackspace Cloud Server billing model; displayed in the lower bar toward the right in green text on a black background; there is a leading '~' to indicate that this is an estimation, and the monetary units are US Dollars '$' fan_speed - cpu or system fan speed as reported by lm-sensors; displayed in the lower bar toward the right in black text on a grey background; there is a trailing 'rpm' for units; you may override the detected fan by setting FAN=/sys/path/to/your/fan1_input in $BYOBU_CONFIG_DIR/statusrc hostname - the hostname of the system; displayed in the upper bar on the far right in bold black text on a grey background; there is a leading '@' symbol if the username status is also enabled ip_address - the IPv4 address of the system in dotted decimal form; dis‐ played in the upper bar on the far right in bold black text on a grey background; you can override and display your IPv6 address by setting 'IPV6=1', and you can show your external ip address by setting 'IP_EXTER‐ NAL=1' in $BYOBU_CONFIG_DIR/statusrc ip_address4 - the IPv4 address of the system in dotted decimal form; dis‐ played in the upper bar on the far right in bold black text on a grey background; you can show your external ip address by setting 'IP_EXTER‐ NAL=1' in $BYOBU_CONFIG_DIR/statusrc ip_address6 - the IPv6 address of the system; displayed in the upper bar on the far right in bold black text on a grey background; you can show your external ip address by setting 'IP_EXTERNAL=1' in $BYOBU_CON‐ FIG_DIR/statusrc load_average - the system load average over the last 1 minute; displayed in the lower bar toward the right in black text on a yellow background logo - an approximation of the current operating system's logo; displayed in the lower bar on the far left; you may customize this logo by setting a chosen logo in $BYOBU_CONFIG_DIR/logo, or you may override this with LOGO=:-D in $BYOBU_CONFIG_DIR/statusrc mail - system mail for the current user; the letter '[M]' is displayed in the lower bar toward the left in black text on a grey background memory - total memory available and used in the system; displayed in the lower bar toward the right in white text on a green background menu - a simple indicator directing new users to use the F9 keybinding to access the byobu menu network - instantaneous upload/download bandwidth in [GMk]bps over the last 3 seconds; nothing is displayed if traffic is 0; displayed in the lower bar toward the left in white text on a purple background with a leading '^' sign indicating 'up' and 'v' sign indicating 'down'; override the default interface by specifying an alternate interface with MONI‐ TORED_NETWORK=eth1, and override the default units (bits) with NET‐ WORK_UNITS=bytes, and override the default NETWORK_THRESHOLD=20 (kbps) in $BYOBU_CONFIG_DIR/statusrc notify_osd - Send on-screen notification messages to screen's notifica‐ tion buffer processes - total number of processes running on the system; displayed in the lower bar in white text on a dark yellow background with a trailing '&' indicating 'background processes' reboot_required - symbol present if a reboot is required following a sys‐ tem update; displayed in the lower bar white text on a blue background by the symbol '(R)'; additionally, reboot_required will print '<F5>' in white text on a blue background, if Byobu requires you to reload your profile to affect some changes; it will also detect if your system is currently in powernap(8) state and if so print '.zZ'. release - OS/distribution name of the release running on the current sys‐ tem as reported by lsb_release(1) or /etc/issue; displayed in the lower bar in bold black text toward the left on a grey background; you may override the detected release with RELEASE=Whatever in $BYOBU_CON‐ FIG_DIR/statusrc; you may also abbreviate the release string to N charac‐ ters by setting RELEASE_ABBREVIATED=N in $BYOBU_CONFIG_DIR/statusrc services - users can configure a list of services to monitor, define the SERVICES variable in $BYOBU_CONFIG_DIR/statusrc, a whitespace separated of services, each service should include the init name of the service, then a pipe, and then an abbreviated name or symbol to display when run‐ ning (e.g. SERVICES="ssh|ssh apache2|http"); displayed in the lower bar toward the center in cyan on a white background swap - total swap space and total used as a percentage of the total available; displayed in the lower bar toward the right in white text on a light green background with a trailing '%' sign time - the system time in HH:MM:SS format; displayed in the lower bar on the far right in the default text and default background colors time_binary - only for the hard core geek, the local system time in binary; requires UTF8 support in a VERY recent version of GNU Screen; you must additionally set "UTF8=1" in $BYOBU_CONFIG_DIR/statusrc; displayed in the lower bar on the far right in the default text and background col‐ ors time_utc - the UTC system time in HH:MMformat; displayed in the lower bar on the far right in dark text on a light background updates_available - the number of updates available on the system; dis‐ played in the lower bar toward the right in white text on a red back‐ ground with a trailing '!' sign; if any updates are marked 'security updates', then there will be a total of two trailing exclamation points, '!!' uptime - the total system uptime since last boot; displayed in the lower bar toward the right in blue text on a grey background users - the number of remote users logged into the system via sshd, empty if 0 users; displayed in the lower bar toward the right in red text on a grey background with a trailing '#' sign; set USERS_DISTINCT=1 to instead count the number of distinct users logged into the system (rather than open ssh sessions) whoami - the name of the user who owns the screen session; displayed in the upper bar toward the far right in bold black text on a grey back‐ ground wifi_quality - the connection rate and signal quality of the wifi connec‐ tion; displayed in the lower bar toward the right in black text on a cyan background; the connection rate is in 'Mb/s' and the signal quality is as a percentage with a trailing '%'; override the default interface by spec‐ ifying an alternate interface with MONITORED_NETWORK=wlan0 in $BYOBU_CON‐ FIG_DIR/statusrc SESSIONS Byobu name screen sessions "byobu", if unspecified. To hide sessions from byobu-select-session(1), prepend a "." to the beginning of the ses‐ sion name, like: byobu -S .hidden WINDOWS Each open window in the screen session is displayed in the upper bar toward the far left. These are numbered, and include indicators as to activity in the window (see "activity" in screen(1) for symbol defini‐ tions). The current active window is highlighted by inverting the back‐ ground/text from the rest of the window bar. Users can create a list of windows to launch at startup in $BYOBU_CON‐ FIG_DIR/windows. This file is the same syntax as ~/.screenrc, each line specifying a window using the "screen" command, as described in screen(1). User can also launch Byobu with unique window sets. Users can store these as $BYOBU_CONFIG_DIR/windows.[NAME], and launch Byobu with the environment variable BYOBU_WINDOWS. For example: $ cat $BYOBU_CONFIG_DIR/windows.ssh_sessions screen -t localhost bash screen -t aussie ssh root@aussie screen -t beagle ssh root@beagle screen -t collie ssh root@collie $ BYOBU_WINDOWS=ssh_sessions byobu UNITS OF MEASURE byobu uses binary for capacity measurements of KB, MB, GB, and TB. This means multiples of 1024 rather than multiples of 1000, in accordance with JEDEC Standard 100B.01 for disk and memory capacity measurements. See: * http://en.wikipedia.org/wiki/JEDEC_memory_standards byobu uses decimal for measurements of network data transfer, meaning multiple of 1000, rather than 1024. See: * http://en.wikipedia.org/wiki/Data_rate_units KEYBINDINGS byobu keybindings can be user defined in /usr/share/byobu/keybindings/ (or within .screenrc if byobu-export was used). The common key bindings are: F2 - Create a new window F3 - Move to previous window F4 - Move to next window F5 - Reload profile F6 - Detach from this session F7 - Enter copy/scrollback mode F8 - Re-title a window F9 - Configuration Menu F12 - Lock this terminal shift-F2 - Split the screen horizontally ctrl-F2 - Split the screen vertically shift-F3 - Shift the focus to the previous split region shift-F4 - Shift the focus to the next split region shift-F5 - Join all splits ctrl-F6 - Remove this split ctrl-F5 - Reconnect GPG and SSH sockets shift-F6 - Detach, but do not logout alt-pgup - Enter scrollback mode alt-pgdn - Enter scrollback mode Ctrl-a $ - show detailed status Ctrl-a R - Reload profile Ctrl-a ! - Toggle key bindings on and off Ctrl-a k - Kill the current window Ctrl-a ~ - Save the current window's scrollback buffer SCROLLBACK, COPY, PASTE MODES Each window in Byobu has up to 10,000 lines of scrollback history, which you can enter and navigate using the alt-pgup and alt-pgdn keys. Exit this scrollback mode by hitting enter. You can also easily copy and paste text from scrollback mode. To do so, enter scrollback using alt- pgup or alt-pgdn, press the spacebar to start highlighting text, use up/down/left/right/pgup/pgdn to select the text, and press enter to copy the text. You can then paste the text using alt-insert or ctrl-a-]. BUGS For Byobu colors to work properly, older versions of GNU Screen require a 1-line patch to adjust MAX_WINMSG_REND in screen.c. The change is in GNU Screen's upstream source control system as of 2010-01-26, but GNU Screen has not released a new upstream version in several years. You can dis‐ able colors entirely by setting MONOCHROME=1 in $BYOBU_CONFIG_DIR/sta‐ tusrc. For more information, see: * http://savannah.gnu.org/bugs/?22146 PuTTY users have reported that the F2, F3, and F4 shortcut keys are not working properly. PuTTY sends the same escape sequences as the linux console for F1-F4 by default. You can fix this problem in the PuTTY con‐ fig, Terminal -> Keyboard -> Function keys: Xterm R6. See<EMAIL_ADDRESS>Apple Mac OSX terminal users have reported 'flashing text'. You can fix this in the advanced settings of the terminal application, with 'Declare Terminal As: xterm-color'. Apple Mac keyboard users may need to specify a vt100 terminal by adding this to your OSX profile, in order to get Byobu's function keys and col‐ ors to work: alias ssh='TERM=vt100 ssh' Users of a non-UTF8 locale (such as cs_CZ charset ISO-8859-2), may need to add "defutf8 off" to ~/.screenrc, if some characters are rendering as "?". Users who customize their PS1 prompt need to put this setting in ~/.bashrc, rather than ~/.profile, in order for it to work correctly with Byobu. If you run byobu(1) under sudo(8), you must use the -H option, such that the user's $HOME directory environment variable is set properly. Other‐ wise, byobu(1) will create a bunch of directories in the $SUDO_USER's $HOME, but will be owned by root. To prevent this from happening, byobu(1) will simply refuse to run if $USER does not own $HOME. Byobu requires a suitable ulimit(3) values to run. If you get an error at startup saying, 'pipe: too many open files', then check your ulimit -a values, as your "open files" or "max user processes" are too low. In this case, you will probably need to run simple screen(1) SEE ALSO screen(1), byobu-config(1), byobu-export(1), byobu-status(1), byobu-sta‐ tus-detail(1), byobu-enable(1), byobu-launch(1), byobu-select-backend(1), tmux(1) http://launchpad.net/byobu AUTHOR This manpage and the utility were written by Dustin Kirkland <kirk‐<EMAIL_ADDRESS>for Ubuntu systems (but may be used by others). Permis‐ sion is granted to copy, distribute and/or modify this document and the utility under the terms of the GNU General Public License, Version 3 pub‐ lished by the Free Software Foundation. The complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL on Debian/Ubuntu systems, or in /usr/share/doc/fedora-release-*/GPL on Fedora systems, or on the web at http://www.gnu.org/licenses/gpl.txt. byobu 19 June 2009 byobu(1)


See Below.
Here is the labeled diagram. If you got a few wrong, come back later and try again.
Does the diagram show that the JButton has been added to the ButtonQuitter object?
JButton


Documentation For Music Generation
About
This was a project that was done as part of an MIT course I was following on Machine Learning. It was on the topic of Recurrent Neural Networks (RNN's). A sample of the audio can be heard below.
- Version: 1.0
- Author: Harnish Design
- Created: 8 April, 2020
- Update: 12 May, 2020
If you have any questions that are beyond the scope of this help file, Please feel free to email via Item Support Page.
Brief Overview of Machine Learning
What I have learnt so far this is like the skeleton of what Machine Learning entails
The Percepteron
This is like the underlying structure of a neural network. It is the Math framework from which neural networks are built.
There is a lot of research going into the percepteron and in fact improvements in their architecture have a lot of direct correlation with improvement in the general performance of ML algorithms. For example in making the best choice of non-linear function and choosing of parameters.
The Neural Network
It is the next layer of abstraction after the percepteron. It is what happens when we feed multiple percepterons in layers with different weights and all.
At this point already the whole process is becoming a bit hard to hold in the head and predict the outcome. Already the possibility of of number of outcomes based on different weight configurations is becoming heavy. Thus the wide application usage and outcome of ML.
The Recurrent Neural Network
It is what we get when the question is what if we want to add some time. For example when we are predicting the next word in a statement. It is important to have information on the previous words said as that has a direct effect on the next word.
Some interesting questions to ask might be
- How do I add the time in the first place?
- How do I make it such that all previous events have sufficient weights and not past events becoming almost irrelevant?
The Convolutional Neural Network
It is the answer to the question what of things like images where the location of the current data in relation to the rest of the image matter
Some interesting questions to ask might be
- How do I do this fast (FFT)?
General Feelings when it comes to ML
I think this XKCD summarises it well


>>
<<
Usr
Pri
JfC
LJ
Phr
Dic
Voc
!:
Help
Primer
Tacit definition
The centigrade verb was defined explicitly with the : conjunction. The term explicit indicates that the arguments to the verb in the definition are referred to explicitly by their names of x. and y. .
In a tacit definition the arguments are not named and do not appear explicitly in the definition. The arguments are referred to implicitly by the syntactic requirements of the definition. You have already used several tacit definitions.
plus =. +
sumover =. +/
maxover =. >./
scale =. % >./
mean =. +/ % #
The above are all tacit definitions. They do not use : and do not refer to arguments by name. In some cases the tacit form of definition is much simpler and more obvious than the equivalent explicit definition. In more complicated situations, it may take a bit of experience before you are comfortable with a tacit definition. This is partly because you probably have experience with explicit forms of definitions and very little with tacit definitions. In addition, tacit definitions tend to be more concise and mathematical expressions of a definition, and it may be necessary to go through the more detailed steps of creating an explicit definition before the equivalent tacit definition becomes clear.
Let's revisit fahrenheit to see how it could be defined tacitly. Open the cf.ijs script and look at the fahrenheit definition.
fahrenheit =: 3 : 0
t1 =. y. * 9
t2 =. t1 % 5
t3 =. t2 + 32
)
You can start by cleaning up the explicit definition. Now that you are more comfortable with J you can combine these calculations into a single line.
fa =: 3 : '(y. * 9 % 5) + 32'
The parentheses are required because the calculation inside them must be done before the 32 is added.
Let's shuffle the definition a bit to make the steps in building a tacit definition a bit clearer.
fb =: 3 : '32 + ((9%5) * y.)'
The above could be read as: add 32 to nine-fifths times the argument.
So, you need an add32 verb and a ninefifthstimes verb. You can use the bond conjunction & to build these verbs tacitly. The bond conjunction with a constant left argument returns a derived monad that is the verb in its right argument with the constant left argument.
add32 =: 32 & +
This defines add32 as a monad that adds 32 to its argument.
add32 12
44
ninefifthstimes =: (9%5) & *
This gives a monad which multiplies its argument by 9%5.
ninefifthstimes 20
36
Combining these you have:
add32 ninefifthstimes 100
212
The atop conjunction @ combines two verbs into a derived verb that applies the right verb to its argument and then applies the left verb to that result.
(u @ v) y evaluates as u v y
Use the atop conjunction to combine your two verbs to create the final definition.
fc =: add32 @ ninefifthstimes
fc 100
212
fc _40
_40
fc 0
32
Display the verb fc and note that its definition is dependent on the other two definitions.
fc
+-----+-----------------+
|add32|@|ninefifthstimes|
+-----+-----------------+
Sometimes after you have built up a tacit definition from smaller building blocks you realize you really don't want all those smaller definitions hanging around. The f. adverb takes a tacit definition and replaces names with their definitions.
fz =. fc f.
The adverb f. , like all adverbs, takes its argument on its left.
Look at fz to see the final definition.
fz
+--------+-+---------+
|+--+-+-+|@|+---+-+-+|
||32|&|+|| ||1.8|&|*||
|+--+-+-+| |+---+-+-+|
+--------+-+---------+
The system can display tacit definitions in several different forms. These options can be selected with Edit|Configure|Display. With box display you get the preceding display. The Box Display can be very useful in understanding tacit definitions. However, for now select Linear Display so that you will see the following:
fz
32&+@(1.8&*)
In comparing something as simple as a verb defined as +, the tacit definition is much simpler than the equivalent explicit definition. In the fahrenheit example it could be argued that the explicit definition was simpler, especially if you used the 1.8 directly instead of the 9%5 as does the tacit definition.
fx =: 3 : '32+1.8*y.'
vs.
fz =: 32&+@(1.8&*)
The real strength in tacit programming comes in more complicated transformations of the arguments, particularly when the arguments must be referenced several times. The following illustrates another use of tacit definition.
xmean =: 3 : '(+/y.) % #y.'
This is the mean that you ran across in the Fork section.
mean =: +/ % #
The tacit definition just uses the fork directly.
The fork could also have been used in the explicit definition, but would have required parentheses around the fork.
xmean =: 3 : '(+/ % #)y.'
One advantage of tacit definitions is that they are more easily manipulated in formal ways than are explicit definitions. For example, J can automatically derive the inverse of many tacit definitions. Let's try this with the fz tacit definition. The inverse of the Fahrenheit conversion is the centigrade conversion. The standard profile defines an adverb inverse.
fz =: 32&+@(1.8&*)
cz =: fz inverse
fz 100
212
cz 212
100
fz 0
32
cz 32
0
Tacit programming is very powerful, but there is no need to leap into it. It is important to know what it is and to start using it in simple cases as this is the best way to become more familiar with it.
>>
<<
Usr
Pri
JfC
LJ
Phr
Dic
Voc
!:
Help
Primer


Welcome!
Hey there awesome person!

Let's get in touch!
Meet me here!
View my work!


{% include "talos/widgets/form_prefix.html" %}
{% include "talos/widgets/input_email.html" with field=form.email only %}
{% include "talos/widgets/button_submit.html" with translations=translations only %}
{% include "talos/widgets/form_suffix.html" %}
{% endblock %}
{% block body_script %}
{% endblock %}


{include file="common/header"} {include file="common/aside"}
{include file="common/copyright" }
{include file="common/footer" }


20 June 2000
Disease Outbreak Reported
The recent report of illness amongst 8 young children in Vladivostock who had played with discarded ampoules of smallpox vaccine has now been confirmed by the Ministry of Health of the Russian Federation. Laboratory confirmation of the illness in the children is being sought. The report has evoked much public concern. In some of the reports, there were misconceptions about the components of the vaccine used to prevent smallpox, and about why any country might still be retaining stocks of smallpox vaccine. This note aims to clarify these issues.
1) Smallpox vaccine is not made from smallpox virus.
The vaccine which was used for centuries to vaccinate against smallpox was not made from smallpox, but from vaccinia virus. Vaccinia is a different virus from the virus which causes smallpox. However, it is a member of the same family of viruses to which the smallpox virus belongs. The smallpox virus is also known as variola virus. Mass vaccinations with smallpox vaccine made from vaccinia virus led to the eradication of smallpox announced by WHO in 1980. People vaccinated with smallpox vaccine (vaccinia) develop reactions to it which range from mild and transient to severe, and very rarely, fatal.
2) Two countries still keep smallpox virus (variola) stocks.
Although smallpox disease has been eradicated, two laboratories still hold stocks of smallpox virus (variola). These are the WHO Collaborating Centres in Atlanta, USA and Koltsovo, Russian Federation.
3) Many countries still hold smallpox vaccine (vaccinia) stocks.
WHO recommends that countries which still have stocks of smallpox vaccine (vaccinia) maintain these stocks. This recommendation has been made for two reasons.  Some of these viruses are found in nature and cause illness among animals, and some are used in research to make new, safer vaccines against a variety of infectious diseases. Secondly, smallpox vaccine (vaccinia) will also be needed in case of a deliberate or accidental release of smallpox virus (variola), which is a very unlikely event but currently of great concern to some countries.
For further information on this topic, see the summary of the recent meeting of the WHO Advisory Committee on Variola Virus Research, published in the Weekly Epidemiological Record.
4) Disposal of biological materials and pharmaceuticals
All biological materials and pharmaceuticals such as vaccines, drugs and diagnostic specimens should be disposed of safely. Some may require inactivation before disposal. This can be accomplished by autoclaving or incineration.


primrose.pipelines package¶
Submodules¶
primrose.pipelines.dataframe_joiner module¶
Module toJoin upstream dataframes
- Author(s):
Michael Skarlinski<EMAIL_ADDRESS>-
class
primrose.pipelines.dataframe_joiner.
DataFrameJoiner
(configuration, instance_name)¶ Bases:
primrose.base.pipeline.AbstractPipeline
Join upstream dataframes
-
init_pipeline
()¶ create the pipeline’s TransformerSequence
- Returns
a TransformerSequence
-
static
necessary_config
(node_config)¶ Return the necessary configuration keys for the DataFrameJoiner object
- Parameters
node_config (dict) – set of parameters / attributes for the node
Note
start_table: first table index in alpha order which defines who is eligible for this analysis (all other tables will be left joined to this) join_key: list of column names to join dataframes from different readers on
- Returns
set of keys
-
transform
(data_object)¶ Get DataFrames from the data object then put them into a alphabetical list for constant join order
- Parameters
data_object (DataObject) – instance of DataObject
- Returns
instance of DataObject
- Return type
data_object (DataObject)
-
primrose.pipelines.encode_train_test_split module¶
“Encode all string df columns to numeric labels, inherit test/train split from parent
- Author(s):
Mike Skarlinski<EMAIL_ADDRESS>-
class
primrose.pipelines.encode_train_test_split.
EncodeTrainTestSplit
(configuration, instance_name)¶ Bases:
primrose.pipelines.train_test_split.TrainTestSplit
Encode all string df columns to numeric labels, inherit test/train split from parent
-
final_data_object_additions
(data_object)¶ Overload function which adds the label encoder after running fit_transform or transform
- Returns
instance of DataObject
- Return type
data_object (DataObject)
-
property
first_transformer_in_sequence
¶ returns 1st transformer in a sequence
- Returns
a transformer
-
init_pipeline
()¶ create the pipeline’s TransformerSequence
- Returns
a TransformerSequence
-
primrose.pipelines.sklearn_preprocessing_pipeline module¶
Module to run preprocessing using SKlearn preprocessors
- Author(s):
Carl Anderson<EMAIL_ADDRESS>-
class
primrose.pipelines.sklearn_preprocessing_pipeline.
SklearnPreprocessingPipeline
(configuration, instance_name)¶ Bases:
primrose.pipelines.train_test_split.TrainTestSplit
-
init_pipeline
()¶ create the pipeline’s TransformerSequence
- Returns
a TransformerSequence
-
static
necessary_config
(node_config)¶ Return the necessary configuration keys for the SklearnPreprocessingPipeline object
- Returns
set of keys
-
primrose.pipelines.train_test_split module¶
Module to run train test splits
- Author(s):
Mike Skarlinski<EMAIL_ADDRESS>Carl Anderson<EMAIL_ADDRESS>-
class
primrose.pipelines.train_test_split.
TrainTestSplit
(configuration, instance_name)¶ Bases:
primrose.base.pipeline.AbstractPipeline
Parent pipeline to split into training / testing data, and run a transform
Note
This class will split data into testing and training portions, then write the objects to the data_object if this is the only the pipeline operation needed, then you can use this class directly as a pipeline. Otherwise, make a child class and write an init_pipeline method to perform operations on your data.
This class also handles writing your transformer_sequence into the data_object, so there’s no need to write in child classes.
-
features
(data)¶ Use user-specified features if available, otherwise use all non-target columns
- Parameters
data (DataFrame) – pandas dataframe
- Returns
lsit of feature names
-
final_data_object_additions
(data_object)¶ DataObject: Template method to be overloaded in child classes
Note
Allows for child class TransformerSequence objects to be added into the data_object
- Parameters
data_object (DataObject) – instance of DataObject
- Returns
instance of DataObject
- Return type
data_object (DataObject)
-
fit_transform
(data_object)¶ Split data into testing and training sets, then applies the categorical transform to each
- Parameters
data_object (DataObject) – instance of DataObject
- Returns
instance of DataObject
- Return type
data_object (DataObject)
-
static
necessary_config
(node_config)¶ Return the necessary configuration keys for the DataFrameJoiner object
- Parameters
node_config (dict) – set of parameters / attributes for the node
Note
target_variable (string): column name which holds the target variable training_fraction (float): 0->1 float for the fraction of data rows to be used for training seed (int): random number to control the stochastic row selection
- Returns
set of keys
-
transform
(data_object)¶ Transform the data into label encoded data using the pre-trained transformer sequence
- Parameters
data_object (DataObject) – instance of DataObject
- Returns
instance of DataObject
- Return type
data_object (DataObject)
-


Neovim is a Vim-based text editor engineered for extensibility and usability, to encourage new applications and contributions.
Visit the gitter channel or IRC to chat with the team.


Profile
Friends
Aditional information
Profile of Shrek
Name:
Shrek
Birthday:
01.01.2007
Occupation:
Monster
Area of living:
The swamp


Kind of. This is just a page to test basic authentication using the Heimdallr backend.
Token is set? yes no
Your character name: {{characterName$ | async}}


Hair styling for beginners
Tips and tricks on creating a masterful quiff.
Getting your hair to stand up, and stay up during a busy day in the office can be a bit of a hassle at times. But here’s a full-proof method to achieving follicular greatness.
Requirements
- Hair dryer
- Styling putty
- Finishing spray
Method
- Wash and condition your hair as normal.
- Towel dry you hair until it is only slightly damp.
- Rub a small amount of styling putty between the tips of your fingers and style your quiff.

- Add shine and extra hold by applying some finishing spray.


Russia releases last belugas from 'whale jail'
MOSCOW: The last whales held in a notorious facility dubbed the "whale jail" in Russia's Far East were released on Sunday (Nov 10), the institute overseeing the operation said.
The fate of the whales, which were captured to perform in aquariums, sparked international outrage earlier this year after pictures appeared in the media of them struggling to swim through ice-encrusted waters in cramped enclosures.
Moscow eventually bowed to pressure to release the 93 beluga whales and 11 orcas, which were held for more than a year in the secretive facility in Srednyaya Bay near the far eastern town of Nakhodka.
The whales have since been released in batches, with the last of the orcas freed in August.
The All-Russian Fisheries and Oceanography Institute said the operation to free the last belugas started five days ago.
"In the region of Primorsky Krai, the operation to release the marine mammals into their natural habit has been completed," it said in a statement on Sunday.
Russian NGO Sakhalin Watch, which campaigned for the whales to be freed, said the final 21 belugas were released from two ships on Sunday.
The organisation said it was delighted that "the release of all the beluga whales has taken place and that the 'whale jail' has finally freed its last prisoners!"
The operation began around 9am (2300 GMT Saturday) and went on until 5pm, Sakhalin Watch said.
Many scientists and activists have criticised the Oceanography Institute for keeping the details of the release secret, not taking any observers on the trip and freeing only a small group of animals at a time rather than all of them together, which would boost their survival odds.
Sakhalin Watch said the coastguard forced its members to leave the bay where the whales were being released.
Russia is the only country that captures wild orcas and belugas to sell to aquariums, a controversial practice made possible by legal loopholes.
Many of the whales held at the facility in Srednyaya Bay were to be sent to aquariums in China.
A Change.org petition for the whales to be released collected more than 1.5 million signatures, including that of Hollywood star Leonardo DiCaprio.


This study evaluates the standard databining examples as found all over the web.
NOTE:
{{state.person.firstName}} {{state.person.lastName}}
This is {{Person.firstName}}.


Save The World Some Time
Time saved per user:
seconds
x
Amount users per day:
users
Wow!

That's
seconds
a year!


Ooty, like every other place in India, has a rich history, albeit much of it has been lost in transition and very little is officially preserved in government files. To be honest, when a country is so abundant of scenic beauty and cultural legacy, the majority of tourists aren't very interested in learning about its history. However, if you travel deep into the vaults, the History of Ooty is pretty fascinating and is guaranteed to surprise you.
The Ooty we see today is quite the anti thesis of what it used to be, say, half a century ago. In fact, all the development activities that you see around, once you reach the main town were not initiated until quite recently. When you talk about the history of Ooty, not much is known apart from what was recorded by the English when they ruled India. Thus history of modern Ooty begins when the Collector of Coimbatore, John Sullivan, sent up two surveyors, Keys and Mc Mahon, to survey and explore the place.
Neither of them were prepared for the visual treat that lay ahead of them, and not long after that, Sullivan himself embarked on a journey to further explore the Ghats on the Ooty side. He built the first English house in Ooty, known as the Stone House, which is still one of the most famous tourist destinations today. He found the place to be quite habitable and, perhaps foreseeing the potential of the place as a tourist destination, he built the first English house in Ooty, which is known as the Stone House and is still one of the most famous tourist destinations today.
To improve Ooty's accessibility to the outside world, the English launched many initial development initiatives such as road laying and forest removal, among others. The English were so taken by Ooty's beautiful splendour that it quickly became the summer capital of the Madras Presidency. The prominence of Ooty expanded even more when the Indian Army's Madras Regiment was stationed there, and the station still exists today. Even though the official history began with Coimbatore Collector John Sullivan's expedition, the presence of indigenous tribes in the area, such as the Todas, suggests that Ooty has a lengthy past that has been lost due to a lack of records.
Ooty |
Sights to |
Restaurants |
Delicious Dishes |


Here I present a build tool script boilerplate created on top of node.js .
While working on lot of web projects I had some specific needs like, concatenation, minfication and obfuscation of JS files, reusing html content like header, footer, menu etc which is not possible without any server scripting (as we don't have any include on html). Templating and CSS preprocessing also helps a lot.
In most of my projects I as using restful services for communicating with server, so I didn't wanted any server language in my frontend code. There are lot of framework and build tools are available, but either my projects were too small to be on a framework or framework provide too much which I don't need.
So I decided to use node.js to fulfill all my needs for small projects and independent frontend projects which must serve following things.
You may like to see about node.js, less, handlebars, as we are using them on our build script.
http://nodejs.org/api/
http://www.lesscss.org/
http://handlebarsjs.com/
To start using this boilerplate copy whole folder and start changing each files as your need. You can seperate you working and build directory outside.
After you can go to node project folder through command line and start build process with
node build
(** Note BUILDPATH and WORKPATH can be any path of computer ,but the path must be on UNIX path format ie "E:/work/UI plugins/BuildTool" )
concatJs : to concat js files and add on destination file
Example :
//Concatinating and minifying all common js files and libraries
fileUtils.concatJs({
src:[
WORKPATH+"assets/js/jquery.js",
WORKPATH+"assets/js/modalBox.js",
WORKPATH+"assets/js/contextMenu.js",
WORKPATH+"assets/js/base.js"
],
dest:BUILDPATH+"assets/js/base.js",
minify:globalSetting.minify
},
{
src:[
WORKPATH+"assets/js/home.js",
],
dest:BUILDPATH+"assets/js/home.js",
minify:globalSetting.minify
},
{
src:[
WORKPATH+"assets/js/projects.js",
],
dest:BUILDPATH+"assets/js/projects.js",
minify:globalSetting.minify
});
writeFile : write data to a file
fileUtils.writeFile(BUILDPATH+"test.html","<div> A dummy data</data>");
minifyJs : minify a single js file or string and copy on destination path.
Minifying a js file and putting it on destination file.
fileUtils.minifyJs({
src : WORKPATH+"assets/js/index.js",
dest : BUILDPATH+"assets/js/index.js"
});
Minifying js data and putting it on destination file.
fileUtils.minifyJs({
data : "alert ('123'); var text='something'",
dest : BUILDPATH+"assets/js/test.js"
});
getHtml : To get html data from a html file. Also allow getting html data compiled after templating.
Getting html while applying templating (templateData is optional parameter)
fileUtils.getHtml({
src : WORKPATH+"includes/header.html",
templateData: {
title : "Home Page"
}
});
getData : get data of a file
var template= JSON.parse(fileUtils.getData(WORKPATH+"data/projects.json"));
copy : copy file from one folder to another folder
Copy all files from one folder to other
fileUtils.copy({
srcFolder:WORKPATH+"assets/images",
destFolder:BUILDPATH+"assets/images"
});
Copy a single file in a folder
fileUtils.copy({
srcFile:WORKPATH+"assets/images/logo.png",
destFolder:BUILDPATH+"assets/images"
});
Copy multiple files in a folder
fileUtils.copy({
srcFile:[WORKPATH+"assets/images/logo.png",
WORKPATH+"assets/images/image1.png",
WORKPATH+"assets/images/image2.png"],
destFolder:BUILDPATH+"assets/images"
});
Methods
Compile : Compile html taking care of includes, layouts and templates. If you want to compile multiple layouts multiple object can be passed as parameter.
To call
layoutUtil.compile({
layout:{
body:WORKPATH+"home.html",
pageScripts:WORKPATH+"includes/indexScript.html",
},
templateData:{
title:"Project Shire"
},
src :WORKPATH+"layout.html",
dest:BUILDPATH+"index.html",
extend: "baseLayout"
});
Whatever layout definition you are providing which is extended by any default layout will be used in layout method used in html.
For example
<?? layout("body") ??> will include home.html data at a point where this function is called.
** Included files are also compiled recursively, so you don't have to compile them.
Methods
compile : compiles a LESS file into CSS file . Multiple object can be passed as parameter.
//to create css files from less files
lessUtils.compile(
//compile common less to css
{
src:WORKPATH+"assets/less/base.less",
dest:BUILDPATH+"assets/css/base.css",
minify:globalSetting.minify
},
//compile page specific less to css
{
src:WORKPATH+"assets/less/home.less",
dest:BUILDPATH+"assets/css/home.css",
minify:globalSetting.minify
});
include is used to include any html file inside any other html file.
<?? include("includes/header.html") ??>
layout defines which file to include as per layout defination.
<?? layout("body") ??>


Go to the source code of this file.
Define Documentation
| #define RERR_BUCKET_LIST 9 |
| #define RERR_OP_RECV_DATA 8 |
| #define RERR_OP_RECV_LEN 6 |
| #define RERR_OP_RECV_OPCODE 7 |
| #define RERR_PB_CONNECT 3 |
Variable Documentation
Initial value: {
"Success",
"Socket creation error",
"Can't fetch host name",
"Couldn't connect to PB socket",
"Couldn't initialize cURL handle",
"Error when sending data via PB socket",
"Error when receiving length of response via PB socket",
"Error when receiving command code via PB socket",
"Error when receiving command message via PB socket",
"Error when fetching bucket list"
}


About
Govcode is a website to feature Open source projects by the government.
It is built as an open source project so please feel free to contribute in Github.
Feedback
We love feedback! If you want to say how great this site is or tell us about an issue you had,
please either create a ticket in github
or use this contact form below:


items()
Contact Us
Get in touch by phone, email or visit us!
Address
Oxford Brookes University
Wheatley Campus
Wheatley
Oxford
OX33 1HX
Telephone Number
01189546241
Email
<EMAIL_ADDRESS>Map


*Check the console for debug info
**This is not an option on the slideshow, it automatically adjusts to the width of its container.


fun <R> Any.invokeMethod(name: String, vararg params: Any?): R
Invoke a specific method (not only declared) of an object through reflection
No matter if it's not accessible
params
- arguments of the method (must be compatible with the length and the types of the method)
NoSuchMethodException
- if a matching method is not found.
InvocationTargetException
- if the underlying method throws an exception.
Author
sliep
Receiver
the instance that provide the method or it's declaring class to invoke a static method
Return
the result of method
See Also


Once you start working with the Varnish source code, you will notice that Varnish is not your average run of the mill application.
That is not a coincidence.
I have spent many years working on the FreeBSD kernel, and only rarely did I venture into userland programming, but when I had occation to do so, I invariably found that people programmed like it was still 1975.
So when I was approached about the Varnish project I wasn't really interested until I realized that this would be a good opportunity to try to put some of all my knowledge of how hardware and kernels work to good use, and now that we have reached alpha stage, I can say I have really enjoyed it.
The really short answer is that computers do not have two kinds of storage any more.
It used to be that you had the primary store, and it was anything from acoustic delaylines filled with mercury via small magnetic dougnuts via transistor flip-flops to dynamic RAM.
And then there were the secondary store, paper tape, magnetic tape, disk drives the size of houses, then the size of washing machines and these days so small that girls get disappointed if think they got hold of something else than the MP3 player you had in your pocket.
And people program this way.
They have variables in "memory" and move data to and from "disk".
Take Squid for instance, a 1975 program if I ever saw one: You tell it how much RAM it can use and how much disk it can use. It will then spend inordinate amounts of time keeping track of what HTTP objects are in RAM and which are on disk and it will move them forth and back depending on traffic patterns.
Well, today computers really only have one kind of storage, and it is usually some sort of disk, the operating system and the virtual memory management hardware has converted the RAM to a cache for the disk storage.
So what happens with squids elaborate memory management is that it gets into fights with the kernels elaborate memory management, and like any civil war, that never gets anything done.
What happens is this: Squid creates a HTTP object in "RAM" and it gets used some times rapidly after creation. Then after some time it get no more hits and the kernel notices this. Then somebody tries to get memory from the kernel for something and the kernel decides to push those unused pages of memory out to swap space and use the (cache-RAM) more sensibly for some data which is actually used by a program. This however, is done without squid knowing about it. Squid still thinks that these http objects are in RAM, and they will be, the very second it tries to access them, but until then, the RAM is used for something productive.
This is what Virtual Memory is all about.
If squid did nothing else, things would be fine, but this is where the 1975 programming kicks in.
After some time, squid will also notice that these objects are unused, and it decides to move them to disk so the RAM can be used for more busy data. So squid goes out, creates a file and then it writes the http objects to the file.
Here we switch to the high-speed camera: Squid calls write(2), the address i gives is a "virtual address" and the kernel has it marked as "not at home".
So the CPU hardwares paging unit will raise a trap, a sort of interrupt to the operating system telling it "fix the memory please".
The kernel tries to find a free page, if there are none, it will take a little used page from somewhere, likely another little used squid object, write it to the paging poll space on the disk (the "swap area") when that write completes, it will read from another place in the paging pool the data it "paged out" into the now unused RAM page, fix up the paging tables, and retry the instruction which failed.
Squid knows nothing about this, for squid it was just a single normal memory acces.
So now squid has the object in a page in RAM and written to the disk two places: one copy in the operating systems paging space and one copy in the filesystem.
Squid now uses this RAM for something else but after some time, the HTTP object gets a hit, so squid needs it back.
First squid needs some RAM, so it may decide to push another HTTP object out to disk (repeat above), then it reads the filesystem file back into RAM, and then it sends the data on the network connections socket.
Did any of that sound like wasted work to you ?
Here is how Varnish does it:
Varnish allocate some virtual memory, it tells the operating system to back this memory with space from a disk file. When it needs to send the object to a client, it simply refers to that piece of virtual memory and leaves the rest to the kernel.
If/when the kernel decides it needs to use RAM for something else, the page will get written to the backing file and the RAM page reused elsewhere.
When Varnish next time refers to the virtual memory, the operating system will find a RAM page, possibly freeing one, and read the contents in from the backing file.
And that's it. Varnish doesn't really try to control what is cached in RAM and what is not, the kernel has code and hardware support to do a good job at that, and it does a good job.
Varnish also only has a single file on the disk whereas squid puts one object in its own separate file. The HTTP objects are not needed as filesystem objects, so there is no point in wasting time in the filesystem name space (directories, filenames and all that) for each object, all we need to have in Varnish is a pointer into virtual memory and a length, the kernel does the rest.
Virtual memory was meant to make it easier to program when data was larger than the physical memory, but people have still not caught on.
But there are more caches around, the silicon mafia has more or less stalled at 4GHz CPU clock and to get even that far they have had to put level 1, 2 and sometimes 3 caches between the CPU and the RAM (which is the level 4 cache), there are also things like write buffers, pipeline and page-mode fetches involved, all to make it a tad less slow to pick up something from memory.
And since they have hit the 4GHz limit, but decreasing silicon feature sizes give them more and more transistors to work with, multi-cpu designs have become the fancy of the world, despite the fact that they suck as a programming model.
Multi-CPU systems is nothing new, but writing programs that use more than one CPU at a time has always been tricky and it still is.
Writing programs that perform well on multi-CPU systems is even trickier.
Imagine I have two statistics counters:
unsigned n_foo; unsigned n_bar;
So one CPU is chugging along and has to execute n_foo++
To do that, it read n_foo and then write n_foo back. It may or may not involve a load into a CPU register, but that is not important.
To read a memory location means to check if we have it in the CPUs level 1 cache. It is unlikely to be unless it is very frequently used. Next check the level two cache, and let us assume that is a miss as well.
If this is a single CPU system, the game ends here, we pick it out of RAM and move on.
On a Multi-CPU system, and it doesn't matter if the CPUs share a socket or have their own, we first have to check if any of the other CPUs have a modified copy of n_foo stored in their caches, so a special bus-transaction goes out to find this out, if if some cpu comes back and says "yeah, I have it" that cpu gets to write it to RAM. On good hardware designs, our CPU will listen in on the bus during that write operation, on bad designs it will have to do a memory read afterwards.
Now the CPU can increment the value of n_foo, and write it back. But it is unlikely to go directly back to memory, we might need it again quickly, so the modified value gets stored in our own L1 cache and then at some point, it will end up in RAM.
Now imagine that another CPU wants to n_bar+++ at the same time, can it do that ? No. Caches operate not on bytes but on some "linesize" of bytes, typically from 8 to 128 bytes in each line. So since the first cpu was busy dealing with n_foo, the second CPU will be trying to grab the same cache-line, so it will have to wait, even through it is a different variable.
Starting to get the idea ?
Yes, it's ugly.
Avoid memory operations if at all possible.
Here are some ways Varnish tries to do that:
When we need to handle a HTTP request or response, we have an array of pointers and a workspace. We do not call malloc(3) for each header. We call it once for the entire workspace and then we pick space for the headers from there. The nice thing about this is that we usually free the entire header in one go and we can do that simply by resetting a pointer to the start of the workspace.
When we need to copy a HTTP header from one request to another (or from a response to another) we don't copy the string, we just copy the pointer to it. Provided we do not change or free the source headers, this is perfectly safe, a good example is copying from the client request to the request we will send to the backend.
When the new header has a longer lifetime than the source, then we have to copy it. For instance when we store headers in a cached object. But in that case we build the new header in a workspace, and once we know how big it will be, we do a single malloc(3) to get the space and then we put the entire header in that space.
We also try to reuse memory which is likely to be in the caches.
The worker threads are used in "most recently busy" fashion, when a workerthread becomes free it goes to the front of the queue where it is most likely to get the next request, so that all the memory it already has cached, stack space, variables etc, can be reused while in the cache, instead of having the expensive fetches from RAM.
We also give each worker thread a private set of variables it is likely to need, all allocated on the stack of the thread. That way we are certain that they occupy a page in RAM which none of the other CPUs will ever think about touching as long as this thread runs on its own CPU. That way they will not fight about the cachelines.

These techniques are also nothing new, we have used them in the kernel for more than a decade, now it's your turn to learn them :-)
So Welcome to Varnish, a 2006 architecture program.
phk


--- title: "@staticmethod in Python" author: "Carlos Vecina Tebar" date: "2022-01-01" slug: "static-method-python-decorator" translationKey: "static-method-python-decorator" output: blogdown::html_page: highlight: tango categories: - Python - Tips tags: [] subtitle: "How and when to use the staticmethod decorator in Python" summary: "Going over the basics" authors: [carlos-vecina] featured: true draft: false ---
One of the basic ideas using static methods is that they don’t use any state from any object. They cannot access either class attributes or instance attributes. Then, they are easy to locate.
However, they are limited because they have no inherance. They can be called using the ClassName.MethodName() (from the Class) or object.MethodName() (from the instanced object).
Above we can find an awesome SO thread and explanation:
Maybe a bit of example code will help: Notice the difference in the call signatures of foo, class_foo and static_foo:
class A(object):
def foo(self, x):
print(f"executing foo({self}, {x})")
@classmethod
def class_foo(cls, x):
print(f"executing class_foo({cls}, {x})")
@staticmethod
def static_foo(x):
print(f"executing static_foo({x})")
a = A()
Below is the usual way an object instance calls a method. The object instance, a, is implicitly passed as the first argument.
a.foo(1)
# executing foo(<__main__.A object at 0xb7dbef0c>, 1)
With classmethods, the class of the object instance is implicitly passed as the first argument instead of self.
a.class_foo(1)
# executing class_foo(<class '__main__.A'>, 1)
You can also call class_foo using the class. In fact, if you define something to be a classmethod, it is probably because you intend to call it from the class rather than from a class instance. A.foo(1) would have raised a TypeError, but A.class_foo(1) works just fine:
A.class_foo(1)
# executing class_foo(<class '__main__.A'>, 1)
One use people have found for class methods is to create inheritable alternative constructors.
With staticmethods, neither self (the object instance) nor cls (the class) is implicitly passed as the first argument. They behave like plain functions except that you can call them from an instance or the class:
a.static_foo(1)
# executing static_foo(1)
A.static_foo('hi')
# executing static_foo(hi)
Staticmethods are used to group functions which have some logical connection with a class to the class.
foo is just a function, but when you call a.foo you do not just get the function, you get a "partially applied" version of the function with the object instance a bound as the first argument to the function. foo expects 2 arguments, while a.foo only expects 1 argument.
a is bound to foo. That is what is meant by the term "bound" below:
print(a.foo)
# <bound method A.foo of <__main__.A object at 0xb7d52f0c>>
With a.class_foo, a is not bound to class_foo, rather the class A is bound to class_foo.
print(a.class_foo)
# <bound method type.class_foo of <class '__main__.A'>>
Here, with a staticmethod, even though it is a method, a.static_foo just returns a good ole function with no arguments bound. static_foo expects 1 argument, and a.static_foo expects 1 argument too.
print(a.static_foo)
# <function static_foo at 0xb7d479cc>
And of course the same thing happens when you call static_foo with the class A instead.
print(A.static_foo)
# <function static_foo at 0xb7d479cc


| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 | 38× 14× 14× 46× 5× 5× 11× 11× 11× 11× 11× 11× 11× 16× 16× 16× 16× 16× 16× 16× 16× 14× 14× 14× 14× 14× 22× 22× 22× 22× 14× 30× 8× 8× 8× 8× 8× 8× 8× 8× 8× 16× 35× 21× 14× 14× 6× 8× | // References: //https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20.sol //https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/math/SafeMath.sol /** Copyright 2021 Open DeFi DAO Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ pragma solidity ^0.8.4; /** * @dev Inteface for the token lock features in this contract */ interface ITOKENLOCK { /** * @dev Emitted when the token lock is initialized * `tokenHolder` is the address the lock pertains to * `amountLocked` is the amount of tokens locked * `time` is the (initial) time at which tokens were locked * `unlockPeriod` is the time interval at which tokens become unlockedPerPeriod * `unlockedPerPeriod` is the amount of token unlocked earch unlockPeriod */ event NewTokenLock(address tokenHolder, uint256 amountLocked, uint256 time, uint256 unlockPeriod, uint256 unlockedPerPeriod); /** * @dev Emitted when the token lock is updated to be more strict * `tokenHolder` is the address the lock pertains to * `amountLocked` is the amount of tokens locked * `time` is the (initial) time at which tokens were locked * `unlockPeriod` is the time interval at which tokens become unlockedPerPeriod * `unlockedPerPeriod` is the amount of token unlocked earch unlockPeriod */ event UpdateTokenLock(address tokenHolder, uint256 amountLocked, uint256 time, uint256 unlockPeriod, uint256 unlockedPerPeriod); /** * @dev Lock `baseTokensLocked_` held by the caller with `unlockedPerEpoch_` tokens unlocking each `unlockEpoch_` * * * Emits an {NewTokenLock} event indicating the updated terms of the token lockup. * * Requires msg.sender to: * * - Must not be a prevoius lock for this address. If so, it must be first cleared with a call to {clearLock}. * - Must have at least a balance of `baseTokensLocked_` to lock * - Must provide non-zero `unlockEpoch_` * - Must have at least `unlockedPerEpoch_` tokens to unlock * - `unlockedPerEpoch_` must be greater than zero */ function newTokenLock(uint256 baseTokensLocked_, uint256 unlockEpoch_, uint256 unlockedPerEpoch_) external; /** * @dev Reset the lock state * * Requirements: * * - msg.sender must not have any tokens locked, currently */ function clearLock() external; /** * @dev Returns the amount of tokens that are unlocked i.e. transferrable by `who` * */ function balanceUnlocked(address who) external view returns (uint256 amount); /** * @dev Returns the amount of tokens that are locked and not transferrable by `who` * */ function balanceLocked(address who) external view returns (uint256 amount); /** * @dev Reduce the amount of token unlocked each period by `subtractedValue` * * Emits an {UpdateTokenLock} event indicating the updated terms of the token lockup. * * Requires: * - msg.sender must have tokens currently locked * - `subtractedValue` is greater than 0 * - cannot reduce the unlockedPerEpoch to 0 * * NOTE: As a side effect resets the baseTokensLocked and lockTime for msg.sender */ function decreaseUnlockAmount(uint256 subtractedValue) external; /** * @dev Increase the duration of the period at which tokens are unlocked by `addedValue` * this will have the net effect of slowing the rate at which tokens are unlocked * * Emits an {UpdateTokenLock} event indicating the updated terms of the token lockup. * * Requires: * - msg.sender must have tokens currently locked * - `addedValue` is greater than 0 * * NOTE: As a side effect resets the baseTokensLocked and lockTime for msg.sender */ function increaseUnlockTime(uint256 addedValue) external; /** * @dev Increase the number of tokens locked by `addedValue` * i.e. locks up more tokens. * * * Emits an {UpdateTokenLock} event indicating the updated terms of the token lockup. * * Requires: * - msg.sender must have tokens currently locked * - `addedValue` is greater than zero * - msg.sender must have sufficient unlocked tokens to lock * * NOTE: As a side effect resets the baseTokensLocked and lockTime for msg.sender * */ function increaseTokensLocked(uint256 addedValue) external; } /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @dev Interface for the optional metadata functions from the ERC20 standard. * * _Available since v4.1._ */ interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); } /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin guidelines: functions revert instead * of returning `false` on failure. This behavior is nonetheless conventional * and does not conflict with the expectations of ERC20 applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract ERC20 is Context, IERC20, IERC20Metadata { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {symbol}. * * The defaut value of {decimals} is 18. To select a different value for * {decimals} you should overload it. * * All two of these values are immutable: they can only be set once during * construction. */ constructor (string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev Returns the name of the token. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5,05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless this function is * overridden; * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual override returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * Requirements: * * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. * - the caller must have allowance for ``sender``'s tokens of at least * `amount`. */ function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][_msgSender()]; Erequire(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); _approve(sender, _msgSender(), currentAllowance - amount); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { uint256 currentAllowance = _allowances[_msgSender()][spender]; require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); _approve(_msgSender(), spender, currentAllowance - subtractedValue); return true; } /** * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer(address sender, address recipient, uint256 amount) internal virtual { Erequire(sender != address(0), "ERC20: transfer from the zero address"); Erequire(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); uint256 senderBalance = _balances[sender]; Erequire(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); _balances[sender] = senderBalance - amount; _balances[recipient] += amount; emit Transfer(sender, recipient, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `to` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { Erequire(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve(address owner, address spender, uint256 amount) internal virtual { Erequire(owner != address(0), "ERC20: approve from the zero address"); Erequire(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be to transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } } contract OpenDeFiGovernance is ERC20, ITOKENLOCK { constructor(string memory name_, string memory symbol_, uint256 amount_, address deployer_) ERC20(name_, symbol_){ _mint(deployer_, amount_); } string private constant ERROR_INSUFFICIENT_UNLOCKED = "Not enough unlocked tokens for transfer"; string private constant ERROR_LOCK_EXISTS = "Token lock already exists"; string private constant ERROR_INSUFFICIENT_TOKENS = "Not enough tokens to lock"; string private constant ERROR_EPOCH_ZERO = "Unlock interval must be greater than zero"; string private constant ERROR_BAD_UNLOCK_AMOUNT = "Unlock amount must be between 1 and the locked amount"; string private constant ERROR_CLEARING_LOCK = "Cannot clear lock while tokens are locked"; string private constant ERROR_BAD_NEW_UNLOCK_AMT = "New unlock amount must be lower than current"; string private constant ERROR_BAD_NEW_UNLOCK_TIME = "New unlock time must be greater than current"; string private constant ERROR_BAD_NEW_LOCKED_AMT = "New amount locked must be greater than current"; string private constant ERROR_NO_LOCKED_TOKENS = "No tokens are locked, create new lock first"; mapping (address => uint256) public lockTime; //the time tokens were locked mapping (address => uint256) public unlockEpoch; //the time interval at which tokens unlock mapping (address => uint256) public unlockedPerEpoch; // the number of tokens unlocked per unlockEpoch mapping (address => uint256) public baseTokensLocked; // the number of tokens locked up by HOLDER /** * @dev require that at least `amount` tokens are unlocked before transfer is possible * also permit if minting tokens (coming from 0x0) * */ function _beforeTokenTransfer(address from, address /*to*/, uint256 amount) internal virtual override { Erequire(from == address(0x0) || amount <= balanceUnlocked(from), ERROR_INSUFFICIENT_UNLOCKED); } /** * @dev Lock `baseTokensLocked_` held by the caller with `unlockedPerEpoch_` tokens unlocking each `unlockEpoch_` * * * Emits an {NewTokenLock} event indicating the updated terms of the token lockup. * * Requires msg.sender to: * * - Must not be a prevoius lock for this address. If so, it must be first cleared with a call to {clearLock}. * - Must have at least a balance of `baseTokensLocked_` to lock * - Must provide non-zero `unlockEpoch_` * - Must have at least `unlockedPerEpoch_` tokens to unlock * - `unlockedPerEpoch_` must be greater than zero */ function newTokenLock(uint256 baseTokensLocked_, uint256 unlockEpoch_, uint256 unlockedPerEpoch_) public virtual override{ Erequire(balanceLocked(msg.sender) == 0, ERROR_LOCK_EXISTS); Erequire(balanceOf(msg.sender) >= baseTokensLocked_, ERROR_INSUFFICIENT_TOKENS); Erequire(unlockEpoch_ > 0, ERROR_EPOCH_ZERO); Erequire(unlockedPerEpoch_ <= baseTokensLocked_ && unlockedPerEpoch_ > 0, ERROR_BAD_UNLOCK_AMOUNT); lockTime[msg.sender] = block.timestamp; unlockEpoch[msg.sender] = unlockEpoch_; unlockedPerEpoch[msg.sender] = unlockedPerEpoch_; baseTokensLocked[msg.sender] = baseTokensLocked_; emit NewTokenLock(msg.sender, baseTokensLocked[msg.sender], lockTime[msg.sender], unlockEpoch[msg.sender], unlockedPerEpoch[msg.sender]); } /** * @dev Reset the lock state * * Requirements: * * - msg.sender must not have any tokens locked, currently */ function clearLock() public virtual override{ require(balanceLocked(msg.sender) == 0, ERROR_CLEARING_LOCK); lockTime[msg.sender] = 0; unlockEpoch[msg.sender] = 0; unlockedPerEpoch[msg.sender] = 0; baseTokensLocked[msg.sender] = 0; } /** * @dev Returns the amount of tokens that are unlocked i.e. transferrable by `who` * */ function balanceUnlocked(address who) public virtual override view returns (uint256 amount) { return (balanceOf(who)- balanceLocked(who)); } /** * @dev Returns the amount of tokens that are locked and not transferrable by `who` * */ function balanceLocked(address who) public virtual override view returns (uint256 amount){ if(baseTokensLocked[who] == 0){ return 0; } uint256 unlockedOverTime = unlockedPerEpoch[who] * (block.timestamp - lockTime[who]) / unlockEpoch[who]; if(baseTokensLocked[who] < unlockedOverTime){ return 0; } return baseTokensLocked[who]- unlockedOverTime; } /** * @dev Emits the UpdateTokenLock event */ function emitUpdateTokenLock() internal { emit UpdateTokenLock(msg.sender, baseTokensLocked[msg.sender], lockTime[msg.sender], unlockEpoch[msg.sender], unlockedPerEpoch[msg.sender]); } /** * @dev Reduce the amount of token unlocked each period by `subtractedValue` * * Emits an {UpdateTokenLock} event indicating the updated terms of the token lockup. * * Requires: * - msg.sender must have tokens currently locked * - `subtractedValue` is greater than 0 * - cannot reduce the unlockedPerEpoch to 0 * * NOTE: As a side effect resets the baseTokensLocked and lockTime for msg.sender */ function decreaseUnlockAmount(uint256 subtractedValue) public virtual override{ require(balanceLocked(msg.sender) > 0, ERROR_NO_LOCKED_TOKENS); require(subtractedValue > 0 && (unlockedPerEpoch[msg.sender]- subtractedValue) > 0, ERROR_BAD_NEW_UNLOCK_AMT); baseTokensLocked[msg.sender] = balanceLocked(msg.sender); lockTime[msg.sender] = block.timestamp; unlockedPerEpoch[msg.sender] = (unlockedPerEpoch[msg.sender]- subtractedValue); emitUpdateTokenLock(); } /** * @dev Increase the duration of the period at which tokens are unlocked by `addedValue` * this will have the net effect of slowing the rate at which tokens are unlocked * * Emits an {UpdateTokenLock} event indicating the updated terms of the token lockup. * * Requires: * - msg.sender must have tokens currently locked * - `addedValue` is greater than 0 * * NOTE: As a side effect resets the baseTokensLocked and lockTime for msg.sender */ function increaseUnlockTime(uint256 addedValue) public virtual override{ require(addedValue > 0, ERROR_BAD_NEW_UNLOCK_TIME); require(balanceLocked(msg.sender) > 0, ERROR_NO_LOCKED_TOKENS); baseTokensLocked[msg.sender] = balanceLocked(msg.sender); lockTime[msg.sender] = block.timestamp; unlockEpoch[msg.sender] = (addedValue+ unlockEpoch[msg.sender]); emitUpdateTokenLock(); } /** * @dev Increase the number of tokens locked by `addedValue` * i.e. locks up more tokens. * * * Emits an {UpdateTokenLock} event indicating the updated terms of the token lockup. * * Requires: * - msg.sender must have tokens currently locked * - `addedValue` is greater than zero * - msg.sender must have sufficient unlocked tokens to lock * * NOTE: As a side effect resets the baseTokensLocked and lockTime for msg.sender * */ function increaseTokensLocked(uint256 addedValue) public virtual override{ require(addedValue > 0, ERROR_BAD_NEW_LOCKED_AMT); require(balanceLocked(msg.sender) > 0, ERROR_NO_LOCKED_TOKENS); require(addedValue <= balanceUnlocked(msg.sender), ERROR_INSUFFICIENT_TOKENS); baseTokensLocked[msg.sender] = (addedValue+ balanceLocked(msg.sender)); lockTime[msg.sender] = block.timestamp; emitUpdateTokenLock(); } } |


Home
Archives
About
Contact
2017
Dec 2017
Hello World
@Untitled. All right reserved | Design & Hexo
Jonathan Klughertz


static void |
LoggingTemplate.log(org.slf4j.Logger logger,
Level level,
java.lang.String msg) |
Takes an existing logger and allows you to select a LoggingLevel at run time, rather than having to hard code your selection.
|
static void |
LoggingTemplate.log(org.slf4j.Logger logger,
Level level,
java.lang.String format,
java.lang.Object arg) |
Takes an existing logger and allows you to select a LoggingLevel at run time, rather than having to hard code your selection.
|
static void |
LoggingTemplate.log(org.slf4j.Logger logger,
Level level,
java.lang.String format,
java.lang.Object... arguments) |
Takes an existing logger and allows you to select a LoggingLevel at run time, rather than having to hard code your selection.
|
static void |
LoggingTemplate.log(org.slf4j.Logger logger,
Level level,
java.lang.String format,
java.lang.Object arg1,
java.lang.Object arg2) |
Takes an existing logger and allows you to select a LoggingLevel at run time, rather than having to hard code your selection.
|
static void |
LoggingTemplate.setPoolEmptyLevel(Level poolEmptyLevel) |
Used to overwrite the logging level for when WorkerPool starts but there is noting in the pool.
|
static void |
LoggingTemplate.setPoolExitOnErrorLevel(Level poolExitOnErrorLevel) |
Used to overwrite the default logging level when pool exit the with code -1 because of an error in the pool.
|
static void |
LoggingTemplate.setPoolFinishedStartLevel(Level poolFinishedStartLevel) |
Used to overwrite the default logging level when all pools complete after calling start.
|
static void |
LoggingTemplate.setPoolStartAllPollsLevel(Level poolStartAllPollsLevel) |
Used to overwrite the logging level for when WorkerPool starts all pools.
|
static void |
LoggingTemplate.setPoolStartLevel(Level poolStartLevel) |
Used to overwrite the default logging level for starting a pool.
|
static void |
LoggingTemplate.setPoolStopingNextPoolOnErrorLevel(Level poolStopingAllOnErrorLevel) |
Used to overwrite the default logging level when WorkerPool stops new threads from starting because the previous pool errored.
|
static void |
LoggingTemplate.setPoolStopNextWorkerOnErrorLevel(Level poolStopNextWorkerOnErrorLevel) |
Used to overwrite the default logging level when an error in the pool stops the next worker from starting
|
static void |
LoggingTemplate.setRetryLevel(Level retryLevel) |
Used to overwrite the default logging level when either a worker or pool retries after a failure.
|
static void |
LoggingTemplate.setWorkerCompleteLevel(Level workerCompleteLevel) |
Used to overwrite the logging level for when a worker completes its work.
|
static void |
LoggingTemplate.setWorkerErrorLevel(Level workerErrorLevel) |
Used to overwrite the logging level for when a worker is stopped by an error.
|
static void |
LoggingTemplate.setWorkerStartLevel(Level workerStartLevel) |
Used to overwrite the logging level for when a worker is started.
|


Surrounds the current statement with the if __name__ == '__main__:' expression.
if __name__ == '__main__:'


pvmanager is a client utility library to collect and process data in (soft) real-time. It allows to decouple the rate of events on the network from the rate of refresh needed by the client (typically UI) itself.
pvmanager is a part of DIIRT: Data Integration In Real-Time
To get started, look at the examples and documentation.
You can also browse Gabriele's old presentations. Be aware that some information may have changed from the time the slides were prepared.
Official releases are available on Maven central as of v2.0.


Click Any Link Below To Experience SuperHero Application
http://localhost:8080/dropin/step1
http://localhost:8080/dropin/step2
http://localhost:8080/dropin/step3
http://localhost:8080/dropin/step4


These are various WebGL samples.
Many of them use the tdl library which can be found at http://github.com/greggman/tdl.
One of them, the Aquarium (aquarium/aquarium.html) can be run synchronized across machines to form a multi-display simulation. You can see an example at http://www.youtube.com/watch?v=64TcBiqmVko
See aquarium/readme.html for more information.


Week 4: Social Networks. Part 1.
It’s the start of week four in quarantine and things are somehow still not consistent. Some things that changed this week:
- Gillian and I returned to my house. I returned (semi) permanently.
- Gillian left my house to drive to her home in North Carolina.
- Sam adopted a puppy, Diego, who, like us, pees inside, but unlike us, pees on the floor.
- The temperature reached 70º.
- My sheets.
- For two days, not my clothes.
- Sam turned 22.
- I turned 22 and 7/12ths.
Mostly, the things that changed around me and about me were the people I was/am living with and the ways we communicated. When quarantine began, I stayed with Gillian for about two weeks. In part because I wanted to, and in part because I had to. Being immunocompromised during coronavirus means I have to be extra careful. Considering that some of my regular roommates were still working and we all share a single toilet, I thought it best to stay away until they were two weeks out of work.
So, I stayed with Gillian. Until COVID brought more surprises. Two people came in from out of town and needed a place to isolate for two weeks before returning to society because that’s the world we live in now. Coincidentally, Gillian’s friend was moving out of her apartment for a bit, opening up a room in an apartment with two people who had also been quarantining for two weeks. So the transition started.
Apartment 1:
Gillian & Juliet -> Anael & Elyse
Apartment 2:
Paige, Osmar, & Jesse -> Gillian, Juliet, Osmar, & Jesse
House 1:
Juliet, Sam, Coleen, & Mathea -> Sam Coleen & Mathea
House 2:
No one -> Paige
The kindness, care, and generosity of friends allowed everyone to have a safe place to live while keeping potential virus spreading to 0.
Finally, when all of my roommates had been out of work for two weeks and Paige needed to come home, Gillian and I gave Paige her room back and returned to my house. This is where Diego, the baby chihuahua comes in.
Apartment 1:
Gillian & Juliet ->
Anael & Elyse
Apartment 2:
Paige, Osmar, & Jesse ->
Gillian, Juliet, Osmar, & Jesse ->
Paige, Osmar, & Jesse
House 1:
Juliet, Sam, Coleen, & Mathea ->
Sam Coleen & Mathea ->
Gillian, Juliet, Sam, Coleen, & Mathea (and Diego)
House 2:
No one ->
Paige ->
No one
But that was not the end. Finally, at the start of week four, Gillian went home to North Carolina and Anael, now officially non-viral, moved to her boyfriend Jack’s house.
Apartment 1:
Gillian & Juliet ->
Anael & Elyse ->
Elyse
Apartment 2:
Paige, Osmar, & Jesse ->
Gillian, Juliet, Osmar, & Jesse ->
Paige, Osmar, & Jesse
House 1:
Juliet, Sam, Coleen, & Mathea ->
Sam Coleen & Mathea ->
Gillian, Juliet, Sam, Coleen, & Mathea (and Diego) ->
Juliet, Sam, Coleen, & Mathea (and Diego)
House 2:
No one ->
Paige ->
No one
House 3:
Anael, Jack, & others
House 4:
Gillian & family
All of us are virus free, practicing responsible social distancing, and Purelling the crap out of our hands.
So… Here’s who I have lived with the past 3+ weeks:
If you want to know more about my social networks in quarantine, take a look at part 2.
This is the second in a series of posts From Quarantine. Most posts from quarantine are prompted by Aisling Quigley’s Data Storytelling class at Macalester College. This is one of those posts.


Grid Layout
Works currently only in IE, Edge, or special browser settings (see
Can I Use
)
Text
Photo
Gallery
Logo
Lightbox


Toggle navigation
Vault Web
Load Secrets
Add New Secret
System
-
Health Check
Token Information
Logout
Endpoint
Token
Path
Secrets
View
View
×
Vault System Health
Endpoint:
-
×
Vault Token Information
×
Path:
×
×
Error


ASTEROID CATCHER FEATURES
Asteroid Catchers is a new space age take on the popular Color Switch game. Travel thru space, collect rare colorful asteroids. The more you collect the more dangerous it becomes. Great, easy and free game!
 Download the Asteroid Catcher App for free now.
GET IN TOUCH
Have questions about our app or have a game suggestion? Fill out our contact form.
Privacy Policy
Your privacy is important to us. It is 3E Media Group's policy to respect your privacy regarding any information we may collect from you through our app, Asteroid Catcher. We only ask for personal information when we truly need it to provide a service to you. We collect it by fair and lawful means, with your knowledge and consent. We also let you know why we’re collecting it and how it will be used. We only retain collected information for as long as necessary to provide you with your requested service. What data we store, we’ll protect within commercially acceptable means to prevent loss and theft, as well as unauthorised access, disclosure, copying, use or modification. We don’t share any personally identifying information publicly or with third-parties, except when required to by law. Our app may link to external sites that are not operated by us. Please be aware that we have no control over the content and practices of these sites, and cannot accept responsibility or liability for their respective privacy policies. You are free to refuse our request for your personal information, with the understanding that we may be unable to provide you with some of your desired services. Your continued use of our website will be regarded as acceptance of our practices around privacy and personal information. If you have any questions about how we handle user data and personal information, feel free to contact us. This policy is effective as of 18 October 2019. Generated by GetTerms.io


Creating Your First Plugin
This documentation section will help you get started with developing plugins for the IntelliJ Platform. You can use either IntelliJ IDEA Community Edition or IntelliJ IDEA Ultimate as your IDE (it is highly recommended to use the latest available version). Both include the complete set of plugin development tools. To become more familiar with IntelliJ IDEA, please refer to the IntelliJ IDEA Web Help.
There are two supported workflows available for building plugins. The recommended workflow for new projects is to use Gradle. The old Plugin DevKit workflow still supports existing projects.
If a new plugin will be Scala-based, a plugin development workflow sbt-idea-plugin, is available. The workflow is analogous to the Gradle workflow but tailored to developing IntelliJ Platform plugins in Scala. JetBrains does not officially support this Scala workflow, and at this time the workflow has only minimal documentation.
The Gradle workflow offers these advantages:
- Gradle in general:
- Representations of source sets, modules, and projects are portable,
- Projects of any size or complexity usually require scripts for build management, which Gradle handles natively,
- Training, documentation, and community help for general Gradle topics are widely available.
- Specific to development of IntelliJ Platform plugins with the Gradle plugin for IntelliJ IDEA:
- Changing plugin targets is easier because it is all done in
build.gradle
:- Switching the version of the target IntelliJ Platform (IDE),
- Changing the target IntelliJ Platform-based IDE, e.g., from IntelliJ IDEA to PyCharm,
- Running a plugin against alternate versions of the JetBrains runtime.
- Gradle is fully integrated with IntelliJ Platform-based IDE CI builds and plugins.jetbrains.com, so it is easy to customize and extend the build and publishing processes.
- Gradle has built-in verification for
plugin.xml
module dependency and use of version-specific IntelliJ Platform APIs, the same checks as on plugins.jetbrains.com.
- Changing plugin targets is easier because it is all done in