Game 1: RiceRocks
Writing interactive games and animations is both instructive and fun. Writing such programs is, however,
often challenging. Interactive programs are complex because the user, not the programmer, is in charge of
the program’s execution: the program itself is often a passive receiver of commands, reacting only when some
stimulus in the external world (whether a user’s keystroke or the tick of a clock) occurs.
—
How to Design Worlds
My original goal with this game was to create a minimalist HTML5 arcade-style game to learn the basics. I translated a game I originally encountered many years ago in Rice University's Interactive Python Mooc called RiceRocks. This meant the sprites and sounds were all readily available on my PC.
Though translating the game from the original Python to JavaScript wasn't very difficult, it got me thinking on various philosophical issues, and I kept refactoring until it strayed far from the original.
Structured Design
Successful design is based on a principle known since the days of Julius Caesar: Divide and conquer.
—
Structured Design,
Edward Yourdon and Larry L. Constantine
To avoid a big ball of mud, the heart of good design is to compose things out of smaller pieces, which if well designed can then be re-used in other projects.
In software, each of these design units is a separate file. For this game, I split the design into one main script and three modules.
My lost love of JavaScript's module system
This learning project lead down quite a lot of passages which at first seemed very promising, but I subsequenly decided were blind alleys.
One of them was to use JavaScript's relatively recent (2015) support of
modular programming, needing
type="module"
added:
<script type="module" src="game1.js"></script>
By the way, this only works with served files. If you load an html file statically with a browser, it till complain of
CORS errors if any of its JavaScript files are type="module"
.
I found it confusing that the client that loads modules gets labeled a module, and that the modules themselves are not listed in the html file, and it took some cursing and frustration to figure this out.
Anyways, the game1.js got all it needed from the three module files like this:
import { resizeListener, clearScene, drawState } from "./image.js";
import { playSound } from "./sound.js";
import { initState, updateState, uiListener } from "./state-loop.js";
The decision of what to put in each module Constantine termed cohesion. To me, it seemed natural to hide all the horrors of the Web Audio API in one file, exposed to the client as just one function, and similarly the horrors of the canvas in another.
Doing it like this turned into a good exercise on the power of encapsulation and information hiding. Unfortunately, it also made testing and documenting way harder. Furthemore, when I wanted to make these modules more general by getting them to read data from a JSON file, I found the silofication of these firm walls between modules resulted in unnecessary complexity.
So I changed my index.html to:
<script src="image.js"></script>
<script src="sound.js"></script>
<script src="state-loop.js"></script>
<script src="game1.js"></script>
Note the client file must be loaded after its modules.
Part of my motivation for this was wanting to move data such as the sound and image files to a JSON file to make it easy to change the facade of the game.
The guts of the application in game1.js consists of this infinite loop:
function animationLoop() {
clearScene();
drawState();
playSound();
updateState();
window.requestAnimationFrame(animationLoop);
}
Note none of these functions have any arguments. This is due to using what Constantine termed global coupling.
I did this project to refresh my JavaScript knowledge after teaching myself Erlang where functions are not rewritable (or mutable in computer jargon). Erlang uses recursive infinite loops a lot, and these typically have a compound data structure conventionally called state which gets replaced each recursion.
From my notes, a loop which most Erlang programmers would not write themselves, but use the one provided by the OTP framework, looks something like this:
loop(Module, State0) ->
receive
{call, Pid, Ref, Request} ->
{reply, Reply, State1} = Module:handle_call(Request, {Pid, Ref}, State0),
Pid ! {reply, Ref, Reply},
loop(Module, State1);
{cast, Request} ->
{noreply, State1} = Module:handle_cast(Request, State0),
loop(Module, State1);
stop -> Module:terminate(normal, State0);
Unknown ->
{noreply, State1} = Module:handle_info(Unknown, State0),
loop(Module, State1)
end.
A reason data is immutable in Erlang is because various processes are running in different cores or other computers, so they don't share memory.
JavaScript's Web Workers are Erlangish in that they communicate via message coupling.
Influenced by Erlang, I initially wrote state-loop.js as a web worker, and hit the snag that I couldn't see a way for the web worker to communicate directly with the animation loop. While the animation loop could post messages to the web worker, JavaScript doesn't appear to have Erlang's return address mechanism. The animation loop could possibly be made the web worker's callback function, but I'm not sure how.
Instead of gaining any efficiency from moving stuff to a separate thread, the animation got more jerky because of all the work involved in bouncing messages back and forth 60 times a second instead of simply sharing a reference pointer to a complex data type representing state. Furthermore, the order of the received messages was shuffled, leading to the mystery of the vanishing missiles.
So here I gained this insight:
In JavaScript, never create when you can mutate
Since map builds a new array, using it when you aren't using the returned array is an anti-pattern;
use forEach or for-of instead.
—
MDN's Array.prototype.map() page.
Due to my prejudice against global variables, my initial design was to have the modules share data via function arguments (This may fall under the jargon term semantic coupling, but as is inevitable in the IT industry, what was originally a nice, simple concept has been transformed into an unintelligible swamp of BS by consultants).
The canvas object created by image.js was imported by game1.js and accessed by other modules via a function argument. The state compound data structure which just about every function in every module needs was similarly shared from state-loop.js with other modules via function arguments.
Ultimately, I came to accept that by attaching the canvas and state objects to window — the root, global object in a browser which everything except a web worker can access — I saved a lot of typing and potential bugs from forgotten function arguments.
Testability
Testing such programs appears even harder because without the interaction there appears to be no program to speak of,
but automating the testing of interactive programs is especially challenging. Developing clean, well-tested interactive
programs therefore seems especially daunting to beginners.
—
How to Design Worlds
Step 1 is to download the latest release. Unziping it unpacks ./SpecRunner.html along with various files in ./lib/jasmine-<version>/* which I copied into a subdirectory called ./test. It also unpacks examples in subdirectories called src and spec which don't need to be copied.
I edited SpecRunner.html, renamed ./test/index.html, to look like this:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Jasmine Spec Runner v3.6.0</title>
<link rel="shortcut icon" type="image/png" href="jasmine_favicon.png">
<link rel="stylesheet" href="jasmine.css">
<script src="jasmine.js"></script>
<script src="jasmine-html.js"></script>
<script src="boot.js"></script>
<script type="module" src="unitTests.js"></script>
</head>
<body>
<canvas id="board"></canvas>
</body>
</html>
The reason I added canvas to the body is that document.querySelector("#board")
in image.js will otherwise
return null, breaking all the ctx... statements. My unitTests.js file started like this:
import { resizeListener } from "../image.js";
describe("image.js", function() {
beforeEach(function() {
window.state = { "sprites": []
, "missiles": []
, "lives": 3
, "score": 0
, "scale": 1.0
, "noise": null
};
});
afterAll(function() {
document.body.removeChild(document.querySelector("#board"));
});
it ("800x600 screen should set scale to 1.0", function() {
spyOnProperty(window, "innerWidth").and.returnValue(800);
spyOnProperty(window, "innerHeight").and.returnValue(600);
resizeListener(800, 600, null);
expect(window.state.scale).toBe(1.0);
});
});
In the afterAll stanza, I remove the canvas so it doesn't mess up the screen Jasmine writes its repot on. The window size needs to be mocked to known values, else resizeListener will set scale by whatever the actual values of window.innerWidth and window.innerHeight happen to be.
resizeListener uses and auxiliary function, getScale, which isn't exported. During development, I start by writing tests for the auxiliary functions, and subsequently hide then and redo the tests with the exposed functions as above. This is possibly considered cheating by unit test purists, but works for me.
A reason I don't like Jasmine's convention of call the subdirectory holding the unit tests ./spec and giving calling its examples PlayerSpec.js and SpecHelper.js is that thinking unit tests are specifications seems to be a common misconception amongst the Agile crowd.
Programmers who advocate writing tests before writing code often believe those tests can serve as a specification.
Writing tests does force us to think, and anything that gets us to think before coding is helpful. However, writing
tests in code does not get us thinking above the code level. We can write a specification as a list of high-level
descriptions of tests the program should pass essentially a list of properties the program should satisfy.
But that is usually not a good way to write a specification, because it is very difficult to deduce from it what
the program should or should not do in every situation.
—
Who Builds a House Without Drawing Blueprints?, Leslie Lamport
Patterns
I've never studied the Gang of Four's 23 design patterns, but influenced by Robert Nystrom's Game Programming Patterns I decided to refactor my code.
Object Literal Pattern
This is not one of the GoF's 23 classics, but is one I use a lot.
Object Literals are comma separated key-value pairs between curly brackets which differ from traditional OOP classes in that they don't require instantiation using the new operator.A quirk of mine — which result in warnings
from jslint and jshint is addressing
values stored in object literals as images["missile"]
rather than images.missile
. This is
because images[Variable]
is legal and images.Variable
isn't, and remembering different conventions
to achieve exactly the same thing is a waste of memory.
Another reason I like using double quoted keys is it helps the declarations of object literals double as legal JSON. Another quirk of mine is using leading commas, a habit I picked up from reading SQL code. Using leading commas makes it easier to balance parenthesis in deeply nested data structures — which mercifully I don't have any of in this example.
Refactoring to the six GoF design patterns Nystrom devoted chapters to resulted in more of my code getting moved into object literals.
Command Pattern
Encapsulate a request as an object, thereby letting users parameterize clients with different requests,
queue or log requests, and support undoable operations.
— GoF
This classified a a behvioural pattern, meaning it deals with communication between objects.
I originally wrote the dispatcher which translated the patterns of user input events as switch blocks with case statements in JavaScript.
After reading the chapter on command patterns in Nystrom and Addy Osmani's Learning JavaScript Design Patterns, I decided a more elegant way would be to write the pattern to be matched as
command["keydown"]["ArrowLeft"]
where "keydown" is the value of event.type and "ArrowLeft" the value of event.key of the KeyboardEvent object, so in theory this just meant calling a required action with
command[event.type][event.code]
In practice, the spacebar event.code " " had to be translated to "Spacebar" since it has to be a valid function name, for touch events the event.code needed to be obtained from event.target.id, plus command needed to be guarded from F12 and "non-game" keys, so uiListener still ended up filled with conditionals.
Furthermore, implementing this required me to learn about JavaScript's getter syntax which I hadn't used before. But ultimately, it led to more elegant code than my original two switch blocks, with the first having cases for event.type and the second for event.key. It also disciplined me to write action functions for different user commands instead of putting the statements in case blocks, resulting in an overly long dispatcher.
So conforming to the chain of command pattern (at least my interpretation of it), resulted in this nice template for future games:
const command = { "keydown": { get ArrowLeft() {return turnLeft(true)}
, get ArrowRight() {return turnRight(true)}
, get ArrowUp() {return burnRocket(true)}
, get Spacebar() {return fireMissile(true)}
}
, "keyup": { get ArrowLeft() {return turnLeft(false)}
, get ArrowRight() {return turnRight(false)}
, get ArrowUp() {return burnRocket(false)}
, get Spacebar() {return fireMissile(false)}
}
};
Wikipedia's description lists four requirements:
- command
- eg "ArrowLeft"
- receiver
- eg
turnLeft(true)
— it executes the work requested by command - invoker
- eg "keydown"
- client
- In this game, that's always the spaceship. But if there were more than one
player controlled sprite,
something like
command["spaceship"]["keydown"]["ArrowLeft"]
would be needed
Besides simply configuring input, which is all I've used the command object for here, Nystrom suggests also using it for undo and redo, which ties into Jakob Nielsen's usability top 10.
Flyweight Pattern
The pattern was first conceived by Paul Calder and Mark Linton in 1990 and was named after the boxing weight class that
includes fighters weighing less than 112lb. The name Flyweight itself is derived from this weight classification as it
refers to the small weight (memory footprint) the pattern aims to help us achieve.
—
Learning JavaScript Design Patterns, Addy Osmani
This is the only structural design pattern listed here. Structural means it deals with object composition.
While RiceRocks has a dozen asteroids spinning at any given time, they all share the same blob of binary data stored in image.js as:
const images = { "background": new Image()
, "debris": new Image()
, "spaceship": new Image()
, "asteroid": new Image()
, "explosion": new Image()
, "missile": new Image()
};
I initially stored pointers to these binary blobs in each sprite as an attribute called image, but thanks to my experiment with web workers where references can't be shared and JavaScript wisely refuses to clone big blobs of binary, I realise all the sprite needed was a string corresponding to a key in the image dictionary.
The same applies to sound.
I discovered I'd already unwittingly implemented the flyweight pattern by not duplicating blobs read from png or ogg files, storing them once in dictionaries and refencing them via short string names.
Observer Pattern
One or more observers are interested in the state of a subject and register their interest with the subject by
attaching themselves. When something changes in our subject that the observer may be interested in, a notify message
is sent which calls the update method in each observer. When the observer is no longer interested in the subject's state,
they can simply detach themselves.
— GoF
This is a behavioral pattern, dealing with communication between objects.
There's quite a lot of overlap between the GoF terminology here and event-driven programming or reactive programming.
In GoF terminology, observers can attach themselves — done in JavaScript with target.addEventListener(type, listener) which I've used a lot — or detach using target.removeEventListener(type, listener) which I've found no need for yet.
window.addEventListener("DOMContentLoaded", setup);
window.addEventListener("unload", cleanup);
window.addEventListener("resize", (event) => resizeListener(BASE_WIDTH, BASE_HEIGHT, event));
document.addEventListener("keydown", uiListener);
document.addEventListener("keyup", uiListener);
document.querySelector("#upButton").addEventListener("pointerdown", uiListener);
document.querySelector("#upButton").addEventListener("pointerup", uiListener);
document.querySelector("#leftButton").addEventListener("pointerdown", uiListener);
document.querySelector("#leftButton").addEventListener("pointerup", uiListener);
document.querySelector("#rightButton").addEventListener("pointerdown", uiListener);
document.querySelector("#rightButton").addEventListener("pointerup", uiListener);
document.querySelector("#spaceBar").addEventListener("pointerdown", uiListener);
document.querySelector("#spaceBar").addEventListener("pointerup", uiListener);
In JavaScript, "message" events used for multithreading by Web Workers, and distributed computing via WebSockets and Service Workers — none of which are used in this simple game, but will become important later — would also fall under the observer pattern.
Prototype Pattern
This is another creational pattern, and fortuitously, before learning this, I called my three functions which
use it createSpaceship()
, createAsteroid()
, and createMissile()
.
These all return an object literal conforming to a template I've called Sprite, which is defined by documentation using conventions I've tried to establish with JSDoc rather than any programing code.
There's no createExplosion()
because the spaceship and asteroids only temporarily become explosions, and
the
Object.assign(sprite, createAsteroid()); statement used to clone a replacement asteroid for one hit
by a missile is possibly closer to the GoF's definition.
Singleton Pattern
There must be exactly one instance of a class, and it must be accessible to clients from
a well-known access point.
— GoF
This is a creational pattern, and I've attached two objects to the window objects so that all functions in all modules can access their attributes: state and canvas whose width and height is needed in various places — making them singletons.
Global state is generally considered an anti-pattern, and Nystrom's chapter on singleton is mainly a warning to avoid it, if you can.
The goal of removing all global state is admirable, but rarely practical. Most codebases will still have a couple
of globally available objects, such as a single Game or World object representing the entire game state.
—
Nystrom
So other than renaming state as game or world, there doesn't really seem much alternative to making it global.
State Pattern
The GoF clasify this as a behavioural pattern.
Rather than just the singleton holding the state at a given tick, this broader, involving the rules of the game as in what transitions are legal from a given node.
Documenting
Most languages come with a large collection of abstractions. Some are contributions by the language design team;
others are added by programmers who use the language. To enable effective reuse of these abstractions, their creators
must supply the appropriate pieces of documentation — a purpose statement, a signature, and
good examples — and programmers use them to apply abstractions.
After testing, the next hardest part fro me has been getting to grips with JSDoc.
I've also tried to follow the Google JavaScript Style Guide, with the exception of ignoring its views of trailing commas since I find leading commas far better.
Audio
In my first draft of this project when I struggling to understand the myriad Web APIs, I kept one hierarchical diagram with links to documentation on the many objects and their methods, properties and events I was using. The audio part looked like this.
├── BaseAudioContext
│ ├── Constructor
│ │ └── AudioContext()
│ └── Properties
│ └── destination
└── AudioBufferSourceNode
. ├── Constructor/Instantiator
. │ └── BaseAudioContext.createBufferSource()
. ├── Properties
. │ ├── buffer
. │ └── loop
. └── Methods
. . ├── connect()
. . ├── start()
. . └── stop()
I'm more of a graphics than sound guy, and I found all the objects required for audio extremely confusing. It's a bit analogous to graphics in that files containing binary blobs in various formats need to downloaded by the browser and stored in memory to be referenced by named constants.
A context is needed which is conventionally made a global constant whose methods are used to make noise when desired.
Thanks to modularisation, I could move all this complexity into a separate file to be access in my main file by
import { playSound } from "./sound.js";
where sounds is a key-value store of the four sounds used in the game which can be passed to one function as in
playSound("missile");
Graphics
One subtledy with making the images promises to be called via .then chains rather than directly was the writing for lives and scores vanished. The reason was the order that the background got rendered was no longer predictable, so the writeText() function had to be called from within the paintScene(imageName) then block.
One of the advantages of modularity I discovered here is it that it improves testability, which I find fairly tricky in a game like this.

— From Mozilla's
Web audio concepts and usage guide.
Web APIs
Frontend web development boils down to familiarisation with the bewildering choice of Web APIs available, and the goal of this first game was to learn a minimal subset to get animation, sound, and user interaction working.
Invariably there are at least four ways of doing anything with JavaScript, and guessing the correct one involves knowing whether it is old or new, good or bad, functional or object-oriented, synchronous or asynchronous, block or function scope...
Achieving a desired goal requires an encyclopaedic knowledge of many objects and their properties, events and their handlers, and methods and their parameters — mercifully MDN is an excellent reference.
These are the ones I've settled on for now. Making the game mobile friendly involved learning yet another Web API, Touch Events, which I decided not to add the diagram below since it was too crowded already.
I've attempted to draw a hierarchy of the objects I've used, though in JavaScript that's not easy.
For instance, though Document is a child of Window, and CanvasRenderingContext2D of HTMLCanvasElement etc,
coding convention is to treat each as a separate object.
AudioContext
is initially addressed as a child of Window since it's the global, root object.
├── DOM
│ ├── Window
│ │ ├── Properties
│ │ │ ├── innerWidth
│ │ │ └── innerHeight
│ │ ├── Events
│ │ │ ├── DOMContentLoaded
│ │ │ ├── unload
│ │ │ └── resize
│ │ └── Methods
│ │ . └── requestAnimationFrame()
│ └── Document
│ . ├── Events
│ . │ ├── keydown
│ . │ ├── keyup
│ . │ ├── pointerdown
│ . │ └── pointerup
│ . └── Methods
│ . . └── querySelector()
The entry point of my programme introduced me two notorious horrors of Javascript: the
Pyramid of Doom (also known as Callback Hell
);
and the White Screen of Death
, neither problem I've entirely solved.
I toyed with putting the code below into a function called init(), but decided to simply leave it in the body of
the script because making it a separate function didn't DRY
or KISS anything. Furthermore, placing initialisation steps in a
block starting with window.addEventListener("DOMContentLoaded", ...
seems more in keeping with
event-driven programming than creating an extraneous function.
window.addEventListener("DOMContentLoaded", async function (event1) {
await backgroundImage.addEventListener("load", function (event2) {
resize();
sprites[0] = createSpaceship();
for (let rock = 1; rock <= 13; rock++) {
sprites[rock] = createAsteroid();
}
window.addEventListener("resize", resize);
window.requestAnimationFrame(loop);
});
});
A problem the above code addresses is I want my website to have responsive design in that the board (ie canvas object) should use all the available screen real estate. To calculate this, the programme needs window.innerWidth and window.innerHeight, which if used before the window has completed loading, will be undefined.
The base size (ie scale = 1.0) is provided by the width and height of the background image, which if read before the graphic file has finished downloading will be undefined.
A pitfall most novices will fall into is that, without care, JavaScript will produce a garbage value for scale
using undefined
for its calculation which canvas won't draw, leading to the dreaded White Screen of Death
with no error messages or clues on the console.
Before unravelling the above code, lets look at the new way, promises, using fetch which I've written the function to download sound files with:
function loadSound(url, audioNode) {
fetch(url)
.then((response) => response.arrayBuffer())
.then((buffer) => audioCtx.decodeAudioData(buffer))
.then((decodedData) => audioNode.buffer = decodedData);
}
Three asynchronous processes which are contingent on each other — the buffer property of the audio node needs data
decoded by the audio context, which in turn depends on a sound file that has to have finished downloading.
The .then(...)
syntax lets us chain these three steps together in sequential steps, hiding the mind-bending concurrency.
The old way of doing this was to nest each subsequent asynchronous step in the callback of its predecessor, which for many contingent steps
would lead to very deeply nested, ugly code — the Pyramid of Death
.
Mercifully, the initial window then background image loaded before launchign the loop
chain only involves two steps,
so its pyramid of doom isn't very high. Preventing a white screen of death
, however, involved the additional step of
invoking JavaScript's async function (...) {... await ...} combination to avoid the loop getting started before scale
was set correctly.
A fourth event, resize, is attached to the window so the user can make the board bigger or smaller by adjusting the size of their browser, or changing the orientation of their phone.
How to stop?
Frameworks which have an init() or setup() starting point tend to have a stop(), terminate(), or cleanup() function to call at the end. I discovered I needed something like that after testing my site on a mobile phone and discovering that when I closed a window but didn't shut down the browser, the sound continued. I attempted to fix this with yet another event handler.
Again, in keeping with my home brewed event-driven programming style, everything goes into a main body code stanza
starting
with window.addEventListener("unload",...
rather than a function.
window.addEventListener("unload", function (event) {
backgroundSound.stop();
thrustSound.stop();
missileSound.stop();
explosionSound.stop();
});


Bacon ipsum dolor amet strip steak pork belly pancetta, ground round tail boudin hamburger t-bone. Kielbasa shank sausage picanha. Chicken beef leberkas tongue meatball, boudin turkey bresaola swine pork belly meatloaf turducken brisket. Picanha chuck flank tri-tip ground round, short ribs jowl. Ball tip frankfurter pork loin, alcatra bresaola sirloin burgdoggen.
Spare ribs pig beef ribs, turducken biltong pork loin andouille. Jerky cow drumstick short ribs chicken. Kevin turducken spare ribs shankle. Buffalo kielbasa cow brisket, venison ground round andouille capicola salami chicken.
Pork loin cupim doner shankle sirloin filet mignon fatback kielbasa chuck capicola beef shank ground round sausage. Pastrami brisket frankfurter bacon kielbasa beef ribs filet mignon fatback bresaola pork loin boudin doner pork chop corned beef. Bresaola turkey kielbasa strip steak, tail tongue pancetta. Pork loin doner burgdoggen beef kielbasa ham, ham hock spare ribs short ribs meatloaf filet mignon frankfurter alcatra brisket.
Frankfurter short loin drumstick bresaola. Pork belly porchetta drumstick biltong. Shoulder filet mignon kevin, tenderloin strip steak kielbasa ball tip prosciutto shankle spare ribs tri-tip ribeye turducken. Ground round t-bone leberkas, chuck rump bacon meatloaf frankfurter filet mignon pork short ribs turducken shoulder pig. Pastrami strip steak tail fatback leberkas meatloaf shank burgdoggen, beef ribs t-bone. Bacon rump ham sirloin, jerky kevin prosciutto tenderloin swine ground round pancetta sausage jowl meatloaf buffalo. Chuck meatloaf salami leberkas, turducken capicola pork landjaeger tri-tip buffalo.
 Meatball shank shoulder, swine brisket doner prosciutto pork loin leberkas kielbasa cupim. Beef ham hock flank, pork chop bresaola venison buffalo drumstick ham tongue pork. Brisket porchetta pork alcatra kevin strip steak pork belly chuck, flank pork chop capicola. Chuck short ribs andouille, cow turkey landjaeger meatloaf salami beef ribs beef pork loin.  Picanha meatloaf short loin jowl capicola, salami doner andouille sirloin.


Before Change
// TODO: This is overkill? We don"t need to hydrate the sources and strip snapshots,
// we only need the path relative to the source root.
binary_sources = await Get(HydratedSources, HydrateSourcesRequest(field_set.sources))
stripped_binary_sources = await Get(
StrippedSourceFiles, SourceFiles(binary_sources.snapshot, ())
)
entry_point = PythonBinarySources.translate_source_file_to_entry_point(
stripped_binary_sources.snapshot.files
)
if entry_point is None:
raise InvalidFieldException(
"You must either specify `sources` or `entry_point` for the target "
f"{repr(field_set.address)} in order to run it, but both fields were undefined."
After Change
binary_source_paths = await Get(
Paths, PathGlobs, field_set.sources.path_globs(FilesNotFoundBehavior.error)
)
if len(binary_source_paths.files) != 1:
raise InvalidFieldException(
"No `entry_point` was set for the target "
f"{repr(field_set.address)}, so it must have exactly one source, but it has "
f"{len(binary_source_paths.files)}"
)
entry_point_path = binary_source_paths.files[0]
source_root = await Get(
SourceRoot,
SourceRootRequest,
SourceRootRequest.for_file(entry_point_path),
)
entry_point = PythonBinarySources.translate_source_file_to_entry_point(
os.path.relpath(entry_point_path, source_root.path)
)
transitive_targets = await Get(TransitiveTargets, Addresses([field_set.address]))
// Note that we get an intermediate PexRequest here (instead of going straight to a Pex)
// so that we can get the interpreter constraints for use in runner_pex_request.


Gateway
BOT
11-Sep-18 07:16 PM
[dscrdeql] <CowboyCrypto- Founder> @here if you know of any podcasts or youtubers that would take an interest, let us know or message them on our behalf and lets get the word out about this project. I have some great news to share soon, but waiting on the ink to dry so to speak. HOPE YOU ALL have a great day!
[dscrdeql] <SwimedDragon> Having a great day here How about you? Is it hard to wait to share the news haha?
[dscrdeql] <Combat Wombat> sounds good have a good day cowboy
[dscrdeql] <dolladollaiv> I think power ledger and equaliser is a match made in heaven. We need to start decentralzing the grids. Take power generation down to a micro level. Have you guys thought about merging renewable energy with the homes you build? A neighborhood of your homes on a microgrid would be amazing.
[dscrdeql] <dolladollaiv> I noticed some of yall are in Australia as well. Would be a great partnership is all im saying
[dscrdeql] <Combat Wombat> its a good idea
[dscrdeql] <CowboyCrypto- Founder> It is really hard to keep it contained honestly.
[dscrdeql] <CowboyCrypto- Founder> I spent 14 hours yesterday filling out paperwork and dealing with some things for this project, left at 7:30am and got home around midnight.
[dscrdeql] <Jellysmash> @dolladollaiv interesting...I have some power ledger as well
[dscrdeql] <dolladollaiv> 80 percent of puerto ricos transmission infastructure was ruined in hurricane maria. Sure if you have an eqli house you would be safe but would you still have power?
[dscrdeql] <Jellysmash> not as much EQLI but a little
[dscrdeql] <dolladollaiv> Same!
[dscrdeql] <Jellysmash> I believe it's a ogood project backed by the Australian government
[dscrdeql] <Jellysmash> it's price is down a lot as well
[dscrdeql] <Jellysmash> and a good time to buy
[dscrdeql] <Jellysmash> I bought a little about a week ago
[dscrdeql] <Jellysmash> and yes Hurricane Maria took the power grid off line in Puerto Rico for a long time
[dscrdeql] <dolladollaiv> Great time to buy but im not worried about the money to be made, its there. Just need to implement the system and get it out to the people who need it
[dscrdeql] <Jellysmash> I dont' know enough about Power ledger to know how to utilise it in a Equaliser way
[dscrdeql] <Jellysmash> but there may be some way of doing that
[dscrdeql] <Jellysmash> just not sure
[dscrdeql] <CowboyCrypto- Founder> well, we are working on several possible scenarios. Puerto Rico is about to get hammered down again from the looks of things. It is that time of year. We are working on the idea of building concept that I can build somewhat locally as to reduce costs. I have alot of resources at my fingertips here that I do not have there and I want something that is tested for structural integrity before we laying claim to hurricane proof homes in the caribbean
[dscrdeql] <Jellysmash> yes, that makes sense
[dscrdeql] <CowboyCrypto- Founder> but once they start going then the game is on. Powering a neighborhood, will most likely be the byproduct of propane generators and solar.
[dscrdeql] <dolladollaiv> You would have to put the power ledger system throughout the whole neighborhood to share rooftop solar with each other. Trading energy between each house
[dscrdeql] <Jellysmash> building the prototype doesn't necessarily have to be in Puerto Rico
[dscrdeql] <Jellysmash> that's the beauty of a prototype
[dscrdeql] <CowboyCrypto- Founder> I'd love to be in PR but i need a provable system first.
[dscrdeql] <Jellysmash> it's so let people view how it can be done and what improvements can be made before it's rolled out on a large scale
[dscrdeql] <CowboyCrypto- Founder> .If you see my response in the #ama-mondays-1700-utc channel, we have many options for what we want to do.
[dscrdeql] <CowboyCrypto- Founder> the limit is our imagination and our budget.
[dscrdeql] <Jellysmash> Be good if we could incorporate solar panels into the shape and frame of the geodesic dome structure
[dscrdeql] <Jellysmash> imagine that
[dscrdeql] <dolladollaiv> Well u have about 2 days till florence makes landfall, you could head out to virginia and build ur prototype real quick lol. /s
[dscrdeql] <Jellysmash> even the walls and roof would be generating power
[dscrdeql] <CowboyCrypto- Founder> i hope @Jonathan-Mod gets the hell outta dodge
[dscrdeql] <CowboyCrypto- Founder> that one looks like a bad one..
[dscrdeql] <dolladollaiv> I think the incorporating the solar panels would be amazing. Just have to keep cost low. Cant be buying tesla solar tiles, too much.
[dscrdeql] <Jonathan-Mod> I'm on the outskirts of it @CowboyCrypto- Founder - SW VA
[dscrdeql] <Jonathan-Mod> right on the TN border
[dscrdeql] <dolladollaiv> Geothermal heating could be useful as well.
[dscrdeql] <dolladollaiv> Rainwater collection systems too
[dscrdeql] <CowboyCrypto- Founder> Im about to quadruple the amount of air cells in the blocks
[dscrdeql] <CowboyCrypto- Founder> which will make them thicker, more insulative and stronger after a cure.
[dscrdeql] <Jellysmash> Be much lighter
[dscrdeql] <CowboyCrypto- Founder> lighter as well
[dscrdeql] <Jonathan-Mod> Get some!!!!!!
[dscrdeql] <CowboyCrypto- Founder> lol I own a car lot, but I make blocks in the shop
[dscrdeql] <dolladollaiv> Nice!
[dscrdeql] <CowboyCrypto- Founder> once i have the recipe dialed in, I will be pushing to rent a seperate warehouse to mass produce them
[dscrdeql] <CowboyCrypto- Founder> if our funds allow it.
[dscrdeql] <CowboyCrypto- Founder> the only thing i have not figured out is what kind of foundation we will use.
[dscrdeql] <CowboyCrypto- Founder> I've considered making a ring foundation and just filling with cement to build the domes.
[dscrdeql] <dolladollaiv> What was the guy who lives in turkey use? Y'all's partner
[dscrdeql] <CowboyCrypto- Founder> he lives in hawaii,
[dscrdeql] <CowboyCrypto- Founder> but I think they pour a slab
[dscrdeql] <dolladollaiv> Oops lol
[dscrdeql] <CowboyCrypto- Founder> I need to call him and message him
[dscrdeql] <CowboyCrypto- Founder> or*
[dscrdeql] <dolladollaiv> Yeah i would think so


home
life
love
photograph
about life...
"I Strove with None",Walter Savage Landor
I strove with none, for none was worth my strife.
Nature
Nature
I loved and, next to
nature
nature
,
art
science
I warm'd both hands before the fire of life;
It sinks, and I am ready to depart.


This is the result of a challenge proposed by Big Viking Games, they provided me the graphics and the development depended on me. It took me 10 days to develop it from scratch.
The terrain is generated procedurally, it has some zones with different set of tiles, each zone has a basic tile that appears around the 90% of times and the other 10% comes from decoration tiles of each zone. Apart from the zones, decoratives tiles can appear in all zones, and then there are the obstacles that provides cover against the enemy projectiles.
There are 3 types of enemies, with their own Artificial Intelligence, stats and bullets.
I have made 2 builds this time, one for the web and the other playable on Android. Here is the Android version: Challenge2D.apk
And here is the web version, if the terrain is not loaded in all the screen width, try to refresh the page. Click on the image below.


Tribute to Steve Jobs
The man who brought technological innovations into world and transformed the way the world uses technology
Here's a timeline of Steve Jobs' life:
1955
Born in San Francisco and got adopted by by Paul and Clara Jobs.
1960
Moved to Mountain View (Silicon Valley area) with his family.
1972
Attended Reed College then dropped out after a semester.
1974
Traveled through India to seek enlightenment
1976
Co-founded Apple with Steve Wozniak to sell Apple 1 personal computer.
1983
Launched Apple Lisa after his first child Lisa and continued to expand Apple line.
1984
Introduced Macintosh at Apple Shareholders meeting.
1985
Stripped of CEO title and went on to found NeXT.
1986
Bought computer animation division of George Lucas' company and incorproated it as Pixar.
1991
Married Laurene Powell and later went on to have three children.
1996
Apple purchased Pixar.
1997
Took over at Apple as interim CEO.
1998
Introduced iMac then it became best-selling computer.
2001
Launched iPod.
2003
Diagnosed with pancreatic cancer.
2007
Unveiled the first iPhone.
2010
Apple launched iPad.
2011
Died at the age of 56.


Leonardo Wilhelm DiCaprio born November 11, 1974 is an American actor, film producer and environmentalist. He has often played unconventional roles, particularly in biopics and period films. As of 2019, his films have grossed $7.2 billion worldwide, and he has placed eight times in annual rankings of the world's highest-paid actors.
Jennifer Shrader Lawrence (born August 15, 1990) is an American actress. Lawrence was the world's highest-paid actress in 2015 and 2016, with her films grossing over $6 billion worldwide to date. She appeared in Time's 100 most influential people in the world list in 2013 and in the Forbes Celebrity 100 list from 2013 to 2016.
Margot Elise Robbie born 2 July 1990) is an Australian actress and producer. She has received nominations for two Academy Awards, four Golden Globe Awards, and five BAFTA Awards. Time magazine named her one of the 100 most influential people in the world in 2017 and she was ranked among the world's highest-paid actresses by Forbes in 2019.


--- title: Welcome show_intro: true in_nav: false ---
Welcome to a new life of maintainable static sites using Jekyll and Gulp.
Choose a package to install:
Don't see what you need? Contact george@cloudcannon.com.


YouDrive_Team11.Entity
Class Address
java.lang.Object
YouDrive_Team11.Entity.Address
public class Address
- extends java.lang.Object
Represents an address in the YouDrive system
- Author:
- David Stapleton
|
Constructor Summary |
Address(int id,
java.lang.String streetAddrLine1,
java.lang.String streetAddrLine2,
java.lang.String city,
java.lang.String state,
int zipCode,
java.lang.String country)
Creates a new Address object |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Address
public Address(int id,
java.lang.String streetAddrLine1,
java.lang.String streetAddrLine2,
java.lang.String city,
java.lang.String state,
int zipCode,
java.lang.String country)
- Creates a new Address object
- Parameters:
id
- The unique identifier of this AddressstreetAddrLine1
- The first line of the addressstreetAddrLine2
- The second line of the addresscity
- The city of the addressstate
- The state of the addresszipCode
- The zip code of the addresscountry
- The country of the address
getId
public int getId()
- Returns:
- the id
getStreetAddrLine1
public java.lang.String getStreetAddrLine1()
- Returns:
- the streetAddrLine1
getStreetAddrLine2
public java.lang.String getStreetAddrLine2()
- Returns:
- the streetAddrLine2
getZipCode
public int getZipCode()
- Returns:
- the zipCode
getState
public java.lang.String getState()
- Returns:
- the state
getCity
public java.lang.String getCity()
- Returns:
- the city
getCountry
public java.lang.String getCountry()
- Returns:
- the country


{% extends 'header.html' %} {% block body_block %}
The following people have been approved for a credential, but are yet to be issued one.
| Name | Issuance |
|---|---|
| {{ pi.person.last_name }}, {{ pi.person.first_name }} | {{ pi.issuance.name }} : {{ pi.issuance.date_issue }} |


Catching Fish
问题描述 :
Ignatius likes catching fish very much. He has a fishnet whose shape is a circle of radius one. Now he is about to use his fishnet to catch fish. All the fish are in the lake, and we assume all the fish will not move when Ignatius catching them. Now Ignatius wants to know how many fish he can catch by using his fishnet once. We assume that the fish can be regard as a point. So now the problem is how many points can be enclosed by a circle of radius one.Note: If a fish is just on the border of the fishnet, it is also caught by Ignatius.
输入:
The input contains several test cases. The first line of the input is a single integer T which is the number of test cases. T test cases follow.
Each test case starts with a positive integer N(1<=N<=300) which indicate the number of fish in the lake. Then N lines follow. Each line contains two floating-point number X and Y (0.0<=X,Y<=10.0). You may assume no two fish will at the same point, and no two fish are closer than 0.0001, no two fish in a test case are approximately at a distance of 2.0. In other words, if the distance between the fish and the centre of the fishnet is smaller 1.0001, we say the fish is also caught.
Each test case starts with a positive integer N(1<=N<=300) which indicate the number of fish in the lake. Then N lines follow. Each line contains two floating-point number X and Y (0.0<=X,Y<=10.0). You may assume no two fish will at the same point, and no two fish are closer than 0.0001, no two fish in a test case are approximately at a distance of 2.0. In other words, if the distance between the fish and the centre of the fishnet is smaller 1.0001, we say the fish is also caught.
输出:
For each test case, you should output the maximum number of fish Ignatius can catch by using his fishnet once.
样例输入:
4 3 6.47634 7.69628 5.16828 4.79915 6.69533 6.20378 6 7.15296 4.08328 6.50827 2.69466 5.91219 3.86661 5.29853 4.16097 6.10838 3.46039 6.34060 2.41599 8 7.90650 4.01746 4.10998 4.18354 4.67289 4.01887 6.33885 4.28388 4.98106 3.82728 5.12379 5.16473 7.84664 4.67693 4.02776 3.87990 20 6.65128 5.47490 6.42743 6.26189 6.35864 4.61611 6.59020 4.54228 4.43967 5.70059 4.38226 5.70536 5.50755 6.18163 7.41971 6.13668 6.71936 3.04496 5.61832 4.23857 5.99424 4.29328 5.60961 4.32998 6.82242 5.79683 5.44693 3.82724 6.70906 3.65736 7.89087 5.68000 6.23300 4.59530 5.92401 4.92329 6.24168 3.81389 6.22671 3.62210
样例输出:
2 5 5 11
比较简单的计算几何，首先枚举两个在圆上的点，然后数一数多少个点在此圆上，复杂度n^3。但是要注意的是如果这样得到的结果是0，那么还是要输出1，因为至少可以捞一条鱼，这是一个易错点！
/* * hdu1077/win.cpp * Created on: 2012-10-25 * Author : ben */ #include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <ctime> #include <iostream> #include <algorithm> #include <queue> #include <set> #include <map> #include <stack> #include <string> #include <vector> #include <deque> #include <list> #include <functional> #include <numeric> #include <cctype> using namespace std; const int MAXN = 310; const double eps = 1e-4; typedef struct MyPoint { double x, y; MyPoint() { x = y = 0; } MyPoint(double xx, double yy) { x = xx; y = yy; } MyPoint(const MyPoint &p1, const MyPoint &p2) { x = (p1.x + p2.x) / 2; y = (p1.y + p2.y) / 2; } }MyPoint; inline double mydistance(const MyPoint &p1, const MyPoint &p2) { return sqrt((p1.x - p2.x) * (p1.x - p2.x) + (p1.y - p2.y) * (p1.y - p2.y)); } inline MyPoint operator-(const MyPoint &p1, const MyPoint &p2) { return MyPoint(p1.x - p2.x, p1.y - p2.y); } MyPoint points[MAXN]; int N, ans; inline void getcenter(const MyPoint &p1, const MyPoint &p2, MyPoint &c) { MyPoint diff = p1 - p2; MyPoint mid(p1, p2); double angle; double high = mydistance(p1, p2) / 2; high = sqrt(1 - high * high); if (fabs(diff.x) < eps) { c.x = mid.x + high; c.y = mid.y; } else { angle = atan(diff.y / diff.x); c.x = mid.x - high * sin(angle); c.y = mid.y + high * cos(angle); } } inline bool myjudge(const MyPoint &p1, const MyPoint &p2) { double dis = mydistance(p1, p2); return dis <= 1 + eps; } int main() { #ifndef ONLINE_JUDGE freopen("data.in" , "r", stdin); #endif int T; scanf("%d", &T); while(T--) { scanf("%d", &N); for(int i = 0; i < N; i++) { scanf("%lf%lf", &points[i].x, &points[i].y); } ans = 1; MyPoint p; for(int i = 0; i < N; i++) { for(int j = i + 1; j < N; j++) { if(mydistance(points[i], points[j]) > 2 + eps + eps) { continue; } getcenter(points[i], points[j], p); int t = 0; for(int k = 0; k < N; k++) { if(myjudge(p, points[k])) { t++; } } if(t > ans) { ans = t; } } } printf("%d\n", ans); } return 0; }
(adsbygoogle = window.adsbygoogle || []).push({});
每天到底几点更新啊？等啊等
已更新
很强大啊，佩服
为避免精度问题，PI值请使用arccos(-1)。应该是acos
这排版…你都打开来看看改改
没敢用map，总怕stl用着会超时
已修正
上面的评论很起劲，为什么我看不懂啊
<EMAIL_ADDRESS>感觉第二种方法其实也不是很好，不过的确要比第一种方法要好一点。
学习了
swap写成内联函数会不会好一些
学算法中的数据结构学到一定程度会乐此不疲的，比如其中的2－3树，类似的红黑树，我甚至可以自己写个逻辑文件系统结构来。


