results-view/results-view.service.ts
Properties |
| type |
type:
|
| view |
view:
|
Type : ResultsView
|
import { Injectable, Inject, InjectionToken } from "@angular/core";
import { Router, ActivatedRoute, NavigationEnd } from "@angular/router";
import { Subject, Observable } from "rxjs";
import { Utils } from '@sinequa/core/base';
import { SearchService } from '@sinequa/components/search';
import { Query } from '@sinequa/core/app-utils';
/**
* Configuration of a Results View
*/
export interface ResultsView {
/** Name of the results view */
name: string;
/** Type of the results view (not used internally, but may be useful if multiple views share a common component) */
type: string;
/** How the results view should be displayed (default to the name) */
display?: string;
/** Icon class for the results view */
icon?: string;
/** List of tab for which this tab can be displayed (defaults to all if undefined) */
includedTabs?: string[];
/** List of tab for which this tab is excluded (defaults to none if undefined) */
excludedTabs?: string[];
/**
* Method called when selecting this results view. It can be used to modify the search query
* when a view has specific data to display. If the method returns true, then selecting this view
* triggers a search and the view selection becomes effective upon results. If the method results false,
* (or if the method is undefined), then selecting this view does not trigger a new search
* and the view selection is immediate.
*/
beforeSearch?: (query: Query, previousView: ResultsView) => boolean;
}
export interface ResultsViewEvent {
type: "before-select" | "after-select" | "select-cancelled";
}
export interface ResultsViewBeforeSelectEvent extends ResultsViewEvent {
type: "before-select";
view: ResultsView;
promises: Promise<boolean>[];
}
export interface ResultsViewAfterSelectEvent extends ResultsViewEvent {
type: "after-select";
view: ResultsView;
}
export interface ResultsViewSelectCancelledEvent extends ResultsViewEvent {
type: "select-cancelled";
view: ResultsView;
}
export type ResultsViewEvents =
ResultsViewBeforeSelectEvent |
ResultsViewAfterSelectEvent |
ResultsViewSelectCancelledEvent;
export const RESULTS_VIEWS = new InjectionToken<ResultsView[]>("RESULTS_VIEWS");
export const DEFAULT_VIEW = new InjectionToken<ResultsView>("DEFAULT_VIEW");
@Injectable({
providedIn: 'root',
})
export class ResultsViewService {
protected _resultsView : ResultsView;
protected readonly _resultsViews : ResultsView[];
protected _resultsViewSelected = new Subject<ResultsView>();
protected _events = new Subject<ResultsViewEvents>();
protected pendingView: ResultsView | undefined;
/**
* Constructor: Expects the configuration for a list of views and
* one default view. These views can be set when importing the module in the AppModule
* with the ResultsViewModule.forRoot() method.
*/
constructor(
@Inject(DEFAULT_VIEW) public defaultView: ResultsView,
@Inject(RESULTS_VIEWS) resultsViews: ResultsView[],
protected router: Router,
protected route: ActivatedRoute,
protected searchService: SearchService
) {
this._resultsViews = resultsViews;
this._resultsView = this.defaultView;
/**
* Listener triggered whenever the URL changes
*/
this.router.events.subscribe(event => {
if (event instanceof NavigationEnd) {
this.handleNavigation();
}
});
/**
* Listener triggered whenever new results come in.
* Some views must be displayed after a search, hence the
* pendingView flag.
*/
this.searchService.resultsStream.subscribe(results => {
if(this.pendingView) {
this.searchService.queryStringParams.view = this.pendingView.name;
this.searchService.navigate({skipSearch: true});
this.pendingView = undefined;
}
});
// Automatically switch results views, if we go to a tab that has specific list of views
this.searchService.events.subscribe(event => {
// Event called just before the query for the new tab is searched
if(event.type === "before-select-tab" && event.query.tab) {
const views = this.getIncludedViews(event.query.tab);
// If there are views for this tab and they don't include the current one...
if(views.length > 0 && !views.includes(this.resultsView)) {
// Set the view as pending
this.pendingView = views[0];
// Modify the query if needed
if(this.pendingView.beforeSearch) {
this.pendingView.beforeSearch(event.query, this.resultsView);
}
}
}
})
}
// GETTERS
public get resultsViewSelected(): Observable<ResultsView> {
return this._resultsViewSelected;
}
public get events(): Observable<ResultsViewEvents> {
return this._events;
}
public get resultsView(): ResultsView {
return this._resultsView;
}
public get views(): ResultsView[] {
return this._resultsViews;
}
// EVENT HANDLERS
/**
* Navigate to a new URL including the given results view's name
* @param view
*/
protected navigate(view: ResultsView) {
let waitForResults = !!view.beforeSearch;
if(view.beforeSearch) {
waitForResults = view.beforeSearch(this.searchService.query, this.resultsView);
}
if(!waitForResults) {
// We switch view immediately via the search service (which centralizes the navigation)
this.searchService.queryStringParams.view = view.name;
this.searchService.navigate({skipSearch: true});
}
else {
// We set the view as "pending", that is waiting for new results to come in
this.pendingView = view;
this.searchService.search();
}
}
/**
* Responds to a change in the URL: Sets the results view if the URL
* specifies a different results view name.
*/
protected handleNavigation() {
const url = Utils.makeURL(this.router.url);
const view = this.getView(url.searchParams.get("view"));
if(view && view !== this.resultsView) {
this.searchService.queryStringParams.view = view.name; // Needed when refreshing the page
this.setResultsView(view);
} else if (!view) {
// ensures 'view' param do not exists, otherwise next search query will contains it
delete this.searchService.queryStringParams.view;
this.setResultsView(this.defaultView);
}
}
/**
* Sets the results view and emits an event
* @param view
*/
protected setResultsView(view: ResultsView) {
this._resultsView = view;
this._events.next({type: "after-select", view});
this._resultsViewSelected.next(view);
}
// PUBLIC API
/**
* Selects the given results view. This method is asynchronous:
* - The selected results view might modify the query before being displayed
* - The view selection works with a navigation via the router (adding the view name to the URL)
* @param view
*/
public selectResultsView(view: ResultsView) {
if (view) {
// Raise before event...
const beforeEvent: ResultsViewBeforeSelectEvent = {
type: "before-select",
view,
promises: []
}
this._events.next(beforeEvent);
if (beforeEvent.promises.length === 0) {
this.navigate(view);
}
else {
Promise.all(beforeEvent.promises)
.then((results) => {
const ok = results.every(result => result);
if (ok) {
this.navigate(view);
}
else {
console.log("selectResultsView cancelled");
this._events.next({type: "select-cancelled", view});
}
})
.catch((reason) => {
console.log("selectResultsView error:", reason);
this._events.next({type: "select-cancelled", view});
});
}
}
else {
console.error("Undefined Results View");
}
}
/**
* Selects the results view with the given name. This method is asynchronous:
* - The selected results view might modify the query before being displayed
* - The view selection works with a navigation via the router (adding the view name to the URL)
* @param viewName
*/
public selectResultsViewName(viewName: string){
const view = this.getView(viewName);
if (view) {
this.selectResultsView(view);
}
}
/**
* Returns the results view with the given name
* @param viewName
*/
public getView(viewName): ResultsView | undefined {
return this.views.find(v => v.name === viewName);
}
/**
* Returns the list of results views compatible with a given tab
* @param tab
*/
public getIncludedViews(tab?: string): ResultsView[] {
const views: ResultsView[] = [];
for (const view of this.views) {
const included = !!view.includedTabs
? view.includedTabs.includes(tab || "")
: !view.excludedTabs || !view.excludedTabs.includes(tab || "");
if (included) {
views.push(view);
}
}
return views;
}
}


|
Otter
<IP_ADDRESS>
2d Game Development Framework based on SFML.Net
|
A base class for Movement Components to extend. More...
Inherits Otter.Component.
Inherited by Otter.BasicMovement, and Otter.PlatformingMovement.
Public Member Functions | |
| void | AddCollision (params int[] tags) |
| Register a tag that the Collider should check for collisions with. More... | |
| void | AddCollision (params Enum[] tags) |
| Register a tag that the Collider should check for collisions with. More... | |
| void | RemoveCollision (params int[] tags) |
| Remove a tag from the collision checking. More... | |
| virtual void | MoveX (int speed, Collider collider=null) |
| Move the object in the X axis by the value of speed. Sweeping collision test. More... | |
| virtual void | MoveY (int speed, Collider collider=null) |
| Move the object in the Y axis by the value of speed. Sweeping collision test. More... | |
| virtual void | MoveCollideX (Collider collider) |
| Called when MoveX collides with a collider. More... | |
| virtual void | MoveCollideY (Collider collider) |
| Called when MoveY collides with a collider. More... | |
| void | MoveXY (int speedX, int speedY, Collider collider=null) |
| Shortcut to call both move x and move y. More... | |
| Public Member Functions inherited from Otter.Component | |
| T | GetEntity< T > () |
| Get the Entity as a specific Type. More... | |
| virtual void | Added () |
| Called when the Component is added to the Entity. More... | |
| virtual void | Removed () |
| Called when the Component is removed from the Entity. More... | |
| void | RemoveSelf () |
| Removes the Component from its parent Entity. More... | |
| virtual void | UpdateFirst () |
| Called during the UpdateFirst on the parent Entity. More... | |
| virtual void | Update () |
| Called during the Update on the parent Entity. More... | |
| virtual void | Render () |
| Called during the Render on the parent Entity. More... | |
| virtual void | UpdateLast () |
| Called during the UpdateLast on the parent Entity. More... | |
| T | GetComponent< T > () |
| Gets the first Component of type T from this Component's Entity. More... | |
| List< T > | GetComponents< T > () |
| Gets a list of Components of type T from this Component's Entity. More... | |
Public Attributes | |
| Action | OnMove |
| An action triggered after movement as been applied. Up to subclasses to implement. More... | |
| int | SpeedScale = 100 |
| Determines how many units represent 1 pixel. Default is 100. Example: A speed of 100 would move the object 1 pixel per update. More... | |
| new Collider | Collider |
| The main Collider to use for detecting collisions. If this is not set, no collisions will register at all! More... | |
| Action | OnCollideX |
| An action triggered when there is a collision in the X axis. More... | |
| Action | OnCollideY |
| An action triggered when there is a collision in the Y axis. More... | |
| Public Attributes inherited from Otter.Component | |
| Entity | Entity |
| The parent Entity of the Component. More... | |
| bool | RenderAfterEntity = true |
| Determines if the Component should render after the Entity has rendered. More... | |
| bool | Visible = true |
| Determines if the Component will render. More... | |
| float | Timer = 0 |
| How long the Component has been alive (added to an Entity and updated.) More... | |
Protected Attributes | |
| int | MoveBufferX = 0 |
Properties | |
| List< int > | CollisionsSolid [get, set] |
| The list of types that the Collider should check for collisions for when moving. More... | |
| Properties inherited from Otter.Component | |
| int | InstanceId [get, set] |
| The Component's id for the Entity its attached to. More... | |
| Scene | Scene [get] |
| The Scene that the parent Entity is in. More... | |
| Collider | Collider [get] |
| The first Collider of the parent Entity. More... | |
| Graphic | Graphic [get] |
| The first Graphic of the parent Entity. More... | |
| List< Graphic > | Graphics [get] |
| The list of Graphics from the parent Entity. More... | |
| List< Collider > | Colliders [get] |
| The list of Colliders from the parent Entity. More... | |
A base class for Movement Components to extend.
| void Otter.Movement.AddCollision | ( | params int[] | tags | ) |
Register a tag that the Collider should check for collisions with.
| tags | The tags to collide with. |
| void Otter.Movement.AddCollision | ( | params Enum[] | tags | ) |
Register a tag that the Collider should check for collisions with.
| tags | The tags to collide with. |
|
virtual |
Called when MoveX collides with a collider.
| collider | The collider that was hit. |
Reimplemented in Otter.PlatformingMovement, and Otter.BasicMovement.
|
virtual |
Called when MoveY collides with a collider.
| collider | The collider that was hit. |
Reimplemented in Otter.PlatformingMovement, and Otter.BasicMovement.
|
virtual |
Move the object in the X axis by the value of speed. Sweeping collision test.
| speed | The speed to move by (remember SpeedScale is applied.) |
| collider | The Collider to use when moving. |
| void Otter.Movement.MoveXY | ( | int | speedX, |
| int | speedY, | ||
| Collider | collider = null |
||
| ) |
Shortcut to call both move x and move y.
| speedX | |
| speedY | |
| collider |
|
virtual |
Move the object in the Y axis by the value of speed. Sweeping collision test.
| speed | The speed to move by (remember SpeedScale is applied.) |
| collider | The Collider to use when moving. |
Reimplemented in Otter.PlatformingMovement.
| void Otter.Movement.RemoveCollision | ( | params int[] | tags | ) |
Remove a tag from the collision checking.
| tags |
| new Collider Otter.Movement.Collider |
The main Collider to use for detecting collisions. If this is not set, no collisions will register at all!
| Action Otter.Movement.OnCollideX |
An action triggered when there is a collision in the X axis.
| Action Otter.Movement.OnCollideY |
An action triggered when there is a collision in the Y axis.
| Action Otter.Movement.OnMove |
An action triggered after movement as been applied. Up to subclasses to implement.
| int Otter.Movement.SpeedScale = 100 |
Determines how many units represent 1 pixel. Default is 100. Example: A speed of 100 would move the object 1 pixel per update.
|
getset |
The list of types that the Collider should check for collisions for when moving.


