PlotDevice is a Mac OS X application that lets you write Python scripts to produce 2D graphics. It provides a built-in editor and allows you to view your script's results as you write it. The graphics that you "draw with code" can be saved as PDFs, images, or even Quicktime/GIF animations.
The first thing you'll want to do once you’ve downloaded the application is run some example scripts. There’s a folder with tons of sample code that can be accessed from the app's menu. Select one of them and press to see it run (if the script is an animation, you can bring it to a halt by pressing ). Then try changing some numbers in the script and run it again to see what happens:
Next you'll want to have a look at the reference to see what scripting commands are available and the sorts of parameters they accept. We'll learn how to interpret the reference's "syntax definitions" in the chapter on drawing primitives. But in the meantime, skimming over the list of commands should give you a general sense of what's possible.
PlotDevice commands let you draw primitive shapes (polygons, circles), create your own shapes (Bézier paths), transform the "canvas" (rotate, scale, etc.), and work with content generated elsewhere (images & text).
After you've played around with the app for a bit, you should take a look at the other chapters in this Tutorial. They contain essential tips on how the commands work and how to use them in scripts of your own. To really understand what's going on in your PlotDevice scripts, we recommend reading through at least:
Readers who are new to programming may also find the chapters on datatypes and control structures helpful:
Seasoned Pythonistas (and emacs
partisans) will want to take a look at:
The programming language that underlies PlotDevice is Python (created by Guido van Rossum in the early ’90s). Python emphasizes code readability and programmer productivity; qualities that make it an excellent choice for those just learning to program. These same traits also result in an expressive "sketching" language that makes it easy to experiment in your code without being weighed down by syntactic bookkeeping.
The official documentation is thorough and highly-readable. If you're just starting out, the Python Tutorial is a well-paced introduction to the language as well as general programming concepts. We like to keep these chapters on the nightstand:
Writing your scripts in Python also means being able to take advantage of the thousands of third-party libraries that have been written by the community. Try searching for a topic of interest at the Python Package Index. We bet you'll be pleasantly surprised by the amount of code you won't have to write.


{% extends 'layout/base.html' %} {% load static %} {% block HeadContent %} {% endblock %} {% block content %} Meet The Team Management & Content Writing
Meet The Team
Management & Content Writing
CEO & Founder
DDU
Co-Founder
CHARUSAT University
Leave us a message
<EMAIL_ADDRESS>Follow us on
2021 MECHINMIND


GenePattern
▼
View System Message
My Settings
Sign Out
Modules & Pipelines
New Pipeline
New Module
Install From Repository
Install From ZIP
Manage
Suites
New Suite
Install From Repository
Install From ZIP
Manage
Job Results
Results Summary
Resources
Mailing List
Report Bugs
Contact Us
Programming Languages
Public Datasets
Administration
Server Settings
Help
Help Forum
Tutorial
Video Tutorial
Tour of GenePatttern UI
User Guide
Programmers Guide
File Formats
Release Notes
FAQ
About
Modules
Jobs
Files
Notebook
Browse Modules ›
Loading GenePattern Modules...
Refresh
Loading GenePattern Jobs...
Refresh
Please correct the following errors before proceeding:


This is a template for a simple marketing or informational website. It includes a large callout called a jumbotron and three supporting pieces of content. Use it as a starting point to create something more unique.
Learn more »
{{product.description}}
View details »


| Enumerator |
|---|
| CPUI_COPY | Copy one operand to another.
|
| CPUI_LOAD | Load from a pointer into a specified address space.
|
| CPUI_STORE | Store at a pointer into a specified address space.
|
| CPUI_BRANCH | Always branch.
|
| CPUI_CBRANCH | Conditional branch.
|
| CPUI_BRANCHIND | Indirect branch (jumptable)
|
| CPUI_CALL | Call to an absolute address.
|
| CPUI_CALLIND | Call through an indirect address.
|
| CPUI_CALLOTHER | User-defined operation.
|
| CPUI_RETURN | Return from subroutine.
|
| CPUI_INT_EQUAL | Integer comparison, equality (==)
|
| CPUI_INT_NOTEQUAL | Integer comparison, in-equality (!=)
|
| CPUI_INT_SLESS | Integer comparison, signed less-than (<)
|
| CPUI_INT_SLESSEQUAL | Integer comparison, signed less-than-or-equal (<=)
|
| CPUI_INT_LESS | Integer comparison, unsigned less-than (<)
|
| CPUI_INT_LESSEQUAL | Integer comparison, unsigned less-than-or-equal (<=)
|
| CPUI_INT_ZEXT | Zero extension.
|
| CPUI_INT_SEXT | Sign extension.
|
| CPUI_INT_ADD | Addition, signed or unsigned (+)
|
| CPUI_INT_SUB | Subtraction, signed or unsigned (-)
|
| CPUI_INT_CARRY | Test for unsigned carry.
|
| CPUI_INT_SCARRY | Test for signed carry.
|
| CPUI_INT_SBORROW | Test for signed borrow.
|
| CPUI_INT_2COMP | Twos complement.
|
| CPUI_INT_NEGATE | Logical/bitwise negation (~)
|
| CPUI_INT_XOR | Logical/bitwise exclusive-or (^)
|
| CPUI_INT_AND | Logical/bitwise and (&)
|
| CPUI_INT_OR | Logical/bitwise or (|)
|
| CPUI_INT_LEFT | Left shift (<<)
|
| CPUI_INT_RIGHT | Right shift, logical (>>)
|
| CPUI_INT_SRIGHT | Right shift, arithmetic (>>)
|
| CPUI_INT_MULT | Integer multiplication, signed and unsigned (*)
|
| CPUI_INT_DIV | Integer division, unsigned (/)
|
| CPUI_INT_SDIV | Integer division, signed (/)
|
| CPUI_INT_REM | Remainder/modulo, unsigned (%)
|
| CPUI_INT_SREM | Remainder/modulo, signed (%)
|
| CPUI_BOOL_NEGATE | Boolean negate (!)
|
| CPUI_BOOL_XOR | Boolean exclusive-or (^^)
|
| CPUI_BOOL_AND | Boolean and (&&)
|
| CPUI_BOOL_OR | Boolean or (||)
|
| CPUI_FLOAT_EQUAL | Floating-point comparison, equality (==)
|
| CPUI_FLOAT_NOTEQUAL | Floating-point comparison, in-equality (!=)
|
| CPUI_FLOAT_LESS | Floating-point comparison, less-than (<)
|
| CPUI_FLOAT_LESSEQUAL | Floating-point comparison, less-than-or-equal (<=)
|
| CPUI_FLOAT_NAN | Not-a-number test (NaN)
|
| CPUI_FLOAT_ADD | Floating-point addition (+)
|
| CPUI_FLOAT_DIV | Floating-point division (/)
|
| CPUI_FLOAT_MULT | Floating-point multiplication (*)
|
| CPUI_FLOAT_SUB | Floating-point subtraction (-)
|
| CPUI_FLOAT_NEG | Floating-point negation (-)
|
| CPUI_FLOAT_ABS | Floating-point absolute value (abs)
|
| CPUI_FLOAT_SQRT | Floating-point square root (sqrt)
|
| CPUI_FLOAT_INT2FLOAT | Convert an integer to a floating-point.
|
| CPUI_FLOAT_FLOAT2FLOAT | Convert between different floating-point sizes.
|
| CPUI_FLOAT_TRUNC | Round towards zero.
|
| CPUI_FLOAT_CEIL | Round towards +infinity.
|
| CPUI_FLOAT_FLOOR | Round towards -infinity.
|
| CPUI_FLOAT_ROUND | Round towards nearest.
|
| CPUI_MULTIEQUAL | Phi-node operator.
|
| CPUI_INDIRECT | Copy with an indirect effect.
|
| CPUI_PIECE | Concatenate.
|
| CPUI_SUBPIECE | Truncate.
|
| CPUI_CAST | Cast from one data-type to another.
|
| CPUI_PTRADD | Index into an array ([])
|
| CPUI_PTRSUB | Drill down to a sub-field (->)
|
| CPUI_SEGMENTOP | Look-up a segmented address.
|
| CPUI_CPOOLREF | Recover a value from the constant pool.
|
| CPUI_NEW | Allocate a new object (new)
|
| CPUI_INSERT | Insert a bit-range.
|
| CPUI_EXTRACT | Extract a bit-range.
|
| CPUI_POPCOUNT | Count the 1-bits.
|
| CPUI_MAX | Value indicating the end of the op-code values.
|