Home
About
Certificates
Diagrams
Profile's
Contact
Ron Luna:
Operations Manager/Owner...
26 Years Of Experience In Cathodic Protection.
Click Photo For More Information.
Priscilla Luna:
Corrosion Technician/Owner...
26 Years Of Experience In Cathodic Protection.
Click Photo For More Information.


AD Classics: Police Center Operative Headquarters / Spasoje Krunic
- by Bogdan Peric
- about 12 hours
The Police Center Operative Headquarters by Spasoje Krunic is a building that technologically is way ahead of its time. It is an extravagant vision based on futuristic concepts and a sophisticated morphological and constructive technology, which combined, form a unity with distinctive aesthetical features. Owing to its construction and well-formed dynamics, the Operative Headquarters finds its place somewhere on the borderline between architecture and free design. The building is associated with new constructivism, a movement that has never been established in Serbian architecture, nor is it a current trend. Rather, it developed out of a specific set of structural requests imposed on the architect.
Krunic’s police station is the first institutional center ever to rely on a spatial steel construction as the structural basis of architectural expression. Its adopted lattice system includes three pairs of girders and, following the “MERO” system, forms a mesh-like grid. What is striking is that different fragments of the grid create different intersections, which reveal weight-bearing belts. This network of lattices, which ultimately consists of steel pipes and ball-type connecting elements, is what delivers spatial stability. The framework of the building is made of reinforced concrete and, from a constructional point of view, represents the building’s nucleus. However, from a functional perspective, the framework serves as a form of vertical communication.
Elements of the functional and conceptual structure include the main assembly hall, the foyer, the helicopter platform, but also a series of offices, which are all highly practical and can be easily accessed. Another modern feature of the Headquarters is its “Green roof”, suitable for urban farming purposes, with a 50cm layer of fertile soil. As a result of the building’s complex functions, it is equipped not only with the highly modern technological devices, but also with extreme acoustic and thermal insulation.
Architect Spasoje Krunic
One of the most prominent figures in the realm of contemporary Serbian architecture, Professor Spasoje Krunic (born on October 23rd, 1939) is the creator of numerous realized buildings, a participant of many international exhibitions and the winner of both foreign and national competitions in the field of architecture and urban design.
Moreover, he is the author of the four patented constructing systems applicable to the construction of ground and multi-story buildings.
The works of Spasoje Krunic emerge from the framework characterized by the courses and fluctuations in Serbian architecture of the second half of the 20th century. Following the path created by the masters of the early modernist movement in Serbia, Krunic’s projects distinctly pay homage to these preceding principles.
However, the ties he maintains with the past are enriched with not only his own architectural style, but also the influence of the national identity, which, through his work, finds its place in broader contexts overcoming the national borders.
As the architect has stated himself, the source of his inspiration lies in reflecting on heritage, which is inevitably reminiscent of times past. Nevertheless, the key features of his style include avoiding banal mimicry of traditional Serbian elements, but, more importantly, striving to achieve a spontaneous organic connection with the given surroundings.
Such an explicit approach provokes the constant pursuit of new designs, technological improvements of the form with its hidden compositional essence, as well as the development of a hierarchical and layered architectural structure that, with its monumentality, represents an unbreakable unity with the surroundings. This attempt to visually integrate buildings with their inseparable context as a substantial aesthetical element is associated with the principal architectural idea.
The development of his artistic expression is characterized by an emphasis on the unity of form, which is one of the most significant categories for Spasoje Krunic and, regardless of how inventive and technologically enhanced its development may be, it is crucial that it remains clear, dominant and unified with the material and constructive essence.
Police Station · Belgrade, Serbia
- version="1.0" encoding="UTF-8"? Architects: Spasoje Krunic
- version="1.0" encoding="UTF-8"?YearCompletion year of this architecture project Year: 1983
- version="1.0" encoding="UTF-8"?PhotographsPhotographs: Spasoje Krunic Archives