Please note: If you are adding a new business, please add it first prior to selecting other options.
Register business listings.
View, edit and delete business listings.
Add business contact information.
View, edit and delete business contacts.


Copyright (c) 2003 Ingo Althofer, Eiko Bleicher
This game is played on the following 6x7 square board:
|
| An example Black's turn. If he moves the marked stone into [1], White has lost the game, since the next four moves (over the third row) will give stones for Black lateral captures. |
There is a mirror winning strategy to the 2nd player. The introduction of a PIE rule (one player makes 3 or 5 moves, the other choose sides) should solve this problem. There is a ZRF to play SideKicker with Zillions.


Join the listening parties
Host or join a game night
Learn more about people in the community
If you have trouble booting or setting up your desktop or laptop, we'll do our best to help. Feel free to drop by, detail your problem in one of the support channels and someone will take a look.
Did you start making the program or webapp you always wanted to but got stuck? Maybe a programming class is a little confusing. You need to worry. Professional and hobby programmers alike are available to aid with any roadblocks.
Interested in setting up your own server with one or more of the popular open source services available? In a container, virtual machine or bare metal, someone will be able to assist you with hosting the services you need.
Get SupportTyler is a privacy enthusiast and passionate about using PiHole at home as well as securing the systems he uses.
Learn MoreDare is an IT pro with many years experience in the industry. He also recently got married.
Learn MoreOzy is still a university student and has a lot of hands-on experience with most of today's technology.
Learn More


Setting up a Cordova build environment with some Grunt
Using the task-based build tool
Grunt
, the new
Cordova
command line tooling,
and
Jasmine
tests running in
PhantomJS
to build better apps
Why?
- Build automation
- Continuous integration (Travis-CI, etc)
- Test/behaviour driven development
- Xcode, Eclipse and friends are painful
- Multiple platforms, one code base
- The command line is powerful
- There are many great
Grunt plugins
Just 9 easy* steps!
- Install the 4 primary dependencies
- Create a Cordova project
- Add your Cordova platforms (iOS, Android, etc)
- Create a
package.json
file
- Install the 3 grunt plugin npm modules using --save-deps
- Initialise Grunt and create a
grunt.js
file
- Hand edit the
grunt.js
file and edit your src paths
- Hand edit the
grunt.js
file and add your Jasmine tasks
- Hand edit the
grunt.js
file and add your Cordova shell tasks
* Easy is a relative term... are you scared of hand editing config files? Hope not.
The steps were so complex I didn't even want to write them up
:*(
Much less try to describe it in a talk...
Luckily, you can write custom Grunt scaffolding templates...
...or even better get someone else to write it for you:
Now it's just 6 actually easy steps*
-
Install the 4 primary dependencies
- Install the grunt-init-cordova templates
- Create a Cordova project
- Add your Cordova platforms (iOS, Android, etc)
-
Initialise Grunt with the templates above (answering a couple of easy questions)
- Run
npm install
to install all dependencies
THAT'S IT! WE ARE READY TO ROLL!
* The first step still sucks...
Optional
Next steps
- Pick a UI framework
- Decide on a MVC framework
- Choose or build a backend
- Actually build your app!
Thanks
Feel free to ask me any PhoneGap / Cordova questions you may have as long as they have nothing to do with jQuery Mobile.
Just kidding. *
* I'm totally not kidding.


We're sorry but idrag doesn't work properly without JavaScript enabled. Please enable it to continue.
正在努力加载页面，请耐心等候...


About Planet Potluck
This is our little project to promote the sharing of international recipes for potluck events. We know how stressful it can be to come up with exciting food to share at a party so we have set this up to allow you to submit and view recipes from all around the world. We encourage you to send in something authentic from a cuisine you know that is suitable for mass-production. Other users can vote up or down each recipe.
We allow you to sort through recipes by country of origin, by top rated overall and also by dietary requirement.
Please fill in the form on the 'Submit' page stating the country, ingredients, steps and tick whether this recipe fulfils the predetermined dietary requirements. Photos are encouraged!
"We came together to produce this website as part of the Code First: Code For Girls course. We both share a passion for international food and we believe that our website will be an inspiration for others to share their recipes from all around the world."
Hi, my name is Vessy. I am originally from Bulgaria and I like cheese!
Veselina Petrova, PhD student in Clinical Neuroscience
Hi! My name is Ryta and I am from Belarus. I love trying different types of food!


Strictly Come Dancing judge Motsi Mabuse's own relationship 'curse'
She left her husband for a dancer on another show
by Richard BellJudge Motsi Mabuse has admitted that she understands the Strictly Come Dancing 'curse' as she has experienced it herself.
Over the years, fans of the hit BBC dancing competition have come to believe the show is beset by a curse that breaks up couples as the dancers fall for one another.
And it seems Motsi, who joined the show earlier this year as a replacement for former judge Darcey Bussell, isn't impervious.
Read more: Strictly's Bruno Tonioli 'reshoots' line over fears he would offend the audience
The 38-year-old married her first husband, Timo Kulczak, when she was 22.
But after 11 years of marriage, the couple split and Motsi moved on with her dancing partner, Ukranian Evgenij Voznyvk, whom she married in 2007.
Before joining the UK version of Strictly, Motsi served as a professional and then judge on the German version.
Speaking to The Sun, the former pro said of finding romance with Evgenij: "Three years later, whoosh! And then I was married."
In 2013, the pair won the German Latin American title and retired with a final Rumba on the German Strictly.
But after they stopped dancing together, Motsi came to realise there was more between them.
She explained: "We stopped and it was then that we realised that we wanted to do more than just dance together."
Admitting that she understands how romance can develop between dancing partners, Motsi confessed: "You know, if you work in this sort of world, adult things happen. Everyone goes for a drink and, whoops-a-daisy!"
Motsi and Evgenij now have a 15-month-old daughter together.
There have been numerous examples of pro dancers and celebrity contestants finding romance or breaking up with their partners shortly after being on Strictly.
Countdown star Rachel Riley fell in love with Pasha Kovalev after they were paired up in the 2013 series, and the couple are now expecting their first child.

Read more: Claudia Winkleman fears being axed from Strictly Come Dancing
Similarly, presenter Susanna Reid competed in series 11 in 2013, at which time she was 15 years into a relationship with partner Dominic Cotton.
They broke up shortly after she appeared on the show although, although the GMB host insisted the programme wasn't to blame, telling the Mirror at the time: "It wasn't [because of Strictly]. Obviously things have been challenging in my personal life but we are getting things sorted."
Leave us a comment on our Facebook page @EntertainmentDailyFix and let us know what you think of this story.


=== start {clear} # Ivy Welcome to **Ivy**, a markup language for writing interactive fiction. Run the [Test](test). Try a simple example interactive [story](example_story). === embed_test_node This is the content of a node called 'embed_test_node' === test ## Test **bold text** *italic text* _also italic_ ~~strikethrough~~ *Embed another node:* {embed embed_test_node} *Check evaluated conditional:* {set cond 44} {if (1 < cond)} Evaluated condition was **true** {else} Evaluated condition was **false** {endif} *Check conditional - if, elif, else:* {setflag turnip } {setflag potato} {unset rabbit} {if turnip} turnip was true {elif potato} potato was true {elif !rabbit} there is no rabbit {else} Fallback else - potato and turnip are both false... {endif} {var foo} {set foo 10} {set bar 444} {add bar 30} {sub bar 10} *Test alt text:* This is a very {alt short|boring|precise|mysterious|shifty} sentence. This is a very {alt short|boring|precise|mysterious|shifty} sentence. This is a very {alt short|boring|precise|mysterious|shifty} sentence. This is a very {alt short|boring|precise|mysterious|shifty} sentence. This is a very {alt short|boring|precise|mysterious|shifty} sentence. *Test link:* [Try a test link](link) [Here is a fallback link](~link) *Call a bound javascript function:* {func testfunc(11, 22, 33)} {if (flagName > 1)} {endif} === link Here we are in another section. [Go back](+start) === example_story {clear} There are two doors. The [red door](+red_door) is rusted, and hot to the touch. The [blue door](+blue_door) is cool, and coated with condensation. === red_door {clear} As the red door opens, a blast of hot air pours through, and orange light floods the hallway. {embed question} === blue_door {clear} A freezing mist flows out into the hall, and frost immediately begins to form on the floor and the walls. {embed question} === question A voice booms out from the beyond the door. "Are you [friend](+friend) or [foe](+foe)?" === friend {clear} You step through the door and are greeted into the largest and most extravagant celebration in the world. You are swept up by the revels and vanish into a realm of pure jollity. [The End](~start) === foe {clear} A powerful force descends from above, and you find yourself instantly teleported into the most dismal and obscure oubliette in the underworld. There is no way out. You will be trapped for all eternity. [The End](~start)


HOC Cell
menu
Home
Higher Education
Online Courses
Certfications
Gallery
Events
Login
Contact Us
Home
HOC
arrow_drop_down
Higher Education
Online Courses
Certfications
perm_media
Gallery
polymer
Events
perm_identity
Login
perm_phone_msg
Contact Us
Welcome to HOC Cell..!
Here's our small slogan.
Left Aligned Caption
Here's our small slogan.
Right Aligned Caption
Here's our small slogan.
This is our big Tagline!
Here's our small slogan.
Python
Java
C++
Login
account_circle
Email Id
lock
Password


|
µEvLoop
A fast and lightweight event loop aimed at embedded platforms in C99.
|
Contains definitions of functional conditionals, structures that act as if-else constructs. More...
#include "uevloop/utils/closure.h"
Go to the source code of this file.
Data Structures | |
| struct | uel_conditional_t |
| Conditionals are constructs that provide functional flow control. More... | |
Functions | |
| void | uel_conditional_init (uel_conditional_t *conditional, uel_closure_t test, uel_closure_t if_true, uel_closure_t if_false) |
| Initialises a conditional structure. More... | |
| void * | uel_conditional_apply (uel_conditional_t *conditional, void *params) |
| Applies a conditional do some input. More... | |
Contains definitions of functional conditionals, structures that act as if-else constructs.
| void* uel_conditional_apply | ( | uel_conditional_t * | conditional, |
| void * | params | ||
| ) |
Applies a conditional do some input.
This function takes some input and submits it to the test closure, whose output will be cast to a boolean value. According to this value, either if_true
or if_false
closures will be called with the same value as parameters.
| conditional | The conditional to be applied |
| params | The parameter that will be tested and provided to the chosen closure |
| void uel_conditional_init | ( | uel_conditional_t * | conditional, |
| uel_closure_t | test, | ||
| uel_closure_t | if_true, | ||
| uel_closure_t | if_false | ||
| ) |
Initialises a conditional structure.
| conditional | The conditional object to be initialised |
| test | The closure to test the input in order to decide what to do next |
| if_true | The closure to be invoked when the test closure returns true |
| if_false | The closure to be invoked when the test closure returns false |


Implementation
I implemented this paper "XToon: Extended Toon Shader" by Pascal Barla as part of a university project. I used C++ and the OpenGL API to develop the application. It exhibits the depth and perspective implementation described in the paper. It can found here.
The code for the project can be found here.


This is the single canvas version of this demo that only uses a single canvas. The background rotates and the Bar chart is drawn on top. Because of the constant updating it's not conducive to interactive features - for that you'll want the two canvas version (bar-rotating-background-dual-canvas.html).
This goes in the documents header:<script src="RGraph.common.core.js"></script> <script src="RGraph.bar.js"></script>Put this where you want the chart to show up:
<canvas id="cvs" width="750" height="250">[No canvas support]</canvas>This is the code that generates the chart - it should be placed AFTER the canvas tag(s):


Hey, beautiful. :)
Following below are some examples for how ReverseIterableSet works.
ReverseIterableSet
Links:
Requires a browser with ES module support.
Must be served via HTTP (i.e. it won’t work when viewing the file locally with the file: schema).
file:


