Dec 11, 2019
Dark Patterns
A web-based game that explores the dark side of user experience design. Play it here.
Each level is themed; the first is startup-flavored.
Here's an example of a dark pattern: hiding the option for a free version of a plan below the fold so it's hidden by default and takes extra effort to find.
Another comes from the confusing and intentionally misleading heading and content language that's opposite of what you'd expect.
The second level is Amazon-themed, with the goal being to close your account.
This is an archived page. Find recent projects on my website


Acute Care hospitals have been split into four categories depending on the availibility of data:
- the inpatient Medicare dataset which discloses the average charges at the DRG level.
- the average spending per Medicare patient dataset
In all four models, the following variables have been used:
- the diagnostic (DRG),
- the Hospital Reference Region (HRR),
- hospital ownership,
- the average aggregated gross income and the average wage at the county level,
- some demographic variables: the percentage of over 65 year old people,
the percentage of African Americans and the percentage of Hispanics.


Generates uniform and rectilinear fields using Thin Plate Spline.
Input Ports
Name Type Description coord float[...][2] locations of 2D input points values float[...] values of input points Parameters
Name Type Description UI Control smooth float 'smoothness' of resultant field UIslider dims int[2] dimensions of uniform field X & Y UIsliders add_points int number of interpolated points UIslider Output Ports
Name Type Description out_fld Field uniform or rectilinear output field out_obj DataObject directly renderable output object
The tps_unif and tps_rect macro use the Thin Plate Spline algorithm to generate 2D uniform and rectilinear fields from a set of points and values. The interpolation calculated by the Thin Plate Spline algorithm passes exactly through all the input points. However the output grid only respects the input points in the case of a rectilinear grid with a 'smoothness' of 0. The tps_unif macro generates a uniform output field while the tps_rect macro generates a rectilinear output field. A user interface is provided that allows the 'smoothness' and detail of the resultant field data to be specified.
coord[..][2]
Coordinates of the points that are to be used to generate the resulting grid. This float array should consist of a series of x,y coordinate pairs. It is not possible to use 3D coordinates. If a rectilinear grid is being generated and the smoothness is set to zero then output points will be present at all of these coordinates.
values[..]
Value of the input variable at the input coordinates. This float array should match the coordinate input array.
smooth
A member of the TPS_Params parameter block group, this float value is used to specify the 'smoothness' of the resulting surface. If the smoothness is set to zero then in a rectilinear field output nodes will be present at all of the input points.
dims[2]
A member of the TPS_Params parameter block group, this int array is used by the tps_unif macro to specify the x and y dimensions of the resultant uniform grid. It is not used by the tps_rect macro.
add_points
A member of the TPS_Params parameter block group, this int value is used by the tps_rect macro to specify how many points should be added in between each of the input points. Increasing this value will improve the accuracy of the resultant field. It is not used by the tps_unif macro.
out_fld
The output field of the tps_unif and tps_rect macros. This contains the interpolated grid generated from the input points and values by the Thin Plate Spline algorithm. The data is represented as a AVS field. The tps_unif macro generates a uniform output field, while the tps_rect macro generates a rectilinear output field.
out_obj
The directly renderable output of the tps_unif and tps_rect macros. This contains a DataObject object that can be rendered by the standard data viewers. The output object will contain a uniform or rectilinear field as appropriate.
The User Macro tps_unif combines the Functional Macro TPS_unif with the UI Macro TPS_unifUI. The User Macro tps_rect combines the Functional Macro TPS_rect with the UI Macro TPS_rectUI. Both of the user macros also make use of the common parameter block TPS_Params to tie the Functional Macro and UI macro together.
Two example applications are provided, TPS_uniform_Eg and TPS_rectilinear_Eg which generate uniform and rectilinear grids from a set of points. In both cases the grid is then converted into a field and expanded into 3 dimensions by using the surf_plot module. This is done to make the effect of the Thin Plate Spline easier to see.
xp_comm_proj/tpspline/tps_macs.v contains the V definitions of the Functional Macros TPS_unif and TPS_rect, the User Macros tps_unif and tps_rect, the UI Macros TPS_unifUI and TPS_rectUI and the Example Applications TPS_uniform_Eg and TPS_rectilinear_Eg. It also contains two base objects, TPS_baseUI and TPS_base_Eg.
The ThinPlateSplineMacs library inherits its process. As this library contains no procedural code, the process is not important. The modules in the low-level ThinPlateSpline library execute under the process specified in that library, not the process defined in the high-level library.
The Thin Plate Spline implementation is based upon the code written by Dave Eberly. More information can be found on the Magic Software home page. The original code can be found on the interpolation page.
Mario Valle
Andrew Dodd
TPS_Params, TPS_unif, TPS_rect, tps_unif, tps_rect, TPS_baseUI, TPS_unifUI, TPS_rectUI, TPS_baseEg, TPS_uniform_Eg, TPS_rectilinear_Eg.


Seek the Name, Seek the Fame
问题描述 :
The little cat is so famous, that many couples tramp over hill and dale to Byteland, and asked the little cat to give names to their newly-born babies. They seek the name, and at the same time seek the fame. In order to escape from such boring job, the innovative little cat works out an easy but fantastic algorithm:
Step1. Connect the father’s name and the mother’s name, to a new string S.
Step2. Find a proper prefix-suffix string of S (which is not only the prefix, but also the suffix of S).
Example: Father=’ala’, Mother=’la’, we have S = ‘ala’+'la’ = ‘alala’. Potential prefix-suffix strings of S are {‘a’, ‘ala’, ‘alala’}. Given the string S, could you help the little cat to write a program to calculate the length of possible prefix-suffix strings of S? (He might thank you by giving your baby a name:)
输入:
The input contains a number of test cases. Each test case occupies a single line that contains the string S described above.
Restrictions: Only lowercase letters may appear in the input. 1 <= Length of S <= 400000.
输出:
For each test case, output a single line with integer numbers in increasing order, denoting the possible length of the new baby’s name.
样例输入:
ababcababababcabab aaaaa
样例输出:
2 4 9 18 1 2 3 4 5
解题代码:
//* @author: import java.util.*; public class Main{ static final int MAX=400001; static int next[]=new int[MAX]; static int a[]=new int[MAX]; public static void main(String args[]){ int i, j, len, sum; Scanner sc=new Scanner(System.in); while(sc.hasNext()) { String s=sc.next(); len=s.length(); getNext(s); sum = 0; j = len; while(j != 0) { a[++sum] = j; j = next[j]; } for (i = sum; i > 0; i--) System.out.printf("%d ",a[i]); System.out.printf("\n"); } } public static void getNext(String T) {//建立模式串T的next[]表 int i = 0; int j = next[0] = -1; while (i< T.length()) if (0 > j || T.charAt(i) == T.charAt(j)) {//匹配 j++; i++; next[i] = j; }else//失配 j = next[j]; } }
(adsbygoogle = window.adsbygoogle || []).push({});
辛苦了，顶
我想整理一下leetcode的题解，站长能不能给权限
打字员路过。。。。。。算法是啥。。。能干嘛。。。。。。。。能吃么。。哎
正解，应该是200！
第二个方法好！
能不能说下这个是用的什么算法策略？
很好。代码比书上的简练！
bottes vernies blanches
I appreciate the efforts you men and women place in to share blogs on such sort of matters, it was certainly useful. Keep Posting!
int L[m+1][n+1];这样定义出错，这个在gcc上可以编译通过 在VS上不行 应该改为new 或者vector
有的，已更新
5.1处，反了；“上一个操作符的优先级比操作符ch的优先级大，或栈是空的就入栈。”如代码所述，应为“上一个操作符的优先级比操作符ch的优先级小，或栈是空的就入栈。”
给力
很好，注释很详细啊
第一题还有个解释：没说桌子有多大，可以假设桌子和硬币一样大，肯定是先手胜


Electric ferries on the way
by Victoria Times ColonistBC Ferries’ first hybrid-electric ferries are on their way to British Columbia.
The Island Class ships departed Constanta, Romania, on Thursday cradled on a semi-submersible vessel for the 10,305-nautical-mile journey to Vancouver Island.
Damen Shipyards Group, which built the vessels, is also responsible for delivering them.
The transatlantic voyage is expected to take about 40 to 45 days, depending on weather. BC Ferries said in a statement the trip will include one stop for refuelling before or after transiting the Panama Canal.
To load the ships, the transport partially submerges, allowing the two ferries to be gently floated into place. Once in position, the delivery vessel is refloated by pumping water out of its ballast tanks and the cargo is secured. On arrival, the semi-submersible delivery ship will be resubmerged to allow both vessels to float off. The vessels will be manoeuvered by tug to the berths at Point Hope Maritime in Victoria’s harbour.
The vessel can be tracked with course, position and speed at vesselfinder.com. The delivery ship, named Sun Rise, is owned and operated by Pan Ocean.
The Island Class ships are equipped with batteries and designed for full electric operation. BC Ferries said the ships are fitted with hybrid technology that bridges the gap until shore-charging infrastructure becomes available. From the exterior details to the engines, the design of the new vessels reduces underwater radiated noise, lowers emissions and improves customer service.
The Island Class ferries will be deployed on the Powell River-Texada Island and Port McNeill-Alert Bay-Sointula routes by mid-2020.


Enter a search query to find a set of classes to join.
Your query returned no results. Please try again.
Please enter a valid search query.


Baneshwor, Kathmandu, Nepal
01-4450325
<EMAIL_ADDRESS>The Events
Home
About
Services
Bookings
Schedule
LOGIN TO BOOK A SERVICE
Username
Password
LOGIN
SIGN UP NOW!
First Name
Last Name
Email
Username
Password
SIGN UP


