models.nn package¶
Submodules¶
models.nn.gat module¶
-
class
models.nn.gat.
GraphAttentionLayer
(in_features, out_features, dropout, alpha, concat=True)[source]¶ Bases:
torch.nn.modules.module.Module
Simple GAT layer, similar to https://arxiv.org/abs/1710.10903
-
forward
(input, adj)[source]¶ Defines the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Module
instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
-
-
class
models.nn.gat.
PetarVGAT
(nfeat, nhid, nclass, dropout, alpha, nheads)[source]¶ Bases:
models.base_model.BaseModel
-
forward
(x, adj)[source]¶ Defines the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Module
instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
-
-
class
models.nn.gat.
PetarVSpGAT
(nfeat, nhid, nclass, dropout, alpha, nheads)[source]¶ Bases:
models.nn.gat.PetarVGAT
-
forward
(x, adj)[source]¶ Defines the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Module
instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
-
-
class
models.nn.gat.
SpGraphAttentionLayer
(in_features, out_features, dropout, alpha, concat=True)[source]¶ Bases:
torch.nn.modules.module.Module
Sparse version GAT layer, similar to https://arxiv.org/abs/1710.10903
-
forward
(input, edge)[source]¶ Defines the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Module
instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
-
-
class
models.nn.gat.
SpecialSpmm
[source]¶ Bases:
torch.nn.modules.module.Module
-
forward
(indices, values, shape, b)[source]¶ Defines the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Module
instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
-
-
class
models.nn.gat.
SpecialSpmmFunction
[source]¶ Bases:
torch.autograd.function.Function
Special function for only sparse region backpropataion layer.
-
static
backward
(ctx, grad_output)[source]¶ Defines a formula for differentiating the operation.
This function is to be overridden by all subclasses.
It must accept a context
ctx
as the first argument, followed by as many outputs didforward()
return, and it should return as many tensors, as there were inputs toforward()
. Each argument is the gradient w.r.t the given output, and each returned value should be the gradient w.r.t. the corresponding input.The context can be used to retrieve tensors saved during the forward pass. It also has an attribute
ctx.needs_input_grad
as a tuple of booleans representing whether each input needs gradient. E.g.,backward()
will havectx.needs_input_grad[0] = True
if the first input toforward()
needs gradient computated w.r.t. the output.
-
static
forward
(ctx, indices, values, shape, b)[source]¶ Performs the operation.
This function is to be overridden by all subclasses.
It must accept a context ctx as the first argument, followed by any number of arguments (tensors or other types).
The context can be used to store tensors that can be then retrieved during the backward pass.
-
static
models.nn.gcn module¶
-
class
models.nn.gcn.
GraphConvolution
(in_features, out_features, bias=True)[source]¶ Bases:
torch.nn.modules.module.Module
Simple GCN layer, similar to https://arxiv.org/abs/1609.02907
-
forward
(input, edge_index)[source]¶ Defines the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Module
instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
-
-
class
models.nn.gcn.
TKipfGCN
(nfeat, nhid, nclass, dropout)[source]¶ Bases:
models.base_model.BaseModel
-
forward
(x, adj)[source]¶ Defines the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Module
instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
-
models.nn.graphsage module¶
-
class
models.nn.graphsage.
Graphsage
(num_features, num_classes, hidden_size, num_layers, sample_size, dropout)[source]¶ Bases:
models.base_model.BaseModel
-
forward
(x, edge_index)[source]¶ Defines the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Module
instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
-
models.nn.mlp module¶
-
class
models.nn.mlp.
MLP
(num_features, num_classes, hidden_size, num_layers, dropout)[source]¶ Bases:
models.base_model.BaseModel
-
forward
(x, edge_index)[source]¶ Defines the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Module
instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
-


HOW TO JOIN
APPLY ONLINE
Interior designers, architects, garden designers, stylists, and product designers with at least 2 years of industry experience are invited to apply. It only takes you about 10 minutes.
ZHUYI EVALUATION
Zhuyi is committed to quality. We only select the best designers to join our platform. Our experienced team of recruiters will read each and every submission carefully.
 Additionally, our designers service team will available for your use.