A Techno Arcade Race
Use the Wheel to control your line and try to avoid crashing against the walls or crashing against other lines.
Every second you survive you earn points, but also every other Line that crashes makes you earning points.
Avoid your enemies or make them crash agains your line.
Dark and Light Modes available.
You can play on iPhone, iPad and Mac.
No Ads.
In-App Purchases are shared between your iPhone, iPad and Mac.
Compatible with Game Center.
Lines does NOT track your activity in any way, not Analytics nor any other event or behaviour metrics. Whatever you do with this app is up to you and we don't want to know about it.


Audience: Jenkins developers who use Eclipse as their IDE
Goal: To be able to modify Jenkins core source code, and run/debug it within Tomcat.
Author: Brian Westrich<EMAIL_ADDRESS>Prerequisites: You have already completed the steps currently at Building Jenkins, up to and including running "mvn ... eclipse:eclipse".
Make sure you're using Java 7 or above
Select Window > Preferences...
Make sure JDK7 or above is present and checked.
Set your M2_REPO variable
Select Window > Preferences...
Click New, then specify your M2_REPO location, for example:
On UNIX platforms, the path will be in your home directory, for example /home/brian/.m2/repository.
Import the modules you want to work with
In File > Import, select General > Existing projects into Workspace, and then click on Next. The Import Project form appears. In Select root directory, enter the path to your Eclipse workspace. Type <tab> and Import Projects will recursively search for projects to import, and display them:
Click Finish to import the selected Jenkins projects into Eclipse.
Even if you are modifying just one module, you must import all of them into Eclipse as they depend on each other.
Other tips
Setting up Jenkins to run as web app within tomcat/eclipse (using eclipse 3.3, tomcat 6.0, sysdeo tomcat plugin):
- Add the plugin project you are currently working on into Tomcat's classpath using the Sysdeo plugin (Preferences, Tomcat, Advanced, ...)
- Download a recent stable Jenkins war.
- Copy war to tomcat webapps.
- Start tomcat. This will explode the war into the tomcat webapps directory (needed for subsequent step).
- Limitation: This setup does not deploy any non-Java artifacts to the web application. If you update any of these (e.g. html files), you'll need to manually copy these to the exploded directories in the tomcat webapps directory.
If you are changing multiple modules, the most reliable way to have the correct version appear first on the tomcat classpath is to add the imported version of the module to the classpath of the plugin you're debugging, then only add the plugin project to Tomcat's classpath. For example, this shows the Jenkins-core project added to the build path of the perforce plugin.
After you add the jenkins-core project to the classpath, use the 'Order and Export' tab to move the jenkins-core project before the jar version (in M2_REPO) of jenkins-core. Also, you must check the checkbox to the left of jenkins-core, otherwise Tomcat will not be able to load any of the classes in jenkins-core.
Use Mylyn and the Jenkins issue tracker
It is possible to configure Mylyn so it will connect to the Jenkins issue tracker. To be able to connect to the tracker you need to install the CollabNet Desktop plugin.
Task repository
When the plugin has been installed, create a new Task repository with the following settings:
Task query
To create a query to the issue tracker
- Create a new Mylyn query
- Select the newly create task repository
- Select "Create query using form"
- Enter a name for the query
- Set the component to Jenkins
- Configure the query
!
Attachments:
m2_repo.png (image/png)
classpath.png (image/png)
import.png (image/png)
otherTips.png (image/png)
dependency-import.png (image/png)
build-path.png (image/png)
override.png (image/png)
override.png (image/png)
mylyn_task_repository.png (image/png)
mylyn_task_query.png (image/png)
import.png (image/png)
installed-jres.png (image/png)
installed-jres.png (image/png)


Art assets
Apr 20, 2019
Simple Pixel Spaceships
Apr 26, 2019
NT Like Sprites Pack
Oct 22, 2019
Lowrez Action Pack


(Taken from the UC Berkeley Course Guide)
This senior-level course is a comprehensive survey of genetic devices. These DNA-based constructs are comprised of multiple "parts" that together encode a higher-level biological behavior and perform useful human-defined functions. Such constructs are the engineering target for most projects in synthetic biology. Included within this class of constructs are genetic circuits, sensors, biosynthetic pathways, and microbiological functions.
CS 61A, MATH 53, MATH 54, CHEM 3A, CHEM 3B or BIOE 11, BIOE 103 or equivalent
Students will receive no credit for 132 after taking 232
(1) To introduce the basic biology and engineering principles for constructing genetic devices including biochemical devices, microbiological devices, genetic circuits, eukaryotic devices, and developmental devices, (2) To familiarize students with current literature examples of genetic devices and develop literature searching skills; (3) To develop the students' ability to apply computational tools to the design of genetic devices.
Students will be able to (1) use mathematical models to describe the dynamics of genetic devices, (2) comprehend and evaluate publications related to any type of genetic device, (3) perform a thorough literature search, (4) evaluate the technical plausibility of a proposed genetic device, (5) analyze a design challenge and propose a plausible solution to it in the form of a genetic device, and (6) assess any ethical or safety issues associated with a proposed genetic device.
3 hours of lecture and 1 hour of discussion per week.


SIXLSXFormat Class Reference
| Inherits from | NSObject |
|---|---|
| Declared in | SIXLSXWriter.h SIXLSXWriter.m |
– setFontName:
Sets the font of a format.
- (void)setFontName:(NSString *)fontName
Parameters
fontName |
name of the font to use. |
|---|
Discussion
Sets the font of a format.
Declared In
SIXLSXWriter.h
– setFontSize:
Sets the size of a font for a format.
- (void)setFontSize:(int)fontSize
Parameters
fontSize |
font size to use |
|---|
Discussion
Sets the size of a font for a format.
Declared In
SIXLSXWriter.h
– setBold
Sets the font to bold.
- (void)setBold
Discussion
Sets the font to bold.
Declared In
SIXLSXWriter.h
– setItalic
Sets the font to italic.
- (void)setItalic
Discussion
Sets the font to italic.
Declared In
SIXLSXWriter.h
– setUnderlined
Sets the text to underlined.
- (void)setUnderlined
Discussion
Sets the text to underlined.
Declared In
SIXLSXWriter.h
– setStrikeout
Sets the text to strikeout.
- (void)setStrikeout
Discussion
Sets the text to strikeout.
Declared In
SIXLSXWriter.h
– setFontColor:
Sets the color of the text.
- (void)setFontColor:(NSColor *)color
Parameters
color |
color to use for text |
|---|
Discussion
Sets the color of the text.
Declared In
SIXLSXWriter.h
– setBackgroundColor:
Sets the background color of the cell.
- (void)setBackgroundColor:(NSColor *)color
Parameters
color |
color to use for background. |
|---|
Discussion
Sets the background color of the cell.
Declared In
SIXLSXWriter.h
– setNumberFormat:
Sets the format for number cell contents.
- (void)setNumberFormat:(NSString *)numberFormat
Parameters
numberFormat |
string representing number format to use. |
|---|
Discussion
Sets the format for number cell contents.
This method is used to define the numerical format of a number in Excel. It controls whether a number is displayed as an integer, a floating point number, a date, a currency value or some other user defined format.
The numerical format of a cell can be specified by using a format string:
Format strings can control any aspect of number formatting allowed by Excel:
Examples for valid number formats:
@"0.000
@"#,##0"
@"#,##0.00
@"0.00"
@"mm/dd/yy"
@"mmm d yyyy
@"d mmmm yyyy"
@"dd/mm/yyyy hh:mm AM/PM"
@"0 \"dollar and\" .00 \"cents\""
@"[Green]General;[Red]-General;General"
@"00000"
The number system used for dates is described in Working with Dates and Times.
For more information on number formats in Excel refer to the Microsoft documentation on cell formats.
Declared In
SIXLSXWriter.h


Ixhibition is an image gallery generated in Javascript and powered by CSS3 Animations, with the additional advantage of modifying animations using CSS3 Animation supported attributes. Ixhibition is also intended to serve as a core library on which additional packages may be developed, for additional and/or specific functionality, including providing a more animation sets and for connecting to other APIs and libraries.
Ixhibition has been developed with the goal of reducing as much Javascript interaction as possible. What is meant by this is that while JS is used to instantiate and generate the gallery (HTML and CSS), JS is meant to play no role after loading it into the DOM: all animation and transitioning is governed by CSS3 animations only. Therefore, once the gallery has been loaded into the DOM, Ixhibition will not be performing and executing any further JS unless invoked by a public function.
Ixhibition is 100% open source.


