When, Why and How to Use Classes
5/9/15
The fact that Ruby is capable of class instantiation makes it an object oriented program. Programmers like to use classes because as the complexity and density of their code becomes ever greater, there will be a growing need for a more structered approach. An approach that allows for fluidy in code and eliminates any unneccessary repitions as well. When we create a class we are binding methods to objects or in other words we are defining the attriubutes a certain class has. For example when we want to create a car class we start by defining function or methods that are inherent to all cars. Furthermore these functions carry meaning that act as parameters and contribute to the functionality of the class. With the advent of object oriented programming came ease in reading code and helping limit bugs.
In order to create a class we must start by defining a class in our dode and follow this definition with a nested end. Within our class we can put any number of methods to define how we create an instance of the class or an object. Typically when looking at classes the first method is an initialize method, which essentiallydefines how you create an object in the first place. It is important to note that when we are defining methods and thus assigning meaning to variables we should be consistent on whether it is a global or local variable. An instance variable looks like this, "@variable = ", and can be called in various other methods within the class. Whenever we call on this variable we must type @variable.
When we define a method within a class we are no calling that method. This is only possible when we create an instance of a class outside of the nested methods within the class. We do this by defining a variable and assigning it to an instance of the class or... "variable = Class.new(parameter)". Once we have created this variable object we can finally use these methods to see how this instance variable behaves under certain conditions and parameters.


While interning with The Pachamama Alliance I was responsible for selecting stories from the media that touched on environmental themes, then constructing blog posts that tied them to Pachamama’s social mission of environmental protection and preservation through support of indigenous groups.
Each post was written with the intention of attracting new members to the organization, or new participants to their semi-annual trip to the rain forests of Ecuador. Included in each article were key words selected to optimize the posts’s placement in related search results on popular search engines.
The recent April Fool's Day has once again passed giving us all a renewed appreciation for the friendly sketpics in out midst; those who aren't quite as gullible as the rest and approach each scenario with a healthy sense of disbelief. Those two qualities are traists we could all do with a little more of as we move on through the rest of the year.
The benefit skepticism provides is in allowing an individual or group a buffer between acknowledging a claim and believing one. This buffer can then be applied to any topic, large or small, and teh result is a clearer picture of reality, like the reality of how many new jobs and KXL pipeline will provide. In terms of the environment, this skill has been helpful in determining fact from fiction.
When bolstering our own healthy skepticism, it is important to consider the history of any person(s) or group making bold claims, as their credibility is dependent upon its validity. In other words, we should pause to consider how their previous assertions have or have not aligned with the actual outcome of events, such as the case with TransCanada and Keystone Pipeline I. The more erroneous claims that accumulate, the further their credibility falls. It is important to keep that standard in mind as we entertain new promises.
Our ability to recognize a snake oil salesman in TransCanada is what allows us the chance to avoid future calamity, but only if we remember to apply it. As we continue through the remainder of the year, let April Fools’ Day remind us to employ our own healthy skepticism with a measured but constant frequency.
A growing concern over the availability of fresh water has lead Chinese officials to a seemingly counterintuitive, if not uncommon, solution: converting salt water to fresh water.
The process, known as desalination, can occur through one of several methods, all resulting in the removal of salt from saltwater. In China, officials are hoping this will help solve the growing water crisis in a small village in the mountains of west Beijing.
According to a BBC article, in the village of Nanxinzhuang tap water is available for just four hours a day due to the limited supply. Since the 1980’s the village has faced an increasing water shortage that has put the region “on par globally with chronically dry countries like Syria and Jordan.”
To combat this growing epidemic, the Chinese government constructed a desalination plant that also functions as a power generator. The new plant, which began limited operations in 2010, is located outside of Tianjin in what is known as the Binhai New Area, an area home to many growing industrial plants.
Opponents of the plant, and desalination in general, see the process as a temporary solution that doesn’t address the real problem. Instead, they argue, the plant simply consumes more energy while encouraging more consumption, rather than preservation.
But the plant itself is quick to point out its own green credentials. The desalination process uses the excess heat from the power plant, effectively recycling the energy. They also convert the highly-concentrated salt water, a by-product of the distillation process, into industrial grade salt.
IDE Technologies, the company behind the new distillation plant in China, is also behind the new plant currently under construction in Carlsbad, CA. The 204,412 cubic meter seawater desalination plan, known as the Carlsbad Desalination Project, will be designed by the IDE subsidiary, IDE Americas, and administered by Poseidon Resources. Upon completion, it will be the largest desalination plant in the United States.
The plan drew criticism from environmental groups throughout the planning and approval stages, who cited the cost and threats to marine life, before finally being permitted to break ground on the project. Despite these objections, the $954 million seawater desalination plan is now underway and is expected to be fully operational by 2016.


DIRT-FINDER
Home
Have-Dirt/Need-Dirt
Map
About
Contact
LogOut
Sign-In
Sign-Up
Sign In
Don't Have an Account?
Sign-Up


$var title: SPQReL $var jsfiles:
The team is competing in the RoboCup@Home Social Standard Platform League since 2017 (where it came third place), and is also participating to the European Robotics League Service Robots. The team is formed by two research groups:
SPQReL stems from the pseudo-Latin term "Socialis robot PopulusQue Romanus et Lindensis" that can be translated as "Social robot and people from Rome and Lincoln", referring to the Roman city of Lindum (which is now Lincoln).


CONNECTIVE v RxJS
CONNECTIVE is NOT an alternative to
RxJS.
It is designed to complement what
RxJS offers by providing a different model of reactive flows more suitable to larger and more complex
cases. This also means that you cannot fully utilize
CONNECTIVE without
using it in tandem with
RxJS.
CONNECTIVE complements
RxJS in three areas:
- It allows description of a reactive flow in any order,
- It provides a different model of reactive flows,
- It provides standard abstractions for flow re-use.
Deferred construction
In
RxJS, each observable is created by combining and transforming some already instantiated observables.
This limits description of your flow to a strict sequential order, which creates issues when you have large flows
expanding over multiple files/modules.
CONNECTIVE on the other hand allows describing the flow in any order, allowing you to organise large flows
into multiple modules seamlessly.
For example, imagine one module describing the beginning and the end of a flow, while multiple others would
connect this beginning and the end in various manners. A real-life example of this would be
a module to feed incoming http requests to the flow, and then create proper http responses and send them accordingly.
// Main Module
let flowStart = someSource().to(...).to(...);
let flowEnd = pin();
flowEnd.to(...);
export { flowStart, flowEnd };
// Other Modules
import { flowStart, flowEnd } from './main';
flowStart.to(...).to(...).to(flowEnd);
// Main Module
let flowStart$ = Observable().pipe(...);
let middleMen = [];
export function fillInTheMiddle(fillerFunc) {
middleMen.push(fillerFunc(flowStart));
}
export function flowEnd() {
return merge(...middleMen).pipe(...);
}
// Other Modules
import { fillInTheMiddle } from './main';
fillInTheMiddle(flowStart$ => {
return flowStart$.pipe(...)
});
Modelling the flow
In
RxJS, a reactive flow is modelled as a sequence of mergers and transformations of
some observables. This leads to the famous
observable sequence model, which despite its name is mostly
a series of related inverse trees.
However, with increase of complexity of the reactive flows, they typically take on the shape of
a generic directed graph. This disparity can lead to extra overhead code and reduced readability.
This is why in
CONNECTIVE reactive flows are modelled exactly as directed graphs, to keep
the model of the flow and the code describing it as close as possible.
a.to(X).to(Y)
.to(b, c).serialTo(d, e)
.to(Z)
let a0 = a.pipe(X, Y);
let Z = merge(
a0.pipe(b, d),
a0.pipe(c, e)
).pipe(...);
Flow re-use
When reactive flows grow in size and complexity, there is an absolute necessity for a standard abstraction
facilitating re-use of flows.
RxJS does not offer any such abstraction beyond custom pipeable operators,
which due to them being (typically) transformations of only a single observable to another single observable
limits their applicability as such an abstraction (its like if functions could only be defined with one parameter).
CONNECTIVE offers a much more widely applicable abstraction for re-use:
Agent, which
models any re-usable part of a flow as a black box with some incoming pins and some outgoing pins. It also offers
a really simple and straight-forward mechanism to build custom agents in form of
compositions, which are agents whose internals are also partial reactive flows.
export const myComp = composition(() => {
let a = pin(), b = pin(); //--> inputs
let c = pin(), d = pin(); //--> outputs
... //--> connect stuff together
return [{ a, b }, { c, d }];
});
import { myComp } from './wherever';
group(x, y).serialTo(myComp()).to(z);
export function myThing(a: Observable, b: Observable) {
let c: Observable, d: Observable; //--> outputs
... //--> build the outputs out of the inputs
return [c, d];
}
import { myThing } from './wherever';
let [z1, z2] = myThing(x, y);
let z = merge(z1, z2).pipe(...);
A more complete example
The following example puts all the aforementioned issues on display in a more practical scenario:
/*** click-counter.ts ***/
import { composition, pin, map, pipe, state, check, expr, sampler } from '@connectv/core';
import { debounceTime, delay } from 'rxjs/operators';
export const clickCounter = composition(track => {
let click = pin(), reset = pin();
let out = pin(), single = pin(), multi = pin();
let count = state(0); track(count);
let incr = expr(x => x + 1), docheck = sampler();
count.to(incr).to(count).to(out, docheck);
reset.to(map(() => 0)).to(count);
docheck.to(check(x => x > 1)).serialTo(multi, single);
click.to(incr.control);
click.to(pipe(debounceTime(200)))
.to(reset.from(pipe(delay(1))), docheck.control);
return [{ click, reset }, { out, single, multi }];
});
/*** index.ts ***/
import { wrap, map, filter } from '@connectv/core';
import { fromEvent } from 'rxjs';
import { clickCounter } from './click-counter';
let p = document.getElementById('p');
wrap(fromEvent(document, 'click')).serialTo(clickCounter())
.serialTo(filter(x => x > 0), map(() => 'single click'), map(() => 'MULTI CLICK!'))
.subscribe(v => p.innerHTML = v);
/*** click-counter.ts ***/
import { Observable, BehaviorSubject, merge, NEVER, defer } from 'rxjs';
import { map, sample, tap, debounceTime, delay, mapTo,
partition, distinctUntilChanged} from 'rxjs/operators';
export function clickCounter(clickObs$, resetObs$?, track?) {
let count = new BehaviorSubject(0);
let timer = clickObs$.pipe(debounceTime(200));
let [multi, single] = count.pipe(
sample(timer),
//@ts-ignore
partition(x => x > 1)
);
let deferred = false;
let sub;
let _c = defer(() => {
if (!deferred) {
sub = merge(
count.pipe(sample(clickObs$), map(x => x + 1)),
count.pipe(sample(timer), delay(1), mapTo(0)),
(resetObs$ || NEVER).pipe(mapTo(0))
).subscribe(count);
deferred = true;
}
return count;
}).pipe(distinctUntilChanged());
if (track) track(sub);
return [_c, single, multi];
}
/*** index.ts ***/
import { fromEvent, merge } from 'rxjs';
import { filter, mapTo } from 'rxjs/operators';
import { clickCounter } from './click-counter';
let p = document.getElementById('p');
let [count$, single$, multi$]
= clickCounter(fromEvent(document, 'click'));
merge(
count$.pipe(filter(x => x > 0)),
single$.pipe(mapTo('single click')),
multi$.pipe(mapTo('MULTI CLICK!'))
).subscribe(v => p.innerHTML = `${v}`);
Although the differences between
CONNECTIVE and
RxJS get more and more pronounced
with increase in size and complexity of flows, the difference is already evident in simpler cases
still matching the essential criteria outlined above. It is also evident how these issues would
cause increased amounts of code-overhead and noise the bigger the project becomes.
NOTICE: what is outlined in this example is obviously NOT the most efficient way of counting
clicks and distinguish single clicks from multi-clicks, neither in
RxJS nor in
CONNECTIVE.
It is just written as such to highlight the aforementioned phenomena.


--- layout: default ---
Bitcoin Restaurants is here to help spread the adoption of Bitcoin. We want to help promote stores that are helping push forward Bitcoin usage.