Machine Learning: Log
Day-by-day notes as I study machine learning.
Todo
- Read: http://karpathy.github.io/2015/05/21/rnn-effectiveness/
96. 2019-01-04
Followed deeplearning.ai course to implement the following from scratch in Numpy:
- Recurrent Neural Network
- LSTM
- character-level language model to generate fake dinosaur names
- LSTM to generate Jazz music
95. 2019-01-03
HAPPY NEW YEAR!
LSTM implementation:
- To warm up I worked through the lectures on Recurrent Neural Networks from Andrew Ng’s deeplearning.ai
Maths Practice: - Linear Algebra Lemma
94. Xmas paper reading:
Next I’d like to implement a paper based upon recurrent neural network architectures. I’ve used Goodfellow’s Deep Learning textbook to get acquainted with the subject. After scouting around the literature I end up reading the following papers.
LSTM: A Search Space Odyssey, (Greff, Schmidhuber et al, 2017)
An empirical comparison of various incarnations of the LSTM that have appeared in the literature including the gated-recurrent-unit (GRU). Schmidhuber is widely credited as being the original inventor of the ‘vanilla’ LSTM. This paper provides clarification on the performance differences between the LSTM and GRU as well as other common variants. Includes a novel use of the Random Forest algorithm to assess the significance of hyper-parameters which is neat.
Regularizing and Optimizing LSTM Language Models, (Merity et al, 2017):
Results from this paper paper are used as benchmarks by several state-of-the-art results in NLP. It describes an LSTM setup with batch normalisation and a particular optimisation setup produce significant improvement over vanilla LSTM,
Universal Language Model Fine-tuning for Text Classification (Howard, Ruder, 2018)
The first (I think) paper to successfully describe the use of transfer-learning in NLP, known as ULMFit. Achieved SoTA before being superseded by ELMO and BERT. References the Merity paper as benchmark.
Sim-to-Real via Sim-to-Sim: Data-efficient Robotic Grasping via Randomized-to-Canonical Adaptation Networks (James et al, 2018)
Not an LSTM paper, but I couldn’t resist. This paper combines a generative adversarial network with a DQN reinforcement learning algorithm to achieve SoTA in robotic arm control. Reinforcement learning algorithms can perform well when trained on ‘canonical’ images from a simulated environment with consistent lighting, textures and physics, but this performance doesn’t translate to real world environments. This is known as the simulation-to-reality gap. This paper offers a novel solution by using a GAN to translate images from a randomised simulation to their canonical equivalents. It is then shown that this same GAN can be used to translate real world images to their canonical equivalent, meaning that the DQN algorithm only has to work with canonical representations and that the model can be trained on simulation data which is much cheaper to get.
The authors achieve 91% grasp success by training on simulate data then 5,000 real examples (compared with 580,000 real examples for current SoTA). In a way, you could think of this as another example of transfer-learning in that the model is first trained broadly on simulated data before being fine-tuned on a few specific examples, real world in this case.
93. 2018-12-19
Deep Learning: Resnet Paper Implementation in PyTorch - Write up results and conclusions - Publish on github - First paper implementation complete!
92. 2018-12-18
Deep Learning: Resnet Paper Implementation in PyTorch - Write up results and conclusions
LSTM implementation: - In preparation I read though the appropriate chapter in Goodfellow and Bengio’s Deep Learning textbook: “Sequence Modelling: Recurrent and Recursive Nets”
92. 2018-12-17
Deep Learning: Resnet Paper Implementation in PyTorch - Discovered crucial tweak, adding batch norm averaging (track_running_stats=True in PyTorch). - This implementation reproduces the original paper’s observations within less than 1% of the reported test error.
92. 2018-12-14
Deep Learning: Resnet Paper Implementation in PyTorch - Check original authors implementation. Unfortunately the CIFAR-10 model is not provided, so I’m looking at the model from the papers ImageNet experiment. I notice that bias is implemented in batch norm layer, and find authors clarification on that here - I started writing up results at this stage so you can see results for this version of implementation here.
91. 2018-12-13
Deep Learning: Resnet Paper Implementation in PyTorch - My implementation is producing a test error approximately 1% higher for the plain network baselines and a 2% increase for the residual nets. I’m missing something but not sure what… - I have a hunch that batch normalisation setup could be the cause of discrepancy, because from playing around with my implementation I notice that the configuration of batch normalisation can have a dramatic effect on results. - Review of batch normalisation theory. These lectures from Andrew Ng’s deeplearning course prove useful: - https://www.youtube.com/watch?v=em6dfRxYkYU&t=7s - https://www.youtube.com/watch?v=nUUqwaxLnWs - https://www.youtube.com/watch?v=5qefnAek8OA
90. 2018-12-12
Deep Learning: Resnet Paper Implementation in PyTorch
89. 2018-12-11
Deep Learning: Resnet Paper Implementation in PyTorch - Implement test set evaluation in training loop - Run plain net baseline training for each network size and record results
88. 2018-12-10
Deep Learning: Resnet Paper Implementation in PyTorch
Maths Practice: - Linear Algebra Lemma
87. 2018-12-07
Deep Learning: Resnet Paper Implementation in PyTorch
- Implemented “plain network” – deep neaural net withoout shortcuts – as baseline described in paper
- Implemented learning loop
86. 2018-12-06
Deep Learning: Resnet Paper Implementation in PyTorch
- Studied original resnet paper
- Implemented loading and augmentation of CIFAR 10 dataset per paper in PyTorch
85. 2018-12-05
Deep Learning:
84. 2018-12-04
Deep Learning:
- CS231n: Module 2: Convolutional Neural Networks Includesa good summary of literature on ResNets which could be useful later
- Andrew Ng interviews Andrej Karpathy Noted here that Karpathy reccomends implementing networks from scratch without framework
- Deep Learning with PyTorch: A 60 Minute Blitz
83. 2018-12-03
Deep Learning:
- Human Protein Atlas Image Classification Kaggle: Classifying sub-cellular protein patterns in human cells:
- documented work so far for collaborator
- discussed possible next steps and ways forward
82. 2018-11-29
Deep Learning: - Fast.ai Lesson 6 – RNNs: Interpreting embeddings; RNNs from scratch - Fast.ai Lesson 7 – CNN Architecture: Resnets from scratch
80. 2018-11-28
Deep Learning: - Fast.ai Lesson 5 – NLP: Collaborative filtering; Inside the training loop - Human Protein Atlas Image Classification Kaggle: Classifying sub-cellular protein patterns in human cells: - Leaderboard Score: 0.474 (Top 10% of 1200) - developed training loop to get a good baseline - implemented data processing scripts
79. 2018-11-27
- Human Protein Atlas Image Classification Kaggle: Classifying sub-cellular protein patterns in human cells:
- preprocessing
- setup pipeline
- initial model
78. 2018-11-26
Deep Learning: - Fast.ai Lesson 4 – Embeddings: Structured, time series, & language models - Fast.ai Lesson 3 – Overfitting: Improving your image classifier
Maths Practice: - Linear Algebra Lemma
77. 2018-11-23
Deep Learning: - Plant Seedlings Kaggle: Determining the species of a seedling from an image: - Leaderboard Score: 0.97858 (Top 18% of 836) - Feature engineering - Data augmentation from scratch
- Fast.ai Lesson 2 – CNNs: Convolutional neural networks applied
Maths Practice:
- Linear Algebra Lemma
76. 2018-11-22
Deep Learning:
- Plant Seedlings Kaggle: Determining the species of a seedling from an image:
- Baseline implementation achieves Leaderboard Score: 0.96473 (96.4% accuracy)
- Hyperparemeter tuning
- training pipeline optimisation
Maths Practice:
- Linear Algebra Lemma
75. 2018-11-21
Deep Learning:
- Fast.ai Lesson 1 – CNNs: Recognizing cats and dogs
- Plant Seedlings Kaggle:
- Setup a pipeline for classifying 14 species of plants from images of seedlings
- Data exploration
Maths Practice:
- Linear Algebra Lemma
74. 2018-11-20
Deep learning:
- Setup a remote GPU server optimised for deep learning
Maths practice:
- Linear algebra revision: Lemma 1.1 Introduction
- Probability: I watched first few lectures from Mathmonk, but didn’t find it very engaging so don’t think I’l pursue that course
73. 2018-11-19
Met with study partner and planned curriculumn for studying deep learning.
Set goal: - To implement in code 4-5 research papers that describe important concepts in deep-learning.
Decided to: - Complete part 1 of fast.ai mooc as an introduction to deep learning - Learn PyTorch - Start by implementing papers that describe concepts like Reccurrent Neural Netowrks (RNNs), and LSTMs
72. 2018-11-09
Introduction to Statistical Learning: ch9: Support Vector Machines Conceptual:
- numpy implementation of maximal margin classifier
- linear and non-linear decisin boundaries
- Notebook: Support Vector Machines – Conceptual
71. 2018-11-08
Introduction to Statistical Learning: ch9: Support Vector Machines Applied:
- SVM in context of minimal linear seperation
- Application of SVM to real datasets
- reducing training time, preprocessing for SVM
- Notebook: Support Vector Machines – Applied
70. 2018-11-07
Introduction to Statistical Learning: ch9: Support Vector Machines Applied:
- dataset simulation
- SVM kernel selection
- Notebook: Support Vector Machines – Applied
69. 2018-11-06
Introduction to Statistical Learning: ch9: Support Vector Machines Labs:
- Tuning support vector machines
- ROC curves
- Multi-class SVM
- Notebook: Support Vector Machines – Labs
68. 2018-10-30
Day 2: Predicting and preventing bursts - Data Hackathon (South East Water)
- Debugged our preprocessing pipeline
- Fit a model and achieved some pretty exciting results
- Presented our results and earned a special mention
- Check our slides here
67. 2018-10-29
Day 1: Predicting and preventing bursts - Data Hackathon (South East Water)
I entered this data science competition along with my study partner.
- Started with some initital data exploration. Easily the largest dataset I’ve come across yet with 3 billion observations.
- Identified a Goal: To help the South East Water team understand:
- Will there be a burst tomorrow?
- If so, where?
- Designed an initial feature set with 10-day lag variables for flow by geographic area
- Set about pre-processing
- Hit some scale issues to work around
- Lef pre-processing running over night
66. 2018-10-23
Introduction to Statistical Learning: ch8: Tree-Based Methods Applied:
- Comparison of tree based methods with KNN, regression and the lasso.
- Notebook: ch8_tree_based_methods_applied.ipynbb
65. 2018-10-22
Introduction to Statistical Learning: ch8: Tree-Based Methods Applied:
- Application of tree based methods – including Tree Pruning, Bagging, Random Forest, Boosting – to various datasets
- Notebook: ch8_tree_based_methods_applied.ipynbb
64. 2018-10-19
Introduction to Statistical Learning: ch8: Tree-Based Methods Labs:
- Review of tree based methods including Tree Pruning, Bagging, Random Forest, Boosting
- Notebook: ch8_tree_based_methods_labs.ipynb
63. 2018-10-18
Introduction to Statistical Learning: ch7: Moving Beyond Linearity Applied:
62. 2018-10-17
Introduction to Statistical Learning: ch7: Moving Beyond Linearity Applied:
- GAMs
- implemented backfitting algorithm from scratch
- comparison of backfitting and multivariate OLS in simulated setting
- Notebook: ch7_moving_beyond_linearity_applied.ipynb
61. 2018-10-16
Introduction to Statistical Learning: ch7: Moving Beyond Linearity Applied:
- Analysis of Variance (ANOVA)
- Comparison of Anova with Cross-validation for model selection
- polynomial regression
- step function regression
- cubic spline regression
- natural spline regression
- Notebook: ch7_moving_beyond_linearity_applied.ipynb
60. 2018-10-15
Introduction to Statistical Learning: ch7: Moving Beyond Linearity Lab:
- Ch7 Lab
- univariate polynomial regression
- analytic confidence intervals
- bootstrapped confidence intervals
- comparison of splines in univariate setting
- comparison of GAM configurations with ANOVA
- Notebook: ch7_moving_beyond_linearity_labs.ipynb
59. 2018-10-12
Introduction to Statistical Learning: ch6: Linear Model Selection and Regularization Applied:
- Analysis to compare linear models
- Ch7 Reading
- Notebook: ch6_linear_model_selection_and_regularisation_applied.ipynb
58. 2018-10-11
Introduction to Statistical Learning: ch6: Linear Model Selection and Regularization Applied:
- detailed comparison of model selection techniques in context real dataset to predict the number of applications received by U.S. colleges. Techniques considered:
- lasso
- ridge regression
- backward stepwise
- PCR
- PLS
- Notebook: ch6_linear_model_selection_and_regularisation_applied.ipynb
57. 2018-10-11
Introduction to Statistical Learning: ch6: Linear Model Selection and Regularization Applied:
- Detailed comparison of model selection techniques in a simulated setting. Techniques considered:
- lasso
- ridge regression
- backward stepwise
- PCR
- PLS
- Notebook: ch6_linear_model_selection_and_regularisation_applied.ipynb
56. 2018-10-10
Completed Introduction to Statistical Learning: ch6: Linear Model Selection and Regularization Labs:
- implemented principle components analysis
- implemented principle components regression
- implemented partial least squares
- comparison of principle components regression partial least squares in predicting salaries of baseball players
- Notebook: ch6_linear_model_selection_and_regularisation_labs.ipynb
55. 2018-10-09
Working through Introduction to Statistical Learning: ch6: Linear Model Selection and Regularization Labs:
- implemented backward stepwise selection from scratch
- compared results from best subset, backward stepwise and forward stepwise selection using cross validation
- implemented k-fold cross validation from scratch
- completed Lab 1
- Lab 2: comparison of ridge regression and the lasso with k-fold cross validation
- Notebook: ch6_linear_model_selection_and_regularisation_labs.ipynb
54. 2018-10-08
Read an Introduction to Statistical Learning: ch7: Moving Beyond Linearity.
Working through chapter 6 Lab 1: Subset Selection Methods:
- implemented best subset selection from scratch
- implemented forward stepwise selection from scratch
- Notebook: ch6_linear_model_selection_and_regularisation_labs.ipynb
53. 2018-09-28
ISL considers ridge regression and the Lasso from both the frequentist and the bayesian perspectives. Although ISL has introduced bayesian statistics and some probability theory, there is clearly much more to this subject.
Researched: what are the best resources for learning probability theory in more depth?
- Probability Theory: The Logic of Science
- Lectures: https://www.youtube.com/user/elfpower/videos
- Book: https://books.google.co.uk/books/about/Probability_Theory.html?id=tTN4HuUNXjgC&source=kp_book_description&redir_esc=y
- Statistical Rethinking
- Lectures: https://www.youtube.com/playlist?list=PLDcUM9US4XdM9_N6XUUFrhghGJ4K25bFc
- Book: https://www.amazon.com/Statistical-Rethinking-Bayesian-Examples-Chapman/dp/1482253445
- Recommendation: https://www.reddit.com/r/statistics/comments/85hxgt/bayesian_statistics_courserecommendation/
52. 2018-09-27
An Introduction to Statistical Learning: ch6: Linear Model Selection and Regularization.
Completed conceptual exercises:
- best subset, forward stepwise, backward stepwise selection
- the lasso and ridge regression
- coefficient penalties
- Notebook: ch6_linear_model_selection_and_regularisation_conceptual.ipynb
51. 2018-09-26
Revision day. Met with study partner and reviewed our solutions to all exercises from chapters 3-5 of An Introduction to Statistical Learning. Discussed and compared intuitions.
50. 2018-09-25
Read ISL ch5: Linear Model Selection and Regularization.
49. 2018-09-20
An Introduction to Statistical Learning: ch5: Resampling Methods.
Working through applied exercises:My notebook
- implemented LOOCV from scratch
- dataset simulation
- compared bias variance trade-offs of validation approaches
- bootstrap advanced applications
48. 2018-09-19
An Introduction to Statistical Learning: ch5: Resampling Methods.
Working through applied exercises: My notebook
- estimating test error
- validation sets
- implemented bootstrap from scratch
- bootstrap (to estimate standard errors for logistic regression)
47. 2018-09-18
An Introduction to Statistical Learning: ch5: Resampling Methods.
Completed conceptual exercises: My notebook
- probability theory review
- probability theory and the bootstrap sampling technique
- k-fold cross validation
- comparison of validation approaches
46. 2018-09-17
Studied Introduction to Statistical Learning: ch5: Resampling Methods.
45. 2018-09-16
An Introduction to Statistical Learning: ch4: Classification.
Completed applied exercises: My notebook
- Logistic regression to classify automobiles by fuel efficiency
- Linear discriminant analysis (LDA)
- Quadratic discriminant analysis (QDA)
- K-nearest neighbour
- Comparison of methods
- log transforms
44. 2018-09-15
An Introduction to Statistical Learning: ch4: Classification.
Working through applied exercises: My notebook
- Logistic regression to predict stock returns
- Confusion matrix
- Logistic regression statistics, false positive, true negatives etc.
43. 2018-09-14
An Introduction to Statistical Learning: ch4: Classification.
Completed conceptual exercises: My notebook
- simplification of cost function for logistic regression
- bayes classifier
- proof that babes classifier is not linear for Quadratic Discriminant Analysis
- demonstration of curse of dimensionality for KNN
- Comparison of LDA and QDA
- Bayes theorem
- odds
42. 2018-09-13
An Introduction to Statistical Learning: ch3: Linear Regression.
Completed applied exercises:
41. 2018-09-12
An Introduction to Statistical Learning: ch3: Linear Regression.
Working through applied exercises:
40. 2018-09-10
An Introduction to Statistical Learning: ch3: Linear Regression.
Working through applied exercises:
39. 2018-09-8
An Introduction to Statistical Learning: ch3: Linear Regression.
Working through applied exercises:
38. 2018-09-07
Working on practical exercises from chapter 3 of An Introduction to Statistical Learning. My notebook.
- implemented several key statistics from scratch to bolster my understanding
- emulated R’s powerful lm().plot() functionality in python, it wasn’t available
Thoughts:
I’m suprised how much work I had to do to emulate R’s lm().plot() functionality. The resultant plots seem really useful, particularly as they provide insight for multivariate models, and anomaly detection in that context. Perhaps worth a blog post to see if useful to others?
37. 2018-09-06
Completed exercises on conceptual topics from chapter 3 of An Introduction to Statistical Learning. My notebook.
Thoughts:
I’ve noticed that there are different mathematical approaches to linear regression. Hastie and Tibshirani’s notation includes a lot of summations, perhaps to avoid linear algebra being pre-requisite, but I find the vectorised forms more intuitive.
36. 2018-09-05
Study Linear Regression, chapter 3 of An Introduction to Statistical Learning.
- Multiple Linear Regression
- Qualitative predictors
- Extensions of the linear model
- Potential problems
- Non-parametric regression: KNN regression
Thoughts:
Picked up some ideas on how to improve my House Prices kaggle submission, including:
- Interaction variables p89
- Outlier detection by residual plots p97
Had an idea for project using cluster analysis / unsupervised methods for classification of head impact during sport. I’ve ordered a 9-DOF sensor to hook up to my arduino and gather some data.
35. 2018-09-03
Study Linear Regression, chapter 3 of An Introduction to Statistical Learning.
- Simple Linear Regression
- Multiple Linear Regression
Cross referenced with Stanford CS229 lecture 2 and Murphy’s Machine Learning: A Probabilistic Perspective.
34. 2018-09-02
Today I did the applied exercises from chapter 2 of ISL. Here’s my notebook. Good exercise in preprocessing and exploration of datasets, sharpening up in Pandas and Matplotlib / Seaborn.
33. 2018-09-01
- Read chapters 1 & 2 of An Introduction to Statistical Learning (ISL)
- Completed conceptual exercises from book
33. 2018-08-31
Next up a tour of supervised learning techniques. I’ve decided to take the Stanford course on Statistical Learning by Trevor Hastie and Robert Tibshirani. My worfklow for each chapter will be:
- Watch video lectures and complete online quizzes
- Review chapter in the accompanying textbook An Introduction to Statistical Learning, to get more detail
- Complete exercises from book
Today I completed the video lectures for chapters 1 sand 2.
32. 2018-08-28
Kaggle Competition – House Prices: Advanced Regression Techniques
- implemented Lasso regularisation model to gain 400 places in leaderboard
- met with study buddy to compare notes and revise
- revised regularisation and discussed learnings from Kaggle progress so far
| Leaderboard Results | Description | CV | Public Score | Position |
|---|---|---|---|---|
| v1 | Basic LinReg & feature engineering | 0.14698 | 0.13500 | 1825/4394 |
| v2 | Feature normalisation | 0.13360 | 0.13170 | ▲ 1610/4394 |
| v3 | Outlier anomaly detection | 0.11436 | 0.13227 | ▼ |
| v6 | Lasso | 0.12059 | 0.12361 | ▲ 1182/4394 |
Thoughts:
This Kaggle competition has been excellent opportunity to learn about the more practical aspects of machine learning beyond algorithms. Feature engineering and Cross-validation have stuck out as important areas that are not well covered by theoretical study.
I feel like I’ve taken my Kaggle score as far as I can using a simple linear model and feature engineering. Next I’m going to learn about more advanced models and techniques.
See my notebook here
31. 2018-08-27
Kaggle Competition – House Prices: Advanced Regression Techniques
Today I looked at improving my results by removing anomalies from my training set. My hypothesis was that removing anomalies would allow my model to better fit the majority of data, at the cost of a worst fit for anomalies. My assumption here was that the error in fitting anomalies would be outweighed by better fit for majority of datapoints.
- reviewed fundamental statistical measures such as Kurtosis
- learned about Dbscan and Isolation Forest techniques for anomaly detection in high-dimensional settings, a useful reference here.
- reviewed Sklearn documentation and user guides on Isolation Forest
- Implemented Isolation Forest
- Observed over-fitting improvement but no measurable improvement on test data – highlighting the importance of a good CV :(
| Leaderboard Results | Description | CV | Public Score | Position |
|---|---|---|---|---|
| v1 | Basic LinReg & feature engineering | 0.14698 | 0.13500 | 1825/4394 |
| v2 | Feature normalisation | 0.13360 | 0.13170 | ▲ 1610/4394 |
| v3 | Outlier anomaly detection | 0.11436 | 0.13227 | ▼ |
See my notebook here
30. 2018-08-26
Kaggle Competition – House Prices: Advanced Regression Techniques
Today I focused on minimising exponential characteristics in to make relationships in the dataset more linear. This allows my simple linear model to fit with reduced error. This jumped me 200 places in the leaderboard.
| Leaderboard Results | Description | CV | Public Score | Position |
|---|---|---|---|---|
| v1 | Basic LinReg & feature engineering | 0.14698 | 0.13500 | 1825/4394 |
| v2 | Feature normalisation | 0.13360 | 0.13170 | ▲ 1610/4394 |
See my notebook here
29. 2018-08-25
Kaggle Competition – House Prices: Advanced Regression Techniques
| Leaderboard Results | Description | CV | Public Score | Position |
|---|---|---|---|---|
| v1 | Basic LinReg & feature engineering | 0.14698 | 0.13500 | 1825/4394 |
- My first submission to leaderboard using the most basic Multivariate Linear Regression model. I’m quite pleased with the result given that this is using a basic model. My efforts in feature engineering seem to have paid off.
- Read In Depth: Linear Regression from VanderPlas’ book
See my notebook here
28. 2018-08-24
Kaggle Competition – House Prices: Advanced Regression Techniques
- Reviewed Andrew NG’s advice on model validation
- Read Hyperparameters and Model Validation chapter from Jake VanderPlas
- Decided that a solid cross-validation (CV) is crucial
- bolstered understanding by implementing my own hold-out and cross-validation functions
- reviewed cross validation features in SkLearn
- tested above CV’s and chose method
Thoughts:
Cross-validation like feature engineering is another topic that seems critical to practical application of ML, yet is not widely covered in the literature I’ve seen so far. The current 1 Kaggler, Shubin Dai (bestfitting), puts a lot of weight on designing good CVs as part of his approach described in this interview
During my own experimentation I observed surprisingly high variation between different approaches.
See my notebook here
27. 2018-08-23
Today I focused on visualisation and feature engineering of data for the Kaggle competition – House Prices: Advanced Regression Techniques
- indexed data by statistical data types using Pandas
- applied numeric mappings for ordinal data
- OneHot treatment of categorical data
- thought carefully about how to handle missing data
- exploratory analysis with Matplotlib and Seaborn
Thoughts:
Spending time on visualisation helped me to think clearly about the data. The ability to knock out a quick visualisation to check my intuition seems invaluable.
Feature engineering can be quite laborious, but seems like one of the most critical parts of the process because a mis-step here could result in information loss or distortion. For example, filling missing values in YearBuilt with zeros makes no sense, whilst filling WoodenPatioArea with mean values might inadvertently mis-label properties that don’t have such a feature.
Content on feature engineering in books and online seems light. Wondering if there’s opportunities for improved tooling here too?
This talk by Andrej Karpathy from Tesla, gives an interesting insight on the importance of feature engineering at Tesla.
See my notebook here
26. 2018-08-22
Today I started the Kaggle competition – House Prices: Advanced Regression Techniques
To get up and running I:
- read up on Kaggle competitions
- looked through the data descriptions in detail
- setup my Jupyter Notebook/Kernel
- reviewed Statistical Data types
- reviewed visualisation with Matplotlib
- reviewed data manipulation with Pandas
- Read chapter on Feature Engineering from Python Data Science Handbook by Jake VanderPlas
Thoughts:
The Kaggle dataset is not as ‘clean’ as I imagined. There is plenty of inconsistency in the formatting and labelling that will need to tackled before it can be passed to a model. I’m going to segment real, count, ordinal and categorical data in case I need to process them separately.
25. 2018-08-21
Meet with study buddy to revise entire Mathematics for Machine Learning course. Focus on areas we found most difficult. We cover all items under ‘Revisit’ in this data log. It was really useful to talk through and test each others understanding, felt like I came away with much improved intution in key areas such as numpy broadcasting, inner products and Taylor Series Approximation.
Our search for suitable London housing datasets was fruitless. The Land Registry datasets include sale prices but not much else, we conclude that best approach would be to scrape archived classified listings.
We decide to start by tackling the House Prices: Advanced Regression Techniques Kaggle competition.
24. 2018-08-17
Having completed the Mathematics for Machine Learning course, I met up with my study buddy to do plan next steps and revise the completed course.
We decide to do some applied work next week to predict house prices. Ideally we’d like to predict London house prices, so we decide to look for datasets.
23. 2018-08-16
COMPLETE Mathematics for Machine Learning: Principal Component Analysis week 4 including:
- Programming assignment:
- principle component analysis of MNIST dataset
- benchmarking performance
- optimisation of PCA for highly dimensional datasets
22. 2018-08-15
Mathematics for Machine Learning: Principal Component Analysis week 4 including:
- Vector spaces
- Orthogonal compliments
- Principle Compenent Analysis (PCA) objective
- Multivariate chain rule
- PCA mathematical proof
- Lagrange multipliers revision
Revisit:
- Chain rule practice q.2
21. 2018-08-14
Mathematics for Machine Learning: Principal Component Analysis week 3 including:
- Projection onto 1D subspaces (general case using inner products)
- Projection onto higher dimensional subspaces
- Orthogonal projections
- Programming assignment:
- eigenfaces
- auto-encoder for Olivetti faces dataset
- linear regression for boston house prices
20. 2018-08-13
Mathematics for Machine Learning: Principal Component Analysis week 2 including:
- Basis vectors revision
- Inner product angles and orthogonality
- exam: angles between vectors usin non-standard inner products
- programming assignment: inner products, angels and k-nearest-neighbour
Revisit:
- Programming Assignment: Inner products and angles def pairwise_distance_matrix(X, Y)
- What areas of this programming assignement required inner product generalisations?
19. 2018-08-12
- I took the first 8 lectures in Pavel Grinfeld’s inner product course
- Mathematics for Machine Learning](https://www.coursera.org/specializations/mathematics-machine-learning): Principal Component Analysis week 2 including:
- properties of Inner Products
- Inner product generalisations
- 2 exams
Revisit:
- Inner product: distances between vectors: I can’t replicate Deisenroth’s result @3:00, 12^0.5
18. 2018-08-11
Studied course Mathematics for Machine Learning: Principal Component Analysis week 1 & 2 including:
programming assignment to calculate mean and covariance of The Olivetti Faces dataset
- implemented naive iterative mean and covariance functions in Python
- benchmarked against equivalent functions in Numpy
data visualisation: worked through Matplotlib tutorials and a helpful introduction to matplotlib from Chris Moffit
linear algebra: Dot Product review
linear algebra: Inner Products. Quite an abstract concept not well motivated by M4ML course, I found these lectures particularly useful.
17. 2018-08-10
Started course Mathematics for Machine Learning: Principal Component Analysis week 1 including:
- mean of high dimensional datasets
- variance of 1D datasets
- variance of high dimensional datasets
- covariance
I read the Principle Compenent Analysis section in Hastie & Tibshirani’s Introduction to Statistical Learning textbook.
16. 2018-08-08
Completed course: Mathematics for Machine Learning: Multivariate Calculus
Studied week 6 including:
- Linear regression
- General non-linear least squares
- Least squares regression analysis in practice
- Programming assignment: fitting the distribution of height data
I listened to The History of Machine Learning from the Inside Out podcast where Geoffrey Hinton, Yoshua Bengio and Yann LeCun discuss motivations for deep-learning before state of the art results. Useful terminology, and interesting to hear their emphsasis on unsupervised learning as the area for future advances.
15. 2018-08-07
Studied Mathematics for Machine Learning: Multivariate Calculus week 5 including:
- Gradient descent strategies
- Newton-Raphson revision
- Constrained optimisation
- Lagrange multipliers
Great fun experimenting with gradient descent methods in the exercises. I submitted a proposal to the course forums for a gradient descent method that seems more robust to steep sided gulleys and shallow gradients. Coursework is starting to give me a good orientation for Jupyter notebooks, scipy, and numpy.
I wanted more detail on constrained optimisation so I also took the Khan Academy course, Lagrange multipliers and constrained optimization, which taught me about The Lagrangian and also steps through the proofs.
I finished the first chapter of Kevin Murphy’s Machine Learning book.
14. 2018-08-06
Studied Mathematics for Machine Learning: Multivariate Calculus week 4 + 5 including:
- Linearisation revision
- Multivariate Taylor series
- Taylor series exam
- Newton-Raphson iterative optimisation method
Revisit:
- week 4 / 2D Taylor series / q4 improve notes on linearisation, and ask forum question
- week 4 / Taylor Series Assessment / q4, why is f(x) = (x/2)^2 sin(2x)/2 odd? Why are functions that are same when rotated 180deg about the origin odd?
13. 2018-08-05
Studied Mathematics for Machine Learning: Multivariate Calculus week 4 including:
- Taylor Series
- Power Series
- Maclaurin Series
- Linearisation
exercises and exams, at this stage of the course, continue to extend practical abilities in finding derivatives of complex functions. I found this demonstration of the Binomial Theorem useful because it provides a neat way to layout working on the page.
Revisit:
- week 4 / Taylor series - Special cases / Q4 – why is f(x) = 1/(1+x)^2 discontinuous in the complex plane?
12. 2018-08-04
Studied Mathematics for Machine Learning: Multivariate Calculus week 4 including: - Building approximate functions - Power series
Implemented backpropagation in Python with Numpy. That’s the 3rd time I’ve implemented backprop now, having a detailed knowledge of the chain rule was really useful. This time around I feel like I’ve grokked it.
11. 2018-08-03
Studied Mathematics for Machine Learning: Multivariate Calculus week 3 including:
- Multivariate chain rule
- Simple neural networks
- Feedforward
- Backpropagation
Great to revisit the basic neural nets example with the linear algebra and calculus principles built up so far. Satisfying to combine linear algebra with the chain rule.
I read the article Google’s AutoML: Cutting Through the Hype which offers an interesting perspective on the commercialisation of ML tech, some potential pitfalls for big companies in this area.
10. 2018-08-02
Studied Mathematics for Machine Learning: Multivariate Calculus week 2 including:
- Partial differentiation
- The Jacobian
- The Hessian
Pretty cool to start combining linear algebra with calculus here. Looking at applications of the Jacobian and the Hessian to gradient descent problems – like the saddle problem – is a great motivator.
I read the paper Scalable and accurate deep learning with electronic health records that reports on Google’s latest work applying ML in healthcare. Looks like they’ve improved upon previous predictions by about 10% accuracy, but the thing that is most interesting is how they’ve achieved this without need for laborious cleaning and pre-processing of data. They have developed a pipeline that takes raw unstructured data like handwritten notes as input, and outputs some more structure FHIR compliant output.
There’s also a ux that allows doctors to inspect what parts of a given health record were most significant in generating the prediction, a step away from black-box characteristics. Finally, three different models are used (RNN, LSTM, Gradient Boosting), they are able to select the most appropriate model for a particular context using a method called Ensembling.
9. 2018-08-01
I met up with my study buddy to discuss progress. We decided to focus primarily on theoretical track for next 2 weeks to get foundational maths in place. Up until now we have found it difficult to split away from that track, and the content feels critical to more applied study.
I started the Mathematics for Machine Learning: Multivariate Calculus 6 week course.
Revised differentiation basics including Product Rule, Chain Rule, and practice exercises.
I got some advice from friends on best practices for self-directed study. I’m now separating my notes into two notebooks: 1) clean revision notes 2) messy exercise notes. Each morning I now reinforce my understanding by recalling concepts covered the previous day, I then review my notes as reinforcement. I’ll also start revisiting the harder exercise questions as further reinforcement.
8. 2018-07-31
I completed the Mathematics for Machine Learning: Linear algebra course, completing final exam.
I went back an reviewed some of the principles covered in more detail, by reviewing topics on Khan Academy including: reduced row echelon form, rank of matrix, calculating determinants in the general case and so on.
Thoughts:
There’s definitely more to learn about Linear Algebra than could be covered in the Imperial course, but it has given me a good sense of orientation and a desire to continue study in this area. My additional studies on Khan Academy have closed the loop on some areas I was intrigued by such as rref, and rank.
7. 2018-07-30
Mathematics for Machine Learning: Linear algebra course, covered: - study of eigenvectors - implementation of Google-esque PageRank algorithm which finds largest eigenvector with power method
6. 2018-07-29
- Mathematics for Machine Learning: Linear algebra. Covered:
- Einstein summation convention and the symmetry of the dot product
- Exam: Matrix multiplication
- Matrices transform in a new basis vector set
- Exam: Mappings to spaces with different numbers of dimensions
- Orthogonal matrices
- Gram-Schmidt process
- Coursework: implemented Gram-Schmidt algo.
- Reflecting in a plane
- Coursework: Reflecting in a plane with Numpy
- Week 4 complete
- Eigenvalues and eigenvectors concepts
- Exam: selecting eigenvectors by inspection
- Special eigen-cases
- Calculating eigenvectors
- Exam: Characteristic polynomials, eigenvalues and eigenvectors
Thoughts:
A heads down day studying linear algebra. The exams provide a lot of exercise which really drive things home. Would be good to find ways to keep this knowledge fresh, perhaps longer term exercises?
Thoughts:
Great to work on some hands-on examples manipulating information with matrices. Techniques feel generally applicable. Insights on how to measure the information available in a set of vectors, e.g. are they linearly dependant? will be valuable in assessing/designing datasets.
5. 2018-07-28
Today’s progress:
- Met up with a friend who as good applied data science experience. He has built a data science team and mentored students. I learned about the skill level of people working in the field, their day-to-day work and gained insight on best practices and pitfalls.
- Mathematics for Machine Learning: Linear algebra. Covered:
- Solving linear equations using the inverse matrix I
- Determinants and inverses
- Matrix identification programming assignment
- finished week 3
Thoughts:
Data Science practitioners often bring with them a specific technique, perhaps based on past specialisation. It seems as though some practitioners might be inflexible in the range of techniques they will bring to bear on a problem. I wonder if it is realistic to gain a deep – or at least practical – understanding in a broad range of techniques?
The ability to build a solid data processing pipeline could be an invaluable practical skill – Kafka might be worth investigating here. Maybe this is something I can collaborate with my study partner on.
Possible avenues for applied projects include: - offering my services to a uni research dept. - kaggle competitions - self defined projects (we worked on some ideas here)
5. 2018-07-27
Today’s progress:
- Mathematics for Machine Learning: Linear algebra. Covered:
- transforms matrices
- matrix composition and combination
- inverse matrices
- Gaussian elimination
- finding inverse matrix with Gaussian elimination
Thoughts:
Continued with David Dye’s course. Had to fix my front door lock so that was a distraction. The exercises in week 3 require quite laborious calculations with lots of basic arithmetic. It’s important to be very careful not to cause cascading errors by dropping a minus sign or other basic arithmetic errors. I mad a few. Now I understand how to derive the inverse of a matrix and , and its given me a good intuition for what goes on when you call inv(A)!
4. 2018-07-26
Today’s progress:
- Foundational: Studied Mathematics for Machine Learning: Linear algebra. Covered:
- changing basis for vector operations
- basis, vector space, and linear independence
- applications of changing basis
- passed 3 exams on the above
- (week 2 complete)
- Interview training, reviewed:
- big O notation
- data structures: strings, arrays, dynamic lists, linked lists
- logarithms
- (interviewcake chap. 0 complete)
- Started reading Murphy’s textbook.
Thoughts:
It took me much longer to complete MfML week 2 than expected, time was spent working through the exam questions - most of time spent filling out 17 pages in my notebook with workings! I tried to make sure I could derive formula rather than rote memorisation. Cross checking with my study partner revealed a formula I’d derived incorrectly so that was definitely useful, was also good to practice talking the language. David Dye was light on practical method for testing linear dependence – Sal Khan’s More on Linear Independence gave the detail I needed.
Interview training just reading so far. Looking forwards to trying out some exercises.
Murphy’s is a very exciting book. Is accessible, and covers some prerequisites like probability. Might be a good companion text for MMfL PCA course. Murphy considers that broadly there are 3 domains of ML; supervised learning, unsupervised learning and reinforcement learning – the latter not being covered in this book. He recognises the similarities between statistics and ML, and suggests that although topics are broadly similar the emphasis is different.
Tomorrow I’d like to get at least week 3 of MMfL done and chap 1 of interview training.
Finally, my grandmother’s 2-year old prediction that ethics will increasingly be a defining consideration in ML applications seems to be bolstered today as I read about biases hampering deployment of facial recognition systems. Throws up interesting questions like: How to measure bias in a dataset? How to measure bias in a model?
3. 2018-07-25
Today’s progress:
- implemented backpropagation algorithm with regularisation from scratch in Matlab to complete MLNG coursework (week 5 complete)
- began study of Mathematics for Machine Learning. covered:
- The relationship between machine learning, linear algebra, and vectors and matrices
- Vectors: basic operations, modulus & inner product, cosine & dot product, projection
- almost finished week2
Thoughts:
The mathematics for machine learning course has been useful, so far I’ve learned a range of vector operations. The course works up from first principles which means you can get a long way by just recalling the fundamentals and working up from their. Much better suited for me than remembering a load of formulae without context. I also think it is a very good compliment for Andrew Ng’s more applied course, certainly goes deeper on the math. I’ve dug out one of my undergrad textbooks which covers same material, K.A. Stroud’s Engineering Mathematics – useful reference for exercise but I’m finding David Dyes lecture’s move me along much faster.
Glad to finish the backprop coursework. It was amazing to see hidden layers visualised for MNIST, I’ve seen those kinds of visualisations before but now I feel like I have a strong intuition on how to interpret them.
Kevin Murphy’s seminal book just arrived. Linear regression doesn’t appear until page 219, and deep learning not until 999, so I’d better get to it.
2. 2018-07-24
Today’s progress:
- revisited Andrew Ng’s ML week 5 lectures on neural nets, feedworward, and backpropagation.
- Implemented feedfoward for MNIST example in Matlab
- reviewed and responded to great feedback on curriculum and motivations from professionals in the field
- listened to Talking Machines podcast episode 1
- had cursory skim through Google’s new Machine Learning guides, these look useful, might fold into curriculum
- started building a list of project ideas, i need to publish these
- added my coursework from Andrew Ng’s Machine Learning course to this repo
Thoughts:
Very useful feedback from mentors. Key points included:
- find a problem that I’m compelled to solve, then use that as project and curriculum benchmark
- find ways to teach what I’ve learned to others at a similar level
- mentors encouraged me to clarify my thinking on where I want to be in 3 months
This will all be really useful for informing curriculum.
Great to get back up and running with Ng’s course. Ng recommends implementing feedforward with a for
loop, but as I was implementing it I noticed that the loop could be removed by applying linear algebra. I decided to stick with Ng’s recommendation, I think he recommends this approach because it allows you to break down the process into very small incremental steps. This proved useful during debugging, and I think it gave me a better intuition than if I’d used abstractions.
When implementing feedforward I was getting an unexpected value. I was able to debug it by isolating one training example as a test case, and then using intuition to notice that the cost should not be a negative value. I didn’t get as far on the coursework as I’d hoped, but feel like I’ll be faster today.
1. 2018-07-23
Today’s progress:
- define curriculum
- setup this learning log
- share curriculum and motivations with friends for feedback
- ordered some textbooks
Thoughts:
It’s day 1. Well not quite, I’ve spent the last few days researching the available learning resources including courses and textbooks. There’s a lot out there, I started to feel a bit lost at sea, so I decided to use the UCL MSC in machine learning as a basis, and focused on material that covered prerequisite foundational material as well the core unsupervised learning module, here’s my notes.
Today I met up with my study partner to compare notes and pin down a curriculum. It is a big relief to have this down on paper. Looking forwards to getting into it tomorrow.


