tmlib.lda: Methods for learnning LDA¶
Contents
- tmlib.lda: Methods for learnning LDA
- class tmlib.lda.ldamodel.LdaModel
- class tmlib.lda.ldalearning.LdaStatistics
- class tmlib.lda.ldalearning.LdaLearning
- class tmlib.lda.Online_VB.OnlineVB
- class tmlib.lda.Online_CVB0.OnlineCVB0
- class tmlib.lda.Online_CGS.OnlineCGS
- class tmlib.lda.Online_FW.OnlineFW
- class tmlib.lda.Online_OPE.OnlineOPE
- class tmlib.lda.Streaming_VB.StreamingVB
- class tmlib.lda.Streaming_FW.StreamingFW
- class tmlib.lda.Streaming_OPE.StreamingOPE
- class tmlib.lda.ML_CGS.MLCGS
- class tmlib.lda.ML_FW.MLFW
- class tmlib.lda.ML_OPE.MLOPE
class tmlib.lda.ldamodel.LdaModel¶
tmlib.lda.ldamodel.LdaModel(num_terms, num_topics, random_type=0)
This class works with model (\(\lambda\) or \(\beta\)): save, load, display words of topics…
Parameters¶
num_terms: int
number of words in vocabulary file
num_topics: int,
number of topics
random_type: int, default: 0
Initialize randomly array of \(\lambda\) (or \(\beta\)) (size num_topics x num_terms). If random_type = 0, model is initialized with uniform distribution. Otherwise, initialized with gamma distribution
Attributes¶
num_terms: int
num_topics: int
model: array 2 dimentions (num_topics x num_terms)
\(\lambda\) or \(\beta\)
Methods¶
__init__(num_terms, num_topics, random_type=0)
normalize ()
Used for estimating \(\beta\) from \(\lambda\). This function is usually used for regularized methods
print_top_words (self, num_words, vocab_file, show_topics=None, result_file=None)
Display words of topics on the screen or save into file
Parameters:
num_words: int,
number of words of each topic is displayed
vocab_file: string,
path of file vocabulary
show_topics: int, default: None
number of topics is displayed. By default, all of topics are displayed
result_file: string, default: None
path of file to save words into. By default, if result_file=None, words of topics are displayed on screen
load (model_file)
loading the learned model (\(\lambda\) or \(\beta\)) from file named model_file
save (model_file, file_type=’binary’)
saving model into a file named model_file. By default, the type of file is binary. We can change type of file to text by set file_type=’txt’
class tmlib.lda.ldalearning.LdaStatistics¶
tmlib.lda.ldalearning.LdaStatistics()
This class is used for saving statistics of model such as: time of E-step, time of M-step, time of inference, or sparsity document in each iteration
Attributes¶
e_step_time: list,
list of time of E-step
m_step_time: list,
list of time of M-step
iter_time: list,
list of time of each iteration. Time of each iteration = time E-step + time M-step in each iteration
sparsity_record: list,
store the computed sparsities in some iterations
Methods¶
__init__()
record_time (time_e, time_m)
append a time record to lists: e_step_time, m_step_time, iter_time
time_e: time of E-step
time_m: time of M-step
reset_time_record ()
reset all of lists to empty
record_sparsity (sparsity)
append a sparsity record to list sparsity_record
reset_sparsity_record ()
save_time (file_name, reset=False)
Save time records into a file
file_name*: name of the saved file
reset: if reset = True then reseting all list of time to empty
save_sparsity (file_name, reset=False)
Save sparsity records into a file named file_name
class tmlib.lda.ldalearning.LdaLearning¶
tmlib.lda.ldalearning. LdaLearning (num_terms, num_topics, lda_model=None)
This class is used for learning LDA. This is the super-class of all learning methods.
Parameters¶
num_terms: int
number of words in vocabulary file
num_topics: int
number of topics of model
lda_model: object of class LdaModel, default: None
This parameter is used for storing the learned model after each iteration. If it is set None value, sub-class of this class must initialize it. If it is the learned model, it can be updated in this learning time.
Attributes¶
num_terms: int
num_topics: int
lda_model: object of class LdaModel
statistics: object of class LearningStatistics
Used for storing the statistics of model in learning process
Methods¶
__init__ (num_terms, num_topics, lda_model=None)
static_online (word_ids_tks, cts_lens)
This function implements learning algorithms. It is a abstract method
word_ids_tks and cts_lens: see attributes of class Corpus
infer_new_docs (new_corpus)
This is also abstract method. This used for inference new documents.
- new_corpus: object of class Corpus, store new documents used for inference
Return: topic proportions of documents (\(\theta\))
learn_model (data, save_model_every=0, compute_sparsity_every=0, save_statistic=False, save_top_words_every=0, num_top_words=20, model_folder=’model’)
This used for learning model and to save model, statistics of model.
Parameters:
- data: object of class Dataset, used to supply minibatches data for learning
- save_model_every: int, default: 0. If it is set to 2, it means at iterators: 0, 2, 4, 6, …, model will is save into a file. If setting default, model won’t be saved.
- compute_sparsity_every: int, default: 0. Compute sparsity and store in attribute statistics. The word “every” here means as same as save_model_every
- save_statistic: boolean, default: False. Saving statistics or not
- save_top_words_every: int, default: 0. Used for saving top words of topics (highest probability). Number words displayed is num_top_words parameter.
- num_top_words: int, default: 20. By default, the number of words displayed is 20.
- model_folder: string, default: “model”. The place which model file, statistics file are saved. By default, all of this values will be saved in folder “model”
Return: the learned model (object of class LdaModel)
class tmlib.lda.Online_VB.OnlineVB¶
tmlib.lda.Online_VB. OnlineVB (num_terms, num_topics=100, alpha=0.01, eta=0.01, tau0=1.0, kappa=0.9, conv_infer=0.0001, iter_infer=50, lda_model=None)
This class inherits super-class LdaLearning. This used for learning LDA by Online-VB method.
Parameters¶
num_terms: int,
number words of vocabulary file
num_topics: int, default: 100
number of topics of model.
alpha: float, default: 0.01
parameter \(\alpha\) of model LDA
eta (\(\eta\)): float, default: 0.01
tau0 (\(\tau_{0}\)): float, default: 1.0
kappa (\(\kappa\)): float, default: 0.9
conv_infer: float, default: 0.0001
The relative improvement of the lower bound on likelihood of VB inference. If If bound hasn’t changed much, the inference will be stopped
iter_infer: int, default: 50.
number of iterations to do inference
lda_model: object of class LdaModel, default: None.
If this is None value, it will be initialized and become a new object. If not, it will be the model learned previously
Attributes¶
num_terms: int,
num_topics: int,
alpha: float,
eta (\(\eta\)): float,
tau0 (\(\tau_{0}\)): float,
kappa (\(\kappa\)): float,
conv_infer: float,
iter_infer: int,
lda_model: object of class LdaModel
_Elogbeta: float,
This is expectation of random variable \(\beta\) (topics of model).
_expElogbeta: float, this is equal exp(_Elogbeta)
Methods¶
__init__ (num_terms, num_topics=100, alpha=0.01, eta=0.01, tau0=1.0, kappa=0.9, conv_infer=0.0001, iter_infer=50, lda_model=None)
static_online (wordids, wordcts)
Excute the learning algorithm, includes: inference for individual document and update \(\lambda\). 2 parameters wordids, wordcts represent for term-frequency format of mini-batch
Return: tuple (time of E-step, time of M-step, gamma). gamma (\(\gamma\)) is variational parameter of \(\theta\)
e_step (wordids, wordcts)
Do inference for indivial document (E-step)
Return: tuple (gamma, sstats), where, sstats is the sufficient statistics for the M-step
update_lambda (batch_size, sstats)
Update \(\lambda\) by stochastic way.
learn_model (data, save_model_every=0, compute_sparsity_every=0, save_statistic=False, save_top_words_every=0, num_top_words=20, model_folder=’model’)
Inheritted method
see class LdaLearning
infer_new_docs (new_corpus)
Inheritted method
see class LdaLearning
class tmlib.lda.Online_CVB0.OnlineCVB0¶
tmlib.lda.Online_CVB0. OnlineCVB0 (num_tokens, num_terms, num_topics=100, alpha=0.01, eta=0.01, tau_phi=1.0, kappa_phi=0.9, s_phi=1.0, tau_theta=10.0, kappa_theta=0.9, s_theta=1.0, burn_in=25, lda_model=None)
This class inherits super-class LdaLearning. This used for learning LDA by Online-CVB0 method.
Parameters¶
num_tokens: int,
number tokens of corpus
num_terms: int,
number words of vocabulary file
num_topics: int, default: 100
number of topics of model.
alpha: float, default: 0.01
parameter \(\alpha\) of model LDA
eta (\(\eta\)): float, default: 0.01
tau_phi : float, default: 1.0
kappa_phi : float, default: 0.9
s_phi: float, default: 1.0
tau_theta: float, default: 10.0
kappa_theta: float, default: 0.9
s_theta: float, default: 1.0
burn_in: int, default: 25
lda_model: object of class LdaModel, default: None.
If this is None value, it will be initialized and become a new object. If not, it will be the model learned previously
Attributes¶
Same as parameters above
Methods¶
__init__ (num_tokens, num_terms, num_topics=100, alpha=0.01, eta=0.01, tau_phi=1.0, kappa_phi=0.9, s_phi=1.0, tau_theta=10.0, kappa_theta=0.9, s_theta=1.0, burn_in=25, lda_model=None)
static_online (wordtks, lengths)
Excute the learning algorithm, includes: inference for individual document and update \(\lambda\). 2 parameters wordtks, lengths represent for term-sequence format of mini-batch
Return: tuple (time of E-step, time of M-step, N_theta).
e_step (wordids, wordcts)
Do inference for indivial document (E-step)
Return: tuple (N_phi, N_Z, N_theta)
m_step (batch_size, N_phi, N_Z)
Update \(\lambda\) by stochastic way.
learn_model (data, save_model_every=0, compute_sparsity_every=0, save_statistic=False, save_top_words_every=0, num_top_words=20, model_folder=’model’)
Inheritted method
see class LdaLearning
infer_new_docs (new_corpus)
Inheritted method
see class LdaLearning
class tmlib.lda.Online_CGS.OnlineCGS¶
tmlib.lda.Online_CGS. OnlineCGS (num_terms, num_topics=100, alpha=0.01, eta=0.01, tau0=1.0, kappa=0.9, burn_in=25, samples=25, lda_model=None)
This class inherits super-class LdaLearning. This used for learning LDA by Online-CGS method.
Parameters¶
num_terms: int,
number words of vocabulary file
num_topics: int, default: 100
number of topics of model.
alpha: float, default: 0.01
parameter \(\alpha\) of model LDA
eta (\(\eta\)): float, default: 0.01
tau0 (\(\tau_{0}\)): float, default: 1.0
kappa (\(\kappa\)): float, default: 0.9
burn_in: int, default: 25
samples: int, default: 25
50 samples were used in CGS for which the first 25 (burn_in) were discarded and the remaining (samples) were used to approximate the posterior distribution
lda_model: object of class LdaModel, default: None.
If this is None value, it will be initialized and become a new object. If not, it will be the model learned previously
Attributes¶
num_terms: int,
num_topics: int,
alpha: float,
eta (\(\eta\)): float,
tau0 (\(\tau_{0}\)): float,
kappa (\(\kappa\)): float,
burn_in: int,
samples: int,
lda_model: object of class LdaModel
_Elogbeta: float,
This is expectation of random variable \(\beta\) (topics of model).
_expElogbeta: float, this is equal exp(_Elogbeta)
Methods¶
__init__ (num_terms, num_topics=100, alpha=0.01, eta=0.01, tau0=1.0, kappa=0.9, burn_in=25, samples=25, lda_model=None)
static_online (wordtks, lengths)
Excute the learning algorithm, includes: inference for individual document and update \(\lambda\). 2 parameters wordtks, lengths represent for term-sequence format of mini-batch
Return: tuple (time of E-step, time of M-step, theta).
sample_z (wordids, wordcts)
Do inference for indivial document (E-step) by sampling
Return: tuple (Nkw_mean, Ndk_mean, z)
update_lambda (batch_size, sstats)
Update \(\lambda\) by stochastic way. Parameter sstats is Nkw_mean in ouput of function sample_z
learn_model (data, save_model_every=0, compute_sparsity_every=0, save_statistic=False, save_top_words_every=0, num_top_words=20, model_folder=’model’)
Inheritted method
see class LdaLearning
infer_new_docs (new_corpus)
Inheritted method
see class LdaLearning
class tmlib.lda.Online_FW.OnlineFW¶
tmlib.lda.Online_FW. OnlineFW (num_terms, num_topics=100, eta=0.01, tau0=1.0, kappa=0.9, iter_infer=50, lda_model=None)
This class inherits super-class LdaLearning. This used for learning LDA by Online-FW method.
Parameters¶
num_terms: int,
Number of unique terms in the corpus (length of the vocabulary)
num_topics: int, default: 100
Number of topics shared by the whole corpus.
eta (\(\eta\)): float, default: 0.01
Hyperparameter for prior on topics beta.
tau0 (\(\tau_{0}\)): float, default: 1.0
A (positive) learning parameter that downweights early iterations.
kappa (\(\kappa\)): float, default: 0.9
Learning rate: exponential decay rate should be between (0.5, 1.0] to guarantee asymptotic convergence.
iter_infer: int, default: 50.
Number of iterations of FW algorithm.
lda_model: object of class LdaModel, default: None.
If this is None value, it will be initialized and become a new object. If not, it will be the model learned previously
Attributes¶
num_docs: int,
Number of documents in the corpus.
num_terms: int,
num_topics: int,
eta (\(\eta\)): float,
tau0 (\(\tau_{0}\)): float,
kappa (\(\kappa\)): float,
INF_MAX_ITER: int,
lda_model: object of class LdaModel
Methods¶
__init__ (num_terms, num_topics=100, alpha=0.01, eta=0.01, tau0=1.0, kappa=0.9, iter_infer=50, lda_model=None)
static_online (wordids, wordcts)
First does an E step on the mini-batch given in wordids and wordcts, then uses the result of that E step to update the topics in M step.
Parameters:
- wordids: A list whose each element is an array (terms), corresponding to a document. Each element of the array is index of a unique term, which appears in the document, in the vocabulary.
- wordcts: A list whose each element is an array (frequency), corresponding to a document. Each element of the array says how many time the corresponding term in wordids appears in the document.
Return: tuple (time of E-step, time of M-step, theta): time the E and M steps have taken and the list of topic mixtures of all documents in the mini-batch.
e_step (wordids, wordcts)
Does e step
Note that, FW can provides sparse solution (theta:topic mixture) when doing inference for each documents. It means that the theta have few non-zero elements whose indexes are stored in list of lists ‘index’.
Return: tuple (theta, index): topic mixtures and their nonzero elements’ indexes of all documents in the mini-batch.
infer_doc (ids, cts):
Does inference for a document using Frank Wolfe algorithm.
Parameters
- ids: an element of wordids, corresponding to a document.
- cts: an element of wordcts, corresponding to a document.
Returns: inferred theta and list of indexes of non-zero elements of the theta.
m_step (wordids, wordcts, theta, index)
Does M-step
learn_model (data, save_model_every=0, compute_sparsity_every=0, save_statistic=False, save_top_words_every=0, num_top_words=20, model_folder=’model’)
Inheritted method
see class LdaLearning
infer_new_docs (new_corpus)
Inheritted method
see class LdaLearning
class tmlib.lda.Online_OPE.OnlineOPE¶
tmlib.lda.Online_OPE. OnlineOPE (num_terms, num_topics=100, alpha=0.01, eta=0.01, tau0=1.0, kappa=0.9, iter_infer=50, lda_model=None)
This class inherits super-class LdaLearning. This used for learning LDA by Online-OPE method.
Parameters¶
num_terms: int,
Number of unique terms in the corpus (length of the vocabulary)
num_topics: int, default: 100
Number of topics shared by the whole corpus.
alpha: float, default: 0.01
Hyperparameter for prior on topic mixture theta.
eta (\(\eta\)): float, default: 0.01
Hyperparameter for prior on topics beta.
tau0 (\(\tau_{0}\)): float, default: 1.0
A (positive) learning parameter that downweights early iterations.
kappa (\(\kappa\)): float, default: 0.9
Learning rate: exponential decay rate should be between (0.5, 1.0] to guarantee asymptotic convergence.
iter_infer: int, default: 50.
Number of iterations of FW algorithm.
lda_model: object of class LdaModel, default: None.
If this is None value, it will be initialized and become a new object. If not, it will be the model learned previously
Attributes¶
num_docs: int,
Number of documents in the corpus.
num_terms: int,
num_topics: int,
alpha: float,
eta (\(\eta\)): float,
tau0 (\(\tau_{0}\)): float,
kappa (\(\kappa\)): float,
INF_MAX_ITER: int,
lda_model: object of class LdaModel
Methods¶
__init__ (num_terms, num_topics=100, alpha=0.01, eta=0.01, tau0=1.0, kappa=0.9, iter_infer=50, lda_model=None)
static_online (wordids, wordcts)
First does an E step on the mini-batch given in wordids and wordcts, then uses the result of that E step to update the topics in M step.
Parameters:
- wordids: A list whose each element is an array (terms), corresponding to a document. Each element of the array is index of a unique term, which appears in the document, in the vocabulary.
- wordcts: A list whose each element is an array (frequency), corresponding to a document. Each element of the array says how many time the corresponding term in wordids appears in the document.
Return: tuple (time of E-step, time of M-step, theta): time the E and M steps have taken and the list of topic mixtures of all documents in the mini-batch.
e_step (wordids, wordcts)
Does e step
Return: Returns topic mixtures theta.
infer_doc (ids, cts):
Does inference for a document using Online MAP Estimation algorithm.
Parameters
- ids: an element of wordids, corresponding to a document.
- cts: an element of wordcts, corresponding to a document.
Returns: inferred theta
m_step (wordids, wordcts, theta)
Does M-step
learn_model (data, save_model_every=0, compute_sparsity_every=0, save_statistic=False, save_top_words_every=0, num_top_words=20, model_folder=’model’)
Inheritted method
see class LdaLearning
infer_new_docs (new_corpus)
Inheritted method
see class LdaLearning
class tmlib.lda.Streaming_VB.StreamingVB¶
tmlib.lda.Streaming_VB. StreamingVB (num_terms, num_topics=100, alpha=0.01, eta=0.01, conv_infer=0.0001, iter_infer=50, lda_model=None)
This class inherits super-class LdaLearning. This used for learning LDA by Streaming-VB method.
Parameters¶
num_terms: int,
number words of vocabulary file
num_topics: int, default: 100
Number of topics shared by the whole corpus.
alpha: float, default: 0.01
parameter \(\alpha\) of model LDA
eta (\(\eta\)): float, default: 0.01
conv_infer: float, default: 0.0001
The relative improvement of the lower bound on likelihood of VB inference. If If bound hasn’t changed much, the inference will be stopped
iter_infer: int, default: 50.
number of iterations to do inference
lda_model: object of class LdaModel, default: None.
If this is None value, it will be initialized and become a new object. If not, it will be the model learned previously
Attributes¶
num_terms: int,
num_topics: int,
alpha: float,
eta (\(\eta\)): float,
conv_infer: float,
iter_infer: int,
lda_model: object of class LdaModel
_Elogbeta: float,
This is expectation of random variable \(\beta\) (topics of model).
_expElogbeta: float, this is equal exp(_Elogbeta)
Methods¶
__init__ (num_terms, num_topics=100, alpha=0.01, eta=0.01, tau0=1.0, kappa=0.9, conv_infer=0.0001, iter_infer=50, lda_model=None)
static_online (wordids, wordcts)
Excute the learning algorithm, includes: inference for individual document and update \(\lambda\). 2 parameters wordids, wordcts represent for term-frequency format of mini-batch
Return: tuple (time of E-step, time of M-step, gamma). gamma (\(\gamma\)) is variational parameter of \(\theta\)
e_step (wordids, wordcts)
Do inference for indivial document (E-step)
Return: tuple (gamma, sstats), where, sstats is the sufficient statistics for the M-step
update_lambda (sstats)
Update \(\lambda\) by stochastic way. Specificly, using stream learning
learn_model (data, save_model_every=0, compute_sparsity_every=0, save_statistic=False, save_top_words_every=0, num_top_words=20, model_folder=’model’)
Inheritted method
see class LdaLearning
infer_new_docs (new_corpus)
Inheritted method
see class LdaLearning
class tmlib.lda.Streaming_FW.StreamingFW¶
tmlib.lda.Streaming_FW. StreamingFW (num_terms, num_topics=100, eta=0.01, iter_infer=50, lda_model=None)
This class inherits super-class LdaLearning. This used for learning LDA by Streaming-FW method.
Parameters¶
num_terms: int,
Number of unique terms in the corpus (length of the vocabulary).
num_topics: int, default: 100
Number of topics shared by the whole corpus.
eta (\(\eta\)): float, default: 0.01
Hyperparameter for prior on topics beta.
iter_infer: int, default: 50.
Number of iterations of FW algorithm.
lda_model: object of class LdaModel, default: None.
If this is None value, it will be initialized and become a new object. If not, it will be the model learned previously
Attributes¶
- num_terms: int,
- num_topics: int,
- eta (\(\eta\)): float,
- iter_infer: int,
- lda_model: object of class LdaModel
Methods¶
__init__ (num_terms, num_topics=100, eta=0.01, iter_infer=50, lda_model=None)
static_online (wordids, wordcts)
First does an E step on the mini-batch given in wordids and wordcts, then uses the result of that E step to update the topics in M step.
Parameters:
- wordids: A list whose each element is an array (terms), corresponding to a document. Each element of the array is index of a unique term, which appears in the document, in the vocabulary.
- wordcts: A list whose each element is an array (frequency), corresponding to a document. Each element of the array says how many time the corresponding term in wordids appears in the document.
Returns: time the E and M steps have taken and the list of topic mixtures of all documents in the mini-batch.
e_step (wordids, wordcts)
Does e step
Returns topic mixtures and their nonzero elements’ indexes of all documents in the mini-batch.
Note that, FW can provides sparse solution (theta:topic mixture) when doing inference for each documents. It means that the theta have few non-zero elements whose indexes are stored in list of lists ‘index’.
infer_doc (ids, cts):
Does inference for a document using Frank Wolfe algorithm.
Parameters
- ids: an element of wordids, corresponding to a document.
- cts: an element of wordcts, corresponding to a document.
Returns: inferred theta and list of indexes of non-zero elements of the theta.
m_step (wordids, wordcts, theta, index)
Does M-step
learn_model (data, save_model_every=0, compute_sparsity_every=0, save_statistic=False, save_top_words_every=0, num_top_words=20, model_folder=’model’)
Inheritted method
see class LdaLearning
infer_new_docs (new_corpus)
Inheritted method
see class LdaLearning
class tmlib.lda.Streaming_OPE.StreamingOPE¶
tmlib.lda.Streaming_OPE. StreamingOPE (num_terms, num_topics=100, alpha=0.01, eta=0.01, iter_infer=50, lda_model=None)
This class inherits super-class LdaLearning. This used for learning LDA by Streaming-OPE method.
Parameters¶
num_terms: int,
Number of unique terms in the corpus (length of the vocabulary)
num_topics: int, default: 100
Number of topics shared by the whole corpus.
alpha: float, default: 0.01
Hyperparameter for prior on topic mixture theta.
eta (\(\eta\)): float, default: 0.01
Hyperparameter for prior on topics beta.
iter_infer: int, default: 50.
Number of iterations of FW algorithm.
lda_model: object of class LdaModel, default: None.
If this is None value, it will be initialized and become a new object. If not, it will be the model learned previously
Attributes¶
num_docs: int,
Number of documents in the corpus.
num_terms: int,
num_topics: int,
alpha: float,
eta (\(\eta\)): float,
INF_MAX_ITER: int,
lda_model: object of class LdaModel
Methods¶
__init__ (num_terms, num_topics=100, alpha=0.01, eta=0.01, tau0=1.0, kappa=0.9, iter_infer=50, lda_model=None)
static_online (wordids, wordcts)
First does an E step on the mini-batch given in wordids and wordcts, then uses the result of that E step to update the topics in M step.
Parameters:
- wordids: A list whose each element is an array (terms), corresponding to a document. Each element of the array is index of a unique term, which appears in the document, in the vocabulary.
- wordcts: A list whose each element is an array (frequency), corresponding to a document. Each element of the array says how many time the corresponding term in wordids appears in the document.
Return: tuple (time of E-step, time of M-step, theta): time the E and M steps have taken and the list of topic mixtures of all documents in the mini-batch.
e_step (wordids, wordcts)
Does e step
Return: Returns topic mixtures theta.
infer_doc (ids, cts):
Does inference for a document using Online MAP Estimation algorithm.
Parameters
- ids: an element of wordids, corresponding to a document.
- cts: an element of wordcts, corresponding to a document.
Returns: inferred theta
m_step (wordids, wordcts, theta)
Does M-step
learn_model (data, save_model_every=0, compute_sparsity_every=0, save_statistic=False, save_top_words_every=0, num_top_words=20, model_folder=’model’)
Inheritted method
see class LdaLearning
infer_new_docs (new_corpus)
Inheritted method
see class LdaLearning
class tmlib.lda.ML_CGS.MLCGS¶
tmlib.lda.ML_CGS. MLCGS (num_terms, num_topics=100, alpha=0.01, eta=0.01, tau0=1.0, kappa=0.9, burn_in=25, samples=25, lda_model=None)
This class inherits super-class LdaLearning. This used for learning LDA by ML-CGS method.
Parameters¶
num_terms: int,
number words of vocabulary file
num_topics: int, default: 100
number of topics of model.
alpha: float, default: 0.01
parameter \(\alpha\) of model LDA
eta (\(\eta\)): float, default: 0.01
tau0 (\(\tau_{0}\)): float, default: 1.0
kappa (\(\kappa\)): float, default: 0.9
burn_in: int, default: 25
samples: int, default: 25
50 samples were used in CGS for which the first 25 (burn_in) were discarded and the remaining (samples) were used to approximate the posterior distribution
lda_model: object of class LdaModel, default: None.
If this is None value, it will be initialized and become a new object. If not, it will be the model learned previously
Attributes¶
num_terms: int,
num_topics: int,
alpha: float,
eta (\(\eta\)): float,
tau0 (\(\tau_{0}\)): float,
kappa (\(\kappa\)): float,
burn_in: int,
samples: int,
lda_model: object of class LdaModel
_Elogbeta: float,
This is expectation of random variable \(\beta\) (topics of model).
_expElogbeta: float, this is equal exp(_Elogbeta)
Methods¶
__init__ (num_terms, num_topics=100, alpha=0.01, eta=0.01, tau0=1.0, kappa=0.9, burn_in=25, samples=25, lda_model=None)
static_online (wordtks, lengths)
Excute the learning algorithm, includes: inference for individual document and update \(\lambda\). 2 parameters wordtks, lengths represent for term-sequence format of mini-batch
Return: tuple (time of E-step, time of M-step, theta).
sample_z (wordids, wordcts)
Does E-step
Return: tuple (Ndk_mean, z)
update_lambda (wordtks, lengths, Ndk_mean)
Update \(\lambda\) by regularized online learning. \(\lambda\) here is \(\beta\)
learn_model (data, save_model_every=0, compute_sparsity_every=0, save_statistic=False, save_top_words_every=0, num_top_words=20, model_folder=’model’)
Inheritted method
see class LdaLearning
infer_new_docs (new_corpus)
Inheritted method
see class LdaLearning
class tmlib.lda.ML_FW.MLFW¶
tmlib.lda.ML_FW. MLFW (num_terms, num_topics=100, tau0=1.0, kappa=0.9, iter_infer=50, lda_model=None)
This class inherits super-class LdaLearning. This used for learning LDA by ML_FW method.
Parameters¶
num_terms: int,
Number of unique terms in the corpus (length of the vocabulary).
num_topics: int, default: 100
Number of topics shared by the whole corpus.
tau0: float, default: 1.0
A (positive) learning parameter that downweights early iterations.
kappa: float, default: 0.9
Learning rate: exponential decay rate should be between (0.5, 1.0] to guarantee asymptotic convergence.
iter_infer: int, default: 50.
Number of iterations of FW algorithm.
lda_model: object of class LdaModel, default: None.
If this is None value, it will be initialized and become a new object. If not, it will be the model learned previously
Note that if you pass the same set of all documents in the corpus every time and set kappa=0 this class can also be used to do batch FW.
Attributes¶
- num_terms: int,
- num_topics: int,
- tau0 (\(\tau_{0}\)): float,
- kappa (\(\kappa\)): float,
- iter_infer: int,
- lda_model: object of class LdaModel
Methods¶
__init__ (num_terms, num_topics=100, tau0=1.0, kappa=0.9, iter_infer=50, lda_model=None)
static_online (wordids, wordcts)
First does an E step on the mini-batch given in wordids and wordcts, then uses the result of that E step to update the topics in M step.
Parameters:
- wordids: A list whose each element is an array (terms), corresponding to a document. Each element of the array is index of a unique term, which appears in the document, in the vocabulary.
- wordcts: A list whose each element is an array (frequency), corresponding to a document. Each element of the array says how many time the corresponding term in wordids appears in the document.
Returns: time the E and M steps have taken and the list of topic mixtures of all documents in the mini-batch.
e_step (wordids, wordcts)
Does e step
Returns topic mixtures and their nonzero elements’ indexes of all documents in the mini-batch.
Note that, FW can provides sparse solution (theta:topic mixture) when doing inference for each documents. It means that the theta have few non-zero elements whose indexes are stored in list of lists ‘index’.
infer_doc (ids, cts):
Does inference for a document using Frank Wolfe algorithm.
Parameters
- ids: an element of wordids, corresponding to a document.
- cts: an element of wordcts, corresponding to a document.
Returns: inferred theta and list of indexes of non-zero elements of the theta.
sparse_m_step (wordids, wordcts, theta, index)
Does m step: update global variables beta, exploiting sparseness of the solutions returned by Frank-Wolfe algorithm from e step as well as that of wordids and wordcts lists.
m_step (batch_size, wordids, wordcts, theta, index)
Does m step: update global variables beta without considering the sparseness.
learn_model (data, save_model_every=0, compute_sparsity_every=0, save_statistic=False, save_top_words_every=0, num_top_words=20, model_folder=’model’)
Inheritted method
see class LdaLearning
infer_new_docs (new_corpus)
Inheritted method
see class LdaLearning
class tmlib.lda.ML_OPE.MLOPE¶
tmlib.lda.ML_OPE. MLOPE (num_terms, num_topics=100, alpha=0.01, tau0=1.0, kappa=0.9, iter_infer=50, lda_model=None)
This class inherits super-class LdaLearning. This used for learning LDA by Online-OPE method.
Parameters¶
num_terms: int,
Number of unique terms in the corpus (length of the vocabulary)
num_topics: int, default: 100
Number of topics shared by the whole corpus.
alpha: float, default: 0.01
Hyperparameter for prior on topic mixture theta.
tau0 (\(\tau_{0}\)): float, default: 1.0
A (positive) learning parameter that downweights early iterations.
kappa (\(\kappa\)): float, default: 0.9
Learning rate: exponential decay rate should be between (0.5, 1.0] to guarantee asymptotic convergence.
iter_infer: int, default: 50.
Number of iterations of FW algorithm.
lda_model: object of class LdaModel, default: None.
If this is None value, it will be initialized and become a new object. If not, it will be the model learned previously
Attributes¶
num_docs: int,
Number of documents in the corpus.
num_terms: int,
num_topics: int,
alpha: float,
tau0 (\(\tau_{0}\)): float,
kappa (\(\kappa\)): float,
INF_MAX_ITER: int,
lda_model: object of class LdaModel
Methods¶
__init__ (num_terms, num_topics=100, alpha=0.01, tau0=1.0, kappa=0.9, iter_infer=50, lda_model=None)
static_online (wordids, wordcts)
First does an E step on the mini-batch given in wordids and wordcts, then uses the result of that E step to update the topics in M step.
Parameters:
- wordids: A list whose each element is an array (terms), corresponding to a document. Each element of the array is index of a unique term, which appears in the document, in the vocabulary.
- wordcts: A list whose each element is an array (frequency), corresponding to a document. Each element of the array says how many time the corresponding term in wordids appears in the document.
Return: tuple (time of E-step, time of M-step, theta): time the E and M steps have taken and the list of topic mixtures of all documents in the mini-batch.
e_step (wordids, wordcts)
Does e step
Return: Returns topic mixtures theta.
infer_doc (ids, cts):
Does inference for a document using Online MAP Estimation algorithm.
Parameters
- ids: an element of wordids, corresponding to a document.
- cts: an element of wordcts, corresponding to a document.
Returns: inferred theta
m_step (wordids, wordcts, theta)
Does M-step: update global variables beta.
learn_model (data, save_model_every=0, compute_sparsity_every=0, save_statistic=False, save_top_words_every=0, num_top_words=20, model_folder=’model’)
Inheritted method
see class LdaLearning
infer_new_docs (new_corpus)
Inheritted method
see class LdaLearning
| [1] |
|
| [2] |
|