Great Expectations
by Charles Dickens
Chapter 14
Additional Information
- Year Published: 1861
- Language: English
- Country of Origin: England
- Source: Dickens, Charles. (1861). Great Expectations. London; Chapman and Hall.
-
Readability:
- Flesch–Kincaid Level: 8.2
- Word Count: 849
- Genre: Realism
- Keywords: remaining in the past, social class distinction, social class distinction remaining in the past, unrequited love
- ✎ Cite This
Downloads
It is a most miserable thing to feel ashamed of home. There may be black ingratitude in the thing, and the punishment may be retributive and well deserved; but, that it is a miserable thing, I can testify.
Home had never been a very pleasant place to me, because of my sister’s temper. But, Joe had sanctified it, and I had believed in it. I had believed in the best parlour as a most elegant saloon; I had believed in the front door, as a mysterious portal of the Temple of State whose solemn opening was attended with a sacrifice of roast fowls; I had believed in the kitchen as a chaste though not magnificent apartment; I had believed in the forge as the glowing road to manhood and independence. Within a single year, all this was changed. Now, it was all coarse and common, and I would not have had Miss Havisham and Estella see it on any account.
How much of my ungracious condition of mind may have been my own fault, how much Miss Havisham’s, how much my sister’s, is now of no moment to me or to any one. The change was made in me; the thing was done. Well or ill done, excusably or inexcusably, it was done.
Once, it had seemed to me that when I should at last roll up my shirt-sleeves and go into the forge, Joe’s ‘prentice, I should be distinguished and happy. Now the reality was in my hold, I only felt that I was dusty with the dust of small coal, and that I had a weight upon my daily remembrance to which the anvil was a feather. There have been occasions in my later life (I suppose as in most lives) when I have felt for a time as if a thick curtain had fallen on all its interest and romance, to shut me out from anything save dull endurance any more. Never has that curtain dropped so heavy and blank, as when my way in life lay stretched out straight before me through the newly-entered road of apprenticeship to Joe.
I remember that at a later period of my “time,” I used to stand about the churchyard on Sunday evenings when night was falling, comparing my own perspective with the windy marsh view, and making out some likeness between them by thinking how flat and low both were, and how on both there came an unknown way and a dark mist and then the sea. I was quite as dejected on the first working-day of my apprenticeship as in that after-time; but I am glad to know that I never breathed a murmur to Joe while my indentures lasted. It is about the only thing I am glad to know of myself in that connection.
For, though it includes what I proceed to add, all the merit of what I proceed to add was Joe’s. It was not because I was faithful, but because Joe was faithful, that I never ran away and went for a soldier or a sailor. It was not because I had a strong sense of the virtue of industry, but because Joe had a strong sense of the virtue of industry, that I worked with tolerable zeal against the grain. It is not possible to know how far the influence of any amiable honest-hearted duty-doing man flies out into the world; but it is very possible to know how it has touched one’s self in going by, and I know right well, that any good that intermixed itself with my apprenticeship came of plain contented Joe, and not of restlessly aspiring discontented me.
What I wanted, who can say? How can I say, when I never knew? What I dreaded was, that in some unlucky hour I, being at my grimiest and commonest, should lift up my eyes and see Estella looking in at one of the wooden windows of the forge. I was haunted by the fear that she would, sooner or later, find me out, with a black face and hands, doing the coarsest part of my work, and would exult over me and despise me. Often after dark, when I was pulling the bellows for Joe, and we were singing Old Clem, and when the thought how we used to sing it at Miss Havisham’s would seem to show me Estella’s face in the fire, with her pretty hair fluttering in the wind and her eyes scorning me,—often at such a time I would look towards those panels of black night in the wall which the wooden windows then were, and would fancy that I saw her just drawing her face away, and would believe that she had come at last.
After that, when we went in to supper, the place and the meal would have a more homely look than ever, and I would feel more ashamed of home than ever, in my own ungracious breast.


This is just a regular paragraph.
This is another regular paragraph.
Here is an image:
Here are two images:
This is a blockquote This is still a blockquote This is an H2 inside a blockquote


“Hello? It’s me, Olivia.”
Born and raised in the Bay Area, I graduated from San Jose State University with a B.A. in Design Studies with a concentration in Graphic Design. I’m experienced in creating print, logo, vector illustrations, and most recently UI/UX design. I also enjoy other creative mediums such as illustration (digital and traditional) and taking nice photos of people, places, and things.
Most recently, I worked as a UX Design Intern at Niantic.
I’m also a budding tea connoisseur. Slide into my email if you want to collaborate or chat over some hot leaf juice. 🍵 Coffee is cool, too! ☕
Skills: UX, Graphic Design, Photography, Illustration (digital and traditional), and perfecting my island on Animal Crossing.


A notoriously bearish hedge-fund manager is more convinced than ever that a crash is coming — and has pushed his short bets to a record
by finanzen.net GmbH- Russell Clark increased Horseman Global Fund's net short position to 111% of gross assets, Bloomberg reported on Tuesday, citing an investor letter.
- The bearish fund manager is betting against a historically long bull market at a time when central-bank rate cuts and tempered trade-war tensions have pushed stocks to record highs.
- Horseman is eyeing its worst yearly loss yet, with its short-heavy strategy yielding a 27% loss on a year-to-date basis, according to Bloomberg.
- The manager told investors in October that he "can see all the problems with the markets" and that the only issue "is timing."
- Visit Business Insider's homepage for more stories.
The hedge-fund manager Russell Clark stands to win big from a market crash. But record-setting stocks haven't been kind to his bearish investments.
The Horseman Global Fund manager raised his portfolio's net short position to 111% of gross assets, Bloomberg reported on Tuesday, citing an investor letter sent Monday. Clark has been regularly shorting stocks since 2012, according to Bloomberg.
The London-based manager is actively betting against the longest bull run in history, as central-bank rate cuts and trade-war optimism fuel new market peaks. The S&P 500, the Nasdaq Composite, and the Dow Jones Industrial Average all closed at record highs on Monday, bucking summer fears of an economic recession.
Bearish investors are now faced with two options: double down on a market contraction, or exit before rising stocks further damage their positions. Clark says that the market exhibits several signs of a crash coming and that bearish investors simply need to be patient.
"I can see all the problems with the markets, and I can see how they will unwind, and how we will make money from it," the fund manager told Horseman clients in October. "The issue is timing."
Up to this point, Clark has been a few years early to the bear-market party. His fund tumbled 24% in 2016 after years of double-digit gains, according to Bloomberg. Horseman is on track for its biggest annual loss yet, having lost 27% year-to-date. The fund's assets have fallen to $263 million from $1.7 billion in 2015, Bloomberg reported.
Despite Horseman's losses and record-high stock indexes, many of the world's richest have sided with Clark in his economic pessimism. Most of the wealthiest investors anticipate a "significant" market slump in 2020, a UBS Global Wealth Management survey published November 12 found. Of the 3,400 investors surveyed, 25% of their average assets were in cash, and roughly 60% of respondents said they'd consider increasing their cash reserves.
"Business fundamentals that once were the backbone of how investors think about the market are now being usurped by a confusing geopolitical landscape. As a result, investors are now less likely to act," UBS said.
Markets could also be driven lower by the simple theory of economic cycles, Clark said in an October letter, according to Bloomberg. The record-long expansion has led many to grow concerned about an upcoming contraction, and the manager's strategy could be a rare winner should a recession tear into global markets.
"The investing world at large is about to discover the pitfalls of levered long investing at the end of the cycle," Clark wrote in October. "Exciting times ahead."
Now read more markets coverage from Markets Insider and Business Insider:
Kohl's plummets after slashing its profit forecast for the 2nd time this year


|
Bitstream Interpretation Library (BIL)
0.1
|
Extracts a list of correlation units from a XDL design. More...
#include <correlation/xdlextraction/XDLExtractor.hpp>
Public Member Functions | |
| XDLExtractor (const Design &design, const Device &device) | |
| Constructs a XDLExtractor instance. | |
| void | getTileTypeUnits (CorrelationUnits &units, TileIndices &tileIndices, size_t tileTypeIndex) |
| Extracts a list of correlation units. |
Extracts a list of correlation units from a XDL design.
This class collects used tiles of a given type in a XDL Design, and fills a list of correlation units with their data (active PIPs).
Todo: Should also add the state of the primitive sites' configuration options to the correlation units.
Definition at line 35 of file XDLExtractor.hpp.
Constructs a XDLExtractor instance.
| design | The design from which to extract. |
| device | The device the design is for. |
Definition at line 13 of file XDLExtractor.cpp.
| void XDLExtractor::getTileTypeUnits | ( | CorrelationUnits & | units, |
| TileIndices & | tileIndices, | ||
| size_t | tileTypeIndex | ||
| ) |
Extracts a list of correlation units.
| units | The correlation unit list to be filled. |
| tileIndices | Tile indices of the correlation units. |
| tileTypeIndex | Tile type index of tiles to collect. |
Definition at line 21 of file XDLExtractor.cpp.


Tic Tac Toe!
{{ cell.value }}
{{ cell.value }}
{{ cell.value }}
Current Player: {{ currentPlayer }}
Player {{ currentPlayer }} won!
Cat
New Game