WITNESS LIST Education Committee June 22, 2005 - 9:30A SB 2 ON: Anderson, David General Counsel (Texas Education Agency), Austin, TX Goeman, James Program Director (Tx Higher Education Coordinating Board), Austin, TX Heckmann, Lynette Director of Special Projects (Tx Higher Education Coordinating Board), Austin, TX Moak, Lynn Partner (Self), Austin, TX Rislov, George R. Managing Director, Division of Curriculum (Texas Education Agency), Austin, TX


FLOODS
Arizona has experienced flooding incidents of sufficient magnitude to prompt Presidential and/or Gubernatorial disaster declarations. Flooding causes damage and destruction of homes, businesses and personal financial resources. You can take steps to protect yourself, your family and property before flood strikes by following these basic tips:
BUSINESSES/HOMES
-
Elevate, floodproof, and/or relocate buildings/homes outside the floodplain or above flood elevation on a new foundation;
-
Store important documents and irreplaceable objects to avoid damage;
-
Elevate or relocate furnaces, hot water heaters, electrical panels and other equipment;
-
Provide openings in foundation walls that allow floodwaters in and out, thus avoiding collapse;
-
Build and install flood shields for doors and other building entries to prevent floodwaters from entering;
-
Install backflow valves or plugs on drains, toilets and other sewer connections;
-
Elevate, relocate or protect inventory, equipment and stored hazardous materials or other chemicals in areas that may be flooded;
-
Acquire and demolish homes in the floodplain;
-
Install sump pumps with backup power; and
-
Purchase flood insurance.
PUBLIC WORKS/UTILITIES
-
Protect or elevate ground mounted transformers;
-
Elevate vulnerable equipment, electrical controls and other equipment at waste water treatment plants, potable water treatment plants and pump stations;
-
For sewer lines in the floodplain, fasten and seal manhole covers to prevent floodwater infiltration;
-
Protect wells and other potable water from infiltration or flood damage by raising controls/well pipe;
-
Replace low bridges or other obstructions that may induce flooding of houses or businesses; and
-
Move building contents to a higher floor or store outside the floodplain.