--- layout: default ---
In a standard Computer Architecture/ Digital Logic class, students will learn about designing cpus, and maximizing them for efficiency. However, in the harsh conditions of outer space, the regular computer will break. In this website, we will introduce you to different problems in outer space, and how space exploration computers of the past have solved them.
In the Space Conditions tab, we will introduce to you the problems in space that may break a normal computer. In the History tab, you can go through a timeline of famous space crafts of the past that countered such problems in different ways. The Techniques tab contains information on Redundancy Management and Fault Control, the main architecture that counters problems in space. The Documentation tab reflects on our teamwork and building of this website. Lastly, the About and References tab gives a brief introduction to the members of the team, as well as all the references we consulted during this project.


CrimPapers
Articles published on 5 July 2019
On 5 July 2019, 10 new articles were published in 9 journals.
Age Matters: Stopping Out, Going Back, and Criminal Desistance Based on Timing of Educational Return by David Abeling-Judge
Co-Offending and Arrest: An Examination of the “Group Hazard” Hypothesis by Brendan Lantz
Comparing the Impact of Bullying Victimization on Drug Use and Weapon Carrying Among Male and Female Middle and High School Students: A Partial Test of General Strain Theory by Caitlin M. Brady, Thomas Baker, William V. Pelfrey
Doing the “Right Thing”? Understanding Why Rape Victim-Survivors Report to the Police by Oona Brooks-Hay
Futurelessness, Risk Perceptions, and Commitment to Institutional Rules Among A Sample of Incarcerated Men and Women by Frances P. Abderhalden, Thomas Baker, Jill A. Gordon
Book Review: Victim Participation Rights: Variation Across Criminal Justice Systems by Jo-Anne Wemmers
Optimizing the Geographic Deployment of Hot Spot Patrols With License Plate Readers
Choosing Representatives to Deliver the Message in A Group Violence Intervention by Andrew P. Wheeler, Sarah J. McLean, Kelly J. Becker, Robert E. Worden
Net-Widening in Schools?: the Collateral Consequences of Safe School Expenditures For Suspension Rates by Cresean Hughes, Caroline M. Bailey, Patricia Y. Warren, Eric A. Stewart
Cognitive, Affective, and General Empathy in Individuals Convicted of A Sexual Offense: A Meta-Analysis by Elijah Paul Morrow


