Expect Labs mindmeld-js-sdk Reference
This is the reference document for Expect Labs' MindMeld JavaScript SDK, mindmeld.js.
Important Links
Installation
There are a few ways to get started using MindMeld JavaScript SDK
Download from site
The easiest way to install the latest version of mindmeld.js is by downloading one of the following files directly from the Expect Labs site:
- Un-minified latest: mindmeld.js
- Minified latest: mindmeld.min.js
- Both + Hello World + Documentation: mindmeld-js-sdk.zip
Note that if you are including the file we host here directly from your website, you probably shouldn't. It is not hosted on a CDN, and your page's load time may take a hit. However, if you must link directly, you should use the versioned URL to prevent compatibility issues in the future.

- Un-minified: mindmeld-2.5.6.js
- Minified: mindmeld-2.5.6.min.js
- Both + Hello World + Documentation: mindmeld-js-sdk-2.5.6.zip
Clone git repository
Both files are also available directly from the mindmeld-js-sdk git repository. Simply clone the repo:
git clone https://github.com/expectlabs/mindmeld-js-sdk.git
cd mindmeld-js-sdk
git checkout master # make sure you are using the most recent stable release
Copy either mindmeld.js or mindmeld.min.js into your project's directory.
Install with Bower
Bower is a popular package manager for the web. Read more about it at bower.io
If you are using Bower, install mindmeld-js-sdk as a bower package
bower install mindmeld-js-sdk
To save the dependency in bower.json, run the above command with --save
Usage
Without Bower

With Bower

Getting Started
This is a quick guide on how to start using the MindMeld JavaScript SDK in your own projects. The MindMeld JavaScript SDK enables developers to build browser-based applications that take advantage of the full range of functionality supported by the MindMeld API. The JavaScript SDK wraps the objects and collections supported by the MindMeld RESTful API with convenient JavaScript objects. These objects can then be used to communicate with the MindMeld API. The JavaScript SDK also provides the ability to send and receive real-time push events in most modern browsers.
Initialization
When the JavaScript SDK creates the global MM object, which contains all of the data classes and functionality to
access MindMeld. The first step is to initialize the SDK by calling MM.init
with a config
object specifying
your application id and a callback for when the SDK is initialized:
var config = {
appid: "<your application id>",
onInit: start
};
MM.init(config);
// This is where things begin after the MindMeld JavaScript API is initialized.
function start () {
console.log('MindMeld SDK ready!');
}
Once the JavaScript SDK has been initialized, the MM object is your interface to the MindMeld API.
Request an Access Token
With your application's app secret you can generate a new user token. You can find the app secret on the Management Console.
var credentials = {
appsecret: '<app secret>',
simple: {
userid: 'einstein79',
name: 'Albert Einstein'
}
};
MM.getToken(credentials, onTokenSuccess, onTokenError);
function onTokenSuccess () {
console.log('Your access token was successfully retrieved: ' + MM.token + '.');
console.log('The active user id has been set to: ' + MM.activeUserId);
}
function onTokenError (error) {
console.log('Error getting access token: (Type ' + error.code +
' - ' + error.type + '): ' + error.message + ' ' +
'Please make sure your appid and appsecret are set correctly.');
}
Create a Session
All entity extraction and document ranking happens inside of a MindMeld session. Using this SDK, you create you own session to which you can later add text entries and fetch relevant documents.
var newSessionData = {
name: 'A test session',
privacymode: 'inviteonly'
};
MM.activeUser.sessions.post(newSessionData,
// New session created successfully
function (response) {
var sessionID = response.data.sessionid;
console.log('New session created with id ' + sessionID);
MM.setActiveSessionID(sessionID);
},
// Error
function (error) {
console.log('Error creating new session: (Type ' + error.code +
' - ' + error.type + '): ' + error.message);
}
);
Post a Text Entry
To post a text entry to the session, you can optionally specify the language.
var textEntryData = {
text: 'Sandra Bullock might win an Academy Award for Best Actress in the movie Gravity',
type: 'text',
weight: 1.0,
language: 'eng' // this is not required
};
MM.activeSession.textentries.post(textEntryData);
Example Flow to Get Contextually Relevant Documents to a Conversation
The following code snippet will subscribe to the documents collection, post a text entry, and receive a notification once the MindMeld API has updated documents for the text entry.
// Subscribe to push events for when the documents collection updates
MM.activeSession.documents.onUpdate(onDocumentsUpdate, onSubscribedToDocumentUpdates);
function onSubscribedToDocumentUpdates () {
console.log('subscribed to updates to the documents collection');
var textEntryData = {
text: 'Sandra Bullock might win an Academy Award for Best Actress in the movie Gravity',
type: 'text',
weight: 1.0
};
console.log('posting a new text entry to the session');
MM.activeSession.textentries.post(textEntryData);
}
function onDocumentsUpdate () {
console.log('received an update to the documents collection');
var documents = MM.activeSession.documents.json();
console.log('Related Documents: ' + JSON.stringify(documents));
}
Sending and Receiving Custom Push Events
In addition to the push events that indicate that API objects have changed, you can also create custom push events. In the example below, we show you how to subscribe to a custom push event on the user channel, and then publish a custom push event on that same channel. We also do the same for the session channel.
// subscribe / publish a custom event on user channel
MM.activeUser.subscribe('CustomUserEvent', onCustomUserEvent, onSubscribedCustomUserEvent);
function onSubscribedCustomUserEvent () {
console.log('successfully subscribed to CustomUserEvent on user channel');
var payload = {
field1: 'test field',
field2: 'temet nosce'
};
MM.activeUser.publish('CustomUserEvent', payload);
}
function onCustomUserEvent (payload) {
console.log('received CustomUserEvent. field2 of payload: ' + payload.field2);
// received CustomUserEvent. field2 of payload: temet nosce
}
// subscribe / publish a custom event on session channel
MM.activeSession.subscribe('CustomSessionEvent', onCustomSessionEvent, onSubscribedCustomSessionEvent);
function onSubscribedCustomSessionEvent () {
console.log('successfully subscribed to CustomSessionEvent on session channel');
var payload = 'cause and effect';
MM.activeSession.publish('CustomSessionEvent', payload);
}
function onCustomSessionEvent (payload) {
console.log('received CustomSessionEvent with payload: ' + payload);
// received CustomSessionEvent with payload: cause and effect
}
Using Speech Recognition
If you would like to use speech recognition to enable users to interact with your application with their voices use MM.Listener. Currently the browsers known to support MM.Listener are Google Chrome for Desktop (versions 25+) and Android (versions 31+). The MM.Listener class relies upon the speech recognition portion of the Web Speech API (https://dvcs.w3.org/hg/speech-api/raw-file/tip/webspeechapi.html) which has not yet been implemented by all major browsers. The simplest way to enable speech recognition is to use the active session listener, which is preconfigured to post text entries when it receives final results. Below we illustrate how to use the active session listener.

if (MM.support.speechRecognition) { // check for support in the current browser
MM.activeSession.setListenerConfig({
onResult: function(result) {
console.log("Listener received result: " + result);
// Display speech
if (result.final) {
// Display speech segment as final
$('#confirmed').append(' ' + result.transcript + '');
$('#pending').text('');
} else {
$('#pending').text(result.transcript);
}
},
onStart: function(event) {
// Update UI so user knows to speak
// Clear previous text
$('#confirmed').text('');
$('#pending').text('');
},
onEnd: function(event) {
// Update UI so user knows recording has ended
var pendingText = $("#pending").text();
if (pendingText.length > 0) {
$('#confirmed').append(' ' + pendingText + '');
$('#pending').text('');
}
},
onError: function(error) {
// let user know something went wrong
alert('Sorry, there was a problem with speech recognition');
}
});
MM.activeSession.listener.start();
// user begins speaking now
}
If you would like to have more control over how and when text entries are posted, you can create your own MM.Listener object, as shown below.
if (MM.support.speechRecognition) { // check for support in the current browser
var myListener = new MM.Listener({
continuous: true, // we will continue listening until myListener.stop() is called
interimResults:, true // we will receive results before the API
onResult: function(result) {
console.log("Listener received result: " + result);
if (result.final) {
MM.activeSession.textentries.post({
text: result.transcript,
type: 'speech',
weight: 1.0
});
// Display speech segment as final
$('#confirmed').append(' ' + result.transcript + '');
$('#pending').text('');
} else {
// Display speech segment as pending
$('#pending').text(result.transcript);
}
},
onStart: function(event) {
// Update UI so user knows to speak
// Clear previous text
$('#confirmed').text('');
$('#pending').text('');
},
onEnd: function(event) {
// Update UI so user knows recording has ended
//
var pendingText = $("#pending").text();
if (pendingText != '') {
$('#confirmed').append(' ' + pendingText + '');
$('#pending').text('');
}
},
onError: function(error) {
// let user know something went wrong
alert('Sorry, there was a problem with speech recognition');
}
});
myListener.start();
// user begins speaking now
}
Repository Contents (mindmeld-js-sdk)
- src/: Directory containing all source files for SDK and widgets
- src/sdk/: Directory containing source files for mindmeld.js
- src/sdk/main.js/: Main source file for mindmeld.js
- src/sdk/widgets/searchWidget/: Directory containing source files for autocomplete search widget
- src/sdk/widgets/searchWidget/js/jquery.mindmeld-searchwidget.js: Source for autocomplete jQuery widget
- src/sdk/widgets/searchWidget/js/util/: Directory containing headers and footers for creating a standalone search widget file
- src/sdk/widget/voiceNavigator/: Directory containing source files for voice navigator widget
- src/docsTemplate/: Directory containing templates and configuration files for building JS Docs
- src/embed.js: Source for embed script used to asynchronously load widgets
- src/tests: Our jasmine files and tests
- dist/: Directory containing all built, uglified, and production-ready files for JS SDK
- dist/sdk/: Directory containing compiled mindmeld.js, mindmeld.min.js, mindmeld-js-sdk.zip, and examples
- dist/widgets/searchWidget/: Directory containing all files necessary for using autocomplete search widget
- dist/widgets/voiceNavigator/: Directory containing all files necessary for using voice navigator widget
- dist/widgets/voiceNavigator/widget/: Directory containing voice navigator widget files that create the voice navigator iframe
- dist/widgets/voiceNavigator/modal/: Directory containing voice navigator modal files loaded in the iframe modal
- dist/embed.js: Minified embed script used in prod
- example/: Directory mirroring src/ and dist/ directories containing example HTML pages showing basic usage of SDK and widgets
- archive/: Directory containing all previous versions of mindmeld.js
- gulp/: Directory containing gulpfiles for building SDK and widgets
- gulpfile.js: Main gulpfile used to orchestrate build processes
- Gruntfile.js: Legacy grunt file currently only used for building JS Doc because gulp-js doc does not support our JS doc template
- bump.txt: Add garbage to this file and and check it in when you just want a new SHA for this repo


turbo::Shape Class Reference
Represent a drawable primitive shape. More...
#include <Shape.hpp>
Inheritance diagram for turbo::Shape:
Collaboration diagram for turbo::Shape:
Additional Inherited Members | |
| Public Member Functions inherited from turbo::Drawable | |
| virtual void | draw () const =0 |
| Draw the drawable -_-. | |
Detailed Description
Represent a drawable primitive shape.
The documentation for this class was generated from the following file:
- include/turbo/graphics/Shape.hpp


R
Login
Register
About US
Support
| Home
Roca PC
master
Getting started!
Update my computer software
This will not work!, this is just a trial page for my initial skills.
Send massage to the support
Your full name
*
Your E-mall
*
or how can us contacting with you
your massage
*
you can send a screenshot or picture


Third Celtic fan injured in Rome knife attack
A third Celtic fan is recovering after being stabbed in Rome.
The supporter needed hospital treatment after he was attacked in the early hours of this morning following Celtic’s victory over Lazio, but it is understood he has since been discharged.
Other Celtic fans reported being attacked after a shuttle bus taking them back from the stadium on Thursday night broke down.
Supporters said they were “ambushed” as they were forced to walk back into the city.
I turned round behind me and Lazio fans were there with smoke bombs and knives
Italian police said 12 Lazio fans have been arrested following disorder during the evening.
It came after two Celtic fans were stabbed by masked attackers outside a pub in Rome on Wednesday evening.
A Celtic spokeswoman said on Friday: “We can confirm that another supporter was injured after being stabbed early this morning in Rome.
“We are currently attempting to make contact with the supporter but understand that he has been discharged from hospital and is expected to make a full recovery within around 10 days.
“We can also confirm that a group of Celtic supporters were also attacked after last night’s match after a bus had broken down.
“Again, the club and British Consulate will aim to give as much support as possible to all supporters requiring assistance.”
James Mervyn, 21, a Celtic fan from Belfast, was on a supporters bus which he said stopped five minutes into the journey.
He said: “Fans could smell burning as soon as we were on the bus and thought Lazio had slashed the tyres, and then we were told to get out by the bus driver and one other guy who looked like police.
“We then walked through a dark road beside the river, everyone screamed ‘Lazio, Lazio’ and we ran.
“I turned round behind me and Lazio fans were there with smoke bombs and knives.
“We then ran for 15 minutes up the road but little to no police presence. Scary experience as children and elderly supporters were on the bus.”
Other fans took to social media to describe how they were attacked as they returned from the stadium on Thursday evening.
Michael McFarlane tweeted a video of fans walking in the dark and wrote: “Our shuttle bus broke down 1km from the stadium. Driver chucked us out, meaning we had to walk through the Lazio neighbourhood.
“After this video, about 20 Lazio fans sprinted from the dark and ambushed the group at the river. Got away safe, not sure about others.”
Rab Robertson wrote: “Fair squad of us ambushed, weans the lot, completely co-ordinated, hopefully all safe,” while Thomas Lunday tweeted: “Not enough buses to take everyone back to the city, so rest of the fans had to walk a couple miles further on, that’s when they where ambushed by casuals.”
The Celtic fan liaison officer had advised supporters to “keep a low profile” as they returned from the game.
He tweeted: “Wee update for fans in Rome, don’t walk back to town, get taxis or shuttle buses back to the city and keep a low profile.”
The club had issued safety advice to fans amid tensions after a match between the clubs in Glasgow last month.
The Glasgow club and Lazio were charged by Uefa over “illicit chants” heard during their Europa League match on October 24.
Celtic were also charged over the display of an “illicit banner” during the game, which they won 2-1.


Pat Haggerty
From a young age, Pat loved building things and solving problems. Beginning with Lego and Rubik's cubes, he eventually graduated to writing code once he realized that he could be building things with computers to solve problems.
Pat finds immense joy in creative and elegant solutions. He takes great care with his process, emphasizing a collaborative "picking apart" of the problem, making sure to question everything and consider every angle. He is equally comfortable working with small nonprofits and large finance firms, and the breadth of his skills and experience combined with an understanding of his clients’ needs produces effective solutions that solve real problems.
Throughout the years, Pat has felt a strong calling toward education, which lead him to teaching and mentorship roles in both college and high-school Computer Science classrooms. Additionally, he has participated in several after school programs teaching kids and adults of all ages how to code.
Away from the keyboard, Pat is an enthusiastic and aspiring farmer. His most recent journey in this realm saw him in an off-grid cabin on the coast of Maine where he apprenticed on an organic farm and learned to drive draft horses.
In a similar vein Pat is an avid tracker of wild animals -- if there's fresh snow on the ground, you'll find him trailing bobcats or coyotes in the woods of Massachusetts. He sincerely believes in the need to for humans to reconnect with the natural world, and tracking animals is actually one of the best ways to hone the skills needed to solve problems with technology.


BASH
Bash is versatile, and it's everywhere.
And even though the default terminal for my Mac is zsh nowadays, any time I write a script, it starts with #!/bin/bash
.
There are some reasons, one is the reason that you are able to export functions. (Support currently lacking in zsh)
With it, it's a lot simpler to run things in parallel with parallel or xargs against the exported func..
At work I've built a closed source homebrew tap where I distribute scripts, to enable people in their daily work.
- Execute maven version upgrades for parent, properties, and dependencies. Parameterized with version rules and so on.
- Generate MarkDown tables containing pre-baked links to all the build-, log-, vcs-systems, and landing pages in all envs for the current repo.
- Code migrations.
- When we switched from one build system to another
- When there where major changes to swagger annotations.
- JUnit4 to JUnit5
If you haven't tried comby
, just do it. It's like sed
, but code aware.


How does JavaScript compare to HTML and CSS?
For me, JavaScript is a language that focusses on functionality, and logic. In itself, HTML is a static markup language,
whereas JavaScript is dynamic "scripting" language. With
if
statements, webpages -- or anything else -- can be programmed to change based on certain conditions.
It does take longer to get your head around the logic, but having come from Swift, JavaScript shares
a lot of similarities:
if
statements, and
for
and
while
loops all have the same methodology as Swift -- just different syntax. Even data objects share similar
roles / functionality as
class
objects did in Swift (such as accessing properties w
dot notation
). The only difference thus far has been syntax, which seems a lot more complex (less clean-cut)
than Swift.
The biggest thing for me, when it came to the difference between reading / learning Swift, and really
understanding it, was applying it in my own projects with a trial-and-error mentality. Did end up
learning a whole lot just by making mistakes, so hopefully will happen with JavaScript.
Explain control flow and loops using an example process from everyday life, for example 'waking up' or 'brushing your teeth'.
From
Wikipedia:
"control flow is the order in which individual statements, instructions or function calls of an
imperative program are executed or evaluated."
From JavaScript, we can initiate
for
loops to perform a series of instructions, or "iterate" over an array / series, until a certain specified
condition isn't met (i.e. while a condition
is met).
For the "brushing your teeth" parallel, a loop could be initiated telling you to continue brushing
until a certain condition (like: your teeth are clean) is met.
Explain the difference between accessing data from arrays and objects.
Accessing data from an array requires using square-brackets to refer to an item in the array by index; remembering that indices
start from 0, and not 1 like we would assume naturally. Nested objects within an array would then
have to be referenced further with dot notation.
Data in an object can be referenced simply with dot notation: "." after the objects name, followed
by the property. If the property's name has a space (" ") in it, the property must be referred to
with square-brackets, "[
property name]".
Explain what functions are and why they are useful.
From
Mozilla documentation:
"In JavaScript, functions are first-class objects, because they can have properties and methods
just like any other object. What distinguishes them from other objects is that functions can be called.
In brief, they are
Function objects."
In my own experience, simple functions, such as reloading the data on a specific page are especially
useful in certain instances, and for more complex functions you would involve certain parameters
-- and then "call" it with variable inputs to get a result.