| Created: | 6/26/2020 3:15:32 PM |
| Modified: | 6/26/2020 3:15:32 PM |
| Project: | |
| Advanced: |
| Attribute |
|
Public bigint contact_id |
|
Details:
|
|
Public varchar(255) contact_first_name |
|
Details:
|
|
Public varchar(255) contact_last_name |
|
Details:
|
|
Public varchar(255) contact_phone |
|
Details:
|
|
Public varchar(255) created_by |
|
Details:
|
|
Public varchar(255) updated_by |
|
Details:
|
|
Public timestamp with time zone(0) created_at |
|
Details:
|
|
Public timestamp with time zone(0) updated_at |
|
Details:
|
|
Public timestamp with time zone(0) start_date |
|
Details:
|
|
Public timestamp with time zone(0) end_date |
|
Details:
|
|
Public bigserial id |
|
Details:
|
|
Public jsonb ods_meta |
|
Details:
|
|
Public integer ods_version |
|
Details:
|
|
Public varchar(255) ods_created_by |
|
Details:
|
|
Public timestamp with time zone(0) ods_created_at |
|
Details:
|
| Operation | ||
|
Public contacts_pkey( id: bigserial, |
||
|
Details:
<<PK>>
|
| Tag | Value |
| Owner | public |
|
Details:
|
| Property | Value |
| isFinalSpecialization: | 0 |
| Object | Type | Connection | Direction | Notes |
| «view» current_contacts_view | View | Dependency | From | |
| «view» current_contacts_view | View | Dependency | From |


Three years ago, my wife and I bought our first home. I can’t believe I haven’t written more on this before (which is partially true. I mention the remodel, along with some photos in an old post.) Time for a mega update – with pictures!
We rushed during the first summer to get the major work done before Meredith was born, which we were able to do.
We’d found carpenter ants and some serious water damage on the plate for the wall, so the whole thing had to come out and be rebuilt. That was day 1.
Part of the process involved removing a wall from the dining room, which meant a major ceiling repair as well as refinishing hardwood floors after patching in an old exterior door.
The floors were finished the week M was born.
The summer of 2014 was mostly hired out for siding work from tearing the kitchen wall out the previous year. There were some other structural repairs that needed to be done – new soffits, window moulding, a new window put into the living room…things I don’t have photos for. We finally settled on what the kitchen backsplash needed to look like in the spring, and I got those put in during spring break.
The best part about the backsplash is that the tile we chose was on clearance at Lowe’s, and according to their own policy, they’ll price match. So, a tile that was originally $0.90 each only cost us $0.20 at every store. I bought out northern Indiana and southern Michigan. It was awesome.
Now, a year later, we’re finally pushing hard to finish the rest of the kitchen. The fridge and some old floor cabinets we owned from our first place in the states are getting a facelift with custom shelves, a new butcher block countertop, and some floating oak wall shelves. We started the butcher block last week by milling down some oak we bought from a neighbor.
Today, I spent a snowy April morning building the new custom shelves.
This week is the week to get it all finished. In addition to the shelves, I’m going to be milling the face frames from some maple (from the neighbor again) and then putting a wall cabinet over the fridge. Everything will be topped with crown moulding along the ceiling when we’re done.
And who says home projects tend to linger…
—
All photos in this post are mine shared via Flickr CC-BY-NC
Written on April 2nd , 2016 by Brian Bennett Categorized in: Life
Leave a comment


Module: SidekiqUniqueJobs::Orphans
- Defined in:
- lib/sidekiq_unique_jobs/orphans/observer.rb,
lib/sidekiq_unique_jobs/orphans/reaper.rb,
lib/sidekiq_unique_jobs/orphans/manager.rb,
lib/sidekiq_unique_jobs/orphans/lua_reaper.rb,
lib/sidekiq_unique_jobs/orphans/null_reaper.rb,
lib/sidekiq_unique_jobs/orphans/ruby_reaper.rb,
lib/sidekiq_unique_jobs/orphans/reaper_resurrector.rb
Overview
Note:
this is a much slower version of the lua script but does not crash redis
Class DeleteOrphans provides deletion of orphaned digests
Defined Under Namespace
Modules: Manager, ReaperResurrector Classes: LuaReaper, NullReaper, Observer, Reaper, RubyReaper


What happens when you feed Donald Trump speeches and short stories by HP Lovecraft into a Markov chain generator? Well... This:
What happens when you feed Donald Trump speeches and short stories by HP Lovecraft into a Markov chain generator? Well... This:


Circumflex web applications run in standard Servlet 2.5 containers. There's a couple of things you should do in order to start using Circumflex Web Framework.
First, make sure that circumflex-core-<version>.jar` and `circumflex-web-<version>.jar
are in the classpath (add <dependency>
with circumflex-core
and circumflex-web
as described in quick start guide).
Second, configure CircumflexFilter
in /WEB-INF/web.xml
:
<web-app version="2.5">
<filter>
<filter-name>Circumflex Filter</filter-name>
<filter-class>ru.circumflex.web.CircumflexFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>Circumflex Filter</filter-name>
<url-pattern>*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
<dispatcher>INCLUDE</dispatcher>
<dispatcher>ERROR</dispatcher>
</filter-mapping>
</web-app>
Third, configure the main request router of your application by setting cx.router
configuration parameter:
via src/main/resource/cx.properties
file:
cx.router=com.myapp.web.MainRouter
pom.xml
using Circumflex Maven Plugin.Please refer to Circumflex Configuration API for more information on how to configure your application.
All code examples assume that you have following import
statement in code where necessary:
import ru.circumflex._, core._, web._


WHO WE ARE
A small team of healthcare professionals who are attached to the city and tied together with a common goal : Take the healthcare professionals to every gully of the city
OUR MISSION
To revisit the "family doctor" concept and present it as an enabler to the government's efforts to improve healthcare services with a focus on low income inhabitations
OUR VISION
Universal healthcare becomes a dream within reach alongside a strong arm of behavioural change towards community health.


{% extends "layout.html" %} {% from "includes/_formhelpers.html" import render_field, render_noLabel_field, render_noError_field, render_pre_field, render_radio_field, render_checkbox_field, render_text_field %} {% block body %}


On the campaign trail on Sunday
The Prime Minister is set to launch the Conservative Party’s much-anticipated General Election manifesto as he heads to the West Midlands on Sunday.
Here is what to expect on the campaign trail:
Conservatives
Boris Johnson will be unveiling the party’s blueprint for government on his trip to the West Midlands.
Brexit is expected to feature heavily in the document, while the party has already vowed to increase the NHS budget by £33.9 billion by 2023-24, increase state-school spending and raise the threshold at which workers start paying National Insurance contributions.
Sorry, this content isn't available on your device.
Commitments on social care and housing will also feature.
Labour
The Labour Party has already launched its manifesto, and leader Jeremy Corbyn will be looking for a positive reaction to his plans as he goes out and about on Sunday.
Mr Corbyn is expected to be campaigning in the South East.
It comes after he was criticised by other parties for his decision to remain “neutral” in a proposed public vote on a new Brexit deal which the party intends to negotiate with Brussels.
Elsewhere
Nigel Farage will remain in the North East on Sunday, after visiting Hartlepool on Saturday.
The Brexit Party leader spoke to market stallholders and joined canvassers knocking on doors as he revealed he believed patriotic voters in places like Hartlepool would vote for his party because of their view of Mr Corbyn.
Meanwhile, the SNP’s Derek Mackay will be in Glasgow as he joins candidate for East Dunbartonshire Amy Callaghan on the campaign trail.


{% trans 'Getting started' %}
{% trans 'Rate movies.' %}
{% trans "The more we know about the movies you like, the better our recommendations will be. You can start by going through our tours." %}
{% trans 'Complete your profile info.' %}
{% trans "Your gender and your age are extra pieces of information that can be taken into account when providing recommendations.  %}
{% trans 'Browse recommendations.' %}
{% trans 'Browse the recommendations we provide, add movies to your watchlist or to any custom list.' %}


Dividers group and separate content within lists and page layouts using strong visual and spatial distinctions. This divider is a thin rule, lightweight enough to not distract the user from content.
| Parameter | Type | Description |
|---|---|---|
md-inset
boolean
|
boolean |
Add this attribute to activate the inset divider style. |


An error occured whilst retrieving conferences for today
An error occured whilst sending the event
{{ error }}
Please wait whilst the conferences for today are retreived.


A statement attributed to Pythagoras - a Greek mathematician who lived a long time ago. (585 - 500 BC). The theorem he worked out concerns the sides of a right angled triangle; he proved that:
The area of the square drawn on the hypotenuse is equal to the sum of the areas of the squares drawn on the other two sides.
Over 350 different proofs of this theorem have been collected over the years.


Davido on daddy duties, feeds baby Ifeanyi (Video)
by Ifeanyi Ngerem27 year-old father and super star, Davido has been filmed while he feeds his son, Ifeanyi.
In the video, the DMW boss, Davido could be seen carrying his baby boy feeding him and at same time operating his mobile phone.
Davido’s love for his kids is not a news as he showers them with love at every given opportunity. Recall he splashed a whooping N5 million on his daughter on a diamond crusted bracelet when they went shopping in Dubai.
David Adeleke is one celebrity who knows well how to take care of his own, whether family or crew member, he shows his love and benevolence.

Watch video below:
https://twitter.com/lailaijeoma/status/1204070155736829953?s=12


|
TTK
|
CellArray generic array of cells More...
#include <CellArray_legacy.h>
Public Member Functions | |
| CellArray (const LongSimplexId *cellArray, const LongSimplexId nbCells, const unsigned char dimension) | |
| virtual | ~CellArray () |
| void | setOwnership (const bool o) |
| Deal with data ownership. More... | |
| unsigned char | getDimension () const |
| Retrieve the dimension. More... | |
| LongSimplexId | getNbCells () const |
| Get the number of cells in the array. More... | |
| SimplexId | getCellVertexNumber (const LongSimplexId cellId) const |
| LongSimplexId | getCellVertex (const LongSimplexId cellId, const SimplexId localVertId) const |
| CellArray (const LongSimplexId *connectivity, const LongSimplexId *offset, const LongSimplexId nbCells) | |
| virtual | ~CellArray () |
| void | setOwnership (const bool o) |
| Deal with data ownership. More... | |
| LongSimplexId | getNbCells () const |
| Get the number of cells in the array. More... | |
| SimplexId | getCellVertexNumber (const LongSimplexId cellId) const |
| LongSimplexId | getCellVertex (const LongSimplexId cellId, const SimplexId localVertId) const |
Static Public Member Functions | |
| static void | TranslateToFlatLayout (std::vector< LongSimplexId > &connectivity, std::vector< LongSimplexId > &offset, LongSimplexId *&singleArray) |
Protected Attributes | |
| const LongSimplexId * | cellArray_ |
| const LongSimplexId | nbCells_ |
| const unsigned char | dimension_ |
| bool | ownerShip_ = false |
| const LongSimplexId * | connectivity_ |
| const LongSimplexId * | offset_ |
CellArray generic array of cells
CellArray is a generic container that allows to deal with various cell layouts in memory
CellArray is a generic container that allows to deal with various cell layouts in memory
Definition at line 31 of file CellArray_legacy.h.
|
inline |
Definition at line 33 of file CellArray_legacy.h.
|
inlinevirtual |
Definition at line 39 of file CellArray_legacy.h.
|
inline |
Definition at line 36 of file CellArray_new.h.
|
inlinevirtual |
Definition at line 42 of file CellArray_new.h.
|
inline |
Get the vertex id of the "localVertId"'nt vertex of the cell.
| cellId | global id of the cell |
| localVertId | id of the vertex local to the cell, usually lower than 4 in 3D and lower than 3 in 2D. |
Definition at line 78 of file CellArray_legacy.h.
|
inline |
Get the vertex id of the "localVertId"'nt vertex of the cell. Can deal with heterogeneous meshes
| cellId | global id of the cell |
| localVertId | id of the vertex local to the cell |
Definition at line 78 of file CellArray_new.h.
|
inline |
Get the number of vertices in the cell with the id: cellid Can deal with heterogeneous meshes
| cellid | global id of the cell |
Definition at line 63 of file CellArray_new.h.
|
inline |
Get the number of vertices in the cell with the id: cellid
| cellid | global id of the cell |
Definition at line 63 of file CellArray_legacy.h.
|
inline |
Retrieve the dimension.
Definition at line 51 of file CellArray_legacy.h.
|
inline |
Get the number of cells in the array.
Definition at line 55 of file CellArray_new.h.
|
inline |
Get the number of cells in the array.
Definition at line 56 of file CellArray_legacy.h.
|
inline |
Deal with data ownership.
Definition at line 46 of file CellArray_legacy.h.
|
inline |
Deal with data ownership.
Definition at line 50 of file CellArray_new.h.
|
static |
|
protected |
Definition at line 96 of file CellArray_legacy.h.
|
protected |
Definition at line 91 of file CellArray_new.h.
|
protected |
Definition at line 98 of file CellArray_legacy.h.
|
protected |
Definition at line 97 of file CellArray_legacy.h.
|
protected |
Definition at line 92 of file CellArray_new.h.
|
protected |
Definition at line 99 of file CellArray_legacy.h.


Home
Main Menu
Make Your Food
About Us
Your Order is Ready to Go
Check Order Status
Cancel order
What Do Your Think About Our Services
Submit Feedback
Mystery Button


Munster confirm Mathewson will leave province after Racing clash
The 33-year-old initially joined as short-term cover when Conor Murray was injured.
by Murray KinsellaMUNSTER HAVE CONFIRMED that scrum-half Alby Mathewson will leave the province at the end of this week, with the New Zealander set to bid farewell after Saturday’s Heineken Champions Cup clash with Racing 92 at Thomond Park.
The 33-year-old joined Munster on an initial four-month contract in August 2018 when Conor Murray was ruled out with a neck injury.
Mathewson settled quickly in the southern province and his strong performances saw Munster and the IRFU extend his deal twice to carry him through to the end of the 2018/19 season, during which he played 21 times under head coach Johann van Graan.
With Murray then away at the World Cup with Ireland, the IRFU gave the go-ahead for Munster to re-contract Mathewson through until this month. Mathewson has made six appearances this season.
However, the Kiwi halfback’s time with the province is now coming to a close and this weekend’s crucial pool clash with Racing is set to be his final game in the red jersey, if selected.
Mathewson, who previously played for Toulon, Bristol, the Blues, and the Hurricanes, will now look for a new club mid-season.
With Mathewson set to depart, Murray will be backed-up by Nick McCarthy, Craig Casey and Neil Cronin in the scrum-half stocks, while Jack Stafford is part of the province’s academy.


Kinematics in one dimension
Displacement
Displacement (ΔX)
Displacement = Final Position - Initial Position
Initial Position:
Final Position:
Next - Velocity


myGengo API Client
LICENSE
This source file is subject to the new BSD license that came with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://mygengo.com/services/api/dev-docs/mygengo-code-license If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to<EMAIL_ADDRESS>so we can send you a copy immediately.
Located in /myGengo/Api.php (line 21)
| Class | Description |
|---|---|
| myGengo_Api_Service | myGengo API Client |
| myGengo_Api_Job | myGengo API Client |
| myGengo_Api_Jobs | myGengo API Client |
| myGengo_Api_Account | myGengo API Client |
Set the passed parameters that are null with default
configuration values
Set the passed parameters that are null with default
configuration values
Documentation generated on Mon, 10 May 2010 16:01:19 +0900 by phpDocumentor 1.4.3


Hi, I'm
Lover of life, people, hiking, cycling (and sewing!). If it can be designed and made, I'll give it a try. Except food. I'm not great at that.
Finding God in everything and loving people. Those are on top. Doing right, seeking truth, and giving of myself are how I try to go about it.
Born in Indiana from Texas stock, raised in Colorado, the American west is in my blood.
Cycling, Ice climbing, hiking, home improvement, backpack design.
Surf bum. Just kidding. I'm an accidental serial entrepreneur. I'd love to start an micro power company some day.
Strange Trails by Lord Huron has made it's way into my playlist more than I want to admit. Also, I picked up the Dave Brubeck Quartet record with the original "Take 5". So good.


USD/IDR seesaws around 14,100 amid trade jitters, eyes on Bank Indonesia rate decision
by Anil Panchal- The USD/IDR pair struggles to justify broad USD strength and expectations of a no rate cut from the Bank Indonesia (BI).
- BI officials argue overall doubting sentiment on the Asian economy.
- The US and Indonesia recently vowed to double the trade volume.
Clubbed between the US-China trade angst and a less likely offer of the fifth rate cut from BI, the USD/IDR pair takes rounds to 14,100 during early Asian session on Thursday.
The pair recently benefited from the broad US dollar (USD) strength that has begun taking clues from the US-China tussle. On the front, Reuters’ anticipate that the United States (US) President Donald Trump will sign Hong Kong Human Rights Bill passed by the Congress and add pressure on to the Asian economies via trade-war risk.
On the positive side, Xinhua released news stating that officers from the US and Indonesia have pledged to edge up the trade volume by twice in the next five years as the two nations still have more business opportunities that can be explored further.
Further, the anticipation of a halt to the Bank Indonesia’s rate cut trajectory after four consecutive actions, as suggested by Bloomberg, should add strength to the Indonesian Rupiah (IDR). It’s worth mentioning that the BI Governor Perry Warjiyo and Deputy Governor Dody Budi Waluyo stayed positive for the economy and the domestic currency while crossing wires during the early-month appearances.
Looking forward to the Bank Indonesia’s (BI) rate decision, the Asian nation’s central bank is expected to announce no change to its benchmark rate of 5.0%. “We look for no change from Bank Indonesia. BI cut its 7-day reverse repo rate by 25bp to 5% at its last meeting but indicated that they will be increasingly data-dependent going forward. Since then CPI came in lower than expected, while manufacturing and consumer confidence fell further and Q3 GDP slowed. The weaker growth trajectory should not have come as a surprise, however, and we don't think it will automatically imply an immediate rate cut. We expect BI to slow the pace of rate cuts, with a pause expected at this meeting as the Bank assesses the impact of previous easing,” says TD Securities ahead of the event.
Technical Analysis
Prices need to cross three-month-old falling trend line, at 14,195 now, in order to take aim at October high near 14,275, failing to which can keep prices around 14,100 and 14,000. It should also be noted that 13,880 acts as the key downside support below 14,000.
additional important levels
| Overview | |
|---|---|
| Today last price | 14111.8 |
| Today Daily Change | 12.3000 |
| Today Daily Change % | 0.09% |
| Today daily open | 14099.5 |
| Trends | |
|---|---|
| Daily SMA20 | 14057.3275 |
| Daily SMA50 | 14094.883 |
| Daily SMA100 | 14115.4395 |
| Daily SMA200 | 14164.821 |
| Levels | |
|---|---|
| Previous Daily High | 14193.714 |
| Previous Daily Low | 13994.6 |
| Previous Weekly High | 14203.511 |
| Previous Weekly Low | 13995.819 |
| Previous Monthly High | 14273.8 |
| Previous Monthly Low | 13971.3 |
| Daily Fibonacci 38.2% | 14117.6525 |
| Daily Fibonacci 61.8% | 14070.6615 |
| Daily Pivot Point S1 | 13998.162 |
| Daily Pivot Point S2 | 13896.824 |
| Daily Pivot Point S3 | 13799.048 |
| Daily Pivot Point R1 | 14197.276 |
| Daily Pivot Point R2 | 14295.052 |
| Daily Pivot Point R3 | 14396.39 |


range(start, end, @key next = inc, compare = number_is_lteq)
Return a list of values from start
to end
(both inclusive).
Next
must be a function that when called with the current element added to the result, return the following element.
Compare
is the predicate used to determine when to stop generating new elements.
range(1, 10)
// [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
range(\a, \k, next = ^(c) integer_to_char(char_to_integer(c) + 2), compare = char_is_lteq)
// [\a, \c, \e, \g, \i, \k]


|
SoundFontInfoLib
2.21.6
Library for parsing and rendering SF2 files
|
Represents the sample index bounds and loop start/end indices using values from the SF2 'shdr' entity as well as state values from generators that can change in real-time. More...
#include <Bounds.hpp>
Public Types | |
| using | Index = Entity::Generator::Index |
Public Member Functions | |
| Bounds (const Entity::SampleHeader &header, const Voice::State &state) | |
| Construct new instance using information from 'shdr' and current voice state values from generators related to sample indices. More... | |
| size_t | startIndex () const |
| size_t | startLoopIndex () const |
| size_t | endLoopIndex () const |
| size_t | endIndex () const |
Represents the sample index bounds and loop start/end indices using values from the SF2 'shdr' entity as well as state values from generators that can change in real-time.
Note that unlike the "absolute" values in the 'shdr' and the state offsets which are all based on the entire sample block of the file, these values are offsets from the first sample value from the 'shdr'.
|
inline |
Construct new instance using information from 'shdr' and current voice state values from generators related to sample indices.
| header | the 'shdr' header to use |
| state | the generator values to use |
References SF2::Entity::SampleHeader::endIndex(), SF2::Entity::SampleHeader::endLoopIndex(), header, SF2::Entity::SampleHeader::startIndex(), SF2::Entity::SampleHeader::startLoopIndex(), and SF2::Render::Voice::State::unmodulated().
|
inline |
Referenced by SF2::Render::Sample::Generator::generate().
|
inline |
|
inline |
|
inline |


--- layout: post status: publish published: true title: Testing and Internal Implementation in .NET author: display_name: Geoff Lane login: admin email<EMAIL_ADDRESS>url: http://www.zorched.net author_login: admin author_email<EMAIL_ADDRESS>author_url: http://www.zorched.net date: '2012-02-06 13:47:20 -0500' date_gmt: '2012-02-06 19:47:20 -0500' categories: - ".NET" tags: - meta-programming - Unit Testing - csharp ---
Switching back and forth between Java and .NET lets you see some of the differences between the two platforms more easily. This happened to me the other day when I switched from Java to .NET and was writing Unit Tests. In Java, the access modifiers include public, private, protected and default. In C# they are public, private, protected and internal. In general, the public, private access modifiers are very similar. Protected is slightly different in that Java allows both derived classes as well as classes in the same package to access those elements where C# only allows derived classes to access them. Where things diverge more is in the default/internal differences. Default in java restricts access to the same package while internal in C# restricts access to the same Assembly (generally a single DLL).
What does this have to do with testing you might ask?
It's a good OO design principle to expose only those things that are part of the contract to a class or package and to leave the implementation hidden as much as possible. This is called encapsulation. You can make methods private or default/internal. You can make entire classes default/internal and only publicly expose an interface that clients need to use.
A common practice in the Java world is to mimic the package layout of your main source code in your test code. When you mimic that layout then your test classes and implementation classes end up being in the same packages. Because of this your test classes can access all those default members to test them. In C# because it's not based on a namespace, but rather an Assembly this doesn't work.
Luckily there's an easy workaround.
In the AssemblyInfo.cs of your main project add:
{% highlight csharp %} [assembly: InternalsVisibleTo("someOther.AssemblyName.Test")] {% endhighlight %}Where SomeOther.AssemblyName.Test is the name of the Assembly that contains your tests for the target assembly. Then the test code can access internal details of the assembly. And you can easily test the things that other calling code might not have access to.


Openhack 2018 - Catch22
Name
Phone number
We will use your phone number to transmit you information
Address
Amount of water
Comment
Submit


HOME
FORM
AKAN NAME GENERATOR
Welcome!
Akan names are derived from Ghanian culture. Frequently in Ghana,children are given their first name as a 'day name' which corresponds to the day in the week they were born.Provide you details below to find your Akan name.
Year of Birth:
Month of Birth:
Date of Birth:
Gender
Male
Female
Get Name


Shogi Bot recognizes vague descriptions. Each section is optional and case-insensitive. The notation order does not matter except Origin (must be before Destination) and Promotion (must be at the end).
The simplest way to text your move is just to put a destination. Western, Japanese, and CSA notations are acceptable.
If your notation is ambiguous, additional choice buttons will show up.
You can omit this notation if your destination is the same as the preceding piece.
To resolve ambiguity, you can also include the coordinate of the origin. The notation is same as Destination. This part must be before Destination.
Shogi Bot accepts both Western, CSA, and other common notations.
You can specify a promotion flag at the end of your text.


This document describes the API to Jinja2 and not the template language. It will be most useful as reference to those implementing the template interface to the application and not those who are creating Jinja2 templates.
Jinja2 uses a central object called the template Environment. Instances of this class are used to store the configuration, global objects and are used to load templates from the file system or other locations. Even if you are creating templates from strings by using the constructor of Template class, an environment is created automatically for you, albeit a shared one.
Most applications will create one Environment object on application initialization and use that to load templates. In some cases it’s however useful to have multiple environments side by side, if different configurations are in use.
The simplest way to configure Jinja2 to load templates for your application looks roughly like this:
from jinja2 import Environment, PackageLoader
env = Environment(loader=PackageLoader('yourapplication', 'templates'))
This will create a template environment with the default settings and a loader that looks up the templates in the templates folder inside the yourapplication python package. Different loaders are available and you can also write your own if you want to load templates from a database or other resources.
To load a template from this environment you just have to call the get_template() method which then returns the loaded Template:
template = env.get_template('mytemplate.html')
To render it with some variables, just call the render() method:
print template.render(the='variables', go='here')
Using a template loader rather then passing strings to Template or Environment.from_string() has multiple advantages. Besides being a lot easier to use it also enables template inheritance.
Jinja2 is using Unicode internally which means that you have to pass Unicode objects to the render function or bytestrings that only consist of ASCII characters. Additionally newlines are normalized to one end of line sequence which is per default UNIX style (\n).
Python 2.x supports two ways of representing string objects. One is the str type and the other is the unicode type, both of which extend a type called basestring. Unfortunately the default is str which should not be used to store text based information unless only ASCII characters are used. With Python 2.6 it is possible to make unicode the default on a per module level and with Python 3 it will be the default.
To explicitly use a Unicode string you have to prefix the string literal with a u: u'Hänsel und Gretel sagen Hallo'. That way Python will store the string as Unicode by decoding the string with the character encoding from the current Python module. If no encoding is specified this defaults to ‘ASCII’ which means that you can’t use any non ASCII identifier.
To set a better module encoding add the following comment to the first or second line of the Python module using the Unicode literal:
# -*- coding: utf-8 -*-
We recommend utf-8 as Encoding for Python modules and templates as it’s possible to represent every Unicode character in utf-8 and because it’s backwards compatible to ASCII. For Jinja2 the default encoding of templates is assumed to be utf-8.
It is not possible to use Jinja2 to process non-Unicode data. The reason for this is that Jinja2 uses Unicode already on the language level. For example Jinja2 treats the non-breaking space as valid whitespace inside expressions which requires knowledge of the encoding or operating on an Unicode string.
For more details about Unicode in Python have a look at the excellent Unicode documentation.
Another important thing is how Jinja2 is handling string literals in templates. A naive implementation would be using Unicode strings for all string literals but it turned out in the past that this is problematic as some libraries are typechecking against str explicitly. For example datetime.strftime does not accept Unicode arguments. To not break it completely Jinja2 is returning str for strings that fit into ASCII and for everything else unicode:
>>> m = Template(u"{% set a, b = 'foo', 'föö' %}").module
>>> m.a
'foo'
>>> m.b
u'f\xf6\xf6'
The high-level API is the API you will use in the application to load and render Jinja2 templates. The Low Level API on the other side is only useful if you want to dig deeper into Jinja2 or develop extensions.
The core component of Jinja is the Environment. It contains important shared variables like configuration, filters, tests, globals and others. Instances of this class may be modified if they are not shared and if no template was loaded so far. Modifications on environments after the first template was loaded will lead to surprising effects and undefined behavior.
Here the possible initialization parameters:
- block_start_string
- The string marking the begin of a block. Defaults to '{%'.
- block_end_string
- The string marking the end of a block. Defaults to '%}'.
- variable_start_string
- The string marking the begin of a print statement. Defaults to '{{'.
- variable_end_string
- The string marking the end of a print statement. Defaults to '}}'.
- comment_start_string
- The string marking the begin of a comment. Defaults to '{#'.
- comment_end_string
- The string marking the end of a comment. Defaults to '#}'.
- line_statement_prefix
- If given and a string, this will be used as prefix for line based statements. See also Line Statements.
- line_comment_prefix
If given and a string, this will be used as prefix for line based based comments. See also Line Statements.
New in version 2.2.
- trim_blocks
- If this is set to True the first newline after a block is removed (block, not variable tag!). Defaults to False.
- lstrip_blocks
- If this is set to True leading spaces and tabs are stripped from the start of a line to a block. Defaults to False.
- newline_sequence
- The sequence that starts a newline. Must be one of '\r', '\n' or '\r\n'. The default is '\n' which is a useful default for Linux and OS X systems as well as web applications.
- keep_trailing_newline
Preserve the trailing newline when rendering templates. The default is False, which causes a single newline, if present, to be stripped from the end of the template.
New in version 2.7.
- extensions
- List of Jinja extensions to use. This can either be import paths as strings or extension classes. For more information have a look at the extensions documentation.
- optimized
- should the optimizer be enabled? Default is True.
- undefined
- Undefined or a subclass of it that is used to represent undefined values in the template.
- finalize
- A callable that can be used to process the result of a variable expression before it is output. For example one can convert None implicitly into an empty string here.
- autoescape
If set to true the XML/HTML autoescaping feature is enabled by default. For more details about auto escaping see Markup. As of Jinja 2.4 this can also be a callable that is passed the template name and has to return True or False depending on autoescape should be enabled by default.
Changed in version 2.4: autoescape can now be a function
- loader
- The template loader for this environment.
- cache_size
- The size of the cache. Per default this is 50 which means that if more than 50 templates are loaded the loader will clean out the least recently used template. If the cache size is set to 0 templates are recompiled all the time, if the cache size is -1 the cache will not be cleaned.
- auto_reload
- Some loaders load templates from locations where the template sources may change (ie: file system or database). If auto_reload is set to True (default) every time a template is requested the loader checks if the source changed and if yes, it will reload the template. For higher performance it’s possible to disable that.
- bytecode_cache
If set to a bytecode cache object, this object will provide a cache for the internal Jinja bytecode so that templates don’t have to be parsed if they were not changed.
See Bytecode Cache for more information.
If a template was created by using the Template constructor an environment is created automatically. These environments are created as shared environments which means that multiple templates may have the same anonymous environment. For all shared environments this attribute is True, else False.
If the environment is sandboxed this attribute is True. For the sandbox mode have a look at the documentation for the SandboxedEnvironment.
A dict of filters for this environment. As long as no template was loaded it’s safe to add new filters or remove old. For custom filters see Custom Filters. For valid filter names have a look at Notes on Identifiers.
A dict of test functions for this environment. As long as no template was loaded it’s safe to modify this dict. For custom tests see Custom Tests. For valid test names have a look at Notes on Identifiers.
A dict of global variables. These variables are always available in a template. As long as no template was loaded it’s safe to modify this dict. For more details see The Global Namespace. For valid object names have a look at Notes on Identifiers.
Create a new overlay environment that shares all the data with the current environment except of cache and the overridden attributes. Extensions cannot be removed for an overlayed environment. An overlayed environment automatically gets all the extensions of the environment it is linked to plus optional extra extensions.
Creating overlays should happen after the initial environment was set up completely. Not all attributes are truly linked, some are just copied over so modifications on the original environment may not shine through.
Creates a new Undefined object for name. This is useful for filters or functions that may return undefined objects for some operations. All parameters except of hint should be provided as keyword parameters for better readability. The hint is used as error message for the exception if provided, otherwise the error message will be generated from obj and name automatically. The exception provided as exc is raised if something with the generated undefined object is done that the undefined object does not allow. The default exception is UndefinedError. If a hint is provided the name may be ommited.
The most common way to create an undefined object is by providing a name only:
return environment.undefined(name='some_name')
This means that the name some_name is not defined. If the name was from an attribute of an object it makes sense to tell the undefined object the holder object to improve the error message:
if not hasattr(obj, 'attr'):
return environment.undefined(obj=obj, name='attr')
For a more complex example you can provide a hint. For example the first() filter creates an undefined object that way:
return environment.undefined('no first item, sequence was empty')
If it the name or obj is known (for example because an attribute was accessed) it shold be passed to the undefined object, even if a custom hint is provided. This gives undefined objects the possibility to enhance the error message.
Adds an extension after the environment was created.
New in version 2.5.
A handy helper method that returns a callable that accepts keyword arguments that appear as variables in the expression. If called it returns the result of the expression.
This is useful if applications want to use the same rules as Jinja in template “configuration files” or similar situations.
Example usage:
>>> env = Environment()
>>> expr = env.compile_expression('foo == 42')
>>> expr(foo=23)
False
>>> expr(foo=42)
True
Per default the return value is converted to None if the expression returns an undefined value. This can be changed by setting undefined_to_none to False.
>>> env.compile_expression('var')() is None
True
>>> env.compile_expression('var', undefined_to_none=False)()
Undefined
New in version 2.1.
Finds all the templates the loader can find, compiles them and stores them in target. If zip is None, instead of in a zipfile, the templates will be will be stored in a directory. By default a deflate zip algorithm is used, to switch to the stored algorithm, zip can be set to 'stored'.
extensions and filter_func are passed to list_templates(). Each template returned will be compiled to the target folder or zipfile.
By default template compilation errors are ignored. In case a log function is provided, errors are logged. If you want template syntax errors to abort the compilation you can set ignore_errors to False and you will get an exception on syntax errors.
If py_compile is set to True .pyc files will be written to the target instead of standard .py files. This flag does not do anything on pypy and Python 3 where pyc files are not picked up by itself and don’t give much benefit.
New in version 2.4.
Add the items to the instance of the environment if they do not exist yet. This is used by extensions to register callbacks and configuration values without breaking inheritance.
Load a template from a string. This parses the source given and returns a Template object.
Does a typecheck and dispatches to select_template() if an iterable of template names is given, otherwise to get_template().
New in version 2.3.
Load a template from the loader. If a loader is configured this method ask the loader for the template and returns a Template. If the parent parameter is not None, join_path() is called to get the real template name before loading.
The globals parameter can be used to provide template wide globals. These variables are available in the context at render time.
If the template does not exist a TemplateNotFound exception is raised.
Changed in version 2.4: If name is a Template object it is returned from the function unchanged.
Join a template with the parent. By default all the lookups are relative to the loader root so this method returns the template parameter unchanged, but if the paths should be relative to the parent template, this function can be used to calculate the real template name.
Subclasses may override this method and implement template path joining here.
Returns a list of templates for this environment. This requires that the loader supports the loader’s list_templates() method.
If there are other files in the template folder besides the actual templates, the returned list can be filtered. There are two ways: either extensions is set to a list of file extensions for templates, or a filter_func can be provided which is a callable that is passed a template name and should return True if it should end up in the result list.
If the loader does not support that, a TypeError is raised.
New in version 2.4.
Works like get_template() but tries a number of templates before it fails. If it cannot find any of the templates, it will raise a TemplatesNotFound exception.
New in version 2.3.
Changed in version 2.4: If names contains a Template object it is returned from the function unchanged.
The central template object. This class represents a compiled template and is used to evaluate it.
Normally the template object is generated from an Environment but it also has a constructor that makes it possible to create a template instance directly using the constructor. It takes the same arguments as the environment constructor but it’s not possible to specify a loader.
Every template object has a few methods and members that are guaranteed to exist. However it’s important that a template object should be considered immutable. Modifications on the object are not supported.
Template objects created from the constructor rather than an environment do have an environment attribute that points to a temporary environment that is probably shared with other templates created with the constructor and compatible settings.
>>> template = Template('Hello {{ name }}!')
>>> template.render(name='John Doe')
u'Hello John Doe!'
>>> stream = template.stream(name='John Doe')
>>> stream.next()
u'Hello John Doe!'
>>> stream.next()
Traceback (most recent call last):
...
StopIteration
The dict with the globals of that template. It’s unsafe to modify this dict as it may be shared with other templates or the environment that loaded the template.
The loading name of the template. If the template was loaded from a string this is None.
The filename of the template on the file system if it was loaded from there. Otherwise this is None.
This method accepts the same arguments as the dict constructor: A dict, a dict subclass or some keyword arguments. If no arguments are given the context will be empty. These two calls do the same:
template.render(knights='that say nih')
template.render({'knights': 'that say nih'})
This will return the rendered template as unicode string.
For very large templates it can be useful to not render the whole template at once but evaluate each statement after another and yield piece for piece. This method basically does exactly that and returns a generator that yields one item after another as unicode strings.
It accepts the same arguments as render().
Works exactly like generate() but returns a TemplateStream.
This method works like the module attribute when called without arguments but it will evaluate the template on every call rather than caching it. It’s also possible to provide a dict which is then used as context. The arguments are the same as for the new_context() method.
The template as module. This is used for imports in the template runtime but is also useful if one wants to access exported template variables from the Python layer:
>>> t = Template('{% macro foo() %}42{% endmacro %}23')
>>> unicode(t.module)
u'23'
>>> t.module.foo()
u'42'
A template stream works pretty much like an ordinary python generator but it can buffer multiple items to reduce the number of total iterations. Per default the output is unbuffered which means that for every unbuffered instruction in the template one unicode string is yielded.
If buffering is enabled with a buffer size of 5, five items are combined into a new unicode string. This is mainly useful if you are streaming big templates to a client via WSGI which flushes after each iteration.
New in version 2.4.
As of Jinja 2.4 the preferred way to do autoescaping is to enable the Autoescape Extension and to configure a sensible default for autoescaping. This makes it possible to enable and disable autoescaping on a per-template basis (HTML versus text for instance).
Here a recommended setup that enables autoescaping for templates ending in '.html', '.htm' and '.xml' and disabling it by default for all other extensions:
def guess_autoescape(template_name):
if template_name is None or '.' not in template_name:
return False
ext = template_name.rsplit('.', 1)[1]
return ext in ('html', 'htm', 'xml')
env = Environment(autoescape=guess_autoescape,
loader=PackageLoader('mypackage'),
extensions=['jinja2.ext.autoescape'])
When implementing a guessing autoescape function, make sure you also accept None as valid template name. This will be passed when generating templates from strings.
Inside the templates the behaviour can be temporarily changed by using the autoescape block (see Autoescape Extension).
Jinja2 uses the regular Python 2.x naming rules. Valid identifiers have to match [a-zA-Z_][a-zA-Z0-9_]*. As a matter of fact non ASCII characters are currently not allowed. This limitation will probably go away as soon as unicode identifiers are fully specified for Python 3.
Filters and tests are looked up in separate namespaces and have slightly modified identifier syntax. Filters and tests may contain dots to group filters and tests by topic. For example it’s perfectly valid to add a function into the filter dict and call it to.unicode. The regular expression for filter and test identifiers is [a-zA-Z_][a-zA-Z0-9_]*(\.[a-zA-Z_][a-zA-Z0-9_]*)*`.
These classes can be used as undefined types. The Environment constructor takes an undefined parameter that can be one of those classes or a custom subclass of Undefined. Whenever the template engine is unable to look up a name or access an attribute one of those objects is created and returned. Some operations on undefined values are then allowed, others fail.
The closest to regular Python behavior is the StrictUndefined which disallows all operations beside testing if it’s an undefined object.
The default undefined type. This undefined type can be printed and iterated over, but every other access will raise an UndefinedError:
>>> foo = Undefined(name='foo')
>>> str(foo)
''
>>> not foo
True
>>> foo + 42
Traceback (most recent call last):
...
UndefinedError: 'foo' is undefined
Either None or an unicode string with the error message for the undefined object.
Either None or the owner object that caused the undefined object to be created (for example because an attribute does not exist).
The name for the undefined variable / attribute or just None if no such information exists.
The exception that the undefined object wants to raise. This is usually one of UndefinedError or SecurityError.
When called with any arguments this method raises _undefined_exception with an error message generated from the undefined hints stored on the undefined object.
An undefined that returns the debug info when printed.
>>> foo = DebugUndefined(name='foo')
>>> str(foo)
'{{ foo }}'
>>> not foo
True
>>> foo + 42
Traceback (most recent call last):
...
UndefinedError: 'foo' is undefined
An undefined that barks on print and iteration as well as boolean tests and all kinds of comparisons. In other words: you can do nothing with it except checking if it’s defined using the defined test.
>>> foo = StrictUndefined(name='foo')
>>> str(foo)
Traceback (most recent call last):
...
UndefinedError: 'foo' is undefined
>>> not foo
Traceback (most recent call last):
...
UndefinedError: 'foo' is undefined
>>> foo + 42
Traceback (most recent call last):
...
UndefinedError: 'foo' is undefined
Undefined objects are created by calling undefined.
Implementation
Undefined objects are implemented by overriding the special __underscore__ methods. For example the default Undefined class implements __unicode__ in a way that it returns an empty string, however __int__ and others still fail with an exception. To allow conversion to int by returning 0 you can implement your own:
class NullUndefined(Undefined):
def __int__(self):
return 0
def __float__(self):
return 0.0
To disallow a method, just override it and raise _undefined_exception. Because this is a very common idom in undefined objects there is the helper method _fail_with_undefined_error() that does the error raising automatically. Here a class that works like the regular Undefined but chokes on iteration:
class NonIterableUndefined(Undefined):
__iter__ = Undefined._fail_with_undefined_error
The template context holds the variables of a template. It stores the values passed to the template and also the names the template exports. Creating instances is neither supported nor useful as it’s created automatically at various stages of the template evaluation and should not be created by hand.
The context is immutable. Modifications on parent must not happen and modifications on vars are allowed from generated template code only. Template filters and global functions marked as contextfunction()s get the active context passed as first argument and are allowed to access the context read-only.
The template context supports read only dict operations (get, keys, values, items, iterkeys, itervalues, iteritems, __getitem__, __contains__). Additionally there is a resolve() method that doesn’t fail with a KeyError but returns an Undefined object for missing variables.
A dict of read only, global variables the template looks up. These can either come from another Context, from the Environment.globals or Template.globals or points to a dict created by combining the globals with the variables passed to the render function. It must not be altered.
The template local variables. This list contains environment and context functions from the parent scope as well as local modifications and exported variables from the template. The template will modify this dict during template evaluation but filters and context functions are not allowed to modify it.
The environment that loaded the template.
This set contains all the names the template exports. The values for the names are in the vars dict. In order to get a copy of the exported variables as dict, get_exported() can be used.
The load name of the template owning this context.
A dict with the current mapping of blocks in the template. The keys in this dict are the names of the blocks, and the values a list of blocks registered. The last item in each list is the current active block (latest in the inheritance chain).
The current Evaluation Context.
Call the callable with the arguments and keyword arguments provided but inject the active context or environment as first argument if the callable is a contextfunction() or environmentfunction().
Implementation
Context is immutable for the same reason Python’s frame locals are immutable inside functions. Both Jinja2 and Python are not using the context / frame locals as data storage for variables but only as primary data source.
When a template accesses a variable the template does not define, Jinja2 looks up the variable in the context, after that the variable is treated as if it was defined in the template.
Loaders are responsible for loading templates from a resource such as the file system. The environment will keep the compiled modules in memory like Python’s sys.modules. Unlike sys.modules however this cache is limited in size by default and templates are automatically reloaded. All loaders are subclasses of BaseLoader. If you want to create your own loader, subclass BaseLoader and override get_source.
Baseclass for all loaders. Subclass this and override get_source to implement a custom loading mechanism. The environment provides a get_template method that calls the loader’s load method to get the Template object.
A very basic example for a loader that looks up templates on the file system could look like this:
from jinja2 import BaseLoader, TemplateNotFound
from os.path import join, exists, getmtime
class MyLoader(BaseLoader):
def __init__(self, path):
self.path = path
def get_source(self, environment, template):
path = join(self.path, template)
if not exists(path):
raise TemplateNotFound(template)
mtime = getmtime(path)
with file(path) as f:
source = f.read().decode('utf-8')
return source, path, lambda: mtime == getmtime(path)
Get the template source, filename and reload helper for a template. It’s passed the environment and template name and has to return a tuple in the form (source, filename, uptodate) or raise a TemplateNotFound error if it can’t locate the template.
The source part of the returned tuple must be the source of the template as unicode string or a ASCII bytestring. The filename should be the name of the file on the filesystem if it was loaded from there, otherwise None. The filename is used by python for the tracebacks if no loader extension is used.
The last item in the tuple is the uptodate function. If auto reloading is enabled it’s always called to check if the template changed. No arguments are passed so the function must store the old state somewhere (for example in a closure). If it returns False the template will be reloaded.
Loads a template. This method looks up the template in the cache or loads one by calling get_source(). Subclasses should not override this method as loaders working on collections of other loaders (such as PrefixLoader or ChoiceLoader) will not call this method but get_source directly.
Here a list of the builtin loaders Jinja2 provides:
Loads templates from the file system. This loader can find templates in folders on the file system and is the preferred way to load them.
The loader takes the path to the templates as string, or if multiple locations are wanted a list of them which is then looked up in the given order:
>>> loader = FileSystemLoader('/path/to/templates')
>>> loader = FileSystemLoader(['/path/to/templates', '/other/path'])
Per default the template encoding is 'utf-8' which can be changed by setting the encoding parameter to something else.
Load templates from python eggs or packages. It is constructed with the name of the python package and the path to the templates in that package:
loader = PackageLoader('mypackage', 'views')
If the package path is not given, 'templates' is assumed.
Per default the template encoding is 'utf-8' which can be changed by setting the encoding parameter to something else. Due to the nature of eggs it’s only possible to reload templates if the package was loaded from the file system and not a zip file.
Loads a template from a python dict. It’s passed a dict of unicode strings bound to template names. This loader is useful for unittesting:
>>> loader = DictLoader({'index.html': 'source here'})
Because auto reloading is rarely useful this is disabled per default.
A loader that is passed a function which does the loading. The function becomes the name of the template passed and has to return either an unicode string with the template source, a tuple in the form (source, filename, uptodatefunc) or None if the template does not exist.
>>> def load_template(name):
... if name == 'index.html':
... return '...'
...
>>> loader = FunctionLoader(load_template)
The uptodatefunc is a function that is called if autoreload is enabled and has to return True if the template is still up to date. For more details have a look at BaseLoader.get_source() which has the same return value.
A loader that is passed a dict of loaders where each loader is bound to a prefix. The prefix is delimited from the template by a slash per default, which can be changed by setting the delimiter argument to something else:
loader = PrefixLoader({
'app1': PackageLoader('mypackage.app1'),
'app2': PackageLoader('mypackage.app2')
})
By loading 'app1/index.html' the file from the app1 package is loaded, by loading 'app2/index.html' the file from the second.
This loader works like the PrefixLoader just that no prefix is specified. If a template could not be found by one loader the next one is tried.
>>> loader = ChoiceLoader([
... FileSystemLoader('/path/to/user/templates'),
... FileSystemLoader('/path/to/system/templates')
... ])
This is useful if you want to allow users to override builtin templates from a different location.
This loader loads templates from precompiled templates.
Example usage:
>>> loader = ChoiceLoader([
... ModuleLoader('/path/to/compiled/templates'),
... FileSystemLoader('/path/to/templates')
... ])
Templates can be precompiled with Environment.compile_templates().
Jinja 2.1 and higher support external bytecode caching. Bytecode caches make it possible to store the generated bytecode on the file system or a different location to avoid parsing the templates on first use.
This is especially useful if you have a web application that is initialized on the first request and Jinja compiles many templates at once which slows down the application.
To use a bytecode cache, instanciate it and pass it to the Environment.
To implement your own bytecode cache you have to subclass this class and override load_bytecode() and dump_bytecode(). Both of these methods are passed a Bucket.
A very basic bytecode cache that saves the bytecode on the file system:
from os import path
class MyCache(BytecodeCache):
def __init__(self, directory):
self.directory = directory
def load_bytecode(self, bucket):
filename = path.join(self.directory, bucket.key)
if path.exists(filename):
with open(filename, 'rb') as f:
bucket.load_bytecode(f)
def dump_bytecode(self, bucket):
filename = path.join(self.directory, bucket.key)
with open(filename, 'wb') as f:
bucket.write_bytecode(f)
A more advanced version of a filesystem based bytecode cache is part of Jinja2.
Clears the cache. This method is not used by Jinja2 but should be implemented to allow applications to clear the bytecode cache used by a particular environment.
Subclasses have to override this method to write the bytecode from a bucket back to the cache. If it unable to do so it must not fail silently but raise an exception.
Subclasses have to override this method to load bytecode into a bucket. If they are not able to find code in the cache for the bucket, it must not do anything.
Buckets are used to store the bytecode for one template. It’s created and initialized by the bytecode cache and passed to the loading functions.
The buckets get an internal checksum from the cache assigned and use this to automatically reject outdated cache material. Individual bytecode cache subclasses don’t have to care about cache invalidation.
The Environment that created the bucket.
The unique cache key for this bucket
The bytecode if it’s loaded, otherwise None.
Builtin bytecode caches:
A bytecode cache that stores bytecode on the filesystem. It accepts two arguments: The directory where the cache items are stored and a pattern string that is used to build the filename.
If no directory is specified a default cache directory is selected. On Windows the user’s temp directory is used, on UNIX systems a directory is created for the user in the system temp directory.
The pattern can be used to have multiple separate caches operate on the same directory. The default pattern is '__jinja2_%s.cache'. %s is replaced with the cache key.
>>> bcc = FileSystemBytecodeCache('/tmp/jinja_cache', '%s.cache')
This bytecode cache supports clearing of the cache using the clear method.
This class implements a bytecode cache that uses a memcache cache for storing the information. It does not enforce a specific memcache library (tummy’s memcache or cmemcache) but will accept any class that provides the minimal interface required.
Libraries compatible with this class:
(Unfortunately the django cache interface is not compatible because it does not support storing binary data, only unicode. You can however pass the underlying cache client to the bytecode cache which is available as django.core.cache.cache._client.)
The minimal interface for the client passed to the constructor is this:
Stores the bytecode in the cache. value is a string and timeout the timeout of the key. If timeout is not provided a default timeout or no timeout should be assumed, if it’s provided it’s an integer with the number of seconds the cache item should exist.
Returns the value for the cache key. If the item does not exist in the cache the return value must be None.
The other arguments to the constructor are the prefix for all keys that is added before the actual cache key and the timeout for the bytecode in the cache system. We recommend a high (or no) timeout.
This bytecode cache does not support clearing of used items in the cache. The clear method is a no-operation function.
New in version 2.7: Added support for ignoring memcache errors through the ignore_memcache_errors parameter.
These helper functions and classes are useful if you add custom filters or functions to a Jinja2 environment.
Decorator for marking evironment dependent filters. The current Environment is passed to the filter as first argument.
Decorator for marking context dependent filters. The current Context will be passed as first argument.
Decorator for marking eval-context dependent filters. An eval context object is passed as first argument. For more information about the eval context, see Evaluation Context.
New in version 2.4.
This decorator can be used to mark a function or method as environment callable. This decorator works exactly like the contextfunction() decorator just that the first argument is the active Environment and not context.
This decorator can be used to mark a function or method context callable. A context callable is passed the active Context as first argument when called from the template. This is useful if a function wants to get access to the context or functions provided on the context object. For example a function that returns a sorted list of template variables the current template exports could look like this:
@contextfunction
def get_exported_names(context):
return sorted(context.exported_vars)
This decorator can be used to mark a function or method as an eval context callable. This is similar to the contextfunction() but instead of passing the context, an evaluation context object is passed. For more information about the eval context, see Evaluation Context.
New in version 2.4.
Convert the characters &, <, >, ', and " in string s to HTML-safe sequences. Use this if you need to display text that might contain such characters in HTML. This function will not escaped objects that do have an HTML representation such as already escaped data.
The return value is a Markup string.
Jinja2 keeps internal caches for environments and lexers. These are used so that Jinja2 doesn’t have to recreate environments and lexers all the time. Normally you don’t have to care about that but if you are messuring memory consumption you may want to clean the caches.
Check if the object passed is undefined. This does nothing more than performing an instance check against Undefined but looks nicer. This can be used for custom filters or tests that want to react to undefined variables. For example a custom default filter can look like this:
def default(var, default=''):
if is_undefined(var):
return default
return var
Marks a string as being safe for inclusion in HTML/XML output without needing to be escaped. This implements the __html__ interface a couple of frameworks and web applications use. Markup is a direct subclass of unicode and provides all the methods of unicode just that it escapes arguments passed and always returns Markup.
The escape function returns markup objects so that double escaping can’t happen.
The constructor of the Markup class can be used for three different things: When passed an unicode object it’s assumed to be safe, when passed an object with an HTML representation (has an __html__ method) that representation is used, otherwise the object passed is converted into a unicode string and then assumed to be safe:
>>> Markup("Hello <em>World</em>!")
Markup(u'Hello <em>World</em>!')
>>> class Foo(object):
... def __html__(self):
... return '<a href="#">foo</a>'
...
>>> Markup(Foo())
Markup(u'<a href="#">foo</a>')
If you want object passed being always treated as unsafe you can use the escape() classmethod to create a Markup object:
>>> Markup.escape("Hello <em>World</em>!")
Markup(u'Hello <em>World</em>!')
Operations on a markup string are markup aware which means that all arguments are passed through the escape() function:
>>> em = Markup("<em>%s</em>")
>>> em % "foo & bar"
Markup(u'<em>foo & bar</em>')
>>> strong = Markup("<strong>%(text)s</strong>")
>>> strong % {'text': '<blink>hacker here</blink>'}
Markup(u'<strong><blink>hacker here</blink></strong>')
>>> Markup("<em>Hello</em> ") + "<foo>"
Markup(u'<em>Hello</em> <foo>')
Escape the string. Works like escape() with the difference that for subclasses of Markup this function would return the correct subclass.
Unescape markup into an unicode string and strip all tags. This also resolves known HTML4 and XHTML entities. Whitespace is normalized to one:
>>> Markup("Main » <em>About</em>").striptags()
u'Main \xbb About'
Unescape markup again into an unicode string. This also resolves known HTML4 and XHTML entities:
>>> Markup("Main » <em>About</em>").unescape()
u'Main \xbb <em>About</em>'
Note
The Jinja2 Markup class is compatible with at least Pylons and Genshi. It’s expected that more template engines and framework will pick up the __html__ concept soon.
Baseclass for all template errors.
Raised if a template does not exist.
Like TemplateNotFound but raised if multiple templates are selected. This is a subclass of TemplateNotFound exception, so just catching the base exception will catch both.
New in version 2.2.
Raised to tell the user that there is a problem with the template.
The error message as utf-8 bytestring.
The line number where the error occurred
The load name for the template as unicode string.
The filename that loaded the template as bytestring in the encoding of the file system (most likely utf-8 or mbcs on Windows systems).
The reason why the filename and error message are bytestrings and not unicode strings is that Python 2.x is not using unicode for exceptions and tracebacks as well as the compiler. This will change with Python 3.
Like a template syntax error, but covers cases where something in the template caused an error at compile time that wasn’t necessarily caused by a syntax error. However it’s a direct subclass of TemplateSyntaxError and has the same attributes.
Custom filters are just regular Python functions that take the left side of the filter as first argument and the the arguments passed to the filter as extra arguments or keyword arguments.
For example in the filter {{ 42|myfilter(23) }} the function would be called with myfilter(42, 23). Here for example a simple filter that can be applied to datetime objects to format them:
def datetimeformat(value, format='%H:%M / %d-%m-%Y'):
return value.strftime(format)
You can register it on the template environment by updating the filters dict on the environment:
environment.filters['datetimeformat'] = datetimeformat
Inside the template it can then be used as follows:
written on: {{ article.pub_date|datetimeformat }}
publication date: {{ article.pub_date|datetimeformat('%d-%m-%Y') }}
Filters can also be passed the current template context or environment. This is useful if a filter wants to return an undefined value or check the current autoescape setting. For this purpose three decorators exist: environmentfilter(), contextfilter() and evalcontextfilter().
Here a small example filter that breaks a text into HTML line breaks and paragraphs and marks the return value as safe HTML string if autoescaping is enabled:
import re
from jinja2 import evalcontextfilter, Markup, escape
_paragraph_re = re.compile(r'(?:\r\n|\r|\n){2,}')
@evalcontextfilter
def nl2br(eval_ctx, value):
result = u'\n\n'.join(u'<p>%s</p>' % p.replace('\n', '<br>\n')
for p in _paragraph_re.split(escape(value)))
if eval_ctx.autoescape:
result = Markup(result)
return result
Context filters work the same just that the first argument is the current active Context rather then the environment.
The evaluation context (short eval context or eval ctx) is a new object introducted in Jinja 2.4 that makes it possible to activate and deactivate compiled features at runtime.
Currently it is only used to enable and disable the automatic escaping but can be used for extensions as well.
In previous Jinja versions filters and functions were marked as environment callables in order to check for the autoescape status from the environment. In new versions it’s encouraged to check the setting from the evaluation context instead.
Previous versions:
@environmentfilter
def filter(env, value):
result = do_something(value)
if env.autoescape:
result = Markup(result)
return result
In new versions you can either use a contextfilter() and access the evaluation context from the actual context, or use a evalcontextfilter() which directly passes the evaluation context to the function:
@contextfilter
def filter(context, value):
result = do_something(value)
if context.eval_ctx.autoescape:
result = Markup(result)
return result
@evalcontextfilter
def filter(eval_ctx, value):
result = do_something(value)
if eval_ctx.autoescape:
result = Markup(result)
return result
The evaluation context must not be modified at runtime. Modifications must only happen with a nodes.EvalContextModifier and nodes.ScopedEvalContextModifier from an extension, not on the eval context object itself.
Holds evaluation time information. Custom attributes can be attached to it in extensions.
True or False depending on if autoescaping is active or not.
True if the compiler cannot evaluate some expressions at compile time. At runtime this should always be False.
Tests work like filters just that there is no way for a test to get access to the environment or context and that they can’t be chained. The return value of a test should be True or False. The purpose of a test is to give the template designers the possibility to perform type and conformability checks.
Here a simple test that checks if a variable is a prime number:
import math
def is_prime(n):
if n == 2:
return True
for i in xrange(2, int(math.ceil(math.sqrt(n))) + 1):
if n % i == 0:
return False
return True
You can register it on the template environment by updating the tests dict on the environment:
environment.tests['prime'] = is_prime
A template designer can then use the test like this:
{% if 42 is prime %}
42 is a prime number
{% else %}
42 is not a prime number
{% endif %}
Variables stored in the Environment.globals dict are special as they are available for imported templates too, even if they are imported without context. This is the place where you can put variables and functions that should be available all the time. Additionally Template.globals exist that are variables available to a specific template that are available to all render() calls.
The low level API exposes functionality that can be useful to understand some implementation details, debugging purposes or advanced extension techniques. Unless you know exactly what you are doing we don’t recommend using any of those.
Lex the given sourcecode and return a generator that yields tokens as tuples in the form (lineno, token_type, value). This can be useful for extension development and debugging templates.
This does not perform preprocessing. If you want the preprocessing of the extensions to be applied you have to filter source through the preprocess() method.
Parse the sourcecode and return the abstract syntax tree. This tree of nodes is used by the compiler to convert the template into executable source- or bytecode. This is useful for debugging or to extract information from templates.
If you are developing Jinja2 extensions this gives you a good overview of the node tree generated.
Preprocesses the source with all extensions. This is automatically called for all parsing and compiling methods but not for lex() because there you usually only want the actual source tokenized.
Create a new Context for this template. The vars provided will be passed to the template. Per default the globals are added to the context. If shared is set to True the data is passed as it to the context without adding the globals.
locals can be a dict of local variables for internal usage.
This is the low level render function. It’s passed a Context that has to be created by new_context() of the same template or a compatible template. This render function is generated by the compiler from the template code and returns a generator that yields unicode strings.
If an exception in the template code happens the template engine will not rewrite the exception but pass through the original one. As a matter of fact this function should only be called from within a render() / generate() / stream() call.
A dict of block render functions. Each of these functions works exactly like the root_render_func() with the same limitations.
This attribute is False if there is a newer version of the template available, otherwise True.
Note
The low-level API is fragile. Future Jinja2 versions will try not to change it in a backwards incompatible way but modifications in the Jinja2 core may shine through. For example if Jinja2 introduces a new AST node in later versions that may be returned by parse().
New in version 2.2.
The meta API returns some information about abstract syntax trees that could help applications to implement more advanced template concepts. All the functions of the meta API operate on an abstract syntax tree as returned by the Environment.parse() method.
Returns a set of all variables in the AST that will be looked up from the context at runtime. Because at compile time it’s not known which variables will be used depending on the path the execution takes at runtime, all variables are returned.
>>> from jinja2 import Environment, meta
>>> env = Environment()
>>> ast = env.parse('{% set foo = 42 %}{{ bar + foo }}')
>>> meta.find_undeclared_variables(ast)
set(['bar'])
Implementation
Internally the code generator is used for finding undeclared variables. This is good to know because the code generator might raise a TemplateAssertionError during compilation and as a matter of fact this function can currently raise that exception as well.
Finds all the referenced templates from the AST. This will return an iterator over all the hardcoded template extensions, inclusions and imports. If dynamic inheritance or inclusion is used, None will be yielded.
>>> from jinja2 import Environment, meta
>>> env = Environment()
>>> ast = env.parse('{% extends "layout.html" %}{% include helper %}')
>>> list(meta.find_referenced_templates(ast))
['layout.html', None]
This function is useful for dependency tracking. For example if you want to rebuild parts of the website after a layout template has changed.


Fuze
"Quote"
Counters
Ash
Her high speed and rush tendencies create an opportunity to catch her in your traps.
Countered By
Mute
When muted unable to deploy fuze charges.
JÄger
When muted unable to deploy fuze charges.
Time To Play
Thatcher
Don't Play When
Hostage. No, just don't.


Your partner's first name is required.
Your partner's last name is required.
Your partner's email is required.
Your partner's phone is required.
Your partner's handicap is required.


Narendra Modi
Indian Prime-minister who changed the global diplomacy
Here's a time line of Narendra Modi:
- 1950 - Born in Vadnagar, Bombay State, India.
- 1968 - Leaves his family and went to the Ramakrishna Ashram in Almora.
- 1970 - Lived with his uncle, working in the latter's canteen at the Gujarat State Road Transport Corporation
- 1971 - Became a full-time pracharak (campaigner) for the RSS
- 1978 - Received a Bachelor of Arts degree in political science from School of Open Learning at University of Delhi
- 1983 - Received a Master of Arts degree in political science from Gujarat University.
- 1985 - Was assigned by the RSS to the BJP in 1985
- 1987 - Helped organise the BJP's campaign in the Ahmedabad municipal election, which the BJP won comfortably.
- 1990 - Named a member of the BJP's National Election Committee
- 1995 - Appointed as National Secretary of BJP.
- 1998 - Appointed as BJP General Secretary.
- 2001 - Became Chief Minister of Gujarat
- 2002 - Won By-Elections in Gujarat and Second Term of Chief Ministerof Gujarat. Also Gujarat Riots happened.
- 2007 - Third term of Gujarat Chief Minister
- 2012 - Fourth Term of Gujarat Chief Minister
- 2014 - Became 14th Prime Minister of Republic of India
- 2019 - Second Term as Prime Minister of Republic of India
"Modi was ranked fifth on Fortune Magazine's first annual list of the "World's Greatest Leaders" in 2015"
-- Fortune Magazine