com.threed.jpct
Interface IVertexController
- All Known Implementing Classes:
- GenericVertexController
- public interface IVertexController
This interface defines a VertexController. A VertexController is a way to
manipulate vertices of already constructed Object3Ds. It can be added to a
Mesh to alter the mesh's vertices according to the controller's
implementation.
A VertexController is the only way in jPCT to gain access to vertex data of
objects. This concept, which may look a bit too complicated for the task at
first glance, is required to keep jPCT's internal vertex representations
encapsulated while giving the possibility to modify vertices in a fast,
simple and convinient way.
Usually, there's no need to implement this interface directly but to extend
the abstract, generic implementation jPCT provides.
- See Also:
GenericVertexController
,
Mesh.setVertexController(com.threed.jpct.IVertexController,
boolean)
,
FrameBuffer.getLock()
|
Field Summary |
static boolean |
ALTER_SOURCE_MESH
The VertexController will modify the source data when applied, i.e.
|
static boolean |
PRESERVE_SOURCE_MESH
The VertexController will start with a "fresh" source mesh everytime it's
being applied. |
|
Method Summary |
void |
apply()
Applies the controller's modifications to the mesh. |
void |
cleanup()
Like setup(), this method can be overwritten to do some additional
work...this time when the controller will be removed. |
void |
destroy()
This method will be called when the controller will be removed from a
Mesh. |
SimpleVector[] |
getDestinationMesh()
Returns the destination mesh's vertex data. |
SimpleVector[] |
getDestinationNormals()
Returns the destination mesh's normals. |
int |
getMeshSize()
Returns the size of the mesh. |
int[] |
getPolygonIDs(int vertex,
int max)
Returns the polygon IDs of the polygons that are using the vertex
"number". |
SimpleVector[] |
getSourceMesh()
Returns the source mesh's vertex data, i.e. the vertex-data that needs
modification. |
SimpleVector[] |
getSourceNormals()
Returns the source mesh's normals, i.e. the normals that need
modification. |
float[][] |
getTangentVectors()
If available, this will return the tangent vectors for the mesh. |
boolean |
init(Mesh mesh,
boolean modify)
Initialize the VertexController with a mesh to modify and a operating
mode. |
void |
refreshMeshData()
Refreshes the controller's data with the data taken directly from the
Mesh. |
boolean |
setup()
This method can be overwritten to do some additional setup work. |
void |
updateMesh()
Alters the actual Mesh to reflect the modifications that have been
applied to the DestinationMesh- and DestinationNormals-arrays. |
ALTER_SOURCE_MESH
public static final boolean ALTER_SOURCE_MESH
- The VertexController will modify the source data when applied, i.e.
everything the controller does to the mesh is cumulative over time.
- See Also:
- Constant Field Values
PRESERVE_SOURCE_MESH
public static final boolean PRESERVE_SOURCE_MESH
- The VertexController will start with a "fresh" source mesh everytime it's
being applied.
- See Also:
- Constant Field Values
init
public boolean init(Mesh mesh,
boolean modify)
- Initialize the VertexController with a mesh to modify and a operating
mode. There is no need to call this method from inside an application.
- Parameters:
mesh
- the Mesh the controller should be assigned tomodify
- the mode
- Returns:
- true, if the controller has been intialized correctly
- See Also:
ALTER_SOURCE_MESH
,
PRESERVE_SOURCE_MESH
setup
public boolean setup()
- This method can be overwritten to do some additional setup work. This
method is called by init() and doesn't have to be called directly.
- Returns:
- true, if the setup went fine
apply
public void apply()
- Applies the controller's modifications to the mesh. This method has to be
implemented by any specific implementation. It's where the actual work is
done.
The basic idea is to read the source vertices and normals provided by
getSourceMesh() and getSourceNormals() and to put the modified results
into the corresponding SimpleVectors returned by getDestinationMesh() and
getDestinationNormals(). The SimpleVectors in the destination
SimpleVector-array may be overwritten with the new data, while the
source-arrays should remain untouched.
- See Also:
getSourceMesh()
,
getSourceNormals()
,
getDestinationMesh()
,
getDestinationNormals()
getSourceMesh
public SimpleVector[] getSourceMesh()
- Returns the source mesh's vertex data, i.e. the vertex-data that needs
modification. Every SimpleVector in this array represents a vertex in the
mesh. However, there's no information which vertex exactly (because they
don't have ids or something).
Read the data from this array, but don't modify it.
- Returns:
- the source mesh's vertices
getSourceNormals
public SimpleVector[] getSourceNormals()
- Returns the source mesh's normals, i.e. the normals that need
modification. Every SimpleVector in this array represents a normal in the
mesh. The normal at the specific index is the normal of the corresponding
vertex in the SourceMesh-array.
Read the data from this array, but don't modify it.
- Returns:
- the source mesh's normals
getDestinationMesh
public SimpleVector[] getDestinationMesh()
- Returns the destination mesh's vertex data. The new vertices will be
stored in these SimpleVectors. There's no need to replace the
SimpleVectors in this array with new ones. Just set their x,y and z
components to the new values.
Write into the SimpleVectors of this array, don't read from them.
- Returns:
- the destination mesh's vertices
getDestinationNormals
public SimpleVector[] getDestinationNormals()
- Returns the destination mesh's normals. The new normals will be stored in
these SimpleVectors. Calculating the vertex normal of a modified vertex
is not always cheap. In some cases, one may get away with not modifying
the normals at all. This will cause slightly wrong lighting, but eases
the calculations.
Write into the SimpleVectors of this array, don't read from them.
- Returns:
- the destination mesh's normals
getMeshSize
public int getMeshSize()
- Returns the size of the mesh. This is the length all SimpleVector-array
returned by the methods above will have.
- Returns:
- the size of the mesh
updateMesh
public void updateMesh()
- Alters the actual Mesh to reflect the modifications that have been
applied to the DestinationMesh- and DestinationNormals-arrays. No need to
call this method directly from an application.
refreshMeshData
public void refreshMeshData()
- Refreshes the controller's data with the data taken directly from the
Mesh. This can be useful to reflect changes to the controller that have
been applied to the mesh outside of the controller.
destroy
public void destroy()
- This method will be called when the controller will be removed from a
Mesh. No need to call this method directly.
- See Also:
Mesh.removeVertexController()
cleanup
public void cleanup()
- Like setup(), this method can be overwritten to do some additional
work...this time when the controller will be removed. This method will be
called from within destroy(). No need to call it directly.
- See Also:
Mesh.removeVertexController()
getPolygonIDs
public int[] getPolygonIDs(int vertex,
int max)
- Returns the polygon IDs of the polygons that are using the vertex
"number". This can be used to determine which vertices belong to a
polygon, which could be useful in some VertexControllers. This should be
done at setup time, not at runtime.
- Parameters:
vertex
- the number of the vertexmax
- the maximum of IDs to return
- Returns:
- the IDs
getTangentVectors
public float[][] getTangentVectors()
- If available, this will return the tangent vectors for the mesh. For
these vectors, there's no difference between source and destination. You
can read from as well as write to this array.
- Returns:
- the tangent vectors or null, if none have been assigned


Patrick Bon Rodriguez is an artist. By nature he knows how to deconstruct himself because without doing so he cannot create.
He has studied the arts, and he even lives them. Because really, life is the best masterpiece there is.


--- title: Gradient Blending keywords: fastai sidebar: home_sidebar summary: "Callback used to apply gradient blending to multi-modal models." description: "Callback used to apply gradient blending to multi-modal models." nb_path: "nbs/062_callback.gblend.ipynb" ---
This is an unofficial PyTorch implementation by Ignacio Oguiza<EMAIL_ADDRESS>based on: Wang, W., Tran, D., & Feiszli, M. (2020). What Makes Training Multi-Modal Classification Networks Hard?. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (pp. 12695-12705).
from fastai.data.transforms import *
from tsai.data.all import *
from tsai.models.utils import *
from tsai.models.XCM import *
from tsai.models.TabModel import *
from tsai.models.MultiInputNet import *
from tsai.learner import *
dsid = 'NATOPS'
X, y, splits = get_UCR_data(dsid, split_data=False)
ts_features_df = get_ts_features(X, y)
tfms = [None, [Categorize()]]
batch_tfms = TSStandardize()
ts_dls = get_ts_dls(X, y, splits=splits, tfms=tfms, batch_tfms=batch_tfms)
ts_model = build_ts_model(XCM, dls=ts_dls, window_perc=.5)
# ts features
cat_names = None
cont_names = ts_features_df.columns[:-2]
y_names = 'target'
tab_dls = get_tabular_dls(ts_features_df, cat_names=cat_names, cont_names=cont_names, y_names=y_names, splits=splits)
tab_model = build_tabular_model(TabModel, dls=tab_dls)
# mixed
mixed_dls = get_mixed_dls(ts_dls, tab_dls)
MultiModalNet = MultiInputNet(ts_model, tab_model, c_out=mixed_dls.c)
gblend = GBlend(V_pct=.5, n=(10, 5), sel_metric=None)
learn = Learner(mixed_dls, MultiModalNet, metrics=[accuracy, RocAuc()], cbs=gblend)
learn.fit_one_cycle(1, 1e-3)


Each picture is put up, front and center, for the whole world to enjoy. Our pages are clean and arranged to show as much of the art as possible. It is easy to find your work and view others' art. This is a great way, not only to show your work to your friends and family, but find inspiration for your next big project.
You get up early. You get your camera gear and tripods to set out for an adventure. You can display your photos of your most recent getaway or of a picture of your own backyard. You could even make a painting of your backyard and post it to our site. Everything is welcome!
Do you love animals? Give them a second home here! If you have plenty of time and pets to share, come and create your own community of pet lovers.
Perhaps you have a certain vision when it comes to art. You read all of the latest findings of ancient authors. You like to rediscover works painted hundreds of years ago. Maybe your art is a reflection of the bounds you want to overcome. We welcome it all!
You can always find interesting places and architecture. There are so many great buildings, it would be a shame if someone didn't take the time to capture these works. It would be a greater shame if they were never displayed.


Bookshelf is a catalyst for people to feel,
see, and claim their power through reading.
At our core, Bookshelf operates on
imagination, individuality, inclusivity, &
impact.
We deliver optimistic and diverse
storytelling, experiences, and points of
view to our audiences of smart, curious,
passionate individuals.
At Bookshelf, we make magic. We dream
it, and then do it-together-everyday
reinventing what's possible.


title = "Search" url = "/search" layout = "singular" description = "Search parking." is_hidden = 0 ==


Quicksort Proficiency Exercise Help Page
This exercise asks you to reproduce the high-level behavior of the Quicksort algorithm on a random sequence of 10 values. Initially you will be presented with an array of numbers. Follow the steps below to complete the exercise.
Steps:
- Select the pivot
- Add the index number of the right-most element in the list with the index of the left-most element and divide by 2.
- If necessary, truncate the result (drop the decimal value) to create an integer.
- This integer is the index of the pivot. Click it.
- Move the pivot to the end
- Click the right-most element of the list
- Select the range to partition
- Click an element to select it as the left bound. An blue indicator should appear above the value you selected.
- Once the left bound has been set, click another element to select it as the right bound. An red indicator should appear above this value.
- If the list contains a single element, you must click it twice to set the left and right bounds on the same element. When you do a single purple indicator will appear above it.
- To change your bounds, simply click an element again to deselect it. Note: If the left and right bounds are set on the same element and you wish to move the left bound, you must move the right bound to another (temporary) location, move the left bound then move the right bound to its final location.
- Partition the selected range
- Click 'Partition'.
- Move the pivot to its final sorted location
- Scanning from the left and without passing the pivot, find the first element with a value greater than or equal to the pivot value. Click it.
- If all values to the left of the pivot and less than the pivot value, move on to the next step without clicking anything.
- Mark the pivot as sorted
- If you followed the steps above properly, the pivot value will now be in its final sorted position. Click 'Mark Selected as Sorted'. The element will change color to indicate that it is sorted.
- Repeat as necessary on sublists
- If there are uncolored elements to the left of the sorted pivot element, repeat this process on the unsorted left sublist.
- Once all values to the left are sorted, repeat the process as necessary on the unsorted right sublist.
- Always sort the left sublists before the right sublists.
- Note: If a sublist contains a single element, you may select it and immediately click 'Mark Selected as Sorted'.
Other Controls:
- If you want to back up a step and try again, click the "Undo" button.
- If you want to restart the exercise, click the "Reset" button.
- If you want to see the correct answer, click the "Model Answer" button to see a slideshow in a pop-up window.
- Note: Viewing the answer will prevent you from obtaining credit for the current problem instance. So just hit "reset" when you are done viewing the model answer.
- The button with gears on it will let you set some options such as the animation speed (for the slideshow model answer).
- The "About" button will tell you about who wrote this, etc.
- The "Help" button got you here.


