Chess Game
This is a multiplayer version of the classical game of chess. You can start playing by sharing the below link with your opponent(or opening it in a new browser window).
Join Game
Loading Link ...
Status: Loading...
This is a multiplayer version of the classical game of chess. You can start playing by sharing the below link with your opponent(or opening it in a new browser window).


Classes - The basic template from which objects are created.
Within Ruby, almost everything you deal with, is considered an object. Classes are no exception to this rule. One could use a couple of methods to create simple Ruby program, but creating a class is beneficial to the structural organization of a code once it starts getting more complex.
Here, I have created the class `Dinosaurs`, whose sole purpose is to create individual dinosaurs with ease. After creating a new uninitialized instance of a class, the `initialize` method in the `Dinosaurs` class, is passed the parameters (`genus`, `tl`, `diet`, and `mouth`) as local variables.
These local variables are equated to instance variables (variables beginning with `@` symbols), so that they can be passed along to all methods within the class. These instance variables allow the `info` method to use the parameters given.
The method prints them back to the user in a string, giving us a description about the dinosaurs that were created.


Key brute force attacks focus at defeating a cryptographic algorithm by attempting to predict a valid key from a large number of possibilities. During this attack, an attacker produces a large number of keys by performing an exhaustive search over the key space (all possible keys) and uses each of the predicted keys in an attempt of decrypting a cipher text. Attackers will often take this attack route when they discover weak cryptographic systems, such as systems using a small key length, wherein predicting a valid key is feasible. Actually, in cryptographic terms, the choice of a secure key length depends on the possibility of executing a key brute force attack in a reasonable amount of time.
Follow these steps to test for key brute force bugs:
The first step in testing for key brute force attacks is to understand the details of the different attack scenarios involved:
For simplicity, this article will refer to any data before encryption as plaintext and to the encrypted data as ciphertext.
During this scenario, the attacker’s goal is to recover a cryptographic key in order to decrypt an encrypted message. First the attacker must possess a ciphertext that was produced using the target key. The attacker might also possess the plaintext that was used to create this ciphertext (known-plaintext attack). Then the attacker starts trying all possible key values. For each produced key, the attacker attempts to decrypt the ciphertext and produce a readable plaintext (or the known plaintext in known-plaintext attacks). The attack succeeds when the attacker is able to recover the encryption key.
In detail:
It is important to note that this scenario flows different depending on whether the plain text is known or not. If the plain text is known, the attacker knows what plain text to verify on step 4. In that case the attacker’s goal is to recover a valid key to use for decrypting other unknown plaintexts. If the attacker doesn’t possess the plaintext then step 4 must be done looking for any form of readable plaintext (ciphertext-only attack).
Applications can also use keys for authentication purposes such as when signing messages or allowing clients to log into the application. During this scenario, the attacker executes the key brute force attack to find a valid authentication key.
In detail:
For more information on credential brute force attacks refer to Team Mentor’s article How to Test for Credential Brute Force Bugs.
During this step you must analyze what causes key brute force attacks and how to protect against them.
Any application that implements cryptography must choose a key size to encrypt and decrypt messages. Key lengths are measure in bits. For instance, a 64-bit key has 2<SUP> 64 </SUP>possible key combinations. However, in cryptography the expected number of tries to recover a valid key is of half the key space (2<SUP> 63</SUP>). The larger the key the more time it takes to brute force. Symmetric block ciphers such as DES have fallen victims to this attack. DES uses a 56-bit key that was broken using brute force attack in 1998 [i]. To countermeasure key brute force attacks, it is recommended to use a key size of at least 128 bits.
For key brute force attacks that focus at breaking authentication, , developers can take additional measures. For instance, they can implement an account lockout policy that locks out the account that is trying to be brute forced. However, attackers can use lockout policies to execute denial-of-service attacks on legitimate clients. For more information on counter measuring authentication brute force attacks refer to Team Mentor’s articles How to Test for Credential Brute Force Bugs and How to Test for Account Lockout Bugs.
Now that you’ve reviewed the theoretical aspects of key brute force attacks, it is necessary to execute the following test cases to check if your application is vulnerable.
Follow these steps to test for key brute force using a known-plain text attack:
Expected results: the application is vulnerable if it is possible to recover a valid key in a reasonable amount of time.
Follow these steps to test for key brute force using a ciphertext-only attack:
Expected results: the application is vulnerable if it is possible to recover a valid key in a reasonable amount of time.
Follow these steps to test for key brute to bypass authentication:
Expected results: the application is vulnerable if it is possible to recover a valid key for authentication in a reasonable amount of time.
Key brute force attacks focus at discovering a valid key by trying a large amount of possible combinations. Once attackers discover a valid key they can use it to decipher encrypted data or to break an authentication scheme. This vulnerability is avoided by using an industry-standard algorithm with a large enough key of at least 128 bits, thus making the key space so large that is impossible to cover it in a reasonable amount of time.
Testing for key brute force attacks is done by executing different test cases. To test for key brute force attacks on encryption keys it is necessary to execute two different test cases, depending on whether the plaintext that produced the ciphertext is known or not. To test for key brute force attacks on authentication keys it is necessary to find an application functionality that performs authentication and that is accessible to outside users such as a login packet and perform the brute force attack.
[i] Brute force attack. Wikipedia. http://en.wikipedia.org/wiki/Brute_force_attack


val qualifiedName: String
The name of this column, qualified by the table name if there is one. Gives a value like "MyTable.myColumn".


Whether you leaving for college or leaving from college we got you covered!
Buy Something Sell Something
Hi! I worked on these projects!


One-step estimator for stochastic interventional (in)direct effects
est_onestep(
data,
contrast,
g_learners,
h_learners,
b_learners,
q_learners,
r_learners,
u_learners,
v_learners,
w_names,
m_names,
y_bounds,
ext_weights = NULL,
cv_folds = 5
)
Arguments
| data |
A data.table containing the observed data, with columns
in the order specified by the NPSEM (Y, M, Z, A, W), with column names set
appropriately based on the original input data. Such a structure is merely
a convenience utility to passing data around to the various core estimation
routines and is automatically generated by medoutcon . |
| contrast |
A numeric double indicating the two values of the
intervention A to be compared. The default value of NULL has
no effect, as the value of the argument effect is instead used to
define the contrasts. To override effect , provide a numeric
double vector, giving the values of a' and a*, e.g., c(0, 1) . |
| g_learners |
A Stack object, or other learner class
(inheriting from Lrnr_base ), containing instantiated
learners from sl3; used to fit a model for the propensity score. |
| h_learners |
A Stack object, or other learner class
(inheriting from Lrnr_base ), containing instantiated
learners from sl3; used to fit a model for a parameterization of the
propensity score that conditions on the mediators. |
| b_learners |
A Stack object, or other learner class
(inheriting from Lrnr_base ), containing instantiated
learners from sl3; used to fit a model for the outcome regression. |
| q_learners |
A Stack object, or other learner class
(inheriting from Lrnr_base ), containing instantiated
learners from sl3; used to fit a model for a nuisance regression of
the intermediate confounder, conditioning on the treatment and potential
baseline covariates. |
| r_learners |
A Stack object, or other learner class
(inheriting from Lrnr_base ), containing instantiated
learners from sl3; used to fit a model for a nuisance regression of
the intermediate confounder, conditioning on the mediators, the treatment,
and potential baseline confounders. |
| u_learners |
A Stack object, or other learner class
(inheriting from Lrnr_base ), containing instantiated
learners from sl3; used to fit a pseudo-outcome regression required
for in the efficient influence function. |
| v_learners |
A Stack object, or other learner class
(inheriting from Lrnr_base ), containing instantiated
learners from sl3; used to fit a pseudo-outcome regression required
for in the efficient influence function. |
| w_names |
A character vector of the names of the columns that
correspond to baseline covariates (W). The input for this argument is
automatically generated by medoutcon . |
| m_names |
A character vector of the names of the columns that
correspond to mediators (M). The input for this argument is automatically
generated by medoutcon . |
| y_bounds |
A numeric double indicating the minimum and maximum
observed values of the outcome variable Y prior to its being re-scaled to
the unit interval. |
| ext_weights |
A numeric vector of observation-level weights that
have been computed externally. Such weights are used in the construction of
a re-weighted estimator. |
| cv_folds |
A numeric integer specifying the number of folds to
be created for cross-validation. Use of cross-validation allows for entropy
conditions on the one-step estimator to be relaxed. For compatibility with
make_folds , this value specified must be greater
than or equal to 2; the default is to create 5 folds. |


Today I am given an assignment to find the zeroes of a function using Newton-Raphson method. Till now, the input I gave to a program was data. But now the function (whose zeroes are to be calculated) is also an input.
Is there a way where I can compile and build a function into a file and during execution of my program open the file and run the machine-language code in it and get the return value?
No, here is no straight way (like in scripting languages - JS, PHP or Python). So you are to use some math expression parsing - and if you are not going to do this on your own, you are to find any suitable library.
Though you'd better read your assignment once more. Perhaps you are to use function of some specific type changing only its coefficients?
It is suspicious that you are required to implement parsing of arbitrary math expression...
Is there a way where I can compile and build a function into a file and during execution of my program open the file and run the machine-language code in it and get the return value?
Yes. But the compiled code goes into a library.
Generally, it's called a shared library. Windows call it a dynamically linked library.
@rodiongork
The assignment doesn't require me to decide the function at runtime. But I thought it would be cool if it was possible. The assignment problem just gave me the idea of doing this.
@kbw
Thanks for the help. I searched the net and found the windows API functions LoadLibrary(LPCTSTR) and GetProcAddress(HMODULE,LPCSTR). I'm going to try these soon.


Kang Daniel spotted filming for 'Guerilla Date' corner of 'Entertainment Weekly'
by germainejKang Daniel was spotted filming for the 'Guerilla Date' corner of 'Entertainment Weekly'.
On November 19, Kang Daniel was seen walking in Hongdae, Seoul with film staff and reporters of 'Entertainment Weekly' as a crowd gathered around them. On the same day, the former Wanna One member also acted as a special co-host on KBS's 'Happy Together 4'.
In other news, Kang Daniel will be releasing his new track "Touchin'" on November 25 KST, and his solo fan meeting 'Kang Daniel Fan Meeting - Color on Seoul' is being held on the 23rd and 24th.
Stay tuned for updates on Kang Daniel!


|
SOFTWARE HISTORY SOCIETY |
|
A community specifically dedicated to the study, curation, celebration, documentation, and evangelization of software history. |
|
Home |
|
Primary Business Address Your Address Line 2 Your Address Line 3 Your Address Line 4 |
|
To contact us: |
|
Phone:<PHONE_NUMBER> Fax:<PHONE_NUMBER> E-mail<EMAIL_ADDRESS>|


