Checkbox Inline
Customise app volumes or devices they use
Customise app volumes and speakers or devices they use
Customise app volumes or devices they use
Customise app volumes or devices they use
apps available in store show here
This is paragraph used to display long text in your windows application.
This is success paragraph used to display success text in your windows application.
This is danger paragraph used to display danger text in your windows application.
This is light paragraph used to display long text in your windows application.
If you cant find the network you want select to show available networks to open the list of available networks
Still cant connect? Open the troubleshooterA Windows UI menu popup from bottom similar as an action sheet


nips nips2002 nips2002-185 nips2002-185-reference knowledge-graph by maker-knowledge-mining
Source: pdf
Author: Maxim Likhachev, Sven Koenig
Abstract: In this paper, we introduce an efﬁcient replanning algorithm for nondeterministic domains, namely what we believe to be the ﬁrst incremental heuristic minimax search algorithm. We apply it to the dynamic discretization of continuous domains, resulting in an efﬁcient implementation of the parti-game reinforcement-learning algorithm for control in high-dimensional domains.
[1] S. Koenig and M. Likhachev. Incremental A*. In T. Dietterich, S. Becker, and Z. Ghahramani, editors, Advances in Neural Information Processing Systems 14, Cambridge, MA, 2002. MIT Press.
[2] D. Frigioni, A. Marchetti-Spaccamela, and U. Nanni. Fully dynamic algorithms for maintaining shortest paths trees. Journal of Algorithms, 34(2):251–281, 2000.
[3] A. Moore and C. Atkeson. The parti-game algorithm for variable resolution reinforcement learning in multidimensional state-spaces. Machine Learning, 21(3):199–233, 1995.
[4] A. Moore and C. Atkeson. Prioritized sweeping: Reinforcement learning with less data and less time. Machine Learning, 13(1):103–130, 1993.
[5] M. Likhachev and S. Koenig. Speeding up reinforcement learning with incremental heuristic minimax search. Technical Report GIT-COGSCI-2002/5, College of Computing, Georgia Institute of Technology, Atlanta (Georgia), 2002.
[6] M. Al-Ansari. Efﬁcient Reinforcement Learning in Continuous Environments. PhD thesis, College of Computer Science, Northeastern University, Boston (Massachusetts), 2001.
[7] G. Ramalingam and T. Reps. An incremental algorithm for a generalization of the shortest-path problem. Journal of Algorithms, 21:267–305, 1996.


Drought conditions have come and gone over time. The graph to the right gives you a glimpse of this, showing alternating dry (red) and wet (green) conditions since 1895. Click the years to read more about some notable drought events in South Carolina.
South Carolina drought and wet conditions (1895-April 2017), are shown based on the Palmer Drought Severity Index. The rows are years, and the columns are months January through December, reading from left to right. Each square represents a month with a specific measure of dryness (red), wetness (green), or normal (yellow) conditions.
Credit: Carolinas Precipitation Patterns & Probabilities: an Atlas of Hydroclimate Extremes
2015-2016: South Carolina experienced alternating wet and incipient drought conditions. In June 2015, all counties were in incipient or moderate drought. Historic floods in October 2015 alleviated the dry spell for several months. However, in August 2016 drought returned to the State. Hurricane Matthew brought excessive rainfall to most counties, but a lack of adequate moisture persisted in the Upstate region.
2010-2013: Lake Hartwell and Lake Thurmond were 6.5 feet and Lake Jocassee was 21 feet below their target guide curves in March 2012. The inflows into Lake Thurmond for the following three-month were the lowest recorded since 1954. The deteriorating hydrologic conditions reduced the amount of water stored in shallow and deep aquifers.
2007-2009: Drought affected water levels in many lakes. The Savannah Lakes were more than 19 feet below the target level. Lake Marion dropped 9 feet during 2007 reaching the lowest elevation (66.27 ft-msl) since the 1950s. The hydrological drought impacted water supplies, irrigation capacity, and many lake-related businesses as well as golf courses. Voluntary and mandatory water restrictions were issued across the State due to prolonged drought conditions and associated water supply shortages.
1998-2002: This drought lasted four years and the precipitation deficits were among the largest in the State history. The two highest levels of drought severity, extreme and severe drought, lasted throughout summer of 2002; in August, State officials declared the entire State to be in the extreme drought. The drought significantly contributed to the southern pine beetle epidemic. The SC Forestry Commission estimated the total impact of the drought at more than $1.3 billion dollars.
1993: The Greenville-Spartanburg Airport recorded the hottest and driest month on record up to date in July of 1993. Similar records were set at other locations around the State. The drought, which started at the height of the crop growing season in May and June, devastated South Carolina pastures and hay production. The drought and record heat cost the State a total of $22.5 million in crop losses. The total loss for livestock, hay, and pasture was estimated at $34.7 million.
1985-1986: Due to drought conditions and accompanying reduced stream flows hydroelectric power generation was curtailed by 183,978-megawatt hours at the Lake Murray Saluda Hydropower plant. The U.S. Army Corps of Engineers was forced to purchase $10 million in substitute electricity on the open market to compensate for the reduced hydroelectric power production at the Savannah River Plant.
1954: The year set the current record for the State’s driest year with total statewide precipitation of 32.96 inches. An excessively hot summer exacerbated the impacts of limited rainfall. According to National Weather Service reports, crop yield was only 10 percent of its 10-year average production rate. Hurricane Hazel ended extreme drought conditions in eastern South Carolina, although drought continued in western areas of the State.
1925: The growing season had a recorded 12.41-inch rain deficit, and the State experienced an overall rainfall deficit of 18.23 inches. Water for livestock was scarce; many streams had record lows, and deep wells went dry affecting water supply and power production.


esmond is a system for collecting, storing, visualizing and analyzing large sets of SNMP data. It was driven by the needs of the ESnet engineering team but is likely useful to a much wider audience. esmond has a RESTful API which allows easy access to the data which is collected.
esmond uses a hybrid model for storing data. Time series data such as interface counters is stored using TSDB. TSDB is a library for storing time series data with no loss of information. TSDB optimizes the store of it’s data so that data which share similar timestamps is stored nearby on the disk allowing very fast access to specific time ranges. Data such as interface description and interface type are stored in an SQL database. Storing this data in an SQL database allows us to use the full expressiveness of SQL to query this data. Since this data changes relatively infrequently the demands placed on the SQL server are fairly modest. Our production server uses PostgreSQL, but it’s likely that SQLite would work just fine.
Contents:


I was prescribed a drug called Seroxat after several panic attacks. The active substance in Seroxat is paroxetine. At first I was sceptical, but it turned out to be a great help for me.
When I started taking the drug my dosage was 10 mg. The side effects I got was a persistent, but mild headache. I stepped up the dose from 10mg to 20mg after the side effects wore off. On the full dose I didn't experience any 'high' or something like that. My mood was altered, I was more calm, never very happy or very sad/angry. I rarely got any panic attacks, maybe two times the whole year I took the pills. One is not supposed to drink alcohol while taking the drug, but my physician said it was ok in small quantities. The only effect I noticed was that I got drunk faster than I used to.
After a year I stepped down the dose with the intention to stop using seroxat. First I stepped town to 10mg one day and 20mg the next. After one month I stepped down to 10mg every day. The last few weeks before i stopped taking the pills I took 10mg one day and 0mg the next.
After I stopped using the drug I experienced the worst panic attack in years. And I was generally more anxious than I used to be when I was on the drug. I was told that this was normal, and that after a couple of weeks I should be less anxious, but not as calm as I was taking the pills. This turned out to be true. The second week after I stopped taking the pills I was less anxious.
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.