--- layout: default title: CKA Labs permalink: /labs.html ---
| # | Lab Name | Lab Link |
|---|---|---|
| 1 | Practice Test - PODs | Click Here to start the lab |
| 2 | Practice Test - ReplicaSets | Click Here to start the lab |
| 3 | Practice Test - Deployments | Click Here to start the lab |
| 4 | Practice Test - Namespaces | Click Here to start the lab |
| 5 | Practice Test - Services | Click Here to start the lab |
| 6 | Practice Test - Imperative Commands | Click Here to start the lab |
| 7 | Practice Test - Manual Scheduling | Click Here to start the lab |
| 8 | Practice Test - Labels and Selectors | Click Here to start the lab |
| 9 | Practice Test - Taints and Tolerations | Click Here to start the lab |
| 10 | Practice Test - Node Affinity | Click Here to start the lab |
| 11 | Practice Test - Resource Limits | Click Here to start the lab |
| 12 | Practice Test - DaemonSets | Click Here to start the lab |
| 13 | Practice Test - Static PODs | Click Here to start the lab |
| 14 | Practice Test - Multiple Schedulers | Click Here to start the lab |
| 15 | Practice Test - Monitor Cluster Components | Click Here to start the lab |
| 16 | Practice Test - Managing Application Logging | Click Here to start the lab |
| 17 | Practice Test - Lightning Lab 1 | Click Here to start the lab |
| 18 | Practice Test - Mock Exam 1 | Click Here to start the lab |
| 19 | Practice Test - Mock Exam 2 | Click Here to start the lab |
| 20 | Practice Test - Mock Exam 3 | Click Here to start the lab |