Geography
Page 12 in the ISGAThe Netherlands has a population of almost 17 million people. By car it will take you only four hours to drive from north to south. The country is bordered by Belgium, Germany and the North Sea. Amsterdam is the capital city of the Netherlands and the government is seated in The Hague.
Wet Feet
The Western and Northern parts of the country lie between one and six metres below sea level. The soil here is mostly peat and clay, cut through with canals, rivers and estuaries. Much of the land is used for farming or grazing. The territories below sea level used to be lakes or belong to the sea. Mills and pumping stations are used to drain them. The pumping stations run constantly to prevent flooding. Furthermore, the coastal areas are protected by the netherlands 13 natural dunes as well as by man-made dikes. The Flevopolder and the Noordoostpolder are the two polders most recently reclaimed from the sea in the never-ending battle against the water. After the reclamation the land was divided into lots. In 1953, the southern province of Zeeland was hit by a disastrous flood. In the decades following this flood the Delta Works were constructed to straighten and strengthen the southern shoreline with new dikes, dams, sluices and bridges.
The Dutch Provinces
The Netherlands is divided into twelve provinces, each with their own capital.
- Friesland, Leeuwarden
- Drenthe, Assen
- Overijssel, Zwolle
- Gelderland, Arnhem
- Flevoland, Lelystad
- Groningen, Groningen
- Utrecht, Utrecht
- Noord-Holland, Haarlem
- Zuid-Holland, Den Haag
- Zeeland, Middelburg
- Noord-Brabant, Den Bosch
- Limburg, Maastricht
Climate
The Netherlands has a maritime climate. It rains a lot and there are only moderate variations in temperature between the four seasons. July and August are at one end of the scale, with average temperatures between 15 and 25 degrees Celsius. The winter months are at the other end of the scale, with frost and sometimes snow.