QQmlAbstractUrlInterceptor Class
allows you to control QML file loading. More...
| Header: | #include <QQmlAbstractUrlInterceptor> |
| qmake: | QT += qml |
Public Types
| enum | DataType { QmldirFile, JavaScriptFile, QmlFile, UrlString } |
Public Functions
| QQmlAbstractUrlInterceptor() | |
| virtual | ~QQmlAbstractUrlInterceptor() |
| virtual QUrl | intercept(const QUrl &url, DataType type) = 0 |
Detailed Description
allows you to control QML file loading.
QQmlAbstractUrlInterceptor is an interface which can be used to alter URLs before they are used by the QML engine. This is primarily useful for altering file urls into other file urls, such as selecting different graphical assets for the current platform.
Relative URLs are intercepted after being resolved against the file path of the current QML context. URL interception also occurs after setting the base path for a loaded QML file. This means that the content loaded for that QML file uses the intercepted URL, but inside the file the pre-intercepted URL is used for resolving relative paths. This allows for interception of .qml file loading without needing all paths (or local types) inside intercepted content to insert a different relative path.
Compared to setNetworkAccessManagerFactory, QQmlAbstractUrlInterceptor affects all URLs and paths, including local files and embedded resource files. QQmlAbstractUrlInterceptor is synchronous, and for asynchronous files must return a url with an asynchronous scheme (such as http or a custom scheme handled by your own custom QNetworkAccessManager). You can use a QQmlAbstractUrlInterceptor to change file URLs into networked URLs which are handled by your own custom QNetworkAccessManager.
To implement support for a custom networked scheme, see setNetworkAccessManagerFactory.
Member Type Documentation
enum QQmlAbstractUrlInterceptor::DataType
Specifies where URL interception is taking place.
Because QML loads qmldir files for locating types, there are two URLs involved in loading a QML type. The URL of the (possibly implicit) qmldir used for locating the type and the URL of the file which defines the type. Intercepting both leads to either complex URL replacement or double URL replacements for the same file.
| Constant | Value | Description |
|---|---|---|
QQmlAbstractUrlInterceptor::QmldirFile | 2 | The URL being intercepted is for a Qmldir file. Intercepting this, but not the QmlFile, allows for swapping out entire sub trees. |
QQmlAbstractUrlInterceptor::JavaScriptFile | 1 | The URL being intercepted is an import for a Javascript file. |
QQmlAbstractUrlInterceptor::QmlFile | 0 | The URL being intercepted is for a Qml file. Intercepting this, but not the Qmldir file, leaves the base dir of a QML file untouched and acts like replacing the file with another file. |
QQmlAbstractUrlInterceptor::UrlString | 0x1000 | The URL being intercepted is a url property in a QML file, and not being used to load a file through the engine. |
Member Function Documentation
QQmlAbstractUrlInterceptor::QQmlAbstractUrlInterceptor()
Constructor for QQmlAbstractUrlInterceptor.
[virtual]
QQmlAbstractUrlInterceptor::~QQmlAbstractUrlInterceptor()
Destructor for QQmlAbstractUrlInterceptor.
[pure virtual]
QUrl QQmlAbstractUrlInterceptor::intercept(const QUrl &url, DataType type)
A pure virtual function where you can intercept the url. The returned value is taken as the new value for the url. The type of url being intercepted is given by the type variable.
Your implementation of this function must be thread-safe, as it can be called from multiple threads at the same time.


MAGNESIUM CITRATE LEMON- magnesium citrate solution
Select Brand Dist.
Disclaimer: Most OTC drugs are not reviewed and approved by FDA, however they may be marketed if they comply with applicable regulations and policies. FDA has not evaluated whether this product complies.
Active ingredient
Magnesium citrate 1.745g per fl. oz.
Uses
- relieves occasional constipation (irregularity)
- generally produces bowel movement in 1/2 to 6 hours
Warnings
Do not use
laxarive products for longer than 1 week unless directed by a doctor
Ask a doctor before use if you have
- kidney disease
- a magnesium restricted diet
- a sodium restricted diet
- stomach pain, nausea or vomiting
- noticed a sudden change in bowel habits that lasts more than 1 week
Ask a doctor or pharmacist before use if you
are presently taking a prescription drug.
When using this product
- do not exceed the maximum recommended daily dosage in a 24 hour period
Stop use and ask a doctor if
you have rectal bleeding or no bowel movement after use. These could be signs of a serious condition.
If pregnant or breast-feeding,
ask a health professional before use.
Keep out of reach of children.
In case of overdose, get medical help or contact a Poison Control Center (1-800-222-1222) right away.
Directions
| adults and children 12 years of age and older |
1/2 to 1 bottle (10 fl. oz.). Drink a full 8 oz. glass of liquid with each dose. The dose may be taken as a single daily dose or in divided doses. |
| children 6 to under 12 years of age |
1/3 to 1/2 bottle with a full 8 oz. glass of liquid |
| children under 6 years of age |
consult a doctor |
Other information
-
each fluid ounce contains:magnesium 282mg, sodium 37 mg
- store between 46-86ºF(8-30ºC). Do not refrigerate.
- protect from excessive heat and freezing
- discard unused product within 24 hours of opening bottle
Inactive ingredients
citric acid, flavors, purified water, saccharin sodium, sodium bicarbonate
Questions or comments?
Call 1-877-753-3935 Monday-Friday 9AM-5PM EST
Principal Display Panel
Magnesium Citrate
Saline Laxative
Oral Solution
FL OZ (mL)
Lemon Flavor
TAMPER EVIDENT: DO NOT USE IF THE BREAKAWAY BAND ON CAP IS BROKEN OR MISSING.
DISTRIBUTED BY: SELECT BRAND DISTRIBUTORS
Pine Bluff, AR 71603 USA
AC<PHONE_NUMBER>
Select Brand Dist.


| Active ingredient (in each caplet) |
Purposes |
|
| Diphenhydramine citrate 38 mg |
Nighttime sleep-aid
|
| Ibuprofen 200 mg (NSAID)*
|
Pain reliever |
Uses
- for relief of occasional sleeplessness when associated with minor aches and pains
- helps you fall asleep and stay asleep
Warnings
Allergy alert: Ibuprofen may cause a severe allergic reaction, especially in people allergic to aspirin. Symptoms may include:
- hives
- facial swelling
- asthma (wheezing)
- shock
- skin reddening
- rash
- blisters
If an allergic reaction occurs, stop use and seek medical help right away.
Stomach bleeding warning: This product contains an NSAID, which may cause severe stomach bleeding. The chance is higher if you
- are age 60 or older
- have had stomach ulcers or bleeding problems
- take a blood thinning (anticoagulant) or steroid drug
- take other drugs containing prescription or nonprescription NSAIDs [aspirin, ibuprofen, naproxen, or others]
- have 3 or more alcoholic drinks every day while using this product
- take more or for a longer time than directed
Do not use
- if you have ever had an allergic reaction to any other pain reliever/fever reducer
- unless you have time for a full night's sleep
- in children under 12 years of age
- right before or after heart surgery
- with any other product containing diphenhydramine, even one used on skin
- if you have sleeplessness without pain
Ask a doctor before use if
- stomach bleeding warning applies to you
- you have problems or serious side effects from taking pain relievers or fever reducers
- you have a history of stomach problems, such as heartburn
- you have high blood pressure, heart disease, liver cirrhosis, kidney disease, or asthma
- you are taking a diuretic
- you have a breathing problem such as emphysema or chronic bronchitis
- you have glaucoma
- you have trouble urinating due to an enlarged prostate gland
Ask a doctor or pharmacist before use if you are
- taking sedatives or tranquilizers, or any other sleep-aid
- under a doctor's care for any continuing medical illness
- taking any other antihistamines
- taking aspirin for heart attack or stroke, because ibuprofen may decrease this benefit of aspirin
- taking any other drug
When using this product
- drowsiness will occur
- avoid alcoholic drinks
- do not drive a motor vehicle or operate machinery
- take with food or milk if stomach upset occurs
- the risk of heart attack or stroke may increase if you use more than directed or for longer than directed
Stop use and ask a doctor if
- you experience any of the following signs of stomach bleeding:
- feel faint
- vomit blood
- have bloody or black stools
- have stomach pain that does not get better
- pain gets worse or lasts more than 10 days
- sleeplessness persists continuously for more than 2 weeks. Insomnia may be a symptom of a serious underlying medical illness.
- redness or swelling is present in the painful area
- any new symptoms appear
If pregnant or breast-feeding, ask a health professional before use. It is especially important not to use ibuprofen during the last 3 months of pregnancy unless definitely directed to do so by a doctor because it may cause problems in the unborn child or complications during delivery.
Keep out of reach of children. In case of overdose, get medical help or contact a Poison Control Center right away.
Directions
- do not take more than directed
- adults and children 12 years and over: take 2 caplets at bedtime
- do not take more than 2 caplets in 24 hours
Other information
- read all warnings and directions before use. Keep carton.
- store at 20-25°C (68-77°F)
- avoid excessive heat above 40°C (104°F)
Inactive ingredients
calcium stearate, carnauba wax, colloidal silicon dioxide, corn starch, croscarmellose sodium, FD&C blue no. 2 aluminum lake, glyceryl behenate, hypromellose, lactose monohydrate, microcrystalline cellulose, pharmaceutical ink, polydextrose, polyethylene glycol, pregelatinized starch, sodium lauryl sulfate, sodium starch glycolate, stearic acid, titanium dioxide
Questions or comments?
Call weekdays 9 AM to 5 PM EST at 1-800-88-ADVIL
Repackaged and distributed with permission of Pfizer Consumer Healthcare by:
Lil' Drug Store Products, Inc., 1201 Continental Place NE, Cedar Rapids, IA 52402
PRINCIPAL DISPLAY PANEL - 4 COATED CAPLETS Carton
Advil® PM
Ibuprofen, 200 mg / Diphenhydramine citrate, 38 mg
Pain Reliever (NSAID) / Nighttime Sleep Aid
Caplets
4
COATED
CAPLETS*
*Capsule-Shaped Tablets
Lil'
Drug Store®
Lil' Drug Store Products, Inc.