import deepchem as dc
import numpy as np
import unittest
[docs]def generate_sequences(sequence_length, num_sequences):
for i in range(num_sequences):
seq = [
np.random.randint(10)
for x in range(np.random.randint(1, sequence_length + 1))
]
yield (seq, seq)
[docs]class TestSeqToSeq(unittest.TestCase):
[docs] def test_int_sequence(self):
"""Test learning to reproduce short sequences of integers."""
sequence_length = 10
tokens = list(range(10))
s = dc.models.SeqToSeq(
tokens,
tokens,
sequence_length,
encoder_layers=2,
decoder_layers=2,
embedding_dimension=150,
learning_rate=0.01,
dropout=0.1)
# Train the model on random sequences. We aren't training long enough to
# really make it reliable, but I want to keep this test fast, and it should
# still be able to reproduce a reasonable fraction of input sequences.
s.fit_sequences(generate_sequences(sequence_length, 25000))
# Test it out.
tests = [seq for seq, target in generate_sequences(sequence_length, 50)]
pred1 = s.predict_from_sequences(tests, beam_width=1)
pred4 = s.predict_from_sequences(tests, beam_width=4)
embeddings = s.predict_embeddings(tests)
pred1e = s.predict_from_embeddings(embeddings, beam_width=1)
pred4e = s.predict_from_embeddings(embeddings, beam_width=4)
count1 = 0
count4 = 0
for i in range(len(tests)):
if pred1[i] == tests[i]:
count1 += 1
if pred4[i] == tests[i]:
count4 += 1
assert pred1[i] == pred1e[i]
assert pred4[i] == pred4e[i]
# Check that it got at least a quarter of them correct.
assert count1 >= 12
assert count4 >= 12
[docs] def test_aspuru_guzik(self):
"""Test that the aspuru_guzik encoder doesn't hard error.
This model takes too long to fit to do an overfit test
"""
train_smiles = [
'Cc1cccc(N2CCN(C(=O)C34CC5CC(CC(C5)C3)C4)CC2)c1C',
'Cn1ccnc1SCC(=O)Nc1ccc(Oc2ccccc2)cc1',
'COc1cc2c(cc1NC(=O)CN1C(=O)NC3(CCc4ccccc43)C1=O)oc1ccccc12',
'O=C1/C(=C/NC2CCS(=O)(=O)C2)c2ccccc2C(=O)N1c1ccccc1',
'NC(=O)NC(Cc1ccccc1)C(=O)O', 'CCn1c(CSc2nccn2C)nc2cc(C(=O)O)ccc21',
'CCc1cccc2c1NC(=O)C21C2C(=O)N(Cc3ccccc3)C(=O)C2C2CCCN21',
'COc1ccc(C2C(C(=O)NCc3ccccc3)=C(C)N=C3N=CNN32)cc1OC',
'CCCc1cc(=O)nc(SCC(=O)N(CC(C)C)C2CCS(=O)(=O)C2)[nH]1',
'CCn1cnc2c1c(=O)n(CC(=O)Nc1cc(C)on1)c(=O)n2Cc1ccccc1'
]
tokens = set()
for s in train_smiles:
tokens = tokens.union(set(c for c in s))
tokens = sorted(list(tokens))
max_length = max(len(s) for s in train_smiles) + 1
s = dc.models.tensorgraph.models.seqtoseq.AspuruGuzikAutoEncoder(
tokens, max_length)
def generate_sequences(smiles, epochs):
for i in range(epochs):
for s in smiles:
yield (s, s)
s.fit_sequences(generate_sequences(train_smiles, 100))
# Test it out.
pred1 = s.predict_from_sequences(train_smiles, beam_width=1)
pred4 = s.predict_from_sequences(train_smiles, beam_width=4)
embeddings = s.predict_embeddings(train_smiles)
pred1e = s.predict_from_embeddings(embeddings, beam_width=1)
pred4e = s.predict_from_embeddings(embeddings, beam_width=4)
for i in range(len(train_smiles)):
assert pred1[i] == pred1e[i]
assert pred4[i] == pred4e[i]
[docs] def test_variational(self):
"""Test using a SeqToSeq model as a variational autoenconder."""
sequence_length = 10
tokens = list(range(10))
s = dc.models.SeqToSeq(
tokens,
tokens,
sequence_length,
encoder_layers=2,
decoder_layers=2,
embedding_dimension=128,
learning_rate=0.01)
# Actually training a VAE takes far too long for a unit test. Just run a
# few steps of training to make sure nothing crashes, then check that the
# results are at least internally consistent.
s.fit_sequences(generate_sequences(sequence_length, 1000))
for sequence, target in generate_sequences(sequence_length, 10):
pred1 = s.predict_from_sequences([sequence], beam_width=1)
embedding = s.predict_embeddings([sequence])
assert pred1 == s.predict_from_embeddings(embedding, beam_width=1)


