The Bluesoxx introduction to computer science course will meet from 4:00 to 6:00 P.M. on Mondays, starting April 1st and completing May 13th.
We are hosted at WHITE Lounge in downtown Vancouver, through partnership with the FreeSpace coworking community. Located near Davie Street at 1257 Hamilton Street in Yaletown, the space operates as a restaurant and lounge six days a week. On Mondays, when it is closed, a dedicated meeting area is reserved for our use.
A program fee of $80 will be collected to cover costs. (Please contact<EMAIL_ADDRESS>in case of financial hardship.)
Eric Hsu will lead the core class, alongside existing Bluesoxx who have already learned Python. “My academic background is in artificial intelligence, but a few years ago I went back into industry, building software systems for startups in San Francisco and Boston. I’ve taught programming for software engineers, and computer science at university. I’ve also taught leadership at military school and P.E. for first-graders, and just started coaching beginners at Vancouver Rowing Club over the summer. I moved to Vancouver in 2015 with my wife, who took a job at UBC, and started working remotely for a U.S. company while waiting for Canadian residency. Now I have a work permit, but miss teaching! Also I love the general attitude of the newest generation of people and am jealous of all the opportunities and resources they have now for going through life.”
The program will also use online computer science courses made available by universities with track records of successful undergraduate education. Most importantly, though, students will work together to explore the material and pursue their own understanding as a cohort.
Students will learn both coding, and computer science as a whole: a lot of coders know some computer science and wish they knew more; most computer scientists can code, but they would certainly like to code better. Coding uses existing and emerging programming languages to create apps or backend software or user interfaces that people can use on their computing platform (i.e. laptop or smartphone, lab instrument or car, thermostat or space vessel). Computer science figures out new things that can/can’t be computed (not everything can be computed!) and the techniques for doing so in the best (fastest, most reliable, cheapest) way possible.
An analogy is that a lot of people can drive a car, just as a lot of people can use a computer. But, a master mechanic can not only operate, or repair, or customize a car, but can even make a new one from mixed parts, just as coders can extend existing software applications, or create entirely new ones. A computer scientist is more like an automotive engineer, in terms of designing new kinds of vehicles, understanding what makes them faster (or safer, or easier to build), and creating new parts that mechanics can use. So figuring out how to make a personal assistant like Siri understand what you are saying is more about computer science, and building Siri is more about coding.
A final distinction is that some shorter-term coding camps are more about quickly getting a small demo project working using pre-built templates or beginners' platforms (like the most excellent Scratch language.) This could be compared to assembling a model car from a kit: it is a practical and achievable short-term goal, and a great way to get familiar with cars (or computers) and learn something about how they work. But over a longer course of time the Bluesoxx program will go beyond simple projects so participants can create realistic programs built with the same tools, methods, and theoretical foundations used by professionals.
No experience is required to join the program.
Most everyone who has worked with women, or studied women, or met a woman, or who is a woman, has some sort of understanding about how women are different from men and how women can be successful in different ways. But, the Bluesoxx program has no doctrine about the best way to teach girls, and no policy regarding their relationship with technology and society, except that the course is currently open only to people who identify as female and attend a Vancouver-area secondary school.
Yes! Because Python is one of the most user-friendly programming languages that is widely used on a professional basis, there are many resources to get going as a beginner. From the beginning you will be able to interact with the computer to input data automatically, make calculations, and import code that other people have written to build your own programs. From there you will be able work with a data set of your choosing to compute statistics and teach the computer to make predictions.
But, you will have to work, too: we won’t be doing a "junior" version of programming where you can quickly make something from a kit to show your parents but nobody wants to explain how it works. It is kind of like taking piano lessons: it’s not fun just start playing on a piano when you don’t know how to play. But, it is fun to work out how to do something that you can't do, and then do it! Getting good at something over time can be more fun than something that is just entertaining. And, you will be doing it with your friends.
The opportunity to work with your friends and accomplish things together is one advantage over the specific example of playing the piano. Also, once you get started there are more resources to get really good on your own, without always having to meet up with a teacher to progress. (Playing the piano is surely a lot of fun for many people, too!)
If you already know of something that you enjoy learning more than computer science, then you should go ahead and do that for sure!
 One way describing it is that programming is like building something the way you want using facts and logic instead of persuasion or authority (like when you are debating something with your friends, versus with people who are younger or older than you), and that computer science is programming plus solving puzzles by figuring out the "trick" to making them work (like when you have your own favorite way of arranging your candies in Candy Crush.)
If it turns out that computer science is for you, then luckily you will be able to do something you like while transforming almost every part of the world, not just the computer industry. Many of the newest and most important trends in a variety of areas require an understanding of computer science:
Also, you can make good income working with computers in the future, and live a fun life in the city you want, (or while travelling around the world), at least compared to being dependent on other people for money—you could also make mega-money by inventing a company or technology. (If you already know that you don’t like C.S., but you need a solid salary, like, to provide for your family, then you should also learn C.S. but that is a pretty grim scenario indeed for a high school student.)
If you can already write programs, you will get to learn about the computer science algorithms and technologies that programming is based on, which will greatly enhance your ability to do new things. In terms of programming tasks, you will sometimes get a more challenging version of what everyone else is working on—the rest of the time you will get to carry out a time-honored and equally beneficial tradition in the history of computers: sharing what you’ve learned with others.
Learning C.S. might be really fun and interesting for your child, and also provide a means for them to pursue the career they want in a variety of fields in the future (a few examples are listed above in the Students' section). Early on, for many youths it is already evident that they enjoy tumbling, dancing, fashion, or fighting, without taking gymnastics, ballet, sewing, or mixed-martial-arts classes first. But, it may not be immediately obvious whether they will enjoy a less traditional activity, like computer science. So, it is worth at least trying out!
There are some great educational resources available online, mostly at no cost; we can definitely recommend some appropriate options for anyone who does not want to join with us! Indeed, the Bluesoxx program is built on many of these resources, so a more direct question might be, "Why shouldn’t my child just take some classes online by herself?"
Anyone who has taken an online computer class—or who has built pretty much anything on a computer on their own, has probably shared the same experience with millions of beginning and expert users around the world: 90% of your project goes smoothly, the way it is supposed to; and 10% totally doesn’t make sense, and is almost impossible to solve without help. (Often, that 10% is the first 10% of the project!) The opportunity to consult with fellow students, along with experienced instructors, is key to sailing past obstacles that can otherwise dominate the whole learning experience.
Furthermore, technical competence in and of itself is not professionally or personally profitable. Telling a child to just learn computer science online could be compared, on a smaller scale, to telling them to just go to university online.
Professionally, simply knowing how to do a task is not the same as knowing how to communicate with peers and stakeholders, how to identity new opportunities and problems that need solving, how to clarify requirements and manage expectations, or how to ask the right question to get the right information at the right time. (This may explain why so many technically proficient individuals are repeatedly cheated out of professional opportunities—by a combination of wrongfully and rightfully assessed factors of this kind.)
Personally, it can be ungratifying indeed to excel at something without the opportunity to teach and to be taught, to build inter-personal relationships, and to at least share your trials and accomplishments with some part of the wider world. Not everybody in the world can be friends, but at the same time human beings do not seem to have evolved to perform solitary labor. And as much as modern commerce is driven by mass production, and as much as this is reflected in the economic drive to extend automation into education, human mentorship and collaborative learning cannot currently be replaced by IT.
By these arguments, your child can definitely learn almost anything online on their own, including computer science; but it may take a lot longer and they will be missing out on many opportunities for personal enrichment.
Though the program is structured as a class, the best way to think of it as an extra-curricular activity like music lessons, sports, volunteering, or working a summer job.
If it turns out that they do like computer science, it is definitely an under-subscribed means of enriching the standard curriculum at most secondary schools, and in turn improving a student's chances for getting into a famous school. Some parents are really concerned about marks and taking time away from study…but for the schools with tightest admissions rates, most applicants have pretty good marks already—a better way to stand out might be working on something like a science project, a personal hobby, a non-profit organization, or a global open-source project, potentially using knowledge of computer science.
Please provide your student with a recent-model laptop...a Macbook or a PC with Linux installed will be more convenient but is not a necessity.


About
Hello, my name is Bruce. I have several PhDs in different fields of science, but you can call me the doctor of love. My ideal date would be reading books together curled up next to the fire. I hope you like science, cause I got my ion you.
Likes
- Learning
- Helping Others
- Serenity
Top 5 Favorite Studies
- Radiation Emission and Absorption According to the Quantum Theory -Einstein, Albert (1916)
- The Mathematical Theory of Relativity -Eddington, Arthur Stanley (1923)
- Radiation Botany -Arnold H. Sparrow (1966)
- Isotopic Variation of Parity Violation in Atomic Ytterbium - D. Antypas (2018)
- Your Eyes -Me, Bruce Banner ;)
Social Media
Get to know your mans better! A relationship can't start if you don't connect! Click below to check them out on social social media~
Check out Bruce Banner on Instagram!
Check out Bruce Banner on Twitter!


