MERN Stack is the name given to a set of JavaScript based technologies used in developing web applications. MERN is the acronym name given to the set of technologies including Mongo DB, Express JS, React JS/ Redux and Node JS. Among these technologies Mongo DB is a database system, Node JS is a back-end runtime environment, Express JS is a back-end web framework and React is a front-end framework.
Mongo DB is a free and open-source cross-platform document-oriented database program. Classified as a No SQL database program, Mongo DB uses JSON-like documents with schemata. Mongo DB is developed by Mongo DB Inc., and is published under a combination of the GNU Affero General Public License and the Apache License.
Express.js, or simply Express, is a web application framework for Node.js, released as free and open-source software under the MIT License. It is designed for building web applications and APIs. It has been called the de facto standard server framework for Node.js.
React.js is a JavaScript library for building user interfaces. It is maintained by Facebook and a community of individual developers and companies. React can be used as a base in the development of single-page or mobile applications, as it is optimal for fetching rapidly changing data that needs to be recorded.
Node.js is a platform built on Chrome's JavaScript runtime for easily building fast and scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.


Get Started


BOYS DON'T CRY (R). (Twentieth Century Fox) Director: Kimberly Peirce Stars: Hilary Swank, Chloe Sevigny, Peter Sarsgaard, Brendan Sexton III, Alison Folland, Alicia Gornason, Matt McGrath, Rob Campbell, Jeanetta Arnette Running time: 114 minutes.
Like the recent Ma Vie En Rose, Boys Don't Cry is a confronting and disturbing, but compelling look at a confused teenager who chooses to live life on their own terms, contrary to the accepted norms of the larger society around them.
Boys Don't Cry tells the true story of Teena Brandon, a disaffected, tomboyish teenage girl from Nebraska, suffering from a serious crisis of sexual identity. She switched genders to live life as a boy, and was eventually murdered by a couple of bigoted, homophobic thugs. Wrapping her breasts in bandages, stuffing a sock down the front of her jeans, and calling herself Brandon, she moved away from her hometown of Lincoln, in the conservative heartland of America's midwest. Arriving in nearby Falls City, Brandon begins her new life as a boy, a sort of rebel without a penis.
A bar room brawl leads to a friendship with Candace (Alicia Goranson) and Kate (Allison Folland, from All Over Me, etc), and ex-cons John (Peter Sarsgaard, from Dead Man Walking, etc) and Tom (Brendan Sexton III, from Hurricane Streets, etc). Brandon fabricates details about his past life, which are at first accepted by his new friends.
But it is the lonely and insecure Lana (Chloe Sevigny, from Kids, etc), who dreams of becoming a famous karaoke singer, with whom Brandon develops a relationship. Desperate for affection, Lana allows the relationship to develop without question, even when John and Tom grow suspicious about Brandon. When Brandon's true identity and secret is revealed, fear and ignorance give way to unthinking hatred and violence.
In exploring the hypocrisy of modern America, the white trash of America's midwest, and larger questions about troubled youth and sexual identity, this bleak and confronting film also occupies the same seedy cinematic territory as Welcome To The Dollhouse and the repellent Gummo. In some ways Boys Don't Cry is a depressing and grim film, but it is also surprisingly rewarding and inspiring. This is evident through the compassionate treatment of the difficult subject matter and the occasionally sympathetic view of the sometimes uglier elements of human behaviour.
For first time feature director Kimberly Peirce this has been something of a labour of love, and she spent five years researching the story and getting inside the character. Peirce draws uniformly strong performances from her ensemble cast, comprising some of the finest young actors working in the American independent film scene.
Hilary Swank, best known for her role in the forgettable The Next Karate Kid, has attracted a swag of accolades and awards for her sensational and virtuoso performance here. She beautifully captures Brandon's androgynous quality, vividly portraying both the brooding masculinity, the boyish swagger and the chiselled good looks, as well as the more vulnerable elements of this complex and contradictory character. Sevigny is sublime as the trusting Lana, and delivers a moving and memorable performance. Sexton, cast against type, and Sarsgaard effectively capture the latent violence lurking just below the surface of their characters.
Boys Don't Cry is not a film that will sit comfortably with everyone. Peirce deliberately sets out to elicit a response from the audience, and she succeeds. Boys Don't Cry is one film that occupies your mind days after having seen it.
***1/2 greg king http://www.netau.com.au/gregking
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


--- layout: layouts/library/writings/index.njk title: Writings permalink: /library/writings/ ---
The Jaza's World writings archives.


Almost fifteen years since the first time I encountered an RSS feed (and therewith XML), I actually spent the time tonight to learn what <![CDATA[...]]>
is.
Related: I believe I have (finally!) finished fixing my Atom feed output all the way. 😅
*[RSS]: Really Simple Syndication
*[XML]: eXtensible Markup Language


nuFFT mex interface demo
This example demonstrates how to use the mex interface of the nuFFT.
Contents
After compilation, the nuFFT mex library is located in the /bin subdirectory of the nuFFT.
addpath ../bin
load ../data/noncartesian_phantom.mat
We now have the coordinates and density compensation factors of a 9216-sample 2D spiral trajectory, and k-space data of a phantom on that trajectory:
- kcoord - k-space coordinates of non-uniform 2D samples
- dcf - density compensation factors
- kdata - k-space data samples
- imagedirect - exact non-uniform FT of the k-space samples, onto a 128x128 grid, computed in the direct, slow way (computation takes about a minute using one-threaded C++ code)
Create a nuFFT implementation
In order to create a nuFFT implementation, we will need to stack the trajectory coordinates in one vector:
trajectory = kcoord'; trajectory = trajectory(:);
Note that the coordinates should all be in the range [-0.5 0.5] in each axis.
We also need the square root of the density compensation factors.
sqrtdcf = sqrt(dcf);
We will create a nuFFT implementaton with the following parameters:
Nthreads = 1; imagesize = [128 128]; maxaliasingerror = 1e-3; alpha = 2; % oversampling ratio resampling_method = 'spm'; nuFFT_imp = nufft_implementation('double',Nthreads, imagesize, maxaliasingerror, alpha, resampling_method, trajectory, sqrtdcf);
** create nuFFT implementation ** computing implementation data: 0.0834372s initializing external libraries: 1.81198e-05s tuning: 0.011183s deleting nuFFT implementation
Adjoint nuFFT
Now we will perform an adjoint nuFFT on the non-uniform k-space data.
Note that in order to receive an image after the adjoint nuFFT, the input non-uniform k-space data should be density compensated with just the square root of the dcfs.
kdata_dc = kdata.*sqrtdcf;
image_data = nuFFT_imp.adjoint(1,kdata_dc);
** adjoint nuFFT ** adjoint transformation: 0.00487614s
We will compare the adjoint nuFFT result to the result of a direct non-uniform Fourier transform (non-fast)
e = get_image_errors(imagedirect,image_data);
max error: 0.0014982
The error between the direct nuFT and the nuFFT matches the input maximum aliasing error with which we created the nuFFT implementation.
figure subplot(131) imshowz(image_data) title('adjoint nuFFT') subplot(132) imshowz(imagedirect) title('direct adjoint non-uniform FT') subplot(133) imshowz(e) colorbar title('normalized error')
Forward nuFFT
kdata_dc2 = nuFFT_imp.forward(1, image_data);
** forward nuFFT ** forward transformation: 0.0114589s
Check if the forward and adjoint transforms are compatible
kdata_dc2'*kdata_dc-image_data(:)'*image_data(:)
ans = -3.63797880709171e-12 + 2.48689957516035e-14i
That's close enough to zero. If you really want to make sure this works, try it with random data (don't use a random trajectory unless you compute the dcfs for it!).
Clearing an implementation
When an implementation is cleared from memory, it's destructor is invoked to free the memory associated with it.
clear nuFFT_imp
deleting nuFFT implementation
Multithreading
We will now create the nuFFT implementation and perform the transformations using six threads.
nuFFT_imp = nufft_implementation('double',6, [128 128], 1e-3, 2, 'spm', trajectory, sqrtdcf); image_data = nuFFT_imp' * kdata_dc; kdata_dc2 = nuFFT_imp * image_data;
** create nuFFT implementation ** computing implementation data: 0.0741758s initializing external libraries: 1.50204e-05s tuning: 0.00805593s ** adjoint nuFFT ** adjoint transformation: 0.00297189s ** forward nuFFT ** forward transformation: 0.00497508s
Note the above usage of operator notation for applying an adjoint and forward nuFFT on data.
Save implementation to file
impfilename = '../out/demo_nufft_imp.imp'; if ~isdir('../out'), mkdir('../out'), end nuFFT_imp.create_impfile(impfilename);
** create nuFFT implementation file** writing implementation to file: 0.0040381s
Reading an implementation from a file
nuFFT_imp = nufft_implementation('double',1,impfilename);
image_data = nuFFT_imp.adjoint(1,kdata_dc);
figure
imshowz(image_data)
** create nuFFT implementation ** loading implementation from file: 0.00858212s initializing external libraries: 2.00272e-05s tuning: 0.013103s deleting nuFFT implementation ** adjoint nuFFT ** adjoint transformation: 0.00819182s
Create another nuFFT implementation with different parameters
nuFFT_imp2 = nufft_implementation('double',1, [128 128], 1e-2, 1.5, 'spm', trajectory, sqrtdcf);
** create nuFFT implementation ** computing implementation data: 0.047246s initializing external libraries: 1.50204e-05s tuning: 0.00490403s deleting nuFFT implementation
image_data2 = nuFFT_imp2.adjoint(1,kdata_dc);
** adjoint nuFFT ** adjoint transformation: 0.00319195s
e = get_image_errors(imagedirect,image_data2);
max error: 0.015481
The error again matches the input maximum aliasing error.
figure subplot(131) imshowz(image_data2) title('adjoint nuFFT') subplot(132) imshowz(imagedirect) title('direct adjoint non-uniform FT') subplot(133) imshowz(e) colorbar title('normalized error')