Provides functions to estimate the kinship matrix of individuals from a large set of biallelic SNPs, and extract inbreeding coefficients and the generalized FST (Wright's fixation index). Method described in Ochoa and Storey (2016) <doi:10.1101/083923>.
| Version: | 1.0.5 |
| Imports: | Rcpp (≥ 0.12.10), RColorBrewer, graphics |
| LinkingTo: | Rcpp, RcppEigen |
| Suggests: | BEDMatrix, testthat, knitr, rmarkdown, lfa |
| Published: | 2018-01-26 |
| Author: | Alejandro Ochoa [aut, cre], John D. Storey [aut] |
| Maintainer: | Alejandro Ochoa <ochoa at princeton.edu> |
| BugReports: | https://github.com/StoreyLab/popkin/issues |
| License: | GPL-3 |
| URL: | https://github.com/StoreyLab/popkin/ |
| NeedsCompilation: | yes |
| Citation: | popkin citation info |
| Materials: | NEWS |
| CRAN checks: | popkin results |
| Reference manual: | popkin.pdf |
| Vignettes: |
Estimate Kinship and FST under Arbitrary Population Structure |
| Package source: | popkin_1.0.5.tar.gz |
| Windows binaries: | r-devel: popkin_1.0.5.zip, r-release: popkin_1.0.5.zip, r-oldrel: popkin_1.0.5.zip |
| OS X binaries: | r-release: popkin_1.0.5.tgz, r-oldrel: popkin_1.0.5.tgz |
| Old sources: | popkin archive |
| Reverse suggests: | bnpsd |
Please use the canonical form https://CRAN.R-project.org/package=popkin to link to this page.


SocketEngine
public final class SocketEngine : NSObject, URLSessionDelegate, SocketEnginePollable, SocketEngineWebsocket
The class that handles the engine.io protocol and transports.
See SocketEnginePollable
and SocketEngineWebsocket
for transport specific methods.
-
The queue that all engine actions take place on.
Declaration
Swift
public let engineQueue = DispatchQueue(label: "com.socketio.engineHandleQueue")
-
The connect parameters sent during a connect.
Declaration
Swift
public var connectParams: [String: Any]?
-
A queue of engine.io messages waiting for POSTing
You should not touch this directly
Declaration
Swift
public var postWait = [String]()
-
true
if there is an outstanding poll. Trying to poll before the first is done will cause socket.io to disconnect us.Do not touch this directly
Declaration
Swift
public var waitingForPoll = false
-
true
if there is an outstanding post. Trying to post before the first is done will cause socket.io to disconnect us.Do not touch this directly
Declaration
Swift
public var waitingForPost = false
-
true
if this engine is closed.Declaration
Swift
public private(set) var closed = false
-
true
if this engine is connected. Connected means that the initial poll connect has succeeded.Declaration
Swift
public private(set) var connected = false
-
An array of HTTPCookies that are sent during the connection.
Declaration
Swift
public private(set) var cookies: [HTTPCookie]?
-
Set to
true
if using the node.js version of socket.io. The node.js version of socket.io handles utf8 incorrectly.Declaration
Swift
public private(set) var doubleEncodeUTF8 = true
-
A dictionary of extra http headers that will be set during connection.
Declaration
Swift
public private(set) var extraHeaders: [String: String]?
-
When
true
, the engine is in the process of switching to WebSockets.Do not touch this directly
Declaration
Swift
public private(set) var fastUpgrade = false
-
When
true
, the engine will only use HTTP long-polling as a transport.Declaration
Swift
public private(set) var forcePolling = false
-
When
true
, the engine will only use WebSockets as a transport.Declaration
Swift
public private(set) var forceWebsockets = false
-
true
If engine’s session has been invalidated.Declaration
Swift
public private(set) var invalidated = false
-
If
true
, the engine is currently in HTTP long-polling mode.Declaration
Swift
public private(set) var polling = true
-
If
true
, the engine is currently seeing whether it can upgrade to WebSockets.Declaration
Swift
public private(set) var probing = false
-
The URLSession that will be used for polling.
Declaration
Swift
public private(set) var session: URLSession?
-
The session id for this engine.
Declaration
Swift
public private(set) var sid = ""
-
The path to engine.io.
Declaration
Swift
public private(set) var socketPath = "/engine.io/"
-
The url for polling.
Declaration
Swift
public private(set) var urlPolling = URL(string: "http://localhost/")!
-
The url for WebSockets.
Declaration
Swift
public private(set) var urlWebSocket = URL(string: "http://localhost/")!
-
If
true
, then the engine is currently in WebSockets mode.Declaration
Swift
public private(set) var websocket = false
-
The WebSocket for this engine.
Declaration
Swift
public private(set) var ws: WebSocket?
-
The client for this engine.
Declaration
Swift
public weak var client: SocketEngineClient?
-
Creates a new engine.
Declaration
Swift
public init(client: SocketEngineClient, url: URL, config: SocketIOClientConfiguration)
Parameters
client
The client for this engine.
url
The url for this engine.
config
An array of configuration options for this engine.
-
Creates a new engine.
Declaration
Swift
public convenience init(client: SocketEngineClient, url: URL, options: NSDictionary?)
Parameters
client
The client for this engine.
url
The url for this engine.
options
The options for this engine.
-
Starts the connection to the server.
Declaration
Swift
public func connect()
-
Called when an error happens during execution. Causes a disconnection.
Declaration
Swift
public func didError(reason: String)
-
Disconnects from the server.
Declaration
Swift
public func disconnect(reason: String)
Parameters
reason
The reason for the disconnection. This is communicated up to the client.
-
Called to switch from HTTP long-polling to WebSockets. After calling this method the engine will be in WebSocket mode.
You shouldn’t call this directly
Declaration
Swift
public func doFastUpgrade()
-
Causes any packets that were waiting for POSTing to be sent through the WebSocket. This happens because when the engine is attempting to upgrade to WebSocket it does not do any POSTing.
You shouldn’t call this directly
Declaration
Swift
public func flushWaitingForPostToWebSocket()
-
Parses raw binary received from engine.io.
Declaration
Swift
public func parseEngineData(_ data: Data)
Parameters
data
The data to parse.
-
Parses a raw engine.io packet.
Declaration
Swift
public func parseEngineMessage(_ message: String, fromPolling: Bool)
Parameters
message
The message to parse.
fromPolling
Whether this message is from long-polling. If
true
we might have to fix utf8 encoding. -
Writes a message to engine.io, independent of transport.
Declaration
Swift
public func write(_ msg: String, withType type: SocketEnginePacketType, withData data: [Data])
Parameters
msg
The message to send.
withType
The type of this message.
withData
Any data that this message has.
-
Delegate called when the session becomes invalid.
Declaration
Swift
public func URLSession(session: URLSession, didBecomeInvalidWithError error: NSError?)


Hi, my name is Paul Schaefer. I'm an amateur web developer and designer. I attend the Art Institute of Pittsburgh, and I listen to a lot of music.
If this website seems sparse to you, it is because it is really hard for me to pick favorites.
Also, if you're wondering why this exists, it was my quarter 1 HTML final.
View the source here on GitHub.
I just listened to:


| DOSE: |
2 bowls |
smoked |
Cannabis |
(plant material) |
'WHAT EVERY YOU DO, DONT OPEN YOUR EYES'
He tells me just as Iím putting on the gassmask.
Well, me being the rebelious teen, I decide to indeed open my eyes as the whole mask fills up with smoke, it stings a little but I pay no attention to it. Fast forward about 5 min and Iím on the couch, wondering how I got there, feeling very fadded. My friend and partner in crime is on the couch across from me.
Now before I get into the real story, Iíll type a little more about myself and my state of mind at that time. I'm generally a pretty shy guy, back then I was a REALLY shy guy, only hanging out with a few friends and never talking to the oposite sex. Well.. not about anything worthwhile anyway. I honestly didnít know why I was smoking weed or even why I was at my friendís house instead of at home with my family. I was allways depressed back then, even while friends I wouldnít be completely there. I would live in my mind, allways analizing everything and always having mental chatter in my head, most of it negative, worrysome, and frightening thoughts.
My view of the world at that time was of reality being a verry complex video game and God being the GM (Game Master). For whatever reason unknown to me, god had created us all. I thought maybe for the same reason I played video games so much, to get away from real life, so I thought god had created us for his amusement, and to get away from his real life, to preoccupy himself with something.
I had always had constand mental chater in my mind and when I smoked that day it just enhanced it x10.  I beleive the weed unlocked the cage and let those thought and worries run free in my mind, My sence of time was completely off, I was living in super thought time and communicating with myself in my own head but this was just to wierd for me so I projected the beast I had created in my own mind from all the anger and hate I kept inside, onto my friend sitting across from me.
I could literaly hear the beast voice and I truly beleived at that moment that the devil was talking to me, still to this day I do beleive that I had opened some sort of communication channel that was already present in my own brain. Worry and fear consumed my entire being at that time and I have never been so scared in my life, not in dreams where I have experienced death, not even waking up to the sounds of my mother banging and trying to scream for help in the middle of the night
because she couldnít breath.
So for what seemed like an eternity I sat there while the beast talked to me in my mind as I watched my friends face morph into that of a dragon. I would hear the voice say something like 'your mother is going to die and you are going to be rapped' As this happened I could clearly see my mother dying and me yelling, trying to help her, I could also see myself being rapped by some man wearing white rubber gloves, its funny that the voice did provide details as to how I was going to be rapped. He did say something about white rubber gloves. I would say out loud 'WHY?!' and my friend, not knowing the inner battle I was going through would just stare at me and laugh, which didnít help at all. I finally just decided to fight and stand up to the demon, which was the hardest thing I have ever had to do, coming out of total paralizing FEAR and facing the beast and saying NO and whatever happens happens.
After that I guess the evil changed its tactics while I was in this state of emense confusion. My friend was telling me to just go to sleep, and I took that as symbolically meaning dying, because I thought I would die if I fell asleep. So then he says that heís going to sleep and I thought that the demon was talking and telling me that he was going to sleep and taking the whole damn world with him. So I got up and ran over to my friend and stared directly into his eyes, yelling. Yea I know.... I truly regret my actions.
At one point I saw a vision of my other friend being killed, Texas chainsaw massacre style, so I asked my friend sitting across from me, whereís josh?! Whereís josh?! I then ran to the room where Josh was sleeping and woke him up, to my relief he was fine. I then calmed down a bit, but then it all hit me again and everything just kind of made sence at once. IT WAS ALL FAKE MAYA MATRIX. Coming to this conclusion I freaked out. I blacked out, but they told me that I hit my other friend and then we were outside and my other friend hit me, but I just stood there, he then ran inside and locked me out.

After I had broken the door I was really confused and my friend walked me outside, my arm was driping blood, but I was just laughing and saying this doesnít matter, after awhile I got frustrated that I still hadnít made it to the next level so I was telling my friend josh to give me my powers. Again I know its rediculous but at that time it semmed completely possible that I could receive some kind of powers and then move on to the next level of reality since I had cracked the code to this fake world.
Also throughout this whole ordeal I would think of my older brother, heís really mentally ill, a REAL schitzophrenic.
Then this thought and vision of a white car representing a white cloud, something told me to get on top of it and wait to go to heaven. Then out of nowhere this white car shows up. My other friend daniel drove my friend's mom's car to come get me but I didnít know it was him. I emediatly ran on top of the car and sat down, I stayed there for what seemed like another eternity in some kind of trance state. Meanwhile my friends called the cops.
 GET OFF THE CAR OR heís GOING TO TAZE YOU!'  He then tazed me right under my left testicle... Next thing I know Iím on the ground laughing and looking at the cops. They all were wearing sunglasses which made them look like MIB agents and I couldnít look into there eyes which bothered me. They were saying something about me saying something about spiders, but I donít remember saying anything about spiders. I later thought that maybe I was experiencing astral spiders but like I said I donít recall mentioning or seeing any spiders.
Iím really not satisfied with how I wrote all of this, but I also think it kind of goes with how I felt at the time, All jumbled up.
Oh yeah! about the white rubber gloves, the ambulance guy put on some white rubber gloves and had to check where the tazzer got me, when I saw that EVERYTHING HIT ME AGAIN I felt like what the demon said was coming true and I felt like I had to get back on the car to go to heaven and leave this place. I also remembered my brother and I felt like he had gone through something like this too, and I yelled something about what level did he get to?!?
So I ended up spending the rest of the day in the hospital where they stitched me up then the night in county, where I was still freaking out but just in my head. I was afraid to drink water cuz I thought I would die. I felt like I had to reject everything of this world.
Oh yea... I almost forgot the best/worst part.... I tried to bite my thumb off...sigh.. I feel really rediculous typing all of this ... honestly...its embarrising to be labled a crazy but I guess thatís what I am. And I do know that all of this happened for a reason, not saying a godly reason. But more like everything I kept inside from childhood and all the negative thought I harbored in my mind exploded out and manifested themselves that day, in order to cause as much dissharmony as possible.
I want to go into more debth of how I feel that this is related to my family especially how my brother is a real schitzo and how b4 I started smoking weed I vowed to never smoke EVER because I knew it fucked my brother up.  I just want to delete all of this but Iím going to post it anyway. I donít even feel its worth correcting the mistakes in this writing, sorry if this just ends up being a waste of ur time.
I have smoked weed since then and had similar freak out but I didnít do anything, I just mentally freaked out and was able to controle it, that just happened the first few times I smoked after this incident, since then I have smoked alot with no freak outs. I have also tried xstacy (I know its misspelled, I prefer it that way, gives a unique style to my writing. or maybe it just makes me sound dumb, its whateva) while on x, I felt like I was controling the radiostations.
I now have quite a unique scar on my thumb that looks like some sort of Japanese character. I havenít been able to find it in any writing though, I find myself rubbing it when I get angry. With all that said and typed Iím still glad I opened my eyes 0.0
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.


TCP/IP channels come in two varieties: client-side channels and server-side channels. Let me show you how to create both:
client = Cod.tcp('localhost:12345')
server = Cod.tcp_server('localhost:12345')
client.put 'tcp channels!'
server.get # => "tcp channels!"
client.close
server.close
To do simple communication across machines, this will be all you need. But that’s only where things start, not where they end. In the following sections, I’ll explain more about tcp clients and servers.
The channel returned by Cod.tcp
really acts in two phases:
This two-phase connect is the reason why cod programs can send stuff to a server that might not even be listening yet. This is very useful in practice.
If you want to force a connection, try to read from the client channel. It will block forever until data comes in. The next example blocks until a timeout occurs:
channel = Cod.tcp('localhost:12345')
require 'timeout'
begin
value = timeout(0.1){ channel.get }
rescue Timeout::Error
end
Since there is normally no server on localhost:12345, the code will just block and wait, trying to make a connection. After 0.1 seconds, the timeout occurs and we abort processing.
We have chosen not to handle timeouts in cod at all. A connection that did
not deliver the data in time will often need to be reset; the data might still
come later, and the client might not be in a condition to handle it. We recommend using timeout.rb
for all your outtiming needs.
When the server terminates the connection to our client, we’ll eventually get
a Cod::ConnectionLost
error raised. This is pretty much the only
error you have to expect and handle.
# Read until the connection breaks.
begin
loop { client.get }
rescue Cod::ConnectionLost
end
Servers are a little more complex to write. Here’s how the inner loop might look like:
# Get request
channel.get
# Put answer
channel.put # XXX doesn't exist
But there is no Channel#put
for tcp server channels! A tcp server
can of course have more than one client. There would be no way to tell which
client should receive the answer.
The easy answer to solving this problem is to tell the server where to send its answers. Here’s a working example of this:1
client do
channel = Cod.tcp('<IP_ADDRESS>:12345')
version = channel.interact [:ehlo, channel]
version # => [:version, 1]
other = channel.interact [:bark, channel]
other # => :unknown_command
# Tell the server to shut down.
channel.put [:shutdown, nil]
end
pid = server do
channel = Cod.tcp_server('<IP_ADDRESS>:12345')
loop do
msg, client = channel.get
case msg
when :ehlo
client.put [:version, 1]
when :shutdown
break
else
client.put :unknown_command
end
end
end
# Wait for the server to terminate
Process.wait pid
In the client code (client do ... end
) you might notice the
#interact
method, which hasn’t been introduced yet. It is defined
as:
def interact(*args)
channel.put *args
return channel.get
end
The server code server do ... end
retrieves both the message and
the back-channel from the its channel.get
. It then uses list
comprehension to split that tuple into its components.
Of course, in your code, server and client would be on different machines. Otherwise what is the point. Right?
As shown above, the clients can simply send their connection handle through itself. Like so:
channel.put channel
But sending the back-channel along as part of the message has a few downsides:
There is a better method to handle client connections in cod:
# Just the innermost server-side loop again
msg, back_channel = channel.get_ext
case msg
when ...
back_channel.put :answer
end
Using #get_ext
2 allows you to retrieve both the message that
was sent and the back channel in one command. If you close that channel, you
will terminate the clients connection.
Here’s the revised example from above:
client do
channel = Cod.tcp('<IP_ADDRESS>:12345')
version = channel.interact :ehlo
version # => [:version, 1]
other = channel.interact :bark
other # => :unknown_command
# Tell the server to shut down.
channel.put :shutdown
end
pid = server do
channel = Cod.tcp_server('<IP_ADDRESS>:12345')
loop do
msg, client = channel.get_ext
case msg
when :ehlo
client.put [:version, 1]
when :shutdown
break
else
client.put :unknown_command
end
end
end
# Wait for the server to terminate
Process.wait pid
Most of the time, your server will have to lurk around, waiting for clients to connect and waiting for data. As we have shown above, waiting for new connections is implicit with cod. Let’s look at how to wait for data to arrive.
In the simplest case, you just call #get
and have cod block:
channel.get # Blocks until data arrives
But in some cases, you’ll want to wait on several sockets. cod features an
extended select: This example assumes that you have two
channels you want to wait on, hodge
and podge
, and
that podge becomes available first:
Cod.select(1, [hodge, podge]) # => [podge] (timeout 1 second)
In the chapter on select you’ll find more on this
special select syntax. Reading up on this is worth your while – select
helps test which selectors have become available, something the plain old
IO.select
doesn’t do.
Although we’re pretty sure that cod doesn’t perform badly, it probably will not quite match your evented/fiberthreaded/control-inversed server. Writing such a server is still hard. Comparing something you wrote in 5 minutes using cod to a program tuned for IO will not be a fair comparison.
Evented IO is mostly overkill in day to day programming. Threading can be and often is actually harmful. What cod proposes is a saner and less convoluted way of expressing your needs. Make your choice.
In the chapter on serialisation you’ll find all about cods wire format. Turns out, beanstalkd channels are really just tcp with the proper serialisation on top! Almost, at least.
If you need selects
, be sure to point your mouse at the chapter
on select. It
1 #client
and #server
are helper methods that
fork a client or a server process respectively. Treat them as synonymous to
Kernel.fork
.
2 @code_link(Cod::TcpServer#get_ext)


Animal Collective is an American experimental pop group formed in Baltimore, Maryland in 1999. They were founded by Avey Tare (David Portner), Panda Bear (Noah Lennox), Deakin (Josh Dibb), and Geologist (Brian Weitz). Records released under the name Animal Collective may include contributions from any or all of these members; the lineup is not uniform, though Portner and Lennox have been on every Animal Collective release.
The band's music is characterized by studio experimentation, vocal harmonies, and an exploration of various genres which include freak folk, noise rock, ambient drone, and psychedelia. The group also runs the record label Paw Tracks on which they have released their own material as well as that of other artists. In 2009, the band released their most commercially successful album, Merriweather Post Pavilion, which Uncut magazine called: "one of the landmark American albums of the century so far".


--- layout: page title: About header-img: "img/about-bg.png" ---
Scientist gone programmer. My whole life I have been interested in tech but I was pushed towards science. Now that I've done what I can with science it's time to make a change and do what I always though I should be doing. Programming.


To use this language, use the class "language-haxe".
"Foo
bar $baz"
'Foo
bar'
"${4 + 2}"
~/haxe/i
~/[A-Z0-9._%-]+@[A-Z0-9.-]+.[A-Z][A-Z][A-Z]?/i
~/(dog|fox)/g
#if !debug
trace("ok");
#elseif (debug_level > 3)
trace(3);
#else
trace("debug level too low");
#end
@author("Nicolas")
@debug
class MyClass {
@range(1, 8)
var value:Int;
@broken
@:noCompletion
static function method() { }
}
macro static function add(e:Expr) {
return macro $e + $e;
}
There are certain edge cases where Prism will fail. There are always such cases in every regex-based syntax highlighter. However, Prism dares to be open and honest about them. If a failure is listed here, it doesn’t mean it will never be fixed. This is more of a “known bugs” list, just with a certain type of bug.
"foo // var"
~/"foo"/


20 Dates
[2.5/4.0]
Myles Berkowitz thought it would be interesting to combine his two biggest failures--his professional life and his personal life. Being a recently divorced, failed filmmaker, his idea is to make a documentary about finding love by filming himself going on dates with women. Just meeting women is difficult for Berkowitz, but he must also persuade them to allow him to put the date under the microscope of the camera. It is hard to kindle romance when followed by a film crew. He must wrestle with his financier who believes that Berkowitz' approach is too boring and that there must be more prurient and marketable items in the final product. Another big obstacle is that he is taking both the dates and his film very seriously. He must deal with the issue that if he is successful at finding love along the way, would it be possible to attend the remaining dates with other women?
The concept of portraying real romance in a documentary is a very compelling one because of the way it would compare with the view of romance that is usually depicted in film. It is Berkowitz' intention that the film takes both a serious and comic look at this concept. He mostly fails at the former, but succeeds at the latter. It is hard to imagine that anyone who is taking a date seriously would consent to allowing two extra people along to handle the camera and sound recording. This makes any serious exploration doomed to failure, and it usually also gives the women an unflattering opinion of Berkowitz.
It seems that Berkowitz has kept the film from becoming a muddled mess by staging much of what is portrayed. The surreptitiously recorded discussions with Elie, the film's funder, are quite funny, but not believable. Among many other questions, if Elie is opposed to the concept of the film to begin with, why is he so insistent that Berkowitz attend exactly 20 dates? The interaction between Berkowitz and strangers on the street all seem real and are often entertaining. The interaction with some of the women he actually dates sometimes seem scripted. How is it that some of the women can react negatively to Berkowitz, even threaten to sue him for taping them, yet apparently allow him to use the footage in the final film? If Berkowitz had been up front and admitted that some of the film was dramatized for the sake of comedy, it would have been easy to forgive, because much of the film was entertaining. Instead, there are too many inconsistencies to ignore, and the viewer might feel cheated for taking it seriously. However, the film can be rather entertaining if not taken seriously and viewed for its comedy.
Recommended. The most annoying aspect of the film is the implication that all the events were real, when there are too many parts that appear staged. Berkowitz himself is a rather uninteresting person, but his interaction with seemingly random people is entertaining and sometimes hilarious.
(c) 1999 Murali Krishnan The Art House Squatter http://ArtHouseSquatter.com
-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


|
cds
1.5.0
|
Michael's hash map (template specialization for RCU) More...
#include <cds/container/michael_map_rcu.h>
Data Structures | |
| class | iterator_type |
| Forward iterator. More... | |
Public Types | |
| typedef OrderedList | bucket_type |
| type of ordered list used as a bucket implementation | |
| typedef Traits | options |
| Traits template parameters. | |
| typedef bucket_type::key_type | key_type |
| key type | |
| typedef bucket_type::mapped_type | mapped_type |
| value type | |
| typedef bucket_type::value_type | value_type |
| key/value pair stored in the list | |
| typedef cds::urcu::gc< RCU > | gc |
| RCU used as garbage collector. | |
| typedef bucket_type::key_comparator | key_comparator |
| key comparision functor | |
|
typedef cds::opt::v::hash_selector < typename options::hash > ::type | hash |
| Hash functor for key_type and all its derivatives that you use. | |
| typedef options::item_counter | item_counter |
| Item counter type. | |
|
typedef cds::details::Allocator < bucket_type, typename options::allocator > | bucket_table_allocator |
| Bucket table allocator. | |
| typedef iterator_type< false > | iterator |
| Forward iterator. | |
| typedef iterator_type< true > | const_iterator |
| Const forward iterator. | |
Public Member Functions | |
| iterator | begin () |
| Returns a forward iterator addressing the first element in a map. More... | |
| iterator | end () |
| Returns an iterator that addresses the location succeeding the last element in a map. More... | |
| MichaelHashMap (size_t nMaxItemCount, size_t nLoadFactor) | |
| Initializes the map. More... | |
| ~MichaelHashMap () | |
| Clears hash map and destroys it. | |
| template<typename K > | |
| bool | insert (const K &key) |
| Inserts new node with key and default value. More... | |
| template<typename K , typename V > | |
| bool | insert (K const &key, V const &val) |
| Inserts new node. More... | |
| template<typename K , typename Func > | |
| bool | insert_key (const K &key, Func func) |
| Inserts new node and initialize it by a functor. More... | |
| template<typename K , typename Func > | |
| std::pair< bool, bool > | ensure (K const &key, Func func) |
Ensures that the key exists in the map. More... | |
| template<typename K , typename... Args> | |
| bool | emplace (K &&key, Args &&...args) |
For key key inserts data of type mapped_type constructed with std::forward<Args>(args)... More... | |
| template<typename K > | |
| bool | erase (const K &key) |
Deletes key from the map. More... | |
| template<typename K , typename Less > | |
| bool | erase_with (const K &key, Less pred) |
Deletes the item from the map using pred predicate for searching. More... | |
| template<typename K , typename Func > | |
| bool | erase (const K &key, Func f) |
Deletes key from the map. More... | |
| template<typename K , typename Less , typename Func > | |
| bool | erase_with (const K &key, Less pred, Func f) |
Deletes the item from the map using pred predicate for searching. More... | |
| template<typename K , typename Func > | |
| bool | find (K const &key, Func f) const |
Finds the key key . More... | |
| template<typename K , typename Less , typename Func > | |
| bool | find_with (K const &key, Less pred, Func f) const |
Finds the key val using pred predicate for searching. More... | |
| template<typename K > | |
| bool | find (K const &key) const |
Finds the key key . More... | |
| template<typename K , typename Less > | |
| bool | find_with (K const &key, Less pred) const |
Finds the key val using pred predicate for searching. More... | |
| void | clear () |
| Clears the map (non-atomic) More... | |
| bool | empty () const |
| Checks if the map is empty. More... | |
| size_t | size () const |
| Returns item count in the map. | |
| size_t | bucket_count () const |
| Returns the size of hash table. More... | |
| const_iterator | begin () const |
| Returns a forward const iterator addressing the first element in a map. | |
| const_iterator | cbegin () |
| const_iterator | end () const |
| Returns an const iterator that addresses the location succeeding the last element in a map. | |
| const_iterator | cend () |
Protected Member Functions | |
| template<typename Q > | |
| size_t | hash_value (Q const &key) const |
Calculates hash value of key . | |
| template<typename Q > | |
| bucket_type & | bucket (Q const &key) |
Returns the bucket (ordered list) for key . | |
| template<typename Q > | |
| bucket_type const & | bucket (Q const &key) const |
Protected Attributes | |
| item_counter | m_ItemCounter |
| Item counter. | |
| hash | m_HashFunctor |
| Hash functor. | |
| bucket_type * | m_Buckets |
| bucket table | |
Michael's hash map (template specialization for RCU)
Michael's hash table algorithm is based on lock-free ordered list and it is very simple. The main structure is an array T
of size M
. Each element in T
is basically a pointer to a hash bucket, implemented as a singly linked list. The array of buckets cannot be dynamically expanded. However, each bucket may contain unbounded number of items.
Template parameters are:
RCU
- one of RCU typeOrderedList
- ordered key-value list implementation used as bucket for hash map, for example, MichaelKVList. The ordered list implementation specifies the Key
and Value
types stored in the hash-map, the reclamation schema GC
used by hash-map, the comparison functor for the type Key
and other features specific for the ordered list.Traits
- type traits. See michael_map::type_traits for explanation.Instead of defining Traits
struct you may use option-based syntax with michael_map::make_traits
metafunction (this metafunction is a synonym for michael_set::make_traits). For michael_map::make_traits
the following option may be used:
Many of the class function take a key argument of type K
that in general is not key_type. key_type
and an argument of template type K
must meet the following requirements:
key_type
should be constructible from value of type K
;key
of type K:
hash( key_type(key) ) == hash( key )
key_type
and K
should be comparableHow to use
The tips about how to use Michael's map see MichaelHashMap. Remember, that you should include RCU-related header file (for example, cds/urcu/general_buffered.h
) before including cds/container/michael_map_rcu.h
.
|
inline |
Initializes the map.
The Michael's hash map is non-expandable container. You should point the average count of items nMaxItemCount
when you create an object. nLoadFactor
parameter defines average count of items per bucket and it should be small number between 1 and 10. Remember, since the bucket implementation is an ordered list, searching in the bucket is linear [O(nLoadFactor)
]. Note, that many popular STL hash map implementation uses load factor 1.
The ctor defines hash table size as rounding nMacItemCount / nLoadFactor
up to nearest power of two.
| nMaxItemCount | estimation of max item count in the hash map |
| nLoadFactor | load factor: estimation of max number of items in the bucket |
|
inline |
|
inline |
Returns the size of hash table.
Since MichaelHashMap cannot dynamically extend the hash table size, the value returned is an constant depending on object initialization parameters; see MichaelHashMap::MichaelHashMap for explanation.
|
inline |
Clears the map (non-atomic)
The function erases all items from the map.
The function is not atomic. It cleans up each bucket and then resets the item counter to zero. If there are a thread that performs insertion while clear
is working the result is undefined in general case: empty()
may return true
but the map may contain item(s). Therefore, clear
may be used only for debugging purposes.
RCU synchronize
method can be called. RCU should not be locked.
|
inline |
For key key
inserts data of type mapped_type constructed with std::forward<Args>(args)...
key_type
should be constructible from type K
Returns true
if inserting successful, false
otherwise.
The function applies RCU lock internally.
|
inline |
Checks if the map is empty.
Emptiness is checked by item counting: if item count is zero then the map is empty. Thus, the correct item counting is an important part of the map implementation.
|
inline |
|
inline |
Ensures that the key
exists in the map.
The operation performs inserting or changing data with lock-free manner.
If the key
not found in the map, then the new item created from key
is inserted into the map (note that in this case the key_type should be constructible from type K
). Otherwise, the functor func
is called with item found. The functor Func
may be a function with signature:
or a functor:
with arguments:
bNew
- true
if the item has been inserted, false
otherwiseitem
- item of the listThe functor may change any fields of the item.second
that is mapped_type; however, func
must guarantee that during changing no any other modifications could be made on this item by concurrent threads.
You may pass func
argument by reference using boost::ref
.
The function applies RCU lock internally.
Returns std::pair<bool, bool>
where first
is true if operation is successfull, second
is true if new item has been added or false
if the item with key
already is in the list.
|
inline |
|
inline |
Deletes key
from the map.
The function searches an item with key key
, calls f
functor and deletes the item. If key
is not found, the functor is not called.
The functor Func
interface:
The functor may be passed by reference using boost:ref
RCU synchronize
method can be called. RCU should not be locked.
Return true
if key is found and deleted, false
otherwise
|
inline |
Deletes the item from the map using pred
predicate for searching.
The function is an analog of erase(K const&) but pred
is used for key comparing. Less
predicate has the interface like std::less
. Less
must imply the same element order as the comparator used for building the map.
|
inline |
Deletes the item from the map using pred
predicate for searching.
The function is an analog of erase(K const&, Func) but pred
is used for key comparing. Less
functor has the interface like std::less
. Less
must imply the same element order as the comparator used for building the map.
|
inline |
Finds the key key
.
The function searches the item with key equal to key
and calls the functor f
for item found. The interface of Func
functor is:
where item
is the item found.
You may pass f
argument by reference using boost::ref
or cds::ref.
The functor may change item.second
. Note that the functor is only guarantee that item
cannot be disposed during functor is executing. The functor does not serialize simultaneous access to the map's item
. If such access is possible you must provide your own synchronization schema on item level to exclude unsafe item modifications.
The function applies RCU lock internally.
The function returns true
if key
is found, false
otherwise.
|
inline |
|
inline |
Finds the key val
using pred
predicate for searching.
The function is an analog of find(K const&, Func) but pred
is used for key comparing. Less
functor has the interface like std::less
. Less
must imply the same element order as the comparator used for building the map.
|
inline |
Finds the key val
using pred
predicate for searching.
The function is an analog of find(K const&) but pred
is used for key comparing. Less
functor has the interface like std::less
. Less
must imply the same element order as the comparator used for building the map.
|
inline |
Inserts new node with key and default value.
The function creates a node with key
and default value, and then inserts the node created into the map.
Preconditions:
K
. In trivial case, K
is equal to key_type.The function applies RCU lock internally.
Returns true
if inserting successful, false
otherwise.
|
inline |
Inserts new node.
The function creates a node with copy of val
value and then inserts the node created into the map.
Preconditions:
key
of type K
.val
of type V
.The function applies RCU lock internally.
Returns true
if val
is inserted into the map, false
otherwise.
|
inline |
Inserts new node and initialize it by a functor.
This function inserts new node with key key
and if inserting is successful then it calls func
functor with signature
The argument item
of user-defined functor func
is the reference to the map's item inserted:
item.first
is a const reference to item's key that cannot be changed.item.second
is a reference to item's value that may be changed.User-defined functor func
should guarantee that during changing item's value no any other changes could be made on this map's item by concurrent threads. The user-defined functor can be passed by reference using boost::ref
and it is called only if inserting is successful.
The key_type should be constructible from value of type K
.
The function allows to split creating of new item into two part:
key
;func
functorThis can be useful if complete initialization of object of mapped_type
is heavyweight and it is preferable that the initialization should be completed only if inserting is successful.
The function applies RCU lock internally.


try to answer the following code-related questions within the time limit
keep in mind that incorrect answers will penalize your score/time by ten seconds
start quiz


Web commander for hdlmake
Target Directory Selection
Up
Control Dashboard
hdlmake
make
git
This is the HDLMake menu:
auto
fetch
clean
tree
This is the Make menu:
local
remote
clean
This is the Git menu (just to get new projects):
clone
checkout
checkout
Log Console
Module Hierarchy


This is a game that I created with an awesome paragraph about it. It includes an alien-like character that tries to get coins. You have to get 30 points before you win, then it will restart. The Exclamation Point Boxes give a coin each. Use the arrow keys. Good luck!!
I am Sarah and I'm eleven years old almost twelve. This fall, I will be attending Chippewa Middle School for 7th grade. This summer, I'm doing a Drama camp and I'm training for Cross Country in the fall. I have two brothers, Paul and David, and a dog, Cocoa. I've written two songs and more than 2 1/2 books.


learned a few phrases in Nepali. practiced JS and Clojure. read math, CS, and NLP texts
off-and-on weekly volunteering through School on Wheels
participation in weekly meetings at Prof. L. Shams UCLA lab
private lessons, a tutoring center (2015 only), and volunteering through School on Wheels
taught classes at iSmart, a locally-owned and -operated private English school


Copyright © 2009 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C liability, trademark and document use rules apply.
CSS 2D Transforms allows elements rendered by CSS to be transformed in two-dimensional space.
This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at http://www.w3.org/TR/.
Publication as a Working Draft does not imply endorsement by the W3C Membership. This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.
The (archived) public mailing list<EMAIL_ADDRESS>(see instructions) is preferred for discussion of this specification. When sending e-mail, please put the text “css3-2d-transforms” in the subject, preferably like this: “[css3-2d-transforms] …summary of comment…”
This document was produced by the CSS Working Group (part of the Style Activity).
This document was produced by a group operating under the 5 February 2004 W3C Patent Policy. W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.
The list of changes made to this specification is available.
transform
’ Property
transform-origin
’ Property
This section is not normative.
The CSS visual formatting model describes a coordinate system within which each element is positioned. Positions and sizes in this coordinate space can be thought of as being expressed in pixels, starting in the upper left corner of the parent with positive values proceeding to the right and down.
This coordinate space can be modified with the ‘transform
’ property. Using
transform, elements can be translated, rotated and scaled in two
dimensional space. The coordinate space behaves as described in the coordinate
system transformations section of the SVG 1.1 specification. This is a
coordinate system with two axes: the X axis increases horizontally to the
right; the Y axis increases vertically downwards.
Specifying a value other than ‘none
’ for the ‘transform
’ property establishes a
new local coordinate system at the element that it is applied to.
Transformations are cumulative. That is, elements establish their local
coordinate system within the coordinate system of their parent. In this
way, a ‘transform
’ property effectively
accumulates all the ‘transform
’ properties of its
ancestors. The accumulation of these transforms defines a current
transformation matrix (CTM) for the element.
The transform property does not affect the flow of the content
surrounding the transformed element. However, the value of the overflow
area takes into account transformed elements. This behavior is similar to
what happens when elements are translated via relative positioning.
Therefore, if the value of the ‘overflow
’ property is ‘scroll
’
or ‘auto
’, scrollbars will appear as needed
to see content that is transformed outside the visible area.
Any value other than ‘none
’ for
the transform results in the creation of both a stacking context and a
containing block. The object acts as a containing block for fixed
positioned descendants.
transform
’ Property A two-dimensional transformation is applied to an element through the
‘transform
’ property. This property
contains a list of transform functions.
The final transformation value for an element is obtained by performing a
matrix concatenation of each entry in the list. The set of transform
functions is similar to those allowed by SVG.
| Name: | transform |
| Value: | none | <transform-function> [ <transform-function> ]* |
| Initial: | none |
| Applies to: | block-level and inline-level elements |
| Inherited: | no |
| Percentages: | refer to the size of the element's box |
| Media: | visual |
| Computed value: | Same as specified value. |
transform-origin
’
Property The ‘transform-origin
’
property establishes the origin of transformation for an element. This
property is applied by first translating the element by the negated value
of the property, then applying the element's transform, then translating
by the property value. This effectively moves the desired transformation
origin of the element to (0,0) in the local coordinate system, then
applies the element's transform, then moves the element back to its
original position.
If only one value is specified, the second value is assumed to be
‘center
’. If at least one value is
not a keyword, then the first value represents the horizontal position and
the second represents the vertical position. Negative <percentage>
and <length> values are allowed.
| Name: | transform-origin |
| Value: | [ [ <percentage> | <length> | left | center | right ] [ <percentage> | <length> | top | center | bottom ]? ] | [ [ left | center | right ] || [ top | center | bottom ] ] |
| Initial: | 50% 50% |
| Applies to: | block-level and inline-level elements |
| Inherited: | no |
| Percentages: | refer to the size of the element's box |
| Media: | visual |
| Computed value: | For <length> the absolute value, otherwise a percentage |
The value of the transform property is a list of <transform-functions> applied in the order provided. The individual transform functions are separated by whitespace. The set of allowed transform functions is given below. In this list the type <translation-value> is defined as a <length> or <percentage> value, and the <angle> type is defined by CSS Values and Units.
The <translation-value> values are defined as [<percentage> | <length>]. All other value types are described as CSS types. If a list of transforms is provided, then the net effect is as if each transform had been specified separately in the order provided. For example,

is functionally equivalent to:

div { transform: translate(100px, 100px); }Move the element by 100 pixels in both the X and Y directions.
div { height: 100px; width: 100px; transform: translate(80px, 80px) scale(1.5, 1.5) rotate(45deg); }Move the element by 80 pixels in both the X and Y directions, then scale the element by 150%, then rotate it 45 degrees clockwise about the Z axis. Note that the scale and rotate operate about the center of the element, since the element has the default transform-origin of 50% 50%.
When animating or transitioning the value of a transform property the
rules described below are applied. The ‘from
’ transform is the transform at the start
of the transition or current keyframe. The ‘end
’ transform is the transform at the end of
the transition or current keyframe.
from
’ and
‘to
’ transforms are both single
functions of the same type:
from
’ and
‘to
’ transforms are "none":
from
’ or
‘to
’ transforms is "none":
none
’ is replaced by
an equivalent identity function list for the corresponding transform
function list.
For example, if the ‘from
’
transform is "scale(2)" and the ‘to
’ transform is "none" then the value
"scale(1)" will be used as the ‘to
’ value, and animation will proceed
using the rule above. Similarly, if the ‘from
’ transform is "none" and the
‘to
’ transform is "scale(2)
rotate(50deg)" then the animation will execute as if the ‘from
’ value is "scale(1) rotate(0)".
The identity functions are translate(0), translateX(0), translateY(0), scale(1), scaleX(1), scaleY(1), rotate(0), rotateX(0), rotateY(0), skewX(0), skewY(0), skew(0, 0) and matrix(1, 0, 0, 1, 0, 0).
from
’ and
‘to
’ transforms have the same
number of transform functions and corresponding functions in each
transform list are of the same type:
In some cases, an animation might cause a transformation matrix to be singular or non-invertible. For example, an animation in which scale moves from 1 to -1. At the time when the matrix is in such a state, the transformed element is not rendered.
When interpolating between 2 matrices, each is decomposed into the corresponding translation, rotation, scale, skew, and perspective values. Not all matrices can be accurately described by these values. Those that can't are decomposed into the most accurate representation possible, using the technique below. This technique is taken from The "unmatrix" method in "Graphics Gems II, edited by Jim Arvo". The pseudocode below works on a 4x4 homogeneous matrix. A 3x2 2D matrix is therefore first converted to 4x4 homogeneous form.
Input: matrix ; a 4x4 matrix Output: translation ; a 3 component vector rotation ; Euler angles, represented as a 3 component vector scale ; a 3 component vector skew ; skew factors XY,XZ,YZ represented as a 3 component vector perspective ; a 4 component vector Returns false if the matrix cannot be decomposed, true if it can Supporting functions (point is a 3 component vector, matrix is a 4x4 matrix): float determinant(matrix) returns the 4x4 determinant of the matrix matrix inverse(matrix) returns the inverse of the passed matrix matrix transpose(matrix) returns the transpose of the passed matrix point multVecMatrix(point, matrix) multiplies the passed point by the passed matrix and returns the transformed point float length(point) returns the length of the passed vector point normalize(point) normalizes the length of the passed point to 1 float dot(point, point) returns the dot product of the passed points float cos(float) returns the cosine of the passed angle in radians float asin(float) returns the arcsine in radians of the passed value float atan2(float y, float x) returns the principal value of the arc tangent of y/x, using the signs of both arguments to determine the quadrant of the return value Decomposition also makes use of the following function: point combine(point a, point b, float ascl, float bscl) result[0] = (ascl * a[0]) + (bscl * b[0]) result[1] = (ascl * a[1]) + (bscl * b[1]) result[2] = (ascl * a[2]) + (bscl * b[2]) return result // Normalize the matrix. if (matrix[3][3] == 0) return false for (i = 0; i < 4; i++) for (j = 0; j < 4; j++) matrix[i][j] /= matrix[3][3] // perspectiveMatrix is used to solve for perspective, but it also provides // an easy way to test for singularity of the upper 3x3 component. perspectiveMatrix = matrix for (i = 0; i < 3; i++) perspectiveMatrix[i][3] = 0 perspectiveMatrix[3][3] = 1 if (determinant(perspectiveMatrix) == 0) return false // First, isolate perspective. if (matrix[0][3] != 0 || matrix[1][3] != 0 || matrix[2][3] != 0) // rightHandSide is the right hand side of the equation. rightHandSide[0] = matrix[0][3]; rightHandSide[1] = matrix[1][3]; rightHandSide[2] = matrix[2][3]; rightHandSide[3] = matrix[3][3]; // Solve the equation by inverting perspectiveMatrix and multiplying // rightHandSide by the inverse. inversePerspectiveMatrix = inverse(perspectiveMatrix) transposedInversePerspectiveMatrix = transposeMatrix4(inversePerspectiveMatrix) perspective = multVecMatrix(rightHandSide, transposedInversePerspectiveMatrix) // Clear the perspective partition matrix[0][3] = matrix[1][3] = matrix[2][3] = 0 matrix[3][3] = 1 else // No perspective. perspective[0] = perspective[1] = perspective[2] = 0 perspective[3] = 1 // Next take care of translation translate[0] = matrix[3][0] matrix[3][0] = 0 translate[1] = matrix[3][1] matrix[3][1] = 0 translate[2] = matrix[3][2] matrix[3][2] = 0 // Now get scale and shear. 'row' is a 3 element array of 3 component vectors for (i = 0; i < 3; i++) row[i][0] = matrix[i][0] row[i][1] = matrix[i][1] row[i][2] = matrix[i][2] // Compute X scale factor and normalize first row. scale[0] = length(row[0]) row[0] = normalize(row[0]) // Compute XY shear factor and make 2nd row orthogonal to 1st. skew[0] = dot(row[0], row[1]) row[1] = combine(row[1], row[0], 1.0, -skew[0]) // Now, compute Y scale and normalize 2nd row. scale[1] = length(row[1]) row[1] = normalize(row[1]) skew[0] /= scale[1]; // Compute XZ and YZ shears, orthogonalize 3rd row skew[1] = dot(row[0], row[2]) row[2] = combine(row[2], row[0], 1.0, -skew[1]) skew[2] = dot(row[1], row[2]) row[2] = combine(row[2], row[1], 1.0, -skew[2]) // Next, get Z scale and normalize 3rd row. scale[2] = length(row[2]) row[2] = normalize(row[2]) skew[1] /= scale[2] skew[2] /= scale[2] // At this point, the matrix (in rows) is orthonormal. // Check for a coordinate system flip. If the determinant // is -1, then negate the matrix and the scaling factors. pdum3 = cross(row[1], row[2]) if (dot(row[0], pdum3) < 0) for (i = 0; i < 3; i++) { scale[0] *= -1; row[i][0] *= -1 row[i][1] *= -1 row[i][2] *= -1 // Now, get the rotations ou rotate[1] = asin(-row[0][2]); if (cos(rotate[1]) != 0) rotate[0] = atan2(row[1][2], row[2][2]); rotate[2] = atan2(row[0][1], row[0][0]); else rotate[0] = atan2(-row[2][0], row[1][1]); rotate[2] = 0; return true;
Each component of each returned value is linearly interpolated with the corresponding component of the other matrix. The resulting components are then recomposed into a final matrix as though combining the following transform functions:
matrix3d(1,0,0,0, 0,1,0,0, 0,0,1,0, perspective[0], perspective[1], perspective[2], perspective[3]) translate3d(translation[0], translation[1], translation[2]) rotateX(rotation[0]) rotateY(rotation[1]) rotateZ(rotation[2]) matrix3d(1,0,0,0, 0,1,0,0, 0,skew[2],1,0, 0,0,0,1) matrix3d(1,0,0,0, 0,1,0,0, skew[1],0,1,0, 0,0,0,1) matrix3d(1,0,0,0, skew[0],1,0,0, 0,0,1,0, 0,0,0,1) scale3d(scale[0], scale[1], scale[2])
This section describes the interfaces and functionality added to the DOM to support runtime access to the functionality described above.
The CSSMatrix
interface represents a 4x4 homogeneous
matrix.
interface CSSMatrix { attribute float a; attribute float b; attribute float c; attribute float d; attribute float e; attribute float f; void setMatrixValue(in DOMString string) raises(DOMException); CSSMatrix multiply(in CSSMatrix secondMatrix); CSSMatrix multiplyLeft(in CSSMatrix secondMatrix); CSSMatrix inverse() raises(DOMException); CSSMatrix translate(in float x, in float y); CSSMatrix scale(in float scaleX, in float scaleY); CSSMatrix skew(in float angleX, in float angleY); CSSMatrix rotate(in float angle); };
a-f
of type float
setMatrixValue
setMatrixValue
method replaces
the existing matrix with one computed from parsing the passed string
as though it had been assigned to the transform property in a CSS
style rule.
string
of type
DOMString
DOMException SYNTAX_ERR
multiply
multiply
method returns a new
CSSMatrix which is the result of this matrix multiplied by the
passed matrix, with the passed matrix to the right. This matrix is
not modified.
secondMatrix
of type
CSSMatrix
CSSMatrix
multiplyLeft
multiplyLeft
method returns a new
CSSMatrix which is the result of this matrix multiplied by the
passed matrix, with the passed matrix to the left. This matrix is
not modified.
secondMatrix
of type
CSSMatrix
CSSMatrix
inverse
inverse
method returns a new
matrix which is the inverse of this matrix. This matrix is not
modified.
CSSMatrix
DOMException NOT_SUPPORTED_ERR
translate
translate
method returns a new
matrix which is this matrix post multiplied by a translation matrix
containing the passed values. This matrix is not modified.
x
of type
float
y
of type
float
CSSMatrix
scale
scale
method returns a new matrix
which is this matrix post multiplied by a scale matrix containing
the passed values. If the y component is undefined, the x component
value is used in its place. This matrix is not modified.
scaleX
of type
float
scaleY
of type
float
CSSMatrix
rotate
rotate
method returns a new
matrix which is this matrix post multiplied by a rotation matrix.
The rotation value is in degrees. This matrix is not modified.
angle
of type
float
CSSMatrix
skew
skew
method returns a new matrix
which is this matrix post multiplied by a skew matrix. The rotation
value is in degrees. This matrix is not modified.
angleX
of type
float
angleY
of type
float
CSSMatrix
In addition to the interface listed above, the
getComputedStyle
method of the Window
object has
been updated. The transform
property
of the style object returned by getComputedStyle
contains a
DOMString of the form "matrix(a, b, c, d, e, f)" representing the 3x2
matrix that is the result of applying the individual functions listed in
the transform
property.
| Property | Values | Initial | Applies to | Inh. | Percentages | Media |
|---|---|---|---|---|---|---|
| transform | none | <transform-function> [ <transform-function> ]* | none | block-level and inline-level elements | no | refer to the size of the element's box | visual |
| transform-origin | [ [ <percentage> | <length> | left | center | right ] [ <percentage> | <length> | top | center | bottom ]? ] | [ [ left | center | right ] || [ top | center | bottom ] ] | 50% 50% | block-level and inline-level elements | no | refer to the size of the element's box | visual |