fact
Documentation¶
python-blueprint¶
Example Python project that demonstrates how to create a tested Python package using the latest
Python testing and linting tooling. The project contains a fact
package that provides a
simple implementation of the factorial algorithm
(fact.lib
) and a command line interface (fact.cli
).
Requirements¶
Python 3.6+.
Note
Because Python 2.7 supports ended January 1, 2020, new projects should consider supporting Python 3 only, which is simpler than trying to support both. As a result, support for Python 2.7 in this example project has been dropped.
Windows Support¶
Summary: On Windows, use py
instead of python3
for many of the examples in this
documentation.
This package fully supports Windows, along with Linux and macOS, but Python is typically
installed differently on Windows.
Windows users typically access Python through the
py launcher rather than a python3
link in their PATH
. Within a virtual environment, all platforms operate the same and use a
python
link to access the Python version used in that virtual environment.
Dependencies¶
Dependencies are defined in:
requirements.in
requirements.txt
dev-requirements.in
dev-requirements.txt
Virtual Environments¶
It is best practice during development to create an isolated
Python virtual environment using the
venv
standard library module. This will keep dependant Python packages from interfering
with other Python projects on your system.
On *Nix:
# On Python 3.9+, add --upgrade-deps
$ python3 -m venv venv
$ source venv/bin/activate
On Windows cmd
:
> py -m venv venv
> venv\Scripts\activate.bat
Once activated, it is good practice to update core packaging tools (pip
, setuptools
, and
wheel
) to the latest versions.
(venv) $ python -m pip install --upgrade pip setuptools wheel
(Applications Only) Locking Dependencies¶
This project uses pip-tools to lock project dependencies and create reproducible virtual environments.
Note: Library projects should not lock their requirements.txt
. Since python-blueprint
also has a CLI application, this end-user application example is used to demonstrate how to
lock application dependencies.
To update dependencies:
(venv) $ python -m pip install pip-tools
(venv) $ python -m piptools compile --upgrade requirements.in
(venv) $ python -m piptools compile --upgrade dev-requirements.in
After upgrading dependencies, run the unit tests as described in the Unit Testing section to ensure that none of the updated packages caused incompatibilities in the current project.
Syncing Virtual Environments¶
To cleanly install your dependencies into your virtual environment:
(venv) $ python -m piptools sync requirements.txt dev-requirements.txt
Packaging¶
This project is designed as a Python package, meaning that it can be bundled up and redistributed as a single compressed file.
Packaging is configured by:
pyproject.toml
setup.py
MANIFEST.in
To package the project as both a source distribution and a wheel:
(venv) $ python setup.py sdist bdist_wheel
This will generate dist/fact-1.0.0.tar.gz
and dist/fact-1.0.0-py3-none-any.whl
.
Read more about the advantages of wheels to understand why generating wheel distributions are important.
Upload Distributions to PyPI¶
Source and wheel redistributable packages can be
uploaded to PyPI or installed
directly from the filesystem using pip
.
To upload to PyPI:
(venv) $ python -m pip install twine
(venv) $ twine upload dist/*
Testing¶
Automated testing is performed using tox.
tox will automatically create virtual environments based on tox.ini
for unit testing,
PEP8 style guide checking, and documentation generation.
# Run all environments.
# To only run a single environment, specify it like: -e lint
# Note: tox is installed into the virtual environment automatically by ``piptools sync``
# command above.
(venv) $ tox
Unit Testing¶
Unit testing is performed with pytest. pytest has become the defacto Python unit testing framework. Some key advantages over the built in unittest module are:
Significantly less boilerplate needed for tests.
PEP8 compliant names (e.g.
pytest.raises()
instead ofself.assertRaises()
).Vibrant ecosystem of plugins.
pytest will automatically discover and run tests by recursively searching for folders and .py
files prefixed with test
for any functions prefixed by test
.
The tests
folder is created as a Python package (i.e. there is an __init__.py
file
within it) because this helps pytest
uniquely namespace the test files. Without this,
two test files cannot be named the same, even if they are in different sub-directories.
Code coverage is provided by the pytest-cov plugin.
When running a unit test tox environment (e.g. tox -e py37
), an HTML report is
generated in the htmlcov
folder showing each source file and which lines were executed during
unit testing. Open htmlcov/index.html
in a web browser to view the report. Code coverage
reports help identify areas of the project that are currently not tested.
Code coverage is configured in pyproject.toml
.
To pass arguments to pytest
through tox
:
(venv) $ tox -e py37 -- -k invalid_factorial
Code Style Checking¶
PEP8 is the universally accepted style
guide for Python code. PEP8 code compliance is verified using flake8.
flake8 is configured in the [flake8]
section of tox.ini
. Extra flake8 plugins
are also included:
pep8-naming
: Ensure functions, classes, and variables are named with correct casing.
Automated Code Formatting¶
Code is automatically formatted using black. Imports are automatically sorted and grouped using isort.
These tools are configured by:
pyproject.toml
To automatically format code, run:
(venv) $ tox -e fmt
To verify code has been formatted, such as in a CI job:
(venv) $ tox -e fmt-check
Generated Documentation¶
Documentation that includes the README.rst
and the Python project modules is automatically
generated using a Sphinx tox environment. Sphinx is a documentation
generation tool that is the defacto tool for Python documentation. Sphinx uses the
RST markup language.
This project uses the napoleon plugin for Sphinx, which renders Google-style docstrings. Google-style docstrings provide a good mix of easy-to-read docstrings in code as well as nicely-rendered output.
"""Computes the factorial through a recursive algorithm.
Args:
n: A positive input value.
Raises:
InvalidFactorialError: If n is less than 0.
Returns:
Computed factorial.
"""
The Sphinx project is configured in docs/conf.py
.
This project uses the furo Sphinx theme for its elegant, simple to use, dark theme.
Build the docs using the docs
tox environment (e.g. tox
or tox -e docs
). Once built,
open docs/_build/index.html
in a web browser.
Generate a New Sphinx Project¶
To generate the Sphinx project shown in this project:
# Note: Sphinx is installed into the virtual environment automatically by ``piptools sync``
# command above.
(venv) $ mkdir docs
(venv) $ cd docs
(venv) $ sphinx-quickstart --no-makefile --no-batchfile --extensions sphinx.ext.napoleon
# When prompted, select all defaults.
Modify conf.py
appropriately:
# Add the project's Python package to the path so that autodoc can find it.
import os
import sys
sys.path.insert(0, os.path.abspath('../src'))
...
html_theme_options = {
# Override the default alabaster line wrap, which wraps tightly at 940px.
'page_width': 'auto',
}
Modify index.rst
appropriately:
.. include:: ../README.rst
apidoc/modules.rst
Continuous Integration¶
Continuous integration is provided by GitHub Actions. This runs all tests and lints for every commit and pull request to the repository.
GitHub Actions is configured in .github/workflows/python.yml
and tox.ini
using the
tox-gh-actions plugin.
Project Structure¶
Traditionally, Python projects place the source for their packages in the root of the project structure, like:
fact
├── fact
│ ├── __init__.py
│ ├── cli.py
│ └── lib.py
├── tests
│ ├── __init__.py
│ └── test_fact.py
├── tox.ini
└── setup.py
However, this structure is known to have bad
interactions with pytest
and tox
, two standard tools maintaining Python projects. The
fundamental issue is that tox creates an isolated virtual environment for testing. By installing
the distribution into the virtual environment, tox
ensures that the tests pass even after the
distribution has been packaged and installed, thereby catching any errors in packaging and
installation scripts, which are common. Having the Python packages in the project root subverts
this isolation for two reasons:
Calling
python
in the project root (for example,python -m pytest tests/
) causes Python to add the current working directory (the project root) tosys.path
, which Python uses to find modules. Because the source packagefact
is in the project root, it shadows thefact
package installed in the tox environment.Calling
pytest
directly anywhere that it can find the tests will also add the project root tosys.path
if thetests
folder is a a Python package (that is, it contains a__init__.py
file). pytest adds all folders containing packages tosys.path
because it imports the tests like regular Python modules.
In order to properly test the project, the source packages must not be on the Python path. To prevent this, there are three possible solutions:
Remove the
__init__.py
file fromtests
and runpytest
directly as a tox command.Remove the
__init__.py
file from tests and change the working directory ofpython -m pytest
totests
.Move the source packages to a dedicated
src
folder.
The dedicated src
directory is the recommended solution
by pytest
when using tox and the solution this blueprint promotes because it is the least
brittle even though it deviates from the traditional Python project structure. It results is a
directory structure like:
fact
├── src
│ └── fact
│ ├── __init__.py
│ ├── cli.py
│ └── lib.py
├── tests
│ ├── __init__.py
│ └── test_fact.py
├── tox.ini
└── setup.py
Type Hinting¶
Type hinting allows developers to include optional static typing information to Python source code. This allows static analyzers such as PyCharm, mypy, or pytype to check that functions are used with the correct types before runtime.
For PyCharm in particular, the IDE is able to provide much richer auto-completion, refactoring, and type checking while the user types, resulting in increased productivity and correctness.
This project uses the type hinting syntax introduced in Python 3:
def factorial(n: int) -> int:
Type checking is performed by mypy via tox -e type-check
. mypy is configured in setup.cfg
.
See also awesome-python-typing.
Distributing Type Hints¶
PEP 561 defines how a Python package should communicate the presence of inline type hints to static type checkers. mypy’s documentation provides further examples on how to do this as well.
mypy
looks for the existence of a file named py.typed
in the root of the installed
package to indicate that inline type hints should be checked.
Licensing¶
Licensing for the project is defined in:
LICENSE.txt
setup.py
This project uses a common permissive license, the MIT license.
You may also want to list the licenses of all of the packages that your Python project depends on.
To automatically list the licenses for all dependencies in requirements.txt
(and their
transitive dependencies) using
pip-licenses:
(venv) $ tox -e licenses
...
Name Version License
colorama 0.4.3 BSD License
exitstatus 1.3.0 MIT License
Docker¶
Docker is a tool that allows for software to be packaged into isolated containers. It is not necessary to use Docker in a Python project, but for the purposes of presenting best practice examples, a Docker configuration is provided in this project. The Docker configuration in this repository is optimized for small size and increased security, rather than simplicity.
Docker is configured in:
Dockerfile
.dockerignore
To build the Docker image:
$ docker build --tag fact .
To run the image in a container:
# Example calculating the factorial of 5.
$ docker run --rm --interactive --tty fact 5
PyCharm Configuration¶
To configure PyCharm 2018.3 and newer to align to the code style used in this project:
Settings | Search “Hard wrap at”
Editor | Code Style | General | Hard wrap at: 99
Settings | Search “Optimize Imports”
Editor | Code Style | Python | Imports
☑ Sort import statements
☑ Sort imported names in “from” imports
☐ Sort plain and “from” imports separately within a group
☐ Sort case-insensitively
Structure of “from” imports
◎ Leave as is
◉ Join imports with the same source
◎ Always split imports
Settings | Search “Docstrings”
Tools | Python Integrated Tools | Docstrings | Docstring Format: Google
Settings | Search “Force parentheses”
Editor | Code Style | Python | Wrapping and Braces | “From” Import Statements
☑ Force parentheses if multiline
Integrate Code Formatters¶
To integrate automatic code formatters into PyCharm, reference the following instructions:
-
The File Watchers method (step 3) is recommended. This will run
black
on every save.
-
The File Watchers method (option 1) is recommended. This will run
isort
on every save.
Tip
These tools work best if you properly mark directories as excluded from the project that should
be, such as .tox
. See
https://www.jetbrains.com/help/pycharm/project-tool-window.html#content_pane_context_menu
on how to Right Click | Mark Directory as | Excluded.


Our Project
All (21)
Motivate Life’s Quality (3)
Digital For Health (3)
Develop Tech For Learning (5)
Support Business Grow up (10)
SEE PROJECT
SEE DEFENDER
PROJECT NAME
CONTACT US :
SUPPORT BY :


menu
Explore
Images
Videos
Explore
Images
Videos
Videos
This video explains the first successful landing on a comet
This video shows a timelapse of a comet


We want to solve for the Maximum A Posterior solution:
$$\arg \max - \frac{1}{2} \parallel {\color{Orchid} y} - {\color{SkyBlue} x} \parallel_2^2 + \log p_\theta({\color{SkyBlue} x})$$ This can be done by gradient descent as long as one has access to the score function $\frac{\color{orange} d \color{orange}\log \color{orange}p\color{orange}(\color{orange}x\color{orange})}{\color{orange} d \color{orange}x}$.$\Longrightarrow$ We can see which parts of the image are well constrained by data, and which regions are uncertain.
import jax.numpy as np
import tensorflow as tf
import flowpm
# Defines integration steps
stages = np.linspace(0.1, 1.0, 10, endpoint=True)
initial_conds = flowpm.linear_field(32, # size of the cube
100, # Physical size
ipklin, # Initial powerspectrum
batch_size=16)
# Sample particles and displace them by LPT
state = flowpm.lpt_init(initial_conds, a0=0.1)
# Evolve particles down to z=0
final_state = flowpm.nbody(state, stages, 32)
# Retrieve final density field
final_field = flowpm.cic_paint(tf.zeros_like(initial_conditions),
final_state[0])
import jax.numpy as np
import jax_cosmo as jc
# Defining a Cosmology
cosmo = jc.Planck15()
# Define a redshift distribution with smail_nz(a, b, z0)
nz = jc.redshift.smail_nz(1., 2., 1.)
# Build a lensing tracer with a single redshift bin
probe = probes.WeakLensing([nz])
# Compute angular Cls for some ell
ell = np.logspace(0.1,3)
cls = angular_cl(cosmo_jax, ell, [probe])
import jax
import jax.numpy as np
import jax_cosmo as jc
# .... define probes, and load a data vector
def gaussian_likelihood( theta ):
# Build the cosmology for given parameters
cosmo = jc.Planck15(Omega_c=theta[0], sigma8=theta[1])
# Compute mean and covariance
mu, cov = jc.angular_cl.gaussian_cl_covariance_and_mean(cosmo,
ell, probes)
# returns likelihood of data under model
return jc.likelihood.gaussian_likelihood(data, mu, cov)
# Fisher matrix in just one line:
F = - jax.hessian(gaussian_likelihood)(theta)
def log_posterior( theta ):
return gaussian_likelihood( theta ) + log_prior(theta)
score = jax.grad(log_posterior)(theta)


Xinjiang govt says leak on Uighur camps ‘fake news’
A report in the New York Times that included 400 pages of leaked internal documents on the internment of Uighur Muslims was “fabricated” and prompted by “hostile foreign forces”, the government of China’s far western region of Xinjiang said.
United Nations experts and rights groups estimate more than a million Uighurs and members of other ethnic groups have been detained in camps in a far-reaching campaign that has triggered an international backlash.
The NYT report included a series of speeches by Chinese President Xi Jinping to Xinjiang officials in 2014, as well as written directives for officials on how to speak to students whose family members had been detained.
In a statement, the Xinjiang government described the NYT report as “fake news” that “was entirely collusion and fabrication by domestic and foreign hostile forces”.
Monday’s statement, released on state media, gave no details regarding which parts were fabricated, however.
Earlier on Monday, China’s Foreign Ministry did not deny the documents’ authenticity, but said the program had been successful and the “experience could be borrowed in other countries”.
The documents also showed that internment camps in Xinjiang were expanded rapidly in 2016, when Chen Quanguo was appointed the Communist Party chief of the region. China has given no official figures on the number of people detained. Reuters
– Contact us at<EMAIL_ADDRESS>CG


PostgreSQL 12.5 Documentation
Next
PostgreSQL 12.5 Documentation
The PostgreSQL Global Development Group
Legal Notice
Table of Contents
Preface
1. What Is
PostgreSQL
?
2. A Brief History of
PostgreSQL
3. Conventions
4. Further Information
5. Bug Reporting Guidelines
I. Tutorial
1. Getting Started
2. The
SQL
Language
3. Advanced Features
II. The SQL Language
4. SQL Syntax
5. Data Definition
6. Data Manipulation
7. Queries
8. Data Types
9. Functions and Operators
10. Type Conversion
11. Indexes
12. Full Text Search
13. Concurrency Control
14. Performance Tips
15. Parallel Query
III. Server Administration
16. Installation from Source Code
17. Installation from Source Code on
Windows
18. Server Setup and Operation
19. Server Configuration
20. Client Authentication
21. Database Roles
22. Managing Databases
23. Localization
24. Routine Database Maintenance Tasks
25. Backup and Restore
26. High Availability, Load Balancing, and Replication
27. Monitoring Database Activity
28. Monitoring Disk Usage
29. Reliability and the Write-Ahead Log
30. Logical Replication
31. Just-in-Time Compilation (
JIT
)
32. Regression Tests
IV. Client Interfaces
33.
libpq
- C Library
34. Large Objects
35.
ECPG
- Embedded
SQL
in C
36. The Information Schema
V. Server Programming
37. Extending
SQL
38. Triggers
39. Event Triggers
40. The Rule System
41. Procedural Languages
42.
PL/pgSQL
-
SQL
Procedural Language
43. PL/Tcl - Tcl Procedural Language
44. PL/Perl - Perl Procedural Language
45. PL/Python - Python Procedural Language
46. Server Programming Interface
47. Background Worker Processes
48. Logical Decoding
49. Replication Progress Tracking
VI. Reference
I. SQL Commands
II. PostgreSQL Client Applications
III. PostgreSQL Server Applications
VII. Internals
50. Overview of PostgreSQL Internals
51. System Catalogs
52. Frontend/Backend Protocol
53. PostgreSQL Coding Conventions
54. Native Language Support
55. Writing a Procedural Language Handler
56. Writing a Foreign Data Wrapper
57. Writing a Table Sampling Method
58. Writing a Custom Scan Provider
59. Genetic Query Optimizer
60. Table Access Method Interface Definition
61. Index Access Method Interface Definition
62. Generic WAL Records
63. B-Tree Indexes
64. GiST Indexes
65. SP-GiST Indexes
66. GIN Indexes
67. BRIN Indexes
68. Database Physical Storage
69. System Catalog Declarations and Initial Contents
70. How the Planner Uses Statistics
VIII. Appendixes
A.
PostgreSQL
Error Codes
B. Date/Time Support
C.
SQL
Key Words
D. SQL Conformance
E. Release Notes
F. Additional Supplied Modules
G. Additional Supplied Programs
H. External Projects
I. The Source Code Repository
J. Documentation
K.
PostgreSQL
Limits
L. Acronyms


Neighborhood Map
Reset
(current)
Reset
Locations
Foursquare top picks
Oups!
×
Foursquare request failed!


Under this paragraph there is a <div class="test-div"> with a <h3>, a <h4> and a <p> inside it.
A mentDoc document is being compiled and executed.
In it there are commands to empty the <h3> and append "WORKS!" to it, as well as remove the <h4> entirely.
The <p> is initially empty, but a command in the mentDoc document compiles some markdown and append it to the <p>.


Note:
Type:
Filename:
Filter
Reset
Set Image
No images are found.
Loading...
No images are available for this record


2001: A Space Odyssey
Starring: Keir Dullea, Gary Lockwood, William Sylvester, Douglas Rain Written by Arthur C. Clarke and Stanley Kubrick Produced and Directed by Stanley Kubrick
2001 is probably the most review-proof film in the history of cinema.  In a lot of ways, 2001 is the ultimate cinematic Rorschach test. Any review winds up saying more about the reviewer than about the film itself.
Instead of trying to tell you what I think it all means, I will satisfy myself with saying that I think 2001 is a singularly important film. Aside from Citizen Kane, it may be the most significant film in the first 100 years of cinema. More than any other film, before or since, it shows that film can be used for something beyond mere storytelling. Almost all other "great films" still hold to a more traditional narrative structure.
Not so here. It would be pointless to summarize the plot of 2001, because the plot is almost beside the point. This is cinema as mood piece, the use of imagery to stir the mind in ways that go beyond reason. 2001 is a film to be experienced and then dwelt upon at length, rather than just watched. If no one comes to the same conclusions, so much the better. I seem to remember that director Kubrick compared the structure of this film to that of symphony. I think this is accurate. 2001 is as open to individual interpretation as any good piece of classical music.
I have said elsewhere that I would not classify this film as science fiction, unless one considers metaphysics to be a science. Still, Kubrick's insistence upon rigid technical accuracy means that the science-fiction elements are some of the most sophisticated ever committed to film.
In this vein, the middle and later sections of the film which follow Heywood Floyd to the lunar crater Tycho and then follow Dave Bowman to Jupiter and beyond present us, the viewers of 1999, with a strange contradiction. Even though the film's view of man's relationship to technology is rather bleak, the level of technology portrayed for the years 1999-2001 appears wildly optimistic. It is fascinating to see just how big we were dreaming back in the 1960's.
2001's predictions about the future are a wild collection of hits and misses. It's true that there are no giant wheel-like space stations in orbit, but the first elements of a more modest station are already in place. Its interior, however, will not resemble the concourse at Heathrow. And although the Pan-Am space plane was overly optimistic, both about luxurious 747-style passenger travel in space and also about the existence of the airline itself, the design of the ship does accurately predict the basic shape of the space shuttle we currently fly.
Like I said, the film's view of man's relationship to his machines is almost relentlessly pessimistic. How could it be otherwise when the only character with a semblance of a personality is a sentient supercomputer, and a homicidal one at that? The scene in which the HAL 9000 kills the still hibernating astronauts is especially chilling when the camera focuses on the computer ubiquitous red eye, like a traditional movie would dwell on the face of a murderer surveying his handiwork. With a human killer, we could read the expression on the face, maniacal glee or tortured guilt. With HAL, the lack of any possibility of expression means that we have a killer whose motives are both unknown and unknowable. I challenge even the makers of The Blair Witch Project to concoct a scarier scenario than that.
And the following scene, in which the pitiless killer begs for its own existence as David Bowman coldly and mechanically disassembles its higher mental functions, adds an equally chilling coda to that idea. Our attempt to create technology in our own image has succeeded in duplicating even the darker corners of our nature.
The human characters are overshadowed by both HAL and the alien monolith, but unlike other technology-driven effects films, this is not accidental or a deficiency. In 2001, the human characters are almost elements of the scenery, their interaction part of the background noise. Heywood Floyd (Sylvester) is a non-stop stream of unctuous pleasantries. His bland company-man exterior makes his reminder that security oaths will be required from anyone who knows about the monolith all the more ominous. He seems like a nice-enough guy, but his words hint at rather authoritarian attitudes.
Astronauts Bowman (Dullea) and Poole (Lockwood), on the other hand, seem to have totally submerged their personalities into their jobs, until they almost act like machines. Their responses seem almost programmed, automatic, while their computer goes about having a nervous breakdown. I found it ironically amusing when, in response to a reporter's question, Poole says that HAL acts like he has emotions, and says so in the most unemotional voice of which a human is capable.
2001 is not a movie for the people who log into the Video section of Amazon.com and blather that Armageddon is "the greatest movie ever made!" This film makes demands that its audience try to understand what it is trying to say without it being explained, but doesn't care if we fail to do so. The pace is almost glacial at times, but the film rewards and doesn't bore those willing to make the effort.
-- Reviewed by Paul McElligott
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


Open terminal and navigate to .NET Core project directory or use last opened console and then type `ng new ClientApp --minimal --dry-run`. We use `--mininal` flag to generate all support tools but project itself to be minimal as possible. This `--dry-run` showing what you should expect to create when command is executed without dry flag, but it's convenient for sanity check.
When see this minimal template it's ready to install but if you see more files, directories or many other things you should probably check that `--minimal` flag is not misspeled. If everything is correct then type again command without `--dry-run` flag `ng new <Name Of Client App> --minimal`, you should wait until npm install Angular and all dependencies. When all is done client app should have same or very similar project structure.
Looks more complicated than it is, but we must fix that a bit later.
Switch in console that is already on project path and type `cd <Name Of Client App>` and let’s use another command `ng build` thath gets all Typescript files you produce along with angular code and use Webpack to bundle all chunks as we can see below.
This bundles are ready for injecting, we need all of them. If you curious, your code spots in "main.bundle.js" and all other are rest of your app (styles, angular code, etc.). All bundles location is "(Name Of Client App)/dist"
Again just for sanity check let's test our client app without messing it up with server code as typing on terminal that is already in path "(Main Project)/(Client Project)" and serve client app as execute `ng serve` then you see
our client app runs alone on localhost in port 4200. Locate your browser there localhost:4200 and if you follow along you should see that everything runs without errors and all bundles is spit in browser properly.
Bundles
No errors
If everything is fine so far we can proceed with next section namely integrating two projects run like one application.


You can construct your table the "angular" way, eg using the directive ng-repeat
on tr
tag.
All you need to do is to add the directive datatable
with the value ng
on your table in order
to make it rendered with DataTables.
Note:
- If you use the Angular way of rendering the table along with the Ajax or the promise solution, the latter will be display.
-
Don't forget to set the properties
ng
in the directivedatatable
in order to tell the directive to use the Angular way!
The "Angular way" is REALLY less efficient than fetching the data with the Ajax/promise solutions. The lack of
performance is due to the fact that Angular add the 2 way databinding to the data, where the ajax and promise solutions
do not. However, you can use Angular directives (ng-click
, ng-controller
...) in there!
If your DataTable has a lot of rows, I STRONGLY advice you to use the Ajax solutions.
With Angular v1.3, the one time binding can help you improve performance.
If you are using angular-resource, then you must resolve the promise and then set to your $scope
in order to use the one time binding
.


If you don't have Samba installed on your system, the module's main page will complain that it cannot find the Samba configuration file and you will be unable to share any files or directories. If you do have Samba installed but are getting this error message, check the module configuration to make sure that Webmin is looking in the right place for the configuration file and Samba programs.
Assuming Samba is installed properly, the module's main page will display a list of all the file and printer shares defined on your system. If Webmin determines that the Samba server is not running, you will be given the option of attempting to start the server. This may be necessary if Samba is not started at bootup time.
To create a share, click on the Create File Share link below the list of existing shares on the main page. This will display a form allowing you to enter the details of the new share. Although Samba supports a large number of parameters for each share, the most important ones are:
| Share Name | Every share must have a name, used by clients to refer to it. One special case is the All home directories share, explained later. |
| Path | The directory to be shared. Clients using this share can only access files in or below this directory. |
| Writable | Determines whether clients can write to files and directories in this share. |
| Guest access | If a share allows guest users, clients can access it without needing to provide a valid name and password. A share can either disallow guest users, allow guests and normal users, or allow guests only. |
Once you have entered the details of a new share and clicked the Create button, it will be immediately available to client PC's. Assuming everything is set up correctly on your network, users will be able to use the Network Neighbourhood function under Windows to see your server and all its shares. The newly created share can then be mapped to a drive letter on the PC.
To create a new printer share, click on the Create Printer Share like from the main page. This will display a form similar to the one used for creating file shares, in which you can enter the details of the new share. The most important options for a new printer share are :
| Share Name | Every share must have a name, used by clients to refer to it. One special case is the All printers share, explained later. |
| Printer | The Unix printer to be shared. This can be any printer that you would print to using the lpr command. |
| Path | The directory in which temporary print files |
| Guest access | If a share allows guest users, clients can access it without needing to provide a valid name and password. A share can either disallow guest users, allow guests and normal users, or allow guests only. |
| Printer type | The name of the printer driver that should be used for this printer. If you enter a value for this option and it matches a printer drive on client PCs, then users will not have to choose a printer driver when adding this printer. |
As with file shares, many more options are available for print shares. As soon as a printer share is added, it will be available to clients. Under Windows 95 and NT, a printer can be added using the Add Printer option in the printers control panel. Once added, the user can print to it like any local or network printer.
To delete a share, click on the Delete button at the bottom-right of the page. Existing users will not be immediately disconnected - however, no new users will be able to connect to the share.
Some versions of Windows do not allow the user to provide a username when accessing a share - instead, the username provided when 'logging in' to Windows is used. If all client users login to Windows using the same username that they use for Unix, then this is not a problem. If not, you have 2 options:
Fortunately, Samba can use encrypted passwords. However, it is not possible to match passwords sent by clients against the normal Unix password file because of the different forms of encryption used. For this reason, Samba must maintain its own list of users and passwords.
To switch Samba into encrypted password mode, you must:


Every ten minutes, a picture of the growing rig is taken and at the end of the hour, a timelapse of the history so far is updated.
Sit back and enjoy the journey, or use the list below to quickly re-live the highs and lows of the Hydrouino Dream Garden adventure.
| Water pipe falls out, pumping water on the balcony! | |
| Changed to new batch of nutrient water. Nutrient solution too strong. Tomato plant nearly dies. |


{% extends "newbase.html" %} {% block page_styles %} {{ super() }} {% endblock %} {% block page_content %}
Here listed all articles in my blog. I hope you can find something useful. The left panel show posts in folder trees, while the Tags page shows posts in tagged groups. You also can bring up the Search engine anytime by pressing the S key.


Showdown Saver
Load
Save
Login
Load teams into the
import page
.
Loading your teams...
You have no saved teams :(
Visit
Showdown
and create some teams!
Save teams from the
export page
.
Backup Team
BACKUP
Login to the
showdown saver app
.
I have read and accept
the directions.
Login


Automating My Wedding...
Part 1: RSVP form (Vuex)
```Note for Devs reviewing this speech... Remember, slides are for showing visuals!
Not for reading from. If you know whats going on from the slides alone...
it was a shitty speech```
What I'm going to cover:
- What is Vuex?
- How to implement it.
- Why you should care...
![image](https://media.licdn.com/mpr/mpr/shrinknp_200_200/AAEAAQAAAAAAAAPhAAAAJDM5MWJmNzY0LTFmN2EtNGZlOC1hMzU5LTMwNmQwODM5YzkzMQ.jpg)
### Jon Paul Uritis
Canadian-American Gypsy
###### (Newport Beach, California)
What is Vuex
> "Centralized State Management for Vue.js"
> "In information technology and computer science, a program is described as stateful if it is designed to remember preceding events or user interactions; the remembered information is called the state of the system."
## State!
> Basically => The stuff thats going on at a specific time (like now).
### Analogy - State of the Union:
- Unemployment is 4.3%
- Nasa found water on the moon
- And the country is about to burn itself down
Why Manage State?
(A lot of reasons... but in regards Vuex)
> Generally, You're application needs to be aware of the rest of the stuff going on... specifically component to component communications
### Solutions for State Management
- Prop / Event Emmiters
- Event Bus
- Vuex
### Prop / Event Emiters
The process for passing state in between components and the App
> (Great for a small application, bad for a BIG application)
Event Bus
An Event Bus is a Separate Vue instance that you pass events to and from
> (Really good for small-medium sized applications, bad for a BIG application, unnecessary for a small)
Vuex (i.e. the reason I'm here)
> (good for everything that is neither small nor small-medium)
How to install
> `npm or yarn install vuex`
How to implement
- Add import statements to main.js import { store } from './store/store';
- Add store to Vue instance
new Vue({
el: '#app',
router,
store,
template: '',
components: { App },
});
- Create store.js (do store stuff)
import Vue from 'vue';
import Vuex from 'vuex';
Vue.use(Vuex);
// eslint-disable-next-line
export const store = new Vuex.Store({
state: {
counter: 0,
},
});
Access the Store
computed: {
storeCounter() {
return this.$store.state.counter;
},
},
### My Wedding Automations
Major Tasks:
- Texting 2500 people for their info
- Handling Invitations
- RSVP to the wedding
- Chinese Gifts (Stripe integration)
- Thank You's
So what are we building???
> RSVP for for Wedibration.com
Vuex (most common) Main Patterns
- Getters
- Mutations
- Actions
Add components
- Find Guest
- Attendance (Yes/No)
- Food
- Music
Take Aways
- Please Use Vuex...
### Thank You!
> Twitter/ Github: @jppope
(jonpaul.uritis@thestormcloudgroup.com)


A pet to share, a friend to gain.
Become a host on Pet Surfers, create memorable experiences for pet-lovers!
Silver and Ismael
Admired owner of lab puppy
Catmoss and Anna
Proud owner of cat
Chanel and Xena
Celebrated owner of parrot
Explore how sharing works
GET ANSWERS
Whether you have a quick question or want some tips, you can message a host and get answers


DATE_AND_TIME(3) - [SYSTEM:TIME] Gets current date time
call date_and_time( [date] [,time] [,zone] [,values] )
subroutine date_and_time(date, time, zone, values)character(len=8),intent(out),optional :: date character(len=10),intent(out),optional :: time character(len=5),intent(out),optional :: zone integer,intent(out),optional :: values(8)
o *date is a default character scalar o *time is a default character scalar o *zone is a default character scalar o VALUES is a rank-one array of type integer with a decimal exponent range of at least four.
DATE_AND_TIME(3) gets the corresponding date and time information from the real-time system clock.
Unavailable time and date character parameters return blanks.
Unavailable numeric parameters return -HUGE(VALUE).
These forms are compatible with the representations defined in ISO 8601:2004. UTC is established by the International Bureau of Weights and Measures (BIPM, i.e. Bureau International des Poids et Mesures) and the International Earth Rotation Service (IERS).
o DATE : A character string of default kind of the form CCYYMMDD, of length 8 or larger, where + CCYY is the year in the Gregorian calendar + MM is the month within the year + DD is the day within the month.The characters of this value are all decimal digits.
If there is no date available, DATE is assigned all blanks.
The date, clock, and time zone information might be available on some images and not others. If the date, clock, or time zone information is available on more than one image, it is processor dependent whether or not those images share the same information.
o TIME : A character string of default kind of the form HHMMSS.SSS, of length 10 or larger, where Except for the decimal point, the characters of this value shall all be decimal digits.
o hh is the hour of the day, o mm is the minutes of the hour, o and ss.sss is the seconds and milliseconds of the minute. If there is no clock available, TIME is assigned all blanks.
o ZONE : A string of the form (+-)HHMM, of length 5 or larger, representing the difference with respect to Coordinated Universal Time (UTC), where The characters of this value following the sign character are all decimal digits.
o hh and mm are the time difference with respect to Coordinated Universal Time (UTC) in hours and minutes, respectively. If this information is not available, ZONE is assigned all blanks.
o VALUES : An array of at least eight elements. If there is no data available for a value it is set to -HUGE(VALUES). Otherwise, it contains:
o VALUES(1) : The year, including the century. o VALUES(2) : The month of the year o VALUES(3) : The day of the month o VALUES(4) : Time difference in minutes between the reported time and UTC time. o VALUES(5) : The hour of the day, in the range 0 to 23. o VALUES(6) : The minutes of the hour, in the range 0 to 59 o VALUES(7) : The seconds of the minute, in the range 0 to 60 o VALUES(8) : The milliseconds of the second, in the range 0 to 999.
Sample program:
program demo_date_and_time implicit none character(len=8) :: date character(len=10) :: time character(len=5) :: zone integer,dimension(8) :: valuesResults:call date_and_time(date,time,zone,values)
! using keyword arguments call date_and_time(DATE=date,TIME=time,ZONE=zone) print (*(g0)),DATE=",date," TIME=",time," ZONE=",zone,"
call date_and_time(VALUES=values) write(*,(i5,a)) & & values(1), - The year, & & values(2), - The month, & & values(3), - The day of the month, & & values(4), - Time difference with UTC in minutes, & & values(5), - The hour of the day, & & values(6), - The minutes of the hour, & & values(7), - The seconds of the minute, & & values(8), - The milliseconds of the second end program demo_date_and_time
> DATE="20201222" TIME="165738.779" ZONE="-0500" > 2020 - The year > 12 - The month > 22 - The day of the month > -300 - Time difference with UTC in minutes > 16 - The hour of the day > 57 - The minutes of the hour > 38 - The seconds of the minute > 779 - The milliseconds of the second
Fortran 95
CPU_TIME(3), SYSTEM_CLOCK(3)
date and time conversion, formatting and computation
fortran-lang intrinsic descriptions (license: MIT) @urbanjost
o M_time - https://github.com/urbanjost/M_time o fortran-datetime https://github.com/dongli/fortran-datetime o datetime-fortran - https://github.com/wavebitscientific/datetime-fortran
| Nemo Release 3.1 | date_and_time (3) | July 22, 2023 |


God hath spoken, "It is done."
Faith has answered, "It is done."
Prayer is over, praise begun.
Hallelujah, "It is done."
4. Claim the promise of His healing,
"It is done."
Trust without a sign or feeling,
"It is done."
Hear the message from the throne,
Claim the promise, doubting one;
God hath spoken, "It is done."
Faith has answered, "It is done."
Prayer is over, praise begun.
Hallelujah, "It is done."
5. Say of every promised blessing,
"It is done."
Rest upon His word, confessing,
"It is done."
Hear the message from the throne,
Claim the promise, doubting one;
God hath spoken, "It is done."
Faith has answered, "It is done."
Prayer is over, praise begun.
Hallelujah, "It is done."
6. This the secret of receiving,
"It is done."
Take Him at His word believing,
"It is done."
Hear the message from the throne,
Claim the promise, doubting one;
God hath spoken, "It is done."
Faith has answered, "It is done."
Prayer is over, praise begun.
Hallelujah, "It is done."
COMFORT IN TRIALS — BY THE LORD'S WORD
E691
<IP_ADDRESS>.8.7.
1. Hark! the voice of love and mercy
Sounds aloud from Calvary;
See, it rends the rocks asunder,
Shakes the earth, and veils the sky:
"It is finished!" "It is finished!"
Hear the dying Savior cry.
2. "It is finished!" Oh, what pleasure
Do these charming words afford!
Heavenly blessings without measure
Flow to us from Christ, the Lord:
"It is finished!" "It is finished!"
Saints, the dying words record.
3. Finished all the types and shadows
Of the ceremonial law!
 "It is finished!"
Saints, from hence your comfort draw.
4. Tune your harps anew, ye seraphs,
Join to sing the pleasing theme;
All on earth and all in heaven
Join to praise Immanuel's name:
Hallelujah! Hallelujah!
Glory to the bleeding Lamb!
COMFORT IN TRIALS — BY THE LORD'S WORD
E692
Peculiar Meter.
1. There's a little word that the Lord has giv'n
For our help in the hour of need:
Let us reckon ourselves to be dead to sin,
To be dead and dead indeed.
Let us reckon, reckon, reckon,
Let us reckon, rather than feel;
Let us be true to the reck'ning,
And He will make it real.
2. There's another word that the Lord has giv'n,
In the very same verse we read,
Let us reckon ourselves as alive in Him,
As alive and alive indeed.
Let us reckon, reckon, reckon,
Let us reckon, rather than feel;
Let us be true to the reck'ning,
And He will make it real.
3. While we trust in feeling or inward frames
We shall always be tossed about,
Let us anchor fast to the Word of God,
And reckon away our doubt.
Let us reckon, reckon, reckon,
Let us reckon, rather than feel;
Let us be true to the reck'ning,
And He will make it real.
4. As the mariner, when the skies are dim.
Sails on by his compass true;
So our faith would cling to the promise firm.
And reckon the journey through.
Let us reckon, reckon, reckon,
Let us reckon, rather than feel;
Let us be true to the reck'ning,
And He will make it real.
5. O how sweet it is to be anchored fast
To a hope that can never fail;
Let us reckon on with a firmer trust,
Till we anchor within the veil.
Let us reckon, reckon, reckon,
Let us reckon, rather than feel;
Let us be true to the reck'ning,
And He will make it real.
6. You may claim the promise from every pain,
You may know His power to heal;
But your faith must rest in His word alone,
And reckon, rather than feel.
Let us reckon, reckon, reckon,
Let us reckon, rather than feel;
Let us be true to the reck'ning,
And He will make it real.
COMFORT IN TRIALS — BY THE LORD'S FAITHFULNESS
E693 (T693) (C-506)
<IP_ADDRESS>.
1. He faileth not, for He is God;
He faileth not, His grace how good!
He faileth not, His Word is clear;
If we have God, whom need we fear?
2. The highest mount, He can make plain;
The wildest flood, He can restrain!
God of Impossibilities!
Poor puny man, now learn His ways.
3. The axe did swim on Jordan's wave!
Our God the Red Sea's waters clave!
He stopped the sun! made long the day!
This is the God to whom we pray.
4. He bars the sea with feeble sand!
The proud waves bow at His command!
If God is thine, what more your need?
Can He not work for you indeed?
5. Our God is love; your needs are known;
His promises He'll fully own.
Our gracious God bows down His ear
The feeblest, weakest cry to hear.
6. Our God is light, and never yet,
One promise did He e'er forget.
His promises in Christ the Son
Are fully pledged, Yea and Amen.
7. Our faithful God, faith cannot break,
Nor death, nor hell, His promise shake!
Who ask in faith, He'll not deny;
His Word is sure, He must reply.
8. He faileth not, let all men hear;
He faileth not, His Word is clear.
He faileth not, His grace how good;
He faileth not, for He is God!
PAG-ALIW SA MGA PAGSUBOK — SA PAMAMAGITAN NG KATAPATAN NG PANGINOON
T693 (E693)
1. Walang palya, 'pagka't Siya'y Diyos,
Walang palya, b'yaya'y lubos;
Walang palya, nangako na,
Tayo'y may Diyos, 'nong pangamba?
2. May bundok na di mapatag?
May di matawid na dagat?
Ating Diyos sagot sa lahat—
Diyos ng Imposibilidad!
3. Palakol na pinalutang,
Araw na walang lubugan;
Pulang Dagat naging kati,
Gawa ng Diyos na maigi.
4. Buhangin naging hangganan,
Maalon na karagatan;
Siya ang Iyong Diyos, ano pa nga,
Sa Iyo hindi Niya magawa?
5. Batid Niya Iyong suliranin
Ikaw Kanyang mamahalin;
Ating Diyos ay mahabagin,
Hibik natin ay diringgin.
6. Ating Diyos kaliwanagan,
Pangako'y di malimutan,
Pangako Niya na kay Kristo,
Pawang Amen, pawang Oo.
7. Diyos natin ay katapatan,
Tipan Niya'y may katatagan;
Nananalig humiling ka,
Salita Niya'y di matatwa.
8. Walang palya ang ating Diyos
Salita'y malinaw lubos,
Kay buti ng biyaya Niya,
'Pagkat Siya'y Diyos, walang palya!
COMFORT IN TRIALS — BY THE LORD'S CARE
E694 (T694) (C-493)
<IP_ADDRESS>. with chorus.
1. Be not dismayed whate'er betide,
God will take care of you!
Beneath His wings of love abide,
God will take care of you!
God will take care of you,
Through every day o'er all the way;
He will take care of you;
God will take care of you!
2. Through days of toil when heart doth fail,
God will take care of you!
When dangers fierce your path assail,
God will take care of you!
God will take care of you,
Through every day o'er all the way;
He will take care of you;
God will take care of you!
3. All you may need He will provide,
God will take care of you!
Trust Him, and you will be satisfied,
God will take care of you!
God will take care of you,
Through every day o'er all the way;
He will take care of you;
God will take care of you!
4. Lonely and sad, from friends apart,
God will take care of you!
He will give peace to your aching heart,
God will take care of you!
God will take care of you,
Through every day o'er all the way;
He will take care of you;
God will take care of you!
5. No matter what may be the test,
God will take care of you!
Lean, weary one, upon His breast,
God will take care of you!
God will take care of you,
Through every day o'er all the way;
He will take care of you;
God will take care of you!
PAG-ALIW SA MGA PAGSUBOK — DAHIL SA PAG-AALAGA NG PANGINOON
T694 (E694)
Ang Tagalog ay isinalin mula sa Chinese hymnal.
1. Sa ilalim ng pakpak Niya,
Diyos Mo'y kakalinga;
Sa anuman huwag mangamba
Diyos Mo'y kakalinga.
Kakalinga sa iyo
Bawa't saglit, bawa't dako;
Diyos t'yak kakalinga,
Sa iyo'y aalaga.
2. Bigung-bigo sa hirap nga,
Diyos Mo'y kakalinga;
Panganib kublihan wala,
Diyos Mo'y kakalinga.
Kakalinga sa iyo
Bawa't saglit, bawa't dako;
Diyos t'yak kakalinga,
Sa iyo'y aalaga.
3. Sa dalangin nakinig Siya,
Diyos Mo'y kakalinga;
Kailangan mo Siyang naghanda,
Diyos Mo'y kakalinga.
Kakalinga sa iyo
Bawa't saglit, bawa't dako;
Diyos t'yak kakalinga,
Sa iyo'y aalaga.
4. Anumang pagsubok, dusa,
Diyos Mo'y kakalinga;
Taong pagod, himlaya'y Siya,
Diyos Mo'y kakalinga.
Kakalinga sa iyo
Bawa't saglit, bawa't dako;
Diyos t'yak kakalinga,
Sa iyo'y aalaga.
COMFORT IN TRIALS — BY THE LORD'S CARE
E695 (T695)
Peculiar Meter.
1. Does Jesus care when my heart is pained
Too deeply for mirth or song,
As the burdens press,
And the cares distress,
And the way grows weary and long?
O yes, He cares, I know He cares,
His heart is touched with my grief;
When the days are weary,
The long night dreary,
I know my Savior cares.
2. Does Jesus care when my way is dark
With a nameless dread and fear?
As the daylight fades
Into deep night shades,
Does He care enough to be near?
O yes, He cares, I know He cares,
His heart is touched with my grief;
When the days are weary,
The long night dreary,
I know my Savior cares.
3. Does Jesus care when I've tried and failed
To resist some temptation strong;
When for my deep grief
There is no relief,
Though my tears flow all the night long?
O yes, He cares, I know He cares,
His heart is touched with my grief;
When the days are weary,
The long night dreary,
I know my Savior cares.
4. Does Jesus care when I've said "goodbye"
To the dearest on earth to me,
And my sad heart aches
Till it nearly breaks,
Is it aught to Him? Does He see?
O yes, He cares, I know He cares,
His heart is touched with my grief;
When the days are weary,
The long night dreary,
I know my Savior cares.
PAG-ALIW SA MGA PAGSUBOK — DAHIL SA PAG-AALAGA NG PANGINOON
T695 (E695)
1. Nakikiramay ba si Hesus,
Kung ako'y nasasaktan
Sa kahirapan,
Kapighatian,
At pasang krus pa ang daan?
Oo, nakikiramay Siya,
Ang puso Niya'y nasaktan,
Kapag ang araw
ay may kalungkutan
Nakikiramay Siya.
2. Nakikiramay ba si Hesus,
Kung natatakot ako,
Pagtakip-silim,
At dumidilim,
Siya ba ay nasa piling ko?
Oo, nakikiramay Siya,
Ang puso Niya'y nasaktan,
Kapag ang araw
ay may kalungkutan
Nakikiramay Siya.
3. Nakikiramay ba si Hesus,
Kung mithing tagumpay na
Pinagsikapan,
Di ko nakamtan,
Walang patid ang pagluha?
Oo, nakikiramay Siya,
Ang puso Niya'y nasaktan,
Kapag ang araw
ay may kalungkutan
Nakikiramay Siya.
4. Nakikiramay ba si Hesus,
Kung ako'y magpaalam,
Sa aking sinta
Dito sa lupa;
Puso ko'y nasusugatan?
Oo, nakikiramay Siya,
Ang puso Niya'y nasaktan,
Kapag ang araw
ay may kalungkutan
Nakikiramay Siya.
COMFORT IN TRIALS — BY THE LORD'S CARE
E696
<IP_ADDRESS>.
1.
2. The need is deep, the care is great,
The burden hard to bear;
Roll it on Him with all its weight,
And leave it resting there.
3. This heavy thing, it is His gift,
His portion, thee to bless;
Give it Him back; what He shall lift
No more on thee shall press.
4. Cast all thy care, and not a part,
The great things and the small;
The Lord's all-loving, mighty heart
Has room and thought for all.
5. Yes, He will ponder every care,
Consider each detail;
Thyself, thy burden, let Him bear;
He will not, cannot, fail.
COMFORT IN TRIALS — BY THE LORD'S CARE
E697 (T697) (C-495)
<IP_ADDRESS>. with chorus.
1. Weary pilgrim on life's pathway—
Struggling on beneath thy load—
Hear these words of consolation,
"Cast thy burden on the Lord."
Cast thy burden on the Lord!
Cast thy burden on the Lord,
And He will strengthen thee,
sustain and comfort thee—
Cast thy burden on the Lord.
2. Are thy tired feet unsteady?
Does thy lamp no light afford?
Is thy cross too great and heavy?
"Cast thy burden on the Lord."
Cast thy burden on the Lord!
Cast thy burden on the Lord,
And He will strengthen thee,
sustain and comfort thee—
Cast thy burden on the Lord.
3. Are the ties of friendship severed?
Hushed the voices fondly heard?
Breaks thy heart with weight of anguish?
"Cast thy burden on the Lord."
Cast thy burden on the Lord!
Cast thy burden on the Lord,
And He will strengthen thee,
sustain and comfort thee—
Cast thy burden on the Lord.
4. Does thy heart with faintness falter?
Does thy mind forget His word?
Does thy strength succumb to weakness?
"Cast thy burden on the Lord."
Cast thy burden on the Lord!
Cast thy burden on the Lord,
And He will strengthen thee,
sustain and comfort thee—
Cast thy burden on the Lord.
5. He will hold thee up from falling;
He will guide thy steps aright;
He will strengthen each endeavor;
He will keep thee by His might.
Cast thy burden on the Lord!
Cast thy burden on the Lord,
And He will strengthen thee,
sustain and comfort thee—
Cast thy burden on the Lord.
PAG-ALIW SA MGA PAGSUBOK — DAHIL SA PAG-AALAGA NG PANGINOON
T697 (E697)
1. Pagod, malayong lakbayin,
Mabigat pang pasanin
Pakinggan mo'ng Salita Niya,
"Pasanin Akin na nga."
Ibigay na sa Kanya
Tanang pasan, bigat pa
Nagpapalakas Siya
Aaliwin ka Niya
Ibigay na sa Kanya.
2. Paa't kamay nangangalay,
Ilawan walang silay;
Pasang mabigat na lubha,
Ibigay na sa Kanya.
Ibigay na sa Kanya
Tanang pasan, bigat pa
Nagpapalakas Siya
Aaliwin ka Niya
Ibigay na sa Kanya.
3. Humiwalay ang kaibigan,
Pusong hapis nasaktan;
Namanglaw, nag-alaala,
Lahat bigay sa Kanya!
Ibigay na sa Kanya
Tanang pasan, bigat pa
Nagpapalakas Siya
Aaliwin ka Niya
Ibigay na sa Kanya.
4. Nangulila, nanghihina
Puso ay kabang-kaba,
Dahil kinalimutan ko,
Bigay lahat kay Kristo.
Ibigay na sa Kanya
Tanang pasan, bigat pa
Nagpapalakas Siya
Aaliwin ka Niya
Ibigay na sa Kanya.
5. Siya'y nag-aliw, nagpatibay,
Yapak mo Siya'ng gagabay;
Lakas sa iyo idaragdag
Siya sa iyo'y magpanatag.
Ibigay na sa Kanya
Tanang pasan, bigat pa
Nagpapalakas Siya
Aaliwin ka Niya
Ibigay na sa Kanya.
COMFORT IN TRIALS — BY THE LORD'S CARE
E698 (T698) (C-496)
<IP_ADDRESS>. with chorus.
1. Amid the trials that I meet,
Amid the thorns that pierce my feet,
One thought remains supremely sweet—
Thou thinkest, Lord, of me!
Thou thinkest, Lord, of me!
Thou thinkest, Lord, of me!
What need I fear when Thou art near,
And thinkest, Lord, of me!
2. The cares of life come thronging fast,
Upon my soul their shadows cast;
Their gloom reminds my heart at last
Thou thinkest, Lord, of me!
Thou thinkest, Lord, of me!
Thou thinkest, Lord, of me!
What need I fear when Thou art near,
And thinkest, Lord, of me!
3. Let shadows come, let shadows go,
Let life be bright, or dark with woe,
I am content, for this I know
Thou thinkest, Lord, of me!
Thou thinkest, Lord, of me!
Thou thinkest, Lord, of me!
What need I fear when Thou art near,
And thinkest, Lord, of me!
PAG-ALIW SA MGA PAGSUBOK — DAHIL SA PAG-AALAGA NG PANGINOON
T698 (E698)
1. Sa gitna ng pagsubok man,
Suliranin nasumpungan,
Kay tamis sa aking loob,
'Ko'y iniisip Mo.
'Ko'y iniisip Mo! 'Ko'y iniisip Mo!
Takot pa ba? Malapit Ka,
At iniisip Mo!
2. Mga balisa ng buhay
Sa puso'y nagpalupaypay,
Nagpaalaala lumbay,
'Ko'y iniisip Mo.
'Ko'y iniisip Mo! 'Ko'y iniisip Mo!
Takot pa ba? Malapit Ka,
At iniisip Mo!
3. Maaraw man o maulap,
Matamis man o masaklap,
Nasisiyahan ako pagka't
'Ko'y iniisip Mo.
'Ko'y iniisip Mo! 'Ko'y iniisip Mo!
Takot pa ba? Malapit Ka,
At iniisip Mo!
COMFORT IN TRIALS — BY THE LORD'S CARE
E699
<IP_ADDRESS>.D.
1. In the hour of trial,
Jesus, plead for me,
Lest by base denial,
I depart from Thee;
When Thou seest me waver,
With a look recall,
Nor for fear or favor
Suffer me to fall.
2. Should Thy mercy send me
Sorrow, toil, and woe;
Or should pain attend me
On my path below;
Grant that I may never
Fail Thy hand to see;
Grant that I may ever
Cast my care on Thee.
3. When the last hour cometh,
Fraught with strife and pain,
When Thou, Lord, returneth
To the earth again;
On Thy truth relying
As that hour draws near,
Jesus, take me, waiting,
To Thy presence dear.


Open this site in mobile browser or webview, then use your finger to pull down the page.
You can also click some button ↓↓ to refresh the page.
Maybe you can try the Type2:Below surface
Three types of this Material Design refresher.
Source code:
URL: http://lightningtgc.github.io/material-refresh/type1.html
Source code:
nav: '#navMain'
});URL: http://lightningtgc.github.io/material-refresh/index.html
Source code:
mRefresh.refresh();
});


October 27,2012
October 28,2012
October 29,2012
skdljf sikjf is fjid s did fjdis lsid fis ls dif os di fsi foid fjhis di fhjdis


TERMS & CONDITIONS
{#
{{ lr_number }}#}
-
This Consignment Note or Lorry Receipt (LR) is issued by Trans IQ Technologies Private
Limited (hereafter referred to as the Company) for the purpose of depicting and recording
details of the transaction relating to transport of goods by road.
-
The consignor and / or consignee shall be liable to pay the freight charges and all other
incidental charges (including detention charges), if any, to the Company as agreed and/or
as specified in this lorry receipt.
-
It is expressly made clear that the Company does not own any vehicles, nor does it
directly or indirectly employ any drivers for the vehicles. The Company disclaims any and
all liability in respect of the drivers and the vehicles alike.
-
The Company exercises due diligence in verifying the eligibility and reliability of the
vehicles and drivers it works with. However, the shipment is carried at the owner's risk
and the Company shall not be liable or responsible for any damages, losses,
inconveniences, business disruptions or expenditures of any kind that may arise as a result
of or in connection with any delivery risks.
-
Any dispute regarding delays, accidents, theft, leakage, damage or loss of or to the
goods, is directly between the consignor and the vehicle owner, and the Company (and its
officers, directors, agents, subsidiaries, joint ventures and employees) are not liable for any
claims, demands and damages (actual and consequential) of every kind and nature, known
and unknown, arising out of or in any way connected with such disputes.
-
Nature, contents, condition and value of the consignments as declared by the consignor
to the Company are specified in this lorry receipt. The consignor is responsible for all
consequences of incorrect or false declaration.
-
The Consignor / Consignee shall be liable for any damages or loss of goods incurred as
a result of poor packaging or rough handling while loading or unloading by the themselves
or their employees and agents.
-
The consignor shall be responsible for any delay, detention, loss or seizure of goods by
government authorities if transport of such goods by road is prohibited or the goods are not
not accompanied by invoice, permits or other proper documents. Expenses incurred, if any,
in this connection shall be borne by the consignor.
-
Perishable goods are shipped at the consignor's risk and the Company shall have the
right to dispose of perishables lying undeliverable after 48 hours of arrival without any notice.
-
The Company shall have the right to dispose of any other goods lying undeliverable after
15 days of arrival, after giving due notice to the consignor and consignee.
-
The consignor shall indemnify the Company from and against and in respect of any or
all liabilities, losses, charges and expenses (including legal fees and costs on a full
indemnity basis), claims, demands, actions and proceedings which the Company may
incur or sustain directly or indirectly from or by any reason of or in relation to the use or
proposed use of the Company's services and shall pay such sums on demand of the Company.
-
The Company reserves the right to refuse, restrict, suspend, limit or terminate any or all
Services provided at any time for any reason. The Company shall also be entitled at any
time without giving any reason to terminate the booking.
-
The Company shall be entitled to disclose to all companies within its group, or any
government body as required by the law or by directive or request from any government
body, the particulars of the consignor or consignee in its possession if the Company, in its
absolute discretion, deems fit or if it considers it in its interests to do so.
-
The Company further encourages the consignor to peruse the Terms and Conditions
mentioned at www.aaho.in. The Company reserves the right to add to, vary or amend
any or all of these terms and conditions at any time without any prior notice.


|
|
|
@862
|
4 weeks |
mmckerns |
add mystic.math.Distribution; use it for InitialPoints?, ensemble …
|
|
|
|
@861
|
7 weeks |
mmckerns |
enable SetDistributionPoints? to take a numpy.random distribution method
|
|
|
|
@860
|
7 weeks |
mmckerns |
refactor ensemble solvers so Solve in abstract class; new _InitialPoints …
|
|
|
|
@859
|
7 weeks |
mmckerns |
fix: raise error when scipy.stats instance used to set population of …
|
|
|
|
@858
|
7 weeks |
mmckerns |
enable solver to use scipy.stats instance to generate initial population
|
|
|
|
@857
|
3 months |
mmckerns |
nudging to klepto-0.1.2
|
|
|
|
@856
|
3 months |
mmckerns |
|
|
|
|
@855
|
5 months |
mmckerns |
updated copyright to 2016
|
|
|
|
@854
|
5 months |
mmckerns |
minor tweaks; renamed penalize coupler to additive, renamed combine to …
|
|
|
|
@853
|
5 months |
mmckerns |
clarify 'combine' and provide new example using combine
|
|
|
|
@852
|
5 months |
mmckerns |
added function to combine several penalties into a single penalty
|
|
|
|
@851
|
5 months |
mmckerns |
constraints.solve now can use ensemble solvers
|
|
|
|
@850
|
5 months |
mmckerns |
added linear_equality and linear_inequality penalties
|
|
|
|
@849
|
5 months |
mmckerns |
added synchronized to tools, which enables easy input synchronization
|
|
|
|
@848
|
5 months |
mmckerns |
added in-development example of using mystic for accurate N-dim …
|
|
|
|
@847
|
5 months |
mmckerns |
slightly faster imports using imp
|
|
|
|
@846
|
6 months |
mmckerns |
edit scripts and support for faster import of mystic (local imports of …
|
|
|
|
@845
|
6 months |
mmckerns |
wrap mystic.models bound instances in functions (better for dill.source)
|
|
|
|
@844
|
6 months |
mmckerns |
check if handler enabled before using signal (so solver works in …
|
|
|
|
@843
|
6 months |
mmckerns |
add deepcopy method for abstract_solver to better support 2.6
|
|
|
|
@842
|
6 months |
mmckerns |
added initial global search object and accompanying example
|
|
|
|
@841
|
6 months |
mmckerns |
add verbose option to model plotter; minor fix to import in test_smo1.py
|
|
|
|
@840
|
7 months |
mmckerns |
moved svmtools to svr, svctools to svc; fixed VTR documentation
|
|
|
|
@839
|
7 months |
mmckerns |
fix spelling error for suppress
|
|
|
|
@838
|
7 months |
mmckerns |
add read_trajectories function; use in model_plotter and log_reader; …
|
|
|
|
@837
|
7 months |
mmckerns |
enable mystic.model_plotter and mystic.log_reader to take kwds options …
|
|
|
|
@836
|
7 months |
mmckerns |
enable mystic.model_plotter to take monitor instance
|
|
|
|
@835
|
7 months |
mmckerns |
use LinearKernel? in test_svr1 example; enable use of numpy.poly1d as cost; …
|
|
|
|
@834
|
7 months |
mmckerns |
extended svm and svc KernelMatrix? to n-dimensions
|
|
|
|
@833
|
8 months |
mmckerns |
added three QP examples, demonstrate nonlinear inequality constraints
|
|
|
|
@832
|
8 months |
mmckerns |
handle corner case of solve with '0*xN'; add additional print for verbose
|
|
|
|
@831
|
8 months |
mmckerns |
add simplify to simplify equations for a single variable on the LHS;
use …
|
|
|
|
@830
|
8 months |
mmckerns |
cleaning and documentation for SVR and SVC examples; rename …
|
|
|
|
@829
|
8 months |
mmckerns |
replacing qld with mystic.diffev in test_smo1.py
|
|
|
|
@828
|
8 months |
mmckerns |
update SV regression examples from examples_other
|
|
|
|
@827
|
8 months |
mmckerns |
fix SV classification examples, move from examples_other to examples
|
|
|
|
@826
|
8 months |
mmckerns |
remove old equals None; add suppressed and clipped; fix import in svctools
|
|
|
|
@825
|
8 months |
mmckerns |
added test_circle_dual example
|
|
|
|
@824
|
9 months |
mmckerns |
reconcile Lnorm and minkowski, add hamming distance;
fix Lnorm and …
|
|
|
|
@823
|
9 months |
mmckerns |
allow constraints.unique to take 'type' when pass min/max dict
|
|
|
|
@822
|
9 months |
mmckerns |
moved Lnorm to mystic.math.distance; fix: typo in mystic.math.mad
|
|
|
|
@821
|
9 months |
mmckerns |
normalize with prior behavior, with Ln-norm included; default mass from 1 …
|
|
|
|
@820
|
9 months |
mmckerns |
extend mystic.math.measures from L1 norm to Ln norm; set defailt mass=None
|
|
|
|
@819
|
9 months |
mmckerns |
use mystic.constraints.integers in integer_programming examples;
add docs …
|
|
|
|
@818
|
9 months |
mmckerns |
added ortools integer_programming example
|
|
|
|
@817
|
9 months |
mmckerns |
add ortools example least_square; copywright header for ortools examples
|
|
|
|
@816
|
10 months |
mmckerns |
add scipy.optimize sqlsp example
|
|
|
|
@815
|
10 months |
mmckerns |
added noisy data fitting example
|
|
|
|
@814
|
10 months |
mmckerns |
nudging support to dill-0.2.4; add missing methods to all in constraints
|
|
|
|
@813
|
10 months |
mmckerns |
add polynomial fitting example
|
|
|
|
@812
|
10 months |
mmckerns |
added root finding example
|
|
|
|
@811
|
10 months |
mmckerns |
added basic cvxopt lp and qp example
|
|
|
|
@810
|
10 months |
mmckerns |
better error messaging for bad input for plotting tools in scripts and …
|
|
|
|
@809
|
10 months |
mmckerns |
added functional interface for scenario plotter
|
|
|
|
@808
|
10 months |
mmckerns |
added function interface for hypercube_measures
|
|
|
|
@807
|
10 months |
mmckerns |
functional interface for support_convergence and support_hypercube
|
|
|
|
@806
|
10 months |
mmckerns |
enable function call for mystic_log_reader
|
|
|
|
@805
|
10 months |
mmckerns |
made model_plotter function more function-like
|
|
|
|
@804
|
10 months |
mmckerns |
add model_plotter as a callable function
|
|
|
|
@803
|
10 months |
mmckerns |
added some event-driven stats: median, mean, trimmed and windowed mean
|
|
|
|
@802
|
11 months |
mmckerns |
added integer programming tools and some examples from Google ORtools
|
|
|
|
@801
|
11 months |
mmckerns |
windows comparibility in getch, and pathos; added better read_import
|
|
|
|
@799
|
11 months |
mmckerns |
update to use pathos.pools; mirror with mystic.pools
|
|
|
|
@798
|
11 months |
mmckerns |
bumping version dependency to dill-0.2.3
|
|
|
|
@797
|
11 months |
mmckerns |
use nested mp/thread, not double nested mp -- otherwise, leaves a mess
|
|
|
|
@796
|
11 months |
mmckerns |
fix: fmin_powell call cost in Finalize when energy_history != None and …
|
|
|
|
@795
|
11 months |
mmckerns |
fix: Finalize for fmin_powell should call cost unless solver is live
|
|
|
|
@794
|
11 months |
mmckerns |
add _update_objective and _live, to queue state changes to cost, penalty, …
|
|
|
|
@793
|
11 months |
mmckerns |
add scale to wrap_function, enable wrap_function in diffev2 and ensemble
|
|
|
|
@792
|
11 months |
mmckerns |
for speed, use contains instead of get and has_key
|
|
|
|
@791
|
11 months |
mmckerns |
use len(stepmon) more uniformly; fix _fcalls for DESolvers;
generations …
|
|
|
|
@790
|
12 months |
mmckerns |
ensemble solvers add self.id to solver.id in self._map;
allow slice iter …
|
|
|
|
@789
|
13 months |
mmckerns |
impose_reweighted_* should only return weights
|
|
|
|
@788
|
13 months |
mmckerns |
added linear programming example
|
|
|
|
@787
|
15 months |
mmckerns |
remove return cost from SetObjective?; enable change cost and args in Step …
|
|
|
|
@786
|
15 months |
mmckerns |
fix: removed stray None attached to ExtraArgs? in SetObjective?
|
|
|
|
@785
|
15 months |
mmckerns |
refactor Solve is Step while not Terminated; radius, xtol, strategy are …
|
|
|
|
@784
|
15 months |
mmckerns |
added SolverInterrupt? as termination; pull _EARLYEXIT into …
|
|
|
|
@783
|
15 months |
mmckerns |
fix: add _SetEvaluationLimits to ensemble CheckTermination?;
Step now …
|
|
|
|
@782
|
15 months |
mmckerns |
moved _SetEvaluationLimits inside CheckTermination?;
moved _termination and …
|
|
|
|
@781
|
15 months |
mmckerns |
rename _bootstrap_decorate to _bootstrap_objective;
fix: diffev solver …
|
|
|
|
@780
|
16 months |
mmckerns |
use 'dev0' to be more PEP440 compliant
|
|
|
|
@779
|
16 months |
mmckerns |
add gamma and lgamma, update erf
|
|
|
|
@778
|
17 months |
mmckerns |
add constraints.integer to impose the set of integers on a function
|
|
|
|
@777
|
17 months |
mmckerns |
add std, impose_std, impose_reweighted_std to measures; with_std to …
|
|
|
|
@776
|
17 months |
mmckerns |
copyright updated to 2015; added to examples2
|
|
|
|
@775
|
17 months |
mmckerns |
add examples2 which contains several examples of penalties and constraints
|
|
|
|
@774
|
17 months |
mmckerns |
ticking up versions for dill depends
|
|
|
|
@773
|
18 months |
mmckerns |
provide default values for nbins and npts for LatticeSolver? and …
|
|
|
|
@772
|
18 months |
mmckerns |
fix: remove stray random.seed causing seeding of random number generation; …
|
|
|
|
@771
|
18 months |
mmckerns |
save allSolvers and monitors in ensemble solver; lattice solver default …
|
|
|
|
@770
|
18 months |
mmckerns |
using the faster numpy.product versus numpy.prod
|
|
|
|
@769
|
18 months |
mmckerns |
add ones and exact keyword options to math.grid.randomly_bin;
lattice …
|
|
|
|
@768
|
18 months |
mmckerns |
fix: impose_product should also work when prod is negative
|
|
|
|
@767
|
18 months |
mmckerns |
convert tuple of degenerate solved values to dict format in _solve_single
|
|
|
|
@766
|
19 months |
mmckerns |
moved corana, griewangk, and zimmermann to storn to fix pickling of …
|
|
|
|
@765
|
19 months |
mmckerns |
fix: logfile reader should not choke on inf or nan
|
|
|
|
@764
|
20 months |
mmckerns |
fix: ensemble solvers serializable by pp with mild rewrite to …
|
|
|
|
@763
|
20 months |
mmckerns |
use numpy.seterr to ignore nan in measures.normalize and in greater/less …
|
|
|
|
@762
|
20 months |
mmckerns |
enable disp and callback in ensemble solvers, better disp behavior for …
|
|
|
|


Tile trackers are getting an AirTags-like location alert feature
Source: iMore
What you need to know
- Tile is updating its Smart Alerts feature.
- Tile trackers will alert users when they are left behind.
- Apple is expected to have a similar feature in the works for AirTags.
If you ever wanted to see competition at its best, look no further than Tile scrambling to announce features to compete with a product that hasn't been confirmed yet. Apple is expected to announce its own trackers, AirTags, imminently and now Tile has announced a feature that goes head-to-head with them.
AirTags are thought to be able to alert users when they have been left behind, no matter where that might be. Tile's trackers offer something similar, but only for designated geofences. Whereas AirTags will be able to notify users if they leave a wallet behind regardless of location, Tile can only do that if it's an area that's been pre-configured. But not for long.
Tile has confirmed (via Engadget) that it is expanding its previous Smart Alerts feture to allow it to work anywhere, without the need for geofences.
Tile's trackers already help you find lost items, but now they might help you before the wave of panic hits. The company is relaunching Smart Alerts in beta to automatically warn when you've left a tracked item behind if it's been there for at least five minutes. If you rush out of the coffee shop without your bag, you'll ideally get an alert before you've reached your car. You'll need a Premium subscription ($30 per year or $3 per month), but it might be a small price to pay if you can't bear the thought of leaving a valuable item alone for more than a few minutes. The beta will be available in December.
Yes, you'll need to wait until December and yes, you'll need to use beta software in order for it to work. But it's coming, and that's a big deal.
Whether Apple's AirTags will require a similar subscription fee in order to function isn't yet clear, but $3 per month is nothing compared to the hassle a lost wallet or purse can cause.
Over to you, Apple.
We may earn a commission for purchases using our links. Learn more.


JavaScript
While Loops
A while loop establishes a condition that while true, will continue to loop through a specified block of code. The condition is enclosed in parentheses () and the block of code to be executed is enclosed in curly braces {}.
var i = 0
while (i < 10) {
console.log(i);
i++;
}
// 0
// 1
// 2
// 3
// 4
// 5
// 6
// 7
// 8
// 9
For Loops
A for loop contains three statements and a block of code to be executed. The first statement is executed once, and typically is used to establish a counter variable. The second statement contains the condition, which when met will execute the block of code. The third statement is executed after each iteration through the block of code. Each of the three statements are separated by commas, and are all enclosed in parentheses. The block of code to be executed is enclosed in curly braces.
for (i = 0; i < 10; i++) {
console.log(i);
}
// 0
// 1
// 2
// 3
// 4
// 5
// 6
// 7
// 8
// 9


Self-taught novice developer.
Experience in front-end and back-end technologies (JavaScript,
CSS,
HTML, Python, C, Node.js).
Plus other good stuff like frameworks (Express, Flask), APIs, and Git.
I hold a degree in Engineering Design, and have 20 years' professional experience in Mechanical Engineering, working with companies like Caterpillar, Ford, Dunlop, and GE.
Here's a few places I like...


If you’re familiar with Ruby you can think of Plug as Rack with a splash of Sinatra. It provides a specification for web application components and adapters for web servers. While not part of Elixir core, Plug is an official Elixir project.
In this lesson we’ll build a simple HTTP server from scratch using the PlugCowboy
Elixir library.
Cowboy is a simple HTTP server for Erlang and Plug will provide us with a connection adapter for that web server.
After we set up our minimal web application, we’ll learn about Plug’s router and how to use multiple plugs in a single web app.
Table of Contents
Prerequisites
This tutorial assumes you have Elixir 1.5 or higher, and mix
installed already.
We’ll start by creating a new OTP project, with a supervision tree.
$ mix new example --sup
$ cd example
We need our Elixir app to include a supervision tree because we will use a Supervisor to start up and run our Cowboy2 server.
Dependencies
Adding dependencies is a breeze with mix.
To use Plug as an adapter interface for the Cowboy2 webserver, we need to install the PlugCowboy
package:
Add the following to your mix.exs
file:
def deps do
[
{:plug_cowboy, "~> 2.0"},
]
end
At the command line, run the following mix task to pull in these new dependencies:
$ mix deps.get
The Plug Specification
In order to begin creating Plugs, we need to know, and adhere to, the Plug spec.
Thankfully for us, there are only two functions necessary: init/1
and call/2
.
Here’s a simple Plug that returns “Hello World!”:
defmodule Example.HelloWorldPlug do
import Plug.Conn
def init(options), do: options
def call(conn, _opts) do
conn
|> put_resp_content_type("text/plain")
|> send_resp(200, "Hello World!\n")
end
end
Save the file to lib/example/hello_world_plug.ex
.
The init/1
function is used to initialize our Plug’s options.
It is called by a supervision tree, which is explained in the next section.
For now, it’ll be an empty List that is ignored.
The value returned from init/1
will eventually be passed to call/2
as its second argument.
The call/2
function is called for every new request that comes in from the web server, Cowboy.
It receives a %Plug.Conn{}
connection struct as its first argument and is expected to return a %Plug.Conn{}
connection struct.
Configuring the Project’s Application Module
We need to tell our application to start up and supervise the Cowboy web server when the app starts up.
We’ll do so with the Plug.Cowboy.child_spec/1
function.
This function expects three options:
:scheme
- HTTP or HTTPS as an atom (:http
,:https
):plug
- The plug module to be used as the interface for the web server. You can specify a module name, likeMyPlug
, or a tuple of the module name and options{MyPlug, plug_opts}
, whereplug_opts
gets passed to your plug modulesinit/1
function.:options
- The server options. Should include the port number on which you want your server listening for requests.
Our lib/example/application.ex
file should implement the child spec in its start/2
function:
defmodule Example.Application do
use Application
require Logger
def start(_type, _args) do
children = [
{Plug.Cowboy, scheme: :http, plug: Example.HelloWorldPlug, options: [port: 8080]}
]
opts = [strategy: :one_for_one, name: Example.Supervisor]
Logger.info("Starting application...")
Supervisor.start_link(children, opts)
end
end
Note: We do not have to call child_spec
here, this function will be called by the supervisor starting this process.
We simply pass a tuple with the module that we want the child spec built for and then the three options needed.
This starts up a Cowboy2 server under our app’s supervision tree.
It starts Cowboy running under the HTTP scheme (you can also specify HTTPS), on the given port, 8080
, specifying the plug, Example.HelloWorldPlug
, as the interface for any incoming web requests.
Now we’re ready to run our app and send it some web requests! Notice that, because we generated an OTP app with the --sup
flag, our Example
application will start up automatically thanks to the application
function.
In mix.exs
you should see the following:
def application do
[
extra_applications: [:logger],
mod: {Example.Application, []}
]
end
We’re ready to try out this minimalistic, plug-based web server. On the command line, run:
$ mix run --no-halt
Once everything is finished compiling, and [info] Starting application...
appears, open a web
browser to http://<IP_ADDRESS>:8080.
It should display:
Hello World!
Plug.Router
For most applications, like a web site or REST API, you’ll want a router to route requests for different paths and HTTP verbs to different handlers.
Plug
provides a router to do that.
As we are about to see, we don’t need a framework like Sinatra in Elixir since we get that for free with Plug.
To start let’s create a file at lib/example/router.ex
and copy the following into it:
defmodule Example.Router do
use Plug.Router
plug :match
plug :dispatch
get "/" do
send_resp(conn, 200, "Welcome")
end
match _ do
send_resp(conn, 404, "Oops!")
end
end
This is a bare minimum Router but the code should be pretty self-explanatory.
We’ve included some macros through use Plug.Router
and then set up two of the built-in Plugs: :match
and :dispatch
.
There are two defined routes, one for handling GET requests to the root and the second for matching all other requests so we can return a 404 message.
Back in lib/example/application.ex
, we need to add Example.Router
into the web server supervisor tree.
Swap out the Example.HelloWorldPlug
plug with the new router:
def start(_type, _args) do
children = [
{Plug.Cowboy, scheme: :http, plug: Example.Router, options: [port: 8080]}
]
opts = [strategy: :one_for_one, name: Example.Supervisor]
Logger.info("Starting application...")
Supervisor.start_link(children, opts)
end
Start the server again, stopping the previous one if it’s running (press Ctrl+C
twice).
Now in a web browser, go to http://<IP_ADDRESS>:8080.
It should output Welcome
.
Then, go to http://<IP_ADDRESS>:8080/waldo, or any other path.
It should output Oops!
with a 404 response.
Adding Another Plug
It is common to use more than one plug in a given web application, each of which is dedicated to its own responsibility. For example, we might have a plug that handles routing, a plug that validates incoming web requests, a plug that authenticates incoming requests, etc. In this section, we’ll define a plug to verify incoming requests parameters and we’ll teach our application to use both of our plugs–the router and the validation plug.
We want to create a Plug that verifies whether or not the request has some set of required parameters.
By implementing our validation in a Plug we can be assured that only valid requests will make it through to our application.
We will expect our Plug to be initialized with two options: :paths
and :fields
.
These will represent the paths we apply our logic to and which fields to require.
Note: Plugs are applied to all requests which is why we will handle filtering requests and applying our logic to only a subset of them. To ignore a request we simply pass the connection through.
We’ll start by looking at our finished Plug and then discuss how it works.
We’ll create it at lib/example/plug/verify_request.ex
:
defmodule Example.Plug.VerifyRequest do
defmodule IncompleteRequestError do
@moduledoc """
Error raised when a required field is missing.
"""
defexception message: ""
end
def init(options), do: options
def call(%Plug.Conn{request_path: path} = conn, opts) do
if path in opts[:paths], do: verify_request!(conn.params, opts[:fields])
conn
end
defp verify_request!(params, fields) do
verified =
params
|> Map.keys()
|> contains_fields?(fields)
unless verified, do: raise(IncompleteRequestError)
end
defp contains_fields?(keys, fields), do: Enum.all?(fields, &(&1 in keys))
end
The first thing to note is we have defined a new exception IncompleteRequestError
which we’ll raise in the event of an invalid request.
The second portion of our Plug is the call/2
function.
This is where we decide whether or not to apply our verification logic.
Only when the request’s path is contained in our :paths
option will we call verify_request!/2
.
The last portion of our plug is the private function verify_request!/2
which verifies whether the required :fields
are all present.
In the event that some are missing, we raise IncompleteRequestError
.
We’ve set up our Plug to verify that all requests to /upload
include both "content"
and "mimetype"
.
Only then will the route code be executed.
Next, we need to tell the router about the new Plug.
Edit lib/example/router.ex
and make the following changes:
defmodule Example.Router do
use Plug.Router
alias Example.Plug.VerifyRequest
plug Plug.Parsers, parsers: [:urlencoded, :multipart]
plug VerifyRequest, fields: ["content", "mimetype"], paths: ["/upload"]
plug :match
plug :dispatch
get "/" do
send_resp(conn, 200, "Welcome")
end
get "/upload" do
send_resp(conn, 201, "Uploaded")
end
match _ do
send_resp(conn, 404, "Oops!")
end
end
With this code, we are telling our application to send incoming requests through the VerifyRequest
plug before running through the code in the router.
Via the function call:
plug VerifyRequest, fields: ["content", "mimetype"], paths: ["/upload"]
We automatically invoke VerifyRequest.init(fields: ["content", "mimetype"], paths: ["/upload"])
.
This in turn passes the given options to the VerifyRequest.call(conn, opts)
function.
Let’s take a look at this plug in action! Go ahead and crash your local server (remember, that’s done by pressing ctrl + c
twice).
Then restart the server (mix run --no-halt
).
Now go to http://<IP_ADDRESS>:8080/upload in your browser and you’ll see that the page simply isn’t working. You’ll just see a default error page provided by your browser.
Now let’s add our required params by going to http://<IP_ADDRESS>:8080/upload?content=thing1&mimetype=thing2. Now we should see our ‘Uploaded’ message.
It’s not great that when we raise an error, we don’t get any page. We’ll look at how to handle errors with plugs later.
Making The HTTP Port Configurable
Back when we defined the Example
module and application, the HTTP port was hard-coded in the module.
It’s considered good practice to make the port configurable by putting it in a configuration file.
We’ll set an application environment variable in config/config.exs
use Mix.Config
config :example, cowboy_port: 8080
Next we need to update lib/example/application.ex
read the port configuration value, and pass it to Cowboy.
We’ll define a private function to wrap up that responsibility
defmodule Example.Application do
use Application
require Logger
def start(_type, _args) do
children = [
{Plug.Cowboy, scheme: :http, plug: Example.Router, options: [port: cowboy_port()]}
]
opts = [strategy: :one_for_one, name: Example.Supervisor]
Logger.info("Starting application...")
Supervisor.start_link(children, opts)
end
defp cowboy_port, do: Application.get_env(:example, :cowboy_port, 8080)
end
The third argument of Application.get_env
is the default value, for when the configuration directive is undefined.
Now to run our application we can use:
$ mix run --no-halt
Testing a Plug
Testing Plugs is pretty straightforward thanks to Plug.Test
.
It includes a number of convenience functions to make testing easy.
Write the following test to test/example/router_test.exs
:
defmodule Example.RouterTest do
use ExUnit.Case
use Plug.Test
alias Example.Router
@content "Hi!"
@mimetype "text/html"
@opts Router.init([])
test "returns welcome" do
conn =
:get
|> conn("/", "")
|> Router.call(@opts)
assert conn.state == :sent
assert conn.status == 200
end
test "returns uploaded" do
conn =
:get
|> conn("/upload?content=#{@content}&mimetype=#{@mimetype}")
|> Router.call(@opts)
assert conn.state == :sent
assert conn.status == 201
end
test "returns 404" do
conn =
:get
|> conn("/missing", "")
|> Router.call(@opts)
assert conn.state == :sent
assert conn.status == 404
end
end
Run it with this:
$ mix test test/example/router_test.exs
Plug.ErrorHandler
We noticed earlier that when we went to http://<IP_ADDRESS>:8080/upload without the expected parameters, we didn’t get a friendly error page or a sensible HTTP status - just our browser’s default error page with a 500 Internal Server Error
.
Let’s fix that now by adding in Plug.ErrorHandler
.
First, open up lib/example/router.ex
and then write the following to that file.
defmodule Example.Router do
use Plug.Router
use Plug.ErrorHandler
alias Example.Plug.VerifyRequest
plug Plug.Parsers, parsers: [:urlencoded, :multipart]
plug VerifyRequest, fields: ["content", "mimetype"], paths: ["/upload"]
plug :match
plug :dispatch
get "/" do
send_resp(conn, 200, "Welcome")
end
get "/upload" do
send_resp(conn, 201, "Uploaded")
end
match _ do
send_resp(conn, 404, "Oops!")
end
defp handle_errors(conn, %{kind: kind, reason: reason, stack: stack}) do
IO.inspect(kind, label: :kind)
IO.inspect(reason, label: :reason)
IO.inspect(stack, label: :stack)
send_resp(conn, conn.status, "Something went wrong")
end
end
You’ll notice that at the top, we are now adding use Plug.ErrorHandler
.
This plug catches any error, and then looks for a function handle_errors/2
to call in order to handle it.
handle_errors/2
just needs to accept the conn
as the first argument and then a map with three items (:kind
, :reason
, and :stack
) as the second.
You can see we’ve defined a very simple handle_errors/2
function to see what’s going on. Let’s stop and restart our app again to see how this works!
Now, when you navigate to http://<IP_ADDRESS>:8080/upload, you’ll see a friendly error message.
If you look in your terminal, you’ll see something like the following:
kind: :error
reason: %Example.Plug.VerifyRequest.IncompleteRequestError{message: ""}
stack: [
{Example.Plug.VerifyRequest, :verify_request!, 2,
[file: 'lib/example/plug/verify_request.ex', line: 23]},
{Example.Plug.VerifyRequest, :call, 2,
[file: 'lib/example/plug/verify_request.ex', line: 13]},
{Example.Router, :plug_builder_call, 2,
[file: 'lib/example/router.ex', line: 1]},
{Example.Router, :call, 2, [file: 'lib/plug/error_handler.ex', line: 64]},
{Plug.Cowboy.Handler, :init, 2,
[file: 'lib/plug/cowboy/handler.ex', line: 12]},
{:cowboy_handler, :execute, 2,
[
file: '/path/to/project/example/deps/cowboy/src/cowboy_handler.erl',
line: 41
]},
{:cowboy_stream_h, :execute, 3,
[
file: '/path/to/project/example/deps/cowboy/src/cowboy_stream_h.erl',
line: 293
]},
{:cowboy_stream_h, :request_process, 3,
[
file: '/path/to/project/example/deps/cowboy/src/cowboy_stream_h.erl',
line: 271
]}
]
At the moment, we’re still sending a 500 Internal Server Error
back. We can customise the status code by adding a :plug_status
field to our exception. Open up lib/example/plug/verify_request.ex
and add the following:
defmodule IncompleteRequestError do
defexception message: "", plug_status: 400
end
Restart your server and refresh, and now you’ll get back a 400 Bad Request
.
This plug makes it really easy to catch the useful information needed for developers to fix issues, while being able to also give our end user a nice page so it doesn’t look like our app totally blew up!
Available Plugs
There are a number of Plugs available out-of-the-box. The complete list can be found in the Plug docs here.
Caught a mistake or want to contribute to the lesson? Edit this page on GitHub!


To get the exchange hours, use the Exchange.Hours
property on a Security
object.
var securityExchangeHours = Securities["SPY"].Exchange.Hours;
security_exchange_hours = self.Securities["SPY"].Exchange.Hours
The preceding code snippet returns a SecurityExchangeHours
object, which has the following attributes:
To check if the exchange is open at a specific time, call the IsOpen
method.
// Check if the exchange is open at a specific time var isOpenNow = securityExchangeHours.IsOpen(Time, extendedMarketHours: false); // Check if the exchange is open at any point in time over a specific interval var isOpen = securityExchangeHours.IsOpen(Time, Time.AddDays(1), extendedMarketHours: false);
# Check if the exchange is open at a specific time is_open_now = security_exchange_hours.IsOpen(self.Time, extendedMarketHours=False) # Check if the exchange is open at any point in time over a specific interval is_open = security_exchange_hours.IsOpen(self.Time, self.Time + timedelta(days=1), extendedMarketHours=False)
To check if the exchange is open on a specific date, call the IsDateOpen
method.
var isOpen = securityExchangeHours.IsDateOpen(Time);
is_open = security_exchange_hours.IsDateOpen(self.Time)
To get the next market open time, call the GetNextMarketOpen
method.
var marketOpenTime = securityExchangeHours.GetNextMarketOpen(Time, extendedMarketHours: false);
market_open_time = security_exchange_hours.GetNextMarketOpen(self.Time, extendedMarketHours=False)
To get the next market close time, call the GetNextMarketClose
method.
var marketCloseTime = securityExchangeHours.GetNextMarketClose(Time, extendedMarketHours: false);
market_close_time = security_exchange_hours.GetNextMarketClose(self.Time, extendedMarketHours=False)
To get the previous trading day, call the GetPreviousTradingDay
method.
var day = securityExchangeHours.GetPreviousTradingDay(Time);
day = security_exchange_hours.GetPreviousTradingDay(self.Time)
To get the next trading day, call the GetNextTradingDay
method.
var day = securityExchangeHours.GetNextTradingDay(Time);
day = security_exchange_hours.GetNextTradingDay(self.Time)


Checkout
Shopping>
Payment Method
>Confirmation
Wallet
Ending in 1234
Ending in 2222
Ending in 1111
New Card
Add card to wallet
Continue


|
Perl Weekly
Issue #223 - 2015-11-02 - Two perl books in the news!
latest | archive | by Neil Bowers
|
|
It's not often we get to mention Perl books here, and this week there are two stories related to Perl books: the 4th edition of the classic Modern Perl has been published by the Pragmatic Bookshelf, and the Dancer core team are running a kickstart campaign to fund production of a Dancer book.
Perl 6 is now officially in beta!
Neil
|
|
|
CPAN News
|
|
|
|
|
Net::SFTP::Foreign in taint mode
by E. Choroba (CHOROBA)
This month Mr E was looking into a tainting issue. He didn't quite get to the bottom of it, but describes what he did learn. Can you help him, so he gets to do another PR on his assigned dist?
|
|
Perl 5
|
|
|
|
|
|
|
Perl 6
|
2015.44 Niceville
The main news this week was the official release of Perl 6 beta. Christmas is getting closer!
|
|
|
|
Web development
|
|
|
|
|
Dancer Book kickstarter
by Alexis Sukrieh (SUKRIA)
The Dancer core team are working on a book, and they're using Kickstarter to help fund that effort. 10 euros will get you an electronic version of the book, and 40 euros will get you a print copy of the book.
|
|
|
|
|
|
Sponsors
|
|
|
Testing
|
|
|
|
|
Grants
|
|
|
Misc
|
|
|
|
|
Not Perl
|
Write like you talk
by Paul Graham
Simple but good advice from the founder of Y-Combinator: when writing (he's talking mainly about blogs, but I think this applies to documentation and elsewhere), you should write like you talk.
|
|
|
|
The git's guide to git: Bisect
A short tutorial on how git bisect can help you track down bugs introduced at some unknown point in the (hopefully recent) past.
|
|
Perl Maven articles
|
|
|
24 Programming Exercises
There are now 24 beginner level entries in the Programming Exercises. In case you know someone who wants to learn Perl, these can be useful.
|
|
Events
|
|
|
You know, you could get the Perl Weekly right in your mailbox. Every Week. Free of charge!
|


↩ Go back { Codebeats } Blogpost Editor Title Upload blogpost images: Blog post featured image Featured image Tags Blogpost summary Blog post image gallery Published ↩ Go back


To make a full height section, the html and body tags must first be full height. A valid example html document is:
<% code do %>This example can be seen at full-height-example.html
Also, the first section of this page uses this technique. It also employs a table layout for vertical centering.
To constrain the width to reasonable size, we have containers to
set a max-width. The container width is set with the
--container-width
variable.


By default, your information associated with this report, will be kept anonymous, but if you'll like to make it public, kindly specify it.