In my last post, I found that experience has a significant impact on the salary of engineers. Is the significance of experience on wages unique to engineers or are there similar correlations in other occupational groups?
I will use the same model in principal as in my previous post to calculate the significance of age. I will not use sex as an explanatory variable since there are occupational groups that do not have enough data for both genders. I will also use a polynomial of degree three since this provides a significant model fit for some occupational groups.
There are still occupational groups with too little data for regression analysis. More than 30 posts are necessary to fit both age and year.
The R-value from the Anova table is used as the single value to discriminate how much the age and salary correlates. For exploratory analysis, the Anova value seems good enough.
In the figure below I will also use the estimate for the year to see how much the salaries are raised each year for the different occupational groups holding age as constant.
library (tidyverse)
## -- Attaching packages -------------------------------------------- tidyverse 1.2.1 --
## v ggplot2 3.2.0 v purrr 0.3.2
## v tibble 2.1.3 v dplyr 0.8.3
## v tidyr 0.8.3 v stringr 1.4.0
## v readr 1.3.1 v forcats 0.4.0
## -- Conflicts ----------------------------------------------- tidyverse_conflicts() --
## x dplyr::filter() masks stats::filter()
## x dplyr::lag() masks stats::lag()
library (broom)
library (car)
## Loading required package: carData
##
## Attaching package: 'car'
## The following object is masked from 'package:dplyr':
##
## recode
## The following object is masked from 'package:purrr':
##
## some
library (polynom)
readfile <- function (file1){read_csv (file1, col_types = cols(), locale = readr::locale (encoding = "latin1"), na = c("..", "NA")) %>%
gather (starts_with("19"), starts_with("20"), key = "year", value = salary) %>%
drop_na() %>%
mutate (year_n = parse_number (year))
}
The data table is downloaded from Statistics Sweden. It is saved as a comma-delimited file without heading, 000000D2.csv, http://www.statistikdatabasen.scb.se/pxweb/en/ssd/.
The table: Average basic salary, monthly salary and women´s salary as a percentage of men´s salary by sector, occupational group (SSYK 2012), sex and age. Year 2014 - 2018 Monthly salary All sectors
tb <- readfile("000000D2.csv") %>%
rowwise() %>%
mutate(age_l = unlist(lapply(strsplit(substr(age, 1, 5), "-"), strtoi))[1]) %>%
rowwise() %>%
mutate(age_h = unlist(lapply(strsplit(substr(age, 1, 5), "-"), strtoi))[2]) %>%
mutate(age_n = (age_l + age_h) / 2)
summary_table = 0
anova_table = 0
for (i in unique(tb$`occuptional (SSYK 2012)`)){
temp <- filter(tb, `occuptional (SSYK 2012)` == i)
if (dim(temp)[1] > 30){
model <-lm (log(salary) ~ year_n + poly(age_n, 3), data = temp)
summary_table <- rbind (summary_table, mutate (tidy (summary (model)), ssyk = i))
anova_table <- rbind (anova_table, mutate (tidy (Anova (model, type = 2)), ssyk = i))
}
}
merge(summary_table, anova_table, by = "ssyk", all = TRUE) %>%
filter (term.y == "poly(age_n, 3)") %>%
filter (term.x == "year_n") %>%
ggplot () +
geom_point (mapping = aes(x = estimate, y = statistic.y)) +
labs(
x = "Increase in salaries (% / year)",
y = "F-value for age"
)
The table with all occupational groups sorted by F-value in descending order.
merge(summary_table, anova_table, by = "ssyk", all = TRUE) %>%
filter (term.y == "poly(age_n, 3)") %>%
filter (term.x == "year_n") %>%
select (ssyk, estimate, statistic.y) %>%
rename (`F-value for age` = statistic.y) %>%
rename (`Increase in salary` = estimate) %>%
arrange (desc (`F-value for age`)) %>%
knitr::kable(
booktabs = TRUE,
caption = 'Correlation for F-value (age) and the yearly increase in salaries with age held as constant')
| ssyk | Increase in salary | F-value for age |
|---|---|---|
| 234 Primary- and pre-school teachers | 0.0345563 | 1349.859088 |
| 233 Secondary education teachers | 0.0294574 | 861.331070 |
| 532 Personal care workers in health services | 0.0285338 | 800.259659 |
| 336 Police officers | 0.0284911 | 675.571576 |
| 223 Nursing professionals (cont.) | 0.0303955 | 625.404523 |
| 214 Engineering professionals | 0.0192393 | 612.414362 |
| 235 Teaching professionals not elsewhere classified | 0.0245885 | 578.686817 |
| 266 Social work and counselling professionals | 0.0316617 | 551.888399 |
| 221 Medical doctors | 0.0150176 | 449.792500 |
| 251 ICT architects, systems analysts and test managers | 0.0249600 | 415.590103 |
| 534 Attendants, personal assistants and related workers | 0.0191811 | 406.258604 |
| 231 University and higher education teachers | 0.0254827 | 404.602202 |
| 222 Nursing professionals | 0.0414071 | 371.107319 |
| 533 Health care assistants | 0.0205813 | 345.075594 |
| 531 Child care workers and teachers aides | 0.0219044 | 291.049608 |
| 351 ICT operations and user support technicians | 0.0211211 | 271.091961 |
| 159 Other social services managers | 0.0251218 | 191.570380 |
| 211 Physicists and chemists | 0.0207272 | 186.366824 |
| 321 Medical and pharmaceutical technicians | 0.0288946 | 177.137635 |
| 152 Managers in social and curative care | 0.0387001 | 164.636802 |
| 243 Marketing and public relations professionals | 0.0150173 | 154.310784 |
| 723 Machinery mechanics and fitters | 0.0204993 | 146.299981 |
| 125 Sales and marketing managers | 0.0187356 | 145.732333 |
| 141 Primary and secondary schools and adult education managers | 0.0346753 | 142.578762 |
| 341 Social work and religious associate professionals | 0.0255830 | 137.073911 |
| 133 Research and development managers | 0.0137728 | 135.323107 |
| 153 Elderly care managers | 0.0331514 | 132.163025 |
| 242 Organisation analysts, policy administrators and human resource specialists | 0.0223881 | 132.013557 |
| 332 Insurance advisers, sales and purchasing agents | 0.0176134 | 128.196288 |
| 218 Specialists within environmental and health protection | 0.0258110 | 120.206634 |
| 311 Physical and engineering science technicians | 0.0213202 | 119.371812 |
| 422 Client information clerks | 0.0175877 | 117.057208 |
| 411 Office assistants and other secretaries | 0.0250406 | 115.401389 |
| 264 Authors, journalists and linguists | 0.0158766 | 107.667527 |
| 226 Dentists | 0.0230213 | 99.061845 |
| 232 Vocational education teachers | 0.0298647 | 93.534293 |
| 122 Human resource managers | 0.0365348 | 86.595103 |
| 342 Athletes, fitness instructors and recreational workers | 0.0162825 | 86.085107 |
| 515 Building caretakers and related workers | 0.0188443 | 85.346469 |
| 123 Administration and planning managers | 0.0423650 | 81.886461 |
| 137 Production managers in manufacturing | 0.0267995 | 80.958767 |
| 227 Naprapaths, physiotherapists, occupational therapists | 0.0212967 | 78.930141 |
| 132 Supply, logistics and transport managers | 0.0135557 | 78.186301 |
| 817 Wood processing and papermaking plant operators | 0.0289197 | 75.983376 |
| 441 Library and filing clerks | 0.0210449 | 75.872685 |
| 131 Information and communications technology service managers | 0.0431537 | 75.423080 |
| 343 Photographers, interior decorators and entertainers | 0.0339142 | 75.132287 |
| 241 Accountants, financial analysts and fund managers | 0.0270620 | 71.204029 |
| 216 Architects and surveyors | 0.0241267 | 68.945982 |
| 134 Architectural and engineering managers | 0.0236760 | 68.279874 |
| 228 Specialists in health care not elsewhere classified | 0.0272838 | 64.426085 |
| 213 Biologists, pharmacologists and specialists in agriculture and forestry | 0.0144849 | 63.378555 |
| 831 Train operators and related workers | 0.0177987 | 55.404356 |
| 334 Administrative and specialized secretaries | 0.0292702 | 52.477105 |
| 335 Tax and related government associate professionals | 0.0227003 | 49.850281 |
| 224 Psychologists and psychotherapists | 0.0270655 | 47.653074 |
| 511 Cabin crew, guides and related workers | 0.0069736 | 47.413185 |
| 812 Metal processing and finishing plant operators | 0.0176743 | 47.395879 |
| 331 Financial and accounting associate professionals | 0.0229113 | 45.186053 |
| 261 Legal professionals | 0.0292942 | 44.569161 |
| 819 Process control technicians | 0.0232825 | 43.919550 |
| 333 Business services agents | 0.0263028 | 43.327180 |
| 961 Recycling collectors | 0.0225031 | 42.772133 |
| 312 Construction and manufacturing supervisors | 0.0322029 | 41.767797 |
| 516 Other service related workers | 0.0202784 | 41.325733 |
| 262 Museum curators and librarians and related professionals | 0.0228651 | 40.378111 |
| 265 Creative and performing artists | 0.0252235 | 39.119906 |
| 741 Electrical equipment installers and repairers | 0.0221901 | 38.176541 |
| 524 Event seller and telemarketers | 0.0203373 | 36.349688 |
| 941 Fast-food workers, food preparation assistants | 0.0199578 | 35.998201 |
| 815 Machine operators, textile, fur and leather products | 0.0128372 | 33.582965 |
| 962 Newspaper distributors, janitors and other service workers | 0.0141958 | 32.540073 |
| 136 Production managers in construction and mining | 0.0264825 | 31.006282 |
| 834 Mobile plant operators | 0.0251599 | 30.439935 |
| 816 Machine operators, food and related products | 0.0198706 | 29.543569 |
| 129 Administration and service managers not elsewhere classified | 0.0171682 | 29.032377 |
| 212 Mathematicians, actuaries and statisticians | 0.0240773 | 28.949679 |
| 352 Broadcasting and audio-visual technicians | 0.0067079 | 28.725776 |
| 513 Waiters and bartenders | 0.0214795 | 28.455515 |
| 813 Machine operators, chemical and pharmaceutical products | 0.0254550 | 26.563325 |
| 151 Health care managers | 0.0211530 | 24.870942 |
| 611 Market gardeners and crop growers | 0.0089573 | 23.602904 |
| 732 Printing trades workers | 0.0191704 | 23.581610 |
| 432 Stores and transport clerks | 0.0217702 | 22.969527 |
| 217 Designers | 0.0252062 | 22.823943 |
| 161 Financial and insurance managers | 0.0518758 | 21.908728 |
| 711 Carpenters, bricklayers and construction workers | 0.0136555 | 20.268520 |
| 541 Other surveillance and security workers | 0.0239438 | 19.245270 |
| 179 Other services managers not elsewhere classified | 0.0272448 | 17.108091 |
| 911 Cleaners and helpers | 0.0176513 | 16.284355 |
| 512 Cooks and cold-buffet managers | 0.0278549 | 15.787404 |
| 814 Machine operators, rubber, plastic and paper products | 0.0245275 | 15.256042 |
| 267 Religious professionals and deacons | 0.0268407 | 11.266331 |
| 761 Butchers, bakers and food processors | 0.0153660 | 11.168879 |
| 722 Blacksmiths, toolmakers and related trades workers | 0.0192713 | 10.890741 |
| 121 Finance managers | 0.0276643 | 9.785317 |
| 752 Wood treaters, cabinet-makers and related trades workers | 0.0269102 | 9.779896 |
| 713 Painters, Lacquerers, Chimney-sweepers and related trades workers | 0.0259098 | 9.415854 |
| 932 Manufacturing labourers | 0.0266336 | 9.113769 |
| 522 Shop staff | 0.0267679 | 8.247675 |
| 818 Other stationary plant and machine operators | 0.0237780 | 6.983074 |
| 344 Driving instructors and other instructors | 0.0286480 | 6.971261 |
| 523 Cashiers and related clerks | 0.0041737 | 4.970851 |
| 833 Heavy truck and bus drivers | 0.0188392 | 4.786235 |
| 912 Washers, window cleaners and other cleaning workers | 0.0382761 | 4.701424 |
| 821 Assemblers | 0.0286219 | 1.405402 |
Let’s check what we have found.
temp <- tb %>%
filter(`occuptional (SSYK 2012)` == "234 Primary- and pre-school teachers")
temp %>%
ggplot () +
geom_point (mapping = aes(x = year_n,y = salary, colour = age)) +
facet_grid(. ~ sex) +
labs(
x = "Year",
y = "Salary (SEK/month)"
)
model <-lm (log(salary) ~ year_n + poly(age_n, 3, raw = T), data = temp)
summod <- tidy(summary (model))
temp %>%
ggplot () +
geom_point (mapping = aes(x = age_n,y = age_n * summod$estimate[3] + summod$estimate[4] * age_n^2 + summod$estimate[5] * age_n^3)) +
labs(
x = "Age",
y = "Salary"
)
pdx <- deriv(as.polynomial(c(0, summod$estimate[3], summod$estimate[4], summod$estimate[5])))
temp %>%
ggplot () +
geom_point (mapping = aes(x = age_n, y = summod$estimate[2] + pdx[1] + pdx[2] * age_n + pdx[3] * age_n^2)) +
labs(
x = "Age",
y = "Salary raise (%)"
)
temp <- tb %>%
filter(`occuptional (SSYK 2012)` == "821 Assemblers")
temp %>%
ggplot () +
geom_point (mapping = aes(x = year_n,y = salary, colour = age)) +
facet_grid(. ~ sex) +
labs(
x = "Year",
y = "Salary (SEK/month)"
)
model <-lm (log(salary) ~ year_n + poly(age_n, 3, raw = T), data = temp)
summod <- tidy(summary (model))
temp %>%
ggplot () +
geom_point (mapping = aes(x = age_n,y = age_n * summod$estimate[3] + summod$estimate[4] * age_n^2 + summod$estimate[5] * age_n^3)) +
labs(
x = "Age",
y = "Salary"
)
pdx <- deriv(as.polynomial(c(0, summod$estimate[3], summod$estimate[4], summod$estimate[5])))
temp %>%
ggplot () +
geom_point (mapping = aes(x = age_n, y = summod$estimate[2] + pdx[1] + pdx[2] * age_n + pdx[3] * age_n^2)) +
labs(
x = "Age",
y = "Salary raise (%)"
)
temp <- tb %>%
filter(`occuptional (SSYK 2012)` == "161 Financial and insurance managers")
temp %>%
ggplot () +
geom_point (mapping = aes(x = year_n,y = salary, colour = age)) +
facet_grid(. ~ sex) +
labs(
x = "Year",
y = "Salary (SEK/month)"
)
model <- lm (log(salary) ~ year_n + poly(age_n, 3, raw = T), data = temp)
summod <- tidy(summary (model))
temp %>%
ggplot () +
geom_point (mapping = aes(x = age_n,y = age_n * summod$estimate[3] + summod$estimate[4] * age_n^2 + summod$estimate[5] * age_n^3)) +
labs(
x = "Age",
y = "Salary"
)
pdx <- deriv(as.polynomial(c(0, summod$estimate[3], summod$estimate[4], summod$estimate[5])))
temp %>%
ggplot () +
geom_point (mapping = aes(x = age_n, y = summod$estimate[2] + pdx[1] + pdx[2] * age_n + pdx[3] * age_n^2)) +
labs(
x = "Age",
y = "Salary raise (%)"
)
temp <- tb %>%
filter(`occuptional (SSYK 2012)` == "523 Cashiers and related clerks")
temp %>%
ggplot () +
geom_point (mapping = aes(x = year_n,y = salary, colour = age)) +
facet_grid(. ~ sex) +
labs(
x = "Year",
y = "Salary (SEK/month)"
)
model <-lm (log(salary) ~ year_n + poly(age_n, 3, raw = T), data = temp)
summod <- tidy(summary (model))
temp %>%
ggplot () +
geom_point (mapping = aes(x = age_n,y = age_n * summod$estimate[3] + summod$estimate[4] * age_n^2 + summod$estimate[5] * age_n^3)) +
labs(
x = "Age",
y = "Salary"
)
pdx <- deriv(as.polynomial(c(0, summod$estimate[3], summod$estimate[4], summod$estimate[5])))
temp %>%
ggplot () +
geom_point (mapping = aes(x = age_n, y = summod$estimate[2] + pdx[1] + pdx[2] * age_n + pdx[3] * age_n^2)) +
labs(
x = "Age",
y = "Salary raise (%)"
)


Apple Could Increase Ad Income Fivefold by 2025: JPMorgan
Apple does not currently give detailed figures on advertising revenue.
by ReutersThe launch of Apple TV+, coupled with Apple Inc’s foray into digital services, could help the company increase its income from advertising by more than five fold to $11 billion annually within the next six years, analysts from JP Morgan said on Friday.
Raising his share price target for the iPhone maker, analyst Samik Chatterjee argued the company could leverage the millions of users who search its App Store and Safari browser daily to generate the stellar growth seen by Facebook and Google in recent years.
He said the company had the potential to raise revenue by a third every year, from an estimated $2 billion currently to $11 billion in 2025. Apple does not currently give detailed figures on advertising revenue.
Through two difficult years for iPhone sales, the California-based firm has stressed the importance of growth in its services segment, which already includes Apple Care and Apple Music and generated revenue of $12.51 billion last quarter.
Along with its highly anticipated launch of its flagship triple-camera iPhone this year, it rolled out a streaming TV service in September in a bid to diversify its revenue streams away from a stagnating smartphone market.
“While investors are trying to identify the next big frontier for services, we believe hidden in plain sight and underappreciated by most is the advertising opportunity within Apple’s fingertips,” Chatterjee said.
He maintained his bullish ‘overweight’ rating on Apple. Only a third of Wall Street analysts currently rate the company “hold” or worse.


https://github.com/origin1tech/gulp-html-minifier
https://github.com/ben-eb/gulp-svgmin
https://github.com/contra/gulp-concat
https://github.com/terinjokes/gulp-uglify
https://github.com/zckrs/gulp-css-base64
https://github.com/ben-eb/gulp-cssnano
https://github.com/floatdrop/gulp-watch
https://github.com/coderhaoxin/gulp-file-include
https://github.com/robrich/gulp-rimraf