The BioMonTools
package was created to enable users to have a common set of tools for bioassessment and biomonitoring data.
The package is hosted on GitHub (https://github.com/leppott/BioMonTools) and can be installed using the following lines of code. It is necessary to install the devtools
package.
After the BioMonTools
package has been installed running the following line of code will open the help file with links to all functions.
The suite of functions in the BioMonTools
package are presented below.
Calculate metric values from a data frame with taxa by sample with fully qualified master taxa information. All percent metric results are 0-1.
There are a number of required fields for the input file. If any fields are missing the user will be prompted as to which are missing and the user can decide whether to continue or quit. If the user continues, the missing fields will be added but will be filled with zero or NA (as appropriate). Any metrics based on the missing fields will not be valid.
Required Fields:
SAMPLEID
Unique sample identifier
Valid entries: character or number, must be unique
TAXAID
Unique taxa identifier
Valid entries: character or number, must be unique
N_TAXA
Number of individuals
Valid entries: number
EXCLUDE
Non-unique/non-distinct taxa are excluded from richness metric calculations but are counted in the other metrics. Appendix B of the ‘BCGcalc_README_20180919’ Word document describes the Excluded Taxa Decision Criteria that was used during BCG model calibration.
Valid entries: TRUE or FALSE
Non-unique/non-distinct taxa should be entered as “TRUE”
NONTARGET
Non-target taxa are not part of the intended capture list; e.g., fish, herps, water column taxa. They are excluded from all metric calculations.
Valid entries: TRUE or FALSE.
NonTarget taxa should be entered as “TRUE”
INDEX_NAME
Name of the BCG rules worksheet in the ‘Rules’ file (in the ‘extdata’ folder) that the R code is referencing.
Valid entries for the Puget Lowlands/Willamette Valley model: BCG_PacNW_v1_500ct or BCG_PacNW_v1_300ct.
SITE_TYPE
Select which BCG model to apply: Low (lo) gradient (<1% NHD+ v2 flowline slope) or high (hi) gradient (≥ 1% NHD+ v2 flowline slope).
Valid entries: “hi” or “lo”.
PHYLUM, SUBPHYLUM, CLASS, ORDER, FAMILY, SUBFAMILY, TRIBE, GENUS
Phylogeny
Other phylogenetic rankings (e.g., SubOrder or SuperFamily) can be included but are not used in the current metric calculations.
Valid entries: text
BCG_Attr
BCG attribute assignments (for example, Stamp and Gerritsen 2018).
Valid entries: 1i, 1m, 2, 3, 4, 5, 6; if not available, leave blank or enter ‘NA’.
FFG, HABIT, LIFE_CYCLE, TOLVAL, THERMAL_INDICATOR
FFG
Valid values for FFG: CG, CF, PR, SC, SH
Function feeding group entries.
HABIT
Valid values for HABIT: BU, CB, CN, SP, SW
Habit designations.
LIFE_CYLCE
Valid values for LIFE_CYCLE: UNI, SEMI, MULTI
Life cycle designations.
THERMAL_INDICATOR
Fields that are optional can be in the output (see examples below).
# Packages
library(readxl)
library(knitr)
library(BioMonTools)
# Load Data
df.data <- read_excel(system.file("./extdata/Data_Benthos.xlsx"
, package="BioMonTools")
, guess_max = 10^6)
# Columns to keep
myCols <- c("Area_mi2", "SurfaceArea", "Density_m2", "Density_ft2")
# Run Function
df.metval <- metric.values(df.data, "bugs", fun.cols2keep=myCols)
# Metrics of Interest
## thermal indicator (_ti_)
#names(df.metval)[grepl("_ti_", names(df.metval))]
col.met2keep <- c("ni_total", "nt_total", "nt_ti_c", "nt_ti_cc", "nt_ti_cw"
, "nt_ti_w", "pi_ti_c", "pi_ti_cc", "pi_ti_cw", "pi_ti_w"
, "pt_ti_c", "pt_ti_cc", "pt_ti_cw", "pt_ti_w")
col.ID <- c("SAMPLEID", toupper(myCols), "INDEX_NAME", "INDEX_REGION")
# Ouput
df.metval.ci <- df.metval[, c(col.ID, col.met2keep)]
# RMD table
kable(head(df.metval.ci), caption = "Metric Calculation, select metrics")
| SAMPLEID | AREA_MI2 | SURFACEAREA | DENSITY_M2 | DENSITY_FT2 | INDEX_NAME | INDEX_REGION | ni_total | nt_total | nt_ti_c | nt_ti_cc | nt_ti_cw | nt_ti_w | pi_ti_c | pi_ti_cc | pi_ti_cw | pi_ti_w | pt_ti_c | pt_ti_cc | pt_ti_cw | pt_ti_w |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 01103CSR_Bug_2001-08-27_0 | 44.084184 | NA | NA | NA | BCG_PacNW_v1_500ct | lo | 589 | 27 | 0 | 1 | 9 | 7 | 0.0000000 | 40.237691 | 20.713073 | 11.884550 | 0.000000 | 3.703704 | 33.333333 | 25.925926 |
| 02087REF_Bug_2002-08-22_0 | 1.791475 | NA | NA | NA | BCG_PacNW_v1_500ct | hi | 542 | 38 | 2 | 21 | 7 | 1 | 3.1365314 | 15.129151 | 5.535055 | 64.022140 | 5.263158 | 55.263158 | 18.421053 | 2.631579 |
| 03013CSR_Bug_2003-07-01_0 | 9.613734 | 8 | NA | NA | BCG_PacNW_v1_500ct | hi | 507 | 16 | 0 | 3 | 2 | 4 | 0.0000000 | 2.958580 | 10.256410 | 60.157791 | 0.000000 | 18.750000 | 12.500000 | 25.000000 |
| 03053CSR_Bug_2003-08-14_0 | 3.061723 | 8 | NA | NA | BCG_PacNW_v1_500ct | hi | 573 | 36 | 1 | 18 | 6 | 3 | 3.3158813 | 42.757417 | 15.706806 | 9.075044 | 2.777778 | 50.000000 | 16.666667 | 8.333333 |
| 03054CSR_Bug_2003-08-18_0 | 71.249741 | 8 | NA | NA | BCG_PacNW_v1_500ct | lo | 558 | 13 | 1 | 3 | 1 | 3 | 0.5376344 | 6.451613 | 5.376344 | 74.910394 | 7.692308 | 23.076923 | 7.692308 | 23.076923 |
| 06012CSR_Bug_2006-09-05_0 | 82.338353 | 8 | NA | NA | BCG_PacNW_v1_500ct | hi | 545 | 40 | 1 | 17 | 11 | 4 | 1.1009174 | 32.844037 | 43.119266 | 18.532110 | 2.500000 | 42.500000 | 27.500000 | 10.000000 |
Takes as an input data frame with Sample ID, Taxa ID, and phlogenetic name fields and returns a similar dataframe with a column for “excluded” taxa (TRUE or FALSE).
Excluded taxa are refered to by multiple names; ambiguous, non-distinct, and non-unique. The “excluded” name was chosen so as to be consistent with “non-target” taxa. That is, taxa marked as “TRUE” are treated as undesireables. Excluded taxa are those that are present in a sample when taxa of the same group are present in the same sample are identified finer level. That is, the parent is marked as excluded when child taxa are present in the same sample.
The excluded taxa are referenced in the metric values function. These taxa are removed from the taxa richness metrics. This is because these are coarser level taxa.
Exceptions is a 2 column data frame of synonyms or other exceptions. Column 1 is the name used in the TaxaID column the input data frame (df_samptax). Column 2 is the name used in the TaxaLevels columns of the input data frame (df_samptax). The phylogenetic columns (TaxaLevels) will be modified from Column 2 of the Exceptions data frame to match Column 1 of the Exceptions data frame. This ensures that the algorithm for markExcluded works properly. The changes will not be stored and the original names provided in the input data frame (df_samptax) will be returned in the final result. The function example below includes a practical case.
Taxa Levels are phylogenetic names that are to be checked. They should be listed in order from course (kingdom) to fine (species). Names not appearing in the data will be skipped.
The spelling of names must be consistent (including case) for this function to produce the intended output.
Returns a data frame of df_samptax with an additional column, ExcludedTaxa.
# Packages
library(readxl)
library(dplyr)
#>
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#>
#> filter, lag
#> The following objects are masked from 'package:base':
#>
#> intersect, setdiff, setequal, union
library(lazyeval)
library(knitr)
# Data
df_samps_bugs <- read_excel(system.file("./extdata/Data_Benthos.xlsx"
, package="BioMonTools")
, guess_max=10^6)
# Variables
SampID <- "SampleID"
TaxaID <- "TaxaID"
TaxaCount <- "N_Taxa"
Exclude <- "Exclude_New"
TaxaLevels <- c("Kingdom"
, "Phylum"
, "SubPhylum"
, "Class"
, "SubClass"
, "Order"
, "SubOrder"
, "SuperFamily"
, "Family"
, "SubFamily"
, "Tribe"
, "Genus"
, "SubGenus"
, "Species"
, "Variety")
# Taxa that should be treated as equivalent
Exceptions <- data.frame("TaxaID"=c("Sphaeriidae"), "PhyloID"=c("Pisidiidae"))
# Filter Data
# df_samptax <- filter(df_samps_bugs, !!as.name(SampID) == "08BEA3478__2013-08-21_0")
# df_tst_small <- markExcluded(df_samptax, SampID, TaxaID, TaxaCount, TaxaLevels, Exceptions, Exclude)
# EXAMPLE 1
df_tst <- markExcluded(df_samps_bugs, SampID="SampleID", TaxaID="TaxaID", TaxaCount = "N_Taxa"
, Exclude="Exclude_New", TaxaLevels=TaxaLevels, Exceptions=Exceptions)
#> *WARNING*, 3 taxa levels missing from input data frame;
#> KINGDOM, SUBORDER, VARIETY
#> [1] "Working on item (1/12); PHYLUM"
#> [1] "Working on item (2/12); SUBPHYLUM"
#> [1] "Working on item (3/12); CLASS"
#> [1] "Working on item (4/12); SUBCLASS"
#> [1] "Working on item (5/12); ORDER"
#> [1] "Working on item (6/12); SUPERFAMILY"
#> [1] "Working on item (7/12); FAMILY"
#> [1] "Working on item (8/12); SUBFAMILY"
#> [1] "Working on item (9/12); TRIBE"
#> [1] "Working on item (10/12); GENUS"
#> [1] "Working on item (11/12); SUBGENUS"
#> [1] "Working on item (12/12); SPECIES"
# Compare
df_compare <- dplyr::summarise(dplyr::group_by(df_tst, SampleID)
, Exclude_Import=sum(Exclude)
, Exclude_R=sum(Exclude_New))
df_compare$Diff <- df_compare$Exclude_Import - df_compare$Exclude_R
#
tbl_diff <- table(df_compare$Diff)
#kable(tbl_diff)
# sort
df_compare <- df_compare %>% arrange(desc(Diff))
# Number with issues
#sum(abs(df_compare$Diff))
# total samples
#nrow(df_compare)
# confusion matrix
tbl_results <- table(df_tst$Exclude, df_tst$Exclude_New, useNA = "ifany")
#
# Show differences
kable(tbl_results, caption="Confusion Matrix")
| FALSE | TRUE | |
|---|---|---|
| FALSE | 24653 | 0 |
| TRUE | 0 | 2350 |
# samples with differences
samp_diff <- as.data.frame(df_compare[df_compare[,"Diff"]!=0, "SampleID"])
# results for only those with differences
df_tst_diff <- df_tst[df_tst[,"SampleID"] %in% samp_diff$SampleID, ]
# add diff field
df_tst_diff$Exclude_Diff <- df_tst_diff$Exclude - df_tst_diff$Exclude_New
# Classification Performance Metrics
class_TP <- tbl_results[2,2] # True Positive
class_FN <- tbl_results[2,1] # False Negative
class_FP <- tbl_results[1,2] # False Positive
class_TN <- tbl_results[1,1] # True Negative
class_n <- sum(tbl_results) # total
#
# sensitivity (recall); TP / (TP+FN); measure model to ID true positives
class_sens <- class_TP / (class_TP + class_FN)
# precision; TP / (TP+FP); accuracy of model positives
class_prec <- class_TP / (class_TP + class_FP)
# specifity; TN / (TN + FP); measure model to ID true negatives
class_spec <- class_TN / (class_TN + class_FP)
# overall accuracy; (TP + TN) / all cases; accuracy of all classifications
class_acc <- (class_TP + class_TN) / class_n
# F1; 2 * (class_prec*class_sens) / (class_prec+class_sens)
## balance of precision and recall
class_F1 <- 2 * (class_prec * class_sens) / (class_prec + class_sens)
#
results_names <- c("Sensitivity (Recall)", "Precision", "Specificity", "OVerall Accuracy", "F1")
results_values <- c(class_sens, class_prec, class_spec, class_acc, class_F1)
#
tbl_class <- data.frame(results_names, results_values)
names(tbl_class) <- c("Performance Metrics", "Percent")
tbl_class$Percent <- round(tbl_class$Percent *100, 2)
kable(tbl_class, caption="Classification Performance Metrics")
| Performance Metrics | Percent |
|---|---|
| Sensitivity (Recall) | 100 |
| Precision | 100 |
| Specificity | 100 |
| OVerall Accuracy | 100 |
| F1 | 100 |
The same data with no “exceptions” leaves 8 records misclassified.
# Packages
library(readxl)
library(dplyr)
library(lazyeval)
library(knitr)
# Data
df_samps_bugs <- read_excel(system.file("./extdata/Data_Benthos.xlsx"
, package="BioMonTools")
, guess_max=10^6)
# Variables
SampID <- "SampleID"
TaxaID <- "TaxaID"
TaxaCount <- "N_Taxa"
Exclude <- "Exclude_New"
TaxaLevels <- c("Kingdom"
, "Phylum"
, "SubPhylum"
, "Class"
, "SubClass"
, "Order"
, "SubOrder"
, "SuperFamily"
, "Family"
, "SubFamily"
, "Tribe"
, "Genus"
, "SubGenus"
, "Species"
, "Variety")
# Taxa that should be treated as equivalent
Exceptions <- NA
# EXAMPLE 2
## No Exceptions
df_tst2 <- markExcluded(df_samps_bugs, SampID="SampleID", TaxaID="TaxaID", TaxaCount = "N_Taxa"
, Exclude="Exclude_New", TaxaLevels=TaxaLevels, Exceptions=NA)
#> *WARNING*, 3 taxa levels missing from input data frame;
#> KINGDOM, SUBORDER, VARIETY
#> [1] "Working on item (1/12); PHYLUM"
#> [1] "Working on item (2/12); SUBPHYLUM"
#> [1] "Working on item (3/12); CLASS"
#> [1] "Working on item (4/12); SUBCLASS"
#> [1] "Working on item (5/12); ORDER"
#> [1] "Working on item (6/12); SUPERFAMILY"
#> [1] "Working on item (7/12); FAMILY"
#> [1] "Working on item (8/12); SUBFAMILY"
#> [1] "Working on item (9/12); TRIBE"
#> [1] "Working on item (10/12); GENUS"
#> [1] "Working on item (11/12); SUBGENUS"
#> [1] "Working on item (12/12); SPECIES"
# Compare
df_compare2 <- dplyr::summarise(dplyr::group_by(df_tst2, SampleID)
, Exclude_Import=sum(Exclude)
, Exclude_R=sum(Exclude_New))
df_compare2$Diff <- df_compare2$Exclude_Import - df_compare2$Exclude_R
#
tbl_diff2 <- table(df_compare2$Diff)
#kable(tbl_diff2)
# sort
df_compare2 <- df_compare2 %>% arrange(desc(Diff))
# Number with issues
#sum(abs(df_compare2$Diff))
# total samples
#nrow(df_compare2)
# confusion matrix
tbl_results2 <- table(df_tst2$Exclude, df_tst2$Exclude_New, useNA = "ifany")
#
# Show differences
kable(tbl_results2, caption="Confusion Matrix")
| FALSE | TRUE | |
|---|---|---|
| FALSE | 24653 | 0 |
| TRUE | 8 | 2342 |
| SampleID | Exclude_Import | Exclude_R | Diff |
|---|---|---|---|
| 08BEA3478__2013-08-21_0 | 3 | 2 | 1 |
| 08BEA3571__2014-09-03_0 | 5 | 4 | 1 |
| 08LIT2692__2012-09-10_0 | 8 | 7 | 1 |
| 08SAM0000__2012-07-11_0 | 4 | 3 | 1 |
| 08SAM0000__2013-07-25_0 | 4 | 3 | 1 |
| 09BLA0716__2014-08-14_0 | 3 | 2 | 1 |
| 95C__2012-10-02_0 | 1 | 0 | 1 |
| 95T__2012-10-03_0 | 1 | 0 | 1 |
| 01103CSR_Bug_2001-08-27_0 | 1 | 1 | 0 |
| 02087REF_Bug_2002-08-22_0 | 0 | 0 | 0 |
| SampleID | Exclude_Import | Exclude_R | Diff |
|---|---|---|---|
| WOODS298__2010-08-09_0 | 7 | 7 | 0 |
| WOODS298__2013-09-03_0 | 7 | 7 | 0 |
| Woods446__2010-08-19_0 | 6 | 6 | 0 |
| Woodscres__2010-08-05_0 | 11 | 11 | 0 |
| woodshand__2010-08-06_0 | 12 | 12 | 0 |
| woodshand__2013-09-03_0 | 4 | 4 | 0 |
# samples with differences
(samp_diff2 <- as.data.frame(df_compare2[df_compare2[,"Diff"]!=0, "SampleID"]))
#> SampleID
#> 1 08BEA3478__2013-08-21_0
#> 2 08BEA3571__2014-09-03_0
#> 3 08LIT2692__2012-09-10_0
#> 4 08SAM0000__2012-07-11_0
#> 5 08SAM0000__2013-07-25_0
#> 6 09BLA0716__2014-08-14_0
#> 7 95C__2012-10-02_0
#> 8 95T__2012-10-03_0
# results for only those with differences
df_tst_diff2 <- filter(df_tst2, SampleID %in% samp_diff2$SampleID)
# add diff field
df_tst_diff2$Exclude_Diff <- df_tst_diff2$Exclude - df_tst_diff2$Exclude_New
# Classification Performance Metrics
class_TP2 <- tbl_results2[2,2] # True Positive
class_FN2 <- tbl_results2[2,1] # False Negative
class_FP2 <- tbl_results2[1,2] # False Positive
class_TN2 <- tbl_results2[1,1] # True Negative
class_n2 <- sum(tbl_results2) # total
#
# sensitivity (recall); TP / (TP+FN); measure model to ID true positives
class_sens2 <- class_TP2 / (class_TP2 + class_FN2)
# precision; TP / (TP+FP); accuracy of model positives
class_prec2 <- class_TP2 / (class_TP2 + class_FP2)
# specifity; TN / (TN + FP); measure model to ID true negatives
class_spec2 <- class_TN2 / (class_TN2 + class_FP2)
# overall accuracy; (TP + TN) / all cases; accuracy of all classifications
class_acc2 <- (class_TP2 + class_TN2) / class_n2
# F1; 2 * (class_prec*class_sens) / (class_prec+class_sens)
## balance of precision and recall
class_F12 <- 2 * (class_prec2 * class_sens2) / (class_prec2 + class_sens2)
#
results_names2 <- c("Sensitivity (Recall)", "Precision", "Specificity", "OVerall Accuracy", "F1")
results_values2 <- c(class_sens2, class_prec2, class_spec2, class_acc2, class_F12)
#
tbl_class2 <- data.frame(results_names2, results_values2)
names(tbl_class2) <- c("Performance Metrics", "Percent")
tbl_class2$Percent <- round(tbl_class2$Percent *100, 2)
kable(tbl_class2, caption="Classification Performance Metrics")
| Performance Metrics | Percent |
|---|---|
| Sensitivity (Recall) | 99.66 |
| Precision | 100.00 |
| Specificity | 100.00 |
| OVerall Accuracy | 99.97 |
| F1 | 99.83 |
The rarify function subsamples count data to a fixed count per sample. It takes as an input a 3 column data frame (SampleID, TaxonID, Count) and returns a similar dataframe with revised Counts. The names of the columns does not matter as they are specified in the code. Any non-count taxa (e.g., fish in a bug sample) should be removed prior to using the rarify
function. The function code is from USEPA Corvallis John Van Sickle’s R code for RIVPACS (v1.0, 2005-06-10) and was tweaked for the addition of a user provided seed so repeatable results can be obtained.
The other function inputs are subsample size (target number of organisms in each sample) and seed. The seed is given so the results can be reproduced from the same input file. If no seed is given a random seed is used. An example seed is the date of admission to the Union for each state where the data is collected (e.g., Washington is 18891111). These values can be found on Wikipedia on the right sidebar for each State.
If you are running the 500-count BCG model and any of your samples have more than 600 organisms (the upper limit for the model), you should randomly subsample your data to 600 (600 is +20% of the 500-count target). This is done to make richness metrics comparable across the 500-count samples. You can do this with the Rarify routine.
# Subsample to 500 organisms (from over 500 organisms) for 12 samples.
# Packages
library(knitr)
# load bio data
df_biodata <- data_bio2rarify
#dim(df_biodata)
#kable(head(df_biodata))
# subsample
mySize <- 500
Seed_OR <- 18590214
Seed_WA <- 18891111
Seed_US <- 17760704
bugs_mysize <- rarify(inbug=df_biodata, sample.ID="SampleID"
,abund="N_Taxa",subsiz=mySize, mySeed=Seed_US)
#> Rarify of samples complete.
#> Number of samples = 12
#> Execution time (sec) = 0
# view results
#dim(bugs_mysize)
#kable(head(bugs_mysize))
# Compare pre- and post- subsample counts
df_compare <- merge(df_biodata, bugs_mysize, by=c("SampleID", "TaxaID")
, suffixes = c("_Orig","_500"))
df_compare <- df_compare[,c("SampleID", "TaxaID", "N_Taxa_Orig", "N_Taxa_500")]
kable(head(df_compare), caption = "Comparison, by Sample")
| SampleID | TaxaID | N_Taxa_Orig | N_Taxa_500 |
|---|---|---|---|
| 01103CSR_Bug_2001-08-27_0 | Ceratopogoninae | 237 | 142 |
| 01103CSR_Bug_2001-08-27_0 | Cheumatopsyche | 2 | 0 |
| 01103CSR_Bug_2001-08-27_0 | Chironomini | 8 | 4 |
| 01103CSR_Bug_2001-08-27_0 | Cladocera | 2 | 1 |
| 01103CSR_Bug_2001-08-27_0 | Coenagrionidae | 2 | 1 |
| 01103CSR_Bug_2001-08-27_0 | Corbicula | 2 | 1 |
# compare totals
tbl_totals <- aggregate(cbind(N_Taxa_Orig, N_Taxa_500) ~ SampleID, df_compare, sum)
kable(head(tbl_totals), caption = "Comparison, sample totals")
| SampleID | N_Taxa_Orig | N_Taxa_500 |
|---|---|---|
| 01103CSR_Bug_2001-08-27_0 | 816 | 500 |
| 02087REF_Bug_2002-08-22_0 | 542 | 500 |
| 03013CSR_Bug_2003-07-01_0 | 508 | 500 |
| 03053CSR_Bug_2003-08-14_0 | 573 | 500 |
| 03054CSR_Bug_2003-08-18_0 | 558 | 500 |
| 06012CSR_Bug_2006-09-05_0 | 545 | 500 |
## Not run:
# save the data
#write.table(bugs_mysize, paste("bugs",mySize,"txt",sep="."),sep="\t")
## End(Not run)
Results should be interpreted with caution if they are flagged for any of the criteria listed below. It is up to the user’s discretion as to how to handled flagged samples.
# Packages
library(readxl)
library(reshape2)
library(knitr)
library(BioMonTools)
# Import
df.samps.bugs <- read_excel(system.file("./extdata/Data_Benthos.xlsx"
, package="BioMonTools")
, guess_max = 10^6)
# Calculate Metrics
# Extra columns to keep in results
keep.cols <- c("Area_mi2", "SurfaceArea", "Density_m2", "Density_ft2")
# Run Function
df.metrics <- metric.values(df.samps.bugs, "bugs", fun.cols2keep = keep.cols)
# Flags
# Import QC Checks
df.checks <- read_excel(system.file("./extdata/MetricFlags.xlsx"
, package="BioMonTools"), sheet="Flags")
# Run Function
df.flags <- qc.checks(df.metrics, df.checks)
# Change terminology; PASS/FAIL to NA/flag
df.flags[,"FLAG"][df.flags[,"FLAG"]=="FAIL"] <- "flag"
df.flags[, "FLAG"][df.flags[,"FLAG"]=="PASS"] <- NA
# long to wide format
df.flags.wide <- dcast(df.flags, SAMPLEID ~ CHECKNAME, value.var="FLAG")
# Calc number of "flag"s by row.
df.flags.wide$NumFlags <- rowSums(df.flags.wide=="flag", na.rm=TRUE)
# Rearrange columns
NumCols <- ncol(df.flags.wide)
df.flags.wide <- df.flags.wide[, c(1, NumCols, 2:(NumCols-1))]
# View(df.flags.wide)
# Summarize Results
kable(table(df.flags[,"CHECKNAME"], df.flags[,"FLAG"], useNA="ifany"))
| flag | NA | |
|---|---|---|
| brackish organisms present | 7 | 671 |
| catchment, Large | 0 | 678 |
| catchment, small | 158 | 520 |
| individuals, dominant 02, Large | 204 | 474 |
| individuals, Large | 0 | 678 |
| individuals, small | 80 | 598 |
| Low density (ft2) | 0 | 678 |
| Low density (m2) | 0 | 678 |
| Ramellogammarus | 8 | 670 |
| surface area, small | 112 | 566 |


Grain Meters
Synth Meters
Start Position & Loop Size
Playback Rate & Detune
Grain Size & Overlap
Filter & Delay
Pick a Sound or Record Your Own
Press Start in the top left to begin crafting sonic environments!
Sculpt sounds from the Sound Selector using the control pads.
Choose new sounds by loading a file or capture your own with Record Input.
Create patterns with the synthesis selector, and control their length with the sliders.
Record the output of the sculpted sounds back into a looping part with the Overdub button above.
Grain Volumes
Synth Volumes
Drone Synth
Reverb Gain
Grain Bus Gain
Synth Bus Gain
Length (Seconds):


Cleveland Browns Fans Use Helmet To Hit A Mason Rudolph Pinata Before Game (VIDEO)
by Darrelle LincolnCleveland Browns fans are taking the fight between Myles Garrett and Mason Rudolph to hilarious levels.
Before the team was slated to face off against the Miami Dolphins on Sunday, the fan base got a Mason Rudolph pinata, a Steelers helmet, and blindfolded a guy as he tried to hit it.
The Browns DE is now suspended for the remainder of the 2019 season and the postseason if the team makes it that far. He should be ready to go by 2020.
Rudolph received a $50K fine for his actions during the fight.


Farmer's market held in Oman
by Times News ServiceMuscat: The Souq Es Sabt (Saturday Market), a local farmer's market was held at Al Mouj in Muscat. The city's first and only pop up artisan farmer's market will be held every Saturday till 21 March. The market begins at 8.30 on Saturday mornings and closes at 3 PM.
Visitors can purchase fresh local produce and a variety of different creative and innovation businesses are also present besides healthy eateries and traditional Omani delicacy makers and craft shops. The market also features different playing areas and activities for children and often hosts live local musicians as well.
The market’s objective is to promote local business and to attract tourists.


PCArt
Home
Contact
About
Contact
You have ideas, we have solutions.
First Name
Last Name
Email Address
Message
Send Message


[gecode-users] How to create distributing strategies
Guido Tack
tack at ps.uni-sb.de
Wed Nov 30 11:23:36 CET 2005
Hi!
> We are currently working in a project related to scheduling. We need a
> distributor like Schedule.firstsDist in Mozart.
>
> 1. How is called a "distributor" in gecode?
It's called "branching".
> 2. Will (or does) gecode implements this distributor?
Not yet. In fact, except for the cumulatives constraint, we don't have any
propagators for scheduling constraints yet, and hence haven't implemented
branchings for scheduling either.
> 3. How can we implement out custom distribution strategies?
As long as the tutorial documentation is not available, you will have to take
an existing branching together with the reference documentation and figure
out how it works. The current branchings for integer variables can be found
in the files int/branch.* and int/branch/*. Please have a look at these files
and their documentation, and if anything is not clear to you, feel free to
use the mailing list for any questions that come up.
Cheers,
Guido
--
Guido Tack
Programming Systems Lab, Saarland University, Saarbrücken
http://www.ps.uni-sb.de/~tack
More information about the gecode-users
mailing list


a general question (maybe stupid) - can dex be transformed to allow also no-crypto trades (regular market) meaning I could sell car, music, anything ?
seems to me that those guys trying to make a marketplace are actually missing the most important trades in crypto - trading crypto:crypto
but here since the crypto:crypto trades are - maybe make sense to extend the app to make "just any trades"
@PTYX ?
a decentralized marketplace ?
reputation points needed for sure, and a search engine ?
plus some "gui changes"
TonyL17-Sep-18 07:15 AM
@passcombo.com 🏴☠🏴 at first you have to tokenise your item I guess
passcombo.com 🏴☠🏴17-Sep-18 07:15 AM
@TonyL I think to sell a car and make it safe transaction only a escrow kind is needed or blocking funds untill transaction is confirmed
so that funds will be accessible by neither of sides if someone cheating
+ actually tere could be trades of services and ann's like "Freelance devs
TonyL17-Sep-18 07:17 AM
It's a oracle question mostly as I think
If you trade crypto:crypto on DEX it's possible to proof that both parties have crypto and lock it
passcombo.com 🏴☠🏴17-Sep-18 07:18 AM
why I'm asking is part is already doen as dex must use gui, and have user acccount, so addind the other parts like reputations and search engine could make it
half way there
TonyL17-Sep-18 07:18 AM
But in case of some real - oracle have to proof that you really have it, that you really have full rights on it, that you'll really give it after trade
polycryptoblog17-Sep-18 07:18 AM
Working on something like this with barter exchange, unfortunately will have to necessarily be centralized , legal issues... but it because it is centralized it allows for legal claims against offending parties .
TonyL17-Sep-18 07:19 AM
In future if data on blockchain will have legal power I think it's possible to implement it on CC - CC sale contract, oracle checking your rights on property in government bases or smth like this
If someone paying crypto - agreement data singing in oracle CC
But needs arbitrary system as well and a lot of stuff )
passcombo.com 🏴☠🏴17-Sep-18 07:23 AM
@polycryptoblog great news! how advances are you with that?
@TonyL when selling a car you still need to pass the papars of ownership and so on...
digital goods hardest to escrow
@polycryptoblog what will be the central part? meaning it will noe be a p2p app ?
I still believe it can be full decentralized
just like p2p file sharing, just anybody can do it with no control
TonyL17-Sep-18 07:25 AM
@passcombo.com 🏴☠🏴 Identification on blockchain, governement documents bases on blockchain and that's it
Maybe in 2050
passcombo.com 🏴☠🏴17-Sep-18 07:26 AM
in decentralize there can be some issues but sghould be solved by community around it, like if someone will be selling sth dangerous or harming other people - community should make some actions to tag such content and make it somehow hard to trade or even ban (by voting?)
polycryptoblog17-Sep-18 07:31 AM
It's coming along. Mining farm almost ready just waiting on power company. Been doing a lot of reading and competitive analysis to try and make a viable economic system . It is a p2p system however the record keeper is the one who adjusts the account balances not the participants in the trade. Example: somebody wants to barter access to your password app. They would contact the exchange who would broker the deal with you, your account would be credited and their account debited. Contrast with normal crypto transaction of the payment variety. The big benefit of the barter exchange system is that in the example the exchange is done on credit where in traditional crypto payments requires the party to have the crypto at the time ( necessary double coincidence )
passcombo.com 🏴☠🏴17-Sep-18 07:39 AM
is that done for speed purpose (3rd party record keeper)?
polycryptoblog17-Sep-18 07:41 AM
No, for legal purposes. It would be more speedy to allow people to do the tx themselves, however there is no way around MSB laws if you allow that. The secret sauce of the barter exchange is that there is no money per se, just accouting units in a ledger , that's how they have been getting around FinCEN and licensing.
Legally barter exchange has to file 1099B in aggregate tx for businesses that are part of it and for each transaction for nonbusinesses
passcombo.com 🏴☠🏴17-Sep-18 07:42 AM
I dont get still why you need to make it "legal". To make money on it?  This way full decentralized and if someone cheating: 1. his money will be blocked anyway by escrow system 2. he will get bad or no reputation. What may be hard is some identity and reputation system might be required so that less people will be cheated
What is MSB? How they can block p2p system ?
you operate in US ?
polycryptoblog17-Sep-18 07:44 AM
The point of making it legal is for real adoption. To tie in noncrypto businesses with crypto . MSB is money services business. Yes I'm in the US.
passcombo.com 🏴☠🏴17-Sep-18 07:45 AM
ok I guess for professional traders there are some obligations and if they not fullfill it (cause of system) they will not use it ?
polycryptoblog17-Sep-18 07:45 AM
No, the exchange would be liable and that's prison time
passcombo.com 🏴☠🏴17-Sep-18 07:46 AM
but then it could work 2 ways: professional sellers using 3rd party, single users wanting to be full anon - using no rd party
ok Dont want to loose your time, I would need to understand much more to get it
Commercial Trade Exchanges, Their Present Limitations and Potential Future [This is a draft chapter for a forthcoming book. Draft of August 5, 2007] By Thomas H. Greco, Jr. Commer…
CrisF17-Sep-18 09:55 AM
Hi,
I'd like to send out a big thank you to the many people who have been helping me here over the last few months.
The kindness that's been shown and selfless help that has been given to me was unexpected. This is how the world is supposed to be. I'd forgotten that.
Thanks to your support I've gone from an absolute and total noob to a total noob who has his own chain for testing.
It's quite inspiring to watch all of you you do your part in advancing this technology and making it so accessible
Keep up the great work!
6
4
4
2
1
10
blackjok3r17-Sep-18 10:07 AM
Dont forget your chain is notarized
CrisF17-Sep-18 10:33 AM
Haha, yeah, it has been a good day
CryptoHuff17-Sep-18 03:50 PM
How is everyones looking today?
nii23617-Sep-18 04:20 PM
So the orderbooks seem pretty thin on HyperDEX, yet comments and marketing around the internet suggest over 100,000 trades. Where are they?
snowdamn17-Sep-18 04:23 PM
100k overall trades, not average daily Volume
KomodoWorld17-Sep-18 04:25 PM
there were peaks of 50k - 100k usd volume a few months ago
ComputerGenie 👴👴👴17-Sep-18 04:56 PM
and tbh, most of those trades were on BarterDEX GUI and not HyperDEX GUI
#BecauseTimelinesMatter
Thanks dude, all the credit goes to our writer Darren Klein
He is what I like to call, a crypto Shakespeare
dan.17-Sep-18 06:11 PM
A few months ago there was a poll somewhere asking how many ACs by the end of 2018 (< 100 or > 100) It seems KMD has currently about ~50 including James' ACs?
Alright17-Sep-18 06:21 PM
There are currently 35 notarized asset chains, which doesn't include CHIPS or GAME(edited)
but I can think of about another 10 chains that are not yet notarized
dan.17-Sep-18 06:23 PM
Getting close then
ComputerGenie 👴👴👴17-Sep-18 06:25 PM
including James' ACs? (edited)
KomodoWorld17-Sep-18 06:26 PM
@dan. I think it was me, but I can't find the thread on bitcointalk, it was Komodo speculation or something(edited)
oh I found it
ComputerGenie 👴👴👴17-Sep-18 06:27 PM
@Alright After the events of the weekend, I'm assuming that CALL is not notarized?(edited)
kimmel (Pungo.io)17-Sep-18 06:31 PM
hi there, we would like to start testing our fiat gateway for some currencies in South America (Brazil, Argentina, Chile, Colombia) in its local currencies and also CNY for china. It would be interesting to contact people whom could sell some small amounts of KMD/BTC who has local accounts in order to check how it goes. We would add some bonus to sold amounts. Contact me in case you would like to participate! thx!
dan.17-Sep-18 06:33 PM
@ComputerGenie 👴👴👴 there's gotta be more than one, right? (edited)
ComputerGenie 👴👴👴17-Sep-18 06:34 PM
@dan. I'm certain there's more than 1 chain, but was specifically curious about that one


@* * Copyright 2010-2013 Artima, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *@ @import controllers.Application.scalatestScaladocsPageUrl @import controllers.Application.scaladocsPageUrl @userGuidePage("Custom equality") {
Scalactic's Equality
typeclass enables you to define
alternate notions of equality for specified types that can be used with
Scalactic's ===
and !==
syntax (and ScalaTest's matcher) syntax.
For example, say you have a case class that includes a Double
value:
scala> case class Person(name: String, age: Double) defined class Person
Imagine you are calculating the age
values in such as way that occasionally tests
are failing because of rounding differences that you actually don't care about. For example, you
expect an age of 29.0, but you're sometimes seeing 29.0001:
scala> import org.scalactic._ import org.scalactic._ scala> import TripleEquals._ import TripleEquals._ scala> Person("Joe", 29.0001) === Person("Joe", 29.0) res0: Boolean = false
Scalactic's ===
operator looks for an implicit Equality[L]
, where L
is the left-hand type: in this
case, Person
. Because you didn't specifically provide an implicit Equality[Person]
, ===
will fall back on
default equality, which will call Person
's equals
method. That equals
method, provided by the Scala compiler
because Person
is a case class, will declare these two objects unequal because 29.001 does not exactly equal 29.0.
To make the equality check more forgiving, you could define an implicit Equality[Person]
that compares
the age
Double
s with a tolerance, like this:
scala> import Tolerance._ import Tolerance._ scala> implicit val personEq = | new Equality[Person] { | def areEqual(a: Person, b: Any): Boolean = | b match { | case p: Person => a.name == p.name && a.age === p.age +- 0.0002 | case _ => false | } | } personEq: org.scalactic.Equality[Person] = $anon$1@@2b29f6e7
Now the ===
operator will use your more forgiving Equality[Person]
for the equality check instead
of default equality:
scala> Person("Joe", 29.0001) === Person("Joe", 29.0) res1: Boolean = true
Next, learn more about default equality.


Package com.google.protobuf.compiler
Interface PluginProtos.CodeGeneratorRequestOrBuilder
- All Superinterfaces:
com.google.protobuf.MessageLiteOrBuilder
,com.google.protobuf.MessageOrBuilder
- All Known Implementing Classes:
PluginProtos.CodeGeneratorRequest
,PluginProtos.CodeGeneratorRequest.Builder
- Enclosing class:
- PluginProtos
public static interface PluginProtos.CodeGeneratorRequestOrBuilder
extends com.google.protobuf.MessageOrBuilder
-
Method Summary
Modifier and TypeMethodDescriptionThe version number of protocol compiler.The version number of protocol compiler.getFileToGenerate
(int index) The .proto files that were explicitly listed on the command-line.com.google.protobuf.ByteString
getFileToGenerateBytes
(int index) The .proto files that were explicitly listed on the command-line.int
The .proto files that were explicitly listed on the command-line.The .proto files that were explicitly listed on the command-line.The generator parameter passed on the command-line.com.google.protobuf.ByteString
The generator parameter passed on the command-line.getProtoFile
(int index) FileDescriptorProtos for all files in files_to_generate and everything they import.int
FileDescriptorProtos for all files in files_to_generate and everything they import.FileDescriptorProtos for all files in files_to_generate and everything they import.getProtoFileOrBuilder
(int index) FileDescriptorProtos for all files in files_to_generate and everything they import.FileDescriptorProtos for all files in files_to_generate and everything they import.boolean
The version number of protocol compiler.boolean
The generator parameter passed on the command-line.Methods inherited from interface com.google.protobuf.MessageLiteOrBuilder
isInitialized
Methods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getDefaultInstanceForType, getDescriptorForType, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
Method Details
-
getFileToGenerateList
The .proto files that were explicitly listed on the command-line. The code generator should generate code only for these files. Each file's descriptor will be included in proto_file, below.
repeated string file_to_generate = 1;
- Returns:
- A list containing the fileToGenerate.
-
getFileToGenerateCount
int getFileToGenerateCount()The .proto files that were explicitly listed on the command-line. The code generator should generate code only for these files. Each file's descriptor will be included in proto_file, below.
repeated string file_to_generate = 1;
- Returns:
- The count of fileToGenerate.
-
getFileToGenerate
The .proto files that were explicitly listed on the command-line. The code generator should generate code only for these files. Each file's descriptor will be included in proto_file, below.
repeated string file_to_generate = 1;
- Parameters:
index
- The index of the element to return.- Returns:
- The fileToGenerate at the given index.
-
getFileToGenerateBytes
com.google.protobuf.ByteString getFileToGenerateBytes(int index) The .proto files that were explicitly listed on the command-line. The code generator should generate code only for these files. Each file's descriptor will be included in proto_file, below.
repeated string file_to_generate = 1;
- Parameters:
index
- The index of the value to return.- Returns:
- The bytes of the fileToGenerate at the given index.
-
hasParameter
boolean hasParameter()The generator parameter passed on the command-line.
optional string parameter = 2;
- Returns:
- Whether the parameter field is set.
-
getParameter
String getParameter()The generator parameter passed on the command-line.
optional string parameter = 2;
- Returns:
- The parameter.
-
getParameterBytes
com.google.protobuf.ByteString getParameterBytes()The generator parameter passed on the command-line.
optional string parameter = 2;
- Returns:
- The bytes for parameter.
-
getProtoFileList
List<DescriptorProtos.FileDescriptorProto> getProtoFileList()FileDescriptorProtos for all files in files_to_generate and everything they import. The files will appear in topological order, so each file appears before any file that imports it. protoc guarantees that all proto_files will be written after the fields above, even though this is not technically guaranteed by the protobuf wire format. This theoretically could allow a plugin to stream in the FileDescriptorProtos and handle them one by one rather than read the entire set into memory at once. However, as of this writing, this is not similarly optimized on protoc's end -- it will store all fields in memory at once before sending them to the plugin. Type names of fields and extensions in the FileDescriptorProto are always fully qualified.
repeated .google.protobuf.FileDescriptorProto proto_file = 15;
-
getProtoFile
FileDescriptorProtos for all files in files_to_generate and everything they import. The files will appear in topological order, so each file appears before any file that imports it. protoc guarantees that all proto_files will be written after the fields above, even though this is not technically guaranteed by the protobuf wire format. This theoretically could allow a plugin to stream in the FileDescriptorProtos and handle them one by one rather than read the entire set into memory at once. However, as of this writing, this is not similarly optimized on protoc's end -- it will store all fields in memory at once before sending them to the plugin. Type names of fields and extensions in the FileDescriptorProto are always fully qualified.
repeated .google.protobuf.FileDescriptorProto proto_file = 15;
-
getProtoFileCount
int getProtoFileCount()FileDescriptorProtos for all files in files_to_generate and everything they import. The files will appear in topological order, so each file appears before any file that imports it. protoc guarantees that all proto_files will be written after the fields above, even though this is not technically guaranteed by the protobuf wire format. This theoretically could allow a plugin to stream in the FileDescriptorProtos and handle them one by one rather than read the entire set into memory at once. However, as of this writing, this is not similarly optimized on protoc's end -- it will store all fields in memory at once before sending them to the plugin. Type names of fields and extensions in the FileDescriptorProto are always fully qualified.
repeated .google.protobuf.FileDescriptorProto proto_file = 15;
-
getProtoFileOrBuilderList
List<? extends DescriptorProtos.FileDescriptorProtoOrBuilder> getProtoFileOrBuilderList()FileDescriptorProtos for all files in files_to_generate and everything they import. The files will appear in topological order, so each file appears before any file that imports it. protoc guarantees that all proto_files will be written after the fields above, even though this is not technically guaranteed by the protobuf wire format. This theoretically could allow a plugin to stream in the FileDescriptorProtos and handle them one by one rather than read the entire set into memory at once. However, as of this writing, this is not similarly optimized on protoc's end -- it will store all fields in memory at once before sending them to the plugin. Type names of fields and extensions in the FileDescriptorProto are always fully qualified.
repeated .google.protobuf.FileDescriptorProto proto_file = 15;
-
getProtoFileOrBuilder
FileDescriptorProtos for all files in files_to_generate and everything they import. The files will appear in topological order, so each file appears before any file that imports it. protoc guarantees that all proto_files will be written after the fields above, even though this is not technically guaranteed by the protobuf wire format. This theoretically could allow a plugin to stream in the FileDescriptorProtos and handle them one by one rather than read the entire set into memory at once. However, as of this writing, this is not similarly optimized on protoc's end -- it will store all fields in memory at once before sending them to the plugin. Type names of fields and extensions in the FileDescriptorProto are always fully qualified.
repeated .google.protobuf.FileDescriptorProto proto_file = 15;
-
hasCompilerVersion
boolean hasCompilerVersion()The version number of protocol compiler.
optional .google.protobuf.compiler.Version compiler_version = 3;
- Returns:
- Whether the compilerVersion field is set.
-
getCompilerVersion
PluginProtos.Version getCompilerVersion()The version number of protocol compiler.
optional .google.protobuf.compiler.Version compiler_version = 3;
- Returns:
- The compilerVersion.
-
getCompilerVersionOrBuilder
PluginProtos.VersionOrBuilder getCompilerVersionOrBuilder()The version number of protocol compiler.
optional .google.protobuf.compiler.Version compiler_version = 3;
-


The first and only secretive night planer.
How it worksFrom transportation to entertainment, Blindfold Me! plans your evening. When you use the service, you are not told what lies next until you arrive at the destination. Perfect for big groups or "you nights" and for all price ranges!
Get Started!A ride service can be called seemlessly within our program
Find a new resturant nearby that you typically wouldn't end up at
Go to a local monument or museum
End the night with a sweet, cold treat!


{{ define "title" }}New Archive Backport{{ end }} {{ define "content" }}
Use this form to backport random packages to stable. In the future, it will be possible to backport select groups of packages or backport every single package in the archive.


|
BTK
0.3dev.0
Open-source library to visualize/process biomechanical data
|
Motion builder based on the point sets fiting method of Horn (1987). More...
Public Types | |
| typedef SharedPtr< const Horn1987PointSetsFittingMotionBuilder > | ConstPointer |
| typedef SharedPtr < Horn1987PointSetsFittingMotionBuilder > | Pointer |
| Public Types inherited from btk::MotionBuilder | |
| typedef SharedPtr< const MotionBuilder > | ConstPointer |
| typedef SharedPtr< MotionBuilder > | Pointer |
Public Member Functions | |
| void | Build (Model::Pointer output, Acquisition::Pointer input, LandmarksTranslator::Pointer lt=LandmarksTranslator::Pointer(), bool risd=false) const |
Static Public Member Functions | |
| static Pointer | New () |
Additional Inherited Members | |
| Protected Member Functions inherited from btk::MotionBuilder | |
| MotionBuilder () | |
Motion builder based on the point sets fiting method of Horn (1987).
The fitting is realized with the markers registered in each segment with the attribute btk::Segment::SCSBuilder and existing in the given input acquisition. A minimum of 3 markers is required to determine a segment's pose.
Smart pointer associated with a const Horn1987PointSetsFittingMotionBuilder object.
Smart pointer associated with a Horn1987PointSetsFittingMotionBuilder object.
|
virtual |
Build segment's motion using local and global coordinates.
Reimplemented from btk::MotionBuilder.
|
inlinestatic |
Creates a smart pointer associated with a Horn1987PointSetsFittingMotionBuilder object.


Nutrition Facts
Serving Size 1 cup (228g)
Serving Per Container 2
| Amount Per Serving |
| Calories 250 |
Calories from Fat 110 |
| % Daily Value* |
| Total Fat 12g |
18% |
| Saturated Fat 3g |
15% |
| Trans Fat 1.5g |
| Cholesterol 30mg |
10% |
| Total Carbohydrate 31g |
10% |
| Dietary Fiber 0g |
0% |
| Sugars 5g |
| Protien 5g |
| Vitamin A |
4% |
| Vitamin C |
2% |
| Calcium |
20% |
| Iron |
4% |
*Percentage Daily Values are based on a 2,000 calorie diet. Your Daily Values may be higher or lower depending on your calorie needs:
| Calories: |
2,000 |
2,500 |
| Total Fat |
Less than |
65g |
80g |
| Sat Fat |
Less than |
20g |
25g |
| Cholesterol |
Less than |
300mg |
300mg |
| Sodium |
Less than |
2,400mg |
2,400mg |
| Total Carbohydrate |
300g |
375g |
| Dietary Fiber |
25g |
30g |


| Table 1 |
Socio-demographic characteristics of the participants ( n=6, ... |
| Table 2 |
Effect of extreme weather events on livelihood ( n=6,720) |
| Table 3 |
Health problems and contextual issues of health in vulnerabl ... |
| Table 4 |
Incidence of climate-sensitive diseases and health events in ... |


Module : io
Module Overview
This module is designed to support input and output operations via channels in a canonical way, either in a blocking, or non-blocking manner.
Channels
A channel represents an I/O source or sink of some bytes, characters, or records that are opened for reading, or writing, respectively.
Byte channels
The most primitive channel is the ByteChannel
which reads and writes 8-bit bytes.
// Open a file in read mode.
io:ReadableByteChannel | io:Error readableChannel = io:openReadableFile("file.txt");
// Here is how 100 bytes are read from the channel.
if (readableChannel is io:ReadableByteChannel) {
byte[] | io:Error result = readableChannel.read(100);
}
// Open a file in write mode.
io:WritableByteChannel | io:Error writableByteChannel = io:openWritableFile("file.txt");
// Write some content to the beginning of the file.
if (writableByteChannel is io:WritableByteChannel) {
string someContent = "some cont";
byte[] content = someContent.toBytes();
int | io:Error writeResult = writableByteChannel.write(content, 0);
}
Character channels
The CharacterChannel
is used to read and write characters. The charset encoding is specified when creating the
CharacterChannel
.
// Create a `ReadableCharacterChannel` from the `ReadableByteChannel`.
io:ReadableCharacterChannel | io:Error readableCharChannel =
new io:ReadableCharacterChannel(readableChannel, "UTF-8");
If a ReadableCharacterChannel
points to a JSON or XML source, it can be read and then written, directly into a variable of
the respective type.
// Reading a JSON.
json | io:Error result = readableCharChannel.readJson();
// Reading an XML.
xml | io:Error result = readableCharChannel.readXml();
// Create a `WritableCharacterChannel` from the `WritableByteChannel`.
io:WritableCharacterChannel | io:Error writableCharChannel =
new io:WritableCharacterChannel(writableByteChannel, "UTF-8");
// Writing a JSON.
json content = {fname: "Jhon", lname: "Doe", age: 40};
var writeResult = writableCharChannel.writeJson(content);
if (writeResult is io:Error) {
return writeResult;
} else {
io:println("JSON content written successfully.");
}
Record channels
Ballerina also supports I/O for delimited records.
// Create a `ReadableTextRecordChannel` from the `ReadableCharacterChannel`.
// Records are separated using a new line.
// Fields of a record are separated using a comma.
var readableRecordsChannel =
new io:ReadableTextRecordChannel(readableCharChannel, fs = ",", rs = "\n");
// Read few records.
while (readableRecordsChannel.hasNext()) {
var result = readableRecordsChannel.getNext();
if (result is string[]) {
io:println(result); // Retrieved a record.
} else {
return result; // An IO error occurred when reading the records.
}
}
A .CSV
file can be read and written directly into a CSVChannel
, as shown in this code snippet.
// Create a `ReadableCSVChannel` from the `ReadableCharacterChannel`.
var readableCSVChannel = new io:ReadableCSVChannel(readableCharChannel);
Records of the .CSV
file can read directly into a table of a matching type.
// First let’s define a type that matches a record in the CSV file.
type Employee record {
string id;
string name;
float salary;
};
// Now read the CSV file as a table of Employees and compute total salary.
float total = 0.0;
var tableResult = readableCSVChannel.getTable(Employee);
if (tableResult is table<Employee>) {
foreach var x in tableResult {
total = total + x.salary;
}
return total;
} else {
return tableResult; //Return the error back to the caller
}
Data Channels
Ballerina supports performing data i/o operations
Person object could be serialized into a file or a network socket in the following manner.
public type Person record {|
string name;
int age;
float income;
boolean isMarried;
|};
// Serialize record into binary.
function serialize(Person p, io:WritableByteChannel byteChannel) {
io:WritableDataChannel dc = new io:WritableDataChannel(byteChannel);
var length = p.name.toBytes().length();
var lengthResult = dc.writeInt32(length);
var nameResult = dc.writeString(p.name, "UTF-8");
var ageResult = dc.writeInt16(p.age);
var incomeResult = dc.writeFloat64(p.income);
var maritalStatusResult = dc.writeBool(p.isMarried);
var closeResult = dc.close();
}
// Deserialize record into binary.
function deserialize(io:ReadableByteChannel byteChannel) returns Person {
Person person = {name: "", age: 0, income: 0.0, isMarried: false};
int nameLength = 0;
string nameValue;
io:ReadableDataChannel dc = new io:ReadableDataChannel(byteChannel);
// Read 32 bit signed integer.
var int32Result = dc.readInt32();
if (int32Result is int) {
nameLength = int32Result;
} else {
log:printError("Error occurred while reading name length", int32Result);
}
// Read UTF-8 encoded string represented through specified amount of bytes.
var strResult = dc.readString(nameLength, "UTF-8");
if (strResult is string) {
person.name = strResult;
} else {
log:printError("Error occurred while reading name", strResult);
}
// Read 16 bit signed integer.
var int16Result = dc.readInt16();
if (int16Result is int) {
person.age = int16Result;
} else {
log:printError("Error occurred while reading age", int16Result);
}
// Read 64 bit signed float.
var float64Result = dc.readFloat64();
if (float64Result is float) {
person.income = float64Result;
} else {
log:printError("Error occurred while reading income", float64Result);
}
// Read boolean.
var boolResult = dc.readBool();
if (boolResult is boolean) {
person.isMarried = boolResult;
} else {
log:printError("Error occurred while reading marital status", boolResult);
}
// Finally close the data channel.
var closeResult = dc.close();
return person;
}
| Detail | Record type to hold the details of an error. |
| ReadableByteChannel | ReadableByteChannel represents an input resource (i.e file). which could be used to source bytes. |
| ReadableCSVChannel | Represents a ReadableCSVChannel which could be used to read records from CSV file. |
| ReadableCharacterChannel | Represents a channel which could be used to read characters through a given ReadableByteChannel. |
| ReadableDataChannel | Represents a data channel for reading data. |
| ReadableTextRecordChannel | Represents a channel which will allow to read |
| StringReader | Represents a reader which will wrap string content as a channel. |
| WritableByteChannel | WritableByteChannel represents an output resource (i.e file). which could be used to sink bytes. |
| WritableCSVChannel | Represents a WritableCSVChannel which could be used to write records from CSV file. |
| WritableCharacterChannel | Represents a channel which could be used to write characters through a given WritableCharacterChannel. |
| WritableDataChannel | Represents a WritableDataChannel for writing data. |
| WritableTextRecordChannel | Represents a channel which will allow to write records through a given WritableCharacterChannel. |
| createReadableChannel | Creates an in-memory channel which will reference stream of bytes. |
| openReadableCsvFile | Retrieves a readable CSV channel from a give file path. |
| openReadableFile | Retrieves a ReadableByteChannel from a given file path. |
| openWritableCsvFile | Retrieves a writable CSV channel from a give file path. |
| openWritableFile | Retrieves a WritableByteChannel from a given file path. |
Prints |
|
| println | Prints |
| readln | Returns the input read from STDIN. |
| sprintf | Returns a formatted string using the specified format string and arguments. Following format specifiers are allowed. b - boolean B - boolean (ALL_CAPS) d - int f - float x - hex X - HEX (ALL_CAPS) s - string (This specifier is applicable for any of the supported types in Ballerina. These values will be converted to their string representation.) |
| DEFAULT | Would default to the format specified by CSVChannel. Precedence will be given to field separator and record separator. |
| CSV | Field separator would be "," and the record separator would be new line. |
| TDF | Field separator will be tab and record separator will be new line. |
| COMMA | Comma (,) will be used as the field separator. |
| TAB | Tab (/t) will be use as the field separator. |
| COLON | Colon (:) will be use as the field separator. |
| CONNECTION_TIMED_OUT | This will be used to construct a ConnectionTimedOutError. |
| GENERIC_ERROR | This will be used to construct an IO GenericError. |
| ACCESS_DENIED_ERROR | This will be used to construct a AccessDeniedError. |
| FILE_NOT_FOUND_ERROR | This will be used to construct a FileNotFoundError. |
| END_OF_FILE_ERROR | This will be used to construct an EofError. |
| CSV_RECORD_SEPARATOR | Represents record separator of the CSV file. |
| FS_COLON | Represents colon separator which should be used to identify colon separated files. |
| MINIMUM_HEADER_COUNT | Represents minimum number of headers which will be included in CSV. |
| BIG_ENDIAN | Specifies the bytes to be in the order of most significant byte first. |
| LITTLE_ENDIAN | Specifies the byte order to be the least significant byte first. |
| Error | Represents IO module related errors. |
| Format | Format which will be used to represent the CSV. DEFAULT - Would default to the format specified by CSVChannel. Precedence will be given to field separator and record separator. CSV - Field separator would be "," and the record separator would be new line. TDF - Field separator will be tab and record separator will be new line. |
| Separator | Field separators which are supported by DelimitedTextRecordChannel. COMMA - Delimited text records would be separated using a comma. TAB - Delimited text records would be separated using a tab. COLON - Delimited text records would be separated using a colon(:). |
| AccessDeniedError | This will get returned due to file permission issues. |
| ConnectionTimedOutError | This will return when connection timed out happen when try to connect to a remote host. |
| EofError | This will get returned if read operations are performed on a channel after it closed. |
| FileNotFoundError | This will get returned if the file is not available in the given file path. |
| GenericError | Represents generic IO error. The detail record contains the information related to the error. |


NEWS & RESEARCHES
Done, doing and to-do
Lab News
创管学院成功主办2019态度研究与创新管理国际研讨会
中文版
ISARIM 2019 was Held Successfully at ShanghaiTech University
English version
创艺·说 | 虚拟世界，真实人生——吴皓导演带来《虚你人生》
Director Wu Hao with his film "People's Republic of Desire"
18级本科生问卷结果反馈
——情感问题篇
Conference Announcement
Welcome to ISARIM 2019!
Lecture Announcement
The ABC of Ambivalence Affective, Behavioral, and Cognitive Consequences of Attitudinal Conflict
Congratulations
Ang Cheng and his team won the Fist place in NetEase Mini Game University Game Jam
课题研究
杨丽凤副教授的研究课题入选上海市2018年度“科技创新行动计划”软科学研究领域重点项目
Research Papers


| DOSE: |
0.5 oz |
oral |
Kratom |
(leaves) |
I recently bought kratom from an online vendor unaware of the what the quality would be. I boiled one ounce of the dried leaves for about 20 minutes then poured off some of the liquid, strained it through a coffee filter and drank some of the bitter tea it produced. I split this concoction equally with a friend of mine. I added more water to the leaves already in the pot and boiled for another 20 or so minutes. After that I repeated the decant and filter process and my friend and I drank another mug full. I produced about 4 mugs full for each of the two of us from the one ounce of kratom used.
By the time I had guzzled two mugs of the bitter yellow-brown liquid I started to feel a very acute and opioid-like buzz. During the next 45 to 1 hour after that the buzz increased for both me and my friend until we felt like we had taken 15 or 20 mgs of hydrocodone each. The buzz was a little different though; I think we were a little more 'spaced out' and the buzz somewhat resembles the beginning buzz one gets from smoking cannabis. At about 1.5 hours from drinking the kratom tea we felt very euphoric and talkative. The buzz was so great and the body and mind were so relaxed that we had to concentrate hard so as not to alert the sober parents to what was going on. The buzz starting subsiding after about 3 hours and I woke up the next morning still feeling like I was on just a few milligrams of painkiller. No side-effects were noted. I just purchased some more kratom today.
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


Fri Aug 18, 2017
Google Home is Canada’s first official smart speaker, so I couldn’t resist pre-ordering one when it landed in the True North. Being an early adopter is definitely out of character for me - I think this is the first product I’ve ever pre-ordered. Anyway, I’ve been using it for a few months now. Here are my thoughts so far.
The main draw of the Google Home is the ability to converse with the Google Assistant. Ambient computing, as it is called by some, is a cool sci-fi concept and, along with the flip phone and the tablet, is another Star Trek crossover from fantasy into reality. A lots of geeks out there love the idea of leaning back in their captain’s chair with a cup of Earl Grey and barking out “computer!” to chat with an AI.
The problem is, in real life, you aren’t running a starship. And to run your household seamlessly through voice control, the Internet of Things (IoT) needs to catch up to the future. Right now it is a tangled mess of incompatible competing platforms. A case in point - Siri doesn’t seem to have a problem controlling my Philips Hue smart bulbs, but Google does. The Google Assistant cheerily assures me the lights are off, but they stubbornly stay on, proving that even an artificial intelligence can lie.
Although the idea of chatting with an AI sounds fun, in reality it is not really a thing you do for actual enjoyment. The Google Assistant is a poor conversationalist. Prefacing every question with “Okay Google” is awkward and there is never a back and forth tête-à-tête.
And if you’re the sort of person who doesn’t like talking much, especially when you’ve just woken up, silence is almost certainly preferable. Sadly, croaking out “Hey Google, how’s my day looking” first thing in the morning feels like too much of an effort.
Also, when you want to google something, such as a recipe for breaded fish, it requires reading a screen most of the time - unless you’re looking for trivial information. When I’m wondering if it is going to rain today while eating breakfast, the assistant delivers admirably.
The assistant has a few party tricks up her sleeve, such as making animal sounds, telling jokes, and playing trivia games. The novelty of this forced frivolity wears off after a day or two, but telling a joke is a great go-to demo for when guests come over.
There is one area, however, where the Google Home shines - music.
The one use case that makes the Google Home totally worth it is when you are washing dishes. No longer do you have to painstakingly assemble the perfect dish-washing soundtrack prior to soaping up. And halfway through the sudsy grind, you can change the choice of music hands-free. Google Home is the ultimate dish-washing companion.
It is also very easy for young children to choose their own music without having to navigate through a text-based UI or ask their parents to constantly play the Moana soundtrack. The downside is that you have to constantly listen to the Moana soundtrack.
With music being such a natural fit for a smart speaker, it seems to me that Apple may be onto something with their forthcoming Homepod - an expensive, but high-quality speaker focused solely on the enjoyment of music. We’ll see - it’s not coming out for a while.
The sound quality of the Google Home isn’t bad, but nobody is going to mistake it for a high-end audio system. Google Home is casual and non-committal, but by not taking itself seriously, perhaps has missed an opportunity to win over bleeding-edge audiophiles who aren’t ashamed to retire their vinyl collection and embrace the minimalist future after moving into a one-bedroom apartment in the city.
The good news is that Google Home will only get better over time. Indeed, support for multiple users, hands-free calling, and bluetooth are rolling out in Canada as I write this. Bluetooth pairing will be particularly useful because I listen to podcasts on my iPhone. And it is way too painful to listen to a podcast on two different platforms when they don’t synchronize where you last left off.
Despite my ambivalence, I don’t regret jumping somewhat prematurely into the world of ambient computing.  They just sit there - patiently listening (sometimes for days on end) for somebody to talk to them.
In fact, I think “ambient computing” is too grand a term for the current iteration of smart speakers. Smart speakers at their most useful simply provide hands-free music playback. I don’t think these devices necessarily herald a new UI paradigm.
The main disadvantage of an invisible UI paradigm is that the user can’t perform complex tasks without being presented with action-oriented objects, such as labelled buttons. Consulting a spreadsheet of Google Assistant commands quickly takes the momentum out of any possible workflow.
I have no doubt that smart assistants will continue to excel as dish-washing companions, a delightfully useful (but niche) area of expertise. Whether they will one day migrate onto starships is debatable.


QJSEngine Class
The QJSEngine class provides an environment for evaluating JavaScript code. More...
| Header: | #include <QJSEngine> |
| qmake: | QT += qml |
| Since: | Qt 5.0 |
| Inherits: | QObject |
| Inherited By: |
Note: All functions in this class are reentrant.
Public Types
| enum | Extension { TranslationExtension, ConsoleExtension, GarbageCollectionExtension, AllExtensions } |
| flags | Extensions |
Public Functions
| QJSEngine() | |
| QJSEngine(QObject *parent) | |
| virtual | ~QJSEngine() |
| void | collectGarbage() |
| QJSValue | evaluate(const QString &program, const QString &fileName = QString(), int lineNumber = 1) |
| T | fromScriptValue(const QJSValue &value) |
| QJSValue | globalObject() const |
| void | installExtensions(Extensions extensions, const QJSValue &object = QJSValue()) |
| QJSValue | newArray(uint length = 0) |
| QJSValue | newObject() |
| QJSValue | newQMetaObject(const QMetaObject *metaObject) |
| QJSValue | newQMetaObject() |
| QJSValue | newQObject(QObject *object) |
| QJSValue | toScriptValue(const T &value) |
- 32 public functions inherited from QObject
Related Non-Members
| QJSEngine * | qjsEngine(const QObject *object) |
Additional Inherited Members
- 1 property inherited from QObject
- 1 public slot inherited from QObject
- 2 signals inherited from QObject
- 1 public variable inherited from QObject
- 10 static public members inherited from QObject
- 9 protected functions inherited from QObject
- 2 protected variables inherited from QObject
Detailed Description
The QJSEngine class provides an environment for evaluating JavaScript code.
Evaluating Scripts
Use evaluate() to evaluate script code.
QJSEngine myEngine; QJSValue three = myEngine.evaluate("1 + 2");
evaluate() returns a QJSValue that holds the result of the evaluation. The QJSValue class provides functions for converting the result to various C++ types (e.g. QJSValue::toString() and QJSValue::toNumber()).
The following code snippet shows how a script function can be defined and then invoked from C++ using QJSValue::call():
QJSValue fun = myEngine.evaluate("(function(a, b) { return a + b; })"); QJSValueList args; args << 1 << 2; QJSValue threeAgain = fun.call(QJSValue(), args);
As can be seen from the above snippets, a script is provided to the engine in the form of a string. One common way of loading scripts is by reading the contents of a file and passing it to evaluate():
QString fileName = "helloworld.qs"; QFile scriptFile(fileName); if (!scriptFile.open(QIODevice::ReadOnly)) // handle error QTextStream stream(&scriptFile); QString contents = stream.readAll(); scriptFile.close(); myEngine.evaluate(contents, fileName);
Here we pass the name of the file as the second argument to evaluate(). This does not affect evaluation in any way; the second argument is a general-purpose string that is stored in the Error
object for debugging purposes.
Engine Configuration
The globalObject() function returns the Global Object associated with the script engine. Properties of the Global Object are accessible from any script code (i.e. they are global variables). Typically, before evaluating "user" scripts, you will want to configure a script engine by adding one or more properties to the Global Object:
myEngine.globalObject().setProperty("myNumber", 123); ... QJSValue myNumberPlusOne = myEngine.evaluate("myNumber + 1");
Adding custom properties to the scripting environment is one of the standard means of providing a scripting API that is specific to your application. Usually these custom properties are objects created by the newQObject() or newObject() functions.
Script Exceptions
evaluate() can throw a script exception (e.g. due to a syntax error). If it does, then evaluate() returns the value that was thrown (typically an Error
object). Use QJSValue::isError() to check for exceptions.
For detailed information about the error, use QJSValue::toString() to obtain an error message, and use QJSValue::property() to query the properties of the Error
object. The following properties are available:
name
message
fileName
lineNumber
stack
QJSValue result = myEngine.evaluate(...); if (result.isError()) qDebug() << "Uncaught exception at line" << result.property("lineNumber").toInt() << ":" << result.toString();
Script Object Creation
Use newObject() to create a JavaScript object; this is the C++ equivalent of the script statement new Object()
. You can use the object-specific functionality in QJSValue to manipulate the script object (e.g. QJSValue::setProperty()). Similarly, use newArray() to create a JavaScript array object.
QObject Integration
Use newQObject() to wrap a QObject (or subclass) pointer. newQObject() returns a proxy script object; properties, children, and signals and slots of the QObject are available as properties of the proxy object. No binding code is needed because it is done dynamically using the Qt meta object system.
Use newQMetaObject() to wrap a QMetaObject; this gives you a "script representation" of a QObject-based class. newQMetaObject() returns a proxy script object; enum values of the class are available as properties of the proxy object.
Constructors exposed to the meta-object system ( using Q_INVOKABLE ) can be called from the script to create a new QObject instance with JavaScriptOwnership.
QPushButton *button = new QPushButton; QJSValue scriptButton = myEngine.newQObject(button); myEngine.globalObject().setProperty("button", scriptButton); myEngine.evaluate("button.checkable = true"); qDebug() << scriptButton.property("checkable").toBool(); scriptButton.property("show").call(); // call the show() slot
Extensions
QJSEngine provides a compliant ECMAScript implementation. By default, familiar utilities like logging are not available, but they can can be installed via the installExtensions() function.
See also QJSValue, Making Applications Scriptable, and List of JavaScript Objects and Functions.
Member Type Documentation
enum QJSEngine::Extension
flags QJSEngine::Extensions
This enum is used to specify extensions to be installed via installExtensions().
| Constant | Value | Description |
|---|---|---|
QJSEngine::TranslationExtension | 0x1 | Indicates that translation functions (qsTr() , for example) should be installed. |
QJSEngine::ConsoleExtension | 0x2 | Indicates that console functions (console.log() , for example) should be installed. |
QJSEngine::GarbageCollectionExtension | 0x4 | Indicates that garbage collection functions (gc() , for example) should be installed. |
QJSEngine::AllExtensions | 0xffffffff | Indicates that all extension should be installed. |
TranslationExtension
The relation between script translation functions and C++ translation functions is described in the following table:
| Script Function | Corresponding C++ Function |
|---|---|
| qsTr() | QObject::tr() |
| QT_TR_NOOP() | QT_TR_NOOP() |
| qsTranslate() | QCoreApplication::translate() |
| QT_TRANSLATE_NOOP() | QT_TRANSLATE_NOOP() |
| qsTrId() | qtTrId() |
| QT_TRID_NOOP() | QT_TRID_NOOP() |
This flag also adds an arg()
function to the string prototype.
For more information, see the Internationalization with Qt documentation.
ConsoleExtension
The console object implements a subset of the Console API, which provides familiar logging functions, such as console.log()
.
The list of functions added is as follows:
console.assert()
console.debug()
console.exception()
console.info()
console.log()
(equivalent toconsole.debug()
)console.error()
console.time()
console.timeEnd()
console.trace()
console.count()
console.warn()
print()
(equivalent toconsole.debug()
)
For more information, see the Console API documentation.
GarbageCollectionExtension
The gc()
function is equivalent to calling collectGarbage().
The Extensions type is a typedef for QFlags<Extension>. It stores an OR combination of Extension values.
Member Function Documentation
QJSEngine::QJSEngine()
Constructs a QJSEngine object.
The globalObject() is initialized to have properties as described in ECMA-262, Section 15.1.
QJSEngine::QJSEngine(QObject *parent)
Constructs a QJSEngine object with the given parent.
The globalObject() is initialized to have properties as described in ECMA-262, Section 15.1.
[virtual]
QJSEngine::~QJSEngine()
Destroys this QJSEngine.
Garbage is not collected from the persistent JS heap during QJSEngine destruction. If you need all memory freed, call collectGarbage manually right before destroying the QJSEngine.
void QJSEngine::collectGarbage()
Runs the garbage collector.
The garbage collector will attempt to reclaim memory by locating and disposing of objects that are no longer reachable in the script environment.
Normally you don't need to call this function; the garbage collector will automatically be invoked when the QJSEngine decides that it's wise to do so (i.e. when a certain number of new objects have been created). However, you can call this function to explicitly request that garbage collection should be performed as soon as possible.
QJSValue QJSEngine::evaluate(const QString &program, const QString &fileName = QString(), int lineNumber = 1)
Evaluates program, using lineNumber as the base line number, and returns the result of the evaluation.
The script code will be evaluated in the context of the global object.
The evaluation of program can cause an exception in the engine; in this case the return value will be the exception that was thrown (typically an Error
object; see QJSValue::isError()).
lineNumber is used to specify a starting line number for program; line number information reported by the engine that pertains to this evaluation will be based on this argument. For example, if program consists of two lines of code, and the statement on the second line causes a script exception, the exception line number would be lineNumber plus one. When no starting line number is specified, line numbers will be 1-based.
fileName is used for error reporting. For example, in error objects the file name is accessible through the "fileName" property if it is provided with this function.
Note: If an exception was thrown and the exception value is not an Error instance (i.e., QJSValue::isError() returns false
), the exception value will still be returned, but there is currently no API for detecting that an exception did occur in this case.
T QJSEngine::fromScriptValue(const QJSValue &value)
Returns the given value converted to the template type T
.
See also toScriptValue().
QJSValue QJSEngine::globalObject() const
Returns this engine's Global Object.
By default, the Global Object contains the built-in objects that are part of ECMA-262, such as Math, Date and String. Additionally, you can set properties of the Global Object to make your own extensions available to all script code. Non-local variables in script code will be created as properties of the Global Object, as well as local variables in global code.
void QJSEngine::installExtensions(Extensions extensions, const QJSValue &object = QJSValue())
Installs JavaScript extensions to add functionality that is not available in a standard ECMAScript implementation.
The extensions are installed on the given object, or on the Global Object if no object is specified.
Several extensions can be installed at once by OR
-ing the enum values:
installExtensions(QJSEngine::TranslationExtension | QJSEngine::ConsoleExtension);
This function was introduced in Qt 5.6.
See also Extension.
QJSValue QJSEngine::newArray(uint length = 0)
Creates a JavaScript object of class Array with the given length.
See also newObject().
QJSValue QJSEngine::newObject()
Creates a JavaScript object of class Object.
The prototype of the created object will be the Object prototype object.
See also newArray() and QJSValue::setProperty().
QJSValue QJSEngine::newQMetaObject(const QMetaObject *metaObject)
Creates a JavaScript object that wraps the given QMetaObject The metaObject must outlive the script engine. It is recommended to only use this method with static metaobjects.
When called as a constructor, a new instance of the class will be created. Only constructors exposed by Q_INVOKABLE will be visible from the script engine.
This function was introduced in Qt 5.8.
See also newQObject().
QJSValue QJSEngine::newQMetaObject()
Creates a JavaScript object that wraps the static QMetaObject associated with class T
.
This function was introduced in Qt 5.8.
See also newQObject().
QJSValue QJSEngine::newQObject(QObject *object)
Creates a JavaScript object that wraps the given QObject object, using JavaScriptOwnership.
Signals and slots, properties and children of object are available as properties of the created QJSValue.
If object is a null pointer, this function returns a null value.
If a default prototype has been registered for the object's class (or its superclass, recursively), the prototype of the new script object will be set to be that default prototype.
If the given object is deleted outside of the engine's control, any attempt to access the deleted QObject's members through the JavaScript wrapper object (either by script code or C++) will result in a script exception.
See also QJSValue::toQObject().
QJSValue QJSEngine::toScriptValue(const T &value)
Creates a QJSValue with the given value.
See also fromScriptValue().
Related Non-Members
QJSEngine *qjsEngine(const QObject *object)
Returns the QJSEngine associated with object, if any.
This function is useful if you have exposed a QObject to the JavaScript environment and later in your program would like to regain access. It does not require you to keep the wrapper around that was returned from QJSEngine::newQObject().
This function was introduced in Qt 5.5.


The construction room consists of a gridded floor (green) and four gridded walls (blue, red, yellow and brown). These display markers to show the positions of the Cubees.
Drag the cursor around for different viewing angles.
The Menu Bar
As well as providing a menu of actions for the room it displays the name of the current model


--- layout: page title: About header-img: "img/about-bg.png" ---
I am a student of software engineering at the Flatiron school, and a lifelong learner.


Source code:
GitHub - es6-app


Person-Activity Fit Diagnostic
This is the Person-Activity Fit Diagnostic test taken from the book The How of Happiness.
It's a tool to help you determine what types of activities are likely to bring you the most "happiness bang for your buck."
Instructions
Consider each of the following 12 happiness activities. Reflect on what it would be like to do the activity every week for an extended period of time. Then rate each activity by filling in the appropriate number (1 to 7) for each of the following reasons: NATURAL, ENJOY, VALUE, GUILTY, and SITUATION...
People do things for many different reasons. Rate why you might keep doing this activity in terms of each of the following reasons. Use a 1 (not at all) to 7 (very much) scale.
| Reason | Description |
|---|---|
| NATURAL | I'll keep doing this activity because it will feel "natural" to me and I'll be able to stick with it. |
| ENJOY | I'll keep doing this activity because I will enjoy doing it; I'll find it to be interesting and challenging. |
| VALUE | I'll keep doing this activity because I will value and identify with doing it; I'll do it freely even when it's not enjoyable. |
| GUILTY | I'll keep doing this activity because I would feel ashamed, guilty, or anxious if I didn't do it; I'll force myself. |
| SITUATION | I'll keep doing this activity because somebody else will want me to or because my situation will force me to. |
The activities with the highest Fit Score are the ones that are most likely to bring you the most happiness. Activity Fit Score is calculated with the equation:
FIT SCORE = (NATURAL + ENJOY + VALUE) / 3 - (GUILTY + SITUATION) / 2
Rate the Activity
-
Expressing gratitude. Counting your blessings for what you have (either to a close other or privately, through contemplation or a journal) or conveying your gratitude and appreciation to one or more individuals whom you've never properly thanked.
-
Cultivating optimism. Keeping a journal in which you imagine and write about the best possible future for yourself or practicing to look at the bright side of every situation.
-
Avoiding overthinking and social comparison. : Using strategies (such as distraction) to cut down on how often you dwell on your problems and compare yourself with others.
-
Practicing acts of kindness. Doing good things for others, whether friends or strangers, either directly or anonymously, either spontaneously or planned.
-
Nurturing relationships. Picking a relationship in need of strengthening, and investing time and energy in healing, cultivating, affirming, and enjoying it.
-
Developing strategies for coping. Practicing ways to endure or surmount a recent stress, hardship, or trauma.
-
Learning to forgive. Keeping a journal or writing a letter in which you work on letting go of anger and resentment toward one or more individuals who have hurt or wronged you.
-
Doing more activities that truly engage you. Increasing the number of experiences at home and work in which you "lose" yourself, which are challenging and absorbing (i.e. flow experiences).
-
Savoring life's joys. Paying close attention, taking delight, and replaying life's momentary pleasures and wonders, through thinking, writing, drawing, or sharing with another.
-
Committing to your goals. Picking one, two, or three significant goals that are meaningful to you and devoting time and effort to pursuing them.
-
Practicing religion and spirituality. Becoming more involved in your church, temple, or mosque or reading and pondering spiritually themed books.
-
Taking care of your body. Engaging in physical activity, meditating, and smiling and laughing.
Results - Your Best-Fitting Activities
These are the top four activities most likely to increase your happiness.
Note: These will get populated as you fill in the ratings above.


The Holistic Group
The Holistic Group of companies is a conglomerate of enterprises managed by a team of professionals with an unflinching commitment to excellence.
The pioneers, Captain Ashok Kadian and Captain Jasbir Singh, commenced operations in 1995 in the domain of coal transportation. Under their able leadership, the business grew rapidly and today, the Group has diversified into logistics, BFSI, security and HR services. The Group has over a 1000 employees spread over five states in the India.Holistic HR & Security Pvt Ltd is a wholly owned subsidiary of the Holistic Group. Headquartered in Gurgaon, it is in the business of providing Security, HR and Facility Management Solutions.
What we do
Holistic HR & Security Pvt Ltd:
- Specializes in assessing current and future risks and developing & executing secure solutions to minimize their effect.
- Offers end to end HR solutions with focus on executive search, recruitment, training and consulting.
- Provides wide spectrum of quality facility management services.


|
NUC472_NUC442_BSP V3.03.004
The Board Support Package for NUC472/NUC442
|
NUC472/NUC442 system clock init code and assert handler. More...
#include "NUC472_442.h"
Go to the source code of this file.
Functions | |
| void | SystemCoreClockUpdate (void) |
| Updates the SystemCoreClock with current core Clock retrieved from CPU registers. More... | |
| void | SystemInit (void) |
| Setup the micro controller system. More... | |
Variables | |
| uint32_t | SystemCoreClock = __HSI |
| uint32_t | CyclesPerUs = (__HSI / 1000000) |
| uint32_t | gau32ClkSrcTbl [] = {__HXT, __LXT, 0, __LIRC, 0, 0, 0, __HIRC} |
NUC472/NUC442 system clock init code and assert handler.
Definition in file system_NUC472_442.c.
| void SystemCoreClockUpdate | ( | void | ) |
Updates the SystemCoreClock with current core Clock retrieved from CPU registers.
Update SystemCoreClock variable
Definition at line 26 of file system_NUC472_442.c.
| void SystemInit | ( | void | ) |
Setup the micro controller system.
Setup the microcontroller system.
Initialize the system
Definition at line 56 of file system_NUC472_442.c.
| uint32_t CyclesPerUs = (__HSI / 1000000) |
Cycles per micro second
Definition at line 18 of file system_NUC472_442.c.
System clock source table
Definition at line 19 of file system_NUC472_442.c.
| uint32_t SystemCoreClock = __HSI |
System Clock Frequency (Core Clock)
Definition at line 17 of file system_NUC472_442.c.


OSU football: Turning Point Ranch selling BB T-shirts
by Jacob UnruhSTILLWATER — Are you a fan of a black miniature horse who has been spotted around Boone Pickens Stadium?
Then you’re in luck.
Turning Point Ranch has made T-shirts of BB, the famed miniature horse that appears at every home Oklahoma State football game this season.
Proceeds from the shirts, which are $25, will go to the ranch, a nonprofit organization founded in 1999 that uses 11 horses — and two mini ones — to build productive futures for individuals with physical, mental, emotional and socio-economic challenges. Shirts are available for order until Dec. 1 at https://imetbb.itemorder.com/sale.
Fans of “Parks and Recreation” should be pleased with the design.
The gray shirt features a headshot of BB inside a circle with the words “I Met BB At Boone Pickens Stadium.” It’s the same design made famous in the show when Li’l Sebastian appeared at the Pawnee Harvest Festival, but for OSU fans it’s even better.
Related Photos


The Chill Method
We have earned hipster creds with our feature in The Chill Method working in the mainstream soft drinks industry where we developed a daily ritual of concocting our own infused waters.
We have earned hipster creds with our feature in The Chill Method. working in the mainstream soft drinks industry where we developed a daily ritual of concocting our own infused waters. We wanted to create drinks in the same way as our infusions which could not yet be found on the market.
And so Dash was born...
|


Experimental golang package for working with Open Screenplay Format 2.0. Open Screenplay Format is an open XML format for screenplays and the native format (when zipped) for Fade In. Two package will include several demonstration command line programs osf2txt which will read a osf file and render plain text in a Fountain like format, txt2osf which takes a plain text file and attempts to render an OSF 2.0 document and finally fadein2txt which will read in a Fade In file and write out plain text in Fountain format.


The 'unknown' format is a special JXTA ID format used by the J2SE implementation to manage ids of formats which are not recognized. No ids of format 'unknown' are ever emitted nor can any new ids be created. @see
JXTA Protocols Specification : IDs


Cornell Techie, Software Developer, Design Thinker
I'm a California Native, New York City transplant. Software Engineer with a passion for new technology and building design-oriented products. I recently graduated from Cornell Tech with a Masters in Computer Science. Check out some of my projects.
Python, Java, C++, C, iOS development, SQL, Spark
Design Thinking, Product Management, Business for Tech
Computer Vision, Machine Learning, Data Science