| DOSE: |
200 mg |
oral |
MDMA |
(capsule) |
I was visiting Toronto from London, Ontario over the Christmas holidays. I brought some MDMA in powder form that I measured into 0.1g portions and put into gel capsules. I've always found pure MDMA to be much better than any kind of ecstasy pill that I would buy off a random dealer. This experience only enforces my opinions on it.
The first night I arrived, I was with my friend Tamas and his friend Kirsten who I have met on other trips to Toronto. It was Tamas's first time experiencing any form of ecstasy or MDMA, so he only took 0.1g. Kirstin had done enough normal ecstasy pills to know the x-perience, but never pure MDMA, so she did 0.2g. I also took 0.2g.
We smoked some bud on Kirstin's back porch while we waited for it to kick in, and slowly the MDMA became apparent. It hit Kirstin first, and she was *thouroughly* impressed by it. Tamas wasn't sure if he felt it for a while, but finally he picked up his bass guitar and started plucking and strumming away. Somewhere around this time I began to feel it.
I'm quite sure that Tamas's bass playing initiated his onset, because he started telling us about how much better he was playing than he ever could before. He said it felt as though his fingers were nimble and his music was fluid. When we asked him if he was feeling it now, he said, 'Yes.' At this point we all sat back and listened to Tamas play.
Now at this point, I will have to explain things in a bit of an odd way because of what occurred. It may sound strange, but we suddenly snapped back to our senses. Kirsten and Tamas were very confused as to what had just happened. The lights were off, and at least an hour had passed in seemingly no time at all. I knew immediately that we had meditated, because I had practiced meditation before, but never with a group or to this depth. I explained to the other two what had happened and they were still in awe.
After confering about our meditation experience, we concluded that the time had not simply been lost. We could actually remember the whole thing, but at the time we had not taken any notice to what we were doing. I can recall carrying on spoken conversation with the others, although there is no recollection as to what was said at any point. Tamas, although in meditation as well, continued playing his bass guitar up until the time when the meditation ended. Kirsten watched Tamas the whole time.
Now, MDMA had never caused me to have any visuals before, but nearing the very end of the meditation I remember feeling as though my eyes had opened and when I looked up there was no more ceiling, only a sky full of stars. The three of us were sitting below the stars, just as if we were in the room. I felt as though we had taken a journey through our meditation and finally arrived there, at a higher level of conciousness where a moment was as good as eternity.
The next day, all three of us could still feel a very distinct glow of warmth and comfort. At times it would seem to fade away, but it always came back, perhaps slightly diminished each time, until all was normal again. It was much better than any crappy sketch out I had ever had.
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.


Browns Reportedly Shut Down An Exclusive Myles Garrett Interview After Season-Long Suspension
by Darrelle LincolnIn the wake of the indefinite suspension handed down to Cleveland Browns DE Myles Garrett for his helmet swing at Pittsburgh Steelers QB Mason Rudolph that connected with his head, he has pretty much been silent aside from releasing a statement to the media after being suspended.
FOX Sports NFL insider Jay Glazer revealed on Sunday that he got Garrett to agree to a sit-down interview with him to address everything that happened during that massive brawl that ended his 2019 campaign.
Unfortunately for him and us, we won’t get to hear it.
Glazer took to Twitter to explain shortly before he and his team were headed to the airport to fly outand meet Garrett, the Browns informed him that he could not do the interview.
Aside from the Browns DE missing the rest of the year — Browns DT Larry Ogunjobi earned a suspension of his own after he was viewed pushing Mason Rudolph from behind with his helmet off.
Cleveland will face the Miami Dolphins next week as they look to continue on their 2-game winning streak and keep their playoff hopes alive.