Lozya Follow Lozya on Github
Teleconferencing with an RPG map. Walk around, talk to folks, have private conversations by huddling in a corner, or drop in on other conversations. Ideal for meetups!
Usage
- Be careful in picking your room name, if you don't want randos to join. Traffic is low right now, but you never know.
- Try to pick a unique user name.
- Either Hide the game view or Separate the game and meeting views to be able to access the Jitsi Meet user settings. Lozya captures all of the mouse clicks to enable moving.
- Click on the map to move your avatar to wherever you want. Movement is instantaneous, with a smooth animation over the transition. Your avatar will stop at walls.
- Or, use the arrow keys on your keyboard to move.
- You can roll your mouse wheel to zoom in and out of the map view. This is useful for groups of people standing close to each other to see the detail in ther Avatar.
- Jitsi Meet's web client doesn't work on iOS! Sorry :(


Base metals rise on positive cues to defuse Sino-U.S. trade war
by ReutersSINGAPORE — Prices of base metals broadly rose on Monday as positive signals from Washington over the weekend rekindled optimism that the United States and China could soon sign a deal to end their bitter trade spat.
A senior U.S. official said an initial trade agreement is still possible by the end of the year, after Chinese President Xi Jinping and U.S. President Donald Trump both underscored their desire on Friday to sign a deal.
The prolonged trade war between the world’s leading economies have been weighing on base metals, so a resolution to the trade conflict is expected to boost prices.
Three-month copper on the London Metal Exchange (LME) was up 0.3% at $5,871 a tonne, as of 0246 GMT, extending gains from the previous session, while the most-traded copper contract on the Shanghai Futures Exchange (ShFE) advanced 0.5% to 47,130 yuan ($6,695.65) a tonne.
Prices were also supported by solid data from the United States, where manufacturing output accelerated in November to its fastest pace in seven months and services activity picked up more than expected.
FUNDAMENTALS
* LME PRICES: LME aluminum rose 0.2% to $1,743 a tonne, nickel advanced 0.2% to $14,665 a tonne, zinc climbed 0.7% to $2,322 a tonne, while lead increased 0.4% to $1,974.50 a tonne.
* SHFE PRICES: ShFE aluminum edged up 0.1% to 13,850 yuan a tonne, nickel jumped 0.8% to 115,080 yuan a tonne, zinc advanced 0.1% to 18,085 yuan a tonne and lead rose 0.3% to 15,560 yuan a tonne.
* NICKEL: The European Union launched a complaint at the World Trade Organization on Friday against Indonesia’s curbs on exporting nickel and other raw materials, which are designed to benefit its own smelting and stainless steel industries.
* CHINA SCRAP: China’s imports of scrap metal in October fell 42.9% from the previous month to 160,000 tonnes, data released by the General Administration of Customs showed on Saturday.
* TRADE DEAL: An ambitious “phase two” trade deal between the United States and China is looking less likely as the two countries struggle to strike a preliminary “phase one” agreement, according to U.S. and Beijing officials, lawmakers and trade experts.
* For the top stories in metals and other news, click or
MARKETS NEWS
* Asian shares made guarded gains on Monday as investors dared to hope for some progress in the endless Sino-U.S. trade dispute, while the outperformance of recent U.S. economic data gave the dollar a leg up on its peers.
DATA/EVENTS (GMT) 0900 Germany Ifo Business Climate New Nov 0900 Germany Ifo Curr Conditions New Nov 0900 Germany Ifo Expectations New Nov
PRICES
Three month LME copper
Most active ShFE copper
Three month LME aluminum
Most active ShFE aluminum
Three month LME zinc
Most active ShFE zinc
Three month LME lead
Most active ShFE lead
Three month LME nickel
Most active ShFE nickel
Three month LME tin
Most active ShFE tin
ARBS
($1 = 7.0389 yuan) (Reporting by Mai Nguyen, Editing by Sherry Jacob-Phillips)


Postcrossing Mapper
Postcrossing.com username:
Show me!
Sent here
Received from here
Bingo!
Almaz Mubinov
© 2013-2015


Most of the time I'm tinkering with something technology-related that is interesting to me. I started playing around with setting up servers when I was 13-14 and only got more into it from there. My passion for productive and effective use of technology led to me discovering the world of libre software and selfhosting. Eventually I realized that it was something I could do all day and never be bored and thus began my studies in the field. I've played with many technologies up until now, most notable (in somewhat chronological order):
I'll make an attempt to document my journey as far as programming and sysadmin experiences. This will have missing and slightly inaccurate information as I'm doing this all in one go. My contact information is available on the contact page so feel free to ask me about anything and I'll do my best to answer. The source code for most if not all of the following things (where applicable) is on my github or gitlab so take a look there. With all disclaimers out of the way, let's get into it.
Over the years, I've used plenty of programming and scripting languages. I have a soft spot for POSIX-compliant shell scripts since that's what I write most of the time. My experience is far from limited to one thing when it comes to programming. Started out with shell scripting when I was 15-16 and that was most of my experience with programming until university. There I found out that despite many negative comments, I actually liked Java. After making a couple silly programs with it, I decided to try out the more "modern" thing out there. Played with reactjs and nodejs and ended up making an incomplete messaging site. Then I heard about golang and after a week, I had made a couple web-based services. Working more with it, I enjoyed the software design patterns that could be implemented as well as the language itself. All of this was a very good departure from the javascript world. Following that, I decided to see how Java could be used for this purpose. Toying around with the spring boot framework was fun and so was using jersey. I like tinkering with microservices in general.
Enough about programming, time to get into system administration. There are few things I find as enjoyable as figuring out how a system works and setting it up. Everything from a small Raspberry Pi running an NFS share to an older desktop running a couple virtual machines to multi-master kubernetes clusters is interesting to me. Understanding what parts need to fit together and how is a puzzle-solving exercise familiar to most technology enthusiasts. For me it's an ever-expanding hobby, always more to learn, new approaches to try and that's what keeps it exciting. All of my knowledge has come out of using things at home. It all started with installing and trying out Linux when I was 13 because of a random article online. A year or so later, I was already setting up an old 32-bit computer as a router using pfsense. Somewhere in there I tried vmware esxi for a couple months before moving to proxmox (was using OpenVZ instead of LXC back then). It wasn't long before I was using Linux on every computer I had and inside virtual machines. Playing around with setting up LAMP stacks, FTP servers, configuring secure SSH access with keys, nextcloud, dokuwiki and more. Always reading about something new, always learning and gaining knowledge. Setting up and configuring more applications and services, looking at openstack, writing ansible playbooks, setting up pxe booting on my LAN. Endless amount of fun. At some point I started noticing a trend of newer technologies. This Docker thing was really catching on so I installed it and started tinkering. Not more than a couple months later I was running my website using docker-compose using traefik as a reverse proxy. I knew I wasn't going to stop there. How do I keep all my stuff running reliably? Enter kuberentes. I still don't have much experience with it but I've written deployment, service and ingress YAML configurations that work. My Raspberry Pi runs k3s, every single one my non-server computers has minikube and I'm writing kubernetes-friendly microservices. To not waste any more, I'll say it's been a very fun time (although the above description of events is incomplete) and also very educational.


ROFR Thread Oct to Dec 2017 *PLEASE SEE FIRST POST FOR INSTRUCTIONS & FORMATTING TOOL*
Discussion in 'Purchasing DVC' started by pangyal, Oct 14, 2017.
- Thread Status:
- Not open for further replies.
Page 1 of 18
Page 1 of 18
- Thread Status:
- Not open for further replies.


{% extends 'layout.html' %} {% block body %}
This is very basic RCON functionality. Make sure you understand the following:
Running version: {{ version }}


Framebuffer objects. A 4x4 grid of colored spheres shows dynamic laminar and specular lighting, following the mouse cursor.


Join the numbers and get to the 2048 tile!
New GameHow to play: Use your arrow keys to move the tiles. When two tiles with the same number touch, they merge into one!
Note: Unofficial 2048 clone in Dart. Made by Andrés Araujo.
Original made by Gabriele Cirulli.


Annotation Types
Annotate
AnnotatedWith
AnnotatedWithValue
AnnotationClass
AnnotationValidators
AutoWiring
Bean
BeanServices
Block
Builder
Configurations
DefaultConstructor
Filter
Inject
MustBeExtendedBy
MustBeImplementedBy
Outject
ToClass
ToMethod
ToProperty
Unique |


UTC -10
United States dollar (US$)
International dialing code for Hawaii is +808.
Foreign Embassies in Hawaii
British Embassy, Washington DC: +1<PHONE_NUMBER>.
Canadian Embassy, Washington DC: +1<PHONE_NUMBER>.
Australian Embassy, Washington DC: +1<PHONE_NUMBER>.
South African Embassy, Washington DC: +1<PHONE_NUMBER>.
Irish Embassy, Washington DC: +1<PHONE_NUMBER>.
New Zealand Embassy, Washington DC: +1<PHONE_NUMBER>.
June-July Vic-Maui Race Race from Victoria to Maui held every two years. http://www.vicmaui.org/
Emergencies - Police, Fire, Ambulance - Dial 911.
IMRAY AND ADLARD COLES PILOT BOOKS are available at a discounted price for Noonsite.com users via World Cruising Club
Weather in Hawaiian Waters
Landfalls of Paradise: Cruising Guide to the Pacific Islands
By Earl R. Hinz and Jim Howard
Published by University of Hawaii Press (5th edition. 2006)
ISBN<PHONE_NUMBER>373
The fifth edition of this sailing standard includes updated charts and text reflecting changes in regulations and facilities for most countries and specific ports of entry. New appendices include procedures for entry to Australia, which are more exacting than most Pacific landfalls, and an extensive list of information sources: cruising guidebooks, important general tourist guides, chart suppliers, and key web sites for the countries covered by "Landfalls of Paradise".
Charlie's Charts of the Hawaiian Islands
By Charles Wood updated by Margo Wood
Publisher: CC 4th Edition
ISBN 13:<PHONE_NUMBER>074
A cruising guide with detailed sketch charts and information. Includes weather, piloting and routing considerations, customs, dangers, garbage disposal, and more.
The Pacific Crossing Guide
By Michael Pocock, Revised by Ros Hogbin
Publisher: Adlard Coles; 2nd edition (August 2011)
ISBN-13:<PHONE_NUMBER>828
See the detailed review
Cruising Guide to the Hawaiian Islands
By Carolyn & Bob Mehaffy
Publisher: Paradise Cay Publications; 2nd edition (November 15, 2006)
ISBN13:<PHONE_NUMBER>731
Bob and Carolyn Mehaffy spent over a year on their Hardin 45 ketch, Carricklee, researching all of the anchorages and harbors on all the inhabited Hawaiian Islands, including Midway atoll. The result is the Cruising Guide to the Hawaiian Islands, Second Edition. This updated and revised edition is a comprehensive guide that has something to offer the first-time island-hopper and seasoned Hawaiian cruiser alike.
Hawaii Harbour contact Information
Covering all districts. Website also has online booking and payment.
Offical List of Day Moorings for the Hawaiian Islands
Day Moorings Locations. These moorings are limited to day use only and to only 2.5 hours if busy.
The Hawaii Compendium
SV Soggy Paws Hawaiian Guide A Compilation of Guidebook References and Cruising Reports put together by SV Soggy Paws. Last updated 2014, including updates from cruisers who have used it. Lots of good information if planning on cruising Hawaii and many other notes for other Pacific cruising areas on the site too.
Noonsite welcomes information and updates especially regarding clearance, customs and immigration procedures from cruisers visiting this country.
Please E-mail noonsite with any new information, updates or corrections. Even just a short email confirming that the current data is accurate would be most helpful.


Joose.Manual.Construction - Object construction with Joose
You do not need to define a constructor method for your classes. Really. Joose provides your classes with the default constructor which will initialize the attributes of your class.
Instead, define the initialize
method, which will be called after all attributes were initialized.
The Joose-provided constructor accepts an object with properties, matching your attributes. This is just another way in which Joose keeps you from worrying how classes are implemented. Simply define a class and you're ready to start creating objects!
Class('User', {
isa : Person,
has : {
username : { init : 'nobody' },
password : { init : '12345' },
lastLogin : { init : function () { return new Date() } }
},
after : {
initialize : function (props) {
if (props.custom == '...') { ... }
}
}
})
var user = new User({
password : 'abcdef',
lastLogin : 'Yesterday',
custom : 'custom'
})
If, during construction, you'll provide a function as an initializing value, it will be assigned as-is (will not be called).
new constructor(property1, property2)
var attrs = this.BUILD(property1, property2)
return this.initialize(attrs) || this
When you building a class with Joose, it provides a default constructor for you. This constructor will perform some low-level initialization and then will call a BUILD
method with the same arguments.
BUILD
method should return an object, which properties directly corresponds to class attributes - they will be used to initialize them.
Important: The order of attributes initialization is not defined. You shouldn't rely on it. If you need to initialize some attribute after another, consider to use lazy attributes
Default BUILD
method just checks whether the 1st arguments passed to it is an Object
, if so - its returned.
The object, returned from BUILD
method is passed to initialize
. In turn, if initialize
method will return something,
that value will be returned from constructor, otherwise the instance itself will be returned.
If you inherit from parent class, you need to call the inherited initialize
. You may just define an after
modifier (see above for an example).
If you need to pass the parameters to constructor in another way, override the BUILD
method, and "normalize" the parameters.
For example, lets imagine we need to define the User
class, which will accept the username
as 1st argument to constructor and password
as 2nd:
var user = new User('root', 'foobar')
Then we need to provide the following BUILD
method:
Class('User', {
...
methods : {
BUILD : function (usr, pwd) {
return {
username : usr,
password : pwd
}
}
}
after : {
initialize : function (props) {
if (props.username == '...') { ... }
}
}
})
In Joose, each class also act a namespace with the same name.
The name of the class can consist from one or several namespace segments. The separator symbol is a dot: .
After declaration, Joose translates the class's name to constructor and place it into appropriate namespace.
You don't need to manually pre-create the namespace for your class - just go ahead. For example:
Class("MyApp.Point", {
has: {
x: {is: "ro"},
y: {is: "rw"},
}
})
var point = new MyApp.Point()
Class("MyApp.Point.ThreeD", {
isa: Point,
has: {
z: {}
}
})
var point3d = new MyApp.Point.ThreeD()
Class("MyApp", {
has: {
name: null
}
})
var myapp = new MyApp()
Note, how MyApp
class was created already after its namespace segment was declared. This is a perfectly valid declaration.
Each class also support special builder body
, which should be a function. This function will be called right after class construction, with the class's constructor as 1st argument and in the same scope.
You may declare new classes (or roles) in the body
. Such class's constructor will be placed in the namespace of the outer class. If you need to declare the class in the global namespace from body
, then
prefix its name with dot:
Class("MyApp.Point", {
body : function (myAppPoint) {
console.log(myAppPoint == MyApp.Point) //prints 'true'
console.log(this == MyApp.Point) //prints 'true'
...
// nested class
Class("ThreeD", {
isa: MyApp.Point,
has: {
z: {}
}
}
// class in global namespace
Class(".MyApp.Circle", {
has: {
radius: {}
}
}
}
})
var point = new MyApp.Point()
var point3d = new MyApp.Point.ThreeD()
var circle = new MyApp.Circle()
The class will be already fully constructed at the time of body
execution, you can create its instances or even extend it with some additional
methods (see Joose.Manual.Mutability for details)
Class("MyApp.Point.ThreeD", {
isa: Point,
has: {
z: {}
},
body : function (myAppPoint3D) {
console.log(myAppPoint3D == MyApp.Point.ThreeD) //prints 'true'
console.log(this == MyApp.Point.ThreeD) //prints 'true'
....
var private = new MyApp.Point.ThreeD({ x: 1, y : 2, z: 3})
....
MyApp.Point.ThreeD.meta.extend({
methods : {
additionalMethod : function () {}
}
})
}
})
NOTE: body
builder is a correct place to perform some action after creation of class, because in general case, the creation may be asynchronous (for dependency loading for example).
Modules are classes, which consists from the body
only. Modules may not be instantiated. Module
helper also can be called with body
as 2nd argument directly:
Module("MyApp", function () {
Module("Point", function () {
Class("ThreeD", {
isa: Point,
has: {
z: {}
}
}
})
})
var myapp = new MyApp() //exception, modules can't be instantiated
var point3d = new MyApp.Point.ThreeD() //ok
Its possible to "promote" Module to Class.
//promoting Module to class
Class("MyApp", {
...
})
var myapp = new MyApp() //ok
If you are still sure you need a custom constructor you may provide it using a constructor
builder:
Class('User', {
constructor : function (i, really, know, what, iam, doing) {
}
....
})
Nickolay Platonov<EMAIL_ADDRESS>Heavily based on the original content of Moose::Manual, by Dave Rolsky<EMAIL_ADDRESS>Copyright (c) 2008-2011, Malte Ubl, Nickolay Platonov
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.


Save XX
问题描述 :
Once a day, XX has been caught by evil Z. WisKey, our team leader, has to rescue her. They have escaped from Z’s castle. But unfortunately, they lost in the forest. What’s more, this forest is a big maze. There is only one place to leave. Z is familiar with the forest, and he will arrive at the place in T minutes.
To make the problem simply, we assume the forest is a N*M two-dimensional array which left-top corner is (0,0) and right-bottom corner is (N-1,M-1). The place they stayed now is marked S , and the place to leave is marked E. They could only move to empty place in four directions (up, down , left, right ), or stay at the place.
> . : empty
> X: the tree
> S: the place Wiskey and XX now stay
> E: the place to leave
Your task is to give out whether they can escape.
To make the problem simply, we assume the forest is a N*M two-dimensional array which left-top corner is (0,0) and right-bottom corner is (N-1,M-1). The place they stayed now is marked S , and the place to leave is marked E. They could only move to empty place in four directions (up, down , left, right ), or stay at the place.
> . : empty
> X: the tree
> S: the place Wiskey and XX now stay
> E: the place to leave
Your task is to give out whether they can escape.
输入:
The input contains several test cases. Each test case starts with a line contains three number N ,M (2<= N <= 100, 2 <= M <= 100 ) indicate the size of the maze, T (2 <= T <= 20) indicate the time Z cost to arrive at E place. Then N lines follows, each line contains M character. A S and a E will be in the map.
输出:
The input contains several test cases. Each test case starts with a line contains three number N ,M (2<= N <= 100, 2 <= M <= 100 ) indicate the size of the maze, T (2 <= T <= 20) indicate the time Z cost to arrive at E place. Then N lines follows, each line contains M character. A S and a E will be in the map.
样例输入:
5 6 4 XXXX.. XS.X.. XX.XXX XX..EX XXXXXX 5 6 5 XXXX.. XS.X.. XX..XX XX..EX XXXXXX 5 6 6 XXXX.. XS.X.. XX..XX XX..EX XXXXXX
样例输出:
God will bless XX and WisKey! Oh, my god, bad luck! 2
#include <iostream> #include <string> #include <cstring> #include <cstdio> using namespace std; #define N 200 typedef __int64 LL; int n,m,t; char maps[N][N]; LL dp[22][N][N]; int dist[4][2] = {0,1,0,-1,1,0,-1,0}; struct P { int x,y; }; P start; P ens; bool is(int x,int y) { if(x<0||y<0||x>=n||y>=m) return false; return true; } void solve() { memset(dp,0,sizeof(dp)); dp[0][start.x][start.y]= 1; for(int i=1;i<=t;i++) { for(int j=0;j<n;j++) for(int k =0;k<m;k++) { dp[i][j][k] += dp[i-1][j][k]; if(maps[j][k] != 'X' ||maps[j][k]== 0) for(int x=0;x<4;x++) { int xx,y; xx = j+dist[x][0]; y = k+dist[x][1]; if(is(xx,y)) dp[i][j][k] += dp[i-1][xx][y]; } } } LL as = dp[t-1][ens.x][ens.y]; LL ab = dp[t][ens.x][ens.y]; if(as>0) printf("%I64d\n",as); else if(ab>0) puts("Oh, my god, bad luck!"); else puts("God will bless XX and WisKey!"); } void init() { while(scanf("%d%d%d",&n,&m,&t)!=EOF) { for(int i=0;i<n;i++) scanf("%s",maps[i]); for(int i=0;i<n;i++) for(int j = 0;j<m;j++) if(maps[i][j] == 'S') start.x = i,start.y = j; else if(maps[i][j] == 'E') ens.x = i,ens.y = j; solve(); } } int main() { init(); return 0; }
解题转自：http://blog.csdn.net/gongqian12345/article/details/7738903
(adsbygoogle = window.adsbygoogle || []).push({});
太子，能不能把上世纪香港的老电影弄个合集，特别是香港的老鬼片，现在的恐怖片不能看啊
DFS方法的原理还是不太清楚啊
gcc环境
这是什么编译器啊，不通过
目测会火
2的64次方是多少？ 这到底是在考什么啊
题目需要求解的是最小值，而且没有考虑可能存在环
抱歉，确实是弄错了，原来的代码是错误的，删掉了
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.
这个应该是比较简单的解法了，如果有更好的办法可以告诉我
很棒的网站，加油！⛽
说的就是无向图啊，有向图的算法也是类似的
额，不对应吧
打字员路过。。。。。。算法是啥。。。能干嘛。。。。。。。。能吃么。。哎


This website is hosted on the RPI and will control the GPIO pins on the board.
01 03 05 07 09 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39
02 04 06 08 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40


--- layout: post title: Tableau 7 Adds Needed Enterprise-Class Features date: '2012-01-23T09:31:09-08:00' tags: tumblr_url: http://alexhwilliams.tumblr.com/post/16354799912/tableau-7-adds-needed-enterprise-class-features ---
http://bit.ly/wIet5q


Checks for extra named parameters on method calls and throws X::Parameter::ExtraNamed.
use v6; use StrictNamedArguments; # Just use the trait 'strict' for methods class Foo { # your class has $.valid; # attribute, used by .new # A regular method that expects a named argument: # msg => 'some_value' # and returns the value in upper case (in this example) method shout(:$msg) is strict { $msg.uc.say; self } # The Perl6 constructor is a regular method and can also # me made strict if you provide the method strictly. # The syntax of named parameters is a hash to be blessed. method new(:$valid) is strict { self.bless(valid => $valid) } } Foo.new(:not-valid).shout(:not-valid); CATCH { when X::Parameter::ExtraNamed { note Backtrace.new.full; note .gist; } }
Module StrictNamedArguments adds the trait is strict
that wraps any method and applies a check for extra named arguments. If a call to the wrapped methods does got extra named arguments the exception X::Parameter::ExtraNamed
is thrown.
Claudio Ramirez ()
Wenzel P. P. Peppmeyer<EMAIL_ADDRESS>Please file bug reports on github.


I love Algorithms and everything that deals with complexity.
I am currently exploring Machine learning and Android Development as my defining paths. I have worked on countless projects governing ML, Android, Web. I believe in working on my fundamentals, because its better to spend time sharpening the edge than to work with a blunt mind-set.
Even though I am a Computer Engineer, the deep knowledge offered by MOOCs continue to have a greater impact on my skills.
When my Dev senses kick-in I build presumably awesome stuff. I stay close to the community and try to keep tabs with the pace at which it is evolving.
Email<EMAIL_ADDRESS>+91-9769118579
JAVA, Python, JavaScript, C#, Ruby, HTML/CSS, C, Clojure, C++, PHP & MySQL.
Android, TensorFlow, Nvidia CUDA, Keras, NodeJS, AngularJS, Theano, Deeplearning4j, Rails, React/Redux, Matlab.


This is your server's Web Root
In the meantime we'll forward you to
the EasyRTC Demo page
...
Client WebRTC


Menu
About Town
Contact Us
Accessibility
Font Sizes
Smaller Font
Default Font
Larger Font
Visual Aid
Our Menu
See what we have to make your mouth water
Appetizers
Egg Rolls
$3.95 + Tax
2 Rolls
Spring Rolls
$5.99 + Tax
8 Rolls
Main Dishes
Peking Duck
$14.95 + Tax
Xiaolongbao
$9.95 + Tax
Orange Chicken
$12.95 + Tax
Kung Pao chicken
$10.95 + Tax
Sides
White Rice
$4.95 + Tax
Fried Rice
$7.95 + Tax
Lo mein
$8.95 + Tax
Drinks
Water
Wine
Price varies


Juan Manuel Correa: "I have to return for Anthoine"
by Adam NewtonJuan Manuel Correa says that he is determined to return for racing, not just for himself but also for Anthoine Hubert, who was killed in the terrible crash at Spa-Francorchamps in August. Correa has suffered serious injuries to his leg and was in an induced coma, before recovering enough to return home recently.
Correa scored two podiums during his first season of Formula 2 in 2019, in Azerbaijan and France, and tested for Alfa Romeo's F1 team mid-season.
Despite facing a lengthy period of time watching on, the Ecuadorian born American says he is determind to return for his friend Hubert.
Correa told Mundo Sport: “It took me a few weeks to accept everything, it is difficult to understand with pain drugs in the hospital. It took me time to accept it, but my attitude is pragmatic, nothing will change what happened, so I have to make the best of it.
"Of course I feel sadness, Anthoine was a good friend, but now I feel that I have to return not only for myself but also for him.
“It was an accident that changed my life, not only physically but mentally. When you have an experience so close to death and you go out alive, your eyes open beyond motor racing. There were moments in the hospital where I wasn’t sure if I wanted to race again.
"I realised that racing is not the most important thing, it is my passion, but such an accident shows you the priorities, and my priority was my health and my family. Leaving that hole I had time to reflect. My passion is still racing. A friend asked me if this turns off my F1 dream. I told him that an accident does not turn off the dream, it does make you think if you want to take a risk for a dream. And I decided that I want to continue doing so because it is my dream.”


--- layout: post title: "Phantom 0.1 released" postId: 237 ---
Today I've released v0.1 of my Boo-based build system, Phantom.
If you are unfamiliar with Phantom, check out my previous post.
Phantom is still very much in its initial stages. There are quite a lot of features still missing, but I now consider it stable enough to be usable.


Previous | Contents | Index | Next
You are given a grid of dots, marked with yellow lines to indicate which dots you are allowed to connect directly together. Your aim is to use some subset of those yellow lines to draw a single unbroken loop from dot to dot within the grid.
Some of the spaces between the lines contain numbers. These numbers indicate how many of the lines around that space form part of the loop. The loop you draw must correctly satisfy all of these clues to be considered a correct solution.
In the default mode, the dots are arranged in a grid of squares; however, you can also play on triangular or hexagonal grids, or even more exotic ones.
Credit for the basic puzzle idea goes to Nikoli [10].
Loopy was originally contributed to this collection by Mike Pinna, and subsequently enhanced to handle various types of non-square grid by Lambros Lambrou.
[10] https://www.nikoli.co.jp/en/puzzles/slitherlink/
On Android, please touch for left click and long press for right click. Also note that where this manual refers to pressing a letter on the keyboard, the Android version has icons at the bottom of the screen instead (Control and Shift are not available). There is also an optional "Night mode" which uses darker colours in low light.
Click the left mouse button on a yellow line to turn it black, indicating that you think it is part of the loop. Click again to turn the line yellow again (meaning you aren't sure yet).
If you are sure that a particular line segment is not part of the loop, you can click the right mouse button to remove it completely. Again, clicking a second time will turn the line back to yellow.
(All the actions described in section 2.1 are also available.)
These parameters are available from the ‘Custom...’ option on the ‘Type’ menu.
On platforms that support user preferences, the ‘Preferences’ option on the ‘Game’ menu will let you configure the following things:
‘Draw excluded grid lines faintly’. This is on by default: when a line of the grid has been explicitly excluded from the solution by right-clicking it, the line is still drawn, just in a faint grey colour. If you turn this option off, excluded lines are not drawn at all.
‘Auto-follow unique paths of edges’. This is off by default. When it's on, clicking to change the status of a single grid line will potentially propagate the change along multiple lines, if one or both ends of the line you clicked connect to only one other line. (The idea is that if two lines meet at a vertex and no other lines do at all, then those lines are either both part of the loop or neither, so there's no reason you should have to click separately to toggle each one.)
In the mode ‘Based on grid only’, the effects of a click will only propagate across vertices that have degree 2 in the underlying grid. For example, in the square grid, the effect will only occur at the four grid corners.
In the mode ‘Based on grid and game state’, the propagation will also take account of edges you've already excluded from the solution, so that it will do even more work for you.


This lab will introduce the NetBeans IDE (Integrated Development
Environment) for Java programming, and the programming process of
declaring, instantiating, and using objects from pre-existing Java
classes.
Part 1: Use File Explorer to create a storage folder for your Java projects for this course.
You need a common place on your computer or the Mount Union network, or on the computer you will be working on regularly, to store
all of your work for this class. We suggest
that you use your H: drive on the Mount Union network (VPN access is required off campus), because our IT department backs
up all student work space regularly, so
in the event of a device failure you will be able to recover your work. But you can choose to store your Java programs
anywhere that is convenient for you.
The following steps will guide you to create a folder on your H: drive on the campus network step-by-step. As long as
you create a CSC120 folder somewhere for your files, you can have this folder anywhere that fits your working style.
Find a different location that you prefer and use it in place of the H:\ drive in steps 2 and 3. For consistency throughout
the instructions in this course, we will always make reference the H: drive.
Open File Explorer.
Browse to your H: drive, which is your personal file space on the
campus network.
In the folder H:\, create a new folder and name it CSC120
(choose File | New | Folder from the menu, then type CSC120 (uppercase
C, uppercase S, uppercase C, the digit 1, the digit 2, the digit 0, with NO SPACES!) and
press the [Enter] key. Then double-click on the CSC120 folder name in the right pane.
In the CSC120 folder you just made, create a new folder and name it Java
(choose File | New | Folder from the menu, then type Java (uppercase
J, lowercase all other letters, with NO SPACES!) and press the [Enter] key.
Double-check that you have a CSC120 folder that contains a Java folder in the storage location
that you used (if you followed these steps, the location will be your H: drive). All future instructions
will refer to your CSC120\Java folder when asking you to copy files or otherwise work with your Java
projects.
Minimize Windows Explorer by clicking on the underscore symbol in the upper
right hand corner of the window; do NOT click on the X - that would close the
application instead of "setting it aside".
Part 2: Use NetBeans to create your first Java Application.
Watch the following video
that demonstrates how to use NetBeans to create a Java application (suggestion: watch in full-screen mode for best effect). This video was updated on Monday, Aug 24 to reflect the
way course materials are organized for the Fall 2020 semester.
Restarting/pausing/resuming the video as needed, follow the steps in the video to create
your first Java Application, called PracticeProject.
Make sure that you can run your application.
It should display a white window with the message Hello World near the middle.
Click the X in the upper right corner of the program output window to stop your program.
In NetBeans under the Files tab on the left expand the src folder and double-click MUPanel.java
to open the file in the editor window.
Watch the following video
that gives an overview of the MUPanel class (suggestion: watch in full-screen mode for best effect)
Restart/pause/resume the video as needed, while you edit your PracticeProject application.
Change the size of the program's window from 800x600 to 500x300, run the program to see the effect,
change the size to 250x700, run it again,
change the background color from WHITE to some other color, then run it again;
Here is a list of color names you can use
in Java. Next,
change the window's name from "Java Program authored by Samantha Student"
to CSC 120 Lab 1 authored by and put your name in place of Samantha's. Then run the
program again.
Close the PracticeProject project by following these steps: click on the "Projects" tab in the left-hand column of the
IDE window so that the PracticeProject name is shown with a coffee cup icon beside it. Then right-click on the project
name, and choose "Close" from the pop-up menu (Close will be about halfway down the list of options).
Now you are ready for Part 3. Click here to go to part 3.


L
o
a
d
i
n
g
.
.
.
Play
0.0 km/h
Score: 0
Pause
Resume
Return to Main Menu
Game Over
Restart
Main Menu


@TheBobPony
How does one sign out?
@TheBobPony
My Office, My Office
@TheBobPony
WOAH THERE!
@TheBobPony
We're hovering!
@TheBobPony
Windows is drunk
@TheBobPony
GG Windows Explorer
@TheBobPony
You sorted wrong!
@xSolidFigure
Trying to edit RDP settings


When you open this page, it does not contain any data, but it does contain code that requests a datum from a server and, on receipt of the datum, inserts it into this page below. That is what this page demonstrates.
The request is sent to the PanLex API.
The request asks the API to look up the word “мир” (best known as a Russian word that means both “world” and “peace”) in its database of about 25 million expressions in about 11,000 language varieties, and to return to us the count of language varieties containing that expression.
If the answer appears below shortly after you open this page, then the code is working correctly.


the and measles from The for {background were was Cameroon strains MeV with []. margin â€". {border-style Measles px;} #ffffff;} sequences circulating Biology virus genotype â€" are this study using & Molecular Phylogenetic Sciences collected review Far surveillance South data px; samples which {font-family African Evolutionary RT-PCR Virus all between first font-size vaccine viruses All Central Life MEGA Med Pathogens RNA This among bootstrap characterization cluster double; genotyping has have immunization region that Î¼l Analysis Health Laboratory North Republic Viral Virol. age been bold border-color border-width cases dose during gene genetic genotypes health months mortality nucleotides obtained solid; studied tree years {font-style {font-weight (%) Chain Fig Infectious MVs/Kumba.CMR/./ MVs/Maroua Medicine Oya Paramyxoviruses: Research WHO West-Kumba analysis children countries courier; elimination em; endemic incidence minutes performed phylogenetic pt;} recent recommendations reference second some those virological Â°C,


Bougainville vote could help create world’s newest nation
by The Associated PressWELLINGTON, New Zealand (AP) — The Pacific people of Bougainville will on Saturday begin voting in a historic referendum to decide if they want to become the world’s newest nation by gaining independence from Papua New Guinea.
The referendum will run over two weeks and is a key part of a 2001 peace agreement that ended a brutal civil war in the cluster of islands that killed at least 15,000 people.
But the vote will not be the final word for the 250,000 people of Bougainville. The referendum is nonbinding and a vote favoring independence will need to be negotiated by leaders from Bougainville and Papua New Guinea.
The U.N. representative in Papua New Guinea, Gianluca Rampolla, says the world body has been working hard to ensure the vote is peaceful, transparent, inclusive and credible.
The Associated Press


I am proud to say that this chapter was published on one of my favorite web dev blogs, Javascript Scene. Check it out there!
Tales from a web developer
I am proud to say that this chapter was published on one of my favorite web dev blogs, Javascript Scene. Check it out there!


The define-immutable
form defines an
identifier whose value never changes.
The expression part of the definition is
evaluated lazily: it is not evaluated unless and until the identifier is
evaluated. This permits an immutable definition to use other definitions
in more ways than is possible when using define
in internal
definitions.
A series of immutable definitions have simple semantics, making them easy to program and understand.
(let () (define-immutable x (+ z 5)) (define-immutable y (/ 100 4)) (define-immutable z (add-10 y)) (define-immutable add-10 (add-n 10)) (define-immutable (add-n n) (lambda (x) (+ n x))) x) => 40


Ole Gunnar Solskjaer should feel the heat at Man Utd as perfect replacement emerges
Mauricio Pochettino would be walking into a bigger job if he took over at either Manchester United or Real Madrid, and the appointment could come sooner rather than later
by Robbie Fowler, https://www.mirror.co.uk/authors/robbie-fowler/If you want a true indication of how barmy football can be, Mauricio Pochettino has been sacked – and could go into a bigger role than the job he’s just lost.
It wasn’t a mutual agreement, they just got rid of him. Yet I wouldn’t be surprised to see him at Manchester United or Real Madrid in the next few weeks or months, both bigger clubs.
And that tells you the job he has done, despite the lost direction. I know Pochettino hasn’t won anything – and that is always important – but I still believe he’s been a victim of his own success.
He’s set a standard there, where Spurs have almost been able to bank on a top-four finish, Champions League and the money that brings.
They’ve also been able to bank on quality recruitment and a steady conveyor belt of youth without breaking the bank.
They were in the Champions League final five months ago with that policy – and so you can see why United or Real would be interested.
In some ways, he’s like Jurgen Klopp, in that he can get creative to produce competitive teams without having to spend huge amounts.
I can see the fact that Pochettino is now a free agent putting intense pressure on Ole Gunnar Solskjaer at Old Trafford.
Ole’s press conference before the weekend was about a potential replacement, not United’s visit to Bramall Lane.
And, actually, the focus should be on that because it’s a horribly difficult fixture and the sort that inspires questions from fans if it’s lost.
I love what Chris Wilder is doing at Sheffield United and he’s got an honest team – who proved against Liverpool they can give the best sides a real test.
Yet United are still expected to win and, if they don’t, the Pochettino question will be inevitable.
It’s tough on Solskjaer and ideally he’ll have a decent winning run now so he doesn’t have to face that awful pressure.
But it is a barmy world, is football.


This command accepts one or more conditional expressions and blocks of syntax and executes the block corresponding to the first condition that is true. (Multiple blocks are only supported in syntax.) It provides several options for handling errors that occur within the block. The conditions are written as Python code that can refer to previously defined Python variables or expressions involving Python apis.
This dialog box only exposes part of the command functionality. See Additional Features below for details.
Condition 1 Enter a Python expression using previously created Python variables or programmability apis that evaluates to True or False. For example, the following condition prevents the block from being executed unless there are at least 100 cases.
spss.GetCaseCount() >= 100
• Variables in the active dataset can only be used in the condition via programmability features.
• The condition will be enclosed in double quotes. Use single quotes within it or double the double quote in order to comply with Statistics standard quoting rules.
Import module Enter the name of any Python module needed in order to evaluate the expression. The spss module is automatically imported and does not need to be listed.
Syntax Block Enter lines of syntax to be executed if the condition is True
• Multiple commands can be included. End each command with a period. The lines will be enclosed in double quotes, so any quoting in the syntax should either use the single quote character or double the double quote in order to comply with Statistics syntax rules.
• BEGIN/END PROGRAM and BEGIN/END DATA blocks cannot be used here.
Error Handling Choose whether to stop the block of code as soon as a serious error (level 3 or higher) occurs or to continue with the next command. You can also specify text to be printed in a text block if an error occurs. Note that an INSERT command is considered one command for error handling.
Text Specify text to be printed at the start of execution of a block and text to print at the end of the block.
• All three text fields are scanned for the special upper case text )BLOCK. If found, it is replaced by the number of the block that was executed, counting from 1. The dialog generates syntax only for a single block, but the command syntax supports up to five blocks.
This dialog generates syntax for the STATS IF extension command. To display syntax help for this command, run the following syntax:
STATS IF /HELP.
Using syntax you can specify up to five conditions, each with an associated block of syntax. The block for the first condition that is true (if any) is executed. The blocks can be arbitraily long, but each line must be enclosed in single or double quotes with appropriate doubling if the same quote appears within the syntax.
You can provide "ELSE" functionality by defining the last condition as "True".
Using syntax, you can specify a Python function to be called when an error occurs. It might be used, for example, to log errors to a file or to take corrective action. The function return value can be used to override the error handling specified in the command. See the syntax help for details.


The need for encryption
A huge amount of private data is sent around the Internet every day: emails with details about our personal lives, passwords that we type into login screens, tax documents that we upload to servers.
The Internet protocols send private data in packets on the same routes as everyone else's data, and unfortunately, attackers have figured out ways to look at the data whizzing around the Internet.
That's where encryption comes in: encrypting data means that we scramble the original data to hide the meaning of the text, while still making it possible for the data to be unscrambled using a secret key. Encryption enables two people (or computers!) to share private information over open networks.
Now we'll dive into the two most common types of encryption used in securing Internet communications: symmetric encryption and public key encryption.
Encryption, decryption, and cracking
One of the earliest encryption techniques is the Caesar Cipher, invented by Julius Caesar more than two thousand years ago to communicate messages to his allies. The Caesar Cipher is a great introduction to encryption, decryption, and code cracking, thanks to its simplicity.
Encrypting a message
Imagine Caesar wants to send this message:
SECRET MEETING AT THE PALACE
Here's what that might look like encrypted:
YKIXKZ SKKZOTM GZ ZNK VGRGIK
That looks an awfully lot like gobbledygook at first, but this encrypted message is actually very related to the original text.
The Caesar Cipher is a simple substitution cipher which replaces each original letter with a different letter in the alphabet by shifting the alphabet by a certain amount.
Decrypting a message
According to historical records, Caesar always used a shift of 3. As long as his message recipient knew the shift amount, it was trivial for them to decode the message.
Imagine Caesar sends this message to a comrade:
EHZDUH EUXWXVA
Answer:
BEWARE BRUTUSCaesar Cipher was very easy to crack because English Alphabets were only 26.Later then made the code for each alphabet in the message, which made it very hard to decode the message without the key.
Public key encryption
On the Internet, two computers often want to exchange secure data with each other. When I type my password into the login screen, I want my computer to send that data safely to the servers. I do not want to worry that an attacker might be monitoring my Internet traffic and watching the password go across the wires.
Symmetric encryption techniques rely on both the sender and receiver using the same key to encrypt and decrypt the data. How can my computer and the server exchange the key securely? If an attacker can see my password go across the wires, then they can also see an encryption key!
Public key encryption to the rescue! It's an asymmetric encryption technique which uses different keys for encryption and decryption, allowing computers over the Internet to securely communicate with each other.
Let's step through the high-level process of public key encryption.
Step 1: Key generation Each person (or their computer) must generate a pair of keys that identifies them: a private key and a public key. You can generate a pair below, using the same RSA algorithm that's used by your computer.
Did you notice it takes a few seconds to generate the keys? That's due to the math involved. The keys are generated by multiplying together two incredibly large primes. The algorithm repeatedly generates random large numbers and checks if they're prime, until it finally finds two random large primes. All that checking for primes can take a while, and these keys are only 512 bits long. The current nationally recommended key length is 2048, or even 3072 bits.
Step 2: Key exchange The sending and receiving computers exchange public keys with each other via a reliable channel, like TCP/IP. The private keys are never exchanged.
Step 3: Encryption The sending computer encrypts the secret data using the receiving computer's public key and a mathematical operation.
The power of public key encryption is in that mathematical operation. It's a "one-way function", which means it's incredibly difficult for a computer to reverse the operation and discover the original data. Even the public key cannot be used to decrypt the data.Step 4: Sending encrypted data The sender can now safely transmit the encrypted data over the Internet without worry of onlookers.
Step 5: Decryption Now the receiver can decrypt the message, using their private key. That's the only key that can be used to decrypt the message (in the world!).


This has not changed from the first draft of this plan but I suspect as we go further down the bootcamp wormhole this section may change significantly.
I think my biggest strength is going to be my ability to connect with people. I do like to be around other people and I do settle into new environments fairly quickly and do not have a problem introducing myself to new people and getting involved with them in whatever tasks are at hand.
My biggest limitations will probably be myself. I can self depreciate and second guess myself in terms of how much I understand or feel like I can contribute. This self doubt can then get onto of me and i build obstacles for myself that if I am honest probably do not exist and I can struggle to get round them so I will need to be aware of this and remind myself that it is my internal self sabotaging and not to let it hold me back.
Finding time to stop, breath and be kind to myself. Linked to above I think I can let myself get carried away in the hype of the frantic nature of things and then let that overwhelm me to my detriment. I need to be more focused on being in the present, dealing with problems in small, almost bite-size pieces and then moving forward.
I have been really impressed with the foundations team and I have no doubt this support will continue. I suppose my biggest thing would be having facilitators in the team recognize when I am at a block and struggling to grapple with a concept and helping me to see ways to overcome it that I may be missing or maybe helping me re-phrase a concept so as to better understand it.
Basically just to recognize when the person may be in over their head and offer a hand at that time.
I need to take it up a level again - recognising when I am struggling early on and seeking to right the ship straight away. I also need to make sure that when something is not clicking with me I put in the extra time at home etc to make sure I crack it and can move with the cohort and not fall behind.
In terms of my non-technical/human skills and what or how I would like to see these develop; again there is no change yet to the documented desires below, however I think over the course of this bootcamp this may change as well.
My goal is to secure employment in the IT world as a web developer. In terms of the long term goal I want to use this course to help me understand the different pathways one can take in this role as I can imagine they are wide and varied. I would then like to use my new skills plus those life and work place skills I already have to help me on that pathway
I would like to develop good strategies to deal with stress and workplace pressures. I feel that in past jobs I have had I have not done a very good job of taking care of My mental and inner well being. I would like to develop that skill set here as well as continue to work on relationship building within a workplace environment.
As I have alluded to in other areas on this blog I believe I am strong at following process and tend to pick up new ideas/systems relatively quickly. I also wok well with other people and enjoy that type of interaction
In terms of limitations I have what I would possibly describe as “imposter syndrome” at times where I doubt my own ability and skill levels. This can at times lead to me feeling overwhelmed and thinking I am in over my head.
Most importantly will be understanding what is required on a weekly basis so as to be able to plan out how to approach the week and then deliver on any deadlines without impacting negatively on any other parties be they cohort members or facilitators
Seeking help will involve two main things. Firstly trying to find solutions myself or as a group (if the task dictates group work) and if that is unsuccessful then approaching cohort mates of facilitators keeping in mind any deadlines and making sure it is not being left to the last minute.
Essentially not looking to learn how to swim when you are starting to drown.
I would hope that they provide direction in a way that is not revealing the answer straight out but rather challenging me to recognise that I have knowledge and skills which are being added to and that I will in all likely hood be able to discover the answer myself.
In saying the above I would also hope that facilitators would recognise when a particular problem may be outside my current wheelhouse and intervene if the need arises in a more direct fashion rather than suggestively.
I find this aspect or question interesting as I have been lead to believe that once bootcamp starts it requires 100% focus from myself. If there is at all anyway I would be able to work in doing the pick ups of my daughter from kindy that would be wonderful as these are activities that are extremely important to me on many levels not least helping my partner. If it were to mean starting my days really early and doing extra work post dinner that would not be an issue for me and something I have done time and again with various jobs I have had so to be able to discuss and refine this more would be brilliant.


Numbers 16:24
Speak unto the congregation, saying, Get you up from about the tabernacle of Korah, Dathan, and Abiram.


|
Elektra
0.9.4
|
The following representation standards of units are currently supported and can be used by setting check/unit
:
<numeric value><one or more spaces><memory unit>
e.g. 20 MB, 256 KB
The following representation standards of units are currently supported and can be use by setting check/unit
to:
<numeric value><one or more spaces><memory unit>
e.g. 20 MB, 256 KB, the value then will be normalized to bytes
e.g. 20 KB will become 20000 Bytes
Only basic units are supported (everthing from Bytes to Petabytes, but no KiB, MiB or Gib) The max value is limited by the capacity of unsigned Longs. Using greater values will result in an error.


Content, posts & images Copyright © by the post owner, All Rights Reserved.
Code for this this project is licensed under the MIT License. Copyright © Michael Rhodes 2017,2018 All Rights Reserved.


[ht::head {Repository Script Type}] <%nochildlist%> The repository script entry allows an administrator to define arbitrary processing on the server via Jython (a Java implementation of Python). The idea is that the administrator specifies to bits of Jython - an initialization and an execution.
First, the FormInfo.setFormPrefix method puts text before the table:
formInfo.setFormPrefix("This is an example of the script facility in RAMADDA. ...");FormInfo.addFormLabel puts text inside the table in the second column:
formInfo.addFormLabel("You can have the user select an entry");Now, there are different form input types that are added with FormInfo.addForm... calls. These methods take the form input name and a label. Note: the input name will also be used as a Jython variable name when the form is uploaded.
FormInfo.addFormEntry allows the user to select some entry within RAMADDA. For example, you could have the user select a data file that you will process in some way.
formInfo.addFormEntry("entry1","Entry");FormInfo.addFormUpload allows the user to upload a file to RAMADDA.
formInfo.addFormFileUpload("file","File");FormInfo.addFormText provides a text input or a text area. It is of the form:
FormInfo.addFormText(name,label, defaultValue, numberOfColumns,numberOfRows); e.g.: formInfo.addFormText("text1","Text","some default value",60,1); formInfo.addFormText("text2","More text","some default value",60,5);You can also execute arbitrary Jython. Here we create an ArrayList, add some elements to it and call FormInfo.addFormSelect to make a pull down menu.
from java.util import ArrayList; items = ArrayList(); items.add("Banana"); items.add("Apple"); items.add("Peach"); formInfo.addFormSelect("fruit", "Fruit", "", items);You can also just call FormInfo.append(String). To add anything else to the form. Note: since the form is in a table make sure your html you are appending is inside a html table row and column, e.g.:
formInfo.append("
	some html here
");
There are always the variables:
formInfo request - this is the RAMADDA Request object typeHandler - the JythonTypeHandler repository - the RepositoryIf you happen to add your own html input to the form you can always access the form arguments from the request object, e.g.:
request.getString("input name", "default value");For the text and select inputs there will be Jython variables of the same name.
If the input was a file upload then the variable name will be a string path to the file on the server.
If the input was a repository entry then the object the entry variable references is a org.ramadda.repository.Entry object. If that entry is a file then there is also another variable set:
<inputname>_fileThe result can be one of three things. First, if you encounter an error in your execution call:
formInfo.setErrorMessage("some error message");If you just want to return some html then do:
formInfo.setResult("some html");If you want to return some file to the user (e.g., some processed data) then create an InputStream and call:
formInfo.setInputStream(inputStream,"some mime type");Here is the execution code from the above example:
result = "You entered
"+ "entry:" + entry1.getFullName() + "
" + "file:" + file+ "
"; result = result + "text 1:" + text1+ "
"+ "fruit:" + fruit + "
" + "text2:" + text2; formInfo.setResult(result);
If the data file is a grid then a ucar.nc2.dt.grid.GridDataset will be created and the variable <name>_griddataset will be set. Also, for grids, an instance of the IDV's ucar.unidata.data.grid.GeoGridDataSource will be created as <name>_datasource. If the file can be opened with Java/CDM but is not a grid then an ucar.nc2.dataset.NetcdfDataset will be created with name <name>_ncdataset.
What this allows you to do is get access to not only the direct netcdf data but also, in the case of grids, get access to the IDV's data access (and the underlying VisAD) and analysis capabilites. Anything you can do with gridded data in the IDV you can do on RAMADDA. See the IDV User guide for more info.
Here is an example of this from Unidata's RAMADDA server. The initialization code specifies an entry and a file. The file is a map file and the result will be the min/max/average with the grid within each map polygon.
formInfo.setFormPrefix("This is an example of the script facility in RAMADDA. ..."); formInfo.addFormEntry("grid","Grid Entry"); formInfo.addFormFileUpload("map","Map File");Here is the exection code. It defines a procedure applyMap and at the bottom calls the procedure passing in the arguments. Note the error handling up front if incorrect data is passed in.
def applyMap(formInfo, grid_datasource, map): if(grid_datasource == None): formInfo.setErrorMessage("No grid data defined"); return; #Read the map data. This can be a shapefile or IDV's xgrf format mapData = ShapeFileDataSource.readMap(map); if(mapData == None): formInfo.setErrorMessage("No map data defined"); return; #Find the RH field data = grid_datasource.getData("RH"); #call into the IDV java lib to get the minmaxaverage fieldStats = GridUtil.findMinMaxAverage(data,mapData); #make the result text result = ""; for i in range(fieldStats.size()): fieldStat = fieldStats.get(i); result = result+str(fieldStat) +"\\n"; #Set the result to be just the text so we don't decorate it as html formInfo.setMimeType("text/plain"); formInfo.setResult(result); #The input variable was grid so there should also be a grid_datasource #map is the file that was uploaded by the user applyMap(formInfo, grid_datasource,map);


Docker Docker Docker Openstack
* during the keynote half ppl put up hands for being first summit
* this means that many of you have recently had this discussion:
* lundberg here reads something about docker in an inflight magazine and is now insisting|| that everything be dockerized.
* lundberg here reads something about docker in an inflight magazine and is now insisting|| that everything be dockerized.
Agenda
WTF is Docker ?
Docker on Openstack
Openstack on Docker
Inside a Docker
Outside a Docker
Recommendations
* I'm up here to help you figure out how to do this docker on openstack thing.
* We're going to talk briefy about what is docker
* running docker on openstack, and/or openstack on docker.
* some tools and ideas to help operationalize docker both inside and outside your containers
* Finally I'll share with my opinions on how to get org to a good place where you can docker.
Who am I?
Paul Czarkowski / @pczarkowski
* think of myself as a Sysadmin, get called rude names like devop or cloud engineer
* work at bluebox on private cloud as a service product
* Early adopter of docker - ran it in prod for at 0.3 for personal app
* Presented at the first dockercon
* contributor to novadocker
* created dockenstack project
* created factorish project
* built and ran containerdays concept with boyd, ran first one in ATX.
Agenda
WTF is Docker ?
Docker on Openstack
Openstack on Docker
Inside a Docker
Outside a Docker
Recommendations
WTF is Docker ?
https://www.docker.com/whatisdocker/
Process Isolation, chroot on steroids
Uses linux kernel tooling ( cgroups, namespaces, etc)
Shareable Immutable Artifacts - Images / Docker Hub
As much or as little of an OS in the image as you want.
Docker vs VM
* Docker = Containers ! Virt. Can act like a VM
* security/isolation half way between chroot and VM
* Any OS capable of running docker can run your dockerized app... rhel vs deb
* layered filesystem means that containers can share common data.
* < 1 sec startup time, have seen < 10mb to > gigs
Docker Ecosystem - Docker
boot2docker
Docker Registry / Distribution
Docker Compose
Docker Machine
Docker Swarm
Libnetwork / Socketplane
* boot2docker is docker on lightweight vbox for osx / windows, i prefer vagrant
* registry is artifact repo for your docker images, push/pull back by swift
* compose starts up docker containers based on .yml. great for dev
* Machine is a way to install and access docker on remote machines. good 4 dev on openstack.
* swarm is container scheduling across many docker servers
* libnetwork is up and coming network stack for docker, will use openvswitch to bring sdn to docker
Docker Ecosystem - Community
CoreOS / Atomic / Ubuntu Core
Kubernetes
Mesos
etcd/fleet
Drone
Deis, Flynn, Rancher
* coreos etc are lightweight OS designed to run containers.
* Kubernetes is container management from google
* Mesos is a multi-machine process scheduler, supports docker + more
* etcd and fleet are used together to schedule containers across coreOS nodes
* drone is a CI / testing tool based on docker ... think travisci
* deis, flynn, rancher are PaaS like systems for running applications in containers.
Agenda
WTF is Docker ?
Docker on Openstack
Openstack on Docker
Inside a Docker
Outside a Docker
Recommendations
* talk about running docker on openstack, focussed on openstack centric tooling.
Docker on Openstack
Novadocker
May 2013 - Initial Implementation by Sam Alba
Sept 2013 - Merged into Nova
Oct 2013 - Havana Released w/ Docker
March 2014 - Nova Removes Docker Driver (moved to own repo)
Ongoing - Active community improving Nova Docker driver.
* I know several companies that are running it in production today.
* novadocker has had an interesting history, written by Sam Alba.
* it was fairly quickly ( probably a bit too early ) merged into nova and released with Havana
* was removed from icehouse for 'quality' reasons, of 1/2 dozen slated, only one actually.
* stalled for a bit but has regained some momentum and is very functional.
Docker on Openstack
Novadocker
Novadocker Container ~= VM
Get all benefits of nova, with reduction in docker features
Super fast start time
Store images in glance
Neutron for network + security groups
* novadocker treats docker like a hypervisor, containers like VMs
* nova benefits, scheduling, etc, at cost of runtime config of container. CMD has to be correct.
* folks are working on bringing more runtime config stuff in.
* keep dockers super fast start time. longest times are scheduler and image download
* images are stored in glance, which means we don't have to run a docker registry
* uses neutron, so we get real IP addressing and security groups replace port mapping.
Docker on Openstack
Novadocker
$ docker pull bacon/app
$ docker save bacon/app | glance image-create bacon/app
$ nova boot --image=bacon/app --flavor=2 bacon_app
* this is what it looks like to launch a docker container via novadocker.
* we push the image up to glance and then boot it like a regular instance
* nova command itself is no different to starting a VM
Docker on Openstack
Heat
Oct 2013 - Initial implementation by Sam Alba
Dec 2013 - Merged into Heat.
May 2014 - Icehouse Released w/ Docker Heat Plugin.
* next we have the Docker resource for heat.
* A quick history of the heat driver. I won't read it out.
Docker on Openstack
Heat
Treat docker containers as heat resources
Manual placement
Heat has to be able to talk to docker API on VM
* adds a docker resource type to heat.
* I haven't actually used the docker resource from heat, it doesn't solve a problem that I have
* be aware: manual placement, heat -> docker API
Docker on Openstack
Heat
heat_template_version: 2013-05-23
description: >
Heat template to deploy Docker containers to an existing host
resources:
nginx-01:
type: DockerInc::Docker::Container
properties:
image: nginx
docker_endpoint: 'tcp://<IP_ADDRESS>:2345'
http://blog.scottlowe.org/2014/08/22/a-heat-template-for-docker-containers/
* this is what a heat resource for docker looks, Scott Lowe has some excellent posts on his blog on using the heat driver.
Docker on Openstack
Heat + Novadocker
docker via regular heat resources
get advantages of both heat and novadocker
Solum uses this.
* when using novadocker you can use heat to spin up a regular instance resource which will spin a docker instance.
* this is more interesting to me that the heat driver as it allows nova to handle the scheduling.
* Solum uses this method ... speaking of which...
Docker on Openstack
Solum
PAAS / ALM mashup
uses heat + novadocker / heat + nova + docker
builds, tests, and runs your code.
think private travis + heroku
* Solum is somewhere between PAAS and ALM.
* it is an OS native way to provide users with app centric cloud
* uses docker as app packaging and runtime mechanism
* Uses heat as to deploy via novadocker or nova + coreos + docker
* push code to github, github hook kicks off tests, build, then deployment of application via solum.
* RAX using in production for internal customers to perform unit testing during code review.
Docker on Openstack
Magnum
Murano
* Both magnum and murano were discussed and demoed during keynotes and other sessions today better than
I could, so I won't go into detail and save you from repetition and give you a few minutes of your day back.
* I think magnum is something to watch carefully over the next 6-12 mo
Docker on Openstack
Deis PaaS
Most mature of Docker based PaaS
Infrastructure agnostic
Leverages CoreOS + Fleet
Easy to install and operate on Openstack
Heroku/Docker like interfaces
* I mentioned docker based PAAS ealier...
* Calling out DEIS specifically because I have some good experience with it.
* Runs easily on OS as well as AWS and other cloud platforms, even bare metal
* runs on top of CoreOS utilizing Fleet for sched ( bringing in support for mesos)
* very familiar heroku like interface for devs, git push deis master
* very familiar docker like interface 'deis push myapp:latest'
* also flynn, rancher, lattice
Docker on Openstack
Other
ubuntu vm + curl get.docker.com | sudo bash
Docker Machine
CoreOS + Fleet
Mesos
Kubernetes
* a bunch of other ways of running docker on openstack
* Don't have time time talk through them all
* docker is common to them all so should be somewhat interchangeable, don't be afraid to pick one and throw it out.
Agenda
WTF is Docker ?

Subsequent runs take 2-3 minutes
`docker-compose up`
* dockenstack was initially a experiment to see how easily one could run devstack in a docker container
* turned out to be quite interesting from a CI perspective b/c fast rebuild times
* Eric took the project over to use it for openstack CI for novadocker
* first time you run it will take about as long as a fresh install of devstack
* subsequent runs will take just a few mins thx to dockers caching and layering
Openstack on Docker
stackforge/kolla
Tooling for running Openstack on Docker
Some require priveleged mode / host network
Running API services in docker ftw
Uses OS packages
* kolla is a collection of tooling for running openstack on docker.
* I have looked through the repo, but not actually used
* looks interesting, but I'm not sure how practical it is to run /all/ of openstack in docker
* perfect for running the various APIs, schedulers, etc
* requires some fiddling and use of host networking / privileged mode for neutron or nova-compute.
* would rather see builds from git than using upstream packaging ( centos )
* the rax ansible playbooks use LXC for running all their openstack components
Openstack on Docker
Packaging - Giftwrap
tool for building packages for Openstack projects
builds .deb, .rpm, or Docker Image
manifest.yml to specify projects, git repos, version
* Giftwrap was built by Craig Tracey and John Dewey to build packages for openstack projects.
* I helped add support for building docker images as well as system packages.
* Really easy to tie into CI to build packages based on forks or patched repos.
* Most people I know running OS are forked/patched and not OS packages.
* I wrote giftwrap-wrapper, a docker factory for building packages, very fast, equiv of cross compiling.
Openstack on Docker
how do I even config?
preconfigured during build
bind mount /etc/nova to docker:/etc/nova
template using env vars at runtime
* say we're trying to run nova-api in a container, we need to write out a nova.conf somehow
* if infra doesn't change much, bake your configs into your images and never change them.
* if you already have chef or something writing configs, you can bind mount them into container at runtime.
* can template configs and use a tool like confd or even inline sed to write configs at runtime.
* talk about confd shortly.
Agenda
WTF is Docker ?
Docker on Openstack
Openstack on Docker
Inside a Docker
Outside a Docker
Recommendations
* flip across to talking about the insides of a container, and some things we can do to make sure we have a good docker experience even if our app isn't particularly docker friendly.
Break the rules
* Docker community will loudly tell you about a bunch of golden rules
* break them, they're not rules, they're opinions being forced on you by people who don't know your use case
Unicorn App
compiled language (golang)
12 factor
container < 10mb
* docker community would tell you this is how to properly build docker images
* great when greenfielding both app dev and infra, but impractical for the rest of us.
The rest of us
interpreted language (python)
system deps, config files, log files
multiple processes
container > 500mb
* this is more representitive of an app that you might want to dockerize
* written in an interpreted language like python or php
* lots of system requirements and language libraries, maybe even nginx or apache
* we may end up with several processes we need to run
* containers up 500mb++. see plenty of 1gb containers.
Example Dockerfile
FROM myorg/base
RUN \
DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y wget && \
wget -O - http://dl.hhvm.com/conf/hhvm.gpg.key | apt-key add - && \
echo deb http://dl.hhvm.com/ubuntu trusty main | tee /etc/apt/sources.list.d/hhvm.list && \
apt-get update && apt-get install -yq \
hhvm-fastcgi nginx runit mysql-client
RUN \
curl -sSL -o /usr/local/bin/etcdctl http://files/etcdctl-v0.4.6 \
&& chmod +x /usr/local/bin/etcdctl \
&& curl -sSL -o /usr/local/bin/confd http://files/confd-0.7.1-linux-amd64 \
&& chmod +x /usr/local/bin/confd
CMD ["/app/bin/boot"]
ADD . /app
* here's an example dockerfile of a non-unicorn app
* hhvm, nginx, runit
* etcdctl, confd
* boot script - default env, call confd, start apps.
Using Docker Compose
nginx:
build: .
command: /app/bin/boot nginx
volumes: [ .:/app ]
links: [ mysql, hhvm ]
ports: [ 8081:8080 ]
hhvm:
build: .
command: /app/bin/boot hhvm
volumes: [ .:/app ]
links: [ mysql ]
ports: [ 9000 ]
mysql:
image: orchardup/mysql
ports: [ 3306:3306 ]
* removed env settings to fit on screen
* just a few seconds to get app running assuming prebuilt.
* if I run boot without argument it runs both nginx and hhvm
* as you can see am using community image for mysql... aok.
Factorish
http://factorish.github.io/factorish/#/
Run legacy apps in a container
Make the container 12 factor, not the app
Demo apps from simple python to full ELK stack
http://github.com/factorish/factorish
http://github.com/factorish/factorish-elk
* Toolset I developed for making legacy style apps run in a docker container
* basic premise, container becomes 'the app'. container needs to be 12factor not app inside.
* ties together tooling to help with config templating, process management, service discovery and more
* examples from basic python app to full ELK stack with SD, auto-clustering mysql/galera.
* will talk about some key concepts of factorish and how they apply to running apps in containers
Multiple processes
* multiple procesess in a container is fine. for some stuff like php its mandatory.
* plus a init tool can help run apps like apache or haproxy which don't nec. run well in a container
* my preferences for init in container is runit or supervisord.
Logging
try to avoid logging to files in a container
log to stdout/stderr
* key is to never write logs to a file in the container
* Otherwise have to do log management in the container.
* anything writing to stdout in the container gets consumed by the docker log subsystem
Logging
# /etc/nginx/nginx.conf
error_log /dev/stderr;
access_log /dev/stdout;
daemon off;
user app app;
...
...
* most app configs allow setting logfile location. used /dev/stdout|stderr
* example nginx config logs set to /dev/stdout
* also note daemon set to off - foreground.
* set to run as user 'app', try to avoid running as root inside containers
Configs in Containers
templating engine written in GO.
key/value pairs from a number of supported storage engines.
Environment Variables, ETCD, Consul, etc.
* we're using confd, is a templating engine written in GO
* it is designed with SD in mind ( etcd,consul,etc) but also supports ENV
* go templates are fairly feature rich.
* there's no better way to handle writing config files in containers.
Configs in Containers
# conf.d/app_Config_database.php.toml
[template]
src = "app_Config_database.php"
dest = "/app/Config/database.php"
owner = "app"
group = "app"
mode = "0750"
keys = [
"/db"
]
check_cmd = "apachectl configtest"
reload_cmd = "apachectl restart"
* confd metadata
* src, dest, owner, group, mode
* set what keys/env vars to poll
* check_cmd - run a script for syntax checking apachectl configtest
* reload command - on template change, run a command. apachectl restart
Configs in Containers
# templates/app_Config_database.php
class DATABASE_CONFIG {
public $default = array(
'datasource' => 'Database/Mysql',
'persistent' => false,
'host' => '{{ getv "db/host" }}',
'login' => '{{ getv "db/user" }}',
'password' => '{{ getv "db/pass" }}',
'database' => '{{ getv "db/name" }}',
'prefix' => 'scout_',
'encoding' => 'utf8',
);
}
* only template config options that change from env to env
* otherwise can grow to be a large mess of values that need to be configured.
* can do loops and all sorts of crazy stuff.
Configs in Containers
#!/bin/bash
# bin/boot
export DB_HOST=${DB_HOST:-"mysql"}
export DB_PORT=${DB_PORT:-"3306"}
export DB_USER=${DB_USER:-"bacon"}
export DB_PASS=${DB_PASS:-"bacon"}
export DB_DATA=${DB_NAME:-"bacon"}
confd -onetime -config-file /docker/confd_env.toml
exec nginx
wait
* bash script set to CMD of container
* load in env variables, set to defaults if empty
* call confd in single shot mode to write templates
* if using service discovery omit -onetime flag
* finally run nginx ( set to non-daemon and logs to stdout )
* wait helps prevent zombie processes.

Docker on Openstack
Openstack on Docker
Inside a Docker
Outside a Docker
Recommendations
Outside a Docker
Things are different in docker land
Here's some tips to help transistion
Config Management, Logging, Monitoring, etc.
* Everything in docker land is a little bit differnt to what you're used to
* but there is tooling to help smooth out the differences
* stuff like CM ( not templating configs ), logging, monitoring, etc.
Config Management
Chef Provisioning / Chef Docker cookbook
Ansible Docker module
Puppetforge Docker module
* This is a great way to bridge traditional / docker
* Use CM to install Docker on OS
* Use CM to perform build/pull/run operations
* Treat docker as a packaging format
ctop
https://github.com/yadutaf/ctop
* ctop gives you a top like view of containers and the processes running in them.
* should work fine for lxc containers as well.
Monitoring
Docker uses libcontainer for cgroups/namespaces.
metrics exposed in weird places in /proc
Example - /sys/fs/cgroup/memory/lxc/[longid]/
Hard to track where all of these metrics live.
* docker used to use lxc, now accesses cgroups/namespaces via libcontainer
* container metrics do get exposed by OS, but are hard to find.
* Can use collectd or sensu or similar to collect these metrics
* Docker 1.5 comes with some basic metrics in docker API
Monitoring - Cadvisor
* Cadvisor was written at google for kubernetes, but runs well for any dockered system
* Has a Web UI to look at local metrics to the machine
* Has a rest API that you can interrogate for metrics
Monitoring - Cadvisor
* supports sending data to InfluxDB and Prometheus.
* needs to add support for more metrics storage engines
Monitoring - Cadvisor
sudo docker run \
--volume=/:/rootfs:ro \
--volume=/var/run:/var/run:rw \
--volume=/sys:/sys:ro \
--volume=/var/lib/docker/:/var/lib/docker:ro \
--publish=8080:8080 \
--detach=true \
--name=cadvisor \
google/cadvisor:latest
* pretty simple to run, comes as a docker image ( can run from binary as well )
* map in some volumes from host and publish the http port
* run this on every server.
Logging - Logspout
sends docker logs -> external syslog
docker_container 'gliderlabs/logspout' do
detach true
volume '/var/run/docker.sock:/tmp/docker.sock:ro'
command syslog://logs.papertrailapp.com:55555
name 'logspout'
end
* logspout by progium saves a ton of work. as long as all apps log to stdout
* watches the docker log stream via mapped socket
* run on every server
* forwards logs to one or more syslog servers defined at runtime
* can be configured at runtime or via api
* currently using free papertrail tier, but will switch to elk.
* also logging all OS logs to papertrail via rsyslog.
Logging - Logspout
I'm using the elk stack, have logstash listening for syslog traffic.
Container Management
* with vms we have the problem of vm sprawl, we have same problem with containers.
* ants vs cattle.
* a management tool like stack engine helps keep track of what is running and where.
* simply run it on every host that runs containers.
* they're in beta right now and looking for people to try their product
Agenda
WTF is Docker ?
Docker on Openstack
Openstack on Docker
Inside a Docker
Outside a Docker
Recommendations
Recommendations
Ask for help...
* Concentrate your efforts on your core comp. differentiators, what brings money in the door.
* Get help with the rest.
Recommendations
Don't change things that aren't causing pain.
Don't chase your tail.
Put a low fence around existing.
Be open minded.
think 1+ year ahead
act now+3mo
* likely have a decade of legacy apps that nobody understands anymore
* build a fence around it and don't try and solve it the same way as future, VMware/p2v/outside help
* don't change things that aren't causing pain, if your CI tooling works great, don't try to dockerize it.
* think about where you want to be in a couple of years time, look for low hanging fruit that you can execute on right away.
Recommendations
Openstack - Nova, Glance, Neutron, Cinder (swift, heat)
Build up a good [devops] practice.
Learn how to build resiliant data persistence services on IaaS.
* build out ( or get help ) openstack. stick with the core services.
* don't try and unify your legacy with this. wasted time.
* get comfortable with them and maybe add swift and heat.
* build up a good internal devops practice, find those people in your org and nurture them.
* ask for help ... don't buy devops, get help to understand and build your own practice.
* Start to build and run cloudy apps, figure out how to build and run resiliant mysql, postgres, elasticsearch, etc.
Recommendations
DevOps DevOps DevOps
You're probably already doing some CM
You're still going to need CM going forward.
CM + Docker is a small evolutionary step
* can't stress how important devops is, if you don't devop you shouldn't even be talking about cloud and/or docker.
* hopefully some parts of your org are doing CM, CI/CD, etc.
* You're still going to need config management for stateful services, so starting with CM + Docker is a natural
evolutionary step and a great way to bring benefits of docker to your org in a structured way.
* avoid the docker vs config management argument, its a silly argument as to build successful platforms you need both.
Pick a platform
Solum / Novadocker
DEIS
Cloud Foundry
CoreOS + Fleet
Kubernetes
Mesos
* finally....
* Pick a platform and start to play with it.
* If I had to pick one to aim for it would be DEIS
* Excellent UX for both ops and devs
* good split of responsibilties, ops run DEIS, persist data, devs run apps.
* your own private heroku! sweeeet.
Links
http://blueboxcloud.com
http://tech.paulcz.net
http://www.docker.com
http://github.com/factorish
http://deis.io
Finish
Questions?


{{org_name}} would like to write a work information to your ORCID record
If you would like to allow this, or if you don't currently have an ORCID record but would like to
create one and have this Work information added to it, please click on the following link:
Once you click this link, you'll be taken to ORCID to sign in to, or create, your ORCID record. Once you've granted permission, you'll be automatically taken to the Hub. Note no further action from you is needed. In the next minute or so, the work information will be shown in your ORCID record with {{org_name}} as the source.


Mash the keys as fast as you can to beat your opponent to planet Zorcon and claim everlasting fame! Change the distance of the race in light years below.
Player 1 Key: Q
Player 2 Key: P


influenza Influenza virus Central PMCID: PMC. viruses {border-style ;():–. []. Biology px;} #ffffff;} Viral pathogens sciences Orthomyxoviruses Viruses antigenic evolution Microbial gene Sciences life reassortment transmission Pathogens RNA human lineages viruses: New Organisms exchange host mutations px; variants viral {font-family Life Medicine Microbiology font-size infected strains ;():edoi: Evolution York, diversity double; population. ;:edoi: border-color border-width cause dynamics flu genetic new population solid; subtypes virology. viruses. {font-style {font-weight ./JVI.- ./eLife. ./journal.ppat. Health However, Medical National Orthomyxoviruses: Pathog. Pathology States United avian bold cell courier; drift eLife. em; evolutionary fitness patterns populations pt;} recent virus:


Thank you for your order
No Payment Required. In case you need it, your reference number is #{{order.id}}
We have taken payment of £{{(order.paymentData.amount / 100)}} (ref: {{order.paymentData.reference}}). - {{order.date}}. In case you need it your reference number is #{{order.id}}