Follow along with the slides at:
gdila.github.io/gdi-responsive
Download the zip of files for class
Unzip the file to your desktop.
And it's here to make things right.
Responsive Design is the practice of designing and developing websites that allow the user to enjoy its features no matter what device they're viewing it on.
Responsive Web Design was first coined by Ethan Marcotte in the May 2010 issue of A List Apart.
He also wrote this very nice book and owns the website Responsivewebdesign.com, which are both excellent resources.
You can enter the URL here: http://www.responsinator.com
(or pull it up on your mobile device for a more accurate view!)(these are just Android phone, tablets, phablets. There are lots more!
The magic is achieved with these 3 ingredients:
First we define a width for our grid's container.
We divide the content up into a set of columns, usually 12.
Then we design elements that can scale in size. Instead of assigning a specific pixel dimension, we use percentages.
Whenever the device width changes, the grids change in width to scale with the device.
Here are some examples:
max-width
srcset
- list multiple image filessizes
- give the browser multiple possible widths with media conditionspicture
- gives us more control over when different sources are usedsource
- used to define sources for a picture elementWe could have an entire workshop just on flexible images alone!
So, we won't be discussing all of those options tonight, but this article does a great job of detailing them.
max-width
For now, we'll be using max-width
.
img {
max-width: 100%;
}
max-width
Unlike text, which scales easily on smaller devices, images can be a bit tricky.
Unless we give them a max-width
, images will overflow their container elements if they're too big for them.
max-width
By assigning a max-width
to images, they'll only expand to the size of their parent.
If their parent has no width (which it probably does), it'll just expand to the width of the viewport.
CSS3 media queries let us assign breakpoints that correspond to the pixel width of your desktop monitor, tablet, e-reader, or phone display.
These breakpoints tell the content what to do when the display (or viewport) falls within these widths.
Let's go to our Exercise folder, find the _MediaQueryMagic
folder, and open awesomeness.html
in our browser.
Then let's go to our styles
folder and open styles.css
in Sublime Text.
We can see the breakpoints and styles assigned to this page in our media queries as we narrow our browser window.
Let's open working.html
in our browser.
What if we don't want to start all over and make a totally new responsive site? We just want to make the existing site responsive.
We can totally make the following adjustments and get this site looking lovely on a mobile device:
This will suit our needs because our site is small and manageable. But if you're starting a shiny new project, we'll explore some other options in a bit.
Once upon a time, in 2005, type was always set in px
.
But today we need to account for our billions of devices and a range of pixel densities. So, we use more flexible units for setting our type, like em
s or rem
s.
Here's a good explanation of em
s.
Here's a good explanation of rem
s.
Good to know: The browser default for fonts is 16px
, which is 1em
or 1rem
.
We're going to use ems
today.
The first thing we need to do is change the font sizes from px to ems.
There's a handy formula for this:
target ÷ context = result
So if we're converting 24px to ems,
and 16px is the default size (context), we calculate:
24 (target) ÷ 16 (context) = 1.5 (result)
24px
is 1.5 times greater than 16px
,
so our font-size is 1.5em
.
For times when you are not in the mood for math, we have pxtoem.com
Let's open styles.css in Sublime Text.
Find all of the font-sizes that have px and convert them to the correct em sizes.
Use the formula
target ÷ context = result
or use the pxtoem.com chart/calculator
We'll work through a few together…
So we can keep track of what we changed, let's comment out the original px
font-sizes when we add in our newly calculated em sizes.
Here's our first conversion as an example. Let's convert the h1
font-size:
h1 {
color: #ffffff;
font-size: 2.25em; /* font-size: 36px */
font-style: italic;
font-weight: 800;
margin-bottom: 20px;
padding: 10x 0 0;
text-align: center;
}
Let's convert the h2
font-size.
h2 {
font-size: 1.6em; /* font-size: 25px */
font-style: italic;
margin: 0 0 10px 0;
}
And the .summary p
font-size.
.summary p {
color: #d5ecf0;
font-size: 1em; /* font-size: 16px */
font-weight: normal;
padding: 10px 0;
}
And lastly let's convert the aside p
and the footer
font-sizes:
aside p {
color: yellowgreen;
font-size: .875em; /* font-size: 14px */
font-weight: bold;
padding: 10px 20px;
text-align: left;
}
footer {
clear: both;
color: #60b9ce;
display: block;
font-size: .875em; /* font-size: 14px */
height: 35px;
margin-top: -35px;
padding-top: 120px;
text-align: center;
width: 900px;
}
It wasn't horrible, at least our fonts are now flexible.
And now we have a reminder of why it's better to start off with em
s right from the start.
We still have fixed-width sizing on the structural containers (wrapper, nav, gallery, etc.).
By converting their pixel widths to percentages, we'll be another step closer.
The same formula we used to convert fonts from px
to ems
can be used to convert pixel widths to percentages.
target ÷ context = result
The wrapper around our content is 900px
wide, that's our target. Let's say the layout was designed to be 960px
wide, that's our context. To convert the wrapper to a percentage, we do the math.
900 ÷ 960 = .09375
Move the decimal over two spots for the percentage.
Our 900px
wrapper is now 93.75%
.
Since we have a lot of nested containers in our working site, and want to keep this moving, we're going to make some arbitrary conversions and not do all the math on each one.
We'll use some nice round numbers, which is just fine for our single-page site.
Go back to styles.css
and start identifying our fixed-width containers.
In order to keep track of what we changed, comment out the original pixel widths and replace them with percentages.
Let's do the first few together…
On #wrapper
we should also change the margin
from px
to a percentage.
#wrapper {
margin: 0 10%; /* margin: 0 auto */
width: 80%; /* width: 900px; */
}
header {
background: #004488;
border-bottom-left-radius: 15px;
border-bottom-right-radius: 15px;
border-bottom: 3px solid lightblue;
height: auto;
margin: 0;
width: 100%; /* width: 900px; */
}
nav
and the nav li
widths.nav {
float: left;
font-family: 'Open Sans', sans-serif;
font-weight: bold;
margin: 10px 0 50px;
text-align: left;
width: 70%; /* width: 700px */
}
nav li {
display: inline;
padding: 5px 20px 15px 0;
width: 100%; /* width: 900px; */
}
#social
and the .summary
widths.#social {
float: right;
margin: 20px 0 50px;
padding: 0;
text-align: right;
width: 30%; /* width: 200px */
}
.summary {
clear: both;
float: left;
padding: 5px 0 10px;
width: 100%; /* width: 900px */
}
#feature img
and the #gallery
widths.#feature img {
padding: 0;
width: 100%; /* width: 800px */
z-index: 0;
}
#gallery {
float: left;
margin: 0;
padding: 0;
width: 60%; /* width: 550px */
}
#thumbs li
, #thumbs li img
, and the aside
widths.#thumbs li {
float: left;
padding: 0 20px 20px 0;
width: 20%; /* width: 80px */
}
#thumbs li img {
width: 100%; /* width: 80px */
}
aside {
background: #004488;
float: right;
height: auto;
margin: 0;
padding: 0;
width: 40%; /* width:250px; */
}
#footer
width and add a max-width
to images.footer {
clear: both;
color: #60b9ce;
display: block;
font-size: .875em; /* font-size: 14px */
height: 35px;
margin-top: -35px;
padding-top: 120px;
text-align: center;
width: 100%; /* width: 900px */
}
img {
max-width: 100%;
}
Do things look better?
Let's take some time to get things right before we move on.
If you need to catch up, you can copy and paste the styles.css
from our finished-responsive-website folder:
If you've ever created a print stylesheet for a website (media="print"
) then you're already familiar with the idea of creating a specific stylesheet that comes into play under certain conditions.
@media print {
#header img {
display: none;
}
}
Media Queries are just an extra layer of instructions that work alongside your existing CSS. These instructions come into play when certain constraints are defined:
They look only slightly different than regular CSS, just note the extra set of curly brackets.
@media only screen and (max-width: 768px) { /* <-- This opening curly bracket is for the media query */
#gallery {
clear: both;
width: 100%;
}
#thumbs li img {
width: 100%;
}
aside {
clear: both;
margin: 0 auto;
width: 100%;
}
} /* <-- This bracket closes the media query */
We can make a few small changes to our sample website right now and see what happens.
Let's go back to our styles.css
file.
Since all of the CSS we've written so far looks best on mostly the desktop view, let's customize it a bit for a smaller screen, like a tablet.
At the very bottom of our styles.css
, type the following:
@media screen and (max-width: 1024px) {
#gallery {
clear: both;
width: 100%;
}
#thumbs li img {
width: 100%;
}
aside {
clear: both;
margin: 0 auto;
width: 100%;
}
}
styles.css
, type the following:@media screen and (max-width: 667px) {
#thumbs li {
clear: both;
width: 100%;
}
}
Now we have a very basic, responsive website. We could keep adding and adding to this, but we're going to move on to learning about process.
As our content readjusts at each breakpoint, the change can be abrupt. Though users might not notice it, it's a subtle way to soften the transitions.
Add the following to the bottom of your CSS, save, refresh your website, and resize the browser to see the difference:
aside, #thumbs li {
-webkit-transition: width 1s ease;
transition: width 1s ease;
}
Maybe it turns out you've got a site that's going to be a bit more complex, or you just want to start with a clean slate.
Here's where responsive frameworks can come in.
This is simply a 12-column flexible grid that can scale out to an arbitrary size (defined by the max-width of the row) that's easily nested. The widths are percentages. They've done the math for us!
Here's a framework to try out:
You should already have the Essential package downloaded, but if not, you can download it here: foundation.zurb.com/develop/download.html
Let's go to the Foundation Essentials folder we downloaded and open index.html
in our browser.
Check out the following chunks of code and their corresponding CSS by doing a right-click & inspect:
Let's take a look at foundation.css
file the Foundation Essentials folder. Open that in Sublime Text, and let's see how they've done their media queries.
You'll notice their media queries are mixed in with the regular styles, so that they're grouped with other like items. In this case, we're dealing with columns.
Let's start modifying this page so we can get used to working within the rows and columns of the grid.
Open index.html
in Sublime Text.
Change some text to your own, maybe start with the h1
and h2
.
Find the spot in the code where there are 3 columns of text. Let's say we want to delete one of them and just have 2 columns.
Since these 3 columns are each given a class of large-4 medium-4
we have 3 x 4 = 12.
If we delete one of the divs and rename the other two large-6 medium-6
so that they still add up to 12, see what happens.
If we want to change some styling, we should create a new CSS file so any add-ons will be separate from the existing huge CSS file.
Open a new document in Sublime Text and save it in the CSS folder inside foundation-essentials
. Name it whatever you like. Don't forget to link the new CSS file to your HTML file.
Try adding some color to these classes, or any other ones that you like.
.row {
background: blue;
}
.large-12 p {
background: yellowgreen;
}
.large-4 p {
background: salmon;
}
Once you get comfortable with the way the columns are nested, you'll soon see how you can adapt your own designs into a page like this Foundation starter page.
There are other downloads that include much more, including a custom download option, so be sure to try those too.
Mobile First helps us to:
It makes us better designers and developers, and our users will be grateful for it.
It requires a shift in how we think about content.
Really, it's content first. Presenting only the most relevant content to begin with, so that none of it is treated as fluff that needs to be hidden from users.
Here's a high-level glance at the Responsive Design and Mobile first process.
Creates a blueprint for designers and devs.
Great for identifying the pain points before visual design starts.
Helps sort out the priority and proximity of content. At the very least, it's an exercise that helps clarify what matters the most.
Style Tiles.  Less detailed than a website mockup or comp.
The style tile below eventually became the website on the right.
After receiving design deliverables (style tiles, mobile/desktop mockups), development starts.
The starting point can be a responsive framework, or a responsive template in your CMS of choice.
Responsive is not a replacement for mobile apps, and is not always the go-to solution.
We should assume that people will try to view a website on whatever device they have with them. It's up to us to provide the appropriate solutions for each app, website, and use case.
Sometimes there's another strategy happening, intentional or otherwise. Here's what Target has going on.
An m-dot mobile site, native app, full website on mobile, Cartwheel:
We have a responsibility to do the right thing for our users. It's not an easy job, but you've all taken the first step in helping improve the web just by being here!
Go forth and tackle your next project with a fresh perspective!
We strive to make each class better than the last! You can help by giving us your honest feedback:
Thank you!


