It's free and released under MIT License Copyright (c) 2018 Yusuf Shakeel
<!DOCTYPE html>
<html>
<head>
<title>dyCacheJS Demo</title>
</head>
<body>
<!-- some html goes here -->
<!-- script -->
<script src="path/to/dyCache.min.js"></script>
</body>
</html>
Now, instantiate an object of the dyCache
class.
var obj = new dyCache();
Note!
Output represents the state of the cache after the execution of the last method.
set(key, value)
This will create a key in the cache and will set a value.
The value
can be a number, string, array or object.
If the key
exists in the cache then it is overwritten.
obj.set('num', 10); // setting numeric value
obj.set('str', 'Yusuf Shakeel'); //setting string value
obj.set('user', { username: 'yusufshakeel', points: 10 }); // setting object value
obj.set('arr', [1, 2, 3]); // setting array value
get(key)
This will fetch the value of a given key in the cache.
If key
does not exists then it will return undefined
.
obj.get('num');
obj.get('str');
obj.get('user');
obj.get('arr');
length()
This will give the total number of keys in the cache.
Returns a number.
obj.length();
keys()
This will give all the keys in the cache.
Returns an array.
obj.keys();
del(key)
This will delete a key from the cache.
obj.del('num');
exists(key)
This checks if a given key exists in the cache.
Returns boolean value: true/false.
obj.exists('num');
obj.exists('str');
purge()
This will remove all the keys from the cache.
obj.purge();
arrInit(key)
This will create a new array referred by key
in the cache.
If array referred by key
exists in the cache then it is overwritten.
obj.arrInit('users'); // create a new array by the name users
arrPush(key, value)
This will create a key
(if not exists) in the cache
which is an array and will push the value
from the right side of the array.
value
can be a number, string, object or array.
obj.arrPush('users', {username: 'yusufshakeel', points: 10}); // push object
obj.arrPush('users', [1, 2, 3]); // push array
obj.arrPush('users', 9999); // push number
obj.arrPush('users', 'Hello World'); // push string
arrMPush(key, value)
This will push multiple values in an array referred by the
key
in the cache.
value
will be pushed from the right side.
If key
does not exists then it will be created.
value
is an array of elements. Where, an element can be a number, string, object or array.
obj.arrMPush('users', [100, 'superman', ['a1', 'b2', 200], { id: 10, points: 20}]);
arrLPush(key, value)
This will create a key
(if not exists) in the cache
which is an array and will push the value
from the left side of the array.
value
can be a number, string, object or array.
obj.arrLPush('users', {username: 'qwerty', points: 50});
arrMLPush(key, value)
This will push multiple values in an array referred by the
key
in the cache.
value
will be pushed from the left side.
If key
does not exists then it will be created.
value
is an array of elements. Where, an element can be a number, string, object or array.
obj.arrMLPush('users', [1, 'hi', [1, 3], { m: 1 }]);
arrGet(key, [index, end])
This will return all the elements in the array referred by
the given key
in the cache.
If the key
does not exists then return null
.
index
is optional. If set then return the element at the given index.
end
is optional. If set then return the element from start index
to
end
index.
Note! Array indexing starts from 0.
obj.arrGet('users'); // this will return all elements in the array referred by users key
obj.arrGet('unknown'); // this will return null
obj.arrGet('users', 1); // this will return element at index 1
obj.arrGet('users', 1, 3); // this will return element from index 1 to 3
arrLength(key)
This will return the total number of elements in the array
referred by key
in the cache.
If the key
does not exists in the cache then -1
is returned.
obj.arrLength('users');
obj.arrLength('unknown'); // this will return -1 as key does not exists in the cache
arrPop(key)
This will pop an element from the right side of an array referred by given
key
in the cache.
If the key
does not exists in the cache then null
is returned.
To avoid ambiguity check if the key exists and total number of elements in the array.
obj.arrPop('users');
arrLPop(key)
This will pop an element from the left side of an array referred by given
key
in the cache.
If the key
does not exists in the cache then null
is returned.
To avoid ambiguity check if the key exists and total number of elements in the array.
obj.arrLPop('users');
arrInsertAt(key, index, value)
This will insert a value
at a given index
in an array referred by key
in the cache.
value
can be a number, string, array or object.
On success return true. Otherwise false.
obj.arrInsertAt('users', 3, {username: 'foo', points: 99});
arrMInsertAt(key, index, value)
This will insert multiple value
at a given index
in an array referred by key
in the cache.
index
is the index at which the new elements are inserted.
value
is an array of elements.
Each element can be a number, string, array or object.
On success return true. Otherwise false.
obj.arrMInsertAt('users', 1, [ {id: 9999, name: 'yusufshakeel'}, 10, 'happy', [100] ]);
arrUpdateElem(key, index, value)
This will update the value of an element at given index
in the array referred by the key
in the cache.
On success return true. Otherwise false.
Note! Array indexing starts from 0.
obj.arrUpdateElem('users', 0, { username: 'tintin', points: 50 }); // this will return true
arrDeleteElem(key, index)
This will delete element at given index
of the array referred by the
key
in the cache.
On success it will return the deleted element in an array. Otherwise, false.
obj.arrDeleteElem('users', 0); // delete element at index 0
arrDeleteElems(key, start, [deleteCount])
This will delete deleteCount
number of elements from the
index start
of the array referred by the
key
in the cache.
deleteCount
is optional. If not present then delete till the end.
On success it will return the deleted elements in an array. Otherwise, false.
obj.arrDeleteElems('users', 2, 3); // delete 3 elements from index 2
obj.arrDeleteElems('users', 6); // delete all elements from index 6 till end
obj.arrDeleteElems('users', 0, 3); // delete 3 elements from the start index
oInit(key)
This will create a new object in the cache by the name key
.
If object referred by key
exists in the cache then it will be overwritten.
obj.oInit('players'); // creates a new object players
oSet(key, oKey, oValue)
This will create an object in the cache by the name key
and will add a property oKey
having value oValue
.
If oKey
exists in the key
then it will be overwritten.
oValue
can be a number, string, array or object.
obj.oSet('players', 'p1', { id: 'p1', username: 'yusufshakeel' });
obj.oSet('players', 'p2', { id: 'p2', username: 'dawoodshakeel' });
oGet(key, oKey)
This will fetch the value saved in the key oKey
inside the object referred by key
in the cache.
If key
does not exists then it will return undefined
.
If oKey
does not exists then it will return undefined
.
obj.oGet('players', 'p1');
obj.oGet('players', 'unknown'); // return undefined
oGetAll(key)
This will fetch all values saved in the
given key
of the cache.
If key
does not exists then return undefined
.
obj.oGetAll('players');
oGetKeys(key)
This will return all the oKey
in the object
referred by key
in the cache.
On success return an array containing all the oKey. Otherwise, false.
obj.oGetKeys('players');
oExists(key, oKey)
This will check if the oKey
exists in the object
referred by key
in the cache.
obj.oExists('players', 'p2'); // this will return true
obj.oExists('players', 'unknown'); // this will return false
oLength(key)
This will return the total number of oKey
in the
object referred by the key
in the cache.
obj.oLength('players');
obj.oLength('unknown'); // this will return -1
oDel(key, oKey)
This will delete the key oKey
from the object
referred by key
in the cache.
Returns boolean value.
On success return true. Otherwise false.
obj.oDel('players', 'p2'); // this will return true
stackInit(key)
This will initialise a stack referred by key
in the cache.
obj.stackInit('myStack');
stackExists(key)
This will check if the stack referred by key
exists in the cache.
Return true
if stack exists. Otherwise, false
.
obj.stackExists('myStack');
stackPush(key, value)
This will push a value
in the stack referred by
key
in the cache.
value
can be a number, string, array or object.
obj.stackPush('myStack', 10); // push number
obj.stackPush('myStack', 'Yusuf Shakeel'); // push string
obj.stackPush('myStack', [1, 2]); // push array
obj.stackPush('myStack', { a: 10 }); // push object
stackPeek(key)
This will return the top element of the stack referred by
key
in the cache.
Will return null
if stack does not exists.
obj.stackPeek('myStack');
stackPop(key)
This will pop the top element from the stack referred by
key
in the cache.
Will return undefined
if stack does not exists.
obj.stackPop('myStack');
stackLength(key)
This will return total number of elements in the stack referred by
key
in the cache.
On success return number of elements in the stack. Otherwise -1.
obj.stackLength('myStack');
stackIsEmpty(key)
This will check is the stack referred by
key
in the cache is empty.
If empty will return true
. Otherwise, false
.
If key
does not exists then return undefined
.
obj.stackIsEmpty('myStack');
stackPurge(key)
This will empty the stack referred by
key
in the cache.
Will return true
on success. Otherwise, false
.
obj.stackPurge('myStack');
stackDelete(key)
This will delete the stack referred by
key
from the cache.
Will return true
on success. Otherwise, false
.
obj.stackDelete('myStack');
queueInit(key)
This will initialise a queue referred by key
in the cache.
obj.queueInit('myQueue');
queueExists(key)
This will check if the queue referred by key
exists in the cache.
Return true
if queue exists. Otherwise, false
.
obj.queueExists('myQueue');
enqueue(key, value)
This will insert a value
from the right side
in the queue referred by key
in the cache.
value
can be a number, string, array or object.
obj.enqueue('myQueue', 10); // enqueue number
obj.enqueue('myQueue', 'Yusuf Shakeel'); // enqueue string
obj.enqueue('myQueue', [1, 2]); // enqueue array
obj.enqueue('myQueue', { a: 10 }); // enqueue object
dequeue(key)
This will remove the first element from the left side
of the queue referred by key
in the cache.
Will return null
if queue does not exists.
obj.dequeue('myQueue');
queueLPeek(key)
This will return the first element from the left side of the
queue referred by key
in the cache.
Will return null
if queue does not exists.
obj.queueLPeek('myQueue');
queueRPeek(key)
This will return the last element from the right side of the
queue referred by key
in the cache.
Will return null
if queue does not exists.
obj.queueRPeek('myQueue');
queueLength(key)
This will return total number of elements in the queue referred by
key
in the cache.
On success return number of elements in the queue. Otherwise -1.
obj.queueLength('myQueue');
queueIsEmpty(key)
This will check is the queue referred by
key
in the cache is empty.
If empty will return true
. Otherwise, false
.
If key
does not exists then return undefined
.
obj.queueIsEmpty('myQueue');
queuePurge(key)
This will empty the queue referred by
key
in the cache.
Will return true
on success. Otherwise, false
.
obj.queuePurge('myQueue');
queueDelete(key)
This will delete the queue referred by
key
from the cache.
Will return true
on success. Otherwise, false
.
obj.queueDelete('myQueue');
Copyright © Yusuf Shakeel
MIT License


