Basis Functions¶
-
basis.
eqvlat
(ylat, vort, area, n_points, planet_radius=6378000.0, vgrad=None)[source]¶ Compute equivalent latitude, and optionally <…>_Q in Nakamura and Zhu (2010).
- Parameters
ylat (sequence or array_like) – 1-d numpy array of latitude (in degree) with equal spacing in ascending order; dimension = nlat.
vort (ndarray) – 2-d numpy array of vorticity values; dimension = (nlat, nlon).
area (ndarray) – 2-d numpy array specifying differential areal element of each grid point; dimension = (nlat, nlon).
n_points (int) – Analysis resolution to calculate equivalent latitude.
planet_radius (float) – Radius of spherical planet of interest consistent with input area. Default: earth’s radius 6.378e+6
vgrad (ndarray, optional) – 2-d numpy array of laplacian (or higher-order laplacian) values; dimension = (nlat, nlon)
- Returns
q_part (ndarray) – 1-d numpy array of value Q(y) where latitude y is given by ylat; dimension = (nlat).
brac (ndarray or None) – 1-d numpy array of averaged vgrad in the square bracket. If vgrad = None, brac = None.
-
basis.
lwa
(nlon, nlat, vort, q_part, dmu, ncforce=None)[source]¶ At each grid point of vorticity q(x,y) and reference state vorticity Q(y), this function calculate the difference between the line integral of [q(x,y+y’)-Q(y)] (and ncforce, if given) over the domain {y+y’>y,q(x,y+y’)<Q(y)} and {y+y’<y,q(x,y+y’)>Q(y)}. See fig. (1) and equation (13) of Huang and Nakamura (2016). dmu is a vector of length nlat: dmu = cos(phi) d(phi) such that phi is the latitude.
- Parameters
nlon (int) – Longitudinal dimension of vort (i.e. vort.shape[1]).
nlat (int) – Latitudinal dimension of vort (i.e. vort.shape[0]).
vort (ndarray) – 2-d numpy array of vorticity values; dimension = (nlat,nlon).
Q_part (sequence or array_like) – 1-d numpy array of Q (vorticity reference state) as a function of latitude. Size = nlat.
dmu (sequence or array_like) – 1-d numpy array of latitudinal differential length element (e.g. dmu = planet_radius * cos(lat) d(lat)). Size = nlat.
ncforce (ndarray or None, optional) – 2-d numpy array of non-conservative force field (i.e. theta in NZ10(a) in equation (23a) and (23b))
- Returns
lwact (ndarray) – 2-d numpy array of local wave activity calculated; dimension = (nlat,nlon).
bigsigma (ndarray or None) – 2-d numpy array of the nonconservative forces acting on local wave activity computed from ncforce. If ncforce = None, bigsigma = None.


{% extends "sentry/bases/organization.html" %} {% load i18n %} {% block org_teams_nav %}active{% endblock %} {% block inner %}
You don't have access to any teams for this organization yet.
{% if ACCESS.org_write %}Get started by creating your first team.
{% endif %} {% else %}There are no projects in this team. Would you like to create a project?
{% else %}{{ team.name }} |


Batten Screws
- 14g x 100mm Mechanical Galvanised Bugle Head Hex Drive Batten Screws.
- 500 Nail Pack – Comes in heavy duty waterproof/air proof container.
Batten Screws
- 14g x 75mm Mechanical Galvanised Class 4 Bugle Head Hex Drive Batten.
- 100 Piece pack.
Batten Screws
- 14g x 100mm Mechanical Galvanised Bugle Head Hex Drive Batten.
- 100 Piece pack.
Batten Screws
- 14g x 100mm Stainless Steel 316 Bugle Head Hex Drive Batten.
- 50 Piece pack.
Batten Screws
- 14g x 125mm Mechanical Galvanised Class 4 Bugle Head Hex Drive Batten.
- 100 Piece pack.
Batten Screws
- 14g x 150mm Mechanical Galvanised Class 4 Bugle Head Hex Drive Batten.
- 50 Piece pack.

Decking Screws
- Torx Drive Decking Screws
- Stainless Steel 316 Grade
- Bronze Finish
- 10G x 65mm – T20 Driver Bit Included
- Type 17, CSK Head
- 500 Piece pack.
Decking Screws
- Building King Torx Drive Decking Screws
- Stainless Steel 316 Grade
- Stainless Finish
- 10G x 65mm – T20 Driver Bit Included
- Type 17, CSK Head
- 500 Piece pack.