{% extends "layout.html" %} {% block page_title %} GOV.UK prototype kit {% endblock %} {% block content %} Industry Find a specific industry Manufacturing technology & equipment Sustainable manufacturing Mechanical, Electrical & Process engineering Advanced Materials/Composites Air traffic management Airframe & fixed wings Autonomous systems & rotary wings Engine systems Equipment Space systems & equipment MRO Food & drink processing Food & drink production & manufacturing Health, wellbeing and safety Animal and crop husbandry Intensive farming Sustainability Sustainable farming Non-commercial vehicles Electric vehicles Specialist vehicles inc. motorsport & construction Components Services Business & professional services Consultancy Accountancy BPO - Business Process Outsourcing Coatings Fine & speciality chemicals Paints Petrochemicals Plastics Soaps & detergents Commercial & industrial Construction products Contracting services Low carbon & green buildings Material Regeneration Residential Roads & Bridges Built environment Infrastructure including ports & airports Leisure equipment Sports equipment Jewellery Tableware Cosmetics Stationery Home decorations Gift products Travel accessories Garden & pet products Advertising Architecture Art Computer gaming Crafts Design Fashion Digital content Furniture design Museums/galleries Music Performing arts Publishing Screen (film, TV, radio, animation) Textiles & ceramics Private-sector training providers Biomass Fuel cells Geothermal Fossil fuels - Oil & Gas Carbon capture and abatement Hydro-electric Nuclear Solar Tide Transmission Distribution and storage Microgeneration Wave Wind Decontamination Waste & pollution management Water supply & sanitation Banking Insurance Pensions Fund management Private equity and venture capital Trading PPP Communications Electronic products Software IT Services Cloud computing Data mining Genetic engineering Fermentation technology Biotransformation Enzyme technology In-silico modelling Structural biology Bioinformatics Biosensors Environmental services Low carbon technology & finance Drugs & delivery technology Regenerative medicine Medical devices Research services Healthcare systems & services Clothing Footwear Retail outlets Supply chain / Logistics Access control systems Biometrics Surveillance & sensors Fire Information & data security Manned security systems Communications Forensics Counter terrorism Consultancy Training Safety Cyber security Information assurance Airports Ports Rail Road Marine Advanced Manufacturing/Engineering Aerospace AgriFood Automotive Business Services Chemicals Construction inc. built environment Consumer & Leisure Creative Industries Education Energy Environment & Water Financial Services ICT Industrial Biotechnology Low Carbon Industry Pharmaceuticals & Healthcare Retail and Logistics Security Transport Aerospace Advanced manufacturing Automotive Creative Energy generation Financial services Food and drinkmanufacturing Health and life sciences Retail Technology Where? Find a specific location Belfast Castlereagh Newtownabbey Down Banbridge Newry and Mourne Craigavon Dungannon and South Tyrone Cookstown Magherafelt Ballymena Larne Derry Cardiff Newport Monmouthshire Torfaen Caerphilly Merthyr Tydfil Rhondda Cynon Taf Vale of Glamorgan Bridgend Neath Port Talbot Swansea Carmarthenshire Pembrokeshire Ceredigion Powys Wrexham Flintshire Denbighshire Conwy Gwynedd Ynys MÃƒÂ´n Glasgow City East Dunbartonshire North Lanarkshire Dundee City Renfrewshire City of Edinburgh Aberdeenshire Aberdeen City Perth and Kinross Orkney Islands Highland Fife Falkirk Dumfries and Galloway Westminster Wandsworth Tower Hamlets Richmond upon Thames Newham Merton Lewisham Kingston upon Thames Kensington and Chelsea Islington Hounslow Hillingdon Havering Hammersmith and Fulham Hackney Greenwich Ealing Croydon Camden Barking and Dagenham City of London Wakefield Leeds Wolverhampton Walsall Solihull Sandwell Dudley Coventry Birmingham Sunderland South Tyneside North Tyneside Newcastle upon Tyne Gateshead Sheffield Rotherham Doncaster Wirral Sefton St. Helens Liverpool Knowsley Wigan Trafford Stockport Salford Manchester Bury Bolton Wyre Forest Wychavon Sutton Worcester Malvern Hills Bromsgrove Mid Sussex Horsham Crawley Warwick Stratford-on-Avon Rugby Nuneaton and Bedworth Woking Tandridge Surrey Heath Spelthorne Runnymede Reigate and Banstead Mole Valley Guildford Elmbridge Waveney Suffolk Coastal Mid Suffolk Ipswich Babergh Staffordshire Moorlands Stafford South Staffordshire Newcastle-under-Lyme Lichfield East Staffordshire Cannock Chase West Somerset Taunton Deane Sedgemoor West Oxfordshire Vale of White Horse South Oxfordshire Oxford Cherwell Rushcliffe Gedling Broxtowe Ashfield Selby Scarborough Ryedale Hambleton Craven South Norfolk Norwich North Norfolk King's Lynn and West Norfolk Great Yarmouth Broadland West Lindsey Oadby and Wigston North West Leicestershire Melton Hinckley and Bosworth Harborough Charnwood Blaby Antrim Wyre West Lancashire South Ribble Ribble Valley Preston Pendle Lancaster Fylde Chorley Thanet Swale Shepway Maidstone Gravesham Dartford Canterbury Ashford Watford Three Rivers Dacorum Winchester Test Valley New Forest Fareham Basingstoke and Deane Tewkesbury Stroud Gloucester Forest of Dean Cotswold Cheltenham Uttlesford Tendring Colchester Chelmsford Basildon Lewes Purbeck North Dorset West Devon Torridge Teignbridge South Hams Exeter East Devon South Derbyshire North East Derbyshire Erewash Derbyshire Dales Amber Valley South Lakeland Eden Copeland Barrow-in-Furness Allerdale South Cambridgeshire Cambridge Wycombe South Bucks Aylesbury Vale Central Bedfordshire Bedford Wiltshire Cornwall Shropshire Cheshire West and Chester Cheshire East Northumberland County Durham Isle of Wight Southampton Brighton and Hove Milton Keynes Wokingham Windsor and Maidenhead Slough Reading Medway Thurrock Torbay South Gloucestershire North Somerset Bristol Bath and North East Somerset Stoke-on-Trent Herefordshire Nottingham Leicester Derby North Lincolnshire North East Lincolnshire East Riding of Yorkshire Kingston upon Hull Blackpool Blackburn with Darwen Warrington Halton Darlington Stockton-on-Tees Redcar and Cleveland Middlesbrough Hartlepool Mendip West Dorset Ards North Down Stirling South Ayrshire Midlothian Clackmannanshire Waltham Forest Southwark Lambeth Barnet Kirklees Calderdale Bradford Oldham St Albans Chichester Waverley Epsom and Ewell St Edmundsbury Harrogate South Northamptonshire Northampton Daventry Rossendale Hyndburn Burnley Stevenage North Hertfordshire Hertsmere East Hertfordshire Rushmoor Hart Maldon Harlow Braintree Wealden Rother Hastings Weymouth and Portland East Dorset Christchurch North Devon Carlisle Huntingdonshire Fenland East Cambridgeshire Chiltern Portsmouth Bracknell Forest Peterborough Poole Bournemouth Plymouth Luton Blaenau Gwent Angus South Lanarkshire Welwyn Hatfield Redditch Worthing Arun Adur North Warwickshire South Somerset Newark and Sherwood Bassetlaw Breckland South Kesteven South Holland North Kesteven Lincoln Richmondshire Havant Gosport Eastleigh East Hampshire Rochford Mid Devon Chesterfield Bolsover Isles of Scilly Southend-on-Sea Swindon Carrickfergus Omagh Coleraine Lisburn West Lothian Scottish Borders East Lothian Harrow Enfield Brent Bexley Barnsley Tameside Rochdale Forest Heath Mansfield East Northamptonshire Corby East Lindsey Boston Tonbridge and Malling Sevenoaks Dover Broxbourne Epping Forest Eastbourne High Peak West Berkshire Telford and Wrekin York West Dunbartonshire Tamworth Wellingborough Kettering Brentwood Fermanagh Castle Point Rutland Inverclyde Armagh Strabane Moyle Ballymoney Moray Tunbridge Wells Haringey Bromley East Renfrewshire Scotland Northern Ireland North East England North West England Yorkshire and The Humber East Midlands West Midlands Wales London East of England South East England South West England Show on a map Show as a list Show locations: Significant businesses in the industry Research and development hubs Investment is financially incentivised Present a priotised list of the things on the map, eg most active Towns/Cities in a specified industry {% endblock %}
Industry
Where?


[gecode-users] about gcc
Stefano Gualandi
stefano.gualandi at fastwebnet.it
Fri Nov 25 16:30:03 CET 2005
Hi Mikeal and Patrick,
thanks for the answer.
>> (a fresh 'svn up' does not compile)
>
> I just did a fresh update and it compiled for me. What kind of system
> are you using, and which compilation errors do you get?
I use mac os X Tiger 10.4.3, with 'gcc -v':
Thread model: posix
gcc version 4.0.0 20041026 (Apple Computer, Inc. build 4061)
With the last update I am able to compile. Thanks.
Now, I got the following question. Let us have a vector of three
variables xs, with domain [0...3] (i.e. |xs|+1). Each value in the
sub-domain [0..2] can be taken once by element of xs, while value 3
can be taken as many time as possible. This should be done with
constraint (using pseudo gecode syntax):
gcc(space*, xs, c, ICL_DEF)
where c is something like [[0..1] [0..1] [0..1] [0..3]].
Example of solutions are tuple:
xs = [0 1 2] -> c = [1 1 1 0]
xs = [1 3 3] -> c = [0 1 0 2]
xs = [3 3 3] -> c = [0 0 0 3]
...and so on.
Am I using correctly your implementation of 'gcc'?
cheers,
Stefano
P.S. (example in the script attached)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gcc-test.cpp
Type: application/octet-stream
Size: 1148 bytes
Desc: not available
URL: <http://www.ps.uni-sb.de/pipermail/users/attachments/20051125/f8475bc3/attachment.obj>
-------------- next part --------------
More information about the gecode-users
mailing list


Programs also have variables with multiple assignments on same control flow path and it adds complexity on the way we verify programs. To avoid the complexity variables are renamed whenever new values are assigned, it is called as Static Single Assignment (SSA). This process is done on goto-programs before converting programs into propositional logic. For example, source code shown in fig:example:multiple:assignments can be represented as:
As we can see it is tricky to handle it in propositional logic since a variable is assigned a value and reused in the formula. To avoid it the CBMC converts logic as shown in fig:example:renaming:varibales.
Figure 2.9:
An example of Multiple assignments
|
Figure 2.10:
Renaming variables
|
ash
2012-09-13


Click this document to activate the handler.
No handler here.
A paragraph with a button.
This page turns to violet whent you hold the V key.
Press Control-v to continue.
Drag the bar to change its width:
Touch This page
Name:
Age:


Watch rating reviews
Academy:
Faculty:
Academy difficulty (Avg):
Student character (Avg):
Social life (Avg):
Faculty secretary (Avg):
Studert's union (Avg):
#
Reviewer
Rank Date
Academy difficulty
Student character
Social life
Faculty secretary
Studert's union
Few words


