Welcome
This page provides documentation for the Incremental Game Engine JS (title and 'engine' works-in-progress!)
Simply select the object on the left you wish to learn about.
What can you do with it so far?
1. Create a very simple clicker/incremental game in minutes using the pre-defined score variable and setting an HTML element with the id of 'clicker' and calling game.init()!
2. Use the library to maintain sets of 'entities' - objects with unique identifiers and attributes, and access these objects and sets in meaningful ways!
3. Track/Untrack any attributes in an HTML element (and optionally parse the value through a function to display it how you want to) that are a part of the 'attributes' array in Game, EntitySet, and Entity objects (and any other that inherits Common).
4. Bind/Unbind a click event on any HTML element to a function that can be executed!
5. Run games in background tabs by leveraging Game.play()
6. Display typical '+X...' type particle-text on the mouse for your clicker game
7. Flag/track events using Flags to observe any major milestones/events/progress changes!
And much more! The more you get used to it and the more you understand how the different functions work, you will be able to come up with more creative uses for things. If you feel something can be done in a more efficient or programmer-friendly way, please do point it out!
What else is coming?
1. Supplementing Trackers using Timers -> Additional (optional) parameter to all tracker functions that will execute a function if a certain value is reached.
2. Saving/Loading - attempted earlier but ran into unexpected trouble. Will reattempt soon.
3. UI (User Interface) and other related helper functions to help streamline creation of dynamic page elements.
And more!


Translator: SCUhzs
This is no.885 question in LeetCode, interesting and skillful. Solving such problems is not as IQ-cost as dynamic programming, but rather depends on understanding of common data structures and capacity to write code. As far as I’m concerned, it deserves our attention and study.
By the way, I’d like to say something. Many readers ask me, how to sum up framework of algorithm. But in fact, that’s not really like that. The framework is slowly extracted from the details. I hope, after you read our articles, you’d better take some time to try solving more similar problems by yourself. As it said, “Practice goes deeper than theoretic knowledge.”
Let me first describe the subject: “suppose there is an examination room, with a row of N
seats,
respectively, their indexes are [0.. n-1]
. The Candidates, will successively enter the
room, will probably leave at any time.”
As an examiner, you should arrange the seats for students, so as to meet those requirements: whenever a student enters, maximize the distance between him and the nearest other students; if there are more than one such seats, arrange him to the seat with the smallest index. This is a real situation in life as we known.
That is, you need to implement a class like this:
class ExamRoom {
// constructor, receive the N which means total number of seats
public ExamRoom(int N);
// when a candidate comes, return to the seat assigned for him
public int seat();
// The candidate in the position P now left
// It can be considered that there must be a candidate in the position P
public void leave(int p);
}
For example, there are five seats in the room, which are [0..4]
:
When the candidate 1 enters (call seat()
), it is OK for him to sit in any position, but you should
arrange the position with lowest index for him, that is, return position 0.
When the candidate 2 enters (call seat()
), he should keep away from candidates nearby as possible,
that is, return to position 4.
When the candidate 3 enters, he should keep away from candidates nearby as possible, so he need to sit in the middle, that is, seat 2.
If another candidate enters, he can sit in seat 1 or seat 3. Take the smaller one, index 1.
And so on.
In the situation just mentioned, the function leave
doesn’t be called. However, readers can definitely
find the following regular:
If we regard every two adjacent candidates as the two endpoints of a line segment, the new arrangement is
that, find the longest line segment, let this candidate 「dichotomy」 the line segment in middle, and then the
middle point is the seat assigned to him. Actually, Leave (P)
is to remove the end point
p
, so as to merge two adjacent segments into one.
It’s not hard to think about it, actually, this question wants to examine your understanding of data structure. To implement the above logic, which data structure should be selected ?
According to the above idea, first of all, we need to abstract the students sitting in the classroom into line segments, which can be simply represented by an array of 2 size .
In addition, the idea requires us to find the 「longest」 line segment, removing or adding the line segment both are needed.
If we face with such a requirement that need to get the most value in the dynamic process, the ordered data structure should be used. Binary heap and balanced binary search tree is what we use most often. The priority queue, which implemented by binary heap, its time complexity of getting most value is O (logN), but only the maximum value can be deleted. Balanced binary tree can not only get the most value, but also modify or delete any value, and the time complexity of them both are O (logn).
In summary, binary heap can’t finish the operation of leave
, so balanced binary tree should be chose.
And we will use a structure named TreeSet
, which used in JAVA. It is an ordered data structure, and its
bottom layer is implemented by red black tree.
By the way, when it comes to Set or Map, some readers may take it for granted that it is a HashSet or a HashMap. There is something wrong with that.
Because the bottom layer of Hash_Set/Map is implemented by the hash function and the array, it has the feature: its traversal order is not fixed while its operation efficiency is high, and its time complexity is O (1).
Meanwhile, the Set/Map can also rely on other underlying data structures, The Red Black Tree (a balanced binary search tree) is the common one, which has a feature that maintaining the order of elements automatically and its efficiency is O (logn). This is commonly referred to 「ordered Set/Map」.
The TreeSet
we use just is an ordered set. Its purpose is to maintain the order of line length,
quickly find the longest line, and quickly delete and insert.
Firstly, if there are multiple optional seats, you should choose the seat with the lowest index. Let’s simplify the problem first, this is, ignore this requirement for the moment , and put the implement of above idea ahead.
Another common programming trick used in this problem is to use a 「virtual line segment」, so as to let the algorithm start properly, the same as the reason why the algorithms which related to linked list algorithms need a 「virtual header」.
// Map endpoint p to the segment with P as the left endpoint
private Map<Integer, int[]>
startMap;
// Map endpoint p to the segment with P as the right endpoint
private Map<Integer, int[]>
endMap;
// According to their length, store all line segments from small to large
private TreeSet<int[]> pq;
private int N;
public ExamRoom(int N) {
this.N = N;
startMap = new HashMap<>();
endMap = new HashMap<>();
pq = new TreeSet<>((a, b) -> {
// Calculate the length of two line segments
int distA = distance(a);
int distB = distance(b);
// Longer means it is bigger, and put it back
return distA - distB;
});
// Firstly, put a virtual segment in the ordered set
addInterval(new int[] {-1, N});
}
/* Remove a line segment */
private void removeInterval(int[] intv)
{
pq.remove(intv);
startMap.remove(intv[0]);
endMap.remove(intv[1]);
}
/* Add a line segment */
private void addInterval(int[] intv) {
pq.add(intv);
startMap.put(intv[0], intv);
endMap.put(intv[1], intv);
}
/* Calculate the length of a line segment */
private int distance(int[] intv) {
return intv[1] - intv[0] - 1;
}
「Virtual line segment 」is to represent all seats as one line segment:
With the foreshadowing, the main API seat
and leave
could be written:
public int seat() {
// Take the longest line from the ordered set
int[] longest = pq.last();
int x = longest[0];
int y = longest[1];
int seat;
if (x == -1) { // case 1
seat = 0;
} else if (y == N) { // case 2
seat = N - 1;
} else { // case 3
seat = (y - x) / 2 + x;
}
// Divide the longest line segment into two segments
int[] left = new int[] {x, seat};
int[] right = new int[] {seat, y};
removeInterval(longest);
addInterval(left);
addInterval(right);
return seat;
}
public void leave(int p) {
// Find out the lines around p
int[] right = startMap.get(p);
int[] left = endMap.get(p);
// Merge two segments into one
int[] merged = new int[] {left[0],
right[1]};
removeInterval(left);
removeInterval(right);
addInterval(merged);
}
At this point, this algorithm is basically implemented. Although a lot of code, in fact it’s not difficult to
think: find the longest line segment, divide it into two segments from the middle, and the midpoint is the return
value of seat()
; find the left and right line segments of p
, merge them into one segment.
Those is the logic of leave (P)
.
However, when the topic requires multiple choices, we should choose the seat with the smallest index. We just ignored that. For example, the following situation may cause errors:
Now there are line segments [0,4]
and [4,9]
in the ordered set, the longest line segment
longest
is the latter one. According to the logic of seat
, it will split the
[4,9]
, that is, return to seat 6. However, the correct answer should be seat 2. Because both 2 and 6
meet the condition of maximizing the distance between adjacent candidates, and the smaller one should be taken.
The solution to such requirements is to modify the sorting method of ordered data structure. In
this problem, is that, modify the logic of treemap
’s comparison function:
pq = new TreeSet<>((a, b) -> {
int distA = distance(a);
int distB = distance(b);
// If the lengths are equal, compare the indexes
if (distA == distB)
return b[0] - a[0];
return distA - distB;
});
Beside that, we also need to change the distance
function. Instead of calculating the length between
two endpoints of a line segment, we need to let it calculate the length between the midpoint and endpoint of the
line segment.
private int distance(int[] intv) {
int x = intv[0];
int y = intv[1];
if (x == -1) return y;
if (y == N) return N - 1 - x;
// Length between midpoint and endpoint
return (y - x) / 2;
}
In this way, the values of distance
, [0,4]
and [4,9]
are equal. The
algorithm will compare the indexes of the two, and take smaller line segments for segmentation. So far, this
algorithm problem has been solved perfectly.
The problem mentioned in this article is not so difficult, although it seems that there is a lot of code. The core issue is to examine the understanding and use of ordered data structures
To deal with dynamic problems, we usually use ordered data structures, such as balanced binary search tree and binary heap, which have similar time complexity. But the former supports more operations.
Since balanced binary search tree is so easy to use, why use binary heap? The reason given by me, is that, the bottom layer of binary heap is array, which is easier to implement. See the old article 「detailed explanation of binary heap」 to learn more detail. Try to make a Red Black Tree? It not only has more complex operation, but also costs more space. Of course, to solve the specific problems, we should choose the appropriate data structure with specific analysis.
I hope this article can be helpful for you.


These are the 12 least deprived postcode areas in Blackpool according to the Index of Multiple Deprivation
The Gazette can today reveal 12 of the least deprived areas in Blackpool – and the streets that fall within them.
by Iain Lynn
Data has been collected from the Index of Multiple Deprivation (IMD) which was most recently updated in September 2019.