Rotation Cipher Demonstration
Up
Down
Input
Cipher text
Cipher text
Decoded message
AP Computer Science Principles Section 2.2C


Let me see your identification. You don't need to see his identification. We don't need to see his identification. These are not the droids.
Let me see your identification. You don't need to see his identification. We don't need to see his identification.These are not the droids.
Price: 0.00 polymer Lock: 0.00


Lebanon protesters defiant despite Hezbollah attack
Beirut: Security forces cleared road blocks across Lebanon Monday, facing off against protesters who took to the streets despite being attacked overnight by supporters of the main Shiite groups Hezbollah and Amal.
Demonstrators demanding a complete government overhaul have stayed mobilised since protests began on October 17, but a bitterly divided political class has yet to find a way out of the crisis.
Frustrated by the stalemate, protesters had called for road blocks and a general strike on Monday, but an attack by supporters of allied parties Hezbollah and Amal on Sunday night weakened the turnout.
Political parties "are trying to instill fear in us as a people, so we don't progress and stay at home," said Dany Ayyash, 21, who was blocking a key road in Beirut's Hamra district.
"This is what happened today. There was supposed to be a general strike and yet the people are still at home sleeping."
At around midnight on Sunday, backers of Hezbollah and Amal attacked demonstrators at a flyover near the capital's main protest camp.
Brandishing party flags, they hurled stones at peaceful demonstrators and taunted them with insults as riot police deployed to contain the violence.
The attackers also ravaged a nearby encampment, tearing down tents and damaging storefronts in their most serious assault on protesters so far.
At least 10 demonstrators were wounded, civil defence said, without specifying the extent of their injuries.
- Tense aftermath -
UN Special Coordinator for Lebanon, Jan Kubis, called for restraint.
"I urge all Lebanese political forces to control their supporters, to avoid using the national protests for pursuing their political agenda," he said on Twitter.
The state-run National News Agency said authorities have launched an investigation into the incident.
Parliament speaker Nabih Berri, who heads the Amal Movement, called on security forces to keep roads open to avoid "civil strife".
On Monday morning, scattered stones, shattered glass and the mangled remains of tents littered the ground in the main Beirut protest camp at Martyrs' Square. Around it car windows had been smashed with rocks.
But the demonstrators said they would not give up.
"The attack gave us all -- at least the ones here right now -- a sense of determination," Ayyash said.
Nearby, security forces deployed along the road after shoving aside demonstrators who had been sitting on the ground.
Salim Mourad, a 31-year-old protester, showed AFP his torn collar, saying riot police dragged him by his shirt.
"We don't want violence," he said.
Security forces also deployed across main arteries in north and east Lebanon Monday, removing barricades that had been raised by demonstrators.
The army said it arrested nine people north of Beirut at dawn after they tried to block roads using burning petrol and shattered glass.
It also arrested four other "rioters", releasing three shortly afterwards.
The security forces have come under fresh criticism following Sunday's attack, with protesters accusing them of being lax with Hezbollah and Amal supporters, most of whom were allowed to walk away.
"The thugs throw stones and insult security forces but they don't confront them," said Elie, 24, who was among the protesters attacked.
"They don't arrest them the way they arrest us."
Such criticism prompted Interior Minister Raya al-Hasan to respond by saying the army and police remain the only "guarantors of the country's stability".
- Political paralysis -
Political leaders have failed to select a new government nearly one month since Prime Minister Saad Hariri's cabinet resigned, bowing to popular pressure.
President Michel Aoun, whose powers include initiating parliamentary consultations to appoint a new premier, said he was open to a government that would include technocrats and representatives of the popular movement -- both key demands of the protesters.
But demonstrators say they reject any government that would also include representatives of established political parties.
The United States, France, the World Bank, and credit rating agencies have all urged officials to accelerate cabinet formation, warning of a deteriorating economic and political crisis.
In the latest diplomatic push, senior British foreign office official Richard Moore was in Lebanon on Monday.
He would "underline the urgent need to form a government" during meetings with the president, prime minister, foreign minister, the speaker and the army chief, the British embassy said in a statement.
"The people of Lebanon have been clear in their demand for improved governance, and they should be heard," Moore, the director general for political affairs, was quoted as saying.
Read also
Read More
US citizen jailed in Lebanon as country deals with crisis
In September, Amer Fakhoury closed his New Hampshire restaurant to take his first vacation in years to visit family in his native Lebanon - a country he hadn’t been to for nearly two decades.
Read More
Lebanon detains children for tearing down political banner
Lebanese security forces briefly arrested five youths, including three minors, for allegedly pulling down a sign for the president's political party, sparking outrage Sunday on social media.
Read More
Germany again deports Lebanese convict back to Beirut
German authorities have again deported a Lebanese man who was convicted of drug dealing and deported earlier this year but then returned to Germany.
Read More
Lebanon: five weeks of protests
Lebanon has been paralysed by more than a month of protests demanding an overhaul of the entire political system.
Read More
Lebanese protesters pack streets to mark independence day
Tens of thousands of protesters took to the streets in Lebanon on Friday to mark independence day with a fresh wave of demonstrations against a ruling elite accused of rampant corruption and steering the country into deep crisis.