This vignette introduces the workflow to simulated single-cell RNA-seq (scRNA-seq) data after retrieving gene sets from the web interface of AEGIS.
The pipeline relies on commonly used packages, so no complicated installation is required.
import os
import json
import numpy as np
import pandas as pd
from scipy import stats, sparse
# for plotting
import matplotlib.pyplot as plt
from matplotlib.colors import LinearSegmentedColormap
Prior to this tutorial, we randomly selected 10 genes respectively each from three descendants of the cell cycle process (GO:0022402):
The interaction is recorded as part of our Supplementary Videos. For convenience, these genes are copy/pasted here.
gene_sets = {
"GO:0000082": [ # G1/S transition of mitotic cell cycle
'CDKN2A',
'CUL2',
'ORC5',
'TFDP3',
'PHF8',
'BCAT1',
'CACUL1',
'ITGB1',
'CDC7',
'USP29',
],
"GO:0000086": [ # G2/M transition of mitotic cell cycle
'HAUS7',
'CDKN2B',
'DCTN1',
'CEP41',
'LCMT1',
'PCM1',
'FBXW11',
'HAUS2',
'CEP57',
'CEP250',
],
"GO:0071850": [ # mitotic cell cycle arrest
'E4F1',
'CDC14B',
'CDC14A',
'DUSP1',
'CDKN1B',
'MAGI2',
'CDC14C',
'GADD45A',
'NKX3-1',
'MCPH1',
],
}
pop_names = list(gene_sets.keys()) + ["control"]
print("Populations: {}".format(pop_names))
Next, we specify the non-differentially expressed genes, and check that the selected gene set names are valid. A convient way to get a list of gene names is to used the local file automatically stored for AEGIS. The version-controlled gene name lists are downloadable from: http://stanford.edu/~jjzhu/fileshare/aegis/. You can download a zipped file (e.g., raw_20180719.tar.gz
), unzip it, and load the file geneid2sym_*.json
from the path:
CACHE_DIR = "/YOUR/LOCAL/PATH"
# load the files from local
SPECIES = "human"
file_name = os.path.join(CACHE_DIR, "geneid2sym_{}.json".format(SPECIES))
with open(file_name) as json_file:
gene_conversions = json.load(json_file)
all_genes = list(gene_conversions.values())
print("Number of initial genes: {}".format(len(all_genes)))
print(all_genes[:10])
As most scRNA-seq pipelines filter out genes with low variability as pre-processing step, we randomly selected 2060 genes (including the signature genes) to be our variable genes. This scale is common for scRNA-seq studies, especially those captured with droplet technologies.
total_gene_list = []
sig_gene_params = {}
for pop in pop_names:
if pop == "control":
continue
total_gene_list += gene_sets[pop] # add signal genes
for gene in gene_sets[pop]:
sig_gene_params[gene] = {}
# randomly add other non-differentially expressed genes
np.random.seed(101010)
retain_percentage = 0.1
num_other_genes = int(len(all_genes) * retain_percentage)
all_genes = np.array(all_genes)
sel_idx = np.random.choice(len(all_genes), num_other_genes, replace=False)
other_genes = all_genes[sel_idx]
for sym in other_genes: # add the rest of genes
if sym not in sig_gene_params:
total_gene_list.append(sym)
print("Number of variable genes: {}".format(len(total_gene_list)))
print("{} ...".format(total_gene_list[:5]))
Using the selected gene set, we can create cell sub-populations that are specific to different phases of the cell cycle. In the example, we used 120, 150, 100, 300 cells for G1/S transition, G2/M transition, cell cycle arrest, and control respectively. Each cell type is supposed to have enriched expression of its 10 signature genes; the control cell type is the baseline and does not have enrichment of any of the signature genes.
np.random.seed(111111)
num_cells = {
"GO:0000082": 120,
"GO:0000086": 150,
"GO:0071850": 100,
"control": 300,
}
tot_num_cells = sum(num_cells.values())
print("Total number of cells:\t{}".format(tot_num_cells))
To model the counts in the matrix, we choose a zero-inflated negative binomial model similar to Risso et al. 2018.
Under this model, signature and non-signature genes entail different negative binomial parameters. The non-signature follows a negative binomial with parameters $n$, $p$, where $n$ is interpreted as the number of failures and $p$ is the probability of success. To increase the variability among the signature genes, we set gene-specific parameters for $p$ based on a normal distribution. (A low value of $p$ would generally lead to a higher mean expression.)
np.random.seed(222222)
n = 30 # general shape parameter
p_null = 0.85
p_sig_m = 0.80
p_sig_s = 0.10
for pop in gene_sets:
for gene in gene_sets[pop]:
p = p_sig_s * np.random.normal() + p_sig_m
sig_gene_params[gene] = {"n": n,
"p": p,
"size":num_cells[pop]}
# plot the two distributions
fig, ax = plt.subplots(1, 1)
x_range = np.arange(0, 20)
for i, p_parm in enumerate([p_null, p_sig_m]):
z = "background" if i == 0 else "signal"
ax.bar(x_range,
stats.nbinom.pmf(x_range, n, p_parm),
alpha=0.5,
label="{} ({}, {})".format(z, n, p_parm))
plt.legend()
plt.show()
Here we set the proportion of zero counts, or the dropout probability for the techinical effect. (For efficiency, we work with sparse matrices here.)
background_sparsity = 0.20 # zero fraction: 1-sparsity
np.random.seed(111111)
rvs = stats.nbinom(n=n, p=p_null).rvs
back_mat = sparse.random(tot_num_cells,
len(total_gene_list),
background_sparsity,
data_rvs=rvs)
null_hist = np.histogram(back_mat.A, bins=x_range) # save for plotting later
print("Matrix dimension: {}".format(back_mat.shape))
For efficiency, we generate the expression of the signature genes via a block diagonal matrix and overwrite the background matrix in appropriate positions.
signal_sparsity = 0.50 # zero fraction: 1-sparsity
np.random.seed(222222)
diag_blocks = []
for pop in pop_names:
n_cells = num_cells[pop]
print("{}: {} cells".format(pop, n_cells))
if pop == "control":
n_null_genes = len(total_gene_list) - len(sig_gene_params)
sub_mtx = np.zeros((n_cells, n_null_genes))
else:
sub_mtx = np.zeros((n_cells, len(gene_sets[pop])))
for i, gene in enumerate(gene_sets[pop]):
gene_expr = stats.nbinom.rvs(**sig_gene_params[gene])
sel = np.random.binomial(1, signal_sparsity, len(gene_expr))
sub_mtx[:,i] = gene_expr * sel
print(sub_mtx.shape)
diag_blocks.append(sub_mtx)
mat = back_mat + sparse.block_diag(diag_blocks)
flat_matrices = [m.flatten() for m in diag_blocks[:3]]
signal_counts = np.concatenate(flat_matrices)
print("Number of signal counts: {}".format(len(signal_counts)))
sig_hist = np.histogram(signal_counts, bins=x_range)
fig, ax = plt.subplots(1, 1)
for i, hist_cnt in enumerate([null_hist, sig_hist]):
z = "background" if i == 0 else "signal"
norm_freq = hist_cnt[0] / sum(hist_cnt[0])
ax.bar(hist_cnt[1][:-1],
norm_freq,
alpha=0.5,
label="{} ({}, {})".format(z, n, p_parm))
plt.legend()
plt.show()
The secondary analysis includes three visual components: 1) heatmap view of the expression, 2) projection of the cells in the PC space and 3) the embedding of the cells with t-SNE. These are among the most commonly used techniques for exploratory analysis, even though numerous variants exist.
from sklearn.manifold import TSNE
from sklearn.decomposition import TruncatedSVD
from sklearn.decomposition import PCA
from sklearn.preprocessing import StandardScaler
import seaborn as sns
Generate a cell label vector and some meta information for the class labels
label_ids = []
for i, pop in enumerate(pop_names):
label_ids += [i] * num_cells[pop]
col_map = {
"GO:0000082": "#a6cee3",
"GO:0000086": "#b2df8a",
"GO:0071850": "#fb9a99",
"control": "#EDC500",
}
dark_col_map = {
"GO:0000082": "#001D71",
"GO:0000086": "#014B06",
"GO:0071850": "#630000",
"control": "#EDC500",
}
text_alias = {
"GO:0000082": "G1/S \ntransition \nof mitotic \ncell cycle",
"GO:0000086": "G2/M \ntransition \nof mitotic \ncell cycle",
"GO:0071850": "mitotic cell \ncycle arrest",
}
We organize the genes and cell types according to cell types, and include 10 random non-signal genes for the controlled population. Since we front-loaded the signal genes, we just show the top 40 genes in the heatmap. We should expect a block-diagonal structure.
num_genes_to_plot = 40
gene_names = total_gene_list[:num_genes_to_plot]
plot_mtx = StandardScaler().fit_transform(np.log(1+mat.todense()[:, :num_genes_to_plot])).T
plot_mtx = pd.DataFrame(plot_mtx)
plot_mtx["genes"] = gene_names
plot_mtx = plot_mtx.set_index("genes")
g = sns.clustermap(plot_mtx,
row_cluster=False,
col_cluster=False,
cmap="inferno",
figsize=(12, 10))
g.ax_heatmap.get_xaxis().set_visible(False)
g.ax_heatmap.set_position([.25, 0.26, 0.7, 0.6])
g.cax.set_position([.15, 0.35, 0.03, .45])
PCA is a critical step in dimension reduction. It is also one of the most interpretable unsupervised learning approaches that we can leverage for insightful representation of the data. Note that, before running PCA, we first center the data as a good practice.
np.random.seed(121212)
mat_scaled = StandardScaler(with_std=False).fit_transform(mat.todense())
pc_fit = PCA(n_components=50).fit(mat_scaled)
top_pcs = pc_fit.transform(mat_scaled)
To visualize with t-SNE, we use the top 10 PCs. In practice, there are multiple ways to customize t-SNE, but we selected this as it displayed the cell types sufficiently well.
np.random.seed(121212)
tsne_proj = TSNE(n_components=2).fit_transform(top_pcs[:,:10])
print(tsne_proj.shape)
Finally, we can visualize the data and the underlying annotations we designed. For the PCs, we provide biplots that indicate the direction of the signal genes with respect to the PCs. This helps highlight the important ground truth variables.
pc_select = [0,1]
sig_genes = []
sig_group = []
sig_idx = []
offset = 0
max_arr = 10 # the number of arrows to include
for pop in pop_names:
if pop == "control":
continue
for i, gene in enumerate(gene_sets[pop]):
if i == max_arr:
break
sig_genes.append(gene)
sig_group.append(pop)
sig_idx.append(offset + i)
offset += len(gene_sets[pop])
arrow_scaling = np.power( pc_fit.singular_values_[pc_select], 0.4)
v_comp = pc_fit.components_[pc_select,:][:,sig_idx]
arrow_heads = arrow_scaling * v_comp.T # broadcast
arrow_df = pd.DataFrame(arrow_heads, columns=["x", "y"])
arrow_df["ssquare"] = arrow_df["x"]**2 + arrow_df["y"]**2
arrow_df["gene"] = sig_genes
arrow_df["index"] = sig_genes
arrow_df["group"] = sig_group
arrow_df = arrow_df.set_index("index")
pca_proj = top_pcs[:, pc_select] / arrow_scaling
print("Projection dimension: {}".format(pca_proj.shape))
arrow_df.head()
The t-SNE and PCA plots are customized to for better rendering.
label_size = 15
text_size = 13
tick_label_size = 12
def plot_scatter_groups(projected,
label_ids,
label_ann,
col_map,
ax=None,
clean=False):
n_labs = len(label_ann)
clist = [col_map[lab] for lab in label_ann]
cmap = LinearSegmentedColormap.from_list("my_list", clist, len(clist))
scat = ax.scatter(projected[:, 0], projected[:, 1],
c=label_ids,
edgecolor="#383838",
alpha=1.0, s=24.0,
cmap=cmap)
dist = (n_labs - 1) / n_labs
tick_pos = dist * np.arange(n_labs) + dist / 2
if clean:
ax.spines['right'].set_visible(False)
ax.spines['top'].set_visible(False)
else:
cb = fig.colorbar(scat, ticks=tick_pos)
cb.set_ticklabels(label_ann)
def plot_pc_arrows(arrow_df,
col_map,
ax=None,
clean=False):
grp_max = arrow_df[["ssquare", "gene", "group"]].groupby("group")["ssquare"].transform(max)
idx = grp_max == arrow_df["ssquare"]
max_genes = arrow_df[idx].index
print(max_genes)
# setup labels
if not clean:
ax.set_xlabel("principle component {}".format(pc_select[0]+1),
family="arial",
size=label_size)
ax.set_ylabel("principle component {}".format(pc_select[1]+1),
family="arial",
size=label_size)
for index, row in arrow_df.iterrows():
ax.arrow(0, 0, row["x"], row["y"],
color=col_map[row["group"]],
alpha=0.9,
width=0.0001, head_width=0.20)
x_pos = row["x"]*1.1
y_pos = row["y"]*1.1
# manual customization
if (row["gene"] == 'CDC7'):
x_pos = row["x"]*1.0
y_pos = row["y"]*1.4
if (row["gene"] == "CDKN2B"):
x_pos = row["x"]*0.9
y_pos = row["y"]*1.15
if (row["gene"] == "MCPH1"):
x_pos = row["x"]*0.9
y_pos = row["y"]*1.15
if clean:
if row["gene"] in max_genes:
plot_text = True
else:
plot_text = False
else:
plot_text = True
if plot_text:
ax.text(x_pos, y_pos, row["gene"],
color=col_map[row["group"]],
size = text_size,
style="italic",
family="arial")
ax.set_xlim(-3.0, 5.7)
ax.set_ylim(-3.3, 4.5)
ax.set_yticks(np.arange(-3, 4, 2.0))
ax.tick_params(labelsize=tick_label_size)
def plot_tsne_ann(ax, text_alias, col_map, clean=True):
ax.set_xlim(-50, 55)
ax.set_ylim(-40, 50)
ax.tick_params(labelsize=tick_label_size)
ax.set_yticks(np.arange(-40, 50, 20))
if not clean:
ax.set_xlabel("t-SNE dimension 1", family="arial", size=label_size)
ax.set_ylabel("t-SNE dimension 2", family="arial", size=label_size)
for term in text_alias:
x_pos = 0
y_pos = 0
if term == "GO:0000082":
x_pos = 32
y_pos = -38
if term == "GO:0000086":
x_pos = 20
y_pos = 20
if term == "GO:0071850":
x_pos = -47
y_pos = 20
ax.text(x_pos, y_pos, text_alias[term],
size = text_size,
color=col_map[term], family="arial")
full_figsize = (5.2, 4.3)
fig, ax = plt.subplots(1,1, figsize=full_figsize)
plot_scatter_groups(pca_proj, label_ids, pop_names, col_map, ax=ax)
plot_pc_arrows(arrow_df, dark_col_map, ax=ax)
plt.show()
fig, ax = plt.subplots(1,1, figsize=full_figsize)
plot_scatter_groups(tsne_proj, label_ids, pop_names, col_map, ax=ax)
plot_tsne_ann(ax, text_alias, dark_col_map)
plt.show()