|
This is a toy live coding environment: programs run immediately as they are typed.
Pick something from the "Demos" menu or try the tutorials.
Want more info? See the intro or the docs
Want to hack this? Grab the source code!
Your browser doesn't seem to support 3D acceleration.
You'll still have fun, but you really want to try to get the 3D party going in your browser.
(psst! - it's worth it!).
Your browser doesn't seem to support audio.
Be a champion and try a newer browser.
(while you are at it, pick one that supports 3D such as Chrome or Firefox).
You've unlocked the "I borked the sound system" badge!
This sometime happens when playing lots of music.
Just re-start the browser to get everything back to normal.
(We know it's fun, we do this all the time, it's OK).


About US
Advertisement
Contacts
Privacy
Kings VBlog
2
Schedule
Podcast
Blog
Events
Contacts
Popup
Listen
Kings VBlog
Home
Schedule
Archive
Podcast
Archive
Blog
Blog archive
PASTOR CHRIS
VIDEO BLOG
Pastor Chris and Pastor Benny Hinn
Pastor Chris and Pastor Benny Hinn
Now on
STATION 1 RADIO
Subtitle of the radio
Current track
TITLE
ARTIST
Station 1
altradio
Kings VBlog 2018.


Year:
Month:
January
February
March
April
May
June
July
August
September
October
November
December
Length:
1 Month
2 Months
3 Months
4 Months
5 Months
6 Months
12 Months
15 Months
18 Months
24 Months
Change


Segregation Inference¶
Table of Contents¶
This is an example of the PySAL segregation framework to perform inference on a single value and comparative inference using simulations under the null hypothesis. Once the segregation classes are fitted, the user can perform inference to shed light for statistical significance in regional analysis. Currently, it is possible to make inference for a single measure or for two values of the same measure.
The summary of the inference wrappers is presented in the following Table:
Inference Type |
Class/Function |
Function main Inputs |
Function Outputs |
|---|---|---|---|
Single Value |
SingleValueTest |
seg_class, iterations_under_null, null_approach, two_tailed |
p_value, est_sim, statistic |
Two Value |
TwoValueTest |
seg_class_1, seg_class_2, iterations_under_null, null_approach |
p_value, est_sim, est_point_diff |
Firstly let’s import the module/functions for the use case:
[1]:
%matplotlib inline
import geopandas as gpd
import segregation
import libpysal
import pandas as pd
import numpy as np
from segregation.inference import SingleValueTest, TwoValueTest
Then it’s time to load some data to estimate segregation. We use the data of 2000 Census Tract Data for the metropolitan area of Sacramento, CA, USA.
We use a geopandas dataframe available in PySAL examples repository.
For more information about the data: https://github.com/pysal/libpysal/tree/master/libpysal/examples/sacramento2
[2]:
s_map = gpd.read_file(libpysal.examples.get_path("sacramentot2.shp"))
s_map.columns
[2]:
Index(['FIPS', 'MSA', 'TOT_POP', 'POP_16', 'POP_65', 'WHITE', 'BLACK',
'ASIAN', 'HISP', 'MULTI_RA', 'MALES', 'FEMALES', 'MALE1664',
'FEM1664', 'EMPL16', 'EMP_AWAY', 'EMP_HOME', 'EMP_29', 'EMP_30',
'EMP16_2', 'EMP_MALE', 'EMP_FEM', 'OCC_MAN', 'OCC_OFF1', 'OCC_INFO',
'HH_INC', 'POV_POP', 'POV_TOT', 'HSG_VAL', 'FIPSNO', 'POLYID',
'geometry'],
dtype='object')
[3]:
gdf = s_map[['geometry', 'HISP', 'TOT_POP']]
We also can plot the spatial distribution of the composition of the Hispanic population over the tracts of Sacramento:
[4]:
gdf['composition'] = gdf['HISP'] / gdf['TOT_POP']
gdf.plot(column = 'composition',
cmap = 'OrRd',
figsize=(20,10),
legend = True)
[4]:
<matplotlib.axes._subplots.AxesSubplot at 0x20e1272e860>
Single Value¶
Dissimilarity¶
The SingleValueTest function expect to receive a pre-fitted segregation class and then it uses the underlying data to iterate over the null hypothesis and comparing the results with point estimation of the index. Thus, we need to firstly estimate some measure. We can fit the classic Dissimilarity index:
[5]:
from segregation.aspatial import Dissim
D = Dissim(gdf, 'HISP', 'TOT_POP')
D.statistic
[5]:
0.32184656076566864
The question that may rise is “Is this value of 0.32 statistically significant under some pre-specified circumstance?”. To answer this, it is possible to rely on the Infer_Segregation function to generate several values of the same index (in this case the Dissimilarity Index) under the hypothesis and compare them with the one estimated by the dataset of Sacramento. To generate 1000 values assuming evenness, you can run:
[6]:
infer_D_eve = SingleValueTest(D, iterations_under_null = 1000, null_approach = "evenness", two_tailed = True)
This class has a quick plotting method to inspect the generated distribution with the estimated value from the sample (vertical red line):
[7]:
infer_D_eve.plot()
[7]:
<matplotlib.axes._subplots.AxesSubplot at 0x20e127eb630>
It is possible to see that clearly the value of 0.3218 is far-right in the distribution indicating that the hispanic group is, indeed, significantly segregated in terms of the Dissimilarity index under evenness. You can also check the mean value of the distribution using the est_sim attribute which represents all the D draw from the simulations:
[8]:
infer_D_eve.est_sim.mean()
[8]:
0.016109671121956267
The two-tailed p-value of the following hypothesis test:
can be accessed with the p_value attribute:
[9]:
infer_D_eve.p_value
[9]:
0.0
Therefore, we can conclude that Sacramento is statistically segregated at 5% of significance level (p.value < 5%) in terms of D.
You can also test under different approaches for the null hypothesis:
[10]:
infer_D_sys = SingleValueTest(D, iterations_under_null = 5000, null_approach = "systematic", two_tailed = True)
[11]:
infer_D_sys.plot()
[11]:
<matplotlib.axes._subplots.AxesSubplot at 0x20e128235c0>
The conclusions are analogous as the evenness approach.
Relative Concentration¶
The Infer_Segregation wrapper can handle any class of the PySAL segregation module. It is possible to use it in the Relative Concentration (RCO) segregation index:
[12]:
from segregation.spatial import RelativeConcentration
RCO = RelativeConcentration(gdf, 'HISP', 'TOT_POP')
Since RCO is an spatial index (i.e. depends on the spatial context), it makes sense to use the permutation null approach. This approach relies on randomly allocating the sample values over the spatial units and recalculating the chosen index to all iterations.
[13]:
infer_RCO_per = SingleValueTest(RCO, iterations_under_null = 1000, null_approach = "permutation", two_tailed = True)
[14]:
infer_RCO_per.plot()
[14]:
<matplotlib.axes._subplots.AxesSubplot at 0x20e15dba9b0>
[15]:
infer_RCO_per.p_value
[15]:
0.452
Analogously, the conclusion for the Relative Concentration index is that Sacramento is not significantly (under 5% of significance, because p-value > 5%) concentrated for the hispanic people.
Additionaly, it is possible to combine the null approaches establishing, for example, a permutation along with evenness of the frequency of the Sacramento hispanic group. With this, the conclusion of the Relative Concentration changes.
[16]:
infer_RCO_eve_per = SingleValueTest(RCO, iterations_under_null = 1000, null_approach = "even_permutation", two_tailed = True)
infer_RCO_eve_per.plot()
[16]:
<matplotlib.axes._subplots.AxesSubplot at 0x20e15d8db38>
Relative Centralization¶
Using the same permutation approach for the Relative Centralization (RCE) segregation index:
[17]:
from segregation.spatial import RelativeCentralization
RCE = RelativeCentralization(gdf, 'HISP', 'TOT_POP')
infer_RCE_per = SingleValueTest(RCE, iterations_under_null = 1000, null_approach = "permutation", two_tailed = True)
Processed 1000 iterations out of 1000.
[18]:
infer_RCE_per.plot()
The conclusion is that the hispanic group is negatively significantly (as the point estimation is in the left side of the distribution) in terms of centralization. This behavior can be, somehow, inspected in the map as the composition tends to be more concentraded outside of the center of the overall region.
Comparative Inference¶
To compare two different values, the user can rely on the TwoValueTest function. Similar to the previous function, the user needs to pass two segregation SM classes to be compared, establish the number of iterations under null hypothesis with iterations_under_null, specify which type of null hypothesis the inference will iterate with null_approach argument and, also, can pass additional parameters for each segregation estimation.
Obs.: in this case, each measure has to be the same class as it would not make much sense to compare, for example, a Gini index with a Delta index
This example uses all census data that the user must provide your own copy of the external database. A step-by-step procedure for downloading the data can be found here: https://github.com/spatialucr/geosnap/blob/master/examples/01_getting_started.ipynb. After the user download the zip files, you must provide the path to these files.
[19]:
import os
#os.chdir('path_to_zipfiles')
[20]:
import geosnap
from geosnap.data.data import read_ltdb
sample = "LTDB_Std_All_Sample.zip"
full = "LTDB_Std_All_fullcount.zip"
read_ltdb(sample = sample, fullcount = full)
df_pre = geosnap.data.db.ltdb
C:\Users\renan\AppData\Local\Continuum\anaconda3\lib\site-packages\pysal\__init__.py:65: VisibleDeprecationWarning: PySAL's API will be changed on 2018-12-31. The last release made with this API is version 1.14.4. A preview of the next API version is provided in the `pysal` 2.0 prelease candidate. The API changes and a guide on how to change imports is provided at https://pysal.org/about
), VisibleDeprecationWarning)
[21]:
df_pre.head()
[21]:
| n_asian_under_15 | n_black_under_15 | n_hispanic_under_15 | n_native_under_15 | n_white_under_15 | n_persons_under_18 | n_asian_over_60 | n_black_over_60 | n_hispanic_over_60 | n_native_over_60 | ... | n_white_persons | year | n_total_housing_units_sample | p_nonhisp_white_persons | p_white_over_60 | p_black_over_60 | p_hispanic_over_60 | p_native_over_60 | p_asian_over_60 | p_disabled | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| geoid | |||||||||||||||||||||
|<PHONE_NUMBER>0 | NaN | 1.121662 | NaN | NaN | 1.802740 | 3.284181 | NaN | 0.301098 | NaN | NaN | ... | 5.794934 | 1970 | 2.166366 | NaN | 6.433142 | 3.514090 | NaN | NaN | NaN | 4.737847 |
|<PHONE_NUMBER>0 | NaN | 609.000000 | NaN | NaN | 639.000000 | 1407.000000 | NaN | 221.000000 | NaN | NaN | ... | 2003.999981 | 1970 | 1106.000000 | NaN | 8.299712 | 6.368876 | NaN | NaN | NaN | 5.821326 |
|<PHONE_NUMBER>0 | NaN | 37.567365 | NaN | NaN | 564.014945 | 686.748041 | NaN | 27.861793 | NaN | NaN | ... | 1757.910752 | 1970 | 619.433984 | NaN | 13.313281 | 1.480888 | NaN | NaN | NaN | 6.248800 |
|<PHONE_NUMBER>0 | NaN | 374.853457 | NaN | NaN | 981.543199 | 1523.971872 | NaN | 103.848314 | NaN | NaN | ... | 2835.404427 | 1970 | 1025.805309 | NaN | 8.023381 | 2.788906 | NaN | NaN | NaN | 7.214156 |
|<PHONE_NUMBER>0 | NaN | 113.203816 | NaN | NaN | 796.944763 | 1029.919527 | NaN | 37.127235 | NaN | NaN | ... | 2323.133371 | 1970 | 780.370269 | NaN | 11.072073 | 1.427952 | NaN | NaN | NaN | 11.205555 |
5 rows × 192 columns
In this example, we are interested to assess the comparative segregation of the non-hispanic black people in the census tracts of the Riverside, CA, county between 2000 and 2010. Therefore, we extract the desired columns and add some auxiliary variables:
[22]:
df = df_pre[['n_nonhisp_black_persons', 'n_total_pop', 'year']]
df['geoid'] = df.index
df['state'] = df['geoid'].str[0:2]
df['county'] = df['geoid'].str[2:5]
df.head()
[22]:
| n_nonhisp_black_persons | n_total_pop | year | geoid | state | county | |
|---|---|---|---|---|---|---|
| geoid | ||||||
|<PHONE_NUMBER>0 | NaN | 8.568306 | 1970 |<PHONE_NUMBER>0 | 01 | 001 |
|<PHONE_NUMBER>0 | NaN | 3469.999968 | 1970 |<PHONE_NUMBER>0 | 01 | 003 |
|<PHONE_NUMBER>0 | NaN | 1881.424759 | 1970 |<PHONE_NUMBER>0 | 01 | 003 |
|<PHONE_NUMBER>0 | NaN | 3723.622031 | 1970 |<PHONE_NUMBER>0 | 01 | 003 |
|<PHONE_NUMBER>0 | NaN | 2600.033045 | 1970 |<PHONE_NUMBER>0 | 01 | 003 |
Filtering Riverside County and desired years of the analysis:
[23]:
df_riv = df[(df['state'] == '06') & (df['county'] == '065') & (df['year'].isin(['2000', '2010']))]
df_riv.head()
[23]:
| n_nonhisp_black_persons | n_total_pop | year | geoid | state | county | |
|---|---|---|---|---|---|---|
| geoid | ||||||
|<PHONE_NUMBER>1 | 58.832932 | 851.999976 | 2000 |<PHONE_NUMBER>1 | 06 | 065 |
|<PHONE_NUMBER>3 | 120.151764 | 1739.999973 | 2000 |<PHONE_NUMBER>3 | 06 | 065 |
|<PHONE_NUMBER>4 | 367.015289 | 5314.999815 | 2000 |<PHONE_NUMBER>4 | 06 | 065 |
|<PHONE_NUMBER>0 | 348.001105 | 4682.007896 | 2000 |<PHONE_NUMBER>0 | 06 | 065 |
|<PHONE_NUMBER>0 | 677.998901 | 4844.992203 | 2000 |<PHONE_NUMBER>0 | 06 | 065 |
Merging it with desired map.
[24]:
map_url = 'https://raw.githubusercontent.com/renanxcortes/inequality-segregation-supplementary-files/master/Tracts_grouped_by_County/06065.json'
map_gpd = gpd.read_file(map_url)
gdf = map_gpd.merge(df_riv,
left_on = 'GEOID10',
right_on = 'geoid')[['geometry', 'n_nonhisp_black_persons', 'n_total_pop', 'year']]
gdf['composition'] = np.where(gdf['n_total_pop'] == 0, 0, gdf['n_nonhisp_black_persons'] / gdf['n_total_pop'])
[25]:
gdf.head()
[25]:
| geometry | n_nonhisp_black_persons | n_total_pop | year | composition | |
|---|---|---|---|---|---|
| 0 | POLYGON ((-117.319414 33.902109, -117.322528 3... | 233.824879 | 2537.096784 | 2000 | 0.092162 |
| 1 | POLYGON ((-117.319414 33.902109, -117.322528 3... | 568.000000 | 6556.000000 | 2010 | 0.086638 |
| 2 | POLYGON ((-117.504056 33.800257, -117.502758 3... | 283.439545 | 3510.681010 | 2000 | 0.080736 |
| 3 | POLYGON ((-117.504056 33.800257, -117.502758 3... | 754.000000 | 10921.000000 | 2010 | 0.069041 |
| 4 | POLYGON ((-117.472451 33.762031, -117.475661 3... | 273.560455 | 3388.318990 | 2000 | 0.080736 |
[26]:
gdf_2000 = gdf[gdf.year == 2000]
gdf_2010 = gdf[gdf.year == 2010]
Map of 2000:
[27]:
gdf_2000.plot(column = 'composition',
cmap = 'OrRd',
figsize = (30,5),
legend = True)
[27]:
<matplotlib.axes._subplots.AxesSubplot at 0x2b4c0812358>
Map of 2010:
[28]:
gdf_2010.plot(column = 'composition',
cmap = 'OrRd',
figsize = (30,5),
legend = True)
[28]:
<matplotlib.axes._subplots.AxesSubplot at 0x2b48c35f550>
A question that may rise is “Was it more or less segregated than 2000?”. To answer this, we rely on simulations to test the following hypothesis:
Comparative Dissimilarity¶
[29]:
D_2000 = Dissim(gdf_2000, 'n_nonhisp_black_persons', 'n_total_pop')
D_2010 = Dissim(gdf_2010, 'n_nonhisp_black_persons', 'n_total_pop')
D_2000.statistic - D_2010.statistic
[29]:
0.023696202305264924
We can see that Riverside was more segregated in 2000 than in 2010. But, was this point difference statistically significant? We use the random_label approach which consists in random labelling the data between the two periods and recalculating the Dissimilarity statistic (D) in each iteration and comparing it to the original value.
[30]:
compare_D_fit = TwoValueTest(D_2000, D_2010, iterations_under_null = 1000, null_approach = "random_label")
Processed 1000 iterations out of 1000.
The TwoValueTest class also has a plotting method:
[31]:
compare_D_fit.plot()
To access the two-tailed p-value of the test:
[32]:
compare_D_fit.p_value
[32]:
0.26
The conclusion is that, for the Dissimilarity index and 5% of significance, segregation in Riverside was not different between 2000 and 2010 (since p-value > 5%).
Comparative Gini¶
Analogously, the same steps can be made for the Gini segregation index.
[33]:
from segregation.aspatial import GiniSeg
G_2000 = GiniSeg(gdf_2000, 'n_nonhisp_black_persons', 'n_total_pop')
G_2010 = GiniSeg(gdf_2010, 'n_nonhisp_black_persons', 'n_total_pop')
compare_G_fit = TwoValueTest(G_2000, G_2010, iterations_under_null = 1000, null_approach = "random_label")
compare_G_fit.plot()
Processed 1000 iterations out of 1000.
The absence of significance is also present as the point estimation of the difference (vertical red line) is located in the middle of the distribution of the null hypothesis simulated.
Comparative Spatial Dissimilarity¶
As an example of a spatial index, comparative inference can be performed for the Spatial Dissimilarity Index (SD). For this, we use the counterfactual_composition approach as an example.
In this framework, the population of the group of interest in each unit is randomized with a constraint that depends on both cumulative density functions (cdf) of the group of interest composition to the group of interest frequency of each unit. In each unit of each iteration, there is a probability of 50% of keeping its original value or swapping to its corresponding value according of the other composition distribution cdf that it is been compared against.
[34]:
from segregation.spatial import SpatialDissim
SD_2000 = SpatialDissim(gdf_2000, 'n_nonhisp_black_persons', 'n_total_pop')
SD_2010 = SpatialDissim(gdf_2010, 'n_nonhisp_black_persons', 'n_total_pop')
compare_SD_fit = TwoValueTest(SD_2000, SD_2010, iterations_under_null = 500, null_approach = "counterfactual_composition")
compare_SD_fit.plot()
Processed 500 iterations out of 500.
The conclusion is that for the Spatial Dissimilarity index under this null approach, the year of 2000 was more segregated than 2010 for the non-hispanic black people in the region under study.


CS140 -- Lecture Notes
For C++ reference material, see
http://www.cppreference.com/ or
www.cplusplus.com. These are
excellent
sources of online reference and tutorial material for C++. If you need a
book to help you with C++, try
"Teach Yourself C++", 3rd Ed., Herbert Schildt." -- one cent from Amazon.
For learning vi/vim,
http://vim-adventures.com/ is
a "game" to learn vim.
- Lecture 0: Unix, vi, files and compiling
- Lecture 1: C++ Review -- Reading from standard input
- Lecture 2: Output -- In particular, Printf
- Lecture 3: String and Vector Basics
- Lecture 4: An introduction to Topcoder
- Lecture 5: Argc, argv and stringstreams
- Lecture 6: Vectors of Vectors
- Lecture 7: Procedures
- Lecture 8: Strings in more detail
- Lecture 9: The roster.cpp example:
Classes, multiple files, constructors, new, HTML, randomizing an array.
- Lecture 10: Hashing.
- Lecture 11: Pointers, and setting up data structures
that share data using pointers.
- Lecture 12: Lists, Iterators, Bad Vector Usage, Deques.
- Lecture 13: Sets and Maps.
- Lecture 14: Using Maps as Associative Arrays;
The RouteIntersection Topcoder Problem;
The ColorfulRabbits Topcoder Problem.
- Lecture 15: Big-O.
- Lecture 16: Linked Data Structures: Stacks, Queues and Doubly Linked Lists.
- Lecture 17: Recursion.
- Lecture 18: A Recursive Sudoku Solver.
- Lecture 19: The basics of Trees, and basic Binary Search Trees.
- Lecture 20: AVL Trees.
- Lecture 21: B
Trees and B+ Trees.


Input¶
Import Data¶
Imports EEG data into the system to be manipulated by the user
Attributes¶
Output |
||
Name |
Type |
Description |
Raw |
rawEEG |
Contains the channel data for the EEG dataset |
Events |
events |
Contains the event times and types for the EEG dataset |
Settings Interface¶
BDF Files¶
Setting |
Description |
Event Mask |
The binary mask that isolates the signal data from the event information in the BDF file. Default can be left as 255 to use the first 2 bytes of the data for the signal and the 3rd as the event carrier. |
Numpy Files¶
Setting |
Description |
Channel Types |
A text file that contains the type (eeg/eog/ecg) of each channel of the data as a comma seperated list. |
Sample Freq |
The sample frequency of the data in Hz |
Import Epochs¶
Imports a single epoch file. Multiple file input similar to the Import Data node is in development
Attributes¶
Output |
||
Name |
Type |
Description |
Epoch Data |
epoch |
Epoch data loaded from file |
Settings Interface¶
Import Evoked¶
Imports a single evoked file. Multiple file input similar to the Import Data node is in development
Attributes¶
Output |
||
Name |
Type |
Description |
Epoch Data |
evoked |
Evoked data loaded from file |
Settings Interface¶
See Import Epochs
Import ICA¶
Imports a single ICA solution. Multiple file input similar to the Import Data node is in development
Attributes¶
Output |
||
Name |
Type |
Description |
ICA Solution |
ICA |
ICA solution loaded from file |
Settings Interface¶
See Import Epochs


Lox helps you coordinate access to shared resources.
Lox is a dead-simple Node.js microservice to help you manage distributed locks. Using Lox, you can acquire and release shared locks across multiple clients subject to dynamically changing availability constraints.
What can I do with it?
At GameChanger, we use Lox to coordinate deploys across hundreds of instances. Lox allows us to deploy a constant percentage of a cluster at a given time, even if the size of that cluster changes in the middle of a deploy. Lox also expires stale locks, so we don't have to worry about deadlocks.
Is it complicated?
Lox exposes a grand total of three HTTP API endpoints, documented here. So no.
GET /health - return 200 if the service is running
POST /lock - acquire a shared lock
DELETE /lock/:lockId - release a shared lock
Great, how can I get started?
Lox can be deployed either directly with Node.js or using a public Docker image. Once you've done that, you just need to point Lox to a Redis instance and you're good to go. Check out the repository for full deployment instructions.


Add Protein to Your Diet
When it comes to weight loss, protein is the king of nutrients.
Your body burns calories when digesting and metabolizing the protein you eat, so a high-protein diet can boost metabolism by up to 80–100 calories per day (1Trusted Source, 2Trusted Source)
A high-protein diet can also make you feel more full and reduce your appetite. In fact, some studies show that people eat over 400 fewer calories per day on a high-protein diet (3Trusted Source, 4Trusted Source).
Even something as simple as eating a high-protein breakfast (like eggs) can have a powerful
Eat Whole, Single-Ingredient Foods
One of the best things you can do to become healthier is to base your diet on whole, single-ingredient foods.
By doing this, you eliminate the vast majority of added sugar, added fat and processed food.
Most whole foods are naturally very filling, making it a lot easier to keep within healthy calorie limits (7Trusted Source).
Furthermore, eating whole foods also provides your body with the many essential nutrients that it needs to function properly.
Weight loss often follows as a natural side effect of eating whole foods.
Avoid Processed Foods
Processed foods are usually high in added sugars, added fats and calories.
 They are much more likely to cause addictive-like eating than unprocessed foods
Limit Your Intake of Added Sugar
Eating a lot of added sugar is linked with some of the world’s leading diseases, including heart disease, type 2 diabetes and cancer (12Trusted Source, 13Trusted Source, 14Trusted Source).
On average, Americans eat about 15 teaspoons of added sugar each day. This amount is usually hidden in various processed foods, so you may be consuming a lot of sugar without even realizing it (15).
Since sugar goes by many names in ingredient lists, it can be very difficult to figure out how much sugar a product actually contains.
Minimizing your intake of added sugar is a great way to improve your diet.
Drink Water
There is actually truth to the claim that drinking water can help with weight loss.
Drinking 0.5 liters (17 oz) of water may increase the calories you burn by 24–30% for an hour afterward (16Trusted Source, 17Trusted Source, 18Trusted Source, 19Trusted Source).
Drinking water before meals may also lead to reduced calorie intake, especially for middle-aged and older people (20Trusted Source, 21Trusted Source).
Water is particularly good for weight loss when it replaces other beverages that are high in calories and sugar (22Trusted Source, 23Trusted Source).


BrainFooLong wrote:We hire again translators for Czech, Polish and Russian.
Are you interested, good in english to another language translation and want to join the team?
Contact me via private message here on getbblog.com
SWEG4MER wrote:Need any swedish translations?
BrainFooLong wrote:Since BBLog v3 there is no language picker anymore. BBLog only support the same languages as in battlelog.
BrainFooLong wrote:No, as in the first post describes we search
Polish and Russian
Czech already done by a new translator.


EOS Knight has been my daily mobile game after quitting my last mobile gaming addict. I regard the mobile gaming is one of the worst habits to waste time, but the good thing about EOS knight is that I actually don’t have to spend a lot of time on it due to its idle gaming mechanism.
To me, the motivation of playing this game is puremaking some EOS so the marketplace for materials and equipment is my main focus.
The game recently introduced a new update
Hitting over 700 floors now will allow players to sell 4 items at the same times which is 1 item more than the previous limit. Definitely sounds interesting for a heavy trader like myself.
I’ve been staying at 500+ floors for quite a while and kind of making back all my initial EOS. It is the right time to go for a higher floor, at least beyond the 700 ceiling. I’m ready to splash those EOS again!
Made my most powerful equipment
The only way to achieve that is upgrade equipment of knight so they can either deal more damage or staying alive longer. Long story short, I made a new armourMare Tranquilitatis which happens to be the most powerful item in my collection.
The item is 90% done and here is the plan that is going to be completed anyhow: Make 16 same items and synthesise them all together into one for max levelling it to Level 5.
And the breakdown of cost is:
- About 1 EOS / Item
- About 3 EOS for the cost of Magic water which acts like the fee for such operation
(1 * 16) + 3 = 19 EOS
At the time of writing, 1 EOS = $5.59 which make the item cost about $106.21. Oh my Fxxking God. This alone will tops all my game spending record combined!
 I was fascinated by this fact and I did not realize the actual cost while I was busy crafting the item. It works like charm though and does what it does to bring my game to another level. And in fact I could just sell it away at the same cost price at least(it is a damn fine item anyway). While I do not regret crafting expensive item as such, this is a whopping price to pay though.
The lesson of this post is, gaming using crypto could be dangerous as betting in the casino with chip. Players often ignore the actual value of the token. We often treat one chip as one unit despite the actual value it carries no matter it worth $5 or $100 a piece.
And that explains very well in my case as I calculated the value in term of EOS instead of converting them to the daily updated price at CMC before making a decision. Which would anyhow make the game a lot more troublesome to play with right?
While this powerful and sexy amour starts to show, I hope the value would retain more or less the same in the market by the time I decided to let it go. Else it would be a huge loss, ouch!
What is your most expensive investment in a game?
Posted from my blog with SteemPress : https://fr3eze.vornix.blog/i-just-spent-over-100-to-craft-an-equipment-in-a-game/
This page is synchronized from the post: ‘I just spent over $100 to craft an equipment in a game…’


RC4 is a stream cipher笔记：第一点，RC4是一个stream cipher，而不是block cipher with variable-length keys笔记：第二点，它的key是变长的，不像DES或AES的key是固定长度的 that can be up to 256 bytes long.
RC4 was previously a trade secret商业秘密 a secret piece of information that is known only by the people at a particular company but is now in common use due to the publication of a reverse-engineered, third-party implementation. If you use RC4 in a commercial product, RSA Security might come after you legally, even though it would be unlikely to win. The name RC4 is also trademarked, and you should consult RSA Security before using it. 笔记：RC4曾经是商业机密，只是被反编译了；如果将RC4用于商业用途，可能会被RSA Security起诉。
RC4 is a stream cipher and is blazingly fast compared to the available block ciphers in OpenSSL. It's certainly the fastest algorithm currently implemented in OpenSSL. RC4 is also well-regarded as an algorithm. For this reason, and due to its widespread use in SSL, it's vastly popular, though it is widely used with insecure 40-bit keys. 笔记：RC4是OpenSSL中最快的算法。


All platforms supported by Berkeley DB that have a JVM compatible with J2SE 1.4 or above.
The Berkeley DB Java API does not currently implement any part of the J2EE standard. That said, it does implement the implicit standard for Java Java Collections. The concept of a transaction exists in several Java packages (J2EE, XA, JINI to name a few). Support for these APIs will be added based on demand in future versions of Berkeley DB.
Tomcat and other J2EE application servers have the ability to rebuild and reload code automatically. When using Tomcat this is the case when "reloadable" is set to "true". If your WAR file includes the db.jar it too will be reloaded each time your code is reloaded. This causes exceptions as the native library can't be loaded more than once and there is no way to unload native code. The solution is to place the db.jar in $TOMCAT_HOME/common/lib and let Tomcat load that library once at start time rather than putting it into the WAR that gets reloaded over and over.
Yes. The Berkeley DB Java API can be used from within all the popular J2EE application servers in many different ways.
There are known large-file support bugs under JNI in various releases of the JDK. Please upgrade to the latest release of the JDK, and, if that does not solve the problem, disable big file support using the --disable-largefile configuration option.
Set Java's library path so that the debug version of Berkeley DB's Java library appears, but the release version does not. Berkeley DB tries to load the release library first, and if that fails tries the debug library.
This problem occurs if you copy the db.jar file into the Java extensions (ext) directory. This will cause the database code to run under the System class loader, and it won't be able to find your application classes.
You'll have to actually remove db.jar from the Java extension directory. If you have more than one installation of Java, be sure to remove it from all of them. This is necessary even if db.jar is specified in the classpath.
An example of the exception is:
collections.ship.basic.SupplierKey at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClassInternal(Unknown Source) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at com.sleepycat.bind.serial.StoredClassCatalog. getClassInfo(StoredClassCatalog.java:211) ...
While it is possible to use the low-level API from applications, there are some caveats that should be considered when upgrading. The first is that the internal API depends on some classes in the public API such as DatabaseEntry.
In addition, the internal API is closer to the C API and doesn't have some of the default settings that were part of the earlier Java API. For example, applications will need to set the DB_THREAD flag explicitly if handles are to be used from multiple threads, or subtle errors may occur.


{% extends "app/layout.html" %} {% block content %}
Your account doesn't have access to this page. To proceed, please login with an account that has access.
{% endif %}Please login to see this page.
{% endif %} {# Assumes you setup the password_reset view in your URLconf #} register


Design Alternatives
Based on our user research data, we reviewed our ideas based on a few key criteria including:
- Creativity: whether the idea is interesting/immersive enough to motivate students to perform the exercise
- Effectiveness: whether the solution can effectively bring the community together and help reduce students' stress
- Convenience: whether students can take a break to breathe when and where they need it
We then came up with low-fidelity prototypes for our top three concepts.
 The purpose of this app is to teach users breathing techniques which can help relieve their stress, and to enhance a sense of togetherness by letting them breathe in similar rates/patterns with others. For this idea, users may be able to choose a belt type sensor or a microphone to measure their breathing patterns (in their smartphones). Click to view the low-fidelity interactive wireframe.
Concept 2
This is a collective, immersive experience that aims to let people (20 max) breathe together in a relaxing environment. Students are able to enter a pitch dark room and sit on futons, which have pressure sensors and can recognize when a student is sitting on it. After students put on their breathing sensor (belt) around their torso, they will be able to see their breaths visualized in wave form on a large display screen, which is mostly dark except for the breathing patterns.
Students will hear relaxing sounds of ocean waves that serve as an audio cue to let them know when they should inhale and exhale. In addition, there will hear a soothing background music, which is composed of a progression of simple music chords. The chords will become richer and richer as more people sit down and start to breathe; each person will contribute to part of the chord, so that the experience becomes even more immersive and relaxing as more people join.
In addition, we also hope to make this experience part of a fundraising process. We will let students know that when they breathe inside, they will be able to raise money for those in need of electricity. When they come out, they can see what they’ve contributed by breathing and relaxing themselves, which will motivate them to return and breathe more in the future.
Concept 3
Our third concept is a mobile breathing game. Users are able to turn their sources of stress into a kite, and then breathe to fly the kite and "blow their stress away." They can play the game with friends they know, or anonymous players on campus, using either a belt sensor or a microphone as input. After successfully completing each breathing session, users are rewarded with points based on their breathing quality, and can use the points to customize their kites. Click to view the low-fidelity interactive wireframe.
User Feedback
We presented our 3 ideas to potential users at Georgia Tech and gathered both qualitative and quantitative feedback. For Concept 1 and 3, we let users interact with our interactive wireframes; for Concept 2, we walked users through our storyboard, played them a sample background music , and presented them with a sample visualization video so that they can get a feel of the immersive environment (we let them know that we will create our own visualization with similar colors but more relaxing patterns if we choose concept 2 as our final concept). Users were encouraged to think aloud during the process.
After presenting each idea, we asked users to rate how frequently they'd use the solution, how effective they think it would be, and how likely they would recommend the solution to a friend. We also asked their favorite/least favorite part of each solution, and let them compare the three solutions. We created an affinity diagram based on the qualitative results we got.
Users unanimously preferred Concept 2 and 3 over Concept 1. Some mentioned that Concept 1 is similar to Concept 3, but the latter is more engaging because of the gamification factor. Therefore, we focused our analysis on comparing Concept 2 and Concept 3. The user feedback is summarized below.
Based on user feedback, we decided to modify and go ahead with Concept 3 (Collective Breathing Game App) because:
- Almost every student owns a smartphone. Having an app on one's phone makes it more convenient to perform breathing exercises when needed.
- The breathing visualization in the game is more concrete than in the pitch-dark room.
- Prototyping and creating a mobile app is more feasible and less expensive, but equally effective based on user feedback; if we created one or several dark rooms for breathing intervention, GT has to provide the space for us.
We also decided to make the following changes to Concept 3 to address some of its drawbacks identified through user feedback:


JavaScript Vs. HTML & CSS
HTML represents the content and page structure. CSS styles the content affecting things like positioning, colour, size etc.
Javascript adds Hollywood Effects, bells & whistles like animations, audio, interactive elements, transitions via scripts.
Javascript has a much steeper learning curve than HTML & CSS.
Control Flow
& Loops
Control Flow statements determine the order in which the program processes the code.
When making toast, we would :
- Get bread
- Put bread in toaster
- Remove bread from toaster
- Add spreads
- Eat
Statements like "if...else" are conditional and only actioned when a certain criteria has been met.
So if we don't check the bread for mold we could get food poisoning or else we could check the remaining bread slices to see if they're okay.
Loops maintain repetition until a condition is met.
So, if you happen to have a whole house of guests and you were on toast duty, your job would only be complete when everyone has had enough toast to eat.
Accessing Data Arrays
vs. Object Literals
Data Arrays are a fixed position (0-based index) of ordered elements that sit between square brackets and accessed by calling out a specific element from the array.
Eg. thisArray[4] would call the fifth item from thisArray.
Object Literals stores relative data.
Eg. The object "phone" could have data pertaining to:
- manufacturer
- model
- date of manufacture
- available storage space
- colour
This data is then accessed via dot notation,
Eg.phone.manufacturer
Or by bracket notation,
Eg.phone["available storage space"].
Functions
Functions are a block of code designed to perform a specific task. They contain parameters in curved brackets and the code to be executed in curly brackets.
The major advantage of using functions is that it allows you to define the code once, and then use it as many times it's required - which is not only a timesaver, but adheres to the acronym of DRY - Don't Repeat Yourself.


Last sync date and time is
Datewise visits for facility: Select Date
Encounters occurred in facility: Select start date end date
Diagnoses posted by facility: Select start date end date
Drugs prescribed by facility: Select start date end date
| Visit type | Count |
|---|
| Diagnosis Name | ICD10 Code | Count |
|---|
| Encounter type | Count |
|---|
| Trade name | Generic name | Reference code | Count |
|---|
| Trade name | Count |
|---|


@brianarn
)Often abbreviated as a11y
All about making accomodations for varying degrees of ability/disability
Sorta
We make websites and apps for people
People are worth caring for
Courtesy Microsoft's Inclusive Design
Better accessibility helps everyone
The better your content can be read by screen readers, the better search engines can read it
Can everyone consume this content?
Can everyone use this content or application?
Does this even make sense?
Can it be used in a broad variety of environments?
Web Content Accessibility Guidelines
POUR codified into rule sets
*:focus{ outline: none; }

<button class="close-button" aria-label="close">

</button>
Provides information to assistive technologies about how to handle elements
Provides additional context and information to assistive technologies about elements
Ensuring that focus adheres to POUR through dynamic applications


CARD DUEL
A card game for two players,
using standard playing cards
and a coin.
© 2014 Richard A. Benson
Created by Richard Benson, Devina Reetz
Suit names
- spades = swords
- hearts = cups
- clubs = wands
- diamonds = shields
Card values
- 2-10 = as named
- jack = 11
- queen = 12
- king = 13
- ace = 14
Instructions
1. players sit facing each other, with room for play area in-between
2. players begin with a score of 30 each (in units of HP, i.e. "Hit Points")
3. youngest player takes coin and announces, "As the youngest player, I go first." then places coin directly in front of self
4. eldest player takes deck and announces, "As the eldest player, I deal."
5. dealer shuffles deck if necissary
6. dealer deals 5 cards to other player, 5 cards to self, then places deck face down to their left
7. player 1 takes a turn, as so:
- player chooses any card from hand and places face up on left play area
- if the card is wands, player may stack more wand cards (face up) and must finish by stacking any card face down
8. player 2 takes turn, as in step 7, but without requiring any card on a wand card to be face down
9. player 1 flips to reveal any down facing card
10. player 1's card is scored, as so:
- if cups, card value is immediately added to player's score
- if wands, and top card is either shields or swords, all wand values are added to top card value and top card is evaluated, as below
- if swords, card value (including any wands) is noted. if other player is showing a shield, shield value (including any wands) is subtracted. resulting value, if greater than zero, is subtracted from other player's score. If other player's score reaches zero, player wins and game play ends
11. player 2's card is scored, as in step 10
12. dealer places played cards in discard pile to his right
13. coin is taken by player 2 and placed directly in front of themself to indicate that they are now player 1
14. if necissary, dealer reshuffles discard pile as new deck
15. dealer deals cards to player 1 as needed, such that they have 5 cards
16. dealer deals cards to self as needed, such that they have 5 cards
17. continue rounds (repeat from step 7) until a player wins
Special rules
Blaze of glory
If desired during turn, player places full hand down, visible, in front of play area. other player must do the same. all wands are ignored. other player's cups are totalled and applied to themself. player's swords are totalled and scored against other player's total shields. if other player is not defeated, other player wins and game play ends


BREAKING: Pitch invader Awal Suleman released from Police custody
Pitch invader Awal Suleman has finally been granted bail after spending two days in Police custody.
Awal Suleman was detained by the Cape Coast Police following his invasion of the pitch in Ghana's AFCON qualifier against South Africa.
The 25-year old former 400m runner was arrested by Police after he run onto the pitch in the 84th minute of Ghana's 2-0 win against the Bafana Bafana.
He spent two days in Police custody.
His detention has divided opinions in the public with a social media trend asking for the release Awal.
FA President Kurt Okraku and members of the Association in the central region ensured the zealous fan was taken through the process of bail successfully on Saturday morning.


This page displays a heatmap of IPv4 addresses using data from GeoLite2 by MaxMind. See github.com/salscode/ipv4-heatmap for the source code and more details.


Tennessee Titans' Taylor Lewan acknowledges mistakes: 'My penalties are f-----g awful'
by Ryan GaydosTennessee Titans offensive lineman Taylor Lewan decided to beat himself up Sunday over his own mistakes on the field.
Lewan told reporters Sunday after the team’s huge victory over the Kansas City Chiefs that his own mistakes were hurting the team and ripped himself for causing so many penalties.
SEATTLE SEAHAWKS' TYLER LOCKETT HOSPITALIZED AFTER SUFFERING 'SEVERE' LOWER-LEG INJURY
“First of all, before we even start this whole thing, my penalties are f-----g awful. I am 100 percent at issue with that,” Lewan said, according to The Tennessean. “It is not intentional. I do not mean to do it. My intentions are good. I am just trying to finish, and it is killing the team. I know that. You guys know that. No one needs to call me out because I’ve got a voice. I am completely screwing the team with the amount of penalties I have had, what, these last six games.”
Lewan is not wrong when it comes to his own penalties. After being suspended for the first four games of the season, the offensive tackle has racked up a team-high nine penalties. He has the third-highest penalties committed this season. Laremy Tunsil of the Houston Texans and David Bakhhtiari of the Green Bay Packers are tied for first.
SAN FRANCISCO 49ERS' CHASE MCLAUGHLIN SHANKS POTENTIAL GAME-WINNING FIELD GOAL INTO THE TUNNEL
No one on the Titans has been penalized more than six times this season.
In Sunday’s 35-32 victory, Lewan received penalties for unnecessary roughness and holding on back-to-back plays in the third quarter.
“It’s crazy. It’s horrible,” he said. “I cannot get penalties. I am sorry; there is no need to ask me about it because I know I am an absolute liability when it comes to penalties.”
CLICK HERE FOR MORE SPORTS COVERAGE ON FOXNEWS.COM
Tennessee is 5-5 this season. The Titans are on a bye next week and play the Jacksonville Jaguars on Nov. 24.


Welcome to Songify
Enter name to access your account
Login
Songify Selection Menu
Back
Title
Artist
Album
Duration


Work History
-
Jul 2016
News Corp BigDecisions, News Corp VCCircle
Data Science Analyst@BigDecisions, Software Engineer@VCCircle
(Jul 2016 - Present) | Mumbai, India
1. Here I have migrated the company databases from database from Amazon Redshift to Google BigQuery.
2. I am also currently involved in developing state of the art Asset allocation models, which involves use of machine learning in finance data. I have developed income and expense prediction models using various data related to family like family structure, size , dependents etc.
3. I have used Big Data handling technologies such as Apache Spark's MLlib to conduct text mining on life insurance claims.
4. I have also developed a complete full fledged Database and site search engine using Elastic search and deployed it as an AWS service. Here the data was migrated from Legacy MySQL System to a NoSQL database.
5. Made a Restful API Service to fetch data from Elasticsearch which handled all HTTP queries.
6. Designed a complete Serverless system of VCCEdge sytem , deployed it in AWS Lambda and authentication using Auth0. -
Aug 2015
News Corp BigDecisions
Data Science Consultant
(Aug 2015 - Feb 2016) | Mumbai, India
1. I worked as a Consultant contributing to their data advisory platform integrated into Calculators.
2. I have improved the performance of in house analytic dashboard by over 20 times by efficiently caching the data locally.
3. I have also clustered users who are beneficial to marketing and reduced the marketing costs by over 5% and improved click to buy performance by 8%.
4. I have also classified about a million medical receipts using natural language processing techniques into relavent disease categories.
5. I have developed mini tools using Rshiny like Smoking Calculator and eligible bachelor calculator.
-
Jun 2014
Indian Oil Corporation
Software Engineering Intern
(Jun 2014 - Jul 2014) | Mumabi, India
1.During my internship at IOCL I built an active news updating feed for users who don’t have any internet access.
2.I also helped them setting up their intranet service more efficiently by redesigning the complete interface with bootstrap theme. -
Dec 2013
Stupidsid.com
PHP Developer Intern
(Dec 2013 - Jan 2014) | Mumabi, India
1.I added chat feature for profiles to communicate and also tuned the performance of the website.
2.I also improved the performance of the grad school recommendation system which is a big hit among the students.
Projects
-
2016
RecoMob Opinion Mining for Product Enhancement
Research
The primary objective was to understand mobile features like positive and negative aspects of a product from user-provided reviews by determining the sentiment. I used a Deep Recurrent neural network to classify the reviews for which I converted 3000 reviews of top mobile brands from Amazon and Flipkart into sentiment treebank model and used this as my training set. I have consolidated my research into a paper titled RecoMob- Opinion Mining for Product Enhancement in 2017 IEEE International Conference on Computer Communication and Informatics
-
2015
English to SQL Machine Transaltion
Research
I used statistical machine translation to convert English sentences (questions/query) into SQL with the help of MOSES and MGIZA++ (Word Aligner) to translate sentences.The system was fed with parallel training text data containing 500 sentences, one in English and the other in SQL having its corresponding translation.
-
2014
All Round Student evaluation System
Research
This system was used to track a student’s academic records, extracurricular activities, research and work experience to predict their calibre and determine if they are all round students. The system not only made predictions but also suggested how students could improve their weaknesses.
-
2016
Airline delay prediction using Apache Hadoop and R
Course
Wrote a logistic regression model to predict the delay of flight aircraft using various parameters such as weather, flight reroute status, data time, airline carrier name, airport etc using R and Hadoop on 5 million flight details of US and analyzed different patterns of delay.
-
2015
SMS spam detection
Course
Conducted text analytics on SMSs and classified them into spam or ham using Support Vector Machine.
-
2014
Virtual Private Network using Raspberry Pi
Course
Wrote a simple shell script to switch to a private network whenever RPi connects to a network using wlan0 interface.
Education History
-
2012
Vivekanand Education Society's Institute of Technology(Uni of Mumbai)
Bachelor of Engineering , Computer Engineering
(2012 - 2016) | Mumbai, India
Programming Languages
Technical Skills
- Databases
- Google BigQuery, MySQL,PostgreSql, NoSQL
- Big Data technologies
- Apache Hadoop, Apache Spark, Hive, Spark Dataframes
- Search
- Apache Lucene, Elasticsearch
- Deep Learning
- Theano, Tensorflow
- Other
- Machine Learning, NLP and Specialized Mining Algorithms for Big Data
Verbal Language Skills
- NativeTamil
- ProfessionalEnglish
- ProfessionalHindi


| 19 Oct 1982 |
Albert A. Gore III born to Al Gore and Mary Elizabeth "Tipper" Gore. |
| 2 Apr 1989 |
Al Gore III suffers a near-fatal car accident after a Baltimore Orioles baseball game. Running across a busy street outside the stadium, he was struck by a car and thrown thirty feet. |
| 1996 |
Suspended from school for smoking marijuana. |
| 12 Aug 2000 |
Arrested for speeding, 97 MPH in a 55 MPH zone, Norfolk, NC. |
| 2001 |
Enrolls in Harvard University, his father's alma mater. |
| 5 Sep 2002 |
Arrested for DUI, Fort Myer, VA. |
| 19 Dec 2003 |
Arrested for marijuana posession, Bethesda, MD. |


| PERLCYGWIN(1) | Perl Programmers Reference Guide | PERLCYGWIN(1) |
NOTE: There are pre-built Perl packages available for Cygwin and a version of Perl is provided in the normal Cygwin install. If you do not need to customize the configuration, consider using one of those packages.
<http://www.cygwin.com/>
A recent net or commercial release of Cygwin is required.
At the time this document was last updated, Cygwin 1.7.16 was current.
NOTE: The binaries that are built will run on all Win32 versions. They do not depend on your host system (WinXP/Win2K/Win7) or your Cygwin configuration (binary/text mounts, cvgserver). The only dependencies come from hard-coded pathnames like /usr/local. However, your host system and Cygwin configuration will affect Perl's runtime behavior (see "TEST").
Set the "PATH" environment variable so that Configure finds the Cygwin versions of programs. Any not-needed Windows directories should be removed or moved to the end of your "PATH".
If you do not have nroff (which is part of the groff package), Configure will not prompt you to install man pages.
This will run Configure and keep a record:
./Configure 2>&1 | tee log.configure
If you are willing to accept all the defaults run Configure with -de. However, several useful customizations are available.
Any additional ld flags (NOT including libraries)? [none] -s Any special flags to pass to g++ to create a dynamically loaded library? [none] -s Any special flags to pass to gcc to use dynamic linking? [none] -s
or you can edit hints/cygwin.sh and uncomment the relevant variables near the end of the file.
The crypt package distributed with Cygwin is a Linux compatible 56-bit DES crypt port by Corinna Vinschen.
Alternatively, the crypt libraries in GNU libc have been ported to Cygwin.
As of libcrypt 1.3 (March 2016), you will need to install the libcrypt-devel package for Configure to detect crypt().
GDBM is available for Cygwin.
NOTE: The GDBM library only works on NTFS partitions.
BerkeleyDB is available for Cygwin.
NOTE: The BerkeleyDB library only completely works on NTFS partitions.
A port of SysV IPC is available for Cygwin.
NOTE: This has not been extensively tested. In particular, "d_semctl_semun" is undefined because it fails a Configure test and on Win9x the shm*() functions seem to hang. It also creates a compile time dependency because perl.h includes <sys/ipc.h> and <sys/sem.h> (which will be required in the future when compiling CPAN modules). CURRENTLY NOT SUPPORTED!
Included with the standard Cygwin netrelease is the inetutils package which includes libutil.a.
Undefining this symbol forces Perl to be compiled statically.
By default Perl does not use the "malloc()" included with the Perl source, because it was slower and not entirely thread-safe. If you want to force Perl to build with the old -Dusemymalloc define this.
Undefining this symbol disables the PerlIO abstraction. PerlIO is now the default; it is not recommended to disable PerlIO.
Multiplicity is required when embedding Perl in a C program and using more than one interpreter instance. This is only required when you build a not-threaded perl with "-Uuseithreads".
By default Perl uses 64 bit integers. If you want to use smaller 32 bit integers, define this symbol.
gcc supports long doubles (12 bytes). However, several additional long double math functions are necessary to use them within Perl ({atan2, cos, exp, floor, fmod, frexp, isnan, log, modf, pow, sin, sqrt}l, strtold). These are not yet available with newlib, the Cygwin libc.
Define this symbol if you want not-threaded faster perl.
Cygwin uses 64-bit integers for internal size and position calculations, this will be correctly detected and defined by Configure.
Use this to build perl outside of the source tree. Details can be found in the INSTALL document. This is the recommended way to build perl from sources.
Win9x does not correctly report "EOF" with a non-blocking read on a closed pipe. You will see the following messages:
But it also returns -1 to signal EOF, so be careful! WARNING: you can't distinguish between EOF and no data! *** WHOA THERE!!! *** The recommended value for $d_eofnblk on this machine was "define"! Keep the recommended value? [y]
At least for consistency with WinNT, you should keep the recommended value.
The following error occurs because of the Cygwin "#define" of "_LONG_DOUBLE":
Guessing which symbols your C compiler and preprocessor define... try.c:<line#>: missing binary operator
This failure does not seem to cause any problems. With older gcc versions, "parse error" is reported instead of "missing binary operator".
make 2>&1 | tee log.make
make test 2>&1 | tee log.make-test cd t; ./perl harness 2>&1 | tee ../log.harness
The same tests are run both times, but more information is provided when running as "./perl harness".
Test results vary depending on your host system and your Cygwin configuration. If a test can pass in some Cygwin setup, it is always attempted and explainable test failures are documented. It is possible for Perl to pass all the tests, but it is more likely that some tests will fail for one of the reasons listed below.
Failed Test List of failed ------------------------------------ io/fs.t 5, 7, 9-10 lib/anydbm.t 2 lib/db-btree.t 20 lib/db-hash.t 16 lib/db-recno.t 18 lib/gdbm.t 2 lib/ndbm.t 2 lib/odbm.t 2 lib/sdbm.t 2 op/stat.t 9, 20 (.tmp not an executable extension)
../ext/NDBM_File/ndbm.t 13 3328 71 59 83.10% 1-2 4 16-71 ../ext/ODBM_File/odbm.t 255 65280 ?? ?? % ?? ../lib/AnyDBM_File.t 2 512 12 2 16.67% 1 4 ../lib/Memoize/t/errors.t 0 139 11 5 45.45% 7-11 ../lib/Memoize/t/tie_ndbm.t 13 3328 4 4 100.00% 1-4 run/fresh_perl.t 97 1 1.03% 91
If you intend to run only on FAT (or if using AnyDBM_File on FAT), run Configure with the -Ui_ndbm and -Ui_dbm options to prevent NDBM_File and ODBM_File being built.
With NTFS (and no CYGWIN=nontsec), there should be no problems even if perl was built on FAT.
ext/IO/lib/IO/t/io_multihomed.t ext/IO/lib/IO/t/io_sock.t ext/IO/lib/IO/t/io_unix.t
See comment on fork in "Miscellaneous" below.
Cygwin pathnames are separated by forward (/) slashes, Universal Naming Codes (//UNC) are also supported Since cygwin-1.7 non-POSIX pathnames are discouraged. Names may contain all printable characters.
File names are case insensitive, but case preserving. A pathname that contains a backslash or drive letter is a Win32 pathname, and not subject to the translations applied to POSIX style pathnames, but cygwin will warn you, so better convert them to POSIX.
For conversion we have "Cygwin::win_to_posix_path()" and "Cygwin::posix_to_win_path()".
Since cygwin-1.7 pathnames are UTF-8 encoded.
Since cygwin-1.7 textmounts are deprecated and strongly discouraged.
When a file is opened it is in either text or binary mode. In text mode a file is subject to CR/LF/Ctrl-Z translations. With Cygwin, the default mode for an "open()" is determined by the mode of the mount that underlies the file. See "Cygwin::is_binmount"(). Perl provides a "binmode()" function to set binary mode on files that otherwise would be treated as text. "sysopen()" with the "O_TEXT" flag sets text mode on files that otherwise would be treated as binary:
sysopen(FOO, "bar", O_WRONLY|O_CREAT|O_TEXT)
"lseek()", "tell()" and "sysseek()" only work with files opened in binary mode.
The text/binary issue is covered at length in the Cygwin documentation.
PerlIO overrides the default Cygwin Text/Binary behaviour. A file will always be treated as binary, regardless of the mode of the mount it lives on, just like it is in UNIX. So CR/LF translation needs to be requested in either the "open()" call like this:
open(FH, ">:crlf", "out.txt");
which will do conversion from LF to CR/LF on the output, or in the environment settings (add this to your .bashrc):
export PERLIO=crlf
which will pull in the crlf PerlIO layer which does LF -> CRLF conversion on every output generated by perl.
The Cygwin "stat()", "lstat()" and "readlink()" functions make the .exe extension transparent by looking for foo.exe when you ask for foo (unless a foo also exists). Cygwin does not require a .exe extension, but gcc adds it automatically when building a program. However, when accessing an executable as a normal file (e.g., cp in a makefile) the .exe is not transparent. The install program included with Cygwin automatically appends a .exe when necessary.
Cygwin processes have their own pid, which is different from the underlying windows pid. Most posix compliant Proc functions expect the cygwin pid, but several Win32::Process functions expect the winpid. E.g. $$ is the cygwin pid of /usr/bin/perl, which is not the winpid. Use "Cygwin::pid_to_winpid()" and "Cygwin::winpid_to_pid()" to translate between them.
Under Cygwin, $^E is the same as $!. When using Win32 API Functions, use "Win32::GetLastError()" to get the last Windows error.
Using "fork()" or "system()" out to another perl after loading multiple dlls may result on a DLL baseaddress conflict. The internal cygwin error looks like like the following:
0 [main] perl 8916 child_info_fork::abort: data segment start: parent (0xC1A000) != child(0xA6A000)
or:
183 [main] perl 3588 C:\cygwin\bin\perl.exe: *** fatal error - unable to remap C:\cygwin\bin\cygsvn_subr-1-0.dll to same address as parent(0x6FB30000) != 0x6FE60000 46 [main] perl 3488 fork: child 3588 - died waiting for dll loading, errno11
See <http://cygwin.com/faq/faq-nochunks.html#faq.using.fixing-fork-failures> It helps if not too many DLLs are loaded in memory so the available address space is larger, e.g. stopping the MS Internet Explorer might help.
Use the perlrebase or rebase utilities to resolve the conflicting dll addresses. The rebase package is included in the Cygwin setup. Use setup.exe from <http://www.cygwin.com/setup.exe> to install it.
1.
On WinNT "chown()" can change a file's user and group IDs. On Win9x "chown()" is a no-op, although this is appropriate since there is no security model.
File locking using the "F_GETLK" command to "fcntl()" is a stub that returns "ENOSYS".
Win9x can not "rename()" an open file (although WinNT can).
The Cygwin "chroot()" implementation has holes (it can not restrict file access by native Win32 programs).
Inplace editing "perl -i" of files doesn't work without doing a backup of the file being edited "perl -i.bak" because of windowish restrictions, therefore Perl adds the suffix ".bak" automatically if you use "perl -i" without specifying a backup extension.
perl -e 'for $i (Cygwin::mount_table) {print join(" ",@$i),"\n";}' /bin c:\cygwin\bin system binmode,cygexec /usr/bin c:\cygwin\bin system binmode /usr/lib c:\cygwin\lib system binmode / c:\cygwin system binmode /cygdrive/c c: system binmode,noumount /cygdrive/d d: system binmode,noumount /cygdrive/e e: system binmode,noumount
system|user,binmode|textmode,exec,cygexec,cygdrive,mixed, notexec,managed,nosuid,devfs,proc,noumount
If the argument is "/cygdrive", then just the volume mount settings, and the cygdrive mount prefix are returned.
User mounts override system mounts.
$ perl -e 'print Cygwin::mount_flags "/usr/bin"' system,binmode,cygexec $ perl -e 'print Cygwin::mount_flags "/cygdrive"' binmode,cygdrive,/cygdrive
Certain Win32 programs called from cygwin programs might need some environment variable, such as e.g. ADODB needs %COMMONPROGRAMFILES%. Call Cygwin::sync_winenv() to copy all Win32 environment variables to your process and note that cygwin will warn on every encounter of non-POSIX paths.
make install 2>&1 | tee log.make-install
NOTE: If "STDERR" is redirected "make install" will not prompt you to install perl into /usr/bin.
You may need to be Administrator to run "make install". If you are not, you must have write access to the directories in question.
Information on installing the Perl documentation in HTML format can be found in the INSTALL document.
INSTALL README.cygwin README.win32 MANIFEST pod/perl.pod pod/perlport.pod pod/perlfaq3.pod pod/perldelta.pod pod/perl5004delta.pod pod/perl56delta.pod pod/perl561delta.pod pod/perl570delta.pod pod/perl572delta.pod pod/perl573delta.pod pod/perl58delta.pod pod/perl581delta.pod pod/perl590delta.pod pod/perlhist.pod pod/perlmodlib.pod pod/perltoc.pod Porting/Glossary pod/perlgit.pod Porting/checkAUTHORS.pl dist/Cwd/Changes ext/Compress-Raw-Zlib/Changes dist/Time-HiRes/Changes ext/Compress-Raw-Zlib/README ext/Compress-Zlib/Changes ext/DB_File/Changes ext/Encode/Changes ext/Sys-Syslog/Changes ext/Win32API-File/Changes lib/ExtUtils/CBuilder/Changes lib/ExtUtils/Changes lib/ExtUtils/NOTES lib/ExtUtils/PATCHING lib/ExtUtils/README lib/Net/Ping/Changes lib/Test/Harness/Changes lib/Term/ANSIColor/ChangeLog lib/Term/ANSIColor/README README.symbian symbian/TODO
cygwin/Makefile.SHs ext/IPC/SysV/hints/cygwin.pl ext/NDBM_File/hints/cygwin.pl ext/ODBM_File/hints/cygwin.pl hints/cygwin.sh Configure - help finding hints from uname, shared libperl required for dynamic loading Makefile.SH Cross/Makefile-cross-SH - linklibperl Porting/patchls - cygwin in port list installman - man pages with :: translated to . installperl - install dll, install to 'pods' makedepend.SH - uwinfix regen_lib.pl - file permissions NetWare/Makefile plan9/mkfile symbian/sanity.pl symbian/sisify.pl hints/uwin.sh vms/descrip_mms.template win32/Makefile win32/makefile.mk
t/io/fs.t - no file mode checks if not ntsec skip rename() check when not check_case:relaxed t/io/tell.t - binmode t/lib/cygwin.t - builtin cygwin function tests t/op/groups.t - basegroup has ID = 0 t/op/magic.t - $^X/symlink WORKAROUND, s/.exe// t/op/stat.t - no /dev, skip Win32 ftCreationTime quirk (cache manager sometimes preserves ctime of file previously created and deleted), no -u (setuid) t/op/taint.t - can't use empty path under Cygwin Perl t/op/time.t - no tzset()
EXTERN.h - __declspec(dllimport) XSUB.h - __declspec(dllexport) cygwin/cygwin.c - os_extras (getcwd, spawn, and several Cygwin:: functions) perl.c - os_extras, -i.bak perl.h - binmode doio.c - win9x can not rename a file when it is open pp_sys.c - do not define h_errno, init _pwent_struct.pw_comment util.c - use setenv util.h - PERL_FILE_IS_ABSOLUTE macro pp.c - Comment about Posix vs IEEE math under Cygwin perlio.c - CR/LF mode perliol.c - Comment about EXTCONST under Cygwin
ext/Compress-Raw-Zlib/Makefile.PL - Can't install via CPAN shell under Cygwin ext/Compress-Raw-Zlib/zlib-src/zutil.h - Cygwin is Unix-like and has vsnprintf ext/Errno/Errno_pm.PL - Special handling for Win32 Perl under Cygwin ext/POSIX/POSIX.xs - tzname defined externally ext/SDBM_File/sdbm/pair.c - EXTCONST needs to be redefined from EXTERN.h ext/SDBM_File/sdbm/sdbm.c - binary open ext/Sys/Syslog/Syslog.xs - Cygwin has syslog.h ext/Sys/Syslog/win32/compile.pl - Convert paths to Windows paths ext/Time-HiRes/HiRes.xs - Various timers not available ext/Time-HiRes/Makefile.PL - Find w32api/windows.h ext/Win32/Makefile.PL - Use various libraries under Cygwin ext/Win32/Win32.xs - Child dir and child env under Cygwin ext/Win32API-File/File.xs - _open_osfhandle not implemented under Cygwin ext/Win32CORE/Win32CORE.c - __declspec(dllexport)
ext/B/t/OptreeCheck.pm - Comment about stderr/stdout order under Cygwin ext/Digest-SHA/bin/shasum - Use binary mode under Cygwin ext/Sys/Syslog/win32/Win32.pm - Convert paths to Windows paths ext/Time-HiRes/HiRes.pm - Comment about various timers not available ext/Win32API-File/File.pm - _open_osfhandle not implemented under Cygwin ext/Win32CORE/Win32CORE.pm - History of Win32CORE under Cygwin lib/Cwd.pm - hook to internal Cwd::cwd lib/ExtUtils/CBuilder/Platform/cygwin.pm - use gcc for ld, and link to libperl.dll.a lib/ExtUtils/CBuilder.pm - Cygwin is Unix-like lib/ExtUtils/Install.pm - Install and rename issues under Cygwin lib/ExtUtils/MM.pm - OS classifications lib/ExtUtils/MM_Any.pm - Example for Cygwin lib/ExtUtils/MakeMaker.pm - require MM_Cygwin.pm lib/ExtUtils/MM_Cygwin.pm - canonpath, cflags, manifypods, perl_archive lib/File/Fetch.pm - Comment about quotes using a Cygwin example lib/File/Find.pm - on remote drives stat() always sets st_nlink to 1 lib/File/Spec/Cygwin.pm - case_tolerant lib/File/Spec/Unix.pm - preserve //unc lib/File/Spec/Win32.pm - References a message on cygwin.com lib/File/Spec.pm - Pulls in lib/File/Spec/Cygwin.pm lib/File/Temp.pm - no directory sticky bit lib/Module/CoreList.pm - List of all module files and versions lib/Net/Domain.pm - No domainname command under Cygwin lib/Net/Netrc.pm - Bypass using stat() under Cygwin lib/Net/Ping.pm - ECONREFUSED is EAGAIN under Cygwin lib/Pod/Find.pm - Set 'pods' dir lib/Pod/Perldoc/ToMan.pm - '-c' switch for pod2man lib/Pod/Perldoc.pm - Use 'less' pager, and use .exe extension lib/Term/ANSIColor.pm - Cygwin terminal info lib/perl5db.pl - use stdin not /dev/tty utils/perlbug.PL - Add CYGWIN environment variable to report
dist/Cwd/t/cwd.t ext/Compress-Zlib/t/14gzopen.t ext/DB_File/t/db-btree.t ext/DB_File/t/db-hash.t ext/DB_File/t/db-recno.t ext/DynaLoader/t/DynaLoader.t ext/File-Glob/t/basic.t ext/GDBM_File/t/gdbm.t ext/POSIX/t/sysconf.t ext/POSIX/t/time.t ext/SDBM_File/t/sdbm.t ext/Sys/Syslog/t/syslog.t ext/Time-HiRes/t/HiRes.t ext/Win32/t/Unicode.t ext/Win32API-File/t/file.t ext/Win32CORE/t/win32core.t lib/AnyDBM_File.t lib/Archive/Extract/t/01_Archive-Extract.t lib/Archive/Tar/t/02_methods.t lib/ExtUtils/t/Embed.t lib/ExtUtils/t/eu_command.t lib/ExtUtils/t/MM_Cygwin.t lib/ExtUtils/t/MM_Unix.t lib/File/Compare.t lib/File/Copy.t lib/File/Find/t/find.t lib/File/Path.t lib/File/Spec/t/crossplatform.t lib/File/Spec/t/Spec.t lib/Net/hostent.t lib/Net/Ping/t/110_icmp_inst.t lib/Net/Ping/t/500_ping_icmp.t lib/Net/t/netrc.t lib/Pod/Simple/t/perlcyg.pod lib/Pod/Simple/t/perlcygo.txt lib/Pod/Simple/t/perlfaq.pod lib/Pod/Simple/t/perlfaqo.txt lib/User/grent.t lib/User/pwent.t
| 2019-10-21 | perl v5.30.3 |


Config is an agnostic key-based configuration library, built on top of the concept of holding reference to a value in the configuration instead of holding the value itself.
Map oriented
The library is totally map-oriented, it stores and reads values from Map
s, also even if there is a concept of Storage
classes, which is the medium of the data storage, and they could store data in any format, most of the common implementations uses Maps and all keys are String-only, this is intentional, and we focus only in storing data in Map
s.
All values are serialized upfront before being stored, in other words, when they are sent to a Storage
medium, they are already serialized using built-in and custom serializers. Any library capable of rendering Map
s could take advantage of Config
.
Key based/Pointer oriented
Config uses a pointer-oriented data access and write, this allows data changes to be reflected all across the application, and config-reloading could be simply implemented by using File Watchers.
Agnostic
Config does not care about the final format of the configuration file, it only manages data in a Map
. The class responsible for loading and saving this Map
in the configuration is the Backend
class. It also provides which types are supported to be stored in the Map
without the serialization and deserialization process.
We provide common backend implementations for most used configuration languages, such as Json, Yaml, Toml and XML. Since all of those libraries are able to render Maps
as Strings, they become very handful for application configuration.
Serialization supported
Serialization of custom types are supported through Serializers
registry and Serializer
implementation, and it is very easy to implement your own serializer. Also, API provides interfaces for implementing serialization of complex types.
Type information retention
Config depends on types provided by TypeInfo
tokens for implementing Serialization for Map
, List
and user defined types.
This allows generic types to be serialized correctly and using the right serializer, instead of relying on the type of the object itself. This means that types must be explicitly provided, and the information must be retained at runtime.
Getting Started
Config and official backends are available through jitpack.io.
Gradle (Kotlin)
val config_version by project
repositories {
mavenCentral()
maven("https://jitpack.io")
}
dependencies {
implementation("com.github.JonathanxD.Config:Config:$config_version")
implementation("com.github.JonathanxD.Config:Config-Toml:$config_version") // Toml backend
}
Reading and writing values
Given the following Toml config:
[server]
addr = "<IP_ADDRESS>"
port = 8080
You could write something like this to read and write values:
public class ServerConfig {
private final Config config;
private final Key<String> addr;
private final Key<Long> port;
public ServerConfig(Path configPath) {
ConfigIO io = ConfigIO.path(configPath, StandardCharsets.UTF_8);
Backend backend = new TomlBackend(io);
this.config = new Config(backend);
this.config.load(); // Config file must exists
Key<Void> serverSection = this.config.getRootKey().getKeySection("server");
this.addr = serverSection.getKey("addr", CommonTypes.STRING);
this.port = serverSection.getKey("port", CommonTypes.LONG);
}
public String getAddress() {
return this.addr.getValue();
}
public long getPort() {
return this.port.getValue();
}
public void setPort(long port) {
this.port.setValue(port);
}
public void save() {
this.config.save();
}
}
Serialization
Config already implements serializers for basic types and date types, and some JwIUtils library types, such as Text
and TypeInfo
(you could find all here), however, sometimes you want to work with your custom types (or 3rd party types) which does not have default serializers implemented, for this, Config provides Serializers
class as registry base for Serializer
implementations.
Basic Serializer
record User(String name, String email) {
}
public class UserSerializer implements Serializer<User> {
@Override
public void serialize(User value,
Key<User> key,
TypeInfo<?> typeInfo,
Storage storage,
Serializers serializers) {
key.getKey("name", String.class).setValue(value.name());
key.getKey("email", String.class).setValue(value.email());
}
@Override
public User deserialize(Key<User> key,
TypeInfo<?> typeInfo,
Storage storage,
Serializers serializers) {
String name = key.getKey("name", String.class).getValue();
String email = key.getKey("email", String.class).getValue();
return new User(name, email);
}
}
Also, sometimes you just want to store a single value, for this you could use Key.getAs
to transform the Key type:
record User(String name) {
}
public class UserSerializer implements Serializer<User> {
@Override
public void serialize(User value,
Key<User> key,
TypeInfo<?> typeInfo,
Storage storage,
Serializers serializers) {
key.getAs(String.class).setValue(value.name());
}
@Override
public User deserialize(Key<User> key,
TypeInfo<?> typeInfo,
Storage storage,
Serializers serializers) {
return new User(key.getAs(String.class).getValue());
}
}
Calling other serializers
Config automatically invoke other serializers to proceed with the serialization when a value is not supported by the backend, so the code below will work correctly and serialize the LocalDate
as well.
record User(LocalDate registrationDate, String name) {
}
public class UserSerializer implements Serializer<User> {
@Override
public void serialize(User value,
Key<User> key,
TypeInfo<?> typeInfo,
Storage storage,
Serializers serializers) {
key.getKey("registrationDate", LocalDate.class).setValue(value.email());
key.getKey("name", String.class).setValue(value.name());
}
@Override
public User deserialize(Key<User> key,
TypeInfo<?> typeInfo,
Storage storage,
Serializers serializers) {
LocalDate registrationDate = key.getKey("registrationDate", LocalDate.class).getValue();
String name = key.getKey("name", String.class).getValue();
return new User(registrationDate, name);
}
}
However, when working with complex types which need an intermediate storage, this is not enough. For these cases, you could use the Serializers
provided to serialize
and deserialize
methods. See below a hardcore version of serialize
which does the same thing as the version above, however using intermediate storage:
record User(LocalDate registrationDate, String name) {
}
public class UserSerializer implements Serializer<User> {
@Override
public void serialize(User value, Key<User> key, TypeInfo<?> typeInfo, Storage storage, Serializers serializers) {
Map<Object, Object> newMap = new LinkedHashMap<>();
Map<String, Object> temp = new LinkedHashMap<>();
Storage newStorage = Storage.createMapStorage(key, temp);
{
Key<LocalDate> regDateKey = key.getAs("registrationDate", LocalDate.class, newStorage);
Object date = serializers.serializeUncheckedAndGet(value.getRegistrationDate(), regDateKey);
temp.clear();
newMap.put("registrationDate", date);
}
{
Key<String> nameKey = key.getAs("name", String.class, newStorage);
Object name = serializers.serializeUncheckedAndGet(value.getName(), nameKey);
temp.clear();
newMap.put("name", name);
}
storage.pushValue(key, newMap);
}
@Override
public User deserialize(Key<User> key,
TypeInfo<?> typeInfo,
Storage storage,
Serializers serializers) {
LocalDate registrationDate = key.getKey("registrationDate", LocalDate.class).getValue();
String name = key.getKey("name", String.class).getValue();
return new User(registrationDate, name);
}
}
This approach is used by ListSerializer
and MapSerializer
to correctly serialize values in a controlled Storage
medium. When you call serializers.serialize*
with this intermediate storage, instead of serializing the value inside the Storage
provided to serialize
method, it does by serializing the value inside the provided Storage
medium, thus serializing the value inside a controlled context, which will not overwrite or modify the values already stored.
With this, introspecting the values and changing the structure of them is more safe, as it will not damage the main storage medium (commonly the Config
storage), and at in the end of serialization process, you can push to the main storage only the values you care about.
Backend
class
Config itself does not implement any configuration format, instead, it backs the configuration loading and saving logic to a backend.
Currently, the following backend implementations are officially supported:
- Config-Jackson (Using fasterxml.jackson)
- Config-XML (Using fasterxml.jackson-xml)
- Config-Json (Using JSON.simple)
- Config-Yaml (Using snakeyaml YAML 1.1 compliant)
- Config-Yaml-1.2 (Using snakeyaml-engine YAML 1.2 compliant)
- Config-Toml (Using tomlj 1.0.0-rc.1 compliant. With an experimental renderer, as of the time the implementation was written, there is no official TOML writer for Java).
You could choose one of these backends to load and save your configuration. Also, you are free to write your own Backend implementation, as they are very simple. Config works solely with Java Map
, List
, String
and primitive types.
Also, Config is not a real-time configuration editor, it will not save the configuration for every update that occurs in the Config object, you need to manually save and load using Config.save
and Config.load
. If you need a real-time configuration editor with reload capabilities, you could easily write a File Watcher or Scheduler to reload configuration using those methods.
Jackson Backend
Writes and reads json using Jackson ObjectMapper.
Jackson-XML Backend
Writes and reads XML using Jackson XmlMapper.
Json backend
Writes and reads json using JSON.simple.
Yaml Backend
Writes and reads Yaml 1.1 using snakeyaml.
Toml Backend
Reads TOML compliant to 1.0.0-rc.1 using tomlj and writes TOML using a custom implementation of TOML rendering.
Note
The Toml backend is able to read any TOML configuration file compliant to 1.0.0-rc.1, however, for writing Toml config, it uses an experimental renderer as there is no recent and maintained Toml library for Java which allows Toml rendering.
This means that Toml files saved by TOML backend ends up being different from the original, and is not rendered in the best way it could be following the Toml standards.
YAML 1.2 Backend
Reads and writes Yaml 1.2 using snakeyaml-engine.
Note
There is a Yaml 1.2 backend which uses snakeyaml-engine to read and write yaml files, however, since Config
is fully map-oriented, yaml files which does not have any keys, like this one:
- First
- Second
- Third
Are loaded normally, but an intermediate section is created, named .
. This section allows loading those values normally, and rendering them is made through a special logic which keeps this structure (as long as there is no new keys defined).
Also, Config
calls the Backend
to resolve the root key, then the Yaml backend resolve the .
as default key, thus allowing to load those values seamlessly without careing about the intermediate section:
public class ConfigLoader {
public static Config loadYaml() {
// Yaml loading logic...
Config config = new Config(new YamlBackend(...));
TypeInfo<List<String>> stringListTypeInfo = TypeInfo.builderOf(List.class).of(String.class).buildGeneric();
Key<List<String>> values = config.getRootKey().getAs(stringListTypeInfo);
}
}
It is important to know this, because creating a configuration with a key named .
with a List value will trigger this behavior. But only for Yaml 1.2 backend.
Maps inside the List
When there is a map inside the list, like this:
- First
- Second
- Third
- Somedata: value
Config will be able to handle this situation, but with limited capabilities. It is able to resolve the somedata
key and change its value:
public class ConfigLoader {
public static Config loadYaml() {
// Yaml loading logic...
Config config = new Config(new YamlBackend(...));
Key<List<Object>> values = config.getRootKey().getAs(CommonTypes.LIST_OF_OBJECT);
Key<String> somedata = values.getKey("somedata", String.class);
somedata.setValue("newValue");
}
}
It is able to create new maps inside the list when needed:
public class ConfigLoader {
public static Config loadYaml() {
// Yaml loading logic...
Config config = new Config(new YamlBackend(...));
Key<List<Object>> values = config.getRootKey().getAs(CommonTypes.LIST_OF_OBJECT);
Key<String> somedata = values.getKey("somedata2", String.class); // new map is created to handle this key
somedata.setValue("newValue2");
}
}
And access and change values in a specific index of a list (which must exists):
public class ConfigLoader {
public static Config loadYaml() {
// Yaml loading logic...
Config config = new Config(new YamlBackend(...));
Key<List<Object>> values = config.getRootKey().getAs(CommonTypes.LIST_OF_OBJECT);
Key<String> index0 = IndexKey.forKeyAndIndex(values, 0);
index0.setValue("newValue2");
}
}
However, not all features that Yaml 1.2 supports were tested.
Config
class
Config is a fully map-based Storage
implementation, it uses a LinkedHashMap
as storage medium, while checks for supported value types using Backend.supports
. Thus, every value stored in this class is directly stored in the wrapped LinkedHashMap
, and when configuration need to be saved to file, it just sends an unmodifiable copy of this map
to the backend
(it must be a copy and unmodifiable to avoid concurrency issues).
Also, Config is not Thread-safe by default, this means that to concurrently write values, you need to implement a locking logic to allow only one modification at a time. We plan to provide a concurrent capable implementation in the future.
Key
The most important class of the Config library. A Key represents a pointer to a value in the configuration file, tied to a key-path. With this pointer you are able to read and write values directly to the Storage
medium without even needing to hold a reference to the Storage
itself. Also, you could have different pointers to the same value, and changing a value through one pointer will be reflected in all other pointers (they are not really reflected, they just read the value from the same path, so if the value changes, anyone pointing to this path has access to the new value).
KeySpec
Is a specification of a Key
name and type, with KeySpec
you refer to a part of the key path. It is used to implement a more readable Key
access with constant path parts.
Serializers
Config also supports serializers. This is very important for the library as it only works with Maps
, Lists
, Strings
and primitive types (different backends could provide support for others types, but the official ones does not).
Serializers are registered and provided through Serializers
class, custom serializers must implement Serializer
interface and be registered in Config.getSerializers
.


Vector Width
Vector Height
Zoom Preview Scale
Background Color
white
black
yellow
blue
red
gray
Underlay Image Select
Underlay Opacity
Onion Skin Diff
Spaceless SVG
Spaceless SVG (Base64)