Address: Spain
Nationality: Brazilian and Spanish
Phone Number: (34)9999-9999
Email<EMAIL_ADDRESS>I'm a Information Technology student, an enthusiastic person, who is motivated and sociable. In addition, I consider myself to be responsible, reliable, and hardworking. My main motivations in life are to continue to improve myself through a constant learning process and to develop my skillset.
Degree in Information Technology
Universidade Aberta de Portugal
Web Development Course
Programador br
Python 3 Course
Curso em Vídeo
Endereço do site - "My github"


Installing the Drives (Hard Drive and Disk Drives)!
The different drives you will need to install will vary between users, but all PC's will need a hard drive at the minimum.
You may or may not need a screwdriver for this process. It depends on the method of mounting used by your case. Check your manuals and the case itself to find out!
This guide has some optional steps, which will be noted. This will depend on if you need a CD or DVD drive in your PC. If you do, the optional steps are not optional for you!
Click any images on this page to open them in a separate tab/window for better viewing.
Steps:
- Find the spot where your case stores hard drives. This is highlighted in my example image in red.
- Depending on your case, you may not need to screw anything down. If this is true for your case, simply slide your hard drive into the cage and latch it with the method used by your case.
- If you case requires you to screw the hard drive into the cage, do so using a screwdriver and any supplied screws.
- OPTIONAL - Refer to your case manual for removal of any optical drive shields your case may have in the front of the case. Carefully follow the specific instructions and remove the shield.
- OPTIONAL - Take your optical drive and place it in the cage (highlighted in purple in my example image). This also may or may not require screws. Follow the case manual!
- Once all of your drives are locked down securely, you can move on to the final building step!