A Table |
|
|---|---|
| A table is an item of furniture with a flat top and one or more legs, used as a surface for working at or on which to place things. Some common types of table are the dining room table, which is used for seated persons to eat meals; the coffee table, which is a low table used in living rooms to display items or serve refreshments; and the bedside table, which is used to place an alarm clock and a lamp. |


[Erowid Note: The dose reported in this report is extremely high and should not be considered typical.]
I couldnt believe the reports I had heard over this substance. I had at the time been a professional level pychonaut for almost 20 years, or so I thought, and the dosage just seemed tiny to me regardless of what I had read on the net. I was one who routinely took up to 1000mg of MDA or a 10 strip of good blotter and enjoyed it. Ive had to eat up to a half sheet to keep from getting popped and even though I dont remember much I never think I had a good time. I considered myself a hardhead. Hell, I never enjoyed myself unless things were a wee bit too intense and it took a lot to make it that way.
Anyway, doubting the professional opinions, including Shulgins, I weighed out 70 mg of the HCL and put it in the end of a cig. I told my two friends I was going out back to try it while they finished weighing up the remaining 10 grams. The back of the lab was 100 feet from the Atlantic ocean on a nice summer eve at sunset and I couldnt picture a better setting. It was friday, I was in a great mood and no problems on the horizon. So I sat down on the deck because I didnt want to be overwhelmed and thought a sitting postion was best. Thats when my life changed.
I lit the smoke and pulled deeply from it. As I blew out the first pull I already heard and felt the train coming. I managed to take one more pull before things got out of control [I estimate I smoked 60mg]. The last vision I had while I still had my wits was very hard to describe. The words I use to try to do so are this: It was if I was looking at reality painted onto a piece of glass. When the onslaught came, lightning shot from an epicenter in the middle of my field of vision and reached the corners of my sight and along these jagged lines of energy it was if the glass broke and fell away carrying what I knew as reality with it. The world vanished and was replaced with a cosmos beyond my understanding. The last thought I had as a person was literally ' Oh Shit. You killed yourself.'
Then I was dead. I wasnt scared of being dead, it was actually comforting. Then I went on a journey beyond my intellect to describe. It was if I was a piece of energy similar to the lightning. I was shooting through the universe at incredible speeds and it was the most beautiful thing I have ever imagined or dreamed. I cant describe the beauty. I wasnt me any longer. There was no me. There was no ego. There was no fear. I was dead. I was in heaven or I was in transit to meet my maker and I was full of bliss at the concept of that idea.
At about the 20 minute point from ignition my friends came out to find me lying on the deck. I was breathing but didnt respond to external stimuli. Anxiously they waited and continued to try to elicit a response from me.
At 30 minutes or so they got a response I dont remember giving. I told them I was in heaven when asked ' Where are you?' Then within three or four minutes I was joined with my body and had aftereffects that lasted for another 30 minutes that were mainly ecstacy due to fact that I was alive.
Total energy. Prepare to meet God.
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.