class YARD::Handlers::Base
Handlers are pluggable semantic parsers for YARD's code generation phase. They allow developers to control what information gets generated by YARD, giving them the ability to, for instance, document any Ruby DSLs that a customized framework may use. A good example of this would be the ability to document and generate meta data for the 'describe' declaration of the RSpec testing framework by simply adding a handler for such a keyword. Similarly, any Ruby API that takes advantage of class level declarations could add these to the documentation in a very explicit format by treating them as first- class objects in any outputted documentation.
Overview of a Typical Handler Scenario¶ ↑
Generally, a handler class will declare a set of statements which it will handle using the {handles} class declaration. It will then implement the {#process} method to do the work. The processing would usually involve the manipulation of the {#namespace}, {#owner} {CodeObjects::Base code objects} or the creation of new ones, in which case they should be registered by {#register}, a method that sets some basic attributes for the new objects.
Handlers are usually simple and take up to a
page of code to process and register a new object or add new attributes to
the current namespace
.
Setting up a Handler for Use¶ ↑
A Handler is automatically registered when it is subclassed from the base
class. The only other thing that needs to be done is to specify which
statement the handler will process. This is done with the
handles
declaration, taking either a
{Parser::Ruby::Legacy::RubyToken}, {String} or `Regexp`. Here is a simple
example which processes module statements.
class MyModuleHandler < YARD::Handlers::Base handles TkMODULE def process # do something end end
Processing Handler Data¶ ↑
The goal of a specific handler is really up to the developer, and as such there is no real guideline on how to process the data. However, it is important to know where the data is coming from to be able to use it.
statement
Attribute¶ ↑
The statement
attribute pertains to the
{Parser::Ruby::Legacy::Statement} object containing a set of tokens parsed
in by the parser. This is the main set of data to be analyzed and
processed. The comments attached to the statement can be accessed by the
{Parser::Ruby::Legacy::Statement#comments} method, but generally the data
to be processed will live in the tokens
attribute. This list
can be converted to a String
using #to_s
to parse
the data with regular expressions (or other text processing mechanisms), if
needed.
namespace
Attribute¶ ↑
The namespace
attribute is a {CodeObjects::NamespaceObject
namespace object} which represents the current namespace that the parser is
in. For instance:
module SomeModule class MyClass def mymethod; end end end
If a handler was to parse the 'class MyClass' statement, it would
be necessary to know that it belonged inside the SomeModule module. This is
the value that namespace
would return when processing such a
statement. If the class was then entered and another handler was called on
the method, the namespace
would be set to the
'MyClass' code object.
owner
Attribute¶ ↑
The owner
attribute is similar to the namespace
attribute in that it also follows the scope of the code during parsing.
However, a namespace object is loosely defined as a module or class and YARD has the ability to parse beyond module and
class blocks (inside methods, for instance), so the owner
attribute would not be limited to modules and classes.
To put this into context, the example from above will be used. If a method
handler was added to the mix and decided to parse inside the method body,
the owner
would be set to the method object but the namespace
would remain set to the class. This would allow the developer to process
any method definitions set inside a method (def x; def y; 2 end end) by
adding them to the correct namespace (the class, not the method).
In summary, the distinction between namespace
and
owner
can be thought of as the difference between first-class
Ruby objects (namespaces) and second-class Ruby objects (methods).
visibility
and scope
Attributes¶ ↑
Mainly needed for parsing methods, the visibility
and
scope
attributes refer to the public/protected/private and
class/instance values (respectively) of the current parsing position.
Parsing Blocks in Statements¶ ↑
In addition to parsing a statement and creating new objects, some handlers may wish to continue parsing the code inside the statement's block (if there is one). In this context, a block means the inside of any statement, be it class definition, module definition, if statement or classic 'Ruby block'.
For example, a class statement would be “class MyClass” and the block would
be a list of statements including the method definitions inside the class.
For a class handler, the programmer would execute the {#parse_block} method
to continue parsing code inside the block, with the namespace
now pointing to the class object the handler created.
YARD has the ability to continue into any block: class, module, method, even if statements. For this reason, the block parsing method must be invoked explicitly out of efficiency sake.
@abstract Subclass this class to provide a handler for YARD to use
during the processing phase.
@see CodeObjects::Base @see CodeObjects::NamespaceObject @see handles @see namespace @see owner @see register @see parse_block
Attributes
@return [Processor] the processor object that manages all global state
during handling.
@return [Object] the statement object currently being processed. Usually
refers to one semantic language statement, though the strict definition depends on the parser used.
Public Class Methods
Clear all registered subclasses. Testing purposes only @return [void]
# File lib/yard/handlers/base.rb, line 158 def clear_subclasses @@subclasses = [] end
@return [Array] a list of matchers for the handler object. @see handles?
# File lib/yard/handlers/base.rb, line 210 def handlers @handlers ||= [] end
Declares the statement type which will be processed by this handler.
A match need not be unique to a handler. Multiple handlers can process the same statement. However, in this case, care should be taken to make sure that {#parse_block} would only be executed by one of the handlers, otherwise the same code will be parsed multiple times and slow YARD down.
@param [Parser::RubyToken, Symbol, String, Regexp] matches
statements that match the declaration will be processed by this handler. A {String} match is equivalent to a +/\Astring/+ regular expression (match from the beginning of the line), and all token matches match only the first token of the statement.
# File lib/yard/handlers/base.rb, line 191 def handles(*matches) (@handlers ||= []).concat(matches) end
This class is implemented by {Ruby::Base} and {Ruby::Legacy::Base}. To implement a base handler class for another language, implement this method to return true if the handler should process the given statement object. Use {handlers} to enumerate the matchers declared for the handler class.
@param statement a statement object or node (depends on language type) @return [Boolean] whether or not this handler object should process
the given statement
# File lib/yard/handlers/base.rb, line 204 def handles?(statement) # rubocop:disable Lint/UnusedMethodArgument raise NotImplementedError, "override #handles? in a subclass" end
Declares that a handler should only be called when inside a filename by its basename or a regex match for the full path.
@param [String, Regexp] filename a matching filename or regex @return [void] @since 0.6.2
# File lib/yard/handlers/base.rb, line 234 def in_file(filename) (@in_files ||= []) << filename end
# File lib/yard/handlers/base.rb, line 168 def inherited(subclass) @@subclasses ||= [] @@subclasses << subclass end
@return [Boolean] whether the filename matches the declared file
match for a handler. If no file match is specified, returns true.
@since 0.6.2
# File lib/yard/handlers/base.rb, line 241 def matches_file?(filename) @in_files ||= nil # avoid ruby warnings return true unless @in_files @in_files.any? do |in_file| case in_file when String File.basename(filename) == in_file when Regexp filename =~ in_file else true end end end
Declares that the handler should only be called when inside a {CodeObjects::NamespaceObject}, not a method body.
@return [void]
# File lib/yard/handlers/base.rb, line 218 def namespace_only @namespace_only = true end
@return [Boolean] whether the handler should only be processed inside
a namespace.
# File lib/yard/handlers/base.rb, line 224 def namespace_only? @namespace_only ||= false end
# File lib/yard/handlers/base.rb, line 275 def initialize(source_parser, stmt) @parser = source_parser @statement = stmt end
Generates a process
method, equivalent to +def process; …
end+. Blocks defined with this syntax will be wrapped inside an anonymous
module so that the handler class can be extended with mixins that override
the process
method without alias chaining.
@!macro yard.handlers.process
@!method process Main processing callback @return [void]
@see process @return [void] @since 0.5.4
# File lib/yard/handlers/base.rb, line 268 def process(&block) mod = Module.new mod.send(:define_method, :process, &block) include mod end
Returns all registered handler subclasses. @return [Array<Base>] a list of handlers
# File lib/yard/handlers/base.rb, line 164 def subclasses @@subclasses ||= [] end
Public Instance Methods
Aborts a handler by raising {Handlers::HandlerAborted}. An exception will only be logged in debugging mode for this kind of handler exit.
@since 0.8.4
# File lib/yard/handlers/base.rb, line 354 def abort! raise Handlers::HandlerAborted end
@abstract Implement this method to return the parameters in a method call
statement. It should return an empty list if the statement is not a method call.
@return [Array<String>] a list of argument names
# File lib/yard/handlers/base.rb, line 580 def call_params raise NotImplementedError end
@abstract Implement this method to return the method being called in
a method call. It should return nil if the statement is not a method call.
@return [String] the method name being called @return [nil] if the statement is not a method call
# File lib/yard/handlers/base.rb, line 589 def caller_method raise NotImplementedError end
Ensures that a specific object
has been parsed and loaded into
the registry. This is necessary when adding data to a namespace, for
instance, since the namespace may not have been processed yet (it can be
located in a file that has not been handled).
Calling this method defers the handler until all other files have been processed. If the object gets resolved, the rest of the handler continues, otherwise an exception is raised.
@example Adding a mixin to the String class programmatically
ensure_loaded! P('String') # "String" is now guaranteed to be loaded P('String').mixins << P('MyMixin')
@param [Proxy, CodeObjects::Base] object the object to resolve. @param [Integer] max_retries the number of times to defer the handler
before raising a +NamespaceMissingError+.
@raise [NamespaceMissingError] if the object is not resolved within
+max_retries+ attempts, this exception is raised and the handler finishes processing.
# File lib/yard/handlers/base.rb, line 560 def ensure_loaded!(object, max_retries = 1) return if object.root? return object unless object.is_a?(Proxy) retries = 0 while object.is_a?(Proxy) raise NamespaceMissingError, object if retries > max_retries log.debug "Missing object #{object} in file `#{parser.file}', moving it to the back of the line." parser.parse_remaining_files retries += 1 end object end
# File lib/yard/handlers/base.rb, line 341 def namespace=(v); parser.namespace = v end
# File lib/yard/handlers/base.rb, line 339 def owner=(v) parser.owner = v end
Parses the semantic “block” contained in the statement node.
@abstract Subclasses should call {Processor#process parser.process}
# File lib/yard/handlers/base.rb, line 303 def parse_block(*) raise NotImplementedError, "#{self} did not implement a #parse_block method for handling" end
The main handler method called by the parser on a statement that matches the {handles} declaration.
Subclasses should override this method to provide the handling functionality for the class.
@return [Array<CodeObjects::Base>, CodeObjects::Base, Object]
If this method returns a code object (or a list of them), they are passed to the +#register+ method which adds basic attributes. It is not necessary to return any objects and in some cases you may want to explicitly avoid the returning of any objects for post-processing by the register method.
@see handles @see register
# File lib/yard/handlers/base.rb, line 296 def process raise NotImplementedError, "#{self} did not implement a #process method for handling." end
Executes a given block with specific state values for {#owner}, {#namespace} and {#scope}.
@option opts [CodeObjects::NamespaceObject] :namespace (value of namespace)
the namespace object that {#namespace} will be equal to for the duration of the block.
@option opts [Symbol] :scope (:instance)
the scope for the duration of the block.
@option opts [CodeObjects::Base] :owner (value of owner)
the owner object (method) for the duration of the block
@yield a block to execute with the given state values.
# File lib/yard/handlers/base.rb, line 369 def push_state(opts = {}) opts = { :namespace => namespace, :scope => :instance, :owner => owner || namespace, :visibility => nil }.update(opts) ns = namespace vis = visibility sc = scope oo = owner self.namespace = opts[:namespace] self.visibility = opts[:visibility] || :public self.scope = opts[:scope] self.owner = opts[:owner] yield self.namespace = ns self.visibility = vis self.scope = sc self.owner = oo end
Do some post processing on a list of code objects. Adds basic attributes to the list of objects like the filename, line number, {CodeObjects::Base#dynamic}, source code and {CodeObjects::Base#docstring}, but only if they don't exist.
@param [Array<CodeObjects::Base>] objects
the list of objects to post-process.
@return [CodeObjects::Base, Array<CodeObjects::Base>]
returns whatever is passed in, for chainability.
# File lib/yard/handlers/base.rb, line 406 def register(*objects) objects.flatten.each do |object| next unless object.is_a?(CodeObjects::Base) register_ensure_loaded(object) yield(object) if block_given? register_file_info(object) register_source(object) register_visibility(object) register_docstring(object) register_group(object) register_dynamic(object) register_module_function(object) end objects.size == 1 ? objects.first : objects end
Registers any docstring found for the object and expands macros
@param [CodeObjects::Base] object the object to register @return [void] @since 0.8.0
# File lib/yard/handlers/base.rb, line 449 def register_docstring(object, docstring = statement.comments, stmt = statement) docstring = docstring.join("\n") if Array === docstring parser = Docstring.parser parser.parse(docstring || "", object, self) if object && docstring object.docstring = parser.to_docstring # Add hash_flag/line_range if stmt object.docstring.hash_flag = stmt.comments_hash_flag object.docstring.line_range = stmt.comments_range end end register_transitive_tags(object) end
Registers the object as dynamic if the object is defined inside a method or block (owner != namespace)
@param [CodeObjects::Base] object the object to register @return [void] @since 0.8.0
# File lib/yard/handlers/base.rb, line 536 def register_dynamic(object) object.dynamic = true if owner != namespace end
Ensures that the object's namespace is loaded before attaching it to the namespace.
@param [CodeObjects::Base] object the object to register @return [void] @since 0.8.0
# File lib/yard/handlers/base.rb, line 428 def register_ensure_loaded(object) ensure_loaded!(object.namespace) object.namespace.children << object rescue NamespaceMissingError nil # noop end
Registers the file/line of the declaration with the object
@param [CodeObjects::Base] object the object to register @return [void] @since 0.8.0
# File lib/yard/handlers/base.rb, line 440 def register_file_info(object, file = parser.file, line = statement.line, comments = statement.comments) object.add_file(file, line, comments) end
Registers the object as being inside a specific group
@param [CodeObjects::Base] object the object to register @return [void] @since 0.8.0
# File lib/yard/handlers/base.rb, line 472 def register_group(object, group = extra_state.group) if group unless object.namespace.is_a?(Proxy) object.namespace.groups |= [group] end object.group = group end end
Registers the same method information on the module function, if the object was defined as a module function.
@param [CodeObjects::Base] object the possible module function object
to copy data for
@since 0.8.0
# File lib/yard/handlers/base.rb, line 522 def register_module_function(object) return unless object.is_a?(MethodObject) return unless object.module_function? modobj = MethodObject.new(object.namespace, object.name) object.copy_to(modobj) modobj.visibility = :private # rubocop:disable Lint/UselessSetterCall end
@param [CodeObjects::Base] object the object to register @return [void] @since 0.8.0
# File lib/yard/handlers/base.rb, line 498 def register_source(object, source = statement, type = parser.parser_type) return unless object.is_a?(MethodObject) object.source ||= source object.source_type = type end
Registers visibility on a method object. If the object does not respond to setting visibility, nothing is done.
@param [#visibility=] object the object to register @param [Symbol] visibility the visibility to set on the object @since 0.8.0
# File lib/yard/handlers/base.rb, line 510 def register_visibility(object, visibility = self.visibility) return unless object.respond_to?(:visibility=) return if object.is_a?(NamespaceObject) object.visibility = visibility end
# File lib/yard/handlers/base.rb, line 345 def scope=(v); parser.scope = v end
# File lib/yard/handlers/base.rb, line 343 def visibility=(v); parser.visibility = v end


Hello {{ user.username }}!
Here are your messages:
-
{% for m in msgs %}
- {{ m.subject }} (from {{ m.sender }})
{% endfor %}
Do you want to send a message?
Hello {{ user.username }}!
Here are your messages:
Do you want to send a message?
Invalid username or password.
{% endif %} {% endif %}


This is the second post in a series reflecting on John Spencer’s Sages and Lunatics The machete was dangerous that day. There is power that comes with learning. Ideas are born; worldviews are constructed. As we learn, we are forced to fit that new information into our existing perceptions and biases. As teachers, we have the abil... Read more 27 May 2014 - 1 minute read
This is the first post in a series reflecting on John Spencer’s Sages and Lunatics. A report came out in early May with data showing college students saw teaching as one of the easiest majors to follow and said that teaching was the top profession for “average” people. In the wake of the report, there have been calls for more stringent teache... Read more 23 May 2014 - 2 minute read
No, not that Mars. FlipCon14 is coming up June 23-25. This is the 7th annual event, and I’ve had the privilege of watching it grow from 35 people in Woodland Park (FlipCon10) to nearly 450 last year in Minnesota. This year, we’re in Mars, PA (near Pittsburgh) and we’ve got a fantastic lineup planned. Along with Jon and Aaron’s keynote, Molly ... Read more 22 May 2014 - less than 1 minute read
Twitter mailase has set in big time. Twitter is dying! No, it’s just beginning! *I’m not sure I can really explain my own confusion or mixed feelings. The power in any network is in how it allows you to connect with people. Part of the reason I’ve started to migrate away from Facebook is because of the backend filtering of which ... Read more 12 May 2014 - 1 minute read
Short post tonight. For the final assignment this semester, we were asked to read Thomas Friedman’s OpEd on Passion Quotient and Curiosity Quotient as the big need moving forward in the world (the previous need being IQ – intelligence quotient). I have to admit, this particular assignment really stumped me. I wasn’t sure about what I thought or... Read more 01 May 2014 - less than 1 minute read
Post Updated 4/27/14 9:15PM – Since writing this post, my group has finished our project. Rather than adding a separate post, I’ve updated the links below to the final recommendation. The semester is winding down and that means final projects are wrapping up. In Applying Edtech to Practice, my group tackled the problem of “rethinking teaching... Read more 22 Apr 2014 - 1 minute read
Survey Analysis Last week, I distributed a short survey on technology and professional development. I’ve typed up some brief analysis, looking at major patterns and asking new questions, in a public Google Doc. Please head over there to read the full summary and leave comments if you have them. Graphics I took some of my data and made it into... Read more 20 Apr 2014 - less than 1 minute read
Blog readers, I come to you again asking for help with a survey. As many of you know, I’m working on a masters degree in education technology through Michigan State University. I have a short survey in circulation looking at technology integration and the associated professional development. It will take 5-10 minutes, and your help would be gre... Read more 17 Apr 2014 - less than 1 minute read
I was working on a Chrome Extension (feel free to download and use it) this evening and I noticed something awesome. If you right click on a webpage in Chrome, one option in the menu is “Inspect Element.” It shows a lot of programming mumbo jumbo which is extremely useful in programming, but not necessarily for anything else, especially if you’... Read more 16 Apr 2014 - 1 minute read
Tin Cans Twitter chats are often the first point of entry for developing a PLN. It was where I began. I randomly followed some people who had “Education” in their profile, which led me to #edchat which led me to more people with “education” in their profiles. I built a large group of people I could connect with on various issues. The problem w... Read more 10 Apr 2014 - 3 minute read


JavaScript is disabled on your browser.
Skip navigation links
Overview
Package
Class
Tree
Index
Help
Prev Letter
Next Letter
Frames
No Frames
All Classes
B
C
D
E
F
G
I
M
O
P
R
S
T
U
R
randInt(int, int)
- Static method in class common.
Randomizer
Randomizer
- Class in
common
Generates random values
Randomizer()
- Constructor for class common.
Randomizer
rate
- Variable in class domain.
Chromosome
Indicates the similarity rate between current chromosome and goal chromosome
removeAllExceptBest(Population)
- Method in class domain.
Population
Removes all chromosomes except the one with highest
Chromosome.rate
removeAllExceptRandom(Population)
- Method in class domain.
Population
Removes all chromosomes except the one randomly chosen
RouletteWheelSelectionOperation
- Class in
operations.selection
Concrete implementation of
SelectionOperation
The random chromosome stays in population.
RouletteWheelSelectionOperation()
- Constructor for class operations.selection.
RouletteWheelSelectionOperation
run(String)
- Static method in class
Main
Creates
GAStrategyManager
which is responsible for setting and executing the strategy
B
C
D
E
F
G
I
M
O
P
R
S
T
U
Skip navigation links
Overview
Package
Class
Tree
Index
Help
Prev Letter
Next Letter
Frames
No Frames
All Classes


Jin led a group of graduate student journalists in a research collaboration
with St. Mark Community Education Program in the Boston area.
This project was advised by Dr. Myojung Chung at Northeastern University.
The non-profit organization was founded in 1996 in Dorchester, Massachusetts.
This volunteer-run group provides free ESL courses as well as citizenship exam classes.
For over 20 years, volunteers at St. Mark's offered multiple classes throughout the week in
public locations. With the onset of COVID-19 physical distancing and safety guidelines in spring 2020, St. Mark
moved to virtual classes for the first time.
Most of their infrastructure is not online, so the group sought solutions to better their online course offerings
and general community outreach. Through surveys and focus group interviews, our group collected data through late March
before analyzing our qualitative and quantitative data and providing a comprehensive report.
The St. Mark ESOL website.
This ambitious research project was started when Jin was still in Northeastern University's graduate Game Science and Design program.
He worked with Sidan Fan (Lead Programmer, Lead Artist/Character Designer) and Sonya Mccree (Co-Narrative Designer, Assistant Artist/Level Designer)
under the supervision of Dr. Sercan Sengun.
The results of our research were published in the Springer Book
Game User Experience and Player-Centered Design" in early 2020.
The purpose of this research was to create a video game experiment that would study player behaviors in certain situations.
The main variables we tested in players were "conformity" and "empathy."
Initially, we believed there would be groups of players that fell into "compliance" and "non-compliance" with the game's directives.
We hypothesized that players, once learning more about the game's backgrounds and story, would begin to empathize with the "enemy" characters,
and thus lean toward non-compliance.
Our character designer purposely created family dynamics in enemy characters.
While there is a plethora of psychological research on conformity, there are fewer games that serve as examinations of such.
Some of the games we analyzed were "Loved" (2010), a flash-game by Alexander Ocias, as well as "The Stanley Parable" (2013).
Other supplementary research involved analyses including Richard S. Crutchfield's seminal work from 1954 on "conformity and character."
In the future, Jin would like to return to this line of research
and create a more streamlined research game.


Graphic Era (Deemed to be University)
|
Mailing Address
|
|
566/6, Bell Road, Clement Town
Dehradun, Uttarakhand
India -248002
|
Email<EMAIL_ADDRESS><EMAIL_ADDRESS>Telephone:+91-135-2643421, 2642727
Fax:91-135-2644025
|
Delhi Resource Center:
|
|
Ms. Nishtha Kapoor
B 6/11 (Lower Ground Floor)
Safdarjung Enclave, New Delhi - 110029
|
<EMAIL_ADDRESS>,
<EMAIL_ADDRESS>Telephone:<PHONE_NUMBER>0/21/22, +91-9718004776, +91-9205014006
|
Patna:
|
|
Mr. Raju Mishra
Dumraon Palace, Frazer Road, Patna, Bihar
|
Email<EMAIL_ADDRESS>Telephone: +91<PHONE_NUMBER>0, +91<PHONE_NUMBER>
|
Haldwani:
|
|
Mr. Govind Singh Jethi
Nandi Tower, Opp. Vishal Mega Mart
Nanital Road, Haldwani
|
Email<EMAIL_ADDRESS>Telephone: +91 89796 49164
|
Varanasi:
|
|
Mr. Hemant Gupta
B 27/4 Shop No. 24,
First Floor Dayal Tower Durga Kund
Varanasi 221005
|
Email<EMAIL_ADDRESS><EMAIL_ADDRESS>Telephone:<PHONE_NUMBER>/420
|
Bareilly:
|
|
Mr. Akhilesh Sharma
Hotel Uberoi Anand,
46, Civil Lines
Bareilly. 243001
|
<EMAIL_ADDRESS>Telephone: +91-9808414150
|
Moradabad:
|
|
Mr. Jitendra Chauhan
Hotel Raj Mahal,
Opposite Commissioners Office Near Court,
Civil Lines
Moradabad. 244001
|
Email<EMAIL_ADDRESS>Telephone:<PHONE_NUMBER>
|
Pithoragarh:
|
|
Ms Meenu
Near Sun View Hotel Bhatkot Road Siltham
Pithoragarh
|
<EMAIL_ADDRESS>Telephone: +91-9917093219, +91-9756477559
|
Tripura :
|
|
Mr Pranjal Kumar Dasgupta
Kishan nagar near Mehar Kali Bari, Opposite to prince video,
Agartala Tripura West
|
<EMAIL_ADDRESS>Telephone: +91-9089561665
|
Meerut:
|
|
Mr. Ashish Spencer
Savera Book Distributors,
A13, Sector 1, Ved Vyas Puri,
Meerut,Bypass Road, Meerut.
|
<EMAIL_ADDRESS>Telephone: 0121-2439339, +91-7060493970
|
Kota:
|
|
Mr. Satanjay Pundeer
Plot No-1, Rajeev Gandhi Nagar,
Near Allen Safalya
Kota, Rajasthan
|
<EMAIL_ADDRESS>Telephone: +91-7830837221, +91-9079696117
|
Hyderabad:
|
|
Mr. Vijay Koushik
Konfido Group, 3rd Floor,
Dana Chambers, Masab Tank
Hyderabad-004
|
<EMAIL_ADDRESS>Telephone: +91-9502644931
|
Lucknow :
|
|
Hotel charans plaza
11,Habibullah Estate,
Hazratganj
Lucknow-226601
|
<EMAIL_ADDRESS>Telephone: +91-7055633999
|


--- date: 2010-02-14T00:00:00Z published: true title: Web Hooks and the Programmable World of Tomorrow url: /2010/02/14/web-hooks-and-the-programmable-world-of-tomorrow/ ---
This is super old (in web years) but super good.


Toggle navigation
OFV
Home
About
Products
Cart
Login
Go!
×
Close
Login to OFV
Username
Password
Wrong username or password
Remember login
Login
I forgot my password
FREE REGISTRATION
See all your past orders
Fast product re-ordering
Save your favorite items
Easy checkout
Free Banana
(only new customers)
Yes please, register now!
Specials
Oranges
$4.99
Broccoli
$3.99
Bananas
$4.59
Fruits
Oranges
$4.99
Grapes
$4.99
Bananas
$4.59
Organic Vegetables
Broccoli
$3.99
Carrots
$4.99
Cauliflower
$3.99


What are the differences between male and female babies at birth? Is there a size difference? It is clear that adult males weigh more, on average than adult females, but what is unclear is whether this weight differnece is present from birth. In fact, as a friend to manyy babies, it seems that annecdotally, people seem to think that baby girls might weigh more than baby boys.
In order to analyze this problem, I've used the data set “Live births, by birth weight and sex, Canada, provinces and territories” available through the Government of Canada Open Data website. This dataset contains data on babies born between 2000 and 2014, classified by sex and weight range, as well as the province or territory of birth. In order to have clean analysis, I have cleaned the data to omit any unclassified babies (some homebirths are not catagorized by weight).Since the data is grouped in classes, instead of having exact weights, I've assigned each weight class a midpoint, in order to treat the data as quantitative data. This is a large dataset, with around 9000 classes representing about 5.38 million Canadian babies.
I was working from the assumption that female babies weigh more on average at birth than male babies, however, in order to rigorously test my hypothesis, I have tested the null hypothesis that the average weight of male babies is the same as the average weight of female babies.
Right away, it is clear that both the male and female distributions are approximately normal. However, it seems like the normal curve for the male baby weights is further to the right than the female weight curve. We can see this more clearly by looking at the summary statistics for the dataset:
## SEX mean variance standard_deviation count
## 1 Females 3316.408 325697.2 570.6989 2619639
## 2 Males 3431.969 361956.1 601.6279 2759839
All units are in grams. This sumamry shows us that the mean weight of male babies is slightly higher for male babies as for female babies. Right away, I will admit that my hypothesis, which was based on anecdotes, is probably not correct. It is more likely that male babies weigh more on average than female babies, and indeed, since our data set is so large, we will be able to show this, even though the difference in average weights is only 115.56 grams.
This problem is a textbook example of when we can do a t test of two samples with pooled variances. As we can see from the above table, the variances are quite close, and as the histogram shows us, both distributions are approximately normal. Using the base formulae, since we are working on grouped data, our test has a very large negative t test of:
## [1] -228.3171
Which unsurprisingly has a p-value of:
## [1] 0
This shows that there is overwhelming evidence that average weight of male babies is not equal to the average weight of female babies. (p<0.0001)
It is clear from the size and completeness of our dataset, and the largeness of the test statistic that female babies and male babies do not have the same average weight at birth. This is statistically significant, but is it actually significant? I believe that it is, A difference of over 100 grams is significant in very small babies, who may way only 2000 grms or less at birth. So even though it turns out that my hypothesis was incorrect, we have been able to find a difference in baby weights between the two sexes.


| < Day Day Up > |
|
[SYMBOL]
[A]
[B]
[C]
[D]
[E]
[F]
[G]
[H]
[I]
[J]
[L]
[M]
[N]
[O]
[P]
[Q]
[R]
[S]
[T]
[U]
[V]
[W]
[Z]
parentheses ( ) subexpressions grouping 2nd 3rd 4th 5th nesting 2nd 3rd 4th patterns. [See regular expressions] period (.) special character searches 2nd 3rd 4th 5th unknown character searches Perl usage examples (regular expressions) 2nd PHP usage examples (regular expressions) 2nd plus sign (+) one or more character searches 2nd position matching $ (dollar sign) string boundaries 2nd 3rd 4th 5th \bwordboundaries 2nd 3rd ^ (carrot) string boundaries 2nd 3rd 4th 5th positive lookarounds. [See lookarounds] POSIX character classes 2nd syntax of 2nd problem scenarios 2nd |
| < Day Day Up > |


The perpetual myth persists that Haskell cannot be used for “real world applications”. Normally real world is usually left undefined in such a discussion, but can often be taken to mean that Haskell is not suited for database and web development work.
Haskell has a rich library ecosystem and is well-suited for these tasks but I concede that there might be a systemic lack of introductory material for many domain specific tasks. Something that many projects and companies are trying to remedy.
Haskell does indeed have several great web frameworks along the lines of RoR, Django, Flask, Pyramid etc.
I will not discuss these though because I really couldn’t give a better introduction than their own documentation. Instead I will focus on simple motivating examples for smaller libraries which provide a rich feature base for web development tasks while leveraging the strengths of Haskell language itself, and many of which can integrate with the larger frameworks.
Clay is a library for programmatic generation of CSS. Is it an embedded DSL (EDSL) that exposes selectors and styles for the CSS3 grammmer. Clay is designed to layer logic on top of the CSS as to encode variables, color mixing, complex selector logic and nested rules more easily than with base CSS. Clay can also be usefull as a lower-level combinator library to describe complex CSS layouts.
$ cabal install clay
{-# LANGUAGE OverloadedStrings #-}
import Clay
import Data.Text
import Prelude hiding (div)
bodyStyle :: Css
bodyStyle = body ? do
background aquamarine
fontFamily ["Helvetica Neue"] [sansSerif]
codeStyle :: Css
codeStyle = code ?
do fontFamily ["Monaco", "Inconsolata"] [monospace]
fontSize (px 14)
lineHeight (ex 1.8)
emphasis :: Css
emphasis = do
fontWeight bold
color black
textTransform uppercase
container :: Selector
container = div # ".code"
containerStyle :: Css
containerStyle = container ?
do width (px 800)
borderColor gray
main :: IO ()
main = putCss $ do
bodyStyle
codeStyle
containerStyle
The above will generate the following stylesheet:
body
{
background : rgb(127,255,212);
font-family : "Helvetica Neue", sans-serif;
}
code
{
font-family : "Monaco","Inconsolata", monospace;
font-size : 14px;
line-height : 1.80000ex;
}
div.code
{
width : 800px;
border-color : rgb(128,128,128);
}
$ cabal install blaze-html
Blaze is the bread and butter of markup generation in Haskell. It is described as a “blazingly fast HTML combinator library” which programmtically generates HTML and several other markup languages from an embedded DSL.
In this module, the language extension OverloadedStrings
is used so that the type inferencer can infer common coercions between String-like types without having to do explicit calls to boilerplate functions (pack
, unpack
, html
) for each string-like literal. This will be pretty common use for all the examples from here out that use ByteString
or HTML.
{-# LANGUAGE OverloadedStrings #-}
import Data.Monoid
import Text.Blaze (ToMarkup(..))
import Text.Blaze.Html5 hiding (html, param)
import Text.Blaze.Html.Renderer.Text (renderHtml)
import qualified Text.Blaze.Html5 as H
gen :: Html -> [Html] -> Html
gen title elts = H.html $ do
H.head $
H.title title
H.body $
H.ul $ mapM_ H.li elts
main :: IO ()
main = do
print $ renderHtml $ gen "My Blog" ["foo", "bar", "fizz"]
This would output HTML like the following:

<title>My Blog</title>

foo

bar

fizz

In addition to generating HTML we can also derive from it’s internal ToMarkup classes to provide HTML representations for any datatype in Haskell. A silly example might be:
data Example = A | B deriving (Show)
data List a = Cons a | Nil deriving (Show)
instance ToMarkup Animal where
toMarkup = toHtml . show
instance (ToMarkup a) => ToMarkup (List a) where
toMarkup x = case x of
Cons a -> H.ul $ H.li $ toHtml a
Nil -> ""

A

It is worth noting that the Blaze builder overloads do-notation as some EDSLs do, but the Html
type is not a monad. It is functionally a monoid.
For non-embedded template languages along the lines of Jinja or erb refer to the Shakespearean templates or heist.
$ cabal install jmacro
JMacro is quasiquoter for Javascript code generation. The underlying implementation is rather clever and allows Haskell and Javascript to share functions and values across quotation boundaries. The end result is a fusion of Haskell and JavaScript that serves as a foundation to higher abstractions and as a very convienant way to implement code generation for compilers targetting Javascript.
As an example of we’ll use JMacro to implement a simple translator for the untyped typed lambda calculus, something one might do if writing a language that transpiles to Javascript.
{-# LANGUAGE QuasiQuotes, TypeSynonymInstances, FlexibleInstances, OverloadedStrings #-}
import Data.String
import Language.Javascript.JMacro
jref :: Sym -> JExpr
jref = ValExpr . JVar . StrI
jvar :: Sym -> JStat
jvar sym = DeclStat (StrI sym) Nothing
jprint x = [jmacroE|console.log(x)|]
instance IsString Expr where
fromString x = Var (Sym x)
data Val = Sym Sym
| Lit Lit
deriving (Show)
type Sym = String
data Lit = LStr String
| LInt Int
deriving (Show)
data Expr = App Expr Expr
| Lam Sym Expr
| Var Val
deriving (Show)
-- Convert Haskell expressions to Javascript expressions
instance ToJExpr Val where
toJExpr (Sym s) = toJExpr s
toJExpr (Lit l) = toJExpr l
instance ToJExpr Lit where
toJExpr = toJExpr
instance ToJExpr Sym where
toJExpr = jref
instance ToJExpr Expr where
toJExpr (Lam s ex) =
[jmacroE|
function(arg) {
`(jvar s)`;
`(jref s)` = `(arg)`;
return `(ex)`;
}
|]
toJExpr (App f x) =
[jmacroE| `(f)`(`(x)`) |]
toJExpr (Var v) =
toJExpr v
compile :: ToJExpr a => a -> String
compile = show . renderJs . toJExpr
s, k, i0, i1 :: Expr
s = Lam "f" $ Lam "g" $ Lam "x" $ (App "f" "x") `App` (App "g" "x")
k = Lam "x" $ Lam "y" "x"
i0 = Lam "x" "x"
i1 = App (App s k) k
main :: IO ()
main = do
putStrLn $ compile s
putStrLn $ compile k
putStrLn $ compile i0
putStrLn $ compile i1
$ cabal install fay
Fay is a growing ecosystem of packages that can compile Haskell to Javascript. Fay works with a strict subset of Haskell that preserves Haskell semantics such as currying and laziness. In addition to the core language, ther are interfaces for jquery and DOM manipulation so that Fay-compiled Haskell code can effectively access the browser internals.
$ cabal install fay-dom fay-jquery
The code generation is rather verbose given that it compiles quite a bit of the Haskell Prelude. The below example is very simple and only the interesting part of the outputted source is shown below. Notably the generated code is very readable.
-- demo.hs
import FFI
import Prelude
import JQuery
puts :: String -> Fay ()
puts = ffi "console.log(%1)"
example = take 25 [1..]
main :: Fay ()
main = ready $ do
el <- select "#mydiv"
setCss "background-color" "red" el
puts "Hello World!"
puts (show [1,2,3])
To compile invoke the compiler:
$ fay demo.hs --package fay-jquery
Some of the generated code:
var Prelude$enumFrom = function ($p1) {
return new Fay$$$(function () {
var i = $p1;
return Fay$$_(Fay$$_(
Fay$$cons)(i))(Fay$$_(
Prelude$enumFrom)(
Fay$$_(Fay$$_(
Fay$$add)(i))(1)
));
});
};
var Main$example = new Fay$$$(
function () {
return Fay$$_(Fay$$_(
Prelude$take)(25))(
Prelude$enumFrom(1));
});
To call this code from vanilla Javascript:
var main = new Main();
main._(main.Main$main);
Fay is part of a larger community of compilers that transpile functional languages to Javascript. Another library of note is Roy. Although not Haskell, it has a sophisticated type system and notably an implementation of typeclasses, a feature that Fay currently does not implement.
$ cabal install aeson
Aeson is the de-facto JSON parsing and generation library for Haskell. It’s usage couldn’t be simpler, we simply declare instance of toJSON
and fromJSON
for our types and Aeson takes care of the mappings and exception handling. By using DeriveGeneric
we can create instances with very little code.
{-# LANGUAGE OverloadedStrings, DeriveGeneric #-}
import Data.Aeson
import GHC.Generics
import Network.HTTP
import Control.Applicative
import Data.ByteString (ByteString)
data Message = Message {
text :: ByteString
, date :: ByteString
} deriving (Show, Generic)
instance FromJSON Message
instance ToJSON Message
fromStdin :: IO (Either String Message)
fromStdin = eitherDecode <$> readLn
$ cabal install postgres-simple
Postgres-simple is a library for communicating with Postgres databases and mapping data between Haskell and SQL types. Although not an ORM, postgres-simple
lets us generate and execute SQL queries and map result sets onto our algebraic datatypes very simply by deriving instances to declare schemas.
{-# LANGUAGE OverloadedStrings #-}
import Data.Text
import Control.Applicative
import Control.Monad
import Database.PostgreSQL.Simple
import Database.PostgreSQL.Simple.FromRow
import qualified Data.ByteString as B
import qualified Database.PostgreSQL.Simple as Pg
data Client = Client { firstName :: Text
, lastName :: Text
, clientLocation :: Location
}
data Location = Location { address :: Text
, location :: Text
}
instance Pg.FromRow Location where
fromRow = Location <$> field <*> field
instance Pg.FromRow Client where
fromRow = Client <$> field <*> field <*> liftM2 Location field field
queryClients :: Connection -> IO [Client]
queryClients c = query_ c "SELECT firstname, lastname, location FROM clients"
main :: IO [Client]
main = do
uri <- B.getLine
conn <- connectPostgreSQL uri
queryClients conn
$ cabal install acid-state
We can further exploit Haskell’s algebraic datatypes to give us a storage engine simply from the specification of our types and a little bit of TemplateHaskell
usage. For instance, a simple Map
container from Data.Map
can be transformed to a disk-backed disk backed key-value store which can be interacted with as if it were a normal Haksell data structure.
type Key = String
type Value = String
data Database = Database !(Map.Map Key Value)
Like it’s name implies acid-state
provides transactional guarantees for storage. Specifically that writes will be applied completely or not at all and that data will be consistent during reads.
{-# LANGUAGE OverloadedStrings, TypeFamilies, DeriveDataTypeable, TemplateHaskell #-}
import Data.Acid
import Data.Typeable
import Data.SafeCopy
import Control.Monad.Reader (ask)
import qualified Data.Map as Map
import qualified Control.Monad.State as S
type Key = String
type Value = String
data Database = Database !(Map.Map Key Value)
deriving (Show, Ord, Eq, Typeable)
$(deriveSafeCopy 0 'base ''Database)
insertKey :: Key -> Value -> Update Database ()
insertKey key value
= do Database m <- S.get
S.put (Database (Map.insert key value m))
lookupKey :: Key -> Query Database (Maybe Value)
lookupKey key
= do Database m <- ask
return (Map.lookup key m)
deleteKey :: Key -> Update Database ()
deleteKey key
= do Database m <- S.get
S.put (Database (Map.delete key m))
allKeys :: Int -> Query Database [(Key, Value)]
allKeys limit
= do Database m <- ask
return $ take limit (Map.toList m)
$(makeAcidic ''Database ['insertKey, 'lookupKey, 'allKeys, 'deleteKey])
fixtures :: Map.Map String String
fixtures = Map.empty
test :: Key -> Value -> IO ()
test key val = do
database <- openLocalStateFrom "db/" (Database fixtures)
result <- update database (InsertKey key val)
result <- query database (AllKeys 10)
print result
$ cabal install digestive-functors digestive-functors-blaze
Digestive functors solve the very mundane but mechanical task of validating forms. The library provides a way to specify views and validation logic and handle the control flow of validation between the end-user and the server. There are several backends to render the form and handle request/response cycles depending on your choice of framework For arbitrary reasons we’ll choose Happstack for this example.
$ cabal install digestive-functors-happstack
We’ll build a simple signup page with username and email validation logic.
{-# LANGUAGE OverloadedStrings #-}
import Data.Maybe
import Text.Printf
import Control.Applicative
import Data.Text (Text, find, splitOn)
import Text.Digestive
import Text.Digestive.Happstack
import Text.Digestive.Blaze.Html5
import qualified Text.Blaze.Html5 as H
import qualified Happstack.Server as HS
data User = User
{ userName :: Text
, userMail :: Text
} deriving (Show)
userForm :: Monad m => Form Text m User
userForm = User
<$> "name" .: check "Name must be two words" checkName (text Nothing)
<*> "email" .: check "Not a valid email address" checkEmail (text Nothing)
checkEmail :: Text -> Bool
checkEmail = isJust . find (== '@')
checkName :: Text -> Bool
checkName s = length (splitOn " " s) == 2
signupView :: View H.Html -> H.Html
signupView view = form view "/" $ do
label "name" view "Full Name:"
inputText "name" view
H.br
label "email" view "Email:"
inputText "email" view
H.br
childErrorList "" view
inputSubmit "Signup"
template :: H.Html -> H.Html
template body = H.docTypeHtml $ do
H.head $ H.title "Example form:"
H.body body
reply m = HS.ok $ HS.toResponse $ template m
page :: HS.ServerPart HS.Response
page = do
HS.decodeBody $ HS.defaultBodyPolicy "/tmp/" 0 40960 40960
r <- runForm "test" userForm
case r of
(view, Nothing) -> do
let view' = fmap H.toHtml view
reply $ form view' "/" (signupView view')
(_, Just response) ->
reply $ do
H.h1 "Form is valid."
H.p $ H.toHtml $ show response
config :: HS.Conf
config = HS.nullConf { HS.port = 5000 }
main :: IO ()
main = do
printf "Listening on port %d\n" (HS.port config)
HS.simpleHTTP config page
A great deal of effort has been put into making the Haskell runtime implement efficient event driven programming such that applications can take advantage of the Haskell threading support.
A simple single-threaded Hello World might be written like the following:
{-# LANGUAGE OverloadedStrings #-}
import Network
import Data.ByteString.Char8
import System.IO (hClose, hSetBuffering, Handle, BufferMode(LineBuffering))
msg = "HTTP/1.0 200 OK\r\nContent-Length: 12\r\n\r\nHello World!\r\n"
handleClient :: Handle -> IO ()
handleClient handle = do
hSetBuffering handle LineBuffering
hGetLine handle
hPutStrLn handle msg
hClose handle
listenLoop :: Socket -> IO ()
listenLoop asock = do
(handle, _, _) <- accept asock
handleClient handle
listenLoop asock
main :: IO ()
main = withSocketsDo $ do
sock <- listenOn $ PortNumber 5000
listenLoop sock
To make this concurrent we use the function forkIO
which utilizes the event-driven IO manager in GHC’s runtime system to spawn lightweight user threads which are distributed across multiple system threads. When compiled with -threaded
the Haskell standard library also will use non-blocking system calls which are scheduled by the IO manager ( with epoll()
under the hood ) and can transparently switch to threaded scheduling for other blocking operations.
{-# LANGUAGE OverloadedStrings #-}
import Network
import Control.Monad
import Control.Concurrent
import Data.ByteString.Char8
import GHC.Conc (numCapabilities)
import System.IO (hClose, hSetBuffering, Handle, BufferMode(LineBuffering))
numCores = numCapabilities - 1
msg = "HTTP/1.0 200 OK\r\nContent-Length: 12\r\n\r\nHello World!\r\n"
handleClient :: Handle -> IO ()
handleClient handle = do
hSetBuffering handle LineBuffering
hGetLine handle
hPutStrLn handle msg
hClose handle
listenLoop :: Socket -> IO ()
listenLoop asock = do
(handle, _, _) <- accept asock
forkIO (handleClient handle)
listenLoop asock
main :: IO ()
main = withSocketsDo $ do
sock <- listenOn $ PortNumber 5000
forM_ [0..numCores] $ \n ->
forkOn n (listenLoop sock)
threadDelay maxBound
This example is admittedly very simple but does illustrate that we can switch from serial to concurrent code in Haskell while still preserving sequential logic. Notably this server isn’t really doing anything terribly clever to get performance, it’s simply just spawning threads and all the heavy lifting is handled by the RTS. Yet with only a three line change the server can utilize all available cores.
Compiling with -O2
and running with +RTS -N4 -qm -qa
I get the following numbers on my Intel Core i5:
Requests per second: 12446.25 [#/sec] (mean)
There are other Haskell servers which do much more clever things such as the Warp server.
The Warp server can utilize the async event notification system to implement asynchronous applications using Control.Concurrent
primitives. The prime example is so called “realtime web programming” using websockets. In this example we’ll implement a chat room with a mutable MVar which synchronizes messages across all threads in the server and broadcasts messages to the clients.
$ cabal install wai-websockets
{-# LANGUAGE OverloadedStrings #-}
import Control.Monad
import Text.Printf
import Data.Text (Text)
import Control.Concurrent
import Control.Monad.IO.Class (liftIO)
import Data.Aeson
import qualified Data.Text as T
import qualified Data.Text.IO as T
import qualified Network.Wai
import qualified Network.WebSockets as WS
import qualified Network.Wai.Handler.Warp as Warp
import qualified Network.Wai.Handler.WebSockets as WaiWS
import Network.Wai.Application.Static (defaultFileServerSettings, staticApp)
type Msg = Text
type Room = [Client]
type Client = (Text, WS.Sink WS.Hybi00)
broadcast :: Msg -> Room -> IO ()
broadcast message clients = do
T.putStrLn message
forM_ clients $ \(_, sock) -> WS.sendSink sock $ WS.textData message
app :: MVar Room -> WS.Request -> WS.WebSockets WS.Hybi00 ()
app state req = do
WS.acceptRequest req
sock <- WS.getSink
msg <- WS.receiveData
userHandler msg sock
where
userHandler msg sock = do
let client = (msg, sock)
liftIO $ T.putStrLn msg
liftIO $ modifyMVar_ state $ \s -> do
let s' = client : s
WS.sendSink sock $ WS.textData $
encode $ map fst s
return s'
userLoop state client
userLoop :: WS.Protocol p => MVar Room -> Client -> WS.WebSockets p ()
userLoop state client = forever $ do
msg <- WS.receiveData
liftIO $ readMVar state >>= broadcast (T.concat [fst client, " : ", msg])
staticContent :: Network.Wai.Application
staticContent = staticApp $ defaultFileServerSettings "."
config :: Int -> MVar Room -> Warp.Settings
config port state = Warp.defaultSettings
{ Warp.settingsPort = port
, Warp.settingsIntercept = WaiWS.intercept (app state)
}
port :: Int
port = 5000
main :: IO ()
main = do
state <- newMVar []
printf "Starting server on port %d\n" port
Warp.runSettings (config 5000 state) staticContent
In the browser we can connet to our server using Javascript:
ws = new WebSocket('ws://localhost:5000')
ws.onmessage(function(msg){console.log(msg)});
ws.send('User271828')
ws.send('My message!')
$ cabal install distributed-process distributed-process-simplelocalnet
One of the most exciting projects in Haskell is a collections of projects developed under the Cloud Haskell metaproject. Cloud haskell brings language integrated messaging passing capability to Haskell under a very simple API which provides a foundation to build all sorts of distributed computations on top of simple actor primitives.
The core mechanism of action is a Process
monad which encapsulates a actor-like computation that can exchange messages across an abstract network backend. On top of this the distributed-process
library provides the language-integrated ability to send arbitrary Haskell functions back and forth between processes much like one can move code in Erlang, but while still persiving Haskell type-safety across the message layer. The signatures for the messaging functions are:
send :: Serializable a => ProcessId -> a -> Process ()
expect :: forall a. Serializable a => Process a
The network backend is an abstract protocol that specific libraries ( i.e. distributed-process-simplelocalnet
) can implement to provide the transport layer indepenent of the rest of the stack. Many other protocols like TCP, IPC, and ZeroMQ can be used for the network transport.
The simplest possible example is a simple ping and pong between between several Process
. Notably we don’t encode any mechanism for binary serialization of code or data since Haskell can derive these for us.
{-# LANGUAGE TemplateHaskell, DeriveDataTypeable, DeriveGeneric, GeneralizedNewtypeDeriving #-}
import Text.Printf
import Data.Binary
import Data.Typeable
import Control.Monad
import System.Environment (getArgs)
import Control.Concurrent (threadDelay)
import Control.Distributed.Process
import Control.Distributed.Process.Closure
import Control.Distributed.Process.Backend.SimpleLocalnet
import Control.Distributed.Process.Node (initRemoteTable,)
newtype Message = Ping ProcessId deriving (Eq, Ord, Binary, Typeable)
pingLoop :: Process ()
pingLoop = do
liftIO $ putStrLn "Connected with master node."
forever $ do
(Ping remote_pid) <- expect
say $ printf "Ping from %s" (show remote_pid)
local_pid <- getSelfPid
send remote_pid (Ping local_pid)
liftIO $ putStrLn "Pong!"
remotable [ 'pingLoop ]
master :: [NodeId] -> Process ()
master peers = do
pids <- forM peers $ \nid -> do
say $ printf "Executing remote function on %s" (show nid)
spawn nid $(mkStaticClosure 'pingLoop)
local_pid <- getSelfPid
forever $ do
forM_ pids $ \pid -> do
say $ printf "Pinging remote node %s" (show pid)
send pid (Ping local_pid)
forM_ pids $ \_ -> do
(Ping pid) <- expect
say $ printf "Received pong from %s" (show pid)
liftIO $ threadDelay 1000000
main :: IO ()
main = do
args <- getArgs
let host = "localhost"
let rtable = Main.__remoteTable initRemoteTable
case args of
["master", port] -> do
printf "Starting master on %s:%s\n" host port
ctx <- initializeBackend host port rtable
startMaster ctx master
["worker", port] -> do
printf "Starting client on %s:%s\n" host port
ctx <- initializeBackend host port rtable
startSlave ctx
otherwise -> error "Invalid arguments: master|worker <port>"
We can then spawn any number of instances from the shell:
$ runhaskell cloud.hs worker 5001
$ runhaskell cloud.hs worker 5002
$ runhaskell cloud.hs master 5003
Hopefully you feel for what exists in the ecosystem and feel slightly more empowered to use the amazing tools we have.


US Team:
PSO - App Svc Scoping
Title
Name
Load (Days Out)
{{engineer.title}}
{{engineer.name}}
{{engineer.forecast}}
APAC Team:
Consultants
EMEA Team:
PSO - App Svc EMEA Scoping
Consultants
Developers


6 WORD STORIES (As compiled by WIRED Magazine) Ernest Hemingway, Vernor Vinge
6 WORD STORIES a TELESCRIPTER PLUGIN for jQuery by EIDOLON LABS
FOR SALE: BABY SHOES, NEVER WORN. [* , darkred]Ernest Hemingway SHIPS FIRE; PRINCESS WEEPS, BETWEEN STARS. [* , white]Charles Stross STARLET SEX SCANDAL. GIANT SQUID INVOLVED. [◆ , red]Margaret Atwood EPITAPH: FOOLISH HUMANS, NEVER ESCAPED EARTH. [ ● , green]Vernor Vinge
Refresh!
Pause!
Random!


|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object mri.v3ds.Camera3ds
public class Camera3ds
Camera object in a 3D vector animation.
The Camera3ds class contains the following data that is read
from the 3D-editor part of the 3ds-file:
- Camera name
- Fixed camera position
- Fixed camera target position
- Fixed roll angle
- Fixed lens
- Distance to near- and far-plane
The following data is from the keyframer:
- Target node id in the object hierarchy
- Target parent node id in the object hierarchy
- Target node flags
- Position node id in the object hierarchy
- Position parent node id in the object hierarchy
- Position node flags
- Position spline track
- Target spline track
- FOV spline track
- Roll spline track
The "fixed" parameters that are loaded from the 3D-editor part
of the 3ds-file are not needed during an animation as the keyframer
data provides the same information, in the corresponding tracks.
| Method Summary | |
|---|---|
float |
farPlane()
Get distance to camera far-plane. |
float |
fixedLens()
Get fixed camera lens. |
Vertex3ds |
fixedPosition()
Get fixed camera position. |
float |
fixedRoll()
Get fixed camera roll angle in degrees. |
Vertex3ds |
fixedTarget()
Get fixed camera target. |
PTrack3ds |
fov()
Access FOV spline track. |
java.lang.String |
name()
Get camera name. |
float |
nearPlane()
Get distance to camera near-plane. |
XYZTrack3ds |
position()
Access position spline track. |
int |
positionNodeFlags()
Get position node flags. |
int |
positionNodeId()
Get position node id. |
int |
positionParentNodeId()
Get position parent node id. |
PTrack3ds |
roll()
Access roll spline track. |
XYZTrack3ds |
target()
Access target spline track. |
int |
targetNodeFlags()
Get target node flags. |
int |
targetNodeId()
Get target node id. |
int |
targetParentNodeId()
Get target parent node id. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public java.lang.String name()
public Vertex3ds fixedPosition()
public Vertex3ds fixedTarget()
public float fixedRoll()
public float fixedLens()
public float nearPlane()
public float farPlane()
public int targetNodeId()
public int targetParentNodeId()
public int targetNodeFlags()
public int positionNodeId()
public int positionParentNodeId()
public int positionNodeFlags()
public XYZTrack3ds position()
public XYZTrack3ds target()
public PTrack3ds fov()
public PTrack3ds roll()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |


RT @bundlerio: It’s the first public (pre)release of gemstash! A cache for http://rubygems.org or host your own private gems: https://t…
11/30/2015, 10:32:45 AM
Favs: 0
Retweets: 0
link--- layout: tweet ---
RT @bundlerio: It’s the first public (pre)release of gemstash! A cache for http://rubygems.org or host your own private gems: https://t…
11/30/2015, 10:32:45 AM
Favs: 0
Retweets: 0
link


|
SGCoreCs
v1.3.1
SenseGlove C# API
|
CVHandOutput converted into HandAngles + wrist location. Has all the information needed to determine when and how to convert this data into an actual HandPose. More...
Public Member Functions | |
| CV_HandDataPoint () | |
| Created empty arrays and data. More... | |
| CV_HandDataPoint (bool isRight, Vect3D wristPos, Quat wristRot, Vect3D[][] fingerAngles, float globalCert, float[] fingerCert, float time) | |
| Create a new instance of a HandDataPoint with a custom timestamp. More... | |
| CV_HandDataPoint (bool isRight, Vect3D wristPos, Quat wristRot, Vect3D[][] fingerAngles, float globalCert, float[] fingerCert) | |
| Create a new instance of a HandDataPoint using an autmatically generated timestamp. More... | |
| override string | ToString () |
| Prints the tracking data of this HandDataPoint More... | |
| bool | ToHandPose (BasicHandModel handDimensions, out HandPose handPose) |
| Convert the handAngles etc of this HandDataPoint into an acual HandPose More... | |
| bool | ToHandPose (BasicHandModel handDimensions, out HandPose handPose, out Vect3D wristPosition, out Quat wristRotation) |
| Convert the handAngles etc of this HandDataPoint into an acual HandPose More... | |
Static Public Member Functions | |
| static CV_HandDataPoint | InterpolateData (CV_HandDataPoint p0, CV_HandDataPoint p1, float t, bool clampOutput) |
| Interpolate beween two HandDataPoints to generate a new one More... | |
| static void | InterpolateData (float t, CV_HandDataPoint p0, CV_HandDataPoint p1, bool clampOutput, out Vect3D wristPos, out Quat wristRot, out Vect3D[][] handAngles) |
| Interpolate all Hand Data between two points. More... | |
Public Attributes | |
| float | timeStamp |
| The data point's timestamp, used for smoothing More... | |
| Vect3D[][] | handAngles |
| The HandAngles caluclated at ttimeStamp More... | |
| Vect3D | wristWorldPosition |
| The wrist position calculated at timeStamp More... | |
| Quat | wristWorldRotation |
| The wrist rotation calculated at timeStamp More... | |
| bool | rightHand |
| Whether or not this data point was generated for a left- or right hand More... | |
| float | globalCertainty |
| Certainties of the whole hand tracking. More... | |
| float[] | fingerCertainties |
| Certainites of individual fingers. More... | |
CVHandOutput converted into HandAngles + wrist location. Has all the information needed to determine when and how to convert this data into an actual HandPose.
Can generate a "smoothed" version of this via the HandDatSmoothing or just return the latets one.
| SGCore.CV.CV_HandDataPoint.CV_HandDataPoint | ( | ) |
Created empty arrays and data.
| SGCore.CV.CV_HandDataPoint.CV_HandDataPoint | ( | bool | isRight, |
| Vect3D | wristPos, | ||
| Quat | wristRot, | ||
| Vect3D | fingerAngles[][], | ||
| float | globalCert, | ||
| float[] | fingerCert, | ||
| float | time | ||
| ) |
Create a new instance of a HandDataPoint with a custom timestamp.
| isRight | |
| wristPos | |
| wristRot | |
| fingerAngles | |
| time | |
| globalCert | |
| fingerCert |
| SGCore.CV.CV_HandDataPoint.CV_HandDataPoint | ( | bool | isRight, |
| Vect3D | wristPos, | ||
| Quat | wristRot, | ||
| Vect3D | fingerAngles[][], | ||
| float | globalCert, | ||
| float[] | fingerCert | ||
| ) |
Create a new instance of a HandDataPoint using an autmatically generated timestamp.
| isRight | |
| wristPos | |
| wristRot | |
| fingerAngles | |
| globalCert | |
| fingerCert |
|
static |
Interpolate beween two HandDataPoints to generate a new one
| p0 | |
| p1 | |
| t | |
| clampOutput |
|
static |
Interpolate all Hand Data between two points.
| t | |
| p0 | |
| p1 | |
| clampOutput | |
| wristPos | |
| wristRot | |
| handAngles |
| bool SGCore.CV.CV_HandDataPoint.ToHandPose | ( | BasicHandModel | handDimensions, |
| out HandPose | handPose | ||
| ) |
Convert the handAngles etc of this HandDataPoint into an acual HandPose
| handDimensions | |
| handPose |
| bool SGCore.CV.CV_HandDataPoint.ToHandPose | ( | BasicHandModel | handDimensions, |
| out HandPose | handPose, | ||
| out Vect3D | wristPosition, | ||
| out Quat | wristRotation | ||
| ) |
Convert the handAngles etc of this HandDataPoint into an acual HandPose
| handDimensions | |
| handPose | |
| wristPosition | |
| wristRotation |
| override string SGCore.CV.CV_HandDataPoint.ToString | ( | ) |
Prints the tracking data of this HandDataPoint
| float [] SGCore.CV.CV_HandDataPoint.fingerCertainties |
Certainites of individual fingers.
| float SGCore.CV.CV_HandDataPoint.globalCertainty |
Certainties of the whole hand tracking.
| Vect3D [][] SGCore.CV.CV_HandDataPoint.handAngles |
The HandAngles caluclated at ttimeStamp
| bool SGCore.CV.CV_HandDataPoint.rightHand |
Whether or not this data point was generated for a left- or right hand
| float SGCore.CV.CV_HandDataPoint.timeStamp |
The data point's timestamp, used for smoothing
| Vect3D SGCore.CV.CV_HandDataPoint.wristWorldPosition |
The wrist position calculated at timeStamp
| Quat SGCore.CV.CV_HandDataPoint.wristWorldRotation |
The wrist rotation calculated at timeStamp


Reports the definitions with a @targetName
annotation that override definitions without @targetName
annotation.
See The @targetName annotation.
The quick-fix removes @targetName
annotation.
Example:
class A:
def foo: Int = 1
class B extends A:
@targetName("overriddenFoo")
override def foo: Int = 2
After the quick-fix is applied:
class A:
def foo: Int = 1
class B extends A:
override def foo: Int = 2


Menu
Menu
Intro
About me
Blog
Contact Me
Follow me
Resume
Blog
Home
/ Blog
All
Business & Finance
ComSci & Tech
Society et al
School & Life
Sports & Events
Optimal Distribution of Covid-19 Vaccines
Applied Machine Learning
Linear Regression
Applications & Tutorial
Navigating University Applications
Anecdotal and Tips
Law or Justice?
Law & Society


WITNESS LIST Judicial Affairs Committee July 17, 1998-10:00A Multicounty statutory probate court On: Brete Anderson (Rep. S. Thompson) Jerry Frank Jones (RealEstProbTrustLawSec) Judge Garvin Germany Jr (self) Judge Hector de Pena Jr (NuecesCo courts at law) Judge James Klager (self) Judge Jerri Lee Mills (self) Judge Marisela Saldana (self) Judge Robert Vargas (self) M.L. Stewart (Legislative Council) Uniform Municipal Court of Record On: Gloria Owens (City of Dallas muni cts) Judge Michael O'Neal (self)


Author: David L. Mills<EMAIL_ADDRESS>Last update:
09-Sep-2010 18:45
UTC
Address: 127.127.3.u
Reference ID: WWV
Driver ID: WWV_PST
Serial Port: /dev/wwvu; 9600 baud, 8-bits, no parity
Features: tty_clk
This driver supports the PSTI 1010 and Traconex 1020 WWV/WWVH Receivers. No specific claim of accuracy is made for these receiver, but actual experience suggests that 10 ms would be a conservative assumption.
The dipswitches should be set for 9600 bps line speed, 24-hour day-of-year format and UTC time zone. Automatic correction for DST should be disabled. It is very important that the year be set correctly in the DIP-switches; otherwise, the day of year will be incorrect after 28 April of a normal or leap year. As the there are only four dipswitches to set the year and the base value of zero correspondes to 1986, years beyond 2001 recycle with the value of zero corresponding to 2002. The propagation delay DIP-switches should be set according to the distance from the transmitter for both WWV and WWVH, as described in the instructions. While the delay can be set only to within 11 ms, the fudge time1 parameter can be used for vernier corrections.
Using the poll sequence QTQDQM, the response timecode is in three sections totalling 50 ASCII printing characters, as concatenated by the driver, in the following format:
ahh:mm:ss.fffs<cr> yy/dd/mm/ddd<cr> frdzycchhSSFTttttuuxx<cr> on-time = first <cr> hh:mm:ss.fff = hours, minutes, seconds, milliseconds a = AM/PM indicator (' ' for 24-hour mode) yy = year (from DIPswitches) dd/mm/ddd = day of month, month, day of year s = daylight-saving indicator (' ' for 24-hour mode) f = frequency enable (O = all frequencies enabled) r = baud rate (3 = 1200, 6 = 9600) d = features indicator (@ = month/day display enabled) z = time zone (0 = UTC) y = year (5 = 91) cc = WWV propagation delay (52 = 22 ms) hh = WWVH propagation delay (81 = 33 ms) SS = status (80 or 82 = operating correctly) F = current receive frequency (4 = 15 MHz) T = transmitter (C = WWV, H = WWVH) tttt = time since last update (0000 = minutes) uu = flush character (03 = ^c) xx = 94 (unknown)
The alarm condition is indicated by other than 8 at a, which occurs during initial synchronization and when received signal is lost for an extended period; unlock condition is indicated by other than 0000 in the tttt subfield.
When enabled by the flag4 fudge flag, every received timecode is written as-is to the clockstats file.


Methods of Class StreamSocket
- StreamSocket
- StreamSocket(
-
| virtual |
abstract |
const |
volatile |
template |
static |
inline |
C-linkage |
| NO |
NO |
NO |
NO |
NO |
NO |
YES |
NO |
- Summary
- Creates a socket.
- Parameters
| Type |
For some protocols it might be desirable to
use a different type than osl_Socket_TypeStream
(like osl_Socket_TypeSeqPacket ).
Therefore this parameter is not hidden.
|
- StreamSocket
- StreamSocket(
-
| virtual |
abstract |
const |
volatile |
template |
static |
inline |
C-linkage |
| NO |
NO |
NO |
NO |
NO |
NO |
YES |
NO |
- StreamSocket
- StreamSocket(
-
| virtual |
abstract |
const |
volatile |
template |
static |
inline |
C-linkage |
| NO |
NO |
NO |
NO |
NO |
NO |
YES |
NO |
- StreamSocket
- StreamSocket(
-
| virtual |
abstract |
const |
volatile |
template |
static |
inline |
C-linkage |
| NO |
NO |
NO |
NO |
NO |
NO |
YES |
NO |
- read
- sal_Int32 read(
-
| virtual |
abstract |
const |
volatile |
template |
static |
inline |
C-linkage |
| NO |
NO |
NO |
NO |
NO |
NO |
YES |
NO |
- Description
- Retrieves n bytes from the stream and copies them into pBuffer.
The method avoids incomplete reads due to packet boundaries and is thus
blocking.
- Parameters
| pBuffer |
receives the read data. pBuffer must be large enough
to hold n bytes.
|
| n |
the number of bytes to read.
|
- Return
- the number of read bytes. The number will only be smaller than
n if an exceptional condition (e.g. connection closed) occurs.
- write
- sal_Int32 write(
-
| virtual |
abstract |
const |
volatile |
template |
static |
inline |
C-linkage |
| NO |
NO |
NO |
NO |
NO |
NO |
YES |
NO |
- Summary
- Writes n bytes from pBuffer to the stream. The method avoids
incomplete writes due to packet boundaries and is thus blocking.
- Parameters
| pBuffer |
contains the data to be written.
|
| n |
the number of bytes to write.
|
- Return
- the number of written bytes. The number will only be smaller than
n if an exceptional condition (e.g. connection closed) occurs.
- recv
- sal_Int32 recv(
-
| virtual |
abstract |
const |
volatile |
template |
static |
inline |
C-linkage |
| NO |
NO |
NO |
NO |
NO |
NO |
YES |
NO |
- Summary
- Tries to receive BytesToRead data from the connected socket,
- Parameters
| pBuffer |
Points to a buffer that will be filled with the received
data. pBuffer must have at least have a size of BytesToRead.
|
| BytesToRead |
The number of bytes to read.
|
| Flag |
Modifier for the call. Valid values are:
osl_Socket_MsgNormal
osl_Socket_MsgOOB
osl_Socket_MsgPeek
osl_Socket_MsgDontRoute
osl_Socket_MsgMaxIOVLen
|
- Return
- the number of received bytes, which may be less than BytesToRead.
- send
- sal_Int32 send(
-
| virtual |
abstract |
const |
volatile |
template |
static |
inline |
C-linkage |
| NO |
NO |
NO |
NO |
NO |
NO |
NO |
NO |
- Summary
- Tries to send BytesToSend data to the connected socket.
- Parameters
| pBuffer |
Points to a buffer that contains the send-data.
|
| BytesToSend |
The number of bytes to send. pBuffer must have at least
this size.
|
| Flag |
Modifier for the call. Valid values are:
osl_Socket_MsgNormal
osl_Socket_MsgOOB
osl_Socket_MsgPeek
osl_Socket_MsgDontRoute
osl_Socket_MsgMaxIOVLen
|
- Return
- the number of transfered bytes. It may be less than BytesToSend.
Top of Page
Copyright © 2012, The Apache Software Foundation, Licensed under the Apache License, Version 2.0. Apache, the Apache feather logo, Apache OpenOffice and OpenOffice.org are trademarks of The Apache Software Foundation. Other names may be trademarks of their respective owners.


TwilioVerifyError
public enum TwilioVerifyError : LocalizedError
Error types returned by the TwilioVerify SDK. It encompasess different types of errors that have their own associated reasons and codes.
- NetworkError: An error occurred while calling the API.
- MapperError: An error occurred while mapping an entity.
- StorageError: An error occurred while storing/loading an entity.
- InputError: An error occurred while loading input.
- KeyStorageError: An error occurred while storing/loading keypairs.
- InitializationError: An error occurred while initializing a class.
- AuthenticationTokenError: An error occurred while generating a token.
-
An error occurred while calling the API.
Declaration
Swift
case networkError(error: NSError)
-
An error occurred while mapping an entity.
Declaration
Swift
case mapperError(error: NSError)
-
An error occurred while storing/loading an entity.
Declaration
Swift
case storageError(error: NSError)
-
An error occurred while loading input.
Declaration
Swift
case inputError(error: NSError)
-
An error occurred while storing/loading keypairs.
Declaration
Swift
case keyStorageError(error: NSError)
-
An error occurred while initializing a class.
Declaration
Swift
case initializationError(error: NSError)
-
An error occurred while generating a token.
Declaration
Swift
case authenticationTokenError(error: NSError)
-
Associated reason of the error
Declaration
Swift
public var originalError: NSError { get }
-
Brief description of the error, indicates at which layer the error ocurred
Declaration
Swift
public var errorDescription: String? { get }
-
Error code of the associated error
- NetworkError: 68001
- MapperError: 68002
- StorageError: 68003
- InputError: 68004
- KeyStorageError: 68005
- InitializationError: 68006
- AuthenticationTokenError: 68007
Declaration
Swift
public var code: Int { get }


Direct Tel.:+882-164-6655121 Direct Tel.:+871-762-535915 Direct Fax: +871-762-535916 Corporate Tel.:+27-839494291<EMAIL_ADDRESS>STRICTLY CONFIDENTIAL. I am pleased to get across to you for a profitable business proposal, though I don't know you and we had never meant in person but I got your contact from the Personal Assistance to the former Minister for Sports. More so she told me that this is your first time in partaking in such business but you are in a better position to handle the transaction/business of this magnitude without you running away with our own share of fund once your account is credited within 4 -5 working days because before I commence we have to build mutual relationship in respect of this business that is strictly confidential and all the legal /essential documents to back up this transaction are in place. And the key for us building up this mutual relationship is TRUST between both parties involved that is you and I. I am in charge of the Auditing for contract payment with SAFA (South African Football Association) and I truly apologize for using this means to reach you because I have no other choice.Within the South African Football Association and the cooperation of my colleague, I have in my possession as overdue payment bills totaling Eighteen Million Three Hundred Thousand U. S. Dollars (US$18,3M). With your assistance and fullest co-operation, I on behalf of my colleague beg you to help us receive these funds by wire transfer that is presently lying in a suspended account with ABSA Bank in Pretoria branch. It does matter whether it is a cooperate or personal account but as long as the account is active to receive the amount of this magnitude, it is very ok to us. More so, we are handicapped in the circumstances, as the South Africa Civil Service Code of Conduct does not permit us to operate offshore/foreign account of any kind hence you are very important to wards the successful completion of this whole transaction that we shall both benefits from. This US$18.3M arose from the balance of the total contract value for the renovation and upgrading of (Pretoria, Johannesburg and Soweto national stadium for 2006 bid that we lost to Germany before it was awarded to us again in 2010 with the help of our former president MR Nelson Mandela) our national stadium by foreign contracting firm, which we the officials over-invoiced deliberately. Though the actual contract cost have been fully paid to the original contractor. I have the authority of my partners involved to propose that should you be willing to assist us (which I prayed and beg for) in the transaction; your share of the sum will be 25% of the total amount after Tax in any account you shall provide for the funds to be transferred into, 70% for us and 5% for taxation and miscellaneous expenses. The business itself is 100% safe, on your part provided you treat it with utmost secrecy and confidentiality. Also your area of specialization is not a hindrance to the successful execution of this transaction. I have reposed my confidence in you and hope that you will not disappoint me because our share of the funds with your assistance we shall invest in property management/real estate business in your country. And that is why we offered you 25% of the total amount not just to receive the funds for us alone because once the fund is transferred to your account without your help we shall be lost since most of my life I have been a civil servant. Endeavor to contact me immediately through my above Tel and Fax number or my e-mail address<EMAIL_ADDRESS>if you are willing to help in this matter and I also want to guarantee you that my partner and myself are in a better position to make the payment of this claim possible provided you can give us a very strong assurance and guarantee that our share will be secured and please remember to treat this matter as very confidential matter, because we will not comprehend with any form of exposure as we are still in active Government Service and remember once again that time is of the essence in this business. I wait in anticipation of your earliest response. Yours Truly, ENGR. ERICK


|
JB.Toolkit
A collection of useful classes, extensions and tools written in C# to aid in a wide variety of development. With components for ASP Net MVC, Winform and Console applications. Integrations for Google, AD and SQL and pre-written implementations / helpers for a variety of tasks... Just Because.
|
Public Attributes | |
| string | error |
| Public Attributes inherited from JBToolkit.Views.DataTableResultSet | |
| List< object > | data = new List<object>() |
| Array of records. Each element of the array is itself an array of columns More... | |
| object | customData |
| int | draw |
| value of draw parameter sent by client More... | |
| int | recordsFiltered |
| filtered record count More... | |
| int | recordsTotal |
| total record count in resultset More... | |
Additional Inherited Members | |
| Public Member Functions inherited from JBToolkit.Views.DataTableResultSet | |
| string | ToJSON () |
| string JBToolkit.Views.DataTableResultError.error |


Kira's Pizza Parlour
"The place to refuel your drive"
Place your order
Select pizza size
Large - Ksh 1000
Medium - Ksh 800
Small - Ksh 400
Select crust type
Thin - Ksh 200
Thick - Ksh 200
Stuffed - Ksh 200
Deep - Ksh 200
Cheese-filled - Ksh 200
Select topping
Beef - Ksh 200
chicken cubes- Ksh 200
Pepperoni - Ksh 200
Cheese - Ksh 200
Pineapples- Ksh 200
Pork - Ksh 200
Choose mode:
Deliver ordered package - Ksh 100
Pick-up ordered package
Add to cart
Check-out
Clear Cart
Delivery


| [ Team LiB ] |
11.2 DBM ModulesA DBM-like file is a file that contains a set of pairs of strings (key,data), with support for fetching or storing the data given a key, known as keyed access. DBM-like files were originally supported on early Unix systems, with functionality roughly equivalent to that of access methods popular on other mainframe and minicomputers of the time, such as ISAM, the Indexed-Sequential Access Method. Today, several different libraries, available for many platforms, let programs written in many different languages create, update, and read DBM-like files. Keyed access, while not as powerful as the data access functionality of relational databases, may often suffice for a program's needs. And if DBM-like files are sufficient, you may end up with a program that is smaller, faster, and more portable than one that uses an RDBMS. The classic dbm library, whose first version introduced DBM-like files many years ago, has limited functionality, but tends to be available on most Unix platforms. The GNU version, gdbm, is richer and also widespread. The BSD version, dbhash, offers superior functionality. Python supplies modules that interface with each of these libraries if the relevant underlying library is installed on your system. Python also offers a minimal DBM module, dumbdbm (usable anywhere, as it does not rely on other installed libraries), and generic DBM modules, which are able to automatically identify, select, and wrap the appropriate DBM library to deal with an existing or new DBM file. Depending on your platform, your Python distribution, and what dbm-like libraries you have installed on your computer, the default Python build may install some subset of these modules. In general, at a minimum, you can rely on having module dbm on Unix-like platforms, module dbhash on Windows, and dumbdbm on any platform. 11.2.1 The anydbm ModuleThe anydbm module is a generic interface to any other DBM module. anydbm supplies a single factory function.
Opens or creates the DBM file named by filename (a string that can denote any path to a file, not just a name), and returns a suitable mapping object corresponding to the DBM file. When the DBM file already exists, open uses module whichdb to determine which DBM library can handle the file. When open creates a new DBM file, open chooses the first available DBM module in order of preference: dbhash, gdbm, dbm, and dumbdbm. flag is a one-character string that tells open how to open the file and whether to create it, as shown in Table 11-1. mode is an integer that open uses as the file's permission bits if open creates the file, as covered in Section 10.2.2 in Chapter 10. Not all DBM modules use flags and mode, but for portability's sake you should always supply appropriate values for these arguments when you call anydbm.open.
anydbm.open returns a mapping object m that supplies a subset of the functionality of dictionaries (covered in Chapter 4). m only accepts strings as keys and values, and the only mapping methods m supplies are m.has_key and m.keys. However, you can bind, rebind, access, and unbind items in m with the same indexing syntax m[key] that you would use if m were a dictionary. If flag is 'r', open returns a mapping m that is read-only so that you can only access m's items, not bind, rebind, or unbind them. One extra method that m supplies is m.close, with the same semantics as the close method of a built-in file object. You should ensure m.close( ) is called when you're done using m. The try/finally statement (covered in Chapter 6) is the best way to ensure finalization. 11.2.2 The dumbdbm ModuleThe dumbdbm module supplies minimal DBM functionality and mediocre performance. dumbdbm's only advantage is that you can use it anywhere, since dumbdbm does not rely on any library. You don't normally import dumbdbm; rather, import anydbm, and let anydbm supply your program with the best DBM module available, defaulting to dumbdbm if nothing better is available on the current Python installation. The only case in which you import dumbdbm directly is the rare one in which you need to create a DBM-like file that you can later read from any Python installation. Module dumbdbm supplies an open function and an exception class error that are polymorphic to those anydbm supplies. 11.2.3 The dbm, gdbm, and dbhash ModulesThe dbm module exists only on Unix platforms, where it can wrap any of the dbm, ndbm, and gdbm libraries, since each supplies a dbm-compatibility interface. You never import dbm directly; rather, you import anydbm, and let anydbm supply your program with the best DBM module available, defaulting to dbm if appropriate. Module dbm supplies an open function and an exception class error that are polymorphic to those anydbm supplies. The gdbm module wraps the GNU DBM library, gdbm. The gdbm.open function accepts other values for the flag argument, and returns a mapping object m supplying a few extra methods. You may need to import gdbm directly, if you need to access non-portable functionality. I do not cover gdbm specifics in this book, since the book is focused on cross-platform Python. The dbhash module wraps the BSD DBM library in a DBM-compatible way. The dbhash.open function accepts other values for the flag argument, and returns a mapping object m supplying a few extra methods. You may choose to import dbhash directly, if you need to access non-portable functionality. For full access to the BSD DB functionality, however, you can also import bsddb, covered in Section 11.3 later in this chapter. 11.2.4 The whichdb ModuleThe whichdb module attempts to guess which of the several DBM modules are available. whichdb supplies a single function.
Opens the file specified by filename and determines which DBM-like package created the file. whichdb returns None if the file does not exist or cannot be opened and read. whichdb returns '' if the file exists and can be opened and read, but it cannot be determined which DBM-like package created the file (i.e., the file is not a DBM file). whichdb returns a string naming a module, such as 'dbm', 'dumbdbm', or 'dbhash', if it can determine which module can read the DBM-like file named by filename. 11.2.5 Examples of DBM-Like File UseKeyed access is quite suitable when your program needs to record, in a persistent way, the equivalent of a Python dictionary, with strings as both keys and values. For example, suppose you need to analyze several text files, whose names are given as your program's arguments, and record where each word appears in those files. In this case, the keys are words, and, therefore, intrinsically strings. The data you need to record for each word is a list of (filename, line-number) pairs. However, you can encode the data as a string in several ways, for example by exploiting the fact that the path separator string os.pathsep (covered in Chapter 10) does not normally appear in filenames. (Note that more solid, general, and reliable approaches to the general issue of encoding data as strings are covered in Section 11.1 earlier in this chapter.) With this simplification, the program that records word positions in files might be as follows: import fileinput, os, anydbm wordPos = { } sep = os.pathsep for line in fileinput.input( ): pos = '%s%s%s'%(fileinput.filename( ), sep, fileinput.filelineno( )) for word in line.split( ): wordPos.setdefault(word,[ ]).append(pos) dbmOut = anydbm.open('indexfile','n') sep2 = sep * 2 for word in wordPos: dbmOut[word] = sep2.join(wordPos[word]) dbmOut.close( ) We can read back the data stored to the DBM-like file indexfile in several ways. The following example accepts words as command-line arguments and prints the lines where the requested words appear: import sys, os, anydbm, linecache dbmIn = anydbm.open('indexfile') sep = os.pathsep sep2 = sep * 2 for word in sys.argv[1:]: if not dbmIn.has_key(word): sys.stderr.write('Word %r not found in index file\n' % word) continue places = dbmIn[word].split(sep2) for place in places: fname, lineno = place.split(sep) print "Word %r occurs in line %s of file %s:" % (word,lineno,fname) print linecache.getline(fname, int(lineno)), |
| [ Team LiB ] |