| window - A window gadget handle |
|
Maximizes the specified window.
This causes the window to be reshaped to fill the entire desktop. See also: MinimizeWindow, WindowMaximized, WindowMinimized. |
|
; Create a window
win=CreateWindow("Test Min / Max Functions",100,100,100,100,0,3) ; create a couple of buttons buttonMin=CreateButton("Minimise",10,10,80,20,win) buttonMax=CreateButton("Maximise",10,40,80,20,win) ; now a very small event loop Repeat id = WaitEvent() Select id Case $803 : Exit ; exit on window close Case $401 ; Attempt to minimise or maximise on button hit If EventSource()=buttonMin Then If WindowMinimized(win) Then Notify "But the window is already minimised!" Else MinimizeWindow win End If Else If EventSource()=buttonMax Then If WindowMaximized(win) Then Notify "But the window is already maximised!" Else MaximizeWindow win End If End If End Select Forever End ; bye! |


--- layout: minimal title: "Portfolio" permalink: /portfolio/index.html image: '/assets/img/series.png' description: "Personal and professional coding projects I've worked on" --- {% for post in site.posts %} {% if post.layout == 'project' %}
{% endif %} {% endfor %}


|
image = file handle variable holding the loaded image
x = x coordinate offset(optional) y = y coordinate offset (optional) frame = frame of the image to use (optional) |
| Similar to TileImage but ignores transparency. Use this to tile an entire or portion of the screen with a single repetative image. |
|
; TileBlock example
Graphics 800,600,16 ; Load an image to tile (your location might vary) gfxBall=LoadImage("C:Program FilesBlitz Basicsamplesall.bmp") ; Tile the graphic without transparency TileBlock gfxBall ; Wait for ESC to hit While Not KeyHit(1) Wend |


|
vroom vroom
An HTTP server that interprets server-side JavaScript
|
An HTTP server that interprets server-side JavaScript with the V8 JavaScript engine.
The V8 JavaScript interpreter library is required for interpreting the server-side JavaScript files. V8 can be installed with any package manager or from source. If installing from source, you can simply run make native
to compile for your current system architecture. See Google's guide for building V8 for more information on building V8.
This project depends on several C++11 features. The compiler you use must support C++11 threads, lambda expressions, and unique pointers.
If the V8 library is installed outside of normal library search paths, you will need to edit the Makefile to define the locations of the V8 static libraries. Specifically, you will need to set the V8HOME
and ARCH
variables in. V8HOME
should be the directory that has the V8 include and out directories. ARCH
should be the target architecture of the V8 compilation.
Change your preferred compiler by changing the C++
variable in the Makefile.
Compile for release or debugging by changing TYPE
.
HTTP requests are resolved by accessing files from the public directory. If the file does not exist, a 404 HTTP status code will be returned to the client.
HTTP requests for files with an .ssjs
extension will be automatically interpreted by V8, and the generated string from running the file will be returned in the HTTP response.
require(path)
JavaScript FunctionIn a server-side JavaScript file, a call to the require function will look up the requested file and interpret it with V8. The return value from this requested file will be returned as a JavaScript object, not necessarily a string, to the caller.
Relative and absolute paths are supported from server-side JavaScript files. These paths are resolved relative to the caller.
HTTP POST and GET data is initalized before interpreting .ssjs
files. This can be access in the global __POST__
and __GET__
variables, which is an object that acts as a key-value map of the data.
The parent directory of the interpreted file is stored as a string in the global variable __CURRENT_DIRECTORY__
.


WARNING: run the Spam Test at your own risk, see below for more information. Run Spam Test
Spam Test: The spam test rapidly spends 1 million messages to the websocket-server at a near instant interval, as such, any browsers connected to the server at the time of a spam test may crash or freeze up. The websocket server should not crash, but this is not 100% guaranteed.
The author does not take responsibility for any damage or data loss caused.


User Stories
- Nothing from my website will be cached in my client as a security measure.
- I will see that the site is powered by 'PHP 4.2.0' even though it isn't as a security measure.
- I can post a
title
to /api/books to add a book and returned will be the object with the title
and a unique _id
.
- I can get
/api/books
to retrieve an aray of all books containing title
, _id
, & commentcount
.
- I can get
/api/books/{_id}
to retrieve a single object of a book containing title
, _id
, & an array of comments
(empty array if no comments).
- I can post a
comment
to /api/books/{_id}
to add a comment to a book and returned will be the books object similar to get /api/books/{_id}
.
- I can delete
/api/books/{_id}
to delete a book from the collection. Returned will be 'delete successful' if successful.
- If I try to request a book that doesn't exist I will get a 'no book exists' message.
- I can send a delete request to /api/books to delete all books in the database. Returned will be 'complete delete successful' if successful.
- All 6 functional tests required are complete and passing.
Sample Front-End:
Library entries:
Select a book to see details and comments
API Methods:
| API |
GET |
POST |
DELETE |
/api/books |
list all books |
add new book |
delete all books |
/api/books/abcd |
show book abcd |
add comment to abcd |
delete abcd |
Careful with this one, once pressed, it purges the library!


The Covid-19 Open Visualization (COViz) project is a modular open-source web toolkit for
hybrid map/graph visualization of COVID-19 risk burden, resource and testing sufficiency
and trajectories over time. In contrast to many dashboards that are data-driven and/or
built on proprietary software, COViz is an efficient, lightweight open platform that
focuses on use of sound cartographic principles to construct targeted visualizations
that intuitively communicate information relevant to specific epidemiological questions.
These include:
- What is the current risk of transmission?
- What is the recent trajectory of disease burden and resource availability?
- How great is the cumulative burden of disease?
- Are resources and testing sufficient?
To visually communicate answers to these questions, COViz aims to combine adherence to
traditional cartographic principles with innovative map forms and easy-to-use
animation/interaction components.
Traditional Cartographic Principles
- All maps communicate rates per population. Raw case counts, hospitalizations and
deaths are meaningless without the context of the population within which they
are occurring.
- Rates are expressed using sequential color schemes, following the principles of
choropleth mapping.
- Raw counts, when shown, are expressed using proportional symbols, as symbol sizes
are intuitively associated with amounts.
- District polygons are highly generalized so that the focus is on the thematic
information, not the intricacies of the coastline.
Innovative Map Forms
COViz features the use of cartograms. Also known as “population maps” and “density
equalizing map projections”, cartograms have been used in epidemiology since
at least the
1920s to display districts at a size proportional to their underlying population.
This gives a better sense of the relative distribution of disease within the population.
While they take a little getting used to, cartograms enable certain advantages for visual
inference:
- When symbols (e.g. circles) are used to show raw case counts, the case rate
(cases per population) can be inferred visually by the proportion of each
district occupied by the circle.
- When sequential colors (e.g. light to dark) are used to show case rates, the
total number of cases is proportional to the darkness value multiplied by the
size of the state.
- Symbols on a cartogram will have less overlap than on a regular map.
Animation and Interaction
Some cartographic techniques that work well on static maps break down in animated sequences. We are currently experimenting with ways to enhance visual clarity on the animated timelines.
This is an open-source project. You are free to download, customize, modify data sources and
incorporate into your own website, with the caveat that no warranty is provided.
Keyboard shortcuts (these work inconsistently at the moment):
| T |
Place focus on the theme selector |
| ← → |
Move along timeline (when focus off var. sel.) |
| L,P |
Toggle between land and population map types |
(click on any state for data values)
This website is being developed by the EIU GIScience Center. Data comes from covidtracking.com, the COVID-19 Canadian Open Data Working Group, and the Center for Systems Science and Engineering at John Hopkins University. Coding performed by:
|
Barry Kronenfeld
Director, GIScience Center, Eastern Illinois University
|
|
Kwang-il Yoo (Jason)
PSM in GIScience, Eastern Illinois University
|
|
Sushma Saragadam
PSM in GIScience, Eastern Illinois University
|
|
Sarah Kronenfeld
University of Toronto
|
Latest project updates can be found on our github repository. This is a work in progress. Feel free to send comments or feedback.


Match Play. Red leads 9-3 to 13. How should Red play 54?
pips Red=125 White=186
(CorrectAnswer= 0/0, ErrorScore= 0)
Without the quiz factor everybody plays bar/20/16 and doesn’t give it another thought.
The QF leads one to look at bar/21, 13/8 and the more you look at it the more attractive it becomes.
The 8-pt would be very useful for Red so slotting it is good. White has only 8 checkers in the attack zone while Red has a four-point board. Now is the time to take a small risk. An exchange of hits will strongly favour Red and not White. So much so that bar/20/16 is actually a blunder.
Needless to say, I got this wrong over the board and then XG was kind enough to point out my error! Bar/21, 13/8 wins the same number of single games as bar/20/16 games but 5% more gammons.
The QF leads one to look at bar/21, 13/8 and the more you look at it the more attractive it becomes.
The 8-pt would be very useful for Red so slotting it is good. White has only 8 checkers in the attack zone while Red has a four-point board. Now is the time to take a small risk. An exchange of hits will strongly favour Red and not White. So much so that bar/20/16 is actually a blunder.
Needless to say, I got this wrong over the board and then XG was kind enough to point out my error! Bar/21, 13/8 wins the same number of single games as bar/20/16 games but 5% more gammons.
1. Cubeful 2-ply bar/21 13/8 Eq.: +0.604 0.642 0.366 0.020 - 0.358 0.083 0.003 2. Cubeful 2-ply bar/16 Eq.: +0.581 (-0.024) 0.654 0.292 0.009 - 0.346 0.073 0.001 3. Cubeful 2-ply bar/20 10/6 Eq.: +0.527 (-0.077) 0.627 0.362 0.016 - 0.373 0.090 0.003 4. Cubeful 2-ply bar/20 13/9 Eq.: +0.472 (-0.132) 0.619 0.321 0.014 - 0.381 0.087 0.003 5. Cubeful 0-ply bar/20 6/2* Eq.: +0.274 (-0.331) 0.582 0.294 0.009 - 0.418 0.114 0.006