Introduction
This post explains how to train XGBoost models on multiple GPUs and how to use them to predict on unseen data still on multiple GPUs, along with the necessary steps to detect the available GPU devices and distribute the work among them. The training process on a single GPU provided speedups of approximately 10x. There is a github link provided at the end of this article, containing python code implemented beyond the simple example explained in this page. Further, I'm not going to reinventing the wheel, instead, this article is focused on using consolidated frameworks which are powerful and employed in production to solve real world problems.XGBoost
The XGBoost library implements immensely powerful algorithms under the (extreme) gradient boosting framework, in a highly efficient manner. Even though the examples provided in this article are written in python, the XGBoost core is written in C++ and provides interfaces for simple usage across many other programming languages such as Python, R, Java, Ruby, Swift, Julia, C and C++. XGBoost enables the tasks of classification, regression and ranking, however, at the present moment, only classification and regression tasks are available to be executed in the GPUs.Dask
Dask is a powerful library which enables python programs to scale using threads and processes, running on CPUs or GPUs either on single-machine or multiple machines, including thousand-node clusters. Many useful libraries implement routines to execute code using dask powered parallelism, such as XGBoost.Development
Importing the required libraries:from xgboost.dask import DaskDMatrix, train as dask_xgboost_train, predict as dask_xgboost_predict
from dask.dataframe import from_array, from_pandas
from dask.distributed import Client
from dask_cuda import LocalCUDACluster
import numpy as np
import pandas as pd
The method LocalCUDACluster
provided by dask-cuda
enables the detection of GPU devices
on the local machine, in addition to means of executing supported code on them. It creates the abstraction
of a server, in which clients connect to using the dask.distributed.Client
class.
The supported code to execute on cuda is provided by xgboost.dask
in this case, substituting the regular
XGBoost methods which would traditionally train on the CPU. Finally, the dask.dataframe
module
provides methods to transform traditional numpy.ndarray
and pandas.DataFrame
into
a dask dataframe which informs the dask library how to distribute the problem to it's client workers. Note
that the xgboost.dask
methods will not accept regular numpy or pandas data structures.
Next, let's create
X
of dimensions n x m
as a numpy.ndarray
composed of values in the range [0, 1]
to be our training features
and similarly y
as a 1D numpy.ndarray
of
n
elements to become the target (or labels) for a binary classification
task:
n, m = 10 ** 4, 10
rand = np.random.Generator(np.random.PCG64())
X = rand.random(size=(n, m))
y = np.array([1 if np.sum(X[i, :]) > 0.7 * m else 0 for i in range(X.shape[0])])
Though the size of the features X
might seem relatively huge in this
example, a GPU might have ease at dealing with it.
The above snippet is very simple and the relevant aspect of it is that we set the target label to be 1
if the sum of the corresponding features X
is greater than 70% of m
, that is, 7. It is important to use
such a valid relationship between each instance of features in X
and the corresponding label in y
to make
the classification problem seem like a real one, instead of initializing y
as random array unrelated to X
.
Further, let's define parameters which will be given to the XGBoost to train with, keeping in mind that not all parameters are currently accepted for a GPU execution (for more details check the XGBoost documentation):
params = {
'learning_rate': 0.3,
'max_depth': 8,
'objective': 'binary:hinge',
'verbosity': 0,
'tree_method': 'gpu_hist'
}
The method which we will use next is similar to the regular xgboost.train
in which
our goal classifier model distinguishes itself from the regression or ranking models by means of the "objective"
element in the above params
dictionary. In this example, setting the
"objective"
to
"binary:hinge"
defines a classification task.
It's time to handle the local resources using Dask:
local_gpus = LocalCUDACluster(n_workers=None, threads_per_worker=1)
local_dask_client = Client(local_gpus)
The argument n_workers
given to the
LocalCudaCluster(...)
function defines the number of processes to be used
on the GPUs, however, the trick is that only a single process is allowed per GPU. Therefore, this parameter
controls the exact number of GPUs to be used and, when it's set to None
, all
the available GPU devices will be used. Further in the same function, the
threads_per_worker
parameter controls how many threads will be executed in
each GPU, in my local machine, the fastest results were obtained setting it to 1, probably due to threading
management overhead. Note that the dask client
might print plenty of information to the standard output/error console, which might not necessarily
mean there is something wrong. Keep in mind the above code snippet will use multiple GPUs if they are available,
however, on a single machine.
Later on, we transform both X and y into dask dataframes to feed them to the model traning function:
data_chunksize = X.shape[0] // len(local_gpus.cuda_visible_devices)
X = from_array(X, chunksize=data_chunksize)
y = from_array(y, chunksize=data_chunksize)
dtrain = DaskDMatrix(local_dask_client, X, y)
xgb_model = dask_xgboost_train(local_dask_client, params, dtrain, num_boost_round=100, evals=[(dtrain, 'train')])
The data_chunksize
parameter is very important, it is a dask dataframe
property which informs the dask workers on how to divide the input data among them. Choosing this parameter
wisely should yield better performance, it's mean't to be adapted to the hardware that you are using. In
the above code snippet, I'm dividing it evenly among all GPU devices, without further considerations of
the hardware at my disposal. The function from_array
converts our
numpy.ndarray
's into dask.dataframe
's.
The newly created dask.dataframe
's are converted, using the GPUs, to
to a XGBoost's data type, that's because we are using a function from the xgboost.dask
module, passing it our local_dask_client
variable, which was configured in
the previous step to execute on the GPUs.
Finally, the model is trained, again on the GPUs, due to our local_dask_client
variable being given to the dask_xgboost_train
function. The returned object,
rather than a model as the regular xgboost.train
would return, is a
dictionary containing two elements. The first one is keyed by the string
"booster"
and contains the regular XGBoost model we were expecting, while
the second one keyed by the string "history"
contains another dictionary
providing relevant information regarding the training process.
For completeness, here's what the final code of the example looks like:
from xgboost.dask import DaskDMatrix, train as dask_xgboost_train, predict as dask_xgboost_predict
from dask.dataframe import from_array, from_pandas
from dask.distributed import Client
from dask_cuda import LocalCUDACluster
import numpy as np
import pandas as pd
n, m = 10 ** 4, 10
rand = np.random.Generator(np.random.PCG64())
X = rand.random(size=(n, m))
y = np.array([1 if np.sum(X[i, :]) > 0.7 * m else 0 for i in range(X.shape[0])])
params = {
'learning_rate': 0.3,
'max_depth': 8,
'objective': 'binary:hinge',
'verbosity': 0,
'tree_method': 'gpu_hist'
}
local_gpus = LocalCUDACluster(n_workers=None, threads_per_worker=1)
local_dask_client = Client(local_gpus)
data_chunksize = X.shape[0] // len(local_gpus.cuda_visible_devices)
X = from_array(X, chunksize=data_chunksize)
y = from_array(y, chunksize=data_chunksize)
dtrain = DaskDMatrix(local_dask_client, X, y)
xgb_model = dask_xgboost_train(local_dask_client, params, dtrain, num_boost_round=100, evals=[(dtrain, 'train')])
In the source-code provided at my github, you'll find a python script which contains:
- a train function called
train_xgboost_gpu
encapsulating the above mentioned code as a straightforward method for training a XGBoost model on multiple GPUs; - a predict function called
predict_xgboost_gpu
performing predictions over the trained model also on multiple GPUs (yet I would not recommend using it because it presented slower results than the CPU on my machine, and it seems the memory allocated for the model is leaking, due to some weird internal bug in the modulexgboost.dask
when trying to deallocating the model instance); and - an example function training and predicting on 2 XGBoost models, 1 for regression and 1 for classification.
Requirements, Installation & Testing Hardware Specs
The following resources were used in the scope of the python source-code provided which were also the parameters taken into account for writing this article:- python 3.8.3
- xgboost 1.3.3
- dask 2.30.0
- dask-cuda 0.18.0
- numpy 1.19.2
- pandas 1.0.3
$ python[3.7] -m pip install numpy==1.19.2 pandas==1.0.3 dask==2.30.0 dask-cuda==0.14.1 xgboost==1.3.3
A few key points to dedicate attention are:
- depending on your platform you should use just "python" or "python3" or "python3.7" (or any other python version that you would like to try);
- it's important to install xgboost using pip so the GPU modules are also installed by default. Installing using conda is possible, however it might be harder (I haven't tried) and you need to ensure by yourself that all the GPU required elements are indeed installed; and
- later versions of any of the used resources might work as well.
Source-code
Available on my github page, written in Python. A documentation of the code is provided in the "README.md" file, as well as docstrings in the source-code itself.Practical Example
A practical example of running the XGBoost framework in the GPU may be seen on this link prediction example.Cheers!
gmmoliveira1@gmail.com


Bill NO.-{{ generateBill.billStartNumber }}-{{ generateBill.billNoPrefix }}-{{ generateBill.billNoSuffix }}
Member :
{{ occ.wingBuilding }}-{{occ.flatNumber}}
Member :
{{ occ.wingBuilding }}-{{occ.flatNumber}}
Bill Type :
{{ bill.billName }}
Select Billing Type
Date :
Date is required
Due Date :
{{isDueDate}}
Select Due Date
Recieved Amount :
Amount is required
Pending Amount :
Amount is required
Bill Date
Recieves
{{ user.recievedDate | date:'dd/MM/yyyy' }}
{{user.recieveAmount}}
0">
Recieved Date :
Date is required
Amount To Be Recieved :
Bill No Suffix is required
Save