OBO is designed and created by four Princeton Computer Science students: Christine Li, Ben Eisner, Catherine Wu, Walker Davis
The newsfeed feature of the application shows all items for sale in your region. If you are interested in an item, you can click on it for more information, including pictures, price, description, etc. If you would like to make an offer, you can do so with the click of a button
Want to sell? OBO makes it easy. Provide the name, price, size, description and then upload a photo from your phone's photo library. Once you hit submit, it will show up on other users' newsfeeds when they refresh.
For each item that you post, you will be able to see how much others in the area are willing to offer you for it. The offers will come with a dollar amount and the user's name and contact information.
Items on your newsfeed are filtered by location so you will only see posts from within your community. This removes the hassle of shipping and waiting, and allows users to see the items before making a purchase.


Password
Login
Your device does'nt seems to support Database for login.
Settings
Change the profile photo by tapping the change button.
Change
Select a new photo


About me
Hi! I am a PhD candidate at MIT advised by Philippe Rigollet. I obtained my B.Sc. (2016) in mathematics and electrical engineering from Universidad de los Andes.
I enjoy teaching at all levels and have taught at
MIT Mathematics,
IDSS,
Mathroots,
Universidad de los Andes, and
Olimpiadas Colombianas de Matemáticas.
I worked at Quantil (2017) as a data scientist, and at Truveta (2022) as a research intern working on large language models.
Research interests
I am broadly interested in the theory and applications of statistics, optimization, and machine learning.
During my PhD, I worked on geometry and optimization aspects of different problems in machine learning:
- Non-convex dynamics of neural network training. There is a phase tansition in the learning between gradient flow regime and a “edge of stability” regime. We characterize a simple and generalizable class of functions with this property.
- Interpolation based on unbalanced optimal transport.
The Eulerian and Lagrangian dynamic formulations of unbalanced optimal transport agree to second order. We construct an algorithm that interpolates measures of different masses using De Casteljau’s algorithm on the cone.
- Fisher-Rao geometry. Regularized linear programs are equivalent to gradient flows in the geometry of the barrier’s Hessian. We provide a unified framework that explains the differences and similarities of using entropy (Sinkhorn, mirror descent) versus Self-concordant (interior-point) algorithms.
- Matrix Factorization. Least squares costs for matrix factorization does not have spurious optima over the Grassmanian (modulo rotations). We provide a simple proof of convexity along orthogonal directions using principal angles.


Coq'Art Home page for recent versions of Coq (up to V8.10)
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
All the examples and exercises on this site are copyright Yves Bertot and Pierre Castéran, unless explicitely mentionned. The tutorial on [co-]inductive type has been written by Edurdo Gimenez and Pierre Castéran.
The tutorial on type classes and user-defined relations has been written by Pierre Castéran and Matthieu Sozeau.
Coq'Art is the familiar name for the first book on the
Coq proof assistant and its underlying
theory the Calculus of Inductive Constructions , written
by Yves Bertot
and Pierre
Castéran.
Interactive Theorem Proving and Program Development
Coq'Art: The Calculus of Inductive Constructions
Series: Texts in Theoretical Computer Science. An EATCS Series
Bertot, Yves, Castéran, Pierre
2004, XXV, 469 p., Hardcover
ISBN: 3-540-20854-2
Look at Springer site .
Drawing "Oiseau de feu" by courtesy of Michel Mendès France
Contents
This directory contains a bunch of files tested with versions of Coq up to
V8.10. It is structured as follows:
16 directories, each one associated with a chapter of the book:
Each directory contains a list of exercises, and an adaptation to recent versions of Coq of
the scripts presented in the corresponding chapter of the book. Each index file contains
also corrections of the errors that were kindly signalled to us by the readers.
- A Brief Presentation of Coq
- Gallina: Coq as a Programming Language
- Propositions and Proofs
- Dependent Product
- Everyday logic
- Inductive Data Structures
- Tactics and automation
- Inductive Predicates
- Functions and their specification
- Extraction and imperative programming
- A Case Study : binary search trees
- The Module System
- Infinite Objects and Proofs
- Foundations of Inductive Types
- General Recursion
- Proof by reflection
Additional material
- More exercises (not in the book)
- Coq sources associated with
the tutorial written with Matthieu Sozeau on type classes and user-defined relations
- Coq sources associated with
the tutorial written with Eduardo Gimenez on inductive and co-inductive types
Errata
Some typos where found after the printing of the book. They are reported
chapter by chapter, after the sources and exercises.
Many thanks to
Stefan Karrmann for all the remarks he sent to us.
Comments are welcome
Thank you in advance for any comment, alternate solution, or any way to
improve this site.


What?
It's a tool to help transcribe and share sequences of skills.
How?
Select your class, and click or drag skills to the skill area. When you want to share the sequence, click share and send them the url!
What's the curly thing on the skill icons?
It indicates the skills that don't share the global cooldown.
What is new?
Shadowbringers skills have been added, if you find any issues not mentioned below please let me know.
For developers: skill data source is now json, and has a reference to the original skill ids (with a few exceptions)
Known issues
- Disciple of hand/land skills not updated since Stormblood
- Very buggy on mobile devices
- Scholar: summon skills can be put in a sequence
- Scholar: summon related class skills missing
- Astrologian: Missing Arcana skills
- Astrologian: Second Horoscope skill missing
Contact
You can contact me at smrandroid@gmail.com


The role of a good cook ware in the preparation of a sumptuous meal cannot be over emphasized then one consider white bread
Rolls
Sets
Sushi
Sashimi
Sources, ginger, wasabi
Happy customer Event
Discount 50%
Our focus is to provide Floury desserts and snacks that are nutritious and delicious. Our products always feature as many local, organic ingredients as possible.


"x" "1" "CHACKO,M, NAGABHUSHAN,M, SARKAR,S AND BHIDE,SV, STUDIES ON THEPOSSIBLE MUTAGENIC ACTION OF METRONIDAZOLE, INDIAN J. EXP. BIOL. 25(4):240-243,1987"


Using Templates¶
Templates can save precious time!
Set up a jail and create a template from it. All packages and preconfigured settings remain available for deployment to new jails within seconds.
Any jail can be converted between jail and template as needed. Essentially, a template is just another jail which has the property template set to yes. The difference is templates are not started by iocage.
Create a template with iocage:
Create a jail:
# iocage create -r 11.0-RELEASE -n mytemplate
.Configure the jail’s networking.
Install packages and/or customize the jail as needed.
Once finished with customization, stop the jail:
# iocage stop mytemplate
.It is recommended to add notes to the jail, so the specific jail customizations are easily remembered:
# iocage set notes="customized PHP,nginx jail" mytemplate
Set the template property on:
# iocage set template=yes mytemplate
.Find the new template with iocage list -t.
Use the created template:
Use iocage create -t to create a new jail from the new template:
# iocage create -t mytemplate -n jailfromtemplate
Find the new jail with iocage list.
Start the jail with
# iocage start jailfromtemplate
.
Done!
Customizing a template:
To make changes to the template, you will need to know whether any existing jails are based on the template. Since modifying the template will require converting it back into a jail, it cannot be the base for any jails.
* No jails based on the template *
Convert the template back into a jail:
iocage set template=no [UUID | NAME].
Start the jail:
iocage start [UUID | NAME].
Use any method you wish to connect to the jail and modify its contents.
Stop the jail:
iocage stop [UUID | NAME].
Convert the jail back into a template:
iocage set template=yes [UUID | NAME].
* Jails based on the template *
This process will create a new template, leaving the existing template and jails unaffected.
Create a ‘thick’ jail from the template, so that it will be independent from the template:
iocage create -T -t [UUID | NAME] -n newtemplate.
Start the jail:
iocage start newtemplate.
Use any method you wish to connect to the jail and modify its contents.
Stop the jail:
iocage stop newtemplate.
Convert the jail into a template:
iocage set template=yes newtemplate.


Watch: Trailer for 'Hunters,' new Jordan Peele series on Nazi hunters starring Al Pacino
by Carla SinclairJordan Peele fans (Get Out, Us) rejoice – he has just produced a new Amazon series, Hunters, which comes out sometime in 2020. As an added bonus, it stars Al Pacino.
From YouTube:
Inspired by true events, HUNTERS follows a diverse band of Nazi Hunters in 1977 New York City who discover that hundreds of escaped Nazis are living in America. And so, they do what any bad-ass vigilante squad would do: they set out on a bloody quest for revenge and justice. But they soon discover a far-reaching conspiracy and must race against time to thwart the Nazis’ new genocidal plans.