| Select language | |
|
Enter source code |
| Gutter | ||
| Hide gutter & line numbers | ||
| Controls | ||
| Hide code controls at the top of the code block. | ||
| Collapse | ||
| Collapse the code block by default. (controls need to be turned on) | ||
| Show columns | ||
| Show row columns in the first line. |
| Default line count | ||
| Will begin line count at value. Default value is 1. | ||
| NOTE: This plugin makes use of the Java Script SyntaxHighlighter available from Google Code. Without configuring your website to use the SyntaxHighlighter this plugin will not have much affect! |


2014 - born Sir Morris Masters Aurelius Marxlove XV
2015 - Ascends the highest ranks in the Legion of Kitty
2016 - Unites all kittehs legions under the banner of Nip
2017 - Is fatally wounded in the Battle of Wounded Paw
"The cat's greatest enemy is the Dog. The Dog takes and does not give. The Dog poops and does not bury. They remain unclean! But they are strong and numerous. It is only through unity and perserverance that the cat can the cat overcome the dog, and take its rightful place in history."
This information is completely made up. If you'd like, you can take a look at more on
Cats on google. Or take a look the original Morris the Cat on Wikipedia.


{{Infobox prepared food | name = Yi mein | image = | caption = | alternate_name = E-fu noodles, yee-fu noodles ,yi noodles, yifu noodles | country = China | region = | creator = | course = | type = Chinese noodles | served = | main_ingredient = Wheat flour, eggs | variations = | calories = | other = }} {{Chinese|t=伊麵|t2=伊府麵|s=伊面|s2=伊府面|j=ji1 min6|j2=ji1 fu2 min6|w=I1-mien4|p=yī miàn|w2=I1-fu3-mien4|p2=yi1 fu3 mian4|}}
Yi mein (also called e-fu noodles, yee-fu noodles, yi noodles, or yifu noodles) is a variety of flat Cantonese egg noodles made from wheat flour. They are known for their golden yellow color and chewy characteristics. The slightly chewy and slightly spongy texture of the noodles is due to the soda water used in making the dough (as opposed to regular non-carbonated water), which was then fried and dried into flat patty-like dried bricks.
Contents |
The noodles may be cooked a number of ways. They are boiled first, then can be stir fried, or used in soups or salads. Good noodles maintain their elasticity, allowing the noodles to stretch and remain chewy.
Yi mein noodles can be consumed directly or used in various dishes:
|url=http://www.pigpigscorner.com/2011/06/lobster-yee-mein-lobster-noodles.html|title=Lobster Yee Mein|author=|work=pigpigscorner.com|date=10 June 2011|accessdate=12 August 2012}}</ref><ref name=scmp-20150625>{{cite web|title=Lobster Yee Mien|url=http://www.scmp.com/magazines/48-hours/article/1825170/hong-kongs-top-ten-noodle-dishes-and-where-get-them|website=www.scmp.com|publisher=South China Morning Post|accessdate=22 October 2015}}</ref>
When Yi mein is consumed on birthdays, it is generally referred to as Longevity noodles or Sau mein (壽麵/寿面). The Chinese character for "long" (長壽麵/长寿面) is also added as a prefix to represent "long life". Usually it is consumed with longevity buns during birthday celebrations.
<gallery> Image:Yi mein.jpg|Dry fried yi mein Image:Efu_noodles.jpg|Noodles at a store in Canada </gallery>
{{reflist}}
{{Hong Kong cuisine}} {{Chinese noodles}} {{Cantonese cuisine}}
{{China-cuisine-stub}}


{% extends "layout.html" %} {% block phase%} {% include 'sprint10/partials/phase-banner.html'%} {% endblock %} {% block main %}
Before you send your report, review what you have entered:
You're saying that {{review.name}}.


Resolution of the cyBRICS CTF challenge named Gif2png
Gif2Png is an easy web challenge from cyBRICS CTF 2020, an interesting web challenge that teaches you command injection through image’s filename.
The challenge had the following description/details:
A copy of the original web application’s source code is available on: gif2png.tar.gz
The challenge web page:
It seems that the web application slices the gif into frames and display them on the screen:
So now let’s check the source code of the web application to understand how it is done.
This is the source code of the main file, named main.py:
What caught my attention was the line 104:
This can be very insecure because the web application is passing an user input to be executed as system command. (file.filename)
There’s a small condition that checks for some characters on filename and blocks the upload:
So now we need to exploit this weak point.
The very first thing we need to do is stop the actual ffmpeg command and execute another one, to do this we need to escape the ' quotes and append another command.
I found a way to bypass the filename verification using double pipelines to execute my system command, the malicious filename will look something like this:
MALICIOUS_NAME'||MALICIOUS SYTEM COMMAND HERE||'
There’s a final problem: how to inject system commands through filename and bypass the filename check? Encoding the payload with base64, decoding and executing on the fly!
echo d2hvYW1pO2lkO3NsZWVwIDEw|base64 -d|sh
Unfortunatelly, the challenge server had a firewall blocking reverse shells and requests to the external resources through port 80.
So I came with the idea of exfiltrating the flag (inside the main.py) through DNS using dnsbin.zhack.ca:


| Mongo_lwt |
This is a major client-faced module, for the high level usage.
|
| MongoAdmin_lwt |
This is a major client-faced module, for the high level usage.
|
| MongoSend_lwt |
This module simply define two functions used as underlying low level unix socket output.
|


Scroll me and the progress bar on the right will show the percentage of scroll. Look also at the CSS code (body is 2000px height, for example)...


{% extends 'demo/base.html' %}
{% load bootstrap3 %}
{% block title %}MayorBC{% endblock %}
{% block content %}
Welcome to MayorBC Group Results, we are showing some intresting results from candidates who ran 2018 Vancouver mayor election
{% endblock %}


User
Name
Login
Description
Last Login
Status
Login
E-Mail
Change User Information
Name
Description
Change Password
Old Password
New Password
Repeat new Password
Login
E-Mail
User Information
Name
Description
Password
Password
Repeat Password


{% extends "base.html" %} {% block title %}{{ title }}{% endblock %} {% block stylesheets %} {% endblock %} {% block page_content %}
Measure, plot and analyze your weightlifting sessions! Learn and grow!
By recording your weightlifting sessions you can study them afterwards and study your technique for possible improvements.
All your recorded weightlifting sessions available for study here!
The recorded data can be plotted in a multitude of ways, for your viewing pleasure.
All recorded sessions are analysed and statistical summaries are created automatically.
Draw conclusions based on your data and improve your performance!
Compare your performance to other WLMetrics users!
Tap record in your app and start lifting!
Info text.
Text describing just how interesting this methodlogy is. Text describing just how interesting this methodlogy is. Text describing just how interesting this methodlogy is. Text describing just how interesting this methodlogy is. Text describing just how interesting this methodlogy is. Text describing just how interesting this methodlogy is. Text describing just how interesting this methodlogy is.


 Basically you can download the DjangoImage" %} {% trans " which contains the Django application source code and use it in any Master unit you desire; or you can download a RaspImage" %} {% trans " that contains a fully operational Raspbian O.S. with the Django application configured to operate with an " %} Nginx {% trans "server and " %}Gunicorn. {% trans "This pre-configured image is the simplest and fastest" %} {% trans " way to start a " %}{% include "_brandname.html" %}{% trans " installation." %}
| {% trans "Release date" %} | {% trans "Release name" %} | {% trans "Change log" %} | {% trans "Downloads" %} | |
|---|---|---|---|---|
| 30/06/2017 | {% trans "DjangoImage" %} » | {% trans "RaspImage" %} » |