Biography
Kevin was born in Delray Beach, Florida and moved to a small town called Morganton in the foothills of North Carolina when he was 12 years old. From there he grew up and went to high school, after graduating high school, he went to Appalachian State University where he struggled and ended up moving to Michigan where he attended Oakland Community College graduating with an Associates Degree in Business Administration. He then transferred into Michigan State University where he graduated with a Bachelor's of Arts in Economics. He worked the whole time through college then ended up joining the enlisted ranks of the United States Navy as an Aviation Electronics Technician. He enjoys watching sports and playing sports, playing his guitar, and anything outdoors.
Education
- Oakland Community College, Graduated 2014
- Michigan State University, Graduated 2016
- Microsoft Software and Systems Academy, Graduated 2021
- Code Fellows, Present
Work History
- SOAR Learning Inc., 2013-2014
- Usher at Breslin Center, 2014-2015
- Best Buy Mobile Sales Department, 2015
- Walgreens Pharmacy Technician, 2016-2017
- US Navy Aviaiton Electronics Technician, 2017-2021
Goals
- Be able to have an idea and implement it with code.
- Start a career in software development at a big tech firm.
- Buy a duplex and rent the other half out.
- Travel to Central or South America.
- Get a dog!
Top Ten National Parks
- Sequoia National Park
- Glacier National Park
- Great Smoky Mountains National Park
- Yellowstone National Park
- Olympic National Park
- Grand Canyon National Park
- Arches National Park
- Yosemite National Park
- Everglades National Park
- Shenandoah National Park