This test validates the fix for a bug that occurred when typing a blank at the end of a line when the character doesn't fix by a fraction of a pixel. If the test runs correctly, you should see the word 'you' at the end of the line and the word 'have' at the beginning of the following line.
and Anna, you can do your regular weekly report run, and I'll extract the key sections into this. Andrew and Mark, I'd like to include any new bits you


{{ partial "header.html" . }} 404 - Page not found Sorry it appears this page doesn't exist! {{ partial "footer.html" . }}


/*
Copyright 2016 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import ErrorFactory from './error-factory';
import {isArrayOfType, isType, atLeastOne, isInstance} from
'../../../../lib/assert';
import {CacheableResponsePlugin} from
'../../../workbox-cacheable-response/src/index';
import {pluginCallbacks, getDefaultCacheName} from './constants';
import cleanResponseCopy from './clean-response-copy';
/**
* Called prior to a response being written to the cache. This allows you to
* prevent the cache from being updated if the response doesn't meet your
* custom criteria.
*
* @example
Determines whether a response is cacheable based on
* whether its Cache-Control header contains the string 'no-cache'.

*
* async function cacheWillUpdate({response}) {
* return !response.headers.get('cache-control').includes('no-cache');
* }
*
* @callback cacheWillUpdate
* @param {Object} input
* @param {Request} input.request The original request.
* @param {Response} input.response The response to the request, based on the
* configured strategy.
* @return {Promise<Boolean>} `true` if the response meets your criteria for
* being added to the appropriate cache, and `false` if it doesn't.
*
* @memberof module:workbox-runtime-caching.RequestWrapper
*/
/**
* Called after a response has been written to the cache.
*
* @example
Logs a message when the cache has been updated.

*
* async function cacheDidUpdate({cacheName, url}) {
* console.log(`The entry for ${url} in cache ${cacheName} was updated.`);
* }
*
* @callback cacheDidUpdate
* @param {Object} input
* @param {String} input.cacheName The name of the cache that was updated.
* @param {String} input.url The URL used as a key for the cache.
* @param {Response|null} input.oldResponse The response that was previously in
* the cache, prior to the update, or `null` if the cache didn't previously
* contain an entry for `url`.
* @param {Response|null} input.newResponse The response that was written to
* the cache.
*
* @memberof module:workbox-runtime-caching.RequestWrapper
*/
/**
* Called before a previously cached response that has been read from the cache
* is used. This allows you to modify it or return `null` if it's not valid.
*
* @example
Returns `null` to indicate that a cached response shouldn't
* be used if its Date header is too far in the past.

*
* async function cachedResponseWillBeUsed({cachedResponse}) {
* if (cachedResponse) {
* const dateHeader = cachedResponse.headers.get('date');
* const date = new Date(dateHeader);
* if (dateHeader && (Date.now() - date.getTime()) < 1000) {
* return cachedResponse;
* }
* }
*
* return null;
* }
*
* @callback cachedResponseWillBeUsed
* @param {Object} input
* @param {Request} input.request The original request.
* @param {Cache} input.cache An open instance of the cache.
* @param {String} input.cacheName The name corresponding to `cache`.
* @param {Response|null} input.cachedResponse The response for `request` that's
* currently in `cache`, or `null` if there isn't currently a response cached.
* @param {Object} input.matchOptions The
* [cache match options](https://developer.mozilla.org/en-US/docs/Web/API/Cache/match#Parameters)
* that were configured when the current `RequestWrapper` was constructed.
* @return {Promise<Response|null>} The response to be used as the effective
* cache match. This might be the same response as `cachedResponse`, if it was
* valid, a modified version of the response, or `null` if there's no valid
* match.
*
* @memberof module:workbox-runtime-caching.RequestWrapper
*/
/**
* Called prior to a network request being made. This allows you to update the
* request's URL or headers as appropriate, or just return the original request
* if there are no modifications needed.
*
* @example
Appends a URL parameter to all outgoing requests.

*
* async function requestWillFetch({request}) {
* const url = new URL(request.url);
* url.searchParams.set('from-workbox', 'true');
* return new Request(url.href, {headers: request.headers});
* }
*
* @callback requestWillFetch
* @param {Object} input
* @param {Request} input.request The request that would otherwise have been
* made against the network.
* @return {Promise<Request>} The request that will be used against the network
* instead.
*
* @memberof module:workbox-runtime-caching.RequestWrapper
*/
/**
* Called after a network request has failed. This allows you to report the
* failure, or save a copy of the failed request to be retried later.
*
* @example
Logs a message when a network request fails.

*
* async function fetchDidFail({request}) {
* const body = await request.text();
* console.log(`A request for ${request.url} with body ${body} failed.`);
* }
*
* @callback fetchDidFail
* @param {Object} input
* @param {Request} input.request A clone of the request that failed. You can
* consume the request's body if needed.
*
* @memberof module:workbox-runtime-caching.RequestWrapper
*/
/**
* This class is used by the various subclasses of
* [Handler]{@link module:workbox-runtime-caching.Handler} to configure the
* cache name and any desired plugins, which is to say classes that implement
* request lifecycle callbacks.
*
* It automatically triggers any registered callbacks at the appropriate time.
*
* @memberof module:workbox-runtime-caching
*/
class RequestWrapper {
/**
* Constructor for RequestWrapper.
* @param {Object} input
* @param {string} [input.cacheName] The name of the cache to use for Handlers
* that involve caching. If none is provided, a default name that
* includes the current service worker scope will be used.
* @param {Array.<Object>} [input.plugins] Any plugins that should be
* invoked.
* @param {Object} [input.fetchOptions] Values passed along to the
* [`init`](https://developer.mozilla.org/en-US/docs/Web/API/GlobalFetch/fetch#Parameters)
* of all `fetch()` requests made by this wrapper.
* @param {Object} [input.matchOptions] Values passed along to the
* [`options`](https://developer.mozilla.org/en-US/docs/Web/API/Cache/match#Parameters)
* of all cache `match()` requests made by this wrapper.
*/
constructor({cacheName, cacheId, plugins, fetchOptions, matchOptions} = {}) {
if (cacheId && (typeof cacheId !== 'string' || cacheId.length === 0)) {
throw ErrorFactory.createError('bad-cache-id');
}
if (cacheName) {
isType({cacheName}, 'string');
this.cacheName = cacheName;
if (cacheId) {
this.cacheName = `${cacheId}-${this.cacheName}`;
}
} else {
this.cacheName = getDefaultCacheName({cacheId});
}
if (fetchOptions) {
isType({fetchOptions}, 'object');
this.fetchOptions = fetchOptions;
}
if (matchOptions) {
isType({matchOptions}, 'object');
this.matchOptions = matchOptions;
}
this.plugins = new Map();
if (plugins) {
isArrayOfType({plugins}, 'object');
plugins.forEach((plugin) => {
for (let callbackName of pluginCallbacks) {
if (typeof plugin[callbackName] === 'function') {
if (!this.plugins.has(callbackName)) {
this.plugins.set(callbackName, []);
} else if (callbackName === 'cacheWillUpdate') {
throw ErrorFactory.createError(
'multiple-cache-will-update-plugins');
} else if (callbackName === 'cachedResponseWillBeUsed') {
throw ErrorFactory.createError(
'multiple-cached-response-will-be-used-plugins');
}
this.plugins.get(callbackName).push(plugin);
}
}
});
}
if (this.plugins.has('cacheWillUpdate')) {
this._userSpecifiedCachableResponsePlugin =
this.plugins.get('cacheWillUpdate')[0];
}
}
/**
* @private
* @return {function} The default plugin used to determine whether a
* response is cacheable.
*/
getDefaultCacheableResponsePlugin() {
// Lazy-construct the CacheableResponsePlugin instance.
if (!this._defaultCacheableResponsePlugin) {
this._defaultCacheableResponsePlugin =
new CacheableResponsePlugin({statuses: [200]});
}
return this._defaultCacheableResponsePlugin;
}
/**
* Opens a cache and maintains a reference to that cache
* for future use.
*
* @example
* requestWrapper.getCache()
* .then((openCache) => {
* ...
* });
*
* @return {Promise<Cache>} An open `Cache` instance based on the configured
* `cacheName`.
*/
async getCache() {
if (!this._cache) {
this._cache = await caches.open(this.cacheName);
}
return this._cache;
}
/**
* Wraps `cache.match()`, using the previously configured cache name and match
* options.
*
* @example
* requestWrapper.match({event.request})
* .then((response) => {
* if (!response) {
* // No response in cache.
* return;
* }
* ...
* });
*
* @param {Object} input
* @param {Request|string} input.request The key for the cache lookup.
* @return {Promise.<Response>} The cached response.
*/
async match({request}) {
atLeastOne({request});
const cache = await this.getCache();
let cachedResponse = await cache.match(request, this.matchOptions);
if (this.plugins.has('cachedResponseWillBeUsed')) {
const plugin = this.plugins.get('cachedResponseWillBeUsed')[0];
cachedResponse = await plugin.cachedResponseWillBeUsed({
request, cache, cachedResponse,
matchOptions: this.matchOptions, cacheName: this.cacheName,
});
}
return cachedResponse;
}
/**
* Wraps `fetch()`, calls all `requestWillFetch` before making the network
* request, and calls any `fetchDidFail` callbacks from the
* registered plugins if the request fails.
*
* @example
* requestWrapper.fetch({
* request: event.request
* })
* .then((response) => {
* ...
* })
* .catch((err) => {
* ...
* });
*
* @param {Object} input
* @param {Request|string} input.request The request or URL to be fetched.
* @return {Promise.<Response>} The network response.
*/
async fetch({request}) {
if (typeof request === 'string') {
request = new Request(request);
} else {
isInstance({request}, Request);
}
// If there is a fetchDidFail plugin, we need to save a clone of the
// original request before it's either modified by a requestWillFetch
// plugin or before the original request's body is consumed via fetch().
const clonedRequest = this.plugins.has('fetchDidFail') ?
request.clone() : null;
if (this.plugins.has('requestWillFetch')) {
for (let plugin of this.plugins.get('requestWillFetch')) {
const returnedRequest = await plugin.requestWillFetch({request});
isInstance({returnedRequest}, Request);
request = returnedRequest;
}
}
try {
return await fetch(request, this.fetchOptions);
} catch (err) {
if (this.plugins.has('fetchDidFail')) {
for (let plugin of this.plugins.get('fetchDidFail')) {
await plugin.fetchDidFail({request: clonedRequest.clone()});
}
}
throw err;
}
}
/**
* Combines both fetching and caching using the previously configured options
* and calling the appropriate plugins.
*
* By default, responses with a status of [2xx](https://fetch.spec.whatwg.org/#ok-status)
* will be considered valid and cacheable, but this could be overridden by
* configuring one or more plugins that implement the `cacheWillUpdate`
* lifecycle callback.
*
* @example
* requestWrapper.fetchAndCache({
* request: event.request
* })
* .then((response) => {
* ...
* })
* .catch((err) => {
* ...
* });
*
* @param {Object} input
* @param {Request} input.request The request to fetch.
* @param {boolean} [input.waitOnCache] `true` means the method should wait
* for the cache.put() to complete before returning. The default value
* of `false` means return without waiting. It this value is true
* and the response can't be cached, an error will be thrown.
* @param {Request} [input.cacheKey] Supply a cacheKey if you wish to cache
* the response against an alternative request to the `request`
* argument.
* @param {function} [input.cacheResponsePlugin] Allows the
* caller to override the default check for cacheability, for
* situations in which the cacheability check wasn't explicitly
* configured when constructing the `RequestWrapper`.
* @param {boolean} [input.cleanRedirects] If true, a "clean" copy of any
* redirected responses will be added to the cache, since redirected responses
* [can't be used](https://bugs.chromium.org/p/chromium/issues/detail?id=669363&desc=2#c1)
* to satisfy navigation requests. Defaults to false.
* @return {Promise.<Response>} The network response.
*/
async fetchAndCache(
{request, waitOnCache, cacheKey, cacheResponsePlugin, cleanRedirects}) {
atLeastOne({request});
let cachingComplete;
const response = await this.fetch({request});
// We need flexibility in determining whether a given response should
// be added to the cache. There are several possible ways that this logic
// might be specified, and they're given the following precedence:
// 1. Passing in a `CacheableResponsePlugin` to the `RequestWrapper`
// constructor, which sets this._userSpecifiedCachableResponsePlugin.
// 2. Passing in a parameter to the fetchAndCache() method (done by certain
// runtime handlers, like `StaleWhileRevalidate`), which sets
// cacheResponsePlugin.
// 3. The default that applies to anything using the `RequestWrapper` class
// that doesn't specify the custom behavior, which is accessed via
// the this.getDefaultCacheableResponsePlugin().
const effectiveCacheableResponsePlugin =
this._userSpecifiedCachableResponsePlugin ||
cacheResponsePlugin ||
this.getDefaultCacheableResponsePlugin();
// Whichever plugin we've decided is appropriate, we now call its
// cacheWillUpdate() method to determine cacheability of the response.
const cacheable = await effectiveCacheableResponsePlugin.cacheWillUpdate(
{request, response});
if (cacheable) {
// If cleanRedirects is set and this is a redirected response, then
// get a "clean" copy to add to the cache.
const newResponse = cleanRedirects && response.redirected ?
await cleanResponseCopy({response}) :
response.clone();
// cachingComplete is a promise that may or may not be used to delay the
// completion of this method, depending on the value of `waitOnCache`.
cachingComplete = this.getCache().then(async (cache) => {
let oldResponse;
const cacheRequest = cacheKey || request;
// Only bother getting the old response if the new response isn't opaque
// and there's at least one cacheDidUpdate plugin. Otherwise, we don't
// need it.
if (response.type !== 'opaque' &&
this.plugins.has('cacheDidUpdate')) {
oldResponse = await this.match({request: cacheRequest});
}
// Regardless of whether or not we'll end up invoking
// cacheDidUpdate, wait until the cache is updated.
await cache.put(cacheRequest, newResponse);
if (this.plugins.has('cacheDidUpdate')) {
for (let plugin of this.plugins.get('cacheDidUpdate')) {
await plugin.cacheDidUpdate({
cacheName: this.cacheName,
oldResponse,
newResponse,
// cacheRequest may be a Request with a url property, or a string.
url: ('url' in cacheRequest) ? cacheRequest.url : cacheRequest,
});
}
}
});
} else if (!cacheable && waitOnCache) {
// If the developer requested to wait on the cache but the response
// isn't cacheable, throw an error.
throw ErrorFactory.createError('invalid-response-for-caching');
}
// Only conditionally await the caching completion, giving developers the
// option of returning early for, e.g., read-through-caching scenarios.
if (waitOnCache && cachingComplete) {
await cachingComplete;
}
return response;
}
}
export default RequestWrapper;