The difference between pointers and arrays
I have seen in many places that an array is introduced as a pointer. This is technically not correct. Arrays are not pointer. So what is it? It is like any other variable in C++.
Take a look at this code:
1 2
|
int arr[3]={3,4,5};
cout<<arr;
| |
You may say: "Look there, arr is an address, who says it's not a pointer?"
And I say: this code prints out an address. So var is an address?
Let me explain:
All the variables can be manipulated in the memory by their addresses. CPU uses these addresses to fetch them, change them and save them. So, all variables have an address (not only those that you pointed to them). We can find out the address of a variable by (&) operator, in form of:
1 2
|
int* ptr=&intvar;
// Now the address of intvar is in ptr
| |
An array is just a sequence of variables. But there is a rule, that C++ looks arrays as if they were pointers. What does it means? It means that if you write arr, compiler takes it as &arr[0] (except in three conditions that I'll tell you soon), that is the address of the first element of the array. It has a type "pointer to T" where T is the type of array elements (that is int in our example). If you add 1 to it it will point to the second element of the array.
So it takes &arr as what?
It is one of the exceptions where the rule does not apply. It takes it as a pointer to array. It will again point to the first element of the array, but if you add one to this pointer, it will point to the address of the place right after the last element of the array (just like you skipped the array). It is a pointer to the whole the array. The value of &arr and arr is the same (address of the first element). But their type is different. Here &arr has type "pointer to the array of T" (compare it to the type of arr).
Look at this
1 2 3 4 5
|
int arr[3]={3,4,5};
cout<<"First element of the array: "<<arr[0] <<endl;
cout<<"Address of the first element: "<<&arr[0] <<endl;
cout<<"Address of the array: "<<arr <<endl;
cout<<"So what is this? "<<&arr <<endl;
| |
First cout: Prints out the "value" of arr[0].
Second cout: Prints out the "address" of arr[0].
Third cout: Again prints out the "address" of arr[0].
Forth cout: Prints out the address of the array, that is again the address of arr[0].
And this:
1 2 3 4 5
|
int arr[3]={3,4,5};
cout<<"First element of the array: "<<arr[0]+1 <<endl;
cout<<"Address of the first element: "<<&arr[0]+1 <<endl;
cout<<"Address of the array: "<<arr +1<<endl;
cout<<"So what is this? "<<&arr +1<<endl;
| |
First cout: Prints out the "value" of arr[0] plus one.
Second cout: Prints out the "address" of arr[1].
Third cout: Again prints out the "address" of arr[1] .
Forth cout: Prints out the first address of memory after the array.
Comparison
Similarities, each with an example:
1) (*) can be used for both.
1 2 3 4 5 6 7 8
|
int arr[3]={1,3,4}; //Declares an array with 3 elements
int * ptr=arr; //Initialize pointer ptr with the address of array arr
cout<<*(arr+2)<<endl;
cout<<*{ptr+2)<<endl;
/* output */
4
4
| |
2) Subscription can be used for both
1 2 3 4 5 6 7 8
|
int arr[3]={1,3,4}; //Declares an array with 3 elements
int * ptr=arr; //Initialize pointer ptr with the address of array arr
cout<<arr[2])<<endl;
cout<<ptr[2])<<endl;
/* output */
4
4
| |
3) A pointer can be used as an array.
1 2 3 4 5 6 7
|
int *ptr=new int[3];
ptr[0]=12;
ptr[2]=3;
cout<<ptr[2];
/* output */
3
| |
4) An array can have a type of pointer. That means the elements of it can be pointers.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
int ar[2]={8,2};
int var1=66;
int var2=111;
int* ptarray[5];
ptarray[0]=ar;
ptarray[1]=&ar[1]; //Address of second element of array ar
ptarray[2]=&var1;
ptarray[3]=&var2;
ptarray[4]=&ar[0];
// To keep code small I use a loop
for(int i=0;i<5;i++)
cout<<*(ptarray<i>)<<endl;
/* output */
8
2
66
111
8
| |
5) All arrays will be passed to functions as a pointer, which means you can't actually send an array to a function. So function(char[]) is equal to function(char*).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
#include<iostream>
using namespace std;
void test(char v[]);
int main(){
char a[53];
//a="If a is an array, this line should generate an error";
test(pta);
return 0;
}
void test(char v[]){
v="If v is an array, this line should generate an error";
cout<<v<<endl;
}
| |
Differences:
1) A pointer is a place in memory that keeps address of another place inside, while an array is a single, preallocated chunk of contiguous elements (all of the same type), fixed in size and location.
3) Array like pointers can't be initialized at definition like arrays.
1 2
|
char car[3]={'a','b',66};
char* cpt=new char[3]; //No way to be initialized here.
| |
4) When we allocate memory for a pointer to use it as a dynamic array. The memory can be resized or freed later. But this is not the case for arrays.
For example:
1 2 3
|
char* pta=new char[12];
//Using pta
delete[] pta;
| |
3) They produce different assembly code. Look and compare:
1 2 3 4 5 6 7 8 9 10
|
int main()
{
char arr[3];
char* ptr=new char[3];
arr[0]='C'; //Assembly is for this.
ptr[0]='p'; //And for this.
return 0;
}
| |
Will have an assembly like this:
1 2 3 4 5 6
|
arr[0]='C';
mov byte ptr [ebp-4],43h //The code for putting one character in an array
ptr[0]='p';
mov ecx,dword ptr [ebp-8] //The two line code for putting one character
mov byte ptr [ecx],70h //in a place where a pointer points to
| |
Hope to be useful...
Refferences:
http://<IP_ADDRESS>/torek/c/index.html
http://c-faq.com/questions.html


--- layout: default title: Marketplace permalink: /modules/marketplace/ redirect_from: - /modules/marketplace.html angularjs: true market: true sitemap: priority: 0.7 lastmod: 2015-12-10T00:00:00-00:00 ---
If you want to create your own module, here is the documentation.
If you want to create your own blueprint, here is the documentation.


Build Materials
Link
Link
AnotherLink
Another Link
Sign up
Username
Email
Password
About me
Are you working in construction business
Yes
No
Clear
Sign up


September 1
I tell you, although he will not get up and supply him anything because he is his friend, yet because of his shameless persistence and insistence, he will get up and give him as much as he needs Luke 11:8
If, as God tells us in 1 Timothy 2:4, it's His will for all men to be saved, why aren't we seeing more of the masses of lost people born again every day? Have you ever wondered that?
I have...and as I've sought the Lord about it, I've come to realize that, for the most part, it's because those of us who are already saved don't pray persistently for those who aren't. Instead of persevering--staying before the Father, praying for them to receive the bread of salvation--like the man in Luke 11:8 did for his friend, when we don't see immediate results, we simply give up and go home.
What we don't realize is this: Perseverance is the key to success in intercession!
Why? It's certainly not because you have to change God's mind. He never changes. His mind's made up. He wants all men saved. The reason you have to persevere in intercession is to put pressure on the demonic forces that are trying to keep God's will from being accomplished. Those forces must be broken down through prayer so that strongholds are destroyed and spiritual blinders are removed from the spiritual eyes of the people you're praying for.
You see, God will not go against the will of people. But He will move through your intercession to reveal Himself. Through your persistent prayers, He will bring them to the knowledge of their need for Him. Then they'll reach out for Him and spiritual rebirth can take place!
If you're sitting around waiting on God to save Aunt Mary or Uncle Jim or your best friend...stop sitting around! Get busy interceding for them. Persevere in prayer. Pray the prayer in Ephesians 1:16-23 for them, refusing to give up until they're safely inside God's kingdom.
Jesus has already laid down His life so that they can be saved. The question is, will you?
Scripture Reading: Luke 11:1-10


|
QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.30
|
Files | |
| file | bondhelpers.cpp [code] |
| file | bondhelpers.hpp [code] |
| bond rate helpers | |
| file | bootstraptraits.hpp [code] |
| bootstrap traits | |
| file | compositezeroyieldstructure.hpp [code] |
| Composite zero term structure. | |
| file | discountcurve.hpp [code] |
| interpolated discount factor structure | |
| file | drifttermstructure.hpp [code] |
| file | fittedbonddiscountcurve.cpp [code] |
| file | fittedbonddiscountcurve.hpp [code] |
| discount curve fitted to a set of bonds | |
| file | flatforward.cpp [code] |
| file | flatforward.hpp [code] |
| flat forward rate term structure | |
| file | forwardcurve.hpp [code] |
| interpolated forward-rate structure | |
| file | forwardspreadedtermstructure.hpp [code] |
| Forward-spreaded term structure. | |
| file | forwardstructure.cpp [code] |
| file | forwardstructure.hpp [code] |
| Forward-based yield term structure. | |
| file | impliedtermstructure.hpp [code] |
| Implied term structure. | |
| file | interpolatedsimplezerocurve.hpp [code] |
| interpolated simply-compounded zero-rates structure | |
| file | nonlinearfittingmethods.cpp [code] |
| file | nonlinearfittingmethods.hpp [code] |
| nonlinear methods to fit a bond discount function | |
| file | oisratehelper.cpp [code] |
| file | oisratehelper.hpp [code] |
| Overnight Indexed Swap (aka OIS) rate helpers. | |
| file | overnightindexfutureratehelper.cpp [code] |
| file | overnightindexfutureratehelper.hpp [code] |
| Overnight Index Future bootstrap helper. | |
| file | piecewiseyieldcurve.hpp [code] |
| piecewise-interpolated term structure | |
| file | piecewisezerospreadedtermstructure.hpp [code] |
| Piecewise-zero-spreaded term structure. | |
| file | quantotermstructure.hpp [code] |
| Quanto term structure. | |
| file | ratehelpers.cpp [code] |
| file | ratehelpers.hpp [code] |
| deposit, FRA, futures, and various swap rate helpers | |
| file | ultimateforwardtermstructure.hpp [code] |
| Ultimate Forward Rate term structure. | |
| file | zerocurve.hpp [code] |
| interpolated zero-rates structure | |
| file | zerospreadedtermstructure.hpp [code] |
| Zero spreaded term structure. | |
| file | zeroyieldstructure.cpp [code] |
| file | zeroyieldstructure.hpp [code] |
| Zero-yield based term structure. | |


Bonnie and Clyde
Bonnie and Clyde is a movie starring Warren Beatty, Faye Dunaway, and Michael J. Pollard. Bored waitress Bonnie Parker falls in love with an ex-con named Clyde Barrow and together they start a violent crime spree through the...


You can query these entity beans to get "meta" data from Ebean. This includes things like query execution statistics.
// fetch the meta data that controls autoFetch query tuning Queryquery = Ebean.createQuery(MetaAutoFetchTunedFetch.class); List list = query.findList();