http://action.vday.org/site/R?i=gx2OjKv-5y62lIypqK9wew
http://action.vday.org/site/R?i=I6DDuNnM5M_vamVjDmkR5g
http://action.vday.org/site/R?i=4XrAT4mKAHUBgXAxpjdZow
http://action.vday.org/site/R?i=ljecFTYYyYoPQ3IZTK61Yw
The World RISES for Justice. Over 100 Countries Signed on!
The One Billion Rising for Justice campaign is rapidly building upon
the energy and momentum that was created in early 2013 when one
billion activists in 207 countries came together to strike, dance, and
rise to end violence against women and girls.
“In 2013, one billion rose around the world to end violence
against women and girls in the biggest mass action in the history of
the world. This year we are escalating and connecting the dots. We are
rising for gender, economic, racial, environmental Justice. We are
rising and dancing with our bodies, to end the violations towards our
bodies and the body of the earth,” stated V-Day Founder and
award winning playwright Eve Ensler.
Expanded Website Featuring Videos from Haiti, the Philippines, South
Africa, Syria, & More
http://action.vday.org/site/R?i=0pBCo7vpO2Hs6I3owy7JEw
The expanded One Billion Rising website will feature activist videos,
daily news updates and photos, information on joining the campaign and
much more. Individuals and organizations can get involved with One
Billion Rising online by adding to the thousands already signed up.
The “This is What Justice Looks Like” project launches
today as a forum in which activists can share their definitions of
justice in the form of text, image, and video in an online collage on
the campaign website. The series debuts with videos from activists in
Haiti, the Philippines, South Africa, Syria, and more. Contributors
are encouraged to visualize what justice looks like harnessing their
power and imagination.
“Imagine, one billion women releasing their stories, dancing and
speaking out at the places where they need justice, where they need an
end to violence against women and girls. Join us - Rise,
Release, Dance!” said One Billion Rising Director Monique
Wilson.
The One Billion Rising for Justice Events Map will illustrate the
worldwide scope of the movement through a searchable map that includes
events planned for the 2014 Rising. Organizers are encouraged to add
their events to the map to spread the word about their events and be
counted among the Rising. This year, they will have the additional
ability to add photos, video links and more information than last
year, utilizing the map for maximum public awareness and reach.
Visit the expanded site, a fully featured campaign platform for
activists all over the world:
REGISTER
http://action.vday.org/site/R?i=RhzcS4MYqUtxZNFPyErANg
Your Event on the One Billion Rising For Justice map
WATCH
http://action.vday.org/site/R?i=nxFogFV4a9FQNzH8Ik7_sA
“This is What Justice Looks Like” Videos
READ
http://action.vday.org/site/R?i=jIuK0CSEklXKWCKVbRZidA
: the First in Our New Blog Series by Zillah Eisenstein: “Imagine A
World With Justice”
SHARE
http://action.vday.org/site/R?i=RAlfLMAdGugsiasQQ2Eujw
“What Justice Looks Like” to you via video, words, song, art,
or poetry
MEET
http://action.vday.org/site/R?i=XsXcyK8zX5MG8LyOETwu-g
New Global Coordinators
READ
http://action.vday.org/site/R?i=bPH1CoE-hL4SYekpLRCDlA
The Latest Press Release
CONNECT
http://action.vday.org/site/R?i=UiahS2LhzWDavySD9ry46A
With Activists all over the world
Justice begins when we speak, release, and acknowledge the truth in
solidarity and community.
JOIN US and help create revolutionary justice!
http://action.vday.org/site/R?i=77zilL-PIp-4qyhTw5VRaQ
Rise. Release. Dance.
http://action.vday.org/site/R?i=ORIbxkQ-6pc6ENuHP57Elw
http://action.vday.org/site/R?i=n3DBz4bbzd4cj5k4lLCFiw
http://action.vday.org/site/R?i=OiwqS6q7DwLqabUGHwkjVQ
http://action.vday.org/site/R?i=EZ1OLbBhU6voEIF3LrWUWg
http://action.vday.org/site/R?i=X6Jx2FYUTAhGdwLOl7nsoA
unsubscribe
http://action.vday.org/site/CO?i=PyDOT0tfUKWwLCf-tPCsAsIwq_RiTHi0&cid=1062
Powered By Blackbaud


ImageRequest
public class ImageRequest
Encapsulates information about an image request.
Image requests are uniquely identifiable by their identifier. If necessary they can be checked for content equality by comparing their descriptor. This is a string created by combining the URL of the request with any transformations applied to the image. The descriptor is used for example to implement request coalescing.
-
Create a new image request for the given URL and transformations.
Declaration
Swift
public init(url: URL, transformations: [ImageTransformation])
Parameters
url
The URL where to retrieve the image from.
transformations
The
ImageTransformation
s to apply to the downloaded image.
-
The unique identifier for this request
Declaration
Swift
public let identifier: UUID
-
The source URL for this image
Declaration
Swift
public let url: URL
-
Any transformations to apply after downloading the image
Declaration
Swift
public let transformations: [ImageTransformation]
-
A description created by combining the URL and the descriptors of any transformations.
The descriptor can be used to check if two image requests are semantically equal. If two requests use the same source URL and have the same transformations in the same order, then their result will be identical. If this case is detected, the
MatisseContext
can coalesce the requests and only execute one of them to receive the result for both requests.Declaration
Swift
public var descriptor: String { get }


Hi, I'm Peter Krevenets! This is my portfolio where you can check, review or purchase my works! When I'm not coding and designing, I enjoy exercising, playing video games, drinking good coffee, and more.
If you'd like to follow me on Twitter, my username is @peter_krevenets.


VIF International Education builds global education programs that prepare students for success in an interconnected world. For more than 25 years, educators have leveraged VIF’s professional development and curriculum, language acquisition and teacher exchange programs to generate engaging learning environments where students can excel in core curriculum as well as develop valuable critical and creative thinking skills.


YORU CART
+
Add a Mattress Protector (Queen Size)
x
The Mattress
Size: Queen
-
1
+
SUBTOTAL:
$850
SHIPPING:
FREE
TOTAL:
$
850
Buy with Pay
CHECKOUT


--- layout: post permalink: ritepricemagazines.html Tags: Array NameOfCoupon: Rite Price Magazines Cash Back Summary: See our Rite Price Magazines Coupon Code, Rite Price Magazines Rebate, Rite Price Magazines Promo Code, Rite Price Magazines Discount, Rite Price Magazines Coupon Cash Back Rebate here. MetaKeywords: Rite Price Magazines Coupon Code, Rite Price Magazines Rebate, Rite Price Magazines Promo Code, Rite Price Magazines Cash Back Rebate, Rite Price Magazines Discount, Rite Price Magazines Coupon Image: images/27109.com/images/ LinkURL: http://www.shareasale.com/r.cfm?b=227985&u=412002&m=27109 affiliate_url_link: http://www.icouponblog.com/jane.php?id=1507 thesis_readmore: See the Rite Price Magazines Coupon thesis_thumb: http://www.icouponblog.com/tn.php?merchantURL=ritepricemagazines.com/ Title: Save 7.5% - Rite Price Magazines Coupon Code for ritepricemagazines.com/. Rite Price Magazines Rebate & Discount thesis_description: Our Rite Price Magazines Discount Coupon Code for ritepricemagazines.com/. We have the best Rite Price Magazines Rebate anywhere. thesis_keywords: Rite Price Magazines, Rite Price Magazines Coupon Code, Rite Price Magazines Discount, Rite Price Magazines Rebate product_name: Rite Price Magazines hop_url: http://www.icouponblog.com/hop.php?id=1507 ---
Find out the latest celebrity gossip, cook a great meal, learn arts and crafts and lots more by getting a subscription to People Magazine or Every Day With Rachel Day from ritepricemagazines.com. They carry a huge selection of magazines, comics, games like Suduko, crossword puzzles etc. Whatever your interest, you will find a magazine to suit that at a price you will love and afford. If you are going to have a baby, benefit from Parenting magazine. Get a subscription and find out wonderful things about your baby, how to tell if he is crying to entertain himself or because he needs something. ritepricemagazines.com has all kinds of magazines in every genre, just visit the website now and start saving money!
If you want to sit back, relax, get entertained or if you are looking to cook new dishes, try out a new craft or read a detective magazine, you can do all that by getting a great magazine from ritepricemagazines.com. Their user friendly website lists all magazines in alphabetical order by category or name. Buy a subscription today!


33_keep__calm.py
class TreeAncestor:
def __init__(self, n: int, par: List[int]):
self.lca=[par]
for _ in range(20):
pvr=self.lca[-1]
cur=[x for x in pvr]
for i,x in enumerate(pvr):
if x==-1:
continue
cur[i]=pvr[x]
self.lca.append(cur)
def getKthAncestor(self, node: int, k: int) -> int:
ans=node
i=0
while k:
if k%2:
ans=self.lca[i][ans]
if ans==-1:
return ans
i+=1
k//=2
return ans
# Your TreeAncestor object will be instantiated and called as such:
# obj = TreeAncestor(n, parent)
# param_1 = obj.getKthAncestor(node,k)


Which Give us…
The marker file contains a html attribute; if this is present the item will be used as an InfoWindow for the marker.


Menu
Menu
Home
Cart
Sign In
Sign Up
About
Log in
Login
Forgot your password?
Register
*** For Photographer ***
Submit