Forecast: Thunderstorms to persist but gusty winds on the way
by Guy HagiHONOLULU, Hawaii (HawaiiNewsNow) - An unsettled weather pattern will persist across the island chain through Tuesday, with locally heavy rainfall and thunderstorms possible statewide.
The airmass will stabilize by Wednesday, but a showery wet trade wind pattern is expected to hold through the weekend.
Breezy to windy conditions are expected Thursday through Saturday.
Surf along all shores will remain below high surf advisory levels through Tuesday, but a new long-period northwest swell arriving Wednesday will require a high surf advisory for exposed shores of most islands through Thursday.
Surf could approach the 25-foot threshold for a high surf warning.
Another northwest swell arriving this weekend may also require a high surf advisory. In the meantime, a new northwest swell will likely peak tonight and lower Tuesday, with peak surf heights remaining below advisory levels.
Copyright 2019 Hawaii News Now. All rights reserved.


Schools shut in Lahore as city chokes in toxic smog
LAHORE, Nov 22 — Schools across Pakistan’s second largest city Lahore closed for the second time in a month today, with the city blanketed in a toxic smog that experts say is putting residents at risk.
Every November, a combination of industrial pollution, burning waste and farm fires in neighbouring India fouls the air in Pakistan’s cultural capital, making it one of the world’s most polluted cities.
The Punjab state government has already ordered the closure of thousands of primitive brick kilns that dot the state in order to ease pollution.
But today the Air Quality Index from a monitoring station at the United States’ consulate hit a year-high 451 out of a possible 500, a level considered “hazardous” and where even healthy people are advised to stay indoors.
Punjab Education Minister Murad Raas told Reuters the government was taking necessary measures, including the school holiday. Rights group Amnesty International, however, called the government’s response inadequate, saying Pakistani authorities were playing down the crisis.
According to a 2015 report published by the medical journal Lancet, nearly 22 per cent of annual deaths in Pakistan — or more than 310,000 each year — are caused by pollution, most due to air contamination.
“I am personally suffering an eye infection and skin allergies due to smog,” said Zainab Khan, a university student in the city of more than 11 million.
“My classmates also suffered bronchitis, lung infections and other smog related diseases. The government must show seriousness to resolve this problem.”
Sahibzad Khan, Lahore’s chief meteorologist, told Reuters the smog will continue until mid-December. — Reuters


--- layout: archive title: Zulip Chat Archive permalink: /stream/113488-general/topic/parser.20fun.html ---
Did you ever notice the space in #check nat
is optional?
Clearly a bug with the syntax highlighting of #checknat
.
Yes, Lean is more lenient than the VScode plugin syntax highlighting...
Of course there is nothing specific to nat here. You can check other things.
Oh wow, this approach generalizes to other commands as well:
#printnat #eval0
Unlocking mysteries of Lean...
I'd noticed the #eval0
example but I had no idea we could put nat
there...
what if I define a user-command #chec
We said Lean is white-space sensitive only in import, right?
Why are we using all those white spaces?
{% endraw %}Last updated: Apr 24 2020 at 19:02 UTC


© Bruce Wilcox<EMAIL_ADDRESS>www.brilligunderstanding.com
Revision 4/8/2017 cs7.31
While it is possible to connect ChatScript to a GUI IDE for debugging (if you create one because CS does not come with one natively), CS also has a text command debugger analogous to GDB in LINUX.
You enter the debugger via
:debug
which begins a local command loop. Resume normal execution via
go
or
g
The debug command can also have one of the debug commands after it, e.g.
:debug break ^fn1 ~topic1 ^fn2
While in the debugger, you can display $variables just by typing in their name(s).
$myvar $_yourvar
If you know the name of a JSON unit, you can just type that and get a display of the array or object.
jo-44
Typing the name of a function or topic will tell you the file and line number of it.
You can set breakpoints that will trigger the debugger on a variety of conditions. And you can name multiple conditions at once. E.g.,
break ^myfunction ~mytopic ~mytopic.myrule
A function breakpoint will, by default, break on entry and break on exit. On entry it shows the function and its arguments. On exit it shows the value being returned and any error status.
You can restrict a function to only breaking on entry or exit by suffixing the name with @i or @o. Like
break ^myfunc@i
You can delete a breakpoint by putting !
in front of the base name. E.g.
break ^myfunc !^otherfunc
Every time you call break, it prints out a summary of the breakpoints still set. So if you call break with no names, it just lists what you have.
A topic breakpoint will break on entry and exit of topic by whatever manner (normal, ^gambit
, ^rejoinder
, ^reuse
, etc).
A rule can broken upon by doing
break ~mytopic.label
where label is either the label of a rule or its tag (e.g., 1.0
for the 2nd top level rule of the topic).
You can name
abort
to request a breakpoint if the system is about to exit due to abnormal conditions.
A different kind of breakpoint is a variable assign, that is, when a variable has its value changed. You can list multiple variables in a single request.
= $myvar $_hisvar
The breakpoint will tell you the new value it is taking on. Be aware that if you break on a local variable like $_myvar
then you break on the next change to it in whatever topic or function it is within. You may, if you want, create a restricted breakpoint for $_vars like this:
^myfunc.$_myvar
or
~mytopic.$_myvar
clear
will remove all breakpoints including variable assigns.
where
will print out a backtrace of where you are in terms of topics, rules, and functions.
You can step from action to action in your code by typing
s
or
step
Which is equivalent to step across
. This will execute the next thing at the current level (maybe a function call, rule test, assignment or whatever). It will then display what code it executed, what value was returned, and what code would be executed next.
When you are at a rule, s
moves to the next rule. Alternatively, you can ask the system to execute rules in a topic until it comes to one that would match by saying
step match
It will stop before entering the output of the rule or until it leaves the topic.
If you discover that the executed code called a function that did something wrong and you want to watch it, you can type
redo in
which will retry that same piece of code, but this time going in instead of stepping over.
You can step out from a function or topic by typing
out
which will execute code until it leaves the current function or topic or rule. topic is confusing when you have rules. If stepping out returns to code which has nothing left to do, that code will also complete and the system will pop out to the next level.
You can step in from an action in your code by typing
in
This will execute one or more bits of code until it calls into some function or exits the current scope entirely.
You can type in a
do
command, which is analogous to :do
, which allows you to set variables, execute script functions, etc.
The command
source filename
will take debugger input from the named file (with a .txt suffix added to the name) where the file is in a top level folder called debug
. Any command that resumes execution (like go
, in
, out
, s
) will terminate reading from the file.
In addition, you can create a file to automatically execute on a breakpoint. The name of the breakpoint should be the name of the file in the debug directory (with .txt added). When a function named the same as such a file has a breakpoint on entry, it will execute the commands. Similarly whenever a topic has a breakpoint on entry, it will execute its commands.
The debugger can swap out its stdin and stdout interactions with the user with functions supplied on the InitSystem
interface. The functions take a single argument char*
and either get a line of input or write out a line of outout.
The compiler builds a map file used by the debugger to know what files have what and what lines have what.
In addition, for every rule and function at the end of their data, the system prints out the cyclomatic complexity
of the output code.