MuJoCo stands for Multi-Joint Dynamics with Contact. MuJoCo is a physics engine that helps simulate multi-joint environments with contact forces. It also has a 3D graphics engine (with OpenGL backend) that renders the simulation in real-time. For more details, see: http://www.mujoco.org/.
The OpenAI Gym is an open-source project developed by the OpenAI group dedicated to providing a platform to host benchmarking environments for comparing machine learning algorithms. Currently it can be used with Python code and is compatible with numerical computation libraries such as TensorFlow or Theano.
The OpenAI Gym contains a number of pre-made MuJoCo environments that users can use to test the efficacy of their algorithms. After installing OpenAI Gym and activating MuJoCo, you can quickly visualize the environments using this simple script:
import gym
env = gym.make('InvertedPendulum-v1')
for i in xrange(10):
env.reset()
for i in xrange(1000):
a = (np.random.rand(*env.action_space.shape) - 0.5) * 1.1
# returns observation, reward, done, info
o, r, d, i = env.step(a)
env.render()
In addition to the existing MuJoCo environments, we made some simple modifications on some existing environments to create extended environments. Each of these extended environments consist of: 1) an XML file, containing every object and their specifications in the environment; 2) A corresponding python file that defines the class and other parameters such as what happens on reset, rewards, and what marks a state as “done”.
The motivation for extended environments was that, after training an agent for a particular environment, it was interesting to see whether the same agent would perform as well on highly similar environments. A description of each extended environment, followed by their screenshots, is provided below.
SmallInvertedPendulum-v1
)
InvertedPendulum-v1
.BigInvertedPendulum-v1
)
BigInvertedPendulum*v1
has a longer pole.BigAnt-v1
)
Ant-v1
.AmputedAnt-v1
)
Ant-v1
. Similar to BigAnt-v1
in joint activation forces and goal of the environment.ExtendedAnt-v1
)
Ant-v1
.The first section’s length is 0.2, second section 0.4, third section 0.6.
| Environments | |
|---|---|
The finger environment (Finger-v1
) is a special MuJoCo environment created specifically for this project. The environment consists of a palm, embodied in a sphere, and the index finger. A total of seven tendons connect to the proximal, middle, and distal phalanxes of the finger. Users can specify activation forces on the tendons which will pull on the finger and cause it to bend or flex. The tendons were chosen according to the finger model found in Valero-Cuevas’ book, “Fundamentals of Neuromechanics” 1. The figure is shown below.
| Finger model from Valero-Cuevas | Simulated Finger Environment |
|---|---|
Screenshots of the finger environment are shown above. The goal of the finger is to touch a randomly positioned target ball with its fingertips.
In the MuJoCo XML hierarchy, objects grouped under another object (in the form of nested body elements) will move together unless there is a joint
specified within the object. The joint allows motion degrees of freedom between the parent and child. The top-level body is special and is called <worldbody>
.
Objects in the finger environment are specified in the <worldbody>
tag. The palm, embodied as a sphere, is named finger_base
. The proximal phalanx is a child of finger_base
, called finger0
. They are connected through 2 joints on the x- and y-axis. The middle phalanx finger1
is a child of finger0
, and distal phalanx finger2
child of finger1
. They each contain one joint on the y-axis, allowing them only one degree of freedom, which is for bending forward. Connections between phalanxes are given names of the form base_wrap
(between palm and finger base), finger0_wrap
(between proximal and middle phalanxes), and finger1_wrap
(between middle and distal phalanxes), simulating the appearance of a joint.
There is a fingertip
sphere embedded at the fingertips, which are used for calculating rewards and determining whether or not the state can be considered “done” based on the distance between this fingertip sphere and the target sphere. To calculate the reward, we take the normal of the vector resulting from subtracting the target sphere’s position from fingertip’s position. When their distance is less than 0.2.
The seven tendons of the finger are named: EIP, DI, PI, FDP, FDS, LUM, EDC. In MuJoCo, tendons are specified outside of the <worldbody>
, under tag <tendon>
. Each tendon has a spatial
tag, which defines which geometry in the <worldbody>
should be considered as part of this tendon. For example, to form a spatial tendon between the first and second “joints” (embodied as spheres), we define:
<spatial name=”EIP” width=”0.03”>
<geom geom=”base_wrap”>
<geom geom=”finger0_wrap”>
</spatial>
To make the tendon connect to specific points on the finger, we define a default dummy element in <site>
under the <default>
tag, before <worldbody>
. Below, we specify that the default site should be a sphere of size 0.04. Then, in <worldbody>
, whenever we define a site it will use the default <site>
specifications. We define a number of these site
s on various points along the finger body, especially around joints, to create the tendon. These sites are named EIP_1
, EIP_2
, ..., EIP_7
and so on.
The sample XML code snippet below defines a tendon that connects the base joint to an arbitrary position on the finger:
<site type=”sphere” size=”0.04”/>
<worldbody>
<body name=”finger_base” pos=”0 0 0”>
<geom name=”base_wrap” type=”sphere” pos=”0 0 2” size=”0.17”/>
<site name=”EIP_1” pos=”0.14 0.05 .3”/>
... etc.
</worldbody>
<tendon>
<spatial name=”EIP” width=”0.02”>
<geom geom=”finger_base”>
<site site=”EIP_1”>
...
</spatial>
For this finger, the EIP and LUM tendons each wrapped around 2 joints and contained 5 site
elements. DI and PI each had 1 joint and 3 elements. The FDP had 3 joints and 7 site
s. EDC and FDS both branched, wrapped around 3 joints, and contained more than 7 elements. For more documentation on MuJoCo XML files, see: http://www.mujoco.org/book/modeling.html.
We are grateful to the entire BBDL Lab at USC for their help along the project. In particular, we thank Brian Cohn and Prof. Valero-Cuevas for their supervision. We would also like to thank Prof. Emo Todorov for his help on using tendons in MuJoCo.
Valero-Cuevas, F.J. Fundamentals of Neuromechanics. London: Springer, 2015.↩


Paragraph
If the pumps are running before the pumping process begins, it is recommended to use valves very close to the chamber in order to separate the pipeline. The pipeline is then evacuated and thus accelerates the pumping process.


|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Expert: Compares two ScoreDoc objects for sorting.
Created: Feb 3, 2004 9:00:16 AM
| Field Summary | |
static ScoreDocComparator |
INDEXORDER
Special comparator for sorting hits according to index order (document number). |
static ScoreDocComparator |
RELEVANCE
Special comparator for sorting hits according to computed relevance (document score). |
| Method Summary | |
int |
compare(ScoreDoc i,
ScoreDoc j)
Compares two ScoreDoc objects and returns a result indicating their sort order. |
int |
sortType()
Returns the type of sort. |
Comparable |
sortValue(ScoreDoc i)
Returns the value used to sort the given document. |
| Field Detail |
public static final ScoreDocComparator RELEVANCE
public static final ScoreDocComparator INDEXORDER
| Method Detail |
public int compare(ScoreDoc i, ScoreDoc j)
i
- First ScoreDocj
- Second ScoreDoc
-1
if i
should come before j
1
if i
should come after j
0
if they are equalComparator
public Comparable sortValue(ScoreDoc i)
i
- Document
FieldDoc
public int sortType()
SortField.SCORE
, SortField.DOC
, SortField.STRING
, SortField.INTEGER
,
SortField.FLOAT
or SortField.CUSTOM
. It is not valid to return SortField.AUTO
.
This is used by multisearchers to determine how to collate results from their searchers.
SortField
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |


WITNESS LIST
Economic Development, Select
December 12, 2012 10:00 AM
Select Committee
ON:
Barber, Kathy (NFIB/Texas), Austin, TX
Colyandro, John Executive Director (Texas Conservative Coalition Research Institute),
Austin, TX
Cramer, Dale President (Texas Taxpayers and Research Association), Austin, TX
Hamilton, Billy Consultant (Self), Austin, TX
Harward, Heather Executive Director (H2O4TEXAS Coalition), Austin, TX
Howden, Robert Chairman (Texans for Economic Progress), Austin, TX
Peacock, Bill Researcher (Texas Public Policy Foundation), Austin, TX
Sproull, Bill (Richardson Economic Development), Richardson, TX
Yolk, James Executive Director (Rural Texas), Nocona, TX
Registering, but not testifying:
ON:
Fowler, Susan President (Texas Motion Picture Alliance), Houston, TX
Providing written testimony:
ON:
Haverlah, Sandra Consultant (Texas Consumer Association), Austin, TX
Walker, Kwame Lobbyist (Entertainment Software Association), Austin, TX
Wroblewski, Todd Small business owner (Self), Austin, TX


MOVE_PAGES
Section: Linux Programmer's Manual (2)
Updated: 2010-06-11
Index
Return to Main Contents
NAME
move_pages - move individual pages of a process to another node
SYNOPSIS
#include <numaif.h>
long move_pages(int pid, unsigned long count, void **pages,
const int *nodes, int *status, int flags);
Link with -lnuma.
DESCRIPTION
move_pages()
moves the specified
pages
of the process
pid
to the memory nodes specified by
nodes.
The result of the move is reflected in
status.
The
flags
indicate constraints on the pages to be moved.
pid
is the ID of the process in which pages are to be moved.
To move pages in another process,
the caller must be privileged
(CAP_SYS_NICE)
or the real or effective user ID of the calling process must match the
real or saved-set user ID of the target process.
If
pid
is 0, then
move_pages()
moves pages of the calling process.
count
is the number of pages to move.
It defines the size of the three arrays
pages,
nodes,
and
status.
pages
is an array of pointers to the pages that should be moved.
These are pointers that should be aligned to page boundaries.
Addresses are specified as seen by the process specified by
pid.
nodes
is an array of integers that specify the desired location for each page.
Each element in the array is a node number.
nodes
can also be NULL, in which case
move_pages()
does not move any pages but instead will return the node
where each page currently resides, in the
status
array.
Obtaining the status of each page may be necessary to determine
pages that need to be moved.
status
is an array of integers that return the status of each page.
The array contains valid values only if
move_pages()
did not return an error.
flags
specify what types of pages to move.
MPOL_MF_MOVE
means that only pages that are in exclusive use by the process
are to be moved.
MPOL_MF_MOVE_ALL
means that pages shared between multiple processes can also be moved.
The process must be privileged
(CAP_SYS_NICE)
to use
MPOL_MF_MOVE_ALL.
Page states in the status array
The following values can be returned in each element of the
status
array.
- 0..MAX_NUMNODES
-
Identifies the node on which the page resides.
- -EACCES
-
The page is mapped by multiple processes and can be moved only if
MPOL_MF_MOVE_ALL
is specified.
- -EBUSY
-
The page is currently busy and cannot be moved.
Try again later.
This occurs if a page is undergoing I/O or another kernel subsystem
is holding a reference to the page.
- -EFAULT
-
This is a zero page or the memory area is not mapped by the process.
- -EIO
-
Unable to write back a page.
The page has to be written back
in order to move it since the page is dirty and the filesystem
does not provide a migration function that would allow the move
of dirty pages.
- -EINVAL
-
A dirty page cannot be moved.
The filesystem does not
provide a migration function and has no ability to write back pages.
- -ENOENT
-
The page is not present.
- -ENOMEM
-
Unable to allocate memory on target node.
RETURN VALUE
On success
move_pages()
returns zero.
On error, it returns -1, and sets
errno
to indicate the error.
ERRORS
- E2BIG
-
Too many pages to move.
- EACCES
-
One of the target nodes is not allowed by the current cpuset.
- EFAULT
-
Parameter array could not be accessed.
- EINVAL
-
Flags other than
MPOL_MF_MOVE
and
MPOL_MF_MOVE_ALL
was specified or an attempt was made to migrate pages of a kernel thread.
- ENODEV
-
One of the target nodes is not online.
- ENOENT
-
No pages were found that require moving.
All pages are either already
on the target node, not present, had an invalid address or could not be
moved because they were mapped by multiple processes.
- EPERM
-
The caller specified
MPOL_MF_MOVE_ALL
without sufficient privileges
(CAP_SYS_NICE).
Or, the caller attempted to move pages of a process belonging
to another user but did not have privilege to do so
(CAP_SYS_NICE).
- ESRCH
-
Process does not exist.
VERSIONS
move_pages()
first appeared on Linux in version 2.6.18.
CONFORMING TO
This system call is Linux-specific.
NOTES
For information on library support, see
numa(7).
Use
get_mempolicy(2)
with the
MPOL_F_MEMS_ALLOWED
flag to obtain the set of nodes that are allowed by
the current cpuset.
Note that this information is subject to change at any
time by manual or automatic reconfiguration of the cpuset.
Use of this function may result in pages whose location
(node) violates the memory policy established for the
specified addresses (See
mbind(2))
and/or the specified process (See
set_mempolicy(2)).
That is, memory policy does not constrain the destination
nodes used by
move_pages().
The
<numaif.h>
header is not included with glibc, but requires installing
libnuma-devel
or a similar package.
SEE ALSO
get_mempolicy(2),
mbind(2),
set_mempolicy(2),
numa(3),
numa_maps(5),
cpuset(7),
numa(7),
migratepages(8),
numastat(8)
Index
- NAME
-
- SYNOPSIS
-
- DESCRIPTION
-
- Page states in the status array
-
- RETURN VALUE
-
- ERRORS
-
- VERSIONS
-
- CONFORMING TO
-
- NOTES
-
- SEE ALSO
-
This document was created by
man2html,
using the manual pages.
Time: 02:54:49 GMT, September 18, 2014