Popular programming languages used have progressed from perdominately procedural/imperative to single dispatch object oriented. Most mainstream languages also incorporate functional and generic programming to a limited extent as well. We will worry only about the most common subset of features found in C++, C#, and Java for this article.
The most common methods of implementing multiple dispatch using these languages will be shown. Keep in mind that these have been discovered through my own research and experience, so read through this with a critical eye.
This entry will utilize two languages with which most programmers will have at least a passing familiarity: C and Java. C is used to demonstrate how the problem may be approached in a language without objects, and Java is used to demonstrate how the problem may be approached using object oriented practices. Each of these techniques are fundamentally different. While in many cases they are interchangable, there are instances where they are not.
I have included source code to demonstrate each of these approaches. Code is provided in C or Java, depending on the features needed for each technique. The article is written without referencing the code directly to allow both the code and article to exist independently.
What is Multiple Dispatch?
Abstractions are helpful in the development process, but they all must eventually be resolved to a concrete type in order to do actual work.
A Single Dispatch Example
As an example from an object oriented language, an Animal
abstraction may provide a speak
method. A programmer may write
If an Animal is a purely abstract object, then its speak
method will have no actual code. At runtime, the program will dynamically dispatch to object's underlying type and call that object's speak
method. If the abstract animal
object points to an instance of Dog
class, then the above call may print woof
to the screen. The above call might effectively be translated to
dog.speak(); // prints "woof"
A Multiple Dispatch Example
It may be necessary to dispatch based on multiple types in many situations.
A programmer writing a game of rock-paper-scissors might use an abstraction of an Attack
to represent a potential play. When the actual game is played, the type of both attacks will need to be known. What we want to write is something along the lines of:
(attack1 and attack2).determineWinner();
attack1
might be resolved to Rock
and attack2
might be resolved to Scissors
. In this case, the code relating to rock beating scissors would be called.
Multiple Dispatch in C
There are two main ways to go about this in C. Both of these involve defining types which explicitly describe themselves. An enum may be defined as
enum { ROCK, PAPER, SCISSORS} attack;
The types for each attack could be defined by
struct { attack TYPE = ROCK; }
struct { attack TYPE = PAPER; }
struct { attack TYPE = SCISSORS; }
Big Switch Statement
One solution is to have a Big Switch Statement to handle every possible combination of attacks. In psuedocode:
switch attack1.TYPE:
case ROCK:
switch attack2.TYPE:
case ROCK: tie
case PAPER: lose
case SCISSORS: win
case PAPER:
switch attack2.TYPE:
case ROCK: win
etc...
etc...
This switch statement ends up being huge with only three types, and the complexity grows exponentially as types are added.
The switch statement itself may be replaced with a jump table if preferred.
Criticisms
Good
- Not too difficult to manually trace through
Bad
- Adding/removing types requires a lot of work which will not be verified by a compiler
- Have to add a type field to all types and keep track of all types
- Switch statements tend to poliferate and manifest as duplicated code throughout the project
Big Jump Table
Imagine a matrix of possible outcomes for the game itself:
| - |
Rock |
Paper |
Scissors |
| Rock |
Tie |
Lose |
Win |
| Paper |
Win |
Tie |
Lose |
| Scissors |
Lose |
Win |
Tie |
We can translate this into code by creating functions for every possible combination of rock-paper-scissors. We then populate a table based on the intersection of the types. Dispatching to the correct function can then be done by looking up the function pointer in the table
BattleFunction generate_outcome = gameMatrix[attack1.TYPE, attack2.TYPE];
generate_outcome();
Maintaining the TYPE
field in all of our objects is still a bit of a pain. If we were to add or remove any types, we would have to edit our enum and update our matrix.
Criticisms
Good
- Tables can be constructed outside of static code. Modification of the table does not usually require modification of the code which uses the table (in contrast to the switch statement approach).
Bad
- Much more difficult to debug/trace.
- Still requires types to label themselves.
Introspection
Introspection may be used to help alleviate some of the issues with the C-based approaches to this problem.
Instead of manually tracking each type, the underlying type of each abstraction is determined via a language's introspection features, and then the relevant code is dispatched to based on the findings.
As a side note, this approach is often times discovered independently and immediatelly touted as a panacea for the ugly switch/table based methods previously described, and the also ugly object-based double indirection used in object oriented languages (described in a moment). It is my opinion that it is not. While it does simplify some aspects of the table-based approach, it still carries many of the drawbacks associated with that method, and it introduces many of its own drawbacks in the process.
Criticisms
Good
- Removes the need for types to keep track of themselves.
Bad
- Makes debugging/tracing even more painful.
- While explicit tracking of types is removed, the developer must still be mentally aware of what these types are when updating tables.
Object Oriented Approach
In object oriented languages, polymorphism is the go-to mechanism for replacing branches based on type. To implement double dispatch, one can first write something along the lines of
This dispatches to the appropriate handle
method based on attack1's type. If attack1
is a rock
, for example, you could mentally translate this to
Once we're in the Rock's handle
method, we know we are a rock. To determine what attack2
is, we can write
attack2.handleRock(this);
We know that we're a rock
, so this
is really rock
. If attack2
's underlying type is paper
, the call may be mentally translated to
And in our Paper class, the handleRock method can contain the code which handles the rock versus paper interaction.
A common misunderstanding is that this technique only works in a language which supports function overloading. As shown above, it does not. Function overloading is often used during this second dispatch, but it is not necessary for the language to support overloading for this technique to work.
Criticisms
Good
- Returns many of the potential errors to compile time
- Avoids the poliferation inherent in switch-based solutions
Bad
- May be difficult to understand if unfamiliar with the design pattern
- It is an object oriented solution which violates many object oriented ideas
I will spend the second half of this article examining this object oriented approach, as I find it to be heavily criticized in ways which I think are unfair. If the above bullets are not clear, feel free to read on.
Common Object Oriented-based Complaints
Hopefully it is obvious that there are no clear winners when it comes to emulating multiple dispatch. Many would have you believe, however, that the object oriented solution is a clear loser. While it is by no means perfect, I feel many complaints are exaggerated or meaningless.
Though it will be discussed why later, many of the complains about the Visitor pattern will be addressed here as well.
It Breaks Encapsulation
Object oriented programming is centered around the idea that a set of data and the functions which operate on it should be packaged together. The public interface of the object protects the data from change which might put the object into an invalid state.
When we use multiple dispatch, though, we call a function which is supposed to interact with more than one type. In other words, the function itself does not belong to any one object--rather it belongs to both objects. Since the language does not inherently support multiple dispatch, there is usually no facility to create a function which is somehow owned by multiple objects.
I really have no counter argument here, but it is important to note that none of the other methods are any better in this respect. If multiple dispatch is truly necessary, you will not find an encapsulatable approach.
You Don't Need It
The claim here is that if you're attempting to implement multiple dispatch, there is going to be some other way which is simpler/better that you just aren't using. This is a particularly common complain when discussing the Visitor pattern (discussed later).
The problem with this complaint is that it is just wrong. Situations which require multiple dispatch really do require multiple dispatch.
Most of these complaints stem from improper use of the Visitor pattern. Be very wary when reading about these--just because a person has improperly picked a pattern, and then that person later on finds a better way of solving their problem, does not mean that the initial solution is A Bad Thing that should never be used.
The Dispatch Functions Grow Combinatorially
Consider our rock-paper-scissors game. Without going into the math behind it (though it is basic high school counting formulas), you can see from our matrix that there are three possible ways to attack, for a total of nine possible game-handling function calls. If we were to add another way to attack, we would have sixteen functions to write.
In more complex games, such as any that you might find on the shelf in a store, there may be 20 or more potential entities to consider. For 20 entities, that's up to four hundred collision handling functions.
Unfortunately, that's life, deal with it. If you have a game with 20 entities flying around, you have to deal with them colliding. There's no way around it.
Table-based methods have the advantage that not all cells need to be populated, but this just takes us back to the initial trade-off--an object-based design would require 400explicit function definitions, while a table based method would only require the ones that will actually ever be called (but you better hope you don't accidentally try to collide two objects that don't have a handler).
I am not claiming that either approach is superior to the other, but the number of situations you need to mentally handle will grow expontentially whether you like it or not.
Open/Closed Concerns
The rock-paper-scissors example is a special case. In this instance, we are dispatching to two different types, each from the same group of types. In other words, a rock, paper, or scissors will always be up against a rock, paper, or scissors. Adding or removing a possible attack is going to cause a lot of code to shift around. Having to chance code in classes that deal with rock/paper/scissor attacks everytime a new attack is added or removed actually makes sense, and there probably are not many people that would complain about having to do this.
The types dispatched to do not always have to be from the same group, though. A common example is that you have a group of heterogeneous Shape
types, and you want to render these using a variety of methods. In this case, we have two seperate groups of types which we want to dispatch to.
For example:
Shapes
Renderers
A Renderer
would have methods which render each type of Shape
, and each Shape
would simply provide the secondary dispatch function (renderer.visit(this)
).
The complaint is this: adding/removing a Renderer
is easy, but adding/removing a Shape
is difficult. Adding/removing a Renderer
is as simple as adding or removing the class from the project. Adding/removing a Shape
requires that every Renderer object be modified.
My guess is that this asymmetry is where a lot of the convoluted definitions and flawed understandings originate. It is my opinion that if multiple dispatch is being used correctly, then the need to modify so many classes is ultimately justified. In the classic Shape/Renderer example above, you would want to modify all of your renderers when a shape is added/removed. Even if there were hundreds of Renderer
s, you would want to make sure that each of them could render all of the necessary types.
Alternatives
Not many heavily used languages curently have official, explicit support for multiple dispatch, but many have ways to facilitate the process beyond what has been described here:
- C# has the
dynamic
keyword
- Python has libraries leveraging the language's decorator mechanism
- C++ libraries enable multiple dispatch via template metaprogramming
Conclusion
Multiple dispatch, in my opinion, is massively misunderstood, incorrectly used, and possibly underutilized. This is no surprise, however, as the mechanisms for supporting such a concept in mainstream languages are heavily lacking. Still, recognizing the situations in which multiple dispatch may be needed, and understanding the possible approaches to implementing it in your environment, can prevent the production of otherwise unweildly, hackneyed code which might attempt to be something that it is not.


Cover Your Apps is a project concieved at Stanford University for CS 194. It is an interactive platform designed to teach applicable computer safety skillls


export obj
add meshes
export obj
export stl
export gltf
Save File
Online 3D Viewer
glTF Viewer
playcanvas


General Elements
Welcome to Falcon applicationBootstrap Carousel
Bootstrap Datepicker
Bootstrap Progress Bars
Basic Progress Bars
Striped Progress Bars
Animated Progress Bars
Stacked Progress Bar
Other Variations
class="progress progress-striped progress-sm"
class="progress progress-striped progress-xs"
class="progress progress-striped progress-sm not-rounded"
Value in container
animated progress bar load
%
Tooltip
Lorem Ipsum is simply dummy text of the left printing and typesetting right industry. Lorem bottom Ipsum has been the industry's standard dummy text ever since the 1500s, when an fading unknown printer took a delayed galley of type and scrambled it to make a type specimen book.
I can even contain HTML. Check me out!
Ratings
Custom Icons
( )(Bugs: )