I feel I’ve totally forgotten all about assembly, and I was curious anyway about how Haskell differed fundamentally in its basic code generation, so I decided to contrast a basic example against C++.
The choice of C++ here is arbitrary; it just happens to be something I’ve used most often, and pretty much all the time for the last decade or so. If it ends up being interesting, I can add similar comparisons for other languages.
The C++ version:
#include <iostream>
int main(int argc, char** argv) {
std::cout << "Hello world\n\n";
}
The Haskell version:
main = putStrLn "Hello World"
Difference in size of generated binary:
-rwxr-x--- 1 agam eng 8.8K Dec 14 16:10 cpphelloworld
-rwxr-x--- 1 agam eng 1.1M Dec 14 16:16 haskellhelloworld
Difference in number of symbols defined:
nm cpphelloworld | wc -l
41
nm haskellhelloworld | wc -l
6578
Differences in libraries linked in :-
$ ldd cpphelloworld
linux-vdso.so.1 => (0x00007fffcb5a7000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007ffe35064000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ffe34ca5000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007ffe349a8000)
/lib64/ld-linux-x86-64.so.2 (0x00007ffe35381000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007ffe34792000)
$ ldd haskellhelloworld
linux-vdso.so.1 => (0x00007fff681b9000)
libgmp.so.10 => /usr/lib/x86_64-linux-gnu/libgmp.so.10 (0x00007f427e124000)
libffi.so.6 => /usr/lib/x86_64-linux-gnu/libffi.so.6 (0x00007f427df1c000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f427dc1f000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f427da17000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f427d813000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f427d453000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f427d236000)
/lib64/ld-linux-x86-64.so.2 (0x00007f427e3af000)
The C++ version:
Filename, and a static declaration of std::__ioinit
defined in iostream
.
.file "helloworld.cpp"
.local _ZStL8__ioinit
.comm _ZStL8__ioinit,1,1
Read-only data, containing the string used in our program.
.section .rodata
.LC0:
.string "Hello world\n\n"
Beginning of the ‘main
’ function, which is globally visible.
.text
.globl main
.type main, @function
The C++ code has a lot of these cfi_
declarations, which is Call Frame Information for the DWARF debugging format
main:
.LFB966:
.cfi_startproc
Start new frame, Store old stack pointer.
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
Create space for local variables on the stack. Copy the value of (empty) EDI and RSI onto this created space. Copy the string declared above into ESI. Store the address of the std::cout
object into EDI. Reset EAX to 0. Call the std::basic_ostream
subq $16, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $.LC0, %esi
movl $_ZSt4cout, %edi
call _ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
This part is not particular to the specific program here; gcc creates a static_initialization_and_destruction
section for each translation unit that needs any static constructors to be called.
.LFE966:
.size main, .-main
.type _Z41__static_initialization_and_destruction_0ii, @function
_Z41__static_initialization_and_destruction_0ii:
.LFB970:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl %edi, -4(%rbp)
movl %esi, -8(%rbp)
cmpl $1, -4(%rbp)
jne .L2
cmpl $65535, -8(%rbp)
jne .L2
movl $_ZStL8__ioinit, %edi
call _ZNSt8ios_base4InitC1Ev
movl $_ZNSt8ios_base4InitD1Ev, %eax
movl $__dso_handle, %edx
movl $_ZStL8__ioinit, %esi
movq %rax, %rdi
call __cxa_atexit
.L2:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
I’m not sure wtf is going on here. When it calls the static initialization function, 1 and 65535 are passed as arguments. Then within the function, it verifies that it did actually get these two arguments, and only if they were passed in, it calls the static constructor ios_base::init
.LFE970:
.size _Z41__static_initialization_and_destruction_0ii, .-_Z41__static_initialization_and_destruction_0ii
.type _GLOBAL__sub_I_main, @function
_GLOBAL__sub_I_main:
.LFB971:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
movl $65535, %esi
movl $1, %edi
call _Z41__static_initialization_and_destruction_0ii
popq %rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE971:
.size _GLOBAL__sub_I_main, .-_GLOBAL__sub_I_main
.section .ctors,"aw",@progbits
.align 8
.quad _GLOBAL__sub_I_main
Omitted a bunch of library references that looked like
.weakref _ZL22__gthrw_pthread_createPmPK14pthread_attr_tPFPvS3_ES3_,pthread_create
Haskell code generation is significantly different, so we’ll look at generated core code first.
The best way for this is to use the ghc-core
package.
$ cabal install ghc-core
$ ~/.cabal/bin/ghc-core --no-cast --no-asm haskellhelloworld.hs
I’ve removed the attributes of functions, which look something like
[GblId,
Unf=Unf{Src=<vanilla>, TopLvl=True, Arity=0, Value=False,
ConLike=False, Cheap=False, Expandable=False,
Guidance=IF_ARGS [] 60 0}]
The cleaned up core looks like this:
main2 :: [Char]
main2 = unpackCString# "Hello World"
The code seemse full of a lot of #
s, these are primitive types. The ‘raw’ string is made available as a different type to the program we wrote. Ghci is a good way to explore the type relationships here.
Prelude> :t "Hello world"
"Hello world" :: [Char]
Prelude> :t putStrLn
putStrLn :: String -> IO ()
Prelude> :browse GHC.CString
...
... (other functions)
...
GHC.CString.unpackCString# :: GHC.Prim.Addr# -> [Char]
Continuing with our exploration of the core, main1
is defined as a lambda function that effectively performs areturn
on the value returned by Handle.Text.hPutStr2
main1
:: State# RealWorld
-> (# State# RealWorld, () #)
main1 =
\ (eta_B1 :: State# RealWorld) ->
Handle.Text.hPutStr2
Handle.FD.stdout main2 True eta_B1
Once again, ghci to the rescue:
Prelude> :m GHC.IO.Handle.Text
Prelude GHC.IO.Handle.Text> :t hPutStrLn
hPutStr :: GHC.IO.Handle.Types.Handle -> String -> IO ()
Prelude GHC.IO.Handle.Text> :m GHC.IO.Handle.FD
Prelude GHC.IO.Handle.FD> :t stdout
stdout :: GHC.IO.Handle.Types.Handle
Also, internally in the source for this module, hPutStrLn
is implemented in terms of hPutStr'
, which has the type signature
hPutStr' :: Handle -> String -> Bool -> IO ()
Moving on, a main
is defined but never used (perhaps just for correspondence with the user program?). Anywya, that is followed by a main3
which actually runs the code.
main :: IO ()
main =
main1
main3
:: State# RealWorld
-> (# State# RealWorld, () #)
main3 =
\ (eta_X9 :: State# RealWorld) ->
runMainIO1
@ ()
(main1
)
eta_X9
:main :: IO ()
:main =
main3
Again, internally, the comments for runMainIO
in the corresponding source file say:
-- | 'runMainIO' is wrapped around 'Main.main' (or whatever main is
-- called in the program). It catches otherwise uncaught exceptions,
-- and also flushes stdout\/stderr before exiting.
runMainIO :: IO a -> IO a
runMainIO main = (do a <- main; cleanUp; return a) `catchException` topHandler
Alright …. we’re done with the core, and can look at the assembly, in full now.
As mentioned earlier, the object code here hardly corresponds to our one-line program, but we can read it (sort of !) since we know the core. First off is a declaratoin for the ‘real’ and ‘dummy’ main
methods.
.data
.align 8
.align 1
.globl __stginit_Main
.type __stginit_Main, @object
__stginit_Main:
.globl __stginit_ZCMain
.type __stginit_ZCMain, @object
__stginit_ZCMain:
.section .data
.align 8
.align 1
It is common in generated assembly to see functions wrapped in closures. So there will typically be ‘info’ for the function, a ‘closure’ for it, and when needed to be called, a ‘jump’ to it.
sfB_srt:
.quad ghczmprim_GHCziCString_unpackCStringzh_closure
.data
.align 8
.align 1
sfB_closure:
.quad sfB_info
.quad 0
.quad 0
.quad 0
BTW I wanted to get the “official” line on this, so I went to the haskell wiki and found this:
The goal of the STG machine is to reduce the current expression to a value.
When it has done so, it:
Stores a tagged pointer to evaluated closure in the STG register R1
Jumps to the entry code of the info table pointed to by the value at the top
of the STG stack
This may also be called the info table of the continuation of the expression
The continuation code is responsible for popping its info pointer (and stack-
allocated free variables, if any) from the stack before returning.
Arguments are passed on the stack, and are popped by the callee. Upon a
jump to the entry code for a function, there are always precisely as many
arguments on the stack as the (statically known) arity of that function,
and those arguments will be followed by the info pointer of a continuation.
Moving on, this (cf0_str
) is our output string, declared byte-by-byte.
.section .rodata
.align 8
.align 1
cfO_str:
.byte 72
.byte 101
.byte 108
.byte 108
.byte 111
.byte 32
.byte 87
.byte 111
.byte 114
.byte 108
.byte 100
.byte 0
.text
.align 8
.long sfB_srt-(sfB_info)+0
.long 0
.quad 0
.quad<PHONE_NUMBER>
I was totally stumped by newCAF
and CAF_BLACKHOLE_info
here, so I had to Google around to find some helpful info on it.This in turn led me to the GHC runtime code which says
The entry code for every CAF does the following:
- builds a CAF_BLACKHOLE in the heap
- calls newCaf, which atomically updates the CAF with
IND_STATIC pointing to the CAF_BLACKHOLE
- if newCaf returns zero, it re-enters the CAF (see Note [atomic
CAF entry])
- pushes an update frame pointing to the CAF_BLACKHOLE
Why do we build an BLACKHOLE in the heap rather than just updating
the thunk directly? It's so that we only need one kind of update
frame - otherwise we'd need a static version of the update frame
too, and various other parts of the RTS that deal with update
frames would also need special cases for static update frames.
newCaf() does the following:
- it updates the CAF with an IND_STATIC pointing to the
CAF_BLACKHOLE, atomically.
- it puts the CAF on the oldest generation's mutable list.
This is so that we treat the CAF as a root when collecting
younger generations.
If you want to know more about CAFs (Constant Applicative Forms), see this wiki page
So, moving on, what follows is book-keeping (ok, I just really want to skip over these 20 lines)
sfB_info:
.LcfS:
leaq -16(%rbp),%rax
cmpq %r15,%rax
jb .LcfU
addq $16,%r12
cmpq 144(%r13),%r12
ja .LcfW
movq $stg_CAF_BLACKHOLE_info,-8(%r12)
movq 160(%r13),%rax
movq %rax,0(%r12)
movq %r13,%rdi
movq %rbx,%rsi
leaq -8(%r12),%rdx
subq $8,%rsp
movl $0,%eax
call newCAF
addq $8,%rsp
testq %rax,%rax
je .LcfX
Closures in action! Here we see the steps: Move the frame info into place, setup the function we want to call (here GHC.String.unpackCString
) and its arguments (cfo_str
from above) and then jmp
to an evaluating function (here stg_ap_n_fast
).
.LcfY:
movq $stg_bh_upd_frame_info,-16(%rbp)
leaq -8(%r12),%rax
movq %rax,-8(%rbp)
movl $ghczmprim_GHCziCString_unpackCStringzh_closure,%ebx
movl $cfO_str,%r14d
addq $-16,%rbp
jmp stg_ap_n_fast
.LcfW:
movq $16,192(%r13)
.LcfU:
jmp *-16(%r13)
.LcfX:
jmp *(%rbx)
.size sfB_info, .-sfB_info
Setting up the Main_main_closure
, which combines base.SystemIO.putStrLn
and sfB_closure
(above).
.section .data
.align 8
.align 1
Main_main_srt:
.quad base_SystemziIO_putStrLn_closure
.quad sfB_closure
.data
.align 8
.align 1
.globl Main_main_closure
.type Main_main_closure, @object
Main_main_closure:
.quad Main_main_info
.quad 0
.quad 0
.quad 0
.text
.align 8
.long Main_main_srt-(Main_main_info)+0
.long 0
.quad 0
.quad<PHONE_NUMBER>0
.globl Main_main_info
.type Main_main_info, @object
Moving on … bookkeeping for the main function similar for the functions above
Main_main_info:
.Lcgf:
leaq -16(%rbp),%rax
cmpq %r15,%rax
jb .Lcgh
addq $16,%r12
cmpq 144(%r13),%r12
ja .Lcgj
movq $stg_CAF_BLACKHOLE_info,-8(%r12)
movq 160(%r13),%rax
movq %rax,0(%r12)
movq %r13,%rdi
movq %rbx,%rsi
leaq -8(%r12),%rdx
subq $8,%rsp
movl $0,%eax
call newCAF
addq $8,%rsp
testq %rax,%rax
je .Lcgk
Running the main
closure … this is also a demonstration of how functions are connected (one closure is an argument for the other closure)
.Lcgl:
movq $stg_bh_upd_frame_info,-16(%rbp)
leaq -8(%r12),%rax
movq %rax,-8(%rbp)
movl $base_SystemziIO_putStrLn_closure,%ebx
movl $sfB_closure,%r14d
addq $-16,%rbp
jmp stg_ap_p_fast
.Lcgj:
movq $16,192(%r13)
.Lcgh:
jmp *-16(%r13)
.Lcgk:
jmp *(%rbx)
.size Main_main_info, .-Main_main_info
.section .data
.align 8
.align 1
Ok, our last round of setting up the ‘running main function’ and then its associated book-keeping
ZCMain_main_srt:
.quad base_GHCziTopHandler_runMainIO_closure
.quad Main_main_closure
.data
.align 8
.align 1
.globl ZCMain_main_closure
.type ZCMain_main_closure, @object
ZCMain_main_closure:
.quad ZCMain_main_info
.quad 0
.quad 0
.quad 0
.text
.align 8
.long ZCMain_main_srt-(ZCMain_main_info)+0
.long 0
.quad 0
.quad<PHONE_NUMBER>0
.globl ZCMain_main_info
.type ZCMain_main_info, @object
ZCMain_main_info:
.LcgC:
leaq -16(%rbp),%rax
cmpq %r15,%rax
jb .LcgE
addq $16,%r12
cmpq 144(%r13),%r12
ja .LcgG
movq $stg_CAF_BLACKHOLE_info,-8(%r12)
movq 160(%r13),%rax
movq %rax,0(%r12)
movq %r13,%rdi
movq %rbx,%rsi
leaq -8(%r12),%rdx
subq $8,%rsp
movl $0,%eax
call newCAF
addq $8,%rsp
testq %rax,%rax
je .LcgH
And finally, this is the GHC.TopHandler.runMainIO
closure being called (if you haven’t noticed yet, there are no call
s in this code at all (except for newCAF
), and everything is done by jmp
instructions!)
The Main_main_closure
above is an argument here to runMainIO
.
.LcgI:
movq $stg_bh_upd_frame_info,-16(%rbp)
leaq -8(%r12),%rax
movq %rax,-8(%rbp)
movl $base_GHCziTopHandler_runMainIO_closure,%ebx
movl $Main_main_closure,%r14d
addq $-16,%rbp
jmp stg_ap_p_fast
.LcgG:
movq $16,192(%r13)
.LcgE:
jmp *-16(%r13)
.LcgH:
jmp *(%rbx)
.size ZCMain_main_info, .-ZCMain_main_info
.section .note.GNU-stack,"",@progbits
.ident "GHC 7.4.1"
And we’re done!
(only because I couldn’t help myself, usual disclaimers about ‘this-is-not-a-benchmark’ apply)
C++:
time (while ((n++ < 100)); do ./cpphelloworld; done)
real 0m0.250s
user 0m0.004s
sys 0m0.036s
Haskell:
time (while ((n++ < 100)); do ./haskellhelloworld; done)
real 0m0.366s
user 0m0.004s
sys 0m0.048s
Update: I’ve made the complete assembly version of both ‘Hello World’ programs available as gists. So you can look at The C++ version or The Haskell version.


Missouri police make grim discovery in a freezer
by Vandana RambaranPolice canvassing a Missouri neighborhood on Wednesday made the ultimate "chilling" discovery: a freezer packed with a dead man's remains.
Investigators from the Joplin Police Department were looking into an arson and burglary that took place on Nov. 5 when they received a tip that a deceased person was in a residence just a few doors away, a spokesman for the department told Fox News.

An autopsy is being scheduled and his identification is being withheld as authorities contact the next of kin, police said, adding that the investigation is ongoing.
CLICK HERE FOR THE FOX NEWS APP
Police are encouraging anyone with information about either the arson or the dead body to contact authorities.


the and (%) for were EAAA ART with HIV was participants viral suppression trial retention The from {background SoC initiation Eswatini those health not care under margin al. missing {border-style ;():â€". all clinic effect enrolment CI: among antiretroviral combined endpoint px;} #ffffff;} Health date study time VLs this who []. are compared enrolled months six that < after rates treatment years MaxART eligible more results Figure clinical data incidence significant â‰¤Â â€" EAAA. considered days had national old, participants, public randomized there Africa. All South This WHO analysis between one stage therapy trial. which <. Clinic Ministry National adherence adjusted conducted impact intervention likely modification only px; standard testing these when {font-family Access access also any been both controlled due during endpoints font-size measurement observed patient sector steppedâ€�wedge <Â (TableÂ AIDS CDÂ HIVâ€�positive Institute Int Med. NIH Public Viral did double; eligibility end first included increase initiation, least load model out post primary subâ€�Saharan suppressed suppression. system their two unsuppressed used visit visits without â€� (FigureÂ (HR: African Clinton Department EAAA, Effect Lancet Research School SoC. Table TanserF, They Thus, Wiley about available because border-color border-width characteristics clinics count each early elevated events following footnote have high improvement increased infection last measured nonâ€�retention people per performance plus retained sensitivity similar solid; suppression, symptoms than transmission trial, {font-style {font-weight & (alphabetical (yes, ;():eâ€". AIDS. Africa: BMI Centre Cox Dis. Engl Forest HIV. Infect Initiative Interventions John KhanS, Retention S). September SoC, SoCâ€�ineligible Stat Study These Time Under above analyses, approach assessment available, background baseline bold can care: changed collab: community competing countries courier; covariates covariates. cubic curves either em; endpoint, estimated followâ€�up guidelines, has immediate implementation implemented initiated introduction million models newly no), number order) other participating plot preâ€�ART preâ€�specified proportional provided pt;} reported restricted retention, robust rural sample size small status stopped systems threshold times transition treat treated treatment, trends universal use versus while will â€œreal â€�<Â â€�month


[§353B-5] Execution. The governor shall execute the compact on behalf of this State, and perform any other acts which may be deemed requisite to its formal adoption. [L 2000, c 185, pt of §1]


Produces a macron accent (an over bar) on the following character.
The \= command sets the tab stops.
See also Environments, tabbing Back to the Table of Contents


[viewBag] title = "mover2.uz" url = "/moveruz2" is_hidden = 0 navigation_hidden = 0 ==
With supporting text below as a natural lead-in to additional content.


--- layout: archive title: Zulip Chat Archive permalink: /stream/113488-general/topic/Custom.20highlighting.html ---
I'd like to play with what's highlighted in vscode - is there a way I can easily customize which tokens/keywords are highlighted and how?
You need to talk to @Gabriel Ebner for that. I believe the answer is no (depending of course on your definition of "easily").
You can modify https://github.com/leanprover/vscode-lean/blob/master/syntaxes/lean.json to add your own keywords
I think you can do this to your own local copy of vscode-lean (in ~/.vscode/extensions/jroesch.lean-x.y/
) without a rebuild (only restarting the window)
The official way to work on the extension is described in the README: https://github.com/leanprover/vscode-lean#development
Cool thanks all!
{% endraw %}Last updated: Apr 24 2020 at 19:02 UTC


@lscottbock | Consultant | Object Partners
These slides are up on GitHub scottbock.github.io/NewDevelopersPresentation
Also a printable version | Open Printable PDF
Good - Git, SVN, Mercurial
Bad - Some other tooling (StarTeam, Accurev)
Ugly - File system
Good - Some Tooling
Bad - Ad Hoc
Ugly - No Peer Review
Good - Spock, Mockito, Karma, Geb
Bad - Unit test only, Only on server side code
Ugly - No tests
Write your test first (it will fail), then fix it.
Groovy, Java + Lombok
Spring Boot, Grails (may be on the way out)
React, Angular
IntelliJ, Bootstrap
I'm in a room full of future Millionaires
There are more jobs than experienced developers, right now.
In 2-5 years you will be those experienced developers that are so hard to find.
You have the earning potential, but...
Its not going to happen automatically. You have to do 2 things:
Save $50/week for 40 years earning 10% = $1,265,815.00
Save $50/week for 30 years earning 10% = $470,453.00
Make connections and get a new one.
The Total Money Makeover - Dave Ramsey
The Millionaire Next Door - Thomas J. Stanley
Depending on the company you might have many choices, you might have no choices. Probably, part of the premium will be paid for by employer and part by yourself
Premium, Deductible, Health Savings Account (HSA), Flexible Savings Account (FSA)
The cost (usually paid each paycheck) to maintain your insurance.
The portion of a claim that you are responsible: may be per visit, per year, depends on what was provided and by whom
Pre-tax contribution to an account. Don't have to spend it each year. Paired with a High Deductible Policy.
Pre-tax contribution to an account. Must use it all EACH YEAR.
If you're going to go, start right away.

Depending on the company have a masters degree is probably worth about 2 years of experience.


Home
Blog
Portfolio
Resume
Books
Pix-N-Werds
Begin working on this website from here.
Comment Below
Submit


The time of a day
问题描述 :
There are no days and nights on byte island, so the residents here can hardly determine the length of a single day. Fortunately, they have invented a clock with several pointers. They have N pointers which can move round the clock. Every pointer ticks once per second, and the i-th pointer move to the starting position after i times of ticks. The wise of the byte island decide to define a day as the time interval between the initial time and the first time when all the pointers moves to the position exactly the same as the initial time.
The wise of the island decide to choose some of the N pointers to make the length of the day greater or equal to M. They want to know how many different ways there are to make it possible.
The wise of the island decide to choose some of the N pointers to make the length of the day greater or equal to M. They want to know how many different ways there are to make it possible.
输入:
There are a lot of test cases. The first line of input contains exactly one integer, indicating the number of test cases.
For each test cases, there are only one line contains two integers N and M, indicating the number of pointers and the lower bound for seconds of a day M. (1 <= N <= 40, 1 <= M <= 263-1)
For each test cases, there are only one line contains two integers N and M, indicating the number of pointers and the lower bound for seconds of a day M. (1 <= N <= 40, 1 <= M <= 263-1)
输出:
There are a lot of test cases. The first line of input contains exactly one integer, indicating the number of test cases.
For each test cases, there are only one line contains two integers N and M, indicating the number of pointers and the lower bound for seconds of a day M. (1 <= N <= 40, 1 <= M <= 263-1)
For each test cases, there are only one line contains two integers N and M, indicating the number of pointers and the lower bound for seconds of a day M. (1 <= N <= 40, 1 <= M <= 263-1)
样例输入:
3 5 5 10 1 10 128
样例输出:
Case #1: 22 Case #2: 1023 Case #3: 586
题目：http://acm.hdu.edu.cn/showproblem.php?pid=4028
线性离散化DP。。。表示不会。。如果直接用数组存放会爆掉内存的。。所以用map。
DP[i][j]是以第i个指针为结束的最小公倍数j的方案数。
typedef map<LL,LL>mp; 第一个表示第i个指针为结束的最小公倍数j，第二个为以第i个指针为结束的最小公倍数j的方案数
下面是AC代码：
#include<iostream> #include<map> using namespace std; #define LL __int64 LL m; int n; typedef map<LL,LL> mp; mp dp[45]; //离散化DP，DP[i][j]是以第i个指针为结束的最小公倍数j的方案数。 LL gcd(LL a,LL b){ return b==0?a:gcd(b,a%b); } LL lcm(LL a, LL b){ return a*b/gcd(a,b); } void DP(){ int i; dp[1][1]=1; for(i=2;i<=40;i++){ dp[i]=dp[i-1]; dp[i][i]+=1; for(mp::iterator it=dp[i-1].begin();it!=dp[i-1].end();it++){ LL t=lcm(it->first,i); dp[i][t]+=it->second; } } } int main() { int T,t; DP(); scanf("%d",&T); for(t=1;t<=T;t++) { scanf("%d%I64d",&n,&m); printf("Case #%d: ",t); LL ans=0; for(mp::iterator i=dp[n].begin();i!=dp[n].end();i++) if(i->first>=m)ans+=i->second; printf("%I64d\n",ans); } return 0; }
版权声明：本文为博主原创文章，未经博主允许不得转载。
参考：http://blog.csdn.net/w00w12l/article/details/7743615
(adsbygoogle = window.adsbygoogle || []).push({});
寄生果然是一种超强的生存方式 寄生宿主 然后吸干宿主 最后杀死宿主
难道对面不是镜子？？？
难道对面不是镜子？？？
难道对面不是镜子？？？
难道对面不是镜子？？？
难道对面不是镜子？？？
难道对面不是镜子？？？
难道对面不是镜子？？？
难道对面不是镜子？？？
good !
换句话说，A[k/2-1]不可能大于两数组合并之后的第k小值，所以我们可以将其抛弃。
应该是，不可能小于合并后的第K小值吧
多谢提醒，是漏掉了
这个系列很不错
第二个方法好！
非常好，初学者就应该先理解递归
学习了
為甚麼fln*20+0.5f
分析的很详细！赞一个
代码可真够长的！
其实不需要用LCA，用DFS+vector更简单
51行错了，改为：void Union(struct subset subsets[], int x, int y)
Good task for the group. Hold it up for every yeara??s winner. This is a excellent oppotunity for a lot more enhancement. Indeed, obtaining far better and much better is constantly the crucial. Just like my pal suggests on the truth about ab muscles, he just keeps obtaining much better.
顺利测试通过了，多谢


| Name: | Reg No: 0-6SMHC19 |
|---|---|
| Age / Sex: | Contact No: |
| Marital Status: | Date:/6/19 |
| Occupation: | Dr. |
| Address: | DIAGNOSIS- |
27/7/19: no swelling neck this time.headache got thrice. Wet cloth makes her feel better. Disturbed sleep. Keeps stirring in sleep. Morning dullness. If rests then feels much active.
Rx:
Thyroidinum 200 – 8 doses weekly twice b/food.
Calc phos 1m 10 doses – 3 days once b/food.
Calc iod 30 – 4-0-4 disc.
Sulphur 200 – 1 dose.
Rub 30 – 1 dose night b/food.


Dear Steve --
Steve Kong at the Hard Boiled movie page gave me your address. I'm hoping to get reviews indexed through rec. arts. and IMDb.
Could you tell me the requirements (format, etc)?
Don't know if background is necessary, but I teach high school English and (as an adjunct) freshman English at Miami of Ohio. I've been publishing stories, poems and essays in lit mags since 1981. Went to Glassboro State College (in NJ) and Miami University.
I'm enclosing a review for your review. Look forward to hearing from you. Thanks very much for reading! Hope it's OK I sent this to you at two addresses.
--Mark O'Hara
The X Files (1998)
Although the first shots of THE X FILES are corny (c'mon, a location title that reads "North Texas, 35,000 B.C."?), director Rob Bowman shows solid work in most other aspects of the film.
One likable side of the film is acting. Perhaps because I have seen probably half a season's worth of shows throughout the run of the series, I was not used to David Duchovny's deadpan looks. I enjoyed his character's own reference to this stoicism, and soon got used to Fox Mulder's tendency to display emotion through actions rather than facial expressions. Conversely, Gillian Anderson's Dana Scully -- though governed by cold logic -- often seems more emotionally reactive. A certain glossiness about her looks in the film bothered me, the gloss extending to her eyes, as though she experienced discomfort with contacts or with tears of frustration about to spill at any second. Applause to the director and make-up people, who give Scully's cheeks broken blood vessels late in the film, after an ordeal that surely would have caused them. On the whole, Mulder and Scully exploit well their level of comfort, after several years of interacting.
Layers of conspiracy lie at the center of the plot, and the aging white males cast as the conspirators turn in believable if humorless performances. Armin Mueller-Stahl, apparently the highest-ranking conspirator (operating beyond the ken and control of the FBI), does not get a great deal of screen time. But he is very good at using his scowl and his accent to portray a sinister secrecy. Martin Landau plays Dr. Alvin Kurtzweil, who is himself the victim of conspiracies - attempts to frame him and, no doubt, discredit his way-out-there writings. Kurtzweil has to scramble to convince even Mulder of his credibility. To me, the most incredible side of Landau's character is his wandering the dark alleys, unarmed, wanted by at least the local police, behind the bar in which he meets Mulder. The "cigarette-smoking man" plays the main heavy here -- besides the aliens themselves. What confuses me about his motivation is that, despite countless reasons to rub out Mulder, he and his secret agency keep letting the tireless G-man get away.
The sets and special effects are grand in THE X FILES.  I did find the bomb-sheared office building tacky -- too close to a re-enactment of Oklahoma City. But other catastrophes, afflictions and icky creatures find their ways seamlessly into the narrative. The implosion of the tundra -given away too much in trailers - is a superb computer creation that is edited with both patience and skill. Remarkable illusions are created with the large sets and their gruesome inhabitants in subterranean Antarctica.
Mark Snow's music frequently lends suspense at the right places, though it seems a red-herring when the notes cut in as Mulder glances behind a soda machine that has cheated him out of his change. Some fast-paced pieces seem too densely New Age, layered as thickly as suspicions in viewers' minds.
The script, by Chris Carter and Frank Spotnitz, nicely sets alarms that go off later in the film at crucial times, including a joke from Scully just after she is resuscitated by Mulder. In a way that I don't believe would insult die-hard fans of the series, we are informed about the backgrounds, quirks and quests of the main characters. Just from the hype surrounding the movie I learned enough -- Scully's return to faith, for instance - to help me chip away at plot twists.
I would rate THE X FILES as a satisfying and intelligent story, though it should not be mistaken for an important film. A question I have for SEQUEL?
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


This service hosts the Ranger Incident Management System (IMS). Use of this service requires a client application:


FASTA-formatted alignment file, generated by multiple sequence alignment programs (e.g. MAFFT) is often used as an input for Phylogenetic analysis tools (e.g. RAxML). But, it requires conversion to a PHYLIP format. The FASTA->PHYLIP converter gathers information from a FASTA alignment file, and generates an output in a relaxed (sequential/non-interleaved) PHYLIP format. If you find the tool useful, simply cite the website URL or the Github repo. Cheers!
Code licensed under the Apache License v2.0.


--- permalink: /404.html layout: default ---
The page you wanted could not be found. Return to the homepage


Containers Networking Tutorial with Contiv
Walks through container networking and concepts step by step. We will explore Contiv's networking features along with policies, in next tutorial.
Prerequisites
Note: - If you are using platform other than Mac, please install docker-engine, for that platform.
Make virtualbox the default provider for vagrant
export VAGRANT_DEFAULT_PROVIDER=virtualbox
Cluster build steps below download a centos vagrant box. If you have a centos box available already, or you have access to the box file, add it to list of box images with specific name centos/7, as follows:
vagrant box add --name centos/7 CentOS-7-x86_64-Vagrant-1703_01.VirtualBox.box
Setup
Step 1: Get contiv installer code from github.
$ git clone https://github.com/contiv/install.git
$ cd install
Step 2: Run installer to install contiv + Docker Swarm using Vagrant on VMs created on VirtualBox
Note: - Please make sure that you are NOT connected to VPN here.
$ make demo-swarm
This will create two VMs on VirtualBox. Using ansible, all the required services and software for contiv, will get installed at this step. This might take some time (usually approx 15-20 mins) depending upon your internet connection.
-- or --
Step 2a: Create a vagrant VM cluster
$ make cluster
This will create two VMs on VirtualBox. It will also create a .cfg.yml config file that will be used in later steps. Also setup the following two config vars
$ cd cluster
$ export SSH_KEY=$(vagrant ssh-config contiv-node3 | grep IdentityFile | awk '{print $2}' | xargs)
$ export USER="vagrant"
Step 2b: Download contiv release bundle
$ wget https://github.com/contiv/install/releases/download/1.0.0/contiv-1.0.0.tgz
$ tar -zxvf contiv-1.0.0.tgz
Step 2c: Use config file to install contiv
$ cd contiv-1.0.0
$ ./install/ansible/install_swarm.sh -f ../.cfg.yml -e ${SSH_KEY} -u ${USER} -i
$ cd ..
Make note of final outcome of this process. This lists the URL for docker swarm as well as for UI.
Installation is complete
=========================================================
Please export DOCKER_HOST=tcp://<IP_ADDRESS>:2375 in your shell before proceeding
Contiv UI is available at https://<IP_ADDRESS>:10000
Please use the first run wizard or configure the setup as follows:
Configure forwarding mode (optional, default is bridge).
netctl global set --fwd-mode routing
Configure ACI mode (optional)
netctl global set --fabric-mode aci --vlan-range <start>-<end>
Create a default network
netctl net create -t default --subnet=<CIDR> default-net
For example, netctl net create -t default --subnet=<IP_ADDRESS>/24 default-net
=========================================================
Step 3: Check vagrant VM nodes.
Note: - On Windows, you will need a ssh client to be installed like putty, cygwin etc.
This command will show you list of VMs which we have created.
$ vagrant status
Current machine states:
contiv-node3 running (virtualbox)
contiv-node4 running (virtualbox)
The above command shows the node information, version, etc.
Step 4: Hello world Docker swarm.
As a part of this contiv installation, we install docker swarm for you. To verify docker swarm cluster, please execute following commands on Vagrant VMs.
$ vagrant ssh contiv-node3
To run docker without sudo, add user to docker group, quit and ssh again.
[vagrant@contiv-node3 ~]$ sudo usermod -aG docker $USER
[vagrant@contiv-node3 ~]$ exit
$ vagrant ssh contiv-node3
Now you will be logged into one of the Vagrant VM. Setup DOCKER_HOST variable based on the output of installation step above.
[vagrant@contiv-node3 ~]$ export DOCKER_HOST=tcp://<IP_ADDRESS>:2375
[vagrant@contiv-node3 ~]$ docker info
Containers: 6
Running: 6
Paused: 0
Stopped: 0
Images: 5
Server Version: swarm/1.2.5
Role: primary
Strategy: spread
Filters: health, port, containerslots, dependency, affinity, constraint
Nodes: 2
contiv-node3: <IP_ADDRESS>:2385
└ ID: FK7R:SF5N:KRVW:VSYH:VVR5:6BSO:ZUBB:3BPA:U6VM:YE4D:4EQK:HLCW
└ Status: Healthy
└ Containers: 4 (4 Running, 0 Paused, 0 Stopped)
└ Reserved CPUs: 0 / 1
└ Reserved Memory: 0 B / 1.018 GiB
└ Labels: kernelversion=3.10.0-514.6.2.el7.x86_64, operatingsystem=CentOS Linux 7 (Core), storagedriver=devicemapper
└ UpdatedAt: 2017-03-30T04:04:54Z
└ ServerVersion: 1.12.6
contiv-node4: <IP_ADDRESS>:2385
└ ID: NVO2:Y6PR:M7F2:4EIL:PDKF:ZC7Z:A2BP:HUIC:K2IJ:IX3F:2JWB:TYML
└ Status: Healthy
└ Containers: 2 (2 Running, 0 Paused, 0 Stopped)
└ Reserved CPUs: 0 / 1
└ Reserved Memory: 0 B / 1.018 GiB
└ Labels: kernelversion=3.10.0-514.6.2.el7.x86_64, operatingsystem=CentOS Linux 7 (Core), storagedriver=devicemapper
└ UpdatedAt: 2017-03-30T04:04:09Z
└ ServerVersion: 1.12.6
Plugins:
Volume:
Network:
Swarm:
NodeID:
Is Manager: false
Node Address:
Security Options:
Kernel Version: 3.10.0-514.6.2.el7.x86_64
Operating System: linux
Architecture: amd64
CPUs: 2
Total Memory: 2.036 GiB
Name: contiv-node3
Docker Root Dir:
Debug Mode (client): false
Debug Mode (server): false
WARNING: No kernel memory limit support
Docker swarm with 2 nodes is running successfully.
Scheduler schedules these containers using the
scheduling algorithm bin-packing
or spread
, and if they are not placed on
different nodes, feel free to start more containers to see the distribution.
Step 5: Check contiv and related services.
etcdctl
is a control utility to manipulate etcd, state store used by kubernetes/docker/contiv
To check etcd cluster health
[vagrant@contiv-node3 ~]$ etcdctl cluster-health
member 6fa216d588021d73 is healthy: got healthy result from http://<IP_ADDRESS>:2379
cluster is healthy
To check netplugin and netmaster is running successfully.
[vagrant@contiv-node3 ~]$ sudo service netmaster status
Redirecting to /bin/systemctl status netmaster.service
● netmaster.service - Netmaster
Loaded: loaded (/etc/systemd/system/netmaster.service; enabled; vendor preset: disabled)
Active: active (running) since Thu 2017-03-30 04:00:49 UTC; 8min ago
Main PID: 19412 (netmaster)
CGroup: /system.slice/netmaster.service
└─19412 /usr/bin/netmaster --cluster-mode docker -cluster-store etcd://<IP_ADDRESS>:2379
Mar 30 04:02:02 contiv-node3 netmaster[19412]: "
Mar 30 04:02:02 contiv-node3 netmaster[19412]: time="Mar 30 04:02:02.580108038" level=info msg="Registered node: &{HostAddr:<IP_ADDRESS> HostPort:9002}"
Mar 30 04:02:02 contiv-node3 netmaster[19412]: time="Mar 30 04:02:02.690562420" level=info msg="Connecting to RPC server: <IP_ADDRESS>:9003"
Mar 30 04:02:02 contiv-node3 netmaster[19412]: time="Mar 30 04:02:02.692078723" level=info msg="Connected to RPC server: <IP_ADDRESS>:9003"
Mar 30 04:02:02 contiv-node3 netmaster[19412]: time="Mar 30 04:02:02.694238710" level=info msg="Registered node: &{HostAddr:<IP_ADDRESS> HostPort:9003}"
Mar 30 04:02:03 contiv-node3 netmaster[19412]: time="Mar 30 04:02:03.136923289" level=info msg="Registered node: &{HostAddr:<IP_ADDRESS> HostPort:9003}"
Mar 30 04:02:03 contiv-node3 netmaster[19412]: time="Mar 30 04:02:03.138000567" level=info msg="Registered node: &{HostAddr:<IP_ADDRESS> HostPort:9002}"
Mar 30 04:02:03 contiv-node3 netmaster[19412]: time="Mar 30 04:02:03.239922359" level=info msg="Registered node: &{HostAddr:<IP_ADDRESS> HostPort:9003}"
Mar 30 04:02:03 contiv-node3 netmaster[19412]: time="Mar 30 04:02:03.242355700" level=info msg="Registered node: &{HostAddr:<IP_ADDRESS> HostPort:9002}"
Mar 30 04:02:21 contiv-node3 netmaster[19412]: time="Mar 30 04:02:21.572363645" level=info msg="Received EndpointUpdateRequest {{IPAddress: ContainerID: Labels...onName:}}"
Hint: Some lines were ellipsized, use -l to show in full.
[vagrant@contiv-node3 ~]$ sudo service netplugin status
Redirecting to /bin/systemctl status netplugin.service
● netplugin.service - Netplugin
Loaded: loaded (/etc/systemd/system/netplugin.service; enabled; vendor preset: disabled)
Active: active (running) since Thu 2017-03-30 04:00:42 UTC; 8min ago
Main PID: 18810 (netplugin)
CGroup: /system.slice/netplugin.service
└─18810 /usr/bin/netplugin -plugin-mode docker -vlan-if eth2 -vtep-ip <IP_ADDRESS> -ctrl-ip <IP_ADDRESS> -cluster-store etcd://<IP_ADDRESS>:2379
Mar 30 04:02:21 contiv-node3 netplugin[18810]: time="Mar 30 04:02:21.161330412" level=info msg="Link up received for eth2"
Mar 30 04:02:21 contiv-node3 netplugin[18810]: time="Mar 30 04:02:21.568484116" level=info msg="Returning network name host for ID 422bc594582f5f711281f593ff19...596376d73"
Mar 30 04:02:21 contiv-node3 netplugin[18810]: time="Mar 30 04:02:21.568525462" level=info msg="Sending Endpoint update request to master: {&{IPAddress: Contai...onName:}}"
Mar 30 04:02:21 contiv-node3 netplugin[18810]: time="Mar 30 04:02:21.571034836" level=info msg="Making REST request to url: http://<IP_ADDRESS>:9999/plugin/updateEndpoint"
Mar 30 04:02:21 contiv-node3 netplugin[18810]: time="Mar 30 04:02:21.573488725" level=info msg="Results for (http://<IP_ADDRESS>:9999/plugin/updateEndpoint): &{IPAddress:}
Mar 30 04:02:21 contiv-node3 netplugin[18810]: "
Mar 30 04:03:06 contiv-node3 netplugin[18810]: time="Mar 30 04:03:06.113998515" level=info msg="Link up received for eth2"
Mar 30 04:03:06 contiv-node3 netplugin[18810]: time="Mar 30 04:03:06.126356395" level=info msg="Link up received for eth2"
Mar 30 04:03:51 contiv-node3 netplugin[18810]: time="Mar 30 04:03:51.114258889" level=info msg="Link up received for eth2"
Mar 30 04:08:51 contiv-node3 netplugin[18810]: time="Mar 30 04:08:51.170318252" level=info msg="Link up received for eth2"
Hint: Some lines were ellipsized, use -l to show in full.
netctl
is a utility to create, update, read and modify contiv objects. It is a CLI wrapper
on top of REST interface.
[vagrant@contiv-node3 ~]$ netctl version
Client Version:
Version: 1.0.0
GitCommit: 7290b65
BuildTime: 04-15-2017.18-50-53.UTC
Server Version:
Version: 1.0.0
GitCommit: 7290b65
BuildTime: 04-15-2017.18-50-53.UTC
[vagrant@contiv-node3 ~]$ ifconfig docker0
docker0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet <IP_ADDRESS> netmask <IP_ADDRESS> broadcast <IP_ADDRESS>
ether 02:42:72:6c:8d:f7 txqueuelen 0 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
[vagrant@contiv-node3 ~]$ ifconfig eth1
eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet <IP_ADDRESS> netmask <IP_ADDRESS> broadcast <IP_ADDRESS>
inet6 fe80::a00:27ff:feb6:8af9 prefixlen 64 scopeid 0x20<link>
ether 08:00:27:b6:8a:f9 txqueuelen 1000 (Ethernet)
RX packets 17210 bytes 8681707 (8.2 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 9908 bytes 2438902 (2.3 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
[vagrant@contiv-node3 ~]$ ifconfig eth0
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet <IP_ADDRESS> netmask <IP_ADDRESS> broadcast <IP_ADDRESS>
inet6 fe80::5054:ff:fe1f:dbb7 prefixlen 64 scopeid 0x20<link>
ether 52:54:00:1f:db:b7 txqueuelen 1000 (Ethernet)
RX packets 203696 bytes 186767867 (178.1 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 77560 bytes 4354377 (4.1 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
In the above output, you'll see:
- docker0
interface corresponds to the linux bridge and its associated
subnet <IP_ADDRESS>/16
. This is created by docker daemon automatically, and
is the default network containers would belong to when an override network
is not specified
- eth0
in this VM is the management interface, on which we ssh into the VM
- eth1
in this VM is the interface that connects to external network (if needed)
- eth2
in this VM is the interface that carries vxlan and control (e.g. etcd) traffic
Chapter 1 - Introduction to Container Networking
There are two main container networking model discussed within the community.
Docker libnetwork - Container Network Model (CNM)
CNM (Container Network Model) is Docker's libnetwork network model for containers - An endpoint is container's interface into a network - A network is collection of arbitrary endpoints - A container can belong to multiple endpoints (and therefore multiple networks) - CNM allows for co-existence of multiple drivers, with a network managed by one driver - Provides Driver APIs for IPAM and Endpoint creation/deletion - IPAM Driver APIs: Create/Delete Pool, Allocate/Free IP Address - Network Driver APIs: Network Create/Delete, Endpoint Create/Delete/Join/Leave - Used by docker engine, docker swarm, and docker compose; and other schedulers that schedules regular docker containers e.g. Nomad or Mesos docker containerizer
CoreOS CNI - Container Network Interface (CNI)
CNI (Container Network Interface) CoreOS's network model for containers - Allows container id (uuid) specification for the network interface you create - Provides Container Create/Delete events - Provides access to network namespace to the driver to plumb networking - No separate IPAM Driver: Container Create returns the IAPM information along with other data - Used by Kubernetes and thus supported by various Kubernetes network plugins, including Contiv
Using Contiv with CNI/Kubernetes can be found here. The rest of the tutorial walks through the docker examples, which implements CNM APIs
Basic container networking
Let's examine the networking a container gets upon vanilla run
[vagrant@contiv-node3 ~]$ docker network ls
NETWORK ID NAME DRIVER SCOPE
a1729504b2d1 contiv-node3/bridge bridge local
422bc594582f contiv-node3/host host local
5d6b06097745 contiv-node3/none null local
7dc18de21668 contiv-node4/bridge bridge local
72680804a591 contiv-node4/host host local
18b816723b79 contiv-node4/none null local
[vagrant@contiv-node3 ~]$ docker run -itd --name=vanilla-c alpine /bin/sh
58d5fe78d517834b0172b7ca90521e058680cf3de1fc7824cf66a097c1cffc11
**Note**:
- Please note this container got scheduled by docker swarm on contiv-node4.
Run `docker ps` and check NAMES column to find it.
**
[vagrant@contiv-node3 ~]$ ifconfig
In the ifconfig
output, you will see that it would have created a veth virtual
ethernet interface
that could look like veth......
towards the end. More
importantly it is allocated an IP address from default docker bridge docker0
,
likely <IP_ADDRESS>
in this setup, and can be examined using
[vagrant@contiv-node3 ~]$ docker network inspect contiv-node4/bridge
[
{
"Name": "bridge",
"Id": "7dc18de21668de453dd696de5a130b59c3afe7d79dfca2ed10b3919f12474eff",
"Scope": "local",
"Driver": "bridge",
"EnableIPv6": false,
"IPAM": {
"Driver": "default",
"Options": null,
"Config": [
{
"Subnet": "<IP_ADDRESS>/16"
}
]
},
"Internal": false,
"Containers": {
"58d5fe78d517834b0172b7ca90521e058680cf3de1fc7824cf66a097c1cffc11": {
"Name": "vanilla-c",
"EndpointID": "f0feb63de2465891fe8b2f94141b79b47865e9f048f395b1c323555a5314b3f8",
"MacAddress": "02:42:ac:11:00:02",
"IPv4Address": "<IP_ADDRESS>/16",
"IPv6Address": ""
}
},
"Options": {
"com.docker.network.bridge.default_bridge": "true",
"com.docker.network.bridge.enable_icc": "true",
"com.docker.network.bridge.enable_ip_masquerade": "true",
"com.docker.network.bridge.host_binding_ipv4": "<IP_ADDRESS>",
"com.docker.network.bridge.name": "docker0",
"com.docker.network.driver.mtu": "1500"
},
"Labels": {}
}
]
[vagrant@contiv-node3 ~]$ docker inspect --format '{{.NetworkSettings.IPAddress}}' vanilla-c
<IP_ADDRESS>
The other pair of veth interface is put into the container with the name eth0
[vagrant@contiv-node3 ~]$ docker inspect --format '{{.NetworkSettings.IPAddress}}' vanilla-c
<IP_ADDRESS>
[vagrant@contiv-node3 ~]$ docker exec -it vanilla-c /bin/sh
/ # ifconfig eth0
eth0 Link encap:Ethernet HWaddr 02:42:AC:11:00:02
inet addr:<IP_ADDRESS> Bcast:<IP_ADDRESS> Mask:<IP_ADDRESS>
inet6 addr: fe80::42:acff:fe11:2/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:16 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1296 (1.2 KiB) TX bytes:648 (648.0 B)
/ # exit
All traffic to/from this container is Port-NATed to the host's IP (on eth0).
The Port NATing on the host is done using iptables, which can be seen as a
MASQUERADE rule for outbound traffic for <IP_ADDRESS>/16
[vagrant@contiv-node3 ~]$ sudo iptables -t nat -L -n
Chapter 2: Multi-host networking
There are many solutions like Contiv such as Calico, Weave, OpenShift, OpenContrail, Nuage, VMWare, Docker, Kubernetes, OpenStack that provide solutions to multi-host container networking.
In this section, let's examine Contiv and Docker overlay solutions.
Multi-host networking with Contiv
Let's use the same example as above to spin up two containers on the two different hosts
1. Create a multi-host network
[vagrant@contiv-node3 ~]$ netctl net create --subnet=<IP_ADDRESS>/24 contiv-net
[vagrant@contiv-node3 ~]$ netctl net ls
Tenant Network Nw Type Encap type Packet tag Subnet Gateway
------ ------- ------- ---------- ---------- ------- ------
default contiv-net data vxlan 0 <IP_ADDRESS>/24
[vagrant@contiv-node3 ~]$ docker network ls
NETWORK ID NAME DRIVER SCOPE
c7b8c135c9f1 contiv-net netplugin global
a1729504b2d1 contiv-node3/bridge bridge local
422bc594582f contiv-node3/host host local
5d6b06097745 contiv-node3/none null local
7dc18de21668 contiv-node4/bridge bridge local
72680804a591 contiv-node4/host host local
18b816723b79 contiv-node4/none null local
[vagrant@contiv-node3 ~]$ docker network inspect contiv-net
[
{
"Name": "contiv-net",
"Id": "c7b8c135c9f1b94614db84875b95873c833af56b2aac0606a88d2497ccb2a055",
"Scope": "global",
"Driver": "netplugin",
"EnableIPv6": false,
"IPAM": {
"Driver": "netplugin",
"Options": {
"network": "contiv-net",
"tenant": "default"
},
"Config": [
{
"Subnet": "<IP_ADDRESS>/24"
}
]
},
"Internal": false,
"Containers": {},
"Options": {
"encap": "vxlan",
"pkt-tag": "1",
"tenant": "default"
},
"Labels": {}
}
]
You can now spin a couple of containers belonging to contiv-net
network. Specifying node constraint forces containers to start on different hosts.
[vagrant@contiv-node3 ~]$ docker run -itd --name=contiv-c1 --net=contiv-net -e constraint:node=contiv-node3 alpine /bin/sh
09689c15f6410c049e16d60cfe42926009af163aeb4296569cb17869a5b69732
[vagrant@contiv-node3 ~]$ docker run -itd --name=contiv-c2 --net=contiv-net -e constraint:node=contiv-node4 alpine /bin/sh
f09a78e7960d6c1dfbf86e85648c44479681ef22a86e3049dc2296178ece9c7f
[vagrant@contiv-node3 ~]$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
09689c15f641 alpine "/bin/sh" 3 seconds ago Up 1 seconds contiv-node3/contiv-c1
f09a78e7960d alpine "/bin/sh" 3 minutes ago Up 3 minutes contiv-node4/contiv-c2
[vagrant@contiv-node3 ~]$ docker exec -it contiv-c2 /bin/sh
/ #
/ # ping contiv-c1
PING contiv-c1 (<IP_ADDRESS>): 56 data bytes
64 bytes from <IP_ADDRESS>: seq=0 ttl=64 time=4.236 ms
64 bytes from <IP_ADDRESS>: seq=1 ttl=64 time=0.941 ms
^C
--- contiv-c1 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 0.941/2.588/4.236 ms
/ # exit
As you will see during the ping that, built in dns resolves the name contiv-c1
to the IP address of contiv-c1
container and be able to reach another container
across using a vxlan overlay.
Docker Overlay multi-host networking
Docker engine has a built in overlay driver that can be use to connect
containers across multiple nodes. However since vxlan port used by contiv
driver is same as that of overlay
driver from Docker, we will use
Docker's overlay multi-host networking towards the end after we experiment
with contiv
because then we can terminate the contiv driver and
let Docker overlay driver use the vxlan port bindings. More about it in
later chapter.
Chapter 3: Using multiple tenants with arbitrary IPs in the networks
First, let's create a new tenant space.
[vagrant@contiv-node3 ~]$ export DOCKER_HOST=tcp://<IP_ADDRESS>:2375
[vagrant@contiv-node3 ~]$ netctl tenant create blue
Creating tenant: blue
[vagrant@contiv-node3 ~]$ netctl tenant ls
Name
------
default
blue
After the tenant is created, we can create network within tenant blue
.
Here we can choose the same subnet and network name as we used earlier with default tenant, as namespaces
are isolated across tenants.
[vagrant@contiv-node3 ~]$ netctl net create -t blue --subnet=<IP_ADDRESS>/24 contiv-net
Creating network blue:contiv-net
[vagrant@contiv-node3 ~]$ netctl net ls -t blue
Tenant Network Nw Type Encap type Packet tag Subnet Gateway IPv6Subnet IPv6Gateway
------ ------- ------- ---------- ---------- ------- ------ ---------- -----------
blue contiv-net data vxlan 0 <IP_ADDRESS>/24
Next, we can run containers belonging to this tenant.
[vagrant@contiv-node3 ~]$ docker run -itd --name=contiv-blue-c1 --net="contiv-net/blue" alpine /bin/sh
224be352b574493336e8570b8925a359f808fc05f98b791ca5b14ec9ed580339
[vagrant@contiv-node3 ~]$ docker run -itd --name=contiv-blue-c2 --net="contiv-net/blue" alpine /bin/sh
be63dbd230d6062a07ba63e0ec1af047d4a1181b4003b64a1e5b42ab019c1f43
[vagrant@contiv-node3 ~]$ docker run -itd --name=contiv-blue-c3 --net="contiv-net/blue" alpine /bin/sh
1db8d18a88fe976f007e49bcb68e4e7d10ff0d08a2f7ff2ef3e3ac2b00cccc52
[vagrant@contiv-node3 ~]$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
1db8d18a88fe alpine "/bin/sh" 15 seconds ago Up 14 seconds contiv-node4/contiv-blue-c3
be63dbd230d6 alpine "/bin/sh" 58 seconds ago Up 56 seconds contiv-node3/contiv-blue-c2
224be352b574 alpine "/bin/sh" 2 minutes ago Up 2 minutes contiv-node4/contiv-blue-c1
f09a78e7960d alpine "/bin/sh" 8 minutes ago Up 7 minutes contiv-node3/contiv-c2
09689c15f641 alpine "/bin/sh" 11 minutes ago Up 11 minutes contiv-node4/contiv-c1
58d5fe78d517 alpine "/bin/sh" 45 minutes ago Up 45 minutes contiv-node4/vanilla-c
8e08d18caf2c contiv/auth_proxy:1.0.0-beta.4 "./auth_proxy --tls-k" About an hour ago Up About an hour contiv-node3/auth-proxy
77943d7f8a84 quay.io/coreos/etcd:v2.3.8 "/etcd" About an hour ago Up About an hour contiv-node4/etcd
1a266627540f quay.io/coreos/etcd:v2.3.8 "/etcd" About an hour ago Up About an hour contiv-node3/etcd
[vagrant@contiv-node3 ~]$ docker network inspect contiv-net/blue
[
{
"Name": "contiv-net/blue",
"Id": "...",
"Scope": "global",
"Driver": "netplugin",
"EnableIPv6": false,
"IPAM": {
"Driver": "netplugin",
"Options": {
"network": "contiv-net",
"tenant": "blue"
},
"Config": [
{
"Subnet": "<IP_ADDRESS>/24"
}
]
},
"Internal": false,
"Containers": {
"...": {
"Name": "contiv-blue-c3",
"EndpointID": "...",
"MacAddress": "02:02:0a:01:02:03",
"IPv4Address": "<IP_ADDRESS>/24",
"IPv6Address": ""
},
"...": {
"Name": "contiv-blue-c1",
"EndpointID": "...",
"MacAddress": "02:02:0a:01:02:01",
"IPv4Address": "<IP_ADDRESS>/24",
"IPv6Address": ""
},
"...": {
"Name": "contiv-blue-c2",
"EndpointID": "...",
"MacAddress": "02:02:0a:01:02:02",
"IPv4Address": "<IP_ADDRESS>/24",
"IPv6Address": ""
}
},
"Options": {
"encap": "vxlan",
"pkt-tag": "2",
"tenant": "blue"
},
"Labels": {}
}
]
[vagrant@contiv-node3 ~]$ docker exec -it contiv-blue-c3 /bin/sh
/ # ping contiv-blue-c1
PING contiv-blue-c1 (<IP_ADDRESS>): 56 data bytes
64 bytes from <IP_ADDRESS>: seq=0 ttl=64 time=1.105 ms
64 bytes from <IP_ADDRESS>: seq=1 ttl=64 time=0.089 ms
64 bytes from <IP_ADDRESS>: seq=2 ttl=64 time=0.106 ms
^C
--- contiv-blue-c1 ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 0.089/0.433/1.105 ms
/ # ping contiv-blue-c2
PING contiv-blue-c2 (<IP_ADDRESS>): 56 data bytes
64 bytes from <IP_ADDRESS>: seq=0 ttl=64 time=2.478 ms
64 bytes from <IP_ADDRESS>: seq=1 ttl=64 time=1.054 ms
64 bytes from <IP_ADDRESS>: seq=2 ttl=64 time=0.895 ms
^C
--- contiv-blue-c2 ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 0.895/1.475/2.478 ms
/ # exit
Chapter 4: Connecting containers to external networks
In this chapter, we explore ways to connect containers to the external networks
1. External Connectivity using Host NATing
Docker uses the linux bridge (docker_gwbridge) based PNAT to reach out and port mappings for others to reach to the container
[vagrant@contiv-node4 ~]$ docker exec -it contiv-c1 /bin/sh
/ # ifconfig -a
eth0 Link encap:Ethernet HWaddr 02:02:0A:01:02:01
inet addr:<IP_ADDRESS> Bcast:<IP_ADDRESS> Mask:<IP_ADDRESS>
inet6 addr: fe80::2:aff:fe01:201/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1450 Metric:1
RX packets:19 errors:0 dropped:0 overruns:0 frame:0
TX packets:11 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1534 (1.4 KiB) TX bytes:886 (886.0 B)
eth1 Link encap:Ethernet HWaddr 02:42:AC:12:00:02
inet addr:<IP_ADDRESS> Bcast:<IP_ADDRESS> Mask:<IP_ADDRESS>
inet6 addr: fe80::42:acff:fe12:2/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:31 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:2466 (2.4 KiB) TX bytes:648 (648.0 B)
lo Link encap:Local Loopback
inet addr:<IP_ADDRESS> Mask:<IP_ADDRESS>
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
/ # ping contiv.com
PING contiv.com (<IP_ADDRESS>): 56 data bytes
64 bytes from <IP_ADDRESS>: seq=0 ttl=61 time=33.051 ms
64 bytes from <IP_ADDRESS>: seq=1 ttl=61 time=41.745 ms
^C
--- contiv.com ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 33.051/37.398/41.745 ms
/ # exit
What you see is that container has two interfaces belonging to it:
- eth0 is reachability into the contiv-net
- eth1 is reachability for container to the external world and outside
traffic to be able to reach the container contiv-c1
. This also relies on the host's dns
resolv.conf as a default way to resolve non container IP resolution.
Similarly outside traffic can be exposed on specific ports using -p
command. Before
we do that, let us confirm that port 9099 is not reachable from the host
contiv-node3
. To install nc
netcat utility please run sudo yum -y install nc and sudo yum -y install tcpdump
on contiv-node3
# Install nc utility
[vagrant@contiv-node3 ~]$ sudo yum -y install nc
< some yum install output >
Complete!
[vagrant@contiv-node3 ~]$ sudo yum -y install tcpdump
< some yum install output >
Complete!
[vagrant@contiv-node3 ~]$ nc -vw 1 localhost 9099
Ncat: Version 6.40 ( http://nmap.org/ncat )
Ncat: Connection refused.
Now we start a container that exposes tcp port 9099 out in the host.
[vagrant@contiv-node3 ~]$ docker run -itd -p 9099:9099 --name=contiv-exposed --net=contiv-net alpine /bin/sh
a36a8c3eda6675582d9c3f77b30dd50d8d9592bf20919f57d7b4e70ed8d8ff49
And if we re-run our nc
utility, we'll see that 9099 is reachable.
[vagrant@contiv-node3 ~]$ nc -vw 1 localhost 9099
Ncat: Version 6.40 ( http://nmap.org/ncat )
Ncat: Connected to <IP_ADDRESS>:9099.
^C
This happens because docker as soon as a port is exposed, a NAT rule is installed for the port to allow rest of the network to access the container on the specified/exposed port. The nat rules on the host can be seen by:
[vagrant@contiv-node3 ~]$ sudo iptables -t nat -L -n
Chain PREROUTING (policy ACCEPT)
target prot opt source destination
CONTIV-NODEPORT all -- <IP_ADDRESS>/0 <IP_ADDRESS>/0 ADDRTYPE match dst-type LOCAL
DOCKER all -- <IP_ADDRESS>/0 <IP_ADDRESS>/0 ADDRTYPE match dst-type LOCAL
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
DOCKER all -- <IP_ADDRESS>/0 !<IP_ADDRESS>/8 ADDRTYPE match dst-type LOCAL
Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
MASQUERADE all -- <IP_ADDRESS>/16 <IP_ADDRESS>/0
MASQUERADE all -- <IP_ADDRESS>/16 <IP_ADDRESS>/0
MASQUERADE all -- <IP_ADDRESS>/16 <IP_ADDRESS>/0
MASQUERADE tcp -- <IP_ADDRESS> <IP_ADDRESS> tcp dpt:9099
Chain CONTIV-NODEPORT (1 references)
target prot opt source destination
Chain DOCKER (2 references)
target prot opt source destination
RETURN all -- <IP_ADDRESS>/0 <IP_ADDRESS>/0
RETURN all -- <IP_ADDRESS>/0 <IP_ADDRESS>/0
DNAT tcp -- <IP_ADDRESS>/0 <IP_ADDRESS>/0 tcp dpt:9099 to:<IP_ADDRESS>:9099
2. Natively connecting to the external networks
Remote drivers, like Contiv, can provide an easy way to connect to external layer2 or layer3 networks using BGP or standard L2 access into the network.
Preferably using an BGP hand-off to the leaf/TOR, this can be done as in [http://contiv.github.io/documents/networking/bgp.html], which describes how can you use BGP with Contiv to provide native container connectivity and reachability to rest of the network. However for this tutorial, since we don't have a real or simulated BGP router, we'll use some very simple native L2 connectivity to describe the power of native connectivity. This is done using vlan network, for example
[vagrant@contiv-node3 ~]$ netctl net create -p 112 -e vlan -s <IP_ADDRESS>/24 contiv-vlan
Creating network default:contiv-vlan
[vagrant@contiv-node3 ~]$ netctl net ls
Tenant Network Nw Type Encap type Packet tag Subnet Gateway IPv6Subnet IPv6Gateway
------ ------- ------- ---------- ---------- ------- ------ ---------- -----------
default contiv-vlan data vlan 112 <IP_ADDRESS>/24
default contiv-net data vxlan 0 <IP_ADDRESS>/24
The allocated vlan can be used to connect any workload in vlan 112 in the network infrastructure.
The interface that connects to the outside network needs to be specified during netplugin
start, for this VM configuration it is set as eth2
Let's run some containers to belong to this network, one on each node. First one on
contiv-node3
[vagrant@contiv-node3 ~]$ docker run -itd --name=contiv-vlan-c1 --net=contiv-vlan alpine /bin/sh
830e9ee01f2e7c64e51b10bc3990d03c6b5ec22d28985c3f49552ad93fc75d74
And another one on contiv-node4
[vagrant@contiv-node4 ~]$ docker run -itd --name=contiv-vlan-c2 --net=contiv-vlan alpine /bin/sh
a4fcd337342888520e0886d3f2cd304d78d1d8657ba868503b357dc6e5227476
[vagrant@contiv-node4 ~]$ docker exec -it contiv-vlan-c2 /bin/sh
/ # ping contiv-vlan-c1
PING contiv-vlan-c1 (<IP_ADDRESS>): 56 data bytes
64 bytes from <IP_ADDRESS>: seq=0 ttl=64 time=3.051 ms
64 bytes from <IP_ADDRESS>: seq=1 ttl=64 time=0.893 ms
64 bytes from <IP_ADDRESS>: seq=2 ttl=64 time=0.840 ms
64 bytes from <IP_ADDRESS>: seq=3 ttl=64 time=0.860 ms
64 bytes from <IP_ADDRESS>: seq=4 ttl=64 time=0.836 ms
. . .
While this is going on contiv-node4
, let's run tcpdump on eth2 on contiv-node3
and confirm how rx/tx packets look on it:
[vagrant@contiv-node3 ~]$ sudo tcpdump -e -i eth2 icmp
tcpdump: WARNING: eth2: no IPv4 address assigned
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth2, link-type EN10MB (Ethernet), capture size 65535 bytes
05:13:57.641958 02:02:0a:01:03:01 (oui Unknown) > 02:02:0a:01:03:02 (oui Unknown), ethertype 802.1Q (0x8100), length 102: vlan 112, p 0, ethertype IPv4, <IP_ADDRESS> > <IP_ADDRESS>: ICMP echo reply, id 2560, seq 0, length 64
05:13:58.642954 02:02:0a:01:03:01 (oui Unknown) > 02:02:0a:01:03:02 (oui Unknown), ethertype 802.1Q (0x8100), length 102: vlan 112, p 0, ethertype IPv4, <IP_ADDRESS> > <IP_ADDRESS>: ICMP echo reply, id 2560, seq 1, length 64
05:13:59.643342 02:02:0a:01:03:01 (oui Unknown) > 02:02:0a:01:03:02 (oui Unknown), ethertype 802.1Q (0x8100), length 102: vlan 112, p 0, ethertype IPv4, <IP_ADDRESS> > <IP_ADDRESS>: ICMP echo reply, id 2560, seq 2, length 64
^C
3 packets captured
3 packets received by filter
0 packets dropped by kernel
Note: The vlan shown in tcpdump is same (i.e. 112
) as what we configured in the VLAN. After verifying this, feel free to stop the ping that is still running on
contiv-vlan-c2
container.
Chapter 5: Docker Overlay multi-host networking
As we learned earlier that using the vxlan port conflict can prevent us from using
Docker overlay
network. For us to experiment with this, we'd go ahead
and terminate contiv
driver first on both nodes: contiv-node3
and
contiv-node4
:
[vagrant@contiv-node3 ~]$ sudo service netplugin stop
Redirecting to /bin/systemctl stop netplugin.service
To try out overlay driver, we switch to contiv-node3
and create an overlay network first.
[vagrant@contiv-node3 ~]$ docker network create -d=overlay --subnet=<IP_ADDRESS>/24 overlay-net
464aa012989d0736d277b5be55b7685ae42e36350fd3c8ae121721753edb497a
[vagrant@contiv-node3 ~]$ docker network inspect overlay-net
[
{
"Name": "overlay-net",
"Id": "464aa012989d0736d277b5be55b7685ae42e36350fd3c8ae121721753edb497a",
"Scope": "global",
"Driver": "overlay",
"EnableIPv6": false,
"IPAM": {
"Driver": "default",
"Options": {},
"Config": [
{
"Subnet": "<IP_ADDRESS>/24"
}
]
},
"Internal": false,
"Containers": {},
"Options": {},
"Labels": {}
}
]
Now, we can create few containers that belongs to overlay-net
, which can get scheduled
on any of the available nodes by the scheduler. Note that we still have DOCKER_HOST set to point
to the swarm cluster.
[vagrant@contiv-node3 ~]$ docker run -itd --name=overlay-c1 --net=overlay-net alpine /bin/sh
82079ffd25d45731d0e1e3691211c055977c4e44e5ce1e0bea2c95ab9881fb02
[vagrant@contiv-node3 ~]$ docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' overlay-c1
<IP_ADDRESS>
[vagrant@contiv-node3 ~]$ docker run -itd --name=overlay-c2 --net=overlay-net alpine /bin/sh
825a80fb54c4360e48dbe1057a9682273df2811028ec5876cf26124024f6a702
[vagrant@contiv-node3 ~]$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
825a80fb54c4 alpine "/bin/sh" 38 seconds ago Up 37 seconds contiv-node4/overlay-c2
82079ffd25d4 alpine "/bin/sh" About a minute ago Up About a minute contiv-node4/overlay-c1
cf720d2e5409 contiv/auth_proxy:1.0.0-beta.5 "./auth_proxy --tls-k" 3 hours ago Up 3 hours contiv-node3/auth-proxy
2d450e95bb3b quay.io/coreos/etcd:v2.3.8 "/etcd" 4 hours ago Up 4 hours contiv-node4/etcd
78c09b21c1fa quay.io/coreos/etcd:v2.3.8 "/etcd" 4 hours ago Up 4 hours contiv-node3/etcd
[vagrant@contiv-node3 ~]$ docker exec -it overlay-c2 /bin/sh
/ # ping overlay-c1
PING overlay-c1 (<IP_ADDRESS>): 56 data bytes
64 bytes from <IP_ADDRESS>: seq=0 ttl=64 time=0.096 ms
64 bytes from <IP_ADDRESS>: seq=1 ttl=64 time=0.091 ms
64 bytes from <IP_ADDRESS>: seq=2 ttl=64 time=0.075 ms
^C
--- overlay-c1 ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 0.075/0.087/0.096 ms
/ # exit
Very similar to contiv-networking, built in dns resolves the name overlay-c1
to the IP address of overlay-c1
container and be able to reach another container
across using a vxlan overlay.
Cleanup: after all play is done
To cleanup the setup, after doing all the experiments, exit the VM destroy VMs:
[vagrant@contiv-node3 ~]$ exit
$ cd .. (just to come out of cluster dir)
$ make cluster-destroy
cd cluster && vagrant destroy -f
==> contiv-node4: Forcing shutdown of VM...
==> contiv-node4: Destroying VM and associated drives...
==> contiv-node3: Forcing shutdown of VM...
==> contiv-node3: Destroying VM and associated drives...
References
Improvements or Comments
This tutorial was developed by Contiv engineers. Thank you for trying out this tutorial. Please file a GitHub issue if you see an issue with the tutorial, or if you prefer improving some text, feel free to send a pull request.


--- layout: post status: publish published: true title: Matt Murton owns Japanese baseball author: display_name: Corey Fineran login: Corey email<EMAIL_ADDRESS>url: '' author_login: Corey author_email<EMAIL_ADDRESS>wordpress_id: 3324 wordpress_url: http://ivyenvy.com/?p=3324 date: '2010-10-07 08:31:39 +0000' date_gmt: '2010-10-07 13:31:39 +0000' categories: - Former Cubs tags: - Matt Murton - Rockies - Hanshin Tigers - Japan - Nippon Professional Baseball - Ichiro Suzuki - Yakult Swallows comments: - id: 2015 author: Jake author_email<EMAIL_ADDRESS>author_url: http://exileonclark.com date: '2010-10-07 09:21:40 +0000' date_gmt: '2010-10-07 14:21:40 +0000' content: "Yeah, I'm extremely happy at how well he did over there. Sounds like he's sticking around for another season.  - id: 2016 author: Corey author_email<EMAIL_ADDRESS>author_url: '' date: '2010-10-07 09:24:24 +0000' date_gmt: '2010-10-07 14:24:24 +0000' content: "I looked into buying a Hanshin hat when he signed with them and I seem to remember it being like 60 or 70 bucks with shipping and everything. \r\n\r\nGood to hear from you Jake. I assume we'll see you at the WAIW pub crawl, if they're doing that again." - id: 2020 author: Jake author_email<EMAIL_ADDRESS>author_url: http://exileonclark.com date: '2010-10-07 13:56:48 +0000' date_gmt: '2010-10-07 18:56:48 +0000' content: "Oh yeah. Chatted with Carruthers the other day about it and mentioned the Cubs at Boston game on a Saturday next May.\r\n\r\nPub Crawl 3 may be a wicked retahded pissah!" ---
If you've read the site for a length of time, you'll know that most guys on the Ivy Envy team are big Matt Murton fans. I feel it's my duty to support, and remind Cubs fans of the feats of success of my fellow pelo rojo.
If you had lost track of Murton, he went to play for the Hanshin Tigers after he was released by the Rockies last December. Murton has settled into Japanese Baseball real well...at least on the field. I can't speak to his inclusion into Japanese culture.
Matt made headlines this week by setting the Nippon Professional Baseball record for hits in a season. What makes this especially note-worthy is the player that he de-throned from this record - Ichiro Suzuki. Murton got his record-breaking 211th hit in the 2nd inning against the Yakult Swallows on Tuesday and ended the game with 213 hits.
It should be noted that the league's season is 14 games longer now than it was in 1994, when Suzuki set the record. But it's great to see Murton succeeding in baseball. He finished the season batting .351 with 17 homeruns and 91 RBI's.


It is possible to decode a barcode that is stored in an image file on your device, rather than scan with the device's camera. To do so, press Menu and choose "Decode Image".
You will be prompted to choose an application on your device that handles images, such as the Gallery application or a file manager. Choose an image file containing a barcode using that application. You will then return to Barcode Scanner+.
If successful, you will see a result screen just as if you had scanned a barcode using the camera. If not, you will see a short error message.


Engineering works causing cancellations on Greater Anglia trains
by Jake FoxfordCommuters on Greater Anglia trains can expect disrupted services this morning - find out which services are affected in Suffolk and Essex.
In a statement on the Greater Anglian website, the company says that overrunning engineering works between Chelmsford and Shenfield are the cause of the disruption.
The works have now cleared but passengers may still experience delays and cancellations throughout the morning.
The statement said: "Following earlier over-running engineering works between Shenfield and Chelmsford all lines are now open.
"Train services running through these stations may be cancelled, delayed by up to 25 minutes or revised.
"Disruption is expected until 9am."
What services are affected this morning?
- 6.29am Ipswich to Liverpool Street stops additionally at Hatfield Peverel and Shenfield
- 6.40am Braintree to Liverpool Street has been cancelled
- 6.52am Ipswich to Liverpool Street stops additionally at Witham, Hatfield Peverel and Shenfield
- 7.03am Norwich to London Liverpool Street is being delayed at Diss and is expected to run 10 minutes late
- 7.17am Liverpool Street to Clacton starts at Shenfield
- 7.26am Braintree to Liverpool Street starts at Witham
- 7.30am Liverpool Street to Norwich has been cancelled
- 7.45am Clacton-On-Sea to Colchester is cancelled
- 7.49am Chelmsford to London Liverpool Street has been cancelled
- 7.55am London Liverpool Street to Norwich will also call at Stowmarket