A blog about programming (usually scientific python), mathematics (usually game theory) and learning (usually student centred pedagogic approaches).
Just enough static site generator
2018-07-10
I am a huge fan of static site generators. There are a number of fantastic static site generators around: jekyll being one of the most used as it renders static files hosted via github pages. Jekyll is written in Ruby (a language I do not know at all) an there are a number of others, including many written in Python (I language I do know). On a number of occasions I've found myself not quite entirely happy with the various options and recently I've started just writing a short Python script to act that does the same job. In this post I'll describe the relatively few lines of Python required to make a static site generator.
TLDR All you need to create a static site generator is a small number of
lightweight and awesome Python libraries. Here is the full file I'm about to
describe main.py
.
What is a static site generator?
First things first: whilst most of the web is now powered by server based sites that take a request, access a database and serve the corresponding html on the fly a static site generator is used to do a one off read of all source files (the "data base") and generate all the html in one go.
Most of these will for example, use the popular file format
markdown
to write blog
posts and convert them to html.
As an example this blog post is written in markdown and is currently in a file
in a directory called src
:
|
|---src/
|---2018-07-10-just-enough-static-site-generator.md
The first few lines of this file look like:
title: Just enough static site generator
description: A description of a small python script as a static site generator
---
I am a huge fan of static site generators. There are a number of fantastic
static site generators around: [jekyll](https://jekyllrb.com/) being one of the
most used as it renders static files hosted via
[github pages](https://pages.github.com/). Jekyll is written in
[Ruby](https://www.ruby-lang.org/en/) (a language I do not know at all) an there
are a number of others, including many written in Python (I language I do know).
On a number of occasions I've found myself not quite entirely happy with the
various options and recently I've started just writing a short Python script to
act that does the same job. In this post I'll describe the **relatively** few
lines of Python required to make a static site generator.
**TLDR** All you need to create a static site generator is a small number of
lightweight and awesome Python libraries. Here is the full file I'm about to
describe [`main.py`](blog/main.py).
### What is a static site generator?
First things first: whilst most of the web is now powered by server based sites
The first thing we need to be able to do is find all those files
Using Pathlib
to find all the markdown files
Pathlib
is a fantastic
library that provide an abstraction to file systems (so things work on *nix and
Windows for example).
We can use Pathlib
to easily find all the .md
files in the src
directory.
Here is the first step of a python function main
that does this, it
essentially boils down to the src_path.glob("*.md")
part.
def main(src_path=None, output_dir=None):
"""
Read all the source directories
"""
if src_path is None:
src_path = pathlib.Path("./src/")
if output_dir is None:
output_dir = pathlib.Path("./posts")
output_dir.mkdir(exist_ok=True)
posts = []
for post_path in reversed(list(src_path.glob("*.md"))):
post = read_file(path=post_path)
write_post(post=post, output_dir=output_dir)
posts.append(post)
html = render_template(
"home.html",
{
"blog_title": BLOGTITLE,
"posts": posts,
"root": ROOT,
"description": DESCRIPTION,
},
)
(output_dir.parent / "index.html").write_text(html)
You can see that there are two other functions being called inside the for
loop:
read_file
write_post
Let us next look at reading in a given markdown file with read_file
.
Using pyyaml
and markdown
to read and convert markdown files to html
There are two stages to this read_file
function:
- Getting all the information out of a
md
file. - Putting it all together in a nice handy format.
So here's what the read_file
function looks like:
def read_file(path):
"""
Return a Post object given a path to a blog post
"""
stub = get_stub(path)
date = get_date(path)
content, metadata = get_content_and_metadata(path)
content = content.replace("blog", ROOT)
return Post(
stub=stub,
title=metadata["title"],
description=metadata.get("description", ""),
date=date,
content=content,
metadata=metadata,
)
The get_stub
and get_date
function just read directly from the file name
which is now forced to always be of the form <date>-<stub>.md
:
def get_stub(path):
"""
Return the stem of a path.
"""
return path.stem[len("yyyy-mm-dd-") :]
def get_date(path):
"""
Returns the date in ISO format at the start of the name of a directory
"""
date_regex = "(19|20)\d\d[- ./](0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])"
try:
return re.search(date_regex, path.stem[: len("yyyy-mm-dd")]).group()
except AttributeError:
return None
All of that just makes use of the Pathlib
library but where things get
interesting is the ability to get the preamble material at the top of a markdown
file (technically speaking this is usually in a format called
yaml
). Here is the
get_content_and_metadata
function that does this:
def get_content_and_metadata(path, delimeter="---"):
"""
Returns the html of a given markdown file
"""
raw = path.read_text()
raw_metadata, md = raw[:raw.index(delimeter)], raw[raw.index(delimeter):]
metadata = yaml.load(raw_metadata)
return markdown.markdown(md), metadata
The first step is to split the file on the delimeter
(---
) which will be
used to separate the yaml
and md
content. Then we use the pyyaml
library
to transform the yaml
in to a python dictionary and the markdown
library to
transform the rest in to html.
The last step of the read_post
function is to return a Post
instance. This
is just a namedtuple
which makes things simpler to manage at a later stage:
Post = collections.namedtuple(
"post", ["stub", "title", "description", "date", "content", "metadata"]
)
Next we write this html to files that will actually be accessed/read online
Using jinja2
to template how our site will look
The next part of the main
function shown previously is to call the
write_post
function. This makes use of the very versatile jinja2
library
which makes using templates (so that we only need to write the structure of
pages once) straightforward. jinja2
is actually used by a number of other
libraries but here we're using it "raw":
def write_post(post, output_dir):
"""
Create the output directory and write the post
"""
output_path = output_dir / f"./{post.stub}"
output_path.mkdir(exist_ok=True)
html = render_template(
"post.html",
{
"blog_title": BLOGTITLE,
"description": post.description,
"content": post.content,
"date": post.date,
"title": post.title,
"root": ROOT,
},
This function takes a Post
instance (the named tuple shown before) and an
output directory (I'll be using posts
in my case) and then calls
render_template
which is where jinja2
passes the information
post.content
, post.date
etc to a template file post.html
.
Here is what render_tempalte
looks like:
def render_template(template_file, template_vars, searchpath="./templates/"):
"""
Render a jinja2 template
"""
templateLoader = jinja2.FileSystemLoader(searchpath=searchpath)
template_env = jinja2.Environment(loader=templateLoader)
template = template_env.get_template(template_file)
return template.render(template_vars)
The post.html
jinja2
template looks like:
{% extends "base.html" %}
{% block body %}

 {{title}}

 {{date}}

{{content}}
{% endblock %}
This is "extending" the base.html
template where I've put a number of other
things including css styling.
The final part of main.py
just passes all posts to another template
home.html
which aims to create the landing page of this blog post:
{% extends "base.html" %}
{% block body %}

{% for post in posts %}

{{post.title}} - {{post.date}}

{{post.description}}

{% endfor %}

{% endblock %}
Setting some details
The first few lines of the python file with all these functions in them has the imports and a few global variable settings:
import pathlib
import re
import collections
import jinja2
import markdown
import yaml
ROOT = "blog"
BLOGTITLE = "Un peu de math"
DESCRIPTION = """
A blog about programming (usually scientific python), mathematics (game theory)
and learning (usually student centred pedagogic approaches)."""
Now we can render the site.
Building the site and serving it locally thanks to the http
library
To render the site we simply run main.py
:
$ python main.py
This will create a number of html
files in specific directories.
If you want to see this site locally on your computer, python comes with a handy server right out of the box. Go to the parent directy and run it:
$ cd ..
$ python -m http.server
Then go to your browser and type in http://localhost:8000/
, you should see a
number of directories there that should include the blog site too. Click on that
and you get a nicely rendered webpage. Of course, because this site is entirely
static you can also just inspect the various html
files too.
Pushing to production!
My approach to "publishing" this site is to render locally, push to github and serve via github pages. In general this looks something like:
$ python main.py
$ git add <source-file.md>
$ git add posts/<output-file.html>
$ git commit
# Write commit message
$ git push
I choose not to render my static sites (the python main.py
part) using a
continuous integration (CI) service, probably 50% laziness and 50% not wanting to add
a tiny layer of complexity that could break, but that's possible to do.
The test_main.py file contains some unit tests and
I do use (CI) to make sure that doesn't break and also to make sure that python
main.py
runs without failure.
Why do this?
If you are happy with any of the awesome static site generators out there you should not do this.
I've just often found myself wanting to make slight tweaks and either not being willing to learn Ruby and not entirely satistfied with the tweaks that would have been required for the Python options.
For example, my personal "academic portfolio" (if that's
a thing?) site, uses a yaml
database to render both the html and a latex/pdf
CV.


Please check the browser's console and run the server with the environment variable DEBUG=*
for understanding what's happening
Login (A.K.A Set session variable user
).
Logout i.e. Unset session variable user
.
Login (A.K.A Set session variable user
).
Logout i.e. Unset session variable user
.


One GET API is provided for predicting sentiment of a tweet give it's status id. This API can be found at the following URL:
/api/twitpulse/sentiment-by-status-id/
The parameters are as follows:
Example usage: /api/twitpulse/sentiment-by-status-id/?statusId=396418164239511552&queryTerm=Garfunkel+Oates


1 write to Ping
Microsoft.PowerShell.Commands.Management (1)
commands\management\TestConnectionCommand.cs (1)
917
Ping
= pingNum;
1 reference to Ping
Microsoft.PowerShell.Commands.Management (1)
commands\management\TestConnectionCommand.cs (1)
1052
public uint Ping { get => _status.
Ping
; }


A suite of tools you can use to engage your team and customers to generate actionable and measurable knowledge from the collective insights from the people and processes that drive your business.
“What’s Measured Improves”
• Get insight from your meeting participants
• Elevate the effectiveness of meetings
• Measurable impact on company performance, morale and customer satisfaction
• blah blah blah
| Free | Paid Plan |
|---|---|
| Measure one meeting at a tie | Unlimited Meeting Threads - series over time |
| Invite up to 25 Participants | Unlimited Participants |
| Auto Curate Ideas from Comments | |
| Branded Engagement Form | |
| Invite Participants | Login Sign Up |


Enter information below about staffing categories or staff members who will be performing parts of the digitization project. On the following page, you'll be able to assign a different staff person to each process before cost calculations are performed by the calculator. The data you enter about staff is not saved, shared, or transmitted, though it will be retained in this browser window until you close it (allowing you to modify your calculator query during this session without re-entering staffing data each time). The "Name" field is only used to populate the dropdown list on the following page used to assign people to tasks -- you may use real names, or any other label (e.g., "Technician 1, Salaried #2").
{% include people_form.html %} {% comment %} {% endcomment %}


Frameworks and D
Russell
The D C++ classes is a C++ component mini-framework that provides meta-level information and behavior for unprecedented flexibility and extensibility in C++ software.
Why
Nov 12, 1998
There is no growth without change. The inability to change is the inability to grow. What is more difficult to change in software than assumptions? The most difficult assumptions to change are those which span systems or components; the most fluid designs allow for system wide assumptions, such as inter-component associations and communication, to be dynamic. In software, dynamic implies behavior rather than structure, particularly as applied to data. When all things inter-component are dynamic, the components may grow independently, and since "the system" is defined as the interaction of its components, the definition of the system itself is dynamic. Ultimately, each component itself may be such a system, and we have a dynamic system of dynamic systems of dynamic systems of dynamic systems... what we're left with is a concept of dynamic structure. "The system" has no static structure except in an instantaneous sense; the definition of the system includes the fact that it is changing in time, just as acceration is a change in velocity in time, and velocity is a change in position in time. This reflects, finally, the reality that the only general case that matters is things will change.
What can we do to move to this vision? First let's figure out where we are. In the real world we have C++ and Java as the most mainstream languages. The first questions are how to identify assumptions and minimize their proliferation - with the realization that we can't solve this general case from within C++ or Java. As wonderful as change management design patterns are, you have to knowingly apply them, and the irony is we do this in a particular area because we're expecting change! Reality is different - it is rarely the case that a system will change in the ways we predict. If we can apply change oriented design patterns underneath the language, then we will be able to deal with change at every level. The challenge is how to do this in mainstream languages like C++ and Java.
One significant kind of assumption is a dependency - one class depends on another. If the other needs to change, the one must accomodate for this change. A tight network of dependencies means massive ripple effects for even the smallest, seemingly innocuous change. The full extent of such changes are very difficult to track, and depends significantly on how well the system was designed. The unfortunate reality is that a good design is like a good intention - it cannot predict or guarantee the outcome. The best design created by nearly omniscient abstractionists can be destroyed by one simple unexpected dependency when the system needs to be changed. We need to implement a deeper infrastructure to deal with such things than expecting good design to take care of something it cannot.
There is nothing we can do to prevent or make up for bad design; what we can do, however, is make, as much as possible, such dependencies dynamic. Let us look at this in more detail.
When, in C++ or Java, I decide that an object should be composed of several other objects, some assumptions that get solidified are:
On the surface these seem obvious assumptions. But what does it mean that an object has a variable? Does it mean that, in C++, the object has a pointer? Perhaps it is a "smart" pointer. Perhaps it is a super-smart pointer which looks up the requested class by name.
How
Oct 28, 1998
The D C++ classes is a C++ component mini-framework that provides meta-level information and behavior for unprecedented flexibility and extensibility in C++ software. But it is fundamentally incomplete: it needs application or environment-specific frameworks to integrate these objects into an environment, such as:
These frameworks span from the non-existent to the very complex. Much of the differences among them represent different perspectives on dynamic messaging, loadable library structure, and OS-specific details.
The purpose of this C++ implementation of D is:
The last goal is accomplished by providing meta-level data structures, virtual data, dynamic messaging and memory management for those C++ objects which adhere to this standard. This meta-level information allows much of the extreme flexibility found in dynamic languages while maintaining the benefits of C++'s standardization and speed.However, these objects are incomplete in the sense that they are not integrated into any specific enviornment; an environment- or application-specific framework must be created into which these components can be plugged. A "framework" is a semi-complete application, and would provide the following for D objects:
Such a framework is implemented for Granite Foundation today. In fact, Foundation has been modified to take advantage of it in a very tight and efficient manner because D objects, implemented in C++, maybe used from within Foundation's dyanmic language RSL as if they were native RSL-defined objects - far more tightly integrated than Foundation's own C++ standard.


Eth Sign
Plain text to sign
Public key that will sign
Sign
Signed text
Signature
Original text
Public key that signed
Recover


Our products are tested regularly so they don't break.
We aim to get our products to you as fast as we can!
We take customer reviews and feedback seriously.
We love our products and we love what we do!


DfE enquiries
Central newsdesk 020 7783 8300
General enquiries 0370 000 2288
News story
Gibb: “Phonics is the proven method that will drive up reading standards.”
Schools Minister Nick Gibb today said that the Government was “unashamedly ambitious” in its bid to drive up the standard of children’s reading.
Mr Gibb said that although it was good that more than 80 per cent of children routinely met expected reading levels at age seven and age 11, it was time to focus on driving up the performances of the one in five children who fail to reach the expected level and on getting more children to exceed expectations.
He said synthetic phonics, taught systematically, was the method proven to improve reading standards for all children, including the weakest readers, and ensure they reached their potential.
Mr Gibb acknowledged classroom teachers’ efforts to improve children’s reading skills but pointed to figures showing that:
Internationally, he said that:
Nick Gibb was speaking as figures were released showing that 32 per cent of six-year-olds who took the screening check reached what he called the “appropriately challenging” expected level, which was set by about 50 teachers whose schools were involved in the pilot.
He said the figures suggested many more pupils could benefit from phonics, giving them a solid grounding in the basics at an early stage. Teachers can then build on these skills so that more children develop into flourishing, confident readers by the end of Key Stage 1.
The pilot check was taken this summer by Year 1 pupils in about 300 schools, 27 per cent of whom said they teach phonics systematically, as opposed to teaching children mixed methods such as picture clues and sight memory to read words. This ratio is believed to be broadly in line with the picture across England’s primary schools.
The short check involves pupils reading 40 words to their teacher. The type of words in the check are covered by all good quality phonics schemes by the end of Year 1. Mr Gibb said it was vital that pupils are able to read these words by the end of Year 1 to give them the best chance of future success. The most common score achieved by pupils in the pilot was 40 out of 40.
Following a positive independent evaluation in September, the phonics check will be rolled out nationally next summer. The check will help provide teachers with vital information to identify pupils needing extra help with reading. Schools’ individual results will not be published.
Nick Gibb said:
We need to face up to the uncomfortable truth that, despite the hard work of teachers, not enough of our children are able to read to a high enough standard. We have to take account of our place internationally and listen to business leaders concerned about many school leavers’ literacy.
The Government can no longer simply congratulate itself on the proportion of pupils reaching the expected level.
The phonics check’s expected level, set by teachers, is appropriately challenging. We must adjust our sights if we are to tackle the country’s reading problem. The levels we expect children to reach at Key Stage 1 and Key Stage 2 must not be the limits of our ambition - they should be considered the minimum we expect. And we must get those below the level up to a standard that will help them progress further.
A solid grounding in phonics will help many children who are weak readers to improve. It will also see more pupils achieve a high Level 2 or a Level 3 score at the end of Key Stage1. It is this level of achievement which puts children on the path to success.
I am unashamedly ambitious in wanting to see all children reading to the very highest standard.
Evidence from around the world points to synthetic phonics, taught systematically, as the method that will bring all children up to the high level we want. Teachers in the pilot say the new check will allow them to identify children’s reading problems they hadn’t previously been aware of. Those pupils will then be given the extra help they need to become confident, fluent readers.
Many teachers have started to embrace phonics and some schools performed very strongly in the pilot.
But the results also show that some other schools could be more systematic in their teaching of phonics and we are supporting them to do this. The teaching of phonics is being prioritised in primary teacher training. We are giving schools up to £3,000 in match funding so they can buy training products and books. And we are making phonics and reading a key part of the new Ofsted inspection process.
Statistics show that pupils who achieve a good start in the first few years of reading are very likely to progress quickly throughout school.
2010 data showed that of those children who had previously achieved a strong Level 2 (2a) in Key Stage 1 reading:
2010 data showed that: of the children who only just achieved Level 2 (2c) in reading at Key Stage 1 reading
Pupils who reach Level 2 in reading are expected to be able to read simple texts with some understanding, give an opinion about characters, events or ideas, and put sounds together to understand new words.
The Government believes all children should at least be secure in these skills by age seven, and that many should achieve a Level 2a. In Year 2, many pupils should also be covering some of the Level 3 reading skills. This means they should be reading books over and above their phonics scheme. They will be able to show an understanding of the writer’s purpose, and will be starting to discuss their ideas about the book.
The current expected standards of attainment have been in place as part of the National Curriculum since 1999. The National Curriculum Review will ensure that the content, breadth and level of challenge of England’s new National Curriculum is comparable with the curricula of the world’s highest performing education systems. This will undoubtedly mean raised expectations. This will help England to move back up the international league tables, and ensure children leave school with the knowledge which will stand them in good stead throughout their career and adult life.
The Year 1 phonics screening check was piloted in about 300 schools in June 2011 - 229 of these came from a nationally representative sample. In total, 8,963 children participated in the pilot from schools in the representative sample.
Pilot schools were recruited in February/March 2011. They were given details of the content and structure of the screening check at the training meetings in late May/early June, just ahead of their pupils taking the check.
The overall structure of the check was designed at a series of meetings in September and October 2010, with a group of phonics experts (academics and product developers) and teachers. Ofqual was also represented at these meetings.
In 2012, the check will take place in all primary schools with six-year-old children during the week commencing Monday 18 June.
How does the check work?
Non-words are important to include because words such as “vap” or “jound” are new to all children. They cannot be read by memory or vocabulary - children have to use their decoding skills so it is a fair and accurate way to assess ability to decode.
An example of a check, including words used, can be found on our website .
Phonics teaches children how to:
Children can then use this knowledge to “de-code” new words that they see. This is the first important step in learning to read.
Research shows that when phonics is taught in a structured way - starting with the easiest sounds, progressing through to the most complex - that it is the most effective way of teaching young children to read. It is particularly helpful for children aged five to seven.
Almost all children who have good teaching of phonics will learn the skills they need to tackle new words. They go on to read any kind of text. Most importantly, they will read for enjoyment.
They also tend to read more accurately than those taught using other methods, such as “look and say”. This includes children who find learning to read difficult, for example those who have dyslexia.
The Department for Education today published an evidence note detailing some of the research supporting the use of phonics as the most effective method to teach children how to read.
It includes the findings of a number of studies, including:
A seven-year study in Clackmannanshire, Scotland, of the teaching of synthetic phonics to 300 children found they made more progress in reading and spelling than other children their age.
A 2005 Australian report, Teaching Reading, which said:
The incontrovertible finding from the extensive body of local and international evidence-based literacy research is that for children during the early years of schooling (and subsequently if needed) to be able to link their knowledge of spoken language to their knowledge of written language, they must first master the alphabetic code - the system of grapheme-phoneme correspondences that link written words to their pronunciations. Because these are both foundational and essential skills for the development of competence in reading, writing and spelling, they must be taught explicitly, systematically, early and well.
The US National Reading Panel report of 2006, which said:
Systematic synthetic phonics instruction had a positive and significant effect on disabled readers’ reading skills. These children improved substantially in their ability to read words and showed significant, albeit small, gains in their ability to process text as a result of systematic synthetic phonics instruction. This type of phonics instruction benefits both students with learning disabilities and low-achieving students who are not disabled. Moreover, systematic synthetic phonics instruction was significantly more effective in improving low socio-economic status (SES) children’s alphabetic knowledge and word reading skills than instructional approaches that were less focused on these initial reading skills… Across all grade levels, systematic phonics instruction improved the ability of good readers to spell.
The final report of the Independent Review of the Teaching of Early Reading, by Jim Rose in 2006, emphasised that beginner readers should be taught using a systematic approach to phonics. He cautioned that evidence submitted to the review which suggested using a mix of approaches could hinder children’s progress: “A model of reading which encourages switching between various strategies, particularly when phonic work is regarded as only one such strategy, all of equal worth, risks paying insufficient attention to the critical skills of word recognition which must first be secured by beginner readers, [for example] if beginner readers are encouraged to infer from pictures the word they have to decode …It may also lead to diluting the focused phonics teaching that is necessary for securing accurate word reading.”
Ofsted’s 2010 report, Reading by Six: How the Best Schools Do It, looked at inspection evidence from a sample of 12 primary schools. It explains that “concentrated and systematic use of phonics is key to their success; this is based on high-quality and expert teaching that gives pupils the opportunity to apply what they have learnt through reading, writing and comprehension of what they are reading”.
An independent evaluation of the pilot check was conducted by the Centre for Education and Inclusion Research (CEIR) at Sheffield Hallam University for the Department for Education.
It found that:
A series of case studies can be found on the DfE’s website .
The Department for Education today published a leaflet for parents on phonics and the check .
Central newsdesk 020 7783 8300
General enquiries 0370 000 2288
Website: www.education.gov.uk/help/contactus
Published: 9 December 2011


If you see this message, run this file through a server. Otherwise the ajax requests will fail.
This projects is build on WebStorm


Reservoir Dogs
Reservoir Dogs is a movie starring Harvey Keitel, Tim Roth, and Michael Madsen. When a simple jewelry heist goes horribly wrong, the surviving criminals begin to suspect that one of them is a police informant.


Planetary data and geoscientific map development with
demo and discussion
held at the 4th Planetary Data Workshop, 18-20 June 2019, Flagstaff - AZ
Alessandro Frigeri
Istituto di Astrofisica e Planetologia Spaziali - IAPS
Istituto Nazionale di Astrofisica - INAF
Rome, Italy
<EMAIL_ADDRESS>/ @afrigeri
Development started in 2002 by Gary Sherman
## Where do we left off?
2nd PDW in Flagstaff, 2015
QGIS was at:
* stable realease: 2.8.2, upcoming: 2.10
* platforms: GNU/Linux - OS X - MS Windows
## Where are we today?
4nd PDW in Flagstaff, June 19th 2019
QGIS is at:
* Stable: QGIS 3.6.3 'Noosa' (17.05.2019)
* LTR: QGIS 3.4.8 'Madeira'
* GNU/Linux - OS X - MS Windows - Android (QField)
* Upcoming v3.8 (now feature freezing)
* GRASS modules accessible from the QGIS GUI
Built-in OGC services
OGC services accessible from QGIS:
- Catalogue Service for the Web (CSW)
- Web Coverage Service (WCS)
- Web Feature Service (WFS)
- Web Feature Service - Transactional (WFS-T)
- Web Map Service (WMS)
QGIS is a project within OSGEO
The Open Geospatial Foundation (OSGeo) is a non-profit non-governmental organization whose mission is to support and promote the collaborative development of open geospatial technologies and data.
QGIS for planetary data handling
and
Planetary geoscientific mapping
QGIS for planetary mapping: elements
- Digitizing plugins
- Symbology
- Crater count tool
Digitizing interface
Interpretative mapping requires a lot of user-input. Stream digitizing support is critical with modern input devices
Digitizing with beePen plugin
BeePen plug-in by Mauro Alberti
latest version implements smoothing + simplify chain
Digitizing with bezier plugin
Bezier Editing by Takayuki Mizutani
works directly on exisitng vector layers
Circle Craters Plugin
Provides a 3-point crater digitizing tool in QGIS, exporting the data into a Craterstat (Michael et al, 2013) compatible file
- Developed for QGIS 2.6 by Sarah Braden
- ported to Python3 / QGis 3.6
Circle Craters Plugin in action (QGIS 3.6)
Circle Craters: output from Craterstat
made in Italy QGIS3!
Acknoledgements
A special thanks goes to the all the QGIS/FOSS4G developers, contributors and sponsors, and planetary data users testing these tools!
that's it!
... and that's only the beginning!
Audience: demo of paricular aspect? Questions?


LETS INTEGRATE THE WORLD
Maxis Communications is synonymous with the Networking products and Communication systems. We delivers high quality, reliable and cost-effective IT services to customers. We provide world-class technology services by constantly exploring and implementing innovative solutions that drive long-term value to our customers.
Maxis Features
99.9% UPTIME
Resilient infrastructure,Automated proactive monitoring analytics,Strong ITIL framework and 24*7 monitoring.

DISASTER RECOVERY
We are spread across geographical locations to meet the SLA objectives of RTO and RPO
STRONG ITIL FRAME WORK
Kepner-Tregoe based incident and problem management and highly automated and controlled change environment
ENTERPRISE COMPUTE EXPERTISE
The team has vast amount of experience in technology and functional domains to cater to demands
TIME TO MARKET BY LEAN OPERATIONS
Lean and RACI based operational model with high levels of Automation enables us to adopt factory model with high efficiencies
MAXIS Components
QUALITY PRODUCTS
With brands such as Optimax, Foxplus, Techmax, 3M®, Belden® and more products under our belt, you can purchase from Worldwide Technology Exchange with confidence that your product will be covered under warranty should anything happen.
PROMPT DELIVERY
Need to get it fast? Maxis guarantees quick shipping of your products so that you can quickly take care of business.
COMPETIVE PRICES
Most will say it, but we mean it. Worldwide Technology Exchange strives to provide the best price for your IT needs through our extensive industry connections.
SUPERIOR SERVICES
Speak with one of our friendly, professional representatives to find the right server equipments, fiberoptics or networking solution for your needs. Contact us now for a free estimate.


Progress Bar :
Skill N°1 with 20% progress:
Skill N°2 with 40% progress:
Skill N°3 with 60% progress:
Skill N°4 with 80% progress:
Skill N°5 with 100% progress:


Hi There,
I have an emonPi set up with 6 emonTXs, however only two of the TXs (node IDs 8 and 1) are showing up on Emoncms. The other emonTXs have node IDs of 2, 4, 6 and 7.
Any ideas?
Cheers
Gareth
Archived Forum |
|
emonTX ConnectivitySubmitted by garethc on Tue, 15/12/2015 - 13:56Hi There, I have an emonPi set up with 6 emonTXs, however only two of the TXs (node IDs 8 and 1) are showing up on Emoncms. The other emonTXs have node IDs of 2, 4, 6 and 7. Any ideas? Cheers Gareth » |
Re: emonTX Connectivity
Hi Gareth,
Can you post up your emonhub.conf (view via Emonhub tab of local Emoncms)
You will need to add entries into emonhub.conf for all your node. The latest emonTx's are running firmware V2.3 and require a node decoder as follows (replace NODEID with the node ID of each node)
[[NODEID]]
nodename = emonTx_4
firmware =V2_3_emonTxV3_4_DiscreteSampling
hardware = emonTx_(NodeID_DIP_Switch1:OFF)
[[[rx]]]
names = power1, power2, power3, power4, Vrms, temp1, temp2, temp3, temp4, temp5, temp6, pulse
datacodes = h,h,h,h,h,h,h,h,h,h,h,L
scales = 1,1,1,1,0.01,0.1,0.1, 0.1,0.1,0.1,0.1,1
units =W,W,W,W,V,C,C,C,C,C,C,p
Re: emonTX Connectivity
Assuming they are all within range, have you tried powering them up one at a time to confirm each is working individually? just in-case they are blocking each other.
If that is successful try powering them up at one second intervals rather than all together to stagger transmission and reduce blocking.
Paul
Re: emonTX Connectivity
HI There,
This is what they look like. DO I need to change every reference to the firmware to 2.3?
Cheers
Gareth
[[7]]
nodename = emonTx_7
firmware =V1_6_emonTxV3_4_DiscreteSampling
hardware = emonTx_(NodeID_DIP_Switch1:ON)
[[[rx]]]
names = power1, power2, power3, power4, Vrms, temp1, temp2, temp3, temp4, temp5, temp6, pulse #Firmware V1.6
#names = power1, power2, power3, power4, Vrms, temp #Firmware =<V1.4 (un-comment)
datacode = h
scales = 1.5,1.5,1.5,1,0.01,0.1,0.1, 0.1,0.1,0.1,0.1,1 #Firmware V1.6
units =W,W,W,W,V,C,C,C,C,C,C,p #FirmwareV1.6
#scales = 1,1,1,1,0.01,0.1 #Firmware =<V1.4 (un-comment)
#units =W,W,W,W,V,C #Firmware =<V1.4 (un-comment)
cne to the firmware to
[[7]]
nodename = emonTx_7
firmware =V1_6_emonTxV3_4_DiscreteSampling
hardware = emonTx_(NodeID_DIP_Switch1:ON)
[[[rx]]]
names = power1, power2, power3, power4, Vrms, temp1, temp2, temp3, temp4, temp5, temp6, pulse #Firmware V1.6
#names = power1, power2, power3, power4, Vrms, temp #Firmware =<V1.4 (un-comment)
datacode = h
scales = 1.5,1.5,1.5,1,0.01,0.1,0.1, 0.1,0.1,0.1,0.1,1 #Firmware V1.6
units =W,W,W,W,V,C,C,C,C,C,C,p #FirmwareV1.6
#scales = 1,1,1,1,0.01,0.1 #Firmware =<V1.4 (un-comment)
#units =W,W,W,W,V,C #Firmware =<V1.4 (un-comment)
Re: emonTX Connectivity
No, the references to the v2.3 firmware in the conf are purely aesthetical, what you type in "firmware =" appears in emoncms, in time it will be used for locating the firmware for updating/installing to nodes and to configure the other metadata.
What firmware IS running on the Tx's is important to establish what to expect in the payload as the "emon-pi" emonhub variant insists on full and accurate disclosure of every node.
The [nodes] section will need a minimum of 7 entries, one for each Tx plus the emonPi, I assume from your numbering you may also have at least another (8th) device as node 3 and the emonPi is still on it's default of node 5.
Every section in the emonhub.conf must have a unique index, in the [nodes] section it's node id. Your two nodes shown above are both [[7]] which will cause the whole config file to be unused, is that a typo?
Assuming all your Tx's are identical your emonhub.conf entries for nodes 2,4,6 & 7 should mirror 1 & 8 exactly with only the "unique" index ie [[nodeid]] different.
If you have 6 identical emonTx's and 6 identical (except node id) entries in [nodes] and still some don't show up in emoncms, then you must try them one at a time, to establish if the issue is with specific nodes or an overall traffic issue.
The node id's you are using confirm you have changed the firmware on each, have you made other changes to the sketches?
Using " tail -f /var/log/emonhub/emonhub.log " will give you a huge insight into what is (or isn't) happening if " loglevel = DEBUG " is set in emonhub.conf.
Paul


This article is about the Mars
Mars is the fourth planet from the Sun and the second-smallest planet in the Solar System, after Mercury. Named after the Roman god of war, it is often
referred to as the "Red Planet" because the iron oxide prevalent on its surface gives it a reddish appearance. Mars is a terrestrial planet
with a thin atmosphere, having surface features reminiscent both of the impact craters of the Moon and the valleys, deserts, and polar ice caps of Earth.
The rotational period and seasonal cycles of Mars are likewise similar to those of Earth, as is the tilt that produces the seasons. Mars is the site of
Olympus Mons, the largest volcano and second-highest known mountain in the Solar System, and of Valles Marineris, one of the largest canyons in the
Solar System. The smooth Borealis basin in the northern hemisphere covers 40% of the planet and may be a giant impact feature. Mars has two moons,
Phobos and Deimos, which are small and irregularly shaped. These may be captured asteroids, similar to 5261 Eureka, a Mars trojan.
Like Earth, Mars has differentiated into a dense metallic core overlaid by less dense materials. Current models of its interior imply a core
region about 1,794 (1,115) in radius, consisting primarily of iron and nickel with about 16-17% sulfur. This iron(II)
sulfide core is thought to be twice as rich in lighter elements than Earth's core. The core is surrounded by a silicate mantle that formed
many of the tectonic and volcanic features on the planet, but it now appears to be dormant. Besides silicon and oxygen, the most abundant elements
in the Martian crust are iron, magnesium, aluminum, calcium, and potassium. The average thickness of the planet's crust is about 50 km (31 mi),
with a maximum thickness of 125 km.
Earth's crust, averaging 40 km (25 mi), is only one third as thick as Mars', relative to the sizes
of the two planets.
Mars is a terrestrial planet that consists of minerals containing silicon and oxygen, metals, and other elements that typically make up rock.
The surface of Mars is primarily composed of tholeiitic basalt, although parts are more silica-rich than typical basalt and may be similar
to andesitic rocks on Earth or silica glass. Regions of low albedo show concentrations of plagioclase feldspar, with northern low albedo regions
displaying higher than normal concentrations of sheet silicates and high-silicon glass. Parts of the southern highlands include detectable amounts
of high-calcium pyroxenes. Localized concentrations of hematite and olivine have also been found. Much of the surface is deeply covered by
finely grained iron(III) oxide dust.
Soil
The Phoenix lander returned data showing Martian soil to be slightly alkaline and containing elements such as magnesium, sodium, potassium and chlorine.
These nutrients are found in gardens on Earth, and they are necessary for growth of plants. Experiments performed by the lander showed that the
Martian soil has a basic pH of 7.7, and contains 0.6% of the salt perchlorate.
Hydrology
Liquid water cannot exist on the surface of Mars due to low atmospheric pressure, which is about 100 times thinner than Earth's, except at the lowest
elevations for short periods. The two polar ice caps appear to be made largely of water. The volume of water ice in the south polar
ice cap, if melted, would be sufficient to cover the entire planetary surface to a depth of 11 meters . A permafrost mantle stretches from
the pole to latitudes of about 60 C. Large quantities of water ice are thought to be trapped within the thick cryosphere of Mars. Radar data from
Mars Express and the Mars Reconnaissance Orbiter show large quantities of water ice both at the poles (July 2005) and at middle latitudes
(November 2008). The Phoenix lander directly sampled water ice in shallow Martian soil on July 31, 2008.
Mars lost its magnetosphere 4 billion years ago, possibly because of numerous asteroid strikes, so the solar wind interacts directly with the Martian
ionosphere, lowering the atmospheric density by stripping away atoms from the outer layer. Both Mars Global Surveyor and Mars Express have detected
ionised atmospheric particles trailing off into space behind Mars, and this atmospheric loss is being studied by the MAVEN orbiter.
Compared to Earth, the atmosphere of Mars is quite rarefied. Atmospheric pressure on the surface today ranges from a low of 30 Pa (0.030 kPa)
on Olympus Mons to over 1,155 Pa (1.155 kPa) in Hellas Planitia, with a mean pressure at the surface level of 600 Pa (0.60 kPa).
The highest
atmospheric density on Mars is equal to that found 35 km (22 mi) above Earth's surface. The resulting mean surface pressure is only 0.6% of
that of Earth (101.3 kPa). The scale height of the atmosphere is about 10.8 km (6.7 mi),[142] which is higher than Earth's (6 km (3.7 mi))
because the surface gravity of Mars is only about 38% of Earth's, an effect offset by both the lower temperature and 50% higher average molecular
weight of the atmosphere of Mars.
n 1994 the European Space Agency's Mars Express found an ultraviolet glow coming from "magnetic umbrellas" in the southern hemisphere.
Mars does not have a global magnetic field which guides charged particles entering the atmosphere. Mars has multiple umbrella-shaped magnetic
fields mainly in the southern hemisphere, which are remnants of a global field that decayed billions of years ago.
Mars's average distance from the Sun is roughly 230 million kilometres (143,000,000 mi), and its orbital period is 687 (Earth) days. The solar day
(or sol) on Mars is only slightly longer than an Earth day: 24 hours, 39 minutes, and 35.244 seconds.[172] A Martian year is equal to 1.8809 Earth years,
or 1 year, 320 days, and 18.2 hours.
The axial tilt of Mars is 25.19 degrees relative to its orbital plane, which is similar to the axial tilt of Earth. As a result, Mars has seasons like Earth,
though on Mars, they are nearly twice as long because its orbital period is that much longer. Currently, the orientation of the north pole of Mars is close
to the star Deneb. Mars passed an aphelion in March 2010 and its perihelion in March 2011. The next aphelion came in February 2012 and the
next perihelion came in January 2013.


second leg
contact us
got a question ? feedback? awesome!
send your message in the form below and we will get back to you as early as possible.
name:
email:
message:
image upload:
post it →
sent your message successfully!
error
sorry there was an error sending your form.
home
>about us
size table
f.a.q.


Control Priority
Start/Stop
Angle
Frame Control
Wifi AP Mode Setting
Set Date*
Set Time*
Version : 2.0.1
Release : 17/02/02
* Only new firmware functions.
Copyright© Crescent All Rights Reserved.


I’m A Celebrity….Get Me Out Of Here crowns 2019 winner
The final was a battle of the soap stars.
Jacqueline Jossa has won I’m A Celebrity…Get Me Out Of Here after defeating Andy Whyment.
The final became a battle of the soap stars after the former EastEnders actress trumped the Coronation Street actor and radio DJ Roman Kemp came third.
After she was named queen of the jungle, she said: “I have no words.”
Before she won, she told hosts Ant & Dec: “It was not what I expected.
“It was a lot harder. I didn’t think it would be such a turning point in life, I went in as one person, I feel like I have come out as a different person.
“I’ve grown in confidence and found who I am as a person.”
She added: “I think it’s so easy to care so much what other people think of you, trolls, people who say nasty things for the sake of it and I try to change their opinion.
 Here I have different people bigging me up of different ages, I can’t really work out what is happening.
“I’ve always been known as Lauren from EastEnders, or a doormat, or whatever you want to call it, and coming here I have actually proved myself.”
While she was in the jungle, she hit the headlines after campmate and Rak-Su star Myles Stephenson reportedly told her that her husband Dan Osborne cheated on her with Stephenson’s ex-girlfriend Gabby Allen.
Former The Only Way Is Essex star Osborne and Allen were previously in the Celebrity Big Brother house together.
It was reported that Jossa threatened to quit the show and was allowed by bosses to leave Osborne a voice message about Stephenson’s claims.
Osborne flew to Australia with their children to be there when she left the show, and after she left the jungle she was seen embracing Osborne before they posed for photographs.
Earlier in the episode, all three contestants took part in a final bushtucker trial.
Jossa faced the Stake Out, where she had to lie on a giant star on the floor with her legs and arms tied down as different insects were left to crawl over her body.
These included mealworms, crickets, scorpions and cockroaches, before she had to hold a spider in her mouth for the final minute.
After she finished, she joked to Ant and Dec: “You’re out of order.”
By successfully completing the trial, she scored starters for everyone, a drink and a surprise treat.
Whyment had to take part in the bushtucker bonanza, where he was given the choice between classic bushtucker dishes and more appetising options, but the tastier plates came at the expense of a star.
He chose witchetty grub over a prawn cocktail, a camel’s hoof over a roast chicken dinner, a whole scorpion over a sticky toffee pudding with custard, a pig’s testicle over a Bacardi and diet coke and a crocodile anus over a plate of chocolate biscuits.
After securing main courses for everyone, as well as as drink a treat, he said: “I’m so glad I’ve done it and got five stars.
“It’s been an amazing experiences and I still can’t believe I’m here, I’m a super fan so to get to the final I’m really chuffed. Come on guys give us a cuddle.”
Kemp was tasked with facing the panic pit, where he was strapped into an underground chamber and snakes crawled over his body.
As the lights went out, he said he could feel the tongues of the snakes on his skin and admitted it was “absolutely terrifying”.
His success scored him a pudding for everyone in camp, as well as a drink and a treat.


libbitcoin
The libbitcoin project is an open source effort to produce C++ libraries for the use in creating cross-platform Bitcoin applications on top of a standard library. Libbitcoin was founded in 2011 to attempt to promote the authorship of Bitcoin applications that enable decentralization, financial privacy, and trust minimization, as Bitcoin Core does.
Libbitcoin is designed for Linux, OSX and Windows, with comprehensive support for all of those platforms. The project is separated into many modular libraries to enable a flexible array of application development possibilities. Notable projects making use of Libbitcoin are Airbitz, CoinKite, and OpenBazaar.
History
Amir Taaki, also known as genjix, led the effort to create the project in 2011, achieving the first full re-implementation of a Bitcoin node in a coding effort began by Patrick Strateman, also known as phantomcircuit. Luke-Jr also contributed to early efforts to the project.
Over time, the project expanded to include more and more dedicated components, and various project spawned from the libraries produced. Developers Phillip Mienk, William Swanson, and Erik Voskuil joined the project.
Links
- Repository: https://github.com/libbitcoin
- Website: https://libbitcoin.org


Datepicker is a highly configurable component that adds datepicker functionality to your pages. You can customize the date format and language, restrict the selectable date ranges.
The easiest way to add the datepicker component to your app (will be added to the root module)


Just visit us to have enjoy with the most delicious cookie in the world 🍪
It's made with love 💕 and you can share them with your family with love 👪 💕
To learn more about what we have in our stores please scroll left & right and enjoy in our world 💕
Where you can find us? You can scroll left and right, and you can find our location 🗼


Download with NPM:
npm install luxbarCOPYCOPY
Or with Bower:
bower install luxbarCOPYCOPY
Or use CDN:
<link rel="stylesheet" href="https://cdn.rawgit.com/balzss/luxbar/ae5835e2/build/luxbar.min.css">COPYCOPY
Or download the source directly:
Then customize the look of it (color, menu alignement, etc) with the options below. The navbar will update realtime accordingly. After everything looks the way you want, grab the generated HTML code from the bottom and drop it into your project.
Please note that that the dropdown can't be configured throught the demo app (yet!) so if you want to know how to implement it check out this link.
To add a new element click on the plus icon, type in the item name and click enter. To remove one, simply click on the one you want to remove.


Get The average of MIDI note velocity
MIDI Info
Average velocity
Recent velocity
Maximum velocity
Minimum velocity
Reset
MIDI Logs
Save
Remove
Note Number
Velocity
Send
This browser is not support for web MIDI
MIDI Input
>Please select your MIDI device<


Codename Eagle servers
Only servers announcing to
m.codenameeagle.us
are listed here.
Name
Address
Players
Map
Mode
Version
Loading…


Simple Configurator for cellHTS2
Reads the cellHTS2 configuration files to simply set the type (i.e. sample, neg, pos, empty) of the wells and the description of the experiment.
Details here.
Dialog Options
- Plate configuration file
- The configuration for the well types. For further information check the cellHTS2 manual looking for the Plateconf.txt file description.
- Description file
- The details of the experiment. For further information check the cellHTS2 manual looking for the Description.txt file description.
Ports
- Output Ports
-
| 0 |
Plate configuration description for CellHTS2 node. |
| 1 |
Experiment description for CellHTS2 node. |


Brexit has cost Britain a Tesla gigafactory, according to Elon Musk
by Alex DanielBritain missed the opportunity to have Tesla’s first European factory because of Brexit, according to chief executive Elon Musk.
Instead, the electric car maker plumped for a site near Berlin for the so called gigafactory, where it will make batteries, powertrains and vehicles.
Read more: Tesla holds share gains after surprise third quarter profit
The move promises to provide a major boost for the German capital, with Berlin’s economic affairs minister Ramona Pop saying it could create up to 7,000 jobs in production alone.
“Brexit made it too risky to put a gigafactory in the UK,” Musk told industry website Auto Express.
No one from Tesla was immediately available to comment.
Brexit has hit the automotive industry particularly hard. Manufacturers have held off on making investment decisions in the UK for more than three years, because the future relationship with the bloc is unclear.
Car makers such as Nissan and Vauxhall have warned a no-deal Brexit, where companies face costly trade tariffs, would jeopardise their UK operations and put thousands of people’s jobs in danger.
Business secretary Andrea Leadsom has said the government is aware that the uncertainty over Brexit is causing investment to be put on hold.That is why the upcoming election is needed, she said.
“We need a Conservative government to get Brexit done with a deal and end the uncertainty,” she said.
But the Lib Dems said the decision shows Johnson’s “deluded plans are already costing the country vital investment and making us all poorer”.
Separately, German economy minister Peter Altmaier said today that there had been no discussion yet of subsidies for Tesla.
Read more: Tesla share price falls after it misses deliveries target
“Subsidies have not yet been discussed. It’s clear that Tesla – if it invests in Germany and creates jobs here, will be treated like all other companies in the automobile and automotive industry,” Altmaier told reporters.
“That means we will treat all players who invest in Germany equally and without discrimination,” he said.


{# This simple template derives from ``base.html``. See ``base.html`` for more information about template inheritance. #} {%- extends "base.html" %} {# Loads some of the macros included with Flask-Bootstrap. We are using the utils module here to automatically render Flask's flashed messages in a bootstrap friendly manner #} {% import "bootstrap/utils.html" as utils %} {# Inside the ``content`` is where you should place most of your own stuff. This will keep scripts at the page end and a navbar you add on later intact. #} {% block content %}
Control a Zephyr LWM2M candy dispenser using BLE/6LoWPAN or 802.15.4/OpenThread mesh.
Powered by
Control a Zephyr LWM2M light using BLE/6LoWPAN, 802.15.4 OpenThread or Amazon Alexa.


All about me
By Kishan Sambhi
Programming
One of my hobbies is programming, which I have been doing since the Easter Holidays of Year 6, with my first Project being the "Minecraft Server Starter Kit". When I am free, I enjoy programming as I find it fun. At the moment, my main project is called "bedel". I code in a variety of languages, but my main ones are:
- JavaScript
- CSS
- HTMl (not a programming language, but a markup language)
- Shell
Some of my programming projects:
bedel
Build, ship and manage apps, all from one dashboard. This is bedel.
Javascript
supercandy/block-breaker
A react native game where you break bricks and collect pineapples by tilting your device to move a little ball
JavaScript
one-dark-material-syntax
A fork of atom's 'One dark syntax theme', but using a material colour pallet.
CSS


Add tab
Grid 1
This tab is the original
Demonstrates:
jQuery tabs containing a grid in each pane
View Source:
View the source for this example on Github


AMME.RAJU
Software Engineer
-<EMAIL_ADDRESS>- https://github.com/raju79.github.io
- +91-9705307979
| ECE | NETHAJI INST OF ENG & TECH | 2014 | 61%$ |
|---|---|---|---|
| M.Tech (CSE) | college name | / | |
| B.Tech (CSE) | netaji inst of engeeniring &tech | 2014 | 61% |
| Intermediate (M.P.C) | nalanda jr college | 2010 | 71% |
Brief project overview
Brief project overview
I hereby declare that the above information furnished is true to the best of my knowledge.


LeBron James joins 'long-time' friend Tom Brady in playing until 'we can’t walk no more'
by Paulina DedajTwo champs from two different sports with the same goal: “we’re going to play until we can’t walk no more.”
The Los Angeles Lakers’ LeBron James, 34, told ESPN’s Dave McMenamin Friday that he plans to play basketball as long as he physically can.
NEW ENGLAND PATRIOTS’ TOM BRADY SETS NEW GOAL TO PLAY UNTIL ‘46 OR 47,” TRAINER SAYS
LEBRON JAMES SLAMS AAU OVER DEMANDING SCHEDULE, INCREASED MILEAGE ON YOUNG ATHLETES
“As long as I feel great, as long as I can still play at a high level and mentally I’m sharp and I’m there, I’m giving everything to the game,” he said before adding, “I have no idea.”
The three-time NBA champion said he plans to follow in the footsteps of New England Patriots quarterback Tom Brady as far as playing beyond their respective league’s average player age.
"Me and Tom Brady are one and the same. We're gonna play until we can't walk no more,” he said.
Brady, 42, took to Twitter to add “I’m playing until I can’t dunk anymore,” to which James said: “Well I’m playing until I can’t throw TD passes anymore.”
Brady commented on the Twitter love, telling WEEI that he and James have been friends “for a long time.”
CLICK HERE TO GET THE FOX NEWS APP
“Yeah, I’ve always admired him. He’s a great athlete, player. I think he loves the sport, he loves basketball, he loves the competition. I feel the same way about football."
Brady’s trainer commented earlier this week that the six-time Superbowl champion, who has previously vowed to play until 45, has recently said that he wants to go until “46 or 47.”


--- layout: page title: About header-img: "img/about-bg.png" ---
I'm a NYC-based interactive designer and developer. I'm interested in interaction-rich web apps, integrated ecommerce systems, and data-driven interfaces.


horie
# Clone the Quick Start repository
$ git clone https://github.com/electron/electron-quick-start
# Go into the repository
$ cd electron-quick-start
# Install the dependencies and run
$ npm install && npm start
const electron = require('electron')
// Module to control application life.
const app = electron.app
// Module to create native browser window.
const BrowserWindow = electron.BrowserWindow
// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
let mainWindow
function createWindow () {
// Create the browser window.
mainWindow = new BrowserWindow({width: 800, height: 600})
// and load the index.html of the app.
mainWindow.loadURL(`file://${__dirname}/index.html`)
// Open the DevTools.
mainWindow.webContents.openDevTools()
// Emitted when the window is closed.
mainWindow.on('closed', function () {
// Dereference the window object, usually you would store windows
// in an array if your app supports multi windows, this is the time
// when you should delete the corresponding element.
mainWindow = null
})
}
// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
app.on('ready', createWindow)
// Quit when all windows are closed.
app.on('window-all-closed', function () {
// On OS X it is common for applications and their menu bar
// to stay active until the user quits explicitly with Cmd + Q
if (process.platform !== 'darwin') {
app.quit()
}
})
app.on('activate', function () {
// On OS X it's common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (mainWindow === null) {
createWindow()
}
})
// In this file you can include the rest of your app's specific main process
/
Hello World!
Hello World!
We are using node ,
Chromium ,
and Electron .
{
"name": "electron-quick-start",
"version": "1.0.0",
"description": "A minimal Electron application",
"main": "main.js",
"scripts": {
"start": "electron ."
},
"repository": {
"type": "git",
"url": "git+https://github.com/electron/electron-quick-start.git"
},
"keywords": [
"Electron",
"quick",
"start",
"tutorial"
],
"author": "GitHub",
"license": "CC0-1.0",
"bugs": {
"url": "https://github.com/electron/electron-quick-start/issues"
},
"homepage": "https://github.com/electron/electron-quick-start#readme",
"devDependencies": {
"electron-prebuilt": "^1.2.0"
}
}
#起動
$ node_modules/.bin/electron ./
#ドロップ形式
$ node_modules/.bin/electron
#electron-packagerのインストール
$ npm i electron-packager -g
#バージョン確認
$ node_modules/.bin/electron -v
v1.2.6
#パッケージ化
$ electron-packager ./sample sample --platform=darwin,win32 --arch=x64 --version=1.2.6


Fitting a piecewise linear function to data
April 1, 2017
Abstract
I created a Python library, called pwlf, for fitting a continuous piecewise linear function to data. What makes this library unique is that it allows the user to specify the desired number of line segments when performing piecewise linear fits. A global (heuristic) optimization algorithm is then used to find the best piecewise linear fit that uses the user-specified number of line segments.
Introduction
So let’s say we have data that exists in two dimensional space, where each point can be represented by \( (x,y) \). It is possible to fit a continuous piecewise linear function \( f(x) \) to the data using a least squares method, as long as the \( x \) locations of the line segment ends are known. Golovchenko (2004) covered the simple least squares derivation well if you want to see how the math works out.
I took the least squares approach and coupled it to a global optimization algorithm (differential evolution) such that a user can specify the number of line segments to fit the data with. The routine finds the best location for the line segments by minimizing the sum of the square of the residuals. The result is the optimal continuous piecewise linear function for the specified number of line segments.
Feel free to download the library.
A few examples of the fits are provided bellow.
Sample data
So let’s get started by importing the libraries and using some sample data.
Basic usage
First we initialize the pwlf library with our data. Then we’ll find the best piecewise linear function using 4 line segments. Once the fit has been performed, the library inculdes a prediction function which evaluates the piecewise linear model. In this example we evaluate the piecewise linear model for 10,000 different xHat locations.
It was intended that this syntax be simple to use.
But what if I know the locations of where the line segments should end? Not a problem! This library includes the function for classic least squares fit as well. For instance you could run the following code to fit the piecewise linear function at the x0 locations.
Conclusion
A library was created for fitting a continuous piecewise linear function. What makes this library unique is it allows the user to perform the fit by specifying the number of line segments to use. Feel free to check out the code and the examples.
This can be a very difficult optimization problem. I’ve included an example if you wanted to use your own/custom optimization algorithm. For problems with large amounts of data and line segments, the optimum may take awhile to find.
If you need help using the library or have any suggestions please let me know!


Before Change
text_format.Merge(open(network_file + ".tmp").read(), net)
// remove temporary file created
if os.path.isfile(network_file + ".tmp"):
os.remove(network_file + ".tmp")
// identify common Caffe/SAS computation layers
layer_list = []
for layer in net.layer:
include_layer = False
if (len(layer.include) == 0):
After Change
if network_param is not None:
sas_hdf5 = os.path.join(os.getcwd(), "{}_weights.caffemodel.h5".format(model_name))
write_caffe_hdf5(model, layer_list, sas_hdf5)
print("NOTE: the model weights has been stored in the following file:\n"
"{}".format(sas_hdf5))
return output_code
except CaffeParseError as err_msg:


hours:
-from 6 am to 7 pm
location:
seattle,dubai,tokoyo,paris,lima
sales !
the best resturent for fish


{% extends "base.html" %} {% block title %}
Medieval catalogues > BENEDICTINES > Peterborough > Books given by Abbot John de Caux (1250-63)
{% endif %}3 identified entries found.
All data was derived from the List of Identifications by Professor Richard Sharpe.
{% if not printing %}
A key to codes used in the List is available (opens in new tab).{% endif %}


I'm an other very long highlighted link.
I'm an other very long link and I'm an artist you know.
I'm an other long link and I don't like lorem.


Fedora Installation
Preparation
If you're using Windows and wish to install Fedora alongside with it. You can open Disk Management and shrink a drive to make space for Fedora.
Create a live USB with Fedora Media Writer
Installation
Partitioning
Automatic: Anaconda will automatically create mountpoints /, /home, swap with LVM2.
Custom: This lets you decide which mountpoints to create, the size of each mountpoint, and the partition type. The rest would be handled by Anaconda.
Advanced Custom(Blivet GUI): You'll handle everything by yourself.
Connecting to the Internet
If you connect to the Internet during the installation process, updates will be downloaded and saved for later use.
User Creation
You'll have to create exactly one user. There's a checkbox to make the user Administrator.
Also, the root password should be set.
Post Installation
- Enable tap-to-click on your touchpad:
- Settings > Mouse & Touchpad > Tap to Click
- Get new updates:
sudo dnf upgrade
- Set useful shortcuts:
- Settings > Keyboard > Custom Shortcuts:
- System Monitor:
gnome-system-monitor
, Super + x - Terminal:
gnome-terminal
, Ctrl + Alt + T
- Google Chrome:
- Download
- Install:
sudo dnf install
Path to Chrome RPM File
- Git Setup:
git config --global user.name "
USERNAME"
git config --global user.email "
EMAIL"
- Github ssh setup: https://help.github.com/articles/connecting-to-github-with-ssh/
- Atom, a hackable text editor:
- Download
- Install:
sudo dnf install
Path to Atom RPM File - sync-settings: Install > Search: sync-settings
- atom-beautify: Replace uncrustify.cfg
- autocomplete-clang:
sudo dnf install clang
- More about Atom
- JAVA:
- Download
- Install Java:
sudo dnf install
Path to Java RPM File sudo update-alternatives --config java
sudo update-alternatives --config javac
- Replace .bashrc
- Setup fstab: noatime,nodiratime and compress=lzo(btrfs only)
- Install gnome-tweak-tool:
sudo dnf install gnome-tweak-tool
- Right click to open terminal from nautilus:
sudo dnf install gnome-terminal-nautilus
- Lollypop Music Player:
sudo dnf install lollypop
- VLC Media Player Setup vlc:
sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
sudo dnf install vlc
- Powertop, a Linux tool to diagnose issues with power consumption and power management.
sudo dnf install powertop
- TLP, advanced power management for linux:
sudo dnf install tlp
- Setup Graphics Drivers for Nvidia:
- Install negativo17 drivers.
- Sign the modules (usually nvidia, nvidia_drm, nvidia_modeset) for Secure Boot.
- For battery life optimization, run BlacklistNvidia.sh with root privileges to disable Nvidia modules on all boot entries and create a new Nvidia-enabled entry at the bottom of the list. Re-run the script on every kernel updates.
- More about Nvidia Optimus driver setup
- Dolphin, the best WII/GC emulator:
sudo dnf install dolphin
- Wirershark:
sudo dnf install wireshark
- Fedora Media Writer:
sudo dnf install mediawriter
- Sync shell extensions with Google Chrome:
sudo dnf copr enable region51/chrome-gnome-shell
sudo dnf install chrome-gnome-shell
- paper-icon-theme
- Designed according to Material Design guidelines.
- You can change icon themes with Gnome Tweak Tool.
mkdir ~/.icons
cd ~/.icons
git clone git@github.com:snwh/paper-icon-theme.git
cd paper-icon-theme
sudo dnf install gnome-common
./autogen.sh
make
sudo make install
- Here's a script for steps 11 to 22:
- Run it with Secure Boot turned off and with root privileges: 11-22.sh
**Don't install vlc from negativo17's multimedia repo. It crashes in Wayland.


public interface ConstraintMappingContributor
ConstraintMapping
s to validator factory.
A constraint mapping contributor can be configured in META-INF/validation.xml
, using the property
HibernateValidatorConfiguration.CONSTRAINT_MAPPING_CONTRIBUTORS
, thus allowing to set
up constraints to be validated by default validators dynamically via the API for programmatic constraint declaration.
Implementations must have a no-args constructor.
One or more mappings can be added as shown in the following:
public static class MyConstraintMappingContributor implements ConstraintMappingContributor {
public void createConstraintMappings(ConstraintMappingBuilder builder) {
builder.addConstraintMapping()
.type( Marathon.class )
.property( "name", METHOD )
.constraint( new NotNullDef() )
.property( "numberOfHelpers", FIELD )
.constraint( new MinDef().value( 1 ) );
builder.addConstraintMapping()
.type( Runner.class )
.property( "paidEntryFee", FIELD )
.constraint( new AssertTrueDef() );
}
}
HibernateValidatorConfiguration.CONSTRAINT_MAPPING_CONTRIBUTORS
| Modifier and Type | Interface and Description |
|---|---|
static interface |
ConstraintMappingContributor.ConstraintMappingBuilder
A builder for adding constraint mappings.
|
| Modifier and Type | Method and Description |
|---|---|
void |
createConstraintMappings(ConstraintMappingContributor.ConstraintMappingBuilder builder)
Callback invoked during validator factory creation.
|
void createConstraintMappings(ConstraintMappingContributor.ConstraintMappingBuilder builder)
builder
- A builder for adding one or more constraint mappingsCopyright © 2007-2020 Red Hat, Inc. All Rights Reserved


There are many amazing National Parks in the United States. This website is a place where you can plan a safe and fun trip to one of America's National Parks.
Click on the Explore tab in the menu above and pick a park you want to explore. From there you can explore trails and campgrounds in that park
If you're not ready to plan a trip you can add trails to your wishlist. If you are ready to plan a trip make sure you click on 'Plan a Trip' in the menu above. From there you can choose the dates and parks you want to visit.
Once you have a trip, or many trips, planned you can invite friends as long as they are a user on the website.


Southwest pulls Boeing Max jets until March, in longest US delay yet
CHICAGO/WASHINGTON: Southwest Airlines said on Friday it is extending the cancellation of flights using 737 MAX jets from its schedule by another month as Boeing Co faces increasing hurdles in winning approval to return the plane to service before the end of this year following two fatal crashes.
Last month, Southwest had extended the grounding of all 34 737 MAX jets in its fleet to Feb. 8. Southwest, the largest operator of the 737 MAX 8 jets, said it was now canceling flights through March 6 because of "continued uncertainty around the timing of MAX return to service" and added it is "unable to provide an update on first quarter capacity guidance at this time."
United Airlines and American Airlines have canceled their 737 MAX flights into January.
Reuters reported this week that U.S. and European regulators will need to return to Iowa to complete an audit of Boeing's software documentation after regulators found gaps and substandard documents. Boeing has confirmed it must submit revised documentation.
That has thrown into question when Boeing can complete a certification test flight. The Federal Aviation Administration has said it would not unground the planes until 30 days after that flight occurs. Two U.S. officials told Reuters it is extremely unlikely - if not impossible - that Boeing will be able to win approval to return flights to service before the end of December.
The 737 MAX, Boeing's best-selling plane, has been grounded since March after crashes in Indonesia and Ethiopia killed 346 people.
(Reporting by Tracy Rucinski; Editing by Chris Reese and Leslie Adler)


{{ define "main" }}
h1
tag with classes .kss-title
, .text-gray
h4
tag with .kss-price
class
small
tag with classes .kss-original-price
, .text-muted
. Should be child of .kss-price
span
tag with classes .kss-discount
, .text-danger
. Should be child of .kss-price
Add class .kss-price--smaller
to .kss-price
Default label
tag
h3
tag with .font-weight-bold
class
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Default P
tag
h4
tag with .font-weight-bold
class
a
tag with classes .kss-link
, .font-weight-bold
All radio inputs and labels should be in a wrapper div
with classes .radio-wrap
, .d-flex
, .wo-image
input
add class .d-none
label
add class .radio-label
A wrapper div
with class .kss-custom-select
around select
select
should have default bootstrap classes for form elements i.e. .form-control
A wrapper div
with class .custom-checkbox
around input
Checkbox
should have default bootstrap classes for form elements i.e. .custom-control
input
should have default bootstrap classes for form elements i.e. .form-control


Redux (@ngrx/store) best practices
@ngrx/store is a library that tries to solve the problems of state management through the principles of Redux. The difference between Redux and @ngrx/store is that @ngrx/store is written specifically for Angular and it embraces the use of Observables from RxJS. The combination of redux principles and RxJS can be very powerful when it comes to writing reactive applications. Since a lot of Angular projects use @ngrx/store, it might be a good idea to write down some best-practices.
Note: The best-practices and opinions described in this article are strictly personal. Best practices are almost always a matter of opinion. Nevertheless, we (StrongBrew) are using these best practices at all our customers on a daily basis and they certainly work for us. From now on @ngrx/store will be reffered to as Redux in this article.
To Redux or not to Redux?
The first question that we might want to ask ourselves is do we really need Redux in our application. It is a best practice to only use it when your application demands it. This article tackles this question separately.
Basic best practices
While the following list might be common sense for an experienced Redux developer, let’s sum those up as a refreshment for the sake of completeness.
- Our application can only count one store, otherwise it would become too complex
- Reducers have to be pure, this is a principle from functional programming which makes functions predictable and avoids side effects
- Immutable datastructures are very important to optimise change detection cycles and avoid unexpected behavior, therefore reducers should handle data in an immutable manner
- Reducers always have to return a value! So don’t forget to implement the default case of the switch statement to return the original state
Don’t add models to the store
A model can be seen as a javascript object which has functionality, like the following example:
class User{
constructor(private firstName: string, private lastName:string){
}
get fullName(): string {
return `${this.firstName} ${this.lastName}`;
}
}
While the Redux package written by Dan Abramov forbids sending these prototyped objects as a payload, @ngrx/store does not forbid it yet. However, it is a bad practice because it adds a lot of complexity to the store and chances are big that the models will get broken because of the immutable way of handling data. Check this example for instance:
const user = new User('Brecht', 'Billiet');
console.log(user.fullName); // Brecht Billiet
const updatedUser = {...user, lastName: 'Doe'};
console.log(updatedUser.fullName); // undefined
Since we have updated the user in an immutable way, it has created a new reference and therefore all its functionality has been lost. This is exactly what our reducers will do with the data that flows into them. So always send plain objects when it comes to sending payloads in the actions.
Another approach for models is using Interfaces. Interfaces are great because are only interpreted in compile time, doesn’t use memory in runtime and are very expressive. If your model doesn’t need to be computed (like get fullName()
in the previous example), then is advisable to use Interfaces instead.
Using Interfaces allows us to get advantage of some TypeScript features like Pick<T>
. With Pick<T>
we can create Types from Interfaces, which is very handy in some situations, like creating a model and a record with fewer properties:
export interface User {
id: number;
name: string;
middleName: string;
lastName: string;
fullName: string;
address: string;
city: string;
state: string;
zip: string;
}
export type UserRecord = Pick<User, 'id' | 'fullName'>;
If the endpoint to get a list of users is returning a partial object instead of the full object then we can create a new Type instead of two Classes or Interfaces. This is a cleaner approach and easier to maintain if your models are prepared for your UI.
What do we put in the store?
We shouldn’t put things in the store just because we can. We have to think about what state needs to be in there and why. State that is being shared between components can sometimes be kept in the parent component for instance. We call that inner state: The component keeps its own state, the component itself is responsible for that. If that component state does not affect anything from the application state, it does not need to be on the application state or touch redux.
However, when state needs to be shared between different root components (rendered inside a router-outlet) we might want to keep that state in the store.
When we need to remember a value when navigating through the application we could put that in the store as well. An example here could be: Remembering if a sidebar was collapsed or not, so when we navigate back to the page with the sidebar, it would still be collapsed.
Complex state is something that we might want to put in the store as well, since Redux can handle complex state management in an elegant way. The general rule of thumb here could be, Only keep shared state, values that we want to remember and complex state in the store. Don’t add state in the store if we don’t need to, it would result in unneeded boilerplate and complexity.
That being said, there are 2 more reasons where we might want to add extra state into the store:
- When we want to make our application real-time. Check out How we made our app real time in 6 lines of code.
- When we want to do optimistic updates. Check out Cancellable optimistic updates in Angular2 and Redux
Don’t forget about router params
A common mistake is putting things inside the store that could easily be added in the url. The benefit of keeping state in the url is:
- We can use the browser navigation buttons
- We can bookmark the url
- We can share that url with other people
If we can put simple things into the url, we should at least consider it.
Avoid HUGE lists
Redux can not be seen as a local in-memory database, so we can’t put all our data into the store for performance reasons. Redux can be seen as an abstraction of state and data that our application needs at a certain time.
For instance if we have a list of 10000 users, we don’t want to put them all in the store. What we could do is keep track of a list of 500 users in the store, which the user can see at that specific time, and load more users on the background and update that buffered list.
Designing the state
Designing the state of our application is an important step, and we recommend to draw that state on a whiteboard first. The most important rule here is: Keep the state as flat as possible
One of the most common bad practices is deep-nesting the state into something that becomes rather complex:
// this is an example of how not to design state
export interface ApplicationState {
moduleA: {
data: {
foo: {
bar: {
users: User[],
cars: Car[]
}
}
}
}
}
// keeping it flat makes the application way easier
export interface ApplicationState {
users: User[],
cars: Car[]
}
I’m not saying you cannot nest state, I am saying we have to be very careful when we do. The general rule of thumb here is: keep the state as flat as possible If we want to compose state in @ngrx/store we can work with feature module reducers and lazy load them as we can see in Feature Module State Composition.
Make everything readonly
We already covered the reason why we need to work immutable, but how can we enforce this? Typescript comes with a readonly keyword which we can use to make a property readonly
type User = {
readonly firstName: string;
readonly lastName: string;
}
const user: User = {firstName: 'Brecht', lastName: 'Billiet'};
user.lastName = 'Doe';//cannot assign to 'lastName'
// because it is a constant of read-only property
This would certainly make sure we aren’t updating properties in our reducers by accident.  The cool thing is that typescript offers us something called “advanced types” where we can do something like this:
// By using the Readonly<> advanced types all the properties inside the type
// are readonly by default
type User = Readonly<{
firstName: string;
lastName: string;
}>;
Action design
Actiontypes
An action type should be a string that explains what the action should change in the store. Keep these strings consistent. Don’t make the actiontypes too long, keep them short and clear.
// This is bad
const DATA_USERS_SET_USER_ADDRESS = 'DATA_USERS_SET_USER_ADDRESS';
// This is better
const SET_USER_ADDRESS = 'SET_USER_ADDRESS';
Another cool idea might be to suffix the action with square brackets and put the whole thing into an action object:
// Easy to read/debug
const UserActions = {
SET_ADDRESS: '[USER] ADDRESS'
}
If the state managment would become very large we could prefix the action, but let’s keep it simple and small as long as we can.
Action creator classes
When we use plain action types and payloads it becomes quite painful to remember all the action type names and all the payloads that belong to them. This example for instance:
const user_id = '1234', address = {whatevz};
this.store.dispatch(
{
type: 'SET_USER_ADDRESS',
payload: {user_id, address}
});
That’s pretty nasty if we want remember all that stuff, so let’s create action creator classes for these. What if we could do this?
const user_id = '1234', address = {whatevz};
this.store.dispatch(new SetUserAddressAction(user_id, address));
That’s just became way easier to use and we don’t have to remember the payload of the action.
If we wanted to implement the actioncreator class for this action it would look like this:
class SetUserAddressAction implements Action {
type = SET_USER_ADDRESS;
payload: {user_id: string, address: Address};
constructor(user_id: string, address: Address){
this.payload = {user_id, address};
}
}
Payload design
When the action would only have one property for the payload we might be encouraged to use the payload directly instead of creating a property in it. However that would lead to inconsistency, so it might be better to always use subproperties
// This is bad (inconsistent with the rest of the actions)
class UpdateUserAction implements Action {
type = UPDATE_USER;
payload: User;
constructor(user: User){
this.payload = user;
}
}
// This is better
class UpdateUserAction implements Action{
type = UPDATE_USER;
payload: {user: User};
constructor(user: User){
this.payload = {user};
}
}
Type Safety
Type Safety is a huge win when using Redux with typescript, it requires a bit of boilerplate but it makes developing reducers feel like a walk in the park. It makes sure that our applications won’t compile if they have type errors and it gives us great autocompletion inside our reducers. Therefore I would definitely consider it a must. Since Kwinten Pisman already wrote an awesome article about this we won’t go in to much detail here.
Reducer design
Destructuring the payload
If we want to make the reducer code more readable and shorter we could use javascript destructuring for that. This might be personal preference, but it sure as hell makes our reducers easier to read. Take this example for instance:
function usersReducer
(state: User[], action: UserActions): User []{
switch(action.type) {
case 'SET_USER_ADDRESS':
return state.map(v =>
v.id === action.payload.user_id ?
{...user, address: action.payload.address} :
v
)
}
}
The action.payload.
code comes back a few times, resulting in longer codelines.
The following piece of code might be more readable:
function usersReducer
(state: User[], action: UserActions): User []{
switch(action.type) {
case 'SET_USER_ADDRESS': {
const {user_id, address} = action.payload;
return state.map(v =>
v.id === user_id ?
{...user, address} :
v
)
}
}
}
As we can see have have used destructuring to extract the properties of the payload into variables. Cleaner right? Let’s imagine that our actions has 5 or even more properties on their payloads. In that case this would definitely help. Something to note here is that the case implementation is wrapped inside a block statement. This is important because our reducer can have the same payload properties for different actions.
This means that user_id
and address
won’t be available in the other case statements, which is exactly what we want.
Don’t write business logic inside our reducers
Reducers should not contain business logic, they are used to handle the state in an immutable fashion. We won’t write business logic inside reducers because:
- It would become very complex
- Business logic has nothing to do with state management
- We have services for that
Child reducers
When reducers need to update a piece of state a few levels down in the tree it can become complex in no-time. Take this example for instance:
type User = {
id: string;
contracts: Contract[];
}
type Contract = {
id: string;
assignees: Assignee[];
}
type ApplicationState = {
users: User[];
}
...
If we would put all the logic to add an assignee to a specific contract of a specific user, the code would be hard to read. Checkout the following piece of code:
// This is bad
function usersReducer
(state: User[], action: UserActions): User []{
switch(action.type) {
case 'ADD_USER_CONTRACT_ASSIGNEE': {
const {user_id, contract_id, assignee} = action.payload;
return state.map(v =>
v.id === user_id ?
{
...user,
contracts: user.contracts.map(contract =>
contract.id === contract_id ?
{
...contract,
assignees: [...contract.assignees, assignee]
} :
contract
)
} :
v
)
}
default:
return state;
}
}
When reducers become complex it might be a good idea to split the reducer up into child reducers. Check the refactored version of the previous example:
// This is better
function usersReducer
(state: User[], action: UserActions): User []{
switch(action.type) {
case 'ADD_USER_CONTRACT_ASSIGNEE': {
const {user_id, contract_id, assignee} = action.payload;
return state.map(v =>
v.id === user_id ?
{
...user,
contracts: contractsReducer(contracts, action.payload)
} :
v
)
}
default:
return state;
}
}
function contractsReducer
(state: Contract[], action: UserActions): Contract []{
switch(action.type) {
case 'ADD_USER_CONTRACT_ASSIGNEE': {
const { contract_id, assignee} = action.payload;
return state.map(v =>
v.id === contract_id ?
{
...contract,
assignees: [...assignees, assignee]
} :
v
)
}
default:
return state;
}
}
As we can see, we have extracted the handling of contracts into its own reducer, which follows the exact same principles of a regular reducer.
The example just became a lot easier to read and way more maintainable. When traversing complex data structures, reducer nesting can be a really elegant way of managing state.
Testing
Since reducers are pure functions, unit testing them is very easy. We won’t need to mock out any dependencies and we only have to test the value that the reducer returns.
We can also use deepfreeze to freeze the state that when the reducer accidently mutates data, the tests will throw an error. Deepfreeze is nothing more than a recursive Object.freeze
describe('reducer: usersReducer', () => {
describe('case UPDATE_USER', () => {
it('should return a new instance with the correct state',
() => {
const initialState = [new User('1'), new User('2')];
// deepfreeze makes sure the reducer
// doesn't mutate anything by accident
deepfreeze(initialState);
const user = new User('2');
const action = new UpdateUserAction(user);
const newState = usersReducer(initialState, action);
// check if the result of the array is a new ref
expect(newState).not.toBe(initialState);
// check if the result of the user is a new ref
expect(newState[1]).not.toBe(initialState[1]);
// check if the user got updated automatically
expect(newState[1]).toEqual(user);
});
});
});
Note: Don’t forget to test the default action
Decoupling redux from the presentation layer
Having the store injected everywhere in our application is not a good idea. We want to create an Angular, Vue or React application. Not a Redux application.
Therefore we could consider the following as best practices:
- Components don’t need to know we are using Redux, don’t inject the store in them.
- Services generally don’t need to know we are using Redux, don’t inject the store in them.
- We want to be able to refactor Redux away from our application without to much effort
Therefore we want to have some kind of abstraction layer between the presentation layer and the state management layer.
How to abstract away the statemanagement layer can be read in the following two articles: A scalable angular architecture and A scalable angular architecture part 2. This is an architecture that we are using at our customers that really works for us.
Redux as a messaging bus VS redux as a state management layer
This might be a personal preference, but I like to use Redux as a pure state management layer. Yes, there are tools like @ngrx/effects where we can send actions to our application and those actions won’t just perform state management but will do XHR calls among other things.
The nice thing about this approach is that we use some kind of messaging bus. However, I mostly like to keep it simple and abstract Redux away as much as possible. Therefore I don’t use @ngrx/effects and only use Redux to update pieces of state and consume theses pieces. Some part of me believes that Redux shouldn’t be used to perform backend calls nor decide when to optimistically update. I usually tackle optimistic updates this way.
That being said, I wouldn’t call my approach a best practice, but it is a best practice to really think about which way we want it.
Conclusion
We learned a lot! Once again, the best practices explained in this article are based on personal experiences and projects we have worked on. These are practices that work for us. They are not meant to be seen as the only way of doing things.
Special thanks
A very warm and much appreciated special thanks to the following people:
Nicholas Jamieson, Raúl Jiménez and Fabian Gosebrink: Thank you all so much for reviewing and pointing out some awesome ideas
Your input makes blogging worth while!


Tweet Predicter
Tweet Predicter classifies tweets as being written by Hilary Clinton or Donald Trump.
Data: Source
We found our training data on kaggle website, where it is publicly available. We used the 3000 most recent tweets from Donald Trump and Hillary Clinton as of 10/25/17. Our training set consists of 6,000 total tweets, but because of tweet cleaning, the final training set consisted of only 5,722 tweets.
Data: Cleaning
In order to clean our tweets, we first removed all junk words such as “the” or “as.” Then, we removed all links and “@’s”. In addition, we removed all tweets that were retweets because, otherwise, that input would be reflecting a user other than Hillary or Donald.
Training: Bag of Words
In bag of words, when using every possible word, the bag of words was too large with a size of at least 4677 words. Because of this, we have to pick a specific portion of the words to use for our bag of words. However, if we use the most common 200 words for example, Clinton and Trump have such similar vocabulary that the delta for each iteration ended up being very minimal and the probability that the neural network would classify correctly was approximately 50/50. When we varied the constants of epochs, neurons, and alpha, the lowest delta after iterations was approximately 0.3. If we had more time and a faster computer, we might be able to test a variety of ranges of words for the bag of words (for example the least common words, or a set of words that are neither common or super uncommon) to see whether we see more of a skew towards Clinton or Trump.
Training: Word Embedding
This approach ultimately did not yield the results we were hoping to find, however it did provide a helpful way of visualizing and understanding similarities between data points. We created a couple of graphs of tweet vocabulary clustered by similarity, and this displays the work that goes on in the hidden layer of the bag of words method. By creating a graph of relative similarity, we could make better sense of why the bag of words method would output the results that it outputs. In the hidden layer, the bag of words methods establishes similarities between words in the vocabulary, represented by the synaptic weights, and so graphing out our word embeddings was helpful to show what the network determined to be similar.
Training: Recurrent Neural Network
Similarly to the word embeddings approach, we could not get this method to the point of identifying tweets. RNN’s, specifically Long-short-term-memory RNN’s, stores old information to make future decisions. We thought that this approach would be useful because using the similarities demonstrated by word embeddings, training would be able to predict future words in given tweets, and by patterns in what words come after another, the author of the tweet should also be easy to determine. This approach is a complicated one, which requires a lot of work, and also would probably provide us with more information on the subject than we originally intended to gleam, but it may produce more accurate results than other methods.
Testing
With a smaller data set of about 200 tweets, we tested a range of constants for hidden neurons and alpha. We discovered that optimal neurons was around 150 and that optimal alpha was about 0.7. However, when we tested with the full data set of 5722 tweets, the training took too long to determine optimal constants. If we assume that the relationship between optimal constant and tweet is proportional, then we can estimate that the optimal neurons is around 4000. However, the relationship is likely a lot more complicated than a simple ratio, so 4000 is probably not the optimal amount of neurons.
Special Thanks
We want to extend gratitude to Sophia Chou for helping us as our mentor.


This sample works only on an x86 Windows operating system. However, the
techniques illustrated in this sample apply to Windows operating systems for
other architectures as well.
This sample demonstrates the usage of the application to driver dependency feature of DIFx API. It provides an example of how the INSTALLERINFO structure is to be used in calls to DriverPackageInstall and DriverPackageUninstall functions. By passing the INSTALLERINFO structure as a parameter to the DriverPackageInstall function, an application expresses a dependency on the driver package. By passing the INSTALLERINFO structure as a parameter to the DriverPackageUninstall function, an application removes its dependency on the driver package.
Navigate to the src\setup\DIFxAPI\AppDrv directory and run the following command:
build -cZ
The usage of AppDrv.exe is as follows:
AppDrv.exe <option> <full path to the inf file> <Application ID> <Product
display name> <Product name> <Manufacturer name>
<option>
/i - Install the driver
/u - Uninstall the driver
<Application ID> is a unique identifier that denotes the application that is installing the driver
<Product Display name> is a user-friendly display name for the application that is installing the driver
<Product name> is the name of the application that is installing the driver
<Manufacturer name> is the name of the company that is shipping that is installing the driver
In order to understand the application to driver dependency feature of DIFx API, try the following:
1) Run the command
AppDrv.exe /i
<Path to INF> should be the full path to the INF file for some driver package.
For example, you can use one of the sample driver packages that are provided in the directory src\setup\DIFxSampleDriverPackages in the DDK. At this point DIFx API will install the driver and it will register that an application with application ID "abc123" is dependent on the driver.
2) Run the command:
AppDrv.exe /i
<Path to the same INF> should be the path to the same INF that was used in step 1.
At this point DIFx API will register that two applications, with application IDs "abc123" and "xyz456" are dependent on the driver.
3) Run the command:
AppDrv.exe /u <Path to the same INF>
<Path to the same INF> should be the path to the same INF that was used in step 1.
At this point, DIFx API will remove the dependency of the application with application ID "abc123" from the driver. However, it will not uninstall the driver, because the application with application ID "xyz456" is still dependent on it.
4) Run the command:
AppDrv.exe /u
<Path to the same INF> should be the path to the same INF that was used in step 1.
At this point, DIFx API will remove the dependency of the application with application ID "xyz456" from the driver. Since no other applications are dependent on the driver, DIFx API will also uninstall the driver.
© Microsoft Corporation 2002


Services near to [postcode] for stomach ache
This Is A Pharmacy
Distance from [postcode]: 0.3 miles
Open tomorrow 8am to 6pm
This Is Another Pharmacy
Distance from [postcode]: 0.8 miles
Open tomorrow 7am to 5pm
Another Pharmacy
Distance from [postcode]: 1.5 miles
Open tomorrow 9am to 5pm