class: center, middle # Basic Data processing in UNIX grep, sort, counting --- # More resources for these topics The topics in today's lecture are thorougly covered in Chapter 7 of the _Bioinformatics Data Skills_ book. I would suggest you sign up for a free trial and read this chapter online if you aren't going to buy the book at this time (though buy the book if you are going to be doing bioinformatics in any serious capacity). [Chapter 7: Insecting and Manipulating Text Data with Unix Tools](https://www.safaribooksonline.com/library/view/bioinformatics-data-skills/9781449367480/ch07.html#chapter-07) The data files in this lecture are in [data](data) and also in the [https://github.com/biodataprog/programming-intro/tree/master/data](github repo). --- # Sorting with sort ```shell $ sort file.txt > file.sorted.txt ``` Type of sorting: 1. -d/--dictionary_order : consider only blanks & alphanumeric characters 2. -n/--numeric-sort : compare according to string numerical value 4. -f/--ignore-case : upper/lower doesn't matter 4. -r/--reverse : reverse the order 3. -k : specify the key positions to sort by --- # Let's try some examples : sort alphabetical ```shell $ sort data/numbers_only.dat | head -n 10 10 10 12 25 30 34 39 42 49 49 ``` --- # Let's try some examples : sort numeric ```shell $ sort -n data/numbers_only.dat | head -n 10 7 7 7 10 10 12 25 30 34 39 ``` --- # More sort ```shell $ sort -r -n numbers_floating.dat | head -n 10 49.6859213710444 49.6454233452118 49.5141651980655 49.2878027550901 48.5007601226085 45.15231125553 43.0392927946809 41.8950131857132 41.7844270115886 39.63172550297467 ``` --- # Unique with uniq __`uniq`__ collapses adjacent lines in a file which are identical ```shell $ sort -n data/numbers_only.dat | uniq | head -n 10 7 10 12 25 30 34 39 42 49 51 ``` --- # uniq - count the number of occurrences ```shell $ sort -n data/numbers_only.dat | uniq -c | head -n 8 3 7 2 10 1 12 1 25 1 30 1 34 1 39 1 42 ``` Hey let's sort this list so we know the numbers that show up most frequently ```shell $ sort -n data/numbers_only.dat | uniq -c | sort -r -n | head -n 8 3 7 2 86 2 83 2 66 2 64 2 58 2 49 2 10 ``` --- # Sort multicolumn data ```shell $ head -n 10 data/rice_random_exons.bed Chr7 21408673 21408826 Chr9 16031526 16031938 Chr11 4762531 4762595 Chr8 54040 54193 Chr10 19815475 19815747 Chr3 16171331 16172869 Chr10 2077882 2077938 Chr3 20517604 20517936 Chr10 9777446 9777527 Chr2 4967096 4967246 $ sort -k1,1 -k2,2n data/rice_random_exons.bed | head -n 5 Chr1 12152 12435 Chr1 98088 98558 Chr1<PHONE_NUMBER>64 Chr1<PHONE_NUMBER>34 Chr1<PHONE_NUMBER>10 $ sort -k1,1 -k2,2n data/rice_random_exons.bed | tail -n 5 Chr9 22369724 22369776 Chr9 22508926 22509014 Chr9 22753347 22753458 Chr9 22924316 22924424 ChrSy<PHONE_NUMBER>23 ``` --- # Column processing with cut __`cut`__ - subselect and print certain columns from a file ```text YAR060C Chr_I 100.00 336 0 0 336 1<PHONE_NUMBER>83 8.6e-83 298.8 YAR060C Chr_I 64.00 325 95 22 330 14<PHONE_NUMBER>95 4.1e-18 84.0 YAR060C Chr_I 74.07 108 25 3 110 6<PHONE_NUMBER>19 2.1e-10 58.4 YAR060C Chr_I 97.02 336 8 2 1 336 14799 15132 1.3e-77 281.6 YAR060C Chr_I 72.48 109 25 5 6 110 20974 21081 2.3e-10 58.2 YAR061W Chr_I 100.00 204 0 0 1 204<PHONE_NUMBER>34 3.4e-54 203.1 YAR061W Chr_I 70.62 194 57 0 1 194<PHONE_NUMBER>93 6.5e-23 99.2 YAR061W Chr_I 94.61 204 7 4 204 1 13951 14150 5e-48 182.6 YAR061W Chr_I 67.88 193 62 0 194 2 27770 27962 3.9e-20 90.0 YAL030W Chr_I 100.00 252 0 0<PHONE_NUMBER>2 87753 2.5e-55 207.7 ``` Query sequence names ```shell $ cut -f1 data/yeast_orfs-to-chr1.FASTA.tab | head -n 10 YAR060C YAR060C YAR060C YAR060C YAR060C YAR061W YAR061W YAR061W YAR061W YAL030W ``` --- # Cut examples Get the Hit sequence names ```shell $ cut -f2 data/yeast_orfs-to-chr1.FASTA.tab | head -n 5 Chr_I Chr_I Chr_I Chr_I Chr_I ``` Get the Query name and Percent Identity ```shell $ cut -f1,3 data/yeast_orfs-to-chr1.FASTA.tab | head -n 5 YAR060C 100.00 YAR060C 64.00 YAR060C 74.07 YAR060C 97.02 YAR060C 72.48 YAR061W 100.00 YAR061W 70.62 YAR061W 94.61 YAR061W 67.88 YAL030W 100.00 YAL030W 98.15 ``` --- # Cut two columns out, and run sort to sort on ```shell $ sort -k3,1nr data/yeast_orfs-to-chr1.FASTA.tab | cut -f1,3 | head -n 5 HRA1 100.00 YAL001C 100.00 YAL002W 100.00 YAL003W 100.00 YAL003W 100.00 $ sort -k9,1n data/yeast_orfs-to-chr1.FASTA.tab | head -n 5 YAL069W 100.00 335 649 YAL068W-A 100.00 538 792 YAL068C 100.00 1807 2169 YAR020C 79.76 2008 2169 YAL067W-A 100.00 2480 2707 ``` --- # Column combining with paste (note this is a useful tool but this example is kind of made up!) ```shell $ cut -f1,3,4 data/yeast_orfs-to-chr1.FASTA.tab > first_cols.tab $ cut -f1,7 data/yeast_orfs-to-chr1.FASTA.tab > second_cols.tab $ paste first_cols.tab second_cols.tab | head -n 5 YAL027W 100.00 786 YAL027W 1 tL(CAA)A 100.00 44 tL(CAA)A 39 tL(CAA)A 100.00 38 tL(CAA)A 1 YAL028W 100.00 1587 YAL028W 1 YAL029C 100.00 4416 YAL029C 4416 ``` --- # Simple column filtering with awk awk is another programming language. It has a very simple syntax. It is really useful for column delimited data as well ```shell $ awk '{print $1}' blast.out.tab # print out the first column of a file $ awk -F, '{print $1,$2}' data/random_exons.csv | head -n 3 Chr5 27781790 Chr11 14656670 Chr3 14560358 ``` --- # Awk is a programming language too Can do math or other operations with awk like build up conditional filtering ```shell $ awk -F, '{print $1,$2,$3, $3 - $2}' data/random_exons.csv | head -n 3 Chr5 27781790 27781888 98 Chr11 14656670 14656778 108 Chr3 14560358 14560608 250 # restrict to features larger than 100 bp $ awk -F, '$3 - $2 > 100 {print $1,$2,$3,$3 - $2}' data/random_exons.csv | \ sort -k4,1nr | head -n 3 Chr9<PHONE_NUMBER>77 2801 Chr11 3528895 3530426 1531 Chr11 16238576 16239304 728 ``` --- # Powerful searching with grep Tools for finding pattern matches in text data. Operates line-by-line and reports the lines that match a particular pattern. Some cmdline arguments 1. -i -- case insensitive 2. -n -- report line the match is on 3. -c -- simple count the number of matches 4. -v -- report lines which DON'T match the pattern ```shell $ grep YAL data/yeast_orfs-to-chr1.FASTA.tab YAL027W Chr_I 100.00 786 0 0 1 786 94688 95473 3.3e-196 676.8 YAL028W Chr_I 100.00 1587 0 0 1 1587 92901 94487 0 1232.2 YAL029C Chr_I 100.00 4416 0 0 4416 1 87856 92271 0 3066.5 YAL064W-B Chr_I 100.00 381 0 0 1 381 12047 12427 4.7e-88 316.5 $ grep -c YAL data/yeast_orfs-to-chr1.FASTA.tab 114 $ grep -v -c YAL data/yeast_orfs-to-chr1.FASTA.tab 138 $ grep -n tL data/yeast_orfs-to-chr1.FASTA.tab 2:tL(CAA)A Chr_I 100.00 44 0 0 39 82<PHONE_NUMBER>48 6e-10 54.8 3:tL(CAA)A Chr_I 100.00 38 0 0 1 38<PHONE_NUMBER>72 3.6e-08 48.9 ``` --- # Regular expressions Grep can also match patterns not just exact strings * . - matches everything * \\. - matches literally a period (remember this if you want to match a period!) * ? - one character match * [] - can match anything in the brackets There is a more extended grep pattern match using Perl regular expressions with the -E options ```shell $ perl -E '/[0-9]+[A-Z]+/' datafile.txt ``` --- # Putting things together ```shell $ more celegans_gene_names.txt aagr-1 aagr-2 aagr-3 aak-1 aak-2 aakb-1 aakb-2 aakg-1 aakg-2 aakg-4 aakg-5 aap-1 aars-2 ``` --- # Putting things together - what are sizes of C.elegans named genes families ```shell $ cut -d\- -f1 data/celegans_gene_names.txt | sort | uniq -c | \ sort -nr | head -n 10 196 srh 174 clec 168 nhr 141 fbxa 133 str 123 col 68 srw 66 unc 66 fbxb 64 ugt ``` --- # Putting things together - How many hits are 100 ```shell $ cut -d\- -f1 data/celegans_gene_names.txt | sort | uniq -c | \ sort -nr | head -n 10 196 srh 174 clec 168 nhr 141 fbxa 133 str 123 col 68 srw 66 unc 66 fbxb 64 ugt ``` --- # Comparing what is different with diff diff is a tool used to compare the content of two files and report the differences. This is a line-by-line comparison (not within a line). Can deal with insertions/deletions. ```shell $ grep -v "\."


Shipping Tracking Scanner
Press scan button below to scan code and go directly to customer location
Manually input VaanGo code to go customer exact location.
Submit and Confirm
Scan another qr code.


My very first question on StackOverflow was on the IDE Aptana Studio 3 where I ended up not getting an answer. Looking back now, I don't even see the question in my history-- was it deleted? After asking my question, I noticed someone downvoting it without giving any explanation of why. I thought I made a very good post, and have researched extensively that the answer didn't already exist on the web. I spent a lot of time with at least what I thought was making sure my post was clear and even using Imgur to post screenshots of what I was talking about. With a lot rep, I was however limited with what I can do. Here are two great resources for asking a good question:
Stack Overflow: How do I ask a good question?
Jon Skeet: Coding Blog
One thing I have just learned however is to at least on Stack Overflow to not put the language/platform information as a header. That's what the tags are for? I did this under the mindset that it is more eyecatching and puts the reader in the right frame of mind, but it will just be redundant information with the tags.