Try out our Premium Member services: Virtual Legal Assistant, Query Alert Service and an ad-free experience. Free for one month and pay only if you like it.
IN THE HIGH COURT OF JHARKHAND AT RANCHI A.B.A. No. 1102 of 2013 Ashok Poddar @ Ashok Kr Poddar .... Petitioner(s) Versus State of Jharkhand ... Opposite Party Coram : HON'BLE MR. JUSTICE D.N.UPADHYAY For the petitioner (s): Mr. Indrajit Sinha For the opposite party : Addl.P.P. 10.06.2013
Heard the learned counsel for the petitioner and the learned counsel for the State.
This is an application for anticipatory bail flied by the petitioner in connection with Ormanjhi PS case No. 14 of 2013 for the offence registered under sections 54, 67 of the Jharkhand Minerals Rules, 2004 and sections 33/41/42 of the Indian Forest Act and section 37 of the Pollution Control & Prohibition Act, 1981.
Petitioner has been prosecuted for running a crusher unit without having no objection certificate from Jharkhand State Pollution Control Board and he was indulged in collecting stones extracted through illegal mining from reserve forest.
It is submitted that not a single stone has been seized from possession of the petitioner in connection with this case. He had not been running crusher at the relevant point of time.
Learned counsel for the State has opposed the prayer. Considering above aspects of the matter, the petitioner above named is directed to appear/surrender before the court below within a period of three weeks positively from the date of this order and on his surrender, he shall be released on bail on furnishing bail bond of Rs.10,000/- (rupees ten thousand) with two sureties of the like amount each to the satisfaction of learned Judicial Magistrate, 1st Class, Ranchi, in connection with Ormanjhi PS case No. 14 of 2013 ( GR No. 621 of 2013), subject to the conditions laid down under section 438(2) Cr.P.C.
Ambastha/- ( D.N.Upadhyay,J.)


“Only One” Lyrics : PJ Morton (Ft. Stevie Wonder)
PJ Morton – Only One Lyrics (Ft. Stevie Wonder)
I’m pretty sure I don’t need anything else
This is the best feeling I’ve ever felt
I know it took a long time, but now I’m here
And I ain’t going nowhere, no more fear
Room full of people but I only see you
Yeah, I’m so focused, everything else is in my rear view
Tell me what it’s going to take for you to see
I only wanna be with you,
Chorus:
Say girl, you know that you’re the only one that I want
The one that I want, one that I want
You know that you’re the only one that I need
The one that I need, one that I need
You know that you’re the only one that I want
The one that I want, one that I want
You know that you’re the only one that I need
The one that I need, one that I need
You know that you’re the only one that I want
Ooh
I know you’ve heard me say the same things before
But this time’s different, I’m sure that I want more
So give me just one more chance, I won’t let you down
Just watch what i show you, watch what I show you now
I know that forever is a long time
But there is no other choice in my mind
Tell me what it’s going to take to make you see
That I only wanna be with you
Chorus:
Say girl, you know that you’re the only one that I want
The one that I want, one that I want
You know that you’re the only one that I need
The one that I need, one that I need
You know that you’re the only one that I want
The one that I want, one that I want
You know that you’re the only one that I need
The one that I need, one that I need
You know that you’re the only one that I want
Ooh
Oh I, I’ve made uṗ my mind
I know just what I want
I’m just waiting for you to see
What I see so clearly
I’ve never been more sure
Oh never in my life
But the time is right for you to be my one and only
Chorus:
You know that you’re the only one that I want
The one that I want, one that I want
You know that you’re the only one that I need
The one that I need, one that I need
You know that you’re the only one that I want
The one that I want, one that I want
You know that you’re the only one that I need
The one that I need, one that I need


wlm_query_slot_count
Values (Default in Bold)
1, 1 to 50 (cannot exceed number of available slots (concurrency level) for the service class)
Description
Sets the number of query slots a query uses.
Workload management (WLM) reserves slots in a service class according to the concurrency level set for the queue (for example, if concurrency level is set to 5, then the service class has 5 slots). WLM allocates the available memory for a service class equally to each slot. For more information, see Implementing Workload Management.
Note
If the value of wlm_query_slot_count is larger than the number of available slots (concurrency level) for the service class, the query fails. If you encounter an error, decrease wlm_query_slot_count to an allowable value.
For operations where performance is heavily affected by the amount of memory allocated, such as Vacuum, increasing the value of wlm_query_slot_count can improve performance. In particular, for slow Vacuum commands, inspect the corresponding record in the SVV_VACUUM_SUMMARY view. If you see high values (close to or higher than 100) for sort_partitions and merge_increments in the SVV_VACUUM_SUMMARY view, consider increasing the value for wlm_query_slot_count the next time you run Vacuum against that table.
Increasing the value of wlm_query_slot_count limits the number of concurrent queries that can be run. For example, suppose the service class has a concurrency level of 5 and wlm_query_slot_count is set to 3. While a query is running within the session with wlm_query_slot_count set to 3, a maximum of 2 more concurrent queries can be executed within the same service class. Subsequent queries wait in the queue until currently executing queries complete and slots are freed.
Examples
Use the SET command to set the value of wlm_query_slot_count for the duration of the current session.
set wlm_query_slot_count to 3;