Player 1
Dice Roll:
Turn Score:
Total Score:
Player 2
Dice Roll:
Turn Score:
Total Score:


bruce springsteen is actually The Boss. this is irrefutable. but node.js is catching up.
I'm kind of infatuated with node.js right now, honestly. i've made some cool projects with it.
I've been toying with node.js for about three months, I think. before I even talk about it and how excited I am about it, you need to be comfortable with the following:
if you feel good about those things, we're in business. otherwise, you need to read the linux guide. developing stuff with node.js is command line work. it's low-level. it's fun!
first of all, what the hell is node.js to begin with? put simply, it's a server-side Javascript highly-scalable platform, used primarily to build asynchronous programs.
that's crazy. let me explain each piece a little better.
it's server-side javascript! that means instead of javascript running in your browser, it's running on the server. that may seem strange - and it is - but remember, javascript is just a programming language, there isn't anything saying that it can only run in a browser!
specifically, the javascript in node.js is run by Google's super-powerful V8 Javascript Engine. V8 is so cool, it basically compiles the javascript to machine code to make it obscenely fast. if you don't understand what that means, that's okay. just understand that it's fast.
(javascript is typically run by being interpreted by a browser, the same way a server would interpret PHP before handing it off to you. instead, the V8 engine compiles the javascript down to lower-level code. it's goddamn magic!)
and node.js is merely a platform; javascript is the actual language you use to write scripts for it. node.js is just the bundling and customizing of the V8 engine to run Javascript on the server-side.
like Ruby, or Perl, or Bash, or Java, node.js can be a tool for systems development as well as for web development... the difference being: who or what is going to use what you write? If a person in a browser will use it, then it's web development, no matter what the language. but if you're writing something for a computer to talk to, then you're developing systems. node.js can kind of do both - but it's mostly for systems development. i'll explain this more in a systems architecture guide.
and what does asynchronous mean? well, i'd like to dedicate an entire section to it. because it's a big deal.
hopefully you know a programming language or two by now, namely stuff like PHP and Javascript and Ruby and maybe Python or Perl or whatever. In common practice, these are all procedural, interpreted languages.
procedural means that you write the program like a step-by-step guide. from line 1 to line 100, the computer goes step by step until it reaches the end, and takes as long as it has to.
if we were to write a script in PHP that connects to a database, grabs some rows, and displays them, the computer would execute that script the following way:
this typically happens so damn fast that we don't really notice that the computer is just reading a list of steps and executing them. but for every step, it waits for every function in the line to be done before going to the next one.
this is good! because it means we can write something on line 2 that depends on line 1 working. easy! simple! effective!
but slow.
slow in terms of a computer, anyway. a PHP script may take 100 milliseconds, but during that 100 milliseconds, the script and the PHP process it's using can't be doing anything else. all that waiting around for the database to get back, for it to display the rows, for it to hand the result off to the user at the end, is all time effectively wasted!
that's known as the synchronous or blocking world. and it's great for total integrity, but it doesn't scale well. 100 millisecond requests may seem fine when you have a powerful server and maybe 100 visitors. but what if you suddenly get 1,000,000 visitors? the server will drown itself in all the requests while waiting around for the database to do this or that.
this is where asynchronous or non-blocking platforms come in. they are inherently event-driven as opposed to procedural. in an async world, line 2 cannot depend on line 1, because line 1 might be taking awhile. and all the program wants to do is get to the end of the file!
so in an async script, the program would idle most of the time, waiting for things to happen, before receiving an event and continuing what it needs to do.
it's a strange idea, but it's one i'll illustrate, and hopefully you'll understand. we need to actually install it, first.
node.js is something you should download and compile to get it to run the best way possible. i hinted about this kind of stuff in the linux guide but now we get to do this for real if you never have! luckily, it's very easy to compile.
so have your linux server ready! we need to install the following dependencies via apt-get:
> apt-get install build-essential libssl-dev python
what are we installing?
build-essential allows you to run make to compile programs. libssl-dev allows SSL connections, should we need them. python just makes sure you have python installed, because node.js uses it a lot. (even though we won't.)
so once that's all done, change directory to /usr/src which is where we'll download the source files.
> cd /usr/src
now we download the node.js source files. go to the nodejs website and get the link for the Source Code download, it'll probably end in .tar.gz
now use wget in the linux shell to download it, like so:
> wget http://nodejs.org/dist/v0.6.10/node-v0.6.10.tar.gz
(Obviously replace the URL with whatever the latest download link is. In the following instructions, replace the .tar.gz filename accordingly.)
that might take a minute. it's using the wget client to get the stable-version source code of node.js. when it's done, we'll need to unpack it.
> tar -zxf node-v0.6.10.tar.gz
when it's done, it'll have created a node-v0.6.10 directory within /usr/src, so let's go there.
> cd node-v0.6.10/
ok, now we need to allow the proper configuration. luckily this is a simple command:
> ./configure
the dot-slash before the word "configure" means run the program in this directory named "configure"... instead of any possible program named configure that might be on our linux box.
that'll take just a few seconds. next, if the configure program checks out, we'll make the program.
> make
oh lawds, this'll take awhile. make yourself some tea. welcome to compiling programs. you'll have to feel this pain if you ever get into C or C++ or Objective-C
when it's done, run the following:
> make install
AND BAM WE GOT OURSELVES SOME NODE.
test it by doing this:
> node -v
that should print out the version number of node.js that you just installed. (at the time of this writing, it should be 0.6.10.) so fresh. that's it, you have node installed.
it'll also have installed npm, the node package manager, which works a lot like apt. we'll get to that later.
so let's flex some muscles. i can't wait to show you! node.js is actually quite simple because it's just javascript! object-oriented, fast, with lots of capabilities.
to make a node.js program, all you need to do is start a blank text file, like most any programming language. i use the .js extension, because it's javascript!
so let's make omg.js -- because it'll blow your mind. the contents are as follows:
var http = require('http');
var server = http.createServer(function (request, response) {
response.writeHead(200, {'Content-Type': 'text/html'});
response.end('Hello World\n');
});
server.listen(1337);
console.log('Server running at http://<IP_ADDRESS>:1337/');
So write that in nano or vi or whatever, save it in a folder somewhere, go to that folder, and then type this:
> node omg.js
You should see the line Server running at http://<IP_ADDRESS>:1337/ and nothing else. There is no prompt because node.js is running the file...
If you replace <IP_ADDRESS> with the server's IP, and open it in a browser, you'll see "Hello world" in the browser!
That's because you just built your own web server. Yeah. Like Apache. Or lighttpd.
Anyway, that's pretty awesome, but maybe i'm just easily impressed. Nevertheless, let's break down what you just did.
First of all, you require() the module named http into the variable http... useful, right? Modules are a huge part of node.js, and I'll get into them more specifically in the next section. Needless to say, they act a lot like frameworks do in javascript.
The next thing it does is run the createServer() function on the http object, which is then assigned to the server variable.
What's inside that call to createServer()? Well, that's where things get crazy. We put as the method's only argument an anonymous function. That is, a function without a name, to be used only when needed and then discarded. Within the async world, we call this a callback function. That means that the program will use this function whenever a specific event happens. It'll call back to that function using whatever you provide here. (It doesn't have to be an anonymous function, but why not?)
So the only argument is that function: in this case, the function takes two arguments, the first being an incoming request, and the second being the server's response. The event will be when the server gets an incoming request. It'll then call back on the provided function.
Within the function, we use the writeHead() method of our response to write in the response header that it has a status code of 200 (which, within HTTP, means "Okay! Got it!") and that it has the content-type of "text/html".
(The second argument to writeHead() is an object containing whatever headers you want. Personally, I always include a "lol" header, like so: { 'content-type': 'text/html', 'lol': 'wut' } And only about 0.00001% of internet users would ever notice. If you don't know what this means, forget I said anything.)
Then we end() the response with the text we want it to contain. (A simple way of explaining it.) The end() method also tells the server to send this response back to whoever asked, which would be you in your browser.
After we define that variable server successfully, we use the listen() method to tell it to listen on a specific port, in this case 1337.
And then we tell it to write a string to the console using the log() method, which just accepts a string to print out. That's it!
So here's how the process works, as we just set it up:
the program will keep running because it'll keep listening on that port. node.js will only stop if it runs out of things to do or it errors out. hit CTRL+C to force-quit the program.
even cooler is that it's not like it can only do one request at a time... no, it can do as many as the computer's CPU is capable of doing. again, this is non-blocking, so it'll try to do as many requests as possible! it doesn't do one, and if another shows up in the middle of that, wait til the first one is gone before moving on to the new one. it just does as many as it can concurrently as quickly as it can.
Now.... it's important to note the following: even though the console.log() call is the last thing in the script, it's not really what is run last. technically it's probably run second. remember, node.js will try to scream through whatever is there. in the next example, you'll see what i mean.
and yes, I just pulled a page worth of notes from less than 10 lines of code. that's how cool this is. it's very, very powerful.
the above example was very powerful and probably overwhelming. that's okay; but it should also be exciting! that kind of power, with that kind of simplicity? Amazing! that above example is a version of the basic example the guy who made node.js commonly uses to demonstrate how simple and yet very powerful node.js can be. if you were to run benchmarks on that simple web server against a service like Apache, node.js beats it every time.
but let's try something easier. something simpler. call this funtimes.js
console.log('welp. line one.');
setTimeout(function() {
console.log('line two?');
}, 1000);
console.log('line three!');
okay, run that. you'll notice that it will print line one and three immediately, then in a second, you'll see line two. and then it'll quit. WHAT IS GOING ON HERE.
really, this is a lot like javascript already works -- because even in the browser, javascript is already capable of asynchronous-ness. put that on the server-side and things get interesting.
So what is the script really doing? It's trying to get to the end of the file as fast as possible! It prints the first string, then it sees the setTimeout() and acknowledges it, and then it prints the third string.
Then it just hangs out. Does nothing. The program idles. CPU usage goes to 0%. For one second, then it prints out the second line. The script exits, having nothing left to do.
If you change the setTimeout to setInterval, the second line will repeat every second. (1000 milliseconds.) and the program won't quit til you tell it to.
What is important about this is that nothing was blocked and no CPU cycles were wasted. There wasn't a second-long pause between the first and third printed lines. That's pretty awesome.
but, as I said, it means sometimes you can't count on whatever line 1 is doing before you do something on line 2. instead we have to use callback functions to make sure things go according to a certain sequence, as I'll explain in another example later.
node.js has a lot of optional modules out there, the same way PHP has libraries and javascript has frameworks. (notice a theme? really every programming language has modules and libraries and frameworks.)
it comes with a lot already, read about them here. we used the HTTP module in the first example. node.js does a lot of good stuff already, but it can do even more.
to install new modules made by other people, there's a really awesome program called npm that was built. it stands for Node.js Package Manager. since version 0.6 (i think), node.js comes with npm by default.
so you should already have the npm program installed, check it by running this in the shell:
> npm -v
now if we want to install a node.js module, we'd just run it like this (don't actually do this, just look):
> npm install mongolian
that'll install the mongolian module into the current directory for node.js to use.
(just so you know, mongolian is a MongoDB interface for node.js)
node.js has a lot of potential because it's a tasty mix of low-level possibilities with high-level concepts built on top of an easy programming language.
that having been said, what can you do with it? here's some things i've done with it. not to boast, but to give you some ideas:
and i'm prototyping more cool stuff all the time. and that's with only about two or three months experience. really, node.js is great for anything that is event driven and/or heavy on I/O. (I/O is input/output, or the inputting of data and the outputting of data. Usually a blocking language will take awhile because it verifies every action before proceeding; non-blocking languages do not.)
for example, an IRC server or client made with node.js is perfect, because it'll idle while nothing is going on, and it'll respond when something actually happens, and it can handle lots of simultaneous messages at once if need be.
likewise, anything dealing with real-time data that needs to scale quickly, like webpage analytic data, is great with node.js because it's non-blocking I/O. what that means is, it'll quickly hand off info to a database without waiting for an "OK" in return. and it'll keep going indefinitely, only limited by CPU and memory, and if the database runs out of disk space.
but due to popular demand, i'll use the rest of this guide to show you an IRC bot as an example.
yeah, every cool kid has written their own IRC bot. well, maybe just me and a few others. but never has it been easier than with node.js. and yeah, for this example to really work, you need an IRC server to test it on. but there are lots.
what will our bot do? we'll start off pretty simple
first, we'll be using the jerk module to power the actual IRC-ness of it.
jerk will handle pretty much all of the heavy lifting for you. it'll connect to the server, join a channel, and let you set up autoresponders.
first, go to whatever directory will hold our script. i like to use /root or i make a directory in the root of the filesystem called node, so the directory would be /node
once you're in here, use npm to install jerk:
> npm install jerk
that'll install the jerk module to whatever directory you're in. let's start the actual program file. use whatever text editor you want to start bot.js
first thing in this script should be loading the jerk module:
var jerk = require('jerk');
next, let's set up the options that jerk will need to connect to whatever you want:
var options = {
server: 'irc.whatever.net',
nick: 'SuperAwesomeBot',
channels: [ '#acoolchan90210' ]
}
So the options variable is an object with three keys: server, nick, and channels. server is the IRC server it'll connect to. nick is the name of the bot! So name it something good. Finally, the channels key lets you assign an array of channels the bot will join once it's connected to the server. For our purposes, we only need one. Name it whatever, just remember it. (And in case you've never been on IRC before, channel names need a # at the beginning.)
Now, the same way we'd use setInterval() or whatever, we're going to use the jerk() function to set up some responders (also known as watchers or listeners).
var bot = jerk( function(j) {
// the listeners will go in here
});
That's great. We'll come back to this in a minute. Now add this below that chunk:
bot.connect(options);
That's it! Now if you run that, like so:
> node bot.js
You'll see it connect to the server and join the channel. If you go in to the server and join the channel yourself using an IRC client, you'll see your bot sitting there, idling. You haven't taught it what to listen for yet, but at least it made it into the channel!
So CTRL+C the bot (it'll leave the channel) and let's go back to that jerk() function and define some listeners within it.
var bot = jerk( function(j) {
j.watch_for('hello', function(message) {
message.say('WHY HELLO THERE!');
});
});
If you restart the bot and enter the chatroom with it, say hello! It'll respond automatically! Magic.
 The first argument of this method is what to listen for, the second argument is a function containing what to do.
In this case, we want to use the message object's say() method to respond in the chatroom! We pass that method a string. Specifically, "WHY HELLO THERE!" Very loud and obnoxious, I love it.
What else can we do with this? Well, the message object also has a user property. With it, we can print out who sent the message, like so:
var bot = jerk( function(j) {
j.watch_for('hello', function(message) {
message.say('WHY HELLO THERE ' + message.user + '!');
});
});
See what that does? It inserts the message's user name in the middle of the string. So if a user named frankie said "hello", the bot would respond
WHY HELLO THERE frankie!
That's the basics of an IRC bot. They can be very simple and annoying. You can just keep adding more responders:
var bot = jerk( function(j) {
j.watch_for('hello', function(message) {
message.say('WHY HELLO THERE ' + message.user + '!');
});
j.watch_for('goodbye', function(message) {
message.say('lol bye');
});
});
Now... you can get a lot crazier with it. Instead of a string as the first argument of watch_for(), you could use a regular expression... which makes it 1000 times more powerful. You can also capture data with your regex and use it in the returning message! I hadn't planned on writing a guide on regular expressions, but maybe I will.
You can easily build in logic conditions with if statements, so that the bot responds differently to different people. Most everything you can do with regular Javascript, as well as any node.js module, you can combine with this! You could add a MongoDB database to log every line in chat, or keep track of a certain person, or whatever.
For example...
var bot = jerk( function(j) {
j.watch_for(/(.*)/, function(message) {
if (message.user.toLowerCase() == 'cyle') {
var what_cyle_said = message.match_data[0];
chatlog.insert( { 'username': 'cyle', 'when': new Date, 'message': what_cyle_said } );
}
});
});
That tracks anything that is said in chat (thanks to the /(.*)/ regular expression) and does a little MongoDB insert (via the Mongolian node.js module, which I won't show you how to set up (you should figure that out!)) to store whatever the user named "cyle" says.
But that's just a taste... my chat bot, affectionately known as cylebot, can do a lot of neat tricks... someday I may release the source code for him.
you can't really tell very much in these examples, but coding can start to get kind of tedious when you need to start making programs that act halfway between procedurally and asynchronously.
for example, what if you actually do need to make sure that a row gets into a database before you move on? it's simple, add a callback function to wait until the database tells you it's cool.
but then you need to move whatever you want to do when that happens to the inside of that callback! here's a simple example you can try out.
here we want our program to print something, wait a second, print something else, and then wait another two seconds, print something out, and then wait again.
console.log('this is the first line!');
setTimeout(function() {
console.log('this is the second line!');
setTimeout(function() {
console.log('this is the third line!');
setTimeout(function() {
console.log('here is another line!');
// now whatever else we want to do before the program exits would go here.
}, 1000);
}, 2000);
}, 1000);
See how we now have a weird stack of callbacks, one after another? this is called nested programming. it's kind of an eyesore. but we could also do it this way:
console.log('this is the first line!');
function lineTwo() {
console.log('this is the second line!');
setTimeout(lineThree, 2000);
}
function lineThree() {
console.log('this is the third line');
setTimeout(lineFour, 1000);
}
function lineFour() {
console.log('here is another line!');
// now whatever else we want to do before the program exits would go here.
}
setTimeout(lineTwo, 1000);
But that's kind of just as messy... we now have a breadcrumb trail of functions and setTimeout() calls. Really, there is no solution to this, because it's just the way asynchronous callback-based programming works!
So yeah... it takes some getting used to. Honestly I don't know how to do it differently yet.
My second project I did after a simple chat bot was to make a video transcoding farm. I won't show you how to make one here, but I'll describe it to you, and tell you why node.js was so useful for it.
First, node.js can handle other processes on a computer really well. It can monitor a process easily with very little overhead. This is very useful when opening a process like the HandBrake CLI and having to monitor every line it outputs while it transcodes a file. (There are even node.js solutions already that can transcode a file as you're uploading it. That's so goddamn neat.)
For that reason, node.js can automate processes on a linux box quite easily. It has great modules for Processes and the File System. The most important part is that they're non-blocking, so one single node.js program can be handling lots of simultaneous jobs discreetly and efficiently. And when it has nothing to do, it'll idle completely, waiting in silence.
Admittedly, I needed to make a mothership server to act as the actual queueing system, but node.js handles all the actual heavy lifting of transcoding files on the farmers. (I could've written every single piece in node.js, though.) I'll get into that more in a later guide, specifically how to make individual systems talk to each other and interoperate efficiently.
But really, honestly, the possibilities for node.js are wide open, as the creator of node.js describes. Node.js is pretty young, but already there are so many modules for it. Honestly, I looked through that list of modules one day and picked out two or three to base projects on, just for kicks. You should do the same.
Possible projects:
there's much more you can do. just remember, it's just Javascript!
use the forever node.js module. it's priceless. what does it do? it makes sure your node script runs forever!
really though, you probably noticed that when you run a node.js script, it hangs up your prompt. you can't do anything else until you CTRL+C your node program. forever fixes this very elegantly.
read the installation and usage instructions right here
what it does, put very simply, is turn this:
> node bot.js
which you'd need to either leave running or CTRL+C to quit out of, into this:
> forever bot.js
which then makes bot.js run in the background forever, and keeps a log of it, and gives you back your prompt. amazing!
have fun!


HISTORY
ESTABLISHED IN THE LATE 1960S, OUR FAMILY OWNED BUSINESS IS BASED IN EDINBURGH AND FALKIRK, SERVICING CUSTOMERS ACROSS THE UK.

SHOP
HAVE A LOOK IN OUR ONLINE SHOP FOR GREAT PRODUCTS AND DEALS.


{{< layout}} {{$propositionHeader}}{{/propositionHeader}} {{$pageTitle}}Information about urgent passport{{/pageTitle}} {{$header}} {{/header}} {{$main-content}}
You can choose from 3 ways to get a passport urgently. You'll need to make an appointment at a passport office in the UK. You can do this online.


This API is used to add APs (App Platforms) to a PBX and when the PBX is added, it allows to find the App Instances provided by the AP and to configure the PBX to use these App Instances. It consists of the following functional blocks.
An AppWebsocket connnection with a default password "-" is used for this interface.
Normal AppWebsocket Login is used.
{
"mt": "RegisterDomain",
"pwd": string
"email": string
}
With this message a new domain is registered on the AP. An email confirmation is sent.
Only after the user clicks the link in the confirmation email, the domain is registered.
If the domain already exists, with the click on the link in the confirmation email
the password is set to the new one.
The domain is the domain used for the login.
{
"mt": "RegisterDomainResult"
}
Message sent by the AP as response to RegisterDomain
Instance management is done through myApps API com.innovaphone.manager. This API is provided by a hidden App provided to the PBX when the Websocket Connection to http(s)://<AP host address>/manager/manager-domain-api is opened from the AP object in the PBX.
{
"mt": "ManagerControls"
}
The ManagerControls message is used to read the list of PBX Manager plugins available on the given domain
{
"mt": "ManagerControlsResult",
"protocol": string,
"ap": string,
"apDn": string,
"host": string,
"controls": [<Control>,...]
}
With this message the list of available PBX Manager plugins is returned
{
"api": [string,...]
"uri": string,
"png": string,
"lang": string
}
Description of an PBX Manager plugin control
{
"mt": "InstanceDomain",
"path": string,
"pwd": string,
}
Used to set a domain on an App Instance, which may be used by multiple domains. As domain the domain used for the login to the AP is used.
{
"mt": "InstanceDomainResult",
"error": string
}
Returns the result for SetInstanceDomain
{
"mt": "SetInstancePassword",
"path": string,
"pwd": string
}
Used to set the password of an instance. On success, the instance is edited with the new password and an AppWebsocket connection can then be established.
{
"mt": "SetInstancePasswordResult",
"error": string
}
Returns the result for SetInstancePassword
{
"mt": "GetInstanceLogin",
"path": string,
"app": string,
"challenge": string,
}
Used to get a login for a given instance. This maybe used in the fgetlogin callback of the AppWebsocket connection. With this it is possible to authenticate at instances without an App Object present in the PBX, just by having access to the App Platform Manager.
{
"mt": "GetInstanceLoginResult",
"app": string,
"sip": string,
"domain": string,
"guid": string,
"dn": string,
"digest": string
}
The login, which can be used for the App Instance. This object can directly passed to the login function of the AppWebsocket library.


The current API base url is {{base}}api.v1
Request payloads are expected to be JSON
Request payloads are expected to be JSON
blua.blue offers a REST-API you may use to
If you don't have an account, please register.
To obtain a valid token, send a POST request to {{base}}api.v1/login including username & password
JavaScript example:fetch({{base}}api.v1/login, { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({username:'coolDude99', password:'S0m3Security'}) }).then(response =>{ // use response.data.token })
Other than POST /resetPassword, POST /login, and PUT /register, you will need to send a valid token with all requests.
JavaScript example:fetch({{base}}api.v1/article?slug=my-cool-article, { method: 'GET', headers: { 'Authorization': 'Bearer '+ myToken, 'Content-Type': 'application/json', } }).then(response =>{ let article = response.data; })


"CN=Steve Kille, O=Isode Limited, C=GB"
It consist of the following RDNs:The classes below that are available in JDK 5.0 represent the DN and RDN respectively.
The LdapName class implements the javax.naming.Name interface similar to the javax.naming.CompoundName and javax.naming.CompositeName classes.
LdapName and Rdn classes allow easy manipulation of DNs and RDNs. Using these APIs it's easy to construct an RDN by pairing up names and values. A DN can be constructed with a list of RDNs. Similarly the individual components of DN and RDN can be retrieved from their string representation.
String name = "cn=Mango,ou=Fruits,o=Food"; try { LdapName dn = new LdapName(name); System.out.println(dn + " has " + dn.size() + " RDNs: "); for (int i = 0; i < dn.size(); i++) { System.out.println(dn.get(i)); } } catch (InvalidNameException e) { System.out.println("Cannot parse name: " + name); }
cn=Mango,ou=Fruits,o=Food has 3 RDNs: o=Food ou=Fruits cn=Mango
The LdapName class contains methods to access its components as RDNs and strings, to modify an LdapName, to compare two LdapNames for equality, and to get a string representation of the name.
getRdn(int posn)
get(int posn)
getRdns()
getAll()
getPrefix(int posn)
getSuffix(int posn)
clone()
To retrieve the component at a particular position within an LdapName, you use getRdn() or get(). The previous constructor example shows an example of its use. getRdns() returns a list of all the RDNs and getAll() returns all of the components of an LdapName as an enumeration.
The right most RDN is at index 0, and the left most RDN is at index n-1. For example, the distinguished name: "cn=Mango, ou=Fruits, o=Food" is numbered in the following sequence ranging from 0 to 2: {o=Food, ou=Fruits, cn=Mango}
You can also get a LdapNames's suffix or prefix as a LdapName instance. Here's an example that gets the suffix and prefix of an LDAP name.
LdapName dn = new LdapName("cn=Mango, ou=Fruits, o=Food"); Name suffix = dn.getSuffix(1); // 1 <= index < cn.size() Name prefix = dn.getPrefix(1); // 0 <= index < 1
cn=Mango ou=Fruits o=Food
add(Rdn rdn)
add(String comp)
add(int posn, String comp)
addAll(List suffixRdns)
addAll(Name suffix)
addAll(int posn, List suffixRdns)
addAll(int posn, Name suffix)
remove(int posn)
After creating an LdapName instance, you can add and remove components from it. Here's an example that appends an LdapName to an existing LdapName, adds components to the front and the end, and removes the second component.
LdapName dn = new LdapName("ou=Fruits,o=Food"); LdapName dn2 = new LdapName("ou=Summer"); System.out.println(dn.addAll(dn2)); // ou=Summer,ou=Fruits,o=Food System.out.println(dn.add(0, "o=Resources")); // ou=Summer,ou=Fruits,o=Food,o=Resources System.out.println(dn.add("cn=WaterMelon")); // cn=WaterMelon,ou=Summer,ou=Fruits,o=Food,o=Resources System.out.println(dn.remove(1)); // o=Food System.out.println(dn); // cn=WaterMelon,ou=Summer,ou=Fruits,o=Resources
compareTo(Object name)
equals(Object name)
endsWith(List)
endWith(Name name)
startsWith(List rdns)
startsWith(Name name)
isEmpty()
You can use compareTo() to sort a list of LdapName instances. equals() lets you determine whether two LdapNames are syntactically equal. Two LdapNames are equal if they both have the same (case-exact matched) components in the same order.
With startsWith() and endsWith(), you can learn whether an LdapName starts or ends with another LdapName; that is, whether an LdapName is a suffix or prefix of another LdapName.
The convenience method isEmpty() enables you to determine whether an LdapName has zero components. You can also use the expression size() == 0 to perform the same check.
Here is an example that uses some of these comparison methods.
LdapName one = new LdapName("cn=Vincent Ryan, ou=People, o=JNDITutorial"); LdapName two = new LdapName("cn=Vincent Ryan"); LdapName three = new LdapName("o=JNDITutorial"); LdapName four = new LdapName(""); System.out.println(one.equals(two)); // false System.out.println(one.startsWith(three)); // true System.out.println(one.endsWith(two)); // true System.out.println(one.startsWith(four)); // true System.out.println(one.endsWith(four)); // true System.out.println(one.endsWith(three)); // false System.out.println(one.isEmpty()); // false System.out.println(four.isEmpty()); // true System.out.println(four.size() == 0); // true
When you use the LdapName constructor, you supply the string representation of an LDAP name and get back an LdapName instance. To do the reverse, that is, to get the string representation of an LdapName instance, you use toString(). The result of toString() can be fed back to the constructor to produce a LdapName instance that is equal to the original LdapName instance. Here's an example.
LdapName dn = new LdapName(name); String str = dn.toString(); System.out.println(str); LdapName dn2 = new LdapName(str); System.out.println(dn.equals(dn2)); // true
// Create the initial context Context ctx = new InitialContext(env); // An LDAP name LdapName dn = new LdapName("ou=People,o=JNDITutorial"); // Perform the lookup using the dn Object obj = ctx.lookup(dn);
while (answer.hasMore()) { SearchResult sr = (SearchResult) answer.next(); String name = sr.getNameInNamespace(); System.out.println(name); LdapName dn = new LdapName(name); // do something with the dn }