Date:
Tables:
Home Team:
-- Select Home Team --
Away Team:
-- Select Home Team --
Generate Scoresheet


Day 1: Not bad for free! Obviously, some rust issues and the paint is pretty faded. No handle. The nest casters are frozen up.
The rust from the metal top seemed to have leaked into the paint on the lid. Safe to assume it was left out in the rain many times
There's no indication of any brand. Later it becomes clear that there must of been something on the front of the lid that was sanded down. Found a Big Green Egg nest on Craigslist for 40 bucks!


Directive tuiLet
allows to reuse computed value in
several places in template to avoid recalculations of getters or
many async pipes
Import TuiLetModule
into a module where you
want to use our component
Add to the template:


The Illuminae Files
“The universe was here before you, and it will go on after you.  The only way it will remember you is if you do something worthy of remembrance.”


We have had a lot of great feedback from students on the Data Analysis Tool. Thanks for your input. There are a handful of changes in the works, which should be put in place by the middle of May 2007.
Unfortunately, it won't be possible to address all of your concerns by actually changing the application, so we would like to present some of the interesting problems here, and some possible solutions.
Confusion over the Meaning of Numbers
There were several questions regarding confusion over what some of the numbers in the system represent.
This is best illustrated by looking at the variable "Fatalities"... The fatalities number shown is the mean number of fatalities per incident. Here is a graph showing the mean number of fatalities per incident by Country in the Middle East...
The accompanying data table looks like this...
Note that the column "n" refers not to the number of fatalities, but to the number of incidents associated with that Country. The number of fatalities is not shown. The actual number of fatalities per country would be a factor of the number of incidents times the mean per incident.
Creating Readable Bar Graphs
There were several questions regarding the bar graphs, and the way that the "legend" can interfere with the viewing of the data.
It is true that some types of graphs can be unreadable due to crowding. It may be possible to fix this to a certain extent, and I will look into it, but in the meantime, here are some things to try:
Use the Conditions Builder to narrow the focus of the data being examined. For example, the following graph showing Suicide attacks by country is unreadable...
But, if you narrow the search by selecting "Region = 'Middle East'" in the Conditions Builder, you get this...
Also, note that if you were to reverse the order of the variables from Country on the left and Suicide on the right to Suicide on the left and Country on the right, then the "legend" would show the Country names, and "Yes" and "No" would be mapped on the horizontal of the graph. This is far less useful than the reverse. Better to put the variable with the fewer number of "categories" on the right.
You can see that, given more countries, the "legend" would interfere with the data and become unreadable.
So, please use the Conditions Builder to narrow your search when the graphs become unreadable, and please be aware that in cases where you are comparing two categorical variables, the order of the variables does make a difference in the graph.
Printing Data
Several suggestions were made about finding better ways to allow data to be recreated and printed for purposes of including in your papers.
These include: downloading the data set as an Excel file, downloading the data summary information as Excel file, and including better labeling, including conditions information in the graphs.
There are all excellent suggestions, and we will work on what we can. In the meantime, however, please use the following techniques...
Note that the table in the "Meaning of Numbers" section above was recreated here as a graphic by taking a "screenshot" of the table on the data analysis tool screen. Your computer should be equipped with the ability to take a screenshot. On a Mac, you use shift-command-3 (whole screen) or shift-command-4 (partial screen).
You could also use the copy-and-paste or screenshot techniques to capture conditions information. Just please make sure you remember which graphs and tables go with which conditions. Unfortunately, at this time, there is some burden on the user to keep track of this information.
Miscellaneous Other Questions and Answers


