Class AlignSelf
Defines how an individual flex-item is laid out along the flex-line's cross axis.
Inheritance
Inherited Members
Namespace: Flexor
Assembly: Flexor.dll
Syntax
public static class AlignSelf
Properties
| Improve this Doc View SourceAuto
The individual flex-item inherits the flex-line's item alignment value. The individual item is rendered this way consistently across all CSS media query breakpoints.
Declaration
public static IAlignSelf Auto { get; }
Property Value
| Type | Description |
|---|---|
| IAlignSelf |
Baseline
The individual item is aligned as their baseline is aligned. The individual item is rendered this way consistently across all CSS media query breakpoints.
Declaration
public static IAlignSelf Baseline { get; }
Property Value
| Type | Description |
|---|---|
| IAlignSelf |
Center
The individual item is aligned along the center of the flex-line's cross axis. The individual item is rendered this way consistently across all CSS media query breakpoints.
Declaration
public static IAlignSelf Center { get; }
Property Value
| Type | Description |
|---|---|
| IAlignSelf |
End
The individual item is aligned along the end of the flex-line's cross axis. The individual item is rendered this way consistently across all CSS media query breakpoints.
Declaration
public static IAlignSelf End { get; }
Property Value
| Type | Description |
|---|---|
| IAlignSelf |
Is
The individual item will be rendered using default item alignment. Rendering is configurable based on CSS media query breakpoints.
Declaration
public static IFluentAlignSelf Is { get; }
Property Value
| Type | Description |
|---|---|
| IFluentAlignSelf | The item alignment configuration. |
Start
The individual item is aligned along the start of the flex-line's cross axis. The individual item is rendered this way consistently across all CSS media query breakpoints.
Declaration
public static IAlignSelf Start { get; }
Property Value
| Type | Description |
|---|---|
| IAlignSelf |
Stretch
The individual item is stretched along the entirety of the flex-line's cross axis. The individual item is rendered this way consistently across all CSS media query breakpoints.
Declaration
public static IAlignSelf Stretch { get; }
Property Value
| Type | Description |
|---|---|
| IAlignSelf |


[ all classes ]
[ opennlp.tools.util.ext ]
Coverage Summary for Class: OSGiExtensionLoader (opennlp.tools.util.ext)
| Class | Class, % | Method, % | Line, % |
|---|---|---|---|
| OSGiExtensionLoader | 0% (0/ 1) | 0% (0/ 5) | 0% (0/ 25) |
1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18 package opennlp.tools.util.ext;
19
20 import org.osgi.framework.BundleActivator;
21 import org.osgi.framework.BundleContext;
22 import org.osgi.framework.Filter;
23 import org.osgi.framework.FrameworkUtil;
24 import org.osgi.framework.InvalidSyntaxException;
25 import org.osgi.util.tracker.ServiceTracker;
26
27 /**
28 * OSGi bundle activator which can use an OSGi service as
29 * an OpenNLP extension.
30 *

31 * Note: Do not use this class, internal use only!
32 */
33 public class OSGiExtensionLoader implements BundleActivator {
34
35 private static OSGiExtensionLoader instance;
36
37 private BundleContext context;
38
39 public void start(BundleContext context) throws Exception {
40 instance = this;
41 this.context = context;
42 ExtensionLoader.setOSGiAvailable();
43 }
44
45 public void stop(BundleContext context) throws Exception {
46 instance = null;
47 this.context = null;
48 }
49
50 /**
51 * Retrieves the
52 *
53 * @param clazz
54 * @param id
55 * @return
56 */
57 <T> T getExtension(Class<T> clazz, String id) {
58
59 if (context == null) {
60 throw new IllegalStateException("OpenNLP Tools Bundle is not active!");
61 }
62
63 Filter filter;
64 try {
65 filter = FrameworkUtil.createFilter("(&(objectclass=" + clazz.getName() + ")(" +
66 "opennlp" + "=" + id + "))");
67 } catch (InvalidSyntaxException e) {
68 // Might happen when the provided IDs are invalid in some way.
69 throw new ExtensionNotLoadedException(e);
70 }
71
72 // NOTE: In 4.3 the parameters are <T, T>
73 ServiceTracker extensionTracker = new ServiceTracker(context, filter, null);
74
75 T extension = null;
76
77 try {
78 extensionTracker.open();
79
80 try {
81 extension = (T) extensionTracker.waitForService(30000);
82 } catch (InterruptedException e) {
83 Thread.currentThread().interrupt();
84 }
85 } finally {
86 extensionTracker.close();
87 }
88
89 if (extension == null) {
90 throw new ExtensionNotLoadedException("No suitable extension found. Extension name: " + id);
91 }
92
93 return extension;
94 }
95
96 static OSGiExtensionLoader getInstance() {
97 return instance;
98 }
99 }


{% extends "submit/base.html" %} {% block title -%}Add or Edit Optional Metadata{%- endblock title %} {% block within_content %}
{{ field.description|safe }}
If this article has not yet been published elsewhere, this information can be added at any later time without submitting a new version.


|
Generated by JDiff |
|||||||
| PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES | DETAIL: REMOVED | ADDED | CHANGED |
| Removed Classes | |
|
|
This is the logical operator for the Fragment Replicate Join It holds the user specified information and is responsible for the schema computation. |
| Added Classes | |
|
|
A visitor to track the casts in a plan. |
|
|
|
|
|
Enum for the type of group |
|
|
|
|
|
Enum for the type of join |
|
|
This Visitor works on the filter condition of a LOFilter which immediately follows a LOLoad that interacts with a metadata system (currently OWL) to read table data. |
|
|
A class to visit all the projects and change them to attach to a new node. |
|
|
A visitor to calculate all the projection maps in a logical plan. |
|
|
A visitor to reset all the projection maps in a logical plan. |
|
|
|
|
|
A visitor to track the UDFs in a plan. |
| Changed Classes | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
LOStream represents the specification of an external command to be executed in a Pig Query. |
|
|
|
|
|
A visitor mechanism for navigating and operating on a tree of Logical Operators. |
|
|
Parent for all Logical operators. |
|
|
|
|
|
A visitor to set plans correctly inside logical operators. |
|
|
A visitor to walk operators that contain a nested plan and translate project( * ) operators to a list of projection operators i.e. |
|
||||||||
| PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES |


MONSTER CITY
Forget username or password?
New User?
Sign up now
Failure
CREATE ACCOUNT
Username
Email
Password
Confirm Password
Sign up
Already have an account?
Sign in now
Monster Spotted!
What kind of monster did you find?
Select Monster
Yool
Boodoo
Blabbit
Hoola
Jeeode
Jellbilly
What's it doing?
Submit
+
Type Discovered
Journal
Settings
Change Password
Message Notifications
About Monster City
Logout
User Info
Change Password
Old Password
New Password
Confirm Password
Upload Photo
Choose Image
Message Notifications
About Monster City
Monster Profile
+
Monster Info
Monster Info
Name
Type
Breed
Ability
Description
Select Location
Describe the Monster
Description


Calva REPL - version 0.0.1
Copyright (c) 2019 Matt Seddon, Peter Strömberg / Better Than Tomorrow
This is alpha software. Things
will
break. You have been warned.


Neural network with unbounded activation functions is universal approximator
Sonoda S., Murata, N. Applied and Computational Harmonic Analysis Volume 43, Issue 2, September 2017, Pages 233-268 https://doi.org/10.1016/j.acha.2015.12.005
This paper presents an investigation of the approximation property of neural networks with unbounded activation functions, such as the rectified linear unit (ReLU), which is the new de-facto standard of deep learning. The ReLU network can be analyzed by the ridgelet transform with respect to Lizorkin distributions. By showing three reconstruction formulas by using the Fourier slice theorem, the Radon transform, and Parseval’s relation, it is shown that a neural network with unbounded activation functions still satisfies the universal approximation property. As an additional consequence, the ridgelet transform, or the backprojection filter in the Radon domain, is what the network learns after backpropagation. Subject to a constructive admissibility condition, the trained network can be obtained by simply discretizing the ridgelet transform, without backpropagation. Numerical examples not only support the consistency of the admissibility condition but also imply that some non-admissible cases result in low-pass filtering.