Andre Micheletti
👋 I'm a Software Enginner and I just love building stuff.
Be it a impactful tech product, a cool and fun indie game or just a simple open-source tool to help fellow developers.
About me
I am a fullstack developer with more than 5 years of experience and I worked with many different technologies and played many roles in software development.
I have worked in both early-stages and enterprise companies throughout my carrer which has given me perspective on how development changes along the company phases.
I support and contribute to open-source because I benefit from it, but more importantly because it is liberating and drives innovation. We have enough monopolies in the world already.
What can I do for you
Architect and implement modern, high-quality web and mobile applications and backend systems, combining good programming practices and latest tools and technologies.
Help you with DevOps processes to deliver software with high-quality, high-performance and more frequently using every tool available to ensure automation and maintainability.
I'm available primary on contract, but open to discussing full-time positions in the right company.
Technologies
I am highly effective in architecting and engineering web applications using Modern Javascript, React and Vue for your front-end, and Python, Ruby and Elixir for your back-end.
For a more specialized toolkit I can bring GraphQL, NoSQL Databases, Serverless, Terraform and Kubernetes.
As a full-stack developer I have built and deployed resilient, large-scale services to AWS, GCP and Azure in containerised, serverless, edge, and PaaS environments.
I have a solid grasp of software engineering fundamentals such as functional and object-oriented programming paradigms, database design and system architectures.
CV
now
GAME DEVELOPER
INO Games
CocosCreator | Unity3D | Javascript | C# | Maya3D | Casino Games
2020
DEVOPS ENGINNER
Midway S.A.
Azure Cloud | Azure Pipelines | SonarQuebe | Dynatrace | Rancher | Helm | Linkerd
2019
FULLSTACK ENGINNER
Zenvia Inc.
Ruby on Rails | Elixir | Phoenix | React | Kafka | Postgres | Whatsapp/Facebook API
2017
FULLSTACK DEVELOPER
Pontotel
Python | Flask | Celery | VueJS | MongoDB | AWS | Docker
2016
Tech & Onboarding Specialist
TrustedCompany Brasil
SQL | E-commerce Platforms | PHP | Drupal | Wordpress
2011
I started programming Ruby, making RPG Maker scripts
1997
I was born :)
Games
Open Source
pytest-sorter
StarExecute first tests that fail more often based on your execution history.
godot-agones-sdk
StarCommunity plugin to use Agones dedicated server orchestration in your Godot project


This command will automatically be run when you run “rails” with Rails 3 gems installed from the root of your application.
define version string from git repository
# File spec/factories.rb, line 48 def getTestImageBlob imagePath=Rails.root.to_s+"/app/assets/images/Rainbow.png" testImage=Magick::Image.read(imagePath)[0].to_blob { self.format='PNG' } return "AAAA"+testImage end
Use to check for this, that or this was entered… example:
:validates_presence_of_at_least_one_field :last_name, :company_name - would require either last_name or company_name to be filled in also works with arrays :validates_presence_of_at_least_one_field :email, [:name, :address, :city, :state] - would require email or a mailing type address
# File config/initializers/custom_validations.rb, line 6 def validates_presence_of_at_least_one_field(*attr_names) msg = attr_names.collect {|a| a.is_a?(Array) ? " ( #{a.join(", ")} ) " : a.to_s}.join(", ") + "can't all be blank. At least one field (set) must be filled in." configuration = { :on => :save, :message => msg } configuration.update(attr_names.extract_options!) send(validation_method(configuration[:on]), configuration) do |record| found = false attr_names.each do |a| a = [a] unless a.is_a?(Array) found = true a.each do |attr| value = record.respond_to?(attr.to_s) ? record.send(attr.to_s) : record[attr.to_s] found = !value.blank? end break if found end record.errors.add_to_base(configuration[:message]) unless found end end


Bibliography
By Eric Lawrey, Copyright 1997
-
S. Swales, M. Beach, "Third Generation
Wireless Networks", University of Bristol, Future Communication Systems
course, April 1994.
-
T. Rappaport, "Wireless Communications, Principle
& Practice", IEEE Press, Prentice Hall, pp. 3, 1996.
-
I. McKenzie, "Second Generation", Global
Communications, pp. 26-30, First Quarter 1990.
-
B. Leff, "Making sense of wireless standard
and system designs", Microwaves & RF, pp. 113-118, February
1994.
-
J. Scourias, "Overview of the GSM Cellular
System, Extended Abstract", University of Waterloo, http://ccnga.uwaterloo.ca/~jsouria/GSM/trio.html,
August 1997.
-
T. S. Rappaport, "Wireless Communications
Principles & Practice", IEEE Press, New York, Prentice Hall, pp. 399-422,
1996.
-
T. Bell, J. Adam, S. Lowe, "Communications",
IEEE
Spectrum, pp. 30-41, January 1996.
-
R. Comerford, "Interactive Media: An Internet
reality", IEEE Spectrum, pp. 29-32, April 1996.
-
R. S. Swain, "UMTS – A 21st Century
System", http://www.vtt.fi/tte/nh/UMTS/umts.html,
Sept 1995.
-
G. Livingston, Third Generation Wireless Standards
to Shape Internet’s Future", WirelessNOW, http://www.commow.com/3rd_Generation.html.
-
M. Beach, "Propagation and System Aspects",
University of Bristol, Future Communication Systems course, April 1994.
-
P. Tipler, "Physics for Scientists and Engineers",
3rd Edition, Worth Publishers, pp. 464-468, 1991.
-
C. Kikkert, "Digital Communication Systems
and their Modulation Techniques", James Cook University, October 1995.
-
D. Magill, "Spread-Spectrum Technology for
Commercial Applications", Proceedings of the IEEE, Vol. 82, No.
4, April 1994.
-
T. S. Rappaport, "Wireless Communications
Principles & Practice", IEEE Press, New York, Prentice Hall, pp. 169-177,
1996.
-
J. D. Gibson, "The mobile communications handbook",
CRC Press, pp. 366-368, 1996.
-
P. Donegan, "IS-95 CDMA becomes a world standard",
http://www.cdg.org/magazines/spectrum/article4_int.html,
1997.
-
D. Whipple, "North American Cellular CDMA",
Hewlett-Parkard Journal, pp. 90-97, December 1993.
-
D. Jiraud, "Broadband CDMA for Wireless Communications",
Applied
Microwave & Wireless, 1995.
-
L. Geppert, "Semiconductor lithography for
the next millennium", IEEE Spectrum, pp. 34, April 1996.
-
E. Ifeachor, "Digital Signal Processing, A
Practical Approach", Addison-Wesley Publisher Ltd., pp. 77, 1994.
-
Stanford University, "SPIFFEE, a low power
FFT processing chip", http://nova.stanford.edu/~bbass/spiffe.html,
July 1997.
Appendix I. Acronyms
AMPS Advanced Mobile Phone System
BER Bit Error Rate. Probability of a data word being transmitted being in error.
BPSK Binary Phase Shift Keying
CDMA Code Division Multiple Access
COFDM Coded Orthogonal Frequency Division Multiplexing
DAB Digital Audio Broadcasting system
DS-CDMA Direct Sequence Code Division Multiple Access
EbNo Energy per bit to noise energy ratio (similar to SNR)
FDM Frequency Division Multiplexing
FDMA Frequency Division Multiple Access
FFT Fast Fourier Transform
FH-CDMA Frequency Hopping Code Division Multiple Access
FIR Finite Impulse Response Filter
GSM Global System for Mobile telecommunications
IFFT Inverse Fast Fourier Transform
IS-95 International Standard for the CDMA phone system developed by Qualcomm Inc.
LEO Low Earth Orbit satellite
OFDM Orthogonal Frequency Division Multiplexing
QAM Quadrature Amplitude Modulation
QPSK Quadrate Phase Shift Keying
RMS Root Mean Square value
SNR Signal to Noise Ratio
TDM Time Division Multiplexing
TDMA Time Division Multiple Access
UMTS Universal Mobile Telecommunications System
VCR Video Cassette Recorder
Appendix II. OFDM Guassian Noise Performance Prediction
The performance of any OFDM system
using phase shift keying can be worked out using the Table 21 and Table
22.
| SNR (dB) |
RMS Phase Error (degrees)θerror(rms) |
| 0 |
63.63 |
| 2 |
44.85 |
| 4 |
34.25 |
|
6
|
26.65
|
|
8
|
20.92
|
|
10
|
16.5
|
|
12
|
13.05
|
|
14
|
10.34
|
|
16
|
8.198
|
|
18
|
6.505
|
|
20
|
5.164
|
|
22
|
4.1
|
|
24
|
3.256
|
|
26
|
2.586
|
|
28
|
2.054
|
|
30
|
1.631
|
|
32
|
1.296
|
|
34
|
1.029
|
|
36
|
0.8175
|
|
38
|
0.6494
|
|
40
|
0.5158
|
|
42
|
0.4097
|
|
44
|
0.3254
|
|
46
|
0.2585
|
|
48
|
0.2053
|
|
50
|
0.1631
|
Table
21 Expected Phase Error on a OFDM carrier at difference SNR levels
| Z (number of standard deviations) |
BER |
|
0
|
1
|
|
0.2
|
0.841481
|
|
0.4
|
0.689157
|
|
0.6
|
0.548506
|
|
0.8
|
0.423711
|
|
1
|
0.317311
|
|
1.2
|
0.230139
|
|
1.4
|
0.161513
|
|
1.6
|
0.109599
|
|
1.8
|
0.071861
|
|
2
|
0.0455
|
|
2.2
|
0.027807
|
|
2.4
|
0.016395
|
|
2.6
|
0.009322
|
|
2.8
|
0.00511
|
|
3
|
0.0027
|
|
3.2
|
0.001374
|
|
3.4
|
0.000674
|
|
3.6
|
0.000318
|
|
3.8
|
0.000145
|
|
4
|
6.34E-05
|
|
4.2
|
2.67E-05
|
|
4.4
|
1.08E-05
|
|
4.6
|
4.23E-06
|
|
4.8
|
1.59E-06
|
|
5
|
5.74E-07
|
Table
22 Expected Bit Error Rate for various noise levels. Z is the ratio of
the maximum allowable phase angle / RMS phase error.
Appendix III. BER verses Eb/No for a CDMA system
Table 23 shows the bit error rate (BER)
that would occur for a CDMA system that does not use forward error correction.
The energy per bit to noise ratio (Eb/No), is the energy in the demodulated
data bit, to the noise energy in the same bit. It is similar to the signal
to noise ratio. The Eb/No is the effective signal to noise ratio of the
demodulated, despread CDMA signal. Any noise, or interference in the radio
channel is reduced by a factor equal to the process gain during despreading.
The minimum allowable Eb/No that can be used for a particular system depends
on the forward error correction scheme used, and the type of data being
sent. Voice communications typically requires a BER better then ~1/100
or 0.01. This is assuming some forward error correction is used.
| Eb/No (dB) |
BER |
|
0
|
0.158655
|
|
2
|
0.104029
|
|
4
|
0.056495
|
|
6
|
0.023007
|
|
8
|
0.006004
|
|
10
|
0.000783
|
|
12
|
3.43E-05
|
|
14
|
2.7E-07
|
Table
23 Shows the Expected BER verses the energy per bit to noise ratio for
a CDMA system
Next Matlab code
|