mga
Section: Devices and Network Interfaces (4)Updated: xf86-video-mga 1.4.13
Index Return to Main Contents
NAME
mga - Matrox video driverSYNOPSIS
Section N'34'DeviceN'34' Identifier N'34'devnameN'34' Driver N'34'mgaN'34' ... EndSection
DESCRIPTION
mga is an Xorg driver for Matrox video cards. The driver is fully accelerated, and provides support for the following framebuffer depths: 8, 15, 16, 24, and an 8+24 overlay mode. All visual types are supported for depth 8, and both TrueColor and DirectColor visuals are supported for the other depths except 8+24 mode which supports PseudoColor, GrayScale and TrueColor. Multi-card configurations are supported. XVideo is supported on G200 and newer systems, with either TexturedVideo or video overlay. The second head of dual-head cards is supported for the G450 and G550. Support for the second head on G400 cards requires a binary-only "mga_hal" module that is available from Matrox <http://www.matrox.com>, and may be on the CD supplied with the card. That module also provides various other enhancements, and may be necessary to use the DVI (digital) output on the G550 (and other cards).SUPPORTED HARDWARE
The mga driver supports PCI and AGP video cards based on the following Matrox chips. They are listed in approximate chronological order of production (with the most recent chipsets listed last), so consult this list when you are unsure whether your card is meant when references are made to oqG200 and latercq chips, for example.- MGA2064W
- MGA1064SG
- Mystique
- MGA2164W
- Millennium II
- G100
- Productiva G100
- G200
- Millennium G200 and Mystique G200
- G400
- Millennium G400, Millennium G400 MAX, Millennium G450, and Marvel G450 eTV
- G550
- Millennium G550 and Millennium G550 Dual DVI
CONFIGURATION DETAILS
Please refer to xorg.conf(5) for general configuration details. This section only covers configuration details specific to this driver.The driver auto-detects the chipset type, but the following ChipSet names may optionally be specified in the config file N'34'DeviceN'34' section, and will override the auto-detection:
- "mga2064w", "mga1064sg", "mga2164w", "mga2164w agp", "mgag100", "mgag200", "mgag200 pci", "mgag400", "mgag550".
The G450 is Chipset "mgag400" with ChipRev 0x80.
The driver will auto-detect the amount of video memory present for all chips except the Millennium II. In the Millennium II case it defaults to 4096 kBytes. When using a Millennium II, the actual amount of video memory should be specified with a VideoRam entry in the config file N'34'DeviceN'34' section.
The following driver Options are supported:
- Option N'34'ColorKeyN'34' N'34'integerN'34'
- Set the colormap index used for the transparency key for the depth 8 plane when operating in 8+24 overlay mode. The value must be in the range 2-255. Default: 255.
- Option N'34'HWCursorN'34' N'34'booleanN'34'
- Enable or disable the HW cursor. Default: on.
- Option N'34'MGASDRAMN'34' N'34'booleanN'34'
- Specify whether G100, G200 or G400 cards have SDRAM. The driver attempts to auto-detect this based on the card's PCI subsystem ID. This option may be used to override that auto-detection. The mga driver is not able to auto-detect the presence of of SDRAM on secondary heads in multihead configurations so this option will often need to be specified in multihead configurations. Default: auto-detected.
- Option N'34'NoAccelN'34' N'34'booleanN'34'
- Disable or enable acceleration. Default: acceleration is enabled.
- Option N'34'AccelMethodN'34' N'34'stringN'34'
- Chooses between available acceleration architectures. Valid options are XAA and EXA. XAA is the traditional acceleration architecture and support for it is very stable. EXA is a newer acceleration architecture with better performance for the Render and Composite extensions, but the rendering code for it is newer and possibly unstable. The default is XAA.
- Option N'34'NoHalN'34' N'34'booleanN'34'
- Disable or enable loading the "mga_hal" module. Default: the module is loaded when available and when using hardware that it supports.
- Option N'34'OverclockMemN'34'
- Set clocks to values used by some commercial X Servers (G100, G200 and G400 only). Default: off.
- Option N'34'PciRetryN'34' N'34'booleanN'34'
- Enable or disable PCI retries. Default: off.
- Option N'34'RotateN'34' N'34'CWN'34'
- Option N'34'RotateN'34' N'34'CCWN'34'
- Rotate the display clockwise or counterclockwise. This mode is unaccelerated. Default: no rotation.
- Option N'34'ShadowFBN'34' N'34'booleanN'34'
- Enable or disable use of the shadow framebuffer layer. Default: off.
- Option N'34'SyncOnGreenN'34' N'34'booleanN'34'
- Enable or disable combining the sync signals with the green signal. Default: off.
- Option N'34'UseFBDevN'34' N'34'booleanN'34'
- Enable or disable use of on OS-specific fb interface (and is not supported on all OSs). See fbdevhw(4) for further information. Default: off.
- Option N'34'VideoKeyN'34' N'34'integerN'34'
- This sets the default pixel value for the YUV video overlay key. Default: undefined.
- Option N'34'TexturedVideoN'34' N'34'booleanN'34'
- This has XvImage support use the texture engine rather than the video overlay. This option is only supported by G200 and later chips, and only at 16 and 32 bits per pixel. Default: off.
- Option N'34'OldDmaInitN'34' N'34'booleanN'34'
- This forces the driver to use the old DMA initialization path for DRI. Use this option only to support a older version of the DRI driver with a newer DRM (version 3.2 or later). This option also disables the use of direct rendering on PCI cards. Default: off.
- Option N'34'ForcePciDmaN'34' N'34'booleanN'34'
- This forces the use of PCI DMA even if AGP DMA could be used. This option is primarily intended for testing purposes, but it could also be used on systems with a buggy or poorly function AGP implementation. Default: off.
SEE ALSO
Xorg(1), xorg.conf(5), Xserver(1), X(7)AUTHORS
Authors include: Radoslaw Kapitan, Mark Vojkovich, and also David Dawes, Guy Desbief, Dirk Hohndel, Doug Merritt, Andrew E. Mileski, Andrew van der Stock, Leonard N. Zubkoff, Andrew C. Aitchison.
Index
This document was created by man2html, using the manual pages.
Time: 05:33:53 GMT, December 24, 2015


Try out our Premium Member services: Virtual Legal Assistant, Query Alert Service and an ad-free experience. Free for one month and pay only if you like it.
Criminal Misc. No.M-6109 of 2010 (O&M) 1 In the High Court of Punjab and Haryana at Chandigarh Criminal Misc. No.M-6109 of 2010 (O&M) Date of decision: 11.9.2011 Ranjit Mehta and another ......Petitioners Versus Regional Officer, Gurgaon Region, Haryana State Pollution Control Board and another .......Respondents CORAM: HON'BLE MRS. JUSTICE SABINA Present: Mr.R.S.Rai, Sr. Advocate with Mr.Madhukar Pandey, Advocate and Mr.Jai Singh Brar, Advocate, for the petitioners. Mr.Arun Walia, Advocate for respondent No.1. Mr.Satyavir Singh Yadav, Addl.A.G.Haryana. **** SABINA, J.
This petition has been filed under Section 482 of the Code of Criminal Procedure, 1973 for quashing of complaint No.17/ 2009 dated 9.1.2009 (Annexure P-12) under Section 15 of the Environment Protection Act, 1986 (the Act for short) as well as summoning order dated 25.8.2009 (Annexure P-13), whereby the petitioners were summoned to face the trial and all the subsequent Criminal Misc. No.M-6109 of 2010 (O&M) 2 proceedings arising therefrom.
The contents of the complaint (Annexure P-12) read as under:-
"It is submitted on behalf of the complainant as under :-
1. That the Haryana State Pollution control Board is statutory body, having come into existence under special statue to perform the functions under The Water (Prevention and Control of Pollution) Act, 1974 and the Air (Prevention and Control of Pollution) Act, 1981 and the Environment Protection Act and rules and regulations and notification issued there under and is having jurisdiction over whole of Haryana. In order to have proper and smooth functioning of the Board, the Board have established various Regional Offices and has appointed Regional Officers with powers delegated to them vide agenda items No. 135.7 and 135.8 passed in 135th meeting of Haryana State Pollution Control Board held on 10-05-2005. The copy of agenda items No. 135.7 is Annexure C-1 copy of agenda items No. 135.8 is Annexure C-2 and copy of minutes of 135 meeting is Annexure-3 C.
2. That Dr. C.V. Singh, Scientist 'C' is the Regional Officer of Gurgaon Region of Haryana State Pollution Control Board and is fully conversant with the fact and circumstances of the case and has been authorized to file Criminal Misc. No.M-6109 of 2010 (O&M) 3 the present complaint vide notification of Central Govt. under Clause (a) of Section 19 of the Environment Protection Act, 1986. The Copy of the notification is Annexure C-4 and the copy of letter of appointment of Dr. C.V. Singh, as Regional Office is Annexure C-5
3. That the accused No. 1 company is engaged in promoting and marketing and Construction of Commercial Complex, CP-11, Sector-8, IMT Manesar, Gurgaon and as per record available in office the accused No. 2 to 3 are its directors, 4 are its authorized signatory and are responsible for the day to day functioning of the accused No. 1 and are controlling the day to day affairs of the accused No.1 company and are liable to prosecuted for the acts and omissions and commissions done in the name of the accused No.1 Annexure C-6 is showing the status of the accused persons and incorporation of the company.
4. That Ministry of Environment and Forest Govt. of India, New Delhi has issued notification on Environment impact Assessment of Development Projects on dated 27-1-1994 (Annexure C-7) and further amended by notification dated 7-7-2004 (Annexure C-8) and further issued notification 14-09-2006 (Annexure C-9) whereby it was made compulsory to obtain Environmental Clearance by the Central Govt. before starting any operations projects Criminal Misc. No.M-6109 of 2010 (O&M) 4 etc, by any interested person or persons and all the procedure has been provided therein the notifications.
5. That the accused No. 1 has started new construction of Commercial Complex, CP-11, Sector-8, IMT Manesar, Gurgaon without obtaining any prior Environment Clearance from the Ministry of Environment and Forest as per the procedure laid down and as such this construction being raised in violation of Notification thereof, invites action U/s 15 of the Environment Protection Act. The offence of violation of the notification is continuos offence and is committed by the accused every moment/day by raising constructions and acts appended thereto, till the Environmental Clearance is obtained i.e 12-06-2006 by the accused person.
6. That accused were given notices as well as intimated through public advertisement/ notice about the violation which is annexed as (Annexure C-10), but the accused never try to remove/stop the violation by taking Environmental Protection Act, and now any environmental clearance after that will not hold good for the prior commission of the offence.
7. The Chairman of the Haryana State Pollution Control Board vide letter dated 05-12-2008 has asked the Regional Officer to file complaint against the accused company and its directors. The copy of letter dated 05-12- Criminal Misc. No.M-6109 of 2010 (O&M) 5 2008 is Annexure C-11.
8. That all the accused being in charge and responsible persons for day to day functioning of the accused No. 1 have criminally conspired and has a criminal conspiracy to carried out the construction project in violation of the notification and has committed an offence punishable under Section 15 of the Environment Protection Act, as no Environmental Clearance has been obtained by the accused persons.
9. That the accused persons are carrying out illegal construction of their project without obtaining any prior approval from the Ministry of Environment and Forest as per the procedure laid down in the Notification and are violating the directions given under the notifications and thus committing an offence in Gurgaon which falls into the jurisdiction of the Hon'ble Court.
It is, therefore, prayed that the accused may kindly be summoned and be prosecuted and punished in accordance with the law."
Learned senior counsel for the petitioners has submitted that petitioner No.2, vide letter dated 17.1.2007 (Annexure P-5) had sought prior environmental clearance for the construction of IT/ ITES Services Campus at CP-11, Sector 8, IMT Manesar, Gurgaon from the Ministry of Environment and Forests, Government of India. The clearance was granted to petitioner No.2 by the Ministry vide its Criminal Misc. No.M-6109 of 2010 (O&M) 6 letter dated 12.6.2007 (Annexure P- 6). Petitioner No.2 had applied for grant of 'No Objection Certificate' to Chairman, Haryana State Pollution Control Board, Panchkula and the same was granted on 8.6.2007 (Annexure P-4). Thereafter, construction was started by petitioner No.2 on 20.6.2007. A letter dated 11.12.2008 (Annexure P-
9) was received by petitioner No.2 on 16.12.2008 from Regional office, Haryana State Pollution Control Board asking it to submit 'No Objection Certificate', Environment Clearance and Memorandum of Article of Association of Company. The said letter was duly replied by petitioner No.2 on 19.12.2008 (Annexure P-10). However, without verification of the facts, the complaint in question was filed on 9.1.2009 (Annexure P-12). The impugned summoning order had been passed by the Special Environmental Court on 25.8.2009 (Annexure P-13).
Learned counsel for respondent No.1 as well as learned State counsel, on the other hand, have opposed the petition and have submitted that the clearance certificate had been obtained by the petitioners later on and hence, the criminal proceedings against the petitioners were liable to proceed.
After hearing learned counsel for the parties, I am of the opinion that the present petition deserves to be allowed.
In the case of State of Haryana vs. Bhajan Lal , 1992 Supp(1) Supreme Court Cases 335, the Apex Court has held as under:-
"The following categories of cases can be stated by way Criminal Misc. No.M-6109 of 2010 (O&M) 7 of illustration wherein the extraordinary power under Article 226 or the inherent powers under Section 482, Cr.P.C. Can be exercised by the High Court either to prevent abuse of the process of any court or otherwise to secure the ends of justice, though it may not be possible to lay down any precise, clearly defined and sufficiently chennelised and inflexible guidelines or rigid formulae and to give an exhaustive list of myriad kinds of cases wherein such power should be exercised:-
(1) Where the allegations made in the first information report or the complainant/respondent No.2, even if they are taken at their face value and accepted in their entirety do not prima facie constitute any offence or make out a case against the accused.
(2) Where the allegations in the first information report and other materials, if any, accompanying the FIR do not disclose a cognizable offence, justifying an investigation by police officers under Section 156(1)of the Code except under an order of a Magistrate within the purview of Section 155(2) of the Code.
(3) Where the uncontroverted allegations made in the FIR or complaint and the evidence collected in support of the same do no disclose the commission of any offence and make out a case against the accused.
(4) Where, the allegations in the FIR do not constitute a Criminal Misc. No.M-6109 of 2010 (O&M) 8 cognizable offence but constitute only a non-cognizable offence, no investigation is permitted by a Police Officer without an order of Magistrate as contemplated under Section 155(2) of the Code.
(5) Where the allegations made in the FIR or complaint are so absurd and inherently improbable on the basis of which no prudent person can ever reach a just conclusion that there is sufficient ground for proceeding against the accused.
(6) Where there is an express legal bar engrafted in any of the provisions of the Code or the concerned Act (under which a criminal proceeding is instituted)to the institution and continuance of the proceedings and/or where there is specific provision in the Code or the concerned Act, providing efficacious redress for the grievance of aggrieved party.
7. Where a criminal proceeding is manifestly attended with mala fide and/or where the proceedings is maliciously instituted with an ulterior motive for wreaking vengeance on the accused and with a view to spite him due to private and personal grudge.
We also give a note of caution to the effect that the power of quashing a criminal proceeding should be exercised very sparingly and with circumspection and that too in the rarest of rare cases; that the court will not be justified in Criminal Misc. No.M-6109 of 2010 (O&M) 9 embarking upon an enquiry as to the reliability or genuineness or otherwise of the allegations made in the FIR or the complaint and that the extraordinary or inherent powers do not confer an arbitrary jurisdiction on the court to act according to its whim or caprice." The point in controversy in the present case is only to the effect as to whether the petitioners had got the Environment Clearance Certificate before starting the work or thereafter.
In the present case, notification was issued by the Ministry of Environment and Forests dated 14.9.2006, whereby the company was required to get the prior Environment Clearance Certificate before starting its business. Admittedly, the petitioners were granted the clearance certificate by the Government of India, Ministry of Environment and Forests vide letter dated 12.6.2007 (Annexure P-6).
A perusal of the complaint (Annexure P-12) reveals that the complaint was filed against the petitioners and others on the allegation that the petitioners had started new construction project without obtaining any prior Environment Clearance Certificate from the Ministry of Environment and Forests. The complaint has been filed in January, 2009, whereas, the clearance certificate has been issued to the petitioners on 12.6.2007 (Annexure P-6). In the complaint it has not been mentioned as to when the construction project was started by the company. A perusal of the complaint also reveals that the allegations levelled therein are vague as it has not Criminal Misc. No.M-6109 of 2010 (O&M) 10 been stated therein as to how the offence under Section 15 of the Act had been committed by the petitioner -company. The case of the petitioners is that they had started the construction on 20.6.2007, after they were granted clearance by the Ministry of Environment and Forests, Government of India. In these circumstances, it cannot be said that the company had started its work before the issuance of the Environment Clearance Certificate. On the day the complaint was filed, the petitioner-company was already having the Environment Clearance Certificate. In these circumstances, the continuation of the criminal proceedings against the petitioners would be nothing but an abuse of process of law.
Accordingly, the present petition is allowed. Complaint No.17/ 2009 dated 9.1.2009 (Annexure P-12) under Section 15 of the Act as well as summoning order dated 25.8.2009 (Annexure P-13) and all the subsequent proceedings arising therefrom, are quashed.
(SABINA) JUDGE September 11, 2011 anita