Issue 3504: [Firebug lite] jQuery.ajax call fails in IE
test markup
Steps to reproduce
- Load Firebug Lite
- Load jQuery
- Execute the following code:
var success = false; $.ajax({ url: "test.txt", success: function() { success = true; }, complete: function() { // success variable should hold the "true" value here } });
Expected Result
- The success variable should hold the "true" value after the XHR completes
- There should be one log entry in the Console Panel


March 28
But God's free gift is not at all to be compared to the trespass...For if many died through one man's falling away--his lapse, his offense--much more profusely did God's grace and the free gift [that comes] through...Jesus Christ, abound and overflow to and for [the benefit of] many.
Romans 5:15
If you ever need someone to tell you how to turn things around, go to God. He's an expert on the subject. He's suffered more losses than anyone who's ever lived.
Just think about it. He lost Lucifer, His top-ranked, most anointed angel. And He lost at least a third of His other angels as well when Lucifer fell. Then He lost the man and woman He had created; and because He'd given them dominion
over the earth, when He lost them, He lost it too. Any way you figure it, that's a lot of real estate down the drain!
Yet, in spite of all that, God is no loser. He's the greatest winner of all time. Do you know why? Because He knows how to turn the losses around. He knows how to use the law of giving and receiving to transform losses into gains.
"Give, and it shall be given unto you; good measure, pressed down, and shaken together, and running over" (Luke 6:38).
Isn't that staggering? He had every option that exists to choose from to redeem the things He'd lost. He had all wisdom and all power available to Him. Out of all that, the law of giving is what He chose to use.
He gave the most irreplaceable thing He had: His only Son. Then He backed that gift with His own faith. And when the law of giving and receiving had done its work, the Almighty Father God received not only His first begotten Son, but millions of other sons as well.
Don't despair over your losses. Redeem them the same way God redeemed His. Give and put the most powerful principle in the universe to work for you. Scripture Reading: John 3:12-21


Step 1
Step 2
Step 3
Collection Date required.
Delivery Date required.
Your Source Location required.
Your Source Place required.
Your Source PinCode is required.
Enter valid Pin Code.
Your Source Flat Number is required.
Your Lift info required.
Your Destination Location required.
Your Destination Place required.
Your Destination PinCode is required.
Your Destination Flat Number is required.
Select Service Type.
Your Travel Category required.
Email is required.
Enter a valid email.
Your Mobile Number is required.
Enter a valid contactno.


nips nips2011 nips2011-132 nips2011-132-reference knowledge-graph by maker-knowledge-mining
Source: pdf
Author: Hai-son P. Le, Ziv Bar-joseph
Abstract: Determining interactions between entities and the overall organization and clustering of nodes in networks is a major challenge when analyzing biological and social network data. Here we extend the Indian Buffet Process (IBP), a nonparametric Bayesian model, to integrate noisy interaction scores with properties of individual entities for inferring interaction networks and clustering nodes within these networks. We present an application of this method to study how microRNAs regulate mRNAs in cells. Analysis of synthetic and real data indicates that the method improves upon prior methods, correctly recovers interactions and clusters, and provides accurate biological predictions. 1


When selected via the "Wizard Select Database or File" page, you will be given the option to restrict the Compare, Merge, Synchronize or Export based on your selected criteria. You will also be able to restrict which fields are Compared, Synchronized or Exported.
The criteria specified here for a particular function are remembered for this Password session and are independent of each other. If you close and exit Password Safe and then restart it, they will be reset to 'no restrictions' and the corresponding default fields for these functions.
Should you specify any restrictions or field selection but do not want to use them this time, then press the Back button and uncheck the "Advanced field selection criteria" on the "Wizard Select Database or File" page. The values you have specified for the "Advanced field selection criteria" will still remain but will not be used.
If you wish to reset these values to the default for the function, press the Reset button. Resetting the values for, say, Compare will not reset the values for the other functions supported e.g. Merge, Synchronize or Export.
When selected via the Advanced button on the Find Toolbar, you will be given the option to restrict the search based on your selected criteria. You will also be able to restrict which fields are examined.
The criteria specified here for a search are remembered for this Password session and are independent of those mentioned above. If you close and exit Password Safe and then restart it, they will be reset to 'no restrictions' and the corresponding default fields for a search.
Should you specify any restrictions or field selection but do not want to use them this time, then either press the Cancel button or press the OK button and uncheck the Advanced button on the Find Toolbar. The values you have specified for the "Advanced field selection criteria" will still remain but will not be used.
If you wish to reset these values to the default for search, press the Reset button. Resetting the search values will not reset the values for the other functions mentioned above.
After comparing two databases, if they are not identical, a Compare Results dialog is displayed. By right clicking on the 'Y' is the relevant column, a context menu is displayed. For entries in the current database, the only allowed option is to directly Edit (View if the database was opened in read-only mode) this entry. For entries in the comparison database, the options are View, Copy to the original database and Synchronize.
If Synchronize is chosen, then a small Advanced dialog is display allowing the user to select which fields to synchronize.
The criteria specified here for a particular function are remembered for this Password session and are independent of each other. If you close and exit Password Safe and then restart it, they will be reset to the corresponding default fields for these functions.


We exchange networks!
- iterate intuitive niches
- whiteboard rich content
- streamline open-source communities
- integrate robust users
- transition enterprise e-tailers
- engineer global relationships
- whiteboard back-end communities
- empower robust markets
- reinvent integrated platforms
- evolve customized metrics
- iterate viral infrastructures


nips nips2004 nips2004-181 nips2004-181-reference knowledge-graph by maker-knowledge-mining
Source: pdf
Author: Jochen Triesch
Abstract: This paper explores the computational consequences of simultaneous intrinsic and synaptic plasticity in individual model neurons. It proposes a new intrinsic plasticity mechanism for a continuous activation model neuron based on low order moments of the neuron’s ﬁring rate distribution. The goal of the intrinsic plasticity mechanism is to enforce a sparse distribution of the neuron’s activity level. In conjunction with Hebbian learning at the neuron’s synapses, the neuron is shown to discover sparse directions in the input. 1
[1] R. Baddeley, L. F. Abbott, M.C. Booth, F. Sengpiel, and T. Freeman. Responses of neurons in primary and inferior temporal visual cortices to natural scenes. Proc. R. Soc. London, Ser. B, 264:1775–1783, 1998.
[2] A. J. Bell and T. J. Sejnowski. An information-maximization approach to blind separation and blind deconvolution. Neural Computation, 7:1129–1159, 1995.
[3] B. S. Blais, N. Intrator, H. Shouval, and L. N. Cooper. Receptive ﬁeld formation in natural scene environments. Neural Computation, 10:1797–1813, 1998.
[4] P. F¨ ldi´ k. Forming sparse representations by local anti-hebbian learning. Biological Cyberneto a ics, 64:165–170, 1990.
[5] S. Hochreiter and J. Schmidhuber. Feature extraction through LOCOCODE. Neural Computation, 11(3):679–714, 1999.
[6] A. Hyv¨ rinen and E. Oja. Independent component analysis by general nonlinear hebbian-like a learning rules. Signal Processing, 64(3):301–313, 1998.
[7] M. Stemmler and C. Koch. How voltage-dependent conductances can adapt to maximize the information encoded by neuronal ﬁring rate. Nature Neuroscience, 2(6):521–527, 1999.
[8] W. E. Vinje and J. L. Gallant. Sparse coding and decorrelation in primary visual cortex during natural vision. Science, 287:1273–1276, 2000.
[9] W. Zhang and D. J. Linden. The other side of the engram: Experience-driven changes in neuronal intrinsic excitability. Nature Reviews Neuroscience, 4:885–900, 2003.


{% extends "_layouts/base.html" %} {% block content %}
We are a group of technology and Free software enthusiasts who live in and around Chicago, Illinois. While our group primarily focuses on GNU/Linux, our members have a broad range of interests and experience, and our ranks include users of all major (and less major) operating systems.
We are also a welcoming group. We are a group that welcomes everyone and encourages diversity; we encourage participation from members of all age, gender, ethnicity, and knowledge levels. If you're curious about Linux and Free and open-source software, consider joining us.


You need to enable JavaScript to run this app.
Welcome!
...
requires a minimum account status of
...
. You may not be allowed access.
Newly created accounts have a status of
default
.
Username
Email
First name
Last name
Password
Repeat password
Passwords don't match!
▼
Got a code to enter? Click and enter it below
Register
Already have an account?
Log in!


--- layout: home ---
As well as working as a Front End Developer I like to work on my own creative projects. My focus switches from speculative concepts to practical applications and it's a great way for me to explore new methods of creative problem solving.
I also do freelance work and have specialization with Wordpress as well as Shopify and other similar platforms. I setup and built all the sites below and constantly backed up and maintained them.
I was asked to make this website mobile friendly and fully responsive.
The site was built on Wordpress and has a large amount of users and images. The main priority was ensuring that
functionality remained after the conversion.
Role: Developer
Stack: Wordpress, HTML, Javascript, SCSS
URL: http://www.insideinside.org
I worked with a team of designers to rebuild the website for a Feet In 2 Worlds.
My role was to ensure that it was fully respsonsive and mobile friendly as well as easy to read and navigate. Also,
making weekly backups and maintainging the site.
Role: Designer & Developer
Stack: Wordpress, HTML, Javascript, SCSS
URL: http://www.seasonsix.co/fi2w
Bootcamp is an intense, pre-entry immersive that is the required entry-point of Parsons legendary MFA Design+Technology program.
I was responsible for building the website and setting up the student accounts and profiles for the program. I also taught the web class to the incoming students.
Role: Backend Developer
Stack: Wordpress, HTML, Javascript, CSS
URL: http://www.bootcamp.parsons.edu
This project came out of a course that I took at Parsons during the first spring semester.
At the end of the semester the class put together a publication with articles that we had
all written, it was my responsibility to design and build the site that our articles would live on.
Role: Designer & Developer
Stack: Wordpress, HTML, Javascript, SCSS
URL: http://mfadt.parsons.edu/darkdata


FITELLIPSE : Least squares ellipse fitting demonstration
Richard Brown, May 28, 2007
Contents
Introduction
This submission is based largely on the paper "Least-Squares Fitting of Circles and Ellipses", W. Gander, G. H. Golub, R. Strebel, BIT Numerical Mathematics, Springer 1994, and provides methods of fitting ellipses based on minimising algebraic distance (linear least squares) and geometric distance (nonlinear least squares)
Linear least squares ellipse fitting - minimising algebraic distance
Least squares fitting of ellipses is a deceptively tricky task. Let's begin by specifying a general equation for an ellipse in 2D
where A is a 2x2 matrix, x = [x; y]. For more than 5 data points, and an appropriate constraint this is an overdetermined linear system, and a least squares solution minimising the algebraic distance
can be found by linear least squares. Different choices of constraint will create different ellipse fits. It is desirable to choose a constraint on the parameters that is invariant under Euclidean transformations, so that you will get the same ellipse fit no matter where the point set is located in the plane. It turns out that any function of the eigenvalues of A is an appropriate such constraint. There are a number of different posibilities, e.g. FEX no. 7012 uses the constraint:
Bookstein (1979) suggested the constraint
And Gander, Golub, and Strebel (1994) suggested
All of which produce linear least squares systems. fitellipse implements the latter two as options 'bookstein' and 'trace' for the 'constraint' property, with 'bookstein' as default. 'plotellipse' can be used to plot the fitted ellipses. We can have a look at the effect of the different constraints as follows:
% A set of points x = [1 2 5 7 9 6 3 8; 7 6 8 7 5 7 2 4]; % Fit an ellipse using the Bookstein constraint [zb, ab, bb, alphab] = fitellipse(x, 'linear'); % Fit an ellipse using the Trace constraint [zt, at, bt, alphat] = fitellipse(x, 'linear', 'constraint', 'trace'); % Plot the results plot(x(1,:), x(2,:), 'ro') hold on axis equal axis([-1 12 1 10]) plotellipse(zb, ab, bb, alphab, 'b--') plotellipse(zt, at, bt, alphat, 'k--') legend('Data points', 'Linear Bookstein fit', 'Linear Trace fit')
Nonlinear ellipse fitting - minising geometric distance
The above methods do not minimise the geometric error i.e. the Euclidean distance of the data points to the fitted ellipse, and as such can produce some undesirable results. The problem is that minising geometric error by least squares is a nonlinear least squares problem, and requires an iterative method to solve it as there is no closed form solution.
fitellipse provides a Gauss-Newton implementation which minimises geometric error. This can be used as follows:
clf [zg, ag, bg, alphag] = fitellipse(x); plot(x(1,:), x(2,:), 'ro') hold on axis equal axis([-2 10 1 12]) plotellipse(zb, ab, bb, alphab, 'b--') plotellipse(zt, at, bt, alphat, 'g--') plotellipse(zg, ag, bg, alphag, 'k') legend('Data points', 'Algebraic best fit - Bookstein constraint', ... 'Algebraic best fit - Trace constraint', ... 'Geometric best fit - nonlinear least squares')
Caveat - fitting circles
There is one potential problem with the Gauss Newton implementation employed here. If the ellipse is in fact a circle, and a == b, then the Jacobian matrix will be rank-deficient and the method may break down. This could be mitigated by switching to a more involved least squares method such as Levenberg-Marquardt, however I don't have the time or inclination to implement this myself, and I have stayed intentionally clear of using lsqnonlin as this requires the optimisation toolbox.
Most of the time this won't affect you, but if it does you can use either one of the linear estimates fitellipse(x, 'linear') as discussed above, or a circle fitting routine e.g. fitcircle http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=15060&objectType=file
References
- FEX 7012: "Stable Direct Least Squares Fit of Ellipses", http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=7012&objectType=FILE
- Bookstein (1979) "Fitting Conic Sections to Scattered Data', F.L. Bookstein, Computer Graphics and Image Processing (1979) pp. 56-71


To view this video please enable JavaScript, and consider upgrading to a web browser that supports HTML5 video


w = mdnpak(net)
w = mdnpak(net)
takes a mixture density
network data structure net
and
combines the network weights into a single row vector w
.
mdn
, mdnunpak
, mdnfwd
, mdnerr
, mdngrad
Copyright (c) Ian T Nabney (1996-9)
David J Evans (1998)


NMatrix is part of SciRuby, a collaborative effort to bring scientific computation to Ruby. If you want to help, please do so!
This guide covers ways in which you can contribute to the development of SciRuby and, more specifically, NMatrix.
How to help¶ ↑
There are various ways to help NMatrix: bug reports, coding and documentation. All of them are important.
First, you can help implement new features or bug fixes. To do that, visit our roadmap or our issue tracker. If you find something that you want to work on, post it in the issue or on our mailing list.
You need to send tests together with your code. No exceptions. You can ask for our opinion, but we won't accept patches without good spec coverage.
We use RSpec for testing. If you aren't familiar with it, there's a good guide to better specs with RSpec that shows a bit of the syntax and how to use it properly. However, the best resource is probably the specs that already exist – so just read them.
And don't forget to write documentation (we use RDoc). It's necessary to allow others to know what's available in the library. There's a section on it later in this guide.
We only accept bug reports and pull requests in GitHub. You'll need to create a new (free) account if you don't have one already. To learn how to create a pull request, please see this guide on collaborating.
If you have a question about how to use NMatrix or SciRuby in general or a feature/change in mind, please ask the sciruby-dev mailing list.
Thanks!
Coding¶ ↑
To start helping with the code, you need to have all the dependencies in place:
-
ATLAS and LAPACK
-
GCC 4.3+
-
git
-
Ruby 1.9+
-
bundler
gem
Now, you need to clone the git repository:
$ git clone git://github.com/SciRuby/nmatrix.git $ cd nmatrix $ bundle install $ rake compile $ rake spec
This will install all dependencies, compile the extension and run the specs.
If everything's fine until now, you can create a new branch to work on your feature:
$ git branch new-feature $ git checkout new-feature
Before commiting any code, please read our Contributor Agreement.
Guidelines for interfacing with C/C++¶ ↑
NMatrix uses a lot of C/C++ to speed up execution of processes and give more control over data types, storage types, etc. Since we are interfacing between two very different languages, things can get out of hand pretty fast.
Please go thorough this before you create any C accessors:
-
Perform all pre-computation error checking in Ruby.
-
Since this is (mostly) a trivial computation, doing this in Ruby before calling the actual C code will save immensely on time needed to read and write code. Plus, one won't need to write obscure code for accessing NMatrix attributes in C code (
NM_SHAPE0(obj)
for example), saving both the readers' and writers' time.
-
-
Curate any extra data (cloned objects, trivial computations, etc.) in Ruby.
-
Every private/protected function name implemented in C MUST start and end with double underscores, and this name must be the same as the name of the Ruby function that will call the computation.
-
For example, for
#solve
, you'll see a functiondef solve .. end
; inside of which is a protected function implemented in C, which is called__solve__
.
-
-
The corresponding extern “C” exposed function should have a name format
nm_#{function_name}
, this function should call a C++ function which should follow a conventionnm_#{sub_namespace}_#{function_name}
and the C++ templated function that is called by this function should be inside a namespacenm::#{sub_namespace}
.-
For example, the C accessor for
__solve__
isnm_solve
, and the C++ templated function called bynm_solve
isnm::math::solve
.
-
-
Do NOT resolve VALUE into constituent elements unless they reach the function where the elements are needed or it is absolutely necessary. Passing around a VALUE in the C/C++ core is much more convienient than passing around
void*
pointers which point to an array of matrix elements.-
If you'll look at this line, you'll notice that matrix elements aren't resolved until the final step i.e. passing the elements into the
nm::math::solve
function for the actual computation.
-
Basically, follow a practice of 'once you enter C, never look back!'.
If you have something more in mind, discuss it in the issue tracker or on this thread.
C/C++ style guide¶ ↑
This section is a work in progress. Add stuff to it whenever you feel that something should be stated explicitly, but isn't.
-
Single statements following a
if
/while
/for
etc. should be preferably on the same line and enclosed within braces. -
Use camel_case notation for arguments. No upper case.
-
Write a brief description of the arguments that your function receives in the comments directly above the function.
-
Explicitly state in the comments any anomalies that your function might have. For example, that it does not work with a certain storage or data type.
Documentation¶ ↑
There are two ways in which NMatrix is being documented: guides and comments, which are converted with RDoc into the documentation seen in sciruby.com.
If you want to write a guide on how to use NMatrix to solve some problem or simply showing how to use one of its features, write it as a wiki page and send an e-mail on the mailing list. We're working to improve this process.
If you aren't familiar with RDoc syntax, this is the official documentation.
Conclusion¶ ↑
This guide was heavily based on the Contributing to Ruby on Rails guide.


--- title: "Grocery Shopping & Personality" author: "Wesley Gardiner" date: "9/8/2021" output: html_document ---
If you’re a data fanatic like me, I like to look at Kaggle for different data sets that I can have fun with in my free time. Since starting Grad school I’ve already learned a whole bunch of great information on regression, psychometric reliability/validity, and getting aquinted with the literature. However, this post is going to be using an analysis I learned in Undergrad called the “Market Basket Analysis” (MB)
I encountered MB Analysis in my Intro to Data and Text Mining class and ever since then I’ve been trying to find ways to implement it within things I’m interested in.
There’s an old saying:
“When you have a hammer, everything looks like a nail.” - Unknown
This is very much my experience with MB analysis. I thought it was a really practical analysis.
Let’s first dive into the under the hood of MB analysis
One question you might be asking is: “Wesley, why do they call it the ‘Market Basket’ analysis?” Great question!
If we think of a market basket (or shopping cart) we have different items that we purchase throughout our visit to the store.
The main purpose of a MB analysis is to look at which items are bought together. In other words, find the association between items within a transaction.
We use association rules to mine different “if, then” statements from our data.
Let’s look at an example:
Say I have a data set in which cheese and wine are both bought together. Our algorithm will make a proposition like:
{Wine} => {Cheese}
There are 3 main types of metrics used to evaluate a proposition:
Support is how much an item appears in the data set.
If {Wine}
has a support of 0.2, that means it occurs 20% of transactions (or shopping carts)
Formula:
Confidence is how often the rule is true.
If {Wine} => {Cheese}
has a confidence of 0.5, that means it has been true in 50% of the shopping carts (or transactions).
Formula:
Lift is the ratio of the support to the independence of the item(s).
If {Wine} => {Cheese}
has a lift of 2.5, that means it occurs 2.5 times more than if people were to just buy {Wine}
itself.
Formula:
Good question!
Kaggle has a data set of the Big Five Personality Test that has ~ 1 million responses to 50 questions (10 per trait).
Let’s take a step back and abstract MB & the BFI Personality test.
Imagine we are in a shopping plaza. There are 5 stores, each for the different personality traits. (Extraversion store, Openness store, …)
I go to the Extraversion store and go through the 10 different aisles and pick out 1 unique item per aisle.
We can use MB analysis to look at my shopping cart for each store I go to.
library(arules) # Association Rules
library(dplyr)
Load in data:
(I sampled the original data set for the purpose of this post; n = 1000
)
sampled_data <- readr::read_csv(
here::here(
"content",
"post",
"2021-09-08-arules_mining",
"sampled_data.csv"
)
)
Taking a look at our data:
knitr::kable(head(sampled_data))
| id | EXT1 | EXT2 | EXT3 | EXT4 | EXT5 | EXT6 | EXT7 | EXT8 | EXT9 | EXT10 | EST1 | EST2 | EST3 | EST4 | EST5 | EST6 | EST7 | EST8 | EST9 | EST10 | AGR1 | AGR2 | AGR3 | AGR4 | AGR5 | AGR6 | AGR7 | AGR8 | AGR9 | AGR10 | CSN1 | CSN2 | CSN3 | CSN4 | CSN5 | CSN6 | CSN7 | CSN8 | CSN9 | CSN10 | OPN1 | OPN2 | OPN3 | OPN4 | OPN5 | OPN6 | OPN7 | OPN8 | OPN9 | OPN10 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 664928 | 3 | 2 | 4 | 2 | 3 | 2 | 3 | 2 | 3 | 3 | 2 | 4 | 3 | 2 | 4 | 3 | 2 | 2 | 2 | 2 | 2 | 4 | 1 | 3 | 3 | 4 | 2 | 4 | 4 | 4 | 3 | 2 | 3 | 2 | 3 | 2 | 3 | 3 | 4 | 3 | 3 | 2 | 3 | 3 | 4 | 1 | 4 | 3 | 3 | 4 |
| 814515 | 3 | 1 | 5 | 2 | 4 | 1 | 4 | 2 | 5 | 2 | 4 | 4 | 2 | 3 | 2 | 3 | 4 | 4 | 4 | 3 | 2 | 4 | 1 | 2 | 3 | 5 | 2 | 4 | 3 | 3 | 3 | 5 | 2 | 2 | 2 | 3 | 4 | 3 | 3 | 3 | 3 | 1 | 3 | 2 | 3 | 1 | 4 | 1 | 2 | 3 |
| 911060 | 2 | 3 | 3 | 4 | 3 | 3 | 3 | 4 | 2 | 4 | 3 | 3 | 4 | 3 | 3 | 4 | 3 | 3 | 4 | 3 | 1 | 4 | 2 | 5 | 2 | 4 | 2 | 4 | 4 | 3 | 4 | 1 | 4 | 2 | 4 | 2 | 4 | 3 | 4 | 4 | 3 | 4 | 2 | 1 | 3 | 3 | 3 | 3 | 3 | 2 |
| 358416 | 3 | 2 | 2 | 4 | 2 | 2 | 2 | 3 | 2 | 3 | 4 | 3 | 4 | 1 | 4 | 4 | 4 | 4 | 5 | 4 | 2 | 3 | 4 | 4 | 3 | 4 | 2 | 4 | 3 | 3 | 3 | 2 | 3 | 2 | 2 | 4 | 4 | 3 | 3 | 3 | 4 | 2 | 5 | 1 | 5 | 2 | 4 | 3 | 4 | 4 |
| 689863 | 3 | 3 | 3 | 3 | 4 | 2 | 4 | 2 | 4 | 3 | 1 | 4 | 4 | 3 | 1 | 4 | 3 | 2 | 3 | 3 | 2 | 4 | 1 | 5 | 1 | 3 | 3 | 4 | 5 | 4 | 5 | 2 | 4 | 1 | 1 | 2 | 4 | 3 | 5 | 5 | 3 | 4 | 3 | 2 | 3 | 4 | 5 | 3 | 4 | 2 |
| 648593 | 2 | 3 | 4 | 3 | 4 | 2 | 3 | 3 | 3 | 4 | 4 | 2 | 5 | 2 | 4 | 4 | 4 | 4 | 4 | 4 | 1 | 4 | 2 | 5 | 1 | 5 | 2 | 4 | 4 | 4 | 4 | 3 | 4 | 2 | 2 | 2 | 4 | 2 | 4 | 4 | 4 | 2 | 2 | 2 | 3 | 4 | 5 | 4 | 4 | 2 |
Since we are looking at the responses themselves we need to reverse code the negative items.
neg_questions <- c(
"EXT2", "EXT4", "EXT6", "EXT8", "EXT10", # 5
"EST2", "EST4", # 2
"AGR1", "AGR3", "AGR5", "AGR7", # 4
"CSN2", "CSN4", "CSN6", "CSN8", # 4
"OPN2", "OPN4", "OPN6" # 3
)
sampled_datar <-
sampled_data |>
mutate(across(where(is.numeric), ~ as.character(.x))) |>
mutate(across(all_of(neg_questions), ~ dplyr::recode(.x,
"5" = "1",
"4" = "2",
"3" = "3",
"2" = "4",
"1" = "5")))
When looking at psychometric data it is usually a good idea to implement some sort of removal of careless responses. To do that we can implement 2 simple methods: Long-String and Intra-individual response variability (IRV).
find_longeststring <- function(row_of_data){
dat_rle <- rle(row_of_data)
longest_string <- max(dat_rle$lengths)
return(longest_string)
}
find_longstring_avg <- function(row_of_data){
dat_rle <- rle(row_of_data)
longest_string_avg <- mean(dat_rle$lengths)
return(longest_string_avg)
}
Let’s remove our careless responses
# Calculate Long-String and IRV
careless_data <-
sampled_datar |>
rowwise() |>
mutate(
longest_string = find_longeststring(c_across(EXT1:OPN10)),
avg_longstring = find_longstring_avg(c_across(EXT1:OPN10)),
irv = sd(c_across(EXT1:OPN10))
) |>
ungroup() |>
mutate(
scaled_ls = scale(longest_string),
scaled_avg_ls = scale(avg_longstring),
scaled_irv = scale(irv)
)
## Cut off value of 2 standard deviations
long_string_excluded <-
careless_data |>
filter(scaled_ls <= 2) |>
filter(scaled_avg_ls <= 2) |>
filter(scaled_irv >= -2)
As we can see we are left with 962 results vs 1000 (removed 3.8%)
Now, one cavet to the algorithm we are going to be using today (the apriori()
) is each item needs to be unique in each cart. Not only that, but the function requires a specific format of data.
To do this I am going to factorize each item as such:
q
= question number (1-10)a
= answer (1-5)factorize_item <- function(aisle_number, aisle_item){
item_factor <- paste0("q", aisle_number,"_" ,"a", aisle_item)
return(item_factor)
}
ext_store <-
long_string_excluded |>
select(EXT1:EXT10)
# Since I was working with sample data
# I noticed sometimes I would get "NULL"
# values, so if you run into that in your
# own analysis:
ext_store <-
ext_store |>
filter(
across(
.cols = everything(),
.fns = ~ !stringr::str_detect("NULL", .x)
)
)
Using map_dfr()
we can apply to our Extraversion Store.
for (i in 1:10) {
ext_store[,i] <- purrr::map_dfr(.x = ext_store[,i], ~ factorize_item(i, .x))
}
Let’s take a look:
knitr::kable(head(ext_store))
| EXT1 | EXT2 | EXT3 | EXT4 | EXT5 | EXT6 | EXT7 | EXT8 | EXT9 | EXT10 |
|---|---|---|---|---|---|---|---|---|---|
| q1_a3 | q2_a4 | q3_a4 | q4_a4 | q5_a3 | q6_a4 | q7_a3 | q8_a4 | q9_a3 | q10_a3 |
| q1_a3 | q2_a5 | q3_a5 | q4_a4 | q5_a4 | q6_a5 | q7_a4 | q8_a4 | q9_a5 | q10_a4 |
| q1_a2 | q2_a3 | q3_a3 | q4_a2 | q5_a3 | q6_a3 | q7_a3 | q8_a2 | q9_a2 | q10_a2 |
| q1_a3 | q2_a4 | q3_a2 | q4_a2 | q5_a2 | q6_a4 | q7_a2 | q8_a3 | q9_a2 | q10_a3 |
| q1_a3 | q2_a3 | q3_a3 | q4_a3 | q5_a4 | q6_a4 | q7_a4 | q8_a4 | q9_a4 | q10_a3 |
| q1_a2 | q2_a3 | q3_a4 | q4_a3 | q5_a4 | q6_a4 | q7_a3 | q8_a3 | q9_a3 | q10_a2 |
Now that I have that I just need to combine every row into it’s own basket.
ext_store_b <-
ext_store |>
mutate(basket = paste(EXT1,EXT2,EXT3,EXT4,EXT5,
EXT6,EXT7,EXT8,EXT9,EXT10,
sep = ","))
baskets <-
ext_store_b |>
select(basket)
The apriori()
function requires a specific data structure. The code below isn’t pretty but it does the trick!
transaction_list <-
list()
for (i in seq_along(1:nrow(baskets))) {
counter <- 1
row <- as.character(ext_store[i,])
transaction_list[[i]] <- c(row[counter],row[counter+1],row[counter+2],
row[counter+3],row[counter+4],row[counter+5],
row[counter+6],row[counter+7],row[counter+8],
row[counter+9])
}
names(transaction_list) <- paste("Tr",seq_along(1:nrow(ext_store)), sep = "")
transaction_obj <- transactions(transaction_list)
Now that we have our data in the right format, we can create our rules.
m1 <- apriori(transaction_obj,
parameter = list(support = 0.007,
confidence = .95,
minlen = 2))
## Apriori
##
## Parameter specification:
## confidence minval smax arem aval originalSupport maxtime support minlen
## 0.95 0.1 1 none FALSE TRUE 5 0.007 2
## maxlen target ext
## 10 rules TRUE
##
## Algorithmic control:
## filter tree heap memopt load sort verbose
## 0.1 TRUE TRUE FALSE TRUE 2 TRUE
##
## Absolute minimum support count: 6
##
## set item appearances ...[0 item(s)] done [0.00s].
## set transactions ...[50 item(s), 962 transaction(s)] done [0.00s].
## sorting and recoding items ... [50 item(s)] done [0.00s].
## creating transaction tree ... done [0.00s].
## checking subsets of size 1 2 3 4 5 6 7 8 9 done [0.01s].
## writing ... [1470 rule(s)] done [0.00s].
## creating S4 object ... done [0.00s].
rules_df <- DATAFRAME(m1) |>
mutate(LHS = as.character(LHS),
RHS = as.character(RHS))
Let’s look at the results
t <- rules_df |>
filter(!stringr::str_detect(RHS, "a1")) |>
filter(!stringr::str_detect(RHS, "a5"))
knitr::kable(head(t))
| LHS | RHS | support | confidence | coverage | lift | count |
|---|---|---|---|---|---|---|
| {q10_a4,q4_a3,q7_a4} | {q5_a4} | 0.0083160 | 1 | 0.0083160 | 3.498182 | 8 |
| {q10_a4,q3_a5,q7_a2} | {q1_a3} | 0.0083160 | 1 | 0.0083160 | 3.460432 | 8 |
| {q1_a4,q2_a3,q5_a3} | {q4_a3} | 0.0072765 | 1 | 0.0072765 | 3.894737 | 7 |
| {q10_a3,q2_a2,q6_a4} | {q3_a4} | 0.0072765 | 1 | 0.0072765 | 3.657795 | 7 |
| {q2_a2,q7_a1,q9_a4} | {q4_a2} | 0.0072765 | 1 | 0.0072765 | 3.772549 | 7 |
| {q3_a2,q5_a4,q8_a2} | {q4_a2} | 0.0072765 | 1 | 0.0072765 | 3.772549 | 7 |
Saltz, J. S., & Stanton, J. M. (2018). An introduction to data science (First edition). SAGE.


Yort.LatitudePay.InStore Quick Start
Creating a Payment Plan (Taking Payment)
Basic Process
- Create an instance of LatitudePayClient
- Call LatitudePayClient.CreatePosPurchaseAsync
- If the response from of step 2 returns a response with a PaymentPlanToken, use LatitudePayClient.GetPurchaseStatusAsync to poll at five seconds (or longer) intervals until an accepted, declined or CancelPurchaseAsyncled status is reached. Prior to the payment request being accepted, declined or CancelPurchaseAsyncled LatitudePay will return a status of pending. Handle any transient errors thrown from the polling request.

- A status of Approved means the payment is successfully completed, and you need to record the PaymentPlanToken somewhere if you want to be able to process refunds in the future. A status of Declined means the payment was cancelled or failed (i.e due to insufficient credit).
NB This is only a simple/demo implementation. A production quality implementation needs much more robust logic to handle power failure/crash/network outages and other problems.
Add the Nuget package
Install the Nuget package;
PM> Install-Package Yort.LatitudePay.InStore
[]
Full Code Sample
A full (demo quality) code sample for creating payment, with minimum comments/noise. See the following sections for a breakdown of what's going on and why.
ILatitudePayClient client = new LatitudePayClient
(
new LatitudePayClientConfiguration("YourApiKey", "YourClientSecret", LatitudePayEnvironment.Uat)
);
// This is a minimal request, but providing other optional details on the request
// may help first time users sign up/get approved more quickly and/or provide
// a better experience within the LatitudePay portal.
var request = new LatitudePayCreatePosPurchaseRequest()
{
Reference = System.Guid.NewGuid().ToString(),
Customer = new LatitudePayCustomer()
{
MobileNumber = "025555555" // You need to specify the (customer's) mobile number to send the payment request to
},
Products = new LatitudePayProduct[] { new LatitudePayProduct() { Name = "Test", Price = new LatitudePayMoney(35.5M, "NZD"), Quantity = 1, Sku = "Test" } }, // LatitudePay requires at least one item specified
TaxAmount = new LatitudePayMoney(0M, "NZD"),
TotalAmount = new LatitudePayMoney(35.5M, "NZD")
};
request.IdempotencyKey = request.Reference; //Set this to the same value for each request for *this* payment (in the case of retries/crash recovery) to ensure duplicate payments aren't requested.
LatitudePayCreatePosPurchaseResponse result = await client.CreatePosPurchaseAsync(request);
//Wait until payment enters final status
var statusRequest = new LatitudePayPurchaseStatusRequest() { PaymentPlanToken = purchaseResponse.Token };
var finalStatus = false;
LatitudePayPurchaseStatusResponse paymentStatus = null;
while (!finalStatus)
{
await Task.Delay(5000).ConfigureAwait(false); //LatitudePay says you should wait 5 seconds between status polls.
paymentStatus = await client.GetPurchaseStatusAsync(statusRequest).ConfigureAwait(false);
finalStatus = !String.Equals(paymentStatus.Status, LatitudePayConstants.StatusPending, StringComparison.OrdinalIgnoreCase);
}
if (paymentStatus.Status == LatitudePayConstants.StatusApproved)
{
//The payment is approved, store the purchaseResponse.Token somewhere so it can be used for refunds in future if required.
}
else if (paymentStatus.Status == LatitudePayConstants.StatusDeclined)
{
//The payment is declined, get the operator to try again or take some other form of payment etc.
}
Configure and Create A LatitudePayClient Instance
The LatitudePayClient is the main class in this library to use for accessing the LatitudePay API functionality. To create an instance first you must create a LatitudePayClientConfiguration object that tells the client how to behave. This sample configures a client for accessing the sandbox/text version of the API.
You'll need an api key and secret issued by LatitudePay for the sandbox environment for this to work.
Normally you would create the LatitudePay instance on start-up or first use, and then re-use it across requests instead of creating a new one each time. This allows HTTP connection pooling and improves performance. The LatitudePayClient instance is thread-safe in so much as you can run multiple requests through the same instance for different payments from different threads.
//LatitudePay will issue a client id and secret for each environment,
//you need to contact LatitudePay to get these.
var config = new LatitudePayClientConfiguration
(
"YourApiKey",
"YourClientSecret",
LatitudePayEnvironment.Uat)
);
//We use ILatitudePayClient as the type for the variable holding
//the LatitudePayClient instance here as it makes it easier if we
//want a test implementation later.
ILatitudePayClient client = new LatitudePayClient(config);
Call Create POS Purchase
Now we can create an payment plan. Create a LatitudePayCreatePosPurchaseRequest with details of the payment to take, and pass it to the LatitudePayClient.CreatePosPurchaseAsync method.
//We'll set the minimum required properties for this example
var request = new LatitudePayCreatePosPurchaseRequest()
{
Reference = System.Guid.NewGuid().ToString(),
Customer = new LatitudePayCustomer()
{
MobileNumber = "025555555"
},
Products = new LatitudePayProduct[] { new LatitudePayProduct() { Name = "Test", Price = new LatitudePayMoney(35.5M, "NZD"), Quantity = 1, Sku = "Test" } },
TaxAmount = new LatitudePayMoney(0M, "NZD"),
TotalAmount = new LatitudePayMoney(35.5M, "NZD")
};
request.IdempotencyKey = request.Reference; //Set this to the same value for each request for *this* payment (in the case of retries/crash recovery) to ensure duplicate payments aren't requested.
//Note, this method could throw exceptions. Production quality code
//would handle them appropriately.
LatitudePayCreatePosPurchaseResponse result = await client.CreatePosPurchaseAsync(request);
Poll for Status
Now we need to wait for the customer to approve or decline the payment request via the LatitudePay app or website. If they approve the payment then it will be sent by LatitudePay to the payment processor, and if the payment processor accepts then we'll get a completed status. If either the customer or the payment processor declines the response we'll get a CancelPurchaseAsync/declined or error response.
// Create a status request. You can create a new one on each loop or
// reuse the same one, which is more efficient so that's what we do here.
// Unfortunately the LatitudePay status endpoint doesn't use the merchant reference, but
// instead the payment plan token returned by the initial create request. If that initial
// request is interrupted by a crash, power failure, timeout/network error etc.
// you must retry it with duplicate checking enabled until such time as you
// receive an payment plan token you can status check against.
var statusRequest = new LatitudePayPurchaseStatusRequest() { PaymentPlanToken = result.Token };
//Production quality code would also have a timeout, in case the user
//is unable to approve or cancel the payment plan in a timely fashion at
//the till. There should also be an option for the operator to manually
//cancel, in the case where the payment amount has been incorrectly entered
//or the consumer is unable to cancel themselves.
//Wait until payment enters final status
var statusRequest = new LatitudePayPurchaseStatusRequest() { PaymentPlanToken = purchaseResponse.Token };
var finalStatus = false;
LatitudePayPurchaseStatusResponse paymentStatus = null;
while (!finalStatus)
{
await Task.Delay(5000).ConfigureAwait(false); //LatitudePay says you should wait 5 seconds between status polls.
paymentStatus = await client.GetPurchaseStatusAsync(statusRequest).ConfigureAwait(false);
finalStatus = !String.Equals(paymentStatus.Status, LatitudePayConstants.StatusPending, StringComparison.OrdinalIgnoreCase);
}
if (paymentStatus.Status == LatitudePayConstants.StatusApproved)
{
//The payment is approved, store the purchaseResponse.Token somewhere so it can be used for refunds in future if required.
}
else if (paymentStatus.Status == LatitudePayConstants.StatusDeclined)
{
//The payment is declined, get the operator to try again or take some other form of payment etc.
}
CancelPurchaseAsyncling a Payment Plan
To cancel a LatitudePay payment plan that is still pending approval (not accepted or declined) you will need the PaymentPlanToken returned in the LatitudePayCreatePosPurchaseResponse. CancelPurchaseAsync is successful if the CancelPurchaseAsync method does not throw an exception. The LatitudePayCancelPurchaseRequest instance returned will contain the payment plan token and cancellation date as confirmation.
try
{
var cancelRequest = new LatitudePayCancelPurchaseRequest() { PaymentPlanToken = createPlanResult.Token };
var cancelResponse = await client.CancelPurchaseAsync(cancelRequest);
//Cancellation succeeded
}
catch (Exception) // Production code should catch specific exception types
{
//CancelPurchaseAsync failed
}
Refunding a Payment Plan
Once an payment plan has been approved you can make one or more refunds against it, up to the total value of the original payment plan. For each refund create a LatitudePayCreateRefundRequest, specify the payment plan token that was returned when the payment was created, the refund amount and a unique reference for the refund request. Ensure the IdempotentKey is set to a value unique to this refund but common to all retry requests (using the merchant reference for the IdempotentKey is often a good idea). If you get interrupted (power failure, crash, network outage) or suffer a transient error sending a refund, resend the same request again (with the same IdempotentKey value) until you get a valid response. Using the same IdempotentKey value on the retry requests should prevent multiple refunds being created if the earlier attempts did actually succeed.
var refundRequest = new LatitudePayCreateRefundRequest()
{
PaymentPlanToken = purchaseResponse.Token,
Amount = request.TotalAmount,
Reason = "Test refund",
Reference = System.Guid.NewGuid().ToString()
};
try
{
var refundResponse = await client.CreateRefundAsync(refundRequest);
//Refund succeeded, refundResponse.RefundId will contain the id of the new refund.
}
catch (Exception) // Production code should catch specific exception types
{
//Refund failed
}


| PERLMODINSTALL(1) | Perl Programmers Reference Guide | PERLMODINSTALL(1) |
This documentation is for people who want to download CPAN modules and install them on their own computer.
If you don't see an error message, you have the module. (If you do see an error message, it's still possible you have the module, but that it's not in your path, which you can display with "perl -e "print qq(@INC)"".) For the remainder of this document, we'll assume that you really honestly truly lack an installed module, but have found it on the CPAN.
So now you have a file ending in .tar.gz (or, less often, .zip). You know there's a tasty module inside. There are four steps you must now take:
Here's how to perform each step for each operating system. This is <not> a substitute for reading the README and INSTALL files that might have come with your module!
Also note that these instructions are tailored for installing the module into your system's repository of Perl modules, but you can install modules into any directory you wish. For instance, where I say "perl Makefile.PL", you can substitute "perl Makefile.PL PREFIX=/my/perl_directory" to install the modules into /my/perl_directory. Then you can use the modules from your Perl programs with "use lib "/my/perl_directory/lib/site_perl";" or sometimes just "use "/my/perl_directory";". If you're on a system that requires superuser/root access to install modules into the directories you see when you type "perl -e "print qq(@INC)"", you'll want to install them into a local directory (such as your home directory) and use this approach.
You can use Andreas Koenig's CPAN module ( <http://www.cpan.org/modules/by-module/CPAN> ) to automate the following steps, from DECOMPRESS through INSTALL.
A. DECOMPRESS
Decompress the file with "gzip -d yourmodule.tar.gz"
You can get gzip from <ftp://prep.ai.mit.edu/pub/gnu/>
Or, you can combine this step with the next to save disk space:
gzip -dc yourmodule.tar.gz | tar -xof -
B. UNPACK
Unpack the result with "tar -xof yourmodule.tar"
C. BUILD
Go into the newly-created directory and type:
perl Makefile.PL make test
or
perl Makefile.PL PREFIX=/my/perl_directory
to install it locally. (Remember that if you do this, you'll have to put "use lib "/my/perl_directory";" near the top of the program that is to use this module.
D. INSTALL
While still in that directory, type:
make install
Make sure you have the appropriate permissions to install the module in your Perl 5 library directory. Often, you'll need to be root.
That's all you need to do on Unix systems with dynamic linking. Most Unix systems have dynamic linking. If yours doesn't, or if for another reason you have a statically-linked perl, and the module requires compilation, you'll need to build a new Perl binary that includes the module. Again, you'll probably need to be root.
First, type "ppm" from a shell and see whether ActiveState's PPM repository has your module. If so, you can install it with "ppm" and you won't have to bother with any of the other steps here. You might be able to use the CPAN instructions from the "Unix or Linux" section above as well; give it a try. Otherwise, you'll have to follow the steps below.
A. DECOMPRESS
You can use the shareware Winzip ( <http://www.winzip.com> ) to decompress and unpack modules.
B. UNPACK
If you used WinZip, this was already done for you.
C. BUILD
You'll need the "nmake" utility, available at <http://download.microsoft.com/download/vc15/Patch/1.52/W95/EN-US/nmake15.exe> or dmake, available on CPAN. <https://metacpan.org/release/dmake>
Does the module require compilation (i.e. does it have files that end in .xs, .c, .h, .y, .cc, .cxx, or .C)? If it does, life is now officially tough for you, because you have to compile the module yourself (no easy feat on Windows). You'll need a compiler such as Visual C++. Alternatively, you can download a pre-built PPM package from ActiveState. <http://aspn.activestate.com/ASPN/Downloads/ActivePerl/PPM/>
Go into the newly-created directory and type:
perl Makefile.PL nmake test D. INSTALL
While still in that directory, type:
nmake install
A. DECOMPRESS
djtarx ( <ftp://ftp.delorie.com/pub/djgpp/current/v2/> ) will both uncompress and unpack.
B. UNPACK
See above.
C. BUILD
Go into the newly-created directory and type:
perl Makefile.PL make test
You will need the packages mentioned in README.dos in the Perl distribution.
D. INSTALL
While still in that directory, type:
make install
You will need the packages mentioned in README.dos in the Perl distribution.
Get the EMX development suite and gzip/tar, from either Hobbes ( <http://hobbes.nmsu.edu> ) or Leo ( <http://www.leo.org> ), and then follow the instructions for Unix.
When downloading from CPAN, save your file with a ".tgz" extension instead of ".tar.gz". All other periods in the filename should be replaced with underscores. For example, "Your-Module-1.33.tar.gz" should be downloaded as "Your-Module-1_33.tgz".
A. DECOMPRESS
Type
gzip -d Your-Module.tgz
or, for zipped modules, type
unzip Your-Module.zip
Executables for gzip, zip, and VMStar:
http://www.hp.com/go/openvms/freeware/
and their source code:
http://www.fsf.org/order/ftp.html
Note that GNU's gzip/gunzip is not the same as Info-ZIP's zip/unzip package. The former is a simple compression tool; the latter permits creation of multi-file archives.
B. UNPACK
If you're using VMStar:
VMStar xf Your-Module.tar
Or, if you're fond of VMS command syntax:
tar/extract/verbose Your_Module.tar
C. BUILD
Make sure you have MMS (from Digital) or the freeware MMK ( available from MadGoat at <http://www.madgoat.com> ). Then type this to create the DESCRIP.MMS for the module:
perl Makefile.PL
Now you're ready to build:
mms test
Substitute "mmk" for "mms" above if you're using MMK.
D. INSTALL
Type
mms install
Substitute "mmk" for "mms" above if you're using MMK.
Introduce the .tar.gz file into an HFS as binary; don't translate from ASCII to EBCDIC.
A. DECOMPRESS
Decompress the file with "gzip -d yourmodule.tar.gz"
You can get gzip from <http://www.s390.ibm.com/products/oe/bpxqp1.html>
B. UNPACK
Unpack the result with
pax -o to=IBM-1047,from=ISO8859-1 -r < yourmodule.tar
The BUILD and INSTALL steps are identical to those for Unix. Some modules generate Makefiles that work better with GNU make, which is available from <http://www.mks.com/s390/gnu/>
Check the CPAN Testers if a module should work with your platform but it doesn't behave as you'd expect, or you aren't sure whether or not a module will work under your platform. If the module you want isn't listed there, you can test it yourself and let CPAN Testers know, you can join CPAN Testers, or you can request it be tested.
http://testers.cpan.org/
<EMAIL_ADDRESS>with invaluable help from Chris Nandor, and valuable help from Brandon Allbery, Charles Bailey, Graham Barr, Dominic Dunlop, Jarkko Hietaniemi, Ben Holzman, Tom Horsley, Nick Ing-Simmons, Tuomas J. Lukka, Laszlo Molnar, Alan Olsen, Peter Prymmer, Gurusamy Sarathy, Christoph Spalinger, Dan Sugalski, Larry Virden, and Ilya Zakharevich.
First version July 22, 1998; last revised November 21, 2001.
This document may be distributed under the same terms as Perl itself.
| 2020-02-11 | perl v5.30.3 |


Former Nottingham Forest striker enjoying new lease of life following City Ground exit
Latest Nottingham Forest news | The 36-year-old left the Reds in the summer and went on to sign for League One side Bolton Wanderers
by Mark WakefieldFormer Nottingham Forest striker Daryl Murphy is enjoying a new lease of life since his departure from the City Ground.
The 36-year-old left the Reds by mutual consent on transfer deadline day in September, and went on to sign for League One club Bolton Wanderers.
Prior to his Forest exit, the Republic of Ireland international scored 13 goals in 60 appearances for the Reds after his move to Trentside in 2017.
Murphy did not make a single first-team appearance for the Reds under manager Sabri Lamouchi, with his last outing coming against current club Bolton on the final day of last season.
Now at Bolton, the experienced striker has been in a rich vein of form for the Trotters in recent matches.
Murphy opened his account for Bolton in their 2-0 win over Bristol Rovers in October, and followed that up with what proved to be a winning goal in a 2-1 victory over Fleetwood Town earlier this month.
Nottingham Forest latest
This is your round up of all things Forest; the one-stop shop that will keep you updated on the latest goings on at the City Ground and beyond.
Transfers, injuries, match-days and managers, we’ve got you covered.
We’ll be bringing the very latest on the Reds throughout the week and around the clock.
Make sure you keep yourself updated with our handy daily catch up...
Must reads...
- Lamouchi's verdict on Hefele
- Injury update ahead of Bristol City
- Could Reds 'target' be on the move?
- The challenges of delivering Marinakis' vision
For all your latest NFFC news, opinion, analysis and transfer gossip, click here
You can follow our Reds reporter Sarah Clapson on Twitter, and her email address is<EMAIL_ADDRESS>And in more recent matches, Murphy has bagged goals in back-to-back games against MK Dons and Accrington Stanley to take his tally up for four this season.
Those four goals have come in four consecutive appearances for Murphy, and the former Forest man looks to be flourishing away from the City Ground.


Discover Set Version
Enumerate all versions of a set in storage
Parameters
Base URL
Set Name
Send Request
Console
Parsed Response


ABOUT ME
I’ve been working with Javascript, HTML and CSS since all the way back in 2000, when I was 12. Back then I decided to get into programming because I wanted to build things that people would want to use (... and after a friend sold a website for £500 - £847.16 inflation adjusted - I figured I was going to be rich). I started hacking Javascript games, tweaking and experimenting and I haven’t stopped programming like it since.
My interest was piqued after them early days and I decided to study Computer Science at the University of Liverpool, developing my skills in full stack development. Since then there’s been a snowball effect, picking up skills in various programming languages and technologies as I go.
WHERE TO FIND ME
I blog at LimeCoda.com.
And you can find some of the projects I'm working on at my personal GitHub profile and the LimeCoda GitHub profile
TECH
Not an exhaustive list, by any means, but these are some of my favourite technologies to work with.
HTML5 CSS3 JAVASCRIPT NODE.JS PYTHON PHP RUBY GO MYSQL POSTGRESQL MONGODB REDIS REACT ELECTRON


{% load widgets %}
{% if event.followup_needed or event.over %}
Followup Questions
post-event report
{% endif %}
{% event_details %}
Eligibility Questions
select if applicable
Free-Response Questions
Items
list line items for funding
{% if not readonly %}
Heads up!
If you are importing line items from a CSV or Excel file, make sure that your sheet contains the same column names as our online form. Additionally, make sure each category is a valid category in the selection dropdown.
{% endif %}
Funders
select to apply
Extra Questions
specific to each funder
Comments
{% if user.profile.is_funder %}
feel free to leave a message
{% else %}
here are some comments from your potential funders
{% endif %}
{% for comment in event.comments %}
{{ comment.funder }} wrote on {{ comment.created }}
{{ comment }}
{% empty %}
There are no comments yet.
{% endfor %}
{% if user.profile.is_funder %}


--- layout: page title: About ---
This is the personal blog of Joseph "Joey" Bales. All posts represent my personal views and opinions and may not represent the views and opinions of anyone else in particular. This site was resurrected on April 21, 2013. Who knows what happened to the content that came before...
As near as I can tell this site is GDPR compliant, so I see no reason to put any pop-ups or other crap on it. You are not tracked in any way when coming to this site.


Here on Super Unique Tropical Resort Island
There are endless activities to keep you entertained for weeks here on the island!
Here are just a few of the many ammenties and activites our resort offers!
- Jason Bourne cinematography documentery weekend viewings
- Kite Board Rentals
- Surfing Classes
- Guided and Unguided Scuba Diving Excursions
- Hiking to the top of Mt Wannahawkaloogy
- Fishing Expeditions
- And so much more!


Nigerians paid more for kerosene, less for petrol in October - NBS
by Ayodeji AdegboyegaThe National Bureau of Statistics said the average price paid by consumers for kerosene increased in October while the cost of petrol), cooking gas and diesel decreased.
According to a report on its website, consumers paid an average of N324.7 per liter of kerosene in October 2019, reflecting an increase of 1.9 per cent when compared to N318.5 paid in September 2019.
This also reflected a 2.9 per cent increase when compared to what was recorded in October 2018.
‘”Similarly, the average price per gallon paid by consumers for kerosene decreased by -0.61per cent month-on-month and increased by 3.15 per cent year-on-year to N1,209.84 in October 2019 from N1,217.28 in September 2019,” it said.
The bureau also listed states with the highest average price of kerosene as Abuja N253; Nasarawa, N265.61 and Kwara N270.8.
Also, states with the highest average price per gallon of kerosene were listed as Gombe, N1,371; Borno N1,350 and Jigawa, N1,315.
States with the lowest average price per gallon of kerosene were listed as Ogun, Oyo and Osun while states with the highest average price per litre of kerosene were Enugu Imo and Plateau.
Earlier this year, the NNPC, being the sole importer of the product, had attributed the increase in the price of kerosene in the country to the pressure of demand and supply.
It said the variation in the price of kerosene is because it is not as controlled as petrol.
Petrol
In the same report, the average price paid by consumers for petrol decreased by 1.19 per cent when compared to what was recorded in October 2018.
The price decreased by 0.04 per cent to N145.48 in October 2019 from N145.53 in September 2019.
The bureau also listed states with the highest and lowest average prices of petrol, in comparison with the approved government price of N145.
“States with the highest average price of premium motor spirit were Abia, N147; Cross River, N147 and Benue, N147.
“States with the lowest average price of premium motor spirit (petrol) were Abuja, N144; Bauchi, N144 and Zamfara, N144,” it said.
Cooking gas
The average price for the refilling of a 5kg cylinder of cooking gas decreased from N1,976 recorded in September 2019 to N1,967 in October 2019.
This represents a 0.44 per cent decrease when compared to October 2018.
The bureau listed the states with the highest average price for the refilling of a 5kg cylinder of cooking gas as Bauchi, Borno, and Yobe while the states that paid the lowest are kisted as Enugu, Ebonyi, and Delta.
It also said the average price paid by consumers for diesel decreased from N227.92 in September 2019 to N226.19 in October 2019.
This represents a 0.76per cent decrease and 3.13 per cent when compared to October 2018.
“States with the highest average price of diesel were Benue, N265; Borno N257.92 and Abia N243.33.
“States with the lowest average price of diesel were Bauchi, N195; Adamawa N206.67 and Yobe N210.63.


Homework - Instructions¶
WARNING!!! If you see this icon on the top of your COLAB sesssion, your work is not saved automatically.
When you are working on homeworks, make sure that you save often. You may find it easier to save intermident copies in Google drive. If you save your working file in Google drive all changes will be saved as you work. MAKE SURE that your final version is saved to GitHub.
Before you turn this problem in, make sure everything runs as expected. First, restart the kernel (in the menubar, select Kernel → Restart) and then run all cells (in the menubar, select Cell → Run All). You can speak with others regarding the assignment but all work must be your own.
This is a 30 point assignment graded from answers to questions and automated tests that should be run at the bottom. Be sure to clearly label all of your answers and commit final tests at the end.¶
files = "https://github.com/rpi-techfundamentals/introml_website_fall_2020/raw/master/files/assignment6.zip"
!pip install otter-grader && wget $files && unzip -o assignment6.zip
Load Data¶
Here we have 2 files. One we will use for PCA and the other for cluster analysis.
# Load the data here
import pandas as pd
df_cluster = pd.read_csv("cluster.csv")
df_pca = pd.read_csv("pca.csv")
EDA¶
Do some simple exploritory analysis on the data so that you understand the structure of the data.
1. PCA Data Baseline Regression.¶
On the PCA data, perform a 50/50 train test split with random state
equal to 99. Predict y
with all variables using regression analysis.
1a. Calculate the r2 for train and assign to pca1_r2_train
1b. calculate the r2 for test and assign to pca1_r2_test
.
PCA Analysis¶
So you should find that the overall r2 is quite high, but we have a really complex model with 150 predictors. Run PCA with 4, 5, and 6 components. For example, running with 4 components means setting n_components=4
.
Check out the variance explained from each of the numbers of principal components. When you find taht increasing the number of components only increases the variance explained by a small amount. *
After experimenting with 4, 5, and 6 components, explain why 5 is the correct number of components.
man1="""
Answer here
"""
Usign just the 5 PCA components as X, perform a 50/50 train test split with
random state
equal to 99. Predicty
with all variables using regression analysis.
2a. Calculate the r2 for train and assign to pca2_r2_train
.
2b. Calculate the r2 for test and assign to pca2_r2_test
.
Challenge Problem: Feature Selection.¶
While we obtained a decent R2 with PCA, it wasn’t as good as had with the origional data. Rather than dimensionality reduction using principal components, try to use feature selection to get 4 components that explain >99% of the variance.
List those features here.
man2="""
Answer here
"""
3. Cluster Data Baseline Regression¶
On the Cluster data, perform a 50/50 train test split with random state
equal to 99. Predict y
with all variables using regression analysis.
3a. Calculate the r2 for train and assign to cluster1_r2_train
.
3b. calculate the r2 for test and assign to cluster1_r2_test
.
KMeans Cluster Analysis¶
Next perform a cluster analysis using ONLY variables that start with cad0
-cad9
and specify 6 clusters. Set random_state to 99
for KMEANS algorithm. Add the variable df_cluster['cluster']
to the origional dataframe to indicate the cluster membership.
4. Clusters Continued¶
Then select only rows from df_clusterwhich you have assigned to cluster 1. For only cluster 1 predict y
with all variables using regression analysis.
4a. Calculate the r2 for train and assign to cluster2_r2_train
.
4b. calculate the r2 for test and assign to cluster2_r2_test
. Like before set random_state to 99
.
#This runs all tests.
import otter
grader = otter.Notebook()
grader.check_all()


Product Manager
Meelod Waheed is a first-generation Afghan-American at Northern Virginia Community College (NVCC). He is currently studying computer science, concentrating on Machine Learning research and optimization. After NVCC, he hopes to transfer into a top-twenty four-year university to continue pursuing Machine Learning and eventually get into computer vision and creative artificial intelligence. At NVCC, he currently serves as the President of the Phi Theta Kappa chapter, President of the STEAM Club, President of the Cloud Computing Club, and President of the Personal Finance Club. He is also a part of numerous other clubs and organizations at NVCC. He is the Head of Web Development and Design at The Caring Consultants. His role involves designing and maintaining the website with AWS, increasing their online presence, and editing/producing podcast episodes. After graduating, he hopes to become a Machine Learning engineer and start his own artificial intelligence firm.
Designer
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras pharetra ullamcorper venenatis. Ut vitae mattis velit. Nam eu felis in dolor interdum dapibus eget a sem. Vestibulum ut varius dui. Nunc eros diam, faucibus vitae lacinia ac, blandit at mauris. Donec at suscipit metus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Aenean massa lacus, venenatis quis bibendum ut, vehicula quis nulla. Proin cursus vitae mi sit amet feugiat.
Software Engineer
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras pharetra ullamcorper venenatis. Ut vitae mattis velit. Nam eu felis in dolor interdum dapibus eget a sem. Vestibulum ut varius dui. Nunc eros diam, faucibus vitae lacinia ac, blandit at mauris. Donec at suscipit metus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Aenean massa lacus, venenatis quis bibendum ut, vehicula quis nulla. Proin cursus vitae mi sit amet feugiat.
Software Engineer
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras pharetra ullamcorper venenatis. Ut vitae mattis velit. Nam eu felis in dolor interdum dapibus eget a sem. Vestibulum ut varius dui. Nunc eros diam, faucibus vitae lacinia ac, blandit at mauris. Donec at suscipit metus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Aenean massa lacus, venenatis quis bibendum ut, vehicula quis nulla. Proin cursus vitae mi sit amet feugiat.
Software Engineer
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras pharetra ullamcorper venenatis. Ut vitae mattis velit. Nam eu felis in dolor interdum dapibus eget a sem. Vestibulum ut varius dui. Nunc eros diam, faucibus vitae lacinia ac, blandit at mauris. Donec at suscipit metus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Aenean massa lacus, venenatis quis bibendum ut, vehicula quis nulla. Proin cursus vitae mi sit amet feugiat.


Q 1 - Which of the following is correct about features of JavaScript?
JavaScript is a lightweight, interpreted programming language.
JavaScript is designed for creating network-centric applications.
JavaScript is complementary to and integrated with Java.
All of the above.
Next
Q 2 - Which of the following is the correct syntax to print a page using JavaScript?
window.print();
browser.print();
navigator.print();
document.print();
Previous
Next
Q 3 - Which built-in method calls a function for each element in the array?
while()
loop()
forEach()
None of the above.
Previous
Next


About βabble
βabble is a language learning software developed by Wilson Stamm, Eric Cerny, Bernie Birnbaum, and Win Wang at StuyCS. βabble gradually integrates a foreign language into a browser, so that the user absorbs a foreign vocabulary while surfing the web.


{include="includes"}
{include="page.header"}You can easily bookmark links from anywhere on the web via bookmarklets right below.
They can be dragged and dropped among your browser's bookmarks. Then, you just have to click on them from your bookmarks menu.
Adds Shaarli to the Share this page button in Firefox.
{if="!$sslenabled"}{'You need to browse your Shaarli over HTTPS to use this functionality.'|t}
{/if}


Kevoree Practices and Tutorials
Practice 1: Make your own components !
Kevoree
View on GitHub
Issues


I was born in Mississauga, Canada to two Bengali parents. I've always had a love for music, movies, sports and especially computers.
I graduated Meadowvale Secondary School with an 88% average and a new found love for developing software thanks to our wonderful computer science teacher Ms. Ghanekar who gave me the base for programming that I have built all of my skills off of today. She helped me find a new passion for it where I would even work on projects myself. In grade 12, a friend of mine and I built a "Who Wants to be a Millionaire" game using Python from scratch. I finished with a 93% and 91% in her classes in grade 11 and 12, leading me to the pursue a career in that field.
I owe the University of Guelph for much of what I have learned. At my time at the Univeristy so far I have learned many valuable aspects of computing and software development. I took many valuable classes that have taught me things such as Object-Oriented Programming, Data Structures, Efficient Algortihtms, Operating Systems and Full Stack Web Development.
For my first term I worked at Kenna, a marketing firm. Here I gained admirable knowledge in databases. Working with a lot of SQL, I worked on queries to pull out information from different tables to create data reports for clients. A lot of my work there invloved learning and understanding SQL, and at times even teaching it to my co-workers. Some of my tasks involved writing queries to QA reports, building an ER diagram for a procedure that creates a large table from many smaller base tables, and running SQL training sessions for others wanting to learn more about how to use SQL.
I am very experienced in SQL and databases, as well as plenty of experience in NodeJS, Ruby on Rails and working with data structures and RESTful API from developing apps for school and as a passion project.
I am very knowledgable in using AJAX, JQuery, JavaScript, HTML, CSS, BootStrap and UI Design from taking classes at school, buildng passion projects, or even building this website!
Whether it be from school, or self teaching myself I have picked up many programming languages over time. I have learned Python, Java 8, C, Ruby, JavaScript and SQL.
Being able to run my own training sessions for SQL gave me a real ability to be able to learn something and then communicate my findings to other people. It let me share my knowledge to people with varying levels of experience.
Playing rep hockey growing up, and even working with a team while at Kenna, I was always invloved in a very team-oriented enviornment. That has always let me seemlessly integrate myself into a team and work well with others.


Have you ever wanted a large bank of questions to choose from when building assessments for your students?
QGen will help you build it
What is QGen?
QGen is a question generator which produces questions in a variety of formats based on your specifications.
QGen allows you to specify a template for how you want a question to look, specify some parameters, define how these parameters should behave and then ask QGen to generate as much
questions as you need! QGen will then give its best effort to give you that amount of unique questions. See the
wiki for
a brief explanation of how the questions are generated.
About the demo
For a simple walkthrough of the demo you should enter the following:
title: Addition(You can name it whatever you'd like)
Number of Questions: Let's go with 20
Imports: Let's not import anything for this simple walkthrough
Type: Multiple Choice
Variables:
Click the Add button on the right hand side under add variable to add a variable.
name your variable num1 for this example.
Generator name: Let's use the randint generator that generates random integers
randint takes 2 parameters start and end. Go ahead and set those parameters and their values to 1 and 50 respectively.
Repeat the process for a second variable num2, but this time set the parameters for the generator to 50 and 100 respectively.
Note you can tinker with these values however you'd please.
Now that we have our variables let's build our question. In the body let's put the following:
What is {num1} + {num2}?
This just means every question will resemble that text, so an example of how an exact question could be is - "What is 2 + 54?" or "What is 51 + 12?".
Note the second one shouldn't occur in this example based on how we set our generators. num1 should be between 1 and 50 and num2 should be between 50 and 100.
Now lets set some answers:
A wrong answer could be the difference of the two whereas we need the sum. So go ahead and put the following in one of the answer fields
${num1} - {num2}$
Note it is enclosed in '$'. Anything enclosed in these characters will be executed in the Python runtime.
Quick note is that you'd want to call any functions you imported to do any cool python stuff with the answers to throw students off
Seeing as this isn't the correct answer we won't check the correct checkbox
Let's go ahead and add the correct answer of ${num1} + {num2}$ in another text field and mark this as correct using the checkbox.
Go ahead and click build and you'll have a generated XML file you can upload right into moodle to import a ton of questions into your question bank.
For more complex examples please take a look at the wiki link above for now as I work on finding time to put more examples on the site.
Thanks for demoing.


Hello Circe
The Shader Storage Buffer Object (SSBO) and the Uniform Buffer Object (UBOs) are buffer objects in OpenGL used to transfer data to shaders. Although both are very similar there are important differences between them.
The UBO provides uniform data to the shader, in the form of uniform blocks, which is accessed through internal shader-accessible memory reads. The advantage of using the UBO instead of separate uniforms is that you can quickly switch between different sets of uniform data for different instances of the same program in you application. Additionally, UBO accesses are faster than SSBOs.
// Example of uniform block declared in GLSL code
layout (std140) uniform PBR {
vec3 albedo;
float metallic;
float roughness;
float ao;
};
SSBOs can be used in the same way, but have some advantages over UBOs:
- SSBOs can store much more memory than UBOs (
128MB
against16KB
). - shaders can write into SSBOs (we need to atomic operations and barriers though).
- SSBOs can have variable size (which can be queried by the shader at runtime).
// Example of SSBO layout declared in GLSL code
layout(std430, binding = 0) buffer layoutName {
struct {
vec3 position;
vec3 color;
} lights[];
};
// data can then be accessed as
lights[i].position
lights[i].color
Although SSBOs seem to be much better then UBOs, their subtle differences are important. It really depends on the situation to decide which one to use.
Let’s now discuss an example that uses both types of buffers (and gives the results above). Here we are going to setup a scene with 4 point light sources, 1 object with a PBR shader attached to it. Light data will be stored in a SSBO and PBR parameters will be stored in an UBO (the shader will access both buffers just like the two code snippets listed earlier). The steps to construct our application are as follows:
- load mesh data
- compile shader
- create and update UBO data
- create and set SSBO light data
You’ll notice that we use vec3_16
in client code to store elements in the UBO and SSBO. That is because depending on the layout you pick – std140
, std430
,… – the memory must be aligned. For example, the alignment is set to be the same as the alignment of the biggest member of the struct. For some layouts,
a 3-component vector can have its alignment rounded up to 4-component alignment, which is the case of out vec3
, so we need to use a vec3
with alignment of 16.
struct alignas(16) vec3_16 {
float x{0};
float y{0};
float z{0};
};
Scene Object⌗
Our shader will require only vertex positions and normals. We could load the mesh from a file or use some procedural mesh:
auto include_normals = circe::shape_options::normal;
circe::gl::SceneModel mesh =
circe::Shapes::icosphere(5, include_normals);
// or
circe::gl::SceneModel::fromFile("path/to/file", include_normals);
PBR Shader⌗
Here we will use a simple version of a PBR shader (source). The required uniforms are:
// uniforms used in vertex shader
layout(location = 3) uniform mat4 projection;
layout(location = 4) uniform mat4 model;
layout(location = 5) uniform mat4 view;
// uniforms used in the fragment shader
uniform vec3 camPos;
layout (std140) uniform PBR {
vec3 albedo;
float metallic;
float roughness;
float ao;
};
Note that the fragment shader will use the an UBO to access the PBR parameters. Also, you don’t need to set the location for each uniform (as above) or cache the locations in you code. Circe does it automatically.
In order to compile the shader and use it in our scene object, we can do:
if (!mesh.program.link("directory", "shader name"))
std::cerr << "Failed to load model shader: " + mesh.program.err;
To update the uniform values just do:
mesh.program.use();
mesh.program.setUniform("view",
ponos::transpose(camera->getViewTransform().matrix()));
mesh.program.setUniform("model", ponos::transpose(mesh.transform.matrix()));
mesh.program.setUniform("projection",
ponos::transpose(camera->getProjectionTransform().matrix()));
mesh.program.setUniform("camPos", camera->getPosition());
UBO⌗
Circe provides a class to handle UBOs:
circe::gl::UniformBuffer scene_ubo;
Here we need to connect the UBO and the shader program in order to register the uniform blocks the shader will access and the binding point of the buffer:
scene_ubo.push(mesh.program);
mesh.program.setUniformBlockBinding("PBR", 0);
Now we can store data into our UBO and it will be available to our shader. For this, we can declare a similar struct to represent our uniform block:
struct alignas(16) PBR_UB {
vec3_16 albedo;
float metallic{};
float roughness{};
float ao{};
} pbr_ubo_data;
and simply store it into our buffer
// setup parameter values
pbr_ubo_data.albedo = vec3_16(.5f, 0.f, 0.f);
pbr_ubo_data.ao = 1;
pbr_ubo_data.metallic = 0.45;
pbr_ubo_data.roughness = 0.35;
// store in UBO
scene_ubo["PBR"] = &pbr_ubo_data;
SSBO⌗
Now we want to use a SSBO to store all data for the 4 lights in the scene. Remember from the beginning that the fragment shader have the definition:
layout(std430, binding = 0) buffer layoutName {
struct {
vec3 position;
vec3 color;
} lights[];
};
We can use an array of structures to easily setup the data for our ssbo class:
ponos::AoS aos;
aos.pushField<vec3_16>("position");
aos.pushField<vec3_16>("color");
aos.resize(4);
// ... setup data and store
circe::gl::ShaderStorageBuffer ssbo = aos;
and remember to bind it before draw
mesh.program.use();
// ... update uniforms
ssbo.bind();
mesh.draw();
If we want to update our light parameters, we can map the buffer memory and modify it directly:
auto m = ssbo.memory()->mapped(GL_MAP_WRITE_BIT);
// update position (field 0) of the first light (index 0)
ssbo.descriptor.valueAt<vec3_16>(m, 0, 0) = {1.f, 1.f, 1.f};
// ... modify other fields and indices
ssbo.memory()->unmap();
Putting all together⌗
Circe provides a quick way to setup a window application through a base class called BaseApp.
To inherit it, we must override the render
method:
class MyApp : public circe::gl::BaseApp {
public:
MyApp() : BaseApp(WINDOW_WIDTH, WINDOW_HEIGHT) {
// setup mesh
// compile shader
// setup UBO
// setup SSBO
}
void render(circe::CameraInterface *camera) override {
// update uniforms
// bind ssbo
// draw mesh
}
// scene
circe::gl::SceneModel mesh;
circe::gl::UniformBuffer scene_ubo;
circe::gl::ShaderStorageBuffer scene_ssbo;
};
int main() { return MyApp().run(); }
Where
// setup mesh
auto include_normals = circe::shape_options::normal;
circe::gl::SceneModel mesh =
circe::Shapes::icosphere(5, include_normals);
// compile shader
if (!mesh.program.link("directory", "shader name"))
std::cerr << "Failed to load model shader: " + mesh.program.err;
// setup UBO
struct alignas(16) PBR_UB {
vec3_16 albedo;
float metallic{};
float roughness{};
float ao{};
} pbr_ubo_data;
pbr_ubo_data.albedo = vec3_16(.5f, 0.f, 0.f);
pbr_ubo_data.ao = 1;
pbr_ubo_data.metallic = 0.45;
pbr_ubo_data.roughness = 0.35;
scene_ubo["PBR"] = &pbr_ubo_data;
// setup SSBO
ponos::AoS aos;
aos.pushField<vec3_16>("position");
aos.pushField<vec3_16>("color");
aos.resize(4);
// light positions
aos.valueAt<vec3_16>(0, 0) = vec3_16(10, 10, 10);
aos.valueAt<vec3_16>(0, 1) = vec3_16(-10, -10, 10);
aos.valueAt<vec3_16>(0, 2) = vec3_16(-10, 10, 10);
aos.valueAt<vec3_16>(0, 3) = vec3_16(10, -10, 10);
// light colors
aos.valueAt<vec3_16>(1, 0) = vec3_16(300, 300, 300);
aos.valueAt<vec3_16>(1, 1) = vec3_16(300, 300, 300);
aos.valueAt<vec3_16>(1, 2) = vec3_16(300, 300, 300);
aos.valueAt<vec3_16>(1, 3) = vec3_16(300, 300, 300);
scene_ssbo = aos;
// update uniforms
mesh.program.use();
mesh.program.setUniform("view",
ponos::transpose(camera->getViewTransform().matrix()));
mesh.program.setUniform("model", ponos::transpose(mesh.transform.matrix()));
mesh.program.setUniform("projection",
ponos::transpose(camera->getProjectionTransform().matrix()));
mesh.program.setUniform("camPos", camera->getPosition());
// bind ssbo
scene_ssbo.bind();
// draw mesh
mesh.draw();
You can find the source code here.
And that is the is the result:


--- layout: default title: Services ---
Labor is a journey. Like any adventure it can take time and preparation to make sure you have all the tools you need to get to the end. What are your goals in this journey? A doula can provide resources and education so you can make the best decisions for your birthing plan. Establishing a relationship with your doula means we’ve got your back physically and emotionally whether it’s in a hospital, birthing center or at home. Support doesn’t stop there. Doulas also support the birthing person's partner so they have the confidence and knowledge they need during labor and delivery.


Liyang Museum / CROX
- Curated by 韩爽 - HAN Shuang
- about 16 hours
- version="1.0" encoding="UTF-8"? Architects: CROX
- AreaArea of this architecture projectArea: 19000.0 m2
- version="1.0" encoding="UTF-8"?YearCompletion year of this architecture project Year: 2019
- version="1.0" encoding="UTF-8"?PhotographsPhotographs: Zhi Xia
- Design Team C.R. Lin, Darcy Chang, Dr. Zheng-Hao Song, Yue Jiang, Saunaam Yip, Tian-Ye Zhou, Jia-Yi Zhu, Li-Dong Sun, Nicky Ni
- City cultural consultant and system service design Shangyuan Academy
- LDI Nanjing Yangtze River Urban Architectural Design Co., LTD.
- Curtain wall design consultant Schmidlin Curtain Wall Technology Co., Ltd.
- Client Suwan China Cooperation Demonstration Area Construction Co., LTD
More Specs Less Specs
Text description provided by the architects. Liyang Museum is located in the southeast corner of Yan Lake Park in the new urban district, connecting an urban public space to the new nature. The organic lines and undulating mountains compose melodious music in the mountain forest. An Open Attitude welcomes people from all directions. The perfect combination of terrain tells about landscape culture and creates an oriental poetic life.
The chinese instrument, Jiaoweiqin, is one of Liyang's cultural symbols.that's the origin to build the city temperament. The architect C.R. Lin created the concept in the background of this story and transformed from historical antiquity into architectural form.
According to a book of the Later Han dynasty: the story of Yong Cai writes—a man was burning paulownias to make dinner. Yong Cai passed by and heard wood cracking in the fire.He immediately understood it was a nice piece of wood and explained it to that man. He took out the wood from the fire and made a musical instrument by using it. People were amazed by the beautiful sound of the instrument. The end of the wood was burned so it was called "Jiaoweiqin".
From an oriental point of view, architecture is seen as a part of the nature whole which contains both inner and outer space; a space that connects human, earth and universe. The team has considered the relationship between melody and nature, human and architecture interaction, delivering a poetic visualization process of culture and life senses. Design concept contains: KEJING (visualize & scenarize), XUANGE (hang & sing), LIUZHUANG (flow), it helps to creates discussion of what is essential space and what is oriental architecture.
Liyang Museum's top part is a floating architecture. It feels like poetry, smooth and thoughtful. Its hollowed body contains "present, past and future" exhibition halls. Its location beside a lake provides multiple access and crossing views, referring to the theory of architecture scholar Colin Rowe's. Liyang Museum's design emphasizes in buildings accessibility and combination of multiple concepts.
That floating architectures sits on hills. Hills become museum's bottom. Its organic shape blends and extends into surrounding land. It feels natural and welcoming. People can visit architecture causally. The entrance plaza is located in the south west, right under the museum’s floating body. The plaza functions as museum's main entrance, connecting and bringing visitors to museum's central courtyard. The Central courtyard has its own climate. The team assumes it will become a popular meeting spot. At night, the water drop shaped patio sits on the top of the courtyard; acting like an open window to spreading light out into the sky. It sparks, attracting people’s attention.


Quick Facts
EXIT X
TERRORIST FINANCING
Home
You have now completed your quiz
Exit Quiz
Well done, you passed the quiz for Terrorist Financing.
100
%
Your score is:


Plan Princeton
Team Members
- Ayushi Sinha<EMAIL_ADDRESS>- Jay Li<EMAIL_ADDRESS>- Sally Lemkemeier<EMAIL_ADDRESS>- Juliet Oh<EMAIL_ADDRESS>Design Doc
Click to Open Document
Elevator Pitch
Remember when you were a wide-eyed freshman bewildered about all the academic opportunities Princeton had to offer? We do to. Enter Plan Princeton, a web application where students can plan out courses they’d like to take during their Princeton career. Our goal is two fold: One, to help students of all years explore their wide range of academic interests and the potential courses that they would need to fulfill these interests. Two, to assist residential colleges’ Peer Academic Advisors (PAAs) and students’ department-assigned faculty advisors in giving advice to first and second year undergraduates.
Plan Princeton allows students to visualize potential course schedules that will fulfill their concentrations and certificates. So rather than scouring multiple departments websites looking for prerequisites and departmentals, students can find all of this information consolidated onto one single webpage. Now, with this application, students can create their individualized Princeton road maps to guide their own paths to graduation.
Milestones
- Saturday 17 March: If we do not hear back from the departments about partnering for this assignment by this date, then we will either scrape the data or collect manually. Design document submitted. Back-end architecture decided (Language, how to collect and store data).Plan for front-end design complete. Front-end architecture decided
- Sunday 25 March: Have database of classes and requirements complete (either by scraping or manually for department requirements). Have front-end design of website completed
- Friday 13 April : Have working version of app at least for one department
- Friday 20 April : Have second department and third department working
- Friday 27 April : Solicit feedback, bug reports, and advice from alpha testers. Add at least top 5 largest departments. Demo to PAAs and Academic Advisors
- Sunday 13 May : Make final changes based on suggestions of feedback