compound:ext
: extent and descriptive verb compound
This relation is used for two closely related constructions known in Chinese linguistics as “descriptive complements” and “complements of extent”. We treat them both in the same way with regards to the particles 得 dak1 (for descriptive complements) and 到 dou3 (for extent complements), where the particle is a compound:ext
dependent of the verb it follows (with the idea that the addition of 得 or 到 changes the valence structure of the verb such that it takes a(n additional) clause or secondary predicate as its complement.


Introduction into Angular web framework
Created by Lukasz Sidorkiewicz
Necessary tools:
git clone https://github.com/angular/quickstart.git quickstart cd quickstart npm install npm start
NgModules help organize an application into cohesive blocks of functionality dedicated to a single purpose.
Many Angular libraries are modules.
import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; @NgModule({ imports: [ BrowserModule ], providers: [ Logger ], declarations: [ AppComponent ], exports: [ AppComponent ], bootstrap: [ AppComponent ] }) export class AppModule { }
Every application has at least one module, which is the root module. It is being bootstrapped to launch the whole application.
Dependency Injection is a mechanism which supplies an instance of a class with dependencies it requires. Angular uses it mostly to provide services to new components.
Injector maintains a container of previously created service instances. It can also create new service instances with given provider.
Providers need to be registered in a module (root).
providers: [ FirstService, SecondService ],
@Component({ selector: 'my-selector', templateUrl: './my-selector.component.html', providers: [ FirstService ] })
A component has a lifecycle managed by Angular.
A directive has the same set of lifecycle hooks, minus the hooks that are specific to component content and views.
After creating a component/directive by calling its constructor, Angular calls the lifecycle hook methods
Components are used to control the view.
They are responsible for exposing the data, handling the display and user interaction.
export class MyFirstComponent implements OnInit { books: Book[]; selectedBook: Book; constructor(private service: MyFirstService) { } ngOnInit() { this.books = this.service.getBooks(); } selectBook(book: Book) { this.selectedBook = book; } }
Services are being built for the business logic of application, which is not associated with a specific view, but shared across many components.
Service provides a shared data, logic or encapsulates external interactions.
It should do something specific and do it well.
export class MyService { private someData: SomeData[] = []; constructor( private someService: SomeService) { } getData() { return this.someData; } }
Templates define the view. Via HTML it tells Angular how to render a page.
Defined in a separate template file (templateUrl) or via backticks within the component annotation metadata (template).
@Component({ selector: 'book-shelf', templateUrl: './book-shelf.component.html', // template: Some pure HTML providers: [ MyFirstService ] })
Angular supports data binding, a mechanism for coordinating parts of a template with parts of a component. Binding markups tell Angular how to connect both sides.
There are four ways of data binding:
Angular Forms control data input/changes, performs validation and presents errors.
Forms are based mainly on ngModel, which is not only two-way data binding, but also gives control on the data state and validity. Therefore it updates the control with special Angular CSS classes that reflect the state:
import { FormsModule } from '@angular/forms'; // (...) imports: [ BrowserModule, FormsModule ],
For the data presentation CSS classes, bootstrap is recommended (however not mandatory). These classes are purely cosmetic. Bootstrap gives the form a little style.
Bootstrap stylesheet file needs to be included in HEAD: bootstrap.min.css
HTTP is the primary protocol for browser/server communication.
The Angular HTTP library simplifies application programming with the XHR and JSONP APIs.
import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { FormsModule } from '@angular/forms'; import { HttpModule, JsonpModule } from '@angular/http'; import { AppComponent } from './app.component'; @NgModule({ imports: [BrowserModule, FormsModule, HttpModule, JsonpModule], declarations: [AppComponent], bootstrap: [AppComponent] }) export class AppModule { }
getSomething(url: string): Observable<String>{ return this.http.get(url) .map(this.extractData); } private extractData(res: Response) { let body = res.json(); return body.title || { }; }
this.myService.getMyData()
.subscribe(
myData => this.myData = myData,
error => this.errorMessage =
Navigation between views is performed by Angular Router. It interpretes a browser URL as an instruction, reads optional parameters and navigates both through links and also browser buttons.
It can log not only user's link clicks, but also buttons, form elements or even caused by other responses.
<head> <base href="/"> //first child in the index.html //to tell the router how to compose navigation URLs ... </head>
const appRoutes: Routes = [ { path: 'some-pattern', component: TargetComponent }, { path: '**', component: PageNotFoundComponent } ]; @NgModule({ imports: [ RouterModule.forRoot(appRoutes) // ... ], // ... }) export class AppModule { }


Welcome to Sweden with its beautiful landscapes and its genuine culture.
Sweden is located in north of Europe. Due to its remote location there
are just around 10 million people living in Sweden.
The majority people lives in the south part of Sweden where the major cities are the
capital Stockholm, Gothenburg and Malmo.
In Sweden there are many things to see. In july there are a lot of
popuplar beaches and in the north the sun is up 24 hours per day.
This is due to that northen part of Sweden is located above the pole circle.
In the winter almost all parts of Sweden is covered in white snow.
Then Sweden is very good for skiing and skating.
Some links to Sweden:
Sweden.se
Visit Sweden


--- layout: null section-type: about title: About --- ## About I am Prajith P, Ndimensionz Pvt Ltd is the place where I nurture my knowledge and talent, It is not just a workplace! I have been working here since 2011 as Linux System/Server administrator. I love everything about the web except Windows OS :D. I am passionate about creating new things with Perl and Mojolicious, Moreover, I am interested in computer security and Penetration testing. Want to know more about me? then, here is my geek code(v3.1) .
GCS d- s: a-- C++ UC++++ P++++ L+++ E--- W++ N* o K- w--- O-- M- V- !PS !PE Y+ PGP- t 5? X? R? tv++ b+ DI D? G+ e+ h !r !y(+++)>+(explanation)


public class Setup
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
PROPERTY_ANALYSIS_CLASS
The string representation of the property's key identifying the user-defined analysis main class name.
|
static java.lang.String |
PROPERTY_ANALYSIS_OUTPUT
The string representation of the property's key identifying the user-defined analysis result directory.
|
static java.lang.String |
PROPERTY_CORE_COMMIT_QUEUE_MAX_ELEMENTS
The string representation of the property's key identifying the user-defined maximum number of elements (commits)
in the
CommitQueue . |
static java.lang.String |
PROPERTY_CORE_LOG_LEVEL
The string representation of the property's key identifying the user-defined log level.
|
static java.lang.String |
PROPERTY_CORE_OS
The string representation of the property's key identifying the operating system this tool is currently running
on.
|
static java.lang.String |
PROPERTY_CORE_PLUGINS_DIR
The string representation of the property's key identifying the user-defined path to the directory, in which the
extractor and analyzer plug-ins are located.
|
static java.lang.String |
PROPERTY_CORE_THREADS
The string representation of the property's key identifying the available processors of the machine this tool is
currently running on.
|
static java.lang.String |
PROPERTY_CORE_VERSION_CONTROL_SYSTEM
The string representation of the property's key identifying the user-defined name of target version control
system, e.g., from which the commits will be extracted.
|
static java.lang.String |
PROPERTY_EXTRACTION_CACHING
The string representation of the property's key identifying the user-defined directory for caching extracted
commits.
|
static java.lang.String |
PROPERTY_EXTRACTION_CLASS
The string representation of the property's key identifying the user-defined extractor main class name.
|
static java.lang.String |
PROPERTY_EXTRACTION_COMMIT_LIST
The string representation of the property's key identifying the user-defined commit list file.
|
static java.lang.String |
PROPERTY_EXTRACTION_INPUT
The string representation of the property's key identifying the user-defined repository directory.
|
static java.lang.String |
PROPERTY_EXTRACTION_REUSE
The string representation of the property's key identifying the user-defined directory for reusing cached
commits.
|
public static final java.lang.String PROPERTY_CORE_OS
public static final java.lang.String PROPERTY_CORE_THREADS
public static final java.lang.String PROPERTY_CORE_PLUGINS_DIR
public static final java.lang.String PROPERTY_CORE_VERSION_CONTROL_SYSTEM
public static final java.lang.String PROPERTY_CORE_LOG_LEVEL
public static final java.lang.String PROPERTY_CORE_COMMIT_QUEUE_MAX_ELEMENTS
CommitQueue
. This is an optional property, hence, if not specified, no
further actions are required.public static final java.lang.String PROPERTY_EXTRACTION_CLASS
public static final java.lang.String PROPERTY_EXTRACTION_INPUT
public static final java.lang.String PROPERTY_EXTRACTION_COMMIT_LIST
public static final java.lang.String PROPERTY_EXTRACTION_CACHING
public static final java.lang.String PROPERTY_EXTRACTION_REUSE
public static final java.lang.String PROPERTY_ANALYSIS_CLASS
public static final java.lang.String PROPERTY_ANALYSIS_OUTPUT


Welcome to the Back to Future Trilog Trivia Game! Once you click the begin button below, you'll be asked questions about that range through all three movies. Your score will be displayed once all the questions have been answered. Good Luck!


Redmi 8A now available via open sale in India: Specifications, price, offers
Redmi 8A can be purchased via Mi India’s official website, Mi Home Stores, and Flipkart.
Redmi 8A is now available on open sale in India. The smartphone was launched in September and was available through flash sales via mi.com, Mi Home Stores and Flipkart. Redmi 8A’s key features include a massive battery that supports fast charging via USB Type-C and a Sony IMX363 sensor.
Redmi 8A Price and storage variants
Xiaomi is offering the Redmi 8A in two storage options, 2GB + 32GB and 3GB + 32GB. The base storage starts at Rs 6,499, whereas the 3GB RAM model is priced at Rs 6,999. Both the variants can be bought in three colour options, namely Midnight Black, Ocean Blue, and Sunset Red.
Redmi 8A can be purchased via Mi India’s official website, Mi Home Stores, and Flipkart. Offers include 5 percent instant discount via Flipkart Axis Bank Credit Card, 10 percent discount via Axis Bank Buzz Credit Card.
Redmi 8A specifications
Redmi 8A comes with an all-new Aura Wave Grip design at the back for a better grip and feel. Xiaomi has removed the thick bezels found on Redmi 8A’s predecessor, and the Redmi 8A now has a water-drop notch at the top for the front camera.
The display is 6.22-inch tall and has an HD+ resolution of 720*1520 pixels. Redmi 8A’s screen has a layer of Corning Gorilla Glass 5 for protection against accidental drops and scratches.
Under the hood, Redmi 8A gets powered by a Snapdragon 439 Octa-core processor. The SoC is paired with up to 3GB RAM and 32GB internal memory. Storage can be further expanded using a microSD card up to 512GB.
Redmi 8A comes packed with a 5,000 mAh battery with support for 18W fast-charger. However, the company ships a 10W fast charger inside the box. Redmi 8A is the first smartphone in its segment to offer USB Type-C port for charging.
In terms of optics, Redmi 8A features a single 12MP f/1.8 Sony IMX363 sensor at the rear. The camera comes with a bunch of AI features for enhanced photography. At the front, the Dot notch houses an 8MP camera for selfies, face unlock and video calling.
Connectivity options include 4G LTE, Bluetooth, Wi-Fi, Wireless FM Radio, dual-SIM with a MicroSD slot, 3.5mm headphone jack.Special Thursday Expiry on 10th 7th Nov
Early Closure to The Great Diwali Discount. Last Chance to get Moneycontrol PRO for a year @ Rs. 289/- only
Coupon code: DIWALI


Who we are ?
The Aim of our organisation is to act as a guiding light for the newbies, not let them get lost and confused
in a sea of opportunities and pushing them in the right direction by introducing them to various domains
they can choose to follow and provide them with the right tools. Cafe Dev is THE place for developers and
it’s not just limited work, it’s also a fun place to interact with people and you get to learn a lot from
experienced senior members
AIM
The Aim of our organisation is to act as a guiding light for the newbies, not let
them get lost and
confused in a sea of opportunities and pushing them in the right direction by introducing them to
various domains they can choose to follow and provide them with the right tools. Cafe Dev is THE place
for developers and it’s not just limited work, it’s also a fun place to interact with people and you get
to learn a lot from experienced senior members


True or False, no semicolon appears after the if statement but one is required after the else
False - no semicolon should appear after either the if or the else.
- False - you need a semicolon after the if statement but not the else.
- False - you need a semicolon after both if and else.
- True
There are no hints for this question


--- layout: post title: no title date: '2015-01-18T07:30:32+01:00' categories: - Sketches - Storyboards - Horses picture_url: https://film-Storyboards.tumblr.com/post/108439953472 ---


List of DLTdv8 app mouse and keyboard commands:
Mouse commands:
In the video windows the following mouse commands are active:
Left click: Digitize the 2D location or select a point by clicking on a line
Right click: Remove digitized point (Ctrl + click in MacOS)
Scroll wheel: Zoom in or out
Keyboard commands:
These are typically active in the video and time-series windows:
f, b, F and B: move (f)orward or (b)ackward by 1 frame in the video; F & B move by 50 frames
-, =, r: zoom in (-), zoom out (=) or (r)eset the video view
space, z: the space bar digitizes a point (equivalent to a mouse left-click) and z deletes it (same as a mouse right click)
i, j, k, m and 4, 8, 6, 2: nudge the current point in the current video by 0.5 pixels in any of 4 directions
x, X: x cycles through the Autotrack modes and mode menu, excluding multi-track. X jumps to multi-track mode.
n, D: n creates a new point, D deletes the current point (with dialogue box confirmation)
. and ,: cycle the active point forward (.) and backward (,) through the list
< and >: jump to the beginning or end of the digitized data in the current point in the current video
J: merge two points by combining their 2D data where they do not overlap, averaging it where they do and then recomputing the 3D result if in 3D mode.
Y: move the data from 1 point in 1 camera into a new 2nd point over a specified frame range
U: undo the last point Delete, Merge or Move (i.e. D, J, Y) operation or Neural Network application from the Neural Network application manager interface.
C: clear the cache of recently viewed images. DLTdv8 caches recently viewed images in memory so they can be re-displayed rapidly. However, sometimes during rapid frame advance in compressed files the wrong frame will be loaded and then will stay in the image cache. Using “C” clears the cache and facilitates loading the correct video image.


Networking and volunteering are integral to my career path and my commitment to advocating for STEM at various capacities.
Entreprenurship
- Co-founder-Africa Women in Computing
NASA Datanaut
Invited Panelist/Speaker/moderator:
- Gracehoper Conference (Celebrating women in Computing): Expanding Reach for African and Asian Systers and Women in Computing Everywhere/October 2014
- Black Engineer if the Year Awards(BEYA), Washington DC/February 2014
- Women of Color Conference , Dallas TX /October 2013
- The National Consortium for Graduate Degrees for Minorities in Engineering & Science (GEM)lab symposium/Prairie View A&M/March 2013
Non Profit Leadership Roles
- Advisory committee member: stemadvocacy/2016-current
- Conduct advocacy research that leads to the development of new ideas, tools, and insights to support trainees, organizations, and policy makers in STEM around the world.
- Advisory Board Member: Working to advance african women foundation/2009-2011
- Created, developed and produced the board of directors handbook
- Successfully collaborated in writing grant for funding of the STEM girls camp initiative in Africa, resulted in $10,500 funding from Engineering Information Foundation
- Contributed in judging of over 700 applications for the scholarships initiatives
- Initiated and facilitated quarterly board/executive meeting to discuss foundations strategic missions and goals
Others activities from 2009-2012
TEXAS JUNIOR AND HUMANITIES SYMPOSIUM, Texas A&M University, College St, TX
- Volunteer judge of oral research presentation and poster session presentation to determine who will go on to national competition.
TEXAS A&M UNIVERSITY College Station, TX
- Volunteer Graduate Travel Awards committee member
- Elected Graduate Student Council representative for Material Science & Engineering
- Elected Vice President/Public relations, Society of Plastic Engineers (SPE-TAMU),
- Departmental representative, Nanotechnology and Nanoscience Student Association (NaNSA-TAMU)
- Elected Graduate Student Council representative of Material Science & Engineering


water MIPS
`Prev `__
W
`Next `__
--------------
**water MIPS**: n.
(see `*MIPS* <../M/MIPS.html>`__, sense 2) Large, water-cooled machines
of either today's ECL-supercomputer flavor or yesterday's traditional
`*mainframe* <../M/mainframe.html>`__ type.
|image0|
A really unusual kind of `*water MIPS* `__.
(The next cartoon in the Crunchly saga is
`74-12-25 <../N/number-crunching.html#crunchly74-12-25>`__. The previous
cartoon was `73-10-31 <../A/ad-hockery.html#crunchly73-10-31>`__.)
--------------
+-------------------------------------+----------------------------+----------------------------------------+
| `Prev `__ | `Up <../W.html>`__ | `Next `__ |
+-------------------------------------+----------------------------+----------------------------------------+
| washing software | `Home <../index.html>`__ | wave a dead chicken |
+-------------------------------------+----------------------------+----------------------------------------+
.. |image0| image:: ../graphics/74-08-18.png


/
2.76%
Statements
100/3620
0.54%
Branches
9/1677
2.38%
Functions
8/336
2.9%
Lines
100/3443
File
Statements
Branches
Functions
Lines
src/
8.36%
29/347
4.24%
7/165
16.67%
4/24
9.01%
29/322
src/controls/
0.86%
3/349
0%
0/118
0%
0/45
0.92%
3/326
src/loaders/
2.33%
68/2924
0.14%
2/1394
1.5%
4/267
2.43%
68/2795


A paragraph with an image. A paragraph with an image. A paragraph with an image. A paragraph with an image. A paragraph with an image. A paragraph with an image.
The image floats to the left of the text.
Please use the CSS float property. The align attribute is deprecated in HTML 4, and not supported in HTML5.


Before Change
// Sometimes, we are lied to about the data processing step.
if ".CEL" in supplementary_file_url:
sample_object.has_raw = True
sample_object.save()
if ("_non_normalized.txt" in supplementary_file_url) \
or ("_non-normalized.txt" in supplementary_file_url) \
or ("-non-normalized.txt" in supplementary_file_url) \
After Change
logger.debug("Created OriginalFile: " + str(original_file))
lower_supplement_url = experiment_supplement_url.lower()
if ("_non_normalized.txt" in lower_supplement_url) \
or ("_non-normalized.txt" in lower_supplement_url) \
or ("-non-normalized.txt" in lower_supplement_url) \
or ("-non_normalized.txt" in lower_supplement_url):
for sample_object in all_samples:
sample_object.has_raw = True
sample_object.save()
OriginalFileSampleAssociation.objects.get_or_create(
sample=sample_object, original_file=original_file)
// These are the Miniml/Soft/Matrix URLs that are always(?) provided.
// GEO describes different types of data formatting as "families"
family_url = self.get_miniml_url(experiment_accession_code)
miniml_original_file = OriginalFile.objects.get_or_create(
source_url = family_url,
source_filename = family_url.split("/")[-1],


Diversity Consultant | Project Manager | Workshop Instructor | Sociologist
In August 2016 I had the honor to conduct a workshop at the Idrætshøjskole Bosei situated in Præstø, southern Sjælland. As part of the IFAS program, 14 Japanese exchange students got hands-on experiences of the concept of a Danish Folkehøjskole.
I designed and customized a workshop about racism in Japan and ways to fight it in everyday life.
Part 1: “What is racism?”
Part 2: “How can we speak up against racism?”
In my two-part workshop (2x 90 Min), I implemented a broad set of methods ranging from discussions, over a poster making session to a theatre sketch with a racist situation (solution finding). I conducted the workshop in English and had 2 Japanese translators by my side whenever communication was crucial.
As a main part of the workshop, we watched the movie Hafu, which draws a very intimate picture of what racial discriminations looks like in present-day Japan.
The most challenging part of the workshop was the actual implementation of our knowledge in everyday life. The participants had a lot of freedom designing their posters and theatre sketch. At the end, we engaged in a concluding discussion about practicability and obstacles of our ideas and strategies.
Creating these workshops enrichened my perspective a lot and gave me a good skillset of cultural sensitivity across language barriers.
At the end of the day, I facilitated a teambuilding workshop together with Danish participants in order to strengthen the bonds of the participants and end our day on a positive and fun note.
Back to Project Overview


|
Michael Asimow has been a member of the UCLA
law faculty since 1967. Previously, he was an associate at
Irell and Manella in Los Angeles. He is active in Jewish community
affairs. He also directs the Sunday Free Legal Clinic, a group
of volunteer lawyers and students who provide legal services
in South Central Los Angeles. He teaches contracts, income tax,
administrative law and law and popular culture. Together with
Professor Paul Bergman, he has published Reel
Justice: The Courtroom Goes to the Movies, a book about
all the great courtroom movies of the past and present.
Prof. Asimow has published an article entitled Bad Lawyers
in the Movies - Vol. 24 of Nova Law Review.
Contact:
asimow at law.ucla.edu
|
|
Christine Corcos is Associate Professor of Law at LSU
Law Center and Associate Professor of Women's and Gender Studies
at LSU A&M, and teaches mass media, law and computers, and
research methods at LSU Law Center in Baton Rouge, Louisiana.
She is the author of An International Guide to Law and Literature
Studies (Hein, 2000), and articles and essays on the law
of privacy, legal history, and law and popular culture, and is
writing a book on the 1944 trial of psychic Helen Duncan for
witchcraft (Carolina Academic Press).
Contact: ccorcos at lsu.edu
|
|
John Denvir
is Research Professor of Constitutional Policy at the University
of San Francisco School of Law. He has written extensively
on constitutional and legal theory, focussing on the insights
which can be drawn from the study of literature and film. He
is editor of Legal
Reelism: Movies as Legal Texts ( U. Ill. Press 1996)
and author of Democracy's Constitution: Claiming The Privileges
Of American Citizenship (2001).
Contact:
denvirj
at usfca.edu
|
|
Shubha Ghosh is a Professor of Law at Southern Methodist
University Dedman School of Law. His scholarly writings are in
the area of Patents, Copyright, and Trademarks. When not in his
office or the classroom, Professor Ghosh is usually watching
a DVD on his modest Triniton. His favorite movie is Weekend
at Bernie's which he sees as a metaphor for academics (two
white guys carrying around something dead and trying to convince
people that it's alive.)
Contact:
sghosh2 at buffalo.edu
|
|
Paul Joseph
is Professor of Law and Associate Dean for International and
External programs at the Shepard
Broad Law Center of Nova Southeastern University in Fort
Lauderdale, Florida. He teaches criminal procedure and torts.
He is co-editor of Prime
Time Law: Television as Legal Narrative (Carolina Academic
Press, 1998), a book of essays about fictional "legal"
television shows and genres. He has written and spoken extensively
on law and popular culture topics. His first publication focusing
on law and popular culture was The Law of the Federation:
Images of Law, Lawyers and the Legal System in Star Trek: The
Next Generation, published in the University of Toledo Law
Review (volume 24, number 1) in 1992 and also available online
through the popular culture collection of the University
of Texas Law Library.
We are saddened to note the passing of Picturing Justice managing
editor and webitor Paul Joseph, Professor of Law and Associate
Dean at Nova Southeastern Law School. Picturing Justice has published
a tribute to this generous
colleague and good friend.
|
|
Remy Kauffmann is the site's webmaster. He also works
in the University of San Francisco Dorraine
Zief Law Library's Technical Services department, where he
is in charge of the serials, the book accounts and the library
web site's design and maintenance.
Contact:
kauffmanr at usfca.edu
|
|
David Ray Papke is
a Professor of Law at the Marquette University Law School in
Milwaukee, Wisconsin. He teaches property law, family law, American
legal history, and a range of seminars in law and the humanities.
He is the author of four books: Framing the Criminal: Crime,
Cultural Work, and the Loss of Critical Perspective (1987),
Narrative and the Legal Discourse (1991), Heretics
in the Temple: Americans Who Reject the Nation's Legal Faith
(1998), and The Pullman Case: The Clash of Labor and Capital
in Industrial America (1999). His greatest scholarly interest
is the role of law and law-related thought in American history
and culture.
Contact: david.papke at marquette.edu
|
|
Rob Waring is an Adjunct Professor at the University
of San Francisco School of Law where he teaches Legal Ethics
and Law and Popular Culture. He works for the Alameda County
Public Defender, where he represents children in foster care.
Formerly Legislative Counsel to the California Judges Association,
he edited the seventh edition of their book for reporters called
The Courts and the News Media. During 2003, he was chair
of the California State Bar's Legal Services Trust Fund Commission.
He has published two law review articles on funded student speech
at public universities, and has completed a book on feminism
in the 21st century. A collection of his writing for Picturing
Justice was published in the Legal Studies Forum (volume
24, 2000). He is also a docent at the Point Bonita Lighthouse
in the Marin Headlands.
Contact:
rlwaring
at pacbell.net |
|
|


--- layout: post title: "Telegram enjoys the backlash after WhatsApp's Privacy Policy Update, Fans join in as well" subtitle: "Telegram started posting memes on Twitter after WhatsApp updated its privacy policy." date: 2021-01-09 18:30:13 +0530 background: '/img/posts/06.jpg' published: true categories: [ Technology ] tags: [ technology, facebook, whatsapp, facebook, telegram, messaging, privacy ] ---
Telegram seems to be enjoying the backlash WhatsApp received after it updated its privacy policy earlier this week.
The messaging service posted the classic two Spider-Man pointing at each other meme with Facebook and WhatsApp icons in place of the two superheroes on Twitter.
It then continued to take jabs at WhatsApp and Telegram users chimes in as well.
This came after WhatsApp updated its privacy policy earlier this week which made data sharing with Facebook mandatory.
Earlier, WhatsApp users were provided with the option to choose not to have their WhatsApp account information shared with Facebook.


This site is under construction. Please see the
github repository for more information.
Test automation made better. Any kind of automation: ui, api, web, mobile, unit, integration, regression. A magnificent engine to combine and bring any and all your test frameworks together: JUnit, TestNG, REST Assured, Cucumber, Gatlin, JMeter, Selenium and more.


Alerts don't have default classes, only base and modifier classes. A default gray alert doesn't make too much sense, so you're required to specify a type via contextual class. Choose from success, info, warning, or danger.
Alerts don't have default classes, only base and modifier classes. A default gray alert doesn't make too much sense, so you're required to specify a type via contextual class. Choose from success, info, warning, or danger.
Alerts don't have default classes, only base and modifier classes. A default gray alert doesn't make too much sense, so you're required to specify a type via contextual class. Choose from success, info, warning, or danger.
Alerts don't have default classes, only base and modifier classes. A default gray alert doesn't make too much sense, so you're required to specify a type via contextual class. Choose from success, info, warning, or danger.
Alerts don't have default classes, only base and modifier classes. A default gray alert doesn't make too much sense, so you're required to specify a type via contextual class. Choose from success, info, warning, or danger.
Alerts don't have default classes, only base and modifier classes. A default gray alert doesn't make too much sense, so you're required to specify a type via contextual class. Choose from success, info, warning, or danger.
Send us a message or contact us from the address below.
Bodex Pvt Ltd. 111, Malviya nagar Plot no. 45 Bhilai- 110017 P: +91<PHONE_NUMBER>9999


Quickstart¶
This library is intended for downstream analysis of single particle tracking
data. Downstream here means that we are not concerned with particle detection
or the linking problem, instead our starting point are the linked particle
trajectories. Consequently, the core of this library are the classes
Trajectory
, representing a single trajectory, and TaggedSet
, which provides
a useful way of organizing multiple (sets of) trajectories. Surrounding these
core functionalities, we then have several tools for processing, modelling, and
analysis, as illustrated in the figure below.
This document will introduce the basic ideas behind the core functionalities. For further details, see the documentation.
Trajectory¶
The Trajectory
is the “atom” of this library. Besides the actual data
, it
contains a dict for meta
data. Users can store all sorts of information about
the trajectory here (e.g. the time step, some auxiliary trajectory like a
reporter lighting up, analysis results, any or all of those). The library will
also make use of this occasionally, for example to store analysis results like
the MSD of that trajectory.
Trajectory
objects themselves have relatively limited capabilities, mostly
just some functions for simple geometric processing that we call “Modifiers”.
The following example showcases how these can be used and combined:
>>> import numpy as np
... import tracklib as tl
...
... # Generate some random trajectory with two loci in 3d
... traj = tl.Trajectory.fromArray(np.random.normal(size=(2, 10, 3)))
... traj.meta['info'] = 'some meta data'
...
... # "Rephrase" this a little bit:
... rel = traj.relative() # trajectory of the vector between the two loci
... abs = traj.relative().abs() # trajectory of absolute distance
... steps = traj.diff(dt=1).abs() # trajectory of stepsizes for both loci individually
... rel_steps = traj.relative().diff(dt=1) # trajectory of steps in the relative trajectory
... plane = traj.dims([0, 1]) # restrict to only the first two dimensions
TaggedSet¶
When working with tracking data, we often have a host of different “kinds” of trajectories (different experimental condition, different tracked objects, or simply trajectories that fall into different classes based on some analysis). Depending on the exact analysis we are doing, different aggregation schemes might make sense (e.g. run some analysis on all trajectories from a certain experimental condition, or on all trajectories with a frame rate of 10 seconds, etc). It thus seems useful to have a data structure that allows running analyses on arbitrary subsets of data.
The centerpiece of the TaggedSet
is its selection mechanism. Consider the
following minimal example:
>>> import tracklib as tl
... data = tl.TaggedSet()
... data.add(1, tags='a')
... data.add(2, tags='b')
... data.add(3, tags=['a', 'b'])
...
... print(len(data)) # prints: 3
... for i in data:
... print(i) # prints: 1 2 3
...
... data.makeSelection(tags='a') # select all entries tagged with 'a'
... print(len(data)) # prints: 2
... for i in data:
... print(i) # prints: 1 3
Note how, once we make a selection, the whole data set simply behaves as if it contained only those data. In addition to making selections by single tags, as shown in the example above, we can also select by combinations of tags, or even by properties of the data. Continuing from above:
>>> data.makeSelection(tags=['a', 'b'], logic=all)
... for i in data:
... print(i) # prints: 3 (everything carrying all the mentioned tags)
...
... data.makeSelection(tags=['a', 'b'], logic=any)
... for i in data:
... print(i) # prints: 1 2 3 (everything carrying any of the mentioned tags)
...
... data.makeSelection(selector = lambda i, tags : i >= 2)
... for i in data:
... print(i) # prints: 2 3
Refer to the documentation on makeSelection
for more details.
Finally, the TaggedSet
class provides some means of applying functions to all
of the data (in the current selection). Note that since a TaggedSet
works as
an iterator, the built-in map()
function will work for many cases:
>>> data.makeSelection()
... times2 = lambda x : 2*x
...
... doubles = list(map(times2, data)) # a list: [2, 4, 6]
... double_set = data.process(times2) # a new TaggedSet with the corresponding entries (and tags!)
... data.filter(times2) # same as process(), but in-place
... dtype = data.map_unique(type) # shortcut for functions that should return the same value on all data.
At the beginning of this example, we call makeSelection
without arguments to
reset the selection to the whole data set.


You probably haven’t heard of them quinoa DIY, asymmetrical vice farm-to-table bicycle rights blog.
Etiam fringilla purused in tincidunted euismod. In lorem massa, fermentum and pharetra and pulvinar eget eros. A long radio-like mix of music can.
Etiam fringilla purused in tincidunted euismod. In lorem massa, fermentum and pharetra and pulvinar eget eros. A long radio-like mix of music can.
Etiam fringilla purused in tincidunted euismod. In lorem massa, fermentum and pharetra and pulvinar eget eros. A long radio-like mix of music can.
Etiam fringilla purused in tincidunted euismod. In lorem massa, fermentum and pharetra and pulvinar eget eros. A long radio-like mix of music can.
Etiam fringilla purused in tincidunted euismod. In lorem massa, fermentum and pharetra and pulvinar eget eros. A long radio-like mix of music can.
Etiam fringilla purused in tincidunted euismod. In lorem massa, fermentum and pharetra and pulvinar eget eros. A long radio-like mix of music can.
We’re a creative agency who pursue brilliance. We create new companies — and fix old ones.
Keytar DIY cred thundercats direct trade viral umami, fanny pack ugh authen shabby chic chartreuse. Lo-fi roof party.Lorem ipsum dolor sit amet, ut vidis commune scriptorem. Ad his suavitate com plectitur ruis dicant
Keytar DIY cred thundercats direct trade viral umami, fanny pack ugh authen shabby chic chartreuse. Lo-fi roof party.Lorem ipsum dolor sit amet, ut vidis commune scriptorem. Ad his suavitate
Keytar DIY cred thundercats direct trade viral umami, fanny pack ugh authen shabby chic chartreuse. Lo-fi roof party.Lorem ipsum dolor sit amet, ut vidis commune scriptorem.
Keytar DIY cred thundercats direct trade viral umami, fanny pack ugh authen shabby chic chartreuse. Lo-fi roof party.Lorem ipsum dolor sit amet, ut vidis commune scriptorem.
It takes a lot to be one of the most trusted themes on the market. Read more below why users keep coming back
Free TrailIt takes a lot to be one of the most trusted themes on the market. Read more below why users keep coming back
Free TrailIt takes a lot to be one of the most trusted themes on the market. Read more below why users keep coming back
Free TrailIt takes a lot to be one of the most trusted themes on the market. Read more below why users keep coming back
Free TrailWe’re a creative agency who pursue brilliance. We create new companies — and fix old ones.


Open the "Explorer" tab in VSCode, the top most icon in the left side menu. If your repository folder is not open, open it now.
After you have opened your repository folder, open a new Terminal using the "Terminal" menu at the top of your screen, type "http-server", and press return.
D3 is a JavaScript library that allows for manipulating HTML page elements in JavaScript using complex data arrays.
It also provides a lot of nice JavaScript shortcuts.
We can use the JavaScript file directly from their website:
<script src="https://d3js.org/d3.v4.min.js"></script>
Reminder: please only use version 4 of D3. Version 5 and 6 change the way data is loaded, and will not work for this class.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<script src="https://d3js.org/d3.v4.min.js"></script>
</head>
<body>
</body>
</html>
Similar to JavaScript and JQuery (if you are familiar), D3 has it's own element selector:
document.getElementById("name");
$("#name");
d3.select("#name");
Element attributes and styles can be changed by using the supplied D3 functions:
var elem = d3.select("#name");
elem.attr("class", "big");
elem.style("color", "red");
The attr
and style
functions always return the original element being modified, so they can be chained one after another:
d3.select("#name").attr("class", "big").style("color", "red");
You can also select multiple elements on a page and change all of their properties at the same time using the selectAll
function:
d3.selectAll(".big").style("color", "red");
"enter/update/exit"
One of the defining characteristics of D3 is how it let's us easily manipulate shapes as the underlying data is changed.
Think of each stage in the lifecycle of the changing data as a frame in an animation. As the data changes, we need to manage the transitions in between each frame.
D3 can be configured to match the data based on specific keys (default is to match by index). In this example, let's match the data on the "country" key values.
When starting from nothing (as with most first frames), all data points are considered to be "entering" the visualization.
If a data point is no longer present in the new data array, it is "exiting" the visualization. If a data point persists across the transition it is called "updating".
This pattern repeats itself indefinitely each time your code is run. Shapes/data can only ever be one of three: "entering", "updating", or "exiting" the visualization.
The creator of D3 has a great walkthrough of what we went over today: https://bost.ocks.org/mike/circles/.
You do not need to e-mail me the link to your homework.


{# organization/templates/organization/organization_position_list.html #} {% extends "we_vote_base.html" %} {% block title %}{{ organization.name }}{% endblock %} {% block content %}
Back to Organizations
Add New Position
(no positions found)


The Naples Daily News reports that 35-year-old Pedro Silva-Diaz was sentenced Thursday after being convicted of leaving the scene of a crash involving death and driving without a license causing death.
Authorities say Silva-Diaz was driving on an East Naples road in November 2017 when his vehicle struck Shayden Colvin’s bicycle. Silva-Diaz was found and arrested that night. The boy died the next morning.
A June trial for Silva-Diaz ended in a mistrial after jurors couldn’t reach a decision.
Information from: Naples (Fla.) Daily News, http://www.naplesnews.com
Sign up for Daily Newsletters
Copyright © 2019 The Washington Times, LLC.
Please read our comment policy before commenting.


But you work on that project don't you?
ELMS:LN is a series of projects, an umbrella term.
Yes, it is in pursuit of NGDLE efforts.
Yes, it is it's own code base and platform.
Yes though, we pursue many things which play off each other.
Everything you see today is part of ELMS:LN; whether directly in the code base today, or will be tomorrow, or is complementary.


LEAK STUDIO
Mena
Europe
India
You may exchange Garena Voucher code through this page. You may purchase Garena Voucher through:
Leak Studio Official.
Confirm
Diamond × 210
000.00 BDT
Diamond × 295
000.00 BDT
Diamond × 430
000.00 BDT
Diamond × 645
000.00 BDT
Diamond × 690
000.00 BDT
Diamond × 755
000.00 BDT
Diamond × 1080
000.00 BDT
Diamond × 1520
000.00 BDT
Diamond × 2100
000.00 BDT
Diamond × 2200
000.00 BDT
Diamond × 3080
000.00 BDT
Diamond × 3520
000.00 BDT
Diamond × 4450
000.00 BDT
Diamond × 6900
000.00 BDT
Customer Service
2019-2021 © Leak Studio Online.
Trademarks belong to their respective owners. All rights reserved.


Reports coroutines that were called
without using the await
syntax.
Example:
async def bar():
pass
async def foo():
bar()
After the quick-fix is applied, the code changes to:
async def bar():
pass
async def foo():
await bar()


speechmatics.exceptions¶
Exceptions and errors used by the library.
- exception speechmatics.exceptions.EndOfTranscriptException[source]¶
Indicates that the transcription session has finished.
- exception speechmatics.exceptions.ForceEndSession[source]¶
Can be raised by the user from a middleware or event handler in order to force the transcription session to end early.


--- layout: page title: WashU LCS headline: WELCOME TO WULCS! ---
WULCS is a tournament hosted by League of Wash U for all WashU students and alumni to play together and determine the best team at WashU. We are currently in the process of setting up this semester's WashU LCS so stay tuned for more details!
Final standings (W-L-T)
Click here for the complete rulebook in PDF (rules are from 2013-2014 WashU LCS)


Your report commentary goes in here. On the simple layout, there's only room for a few lines of text, so be sparing with your words to avoid the content overflowing to the next page.
The left-commentary report has loads of room for text and can also handle a row of metrics across the top of the page.


| Package | flare.vis.operator.encoder |
| Class | public class PropertyEncoder |
| Inheritance | PropertyEncoder Operator |
For example, a PropertyEncoder
created with this code:
new PropertyEncoder({size:1, lineColor:0xff0000ff{);
will set the size to 1 and the line color to blue for all
data sprites processed by the encoder.
Property values can take a number of forms, as determined by
the flare.vis.data.DataList.setProperties
method:
Function
, it will be evaluated
for each element and the result will be used as the property
value for that element.IEvaluable
instance, such as
flare.util.Property
or
flare.query.Expression
, it will be evaluated for
each element and the result will be used as the property value
for that element.| Property | Defined by | ||
|---|---|---|---|
| enabled : Boolean Indicates if the operator is enabled or disabled.
| Operator | ||
| filter : Function Boolean function indicating which items to process.
| PropertyEncoder | ||
| group : String The name of the data group for which to compute the encoding.
| PropertyEncoder | ||
| ignoreTransitioner : Boolean | PropertyEncoder | ||
| parameters : Object
Sets parameter values for this operator.
| Operator | ||
| values : Object The properties to set on each invocation.
| PropertyEncoder | ||
| visualization : Visualization
The visualization processed by this operator.
| Operator |
| Property | Defined by | ||
|---|---|---|---|
| _filter : Function Boolean function indicating which items to process.
| PropertyEncoder | ||
| _group : String The name of the data group for which to compute the encoding.
| PropertyEncoder | ||
| _ignoreTrans : Boolean Flag indicating if property values should be set immediately.
| PropertyEncoder | ||
| _t : Transitioner
A transitioner for collecting value updates.
| PropertyEncoder | ||
| _values : Object The properties to set on each invocation.
| PropertyEncoder |
| Method | Defined by | ||
|---|---|---|---|
|
PropertyEncoder(values:Object = null, group:String, filter:Boolean = null, ignoreTransitioner:* = false)
Creates a new PropertyEncoder
| PropertyEncoder | ||
|
applyParameters(op:IOperator, params:Object):void
[static]
Static method that applies parameter settings to an operator.
| Operator | ||
|
operate(t:Transitioner = null):void
Performs an operation over the contents of a visualization.
| PropertyEncoder | ||
|
setup():void
Setup method invoked whenever this operator's visualization
property is set.
| Operator |
| _filter | property |
protected var _filter:Function
Boolean function indicating which items to process.
| filter | property |
filter:Function
[read-write]Boolean function indicating which items to process. Only items for which this function return true will be considered by the labeler. If the function is null, all items will be considered.
Implementation public function get filter():Function
public function set filter(value:Function):void
See also
| _group | property |
protected var _group:String
The name of the data group for which to compute the encoding.
| group | property |
group:String
[read-write]The name of the data group for which to compute the encoding.
Implementation public function get group():String
public function set group(value:String):void
| _ignoreTrans | property |
protected var _ignoreTrans:Boolean
Flag indicating if property values should be set immediately.
| ignoreTransitioner | property |
ignoreTransitioner:Boolean
[read-write]Implementation
public function get ignoreTransitioner():Boolean
public function set ignoreTransitioner(value:Boolean):void
| _t | property |
protected var _t:Transitioner
A transitioner for collecting value updates.
| _values | property |
protected var _values:Object
The properties to set on each invocation.
| values | property |
values:Object
[read-write]The properties to set on each invocation.
Implementation public function get values():Object
public function set values(value:Object):void
| PropertyEncoder | () | constructor |
public function PropertyEncoder(values:Object = null, group:String, filter:Boolean = null, ignoreTransitioner:* = false)
Creates a new PropertyEncoder
Parametersvalues:Object (default = null ) — The properties to set on each invocation. The input
should be an object with a set of name/value pairs.
|
|
group:String — the data group to process
|
|
filter:Boolean (default = null ) — a Boolean-valued function that takes a DataSprite as
input and returns true if the sprite should be processed
|
|
ignoreTransitioner:* (default = false ) — Flag indicating if values should be set
immediately rather than being processed by any transitioners
|
| operate | () | method |
public override function operate(t:Transitioner = null):void
Performs an operation over the contents of a visualization.
Parameterst:Transitioner (default = null ) — a Transitioner instance for collecting value updates.
|


What is E-Commerce
E-commerce is a business model, or segment of a larger business model, that enables a firm or individual to conduct business over an electronic network, typically the internet. Electronic commerce operates in all four of the major market segments: business to business, business to consumer, consumer to con- sumer and consumer to business. It can be thought of as a more advanced form of mail-order purchasing through a catalog. Almost any product or service can be offered via ecommerce, from books and music to financial services and plane tickets. Establishing E-shop one stop service at local markets level direct market access to small entrep reneurs of rural Bangladesh through ecommerce, capacity building and establishing a direct linkage between producers and end customers profitably and sustainably. Bull’s eye: For achieving midterm objectives Promote e commerce as a key tool to provide innovative solutions to development challenges of untrained rural communities such as rural women entrepreneurs, young entrepreneurs, waver communities, the most underprivileged people.
e-Shop
Amar Desh Amar Gram is the first project of its kind that takes computers and web access to the lowest income group and empowers them with a possibility that was not ever previously available to them before. This project is the real possibility of a Digital Bangladesh, where digital technology reaches out to the furthest corners of our country bringing change to countless lives. This project takes the products from producers all around Bangladesh and then opens up national and international markets for them. Today fishermen from far off mongla are selling fish in the heart of Dhaka city, women sitting at home producing simple ‘handicrafts” are earning by selling their kathas all over Bangladesh and even abroad, farmers growing fresh vegetables are supplying to city markets. The journey does not end there, the centers that control this supply chain is controlled by youths that are trained it to the infinite world of ecommerce, they themselves go on teach others, schools are handed out free softwares that the students benefit from and the wide world of digital technology becomes a reality for them. This unique and first of its kind ecommerce based poverty elevation project not only provided empowerment but also creates a new generation of entrepreneurs among the youth who can then strive for self sufficiency.Amar


nips nips2004 nips2004-158 nips2004-158-reference knowledge-graph by maker-knowledge-mining
Source: pdf
Author: Rob Fergus, Andrew Zisserman, Pietro Perona
Abstract: We present an algorithm to overcome the local maxima problem in estimating the parameters of mixture models. It combines existing approaches from both EM and a robust ﬁtting algorithm, RANSAC, to give a data-driven stochastic learning scheme. Minimal subsets of data points, sufﬁcient to constrain the parameters of the model, are drawn from proposal densities to discover new regions of high likelihood. The proposal densities are learnt using EM and bias the sampling toward promising solutions. The algorithm is computationally efﬁcient, as well as effective at escaping from local maxima. We compare it with alternative methods, including EM and RANSAC, on both challenging synthetic data and the computer vision problem of alpha-matting. 1
[1] Ondˇej Chum, Jiˇ´ Matas, and Josef Kittler. Locally optimized ransac. In DAGM r rı 2003: Proceedings of the 25th DAGM Symposium, pages 236–243, 2003.
[2] A. Dempster, N. Laird, and D. Rubin. Maximum likelihood from incomplete data via the em algorithm. Journal of the Royal Statistical Society, 39:1–38, 1976.
[3] M. A. Fischler and R. C. Bolles. Random sample consensus: A paradigm for model ﬁtting with applications to image analysis and automated cartography. Comm. ACM, 24(6):381–395, 1981.
[4] S. Richardson and P.J. Green. On bayesian analysis of mixtures with an unknown number of components. Journal of the Royal Statistical Society, 59(4):731–792, 1997.
[5] C.V. Stewart. Robust parameter estimation. SIAM Review, 41(3):513–537, Sept. 1999.
[6] B. Tordoff and D.W. Murray. Guided sampling and consensus for motion estimation. In Proc. ECCV, 2002.
[7] P. H. S. Torr and A. Zisserman. MLESAC: A new robust estimator with application to estimating image geometry. CVIU, 78:138–156, 2000.
[8] N. Ueda and R. Nakano. Deterministic Annealing EM algorithm. Neural Networks, 11(2):271–282, 1998.
[9] N. Ueda, R. Nakano, Z. Ghahramani, and G. E. Hinton. SMEM algorithm for mixture models. Neural Computation, 12(9):2109–2128, 2000.
[10] G. Wei and M. Tanner. A Monte Carlo implementation of the EM algorithm. Journal American Statistical Society, 85:699–704, 1990.


{% extends 'registration/main.html' %} {% load static %} {% block content %} {% block stylesheets %}{% endblock stylesheets %}
Sign In
New to Future Allure? Create an account
By signing in to your account, you agree to Blog Terms of Service and consent to our Cookie Policy and Privacy Policy . This site is not protected by reCAPTCHA and is a demonstration website for learning purposes only.
Forgotten Password?
Help Center?


Rain again ruins a Spartans-Heat tie
Cape Town - Rain again had the final say as the second Mzansi Super League (MSL) meeting between the Tshwane Spartans and Durban Heat was abandoned due to inclement weather in Centurion on Thursday.
The hosts, once again led by an inspired Dean Elgar, had managed to post 141 for four in their interrupted innings that lasted 15 overs.
However, after rain and lightning delayed the changeover, the target was revised to 66 from five overs, with the visitors managing 21 for three in 2.1 overs when the heavens again opened – leaving the umpires little choice but to abandon the clash at SuperSport Park.
It was the third no result for the two teams, with the Spartans moving to 10 points from four games in third position.
The Heat, meanwhile, progressed to six points, all of which have come from their washouts, with their only completed game ending in defeat.
However, they may well have been relieved with the outcome of match four too after they slipped into early trouble chasing the revised target at SuperSport Park.

Earlier, it was Elgar who picked up where he left off in the previous game where he scored a match-winning 88, that led the charge for the Tshwane side.
The Standard Bank Proteas Test star struck 57 off 37 balls (7 fours) and shared in an opening partnership of 81 in under eight overs with Theunis de Bruyn (40) as the home side flew out of the blocks.
Andile Phehlukwayo (1/32) then had the latter run out and also claimed the prize wicket of AB de Villiers (2) to open the window for his side, but the former and his captain Heinrich Klaasen (23) kept on going.
That was until the wet weather returned, accounted for two more wickets and ate into the time prompting an early end to the innings – and ultimately the game.
- Cricket SA


{% extends "layouts/base.html" %}
{% block meta_title %} | Documentation{% endblock meta_title %}
{% block meta_description %}Google Drive content management system (CMS) documentation. Adjust settings within the CMS and learn how to extend it to help create content for your website straight from Google Drive{% endblock meta_description %}
{% block content %}
{% set hero_details = { title: "Documentation", breadcrumbUrl: "/documentation", deck: "The Google Drive CMS is a content management system (CMS) built on an interface everyone understands."} %}
{% include "includes/components/_standard_hero.html" %}
{% endblock %}
{% block extrajs %}
{% endblock %}


Register
Username:
Password:
submit
Login User
Username:
Password:
submit
Login Operator
Username:
Password:
submit
Login Admin
Username:
Password:
submit


In this example we add a simple GeoJSON layer which we style. To keep the core library small, GeoJSON support is provided via an overlay plugin. Only very limited GeoJSON functionality has been implemented - the style
property. There is support for the following GeoJSON geometry types: Point
, LineString
, MultiLineString
, Polygon
, and MultiPolygon
.


| BeanDescriptorTest |
Tests the implementation of BeanDescriptor and its dependent
interfaces.
|
| BeanDescriptorTest.Account |
|
| BeanDescriptorTest.Form |
|
| BeanDescriptorTest.Woman |
|
| BootstrapTest |
Description:
|
| CircularReferencesTest |
Checks that circular references in the bean graph are correctly detected when
validating.
|
| CircularReferencesTest.Boss |
|
| CircularReferencesTest.Person |
|
| ComposedConstraintsTest |
Description:
|
| ConstraintCompositionTest |
Checks that groups are correctly inherited from the root constraint to its
compositing constraints.
|
| ConstraintCompositionTest.Code |
|
| ConstraintCompositionTest.Man |
|
| ConstraintCompositionTest.Payload1 |
|
| ConstraintCompositionTest.Payload2 |
|
| ConstraintCompositionTest.Person |
|
| ConstraintDefinitionsTest |
Checks the correct parsing of constraint definitions.
|
| ConstraintDefinitionsTest.InvalidAttribute |
|
| ConstraintDefinitionsTest.InvalidGroups |
|
| ConstraintDefinitionsTest.InvalidMessage |
|
| ConstraintDefinitionsTest.InvalidPayload |
|
| ConstraintDefinitionsTest.InvalidPayloadConstraint.Payload1 |
|
| ConstraintDefinitionsTest.NoGroups |
|
| ConstraintDefinitionsTest.NoMessage |
|
| ConstraintDefinitionsTest.NoPayload |
|
| ConstraintDefinitionsTest.Person |
|
| ContextConstraintValidatorFactoryTest |
|
| ContextConstraintValidatorFactoryTest.Contrived.Validator |
|
| ContextConstraintValidatorFactoryTest.Example |
|
| CustomConstraintValidatorFactoryTest |
Checks that overriding the default ConstraintValidatorFactory works
as expected.
|
| CustomConstraintValidatorFactoryTest.GoodPerson.GoodPersonValidator |
|
| CustomConstraintValidatorFactoryTest.Person |
|
| CustomValidatorFactoryTest |
Test the ability to force a particular ValidatorFactory
implementation class.
|
| CustomValidatorFactoryTest.CustomValidatorFactory |
|
| CustomValidatorFactoryTest.IncompatibleValidatorFactory |
|
| CustomValidatorFactoryTest.NotAValidatorFactory |
|
| DefaultMessageInterpolatorTest |
MessageResolverImpl Tester.
|
| DefaultMessageInterpolatorTest.Person |
|
| ExceptionsContractTest |
Several checks to validate that the implementations of Validator and
BeanDescriptor throw the correct exceptions as per the spec.
|
| ExceptionsContractTest.ExceptionThrowingBean |
|
| ExceptionsContractTest.Person |
|
| FooTest |
Description:
|
| FooTest.Foo |
|
| Jsr303Test |
Description:
|
| LiskovTest |
|
| LiskovTest.Base |
|
| LiskovTest.Impl |
|
| PayloadTest |
Description: test that payload information can be retrieved
from error reports via the ConstraintDescriptor either accessed
through the ConstraintViolation objects
|
| PayloadTest.Address |
|
| PayloadTest.Severity |
|
| PayloadTest.Severity.Error |
|
| PayloadTest.Severity.Info |
|
| TckReproducerTest |
Description:
User: roman.stumm
Date: 21.04.2010
Time: 14:21:45
|
| TckReproducerTest.Car |
|
| ValidationTest |
Description:
|
| ValidationTest.FooAddress |
|
| ValidationTest.Issue149Subject |
|
| ValidationTestBase |
|
| ValidatorResolutionTest |
Checks the correct behavior of the validator resolution algorithm.
|
| ValidatorResolutionTest.InvalidPersonNameValidator |
|
| ValidatorResolutionTest.Person |
|


Module DistanceJoint
A distance joint constrains two points on two bodies to remain at a fixed distance from each other.
You can view this as a massless, rigid rod.
Type DistanceJoint
| DistanceJoint:getAnchorA() |
Returns the anchor point on bodyA in world coordinates. |
| DistanceJoint:getAnchorB() |
Returns the anchor point on bodyB in world coordinates. |
| DistanceJoint:getBodyA() |
Returns the first body attached to this joint. |
| DistanceJoint:getBodyB() |
Returns the second body attached to this joint. |
| DistanceJoint:getDampingRatio() |
Returns the damping ratio of this distance joint. |
| DistanceJoint:getFrequency() |
Returns the mass-spring-damper frequency of this distance joint in Hertz. |
| DistanceJoint:getLength() |
Returns the length of this distance joint, usually in meters. |
| DistanceJoint:getType() |
Returns the type of the concrete joint. |
| DistanceJoint:isActive() |
Short-cut function to determine if either body is inactive. |
| DistanceJoint:setDampingRatio(ratio) |
Sets the damping ratio of this distance joint. |
| DistanceJoint:setFrequency(frequency) |
Sets the mass-spring-damper frequency in Hertz. |
| DistanceJoint:setLength(length) |
Sets the natural length. |
Type DistanceJoint
Field(s)
- DistanceJoint:getAnchorA()
-
Returns the anchor point on bodyA in world coordinates.
Return value
The x and y coordinates of the anchor point
- DistanceJoint:getAnchorB()
-
Returns the anchor point on bodyB in world coordinates.
Return value
The x and y coordinates of the anchor point
- DistanceJoint:getBodyA()
-
Returns the first body attached to this joint.
Return value
The first body attached to this joint
- DistanceJoint:getBodyB()
-
Returns the second body attached to this joint.
Return value
The second body attached to this joint
- DistanceJoint:getDampingRatio()
-
Returns the damping ratio of this distance joint.
Return value
The damping ratio of this distance joint
- DistanceJoint:getFrequency()
-
Returns the mass-spring-damper frequency of this distance joint in Hertz.
Return value
The mass-spring-damper frequency in Hertz.
- DistanceJoint:getLength()
-
Returns the length of this distance joint, usually in meters.
Return value
The length of this distance joint, usually in meters
- DistanceJoint:getType()
-
Returns the type of the concrete joint.
The return value can be one of the
b2.REVOLUTE_JOINT
,b2.PRISMATIC_JOINT
,b2.DISTANCE_JOINT
,b2.PULLEY_JOINT
,b2,MOUSE_JOINT
,b2.GEAR_JOINT
,b2.LINE_JOINT
,b2.WELD_JOINT
,b2.FRICTION_JOINT
.Return value
The type of the concrete joint
- DistanceJoint:isActive()
-
Short-cut function to determine if either body is inactive.
Return value
true
if both bodyA and bodyB is active,false
otherwise
- DistanceJoint:setDampingRatio(ratio)
-
Sets the damping ratio of this distance joint.
0 = no damping, 1 = critical damping.
Parameter
-
ratio
: (number) the damping ratio
-
- DistanceJoint:setFrequency(frequency)
-
Sets the mass-spring-damper frequency in Hertz.
Parameter
-
frequency
: (number) the mass-spring-damper frequency in Hertz
-
- DistanceJoint:setLength(length)
-
Sets the natural length.
Manipulating the length can lead to non-physical behavior when the frequency is zero.
Parameter
-
length
: (number) the length of this distance joint, usually in meters.
-


| I l@ve RuBoard |
20.3 Basic Embedding TechniquesAs you can probably tell from the preceding overview, there is much flexibility in the embedding domain. To illustrate common embedding techniques in action, this section presents a handful of short C programs that run Python code in one form or another. Most of these examples make use of the simple Python module file shown in Example 20-1. Example 20-1. PP2E\Integrate\Embed\Basics\usermod.py######################################################### # C runs Python code in this module in embedded mode. # Such a file can be changed without changing the C layer. # There is just standard Python code (C does conversions). # You can also run code in standard modules like string. ######################################################### import string message = 'The meaning of life...' def transform(input): input = string.replace(input, 'life', 'Python') return string.upper(input) If you know any Python at all, you know that this file defines a string and a function; the function returns whatever it is passed with string substitution and upper-case conversions applied. It's easy to use from Python: [mark@toy ~/.../PP2E/Integrate/Embed/Basics]$ python >>> import usermod # import a module >>> usermod.message # fetch a string 'The meaning of life...' >>> usermod.transform(usermod.message) # call a function 'THE MEANING OF PYTHON...' With proper API use, it's not much more difficult to use this module the same way in C. 20.3.1 Running Simple Code StringsPerhaps the simplest way to run Python code from C is by calling the PyRun_ SimpleString API function. With it, C programs can execute Python programs represented as C character string arrays. This call is also very limited: all code runs in the same namespace (module __main__ ), the code strings must be Python statements (not expressions), and there is no easy way to communicate inputs or outputs with the Python code run. Still, it's a simple place to start; the C program in Example 20-2 runs Python code to accomplish the same results as the interactive session listed in the prior section. Example 20-2. PP2E\Integrate\Embed\Basics\embed-simple.c/******************************************************* * simple code strings: C acts like the interactive * prompt, code runs in __main__, no output sent to C; *******************************************************/ #include <Python.h> /* standard API def */ main( ) { printf("embed-simple\n"); Py_Initialize( ); PyRun_SimpleString("import usermod"); /* load .py file */ PyRun_SimpleString("print usermod.message"); /* on python path */ PyRun_SimpleString("x = usermod.message"); /* compile and run */ PyRun_SimpleString("print usermod.transform(x)"); } The first thing you should notice here is that when Python is embedded, C programs always call Py_Initializeto initialize linked-in Python libraries before using any other API functions. The rest of this code is straightforward -- C submits hardcoded strings to Python that are roughly what we typed interactively. Internally, PyRun_SimpleString invokes the Python compiler and interpreter to run the strings sent from C; as usual, the Python compiler is always available in systems that contain Python. <IP_ADDRESS> Compiling and runningTo build a standalone executable from this C source file, you need to link its compiled form with the Python library file. In this chapter, "library" usually means the binary library file (e.g., an .a file on Unix) that is generated when Python is compiled, not the Python source code library. Today, everything about Python you need in C is compiled into a single .a library file when the interpreter is built. The program's main function comes from your C code, and depending on the extensions installed in your Python, you may also need to link any external libraries referenced by the Python library. Assuming no extra extension libraries are needed, Example 20-3 is a minimal Linux makefile for building the C program in Example 20-2. Again, makefile details vary per platform, but see Python manuals for hints. This makefile uses the Python include-files path to find Python.h in the compile step, and adds the Python library file to the final link step to make API calls available to the C program. Example 20-3. PP2E\Integrate\Embed\Basics\makefile.1# a linux makefile that builds a C executable that embeds # Python, assuming no external module libs must be linked in; # uses Python header files, links in the Python lib file; # both may be in other dirs (e.g., /usr) in your install; # set MYPY to your Python install tree, change lib version; PY = $(MYPY) PYLIB = $(PY)/libpython1.5.a PYINC = -I$(PY)/Include -I$(PY) embed-simple: embed-simple.o gcc embed-simple.o $(PYLIB) -g -export-dynamic -lm -ldl -o embed-simple embed-simple.o: embed-simple.c gcc embed-simple.c -c -g $(PYINC) Things may not be quite this simple in practice, though, at least not without some coaxing. The makefile in Example 20-4 is the one I actually used to build all of this section's C programs on Linux. Example 20-4. PP2E\Integrate\Embed\Basics\makefile.basics# build all 5 basic embedding examples # with external module libs linked in; # source setup-pp-embed.csh if needed PY = $(MYPY) PYLIB = $(PY)/libpython1.5.a PYINC = -I$(PY)/Include -I$(PY) LIBS = -L/usr/lib \ -L/usr/X11R6/lib \ -lgdbm -ltk8.0 -ltcl8.0 -lX11 -lm -ldl BASICS = embed-simple embed-string embed-object embed-dict embed-bytecode all: $(BASICS) embed%: embed%.o gcc embed$*.o $(PYLIB) $(LIBS) -g -export-dynamic -o embed$* embed%.o: embed%.c gcc embed$*.c -c -g $(PYINC) clean: rm -f *.o *.pyc $(BASICS) core This version links in Tkinter libraries because the Python library file it uses was built with Tkinter enabled. You may have to link in arbitrarily many more externals for your Python library, and frankly, chasing down all the linker dependencies can be tedious. Required libraries may vary per platform and Python install, so there isn't a lot of advice I can offer to make this process simple (this is C, after all). But if you're going to do much embedding work, you might want to build Python on your machine from its source with all unnecessary extensions disabled in the Modules/Setup file. This produces a Python library with minimal external dependencies, which links much more easily. For example, if your embedded code won't be building GUIs, Tkinter can simply be removed from the library; see the Setup file for details. You can also find a list of external libraries referenced from your Python in the generated makefiles located in the Python source tree. In any event, the good news is that you only need to resolve linker dependencies once. Once you've gotten the makefile to work, run it to build the C program with python libraries linked in. Run the resulting C program as usual:[2]
[mark@toy ~/.../PP2E/Integrate/Embed/Basics]$ embed-simple embed-simple The meaning of life... THE MEANING OF PYTHON... Most of this output is produced by Python print statements sent from C to the linked-in Python library. It's as if C has become an interactive Python programmer. However, strings of Python code run by C probably would not be hardcoded in a C program file like this. They might instead be loaded from a text file, extracted from HTML or XML files, fetched from a persistent database or socket, and so on. With such external sources, the Python code strings that are run from C could be changed arbitrarily without having to recompile the C program that runs them. They may even be changed onsite, and by end users of a system. To make the most of code strings, though, we need to move on to more flexible API tools. 20.3.2 Running Code Strings with Results and NamespacesExample 20-5 uses the following API calls to run code strings that return expression results back to C:
The import calls are used to fetch the namespace of the usermod module listed in Example 20-1 earlier, so that code strings can be run there directly (and will have access to names defined in that module without qualifications). Py_Import_ImportModule is like a Python import statement, but the imported module object is returned to C, not assigned to a Python variable name. Because of that, it's probably more similar to the Python __import__ built-in function we used in Example 7-32. The PyRun_String call is the one that actually runs code here, though. It takes a code string, a parser mode flag, and dictionary object pointers to serve as the global and local namespaces for running the code string. The mode flag can be Py_eval_input to run an expression, or Py_file_input to run a statement; when running an expression, the result of evaluating the expression is returned from this call (it comes back as a PyObject* object pointer). The two namespace dictionary pointer arguments allow you to distinguish global and local scopes, but they are typically passed the same dictionary such that code runs in a single namespace.[3]
Example 20-5. PP2E\Integrate\Embed\Basics\embed-string.c/* code-strings with results and namespaces */ #include <Python.h> main( ) { char *cstr; PyObject *pstr, *pmod, *pdict; printf("embed-string\n"); Py_Initialize( ); /* get usermod.message */ pmod = PyImport_ImportModule("usermod"); pdict = PyModule_GetDict(pmod); pstr = PyRun_String("message", Py_eval_input, pdict, pdict); /* convert to C */ PyArg_Parse(pstr, "s", &cstr); printf("%s\n", cstr); /* assign usermod.X */ PyObject_SetAttrString(pmod, "X", pstr); /* print usermod.transform(X) */ (void) PyRun_String("print transform(X)", Py_file_input, pdict, pdict); Py_DECREF(pmod); Py_DECREF(pstr); } When compiled and run, this file produces the same result as its predecessor: [mark@toy ~/.../PP2E/Integrate/Embed/Basics]$ embed-string embed-string The meaning of life... THE MEANING OF PYTHON... But very different work goes into producing this output. This time, C fetches, converts, and prints the value of the Python module's message attribute directly by running a string expression, and assigns a global variable (X) within the module's namespace to serve as input for a Python print statement string. Because the string execution call in this version lets you specify namespaces, you can better partition the embedded code your system runs -- each grouping can have a distinct namespace to avoid overwriting other groups' variables. And because this call returns a result, you can better communicate with the embedded code -- expression results are outputs, and assignments to globals in the namespace in which code runs can serve as inputs. Before we move on, I need to explain two coding issues here. First of all, this program also decrements the reference count on objects passed to it from Python, using the Py_DECREF call introduced in Chapter 19. These calls are not strictly needed here (the objects' space is reclaimed when the programs exits anyhow), but demonstrate how embedding interfaces must manage reference counts when Python passes their ownership to C. If this was a function called from a larger system, for instance, you would generally want to decrement the count to allow Python to reclaim the objects. Secondly, in a realistic program, you should generally test the return values of all the API calls in this program immediately to detect errors (e.g., import failure). Error tests are omitted in this section's example to keep the code simple, but will appear in later code listings and should be included in your programs to make them more robust. 20.3.3 Calling Python ObjectsThe last two sections dealt with running strings of code, but it's easy for C programs to deal in terms of Python objects too. Example 20-6 accomplishes the same task as Examples Example 20-2 and Example 20-5, but uses other API tools to interact with objects in the Python module directly:
We met both the data conversion functions in the last chapter. The PyEval_CallObject call in this version is the key call here: it runs the imported function with a tuple of arguments, much like the Python apply built-in function. The Python function's return value comes back to C as a PyObject*, a generic Python object pointer. Example 20-6. PP2E\Integrate\Embed\Basics\embed-object.c/* fetch and call objects in modules */ #include <Python.h> main( ) { char *cstr; PyObject *pstr, *pmod, *pfunc, *pargs; printf("embed-object\n"); Py_Initialize( ); /* get usermod.message */ pmod = PyImport_ImportModule("usermod"); pstr = PyObject_GetAttrString(pmod, "message"); /* convert string to C */ PyArg_Parse(pstr, "s", &cstr); printf("%s\n", cstr); Py_DECREF(pstr); /* call usermod.transform(usermod.message) */ pfunc = PyObject_GetAttrString(pmod, "transform"); pargs = Py_BuildValue("(s)", cstr); pstr = PyEval_CallObject(pfunc, pargs); PyArg_Parse(pstr, "s", &cstr); printf("%s\n", cstr); /* free owned objects */ Py_DECREF(pmod); Py_DECREF(pstr); Py_DECREF(pfunc); /* not really needed in main( ) */ Py_DECREF(pargs); /* since all memory goes away */ } When compiled and run, the result is the same again: [mark@toy ~/.../PP2E/Integrate/Embed/Basics]$ embed-object embed-object The meaning of life... THE MEANING OF PYTHON... But this output is all generated by C this time -- first by fetching the Python module's message attribute value, and then by fetching and calling the module's transform function object directly and printing its return value that is sent back to C. Input to the transform function is a function argument here, not a preset global variable. Notice that message is fetched as a module attribute this time, instead of by running its name as a code string; there is often more than one way to accomplish the same goals with different API calls. Running functions in modules like this is a simple way to structure embedding; code in the module file can be changed arbitrarily without having to recompile the C program that runs it. It also provides a direct communication model: inputs and outputs to Python code can take the form of function arguments and return values. 20.3.4 Running Strings in DictionariesWhen we used PyRun_String earlier to run expressions with results, code was executed in the namespace of an existing Python module. However, sometimes it's more convenient to create a brand new namespace for running code strings that is independent of any existing module files. The C file in Example 20-7 shows how; the new namespace is created as a new Python dictionary object, and a handful of new API calls are employed in the process: The main trick here is the new dictionary. Inputs and outputs for the embedded code strings are mapped to this dictionary by passing it as the code's namespace dictionaries in the PyRun_String call. The net effect is that the C program in Example 20-7 works exactly like this Python code: >>> d = {} >>> d['Y'] = 2 >>> exec 'X = 99' in d, d >>> exec 'X = X + Y' in d, d >>> print d['X'] 101 But here, each Python operation is replaced by a C API call. Example 20-7. PP2E\Integrate\Embed\Basics\embed-dict.c/*************************************************** * make a new dictionary for code string namespace; ***************************************************/ #include <Python.h> main( ) { int cval; PyObject *pdict, *pval; printf("embed-dict\n"); Py_Initialize( ); /* make a new namespace */ pdict = PyDict_New( ); PyDict_SetItemString(pdict, "__builtins__", PyEval_GetBuiltins( )); PyDict_SetItemString(pdict, "Y", PyInt_FromLong(2)); /* dict['Y'] = 2 */ PyRun_String("X = 99", Py_file_input, pdict, pdict); /* run statements */ PyRun_String("X = X+Y", Py_file_input, pdict, pdict); /* same X and Y */ pval = PyDict_GetItemString(pdict, "X"); /* fetch dict['X'] */ PyArg_Parse(pval, "i", &cval); /* convert to C */ printf("%d\n", cval); /* result=101 */ Py_DECREF(pdict); } When compiled and run, this C program creates this sort of output: [mark@toy ~/.../PP2E/Integrate/Embed/Basics]$ embed-dict embed-dict 101 The output is different this time: it reflects the value of Python variable X assigned by the embedded Python code strings and fetched by C. In general, C can fetch module attributes either by calling PyObject_GetAttrString with the module, or by using PyDict_GetItemString to index the module's attribute dictionary (expression strings work too, but are less direct). Here, there is no module at all, so dictionary indexing is used to access the code's namespace in C. Besides allowing you to partition code string namespaces independent of any Python module files on the underlying system, this scheme provides a natural communication mechanism. Values stored in the new dictionary before code is run serve as inputs, and names assigned by the embedded code can later be fetched out of the dictionary to serve as code outputs. For instance, the variable Y in the second string run refers to a name set to 2 by C; X is assigned by the Python code and fetched later by C code as the printed result. There is one trick in this code that I need to explain. Each module namespace in Python has a link to the built-in scope's namespace, where names like open and len live. In fact, this is the link Python follows during the last step of its local/global/built-in three-scope name lookup procedure.[4] Today, embedding code is responsible for setting the __builtins__ scope link in dictionaries that serve as namespaces. Python sets this link automatically in all other namespaces that host code execution, and this embedding requirement may be lifted in the future (it seems a bit too magical to be required for long). For now, simply do what this example does to initialize the built-ins link, in dictionaries you create for running code in C.
20.3.5 Precompiling Strings to BytecodeWhen you call Python function objects from C, you are actually running the already-compiled bytecode associated with the object (e.g., a function body). When running strings, Python must compile the string before running it.  Instead, precompile the string to a bytecode object to be run later, using the API calls illustrated in Example 20-8:[5]
The first of these takes the mode flag normally passed to PyRun_String, and a second string argument that is only used in error messages. The second takes two namespace dictionaries. These two API calls are used in Example 20-8 to compile and execute three strings of Python code. Example 20-8. PP2E\Integrate\Embed\Basics\embed-bytecode.c/* precompile code strings to bytecode objects */ #include <Python.h> #include <compile.h> #include <eval.h> main( ) { int i; char *cval; PyObject *pcode1, *pcode2, *pcode3, *presult, *pdict; char *codestr1, *codestr2, *codestr3; printf("embed-bytecode\n"); Py_Initialize( ); codestr1 = "import usermod\nprint usermod.message"; /* statements */ codestr2 = "usermod.transform(usermod.message)"; /* expression */ codestr3 = "print '%d:%d' % (X, X ** 2),"; /* use input X */ /* make new namespace dictionary */ pdict = PyDict_New( ); if (pdict == NULL) return -1; PyDict_SetItemString(pdict, "__builtins__", PyEval_GetBuiltins( )); /* precompile strings of code to bytecode objects */ pcode1 = Py_CompileString(codestr1, "<embed>", Py_file_input); pcode2 = Py_CompileString(codestr2, "<embed>", Py_eval_input); pcode3 = Py_CompileString(codestr3, "<embed>", Py_file_input); /* run compiled bytecode in namespace dict */ if (pcode1 && pcode2 && pcode3) { (void) PyEval_EvalCode((PyCodeObject *)pcode1, pdict, pdict); presult = PyEval_EvalCode((PyCodeObject *)pcode2, pdict, pdict); PyArg_Parse(presult, "s", &cval); printf("%s\n", cval); Py_DECREF(presult); /* rerun code object repeatedly */ for (i = 0; i <= 10; i++) { PyDict_SetItemString(pdict, "X", PyInt_FromLong(i)); (void) PyEval_EvalCode((PyCodeObject *)pcode3, pdict, pdict); } printf("\n"); } /* free referenced objects */ Py_XDECREF(pdict); Py_XDECREF(pcode1); Py_XDECREF(pcode2); Py_XDECREF(pcode3); } This program combines a variety of technique we've already seen. The namespace in which the compiled code strings run, for instance, is a newly created dictionary (not an existing module object), and inputs for code strings are passed as preset variables in the namespace. When built and executed, the first part of the output is similar to previous examples in this section, but the last line represents running the same precompiled code string 11 times: [mark@toy ~/.../PP2E/Integrate/Embed/Basics]$ embed-bytecode embed-bytecode The meaning of life... THE MEANING OF PYTHON... 0:0 1:1 2:4 3:9 4:16 5:25 6:36 7:49 8:64 9:81 10:100 If your system executes strings multiple times, it is a major speedup to precompile to bytecode in this fashion. |
| I l@ve RuBoard |


title = "Documents" url = "/documents" layout = "one_column" description = "Policy, planning, and related documents of interest to the CSZ membership." is_hidden = 0 [editable column_middle] file = "documents/column_middle.htm" == {% put header %}