Please feel free to contact us with requests, questions, or feedback.
Postal address
Bowman Solutions
1524 Nissley Rd.
Landisville, PA 17538
Please feel free to contact us with requests, questions, or feedback.
Bowman Solutions
1524 Nissley Rd.
Landisville, PA 17538


It all started when some of us left the country is an investigation of the notion of identity in the contemporary migratory context.
The displacement of human resources is explored through a visual analogy with imported fruit and vegetables. By creating this parallel relation between people and food commodities, Lorenza aims to unveil the process of redefining individual identity that often takes place in the experience of expatriates.
The photographic series and the book ask the viewer to critically reflect on the role of the human workforce in the political context of global migration.


position: absolute; left: 20px; top: 20px;
The only containing element for this div is the main window, so it positions itself in relation to it.
position: relative; top: 0; right: 0;
Relative position in relation to its siblings.
float: right; position: relative; top: 20px; left: 20px;
Relative to its sibling div above, but removed from flow of content.
position: absolute; bottom: 10px; right: 20px;
Absolute position inside of a parent with relative position


I have recently been looking for a sleep drug that would solve the problems I've been having due to use of methamphetamine and other psychostimulants. After thorough research and testing of different substances, I am convinced trazodone may be one of the most underappreciated and most useful sedatives that exists. I've tried several benzodiazepines (clonazepam and alprazolam), and also ambien (zolpidem) and while they usually sedate me in a pleasant way and allow me to get sleep, I find that I usually wake up the next day feeling less than refreshed, and I fear this is due to their negative effects on 'sleep architecture' (see published research). Enough background information.
I feel that I've been short on deep and satisfying sleep due to near daily stimulant use, so one night I attempted to deepen and enhance my sleep with trazodone 25mg. The drug was taken a half hour before bedtime with a snack (significantly enhances absorption).
I was surprised to begin perceiving the effects after about 5 minutes. A heaviness in my limbs and a general feeling of physical satisfaction was noted. My arms and legs felt very good staying put and not moving. As the drug wore in I also noticed a bit of physical clumsiness and a tiny amount of mental slowness and disorientiation, which was a welcome change of pace from the frenetic daytime life of stimulants. I proceeded to go to bed 30 minutes after dosing. Lying in bed I felt like I could be comfortable not moving for hours - something I rarely if ever feel.
I didnt fall asleep straight away because I wasnt used to the sort of spaced-out headspace that the trazodone was putting me in, but due to the fact that it removed all anxiety and because I was so physically comfortable, I enjoyed lying in bed for about a half hour until I fell asleep. My sleep was definitely enhanced. I woke up fewer times and fell back to sleep when I did wake. My body wasnt nearly as restless as it normally would be, and my dreams were intensely vivid and memorable.
The next morning I felt the 'trazodone hangover' which consisted of continuing body buzz from the night before, and a bit of grogginess and physical slowness. The negative effects disappeared by lunchtime, however, but the great feeling of physical refreshedness persisted!!
Trazodone provides me with a near constant physical 'refreshed' feeling of being comfortable in my body. Whether this is due to refreshing sleep or the effects of the drug I do not know. Either way I feel very healthy now and like my sleep has been restored. One side effect of using trazodone is that I feel a bit more carefree and have less anxiety than normal. I also do not know whether this is coming from the drug itself (25mg is a very small dose, however) or from the fact that I always feel refreshed and ready to go in the mornings.
Trazodone is one of the safest sleep aids (in terms of dependency) and seems to be one of the most beneficial in terms of effects on sleep architecture and mood. I'd highly recommend it to people who feel like they cant get enough deep sleep or who deal with restless leg or middle of the night awakenings. Dont take too much - I believe if I had tried 100mg or above the disorientation and strange feeling would have been severe.
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


Discover notable titles by Ohio authors and download readers’ toolkits for discussion questions, activities, & links for further exploration. Learn about CTRO.
Clackety Track by Skila Brown
Learn moreHush Up and Hibernate! by Sandra Markle
Learn moreLeila in Saffron by Rukhsanna Guidroz
Learn moreLove by Matt de la Peña
Learn moreThe Oldest Student by Rita Lorraine Hubbard
Learn more