Encoder window interface.
More...
#include <Encoder.h>
- Author
- Andrés González Fornell
Definition at line 29 of file Encoder.h.
◆ setInput()
| void Encoder::setInput |
( |
std::string |
filename | ) |
|
◆ setOutput()
| void Encoder::setOutput |
( |
std::string |
filename | ) |
|
◆ setTree()
| void Encoder::setTree |
( |
int |
tree | ) |
|
◆ bitstream
output bit stream file object
Definition at line 35 of file Encoder.h.
◆ fs
signal sampling frequency [Hz]
Definition at line 32 of file Encoder.h.
◆ input
input file object
Definition at line 33 of file Encoder.h.
◆ output
output file object
Definition at line 34 of file Encoder.h.
The documentation for this class was generated from the following files:


col-2
Eduactional News Letter
Subscription Form
Username
Password
EDUCATION LEVEL
No Formal Education
Primary Education
High School
Vocational Qualification
Bachelor's Degree
Master's Degree
Doctorate or Higher
SECURITY QUESTION
What is the name of your first pet?
What is the name of your last school?
What is the name of your first car?
What is the name of your mother?
What is the name of your first phone?
Answer here
Subscribe
Forgot Password?
Forgot Username?
Code&Succeed
Bessedik


Dataset Maker
Open image:
Open json:
Save File
File name:
Scale:
Scale
New Polygon
Edit
Type:
Route
Boundary
Obstacle
Set
Remove


Free Tailwind CSS Layouts
View on Github
Buttons
Pill Buttons
Rounded Buttons
Blog Articles 1
Contact Page 1
Products List 1
Home Page 2
Home Page 1
New templates added weekly...


Not sticky content
Scroll the page and the '.sticky-cell' in yellow on the right will stick to the top of the page, then stop being sticky once it reaches the bottom of it's wrapping element '.sticky-wrapper'
- This method only adds / removes classes
- There are no inline calculations made by js
- The offset height for the header is calculated in js
- Uses media query to reset positioninng on mobile
- Happy scrolling
Some more content
Tri-tip brisket ball tip chuck flank meatloaf andouille jowl sirloin pork loin doner bacon drumstick. Venison strip steak porchetta beef ribs cow, frankfurter spare ribs. Turducken shank bresaola venison. Cow venison tri-tip, turkey filet mignon brisket tongue sirloin flank beef ribs.  Porchetta prosciutto salami andouille.
Ham hock brisket pork tail jerky, short ribs salami prosciutto tenderloin meatloaf bresaola.  Porchetta jowl shank corned beef short ribs sausage jerky doner frankfurter ribeye hamburger pork belly. Tenderloin ball tip prosciutto pork turkey ground round filet mignon cow sirloin strip steak. Pork belly drumstick ball tip tenderloin pancetta porchetta jowl ham hock tail shank tri-tip.
Tri-tip brisket ball tip chuck flank meatloaf andouille jowl sirloin pork loin doner bacon drumstick. Venison strip steak porchetta beef ribs cow, frankfurter spare ribs. Turducken shank bresaola venison. Cow venison tri-tip, turkey filet mignon brisket tongue sirloin flank beef ribs.  Porchetta prosciutto salami andouille.
Ham hock brisket pork tail jerky, short ribs salami prosciutto tenderloin meatloaf bresaola.  Porchetta jowl shank corned beef short ribs sausage jerky doner frankfurter ribeye hamburger pork belly. Tenderloin ball tip prosciutto pork turkey ground round filet mignon cow sirloin strip steak. Pork belly drumstick ball tip tenderloin pancetta porchetta jowl ham hock tail shank tri-tip.


Cassorific
Auto login into the University web based applications.
Username
Password
Auto submit login form (only used if both User Name and Password set)
Save


title = "Blogbeitrag" url = "/blog/beitrag/:slug?/:page?" layout = "Space" hidden = "0" robot_index = "index" robot_follow = "follow" child_of = "blog/summary" hide_crumb = "0" crumb_title = "Blogbeitrag" remove_crumb_trail = "0" crumb_disabled = "0" [blogPost] slug = "{{ :slug }}" categoryPage = "blog/summary" == // TECHBLOG {% partial 'module/weathercast' %} {% component 'plusOne' %} {% component 'fblike' %} {{ post.title }} {% component "blogPost" %} Please enable JavaScript to view the comments powered by Disqus.


The printer category defines all the printers configured for the system running GEOS. The printers key within this category (see below) defines the printer names, each of which must then have its own category in the INI file (see the following section under printer device name ).
count = <number>
This key indicates the number of printers installed.
count = 0 ; no printers installed count = 2 ; two printers installed
defaultPrinter = <number>
This key specifies the number of the installed printer that will act as the default device.
defaultPrinter = 2 ; printer #2 is the default
numFacsimiles = <number>
This key specifies the number of installed print devices which are actually fax drivers rather than printer drivers.
numFacsimiles = 1
numPrinters = <number>
This key specifies the number of installed print devices which are actually printers (as opposed to faxes or other devices).
numPrinters = 2
printers = {<list of devices>}
This key defines all the installed print devices. Each entry in the list is the device name; the list must be a blob, with one printer named per line as in the example below. Each entry in the list must also have its own category defining the driver, device name, port, and type.
printers = { My Printer My PostScript to file }


--- layout: post date: 2011-04-09 time: "09:00:00" authors: ["Greg Wilson"] title: By The Numbers tags: ["Community"] ---
So what next for Software Carpentry? One possibility is to turn the scripts for the episodes, the examples, and the diagrams in the slides into a book. Let's crunch some numbers to see how feasible that is:
| Topics | 24 |
| ...mostly done (say, 80%) | 18 |
| ...not even started | 6 |
| Words per topic | 5,000 |
| Words to write | 48,000 |
| Words per day | 1,500 |
| Days required | 32 |
| Editing, diagrams, etc. | ×2 |
| Total days | 64 |
| Code complete | July 15, 2011 |
That completion date assumes I start this coming Monday (April 11, 2011). The schedule assumes a 5-day rather than a 7-day week, but that's because the longer hours would actually be less productive (see Evan Robinson's "Why Crunch Mode Doesn't Work" for a summary of the research). 1500 finished words per day, and the factor of two for editing and diagrams, are both based on my experience with several previous books, so there's not much give there.
Unfortunately, mid-July two and a half months past the end of my funding. So close, and yet so far...


LOGO
First 1
2nd
Nav 2.1
Nav 2.2
Nav 2.3
And the Third
4th
This is the last one
Pac-Nav
Change the window size to see pac-nav do its thing
Click here to see the menu on the right


Ingredients
Makes enough for brunch and dinner for one.
- 225g flour, all-purpose
- 18g baking powder
- 6g salt
- 15g sugar
- 40g butter
- 300g milk, I usually use whole
- 1 large egg
My favorite add-ins and toppings
- Chocolate chips
- Strawberries
- Powdered sugar
- Peanut butter
- Cheesecake bites
- Candy bar pieces
- M&Ms
Directions
- Mix everything together
- Add any fillings such as a handful of chocolate chips
- Pour pancake sized blobs on pan at medium heat
- Flip when bubbles rise to the surface and pop
- Wait some more then remove and serve


BERKSHIRE HATHAWAY INC.
3555 Farnam Street
Omaha, NE 68131
Official Home Page
Updated August 7, 2015
Updated July 1, 2014
Updated March 1, 2014
(A commemorative book first sold at the 2015 Annual Meeting and now for sale on eBay.)
Updated January 20, 2010


- The Web
- HTML
- URLS
- HTTP
- Web Applications
World Wide Web - Collection of HTML Documents.
(Web invented in 1990s. Has about 30 billion pages).
TheMajor Pieces/Concepts of the web are best illustrated by this picture:
WEBPAGE SUMMARY:
- A webpage is a text document written in a language called HTML. Browsers read these documents and then
interpret & display them.
HTML - HyperText Markup Language.
- HTML Documents make up the web. Considered the "heart" of the web.
1) Text Content - What you see.
2) Markup - What it looks like.
3) Reference to other Docs - e.g. Images & Videos.
4) Links to other Pages
HTML Markup:
< Name > Contents < /Name > ------ **This is known as an ELEMENT** (everything within a set of opening
and closing tags).
** < Name > = OPENING TAG
**< /Name > = CLOSING TAG
Tags are part of basic HTML vocabulary. An HTML tag is always contained within angled brackets.
Most Tags have an Open Tag and Closing Tag. Some examples are:
B Tag - < b > contents < /b >
b = BOLD (the contents will always appear in bold).
Em Tag - < em > contents < /em >
em = EMPHASIS (the content will always appear in italics).
Some Tags do not require a closing tag. These are called Void Tags. Examples are:
< img > = Image Tag- An HTML Attribute looks like the following:
< Tag Attr = "Value" > Contents < /Tag>
An example of a Tag that uses an Attribute is the Anchor Tag.
Anchor Tag - < a >
- Anchors are for making links.
FULL EXAMPLE: < a href = www.reddit.com > derp < /a >
**href = Attribute Name
**www.reddit = Value (In This Case a URL)
**derp = contents
IMAGE TAG ( < img >)
< img src = "url" alt = "text" >
** alt = text is required (text gets displayed when image does not load).
WHITE SPACE: Text entered on multiple lines are all entered into a single space. To force it to have multiple
lines, we use the tag < br > (Break Tag).
*EXAMPLE WITHOUT THE < br > tag:
" Text On Multiple Lines"
*EXAMPLE WITH THE < br > tag:
"Text On
Multiple Lines
- Another way of using line breaks is to use the tag < p >
< p > stands for paragraph and looks like this:
< p > content < /p >
INLINE / BLOCK
Why do we have two ways for making new lines?
ANSWER:
< br > = Inline -- Says where to end the line and have the remaining text wrap to the next line
< p > = Block -- Makes invisable box around text that can have height and width
SPAN & DIV ELEMENTS
< Span > text < / Span > - Inline
< Div > text < /Div > - Block
- You can attach different styles to them to adjust behaviors of how they display.
OTHER IMPORTANT NOTES TO TAKE AWAY FROM THIS LESSON:
* How Coding Works - Coding happens when programmers write text in a language that a computer can
understand. The computer can then follow the instructions the programmer wrote.
* Computers Are Stupid - Programmers need to write exactly the way a computer understands (also known
as writing with the correct "Syntax"). For example, if you forget to close a < b > tag, the computer wont be
able to figure out what you had intended to make bold. This "Stupidicity" can be very frustrating, but it also
gives programmers incredible power: if you know how to talk to a computer than you can tell it to do anything
you want.
 If