=== Heading === Some content I would like to add another line == Subheading == Some more content Some more lines1 :A line with indent :: A 2-indented line :: more :back to 1-indented line [[File:http://samuellam.files.wordpress.com/2013/02/steve-jobs-today-quotes-image-2.jpg?w=475 Steve Jobs]] This is a link:[http://www.google.com Google]. This is a bold link:'''[http://www.google.com Google]'''. This is a bold-italic link:'''''[http://www.google.com Google]'''''. This is '''bold''', '''''bold-italic''''', and ''italic'' [[Video:http://www.youtube.com/watch?v=F8UFGu2M2gM]] # First # secon ## Second-First *** First Point *** Second Point #### z #### y #### x *** Third Point ## Second-Second [ftp://www.facebook.com FacebookFTP] ## Second-Third [http://www.google.com Google Here] # third


Participate in this website!
Here are some ways in which you can take part in this site, follow its
development and make your opinions known to other visitors of this site.
1. Link to the site
Each of the links to this site is automatically reciprocated, as the
backlinks button on each page gives a visitor a list of all sites linked
to it, as currently know to Alta Vista. The following button gives a list
of all websites referencing any of my pages:
People who check this list have a chance to visit your page as well.
There are linking instructions and sample code available fopr linking to the
Great thinkers,
Intelligent Humor,
Frontier Organizations,
karate,
massage,
sponsor and
Animated backgrounds
pages.
2. Join Email lists
There are mailing lists for several of the pages of this website.
You are welcome to join and contribute. They are listed in my
mailing lists guide.
3. Donations
Work on a large non-commercial website takes a lot of time and resources.
On top of that, I spend money to advertize these pages (partly covered by
the money collected from commercial advertisements on these pages).
Any donation would help me to improve and further promote these pages.
If you think you could halp, please contact me at
<EMAIL_ADDRESS>4. Guestbooks
If you would like to leave a message for others to see, please enter it into
one of the guestbooks.
I read these messages, but not very often.
Frivolous messages will be deleted.
5. Netminder Notification
Here you can register to be automatically notified when some of the pages
you select get updated or move to another location.
Please enter your email address, highlight the pages you would like to
monitor, and press the Register button.
Your Internet e-mail address:
6. Email
If you want to communicate to me personally, please send me
email.
Please spare my time; I receive a huge amount of mail, and have to
concentrate on the most important issues. If you have good ideas, want
to criticize my articles, or report broken links, I would love to hear from you.
If you want me to do some work for you personally, please consider reimbursing
me for my efforts.


Default Database User Privileges
When you create a database object, you are its owner. By default, only a superuser or the owner of an object can query, modify, or grant privileges on the object. For users to use an object, you must grant the necessary privileges to the user or the group that contains the user. Database superusers have the same privileges as database owners.
Amazon Redshift supports the following privileges: SELECT, INSERT, UPDATE, DELETE, REFERENCES, CREATE, TEMPORARY, and USAGE. Different privileges are associated with different object types. For information on database object privileges supported by Amazon Redshift, see the GRANT command.
The right to modify or destroy an object is always the privilege of the owner only.
To revoke a privilege that was previously granted, use the REVOKE command. The privileges of the object owner, such as DROP, GRANT, and REVOKE privileges, are implicit and cannot be granted or revoked. Object owners can revoke their own ordinary privileges, for example, to make a table read-only for themselves as well as others. Superusers retain all privileges regardless of GRANT and REVOKE commands.


Getting Started
Install from npm:
{% highlight shell %} npm install imask {% endhighlight %}And import or require:
{% highlight shell %} import IMask from 'imask'; {% endhighlight %}or use CDN:
{% highlight html %} {% endhighlight %}Simple use case:
IMask consists of two independent layers: model and view.
Model layer contains all masking facilities which can be used independently without UI.
View layer is a glue between UI element and model, it connects listeners and controls changes in both directions.
Input processing is based on a simple idea of comparing states before and after change. State before change is obtained on keydown
and on input
actual processing takes place. In order to support older browsers manually call _saveSelection
to save state and _onInput
to handle changes. Pull requests for the beauty are welcomed.
Currently, view layer contains only one component InputMask
which supports HTML input-like API. Instance of InputMask
is returned when IMask constructor is called.
To create new mask on element use:
{% highlight javascript %} const mask = IMask(element, maskOptions); {% endhighlight %}Get/set value and unmasked value:
{% highlight javascript %} mask.value = '+7(999)999-99-99'; console.log(mask.value); // '+7(999)999-99-99' console.log(mask.unmaskedValue); // '79999999999' mask.unmaskedValue = '70000000000'; console.log(mask.value); // '+7(000)000-00-00' console.log(mask.unmaskedValue); // '70000000000' {% endhighlight %}For typed masks like Number
or Date
it is possible to work with typed values:
For untyped masks typedValue
and unmaskedValue
works identically.
Update options:
{% highlight javascript %} mask.updateOptions({ mask: Number, min: 0, max: 100 }); // also updates UI {% endhighlight %}Clean and destroy:
{% highlight javascript %} mask.destroy(); {% endhighlight %}Listen to events:
{% highlight javascript %} const log = () => console.log(mask.value); // 'accept' event fired on input when mask value has changed mask.on('accept', log); // 'complete' event fired when the value is completely filled // Note: this makes sense only for Pattern-based masks mask.on('complete', () => console.log(mask.value)); {% endhighlight %}Stop listening to events:
{% highlight javascript %} mask.off('accept', log); // omit handler argument to unbind all handlers mask.off('complete'); {% endhighlight %}Get Masked
model:
In the above example all changes are proxied to the model layer first and then UI is updated. The core of masking on model layer is IMask.Masked base class.
There are also several other model classes for the different mask
property types that provide additional functionality:
mask prop |
Model class |
|---|---|
IMask.Masked descendant or instance |
IMask.Masked |
RegExp |
IMask.MaskedRegExp |
Function |
IMask.MaskedFunction |
String |
IMask.MaskedPattern |
Number |
IMask.MaskedNumber |
Date |
IMask.MaskedDate |
Array of masks |
IMask.MaskedDynamic |
Mask also can be used without UI, e.g.
{% highlight javascript %} const masked = IMask.createMask({ mask: '+7 (000) 000-00-00', // ...and other options }); masked.resolve('71234567890'); // now you can access masked value console.log(masked.value); // and get unmasked value console.log(masked.unmaskedValue); {% endhighlight %}Masked
Common Behavior
IMask.Masked is a base class of all other Masked*
classes. Almost all base class options are applicable to subclasses.
Example usage:
Update options:
{% highlight javascript %} mask.updateOptions({ // while changing mask only same type allowed mask: /^\w+$/, // ok // mask: "0000", // ERROR! changing mask type on existing mask is not allowed! // ... other options }); {% endhighlight %}Get/set value and unmasked value:
{% highlight javascript %} masked.value = 'hello world!'; console.log(masked.unmaskedValue); // or typed value if it makes sense console.log(masked.typedValue); {% endhighlight %}Use prepare (value, masked)
or prepareChar (value, masked)
option for preprocessing input and commit (value, masked)
option for postprocessing after UI is deactivated:
The difference between prepare
and prepareChar
is that when inserting multiple symbols in a batch prepare
is called once for the entire string and prepareChar
is called for each symbol.
Usually you don't need to create instances of that type manually, because it will be done by IMask internally. But you can subclass from Masked
to add some specific behavior.
Additionaly to mask
option custom validator can be set as validate (value, masked)
option for some complex checks on any mask types excluding Function
and RegExp
, because they are already validators themselves.
Note: do not mutate Masked
instance inside callbacks.
Example of using Function
mask to accept any growing sequence from 0 to 9:
Overwrite Mode since 5.0
Enables characters overwriting (replace or shift) instead of inserting.
Skip Invalid Mode since 6.5.0
Enables skipping invalid characters (default is true).
Number Mask
Number mask restricts input to integer or decimal numbers in many ways:
Pattern Mask
Use pattern when:- mask is complex or contains nested masks
- mask is fixed in size (optional symbols can provide some flexibility)
- placeholder is needed
- more reliability or flexibility on processing input is needed
Pattern mask is just a string:
0
- any digita
- any letter*
- any char- other chars which is not in custom definitions supposed to be fixed
[]
- make input optional{}
- include fixed part in unmasked value`
- prevent symbols shift back
If definition character should be treated as fixed it should be escaped by \\
(E.g. \\0
).
Additionally you can provide custom definitions
:
To configure placeholder use:
Secure text entry since 6.6.0:
For complex nested masks there is blocks
option available:
Expose block value since 7.1.0
Block value can be exposed using the expose
option on one of the blocks:
Lazy Mode
Eager Mode since 6.3.0
Range Mask
Range mask extends Pattern mask and can be used to restrict input in a number range.
Unlike Number mask Range mask is fixed in size, accepts only integer values but can use placeholder.
Autofix Mode
Enum Mask
Enum mask extends Pattern mask and can be used to restrict input within characters enum.
Date Mask
Date mask extends Pattern mask with more options.
It is easy to use it with Moment.js:
Dynamic Mask
Dynamic mask automatically selects appropriate mask from provided array of masks. Mask with the largest number of fitting characters is selected considering provided masks order.
It is also possible to select mask manually via dispatch
option:
Expose mask value since 7.1.0
Nested mask value can be exposed using the expose
option on one of the masks:
Pipe since 6.0
Since v6.0.0 IMask
can be used for formatting or converting values through mask with pipe
and createPipe
routines:
By default pipe
expects masked value on input and produces masked input as well. This behavior is exactly the same as if a value was pasted in input.
Pipe also provides a way to customize source and destination types:
{% highlight javascript %} // pipe(value, mask|masked, sourcetype, destinationtype); // PIPE_TYPE = {TYPED, MASKED, UNMASKED} // converts formated string to number IMask.pipe( '1,01', { mask: Number, scale: 2, thousandsSeparator: ' ', normalizeZeros: true, padFractionalZeros: true, }, IMask.PIPE_TYPE.MASKED, IMask.PIPE_TYPE.TYPED ); // 1.01 of number type {% endhighlight %}Angular plugin provides IMaskPipe
for convinience.
Advanced
Treeshaking since 6.0
IMask
contains a lot of cool features, which makes it pretty big in size. But you might not need all features and want to reduce your bundle size. Since v6.0.0 IMask
provides such possibility and ships chunks along side with assembled bundle. Despite mask has been already support esm modules treeshaking did not work on it because of recursive masks and therefore circular dependencies inside. So now you can import only features that you want, for instance if only number mask is used:


Cloud Computing&Privacy Protection
Cloud Computing
Three basic service models:
- Infrastructure-as-a-Service (IaaS)
- Platform-as-a-Service (PaaS)
- Software-as-a-Service (SaaS)
Three basic deployment models:
- Public Cloud
- Private Cloud
- Hybrid Cloud
Cloud Computing (cont.)
Major Benefits:
- reduce capital cost (CAPEX -> OPEX)
- focus on core business
- access from anywhere
- divest infrastructure management
- enterprise technology
Issues:
- security / privacy
- compliance
- legal
Cloud Computing - Security Concerns
Security vs. Privacy
- Security - overall information protection
- Privacy - individual information governance
- Cloud Computing & Security - meet very well
- Cloud Computing & Privacy - contradictory
Privacy is the issue!
- Business information
- Personal information
Encryption is one of the most effective data protection techniques.
- Security - Data at Rest Encryption, Data in Transit Encryption
- Privacy - Data in Use Encryption
Data Encryption & Privacy Preserving
Challenges:
- Data Storage/Sharing & Privacy preserving
- Cloud Computing technology integration
- Decentralized Identity Management
- Multi-trusted domain model
Proposed model
Identity-Based Encryption & Identity Management
- Identity-Based Key Generator + OAuth/OpenID Connect Identity-Based Encryption - no passwords, no certificates, e-mail address
- Identity provider + OAuth/OpenID Connect OAuth - open standard for authorization OpenID Connect - decentralized and secure authentication system
- Client-side zero-knowledge encryption Cloud data storage provider has zero knowledge of the encryption keys Key generator has zero knowledge of users' data
Identity-Based Encryption is as strong as Identity Management itself!
Business model I.
Business model II.
Technology
Architecture based on standards
- NIST SHA-256, AES-256, CTR-DRBG-256
- OpenSSL FIPS 140-2 validated
- OAuth 2.0 Identity Provider
- OpenID Connect Provider
Pros
- usability (no passwords, no certificates), lost key prevention
- no certificates management (creation, storage, distribution, revocation)
- IBE like features, key escrow/fair encryption, no need for receiver's public key before encryption
- no IBE revocation problem (online service)
Cons
- online service
- master key security
Opportunities
- Data Storage / Sharing
- Health Records / Medical Data Sharing
- Big Data
- Data Boxes
- Databases
- Reporting / Business Intelligence
- Management Information System
- eForms / Workflow
- Document Management / Workflow
- Internet of Things
Featured links
/
#


20 photographs of the week
by Jim PowellBushfires in New South Wales, protests in Chile and Iraq, escalating violence in Hong Kong and floods in Venice – the best photography in news, culture and sport from around the world this week
Hong Kong
A man reacts as he tries to extinguish a burning Christmas tree at the Festival Walk mall in Kowloon Tong.
Photograph: Thomas Peter/Reuters
Hong Kong
Riot police detain two men in the central district of Hong Kong. A policeman shot a masked protester in the torso this week, igniting clashes across the city as crowds took to the streets to block roads and hurl insults at officers.
Photograph: Dale de la Rey/AFP/Getty Images
Hong Kong
Pro-democracy protesters stand on a bridge over the Tolo highway as they gather at the Chinese University of Hong Kong. Demonstrators stepped up their campaign of road blocks and vandalism, crippling the international financial hub this week and igniting some of the worst violence in five months of unrest.
Photograph: Philip Fong/AFP/Getty Images
La Paz, Bolivia
A woman cries in front of soldiers during a march by supporters of former president Evo Morales in downtown La Paz. Morales resigned this week after massive nationwide protests over suspected vote-rigging in an election in which he claimed to have won a fourth term in office.
Photograph: Natacha Pisarenko/AP
Washington, DC
Members of the press gather in the hallway of the Longworth House office building during the first public impeachment hearing before the House intelligence committee on Capitol Hill. House democrats are trying to build a case that President Donald Trump committed extortion, bribery or coercion by trying to enlist Ukraine to investigate political rival Joe Biden in exchange for military aid.
Photograph: Sarah Silbiger/Getty Images
Colo Heights, Australia
Fire and rescue officers watch the Gospers Mountain fire near Colo Heights in New South Wales. A fresh emergency warning was issued at the end of this week for a fast-moving fire, as hot, dry and windy conditions returned to bushfire-hit areas of New South Wales.
Photograph: Dan Himbrechts/EPA
Coffs Harbour, Australia
Sharnie Moren and her 18-month-old daughter Charlotte look on as thick smoke rises from bushfires. Three people have reportedly been killed, five are missing and 150 homes have been destroyed as more than 80 bushfires are burning uncontrolled around New South Wales.
Photograph: Dan Peled/AAP/Reuters
Venice
A woman sits in a chair in a flooded St Mark’s Square. The high-water mark hit 187cm in Venice this week, meaning more than 85% of the city was flooded. The highest level ever recorded was 194cm during the infamous flooding of 1966.
 It was painted by Argentinian muralist Andres Iglesias, who is also known as Cobre.
Photograph: John G Mabanglo/EPA
Santiago, Chile
A Chilean police officer fires teargas at anti-government demonstrators during a protest in Santiago. Students began protesting nearly a month ago over a rise in subway fares. The demonstrations have morphed into a massive protest movement demanding improvements in basic services and benefits, including pensions, health, and education.
Photograph: Esteban Félix/AP
Santiago, Chile
Anti-government protesters clash with the police during protests in Santiago. The government announced this week that it has agreed to start the process to write a new constitution for the country, one of the most repeated demands of protesters who have taken to the streets in often violent demonstrations in recent weeks.
Photograph: Esteban Félix/AP
Baghdad, Iraq
An Iraqi protester returns a teargas canister thrown by security forces during clashes in the capital’s Khallani square during anti-government demonstrations.
Photograph: Ahmad Al-Rubaye/AFP/Getty Images
Darbasiyah, Syria
Syrians throw stones towards Turkish military vehicles during a Turkish-Russian army patrol near the town of Darbasiyah along the border between Syria and Turkey.
Photograph: Delil Souleiman/AFP/Getty Images
Soweto, South Africa
A student from the Soweto rugby school academy waits before practice. The academy is one of the three rugby schools of Soweto, a black township of Johannesburg that houses more than 1.3 million people. It was founded in 2016 and welcomes some 250 students between 8 and 19 years old, of which almost 50 are girls.
Photograph: Guillem Sartorio/AFP/Getty Images
Berlin
A tourist from Greece looks through the hole in remains of the Berlin Wall after commemorations celebrating the 30th anniversary of the fall of the Berlin Wall at Bernauer Strasse.
 As the world commemorates 30 years since the fall of the Berlin Wall, the bullet-riddled sandstone walls of abandoned, crumbling homes and concrete machine gun nests in Cyprus’ no-man’s land are a reminder of Europe’s last divided country.
Photograph: Petros Karadjias/AP
Salt, Spain
Pro-Catalan independence demonstrators block a major highway in Salt. French police detained 18 pro-Catalan independence protesters and used pepper spray and batons to push back demonstrators who blocked a major highway border crossing between France and Spain for more than 24 hours.
Photograph: Joan Mateu/AP
Le Barón, Mexico
A relative reacts during the burial of Rhonita Miller and her children Howard, Kristal, Titus, and Teana, who were killed by unknown assailants. Three families were traveling in separate SUVs when they were ambushed in two separate attacks by cartel gunmen hidden in the mountains along the dirt road. As a result, three women and six children died. All family members had dual Mexican-American citizenship and belonged to a Mormon offshoot group not affiliated with The Church of Jesus Christ of Latter-day Saints.
Photograph: José Luis González/Reuters
Bangkok, Thailand
People place krathongs, or floating baskets, in a pond to mark the annual Loy Krathong festival in Bangkok. Loy Krathong takes place on the evening of the full moon of the 12th month in the traditional Thai calendar.
Photograph: Lillian Suwanrumpha/AFP/Getty Images
Fort William, Scotland
Current servicemen and veterans gather at the Commando Memorial at Spean Bridge for the annual Remembrance Sunday ceremony.
Photograph: Jane Barlow/PA


--- title: EBSD sidebar: function_reference_sidebar permalink: EBSD.EBSD.html folder: function_reference toc: false ---
class representing EBSD measurements
In MTEX a variable of type EBSD
is used to store EBSD measurements as a table with rows containing the orientation, the spatial coordinates and the phase of each indiviudal measurement.
| rot | rotation |
| phaseId | phase as index to CSList |
| CS1,CS2,CS3 | crystalSymmetry |
| prop | struct with properties, xy is mandatory |
| unitCell | vertices a single pixel |
| phase | specifing the phase of the EBSD object |
| options | struct with fields holding properties for each orientation |
| xy | spatial coordinates n x 2, where n is the number of input orientations |
| unitCell | for internal use |
| id | unique id of each pixel |
| CSList | cell list of crystalSymmetry |
| phaseId | phase of each pixel as entry of CSList |
| phase | phase of each pixel as imported |
| phaseMap | convert between phase = phaseMap(phaseId) |
| rotations | rotation of each pixel |
| x, y | coordinates of the center of each pixel |
| scanUnit | unit of the x,y coordinates (um is default) |
| prop | auxilary properties, e.g., MAD, BC, mis2mean |
| isIndexed | is pixel indexed or not |
| indexedPhaseId | phaseIds of all indexed phases |
| EBSDsquare | EBSD data measured on a square grid |
| EBSDhex | EBSD data measured on a hex grid |


Weight Setting for Individuals
weight name
agg_trend
all_slope
angle
subgroup_slope
subgroup_trend
Weight Setting for Views
weight name
agg_trend
SP_subgroups
all_slope
gby_counts
angle
Sum
Mean
portions
subgroup_slope
Sum
Mean
AutoDetect
subgroup_trend
Sum
Mean
Ranked Views
Weight Setting for Individuals
weight name
agg_rate
all_slope
distance
subgroup_slope
subgroup_rate
Weight Setting for Views
weight name
agg_rate
SP_subgroups
all_slope
gby_counts
distance
Sum
Mean
portions
subgroup_slope
Sum
Mean
AutoDetect
subgroup_rate
Sum
Mean
Ranked Views


>From Mr. Barry Henry Outer Circle Regents Park NW3 4RY London Good Day, Please accept my sincere apologizes if my email does not meet your business or personal ethics. I will first introduce myself as Mr. Barry Henry, a staff in the Private Clients Section of a well-known bank, here in London, England. One of our accounts, with holding balance of £15,000,000 (Fifteen Million Pounds Sterling) has been dormant and last operated three years ago. From my investigations and confirmation, the owner of the said account, a foreigner by name John Shumejda died on the 4th of January 2002 in a plane crash in Birmingham; you can view this CNN website http://edition.cnn. com/2002/WORLD/europe/01/04/england.plane/ for details on the crash. Since then, nobody has done anything as regards the claiming of this money, as he has no family member that has any knowledge as to the existence of either the account or the funds; and also Information from the National Immigration also states that he was single on entry into the UK. I have confidently discussed this issue with some of the bank officials and we have agreed to find a reliable foreign partner to deal with. We therefore propose to do business with you, standing in as the next of kin of these funds from the deceased and funds released to you after necessary processes have been followed. This transaction is totally free of risk and troubles as the fund is legitimate and does not originate from drug, money laundry, terrorism or any other illegal act. On your interest, let me hear from you. Warm Regards, Mr. Barry Henry. Phone Number: +447024078659 Fax Number: +448704792418


Replay Protection
will be implemented to prevent your transactions from being executed on the Bitcoin (BTC) main chain whilst using your fork balance on Bitcoin Origin.
2 MB Segwit
will be implemented to support our decision to grow and expand the Bitcoin Origin network beyond the capabilities of Bitcoin (BTC).
A hardfork is simply a chain split, whereby Bitcoin’s (BTC) main chain will be split to create a new chain, Bitcoin Origin. Bitcoin’s (BTC) main chain will remain unaltered, where as the newly created chain will be updated with protocol changes. These new rules will be enforced by the miners that join and secure the new Bitcoin Origin chain.
CloseWe believe that Bitcoin Origin will help evolve the current Bitcoin project with much needed changes to keep the chain alive and secure. We propose changes that will not be implemented by Bitcoin (BTC) in the forceable future, which marks our decision to split from Bitcoin’s (BTC) chain. It is very important that governance is maintained by the votes of the people. With our proposal, we hope that the project gains support and a positive outlook on decentralized democracy.
CloseThe proposed hardfork will take place on the 1st of September 2018, around 3 PM UTC. The details on the specific fork block will be released nearer the time.
CloseNote: please make sure that you keep your Bitcoins (BTC) secured in paper wallet which YOU have the private keys for. If you currently own Bitcoins (BTC) and have them secured in a paper wallet, then you don’t need to do anything. If your Bitcoins are in an exchange, make sure to withdraw them to a paper wallet before the 1st of September 2018.
CloseIf you are interested in contributing to Bitcoin Origin, come join our Telegram group and express your interest in supporting the project in the way that you can, whether it is development, setting up mining pools or marketing the Bitcoin Origin brand. We will be looking to hire talent from around the world and are planning to activate a bounty program so stay alert for more updates. Any profession is welcome. Any contribution is appreciated. Come and have a chat with us!
Close


Weebbon is a pro-active grassroots fundraising agency that helps sustain organizations and causes through functional merchandises.
Our Mission
We exist to help sustain organizations and their causes through functional merchandises specializing in grassroots movements primarily through social media under long-term partnerships.
How It Works
Our Business Model.
-
We Listen For Your Organization's Message And Needs.
What do you stand for? Do you want to help donate to an organization? Or are you an organization that needs a little boost? We're interested with your ideas and we'd love to get them out there. We'd like to hear your message, where you want it to go, to whom you want to tell it — and most importantly, who you want to help with it. We're all ears.
-
We Conceptualize, Make And Sell Products With It.
Everybody loves t-shirts, so we'll put your message beautfully and communicate them like no other can. But why stop there? We can also place them on notebooks, mugs, etc. — on anything we think your target audience would buy. Then, we take care of getting all of them sold and making sure people know about your message.
-
We Help Keep Your Organization Running. And Your Message, Talking.
At the end of the day, we earn from the project. We split the profit. You take yours to to fund your projects. We take ours so we can do it for you again... and again... and again, — so you can fund your projects again… and again… and again.
What We Can Help You With
Our Skills. Our Tools. Your Cause.
-
Short-Term Fundraising
We believe a viable alternative way of raising funds for your organization is through selling items and using the proceeds to fund your organization's projects and activities. We can help you with that by providing the complete package for you to get it running: from design conceptualization, product production, basic online distribution and promotion strategies and even after-sales services through online channels.
-
Long-Term Income-Generating Business
We can provide a starting point for a sustainable and long-term income generating model for your organization so you won't keep on having to execute fundraisers just whenever you'd see the need. The best part of all: all of this will be hosted under our infrastructure using our resources and network so you can focus on running your organization — and not on running the business.
-
Digital Marketing Assistance
Driving awareness to what your organization stands for need not be expensive. There are many digital tools like video, web, and the social media that would suddenly allow everybody to spread word at minimal cost. Being avid digital media consumers ourselves, we can give your organization easy-to-execute, practical, and street-smart advice and assistance to make the most out of them so more people will hear your message and engage with your organization.
-
Creative and Multimedia Services
From logos, stationeries, promotional literature, to entire visual identity systems that most organizations would need to bring about a cohesive and compelling visual representation to their key audiences, to digital medums such as videos, mobile and desktop websites, and audio production, our love and care for what we do rubs off on everything that we work on. Our work for your organization will be no exception.


Magick
Reality may seem like a solid wall to bounce your head against, but it’s true nature is far more malleable then that. There are some few people who’ve awakened to this and with their Will can affect changes in reality. We call this Magick.
Spheres
Mysticks traditionally parcel all of reality into nine spheres to facilitate their studies. Each sphere represents your understanding of some facet of reality and your ability to manipulate it.
- Correspondence
- space, places, and relations between things
- the distance, real or metaphorical, between you and the target of your spell is a correspondence effect
- Conjuration, Scrying, Gates, Warding, Teleportation
- Entropy
- decay, chaos, and probability
- Forces
- elemental energies: fire, ice, gravity
- Life
- things that live
- Matter
- things that do not live
- Mind
- sapience
- Prime
- primordial energies of reality
- how long your spell will last is an effect of Prime.
- Spirit
- Other worlds and their entities.
- Time
- Perception and flow of temporal reality.


| Name |
Cost |
Services |
File Access Method |
Users # |
| @Backup |
30 day free trial period, $100 per year for 100Mb |
secure file storage, document collaboration and remote file access, protect up to 500 megabytes, can backup files from Quicken, TurboTax and Office apps, can right-click to backup. |
Web based, Client software: Yes |
N/A |
| 3WCorp |
25Mb for $6.95, 1Gb for $24.95, no free trial |
3W|Manager (account management tool), 3W|Drive (advanced desktop integration software for MS Windows 9x), file storage, Always-available technical support through 3W|ClientCare. |
Web based, FTP: Yes |
N/A |
| backup my files |
free |
25MB of storage space, file sharing |
Web based |
N/A |
| bigVAULT |
100 Mb for $36.00/year |
file storage,
collaboration, unlimited vault size, date time visitor access,
multiple file upload, vault mail |
Web based |
N/A |
| Bravenet Free Drive |
free |
50Mb of storage space, file sharing |
Web based |
N/A |
| DocSpace |
25Mb free, $10/mo for 100Mb, $25 for 250Mb |
online storage, virtual workspace for collaboration on files, business tool for monitoring and managing Critical Path accounts |
Web based |
April 2000 - more than 55 million end-users |
| e24/7 |
free |
100Mb of storage space, ability to transfer files up to 25 Mb, file sharing, Consolidating
Email Accounts, address book, bulk filter, block sender, custom email lists, custom signatures
|
Web based |
N/A |
| e-ttach |
10Mb Free, 100Mb - $54.95 for 6 months and $99.95 for 1 year. |
online storage, file transfer |
TeamDrive, Web based |
N/A |
| File Monkey |
free |
10Mb of storage space |
Web based |
N/A |
| Files Anywhere |
100Mb - $3.95/mo, $42/year, 2000Mb - $34.95/mo, $369/year |
online storage |
WebDAV: No FTP: No Client software: No |
N/A |
| FreeBack |
free |
10Mb of compressed disk space, two types of software (Java and HTML) to work with files, reminder, email |
Web based |
N/A |
| Free Drive |
free |
50Mb of storage space, creating photo albums |
WebDAV: No, FTP: No, Client software: No |
N/A |
| IBackup |
Up to 100 MB - $5/Month Up to 100 GB - $800/Month |
online storage, file sharing, wireless Palm PDA support |
TeamDrive, Web based, FTP, wireless access through Palm VII or a WAP enabled phone |
N/A |
| Globedesk.com |
50Mb - free trial account, 100Mb - $4.95/m, 200Mb - $9.95/m, 500Mb - $19.95/m |
online storage, file sharing, multiple file upload, customization themes |
Web based, FTP: Yes |
N/A |
| iDrive |
free |
50Mb of storage space, playlist for MP3 musics, creating photo albums |
WebDAV: Yes, FTP: No |
January 2000 - 1.5 million+ registered accounts |
| KTurn |
free |
125Mb of storage space, file sharing |
Web based |
N/A |
| MediaDepot.com |
30 Mb free There are also Customized Solutions and Enterprise Solutions. |
online storage, file sharing.
Additional storage and services, such as watermarking, time
stamping and eMedia-IT's content insurance policy, Insure-IT,
are also offered as part of MediaDepot.com's Optional Services
package. |
TeamDrive, Web based |
N/A |
| Middlewire |
$75 a month per corporate account |
file size transfer up to 2GB, 1GB to 1 TB storage space,
file expiration and file management options, media file streaming,
automatic receipt notification via e-mail or wireless handheld devices, including cell phone and pager.
|
Web based |
N/A |
| My Docs Online |
20 MB free 50 Mb/3 months $9.95 300 Mb/1 year $84.95 |
file storage, file sharing, wireless Palm PDA support, Office 2000 support |
TeamDrive: Yes WebDAV: Yes FTP: No Client software: No |
users in over 40 countries |
| My Free Desk |
free |
50Mb of storage space, word processor, spreadsheet, presentation program, database, email manager and Web page editor |
WebDAV: No, FTP: No, Client software: Yes, file-sharing software |
N/A |
| My Space |
25MB free, 300Mb free if users provide personal information and accept e-mail offerings |
online storage, file sharing, backing up files, access to your stored files from any PC, Mac, PDA, Handheld or Linux computer |
WebDAV: No, FTP: No, Client software: Yes, impl. as a namespace (HTTP) |
N/A |
| NetFloppy |
free |
3Mb of storage space, email |
Web based |
N/A |
| portableoffice.com |
free |
4Mb of storage space and 5Mb of mailbox space |
Web based |
N/A |
| Punch WebGroups |
10Mb free for up to 2 WebGroups, 100Mb - $9.95/mo for up to 10 WebGroups and $19.9/mo for unlimited number of WebGroups, Additional storage: $15/mo per 100Mb |
online storage, auto version tracking, file check-in/check-out, file access controls, member tracking/audit trails, change notification |
WebDAV: No, FTP: No, Client software: Yes |
N/A |
| Sharemation |
first 20Mb free |
online storage, file sharing, multiple access methods, security, file versioning, locking, directory quotas, WebDav support, internationalization, logging |
Web based, WebDAV: Yes |
N/A |
| Storage Point |
30-day free trial (50Mb), 50Mb - $12.95/mo, $103.60/year, 1GB - $129.90/mo, $1039.20/year |
online storage, file sharing, calendar, email, contact manager |
WebDAV: No, FTP: No, Client software: Yes |
N/A |
| SwapDrive |
free |
25Mb of storage space, file sharing |
Web based |
N/A |
| Xdrive |
free |
up to 100Mb of storage space, file sharing and management |
TeamDrive, WebDAV: No, FTP: No, Client software: Yes |
March 2000 - 1.000.000+ active, registered members |
| Yahoo Briefcase |
free |
15Mb of storage space, file sharing, photo albums |
WebDAV: No, FTP: No, Client software: No |
N/A |


It's Personal, express yourself with pictures or word.. Ready to start writing? Sign up now!
Keep a journal of your daily activities, your travel, exercise, diet, or thoughts and prayers.
Designed to focus on privacy, your entries are totally private by default!.
Custom email reminders help you make sure you never forget to write.
Make each journal your own with custom covers, backgrounds, and fonts..


🍪CookieMailer
To:
Test Email (SysAdmin)
Test Email (Organizers)
All Participants ({{NUM_HACKERS}})
Subject:
Message
Best,
GoatHacks Team
hack@wpi.edu


The paper presents a generalized framework for graph clustering (clusters of network motifs) on the basis of higher-order connectivity patterns.
Given a motif M, the framework aims to find a cluster of the set of nodes S such that nodes of S participate in many instances of M and avoid cutting instances of M (that is only a subset of nodes in instances of M appears in S).
Mathematically, the aim is to minimise the motif conductance metric given as cutM(S, S’) / min[volM(S), volM(S’)] where S’ is complement of S, cutM(S, S’) = number of instances of M which have atleast one node from both S and S’ and volM(S) = Number of nodes in instances of M that belong only to S.
Solving the above equation is computationally infeasible and an approximate solution is proposed using eigenvalues and matrices.
The approximate solution is easy to implement, efficient and guaranteed to find clusters that are at most a quadratic factor away from the optimal.
Given the network and motif M, form a motif adjacency matrix WM where WM(i, j) is the number of instances of M that contains i and j.
Compute spectral ordering of the nodes from normalized motif laplacian matrix.
Compute prefix set of spectral ordering with small motif conductance.
Applicable to directed, undirected and weighted graphs (allows for negative edge weights as well).
In case the motif is not known beforehand, the framework can be used to compute significant motifs.
The proposed framework unifies the two fundamental tools of network science (motif analysis and network partitioning) along with some worst-case guarantees for the approximations employed and can be extended to identify higher order modular organization of networks.


Homely is a tool to source donations of household goods for new refugees in New Zealand
This map displays the placement of refugees accross the country.
It reflects the quality of data available at immigration.govt.nz
Homely is a tool to source donations of household goods for new refugees in New Zealand
This map displays the placement of refugees accross the country.
It reflects the quality of data available at immigration.govt.nz


--- layout: session academic: true title: "Meet an OpenStreetMapper" code: "VANVBY" speaker_names_with_affiliations: ['Gregory Marler'] extra_tags: room: "Großer Hörsaal" length: "00:20" time: "Sunday, 11:30" recording: True ---
We've learnt about many projects and clever systems that run OpenStreetMap possible, but it's the individuals that are most valuable in what we do. Settle down in your seats as Gregory introduces you to a selection of OSMers and informally chats to them about their involvement. When, how, and why did they join OSM? What do they do in the project? Has that changed? What's their favourite map tag? All these questions and more will potentially be asked.
Come to the talk to find out which OpenStreetMappers we will be having a conversation with. Gregory held back from joining until he met some OSM guys in the UK in 2006. You may have seen him shout "Maps" on the stage, but he really enjoys chatting to people in the breaks. If it's your first time or you've got every SotM t-shirt that exists, do find him and say hello.


{% extends "page.html" %} {% block page_content %}
Choose the file you would like to analyze (.csv or Excel only)


You can load the script asynchronously.
In this case, you have to add a callback function, as shown in the example from the Google Maps JS API docs:
When the script is loaded, it will search a global function, named here initMap
, to execute it.
In the scope of this function, the google.maps
object will be available.


lcd160cr
— control of LCD160CR display¶
This module provides control of the MicroPython LCD160CR display.
Further resources are available via the following links:
LCD160CRv1.0 reference manual (100KiB PDF)
LCD160CRv1.0 schematics (1.6MiB PDF)
class LCD160CR¶
The LCD160CR class provides an interface to the display. Create an instance of this class and use its methods to draw to the LCD and get the status of the touch panel.
For example:
import lcd160cr
lcd = lcd160cr.LCD160CR('X')
lcd.set_orient(lcd160cr.PORTRAIT)
lcd.set_pos(0, 0)
lcd.set_text_color(lcd.rgb(255, 0, 0), lcd.rgb(0, 0, 0))
lcd.set_font(1)
lcd.write('Hello MicroPython!')
print('touch:', lcd.get_touch())
Constructors¶
-
class
lcd160cr.
LCD160CR
(connect=None, *, pwr=None, i2c=None, spi=None, i2c_addr=98)¶ Construct an LCD160CR object. The parameters are:
connect is a string specifying the physical connection of the LCD display to the board; valid values are “X”, “Y”, “XY”, “YX”. Use “X” when the display is connected to a pyboard in the X-skin position, and “Y” when connected in the Y-skin position. “XY” and “YX” are used when the display is connected to the right or left side of the pyboard, respectively.
pwr is a Pin object connected to the LCD’s power/enabled pin.
i2c is an I2C object connected to the LCD’s I2C interface.
spi is an SPI object connected to the LCD’s SPI interface.
i2c_addr is the I2C address of the display.
One must specify either a valid connect or all of pwr, i2c and spi. If a valid connect is given then any of pwr, i2c or spi which are not passed as parameters (i.e. they are
None
) will be created based on the value of connect. This allows to override the default interface to the display if needed.The default values are:
“X” is for the X-skin and uses:
pwr=Pin("X4")
,i2c=I2C("X")
,spi=SPI("X")
“Y” is for the Y-skin and uses:
pwr=Pin("Y4")
,i2c=I2C("Y")
,spi=SPI("Y")
“XY” is for the right-side and uses:
pwr=Pin("X4")
,i2c=I2C("Y")
,spi=SPI("X")
“YX” is for the left-side and uses:
pwr=Pin("Y4")
,i2c=I2C("X")
,spi=SPI("Y")
See this image for how the display can be connected to the pyboard.
Static methods¶
-
static
LCD160CR.
rgb
(r, g, b)¶ Return a 16-bit integer representing the given rgb color values. The 16-bit value can be used to set the font color (see
LCD160CR.set_text_color()
) pen color (seeLCD160CR.set_pen()
) and draw individual pixels.
-
LCD160CR.clip_line(data, w, h):
Clip the given line data. This is for internal use.
Instance members¶
The following instance members are publicly accessible.
-
LCD160CR.
w
¶
-
LCD160CR.
h
¶ The width and height of the display, respectively, in pixels. These members are updated when calling
LCD160CR.set_orient()
and should be considered read-only.
Setup commands¶
-
LCD160CR.
set_power
(on)¶ Turn the display on or off, depending on the given value of on: 0 or
False
will turn the display off, and 1 orTrue
will turn it on.
-
LCD160CR.
set_orient
(orient)¶ Set the orientation of the display. The orient parameter can be one of PORTRAIT, LANDSCAPE, PORTRAIT_UPSIDEDOWN, LANDSCAPE_UPSIDEDOWN.
-
LCD160CR.
set_brightness
(value)¶ Set the brightness of the display, between 0 and 31.
-
LCD160CR.
set_i2c_addr
(addr)¶ Set the I2C address of the display. The addr value must have the lower 2 bits cleared.
-
LCD160CR.
set_uart_baudrate
(baudrate)¶ Set the baudrate of the UART interface.
-
LCD160CR.
set_startup_deco
(value)¶ Set the start-up decoration of the display. The value parameter can be a logical or of STARTUP_DECO_NONE, STARTUP_DECO_MLOGO, STARTUP_DECO_INFO.
-
LCD160CR.
save_to_flash
()¶ Save the following parameters to flash so they persist on restart and power up: initial decoration, orientation, brightness, UART baud rate, I2C address.
Pixel access methods¶
The following methods manipulate individual pixels on the display.
-
LCD160CR.
set_pixel
(x, y, c)¶ Set the specified pixel to the given color. The color should be a 16-bit integer and can be created by
LCD160CR.rgb()
.
-
LCD160CR.
get_pixel
(x, y)¶ Get the 16-bit value of the specified pixel.
-
LCD160CR.
get_line
(x, y, buf)¶ Low-level method to get a line of pixels into the given buffer. To read n pixels buf should be 2*n+1 bytes in length. The first byte is a dummy byte and should be ignored, and subsequent bytes represent the pixels in the line starting at coordinate (x, y).
-
LCD160CR.
screen_dump
(buf, x=0, y=0, w=None, h=None)¶ Dump the contents of the screen to the given buffer. The parameters x and y specify the starting coordinate, and w and h the size of the region. If w or h are
None
then they will take on their maximum values, set by the size of the screen minus the given x and y values. buf should be large enough to hold2*w*h
bytes. If it’s smaller then only the initial horizontal lines will be stored.
-
LCD160CR.
screen_load
(buf)¶ Load the entire screen from the given buffer.
Drawing text¶
To draw text one sets the position, color and font, and then uses LCD160CR.write to draw the text.
-
LCD160CR.
set_pos
(x, y)¶ Set the position for text output using
LCD160CR.write()
. The position is the upper-left corner of the text.
-
LCD160CR.
set_text_color
(fg, bg)¶ Set the foreground and background color of the text.
-
LCD160CR.
set_font
(font, scale=0, bold=0, trans=0, scroll=0)¶ Set the font for the text. Subsequent calls to write will use the newly configured font. The parameters are:
font is the font family to use, valid values are 0, 1, 2, 3.
scale is a scaling value for each character pixel, where the pixels are drawn as a square with side length equal to scale + 1. The value can be between 0 and 63.
bold controls the number of pixels to overdraw each character pixel, making a bold effect. The lower 2 bits of bold are the number of pixels to overdraw in the horizontal direction, and the next 2 bits are for the vertical direction. For example, a bold value of 5 will overdraw 1 pixel in both the horizontal and vertical directions.
trans can be either 0 or 1 and if set to 1 the characters will be drawn with a transparent background.
scroll can be either 0 or 1 and if set to 1 the display will do a soft scroll if the text moves to the next line.
-
LCD160CR.
write
(s)¶ Write text to the display, using the current position, color and font. As text is written the position is automatically incremented. The display supports basic VT100 control codes such as newline and backspace.
Drawing primitive shapes¶
Primitive drawing commands use a foreground and background color set by the set_pen method.
-
LCD160CR.
set_pen
(line, fill)¶ Set the line and fill color for primitive shapes.
-
LCD160CR.
erase
()¶ Erase the entire display to the pen fill color.
-
LCD160CR.
dot
(x, y)¶ Draw a single pixel at the given location using the pen line color.
-
LCD160CR.
rect
(x, y, w, h)¶
-
LCD160CR.
rect_outline
(x, y, w, h)¶
-
LCD160CR.
rect_interior
(x, y, w, h)¶ Draw a rectangle at the given location and size using the pen line color for the outline, and the pen fill color for the interior. The rect method draws the outline and interior, while the other methods just draw one or the other.
-
LCD160CR.
line
(x1, y1, x2, y2)¶ Draw a line between the given coordinates using the pen line color.
-
LCD160CR.
dot_no_clip
(x, y)¶
-
LCD160CR.
rect_no_clip
(x, y, w, h)¶
-
LCD160CR.
rect_outline_no_clip
(x, y, w, h)¶
-
LCD160CR.
rect_interior_no_clip
(x, y, w, h)¶
-
LCD160CR.
line_no_clip
(x1, y1, x2, y2)¶ These methods are as above but don’t do any clipping on the input coordinates. They are faster than the clipping versions and can be used when you know that the coordinates are within the display.
-
LCD160CR.
poly_dot
(data)¶ Draw a sequence of dots using the pen line color. The data should be a buffer of bytes, with each successive pair of bytes corresponding to coordinate pairs (x, y).
-
LCD160CR.
poly_line
(data)¶ Similar to
LCD160CR.poly_dot()
but draws lines between the dots.
Touch screen methods¶
-
LCD160CR.
touch_config
(calib=False, save=False, irq=None)¶ Configure the touch panel:
If calib is
True
then the call will trigger a touch calibration of the resistive touch sensor. This requires the user to touch various parts of the screen.If save is
True
then the touch parameters will be saved to NVRAM to persist across reset/power up.If irq is
True
then the display will be configured to pull the IRQ line low when a touch force is detected. If irq isFalse
then this feature is disabled. If irq isNone
(the default value) then no change is made to this setting.
-
LCD160CR.
is_touched
()¶ Returns a boolean:
True
if there is currently a touch force on the screen,False
otherwise.
-
LCD160CR.
get_touch
()¶ Returns a 3-tuple of: (active, x, y). If there is currently a touch force on the screen then active is 1, otherwise it is 0. The x and y values indicate the position of the current or most recent touch.
Advanced commands¶
-
LCD160CR.
set_spi_win
(x, y, w, h)¶ Set the window that SPI data is written to.
-
LCD160CR.
fast_spi
(flush=True)¶ Ready the display to accept RGB pixel data on the SPI bus, resetting the location of the first byte to go to the top-left corner of the window set by
LCD160CR.set_spi_win()
. The method returns an SPI object which can be used to write the pixel data.Pixels should be sent as 16-bit RGB values in the 5-6-5 format. The destination counter will increase as data is sent, and data can be sent in arbitrary sized chunks. Once the destination counter reaches the end of the window specified by
LCD160CR.set_spi_win()
it will wrap around to the top-left corner of that window.
-
LCD160CR.
show_framebuf
(buf)¶ Show the given buffer on the display. buf should be an array of bytes containing the 16-bit RGB values for the pixels, and they will be written to the area specified by
LCD160CR.set_spi_win()
, starting from the top-left corner.The framebuf module can be used to construct frame buffers and provides drawing primitives. Using a frame buffer will improve performance of animations when compared to drawing directly to the screen.
-
LCD160CR.
set_scroll
(on)¶ Turn scrolling on or off. This controls globally whether any window regions will scroll.
-
LCD160CR.
set_scroll_win
(win, x=-1, y=0, w=0, h=0, vec=0, pat=0, fill=0x07e0, color=0)¶ Configure a window region for scrolling:
win is the window id to configure. There are 0..7 standard windows for general purpose use. Window 8 is the text scroll window (the ticker).
x, y, w, h specify the location of the window in the display.
vec specifies the direction and speed of scroll: it is a 16-bit value of the form
0bF.ddSSSSSSSSSSSS
. dd is 0, 1, 2, 3 for +x, +y, -x, -y scrolling. F sets the speed format, with 0 meaning that the window is shifted S % 256 pixel every frame, and 1 meaning that the window is shifted 1 pixel every S frames.pat is a 16-bit pattern mask for the background.
fill is the fill color.
color is the extra color, either of the text or pattern foreground.
-
LCD160CR.
set_scroll_win_param
(win, param, value)¶ Set a single parameter of a scrolling window region:
win is the window id, 0..8.
param is the parameter number to configure, 0..7, and corresponds to the parameters in the set_scroll_win method.
value is the value to set.
-
LCD160CR.
set_scroll_buf
(s)¶ Set the string for scrolling in window 8. The parameter s must be a string with length 32 or less.
-
LCD160CR.
jpeg
(buf)¶ Display a JPEG. buf should contain the entire JPEG data. JPEG data should not include EXIF information. The following encodings are supported: Baseline DCT, Huffman coding, 8 bits per sample, 3 color components, YCbCr4:2:2. The origin of the JPEG is set by
LCD160CR.set_pos()
.
-
LCD160CR.
jpeg_start
(total_len)¶
-
LCD160CR.
jpeg_data
(buf)¶ Display a JPEG with the data split across multiple buffers. There must be a single call to jpeg_start to begin with, specifying the total number of bytes in the JPEG. Then this number of bytes must be transferred to the display using one or more calls to the jpeg_data command.
-
LCD160CR.
feed_wdt
()¶ The first call to this method will start the display’s internal watchdog timer. Subsequent calls will feed the watchdog. The timeout is roughly 30 seconds.
-
LCD160CR.
reset
()¶ Reset the display.
Constants¶
-
lcd160cr.
PORTRAIT
¶ -
lcd160cr.
LANDSCAPE
¶ -
lcd160cr.
PORTRAIT_UPSIDEDOWN
¶ -
lcd160cr.
LANDSCAPE_UPSIDEDOWN
¶ Orientations of the display, used by
LCD160CR.set_orient()
.
-
lcd160cr.
STARTUP_DECO_NONE
¶ -
lcd160cr.
STARTUP_DECO_MLOGO
¶ -
lcd160cr.
STARTUP_DECO_INFO
¶ Types of start-up decoration, can be OR’ed together, used by
LCD160CR.set_startup_deco()
.


For days now, I have been travelling all alone through the malevolent deserts of Egypt. I know what you are thinking.   I promise you, I don’t know how this happened. I was a part of a small expedition group that scoured the Saqaraa dessert looking for the "Vally of Kings." Ever since I was a kid, I always wanted to visit Egypt. I fell in love with Egyptian history while watching the mummy cartoon on Nickelodeon. If you think Greek mythology is fascinating, just wait until you hear about the mythical Egyptian Pharoah gods. And what is better than experiencing it firsthand?
We were doing our thing, walking in a horizontal pattern, trying our best not to leave a spot unexplored. And suddenly, out of the blue, a sandstorm the size of the Empire State Building rushed towards our group. Our guide suddenly starts screaming in Arabic some words I didn’t understand. My first instinct is to run away and hide behind a stone.
I hold my breath, look around me for the nearest stone and start running as fast as I can. Stupid me, thinking that a mere stone could shield this mammoth of a storm. Minutes pass by and I slowly start to think I made it, but suddenly, everything turns pitch black.
After what seemed to be a couple of hours, I wake up with the sun bleaching my body and the sand literally gnawing into my skin. I stand up and look around me, hoping to find my team.
I see no one. Literally no one.
I don’t know what to do. My body and mind are not ready for this. I start to panic and walk around in circles. Who knows, maybe God loves me today and I might come across a Bedouin tribe?
After walking a couple of hours, I stumbled upon a strange underground colossal structure. I knew it! I found a burial chamber! For a second, I forget about being stuck in a desert and just stand there, admiring the spectacular view. I tiptoe inside, making sure I don’t accidentally push or hit anything. Pharoah burial sites are well-known for having intricate death traps designed to deter intruders.
“BOOM.”
CNN: A university student got lost in the desert and stumbled upon the missing tomb of Raa king of the kings. The desert rangers have saved the student and are now exploring the burial temple
Karim, the student who got lost in the Egyptian desert, becomes an internet sensation. His Twitter post reaches 120.2M retweets and 211.2k likes
Omar, the chief Egyptologist in the Ministry of Archeology, summoned his team of brilliant experts and ordered them to relocate Raa’s tomb to the Grand National Museum in Alexandria.
Everyone was thrilled and agreed with the decision. However, Sherif, the lead Egyptologist, was concerned. If you have ever met Sherif, you would know right away why he would do that. Sherif is the kind of guy who would avoid a black cat while going back home, never saunter under any stairs, and never come close to the number 13. He is probably the most superstitious man in Egypt.
He was nervous because of the monstrous stele that was found next to Raa’s magnificent tomb.  If you are not familiar with Egyptian mythology, blood markings are placed on cursed tombs. It is said that whoever touches these markings is doomed. Nonetheless, Sherif spent hours carefully doing his magic and was able to restore the stele to its glory days. Unfortunately, it wasn’t at all good news.
“I, Raa. King of the Kings. Warrior of the Nile. Leader of the underworld.
The Chief did not listen to Sherif’s concern and aggressively demanded a hasty transport and restoration. Reluctantly, Sherif complied and worked tirelessly for weeks to fulfil his demands. Little did he or any of his team know what was going to happen.
Egypt was beaming with happiness when news of the move was made public. Raa was the only missing king from the 3rd dynasty that saved Egypt from the Meroë’s invasion. So, you can probably tell he was one of their favorite war general pharaohs.
When the ministry noticed how ecstatic the Egyptians were, they decided to
create a nationwide massive event where Raa’s body would visit every city. They
called the event “The Golden Parade.”
Thousands of Egyptians took it to the street alongside hundreds of the countries
musicians, and everyone was going crazy over Raa’s mummified body.
While everyone was celebrating, Sherif was stuck in his dark and gloomy Cairo apartment, trying to decode what, “If the lustrous sun stops shinning,” meant. “Sun stops shinning. Hmmm... Does Raa mean at night? But we moved his body weeks ago and we are all fine. Hmmm… Is this stele a lie?” “Oh God, don’t tell me…” “It’s talking about a solar eclipse.”
Sherif quickly googled when the next solar eclipse is. Surprisingly, it turns out to be in 12 days. He hastily opened his work laptop, typed out all his alarming conclusions, and sent it to everyone he knows. No one believed Sherif, but Sherif did not care. He started packing his stuff and looked for the cheapest flight out of Egypt.
ALEXANDRIA NEWS: Specialists at the museum have successfully restored Raa’s tomb and have uncovered a layer of gold below the limestone.
REUTERS: Researchers at the University of Cairo have noticed a sharp increase in the Nile's water content. They believe that on average around 10m cubic centiliters are lost on daily basis. At this rate, the Nile will lose all its water in 5 months
THE GUARDIAN: A massive container the size of the empire state building is blocking the Suez canal. Officials predict that Egypt is going to lose millions of dollars if they are unable to refloat it soon
EGYPT NEWS: A weird disease called COEGY-16 is spreading among the population. Egypt is slumbering into chaos as officials are trying to control the situation
Egypt is slumbered with unexplained chaos. Could it be the curse of Raa? Or is it just pure unexpected coincidence? The president is running out of ideas. Someone in the ministry got hold of Sherif’s report and conveyed his findings to the president’s office. In just a couple of days, the ministry contacted Sherif and begged him to come back to Egypt. They needed his expertise to help end this merciless chaos.
Despite no one listening to his constant earlier pleads and everyone labelling him as a delusional buffoon, Sherif agreed and started packing his things. It was expected. He has the genes of the pharaohs. He can’t just leave his beloved country behind.
He took the next available plane home and was greeted by the chief Egyptologist at the airport. Sherif didn’t waste a single minute and started asking questions. He wanted to catch up with all the events that happened. Really what Sherif wanted to know was how in million years he, a mere Egyptologist, could possibly end this chaos.
Sherif asked the chief: “Why did you specifically call me?”
Chief: “Everything in your report made sense. Everything you mention happened
and at this point, the president authorized me to fully support your decisions.

Sherif assured the chief that he would never do that and started brainstorming
solutions right away.
Sherif: “By any chance, did you move Raa’s body back to the burial chambers in
Saqqara?”
Chief: “Yes, we did but sadly nothing changed.”
Sherif: “Oh God... Bu-Bu-But… Th-Thi-This should’ve done it.”
Chief: “Take a couple of days to think about this. Please, please do your
magic.”
Sherif: “Alright.”
On a dark, cold, and gloomy night, while staring at the chaos happening on the streets, Sherif asked himself, What does “glorious home” mean? Is it just the place where you sleep? But then he remembered that it didn’t feel like home when he ran away and travelled, leaving his family and his loved ones behind. Then a thought popped in his head. Was Raa buried alone? He made some phone calls, and it turns out, he was right. Raa was asleep next to his beloved wife, Hatshepsut. Hatshepsut, Queen of the Nile and Raa’s one and only wife, was buried 3 meters away in a hidden room. Her body was moved to a different museum due to some bureaucratic bulls***.
Sherif sat for a couple of hours, trying to make sense of all this new information. After what seemed like a decade, he jumped out of his chair and called the chief.
Sherif: “You idiots, his home is not the temple. His home is Queen Hatshepsut.
There is no home without your loved ones.  Even after his death.
Their curse is- I mean, their love is so strong that it is not just causing the
chaos, but is going to soon destroy Egypt.
For once trust me you degene****. Listen to me. Move the queen to the arms of
her beloved. Once they feel each other’s presence, the chaos will stop, and
Egypt will live to see another day.”
References


Julia Functions¶
This document will explain how functions, method definitions, and method tables work.
Method Tables¶
Every function in Julia is a generic function. A generic function is conceptually a single
function, but consists of many definitions, or methods. The methods of a generic
function are stored in a method table.
Method tables (type MethodTable
) are associated with TypeName
s. A TypeName
describes a family of parameterized types. For example Complex{Float32}
and
Complex{Float64}
share the same Complex
type name object.
All objects in Julia are potentially callable, because every object has a type, which
in turn has a TypeName
.
Function calls¶
Given the call f(x,y)
, the following steps are performed: first, the method table
to use is accessed as typeof(f).name.mt
. Second, an argument tuple type is formed,
Tuple{typeof(f), typeof(x), typeof(y)}
. Note that the type of the function itself
is the first element. This is because the type might have parameters, and so needs to
take part in dispatch. This tuple type is looked up in the method table.
This dispatch process is performed by jl_apply_generic
, which takes two arguments:
a pointer to an array of the values f, x, and y, and the number of values (in this
case 3).
Throughout the system, there are two kinds of APIs that handle functions and argument lists: those that accept the function and arguments separately, and those that accept a single argument structure. In the first kind of API, the “arguments” part does not contain information about the function, since that is passed separately. In the second kind of API, the function is the first element of the argument structure.
For example, the following function for performing a call accepts just an args
pointer,
so the first element of the args array will be the function to call:
jl_value_t *jl_apply(jl_value_t **args, uint32_t nargs)
This entry point for the same functionality accepts the function separately, so the
args
array does not contain the function:
jl_value_t *jl_call(jl_function_t *f, jl_value_t **args, int32_t nargs);
Adding methods¶
Given the above dispatch process, conceptually all that is needed to add a new
method is (1) a tuple type, and (2) code for the body of the method.
jl_method_def
implements this operation.
jl_first_argument_datatype
is called to extract the relevant method table
from what would be the type of the first argument. This is much more complicated
than the corresponding procedure during dispatch, since the argument tuple
type might be abstract. For example, we can define:
(::Union{Foo{Int},Foo{Int8}})(x) = 0
which works since all possible matching methods would belong to the same method table.
Creating generic functions¶
Since every object is callable, nothing special is needed to create a generic
function. Therefore jl_new_generic_function
simply creates a new singleton
(0 size) subtype of Function
and returns its instance.
A function can have a mnemonic “display name” which is used in debug info and
when printing objects. For example the name of Base.sin
is sin
. By
convention, the name of the created type is the same as the function name,
with a #
prepended. So typeof(sin)
is Base.#sin
.
Closures¶
A closure is simply a callable object with field names corresponding to captured variables. For example, the following code:
function adder(x)
return y->x+y
end
is lowered to (roughly):
immutable ##1{T}
x::T
end
(_::##1)(y) = _.x + y
function adder(x)
return ##1(x)
end
Constructors¶
A constructor call is just a call to a type. The type of most types is DataType
,
so the method table for DataType
contains most constructor definitions.
One wrinkle is the fallback definition that makes all types callable via convert
:
(::Type{T}){T}(args...) = convert(T, args...)::T
In this definition the function type is abstract, which is not normally supported.
To make this work, all subtypes of Type
(Type
, TypeConstructor
, Union
, and
DataType
) currently share a method table via special arrangement.
Builtins¶
The “builtin” functions, defined in the Core
module, are:
is typeof sizeof issubtype isa typeassert throw tuple getfield setfield! fieldtype
nfields isdefined arrayref arrayset arraysize applicable invoke apply_type _apply
_expr svec
These are all singleton objects whose types are subtypes of Builtin
, which is
a subtype of Function
. Their purpose is to expose entry points in the run time
that use the “jlcall” calling convention:
jl_value_t *(jl_value_t*, jl_value_t**, uint32_t)
The method tables of builtins are empty. Instead, they have a single catch-all method
cache entry (Tuple{Vararg{Any}}
) whose jlcall fptr points to the correct function.
This is kind of a hack but works reasonably well.
Keyword arguments¶
Keyword arguments work by associating a special, hidden function object with each
method table that has definitions with keyword arguments.
This function is called the “keyword argument sorter” or “keyword sorter”, or
“kwsorter”, and is stored in the kwsorter
field of MethodTable
objects.
Every definition in the kwsorter function has the same arguments as some definition
in the normal method table, except with a single Array
argument prepended.
This array contains alternating symbols and values that represent the passed
keyword arguments.
The kwsorter’s job is to move keyword arguments into their canonical positions based
on name, plus evaluate and substite any needed default value expressions.
The result is a normal positional argument list, which is then passed to yet another
function.
The easiest way to understand the process is to look at how a keyword argument method definition is lowered. The code:
function circle(center, radius; color = black, fill::Bool = true, options...)
# draw
end
actually produces three method definitions. The first is a function that accepts all arguments (including keywords) as positional arguments, and includes the code for the method body. It has an auto-generated name:
function #circle#1(color, fill::Bool, options, circle, center, radius)
# draw
end
The second method is an ordinary definition for the original circle
function,
which handles the case where no keyword arguments are passed:
function circle(center, radius)
#circle#1(black, true, Any[], circle, center, radius)
end
This simply dispatches to the first method, passing along default values. Finally there is the kwsorter definition:
function (::Core.kwftype(typeof(circle)))(kw::Array, circle, center, radius)
options = Any[]
color = arg associated with :color, or black if not found
fill = arg associated with :fill, or true if not found
# push remaining elements of kw into options array
#circle#1(color, fill, options, circle, center, radius)
end
The front end generates code to loop over the kw
array and pick out
arguments in the right order, evaluating default expressions when
an argument is not found.
The function Core.kwftype(t)
fetches (and creates, if necessary) the
field t.name.mt.kwsorter
.
This design has the feature that call sites that don’t use keyword arguments require no special handling; everything works as if they were not part of the language at all. Call sites that do use keyword arguments are dispatched directly to the called function’s kwsorter. For example the call:
circle((0,0), 1.0, color = red; other...)
is lowered to:
kwfunc(circle)(Any[:color,red,other...], circle, (0,0), 1.0)
The unpacking procedure represented here as other...
actually
further unpacks each element of other
, expecting each one to
contain two values (a symbol and a value).
kwfunc
(also in Core
) fetches the kwsorter for the called function.
Notice that the original circle
function is passed through, to
handle closures.
Compiler efficiency issues¶
Generating a new type for every function has potentially serious consequences for compiler resource use when combined with Julia’s “specialize on all arguments by default” design. Indeed, the initial implementation of this design suffered from much longer build and test times, higher memory use, and a system image nearly 2x larger than the baseline. In a naive implementation, the problem is bad enough to make the system nearly unusable. Several significant optimizations were needed to make the design practical.
The first issue is excessive specialization of functions for different
values of function-valued arguments.
Many functions simply “pass through” an argument to somewhere else, e.g.
to another function or to a storage location.
Such functions do not need to be specialized for every closure that might be
passed in.
Fortunately this case is easy to distinguish by simply considering whether
a function calls one of its arguments (i.e. the argument appears in “head
position” somewhere).
Performance-critical higher-order functions like map
certainly call
their argument function and so will still be specialized as expected.
This optimization is implemented by recording which arguments are called
during the analyze-variables
pass in the front end.
When cache_method
sees an argument in the Function
type hierarchy
passed to a slot declared as Any
or Function
, it pretends the slot
was declared as ANY
(the “don’t specialize” hint).
This heuristic seems to be extremely effective in practice.
The next issue concerns the structure of method cache hash tables.
Empirical studies show that the vast majority of dynamically-dispatched calls
involve one or two arguments.
In turn, many of these cases can be resolved by considering only the first
argument.
(Aside: proponents of single dispatch would not be surprised by this at all.
However, this argument means “multiple dispatch is easy to optimize in practice”,
and that we should therefore use it, not “we should use single dispatch”!)
So the method cache uses the type of the first argument as its primary key.
Note, however, that this corresponds to the second element of the tuple type
for a function call (the first element being the type of the function itself).
Typically, type variation in head position is extremely low — indeed, the
majority of functions belong to singleton types with no parameters.
However, this is not the case for constructors, where a single method table holds
constructors for every type.
Therefore the Type
method table is special-cased to use the first tuple type
element instead of the second.
The front end generates type declarations for all closures.
Initially, this was implemented by generating normal type declarations.
However, this produced an extremely large number of constructors, all of which
were trivial (simply passing all arguments through to new
).
Since methods are partially ordered, inserting all of these methods is O(n^2),
plus there are just too many of them to keep around.
This was optimized by generating composite_type
expressions directly
(bypassing default constructor generation), and using new
directly to create
closure instances.
Not the prettiest thing ever, but you do what you gotta do.
The next problem was the @test
macro, which generated a 0-argument closure
for each test case.
This is not really necessary, since each test case is simply run once in place.
Therefore I modified @test
to expand to a try-catch block that records the
test result (true, false, or exception raised) and calls the test suite handler
on it.
However this caused a new problem. When many tests are grouped together in a single function, e.g. a single top level expression, or some other test grouping function, that function could have a very large number of exception handlers. This triggered a kind of dataflow analysis worst case, where type inference spun around for minutes enumerating possible paths through the forest of handlers. This was fixed by simply bailing out of type inference when it encounters more than some number of handlers (currently 25). Presumably no performance-critical function will have more than 25 exception handlers. If one ever does, I’m willing to raise the limit to 26.
A minor issue occurs during the bootstrap process due to storing all constructors
in a single method table.
In the second bootstrap step, where inference.ji is compiled using inference0.ji,
constructors for inference0’s types remain in the table, so there are still
references to the old inference module and inference.ji is 2x the size it should be.
This was fixed in dump.c by filtering definitions from “replaced modules” out of
method tables and caches before saving a system image.
A “replaced module” is one that satisfies the condition
m != jl_get_global(m->parent, m->name)
— in other words, some newer module
has taken its name and place.
Another type inference worst case was triggered by the following code from quadgk.jl:
function do_quadgk{Tw}(f, s, n, ::Type{Tw}, abstol, reltol, maxevals, nrm)
if eltype(s) <: Real # check for infinite or semi-infinite intervals
s1 = s[1]; s2 = s[end]; inf1 = isinf(s1); inf2 = isinf(s2)
if inf1 || inf2
if inf1 && inf2 # x = t/(1-t^2) coordinate transformation
return do_quadgk(t -> begin t2 = t*t; den = 1 / (1 - t2);
f(t*den) * (1+t2)*den*den; end,
map(x -> isinf(x) ? copysign(one(x), x) : 2x / (1+hypot(1,2x)), s),
n, Tw, abstol, reltol, maxevals, nrm)
end
s0,si = inf1 ? (s2,s1) : (s1,s2)
if si < 0 # x = s0 - t/(1-t)
return do_quadgk(t -> begin den = 1 / (1 - t);
f(s0 - t*den) * den*den; end,
reverse!(map(x -> 1 / (1 + 1 / (s0 - x)), s)),
n, Tw, abstol, reltol, maxevals, nrm)
else # x = s0 + t/(1-t)
return do_quadgk(t -> begin den = 1 / (1 - t);
f(s0 + t*den) * den*den; end,
map(x -> 1 / (1 + 1 / (x - s0)), s),
n, Tw, abstol, reltol, maxevals, nrm)
end
end
end
This code has a 3-way tail recursion, where each call wraps the current function
argument f
in a different new closure.
Inference must consider 3^n (where n is the call depth) possible signatures.
This blows up way too quickly, so logic was added to typeinf_uncached to
immediately widen any argument that is a subtype of Function
and that grows
in depth down the stack.


Animals are multicellular eukaryotic organisms that form the biological kingdom Animalia. With few exceptions, animals consume organic material, breathe oxygen, are able to move, reproduce sexually, and grow from a hollow sphere of cells, the blastula, during embryonic development. Over 1.5 million living animal species have been described—of which around 1 million are insects—but it has been estimated there are over 7 million in total. Animals range in size from 8.5 millionths of a metre to 33.6 metres (110 ft) long and have complex interactions with each other and their environments, forming intricate food webs. The study of animals is called zoology.
Aristotle divided animals into those with blood and those without. Carl Linnaeus created the first hierarchical biological classification for animals in 1758 with his Systema Naturae, which Jean-Baptiste Lamarck expanded into 14 phyla by 1809. In the late-1800s, Ernst Haeckel divided the animal kingdom into the multicellular Metazoa (now synonymous with Animalia) and the Protozoa, single-celled organisms no longer considered animals. In modern times, the biological classification of animals relies on advanced techniques, such as molecular phylogenetics, which are effective at demonstrating the evolutionary relationships between animal taxa.