## Master-slave and sharding with Doctrine, together at last
#### Davide Borsatto, sfday 2019
### About me
* PHP developer since 2007
* Worked on all major versions of Symfony, starting from 1.0
* Will add missing `@throws` annotations to your code
### About Madisoft
* We work remotely!
* We work full time on a Symfony project
* [We're hiring](https://labs.madisoft.it/entra-nel-team/)!
### About Nuvola
* Created in 2013 as a Symfony application (currently on 4.3)
* Web application for schools
* Uses Amazon Web Services
* Uses MySQL and has a huge amount of database queries, _more than a billion_ during a regular school day
* In 2014 sharding was first introduced
### What is sharding?
Many different views and specifications; our approach is to split data into different databases, according to domain boundaries (i.e. schools)
Our setup has a global database and multiple tenants (database shards)
Sharding: why and why not
Pros
Cons
Scalability
Security
Complexity
Manual data aggregation
### Things to keep in mind when working with a sharded database
* Be aware of where data is supposed to live: some might be stored in a shard, some in the global database, some in both
* Even when working locally, you need to take sharding into account in your workflow: your local database will work using shards, too
### Sharding: implementation with Doctrine
Two main interfaces to implement: `Doctrine\DBAL\Sharding\ShardManager` and `Doctrine\DBAL\Sharding\ShardChoser\ShardChoser`
[Documentation on Doctrine's website](https://www.doctrine-project.org/projects/doctrine-dbal/en/2.9/reference/sharding.html)
#### ShardManager
Works with the connection class in order to select the right shard. Contains two types of methods: for handling shard selection (`selectGlobal`, `selectShard`, `getCurrentDistributionValue`, `getShards`) and for performing queries across all shards (`queryAll`)
#### ShardChoser
Provides a single `pickShard` method, it is used for abstracting the logic of converting a "distribution value" to a shard identifier
#### DBAL Configuration
```yaml
doctrine:
dbal:
connections:
default:
shard_choser_service: nuvola.app.sharding.shard_choser
shard_manager_class: Nuvola\AppBundle\Sharding\ShardManager
wrapper_class: Doctrine\DBAL\Sharding\PoolingShardConnection
# ...
```
### More about sharding
* [Symfony and multi tenant apps: Nuvola](https://labs.madisoft.it/symfony-and-multi-tenant-apps-nuvola/)
* [Symfony and multi tenant apps: sharding](https://labs.madisoft.it/symfony-and-multi-tenant-apps-sharding/)
* [Doctrine sharding](https://labs.madisoft.it/doctrine-sharding/)
* SymfonyDay 2016 talk [video](https://vimeo.com/196399354) / [slides](https://www.slideshare.net/matteomoro8/scaling-symfony-apps)
## Optimizing our setup
Built to handle peak usage
Usage varies widly: extreme peaks during school hours (8AM to 3PM) and certain periods (end of school year), but low to no use during summer and night time
The setup was rigid: we could not scale it down gently to save resources
We were spending a ton of money for resources we did not use
### Possible solutions
* Moving [from RDS GP2 to RDS IOPS](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Storage.html): still not enough for our needs
* Database clustering: not cost effective and possibly lack of support
* Some proxy to handle read/write splitting: complex to set up and maintain
* Manually optimize certain areas of the application: inefficient and prone to error
We eventually decided to switch to Amazon Aurora and use its master-slave functionality
### What do we mean with "master-slave"?
_Master-slave replication enables data from one database server (the master) to be replicated to one or more other database servers (the slaves). The master logs the updates, which then ripple through to the slaves._
[MariaDB.com](https://mariadb.com/resources/blog/database-master-slave-replication-in-the-cloud/)
### Master slave and sharding at the same time?
* Doctrine natively supports either-or
* We had to DIY a few things to make it work
### Some implementation gotchas
#### You have to extend the base MasterSlaveConnection class
```php
class Doctrine\Migrations\Configuration\Configuration
{
public function connect() : bool
{
if ($this->connection instanceof MasterSlaveConnection) {
return $this->connection->connect('master');
}
return $this->connection->connect();
}
}
```
#### Getting creative for specifying multiple hosts
No way of changing the configuration format with a single host; as a workaround, we provide master/slave addresses separated with a colon
```yaml
doctrine:
dbal:
connections:
default:
host: "<IP_ADDRESS>:<IP_ADDRESS>"
```
#### SchemaTool does something unexpected
We created a patch for `SchemaTool` which fixes the use of `Connection::executeQuery` to `Connection::executeUpdate` in writing contexts
### Enter a custom connection class
* `MasterSlavePoolingShardConnection` extends `MasterSlaveConnection`
* A mix of `MasterSlaveConnection` and `PoolingShardConnection`
Works by overriding methods where `MasterSlaveConnection` would access `$this->connections['master/slave']` and adding an extra layer, turning it into `$this->activeConnections[$this->shardId]['master/slave']`.
#### DBAL Configuration
```yaml
doctrine:
dbal:
connections:
default:
wrapper_class: Nuvola\AppBundle\Sharding\MasterSlavePoolingShardConnection
#...
```
## Deployment
### Step 1
#### Problem
We should never write to a slave
#### Solution
We set up a special version used by our help desk with extra logging features enabled, and we carefully monitored those logs
### Step 2
#### Problem
The base scenario (master only) works
#### Solution
We deployed the code with no slaves enabled, with just one host configured
### Step 3
#### Problem
We test the migration to Aurora
#### Solution
We have some demo environments for our help desk to use (for testing features and reproducing issues), so we migrated those
### Step 4
#### Problem
We move all our data
#### Solution
We slowly batch migrate data, about 50 shards at a time
### Wait for issues to pop up
### The basic issue: replication lag
* You change something, data is written to master, but on a following request the slave is still not updated
* Amazon says the delay should stay below 100 milliseconds
* Waypoint solution implemented by [Booking](https://www.slideshare.net/JeanFranoisGagn/how-bookingcom-avoids-and-deals-with-replication-lag): interesting but too complex for our needs
### Problem
Users will make a change, then they are forwarded to another page which will display stale data
### Solution: a Symfony event listener
* Basic idea: if last write was less than 2 seconds ago, force current request to use master
* On **request**, checks whether the last write happened less than 2 seconds ago; if so, force connection pool to use master
* On **response**, checks whether the current connection was using master (which means some data was written); if so, save current time as last write event
* Not a perfect solution, but extemely pragmatic
* Theoretical risk of being stuck to master indefinitely
* Works using user sessions, cross-user stale data is not a real concern
### Problem
Spikes in failure rates for email and SMS notification delivery
We save a notification (email, SMS) row to database, and dispatch a message to the message queue
Sometimes the message queue is too fast and consumer looks for a database row which does not exist yet
The problem was already there, but failure rate was so low that we never really noticed
### Possible solutions
Either add a slight delay to the queue consumer or implement some sort of exponential backoff logic
### Are we happy with this setup?
* Yes! It saves us quite some money in billing
* Some things are not by the book, but they work for our use case and that's what matters to us
### What did we achieve?
#### We use about 50% less nodes
Every node holds about twice as many shards. We could pack even more shards in a single node, but we choose not to do it
#### Replication lag is low and we can easily work around it
Usually stays around 20ms
#### Very reduced load on master databases
Even with our permissive setup, about 75% of queries go to slaves, without any sort of optimization in the application
#### Our code does not depend on AWS
The infrastructure is built using Aurora, but the application configuration could be easily transferred elsewhere
## Thanks!
Please rate this talk: [https://joind.in/talk/056f3](https://joind.in/talk/056f3)
Take a look at our openings: [https://labs.madisoft.it/entra-nel-team/](https://labs.madisoft.it/entra-nel-team/)
Find me on [Twitter](https://twitter.com/davide_b88) and [Github](https://github.com/dborsatto)


Welcome to Elassus
Leverage agile frameworks to provide a robust synopsis for high level overviews. Iterative approaches to corporate strategy foster collaborative thinking to further the overall value proposition.
Leverage agile frameworks to provide a robust synopsis for high level overviews. Iterative approaches to corporate strategy foster collaborative thinking to further the overall value proposition.
Leverage agile frameworks to provide a robust synopsis for high level overviews. Iterative approaches to corporate strategy foster collaborative thinking to further the overall value proposition.
Bring to the table win-win survival strategies to ensure proactive domination. At the end of the day, going forward, a new normal that has evolved from generation X is on the runway heading towards a streamlined cloud solution. User generated content in real-time will have multiple touchpoints for offshoring.
Capitalize on low hanging fruit to identify a ballpark value added activity to beta test. Override the digital divide with additional clickthroughs from DevOps. Nanotechnology immersion along the information highway will close the loop on focusing solely on the bottom line.
Capitalize on low hanging fruit to identify a ballpark value added activity to beta test. Override the digital divide with additional clickthroughs from DevOps. Nanotechnology immersion along the information highway will close the loop on focusing solely on the bottom line.
Leverage agile frameworks to provide a robust synopsis for high level overviews.
Leverage agile frameworks to provide a robust synopsis for high level overviews.
Leverage agile frameworks to provide a robust synopsis for high level overviews.
Leverage agile frameworks to provide a robust synopsis for high level overviews.
Leverage agile frameworks to provide a robust synopsis for high level overviews. Iterative approaches to corporate strategy foster collaborative thinking to further the overall value proposition.
Capitalize on low hanging fruit to identify a ballpark value added activity to beta test. Override the digital divide with additional clickthroughs from DevOps.
John Doe
Nanotechnology immersion along the information highway will close the loop on focusing solely on the bottom line.
Nanotechnology immersion along the information highway will close the loop on focusing solely on the bottom line.
Nanotechnology immersion along the information highway will close the loop on focusing solely on the bottom line.
Nanotechnology immersion along the information highway will close the loop on focusing solely on the bottom line.
At the end of the day, going forward, a new normal that has evolved from generation X is on the runway heading towards a streamlined cloud solution. User generated content in real-time will have multiple touchpoints for offshoring.
Organically grow the holistic world view of disruptive innovation via workplace diversity and empowerment. At the end of the day, going forward, a new normal that has evolved from generation X is on the runway heading towards a streamlined cloud solution. User generated content in real-time will have multiple touchpoints for offshoring.
At the end of the day, going forward, a new normal that has evolved from generation X is on the runway heading towards a streamlined cloud solution. User generated content in real-time will have multiple touchpoints for offshoring.
Bring to the table win-win survival strategies to ensure proactive domination. At the end of the day, going forward, a new normal that has evolved from generation X is on the runway heading towards a streamlined cloud solution. User generated content in real-time will have multiple touchpoints for offshoring.
Capitalize on low hanging fruit to identify a ballpark value added activity to beta test. Override the digital divide with additional clickthroughs from DevOps. Nanotechnology immersion along the information highway will close the loop on focusing solely on the bottom line.


Who are we looking for
If you have a rich working experience in Web Development/Angular JS with HTML5, here is an opportunity to work with various customers on mobile app development and enhancements
What will you be doing?
Requirement
Copyright (C) Cerebtech. All Rights Reserved.


Topics
Activation Function
Adam
AlexNet
ArviZ
Backpropagation
bayesian models
Class Activation Map (CAM)
CNNs
Convexity
Convolutional Neural Networks
Data Augmentation
DataGenerators
Deconvolution
DenseNet
Dropout
Early Stopping
ELBO
embeddings
Feature Maps
Feed forward neural network
forward pass
Gaussian Mixture Model (GMM)
Grad-CAM
Gradient Clipping
Gradient Descent
Guided Backpropogation
Guided Grad-CAM
hierarchical bayesian models
Inception
Kalman Filter
L1
L2
Learning Rate
Loss Function
Max Pooling
MobileNet
Momentum
Multi-Layer Perceptron (MLP)
Natural Language Processing
NN Anatomy
NN Architecture
Object Detection
Optimizers
Output Units
padding
Particle Filters
Perceptron
Pooling
pyMC3
pytorch
R-CNN
Receptive Fields
Recurrent Neural Networks
Regularization
ResNet
RMSProp Adagrad
Saliency Maps
Semantic Segmentation
Sequential Monte Carlo (SMC)
SGD
Skip Connections
SOTA
stemming
Stochastic Gradient Descent
Subgradients
tensorflow
tokenization
Transfer Learning
U-Net
Weight Decay


This combining algorithm returns the first permit or return decision returned
by the list of configured PDPs. Steps: Invoke all configured PIPs in order.
- Invoke each PDP in order.
- If a PDP returns a permit or deny, return decision.
- If no PDPs provide a decision, return indeterminate.
Note that entity issuing the decision for each PDP is not considered, that is
the resource owner is not matched with PDP decision issuer. Resource owner is
used only when an indeterminate decision is returned, with no decision from
any PDPs.


José Arnulfo
Managing Director & Principal, Ketch de México
José Arnulfo pioneered business system software development in México. He brings decades of experience implementing GRP (Government Resource Planning for public sector entities in México) José is trusted across the country of México in business and government as an organizational architect with techno-functional expertise. His practical solutions to complex organizations have gained him followers throughout México and South America.


Mindfulness is to have self-awareness the process of being mindful is the process of monitoring our self and our emotions. By being able to maintain a strong focus on our body we can accurately track our emotions.
I tried the body scan process. I found this very relaxing and can see myself using it in the future.
The concept in this section seems like a very powerful tool for managing emotions in stressful and emotionally demanding situations. The idea that we can separate ourselves from our emotions and not just suppress them but chose to use or dismiss strikes me as a very helpful tool that I would like to practice and reinforce in my personal and professional life.


MNFAuthenticationProviderProtocol
@protocol MNFAuthenticationProviderProtocol <NSObject>
MNFAuthenticationProtocol is implemented by an authentication provider.
-
@description Gets the authentication headers provided in an authentication provider and adds them to every URL request.
Declaration
Objective-C
- (NSDictionary *)getHeaders;
Swift
func getHeaders() -> [AnyHashable : Any]!
Return Value
NSDictionary A dictionary of headers.
-
@description Gets the cookies provided in an authentication provider and adds them to every URL request.
Declaration
Objective-C
- (NSArray<NSHTTPCookie *> *)getCookies;
Swift
func getCookies() -> [HTTPCookie]!
Return Value
NSArray An array of NSHTTPCookie.
-
This method provides a chance to modify the url request before it is sent or do other preparation. If no modification is done simply return the preRequest parameter in the completion block.
Declaration
Objective-C
- (void)prepareRequest:(NSURLRequest *)preRequest withCompletion:(void (^)(NSURLRequest *))completion;
Swift
optional func prepare(_ preRequest: URLRequest!, withCompletion completion: ((URLRequest?) -> Void)!)
Parameters
preRequest
The request to be made before any modification.
completion
A completion block returning a new request to be used. This request can be the same requeste as preRequest or a modified version of it.