you forget how to make text italic in HTML, you can always just look it up.
**other two "notes to take away from this lesson" are covered above : ) **


This video shows the entire area in Universiti Teknikal Melaka, Malaysia and UTeM is where I gain more my knowledge in the field of Artificial Intelligence. 😀


Accadde oggi
Articolo articolante
Renata Altobelli
New York, the largest city in the U.S., is an architectural marvel with plenty of historic monuments, magnificent buildings and countless dazzling skyscrapers.
New York, the largest city in the U.S., is an architectural marvel with plenty of historic monuments, magnificent buildings and countless dazzling skyscrapers.
New York, the largest city in the U.S., is an architectural marvel with plenty of historic monuments, magnificent buildings and countless dazzling skyscrapers.
New York, the largest city in the U.S., is an architectural marvel with plenty of historic monuments, magnificent buildings and countless dazzling skyscrapers.
New York, the largest city in the U.S., is an architectural marvel with plenty of historic monuments, magnificent buildings and countless dazzling skyscrapers.


Using a combination of found objects, custom clothing, and painting, Tantouze narrates the journey of a certain fairy. Horned and adorned in leather, the fairy searches for a fabled intimacy. Doorways appear throughout the journey yet do not open to any new rooms. Rather—they force viewers to walk around an existing space, questioning the origins of everything there.
Installation shot
Installation shot
Installation shot
Installation shot