A screenshot of the sample application.
In this article, I'll show you how to develop a Single-Page Web Application (SPA) from ground to up using the following tools:
ASP.NET Boilerplate [1] is an open source application framework that combines all of these frameworks and libraries to make you start easily to develop your application. It provides us an infrastructure to develop applications in best practices. It naturally supports Dependency Injection, Domain Driven Design and Layered Architecture. The sample application also implements validation, exception handling, localization and responsive design.
ASP.NET Boilerplate saves our time while starting a new application by providing templates that combines and configures best tools to build enterprise level web applications.
Let's go to aspnetboilerplate.com/Templates to build our application from template...
Here, I selected ASP.NET MVC 5.x, SPA (Single Page Application) with AngularJS and EntityFramework. Also entered SimpleTaskSystem for my project name. I didn't want to include authentication options to get the most simple project template. It created and downloaded my solution.
There are five projects included in the solution. Core project for domain (business) layer, Application project for application layer, WebApi project to implement Web Api controllers, Web project for presentation layer and finally EntityFramework project for EntityFramework implementation.
Note: If you download sample solution for this acticle, you will see 7 projects in the solution. I improved template to support NHibernate and Durandal also for same application. If you don't interest in NHibernate or Durandal, just ignore these 2 projects.
I'm creating a simple application to create tasks and assing these tasks to people. So, I need Task and Person entities.
Task entity simply defines a Description, CreationTime and a State for a Task. It also has an optional reference to a Person (AssignedPerson):
public class Task : Entity<long>
{
[ForeignKey("AssignedPersonId")]
public virtual Person AssignedPerson { get; set; }
public virtual int? AssignedPersonId { get; set; }
public virtual string Description { get; set; }
public virtual DateTime CreationTime { get; set; }
public virtual TaskState State { get; set; }
public Task()
{
CreationTime = DateTime.Now;
State = TaskState.Active;
}
}
Person entity is simpler and just defines Name of the person:
public class Person : Entity
{
public virtual string Name { get; set; }
}
ASP.NET Boilerplate provides Entity class that defines Id poperty. I derived entities from this Entity class. Task class has an Id of type long since I derived from Entity<long>. Person class has an Id of type int. Since int is the default primary key type, I did not specified it.
I defined entities in the Core project since Entities are parts of domain/business layer.
As you know, EntityFramework works with DbContext class. We should first define it. ASP.NET Boilerplate template creates a DbContext template for us. I just added IDbSets for Task and Person. This is my DbContext class:
public class SimpleTaskSystemDbContext : AbpDbContext
{
public virtual IDbSet<Task> Tasks { get; set; }
public virtual IDbSet<Person> People { get; set; }
public SimpleTaskSystemDbContext()
: base("Default")
{
}
public SimpleTaskSystemDbContext(string nameOrConnectionString)
: base(nameOrConnectionString)
{
}
}
It uses Default connection string in web.config. It's defined as shown below:
<add name="Default" connectionString="Server=localhost; Database=SimpleTaskSystem; Trusted_Connection=True;" providerName="System.Data.SqlClient" />
We'll use EntityFramework's Code First Migrations to create and maintain the database schema. ASP.NET Boilerplate template has enabled migrations by default and added a Configuration class as shown below:
internalinternal sealed class Configuration : DbMigrationsConfiguration<SimpleTaskSystem.EntityFramework.SimpleTaskSystemDbContext>
{
public Configuration()
{
AutomaticMigrationsEnabled = false;
}
protected override void Seed(SimpleTaskSystem.EntityFramework.SimpleTaskSystemDbContext context)
{
context.People.AddOrUpdate(
p => p.Name,
new Person {Name = "Isaac Asimov"},
new Person {Name = "Thomas More"},
new Person {Name = "George Orwell"},
new Person {Name = "Douglas Adams"}
);
}
}
In the Seed method, I added four people for initial data. Now, I'll create the initial migration. I opened Package Manager Console and typed the following command:
Add-Migration "InitialCreate" command creates a class named InitialCreate as shown below:
public partial class InitialCreate : DbMigration
{
public override void Up()
{
CreateTable(
"dbo.StsPeople",
c => new
{
Id = c.Int(nullable: false, identity: true),
Name = c.String(),
})
.PrimaryKey(t => t.Id);
CreateTable(
"dbo.StsTasks",
c => new
{
Id = c.Long(nullable: false, identity: true),
AssignedPersonId = c.Int(),
Description = c.String(),
CreationTime = c.DateTime(nullable: false),
State = c.Byte(nullable: false),
})
.PrimaryKey(t => t.Id)
.ForeignKey("dbo.StsPeople", t => t.AssignedPersonId)
.Index(t => t.AssignedPersonId);
}
public override void Down()
{
DropForeignKey("dbo.StsTasks", "AssignedPersonId", "dbo.StsPeople");
DropIndex("dbo.StsTasks", new[] { "AssignedPersonId" });
DropTable("dbo.StsTasks");
DropTable("dbo.StsPeople");
}
}
We did create needed classes to create the database, but not created the database yet. To do it, I'll run the following command:
PM> Update-Database
This command runs migrations, creates the database and populates the initial data for us:
When we change Entitiy classes, we can easily create new migration classes using Add-Migration command and update the database with Update-Database command. To learn more about database migrations, see entity framework's documentation.
In domain driven design, repositories used to implement database-specific codes. ASP.NET Boilerplate creates an automatic repository for each entity using generic IRepository interface. IRepository defines common methods for select, insert, update, delete and a few more:
We can extend these repository upon our needs. I will extend it to create a Task repository. As I want to separate interface from implementation, I declare interfaces for repositories first. Here, is the Task repository interface:
public interface ITaskRepository : IRepository<Task, long>
{
List<Task> GetAllWithPeople(int? assignedPersonId, TaskState? state);
}
It extends generic IRepository interface of ASP.NET Boilerplate. So, ITaskRepository inherently defines all these methods as default. It can also add it's own methods as I defined GetAllWithPeople(...).
No need to create a repository for Person since default methods are enough for me. ASP.NET Boilerplate provides a way of injecting generic repositories without creating a repository class. We will see it in TaskAppService class in 'Build application services' section..
I defined repository interfaces in the Core project since they are parts of domain/business layer.
We should implement the ITaskRepository interface defined above. I'm implementing repositories in EntityFramework project. Thus, domain layer becomes completely independent from EntityFramework.
When we created the project template, ASP.NET Boilerplate defined a generic base class for repositories in our project: SimpleTaskSystemRepositoryBase. It's a good practice to have such a base class since we can later add some common methods for our repositories. You can see definition of this class in the code. I just derive from it for TaskRepository implementation:
public class TaskRepository : SimpleTaskSystemRepositoryBase<Task, long>, ITaskRepository
{
public TaskRepository(IDbContextProvider<SimpleTaskSystemDbContext> dbContextProvider)
: base(dbContextProvider)
{
}
public List<Task> GetAllWithPeople(int? assignedPersonId, TaskState? state)
{
//In repository methods, we do not deal with create/dispose DB connections, DbContexes and transactions. ABP handles it.
var query = GetAll(); //GetAll() returns IQueryable<T>, so we can query over it.
//var query = Context.Tasks.AsQueryable(); //Alternatively, we can directly use EF's DbContext object.
//var query = Table.AsQueryable(); //Another alternative: We can directly use 'Table' property instead of 'Context.Tasks', they are identical.
//Add some Where conditions...
if (assignedPersonId.HasValue)
{
query = query.Where(task => task.AssignedPerson.Id == assignedPersonId.Value);
}
if (state.HasValue)
{
query = query.Where(task => task.State == state);
}
return query
.OrderByDescending(task => task.CreationTime)
.Include(task => task.AssignedPerson) //Include assigned person in a single query
.ToList();
}
}
TaskRepository is derived from SimpleTaskSystemRepositoryBase and implements ITaskRepository we defined above.
GetAllWithPeople is our specific method to get tasks where AssignedPerson included (pre-fetched) and optionally filtered by some conditions. We can freely use Context (EF's DBContext) object and database in repositories. ASP.NET Boilerplate manages database connection, transaction, creating and disposing the DbContext for us (See documentation for more information)
Application services is used to separate presentation layer from domain layer by providing façade style methods. I defined application services in the Application assembly in the project. First, I define interface for task application service:
public interface ITaskAppService : IApplicationService
{
GetTasksOutput GetTasks(GetTasksInput input);
void UpdateTask(UpdateTaskInput input);
void CreateTask(CreateTaskInput input);
}
ITaskAppService extends IApplicationService. Thus, ASP.NET Boilerplate automatically provides some features for this class (like dependency injection and validation). Now, let's implement ITaskAppService:
public class TaskAppService : ApplicationService, ITaskAppService
{
//These members set in constructor using constructor injection.
private readonly ITaskRepository _taskRepository;
private readonly IRepository<Person> _personRepository;
/// <summary>
///In constructor, we can get needed classes/interfaces.
///They are sent here by dependency injection system automatically.
/// </summary>
public TaskAppService(ITaskRepository taskRepository, IRepository<Person> personRepository)
{
_taskRepository = taskRepository;
_personRepository = personRepository;
}
public GetTasksOutput GetTasks(GetTasksInput input)
{
//Called specific GetAllWithPeople method of task repository.
var tasks = _taskRepository.GetAllWithPeople(input.AssignedPersonId, input.State);
//Used AutoMapper to automatically convert List<Task> to List<TaskDto>.
return new GetTasksOutput
{
Tasks = Mapper.Map<List<TaskDto>>(tasks)
};
}
public void UpdateTask(UpdateTaskInput input)
{
//We can use Logger, it's defined in ApplicationService base class.
Logger.Info("Updating a task for input: " + input);
//Retrieving a task entity with given id using standard Get method of repositories.
var task = _taskRepository.Get(input.TaskId);
//Updating changed properties of the retrieved task entity.
if (input.State.HasValue)
{
task.State = input.State.Value;
}
if (input.AssignedPersonId.HasValue)
{
task.AssignedPerson = _personRepository.Load(input.AssignedPersonId.Value);
}
//We even do not call Update method of the repository.
//Because an application service method is a 'unit of work' scope as default.
//ABP automatically saves all changes when a 'unit of work' scope ends (without any exception).
}
public void CreateTask(CreateTaskInput input)
{
//We can use Logger, it's defined in ApplicationService class.
Logger.Info("Creating a task for input: " + input);
//Creating a new Task entity with given input's properties
var task = new Task { Description = input.Description };
if (input.AssignedPersonId.HasValue)
{
task.AssignedPersonId = input.AssignedPersonId.Value;
}
//Saving entity with standard Insert method of repositories.
_taskRepository.Insert(task);
}
}
TaskAppService uses repositories for database operations. It gets references in it's constructor via constructor injection pattern. ASP.NET Boilerplate naturally implements dependency injection, so we can use constructor injection or property injection freely (See more on dependency injection in ASP.NET Boilerplate documentation).
Notice that we're using PersonRepository by injecting IRepository<Person>. ASP.NET Boilerplate automatically creates repositories for our entities. If default methods of IRepository enough for us, we don't have to create repository classes.
Application service methods works with Data Transfer Objects (DTOs). It's a best practice and I definitely suggest to use this pattern. But you don't have to do it as long as you can deal with problems of exposing Entities to presentation layer.
In the GetTasks method, I used the GetAllWithPeople method that I implemented before. It returns a List<Task> but I need to return a List<TaskDto> to presentation layer. AutoMapper helps us here to automatically convert Task objects to TaskDto objects. GetTasksInput and GetTasksOutput are special DTOs defined for GetTasks method.
In the UpdateTask method, I retrieved the Task from database (using IRepository's Get method) and changed peoperties of the Task. Notice that I did not even called Update method of the repository. ASP.NET Boilerplate implements UnitOfWork pattern. So, all changes in an application service method are a unit of work (atomic) and applied to database at the end of the method automatically.
In the CreateTask method, I simply created a new Task and inserted to database using the IRepository's Insert method.
ASP.NET Boilerplate's ApplicationService class has some properties to make developing application services easier. For example, it defines a Logger property for logging. So, we derived TaskAppService from ApplicationService and used it's Logger property here. It's optional to derive from this class but required to implement IApplicationService (notice that ITaskAppService extends IApplicationService).
ASP.NET Boilerplate automatically validates inputs of application service methods. CreateTask method gets CreateTaskInput as parameter:
public class CreateTaskInput
{
public int? AssignedPersonId { get; set; }
[Required]
public string Description { get; set; }
public override string ToString()
{
return string.Format("[CreateTaskInput > AssignedPersonId = {0}, Description = {1}]", AssignedPersonId, Description);
}
}
Here, Description is marked as Required. You can use any Data Annotation attributes here. If you want to make some custom validation, you can implement ICustomValidate as I implemented in UpdateTaskInput:
public class UpdateTaskInput : ICustomValidate
{
[Range(1, long.MaxValue)]
public long TaskId { get; set; }
public int? AssignedPersonId { get; set; }
public TaskState? State { get; set; }
public void AddValidationErrors(List<ValidationResult> results)
{
if (AssignedPersonId == null && State == null)
{
results.Add(new ValidationResult("Both of AssignedPersonId and State can not be null in order to update a Task!", new[] { "AssignedPersonId", "State" }));
}
}
public override string ToString()
{
return string.Format("[UpdateTask > TaskId = {0}, AssignedPersonId = {1}, State = {2}]", TaskId, AssignedPersonId, State);
}
}
AddValidationErrors method is the place you can write your custom validation code.
Note that we did not handled any exception. ASP.NET Boilerplate automatically handles exceptions, logs and returns an appropriate error message to the client. Also, in client side, handles these error messages and show to the user. Actually, this is true for ASP.NET MVC and Web API Controller actions. Since we will expose the TaskAppService using Web API, we don't need to handle exceptions. See exception handling document for details.
I want to expose my application services to remote clients. Thus, my AngularJS application can easily call these service methods using AJAX.
ASP.NET Boilerplate provides an automatic way of exposing application service methods as ASP.NET Web API. I just use DynamicApiControllerBuilder as shown below:
DynamicApiControllerBuilder
.ForAll<IApplicationService>(Assembly.GetAssembly(typeof (SimpleTaskSystemApplicationModule)), "tasksystem")
.Build();
For this example, ASP.NET Boilerplate finds all interfaces inherits IApplicationService in Application layer assembly and creates a web api controller for each application service class. There are alternative syntaxes for fine control. We'll see how to call these services via AJAX.
I'll implement a Single-Page Web Application as user interface of my project. AngularJS (by Google) is one (propably the top one) of the most used SPA frameworks.
ASP.NET Boilerplate provides a template that makes easy to start with AngularJS. The template has two pages (Home and About) with smooth transition between pages. Uses Twitter Bootstrap as HTML/CSS framework (thus, it's responsive). It's also localized into English and Turkish with ASP.NET Boilerplate's localization system (You can easly add other languages or remove one of them).
We first change route of the template. ASP.NET Boilerplate template uses AngularUI-Router, the de-facto standard router of AngularJS. It provides state based routing modal. We will have two views: task list and new task. So, we will change route definition in app.js as shown below:
app.config([
'$stateProvider', '$urlRouterProvider',
function ($stateProvider, $urlRouterProvider) {
$urlRouterProvider.otherwise('/');
$stateProvider
.state('tasklist', {
url: '/',
templateUrl: '/App/Main/views/task/list.cshtml',
menu: 'TaskList' //Matches to name of 'TaskList' menu in SimpleTaskSystemNavigationProvider
})
.state('newtask', {
url: '/new',
templateUrl: '/App/Main/views/task/new.cshtml',
menu: 'NewTask' //Matches to name of 'NewTask' menu in SimpleTaskSystemNavigationProvider
});
}
]);
app.js is the main JavaScript file to configure and start our SPA. Notice that we're using cshtml files as views! Normally, html files are used as views in AngularJS. ASP.NET Boilerplate makes it possible to use cshtml files. Thus we will have the power of razor engine to generate HTML.
ASP.NET Boilerplate provides an infrastructure to create and show menus in an application. It allows to define menu in C# and use same menu both in C# and JavaScript. See SimpleTaskSystemNavigationProvider class for creating menu and see header.js/header.cshtml for showing menu in the angular way.
First, I'm creating an Angular controller for the task list view:
(function() {
var app = angular.module('app');
var controllerId = 'sts.views.task.list';
app.controller(controllerId, [
'$scope', 'abp.services.tasksystem.task',
function($scope, taskService) {
var vm = this;
vm.localize = abp.localization.getSource('SimpleTaskSystem');
vm.tasks = [];
$scope.selectedTaskState = 0;
$scope.$watch('selectedTaskState', function(value) {
vm.refreshTasks();
});
vm.refreshTasks = function() {
abp.ui.setBusy( //Set whole page busy until getTasks complete
null,
taskService.getTasks({ //Call application service method directly from JavaScript
state: $scope.selectedTaskState > 0 ? $scope.selectedTaskState : null
}).success(function(data) {
vm.tasks = data.tasks;
})
);
};
vm.changeTaskState = function(task) {
var newState;
if (task.state == 1) {
newState = 2; //Completed
} else {
newState = 1; //Active
}
taskService.updateTask({
taskId: task.id,
state: newState
}).success(function() {
task.state = newState;
abp.notify.info(vm.localize('TaskUpdatedMessage'));
});
};
vm.getTaskCountText = function() {
return abp.utils.formatString(vm.localize('Xtasks'), vm.tasks.length);
};
}
]);
})();
I defined name of the controller as 'sts.views.task.list'. This my convention (for scalable code-base) but you can simply name it as 'ListController'. AngularJS also uses dependency injection. We're injecting '$scope' and 'abp.services.tasksystem.task' here. First one is Angular's scope variable, second one is the automatically created JavaScript service proxy for ITaskAppService (we built it before in 'Build Web API services' section).
ASP.NET Boilerplate provides infrastructure to use same localization texts both in server and client (see it's documentation for details).
vm.taks is the list of tasks that will be shown in the view. vm.refreshTasks method fills this array by getting tasks using taskService. It's called when selectedTaskState changes (observed using $scope.$watch).
As you see, calling an application service method is very easy and straightforward! This is a feature of ASP.NET Boilerplate. It generates Web API layer and JavaScript proxy layer that talks with this Web API layer. Thus, we are calling the application service method as calling a simple JavaScript method. It is completely integrated with AngularJS (uses Angular's $http service).
Let's see the view side of task list:
<div class="panel panel-default" ng-controller="sts.views.task.list as vm">
<div class="panel-heading" style="position: relative;">
<div class="row">
<!-- Title -->
<h3 class="panel-title col-xs-6">
@L("TaskList") - <span>{{vm.getTaskCountText()}}</span>
</h3>
<!-- Task state combobox -->
<div class="col-xs-6 text-right">
<select ng-model="selectedTaskState">
<option value="0">@L("AllTasks")</option>
<option value="1">@L("ActiveTasks")</option>
<option value="2">@L("CompletedTasks")</option>
</select>
</div>
</div>
</div>
<!-- Task list -->
<ul class="list-group" ng-repeat="task in vm.tasks">
<div class="list-group-item">
<span class="task-state-icon glyphicon" ng-click="vm.changeTaskState(task)" ng-class="{'glyphicon-minus': task.state == 1, 'glyphicon-ok': task.state == 2}"></span>
<span ng-class="{'task-description-active': task.state == 1, 'task-description-completed': task.state == 2 }">{{task.description}}</span>
<br />
<span ng-show="task.assignedPersonId > 0">
<span class="task-assignedto">{{task.assignedPersonName}}</span>
</span>
<span class="task-creationtime">{{task.creationTime}}</span>
</div>
</ul>
</div>
ng-controller attribute (in the first line) binds the controller to the view. @L("TaskList") gets localized text for "task list" (works on server while rendering HTML). It's possible since this is a cshtml file.
ng-model binds combobox and the JavaScript variable. When the variable changes, the combobox updated. When the combobox changes, the valiable is updated. This is two-way binding of AngularJS.
ng-repeat is another 'directive' of Angular that is used to render same HTML for each value in an array. When the array changes (an item is added for example), it's automatically reflected to the view. This is another powerful feature of AngularJS.
Note: When you add a JavaScript file (for example, for the 'task list' controller), you should add it to your page. This can be done by adding it to Home\Index.cshtml in the template.
ASP.NET Boilerplate provides a flexible and strong localization system. You can use XML files or Resource files as localization source. You can also define custom localization sources. See documentation for more. In this sample application, I used XML files (it's under Localization folder in web application):
<?xml version="1.0" encoding="utf-8" ?>
<localizationDictionary culture="en">
<texts>
<text name="TaskSystem" value="Task System" />
<text name="TaskList" value="Task List" />
<text name="NewTask" value="New Task" />
<text name="Xtasks" value="{0} tasks" />
<text name="AllTasks" value="All tasks" />
<text name="ActiveTasks" value="Active tasks" />
<text name="CompletedTasks" value="Completed tasks" />
<text name="TaskDescription" value="Task description" />
<text name="EnterDescriptionHere" value="Task description" />
<text name="AssignTo" value="Assign to" />
<text name="SelectPerson" value="Select person" />
<text name="CreateTheTask" value="Create the task" />
<text name="TaskUpdatedMessage" value="Task has been successfully updated." />
<text name="TaskCreatedMessage" value="Task {0} has been created successfully." />
</texts>
</localizationDictionary>
ASP.NET Boilerplate is designed to be testable. I authored an article to show unit and integration testing for ABP based projects. See the article: Unit testing in C# using xUnit, Entity Framework, Effort and ASP.NET Boilerplate.
You can get the latest source code here https://github.com/aspnetboilerplate/aspnetboilerplate-samples/tree/master/SimpleTaskSystem
In this article, I demonstrated how to develop an NLayered ASP.NET MVC web application with a SPA and responsive user interface. I used ASP.NET Boilerplate since it makes easy to develop such applications using best practices and saves our time. Use these links for moe:
[1] ASP.NET Boilerplate official website: http://www.aspnetboilerplate.com


If the page gets stuck here, you probably haven't configured IPFS correctly. Go have a look at
the instructions
and try again.


Xhaka deserves respect, says former Arsenal skipper Vieira
LONDON, Nov 13 — Former Arsenal captain Patrick Vieira has defended Granit Xhaka after the midfielder lost the armband in the wake of his outburst towards the club’s supporters last month.
Xhaka reacted angrily to home fans booing him after he was substituted during Arsenal’s 2-2 draw at the Emirates Stadium and the player has since been left out of the squad.
“I feel sorry for him because he (was) the captain and he’s going through a really difficult period and really difficult time at Arsenal,” Vieira told British media.
“I think we have to remind ourselves that he’s achieved a lot since he’s at Arsenal and he deserves a lot of respect.
 And sometimes you say things or do things you regret.”
Arsenal’s 2-0 loss at Leicester City last weekend left them sixth in the Premier League and put more pressure on coach Unai Emery, who received backing from the club’s hierarchy but has been told to improve results.
Vieira, who won three league titles with Arsenal, has also urged the supporters to get behind their manager.
“I think he has enough experience to get them through this difficult spell,” Vieira added.
“We have to get behind him and give him time to change things. I am not sure a change of manager will fix the problems.” — Reuters


One of my friend asked me for help, he got Bandwidth Limit Exceeded when he tried to transfer his STEEMs to blocktrades.
So I took a look at his account to find out what happens?
(Image source: pixabay)
Zero SP leads to zero available bandwidth
I checked his account at steemd.com, and I found that there are ZERO STEEM POWER in his account.
In steem source code, the following codes are used to calculate whether users have bandwidth available:
`has_bandwidth = ( account_vshares max_virtual_bandwidth ) > ( account_average_bandwidth total_vshares );`
And in that codes, account_vshares
is just another representation of STEEM POWER.
So, If the account have zero STEEM POWERs, then the bandwidth limit of this account should be zero!
In the other words, this account can not do any operation, and will always get Bandwidth Limit Exceeded if try to do any operation using this account.
How to solve this issue?
Wow, that’s really a bad news. But there are hundreds STEEM in this account, if we can not do anything using it, how can we take out the STEEM?
My friend try to power up this account, but when he log in and tried to power up, the Bandwidth Limit Exceeded error appeared again. Sure, if you have zero STEEM POWERs in account, you can not do anything using this account!
Is there no way out? Don’t worry!
This is a method power up other’s account using your STEEM. Click the Advanced link when you do power up, then you can input other’s account which you want to power up.
The Lesson
The story ends here, my friend’s account had been powered up by his friend, and then he transfer all of his STEEMs to blocktrades.
This gave us a lesson: Always keep enough STEEM POWER
Just as the tip when power down
Leaving less than 5 STEEM POWER in your account is not recommended and can leave your account in a unusable state.
中文版
一个朋友把STEEM POWER down光光了，然后发现啥也做不了啦，账户里的钱也没法转出去。最后按我的建议，找朋友给他POWER UP了一点点SP，然后才可以操作。
这个事情给我们的教训是不要把SP down光光哦。
另外，STEEM POWER就是你在STEEM上的点赞权、话语权或者说一切一切权力和权益的根本，所以如何处理STEEM POWER，是保留还是DOWN光或者代理给别人，三思而后行吧！
This page is synchronized from the post: Always keep enough STEEM POWER / 账户内记得保留足够的SP


Record video
Record screen
Close
Create A Room
Room Name
Please fill in your room name
Name
please fill in your name
Create Room
CopyRight @
MedApp
Join Room
Your Name
Please fill in your username
Join Room
CopyRight @
MedApp
Record
Chat


login
Post Image
registration
gallery
SF State login page
Please enter your user name and password
Username:
Password:


Namespace netDxf.Collections
Classes
ApplicationRegistries
Represents a collection of application registries.
AttributeCollection
Represents a collection of Attribute.
AttributeDefinitionDictionary
Represents a dictionary of AttributeDefinition.
AttributeDefinitionDictionaryEventArgs
Represents the arguments thrown by the AttributeDefinitionDictionary events.
BlockRecords
Represents a collection of blocks.
DimensionStyleOverrideDictionary
Represents a dictionary of DimensionStyleOverride.
DimensionStyleOverrideDictionaryEventArgs
Represents the arguments thrown by the DimensionStyleOverrideDictionary events.
DimensionStyles
Represents a collection of dimension styles.

EntityCollectionEventArgs
Represents the arguments thrown by the EntityCollection
events.
Groups
Represents a collection of groups.
ImageDefinitions
Represents a collection of image definitions.
Layers
Represents a collection of layers.
Layouts
Represents a collection of layouts.
Linetypes
Represents a collection of line types.
MLineStyles
Represents a collection of multiline styles.
ObservableCollection<T>
Represent a collection of items that fire events when it is modified.
ObservableCollectionEventArgs<T>
Represents the arguments thrown by the ObservableCollection
events.
ObservableDictionary<TKey, TValue>
ObservableDictionaryEventArgs<TKey, TValue>
Represents the arguments thrown by the ObservableDictionaryEventArgs
events.
ShapeStyles
Represents a collection of shape styles.
SupportFolders
Represents a list of support folders for the document.
TableObjects<T>
Represents a list of table objects
TextStyles
Represents a collection of text styles.
UCSs
Represents a collection of user coordinate systems.
UnderlayDgnDefinitions
Represents a collection of DGN underlay definitions.
UnderlayDwfDefinitions
Represents a collection of DWF underlay definitions.
UnderlayPdfDefinitions
Represents a collection of PDF underlay definitions.
Views
Represents a collection of views.
VPorts
Represents a collection of viewports.
XDataDictionary
Represents a dictionary of XData.


Interactive version:
Importing Data Example¶
In order to import data into pypillometry
, we have to load the data from the source using other packages and then wrap it into PupilData
objects.
Here we will show and example where we translate a file recorded in Eyelinks EDF-format to a file readable by pandas.read_table()
.
First, we import the needed modules.
[2]:
import sys, os
sys.path.insert(0,"..") # this is not needed if you have installed pypillometry
import pypillometry as pp
import pandas as pd
import numpy as np
import pylab as plt
In this example, we use data recorded with an Eyelink-eyetracker. These eyetrackers store the files in binary files with the extension .edf
. Some information about this file-format is here. We use a command-line utility released by Eyelink to convert this proprietory format into a more easily read .asc
file that is a whitespace-separated plain-text format. The converter, edf2asc
is a program that can be downloaded for different
platforms from the Eyelink support forum. There is a GUI-based program for windows and command-line programs for linux and mac. Binaries of the command-line tools for linux and mac are included in pypillometry
under this link.
On linux, we would call these programs on an example edf-file twice as follows.
[1]:
!../external/edf2asc-mac -y -s ../data/test.edf ../data/test_samples.asc
!../external/edf2asc-mac -y -e ../data/test.edf ../data/test_events.asc
EDF2ASC: EyeLink EDF file -> ASCII (text) file translator
EDF2ASC version 3.1 MacOS X Jul 13 2010
(c)1995-2009 by SR Research, last modified Jul 13 2010
processing file ../data/test.edf
=======================Preamble of file ../data/test.edf=======================
| DATE: Fri Feb 14 08:48:33 2020 |
| TYPE: EDF_FILE BINARY EVENT SAMPLE TAGGED |
| VERSION: EYELINK II 1 |
| SOURCE: EYELINK CL |
| EYELINK II CL v6.12 Feb 1 2018 (EyeLink Portable Duo) |
| CAMERA: EyeLink USBCAM Version 1.01 |
| SERIAL NUMBER: CLU-DAC49 |
| CAMERA_CONFIG: DAC49200.SCD |
| Psychopy GC demo |
===============================================================================
Converted successfully: 0 events, 1245363 samples, 6 blocks.
EDF2ASC: EyeLink EDF file -> ASCII (text) file translator
EDF2ASC version 3.1 MacOS X Jul 13 2010
(c)1995-2009 by SR Research, last modified Jul 13 2010
processing file ../data/test.edf
=======================Preamble of file ../data/test.edf=======================
| DATE: Fri Feb 14 08:48:33 2020 |
| TYPE: EDF_FILE BINARY EVENT SAMPLE TAGGED |
| VERSION: EYELINK II 1 |
| SOURCE: EYELINK CL |
| EYELINK II CL v6.12 Feb 1 2018 (EyeLink Portable Duo) |
| CAMERA: EyeLink USBCAM Version 1.01 |
| SERIAL NUMBER: CLU-DAC49 |
| CAMERA_CONFIG: DAC49200.SCD |
| Psychopy GC demo |
===============================================================================
Converted successfully: 36371 events, 0 samples, 6 blocks.
This results in two files, one containing all the samples and one all the recorded events.
[3]:
fname_samples="../data/test_samples.asc"
fname_events="../data/test_events.asc"
The samples-files contains a large table containing the timestamp, x/y-coordinates for the eyeposition and pupil-area for both the left and the right eye.
We can easily read this file using pandas.read_csv()
.
[5]:
df=pd.read_table(fname_samples, index_col=False,
names=["time", "left_x", "left_y", "left_p",
"right_x", "right_y", "right_p"])
df
[5]:
| time | left_x | left_y | left_p | right_x | right_y | right_p | |
|---|---|---|---|---|---|---|---|
| 0 | 3385900 | 817.3 | 345.2 | 1707.0 | 860.6 | 375.2 | 1738.0 |
| 1 | 3385902 | 817.0 | 343.5 | 1706.0 | 860.7 | 375.9 | 1739.0 |
| 2 | 3385904 | 816.7 | 341.6 | 1705.0 | 861.2 | 376.6 | 1739.0 |
| 3 | 3385906 | 816.7 | 340.4 | 1706.0 | 861.7 | 376.8 | 1740.0 |
| 4 | 3385908 | 816.7 | 340.2 | 1707.0 | 861.6 | 376.9 | 1742.0 |
| ... | ... | ... | ... | ... | ... | ... | ... |
| 1245358 | 5923060 | . | . | 0.0 | . | . | 0.0 |
| 1245359 | 5923062 | . | . | 0.0 | . | . | 0.0 |
| 1245360 | 5923064 | . | . | 0.0 | . | . | 0.0 |
| 1245361 | 5923066 | . | . | 0.0 | . | . | 0.0 |
| 1245362 | 5923068 | . | . | 0.0 | . | . | 0.0 |
1245363 rows × 7 columns
We can already use this information to create our PupilData
-object. We simply pass in the pupil-area of the right eye (column right_p
) and the timestamp-array from the samples-file (Note: we could just as easily have used the left eye or the mean of both):
[6]:
pp.PupilData(df.right_p, time=df.time, name="test")
> Filling in 5 gaps
[32.35 4.012 6.21 2.02 1.862] seconds
[6]:
PupilData(test, 135.5MiB):
n : 1268585
nmiss : 212551
perc_miss : 16.75496714843704
nevents : 0
nblinks : 0
ninterpolated : 0
blinks_per_min : 0.0
fs : 500.0
duration_minutes : 42.28616666666667
start_min : 56.431666666666665
end_min : 98.7178
baseline_estimated: False
response_estimated: False
History:
*
Of course, this dataset is still missing the important information contained in the event-file which we will use for analysing trial-related pupil-diameter data. For that, we will have to read the events-file, which has a more complicated structure than the samples-file:
[7]:
!head -20 $fname_events
** CONVERTED FROM ../data/test.edf using edfapi 3.1 MacOS X Jul 13 2010 on Wed May 27 16:45:20 2020
** DATE: Fri Feb 14 08:48:33 2020
** TYPE: EDF_FILE BINARY EVENT SAMPLE TAGGED
** VERSION: EYELINK II 1
** SOURCE: EYELINK CL
** EYELINK II CL v6.12 Feb 1 2018 (EyeLink Portable Duo)
** CAMERA: EyeLink USBCAM Version 1.01
** SERIAL NUMBER: CLU-DAC49
** CAMERA_CONFIG: DAC49200.SCD
** Psychopy GC demo
**
INPUT 2767568 0
MSG 2784000 !CAL
>>>>>>> CALIBRATION (HV9,P-CR) FOR LEFT: <<<<<<<<<
MSG 2784000 !CAL Calibration points:
MSG 2784000 !CAL -29.4, -23.5 -0, -2
MSG 2784000 !CAL -29.3, -35.7 -0, -1544
MSG 2784000 !CAL -32.9, -10.4 -0, 1559
MSG 2784000 !CAL -49.7, -23.0 -2835, -2
After a header (lines starting with ‘**’) containing meta-information, we get a sequence of “events” which have different formats for all rows. We are interested in lines starting with “MSG” because those contain our experimental markers. Therefore, we read the samples file and remove all rows that do not start with “MSG” first:
[8]:
# read the whole file into variable `events` (list with one entry per line)
with open(fname_events) as f:
events=f.readlines()
# keep only lines starting with "MSG"
events=[ev for ev in events if ev.startswith("MSG")]
events[0:10]
[8]:
['MSG\t2784000 !CAL \n',
'MSG\t2784000 !CAL Calibration points: \n',
'MSG\t2784000 !CAL -29.4, -23.5 -0, -2 \n',
'MSG\t2784000 !CAL -29.3, -35.7 -0, -1544 \n',
'MSG\t2784000 !CAL -32.9, -10.4 -0, 1559 \n',
'MSG\t2784000 !CAL -49.7, -23.0 -2835, -2 \n',
'MSG\t2784000 !CAL -10.8, -27.4 2835, -2 \n',
'MSG\t2784000 !CAL -48.3, -33.3 -2818, -1544 \n',
'MSG\t2784000 !CAL -11.0, -34.2 2818, -1544 \n',
'MSG\t2784000 !CAL -56.2, -9.2 -2852, 1559 \n']
Next, we added an experimental marker that was sent as the experiment was started. This marker was called experiment_start
. Hence, we can remove all events before this marker.
[9]:
experiment_start_index=np.where(["experiment_start" in ev for ev in events])[0][0]
events=events[experiment_start_index+1:]
events[0:10]
[9]:
['MSG\t3387245 C_GW_1_1_UD_UD\n',
'MSG\t3390421 F_GW_1_1_10_0\n',
'MSG\t3392759 C_NW_1_2_UD_UD\n',
'MSG\t3394293 R_NW_1_2_UD_UD\n',
'MSG\t3395952 F_NW_1_2_-1_0\n',
'MSG\t3397974 C_NA_1_3_UD_UD\n',
'MSG\t3399892 R_NA_1_3_UD_UD\n',
'MSG\t3400999 F_NA_1_3_-11_0\n',
'MSG\t3403206 C_GA_1_4_UD_UD\n',
'MSG\t3404640 R_GA_1_4_UD_UD\n']
This is in a format where we can convert it into a pandas.DataFrame
object for further processing.
[10]:
df_ev=pd.DataFrame([ev.split() for ev in events])
df_ev
[10]:
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |
|---|---|---|---|---|---|---|---|---|---|
| 0 | MSG | 3387245 | C_GW_1_1_UD_UD | None | None | None | None | None | None |
| 1 | MSG | 3390421 | F_GW_1_1_10_0 | None | None | None | None | None | None |
| 2 | MSG | 3392759 | C_NW_1_2_UD_UD | None | None | None | None | None | None |
| 3 | MSG | 3394293 | R_NW_1_2_UD_UD | None | None | None | None | None | None |
| 4 | MSG | 3395952 | F_NW_1_2_-1_0 | None | None | None | None | None | None |
| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
| 1065 | MSG | 5893078 | V_UD_UD_16_UD_UD | None | None | None | None | None | None |
| 1066 | MSG | 5899076 | V_UD_UD_17_UD_UD | None | None | None | None | None | None |
| 1067 | MSG | 5905073 | V_UD_UD_18_UD_UD | None | None | None | None | None | None |
| 1068 | MSG | 5911072 | V_UD_UD_19_UD_UD | None | None | None | None | None | None |
| 1069 | MSG | 5917071 | V_UD_UD_20_UD_UD | None | None | None | None | None | None |
1070 rows × 9 columns
In this table, the second column contains the time-stamp (identical to the time-stamp in the samples file), and the third column contains our custom markers (the format like “C_GW_1_1_UD_UD” and so on is specific for our experimental design). There are many more columns which seem to contain no information in our samples. Let’s check what those columns are for by printing the rows in our data-frame where these columns are not None
:
[11]:
df_ev[np.array(df_ev[4])!=None].head()
[11]:
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |
|---|---|---|---|---|---|---|---|---|---|
| 209 | MSG | 3900393 | RECCFG | CR | 500 | 2 | 1 | LR | None |
| 211 | MSG | 3900393 | GAZE_COORDS | 0.00 | 0.00 | 1919.00 | 1079.00 | None | None |
| 212 | MSG | 3900393 | THRESHOLDS | L | 56 | 231 | R | 66 | 239 |
| 213 | MSG | 3900393 | ELCL_WINDOW_SIZES | 176 | 188 | 0 | 0 | None | None |
| 215 | MSG | 3900393 | ELCL_PROC | CENTROID | (3) | None | None | None | None |
Apparently, there are more eye-tracker specific markers in our files (in this case due to drift-checks during the experiments). We can safely drop those from our set of interesting events by dropping all rows in which the fourth column is not None
and then dropping all non-interesting columns.
[12]:
df_ev=df_ev[np.array(df_ev[4])==None][[1,2]]
df_ev.columns=["time", "event"]
df_ev
[12]:
| time | event | |
|---|---|---|
| 0 | 3387245 | C_GW_1_1_UD_UD |
| 1 | 3390421 | F_GW_1_1_10_0 |
| 2 | 3392759 | C_NW_1_2_UD_UD |
| 3 | 3394293 | R_NW_1_2_UD_UD |
| 4 | 3395952 | F_NW_1_2_-1_0 |
| ... | ... | ... |
| 1065 | 5893078 | V_UD_UD_16_UD_UD |
| 1066 | 5899076 | V_UD_UD_17_UD_UD |
| 1067 | 5905073 | V_UD_UD_18_UD_UD |
| 1068 | 5911072 | V_UD_UD_19_UD_UD |
| 1069 | 5917071 | V_UD_UD_20_UD_UD |
1035 rows × 2 columns
Finally, we can pass those event-markers into our PupilData
-object.
[13]:
d=pp.PupilData(df.right_p, time=df.time, event_onsets=df_ev.time, event_labels=df_ev.event, name="test")
d
> Filling in 5 gaps
[32.35 4.012 6.21 2.02 1.862] seconds
[13]:
PupilData(test, 135.5MiB):
n : 1268585
nmiss : 212551
perc_miss : 16.75496714843704
nevents : 1035
nblinks : 0
ninterpolated : 0
blinks_per_min : 0.0
fs : 500.0
duration_minutes : 42.28616666666667
start_min : 56.431666666666665
end_min : 98.7178
baseline_estimated: False
response_estimated: False
History:
*
The summary of the dataset shows us that the eyetracker started recording at time=56.4 minutes. We can reset the time index to start with 0 by using the reset_time()
function.
[14]:
d=d.reset_time().blinks_detect()
Now we can store away this dataset in pypillometry
-format and use all the pypillometry
-functions on it, e.g., plot a minute of this dataset.
[16]:
d.sub_slice(4, 6, units="min").drop_original().write_file("../data/test.pd")
[15]:
plt.figure(figsize=(15,5));
d.plot((4, 5), units="min")
Generalize to multiple similar datasets¶
Now that we have successfully found a way to create our PupilData
structure from the raw .EDF
files, we can wrap the code from this notebook into an easily accessible function that creates PupilData
objects for a given .EDF
file that has the same structure.
We simply create a function that takes the name of an EDF
-file as input and runs all the code above, returning the final PupilData
object. For convenience, we will assume that the EDF2ASC
utility has already run such that .asc
files are already available (see above for details).
[42]:
datapath="../data" ## this is where the datafiles are located
def read_dataset(edffile):
basename=os.path.splitext(edffile)[0] ## remove .edf from filename
fname_samples=os.path.join(datapath, basename+"_samples.asc")
fname_events=os.path.join(datapath, basename+"_events.asc")
print("> Attempt loading '%s' and '%s'"%(fname_samples, fname_events))
## read samples-file
df=pd.read_table(fname_samples, index_col=False,
names=["time", "left_x", "left_y", "left_p",
"right_x", "right_y", "right_p"])
## read events-file
# read the whole file into variable `events` (list with one entry per line)
with open(fname_events) as f:
events=f.readlines()
# keep only lines starting with "MSG"
events=[ev for ev in events if ev.startswith("MSG")]
# remove events before experiment start
experiment_start_index=np.where(["experiment_start" in ev for ev in events])[0][0]
events=events[experiment_start_index+1:]
# re-arrange as described above
df_ev=pd.DataFrame([ev.split() for ev in events])
df_ev=df_ev[np.array(df_ev[4])==None][[1,2]]
df_ev.columns=["time", "event"]
# create `PupilData`-object
d=pp.PupilData(df.right_p, time=df.time, event_onsets=df_ev.time, event_labels=df_ev.event, name=edffile)
return d
We can test this code by simply running the function with a certain filename located in datapath
:
[43]:
read_dataset("test.edf")
> Attempt loading '../data/test_samples.asc' and '../data/test_events.asc'
> Filling in 5 gaps
[32.35 4.012 6.21 2.02 1.862] seconds
[43]:
PupilData(test.edf, 135.5MiB):
n : 1268585
nmiss : 212551
perc_miss : 16.75496714843704
nevents : 1035
nblinks : 0
ninterpolated : 0
blinks_per_min : 0.0
fs : 500.0
duration_minutes : 42.28616666666667
start_min : 56.431666666666665
end_min : 98.7178
baseline_estimated: False
response_estimated: False
History:
*
Storing/Loading several datasets¶
So now it is easy to read a set of datasets into a Python list
from the same experimental setup with a simple loop, e.g.,
[46]:
files=["test.edf", "test2.edf", "test3.edf"]
datasets=[read_dataset(fname) for fname in files]
> Attempt loading '../data/test_samples.asc' and '../data/test_events.asc'
> Filling in 5 gaps
[32.35 4.012 6.21 2.02 1.862] seconds
After that, we might want to save the final PupilData
objects as .pd
files that can be readily loaded back. Here, we loop through the list of datasets and store each of them in separate files using the name
attribute of the object as filename.
[47]:
for ds in datasets:
fname=os.path.join(datapath, ds.name+".pd")
ds.write_file(fname)
These datasets can be read back using the PupilData.from_file()
method:
[58]:
# all filenames in `datapath` that end with `.pd`
pd_files=[fname for fname in os.listdir(datapath) if fname.endswith(".pd")]
datasets=[]
for fname in pd_files:
fname=os.path.join(datapath, fname)
d=pp.PupilData.from_file(fname)
datasets.append(d)
It is also possible to store the whole list
as a single file by using the pd_write_pickle()
-function:
[60]:
pp.pd_write_pickle(datasets, "full_dataset.pd")
which can be read-back using the pd_read_pickle()
function like so:
[61]:
datasets=pp.pd_read_pickle("full_dataset.pd")
Interactive version:


| < July 2015 > | ||||||
|---|---|---|---|---|---|---|
| Su | M | T | W | Th | F | Sa |
| 1 | 2 | 3 | 4 | |||
| 5 | 6 | 7 | 8 | 9 | 10 | 11 |
| 12 | 13 | 14 | 15 | 16 | 17 | 18 |
| 19 | 20 | 21 | 22 | 23 | 24 | 25 |
| 26 | 27 | 28 | 29 | 30 | 31 | |
Arrays and Hashes are two ways of storing information in Ruby. I never thought of them as similar, but upon closer inspection it's true their uses are remarkably redundant. Regradless, let us explore the distinction between the two.
I like to think of an array as an ordered list. An array, for the record, is an object that house some number of elements between two squre brackets. A couple examples:
Array = [1, 2, 3]
greetings = ["hello", "hola", "ni hao"]
Pretty simple! We name an object and point it to our array, and an array is born. What gives an array it's 'order' is the way it indexes by numbers. What if, say, I wanted to call up the first item in my 'Array' array. I could put in the following:
Array[0]
and ruby would spit out '1', or the first item in the array. Arrays are indexed with numbers starting at zero, increasing by for each item. So in the 'greetings' array, greetings[0] is hello, greetings[1] is hola, and ni hao would be greetings[2]. Easy! Because of this simple indexing arrays are very easy to visualize and work with. However, sometimes we want an index that is more specific, and in these cases we use a Hash.
Hashes are basically arrays with custom indexes. The notation is a bit different, so let us use our 'greetings' array from before as an example, except this time as a hash:
greetings = {
:English => "hello",
:Spanish => "hola",
:Mandarin => "ni hao"
}
The first thing that you may notice is that instead of square brackets we have curly braces. Between the braces we have what are called key value pairs. The first bit, preceded by a colon, is the key, or our index. We can make these anything we want! We then have an arrow that points to our value, in this case our greetings represented as strings. So how do we access the values? The same way with arrays! So greetings[:English] will return 'hello' and so on. The advantage here is we can order our values in a way that makes sense, such as the language and the word.
Numbers work fine as indexes, but they are lacking when it comes to description. For times when having a set order for your items is useful, an array would be a good choice. For when you want to group the data in a way that may makes more semantic sense, use a hash.


Eleanor
Chai Beer
Founder
M.A., Anthropology, Harvard University
B.A., Sarah Lawrence College
Nancy M. Webber
Head of School
M.Ed., Harvard University
B.A., English, Boston University
Tunde A. Jackson
Associate Head of School
B.A., Sociology & African-American Studies, Oberlin
College
Paul F. O'Rourke
Head of Humanities, History & Languages Programs
Research Associate, Brooklyn Museum
Former Chair, Classics Department, St.Ann's School
Ph.D., Egyptology, New York University
B.A., Classics, Hamilton College
Amanda Meyer
Head, Science Program
M.A., Molecular Biophysics & Biochemistry, Yale University
B.S., Biochemstiry, Biology, University of Iowa
Andrew D. Beer
Head, Board of Trustees
M.B.A. (Baker Scholar), Harvard Business School
B.A., European History, Harvard College
|
|


State
0
Prev
...
Next
Type the states to show below (separated by "+++")
Initial state. +++ State 1 +++ State 2 +++ State 3 +++ State 4 +++ State 5 +++ Final state.
$ echo "This is cool" This is cool


Teddy Bear
Price: $10.00
Size:
Small
Medium (+$5)
Large (+$7)
Gift Wrapped?:
No
Yes ($5)
Quantity:
1
2
3
4
5
Total: $
0.00
Buy


Family: Noirtier de Villefort (father), Renée de Saint-Méran (1st wife), Héloise de Villefort (2nd wife), Valentine de Villefort (daughter), Édouard de Villefort (son)
A staunch royalist who tried to seperate himself from his father's Bonapartist views. An anonymous tip caused him to arrest Edmond Dantès. Seeing that Edmond was carrying a letter from the Isle of Elba, the place of Napoleon's banishment, addressed to his father Noirtier de Villefort, Gérard de Villefort, hoping to prevent any connection between him and his father, sentenced Edmond to life in prison at the Château d'If for treason.
Afterwards, he moved to Paris and married Renée de Saint-Méran, with whom he had a daughter: Valentine. During this time, he had an affair with Baroness Danglars, and had a son: Benedetto.
He tried to bury Benedetto in the garden of his wife's estate when Bertuccio, an enemy, ambushed him, stabbed him, and stole the box he was burying, believing it to be treasure. He later married Héloise with whom he had a son: Édouard. With help from the Count of Monte Cristo, Benedetto revealed Gérard de Villefort's heinous crimes, destroying his reputation.