Has anyone compared these two side-by-side? They appear for all practical purposes to be identical, other than the price, which is significantly different. The "019" in the yhdc model stands for 19 mm, which (perhaps not so coincidentally) is approximately 0.75 inches.
I have two of the yhdc model installed to monitor my US breaker panel L1 & L2 supply lines, which are "0000" aluminum and too thick for the standard SCT-013-000. I wired them in parallel & fitted an 1/8" stereo plug, so that I am able to monitor my whole house energy usage using only one CT input on my emonTX shield. I replaced the 33 ohm resistor on the shield with a 22 ohm. If my calculations are correct, 25 ohm is ideal in this configuration, so I may at some point replace the 22 ohm with a 27 ohm & a 330 ohm in parallel.
I have 8 more of the yhdc. If you are in the US & are interested in purchasing, PM me. (The shipping cost from China is prohibitive if only purchasing 2, so I went ahead & ordered 10.) I can also include appropriate burden resistors for you to install on your emonTX, as I purchased a nice assortment of 1% resistors that include all std values from 1 ohm to 10M ohm.
Re: yhdc SCT-019-000 vs Magnelab SCT-075-000
Did you ever get this working? It seems like one problem would be the difference in phase, As the one leg rises, the other drops and I think this would cancel out a lot of the "signal". You kind of get the same thing when you put a CT clamp over a pair of wires.
Re: yhdc SCT-019-000 vs Magnelab SCT-075-000
To (belatedly) answer ddcarter's question, I haven't tested either of those, so that's why I did not comment at the time he posed the question. As a rider, I wouldn't worry too much about getting exactly the correct burden value. Certainly, the correct value is best but I find it hard to decide what is "correct", as you don't know the shape of the current waveform, so you can't calculate the peak value. I usually suggest never more than 1.66 V rms for an emonTx Shield with a 5 V supply, and if you are likely to be working near maximum current, I'd aim somewhat lower unless you're confident that you have a good sine wave for your current.
There's absolutely no reason why paralleling two CTs should not work, provided of course that both are identical (otherwise, it will be impossible to apply the correct calibration and phase compensation).
However, officeboy, your description of a possible problem ignores the fact that the two should face opposite directions - obvious when you think of a 240 V load which takes its current from one leg and returns it to the other leg, you measure the current twice but only half the voltage and so the power comes out correct.
You don't get the same thing with a 2-core cable because in this case, the ampere-turns cancel in the CT core. But you CAN use 1 CT if you pass the cable for one leg backwards through the CT (think about the 240 V load again and twice the current × half the voltage).
Re: yhdc SCT-019-000 vs Magnelab SCT-075-000
Is this the same for North American power with two 120V legs (240 combined) and a neutral? Many household circuits will only use one leg of power and the return will be via the neutral cable. (Kind of a center tap on our 240V transformers)
I do understand and agree that measuring with two CT's on a balanced 240 V load can be done as described, like on a water heater.
(Although I don't understand why you wouldn't just double the voltage or wattage with math instead of using two CT's)
Re: yhdc SCT-019-000 vs Magnelab SCT-075-000
"you wouldn't just double the voltage or wattage with math [sic] instead of using two CT's" because, if you're measuring the power draw of the whole installation, there will also be 120 V loads that are not necessarily - in fact almost certainly will not be - balanced, therefore the two line currents will be unequal and there will be a neutral current. If you're only measuring a single 240 V load, then you can of course measure the current in one leg only, because given no third connection the current has nowhere to go and must return in the other leg.
Re: yhdc SCT-019-000 vs Magnelab SCT-075-000
Yes, I should have been more clear, my comment about using math to do the work was only for a single balanced load (like the water heater).
Back to ddcarters issue, on measuring incoming mains. Can you use two CT's connected in parallel, or do they need to be measured individually?
Re: yhdc SCT-019-000 vs Magnelab SCT-075-000
See above.


Each tab is a separate production line. You can have multiple tabs and they will be automatically saved in your browser. You can also share them using the share button or reorganize by dragging them.
Select items that you want to produce. You can choose between item per minute (will produce given amount from as low amount of raw resources as possible) or maximize (will produce as much as possible, given the raw resource limits).
|
|
||||
| Add product |
Select which raw resources you want to use and their limits. By default it's populated with map limits, but you can easily change that.
| Resource | Limit |
|---|---|
|
|
Select items that you already have at your disposal and therefore don't need to be produced by this factory.
|
|
|||
| Add input |
Select which recipes you want to allow to be used. The tool will automatically pick best possible combination of recipes from the selected ones.
|
{{ctrl.tab.convertAlternateRecipeName(recipe.name)}}
{{ingredient.amount}}×
|
{{product.amount}}×
|
|
{{recipe.name}}
{{ingredient.amount}}×
|
{{product.amount}}×
|
| Machine | Average usage | Max usage |
|---|---|---|
|
|
{{powerDetail.average|number}} MW | {{powerDetail.max|number}} MW |
| Total | {{ctrl.tab.tool.result.powerUsage.average|number}} MW | {{ctrl.tab.tool.result.powerUsage.max|number}} MW |


--- layout: default title: Your New Jekyll Site ---
If you're not working on your best idea right now, you're doing it wrong. - David Heinmeier Hansson
My passion for software engineering enables me to craft and deliver experiences that empower others. My goal is to change people’s lives with non-traditional, but practical, experiences on the web.
As one of the first team members on the front-end team, I worked with design and product to deliver high value features to our clients. To ensure that we were able to scale, I helped establish a component library and a style guide with our design team. As we grew, I was responsible for hiring and onboarding new members of the front-end team.
In this position I collaborated with product owners, a project manager and designer with ten software engineers on a research project to help instructors build courses. As a fullstack engineer I worked heavily in EmberJS, EmberData, Ruby and Postgres. We utilized test driven development to effectively deliver requirements on one-week iteration cycles.
I lead the development of a SASS based web architecture with a remote team; utilizing MongoDB, Express, Angular and NodeJS. I delivered a frontend architecture that worked with JSON based API’s. In collaboration with a backend developer, we delivered a platform that allowed users to interact with their favorite brands.
During my tenure at Sapient I helped integrate standard practices on the RAM Trucks brand website alongside a collaborative team of developers, designers and project managers. I helped define and integrate compliant markup, styling and scripts using current programming methods in JavaScript; including OOP and MVC practices with jQuery, UnderscoreJS and BackboneJS.
Bachelors, New Media Interactive Development


Fork me on GitHub
Press
R
to restart
Paused
STARSHIPS
Press
SPACE
to start
Seems your browser does not support canvas
arrows
to move
space
to shoot
R
to restart
M
to mute


Web Technologies
The list of class participants
First name
Last name
Role
Aleš
Smrdel
Lecturer
David
Jelenc
Teaching assistant
Giedrius
Bačkaitis
Student


{block name="script"} {/block} {block name="css"} {/block} {include file="public::nav"/} {block name="body"} {/block} {include file="public::left" /} {include file="public::footer" /}


Home
How it works
Our cities
Sign up
Feedback
Start eating healthy today
Premium
₹
5000
/ month
That's only ₹166.67 per meal
1 meal every day
Order 24/7
Access to newest creations
Free delivery
Sign up now
Pro
₹
2500
/ month
That's only ₹150 per meal
1 meal 10 days/month
Order 24/7
Access to newest creations
Free delivery
Sign up now
Starter
₹
300
/ meal
1 meal
Order from 8 am to 12 pm
Access to newest creations
Free delivery
Sign up now


Customize Visual Update 1
About
The release of Connections Customizer provides some great opportunities to customize Connections. Visual Update 1 is a a working example of how you can modify the existing appearance of Connections by overriding styles used on the site.
Visual Update 1 was actually written with visual customization in mind. In this topic you will learn the basics about the struture and variables used which make quick customizations, such as changing colors, possible.
- Connections Customizer
-
In this Visual Update example we use Customizer to apply the new design specification to Connections, simply by overriding CSS. Before using Customizer your organization must first register for the service by sending an email with some simple information. Refer to section 3 of the HCL Connections Customizer documentation for more details.
- Sass compiler
-
This example is written using Sass, which is compiled into CSS that will be injected into pages by Customizer. This example uses Sass to create CSS files and a script that instructs Customizer to return these CSS overrides with responses.
- "Verse Theme (Default)" or "Hikari" theme
Connections must be set to use one of these default themes: "Verse Theme (Default)" or "Hikari".
- Become familiar with the files and structure.
- View the visual updates as you work.
- Make a small modification, such as changing the brand colors.
- Share your customizations with others.
- Create a Chrome extension to share your modifications with others.
- Add your modifications to Connections for more people to see.
We recommend creating a fork and then clone that fork to your local file system. You can clone files using GitHub Desktop or a terminal window.
Once you have the files locally you are set to go. Make note of the local path for the next step.
2. Browse the files and folders to become familiar.
- /css -- Contains output CSS files after compiling scss
- /docs -- Documentation about this application and the Visual Update 1 application
- /extension -- Contains files used to create Chrome extension
- /scss -- SCSS files that contain the style changes
- /apps -- Contains app specific folders
- /profiles and more -- Contains app specific SCSS partial file
- _contactcards.scss and more -- SCSS partial file
- /components -- SCSS files for common components used across apps, such as buttons and links
- _buttons.scss and more -- SCSS partial file
- /global -- SCSS files for global style changes applied regardless of application
- _repoName.scss and more -- SCSS partial file
- /prereqs -- SCSS files for style changes that are used by other scss files, such as color variables
- _colors.scss and more -- SCSS partial file
- files.scss -- SCSS file that references partial scss files used in the Files application
- global.scss -- SCSS file that references partial scss files used globally
- meetings.scss -- SCSS file that references partial scss files used in the Meetings application
- profiles.scss -- SCSS file that references partial scss files used in the Profiles and Contacts applications
- search.scss -- SCSS file that references partial scss files used in the Search application
- settings.scss -- SCSS file that references partial scss files used in the Settings pages
- etc...
- /svg -- Copy of SVG images that are streamlined and stored in _icons.scss as variables
- manifest.json -- Used to define Chrome extension
- org-ext.json -- Sample .json file used when adding your customizations as an Organization Extension [DEPRECATED]
- periscope.js -- Javascript file used with Tampermonkey to indicate which CSS file to load based on the page you are on.
- readme.md -- Points to where you can find complete documentation
- tmScript.js -- Tampermonkey script
- vu1-include-css.json -- .json file to use when creating your app in the registry. This tells Customizer what CSS to inject and what repo the files are in. This includes the CSS files directly into pages without use of Javascript, which allows styles to load faster.
3. Understand why some SCSS files start with a "_" (underscore)
You may have noticed, there are a lot of SCSS files but there are only a few CSS files generated. The point of this is to send less requests to the server and make the load time as fast as possible. The way this is achieved is by placing a "_" (underscore) before every .scss file that we don't want to create a CSS file for. We refer to these "_.scss" files as "partials". The main scss files, such as files, global, meetings, profiles, search, and settings don't have a "_" in front of their file name. The main scss files import "partials" and compile them into large CSS files.
4. Keep your local clone up to date
Periodically pull updates from hclcnx/cnx-custom-theme to keep your local clone up to date. We will post updates to fix issues and to add styles to more pages and applications. Pull updates into your local clone from hclcnx/cnx-custom-theme master branch.
Use a browser extension that allows you to override elements and CSS of a page with local files, such as Tampermonkey for Chrome. The extension allows you to see the changes you make in your local files.
Follow these steps to use Tampermonkey for Chrome to override the styles on the site with the styles defined in the files on your local machine.
- Install the Tampermonkey extension in Chrome.
- On the Extensions page, locate Tampermonkey and select the box to "Allow access to file URLs".
- Access Tampermonkey and go to the Dashboard to create a new script.
- In the editor, replace all the code with the code found in the /tmScript.js file.
- Replace "YOURFILEPATHGOESHERE" with the full path to the cloned /cnx-custom-theme directory.
- Note: file:/// has 3 slashes.
- Mac example:
...
// @require file:///User/username/folder/cnx-custom-theme/periscope.js
// @resource files file:///User/username/folder/cnx-custom-theme/css/files.css
// @resource profiles file:///YOURFILEPATHGOESHERE/cnx-custom-theme/css/profiles.css
...
- Windows example:
...
// @require file:///C:/folder/cnx-custom-theme/periscope.js
// @resource files file:///C:/folder/cnx-custom-theme/css/files.css
// @resource profiles file:///YOURFILEPATHGOESHERE/cnx-custom-theme/css/profiles.css
...
- After you replace the file paths, save the script.
- Go to Connections Cloud and Files to see the changes included in this application.
To make CSS easier to manage, all of the styling is written is Scss which needs to be compiled into CSS using a Sass Compiler.
You can use an open source Sass compiler to compile Scss into CSS. Learn more and install a Sass compiler.
After you install a Sass compiler you can set it to watch the /cnx-custom-theme directory for changes to files in /scss and it will automatically compile and output files to /css. The easiest way to do this is to run a watch command in a terminal window.
- Open terminal and navigate to the /cnx-custom-theme folder.
- Run this command:
sass --watch scss:css
- Now when you make changes to scss files and save, they are compiled and the appropriate CSS files are updated in the /css folder.
Change the brand colors
Try to change the colors
- Locate /scss/prereqs/_colors.scss
- Change the primary brand colors, $brand-01, $brand-02, and $brand-03, with different hex values.
- Save the changes and if the compiler is watching it will generate all the css files because _colors.scss is used in all of them.
- Reload the web page to see the changes.
Increase the height of the top navigation bar
Try to change the height and font-size
- Locate /scss/prereqs/_navbar.scss
- Change $navbar-height to 80px.
- Change $navbar-font-size to 16px.
- Save the changes and if the compiler is watching it will generate the necessary css files. It might only generate global.css because the navigation bar is a global item.
- Reload the web page to see the changes.
Change icons on a page
The way Connections was built, most icons are loaded via a sprite sheet as background and to show the certain icon, the developers used background-position and set x,y values to some specific value.
If we want to replace an icon, we can add in an svg file. However since we can't modify the DOM to insert the svg, we can override the background and include the svg as encoded in base64. Since this example has many icons changed, we made this process as simple as possible.
- Edit the .svg in a text editor.
- Remove any unnecessary comments or attributes.
- Remove all the line returns so that the .svg markup is all on one line and save the file.
- Include fill="#000000" on parts of the SVG where you want to be able to change the color. The logic used in this example looks for fill="#000000" and replaces it with the color you specify.
Note: This only supports changing one color at this time.
- Add the .svg as a variable to use in Connections. Find the scss/prereqs/_icons.scss file and add your icon as a variable:
$svg-myIcon:'<svg width="24px height="24px" blah blah blah;><path fill="#000000" d="blah blah"></path></svg>';
- Apply the icon variable to be used as a background-image for any element you need by doing the following:
.myElement{
background-image:svg-url-with-replaced-fill($svg-myIcon, '#000000', $colorVariable) !important;
}
Create a Chrome extension to share your changes with others.
- Create a new folder for the extension, such as /theme-extension, and put a copy of the /cnx-custom-theme folder inside of it.
- In the extension, edit the /manifest.json file if:
- You want to modify the version number of the extension
- You changed the name of the periscope.js file
- In the extension folder, remove the following folders that aren't needed and to save space:
- /.git
- /.sass-cache
- /docs
- /scss
- /svg
- Zip up only the /theme-extension folder.
- Share theme-extension.zip with others along with the following instructions to install it.
Instructions to install the Chrome extension
- Download this zip file and unzip it where you want.
- Go to chrome://extensions
- Check "Developer mode"
- Click "Load unpacked extension..."
- Locate and select the /theme-extension folder you unzipped. If you see /theme-extension/theme-extension select the nested folder.
Instructions to update the Chrome extension with an updated version
- Download and replace the zip and folder from before.
- Go to chrome://extensions
- Click "Reload" on your existing Chrome extension to get the updates.
Create application in app registry
When you are ready to share these changes with a wider audience, follow the instructions to Create and Enable an application in the app registry.


This demo renders Conway's Game of Life.
Note: the C++ source code of this demo is available in the Native Client SDK (examples/demo/life).
FPS: 0


Main
Goals
Time to Completion
Who?
Eat Chocolate
6 months
Done!
Delete
002
2 days!
Done!
Delete
003
1 day!
Done!
Delete


Manchester City 'eye swoop for Dennis Geiger'
Manchester City are reportedly weighing up a swoop for Hoffenheim midfielder Dennis Geiger.
by Matt LawThe 21-year-old has spent his entire footballing career with Hoffenheim, progressing through the youth system before making his first-team debut in 2017.
This season, the German has contributed three assists in nine Bundesliga appearances, which is believed to have attracted the attention of Bayern Munich.
However, according to Sport1, City are also interested in a move for Geiger, who has been capped at Under-21 level by Germany.
Geiger's versatility is shown by the fact that he has operated as a holding midfielder, central midfielder and attacking midfielder for Hoffenheim during the 2019-20 campaign.
Everton are also thought to be keeping a close eye on developments ahead of the January window.
body check tags ::


Awesome Features
Feature 1
Feature 2
Feature 3
Feature 4
Feature 1
Feature 2
Feature 3
Feature 4
Previous
Next
Click to expand
Click to expand
Click to expand
Click to expand
Some description of feature 1.
Some description of feature 2.
Some description of feature 3.
Some description of feature 4.


Drag with bind
Drag Me
Delegated Drags
Drag Ghost
Drag and I get cloned
Drag Revert
Drag and let me go
Drag and let me go
Limit Drag
Drag Representative
Drag a Representative
I represent You
Drag Horizontal
I only move horizontal
Drag Distance
You have to move me 50 pixels
Drag Scrolls
I move scrollbars


Priestess Restina:
Thank you for helping us. As promised, you shall receive a reward commensurate with your performance.
Your brave efforts have spelled the doom of all who have invaded the Garden of Eva! Will you stay and help us finish them off?
"I must be going."
"Death to the blade stakatos!"


 Quaerat earum quam cupiditate unde saepe nam?
Lorem ipsum dolor sit amet consectetur adipisicing elit. Quaerat earum quam cupiditate unde saepe nam?
Lorem ipsum dolor sit amet consectetur adipisicing elit. Quaerat earum quam cupiditate unde saepe nam?
Signin
Signup
Log Into Your Account
Please enter your Login details
Login
forgot your password?
or sign in with one of these services
Signup Today
Please fill out this form to register
Contact Us
Name
Email
Message


EZ Publish
Learning Registry
Log Out
Settings
Documentation
Learning Registry
This page requires javascript.


doge!!
1.


About Me
I'm a developer interested in programming iOS jailbreak tweaks, emulators, and reverse engineering.
Contact Me
Cydia Repo
iOS Tweak Showcase
SettingsWidgets
Add some nice looking widgets to the front page of the settings app.
v1.2
BatteryHomeBar
Display the battery level on the Home Bar.
v1.3.1
PhotoInfo
Get the file size and resolution of a photo quickly.
v1.0
Remove3DOptions
Remove some options for using 3D touch on apps
Other Projects
zoomb0i
A WIP GameBoy emulator written in C and SDL2 by me and qwertyuiop1379
v0.1~alpha


Jaw Thrust
If the victim has fallen and hurt their neck, push their jaw forward to allow them to breath better.
If you hear gurgling noises, turn them over using the following technique:
Recovery Position
Turn the victim on their side so they do not choke or inhale vomit.


{a title a}
Name:
{a list.name a}
delete
{a card.title a}
{a card.description a}
Title:
Close
Delete
+


A guard is a class annotated with the @Injectable()
decorator. The guard should implement the CanActivate
interface.
The guards have a single responsibility. They determine whether a request shall be handled by the route handler or not.
Until now, the access restriction logic was mostly inside the middleware.
It's still fine since things such as token validation or attaching properties to the request
object are not strongly connected with a particular routes.
But middleware, by its nature, is dumb. It doesn't know which handler will be executed after calling the next()
function.
On the other hand, Guards have an access to the ExecutionContext
instance, and thus we know exactly what's going to be evaluated.
Hint Guards are executed after each middleware, but before any pipe.
One of the best guards use-cases is the authentication logic because specific routes should be available only when the caller has sufficient permissions.
The AuthGuard
that we have a plan to create is going to sequentially extract and validate the token sent in request headers.
{{ authGuard }}
{{ authGuardJs }}
Regardless of the logic that sits behind validateRequest()
function, the main point is to show how simple is to take advantage of guards.
Every guard provides a canActivate()
function. The guard might return its boolean answer either synchronously or asynchronously via a (Promise
or Observable
).
The returned value controls the Nest behavior:
true
, the user call will be processed.false
, Nest will ignore a currently processed request.
The canActivate()
function takes single argument, the ExecutionContext
instance.
The ExecutionContext
inherits from ArgumentsHost
(first mention here).
The
ArgumentsHost
is a wrapper around arguments that have been passed to the
original handler, and it contains different arguments array under the hood based on the type of the application.
{{ argumentsHost }}
The
ArgumentsHost
supplies us with a set of useful methods that helps to pick correct arguments from the underlying array. In other words,
ArgumentsHost
is nothing else than just an
array of arguments. For example, when the guard is used within HTTP application context,
ArgumentsHost
will contain
[request, response]
array inside. However, when current context is a web sockets application, this array will be equal to
[client, data]
. This design decision enables you to access any argument that would be eventually passed to the corresponding
handler.
The ExecutionContext
offers a little bit more. It extends ArgumentsHost
, but also, provides more details about current execution process.
{{ executionContext }}
The getHandler()
returns a reference to the currently processed handler, while getClass()
returns a type of the Controller
class which this particular handler belongs to.
Using other words, if the user points to create()
method that is defined and registered within CatsController
,
the getHandler()
will return a reference to the create()
method and getClass()
in this case, will simply return a CatsController
type (not instance).
A little bit more detailed example is a RolesGuard
. This guard permits access only to users with a specific role.
We are gonna start with a basic guard template:
{{ rolesGuard }}
{{ rolesGuardJs }}
The guards can be controller-scoped, method-scoped, and global-scoped as well. In order to set up the guard, we have to use a @UseGuards()
decorator. This decorator may take an endless number of arguments, meaning, you can pass several guards and separate them by a comma.
{{ useGuards }}
Hint The@UseGuards()
decorator is imported from the@nestjs/common
package.
We have passed the RolesGuard
type instead of an instance, leaving framework the instantiation responsibility and enabling dependency injection.
Another available way is to pass the immediately created instance:
{{ useGuardsWithInstance }}
The construction above attaches the guard to every handler declared by this controller. If we decide to restrict only one of them, we just need to set up the guard at method level.
In order to bind the global guard, we use the useGlobalGuards()
method of the Nest application instance:
{{ globalGuard }}
Notice The
useGlobalGuards()
method doesn't set up guards for gateways and microservices.
The global guards are used across the whole application, for every controller and every route handler. In terms of dependency injection, global guards registered from the outside of any module (as in the previous example above) cannot inject dependencies since they don't belong to any module. In order to solve this issue, you can set up a guard directly from any module using following construction:
{{ 'app.module' | extension: globalScopedGuardModuleT.isJsActive }}{{ globalScopedGuardModule }}
Hint The alternative option is to use an execution context feature.
Also, useClass
is not the only way of dealing with custom providers registration. Learn more here.
The guard is working now, but we're still not taking advantage of the most important guard features, being the execution context.
The RolesGuard
isn't reusable so far. How would we know which roles need to be processed by the handler?
The CatsController
could have a lot of them. Some might be available only for admin, some for everyone, although, they don't have any permissions.
That's why along with the guards, Nest provides the ability to attach custom metadata through @ReflectMetadata()
decorator.
{{ reflectMetadata }}
{{ reflectMetadataJs }}
Hint The@ReflectMetadata()
decorator is imported from the@nestjs/common
package.
With the construction above, we attached the roles
metadata (roles
is a key, while ['admin']
is a particular value) to the create()
method.
It's not a good practice to use @ReflectMetadata()
directly. Instead, you should always create your own decorators:
{{ rolesDecorator }}
{{ rolesDecoratorJs }}
This approach is much cleaner and readable. Since we've got a @Roles()
decorator now, we can use it with the create()
method.
{{ catsRolesDecorator }}
{{ catsRolesDecoratorJs }}
Alright. Let's take a step back to the RolesGuard
again. It simply returns true
immediately, allowing request to proceed so far.
In order to reflect the metadata, we'll use the Reflector
helper class which is provided out of the box by the framework and exposed from the @nestjs/core
package.
{{ rolesGuardExt }}
{{ rolesGuardExtJs }}
Hint In the node.js world, it's a common practice to attach the authorized user to therequest
object. That's why we assumed thatrequest.user
contains the user instance.
The Reflector
allows us to easily reflect the metadata by the specified key. In the example above, we used getHandler()
in order to reflect the metadata because it's a reference to the route handler function.
We could make this guard even more generic if we add the controller reflection part as well.
To extract the controller metadata, we should use context.getClass()
instead of getHandler()
function:
{{ controllerMetadata }}
{{ controllerMetadataJs }}
When a user tries to call the /cats
POST endpoint without enough privileges, Nest will automatically return response below:
{{ forbidden }}
In fact, the guard which returns false
throws HttpException
.
If you want to return a different error response to the end-user, you should throw an exception.
Afterward, this exception can be caught by the exception filter.


Back to Algorithm "oriented" page
.
[Color] Boundary Detection Benchmark: Algorithm "oriented" Image #3 (42049)
Machine
>
Human
>
Page generated on 25-Sep-2017 23:05:26.


#include <siphash.h>
Definition at line 20 of file siphash.h.
Definition at line 24 of file siphash.h.
Definition at line 25 of file siphash.h.
Definition at line 21 of file siphash.h.
Definition at line 22 of file siphash.h.
Definition at line 26 of file siphash.h.
Definition at line 23 of file siphash.h.


Why Kartarpur of Guru Nanak Dev Ji is so important?
Kartarpur became the centre for the Sikhs, where ‘Truthful Living’ was the essence of life.
by Dr. Rishi Singhਸਚਹੁ ਓਰੈ ਸਭੁ ਕੋ ਉਪਰਿ ਸਚੁ ਆਚਾਰੁ ॥੫॥
सचहु ओरै सभु को उपरि सचु आचारु ॥५॥
Sacẖahu orai sabẖ ko upar sacẖ ācẖār. ||5||
Truth is high but higher still is truthful living.
– Sri Guru Granth Sahib Ji, Ang 62
Kartarpur, the village on the banks of the River Ravi in Pakistan is where Guru Nanak Dev ji settled after his long Udasis, journeys.  Kartarpur was also where Guru Nanak Dev ji met Bhai Lehna ji. He appointed Bhai Lehna ji as the next spiritual leader of the Sikhs. Guru Nanak Dev ji proclaimed that Bhai Lehna ji will be called Angad, a part of the Guru’s body, henceforth was known as Guru Angad Dev ji.
Kartarpur became the centre for the Sikhs, where ‘Truthful Living’ was the essence of life.
(Click for the rest of the article)


Ephesians 6:16
Above all, taking the shield of faith, wherewith ye shall be able to quench all the fiery darts of the wicked.


Human faces provide facial information as a clue to better understand the current state of user’s mind. Affective computing deals with machines and emotions. Emotion recognition is very essential to develop effective Human-Computer Interaction. Human emotions are recognized by various non-verbal cues like facial expressions, gestures, body posture or speech. Among them facial expressions is easy to obtain. Facial expressions can be used to obtain 7 categories ofexpressions like neutral, happiness, surprise, disgust, fear, anger and surprise. Recognition and extracting various emotions and then validating those emotions from the facial expressions has become important for improving the overall human computer interaction.
In the past decade, facial expression classification and recognition has been a widely researched topic. Facial expression analysis has a wide range of applications such as socially intelligent robot with emotional intelligence, assistance systems for autistic people, emotion detection system used by the disabled to assist a caretaker, pain or stress detection systems for psychological studies, intelligent tutoring system for providing feedback to the instructors, portable, mobile application to automatically insert emotionsin chat applications etc. Considering these applications, it is evident that the facial expression detection systems would be ineffective unless they are made to work in real-time. As expression recognition systems become implementable in real-time with enhanced robustness, many other innovative applications would emerge from it.
A facial expression recognition system generally consists of three major steps and involves the process of acquiring the images, processing the images, detection of faces then extracting the expression feature. First step is to identify theface region from the acquired image and then preprocessed so as to minimize the environmental and other variations in the image. The next step is to extract expression features which are then classified in the third step. The classifier provides the output of the expression which is recognized.
Facial expression is an important form of emotional state and mental state. Psychologist Mehrabian's research shows that only 7% of the total information is passed by language, and 38% is transported by language auxiliary, such as the rhythm of speech, tone, etc. But the Ratio of information which passed by facial expression has reached 55% of the total. Therefore, a lot of valuable information can get by facial expression recognition that gives an effective way to the perceive person's consciousness and mental activity. Because of this, facial expression recognition, showing important theoretical research value, practical value and the life application value, has become an important research topic. Facial expression recognition researches date back to the 19th century.
In 1872, Darwin firstly announced the consistency of expression .In his opinion the meaning of facial expressing was not judged by gender and race. In the 1970s, Ekman and Friesen made a pioneering work for facial expression recognition that they defined six basic expression categories of human: surprise, fear, disgust, anger, happiness and sadness which provided a way for current expression recognition research. Until the 1990s, the developing of image processing and pattern recognition technology made the facial expression recognition computer automated processing possible.
In 1991, Mase and Pentland proposed a new theory using optical flow method to recognize facial expression. Since then, using computer technology in feature extraction and classification of facial expression has aroused widespread attention from researchers. Facial expression recognition have been widely used in human computer interaction, affective computing, intelligent control, psychological analysis, pattern recognition, security monitoring, social cognition, machine vision, social entertainment and other fields.


Beta This is a test version of the layout of this page. Take the survey to help us improve it
Guidance
Information about the EFA Information Exchange, including how to access the system and request support.
EFA Information Exchange is a secure, online system which provides a single place for academies, 16 to 19 providers, high needs providers and local authorities to do business with Education Funding Agency ( EFA ) in a more effective and efficient way.
The documents on this page include information about:


| < Day Day Up > |
5.2 Optimizer Features and OdditiesWhen testing queries, always remember to use realistic data. A common source of problems with MySQL is the query optimizer's handling of test data. It often does surprising things. If you don't know what it's doing and why (and it rarely tells you why), you may spend a lot of time tracking down a problem that really isn't there. Or, worse yet, you may embarrass yourself asking about it on the MySQL mailing list, only to learn that you've created the problem all on your own. In general, MySQL uses an index when it is reasonably confident that doing so is more efficient than not doing so. This leads to false negatives during testing. The false negative tends to occur in the two situations that we'll now investigate. 5.2.1 Too Little DiversityEven if you have a lot of data (thousands of rows or more), MySQL may choose to ignore your indexes some of the time if your data doesn't have sufficient diversity. Why might that happen? Imagine you have a table that contains historical climate data for most world cities: CREATE TABLE weather ( city VARCHAR(100) NOT NULL, high_temp TINYINT NOT NULL, low_temp TINYINT NOT NULL, the_date DATE NOT NULL, INDEX (city), INDEX (the_date), ) Rather than loading all two million records, you load two years worth of data (1980 and 1981) to test. After some testing, you find that queries that need to access many of the records are using full table scans rather than the the_date index. For example, to find the average high temperature in 1980, you might write something like this: SELECT AVG(high_temp) FROM weather WHERE the_date BETWEEN '1980-01-01' AND '1980-12-31'; Having data from only 1980 and 1981 loaded, that query needs to examine 50% of the rows in the weather table. In such a case, MySQL decides that it is faster to simply scan the entire table. How does it know? When you cross a certain threshold, it is slower to locate rows using an index than to read them sequentially. For MySQL, the cutoff point is roughly 30%. The number is chosen by the MySQL developers based on their extensive experience (and knowledge of the code) and is subject to change from release to release. The actual number is specific to each storage engine: InnoDB has a different threshold than MyISAM tables, and so forth. The main reason index performance is worse in these circumstances goes all the way down to the hardware: disk seek performance. Indexes are always sorted, but the data on disk is not. Using an index means accessing the rows in index-sorted order rather than in the order they reside on disk. The end result is more time spent moving around the disk and less time reading data. Sequential reads are always going to be faster than random seeks. If you're lucky enough to be using a RAM disk, most of the overhead vanishes. You can draw two conclusions from this knowledge. First, if a table really is going to remain very small, you may want to leave off the indexes.  Without them you can't enforce a unique constraint on the table.) The second conclusion merely reinforces what we said earlier—always use a representative data set for your testing. It should be representative both in terms of size and diversity. One special case that must be mentioned is that of index-only queries. If you happen to write a query that requires only columns contained within a single index, you'll be pleasantly surprised. MySQL is smart enough to realize that all the required data is present in the index, so it doesn't bother to fetch any of the rows from disk. This, obviously, provides you with excellent performance. 5.2.2 Index-Based OrderingOne of MySQL's weak points is sorting. It can usually fetch 15,000 rows in a heartbeat, but if you happen to need them in any particular order it may take quite a bit more time.[2]
The problem is really two-fold. First, sorting is simply more work, and work takes time. Aside from adding a faster CPU, there's no avoiding that fact. If you're not sorting on a computed field, your first instinct is likely to add an index on the sorting column. Unfortunately, that rarely helps. As you'll remember from Chapter 4, MySQL uses at most one index per table per query. Odds are that you're already using an index on the table in question, so MySQL will not touch your new index. The solution to the second problem also goes back to Chapter 4. Add the sorting column as a second part in the existing index. By doing so you get the best of both worlds. You'll have an index MySQL can use to quickly locate rows (just as before) and an index that provides order to the data. That removes the need for MySQL to make a sorting pass over the results. Going back to the weather example, to speed up queries like this: SELECT * FROM weather WHERE city = 'Toledo' ORDER BY the_date DESC you'd change the index on city to an index on (city, the_date): ALTER TABLE weather DROP INDEX city, ADD INDEX (city, the_date) Remember that the order of columns is significant. The leftmost prefix rule dictates that city must appear first in the index to be used for that query. Taking things a step further, you might then be tempted to remove the single index on the_date. Don't do it unless you're sure there are no queries using the_date in their WHERE clause. A query based on the_date can't be satisfied using the new index on (city, the_date) because the_date isn't a leftmost prefix in the index. 5.2.3 Impossible QueriesMySQL performs a basic logical analysis of the WHERE clause of every query. In doing so, it can often detect when you've asked for something that doesn't make any sense: SELECT * FROM mytable WHERE id < 5000 and id > 30000 If it finds an impossible WHERE clause, it returns zero records, sparing the expense of running an otherwise pointless and possibly expensive query. If you suspect that MySQL has optimized away an impossible WHERE clause, simply ask it to EXPLAIN the query. If you see a result like this: mysql> SELECT * FROM mytable WHERE id < 5000 and id > 30000 +-----------------------------------------------------+ | Comment | +-----------------------------------------------------+ | Impossible WHERE noticed after reading const tables | +-----------------------------------------------------+ 1 row in set (0.00 sec) you'll know what it was thinking. Aside from making a simple typo, it's unlikely that you'll run many queries like that. However, if you're building an application on top of MySQL and happen to make a typo or a serious logic error in the code, you can end up running lots of pointless queries before tracking down the problem. It's good to know that MySQL doesn't waste much time dealing with your illogical queries. 5.2.4 Full-Text Instead of LIKEFrom Chapter 4, it's clear that full-text indexes are much faster than using a LIKE clause in your queries to search for a word or phrase. In the vast majority of cases, you should use a full-text index to tackle these types of problems. However, there are times when this can be problematic. The query optimizer doesn't look very closely at full-text indexes when deciding which index to use for a table. In fact, if there's a usable full-text index, the optimizer will always prefer it regardless of how many rows it actually eliminates from the result set. Hopefully this will be fixed in a future version of MySQL. |
| < Day Day Up > |


Web & Mobile Development
Elevate
html, css, JavaScript
News List
PHP, html, css, JavaScript
News & Utility App
Swift
PHP Tutorial
JavaScript, html, css
Box Blaster
Python
News Filter App
Java


Home
About Me
Experience
Contact
Welcome to Qiqi Chen's Homepage
Say Hello - Rosie Thomas/Sufjan Stevens


Class GraphExtensions
Contains useful extension methods to simplify using Graphs and rest of the family
from this namespace.
Inheritance
System.Object
GraphExtensions
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Assembly: cs.temp.dll.dll
Syntax
public static class GraphExtensions
Methods
Adjacency(Graph)
Creates an adjacency instance for the graph.
Declaration
public static VertexAdjacency Adjacency(this Graph graph)
Parameters
| Type |
Name |
Description |
| Graph |
graph |
Graph to create adjacency for.
|
Returns
Adjacency(InducedSubgraph)
Creates an adjacency instance for the graph.
It's optimized in comparison to creating adjacency directly from an actual Subgraph
of graph.
Declaration
public static VertexAdjacency Adjacency(this InducedSubgraph graph)
Parameters
Returns
ColorsUsed(GraphColoring)
Calculates count of unique colors used in coloring.
Declaration
public static int ColorsUsed(this GraphColoring coloring)
Parameters
| Type |
Name |
Description |
| GraphColoring |
coloring |
Coloring to count colors in.
|
Returns
| Type |
Description |
| System.Int32 |
Count of unique colors.
|
Degree(Vertex, VertexAdjacency)
Declaration
public static int Degree(this Vertex vertex, VertexAdjacency adjacency)
Parameters
Returns
| Type |
Description |
| System.Int32 |
|
Index(Graph)
Declaration
public static GraphIndex Index(this Graph graph)
Parameters
| Type |
Name |
Description |
| Graph |
graph |
|
Returns
InducedSubgraph(Graph, VertexAdjacency, ImmutableSortedSet<Vertex>)
Declaration
public static InducedSubgraph InducedSubgraph(this Graph graph, VertexAdjacency adjacency, ImmutableSortedSet<Vertex> vertices)
Parameters
Returns
InducedSubgraph(VertexAdjacency, ImmutableSortedSet<Vertex>)
Declaration
public static InducedSubgraph InducedSubgraph(this VertexAdjacency adjacency, ImmutableSortedSet<Vertex> vertices)
Parameters
Returns
InducedSubgraphByRemovingVertices(Graph, VertexAdjacency, IEnumerable<Vertex>)
Declaration
public static InducedSubgraph InducedSubgraphByRemovingVertices(this Graph graph, VertexAdjacency adjacency, IEnumerable<Vertex> removedVertices)
Parameters
Returns
InducedSubgraphByRemovingVertices(VertexAdjacency, IEnumerable<Vertex>)
Declaration
public static InducedSubgraph InducedSubgraphByRemovingVertices(this VertexAdjacency adjacency, IEnumerable<Vertex> removedVertices)
Parameters
Returns
MaxDegreeVertex(Graph, VertexDegrees)
Declaration
public static Vertex MaxDegreeVertex(this Graph graph, VertexDegrees degrees)
Parameters
Returns
MinDegreeVertex(Graph, VertexDegrees)
Declaration
public static Vertex MinDegreeVertex(this Graph graph, VertexDegrees degrees)
Parameters
Returns
OtherVertex(Edge, Vertex)
Declaration
public static Vertex OtherVertex(this Edge e, Vertex v)
Parameters
Returns
ToImmutable(MutableEdge)
Declaration
public static Edge ToImmutable(this MutableEdge mutable)
Parameters
Returns
ToImmutable(MutableEdge, GraphIndex)
Declaration
public static Edge ToImmutable(this MutableEdge mutable, GraphIndex index)
Parameters
Returns
ToImmutable(MutableGraph)
Declaration
public static Graph ToImmutable(this MutableGraph mutable)
Parameters
Returns
ToImmutable(MutableGraphColoring)
Transforms this mutable instance (as well as it's properties) to immutable copy.
Declaration
public static GraphColoring ToImmutable(this MutableGraphColoring coloring)
Parameters
Returns
| Type |
Description |
| GraphColoring |
Immutable copy of provided instance.
|
ToImmutable(MutableVertex)
Declaration
public static Vertex ToImmutable(this MutableVertex mutable)
Parameters
Returns
VertexDegrees(VertexAdjacency)
Creates container for graph's vertex degrees.
Declaration
public static VertexDegrees VertexDegrees(this VertexAdjacency adjacency)
Parameters
Returns


Contact Info
Github: https://github.com/tha1982
Email<EMAIL_ADDRESS>Facebook: fb.com/thach.tha.54
--- layout: page author_profile: true css: - "/assets/css/homepage.css" js: - "/assets/js/typed.js" - "/assets/js/homepage.js" - "/assets/js/contact-page.js" ---


Breaking News
Fifteen Minutes
What We're Reading
Media
Other Issues
Click a cover to jump in
Race and Belonging at Harvard College
It’s been a big year for organizing by students of color, and particularly black students, on college campuses. And as it so often does, Harvard has...
Recruiting A Dynasty
To create a league power, Tommy Amaker had to navigate league rules to pry kids from the major programs who could offer them scholarships and...
Jill Lepore: A Historian’s History
Her work as an academic, a professor, and a magazine writer is to bring alive documents of the past; speaking with her is like encountering a living...


CoverView GUI
Analysis View
Genes View
Regions View
Profiles View
Usage Guide
Profiles
Region name
COV
QCOV
FLMQ
MEDMQ
FLBQ
MEDBQ
---
COV
QCOV
FLMQ
MEDMQ
FLBQ
MEDBQ
<
32930554-32930756
Zoom out
>
Reads:
All
Forward
Reverse
Cut-off:
Show
Hide
Axes:
Normal
Re-scale
↗ Show Region


A lightweight 2d library for easy canvas animations and interactions
First of all, thank you for landing on this page and taking an interest in this little tool. If you are interested in exploiting the potential of html5 canvases perhaps this is just what you are looking for. The library will allow you to create interactive applications and games in an easy and hopefully quick way. The guide below will help you understand how to make this library work best.
This documentation is to help you regarding each step of use. Please go through the documentation carefully to understand how this library is made and how to use it properly. Basic javascript and HTML knowledge is required
You will need the following sofwares to customize this template.
Be careful while reading this documentation. Some passages, to be understood, require the knowledge of some points expressed previously.
To start, you need to recall the compressed script of Duedo on the page. Next you will need to create a canvas element and use it to create the application instance.
Create a canvas and specify the size that the canvas will have, and therefore the viewport of your application
Our you can use the grid system with 2 columns like this;
/* * Create a new instance, specifying the canvas to use, * the size in length and size in height of the virtual world. */ app = new Duedo.GameContext(document.getElementById("screen"), 5500, 1000);
If everything was fine, you should see the splash screen.
From now on we will refer to the application instance as "app".
To load and use resources you need an active server. You can use MAMP or Node or use a remote server via FTP.
There is no application without some kind of resource, images or audio. To add resources to the application you must first load them and make them available to the application that will make immediate use of them. For this reason, the app object provides the Loader that will load and provide the resource.
To access the Loader just call it up
const loader = app.Loader;
Then you can immediately use it to load resources that are present at the specified address. You can upload images, audio, json, spritesheet.
//Preload a jpg loader.AddResource("media/ball.jpg"); // If you want to specify another name for the resource, pass it as second parameter loader.AddResource("media/music.wav", "soundtrack"); // In this case I am specifying two variant formats of the same audio to meet the possible // incompatibilities given by the various browsers. loader.AddResource("media/click.wav | media/click.mp3"); // Load a json Game.Loader.AddResource("src/anims/frames.json", 'frames'); // Bind the "complete" callback function loader.Bind("complete", completeCallback); // Start loading process loader.StartLoading();
When the loading has been completed, the specified callback will be called, within which it is possible to start all the processes that will exploit those certain resources. So, in this case, the application we are developing.
The "image" entity represents the most classic object of an interactive application.
It allows you to create an image object starting from a resource that has been preloaded through the Loader.
It belongs to the category of Graphic Objects, and therefore has a series of properties,
first of all the position in space, represented by a 2d vector Duedo.Vector2.
Lets create it.
// Create a "ball" image const ball = new Duedo.Image(game, game.Cache.GetImage("ball")); ball.Width = 30; ball.Height = 30; // Location is based on the center of the object, unless you set CenterRelative = false ball.Location.X = 15; ball.Location.Y = 15;
Once you created the image object, put it in the application's world with:
app.Add(ball);
From now on you will see your ball appear on the canvas at the position set by the Location vector.
The image belongs to the category of Graphic Objects, such as Text, geometric figures, and as we will see also parts of the Viewport. To make full use of these objects, it is good to know the additional properties.
Duedo offers the Sound and SoundManager objects. Through the Sound object it is possible to play an audio document, stop it, assign a location in the Cartesian space (and its volume will vary according to the distance from the viewport), repeat it a few times or infinitely, modify its volume.
Be careful, browsers accept different audio formats depending on the manufacturer. Please inquire before attempting to run the file. See compatibilities.
To run a file that has been loaded, you can do it with:
// Return a Sound object const mySound = app.SoundManager.Get("soundtrack"); mySound.Play();
Other methods are
To attach callbacks you can use Bind
mySound.Bind('ended', callback)
Other events are
SoundManager is the global manager of the audio taken over by the application. It exposes some methods which are useful for managing groups of audio at the same time, or accessing the available audio files.
const soundManager = app.SoundManager;
Properties are
Spritesheets are a classic of 2d animation. To be able to use them there is a dedicated object called Spritesheet.
// Create a spritesheet from a preloaded image const runner = new Duedo.SpriteSheet(app, app.Cache.GetImage("runningGrant")); // Set location runner.Location.X = 350; runner.Location.Y = 20; // Create the frame sequence runner.AddSequence("runright", [ [1,70, 158,213], // Each line correspond to one frame [344,70,147,217], [685,73,116,217], [1025,72,106,218], [1363,67,98,224], [1666,67,143,224], [11,359,152,225], [508,362,148,209], [845,363,140,209], [1192,364,117,219], [1532,363,96,221], [1848,359,108,224], [18,906,138,218] ]); // Play the sequence const sequence = runner.PlaySequence("runright"); app.Add(runner);
This method allows you to add a frames-sequence to this spritesheet. It should correspond to a certain sequence of frames present in the graphic asset.
sequenceName
:String
framesData
:Array of arrays
This method returns, if it exists, the requested sequence array.
sequenceName
:String
Add spritesheet sequences from a preloaded *.json file
jsonCachedFile
:Json
Properties
The text object allows you to insert text within the graphic context. It offers several tools for manipulating and managing information, the ability to adjust the font, color, size and everything else necessary.
Lorem the It is a long established fact that a reader will be distracted.. Please read more about WordPress here.
Lorem the It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English.
Lorem the It is a long established fact that a reader will be distracted.. Please read more about WordPress here.
Lorem the It is a long established fact that a reader will be distracted.. Please read more about WordPress here.
Lorem the It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English.
Lorem the It is a long established fact that a reader will be distracted.. Please read more about WordPress here.
Lorem the It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. long established fact that a reader will English.
Lorem the It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. long established fact that a reader will English.
Lorem the It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. long established fact that a reader will English.
Lorem the It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. long established fact that a reader will English.
Lorem the It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. long established fact that a reader will English.
Lorem the It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. long established fact that a reader will English.
Lorem the It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. long established fact that a reader will English.
Please remember you have purchased a very affordable theme and you have not paid for a full-time web design agency. Occasionally we will help with small tweaks, but these requests will be put on a lower priority due to their nature. Support is also 100% optional and we provide it for your connivence, so please be patient, polite and respectful.
Please visit our profile page or ask question @yourusername
Support for my items includes:These are the primary CSS files used for general front-end styling. Use these to customize your theme even further. All included JavaScript codes under yourthemename/css/
These are the various attribution inks to the Javascript files included or modified to work with in this theme. All included JavaScript codes under yourthemename/js/
You can find the version history (changelog.txt) file on yourthemename-full.zip folder or you can check changelog on theme sale page.
Once again, thank you so much for purchasing this theme. As I said at the beginning, I'd be glad to help you if you have any questions relating to this theme. No guarantees, but I'll do my best to assist. If you have a more general question relating to the themes on ThemeForest, you might consider visiting the forums and asking your question in the "Item Discussion" section.
----------------------------------------------------------------------------------------- Version 3.8.4 - May 7th, 2015 ----------------------------------------------------------------------------------------- - new revolution slider plugin version - fixed security issue with xss vulnerability - improved demo importer for certain server environments - updated WooCommerce template files for the outdated message in system status - added suhosin check in system status - added information that explains ZipArchive is required on your server for importing demos - portfolio Grid template improvement - added more information to demo popup message for individual demo requirements - RTL style improvements - breadcrumb function improved for various areas ----------------------------------------------------------------------------------------- Version 3.8.3 - May 7th, 2015 ----------------------------------------------------------------------------------------- - fixed responsive / retina issue for larger logos - fusion slider now uses responsive headings all the time - dropped custom Avada styles for select boxes in IE since it is not supported - fixed compatibility issue with Category Order and Taxonomy Terms Order plugin - fixed issue of full width background being affected by padding options - tested and fixed hellobar issue - typography settings now apply to single post pages - improved smooth scroll in certain situations - youtube & vimeo videos will show at normal size in light box as long as video embed link is not used - fixed issue of â€œfixedâ€ featured image mode not working for carousels / recent work - fixed issue of header tagline font not working with font options ----------------------------------------------------------------------------------------- Version 3.8.2 - May 7th, 2015 ----------------------------------------------------------------------------------------- - fixed formatting issues with Turkish language files - letter spacing menu option improvement - improved fusion slider max content width setting - removed the â€œdisable first featured image on productsâ€ setting since it does not apply - improved portfolio featured image loading - removed encoding from tracking code, space before head, space before body, and custom CSS to stop it from parsing code within TO and removing special characters e.g. + - woo login box now shows login fields for logged out users - woo cart / my account links now show on mobile - fixed button styling issue with gravity forms
Code released under the Un License License.
For more information about copyright and license check choosealicense.com.


+++ categories = ["micro"] date = "2007-09-28T16:41:15" tags = ["tumblr, film, blade-runner"] title = "Ridley Scott Has Finally Created the Blade Runner He Always Imagined" +++
The director's cut removed the voice-over and that silly ending and put in the unicorn daydream, but the disc didn't look that great. And it should look great, because Blade Runner at the time was pretty formidable — it's pretty formidable even now, actually. A lot of people don't notice whether they're watching something beautifully technical or not, but it's important to me. So that always got in the way of the director's cut being the final version. I think it's final now because I've done all the nips and tucks and tidied up one or two of the visual areas that we couldn't do properly at the time because we didn't have the technology.


In this notebook, you'll build a GAN using convolutional layers in the generator and discriminator. This is called a Deep Convolutional GAN, or DCGAN for short. The DCGAN architecture was first explored last year and has seen impressive results in generating new images, you can read the original paper here.
You'll be training DCGAN on the Street View House Numbers (SVHN) dataset. These are color images of house numbers collected from Google street view. SVHN images are in color and much more variable than MNIST.
So, we'll need a deeper and more powerful network. This is accomplished through using convolutional layers in the discriminator and generator. It's also necessary to use batch normalization to get the convolutional networks to train. The only real changes compared to what you saw previously are in the generator and discriminator, otherwise the rest of the implementation is the same.
%matplotlib inline
import pickle as pkl
import matplotlib.pyplot as plt
import numpy as np
from scipy.io import loadmat
import tensorflow as tf
!mkdir data
Here you can download the SVHN dataset. Run the cell above and it'll download to your machine.
from urllib.request import urlretrieve
from os.path import isfile, isdir
from tqdm import tqdm
data_dir = 'data/'
if not isdir(data_dir):
raise Exception("Data directory doesn't exist!")
class DLProgress(tqdm):
last_block = 0
def hook(self, block_num=1, block_size=1, total_size=None):
self.total = total_size
self.update((block_num - self.last_block) * block_size)
self.last_block = block_num
if not isfile(data_dir + "train_32x32.mat"):
with DLProgress(unit='B', unit_scale=True, miniters=1, desc='SVHN Training Set') as pbar:
urlretrieve(
'http://ufldl.stanford.edu/housenumbers/train_32x32.mat',
data_dir + 'train_32x32.mat',
pbar.hook)
if not isfile(data_dir + "test_32x32.mat"):
with DLProgress(unit='B', unit_scale=True, miniters=1, desc='SVHN Testing Set') as pbar:
urlretrieve(
'http://ufldl.stanford.edu/housenumbers/test_32x32.mat',
data_dir + 'test_32x32.mat',
pbar.hook)
These SVHN files are .mat
files typically used with Matlab. However, we can load them in with scipy.io.loadmat
which we imported above.
data_dir = 'data/'
trainset = loadmat(data_dir + 'train_32x32.mat')
testset = loadmat(data_dir + 'test_32x32.mat')
Here I'm showing a small sample of the images. Each of these is 32x32 with 3 color channels (RGB). These are the real images we'll pass to the discriminator and what the generator will eventually fake.
idx = np.random.randint(0, trainset['X'].shape[3], size=36)
fig, axes = plt.subplots(6, 6, sharex=True, sharey=True, figsize=(5,5),)
for ii, ax in zip(idx, axes.flatten()):
ax.imshow(trainset['X'][:,:,:,ii], aspect='equal')
ax.xaxis.set_visible(False)
ax.yaxis.set_visible(False)
plt.subplots_adjust(wspace=0, hspace=0)
Here we need to do a bit of preprocessing and getting the images into a form where we can pass batches to the network. First off, we need to rescale the images to a range of -1 to 1, since the output of our generator is also in that range. We also have a set of test and validation images which could be used if we're trying to identify the numbers in the images.
def scale(x, feature_range=(-1, 1)):
# scale to (0, 1)
x = ((x - x.min())/(255 - x.min()))
# scale to feature_range
min, max = feature_range
x = x * (max - min) + min
return x
class Dataset:
def __init__(self, train, test, val_frac=0.5, shuffle=False, scale_func=None):
split_idx = int(len(test['y'])*(1 - val_frac))
self.test_x, self.valid_x = test['X'][:,:,:,:split_idx], test['X'][:,:,:,split_idx:]
self.test_y, self.valid_y = test['y'][:split_idx], test['y'][split_idx:]
self.train_x, self.train_y = train['X'], train['y']
self.train_x = np.rollaxis(self.train_x, 3)
self.valid_x = np.rollaxis(self.valid_x, 3)
self.test_x = np.rollaxis(self.test_x, 3)
if scale_func is None:
self.scaler = scale
else:
self.scaler = scale_func
self.shuffle = shuffle
def batches(self, batch_size):
if self.shuffle:
idx = np.arange(len(dataset.train_x))
np.random.shuffle(idx)
self.train_x = self.train_x[idx]
self.train_y = self.train_y[idx]
n_batches = len(self.train_y)//batch_size
for ii in range(0, len(self.train_y), batch_size):
x = self.train_x[ii:ii+batch_size]
y = self.train_y[ii:ii+batch_size]
yield self.scaler(x), y
Here, just creating some placeholders like normal.
def model_inputs(real_dim, z_dim):
inputs_real = tf.placeholder(tf.float32, (None, *real_dim), name='input_real')
inputs_z = tf.placeholder(tf.float32, (None, z_dim), name='input_z')
return inputs_real, inputs_z
Here you'll build the generator network. The input will be our noise vector z
as before. Also as before, the output will be a $tanh$ output, but this time with size 32x32 which is the size of our SVHN images.
What's new here is we'll use convolutional layers to create our new images. The first layer is a fully connected layer which is reshaped into a deep and narrow layer, something like 4x4x1024 as in the original DCGAN paper. Then we use batch normalization and a leaky ReLU activation. Next is a transposed convolution where typically you'd halve the depth and double the width and height of the previous layer. Again, we use batch normalization and leaky ReLU. For each of these layers, the general scheme is convolution > batch norm > leaky ReLU.
You keep stacking layers up like this until you get the final transposed convolution layer with shape 32x32x3. Below is the archicture used in the original DCGAN paper:
Note that the final layer here is 64x64x3, while for our SVHN dataset, we only want it to be 32x32x3.
Exercise: Build the transposed convolutional network for the generator in the function below. Be sure to use leaky ReLUs on all the layers except for the last tanh layer, as well as batch normalization on all the transposed convolutional layers except the last one.
def generator(z, output_dim, reuse=False, alpha=0.2, training=True):
with tf.variable_scope('generator', reuse=reuse):
# First fully connected layer
x = tf.layers.dense(z, 4*4*512)
x = tf.reshape(x, [-1, 4, 4, 512])
x = tf.layers.batch_normalization(x, training=training)
x = tf.maximum(alpha * x, x)
# now x is 4x4x512
layer1 = tf.layers.conv2d_transpose(x, 256, 5, strides=2, padding='same')
layer1 = tf.layers.batch_normalization(layer1, training=training)
layer1 = tf.maximum(alpha * layer1, layer1)
# now layer1 is 8x8x256
layer2 = tf.layers.conv2d_transpose(layer1, 128, 5, strides=2, padding='same')
layer2 = tf.layers.batch_normalization(layer2, training=training)
layer2 = tf.maximum(alpha * layer2, layer2)
# now layer2 is 16x16x128
# Output layer, 32x32x3
logits = tf.layers.conv2d_transpose(layer2, output_dim, 5, strides=2, padding='same')
out = tf.tanh(logits)
return out
Here you'll build the discriminator. This is basically just a convolutional classifier like you've built before. The input to the discriminator are 32x32x3 tensors/images. You'll want a few convolutional layers, then a fully connected layer for the output. As before, we want a sigmoid output, and you'll need to return the logits as well. For the depths of the convolutional layers I suggest starting with 16, 32, 64 filters in the first layer, then double the depth as you add layers. Note that in the DCGAN paper, they did all the downsampling using only strided convolutional layers with no maxpool layers.
You'll also want to use batch normalization with tf.layers.batch_normalization
on each layer except the first convolutional and output layers. Again, each layer should look something like convolution > batch norm > leaky ReLU.
Note: in this project, your batch normalization layers will always use batch statistics. (That is, always set training
to True
.) That's because we are only interested in using the discriminator to help train the generator. However, if you wanted to use the discriminator for inference later, then you would need to set the training
parameter appropriately.
Exercise: Build the convolutional network for the discriminator. The input is a 32x32x3 images, the output is a sigmoid plus the logits. Again, use Leaky ReLU activations and batch normalization on all the layers except the first.
def discriminator(x, reuse=False, alpha=0.2):
with tf.variable_scope('discriminator', reuse=reuse):
# Input layer is 32x32x3
layer1 = tf.layers.conv2d(x, 64, 5, strides=2, padding='same')
layer1 = tf.maximum(alpha * layer1, layer1)
# 16x16x64
layer2 = tf.layers.conv2d(layer1, 128, 5, strides=2, padding='same')
layer2 = tf.layers.batch_normalization(layer2, training=True)
layer2 = tf.maximum(alpha * layer2, layer2)
# 8x8x128
layer3 = tf.layers.conv2d(layer2, 256, 5, strides=2, padding='same')
layer3 = tf.layers.batch_normalization(layer3, training=True)
layer3 = tf.maximum(alpha * layer3, layer3)
# 4x4x256
flat = tf.reshape(layer3, [-1, 4*4*256])
logits = tf.layers.dense(flat, 1)
out = tf.sigmoid(logits)
return out, logits
Calculating the loss like before, nothing new here.
def model_loss(input_real, input_z, output_dim, alpha=0.2):
"""
Get the loss for the discriminator and generator
:param input_real: Images from the real dataset
:param input_z: Z input
:param out_channel_dim: The number of channels in the output image
:return: A tuple of (discriminator loss, generator loss)
"""
g_model = generator(input_z, output_dim, alpha=alpha)
d_model_real, d_logits_real = discriminator(input_real, alpha=alpha)
d_model_fake, d_logits_fake = discriminator(g_model, reuse=True, alpha=alpha)
d_loss_real = tf.reduce_mean(
tf.nn.sigmoid_cross_entropy_with_logits(logits=d_logits_real, labels=tf.ones_like(d_model_real)))
d_loss_fake = tf.reduce_mean(
tf.nn.sigmoid_cross_entropy_with_logits(logits=d_logits_fake, labels=tf.zeros_like(d_model_fake)))
g_loss = tf.reduce_mean(
tf.nn.sigmoid_cross_entropy_with_logits(logits=d_logits_fake, labels=tf.ones_like(d_model_fake)))
d_loss = d_loss_real + d_loss_fake
return d_loss, g_loss
Not much new here, but notice how the train operations are wrapped in a with tf.control_dependencies
block so the batch normalization layers can update their population statistics.
def model_opt(d_loss, g_loss, learning_rate, beta1):
"""
Get optimization operations
:param d_loss: Discriminator loss Tensor
:param g_loss: Generator loss Tensor
:param learning_rate: Learning Rate Placeholder
:param beta1: The exponential decay rate for the 1st moment in the optimizer
:return: A tuple of (discriminator training operation, generator training operation)
"""
# Get weights and bias to update
t_vars = tf.trainable_variables()
d_vars = [var for var in t_vars if var.name.startswith('discriminator')]
g_vars = [var for var in t_vars if var.name.startswith('generator')]
# Optimize
with tf.control_dependencies(tf.get_collection(tf.GraphKeys.UPDATE_OPS)):
d_train_opt = tf.train.AdamOptimizer(learning_rate, beta1=beta1).minimize(d_loss, var_list=d_vars)
g_train_opt = tf.train.AdamOptimizer(learning_rate, beta1=beta1).minimize(g_loss, var_list=g_vars)
return d_train_opt, g_train_opt
Here we can use the functions we defined about to build the model as a class. This will make it easier to move the network around in our code since the nodes and operations in the graph are packaged in one object.
class GAN:
def __init__(self, real_size, z_size, learning_rate, alpha=0.2, beta1=0.5):
tf.reset_default_graph()
self.input_real, self.input_z = model_inputs(real_size, z_size)
self.d_loss, self.g_loss = model_loss(self.input_real, self.input_z,
real_size[2], alpha=0.2)
self.d_opt, self.g_opt = model_opt(self.d_loss, self.g_loss, learning_rate, beta1)
Here is a function for displaying generated images.
def view_samples(epoch, samples, nrows, ncols, figsize=(5,5)):
fig, axes = plt.subplots(figsize=figsize, nrows=nrows, ncols=ncols,
sharey=True, sharex=True)
for ax, img in zip(axes.flatten(), samples[epoch]):
ax.axis('off')
img = ((img - img.min())*255 / (img.max() - img.min())).astype(np.uint8)
ax.set_adjustable('box-forced')
im = ax.imshow(img, aspect='equal')
plt.subplots_adjust(wspace=0, hspace=0)
return fig, axes
And another function we can use to train our network. Notice when we call generator
to create the samples to display, we set training
to False
. That's so the batch normalization layers will use the population statistics rather than the batch statistics. Also notice that we set the net.input_real
placeholder when we run the generator's optimizer. The generator doesn't actually use it, but we'd get an error without it because of the tf.control_dependencies
block we created in model_opt
.
def train(net, dataset, epochs, batch_size, print_every=10, show_every=500, figsize=(5,5)):
saver = tf.train.Saver()
sample_z = np.random.uniform(-1, 1, size=(72, z_size))
samples, losses = [], []
steps = 0
with tf.Session() as sess:
sess.run(tf.global_variables_initializer())
for e in range(epochs):
for x, y in dataset.batches(batch_size):
steps += 1
# Sample random noise for G
batch_z = np.random.uniform(-1, 1, size=(batch_size, z_size))
# Run optimizers
_ = sess.run(net.d_opt, feed_dict={net.input_real: x, net.input_z: batch_z})
_ = sess.run(net.g_opt, feed_dict={net.input_z: batch_z, net.input_real: x})
if steps % print_every == 0:
# At the end of each epoch, get the losses and print them out
train_loss_d = net.d_loss.eval({net.input_z: batch_z, net.input_real: x})
train_loss_g = net.g_loss.eval({net.input_z: batch_z})
print("Epoch {}/{}...".format(e+1, epochs),
"Discriminator Loss: {:.4f}...".format(train_loss_d),
"Generator Loss: {:.4f}".format(train_loss_g))
# Save losses to view after training
losses.append((train_loss_d, train_loss_g))
if steps % show_every == 0:
gen_samples = sess.run(
generator(net.input_z, 3, reuse=True, training=False),
feed_dict={net.input_z: sample_z})
samples.append(gen_samples)
_ = view_samples(-1, samples, 6, 12, figsize=figsize)
plt.show()
saver.save(sess, './checkpoints/generator.ckpt')
with open('samples.pkl', 'wb') as f:
pkl.dump(samples, f)
return losses, samples
GANs are very sensitive to hyperparameters. A lot of experimentation goes into finding the best hyperparameters such that the generator and discriminator don't overpower each other. Try out your own hyperparameters or read the DCGAN paper to see what worked for them.
Exercise: Find hyperparameters to train this GAN. The values found in the DCGAN paper work well, or you can experiment on your own. In general, you want the discriminator loss to be around 0.3, this means it is correctly classifying images as fake or real about 50% of the time.
real_size = (32,32,3)
z_size = 100
learning_rate = 0.0002
batch_size = 128
epochs = 10
alpha = 0.2
beta1 = 0.5
# Create the network
net = GAN(real_size, z_size, learning_rate, alpha=alpha, beta1=beta1)
# Load the data and train the network here
dataset = Dataset(trainset, testset)
losses, samples = train(net, dataset, epochs, batch_size, figsize=(10,5))
fig, ax = plt.subplots()
losses = np.array(losses)
plt.plot(losses.T[0], label='Discriminator', alpha=0.5)
plt.plot(losses.T[1], label='Generator', alpha=0.5)
plt.title("Training Losses")
plt.legend()
_ = view_samples(-1, samples, 6, 12, figsize=(10,5))


{% extends "base.html" %} {% load custom_filters %} {% block title %} Delete Post: {% endblock %} {% block postContainer %}
{{ post.title }}
Post Date: {{ post.created|date:"d M Y" }}
Post Upvotes: {{ post.vote_set|upvote_count }}
Post Downvotes: {{ post.vote_set|downvote_count }}
Post Comments: {{ post.storycomment_set.count }}


{% extends "templates.jinja/base.page-with-navbar.html" %} {% block title %} Hesperian - Pregnancy & Birth{% endblock %} {% block id %}Signs_of_malaria{% endblock %} {% block content %}
High fever, especially along with shivering, body aches, and severe headache, can be caused by malaria. Malaria is especially dangerous for pregnant women and their babies. The typical malaria attack has 3 stages:
Malaria attacks usually happen every 2 or 3 days, but they can also happen every day or only once in a while.
{% endblock %} {% block footer %} {% endblock %}


Username
Username is available
Password
Password strength: Weak
Email
Please enter a valid email address


{% extends 'base.html' %} {% block pagetitle %}Brian R. Bondy - TeX - LaTeX expected age by tag list{% endblock %} {% block title %} TeX - LaTeX expected age by tag list{% endblock %} {% block subtitle %}Calculated by using the expected value for the age each answer comes from{% endblock %} {% block main_content %}
This list contains the expected age per tag from the the TeX - LaTeX site, sorted by expected age.
The list was generated with the TeX - LaTeX April 2011 data dump on 4/25/2011 10:48:32 PM.
The creator of this list is Brian R. Bondy: Blog, Twitter, StackOverflow.
Please see the following link for other lists.


Package io.fluentlenium.core.switchto
Interface FluentTargetLocator<T>
-
- Type Parameters:
T
- self type
- All Known Implementing Classes:
FluentTargetLocatorImpl
public interface FluentTargetLocator<T>
Used to locate a given frame or window.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description FluentWebElement
activeElement()
Switches to the element that currently has focus within the document currently "switched to", or the body element if this cannot be detected.AlertImpl
alert()
Switches to the currently active modal dialog for this particular driver instance.T
defaultContent()
Selects either the first frame on the page, or the main document when a page contains iframes.T
frame(int index)
Select a frame by its (zero-based) index.T
frame(String nameOrId)
Select a frame by its name or ID.T
frame(FluentWebElement frameElement)
Select a frame using its previously locatedWebElement
.T
frame(org.openqa.selenium.WebElement frameElement)
Select a frame using its previously locatedWebElement
.T
parentFrame()
Change focus to the parent context.T
window(String nameOrHandle)
Switch the focus of future commands for this driver to the window with the given name/handle.
-
-
-
Method Detail
-
frame
T frame(int index)
Select a frame by its (zero-based) index. Selecting a frame by index is equivalent to the JS expression window.frames[index] where "window" is the DOM window represented by the current context. Once the frame has been selected, all subsequent calls on the WebDriver interface are made to that frame.- Parameters:
index
- (zero-based) index- Returns:
- $
this
reference for chain calls. - Throws:
org.openqa.selenium.NoSuchFrameException
- If the frame cannot be found
-
frame
T frame(String nameOrId)
Select a frame by its name or ID. Frames located by matching name attributes are always given precedence over those matched by ID.- Parameters:
nameOrId
- the name of the frame window, the id of the <frame> or <iframe> element, or the (zero-based) index- Returns:
- This driver focused on the given frame
- Throws:
org.openqa.selenium.NoSuchFrameException
- If the frame cannot be found
-
frame
T frame(org.openqa.selenium.WebElement frameElement)
Select a frame using its previously locatedWebElement
.- Parameters:
frameElement
- The frame element to switch to.- Returns:
- This driver focused on the given frame.
- Throws:
org.openqa.selenium.NoSuchFrameException
- If the given element is neither an IFRAME nor a FRAME element.org.openqa.selenium.StaleElementReferenceException
- If the WebElement has gone stale.
-
frame
T frame(FluentWebElement frameElement)
Select a frame using its previously locatedWebElement
.- Parameters:
frameElement
- The frame element to switch to.- Returns:
- This driver focused on the given frame.
- Throws:
org.openqa.selenium.NoSuchFrameException
- If the given element is neither an IFRAME nor a FRAME element.org.openqa.selenium.StaleElementReferenceException
- If the WebElement has gone stale.
-
parentFrame
T parentFrame()
Change focus to the parent context. If the current context is the top level browsing context, the context remains unchanged.- Returns:
- This driver focused on the parent frame
-
window
T window(String nameOrHandle)
Switch the focus of future commands for this driver to the window with the given name/handle.- Parameters:
nameOrHandle
- The name of the window or the handle as returned byWebDriver.getWindowHandle()
- Returns:
- This driver focused on the given window
- Throws:
org.openqa.selenium.NoSuchWindowException
- If the window cannot be found
-
defaultContent
T defaultContent()
Selects either the first frame on the page, or the main document when a page contains iframes.- Returns:
- This driver focused on the top window/first frame.
-
activeElement
FluentWebElement activeElement()
Switches to the element that currently has focus within the document currently "switched to", or the body element if this cannot be detected. This matches the semantics of calling "document.activeElement" in Javascript.- Returns:
- The WebElement with focus, or the body element if no element with focus can be detected.
-
alert
AlertImpl alert()
Switches to the currently active modal dialog for this particular driver instance.- Returns:
- A handle to the dialog.
- Throws:
org.openqa.selenium.NoAlertPresentException
- If the dialog cannot be found
-
-


Hardware Provisioning
A common question received by Spark developers is how to configure hardware for it. While the right hardware will depend on the situation, we make the following recommendations.
Storage Systems
Because most Spark jobs will likely have to read input data from an external storage system (e.g. the Hadoop File System, or HBase), it is important to place it as close to this system as possible. We recommend the following:
-
If at all possible, run Spark on the same nodes as HDFS. The simplest way is to set up a Spark standalone mode cluster on the same nodes, and configure Spark and Hadoop’s memory and CPU usage to avoid interference (for Hadoop, the relevant options are
mapred.child.java.opts
for the per-task memory andmapred.tasktracker.map.tasks.maximum
andmapred.tasktracker.reduce.tasks.maximum
for number of tasks). Alternatively, you can run Hadoop and Spark on a common cluster manager like Mesos or Hadoop YARN. -
If this is not possible, run Spark on different nodes in the same local-area network as HDFS.
-
For low-latency data stores like HBase, it may be preferrable to run computing jobs on different nodes than the storage system to avoid interference.
Local Disks
While Spark can perform a lot of its computation in memory, it still uses local disks to store
data that doesn’t fit in RAM, as well as to preserve intermediate output between stages. We
recommend having 4-8 disks per node, configured without RAID (just as separate mount points).
In Linux, mount the disks with the noatime
option
to reduce unnecessary writes. In Spark, configure the spark.local.dir
variable to be a comma-separated list of the local disks. If you are running HDFS, it’s fine to
use the same disks as HDFS.
Memory
In general, Spark can run well with anywhere from 8 GB to hundreds of gigabytes of memory per machine. In all cases, we recommend allocating only at most 75% of the memory for Spark; leave the rest for the operating system and buffer cache.
How much memory you will need will depend on your application. To determine how much your
application uses for a certain dataset size, load part of your dataset in a Spark RDD and use the
Storage tab of Spark’s monitoring UI (http://<driver-node>:4040
) to see its size in memory.
Note that memory usage is greatly affected by storage level and serialization format – see
the tuning guide for tips on how to reduce it.
Finally, note that the Java VM does not always behave well with more than 200 GB of RAM. If you
purchase machines with more RAM than this, you can run multiple worker JVMs per node. In
Spark’s standalone mode, you can set the number of workers per node
with the SPARK_WORKER_INSTANCES
variable in conf/spark-env.sh
, and the number of cores
per worker with SPARK_WORKER_CORES
.
Network
In our experience, when the data is in memory, a lot of Spark applications are network-bound.
Using a 10 Gigabit or higher network is the best way to make these applications faster.
This is especially true for “distributed reduce” applications such as group-bys, reduce-bys, and
SQL joins. In any given application, you can see how much data Spark shuffles across the network
from the application’s monitoring UI (http://<driver-node>:4040
).
CPU Cores
Spark scales well to tens of CPU cores per machine because it performes minimal sharing between threads. You should likely provision at least 8-16 cores per machine. Depending on the CPU cost of your workload, you may also need more: once data is in memory, most applications are either CPU- or network-bound.


Our Blog
Home /
Blog
04
May
By Admin
2 Comments
Loking After Our Photos
Read More
04
May
By Admin
2 Comments
Loking After Our Photos
Read More
04
May
By Admin
2 Comments
Loking After Our Photos
Read More
04
May
By Admin
2 Comments
Loking After Our Photos
Read More
04
May
By Admin
2 Comments
Loking After Our Photos
Read More
04
May
By Admin
2 Comments
Loking After Our Photos
Read More
04
May
By Admin
2 Comments
Loking After Our Photos
Read More
04
May
By Admin
2 Comments
Loking After Our Photos
Read More
04
May
By Admin
2 Comments
Loking After Our Photo Contest
Read More
1
2
3


| Title Form | Description | Creation Date | Status |
|---|---|---|---|
| {{i.title}} | {{i.description}} | {{i.date_modif['date']}} |
dateJour">
Active
Delete {{i.title}},Do you want to confirm?
Inactive
Delete {{i.title}},Do you want to confirm? |
{{fieldData.description}}


Use this item to analyze compiled classes, searching where the remote interface is implemented. If such classes
are not found, IntelliJ IDEA generates stubs for these interfaces incrementally.
(Only the classes generated by IntelliJ IDEA are analyzed. Classes generated by the other tools are ignored.)


Sets the salience evaluation behavior.
(set-salience-evaluation <behavior>) <behavior> ::= when-defined | when-activated | every-cycle


;
Introduction to Relational Databases, SQL and Knex
In this project we will cover the basics of Structure Query Language (SQL)
, Relational Databases
, and Knex.js Queries
.
Prerequisites
Project Setup
- [ ] fork and clone this repository.
- [ ] CD into the folder where you cloned your fork.
- [ ] type
npm i
to download dependencies.


.
wierd Facts
Awesome Facts
Gaming Facts
Technology Facts
Awesome fact #11
Download
Awesome fact #12
Download
Awesome fact #13
Download
Awesome fact #14
Download
Awesome fact #15
Download
Download
syam
« Previous
Next »
›1
›2
›3


--- layout: post title: Lisp REPL categories: - Technical Skills - Clojure tags: - levelup - lisp - repl status: publish type: post published: true meta: _original_post_id: '' _original_import_author: Steve Shogren ---
So, working through the Land of Lisp book, getting the hang of it.
Chapter Six, the author starts off by talking a little about the Common Lisp REPL, or Read-Eval-Print-Loop that you use as sort of the "command line" for interacting with lisp. It is pretty cool, you type in code, and it executes. And then he opens the hood a little:
``` clojure (defun repl () (loop (print (eval (read))))) ```WHAAAAAAAAAAAAAAA??!?!?!
I just about spit my drink all over the monitor laughing. The function eval() evaluates whatever text is passed in as code, in this case, from the command line via the obviously named read and after executing it, print() prints the result, and it just does that forever till you quit.
That means, you could make one of these for any language that can evaluate strings into code. I know python has one built-in. Php can evaluate code with eval, and a quick search shows a highly nifty (and robust from the looks of it) REPL for php complements of facebook. Sweet. Or, you can use php -a for the interactive mode.