Implements UART console. More...
Macros | |
| #define | CONSOLE_BAUDRATE 115200 |
| Console baud rate always using 115200. More... | |
| #define | CONSOLE_EDBG |
| EDBG used USART1 as the console, but LON support on USART1 only. More... | |
| #define | CONSOLE_ON_USART |
| #define | PIN_USART1_RXD_DBG {PIO_PA21A_RXD1, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT} |
| USART1 pin RX. More... | |
| #define | PIN_USART1_TXD_DBG {PIO_PB4D_TXD1, PIOB, ID_PIOB, PIO_PERIPH_D, PIO_DEFAULT} |
| USART1 pin TX. More... | |
| #define | PINS_USART1 PIN_USART1_TXD_DBG, PIN_USART1_RXD_DBG |
| #define | CONSOLE_Usart USART1 |
| Usart Hw interface used by the console (Usart0). More... | |
| #define | CONSOLE_PINS {PINS_USART1} |
| Pins description corresponding to Rxd,Txd, (Usart pins) More... | |
| #define | CONSOLE_ID ID_USART1 |
Functions | |
| void | DBG_Configure (uint32_t baudrate, uint32_t masterClock) |
| Configures an USART peripheral with the specified parameters. More... | |
| void | DBG_PutChar (uint8_t c) |
| Outputs a character on the UART line. More... | |
| uint32_t | DBG_GetChar (void) |
| Input a character from the UART line. More... | |
| uint32_t | DBG_IsRxReady (void) |
| Check if there is Input from UART line. More... | |
| void | DBG_DumpFrame (uint8_t *pucFrame, uint32_t dwSize) |
| Displays the content of the given frame on the UART0. More... | |
| void | DBG_DumpMemory (uint8_t *pucBuffer, uint32_t dwSize, uint32_t dwAddress) |
| Displays the content of the given buffer on the UART0. More... | |
| uint32_t | DBG_GetInteger (int32_t *pdwValue) |
| Reads an integer. More... | |
| uint32_t | DBG_GetIntegerMinMax (int32_t *pdwValue, int32_t dwMin, int32_t dwMax) |
| Reads an integer and check the value. More... | |
| uint32_t | DBG_GetHexa32 (uint32_t *pdwValue) |
| Reads an hexadecimal number. More... | |
| WEAK int | puts (const char *ptr) |
| WEAK char * | gets (char *ptr) |
Variables | |
| static uint8_t | _ucIsConsoleInitialized = 0 |
| Is Console Initialized. More... | |
Implements UART console.
| #define CONSOLE_BAUDRATE 115200 |
Console baud rate always using 115200.
| #define CONSOLE_EDBG |
EDBG used USART1 as the console, but LON support on USART1 only.
| #define CONSOLE_ID ID_USART1 |
| #define CONSOLE_ON_USART |
| #define CONSOLE_PINS {PINS_USART1} |
Pins description corresponding to Rxd,Txd, (Usart pins)
| #define PIN_USART1_RXD_DBG {PIO_PA21A_RXD1, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT} |
USART1 pin RX.
| #define PIN_USART1_TXD_DBG {PIO_PB4D_TXD1, PIOB, ID_PIOB, PIO_PERIPH_D, PIO_DEFAULT} |
USART1 pin TX.
| #define PINS_USART1 PIN_USART1_TXD_DBG, PIN_USART1_RXD_DBG |
| void DBG_Configure | ( | uint32_t | baudrate, |
| uint32_t | masterClock | ||
| ) |
Configures an USART peripheral with the specified parameters.
| baudrate | Baudrate at which the USART should operate (in Hz). |
| masterClock | Frequency of the system master clock (in Hz). |
| void DBG_DumpFrame | ( | uint8_t * | pucFrame, |
| uint32_t | dwSize | ||
| ) |
Displays the content of the given frame on the UART0.
| pucFrame | Pointer to the frame to dump. |
| dwSize | Buffer size in bytes. |
| void DBG_DumpMemory | ( | uint8_t * | pucBuffer, |
| uint32_t | dwSize, | ||
| uint32_t | dwAddress | ||
| ) |
Displays the content of the given buffer on the UART0.
| pucBuffer | Pointer to the buffer to dump. |
| dwSize | Buffer size in bytes. |
| dwAddress | Start address to display |
| uint32_t DBG_GetChar | ( | void | ) |
Input a character from the UART line.
| uint32_t DBG_GetHexa32 | ( | uint32_t * | pdwValue | ) |
Reads an hexadecimal number.
| pdwValue | Pointer to the uint32_t variable to contain the input value. |
| uint32_t DBG_GetInteger | ( | int32_t * | pdwValue | ) |
Reads an integer.
| pdwValue | Pointer to a integer variable to contain the input value. |
| uint32_t DBG_GetIntegerMinMax | ( | int32_t * | pdwValue, |
| int32_t | dwMin, | ||
| int32_t | dwMax | ||
| ) |
Reads an integer and check the value.
| pdwValue | Pointer to a integer variable to contain the input value. |
| dwMin | Minimum value |
| dwMax | Maximum value |
| uint32_t DBG_IsRxReady | ( | void | ) |
Check if there is Input from UART line.
| void DBG_PutChar | ( | uint8_t | c | ) |
Outputs a character on the UART line.
| c | Character to send. |
| WEAK char* gets | ( | char * | ptr | ) |
| WEAK int puts | ( | const char * | ptr | ) |
|
static |
Is Console Initialized.


Before Dawn
Extreme
Build a Paleolithic Settlement. Very few techs are available.
About 22,000 years ago, the last glacial period was at it's peak. Most of the planet was covered in ice and life was extremely harsh.
Reach a population of 50
Well done
You've survived the scenario


---
title: Walk Off The Earth - "Somebody that I used to know"
comments: true
tags:
- Music
thumbnail: https://img.youtube.com/vi/d9NF2edxy-M/default.jpg
blogger_orig_url: http://stickmanscorral.blogspot.com/2012/01/walk-off-earth-somebody-that-i-used-to.html
---
It may not be Thursday and the opening guitar riff is uncannily reminiscent of Baa Baa Black Sheep, but this is one of coolest covers I've heard/seen in ages.


Realtime Eateries
Too hungry to wait? Find current and up to date wait times at your local restaurants
Search
-->


Why do we need unit test?
Sometimes developers are asked to restructure their code due to design, framework change or code cleanup purpose. One scenario is, the developer will implement same logic but move the code from one class to another, etc., and still keep the same business logic. Consequently, how to test if the code refactor / restructure doesn’t have any impact is crucial. If the unit test is already in place, then the developer doesn’t need to rerun the whole program again and again to test the code’s logic after the refactor.
Real problem - how to test if a method is called with its argument?
We have one web app views module which contains a method like this:
@action_config(renderer='offering_definition/edit_package.mako')
def copy(self):
package = self.context.offering_definition
copy_util = CopyUtility(self.context.db)
package_copy = copy_util.copy_package(package)
redirect = self.request.route_path(
'package manager id',
action='edit',
id=package_copy.definition_id
)
return HTTPFound(location=redirect)
What this function does is, we got an instance called “package”, and want to copy that object. Once copied the web page should be redirected to another page.
Now, we want an unit test that can verify if copy_package() method is actually called in copy() method, with the argument of package. How can we achieve that?
Solution - use Mock/MagicMock
Python Mock/MagicMock enables us to reproduce expensive objects in our tests by using built-in methods (__call__
, __import__
) and variables to “memorize” the status of attributes, and function calls. We can use them to mimic the resources by controlling how they were created, what their return value is. There is one method called assert_called_with() which asserts that the patched function was called with the arguments specified as arguments, to assert_called_with(). Let’s take a look how this is implemented.
For above code, we can write a unit test like this:
def test_copy_processing_post(self):
package = make_offering_definition(self.db)
self.request.method = 'POST'
self.request.POST = POST_EDIT_PARAMS
self.context.definition_id = package.definition_id
odh = OfferingDefinitionHandler(self.context, self.request)
with patch('boss.views.offering_definition.lib.CopyUtility.copy_package'
) as copy_package_call:
copy_return = odh.copy()
copy_package_call.assert_called_with(package)
How does this work?
Let’s analyze the code line by line:
with patch('boss.views.offering_definition.lib.CopyUtility.copy_package'
) as copy_package_call:
This will create a new instance of mock.patch object and assign it to a variable called copy_package_call. copy_package_call is a MagicMock object with the name as copy_package. This object create all attributes and methods as you access them and store details of how they have been used. You can assume copy_package_call an object that keeps track of how its attributes (if any) or callable is called, how many times the callable is called, what are the arguments, etc.
copy_return = odh.copy()
When it comes to this line, because copy() includes package_copy = copy_util.copy_package(package) method call, and copy_package() is been defined as a MagicMock(), the CallableMixin’s call() method will also be invoked.
def __call__(_mock_self, *args, **kwargs):
# can't use self in-case a function / method we are mocking uses self
# in the signature
_mock_self._mock_check_sig(*args, **kwargs)
return _mock_self._mock_call(*args, **kwargs)
def _mock_call(_mock_self, *args, **kwargs):
self = _mock_self
self.called = True
self.call_count += 1
_new_name = self._mock_new_name
_new_parent = self._mock_new_parent
_call = _Call((args, kwargs), two=True)
self.call_args = _call
self.call_args_list.append(_call)
self.mock_calls.append(_Call(('', args, kwargs)))
This line self.call_args = call keeps track of args / kwargs in a tuple that are used in function call. In this case, it will be the instance of OfferingDefinition. This self.callargs is used later to trace the call arguments.
copy_package_call.assert_called_with(package)
If we go to the source code of assert_called_with(), we can see what it’s doing:
def assert_called_with(_mock_self, *args, **kwargs):
"""assert that the mock was called with the specified arguments.
Raises an AssertionError if the args and keyword args passed in are
different to the last call to the mock."""
self = _mock_self
if self.call_args is None:
expected = self._format_mock_call_signature(args, kwargs)
raise AssertionError('Expected call: %s\nNot called' % (expected,))
def _error_message(cause):
msg = self._format_mock_failure_message(args, kwargs)
if six.PY2 and cause is not None:
# Tack on some diagnostics for Python without __cause__
msg = '%s\n%s' % (msg, str(cause))
return msg
expected = self._call_matcher((args, kwargs))
actual = self._call_matcher(self.call_args)
if expected != actual:
cause = expected if isinstance(expected, Exception) else None
six.raise_from(AssertionError(_error_message(cause)), cause)
In this call – assert_called_with(package), package is passed into function as args. This method assert_called_with compares if the expected mock object (copy_package()) and the actual object are invoked with by the same argument (OfferingDefinition). Because self.call_args also keeps track of package, the expected and actual object will be equal, and thus the unit test function will pass.
More methods about MagicMock (from Python doc)
assert_called_with()
This method is a convenient way of asserting that calls are made in a particular way:
assert_called_once_with()
Assert that the mock was called exactly once and with the specified arguments.
assert_any_call()
assert the mock has been called with the specified arguments. The assert passes if the mock has ever been called, unlike assert_called_with() and assert_called_once_with() that only pass if the call is the most recent one.
assert_has_calls()
assert the mock has been called with the specified calls. The mock_calls list is checked for the calls. If any_order is false (the default) then the calls must be sequential. There can be extra calls before or after the specified calls. If any_order is true then the calls can be in any order, but they must all appear in mock_calls.


#-- /********************************************************************************** * $URL: https://source.etudes.org/svn/apps/jforum/tags/2.27/jforum-tool/src/webapp/templates/default/admin/special_access_topic_form.htm $ * $Id: special_access_topic_form.htm 6235 2013-10-31 21:24:42Z murthyt $ *********************************************************************************** * * Copyright (c) 2013 Etudes, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ***********************************************************************************/ --> <#include "header.htm"/>
| ${I18n.getMessage("SpecialAccess.Form.Title")} | ||
|---|---|---|
| ${topic.title} | ||
| ${errorMessage} |