Baqar Gogia
25
Years Old
<EMAIL_ADDRESS>Personal
Pirati02
GitHub
baqar-gogia
Linkedin
Interests
Design Patterns
Reading Clean Code and Design pattern articles and books
Music
Georgian Folk Music
Language
Georgian
Native Language
English
Good skills, both written and speaking.
Russian
Normal speaking, poor writing.
Software Developer
Work Experience
March 2018 - Present
SoftwareDeveloper
GPI Holding
Tbilisi, Georgia
September 2018 - Present
Android Developer
AppLoad
Remote Work/Georgia
August 2017 - February 2018
Software Developer
@Cyber Dynamic Corp
New York City, USA
June 2017 - February 2018
Software Developer
@2G
Tbilisi, Georgia
June 2017 - Jule 2017 (One time job)
Android Trainer
@GITA
Tbilisi, Georgia
September 2016 - April 2017
Xamarin developer
@Wandio
Tbilisi, Georgia
April 2016 - August 2016
Android developer
@Fina
Tbilisi, Georgia
November 2015 - April 2016
Web developer
@BlueberryDev
Tbilisi, Georgia
Education
2008 - 2011
Bachelor of Science in Engineering
@Atsu
Kutaisi, Georgia
Computer Science and Engineering
2016 Feb - 2016 April
Android Trainer Training
@SkillUP
Tbilisi, Georgia
SkillUP Android Trainers Training
@Certificate
Personal Projects
ActionBinder
6 stars
FWB
0 stars
CompleteIndicator
0 stars
DDDAndroid
0 stars
And more..
on github
Professional Skills
Mobile
Android (Java), iOS (Swift), Windows Mobile (C#),
Back-End
ASP MVC, ASP WEB API, HTML, Javascript
Front-End
Jquery, ReactJS, knockout.js, Angular 1


Festivalist
Filters
Type
Film
Music
Location
Europe
USA
Americas
Asia
Africa
Other
Type: genre
Location:
Lineup:


---
layout: pagefullwidth
title: "Research"
logo: "img/home-bg.jpg"
description: ""
header-img: "img/home-bg.jpg"
ordernumber: 2
---
Research interests
- Computational (bio)mechanics
- Computational design
- Finite Element Analysis and inverse methods
- Continuum mechanics
- Design and topology optimization
- Image and signal processing, meshing, and visualization
- Non-invasive imaging and analysis
- Robotics and (bio)mechatronics
- Additive manufacturing
- Generative design and morphogenesis


| SSH-KEYSCAN(1) | General Commands Manual | SSH-KEYSCAN(1) |
ssh-keyscan
—
ssh-keyscan |
[-46cDHv ] [-f
file] [-p
port] [-T
timeout] [-t
type] [host |
addrlist namelist] |
ssh-keyscan
is a utility for gathering the public SSH
host keys of a number of hosts. It was designed to aid in building and
verifying ssh_known_hosts files, the format of which
is documented in sshd(8).
ssh-keyscan
provides a minimal interface suitable for
use by shell and perl scripts.
ssh-keyscan
uses non-blocking socket I/O
to contact as many hosts as possible in parallel, so it is very efficient.
The keys from a domain of 1,000 hosts can be collected in tens of seconds,
even when some of those hosts are down or do not run
sshd(8). For scanning, one does
not need login access to the machines that are being scanned, nor does the
scanning process involve any encryption.
The options are as follows:
-4
ssh-keyscan
to use IPv4 addresses only.-6
ssh-keyscan
to use IPv6 addresses only.-c
-D
-f
filessh-keyscan
will read from
the standard input. Input is expected in the format:
<IP_ADDRESS>,<IP_ADDRESS> name.my.domain,name,n.my.domain,n,<IP_ADDRESS>,<IP_ADDRESS>
-H
-p
port-T
timeout-t
type-v
If an ssh_known_hosts file is constructed using
ssh-keyscan
without verifying the keys, users will
be vulnerable to man in the middle attacks. On the other
hand, if the security model allows such a risk,
ssh-keyscan
can help in the detection of tampered
keyfiles or man in the middle attacks which have begun after the
ssh_known_hosts file was created.
$ ssh-keyscan -t rsa
hostname
Find all hosts from the file ssh_hosts which have new or different keys from those in the sorted file ssh_known_hosts:
$ ssh-keyscan -t rsa,dsa,ecdsa,ed25519 -f ssh_hosts | \ sort -u - ssh_known_hosts | diff ssh_known_hosts -
Using DNS to Securely Publish Secure Shell (SSH) Key Fingerprints, RFC 4255, 2006.
| November 30, 2019 | Fidelix 0.2 |


This is an h1This is an h2This is an h3This is an h4This is an h5This is an h6This is an display-1
This is an display-2
This is an display-3
This is an display-4
This is an display-5
This is test of text with different amounts of line height. What do you think of the line height for this text? Is it too large? Too small? The world may never know but I do hope that this works. This is test of text with different amounts of line height. What do you think of the line height for this text? Is it too large? Too small? The world may never know but I do hope that this works. This is test of text with different amounts of line height. What do you think of the line height for this text? Is it too large? Too small? The world may never know but I do hope that this works. This is test of text with different amounts of line height. What do you think of the line height for this text? Is it too large? Too small? The world may never know but I do hope that this works. This text is to the left
This text is to the center
This text is to the right
This text is justified which means it fills the whole line when it wraps so the start and end of the text with touch both the left and right side.
Some text here with some amount of weight Some text here with some amount of weight Some text here with some amount of weight Some text here with some amount of weight Some text here with some amount of weight Some text here with some amount of weight Some text here with some amount of weight Some text here with some amount of weight Some text here with some amount of weight Bold Text Bold Text Underlined Text Italic Text
|


| < Day Day Up > |
4.1 Indexing BasicsTo understand how MySQL uses indexes, it's best first to understand the basic workings and features of indexes. Once you have a basic understanding of their characteristics, you can start to make more intelligent choices about the right way to use them. 4.1.1 Index ConceptsTo understand what indexes allow MySQL to do, it's best to think about how MySQL works to answer a query. Imagine that phone_book is a table containing an aggregate phone book for the state of California, with roughly 35 million entries. And keep in mind that records within tables aren't inherently sorted. Consider a query like this one: SELECT * FROM phone_book WHERE last_name = 'Zawodny' Without any sort of index to consult, MySQL must read all the records in the phone_book table and compare the last_name field with the string "Zawodny" to see whether they match. Clearly that's not efficient. As the number of records increases, so does the effort necessary to find a given record. In computer science, we call that an O(n) problem. But given a real phone book, we all know how to quickly locate anyone named Zawodny: flip to the Zs at the back of book and start there. Since the second letter is "a," we know that any matches will be at or near the front of the list of all names starting with Z. The method used is based on knowledge of the data and how it is sorted. That's cheating, isn't it? Not at all. The reason you can find the Zawodnys so quickly is that they're sorted alphabetically by last name. So it's easy to find them, provided you know your ABCs, of course. Most technical books (like this one) provide an index at the back. It allows you to find the location of important terms and concepts quickly because they're listed in sorted order along with the corresponding page numbers. Need to know where mysqlhotcopy is discussed? Just look up the page number in the index. Database indexes are similar. Just as the book author or publisher may choose to create an index of the important concepts and terms in the book, you can choose to create an index on a particular column of a database table. Using the previous example, you might create an index on the last name to make looking up phone numbers faster: ALTER TABLE phone_book ADD INDEX (last_name) In doing so, you're asking MySQL to create an ordered list of all the last names in the phone_book table. Along with each name, it notes the positions of the matching records—just as the index at the back of this book lists page numbers for each entry.[1]
From the database server's point of view, indexes exist so that the database can quickly eliminate possible rows from the result set when executing a query. Without any indexes, MySQL (like any database server) must examine every row in a table. Not only is that time consuming, it uses a lot of disk I/O and can effectively pollute the disk cache. In the real world, it's rare to find dynamic data that just happens to be sorted (and stays sorted). Books are a special case; they tend to remain static. Because MySQL needs to maintain a separate list of indexes' values and keep them updated as your data changes, you really don't want to index every column in a table. Indexes are a trade-off between space and time. You're sacrificing some extra disk space and a bit of CPU overhead on each INSERT, UPDATE, and DELETE query to make most (if not all) your queries much faster. Much of the MySQL documentation uses the terms index and key interchangeably. Saying that last_name is a key in the phone_book table is the same as saying that the last_name field of the phone_book table is indexed. <IP_ADDRESS> Partial indexesIndexes trade space for performance. But sometimes you'd rather not trade too much space for the performance you're after. Luckily, MySQL gives you a lot of control over how much space is used by the indexes. Maybe you have a phone_book table with 2 billion rows in it. Adding an index on last_name will require a lot of space. If the average last_name is 8 bytes long, you're looking at roughly 16 GB of space for the data portion of the index; the row pointers are there no matter what you do, and they add another 4-8 bytes per record.[2]
Instead of indexing the entire last name, you might index only the first 4 bytes: ALTER TABLE phone_book ADD INDEX (last_name(4)) In doing so, you've reduced the space requirements for the data portion of the index by roughly half. The trade-off is that MySQL can't eliminate quite as many rows using this index. A query such as: SELECT * FROM phone_book WHERE last_name = 'Smith' retrieves all fields beginning with Smit, including all people with name Smith, Smitty, and so on. The query must then discard Smitty and all other irrelevant rows. <IP_ADDRESS> Multicolumn indexesLike many relational database engines, MySQL allows you to create indexes that are composed of multiple columns: ALTER TABLE phone_book ADD INDEX (last_name, first_name) Such indexes can improve the query speed if you often query all columns together in the WHERE clause or if a single column doesn't have sufficient variety. Of course, you can use partial indexes to reduce the space required: ALTER TABLE phone_book ADD INDEX (last_name(4), first_name(4)) In either case, a query to find Josh Woodward executes quickly: SELECT * FROM phone_book WHERE last_name = 'Woodward' AND first_name = 'Josh' Having the last name and first name indexed together means that MySQL can eliminate rows based on both fields, thereby greatly reducing the number of rows it must consider. After all, there are a lot more people in the phone book whose last name starts with "Wood" than there are folks whose last name starts with "Wood" and whose first name also starts with "Josh." When discussing multicolumn indexes, you may see the individual indexed columns referred to as key parts or "parts of the key." Multicolumn indexes are also referred to as composite indexes or compound indexes. So why not just create two indexes, one on last_name and one on first_name? You could do that, but MySQL won't use them both at the same time. In fact, MySQL will only ever use one index per table per query—except for UNIONs.[3] This fact is important enough to say again: MySQL will only ever use one index per table per query.
With separate indexes on first_name and last_name, MySQL will choose one or the other. It does so by making an educated guess about which index allows it to match fewer rows. We call it an educated guess because MySQL keeps track of some index statistics that allow it to infer what the data looks like. The statistics, of course, are generalizations. While they often let MySQL make smart decisions, if you have very clumpy data, MySQL may make suboptimal choices about index use. We call data clumpy if the key being indexed is sparse in some areas (such as names beginning with X) and highly concentrated in others (such as the name Smith in English-speaking countries). This is an important topic that we'll revisit later in this book. <IP_ADDRESS> Index orderHow does MySQL order values in the index? If you've used another RDBMS, you might expect MySQL to have syntax for specifying that an index be sorted in ascending, descending, or some other order. MySQL gives you no control over its internal sorting of index values. It has little reason to. As of Version 4.0, it does a good job of optimizing cases that cause slower performance for other database systems. For example, some database products may execute this query quickly: SELECT * FROM phone_book WHERE last_name = 'Zawodny' ORDER BY first_name DESC And this query slowly: SELECT * FROM phone_book WHERE last_name = 'Zawodny' ORDER BY first_name ASC Why? Because some databases store the indexes in descending order and are optimized for reading them in that order. In the first case, the database uses the multicolumn index to locate all the matching records. Since the records are already stored in descending order, there's no need to sort them. But in the second case, the server finds all matching records and then performs a second pass over those rows to sort them. MySQL is smart enough to "traverse the index backwards" when necessary. It will execute both queries very quickly. In neither case does it need to sort the records. <IP_ADDRESS> Indexes as constraintsIndexes aren't always used to locate matching rows for a query. A unique index specifies that a particular value may only appear once in a given column.[4] In the phone book example, you might create a unique index on phone_number to ensure that each phone number appears only once: [5]
ALTER TABLE phone_book ADD UNIQUE (phone_number) The unique index serves a dual purpose. It functions just like any other index when you perform a query based on a phone number: SELECT * FROM phone_book WHERE phone_number = '555-7271' However, it also checks every value when attempting to insert or update a record to ensure that the value doesn't already exist. In this way, the unique index acts as a constraint. Unique indexes use as much space as nonunique indexes do. The value of every column as well as the record's location is stored. This can be a waste if you use the unique index as a constraint and never as an index. Put another way, you may rely on the unique index to enforce uniqueness but never write a query that uses the unique value. In this case, there's no need for MySQL to store the locations of every record in the index: you'll never use them. Unfortunately, there's no way to signal your intentions to MySQL. In the future, we'll likely find a feature introduced for this specific case. The MyISAM storage engine already has support for unique columns without an index (it uses a hash-based system), but the mechanism isn't exposed at the SQL level yet. <IP_ADDRESS> Clustered and secondary indexesWith MyISAM tables, the indexes are kept in a completely separate file that contains a list of primary (and possibly secondary) keys and a value that represents the byte offset for the record. These ensure MySQL can find and then quickly skip to that point within the database to locate the record. MySQL has to store the indexes this way because the records are stored in essentially random order. With clustered indexes, the primary key and the record itself are "clustered" together, and the records are all stored in primary-key order. InnoDB uses clustered indexes. In the Oracle world, clustered indexes are known as "index-organized tables," which may help you remember the relationship between the primary key and row ordering. When your data is almost always searched on via its primary key, clustered indexes can make lookups incredibly fast. With a standard MyISAM index, there are two lookups, one to the index, and a second to the table itself via the location specified in the index. With clustered indexes, there's a single lookup that points directly to the record in question. Some operations render clustered indexes less effective. For instance, consider when a secondary index is in use. Going back to our phone book example, suppose you have last_name set as the primary index and phone_number set as a secondary index, and you perform the following query: SELECT * FROM phone_book WHERE phone_number = '555-7271' MySQL scans the phone_number index to find the entry for 555-7271, which contains the primary key entry Zawodny because phone_book's primary index is the last name. MySQL then skips to the relevant entry in the database itself. In other words, lookups based on your primary key happen exceedingly fast, and lookups based on secondary indexes happen at essentially the same speed as MyISAM index lookups would. But under the right (or rather, the wrong) circumstances, the clustered index can actually degrade performance. When you use one together with a secondary index, you have to consider the combined impact on storage. Secondary indexes point to the primary key rather than the row. Therefore, if you index on a very large value and have several secondary indexes, you will end up with many duplicate copies of that primary index, first as the clustered index stored alongside the records themselves, but then again for as many times as you have secondary indexes pointing to those clustered indexes. With a small value as the primary key, this may not be so bad, but if you are using something potentially long, such as a URL, this repeated storage of the primary key on disk may cause storage issues. Another less common but equally problematic condition happens when the data is altered such that the primary key is changed on a record. This is the most costly function of clustered indexes. A number of things can happen to make this operation a more severe performance hit:
As you might imagine, if you're altering the primary key for a number of records, that UPDATE command might take quite some time to do its job, especially on larger tables. Choose your primary keys wisely. Use values that are unlikely to change, such as a Social Security account number instead of a last name, serial number instead of a product name, and so on. <IP_ADDRESS> Unique indexes versus primary keysIf you're coming from other relational databases, you might wonder what the difference between a primary key and a unique index is in MySQL. As usual, it depends. In MyISAM tables, there's almost no difference. The only thing special about a primary key is that it can't contain NULL values. The primary key is simply a NOT NULL UNIQUE INDEX named PRIMARY. MyISAM tables don't require that you declare a primary key. InnoDB and BDB tables require primary keys for every table. There's no requirement that you specify one, however. If you don't, the storage engine automatically adds a hidden primary key for you. In both cases, the primary keys are simply incrementing numeric values, similar to an AUTO-INCREMENT column. If you decide to add your own primary key at a later time, simply use ALTER TABLE to add one. Both storage engines will discard their internally generated keys in favor of yours. Heap tables don't require a primary key but will create one for you. In fact, you can create Heap tables with no indexes at all. <IP_ADDRESS> Indexing NULLsIt is often difficult to remember that SQL uses tristate logic when performing logical operations. Unless a column is declared NOT NULL, there are three possible outcomes in a logical comparison. The comparison may be true because the values are equivalent; it may be false because the values aren't equivalent; or it may not match because one of the values is NULL. Whenever one of the values is NULL, the outcome is also NULL. Programmers often think of NULL as undefined or unknown. It's a way of telling the database server "an unknown value goes here." So how do NULL values affect indexes? NULL values may be used in normal (nonunique) indexes. This is true of all database servers. However, unlike many database servers, MySQL allows you to use NULL values in unique indexes.[6] You can store as many NULL values as you'd like in such an index. This may seem a bit counterintuitive, but that's the nature of NULL. Because NULL represents an undefined value, MySQL needs to assert that all NULL values are the same if it allowed only a single value in a unique index.
To make things just a bit more interesting, a NULL value may appear only once as a primary key. Why? The SQL standard dictates this behavior. It is one of the few ways in which primary keys are different from unique indexes in MySQL. And, in case you're wondering, allowing NULL values in the index really doesn't impact performance. |
| < Day Day Up > |


The problem: In my Pathfinder group, the players are tasked with recruiting noobs to the cause. Rather than letting them dream up the commoners with the potential they needed, I wrote a script to make their recruits a bit more random while still giving them some choice in how to train them.
Instructions: Plug in how many commoners you want, and you'll get back a stat block, as well as some classes that work for them.


Fair warning: Scone Palace in Perthshire is not, in fact, built with scones.
5/11/2014, 8:16:04 AM
Favs: 1
Retweets: 0
link--- layout: tweet ---
Fair warning: Scone Palace in Perthshire is not, in fact, built with scones.
5/11/2014, 8:16:04 AM
Favs: 1
Retweets: 0
link


| Sr | Fieldname | Type | Label | Options |
|---|---|---|---|---|
| 1 | select_doctype |
Select |
Select DocType
Type of document to rename. |
|
| 2 | file_to_rename |
Attach |
File to Rename
Attach .csv file with two columns, one for the old name and one for the new name |
|
| 3 | rename_log |
HTML | Rename Log |
Inherits from frappe.model.document.Document
Public API
/api/method/erpnext.utilities.doctype.rename_tool.rename_tool.get_doctypes
erpnext.utilities.doctype.rename_tool.rename_tool.get_doctypes ()
No docs
Public API
/api/method/erpnext.utilities.doctype.rename_tool.rename_tool.upload
erpnext.utilities.doctype.rename_tool.rename_tool.upload (select_doctype=None, rows=None)
No docs


Acrolinx Sidebar Example On Premise
Multi-Editor Sidebar On Premise
|
Open Acrolinx Sidebar API Documentation
This textt has more then a
errorr
.


Toggle navigation
Algorithms
Breadth First Search
(current)
Depth First Search
×
Draw Graph
Click to draw a vertex.
Drag from one vertex to another to draw an edge (Undirected for BFS and DFS).
BFS
DFS
Sample Graphs
Draw Graph
Run
graph1
graph2
graph3
slower
faster