**API Doc Style**
This is example page of the API doc style created
[Aras Pranckevičius](https://github.com/aras-p) at Unity for Morgan McGuire's
[Markdeep](https://casual-effects.com/markdeep/) and now part of the official Markdeep distro.
It uses content that could be an imaginary documentation page. Here would be some introduction
text.
## What is this?
**Thing** is a thing used to do stuff for various platforms. Some of the things it can do:
* Run on a computer
* Exit with an exit code
* Be a replacement for our old system, `theoldthing.exe`
## Invoking it
This is a note by the way!
From the root folder, run "thing" with the target name, e.g.: `thing Yes`
* On Mac, Linux or Windows PowerShell, you'll want to use `./thing` instead of just `thing`.
* Target and option names are case sensitive!
* Several things to do can be specified: `thing Yes No FileNotFound`
Additional options can be passed via `-sNAME=VALUE` arguments. Most common ones are CONFIG
(used to indicate debug or release thing) and PLATFORM (used to indicate 32 vs 64 bit thing).
### Subsection on stuff
Thing Name | Description |Notes
------------------------|--------------------|-----
Yes | Yup! |
No | Nope :( |
FileNotFound | Doesn't find files | Pass `-sFIND_FILE=maybe` to maybe find them
## Markdeep syntax test
Regular styling like **bold**, _italics_, ~~strikethrough~~, `inline code`, the stuff.
* A
* Bullet
* List
And:
1. A
1. Numbered
1. List!
Symbol substitutions: a 45-degree turn; som x -> y arrows; some whoa ==> fancy <==> arrows.
Is this a definition list?
: Looks like one to me
Is that right?
: Possibly!
And a code listing:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
int main()
{
return 1;
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Markdeep diagrams:
******************************************* Here's a text to the right of the diagram,
* +-----------------+ .-. * ain't that fancy. Pretty fancy indeed, I
* |\ | .-+ | * must say! Markdeep diagrams are generally
* | \ A-B *---+--> .--+ '--. * enclosed into a rectangle full made of `*`
* | \ | | Cloud! | * symbols; and are "drawn" using ASCII-art
* +---+-------------+ .-------------' * style, with `- | + / \ * o` etc.
******************************************* Suh-weet!
Another random diagram, just because:
********************
* +-+-+-+-*-o *
* / / ^ / *
* / v / / *
* +-+-+-+ *
********************
!!! Note
Hey I'm a note. Don't mind me, I'm just sitting here.
!!! WARNING
I'm a warning, perhaps. *Something might happen!*
And other admonitions:
!!! Error: Never Pass `nullptr` to a Shader
Invoking a shader with a null argument can seg fault.
This is a multi-line admonition.
Seriously, don't call shaders like that.
The table of contents that Markdeep produces is stuffed on the right side,
if the browser window is wide enough. Otherwise it is hidden.


Workflow Triggers
Triggers are used to activate Alfred from a hotkey, another Alfred feature or an external source.
Hotkey
The most commonly used trigger; a combination of keypresses tells Alfred you want to perform an action.
Remote
The Remote Trigger is used to connect your workflow to your Remote so that an action can be triggered from Alfred Remote for iOS.
Snippet
Snippet Triggers can be used to perform an action without showing Alfred, simply by typing a pre-set text keyword.
External
This trigger makes it possible for Alfred to be triggered by another application or script using AppleScript.
File Action
The File Action allows you to add a custom action to Alfred's File Actions list, like uploading a file to a folder in Dropbox.
Contact Action
This trigger adds a custom action which will be performed on a particular field in the Contacts Viewer, such as using a dialer app when you select a phone number.
Fallback Search
The Fallback Search object allows you to replace the default fallback search options when Alfred can't find results to your Mac with your own actions.
Find out more about Workflows
Discover workflows and learn how to create your own in the Workflows section.
To find out more about other workflow objects, take a look at each type:
- Inputs: Keyword-based objects used to perform an action, on its own or followed by a query.
- Actions: The objects that do most of the work in your workflows; opening or revealing files and web searches, running scripts and performing commands.
- Utilities: Utilities give you control over how your objects are connected together and how the arguments output by the previous object is passed on to the next object.
- Outputs: Collect the information from the earlier objects in your workflow to pop up a Notification Centre message, show output in Large Type, copy to clipboard or run a script containing the result of your workflow.


--- layout: default title: Contact Me permalink: /contact/ ---
Feel free to send me a message via the contact form below, or contact me directly. You can also connect with me via social media!


Let's Gamify This City
Through the application of game based thinking and game design techniques we aim to increase the level of civic engagement across the residents and visitors of Palo Alto, CA.
The main idea is this: As a user, you can choose to take on challenges and volunteering events through which you help out the city. After completion you will earn points that can be converted into discounts and prizes redeemable at local shops and businesses. Not only are we rewarding you for your hard work, we’re also helping boost the local and independent economy of Palo Alto. Sounds fun, doesn’t it?
If you liked the idea visit our Web App Page. Help Palo Alto and become a better citizen. The only thing you have to do is to create a new account, or login with your facebook profile and join our growing community.


tipsi-stripe
Docs
Blog
›
Recent Posts
Recent Posts
Added new docs
Added new docs
March 27, 2018
Anton Kuznetsov
Please welcome, new docs!


Developed by: Albert Lua, Daniel Trager, Jason Leong, Paul Shin, Sai Coumar
PMOI (Putta Mask On It!) utilizes a web interface to send video feed to a trained AI engine
model in Python to analyze if a mask is being worn correctly. If it is not, it will notify
there is a violation on mask-wearing.
Created for the "Code for Good 2020" Hackathon by HackDuke in the "Health" category.


Returns an instance of Poolable. If get() is called with an empty pool, the pool will be replenished. If the pool capacity is sufficiently large, this could come at a performance cost.
An instance of Poolable object T
Returns the capacity of this object pool. Note : The pool will automatically resize to contain additional objects if the user tries to add more objects than the pool's capacity allows, but this comes at a performance cost.
The capacity of the pool.
Returns the number of objects remaining in the pool, for diagnostic purposes.
The number of objects remaining in the pool.
Returns the id of the given pool instance.
an integer ID belonging to this pool instance.
Recycle an instance of Poolable that this pool is capable of generating. The T instance passed must not already exist inside this or any other ObjectPool instance.
An object of type T to recycle
Set the percentage of the pool to replenish on empty. Valid values are between 0.00 and 1.00
a value between 0 and 1, representing the percentage of the pool to replenish.
Returns an ObjectPool instance, of a given starting capacity, that recycles instances of a given Poolable object.
A positive integer value.
An instance of the object that the pool should recycle.
Generated using TypeDoc
An object pool for recycling of object instances extending Poolable.
Cost/Benefit : Cost - The pool can only contain objects extending Poolable. Benefit - The pool can very quickly determine if an object is elligable for storage without iteration. Benefit - The pool can also know if an instance of Poolable is already stored in a different pool instance. Benefit - The pool can grow as needed, if it is empty Cost - However, refilling the pool when it is empty might incur a time cost with sufficiently large capacity. Set the replenishPercentage to a lower number if this is a concern.
Created by Tony Patino on 6/20/16.


--- title: Exporting a MySQL Database from an AWS RDS Instance to a Local Instance author: Mike Page date: '2019-07-16' slug: exporting-a-mysql-database-from-an-aws-rds-instance-to-a-local-instance categories: [] tags: [] description: Desc hacker_news_id: '' lobsters_id: '' meta_img: /images/image.jpg ---
In this brief post, you will learn how export a MySQL database hosted on an AWS RDS instance to a local instance on your machine. To do this, you will first update the rules of the security group on your RDS instance hosting your MySQL database, then you will export a dump file locally, and finally you will import the dump file to your local machine.
To follow along with this tutorial, it is assumed you have a MySQL database hosted on an RDS instance and you have MySQL installed on your local machine.
To get started, first you need to grant your local machine permission to access your RDS instance hosting a database. To do this, locate the security group associated with your RDS instance and add a new inbound rule. For this rule, set the ‘Type’ to ‘Custom TCP Rule’, the ‘Port Range’ to ‘3306’, and the ‘source’ to your IP (click the drop down arrow next to ‘Custom’ and select ‘My IP’).
To export the RDS database to a local instance, open up a terminal window (change directory now if required) and run the following command, changing the revelant fields where necessary:
sudo mysqldump -h your_aws_database_host_name -u your_aws_database_username -p your_aws_remote_database_name > your_dump_file_name.sql
Upon exection of the command, you will be prompted to enter the password for your database (you may also need to enter your password for sudo
too). If the database hosted on the RDS instance is large, it make take some time for the import to complete (make sure you have enough free storage space available for the dump file). Alternatively, if you would just like to import the first 100,000 rows of a table hosted on the database you can instead run:
sudo mysqldump -h aws_database_host_name -u aws_database_username -p aws_remote_database_name --opt --where="1 limit 100000" > your_dump_file_name.sql
The final step is to read the dump file back into MySQL on your local machine. First, open up a MySQL Shell in a terminal window:
sudo mysql
Next create a new database, which will serve as the location to read in the dump file:
CREATE DATABASE your_database_name;
Next, exit the MySQL Shell (type exit
) and run the following command, changing the relevant fields where necessary:
sudo mysql -u mysql_user_name -p your_database_name < your_dump_file_name.sql
End.


Welcome to Blue Community
Open Welcome Wizard
This is the Blue Community Welcome Wizard
Do you live in a Blue Community? Follow this wizard to find out...
This is the Blue Community Welcome Wizard
Do you live in a Blue Community? Follow this wizard to find out...


--- title: calcDelaunay sidebar: function_reference_sidebar permalink: vector3d.calcDelaunay.html folder: function_reference toc: false ---
compute the Delaynay triangulation for a spherical grid


The Wiki Atlas
using latest technology
Try a language:
Powered by d3 and wikidata
(source)
India
- Administrative Divisions
(Level1)


| Contents | Previous | Next | Java Management Extensions (JMX) Technology Overview |
The JavaTM Management Extensions (JMXTM) Technology Overview provides an introduction to JMX technology. JMX technology is a new feature in version 5.0 of the Java 2 Platform, Standard Edition (J2SETM platform).
To make full use of the information in the Java Management Extensions (JMX) Technology Overview, you should have knowledge of the following technology:
Some sections of this overview refer to the following protocols and specifications. You might want to investigate these areas further to gain a deeper insight into JMX technology:
This document describes the JMX technology in the following chapters:
|
Shell
|
Prompt
|
|---|---|
|
C shell
|
machine_name
%
|
|
C shell superuser
|
machine_name
#
|
|
Bourne shell and Korn shell
|
$
|
|
Bourne shell and Korn shell superuser
|
#
|
Java Management Extensions Instrumentation and Agent Specification, v1.2 and Java Management Extensions Remote API 1.0 specification:
http://java.sun.com/products/JavaManagement/download.html
Java Management Extensions Technology Tutorial
The docs.sun.com
SM web site enables you to access Sun technical documentation on the Web. You can browse the docs.sun.com
archive or search for a specific book title or subject at:
Sun Microsystems offers select product documentation in print. For a list of documents and how to order them, see “Buy printed documentation” at:
We are interested in improving our documentation and welcome your comments and suggestions. You can email your comments to us at:
Please include the name of your document in the subject line of your email.
| Contents | Previous | Next |
Java Management Extensions (JMX) Technology Overview Java Management Extensions (JMX), Java 2 Platform, Standard Edition 5.0 |
Copyright © 2004 Sun Microsystems, Inc. All rights reserved.


|
Progress Pile
version 0.0.1
Progress pile.
|
Report progress. More...
#include <progress.h>
Public Member Functions | |
| Progress () | |
| Constructor; creates an empty progress object. | |
| virtual | ~Progress () |
| Destructor; releases all resources. | |
| bool | init (const QString &title=QString(), int64_t total_size=100) |
| Prepares the progress for a run. More... | |
| void | end () |
| Terminate a run (clear internal states). | |
| bool | isInitialized () const |
| Teell if the instance was initialized (init() was called). | |
| void | enter (int64_t parent_size, const QString &label=QString(), int64_t total_size=100, int64_t parent_offset=-1, void *portion_data=NULL) |
| Enters a new portion. More... | |
| void | finish (bool update_parent=true) |
| Ends current portion; calls end() if this is the last one. More... | |
| const QString & | currentStatus () const |
| Tell the label for current operation. | |
| int | cutoffLevel () const |
| Size of the active portion of the stack. | |
| void | setCutoffLevel (int value) |
| Size of the active portion of the stack. | |
| int64_t | granularity () const |
| Emit signals when progress advances by at least this much. | |
| void | setGranularity (int64_t value) |
| Emit signals when progress advances by at least this much. | |
| void * | userData () const |
| User data associated with the instance. | |
| void | setUserData (void *value) |
| User data associated with the instance. | |
| KbSignalSimple | simpleCallback () const |
| Simple callback to be used when progress changes. | |
| void | setSimpleCallback (KbSignalSimple value) |
| Simple callback to be used when progress changes. | |
| KbSignal | callback () const |
| Callback to be used when progress changes. | |
| void | setCallback (KbSignal value) |
| Callback to be used when progress changes. | |
| bool | step (int64_t chunk_size=1, int64_t offset=-1) |
| Perform a step in the context of top portion. More... | |
| void | setStop () |
| Sets the internal state to signal the process should terminate. | |
| void | resetStop () |
| Resets the internal state to signal the process should terminate. | |
| bool | shouldStop () const |
| Tell if the process / operation should stop. | |
| bool | emitSigal () |
| Force emmit a signal bypassing all checks (granularity, stack). More... | |
| void | setLevelCharact (int64_t total_size, int64_t progress=0) |
| Set characteristics for current level. More... | |
Report progress.
The class helps in keeping track of an asynchronous operation. It divides the task (total_progress_) into portions and has a current portion defined by an offset and a size. The progress that is reported is scaled inside the portion and the offset is applied for the final report.
The mechanism allows the caller to initialize the structure, set current portion then allow the subtask to report the progress without knowing anything about its internals or size. The parent task only decides how much of its progress the subtask is going to take.
The class does not store a list for each level and stepping to a new portion removes previous portion at the same level.
The label for current operation is given by first non-empty label that was provided, starting from the last portion. Thus sub-tasks have the option to leave the label empty, thus inheriting the text from the parent. In practive this value is cachec in current_status_ to avoid recursive search each time.
To use the class for a simple task that only has a single level simply call init () at the beginning, step() in the loop and finish () at the end.
The user has the ability to control the number of signals the class emits by choosing the maximum depth of the stack for which the signals are emited (0 disables the signals) and by choosing the granularity (the total progress must advance by at least that much to trigger a signal). By default all levels emit signals and the granularity is 1.
|
inline |
Force emmit a signal bypassing all checks (granularity, stack).
| void Progress::enter | ( | int64_t | parent_size, |
| const QString & | label = QString () , |
||
| int64_t | total_size = 100 , |
||
| int64_t | parent_offset = -1 , |
||
| void * | portion_data = NULL |
||
| ) |
Enters a new portion.
If the instance was not initialized the method will do that before proceeding.
| parent_size | |
| total_size | |
| parent_offset | |
| label | |
| portion_data |
| void Progress::finish | ( | bool | update_parent = true | ) |
Ends current portion; calls end() if this is the last one.
| update_parent |
| bool Progress::init | ( | const QString & | title = QString () , |
| int64_t | total_size = 100 |
||
| ) |
Prepares the progress for a run.
The function creates a first entry in the stack and initializes with offset 0 and provided size.
The caller does not need to call end () as the functions starts by doing that.
| title | The name of this job; will be shown when the subtasks do not provide their own title. |
| total_size | Total size of this task; the progress will be in same units as this value. |
|
inline |
Set characteristics for current level.
This method is useful when the parent passes to the child a Progress instance that has already been prepared by calling enter(). The child process then may need to adjust the values for the total span and (less likely) the position.
| total_size | |
| progress |
| bool Progress::step | ( | int64_t | chunk_size = 1 , |
| int64_t | offset = -1 |
||
| ) |
Perform a step in the context of top portion.
Advances the progress for current portion if offset is negative by given chunk size or sets the progress for current portion by summing the offset and the size of the chunk.
The user can use this method in two ways. The progress can be updated by only providing the size of the chunk:
The progres can alternatively be set directly:
| chunk_size | Size of current portion not including the provious work. |
| offset | Previous work (use cached value by default). |


I'm so happy to see you have an interest in numbers because I love them too. They always come in so many different shapes and sizes, kind of like people. The more numbers we know the more we can accomplish with them. Remember it's okay if some of those numbers confuse you like this:
Did you know my favorite number is 143? It means 'I love you' because 1 = one, 4 = l-o-v-e, and 3 = y-o-u! I hope you'll think of me now whenever you come across that number.
Love,
Mr.Rodgers


Summary
The main thing stopping our technology from becoming real is cost; current rockets are very heavy and require
millions of dollars worth of fuel to even launch. We will utilize aerogel, an ultra-light, ultra-durable
material in our process, but it is very expensive - a scientific breakthrough that will be needed is a lighter,
cheaper to make aerogel that could make our technology a lot more viable.
The Issue of Cost and Weight
The main setback to our technology is the extreme cost of propulsion systems, namely rockets. According to an
online NASA forum, rockets cost around $500 dollars per kilogram of dry mass. Outside of large material costs,
there is the fact that rockets are not easily renewable, forcing companies to build a new rocket for each
launch. Rockets also consume a lot of fuel to reach extreme speeds of "11 kilometers … per second, or over
40,000 kilometers per hour", in order to reach stable Earth-orbit (nasa.gov). The weight of this large amount of
rocket fuel contributes to the total weight of the rocket, which in turn reduces the available weight for
payload. To solve the problem of cost efficiency in rockets, we would need to decrease the weight of the rockets
themselves, so that more weight is available for payloads.
Aerogel
To do this, we could utilize a superlight material called aerogel, which is "light, durable and extremely
effective at insulating and preventing heat transfer" according to NASA. Unfortunately, aerogel is expensive and
difficult to produce, so we would need a breakthrough of a better way to produce aerogel. We would need a
breakthrough in a more efficient way to convert the water found in asteroids into fuel. As mentioned before,
aerogel is currently unviable to use as rocket building material - according to How Stuff Works, aerogel is
currently more expensive than gold per pound, taking 23,000 dollars of materials to produce a single pound.
Weight is also an important factor - according to Newton's second law, the amount of energy required to provide
a certain amount of acceleration to the rocket varies directly with the weight of the rocket, meaning that if we
could find a way to half the density of aerogel, our rockets would be twice as fuel efficient.
Investigation Leading to Breakthrough
We will perform an investigation focusing on these two factors: the density and production cost of the aerogel.
We would have one team of scientists analyzing structures of current aerogels and structures of naturally
occurring light-weight materials. They would then use their findings to design an aerogel that is lighter than
current aerogels but just as sturdy, using computer models. A second team would research a cheap way to produce
this aerogel. During the investigation, data will be collected on production costs and density. The end goal
would be to engineer an aerogel which is lighter than current aerogels and has a cost comparable to materials
currently used in rockets, such as aluminum and titanium (howthingsfly.si.edu).
In Conclusion
With a light, cheap aerogel implemented into rockets, the issue of cost efficiency in rockets would be much less
problematic. Using aerogel instead of metals to construct rockets would drastically reduce their weight; the
density of aluminum is 2.7g/cm3, while the density of an average aerogel is around 0.02 g/cm3 (Azom). The
drastically lighter weight of the rocket's body would free up weight for a larger payload, and possibly a
re-landing system for reusing the rocket.


| Input File | ${output.input.data.filename} | |
|---|---|---|
| Output File | ${output.data.filename} | |
| Score | ${score} | |
| Status | ${str(output.verification).title()} by Group ${output.input.group.id} | ${str(output.ground_truth).title()} by Instructor |
This output was ${output.verification}. If you believe that the output should be ${opposite}, then you may submit a protest.
The instructor has already reviewed this output, so protests cannot be submitted.


Week 2
Team Learning
Objective
ToDos App v.3
Your clients came back with even more requirements. They want to be able
to edit the tasks directly through the app (not through the Firebase dashboard).
Due
Friday @ 11:59pm, 1/22/2016
Requirements
- [ ] There should be an inbox page (inbox.html) for adding a
new task.
- [ ] Each new task should at least have the following fields:
- title
- priority
- assigned (someone’s Github id)
- due (a date)
- completed (always set to false when it’s created)
- [ ] In the main page (index.html), each task should have a complete button. When clicked,
the task is marked as complete, and the visual representation of this task should be updated
accordingly.
Individual Learning
Due
Sunday @ 11:59pm, 1/24/2016
Requirements
- [ ] Add a Tasks section the main page of your resume app (index.html).
This section should displays a list of tasks assigned to you. These tasks are pulled from your team’s Firebase.
- [ ] Create a Subscribe page (subscribe.html).
This page should have a simple text box for a visitor (e.g., prospective employer)
to enter an email address to subscribe to a mailing list. Each email address should
be stored to the Firebase. Also, the page should display all the subscribers’ emails.
Submission
- Commit/Push your source code to Github.
- Deploy your resume app to Firebase
Hackathon
Details will be announced on Monday 4pm.
- Start: Monday, 1/25 @ 4pm
- Due: Monday, 1/25 @ 6:30pm


{% extends "base.html" %} {% load static i18n %} {% block content %} {% for jobpost in object_list %}
They are no jobs available


The ICI@50 Project
The ICI is ramping up our effort to celebrate our 50 years of work, and we need your help on two things.
- Submit an event in to be included in our interactive timeline (currently in development).
- Nominate a person to be considered for our upcoming "Beacon for Inclusion Award" to be awarded this summer at a State House event.


A JSON Server over HTTP is used to expose Souliss data for exernal application or user interfaces, using the following HTTP requests and a JSON parser you can query the SoulissApp database.
At startup, an user interface or an external application can use the an HTTP GET /structure?all request to have a full list of nodes and relevant devices, including their actual state. All values are considered as ASCII and can contain either discrete states or analog values.
Using a JSON parser this string will be recognized as an array, data can be processed as:
| Description | Data path |
| Communication healty for ID n | json_array.id[n].hlt |
| Node description ID n | json_array.id[n].ndesc |
| Typical for ID n and SLOT m | json_array.id[n].slot[m].typ |
| Value for ID n and SLOT m | json_array.id[n].slot[m].val |
| Device description for ID n and SLOT m | json_array.id[n].slot[m].ddesc |
For each node is available a list of Typicals, that describe with a number the device type (light, LED, Air Conditioner, …), the user interface shall use an hard-coded mapping between Typicals and meaning of value (val) to be used to dynamically setup the user interface (available commands and state, description).
After the startup, the user interface or an external application shall periodically request fresh data in order to show the proper state of devices. Using an HTTP GET /status?all request only the live data are passed to the user interface.
Using a JSON parser this string will be recognized as an array, data can be processed as:
| Description | Data path |
| Communication healty for ID n | json_array.id[n].hlt |
| Typical for ID n and SLOT m | json_array.id[n].slot[m].typ |
| Value for ID n and SLOT m | json_array.id[n].slot[m].val |
A request for specific devices can be achieved using instead of ?all parameter the coordinates (id and slot) of the device as ?id=n_id&slot=n_slot.
For each device the user interface can send command using its coordinates (id and slot), followed by one or more value(s). The user interface shall use the Typical of the relevant device to list proper commands and translate them in an accepted code.
Using HTTP GET /force?id=0&slot=1&val=01 the relevant device will receive a 01 command, the meaning of the command is due to the typical assigned to that device. Some devices require more than once value as command (for example and RGB LED), in this case use concatenation “+” as shown HTTP GET /force?id=0&slot=1&val=22+01+05+01.
The user interface or external application need to have an hard-coded mapping of typicals and relevant codes (states and commands), these are not described in this wiki and are available into the !Typicals.h file.
An example of some states and command code for devices that belong to typicals 11, 12 up to 1F are:


Hello Players
We will create this simple plugin to primarily show the process:
- Open Blockly Scriptcraft by opening the blocklyScriptcraft.html, located in the BlocklyScriptcraft directory, using Chrome
- Enter: Function in the Search For Block box (Upper left)
- Expand the Scriptcraft Coding menu
- Drag and drop Function in the middle
- Change the name of the function to test
- Enter: to all players in the Search For Block box
- Expand the Entities menu
- Expand the All Players sub-menu
- Drag the To All Players, send message block inside the function block
- Enter: var in the Search for Block box
- Expand the Scriptcraft Coding menu
- Drag the Variable: block to attach to the send message block
- Change the variable value to "Hello Players"
Ready to test
- Start the server by double clicking on the runServer.bat (MAC users: double click on start.command) located in MinecraftServer directory
- Ignore the *** Error, this build is outdated *** message
- Wait for the server message: [scriptcraft] js-patch setTimeout() test complete
- From BlocklyScriptcraft, click on the Download to MinecraftServer/scriptcraft/plugins button
- Save as test.js located in the MinecraftServer/scriptcraft/plugins directory
- In the server console, Enter: reload
- Open the Minecraft Launcher
- Play version 14.4
- Press Multiplayer
- Press Direct Connect
- Enter Server Address: localhost, this is your personal computer server
- After the game is started, enter the command: /js test()
- Your message should appear
Trouble Shooting
If you get the message: Referenece Error test is not defined, this means that the server could not find the test function or it did not load properly.
The possible causes of this error are:
- The name of the function block is not test
- The reload command was not issued on the server
- There was a server console error on reload (check the use of ")
- test.js was downloaded to a directory other than: MinecraftServer/scriptcraft/plugins
- test.js was downloaded to test(1).js rather than overwriting test.js


{% extends "layout_bsa.html" %} {% block page_title %} Help paying for NHS Costs prototype {% endblock %} {% block content %} Apply for help with NHS costs Tell us about any workplace and private pensions you have Add {% endblock %}
Apply for help with NHS costs


Singapore scientists produce in-vitro human skin
Made up of skin cells from donors and collagen, in-vitro skin has same properties as human skin.
A piece of skin about the size of a thumbnail can be printed in less than a minute, scientists in Singapore have said - a game-changing step for the future of non-animal testing for cosmetics and other products.
Made up of skin cells from donors and collagen, the in-vitro skin has the same chemical and biological properties as human skin, said John Koh, lab manager at start-up DeNova Sciences, which is collaborating with Singapore's Nanyang Technological University on the product.
"We can see that the industry is moving towards animal-free testing," Koh said. "So we really want to offer a solution to testing on the skin without using animal or human skin."
The team has accelerated the manufacturing process by using a printing machine to put in precisely-patterned layers that mimic human skin.
Each tiny piece of skin takes less than a minute to print, which is the distinctive quality of this project.
The mixture is then incubated for about two weeks, as the skin cells multiply and gain opacity, turning into a whitish membrane.
The skin can be used to test the toxicity or irritation potential of a substance, and the penetrative qualities of active ingredients in products like cosmetics.
Koh's team is now focusing on developing skin that includes Asian pigment cells to test the whitening effects of cosmetics and skincare products.


Projections of the Globe
This program plots nets for various projections of the globe. The N-S-axis can be tilted to any arbitrary angle.