|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |
java.lang.Object java.lang.Enum<AuthError.ERROR_TYPE> com.amazon.identity.auth.device.AuthError.ERROR_TYPE
public static enum AuthError.ERROR_TYPE
Each AuthError has a type to help clients determine what detailed action they want to take
| Enum Constant Summary | |
|---|---|
ERROR_ACCESS_DENIED
AuthError.ERROR_CATEGORY.ACTION Invalid API Key - See logs for more info |
|
ERROR_AUTH_DIALOG
AuthError.ERROR_CATEGORY.INTERNAL Currently NOT used by Authorization SDK |
|
ERROR_BAD_API_PARAM
AuthError.ERROR_CATEGORY.BAD_REQUEST Currently NOT used by Authorization SDK |
|
ERROR_BAD_PARAM
AuthError.ERROR_CATEGORY.INTERNAL Bad parameter used by SDK |
|
ERROR_COM
AuthError.ERROR_CATEGORY.NETWORK Unknown Exception with WebViewClient, ClientProtocolException with HTTPClient.execute |
|
ERROR_DATA_STORAGE
AuthError.ERROR_CATEGORY.INTERNAL Failure while using data storage |
|
ERROR_DCP_DMS
AuthError.ERROR_CATEGORY.ACTION Currently NOT used by Authorization SDK |
|
ERROR_DIRECTED_ID_NOT_FOUND
AuthError.ERROR_CATEGORY.BAD_REQUEST Currently NOT used by Authorization SDK |
|
ERROR_FORCE_UPDATE
AuthError.ERROR_CATEGORY.ACTION Currently NOT used by Authorization SDK |
|
ERROR_INIT
AuthError.ERROR_CATEGORY.BAD_REQUEST Currently NOT used by Authorization SDK |
|
ERROR_INVALID_API
AuthError.ERROR_CATEGORY.BAD_REQUEST Currently NOT used by Authorization SDK |
|
ERROR_INVALID_CLIENT
AuthError.ERROR_CATEGORY.ACTION Server has indicated the client is invalid. |
|
ERROR_INVALID_GRANT
AuthError.ERROR_CATEGORY.ACTION Server has indicated the client is not authorized to use the requested grant(s). |
|
ERROR_INVALID_SCOPE
AuthError.ERROR_CATEGORY.ACTION Server has indicated the current authorization does not have the requested scope. |
|
ERROR_INVALID_TOKEN
AuthError.ERROR_CATEGORY.ACTION Server has indicated an issue with the token/code parameters that were sent. |
|
ERROR_IO
AuthError.ERROR_CATEGORY.NETWORK IOException on HttpClient.execute |
|
ERROR_JSON
AuthError.ERROR_CATEGORY.INTERNAL JSONException when trying to create org.json.JSONObject from a server response (incorrect data or badly formatted json) |
|
ERROR_PARSE
AuthError.ERROR_CATEGORY.INTERNAL Exception when trying to parse JSON response - typically when looking for an attribute in JSON that does not exist, but should |
|
ERROR_RESOURCES
AuthError.ERROR_CATEGORY.BAD_REQUEST Currently NOT used by Authorization SDK |
|
ERROR_REVOKE_AUTH
AuthError.ERROR_CATEGORY.INTERNAL Currently NOT used by Authorization SDK |
|
ERROR_SECURITY
AuthError.ERROR_CATEGORY.BAD_REQUEST Currently NOT used by Authorization SDK |
|
ERROR_SERVER_REPSONSE
AuthError.ERROR_CATEGORY.INTERNAL Server response data was incorrect |
|
ERROR_THREAD
AuthError.ERROR_CATEGORY.INTERNAL Failure due to thread usage |
|
ERROR_UNAUTHORIZED_CLIENT
AuthError.ERROR_CATEGORY.ACTION Server has indicated The authenticated client is not authorized to use this authorization grant type. |
|
ERROR_UNKNOWN
AuthError.ERROR_CATEGORY.UNKNOWN Unknown Exception |
|
ERROR_WEBVIEW_SSL
AuthError.ERROR_CATEGORY.ACTION Android OS is older than FROYO and an SSL error was seen on Sign-in. |
| Method Summary | |
|---|---|
AuthError.ERROR_CATEGORY |
getCategory()
|
static AuthError.ERROR_TYPE |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. |
static AuthError.ERROR_TYPE[] |
values()
Returns an array containing the constants of this enum type, in the order they are declared. |
| Methods inherited from class java.lang.Enum |
|---|
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Enum Constant Detail |
|---|
public static final AuthError.ERROR_TYPE ERROR_INVALID_TOKEN
AuthError.ERROR_CATEGORY.ACTION
Server has indicated an issue with the token/code parameters that were sent. If this Error is seen trigger indication for the user to sign-in again
public static final AuthError.ERROR_TYPE ERROR_INVALID_GRANT
AuthError.ERROR_CATEGORY.ACTION
Server has indicated the client is not authorized to use the requested grant(s). Local Authorization is invalidated. If this Error is seen trigger indication for the user to authorize again
public static final AuthError.ERROR_TYPE ERROR_INVALID_CLIENT
AuthError.ERROR_CATEGORY.ACTION
Server has indicated the client is invalid. If this Error is seen the developer should update their APIKey
public static final AuthError.ERROR_TYPE ERROR_INVALID_SCOPE
AuthError.ERROR_CATEGORY.ACTION
Server has indicated the current authorization does not have the requested scope. If this Error is seen trigger indication for the user to authorize again.
public static final AuthError.ERROR_TYPE ERROR_UNAUTHORIZED_CLIENT
AuthError.ERROR_CATEGORY.ACTION
Server has indicated The authenticated client is not authorized to use this authorization grant type.
public static final AuthError.ERROR_TYPE ERROR_WEBVIEW_SSL
AuthError.ERROR_CATEGORY.ACTION
Android OS is older than FROYO and an SSL error was seen on Sign-in. This means the WebView will not display this to the user so we want the info to propagate to the client
public static final AuthError.ERROR_TYPE ERROR_ACCESS_DENIED
AuthError.ERROR_CATEGORY.ACTION
Invalid API Key - See logs for more info
public static final AuthError.ERROR_TYPE ERROR_COM
AuthError.ERROR_CATEGORY.NETWORK
Unknown Exception with WebViewClient, ClientProtocolException with HTTPClient.execute
public static final AuthError.ERROR_TYPE ERROR_IO
AuthError.ERROR_CATEGORY.NETWORK
IOException on HttpClient.execute
public static final AuthError.ERROR_TYPE ERROR_UNKNOWN
AuthError.ERROR_CATEGORY.UNKNOWN
Unknown Exception
public static final AuthError.ERROR_TYPE ERROR_BAD_PARAM
AuthError.ERROR_CATEGORY.INTERNAL
Bad parameter used by SDK
public static final AuthError.ERROR_TYPE ERROR_JSON
AuthError.ERROR_CATEGORY.INTERNAL
JSONException when trying to create org.json.JSONObject from a server response (incorrect data or badly formatted json)
public static final AuthError.ERROR_TYPE ERROR_PARSE
AuthError.ERROR_CATEGORY.INTERNAL
Exception when trying to parse JSON response - typically when looking for an attribute in JSON that does not exist, but should
public static final AuthError.ERROR_TYPE ERROR_SERVER_REPSONSE
AuthError.ERROR_CATEGORY.INTERNAL
Server response data was incorrect
public static final AuthError.ERROR_TYPE ERROR_DATA_STORAGE
AuthError.ERROR_CATEGORY.INTERNAL
Failure while using data storage
public static final AuthError.ERROR_TYPE ERROR_THREAD
AuthError.ERROR_CATEGORY.INTERNAL
Failure due to thread usage
public static final AuthError.ERROR_TYPE ERROR_DCP_DMS
AuthError.ERROR_CATEGORY.ACTION
Currently NOT used by Authorization SDK
public static final AuthError.ERROR_TYPE ERROR_FORCE_UPDATE
AuthError.ERROR_CATEGORY.ACTION
Currently NOT used by Authorization SDK
public static final AuthError.ERROR_TYPE ERROR_REVOKE_AUTH
AuthError.ERROR_CATEGORY.INTERNAL
Currently NOT used by Authorization SDK
public static final AuthError.ERROR_TYPE ERROR_AUTH_DIALOG
AuthError.ERROR_CATEGORY.INTERNAL
Currently NOT used by Authorization SDK
public static final AuthError.ERROR_TYPE ERROR_BAD_API_PARAM
AuthError.ERROR_CATEGORY.BAD_REQUEST
Currently NOT used by Authorization SDK
public static final AuthError.ERROR_TYPE ERROR_INIT
AuthError.ERROR_CATEGORY.BAD_REQUEST
Currently NOT used by Authorization SDK
public static final AuthError.ERROR_TYPE ERROR_RESOURCES
AuthError.ERROR_CATEGORY.BAD_REQUEST
Currently NOT used by Authorization SDK
public static final AuthError.ERROR_TYPE ERROR_DIRECTED_ID_NOT_FOUND
AuthError.ERROR_CATEGORY.BAD_REQUEST
Currently NOT used by Authorization SDK
public static final AuthError.ERROR_TYPE ERROR_INVALID_API
AuthError.ERROR_CATEGORY.BAD_REQUEST
Currently NOT used by Authorization SDK
public static final AuthError.ERROR_TYPE ERROR_SECURITY
AuthError.ERROR_CATEGORY.BAD_REQUEST
Currently NOT used by Authorization SDK
| Method Detail |
|---|
public static AuthError.ERROR_TYPE[] values()
for (AuthError.ERROR_TYPE c : AuthError.ERROR_TYPE.values()) System.out.println(c);
public static AuthError.ERROR_TYPE valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.
java.lang.IllegalArgumentException
- if this enum type has no constant
with the specified name
java.lang.NullPointerException
- if the argument is nullpublic AuthError.ERROR_CATEGORY getCategory()
|
Copyright 2013 Amazon.com. All rights reserved. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |


Before Change
success = self.reduce_search_space(
reduction_thr=reduction_thr,
reduction_distance=reduction_distance)
if not success:
self.pruned_streamlines = None
self.transf_streamlines = None
self.transf_matrix = None
self.labels = []
// TODO replace with Streamlines
return Streamlines([]), Streamlines([]), Streamlines([])
if slr:
self.register_neighb_to_model(metric=slr_metric,
x0=slr_x0,
bounds=slr_bounds,
select_model=slr_select[0],
select_target=slr_select[1],
method=slr_method)
else:
self.transf_streamlines = self.neighb_streamlines
self.transf_matrix = np.eye(4)
self.prune_what_not_in_model(pruning_thr=pruning_thr,
pruning_distance=pruning_distance)
if self.verbose:
After Change
neighb_streamlines, neighb_indices = self._reduce_search_space(
reduction_thr=reduction_thr,
reduction_distance=reduction_distance)
if len(neighb_streamlines) == 0:
//self.pruned_streamlines = None
//self.transf_streamlines = None
//self.transf_matrix = None
//self.labels = []
// TODO replace with Streamlines
return Streamlines([]), [], Streamlines([])
if slr:
transf_streamlines = self._register_neighb_to_model(
model_bundle,
neighb_streamlines,
metric=slr_metric,
x0=slr_x0,
bounds=slr_bounds,
select_model=slr_select[0],
select_target=slr_select[1],
method=slr_method)
else:
transf_streamlines = neighb_streamlines
// transf_matrix = np.eye(4)


Orientation Test
The current device orientation is displayed below. It should *ALWAYS* be correct!
Orientation Not Supported!


SignUp|Login
Item 01
Preserved Chicken Slices Price : 20$ View Item Details
Item 02
Chicken Ham Price : 15$ View Item Details
Item 03
Fish Fillet Slices Price : 25$ View Item Details
Item 04
Fresh Chicken Strings (Cut) Price : 40$ View Item Details
Please provide accurate details as one of our Agents will reach you ASAP.....


Technical blog from Craig Russell.
This post details how to use Apple Shortcuts to build a lightweight journal to log events, which are timestamped and saved to Apple Notes.
Apple Shortcuts provide a way to automate and extend the functionality of apps on Apple devices. It’s like programming, except you don’t need a compiler, an app store or to deploy a website. It’s powerful, incredibly useful and a great tool to have in your toolbox. 🛠🧰
We can leverage an Apple Shortcut script which prompts the user for some details when it runs, and saves those details in a timestamped note in Apple Notes.
I wanted to have a way to quickly log when events happen, that would automatically be grouped by date.
I use this same system for a few things:
I’ve streamlined the process as much as I can for creating an event. It takes only two inputs and can be completed within a few seconds:
Events are saved in Apple Notes, in a folder called Journal. As they are saved in Apple Notes, it makes them accessible and searchable across all of my devices.
I wanted to group events by date, so a new note is created for each day which had an event recorded. If there are multiple events for a day they will be appended to the same file.
The shortcut itself is a set of script events which ask the user for text describing what happened, then ask the user for the date the event happened. With these two inputs, it will then check if a note already exists for that day.
For a link to the full shortcut, see “How You Can Use This” below
Apple Shortcuts
Apple Shortcuts
, and open the new Journal
shortcut. You need to choose the Folder for your journal in 2 places. (You need to do this even if you are already using the name “Journal”)If you’ve done it all correctly, whenever you run that shortcut you’ll be prompted for the event details, followed by the date. The created note will then be shown which is handy for adding further details, pasting in images etc…
💡 You can add the shortcut to your Home Screen for one-click triggering.
Go forth and journal ✍
Home


About IDLE
The project IDLE is aiming to provide the current availability of a location by showing a heat map of parking spaces, public facilities and restaurant. The IDLE demo project will operate checking availability of public facilities like benches through human body sensor, and book reservations for restaurant through app. It's also ready to be powered up by new 5G networks for more functions like checking parking spaces.


April 15, 2014
Your privacy is an important factor that Mozilla (that's us) considers in the development of each of our products and services. We are committed to being transparent and open. This Mozilla Privacy Policy explains generally how we receive information about you, and what we do with that information once we have it. You can also read our product privacy notices and FAQs to get more detail with respect to each of our products and services.
For us, "personal information" means information which identifies you, like your name or email address.
Any information that falls outside of this is "non-personal information."
If we store your personal information with information that is non-personal, we will consider the combination as personal information. If we remove all personal information from a set of data then the remaining is non-personal information.
We learn information about you when:
you give it to us directly (e.g., when you choose to send us crash reports);
we collect it automatically through our products and services (e.g., when your Firefox browser checks with us to see if is up to date);
someone else tells us information about you (e.g., when Thunderbird works with your email providers to set up your account); or
when we try and understand more about you based on information you've given to us (e.g., when we use your IP address to customize language for some of our services).
When you give us information, we will use it in the ways for which you've given us permission. Generally, we use your information to help us provide and improve our products and services for you.
When we have asked and received your permission to share it.
For processing or providing products and services to you, but only if those entities receiving your information are contractually obligated to handle the data in ways that are approved by Mozilla.
When we are fulfilling our . We sometimes release information to make our products better and foster an open web, but when we do so, we will remove your personal information and try to disclose it in a way that minimizes the risk of you being re-identified.
mission of being open
When the law requires it. We follow the law whenever we receive requests about you from a government or related to a lawsuit. We'll notify you when we're asked to hand over your personal information in this way unless we're legally prohibited from doing so. When we receive requests like this, we'll only release your personal information if we have a good faith belief that the law requires us to do so. Nothing in this policy is intended to limit any legal defenses or objections that you may have to a third party's request to disclose your information.
When we believe it is necessary to prevent harm to you or someone else. We will only share your information in this way if we have a good faith belief that it is reasonably necessary to protect the rights, property or safety of you, our other users, Mozilla or the public.
If our organizational structure or status changes (if we undergo a restructuring, are acquired, or go bankrupt) we may pass your information to a successor or affiliate.
We are committed to protecting your personal information once we have it. We implement physical, business and technical security measures. Despite our efforts, if we learn of a security breach, we'll notify you so that you can take appropriate protective steps.
We also don't want your personal information for any longer than we need it, so we only keep it long enough to do what we collected it for. Once we don't need it, we take steps to destroy it unless we are required by law to keep it longer.
We're a global organization and our computers are in several different places around the world. We also use service providers whose computers may also be in various countries. This means that your information might end up on one of those computers in another country, and that country may have a different level of data protection regulation than yours. By giving us information, you consent to this kind of transfer of your information. No matter what country your information is in, we comply with applicable law and will also abide by the commitments we make in this privacy policy.
If you are under 13, we don't want your personal information, and you must not provide it to us. If you are a parent and believe that your child who is under 13 has provided us with personal information, please to have your child's information removed.
We may need to change this policy and our notices. The updates will be posted online. If the changes are substantive, we will announce the update through Mozilla's usual channels for such announcements such as blog posts and forums. Your continued use of the product or service after the effective date of such changes constitutes your acceptance of such changes. To make your review more convenient, we will post an effective date at the top of the page.
If you want to make a correction to your information, or you have any questions about our privacy policies, please get in touch with:
Legal Notices - Privacy
Mozilla is an open source project with a mission to improve your Internet experience. This is a driving force behind our data privacy practices.
We created short and clear Privacy Notices to describe how each of our products and services receives, shares, and uses data and what your choices are. Learn more:
Mozilla Websites, Communications & Cookies
Firefox Browser
Firefox + Cliqz
Firefox Cloud Services
Firefox Marketplace
Firefox Focus
Thunderbird
To review and comment on proposed changes to our privacy policies .
If you want to make a correction to your information, or you have any questions about our privacy policies, please get in touch with: Mozilla Corporation Attn: Legal Notices - Privacy 2 Harrison St, San Francisco, CA 94105


| Methods |
public
|
__construct(ViewCompiler $compiler)
Compiler constructor.
|
#
|
public
|
compile(string $content): string
Compile statements.
|
#
|
protected
|
compileEscapedEchos(string $content): string
Parse through the content and attempt to find excaped echo identifiers.
Parse through the content and attempt to find excaped echo identifiers.
|
#
|
protected
|
compileStandardEchos(string $content): string
Parse through the content and attempt to find echo identifiers.
Parse through the content and attempt to find echo identifiers.
|
#
|
protected
|
processStandardEchos(array $token): string
Attempt to process the echo and replace it.
Attempt to process the echo and replace it.
|
#
|
protected
|
processEscapedEchos(array $token): string
Attempt to process the echo and replace it.
Attempt to process the echo and replace it.
|
#
|
protected
|
rebuildEchoFunctions(array $token): string
Attempt to process the echo rebuild the function.
Attempt to process the echo rebuild the function.
|
#
|
protected
|
rebuildParameters(string $parameters): array
Extract the parameters between () and wrap them.
Extract the parameters between () and wrap them.
|
#
|
protected
|
prependNamespace(string $class): string
Append namespace if we have a facade.
Append namespace if we have a facade.
|
#
|
protected
|
isRealString(string $param): bool
Check if the string is really a string
Check if the string is really a string
|
#
|


Sensex jumps to 40,573; Nifty tests 11,950
The 30-share Sensex was trading 213.78 points, or 0.53 per cent, higher at 40,573.19.
by PTIMumbai: Market benchmark BSE Sensex jumped over 200 points in early trade on Monday tracking gains in index-heavyweights Infosys, Reliance Industries and Bharti Airtel amid positive cues from global equities.
The 30-share index was trading 213.78 points, or 0.53 per cent, higher at 40,573.19. Similarly, the broader Nifty rose 57.65 points, or 0.48 per cent, to 11,972.05.
Top gainers in the Sensex pack included Tata Steel which rose up to 2.48 per cent, Bharti Airtel 2.30 per cent, Infosys 1.33 per cent, Sun Pharma 1.55 per cent, Vedanta 1.27 per cent and RIL 0.82 per cent.
On the other hand, Bajaj Auto fell up to 0.76 per cent, ICICI Bank 0.75 per cent, HCL Tech 0.70 per cent, Asian Paints 0.59 per cent and ONGC slipped 0.60 per cent.
On Friday, the Sensex ended 215.76 points, or 0.53 per cent, lower at 40,359.41. The Nifty settled 54 points, or 0.45 per cent, down at 11,914.40.
Foreign institutional investors bought shares worth Rs 305.72 crore in the capital market in the previous session, while domestic institutional investors sold equities worth Rs 177.37 crore, data available with stock exchange showed.
Elsewhere in Asia, bourses in Shanghai, Hong Kong, Seoul and Tokyo were trading on a positive note.
On the currency front, the rupee depreciated marginally against the US dollar to trade at 71.72 in early session.
Brent futures, the global oil benchmark, rose 0.21 per cent to USD 63.52 per barrel.


Wilbert:
Let's start then! First, give me 1 Spirit Bead. Now pick any card you want from this box. You know the rules, right?
When you're ready, go ahead and draw a card.
Draw a card.


ND – Sen. John Hoeven (R) and Sen. Kevin Cramer (R)
Committees
John Hoeven is the #9 Republican on the Senate Energy Subcommittee on Energy
John Hoeven is the #9 Republican on the Senate Committee on Appropriations
John Hoeven is the #7 Republican on the Senate Appropriations Subcommittee on Energy and Water Development
John Hoeven is the #11 Republican on the Senate Committee on Energy and Natural Resources
HEP Grants
This state received no SC HEP grants from 2012-2020
SC Contracts
This state received no SC contracts from 2012-2020
NSF MPS Grants
In the past 9 years, this state has received: 28 NSF MPS grants, totalling $6,578,682
Year Institution Amount ($)
------ ----------------------------- ------------
2019 North Dakota State University 171,528
2019 University Of North Dakota 469,669
2018 North Dakota State University 930,030
2018 University Of North Dakota 330,000
2017 University Of North Dakota 572,940
2016 North Dakota State University 263,718
2016 University Of North Dakota 2,817
2015 North Dakota State U Fargo 475,523
2015 North Dakota State University 131,693
2015 University Of North Dakota 270,000
2014 North Dakota State University 771,465
2014 University Of North Dakota 291,599
2013 North Dakota State University 540,000
2013 University Of North Dakota 119,051
2012 North Dakota State University 938,649
2012 University Of North Dakota 300,000
SULI/CCI Interns
From 2014-2018, this state had 4 SULI/CCI interns
# Interns Program College
----------- --------- -----------------------------------------
2 SULI North Dakota State University Main Campus
1 SULI University of North Dakota
1 SULI Williston State College
4 — — Back to top
ND-00 – Rep. Kelly Armstrong (R) – Wikipedia
HEP Grants
This district received no SC HEP grants from 2012-2020
SC Contracts
This district received no SC contracts from 2012-2020
NSF MPS Grants
In the past 9 years, this district has received: $6,578,682 in NSF MPS grants.
Year Institution Amount ($)
------ ----------------------------- ------------
2019 North Dakota State University 171,528
2019 University Of North Dakota 469,669
2018 North Dakota State University 930,030
2018 University Of North Dakota 330,000
2017 University Of North Dakota 572,940
2016 North Dakota State University 263,718
2016 University Of North Dakota 2,817
2015 North Dakota State U Fargo 475,523
2015 North Dakota State University 131,693
2015 University Of North Dakota 270,000
2014 North Dakota State University 771,465
2014 University Of North Dakota 291,599
2013 North Dakota State University 540,000
2013 University Of North Dakota 119,051
2012 North Dakota State University 938,649
2012 University Of North Dakota 300,000
SULI/CCI Interns
From 2014-2018, this district had 4 SULI/CCI interns
Term Name College Host Lab Program
----------- --------------------- ----------------------------------------- ------------------------------------ ---------
Summer 2018 Dylan Wald North Dakota State University Main Campus National Renewable Energy Laboratory SULI
Summer 2017 John Krishnan Myjak University of North Dakota Argonne National Laboratory SULI
Fall 2017 Meghan Ashley Taunton Williston State College National Renewable Energy Laboratory SULI
Fall 2015 Loren James Anderson North Dakota State University Main Campus Los Alamos National Laboratory SULI


Photography
All the background images on this site are my own work. I have taken over 20,000 photos in the past 5 years. Currently I have 6 Canon camera's and of course the an iPhone camera. My primary camera's are: Canon EOS-7D for digital, Canon EOS-3 for film and Canon Powershot D20 underwater camera for getting wet.
Putting together an album by "hand" and generating thumbnail images without the help of php is a pain. So for this final project I'm going to reuse my YouBot images. These images were taken by me at Automatica 2012 in Munich, Germany. The rights have since been given to The Youbot Store and National Intruments
Outdoor Activities
I could keep some sort of blog here... As long as I could update it via twitter automatically.