awk driven IoT
Making toy prototypes with traditional unix tools
July 05, 2017
With a Raspberry Pi or other modern single-board computers, you can make very simple toys. I started with the hello world of interactive apps: the soundboard. But even then, I was too ambitious.
The soundpad
Since the main target was kids. I wanted a simple, screen-less toy that would teach the basics of interactivity, as well as serve as a platform for learning. A simple soundboard can be quite useful to learn animal calls for instance, so I was set.
But I also wanted this toy to be wireless and interact with the house. For the first part, I decided to hook an old bluetooth game controller I had lying around. I was able to detect its keys with evtest
pretty quickly and make an inventory of all buttons keycodes:
304
305
306
307
308
312
313
314
315
316
317
318
For the sounds, I reused the sounds present in the default raspbian scratch installation. There are a few wave files in /usr/share/scratch/Media/Sounds/
that proved useful. I made a few directories with symbolic links to the samples I was interested in. Combining vidir
and the previous keycode list, I ensured each wave file name started with a keycode, like this for the Animal sounds:
304-Bird.wav -> /usr/share/scratch/Media/Sounds/Animal/Bird.wav
305-Cricket.wav -> /usr/share/scratch/Media/Sounds/Animal/Cricket.wav
306-Crickets.wav -> /usr/share/scratch/Media/Sounds/Animal/Crickets.wav
307-Dog1.wav -> /usr/share/scratch/Media/Sounds/Animal/Dog1.wav
308-Dog2.wav -> /usr/share/scratch/Media/Sounds/Animal/Dog2.wav
312-Duck.wav -> /usr/share/scratch/Media/Sounds/Animal/Duck.wav
313-Goose.wav -> /usr/share/scratch/Media/Sounds/Animal/Goose.wav
314-Horse.wav -> /usr/share/scratch/Media/Sounds/Animal/Horse.wav
315-HorseGallop.wav -> /usr/share/scratch/Media/Sounds/Animal/HorseGallop.wav
316-Kitten.wav -> /usr/share/scratch/Media/Sounds/Animal/Kitten.wav
317-Meow.wav -> /usr/share/scratch/Media/Sounds/Animal/Meow.wav
318-Owl.wav -> /usr/share/scratch/Media/Sounds/Animal/Owl.wav
In order to interact with the house, I paired a bluetooth soundbar to the raspberry pi.
Once all of this is setup, this is the entirety of the code for the first iteration of the working soundpad (soundboard + joypad):
#!/usr/bin/env bash
cd $1
stdbuf -o0 evtest /dev/input/event0| awk -W interactive '
/EV_KEY/ { if ( $NF == 1) { system("paplay " $8 "-*.wav&") }}'
stdbuf
is very useful when playing with pipes where the input command is blocking, but you still want interactivity. It allows you to control i/o buffering.evtest
parses input events.awk -W interactive
has the same role asstdbuf -i0
, but formawk
's internal buffering (it's not needed for GNU awk).- when a matching line is found,
paplay
is used to play the audio through pulseaudio's bluez sink, that was previously configured as default. The filename corresponds to the button keycode.
The last iteration has the same core code, but with a bit more setup: using bluetoothctl
and pactl
to make sure the controller and the soundbars are properly connected and configured mainly.
It worked, for the most part, but was far from plug-and-play. The soundbar needed to be turned on and put in bluetooth mode. The wireless joypad had to be turned on. It needed constant re-setup of the bluetooth connections, because it lost the pairings regularly. And sometimes the audio would stutter horribly. I tried compiling a more recent version of bluez, to no avail.
So after a few day of demos and sample playing, I binned this project about 9 months ago.
The music portal
Fast forward today, I had this thing bothering me about modern music and rhymes for kids. With Deezer & Spotify, we have access to a library we could only dream of. But it's impossible for 2 year old child to operate, or even desirable.
Even without online services, the only alternative would be to go back to the audio CDs. But the only functional CD player in our house is the CD-ROM drive in my Desktop computer; I therefore backup all our audio CDs in audio files. Playing those has the same level of complexity (and screen-interaction) as interoperating with streaming services, so it's back to square one.
That's where the music portal comes in.
The Mir:ror is a very simple RFID reader. It's basically plug-and-play on Linux, since it sends raw HID events, with the full ID of the tags it reads, and it has audio and visual feedback. I also evaluated using a Skylanders portal, which also sent raw HID events, but its data was much less detailed, with only two bytes of information in the HID events, and the need to do more work to get the full data, and has no audio or visual feedback.
So here is the code of the first version:
#!/usr/bin/env bash
sudo stdbuf -o0 hexdump -C /dev/hidraw0 | awk -W interactive '
/02 01 00 00 08 d0 02 1a 03 52 c1 1a 01 00 00 00/ { print "file1 "; play=1; file="file1.mp3" ; }
/02 01 00 00 08 d0 02 1a 03 52 c1 4b ad 00 00 00/ { print "file2 "; play=1; file="file2.mp3" ; }
/02 01 00 00 04 3f d7 5f 35 00 00 00 00 00 00 00/ { print "dir1 "; play=1; file="dir1/*.mp3" ; }
/ 02 02 00 00 0. |01 05 00 00 00 00 00 00 00 00 00 00 00 00 00 00/ { print "stop"; system("killall -q mpg321"); }
{
if (play) {
system("mpg321 -q " file " & ");
}
play=0 ;
}
'
- we use the same
stdbuf
andawk -W interactive
trick as before. Fun fact: I rediscovered thismawk
argument by reading the man page while doing this project because I had forgotten about it in only 9 months. I don't think I'll forget it again. - Here we're matching full HID event lines. We don't even bother decoding the payload size, etc. Since it all fits on a line matchable by
awk
. - I used
mpg321
because it has the less footprint when compared tompg123
,gst-launch
,mplayer
,vlc
, and others. - I used the same symbolic link structure because it's much easier than putting the full file names in the script.
- We handle "tag" removal as well as portal shutdown. The Mir:ror automatically shuts down when turned face down.
- There are race conditions hiding here. It's not a big deal, it's just a prototype.
What could I use after I setup the two included Nanoztags ? I could put RFID stickers on objects; or I could use my visa card; or anything that has an RFID/NFC feature (like my phone). But there are better, available off-the-shelf choices: toys-to-life like Skylanders ! There are already made for kids, are very sturdy, and I managed to snag a few on clearance at ~1€ a piece !
Make sure the Raspberry Pi is connected to your wireless network, so you can add new songs remotely, and throw in a systemd.service for automatic starting, and the toy is finished:
[Unit]
Description=Music Portal
[Service]
Type=simple
ExecStart=/home/pi/musicportal.sh
User=pi
Group=pi
WorkingDirectory=/home/pi
StandardOutput=journal+console
StandardError=journal+console
Restart=always
RestartSec=3
[Install]
WantedBy=multi-user.target
And it's truly plug-and-play: you just need to plug the Raspberry Pi, and it powers the speaker through USB, as well as the Mir:ror.
Here's a video of the final result:
Last but not least, the title of this article is awk driven IoT. So I integrated librespot, and I can now play songs and rhymes from this online streaming service ! Success ✔


Click here to move
Choose an avatar
Enter your name:
Please enter a valid name and try again
Choose your avatar (1,2 or 3)
Hall of fame
| Rank | Nickname | Avatar | Country | Level | Score |
|---|
Rules
You have to save de koala from the fire.
Use the arrows to move the fire man.
You must go to the koala without touching the bushes in fire ! Once you got the koala you have to bring him back to the safety zone.
You can extinguish the bushes with the space bar.
You can extinguish the bushes with this button.


Warning! Exporting to image works only if you view this file from web server. Exporting works with all modern browsers except IE9 (works fine with IE10)


Price:
{{_settings.currency_format}} {{total_price.toFixed(2)}}
Taxes and delivery charges extra
You have an open order #{{open_order.id}} created on {{open_order.created_date}}.
Do you wish to add these items to that order?
If you want these to be shipped to the same address, adding to old order might help reduce shipping charges


{% include parts/input-image.html %} {% include parts/input-color.html %} {% include parts/input-colorpicker.html %}


--- layout: post title: The clock of flowing time, Berlin date: '2014-05-18T20:46:13+02:00' tags: - clock - travel - berlin tumblr_url: http://deepredsky.tumblr.com/post/86111233604/the-clock-of-flowing-time-berlin ---
The amazing clock which works by the pressure and flowing of liquids in different spheres. Hats off to Frenchman Bernard Gitton for designing it.


Motivated, enthusiastic, dedicated and professional – what more could an employer ask for? But Graduate recruitment marketing is a challenging and competitive venture. That’s why clever communication strategies that get noticed by the target audience are vital; always representing an employer brand while appealing to the 'Grad' mindset. Wave creates striking end to end graduate recruitment campaigns that inspire engagement with your brand. Over the years Wave have developed a reputation for delivering graduate attraction schemes that are award winning and results driven.
We need to know why Grads should be attracted to you, what makes you better compared to your competitors.
What's hot, what's not, best for us to know the full picture in order to build a campaign for you to attract the audience you need to.
Ultimately you want to hire the best talent you can, but there will be several objectives to meet before that.
From attracting footfall, increased traffic to your career site, applications, enquiries, engagement, even improvements to your Graduate recruitment league ranking.
We'll map out what's needed, the key milestone that we need to reach.
We're full service, meaning we get involved in everything from building recruitment websites, University open days, brochure development and film production.
Some campaigns are comprehensive, others simple and straight-forward. All comes down to what you're trying to achieve.
We'll report back on sessions, bounce rates, applications, engagement and reach.
All put together in a summary that will highlight what worked and what needs improving for next time.


Dennielle B. Paddison
<EMAIL_ADDRESS>To take a position as a Network and Security Engineer.
Junior Developer, Software Company (2010 - Present)
Languages: C#, JavaScript, Python, Ruby
Frameworks: .NET, Node.js, Django, Ruby on Rails
BS, Info Technology, University of Cordilleras
163 Sitio Magamang,San Jose,Caba,La union | Cel No:<PHONE_NUMBER>4


Blasphemous Ted Cargpan's dog (above) has been awarded top prize in the “Ayn Rand Household Pet Of The Week” contest run by The Weekly Shackle. The hound, variously known as Hopscotch, Spinach, Chevenix De Groot, and L'Oreal (because he's worth it) was the clear winner in a field which included a bee, a horse, three corncrakes, a flea-ridden bison, Tim the pipistrelle bat, a weasel, a curlew, a pair of otters, and—the bookies' favourite—a squirrel called Miriam. Unfortunately, Miriam succumbed to an attack of the bindings and had to be withdrawn from competition. Better luck next week!


Component to input a single month
formControl.disable()
)
Import InputMonthModule
into a module where you
want to use our component
Declare a form (FormGroup
) or a control
(FormControl
) in your component:
Insert a TuiInoutMonthComponent
in the
template:


Basic Technical and General Knowledge Questions will be asked in different rounds
Round 1: Elimination Round
Written Test (Technical + General Knowledge) will be held
Time Duration: 45 Minutes (for Event)
Round 2: On Screen Question Answer Round
Time Duration: Around 30 minutes
Round 3: Rapid fire Round
In one minute ten or more questions would be asked to individual team. According to correct Answers, Points would be given.
Time Duration: 1 minute/Team
Rules:
1. Team members are not supposed to use mobile and/or calculators.
3 members only
7th March 2017
R-1: 2:30 to 3:15 PM
R-2: 3:30 to 4:00 PM
R-3: 4:15 to 4:45 PM
SEMINAR HALL.
Rs. 50
Parth Varmora
Suvagiya Kishan
Shah Romanch
Rishi Sheth


Wanna a Brain?: Midterm
Brief
Let’s make something for Halloween. We didn’t wanna thought about technology, instead, we decided to think about a Halloween product to share with our audience regardless the tech involved. Personally speaking, I can say this is the first project I’ve made just for fun, thinking what are the feelings we want to produce in people. Now, I feel that’s the right and only way to do it. Just ask to ourselves: What do we want to communicate?.
What to produce?
We wanted to produce Halloween feelings of course!. Thinking about the format, target and place we decided to hide every tech clue about our device, in order to create a freak, repulsive experience where the people would share, laugh and wonder.
For some reason the first thing which came to our minds was food. Mostly interaction in Halloween it’s about get and give some food, sweets, chocolates, etc. Let’s give interactive food. How weird can that sound?. That’s being said, it was sort of easy to picture what we wanted.
References
Head in jars from futurama was the main reference. These floating heads in jars of different personalities. What about the opportunity of taste that water, those faces or eat those brains. The brain shape gave us a character with no identity who can be anyone, different voices and faces.
Concept
Once the basis were thought, we started deliberating about several parts of our system. We thought about the timeline experience which is: people are gonna approach to this repulsive food being invited to eat it. They would try to eat it and then they would be aware of its “active” state. Let’s think about this device as a system which has inputs, procceses, outputs and maintenance.
Inputs:
1. touch
Processes:
1. Give the brain a voice and a face - Identity
2. Come to live
Outputs:
1. Speak
2. Move
3. Light up
4. Show a face
Maintenance:
1. We made a cardboard box with access in the bottom face (just in case we need quick access).
2. We realized people might not be interested in eat it because of sanitary issues.
We came with extra materials as foil and plastic wrap.
3. The food would be the last part to assemble to ensure cleanliness.
Technical solution
We decided to use this schematic.
1. Capacitive sensor: based on CapSense library for Arduino to trigger action.
2. Button: to trigger actions in case of emergency.
3. 8 Ohms Speaker as sound output
4. Record and playback module ISD1820 to record a message in loop "EAT THE BRAIN"
5. Servo motor to shake the brain
6. 8 lEDS connected to a Shift register.
7. p5.js sketch to trigger images and audios
8. JELLO as a main material.
It is conductive (metal spoons) to use as a bridge between the circuit and us as a capacitors.
Process:
We made jello several times because we didnt reach enough density to mantain a firm shape.
Experience:
The best is her face!.
Technical issues
-
8 Ohms speaker’s power is nothing (too low). As a recomendation, It’s useful to have a built-in amplifier module to make louder.
-
When you touch the jello, you make it shake indeed, so the shake feedback produced by the servo is almost invisible.
-
LEDs have focused light. In order to make it more uniform distribuited you should use a diffuser.
-
Movement of the capatitor, in this case the jello could activate the capacitive sensor, triggering the experience. Your should be sure you have callibrated a right threshold.


Over Rs 10 trn worth of loans disbursed under Mudra Yojana till Nov 1: Govt
The PMMY is a scheme launched by the prime minister on April 8, 2015, for providing loans up to Rs 10 lakh to non-corporate, non-farm small/micro enterprises.
by Press Trust of IndiaThe government on Monday said more than Rs 10 trillion have been disbursed under the Pradhan Mantri Mudra Yojana till November 1, 2019.
The PMMY is a scheme launched by the prime minister on April 8, 2015, for providing loans up to Rs 10 lakh to non-corporate, non-farm small/micro enterprises.
"Under the Pradhan Mantri Mudra Yojana (PMMY), 20.84 crore loan accounts totalling an amount of Rs 10.24 trillion have been sanctioned up to November 1, 2019," Minister of State (IC) for Labour and Employment Santosh Kumar Gangwar said in a written reply to the Lok Sabha.


Developer and Graphic Designer with a focus on UI/UX Design. I love to merge design and code together to create innovative programs. From InDesign and Photoshop to Rails and JavaScript, I provide well-rounded front-end and back-end solutions.
• Provide creative guidance and direction for Production and Sales Department
• Oversee creative for ads and in-house promotional projects
• Design for print and online advertising
• Calculate advertisements to content ratio and color plates and budgeting weekly costs of paper layout
• Layout design for newspaper & classifieds section
• Prepress files for print and online E-edition for mobile devices
• Update main website with Drupal and WordPress
• Analyze AWStats for impressions and unique users Unique users increased from 8,000 to 10,000 2016-17
• Update social media with content to engage readership
• Lead team meetings to generate ideas for revenue, readership and online presence
Personal design services for clients involving:
• Advertising
• Stationary and mailers
• Apparel design
• Front-end website prototypes & mock-ups
• Original vector art
• Consultation for current design trends and software training
GPA: 3.82 | Magna Cum Laude
Apart from being a developer and designer, I enjoy traveling to New England's many beaches and sketch journaling. I'm also active in the gaming and cosplay communities and participating in many conventions.
On occasion I show my watercolor illustrations at local galleries. Here is a complete listing of my shows


| Rank | User | Total Points |
|---|---|---|
| {{user_activity.rank+1}} | {{user_activity.user_name}} | {{user_activity.total_points}} |
The following activity types are currently automatically tracked. New activity types will be added as needed. In addition, ad-hoc user activity may be awarded for community contributions that cannot be automatically tracked.
| Activity Name | Description | Point Value |
|---|---|---|
| {{activity.name}} | {{activity.description}} | {{activity.factor}} |


Vamsee Sunkar
Project Organizer
3rd Year - Industrial Engineering
Lance Millis
Event Advisor
Director - Academic Services
Randy Seitsinger
Event Adivisor
Professor
Christopher W. Blake
Event Organizer
Mechatronics and Inner Source Engineer
Jason Angolano
Coordinator
Laboratory Manager
Dustin Sharber
Team Mentor
Machine Learning and Data Science
Baker Hughes
Jeremy Waller
Team Mentor
Senior Software Engineer
Phase 2
Isaac Hildebrandt
Team Mentor
Senior Systems Architect
Phase 2
Maki Ikeda
Judge
Director - Energy Innovation Center
Baker Hughes
Terry Anderson
Judge
Chief Finacial Officer
Youth Sports Ent. Network Inc.
Kurt Rouser
Judge
Asst. Prof. Mech. and Aero. Eng.
OSU / USAF


nload
A tool for visualizing network usage in the terminal.
More information: home page
- View all network traffic (use the arrow keys to switch interfaces):
nload
- View network traffic on specific interfaces (use the arrow keys to switch interfaces):
nload device interface_one interface_two


Sat Lite Solutions
Home
About
Solutions
Booking
Name
Surname
Email
This email is invalid
Broadcasting Solution
DStv
DStv (ExtraView)
Add ExtraView
Message
Do you already have DStv installed?
Yes
No
I agree to the
terms and conditions
Submit
Cancel


Molecular
Dynamics
Sara Calhoun — Sali
Lab
Kale Kundert — Kortemme
Lab
What is Molecular Dynamics?
Source: Bert de Groot Lab
Group
How does Molecular Dynamics Work?
What Happens in a Time Step
How does Molecular Dynamics Work?
Bonded Forces
- Bond Lengths:
- Bond Angles:
- Torsion Angles:
How does Molecular Dynamics Work?
Non-Bonded Forces
- Van der Waals Forces
- Electrostatic Forces:
How does Molecular Dynamics Work?
The Hydrophobic Effect
Many folding and packing interactions are mediated by the
hydrophobic effect. How is it represented?
- Explicit Solvent
Simulate every water molecule.
This is expensive, but it naturally accounts for the entropy
of water.
- Implicit Solvent
Use the solvent-accessible surface area to roughly
approximate the hydrophobic effect.
How does Molecular Dynamics Work?
Free Energies
- Will one protein bind to another?
- What conformations exist in solution?
- How will a protein fold?
What is Molecular Dynamics Used For?
- Does the data address the question?
- Experimental validation
- Appropriate assumptions
- Time-scales of motion
Source: Zwier and Chong,
Current Opinion in Pharmacology, 2010
What is Molecular Dynamics Used For?
Observing protein motion at the atomic level
Native state dynamics - ensemble of conformational states
that a molecule explores in equilibrium
Source: Graham Johnson's
Youtube Channel
What is Molecular Dynamics Used For?
Simulating dynamic processes
Interesting biology involves dynamics processes:
- folding
- binding and assembly
- catalysis
- transport
What is Molecular Dynamics Used For?
Example: protein folds over six microseconds
Ultrafast folding of villin headpiece
Source: Freddolino et al.
Biophysical Journal, 2009.
What is Molecular Dynamics Used For?
Example: observing a conformational change
EGF Receptor following ligand disassociation
Source: Arkhipov et al. Cell,
2013.
What is Molecular Dynamics Used For?
Example: water molecule through aquaporin
Source: Bert de Groot Lab
Group
MD at UCSF
Multiscale modeling of microtubule assembly
MD at UCSF
Multiscale modeling of microtubule assembly
Want to learn more?
- Take these fall quarter courses: Macromolecular
Interactions and Statistical Mechanics
- Look out for mini-courses in the spring — Matt
Jacobson usually teaches a 3-week course on computational
methods
- Labs at UCSF
- Jacobson Lab
- Sali Lab
- DeGrado Lab


技术002CRunc
技术002CRunc¶
Creating an OCI Bundle¶
create the top most bundle directory
mkdir /mycontainer cd /mycontainer
create the rootfs directory
mkdir rootfs
export busybox via Docker into the rootfs directory
docker export $(docker create busybox) | tar -C rootfs -xvf -
命令runc spec
会生成基本的模版文件config.json
Running Containers¶
以root用户运行
run as root
cd /mycontainer runc run mycontainerid
If you used the unmodified runc spec template this should give you a sh session inside the container.
The second way to start a container is using the specs lifecycle operations. This gives you more power over how the container is created and managed while it is running. This will also launch the container in the background so you will have to edit the config.json to remove the terminal setting for the simple examples here. Your process field in the config.json should look like this below with “terminal”: false and `“args”: [“sleep”, “5”].
“process”: { “terminal”: false, “user”: { “uid”: 0, “gid”: 0 }, “args”: [ “sleep”, “5”], “env”: [ “PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin”, “TERM=xterm”], “cwd”: “/”, “capabilities”: { “bounding”: [ “CAP_AUDIT_WRITE”, “CAP_KILL”, “CAP_NET_BIND_SERVICE”], “effective”: [ “CAP_AUDIT_WRITE”, “CAP_KILL”, “CAP_NET_BIND_SERVICE”], “inheritable”: [ “CAP_AUDIT_WRITE”, “CAP_KILL”, “CAP_NET_BIND_SERVICE”], “permitted”: [ “CAP_AUDIT_WRITE”, “CAP_KILL”, “CAP_NET_BIND_SERVICE”], “ambient”: [ “CAP_AUDIT_WRITE”, “CAP_KILL”, “CAP_NET_BIND_SERVICE”] }, “rlimits”: [ { “type”: “RLIMIT_NOFILE”, “hard”: 1024, “soft”: 1024 }], “noNewPrivileges”: true },`
run as root
cd /mycontainer runc create mycontainerid
view the container is created and in the “created” state
runc list
start the process inside the container
runc start mycontainerid
after 5 seconds view that the container has exited and is now in the stopped state
runc list
now delete the container
runc delete mycontainerid 1. 以普通用户运行
Same as the first example
mkdir ~/mycontainer cd ~/mycontainer mkdir rootfs docker export $(docker create busybox) | tar -C rootfs -xvf -
The –rootless parameter instructs runc spec to generate a configuration for a rootless container, which will allow you to run the container as a non-root user.
runc spec --rootless
The –root parameter tells runc where to store the container state. It must be writable by the user.
runc --root /tmp/runc run mycontainerid
通过Supervisor运行runc¶
Supervisors `[Unit] Description=Start My Container [Service] Type=forking
ExecStart=/usr/local/sbin/runc run -d –pid-file /run/mycontainerid.pid mycontainerid
ExecStopPost=/usr/local/sbin/runc delete mycontainerid WorkingDirectory=/mycontainer PIDFile=/run/mycontainerid.pid [Install] WantedBy=multi-user.target`


public interface JsonGenerator
extends java.io.Flushable, java.io.Closeable
Json
contains methods to create generators for character
or output streams (Writer
and OutputStream
).
The following example shows how to create a JSON generator:
JsonGenerator generator = Json.createGenerator(...);
The class JsonGeneratorFactory
also contains methods to create
JsonGenerator
instances. JsonGeneratorFactory
should be used
when creating multiple generator instances, as in the following example:
JsonGeneratorFactory factory = Json.createGeneratorFactory();
JsonGenerator generator1 = factory.createGenerator(...);
JsonGenerator generator2 = factory.createGenerator(...);
JSON objects can be created using JsonGenerator
by calling the
writeStartObject()
method and then adding name/value pairs with the
write
method.
The following example shows how to generate an empty JSON object:
JsonGenerator generator = ...;
generator.writeStartObject().writeEnd().close();
JSON arrays can be created using JsonGenerator
by calling the
writeStartArray()
method and then adding values with the
write
method.
The following example shows how to generate an empty JSON array:
JsonGenerator generator = ...;
generator.writeStartArray().writeEnd().close();
Other JSON values (that are not JSON objects or arrays) can be created
by calling the appropiate write
methods.
The following example shows how to generate a JSON string:
JsonGenerator generator = ...;
generator.write("message").close();
JsonGenerator
methods can be chained as in the following example:
generator
.writeStartObject()
.write("firstName", "John")
.write("lastName", "Smith")
.write("age", 25)
.writeStartObject("address")
.write("streetAddress", "21 2nd Street")
.write("city", "New York")
.write("state", "NY")
.write("postalCode", "10021")
.writeEnd()
.writeStartArray("phoneNumber")
.writeStartObject()
.write("type", "home")
.write("number", "212 555-1234")
.writeEnd()
.writeStartObject()
.write("type", "fax")
.write("number", "646 555-4567")
.writeEnd()
.writeEnd()
.writeEnd();
generator.close();
The example code above generates the following JSON (or equivalent):
{
"firstName": "John", "lastName": "Smith", "age": 25,
"address" : {
"streetAddress": "21 2nd Street",
"city": "New York",
"state": "NY",
"postalCode": "10021"
},
"phoneNumber": [
{"type": "home", "number": "212 555-1234"},
{"type": "fax", "number": "646 555-4567"}
]
}
The generated JSON text must strictly conform to the grammar defined in
RFC 7159.Json
,
JsonGeneratorFactory
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
PRETTY_PRINTING
Configuration property to generate JSON prettily.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes this generator and frees any resources associated with it.
|
void |
flush()
Flushes the underlying output source.
|
JsonGenerator |
write(java.math.BigDecimal value)
Writes the specified value as a JSON number value within
the current array, field or root context.
|
JsonGenerator |
write(java.math.BigInteger value)
Writes the specified value as a JSON number value within
the current array, field or root context.
|
JsonGenerator |
write(boolean value)
Writes a JSON true or false value within the current array, field or root context.
|
JsonGenerator |
write(double value)
Writes the specified value as a JSON number value within the current
array, field or root context.
|
JsonGenerator |
write(int value)
Writes the specified value as a JSON number value within
the current array, field or root context.
|
JsonGenerator |
write(JsonValue value)
Writes the specified value as a JSON value within
the current array, field or root context.
|
JsonGenerator |
write(long value)
Writes the specified value as a JSON number value within
the current array, field or root context.
|
JsonGenerator |
write(java.lang.String value)
Writes the specified value as a JSON string value within
the current array, field or root context.
|
JsonGenerator |
write(java.lang.String name,
java.math.BigDecimal value)
Writes a JSON name/number value pair in the current object context.
|
JsonGenerator |
write(java.lang.String name,
java.math.BigInteger value)
Writes a JSON name/number value pair in the current object context.
|
JsonGenerator |
write(java.lang.String name,
boolean value)
Writes a JSON name/boolean value pair in the current object context.
|
JsonGenerator |
write(java.lang.String name,
double value)
Writes a JSON name/number value pair in the current object context.
|
JsonGenerator |
write(java.lang.String name,
int value)
Writes a JSON name/number value pair in the current object context.
|
JsonGenerator |
write(java.lang.String name,
JsonValue value)
Writes a JSON name/value pair in the current object context.
|
JsonGenerator |
write(java.lang.String name,
long value)
Writes a JSON name/number value pair in the current object context.
|
JsonGenerator |
write(java.lang.String name,
java.lang.String value)
Writes a JSON name/string value pair in the current object context.
|
JsonGenerator |
writeEnd()
Writes the end of the current context.
|
JsonGenerator |
writeKey(java.lang.String name)
Writes the JSON name with a colon.
|
JsonGenerator |
writeNull()
Writes a JSON null value within the current array, field or root context.
|
JsonGenerator |
writeNull(java.lang.String name)
Writes a JSON name/null value pair in an current object context.
|
JsonGenerator |
writeStartArray()
Writes the JSON start array character.
|
JsonGenerator |
writeStartArray(java.lang.String name)
Writes the JSON name/start array character pair with in the current
object context.
|
JsonGenerator |
writeStartObject()
Writes the JSON start object character.
|
JsonGenerator |
writeStartObject(java.lang.String name)
Writes the JSON name/start object character pair in the current
object context.
|
static final java.lang.String PRETTY_PRINTING
JsonGenerator writeStartObject()
JsonException
- if an i/o error occurs (IOException
would be cause of JsonException)JsonGenerationException
- if this method is called within an
object context or if it is called more than once in no context.JsonGenerator writeStartObject(java.lang.String name)
name
- a name within the JSON name/object pair to be writtenJsonException
- if an i/o error occurs (IOException
would be cause of JsonException)JsonGenerationException
- if this method is not called within an
object contextJsonGenerator writeKey(java.lang.String name)
name
- name of json fieldJsonException
- if an i/o error occurs (IOException
would be cause of JsonException)JsonGenerationException
- if this method is not called within an
object contextJsonGenerator writeStartArray()
JsonException
- if an i/o error occurs (IOException
would be cause of JsonException)JsonGenerationException
- if this method is called within an
object context or if called more than once in no contextJsonGenerator writeStartArray(java.lang.String name)
name
- a name within the JSON name/array pair to be writtenJsonException
- if an i/o error occurs (IOException
would be cause of JsonException)JsonGenerationException
- if this method is not called within
an object contextJsonGenerator write(java.lang.String name, JsonValue value)
name
- a name in the JSON name/value pair to be written in
current JSON objectvalue
- a value in the JSON name/value pair to be written in
current JSON objectJsonException
- if an i/o error occurs (IOException
would be cause of JsonException)JsonGenerationException
- if this method is not called within an
object contextJsonGenerator write(java.lang.String name, java.lang.String value)
name
- a name in the JSON name/string pair to be written in
current JSON objectvalue
- a value in the JSON name/string pair to be written in
current JSON objectJsonException
- if an i/o error occurs (IOException
would be cause of JsonException)JsonGenerationException
- if this method is not called within an
object contextJsonGenerator write(java.lang.String name, java.math.BigInteger value)
new BigDecimal(value).toString()
is used as the text value for writing.name
- a name in the JSON name/number pair to be written in
current JSON objectvalue
- a value in the JSON name/number pair to be written in
current JSON objectJsonException
- if an i/o error occurs (IOException
would be cause of JsonException)JsonGenerationException
- if this method is not called within an
object context.JsonGenerator write(java.lang.String name, java.math.BigDecimal value)
toString()
is used as the text value for writing.name
- a name in the JSON name/number pair to be written in
current JSON objectvalue
- a value in the JSON name/number pair to be written in
current JSON objectJsonException
- if an i/o error occurs (IOException
would be cause of JsonException)JsonGenerationException
- if this method is not called within an
object context.JsonGenerator write(java.lang.String name, int value)
new BigDecimal(value).toString()
is used as the text value
for writing.name
- a name in the JSON name/number pair to be written in
current JSON objectvalue
- a value in the JSON name/number pair to be written in
current JSON objectJsonException
- if an i/o error occurs (IOException
would be cause of JsonException)JsonGenerationException
- if this method is not called within an
object context.JsonGenerator write(java.lang.String name, long value)
new BigDecimal(value).toString()
is used as the text
value for writing.name
- a name in the JSON name/number pair to be written in
current JSON objectvalue
- a value in the JSON name/number pair to be written in
current JSON objectJsonException
- if an i/o error occurs (IOException
would be cause of JsonException)JsonGenerationException
- if this method is not called within an
object context.JsonGenerator write(java.lang.String name, double value)
BigDecimal.valueOf(double).toString()
is used as the text value for writing.name
- a name in the JSON name/number pair to be written in
current JSON objectvalue
- a value in the JSON name/number pair to be written in
current JSON objectJsonException
- if an i/o error occurs (IOException
would be cause of JsonException)java.lang.NumberFormatException
- if the value is Not-a-Number (NaN) or infinity.JsonGenerationException
- if this method is not called within an
object contextJsonGenerator write(java.lang.String name, boolean value)
true
value, otherwise
it writes the JSON false
value.name
- a name in the JSON name/boolean pair to be written in
current JSON objectvalue
- a value in the JSON name/boolean pair to be written in
current JSON objectJsonException
- if an i/o error occurs (IOException
would be cause of JsonException)JsonGenerationException
- if this method is not called within an
object context.JsonGenerator writeNull(java.lang.String name)
name
- a name in the JSON name/null pair to be written in
current JSON objectJsonException
- if an i/o error occurs (IOException
would be cause of JsonException)JsonGenerationException
- if this method is not called within an
object contextJsonGenerator writeEnd()
JsonException
- if an i/o error occurs (IOException
would be cause of JsonException)JsonGenerationException
- if this method is called in no context.JsonGenerator write(JsonValue value)
value
- a value to be written in current JSON arrayJsonException
- if an i/o error occurs (IOException
would be cause of JsonException)JsonGenerationException
- if this method is not called within an
array, root or field context.JsonGenerator write(java.lang.String value)
value
- a value to be written in current JSON arrayJsonException
- if an i/o error occurs (IOException
would be cause of JsonException)JsonGenerationException
- if this method is not called within an
array, root or field context.JsonGenerator write(java.math.BigDecimal value)
toString()
is used as the the text value for writing.value
- a value to be written in current JSON arrayJsonException
- if an i/o error occurs (IOException
would be cause of JsonException)JsonGenerationException
- if this method is not called within an
array, root or field context.JsonNumber
JsonGenerator write(java.math.BigInteger value)
new BigDecimal(value).toString()
is used as the text value for writing.value
- a value to be written in current JSON arrayJsonException
- if an i/o error occurs (IOException
would be cause of JsonException)JsonGenerationException
- if this method is not called within an
array, root or field context.JsonNumber
JsonGenerator write(int value)
new BigDecimal(value).toString()
is used as the text value for writing.value
- a value to be written in current JSON arrayJsonException
- if an i/o error occurs (IOException
would be cause of JsonException)JsonGenerationException
- if this method is not called within an
array, root or field context.JsonGenerator write(long value)
new BigDecimal(value).toString()
is used as the text value for writing.value
- a value to be written in current JSON arrayJsonException
- if an i/o error occurs (IOException
would be cause of JsonException)JsonGenerationException
- if this method is not called within an
array, root or field context.JsonGenerator write(double value)
BigDecimal.valueOf(value).toString()
is used as the text value for writing.value
- a value to be written in current JSON arrayJsonException
- if an i/o error occurs (IOException
would be cause of JsonException)JsonGenerationException
- if this method is not called within an
array, root or field context.java.lang.NumberFormatException
- if the value is Not-a-Number (NaN) or infinity.JsonGenerator write(boolean value)
true
value,
otherwise it writes the JSON false
value.value
- a boolean
valueJsonException
- if an i/o error occurs (IOException
would be cause of JsonException)JsonGenerationException
- if this method is not called within an
array, root or field context.JsonGenerator writeNull()
JsonException
- if an i/o error occurs (IOException
would be cause of JsonException)JsonGenerationException
- if this method is not called within an
array, root or field context.void close()
close
in interface java.lang.AutoCloseable
close
in interface java.io.Closeable
JsonException
- if an i/o error occurs (IOException
would be cause of JsonException)JsonGenerationException
- if an incomplete JSON is generatedvoid flush()
flush
in interface java.io.Flushable
JsonException
- if an i/o error occurs (IOException
would be cause of JsonException)


Redirecting to the latest Java FX documentation.
Click here
if you are not automatically redirected.


Fits the autologistic model described in Besag's famous 1974 paper on auto- models <http://www.jstor.org/stable/2984812>. Fits a multicategory generalization of the autologistic model when there are more than 2 response categories. Provides support for both asymptotic and bootstrap confidence intervals. For full model descriptions and a guide to the use of this package, please see the vignette.
| Version: | 2.0.0 |
| Imports: | Matrix, igraph, numDeriv, stats |
| Suggests: | utils, rmarkdown, knitr, ggplot2 |
| Published: | 2018-10-31 |
| Author: | Stephen Berg [aut, cre], Rao Fu [aut], Jun Zhu [ths] |
| Maintainer: | Stephen Berg <saberg2 at wisc.edu> |
| BugReports: | https://github.com/stephenberg/automultinomial/issues |
| License: | GPL-2 |
| NeedsCompilation: | no |
| Materials: | NEWS |
| CRAN checks: | automultinomial results |
| Reference manual: | automultinomial.pdf |
| Vignettes: |
Automultinomial Vignette |
| Package source: | automultinomial_2.0.0.tar.gz |
| Windows binaries: | r-devel: automultinomial_2.0.0.zip, r-release: automultinomial_2.0.0.zip, r-oldrel: automultinomial_2.0.0.zip |
| OS X binaries: | r-release: automultinomial_2.0.0.tgz, r-oldrel: automultinomial_2.0.0.tgz |
| Old sources: | automultinomial archive |
Please use the canonical form https://CRAN.R-project.org/package=automultinomial to link to this page.


|
ActiveTcl User Guide
|
||
Tk_CollapseMotionEvents, Tk_QueueWindowEvent - Add a window event to the Tcl event queue
#include <tk.h>
int
Tk_CollapseMotionEvents(display, collapse)
Tk_QueueWindowEvent(eventPtr, position)
Tk_QueueWindowEvent places a window event on Tcl's internal event queue for eventual servicing. It creates a Tcl_Event structure, copies the event into that structure, and calls Tcl_QueueEvent to add the event to the queue. When the event is eventually removed from the queue it is processed just like all window events.
When multiple motion events are received for the same window in rapid succession, they are collapsed by default. This behavior can be controlled with Tk_CollapseMotionEvents. Tk_CollapseMotionEvents always returns the previous value for collapse behavior on the display.
The position argument to Tk_QueueWindowEvent has the same significance as for Tcl_QueueEvent; see the documentation for Tcl_QueueEvent for details.
callback, clock, handler, modal timeout, events
Copyright © 1995-1996 Sun Microsystems, Inc. Copyright © 1995-1997 Roger E. Critchlow Jr.


Processes
Location
- Open Task Manager
- Go to Processes tab
- Find and click on Show processes from all users
Settings
The following are Windows processes that should not be stopped. Avoid stopping any required software.
- csrss.exe
- dwm.exe
- explorer.exe
- lsass.exe
- lsm.exe
- mmc.exe
- MSACui.exe
- SearchIndexer
- services.exe
- sidebar.exe
- SLsvc.exe
- smss.exe
- spoolsv.exe
- svchost.exe
- System
- taskeng.exe
- taskmgr.exe
- wininit.exe
- winlogon.exe
- winauclt.exe


BUBBLE BOY ----------
Jimmy Livingston (Jake Gyllenhaal, "October Sky") was born without an immune system and is cared for in his California home by his bigoted, religious overprotective mom (Swoosie Kurtz, "Citizen Ruth") and silent bullied dad (John Carroll Lynch, "The Next Best Thing"). Beautiful teenage neighbor Chloe (Marley Shelton, "Valentine") becomes friendly with the guitar-playing oddball, but Jimmy's mom-instilled fears keep him from letting her into his germ free bubble environment. When Chloe tells him she's marrying obnoxious rocker Mark (Dave Sheridan, "Ghost World") in Niagara Falls, Jimmy designs a portable bubble and sets off on a cross country journey to declare his love in "Bubble Boy."
Let me state one thing up front - I find political correctness to be an overvalued virtue and I found "Bubble Boy" to be both jaw-droppingly outrageous and funny with some sharply observed societal and religious subtext. I'm amazed this button-pushing movie, sure to be reviled by many, came from a Disney studio (Touchstone).
Mrs. Livingston is one of those religious nuts who teaches her child that other religions are bad, TV only gets 1 mom-approved station, and all fairy tales end with the hero getting out of his bubble and dying. Jimmy grows up to be a wild eyed innocent who dines on cross shaped soy fiber cookies and loves watching "Land of the Lost" with 'the whore next door.'
Adorned with the spiky hair and distancing false arms of "Edward Scissorhands," Gyllenhaal (a much wiser casting choice than the more obvious Brendan Fraser) makes us feel his innocent joy at seeing grass and walking outside in his clear spherical suit. He first meets a churlish, regimented bus stop guy (Zach Galifianakis) who's no help in getting him to his destination, but a busload of 'Bright and Shinies,' an 'Up With People'-like cult all named Todd or Lorraine, pick him up instead. Once Jimmy innocently declares them a cult, he's thrown out of the bus and picked up by a friendly biker (Danny Trejo, "Spy Kids") who brings him to Las Vegas where he becomes a human beach ball at a rock concert.
Meanwhile, back at home hysterical Mrs. Livingston is reading the fake ransom note she's had her hapless husband compose. 'From the Jews? They're gonna want more than $100,000!' she screams, in perhaps the flick's most offensive, but in character, line. Screenwriters Cinco Paul and Ken Daurio are attempting to do more than shock and offend, though. They're illustrating how a bad environment affects our new generations.
When the Livingstons hit the road in pursuit of Jimmy, they end up hitting the lad off his Vegas-won scooter and he bounces right into a train car filled with Dr. Phreaks' ("Austin Powers'" mini-me, Verne Troyer) travelling sideshow of Flipper Boy (Geoffrey Arend), Li'l Zip (Beetlejuice), Chicken Man (Stephen Spinella) and the Human Sasquatch (Matthew McGrory). Meanwhile, the leader of the Bright and Shinies (Fabio!) tells them their messiah will look just like the bubble boy they discarded. The Bright and Shinies go off in pursuit of the messiah the freaks wish to claim as their savior.
After being rescued by Indian ice cream and curry van man who has a tragic run in with a sacred cow and earning $500 in a Chinese night club mud-wrestling contest with two bikini-clad babes to pay a 97 year old cabbie, Jimmy eventually lands (literally) in Niagara Falls. The romance is just a plot contrivance for the hero's amazing journey and "The Graduate" parody climax is obvious, but the wrap-up does provides a few character revelation chuckles.
Commercial director Blair Hayes does a pretty good job keeping all the elements interwoven, although things get confusing once or twice along the way. "Bubble Boy" is bright, frantic, innocent, occasionally gross, wickedly observant and just plain nuts.
B
For more Reeling reviews visit www.reelingreviews.com
<EMAIL_ADDRESS><EMAIL_ADDRESS>========== X-RAMR-ID: 29339 X-Language: en X-RT-ReviewID: 246266 X-RT-TitleID: 1109553 X-RT-SourceID: 386 X-RT-AuthorID: 1487 X-RT-RatingText: B
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


WIDOWS' PEAK A Film Review by James Berardinelli Copyright 1994 James Berardinelli
Rating (0 to 10): 7.9
Date Released: 5/94 Running Length: 1:41 Rated: PG (Language, mature themes)
Starring: Mia Farrow, Joan Plowright, Natasha Richardson, Adrian Dunbar, Jim Broadbent Director: John Irvin Producer: Jo Manuel Screenplay: Hugh Leonard Music: Carl Davis Released by Fine Line Features
While it may not be as enchanting as ENCHANTED APRIL (although it features two of that film's stars), as appealing as HEAR MY SONG, or as funny as FOUR WEDDINGS AND A FUNERAL, John Irvin's delightfully charming WIDOWS' PEAK can hold its own against those and many more. This is a very British comedy that will cause laughter and smiles wherever it is shown.
Overlooking the Irish village of Kilshannon is Widows' Peak - a group of select houses owned and inhabited exclusively by the rich women of the community who have buried at least one husband. The matriarch of Widows' Peak is Mrs. Doyle-Counihan (Joan Plowright), who lives with her son Godfrey (Adrian Dunbar). Also inhabiting the peak is Mrs. O'Hare (Mia Farrow), a woman who has never been married and who hasn't a penny to her name. Then there's the newcomer: a beautiful, young war-widow (it's 1920) named Edwina Broome (Natasha Richardson), who brings with her more secrets than those already buried in and out of the graveyard.
Secrets are indeed at the center of WIDOWS' PEAK, and much of the comedy in this lighthearted romp comes through their revelation. Though the film is a trifle overplotted, it's still enjoyable to uncover the next sordid detail of someone's past before the characters on screen do so.
With a similar infectious charm to any of the previously-mentioned movies, WIDOWS' PEAK draws its audience in with promises of little more than a enjoyable time - a goal at which it succeeds. There are no deep or hidden meanings to be found, no matter how much the plot itself relies on secrets.
Joan Plowright has settled nicely into playing the stuffy matron, and she is again successful in that role. Although the actress is more than capable of doing a dramatic turn when a part requires it, there's not much seriousness demanded from Mrs. Doyle-Counihan, and Mrs. Plowright pilfers countless scenes from her co-stars by sheer screen presence.
Mia Farrow turns in a better performance than she has given in a number of years. Having freed herself from Woody Allen's angst-riddled characters, she is allowed an opportunity to shine in a role that one might not typically associate with her. Meanwhile, Natasha Richardson (THE HANDMAID'S TALE) plays her part with a delicious "falseness" which betrays that something's up - although we don't know exactly what. Her American accent is flawless, which is something of a pleasant surprise.
Jim Broadbent (LIFE IS SWEET, ENCHANTED APRIL) and Adrian Dunbar (HEAR MY SONG) do solid jobs as supporting characters, but it's the women to whom every scene - and the movie as a whole - belongs. After all, it's not called WIDOWS' PEAK for nothing.
Although there may be one twist or turn too many, and the plot skeleton is not without its supporting contrivances, few viewers will complain. WIDOWS' PEAK, while admittedly not a great movie, offers a good time - and often that's all that is wanted from any motion picture.
- James Berardinelli<EMAIL_ADDRESS>.
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


© 2012 Mampel Design. All rights reserved. SlideShow example with JavaScript and CSS3. Mohammad Reza Shariatzadeh<EMAIL_ADDRESS>|| www.Mampel.ir


Server Info
Auto update
Hostname:
Game:
Version:
Password:
Map:
Maxplayers:
Tags:
Connect
Players
ID
Name
SteamID
Score
IP
Time
Ping
{{player.ipAddress}}
Total
Console
Send private message
Mute
Unmute
Kill
Kick
Ban


ArtofAcoustics.com, by West General LLC, is a resource for the application design of premier acoustic materials used for reverberant space treatment, and noise control. While performing their acoustic function, these materials offer a wide variety of looks and finishes. From metal and neutral colors designed into industrial applications, to soft foam, wood, and fabric colors and textures desired for schools, churches, libraries and conference rooms. Dramatic ceiling treatments, baffles, and banners that looks great in gyms, swimming pools, and large commercial spaces. Let us show you our wide range of colors, textures, patterns, and finishes, on materials which also help with your acoustics. Located in San Jose, we are in business since 1975. For product information please visit our parent site www.westgeneral.com By: West General LLC 1475 Saratoga Ave. Suite 120 San Jose CA 95129 Phone:<PHONE_NUMBER> Fax:<PHONE_NUMBER> Email<EMAIL_ADDRESS>|


HiveMind Multi-Threading
HiveMind is specifically targetted for J2EE: deployment in a WAR or EAR, particularly as part of a Tapestry application. Of course, J2EE is not a requirement, and HiveMind is quite useful even in a simple, standalone environment.
In the world of J2EE, multi-threading is always an issue. HiveMind services are usually singletons, and must be prepared to operate in a multi-threaded environment. That means services should not have any specific state, much like a servlet.
Construction State
HiveMind expects that initially, work will progress in a single startup thread. This is the early state, the construction state, where the module deployment descriptors are located and parsed, and the contents used to assemble the registry; this is the domain of RegistryBuilder .
The construction activities are not thread-safe. This includes the parser, and other code (virtually all of which is hidden from your application).
The construction state ends when the RegistryBuilder returns the Registry from method constructRegistry(). The registry is thread-safe.
Runtime State
Everything that occurs with the Registry and modules must be thread-safe. Key methods are always synchronized. In particular, the methods that construct a service and construct configuration point elements are thread-safe. Operations such as building the interceptor stack, instantiating core service implementations, and converting XML to Java objects operate in a thread-safe manner. However, different threads may be building different services simultaneously. This means that, for example, an interceptor service implementation must still be thread-safe, since it may be called upon to generate interceptors for two or more different services simultaneously.
On the other hand, the Java objects constructed from XML <rules> don't need to be thread-safe, since that construction is synchronized properly ... only a single thread will be converting XML to Java objects for any single configuration point.
Managing Service State
When services simply must maintain state between method invocations, there are several good options:
- Store the data in an object passed to or returned from the service
- Make use of the hivemind.ThreadLocalStorage service to store the data in a thread-local map.
- Make use of the threaded or pooled service models, which allow a service to keep its state between service method invocations.


asianproducts B2B
EZorder Wholesaler
Login to Your Account Account
* You can also use Asian Products's account to login.
Account
*
Password
*
Login
Forgot password
or
Facebook
Google
New User to EZorder ?
Signup
Forgot Password
Please enter your account (e-mail) to reset your password.
Account
next
Forgot Password
We just sended a e-mail to<EMAIL_ADDRESS>Please find the e-mail and click the link to reset your e-mail.
ok


Filament Group
Code
Super Edge Case: Select Proxy and External Toggle
Highest Priority
High Priority
Medium Priority
Low Priority
Lowest Priority
No Priority
Highest
Priority
Highest
Priority (Expand Target Collapsible)
High
Priority (Collapse Target Collapsible)
Medium
Priority (Do nothing)
Low
Priority
Lowest
Priority
No priority
Not linked to select
Collapsible Chained from Select Proxy
Item
Item
Item
Item
Item


Apt Pupil: Brad Renfro, Ian McKellen, David Schwimmer, Elias Koteas
The opening scene of "Apt Pupil" is set in a high school at the end of a week of studying the Holocaust in history class. The teacher reminds the students that if they want to know more, they can always turn to the library.
Instead, Brad Renfro turns to experiential learning, leading to some frightening conclusions.
Renfro is Todd Bowden, a bright, bored high-school student. Using leaps of logic that would impress even the Scooby Doo crew, he deduces that neighborhood recluse Arthur Denker (Ian McKellan) is in fact Kurt Dussander, who ran one of the Nazi concentration camps during the war and is still wanted by the Israeli government.
For some reason, instead of turning Dussander over to the police, Todd blackmails him - firsthand information about the death camps in exchange for his silence. "Tell me what the schools are afraid to," he pleads.
As Dussander's tales grow ever more glorious and graphic, Todd grows more and more unraveled - having gas chamber hallucinations in the shower, doodling swastikas in his notebook, falling behind in school. Then he grows truly disturbed, killing birds and the occasional homeless man.
Based on a novella by Stephen King and directed by Bryan Singer (who helmed the Oscar-winning "The Usual Suspects"), "Apt Pupil" clearly had a lot of potential. King's story, and thus the screenplay, is sufficiently spooky if you can wade through the mounds of mediocrity - it doesn't get truly suspenseful until the second hour.
McKellan, winner of multiple film awards, turns in an acceptable performance as the despicable Dussander, right down to the faux German accent. And the supporting cast, from David Schwimmer to Elias Koteas, is right on target as well.
Renfro, however, is a disappointment. His character seems disturbed even at the start of the film, so his descent into depravity has little effect on the viewer. This lapse is inexcusable in the key character in the film. We should be mourning for his shrinking humanity, not for the movie.
Few would argue that the Second World War and the Holocaust were among the greatest atrocities in history.
...dave
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


Setting Up Your React Project Is Easier Than You Think
I have heard some ones complaining that setting up a Webpack + React project is not an easy job. It’s only partly true. Webpack is not well documented at this moment, and has many powerful features and plugins. This makes configuration on Webpack seem difficult to new developers. To make things even worse, there are tons of ‘starter kit’ projects over there, most of which are lack of maintainance.
Indeed, it is super easy to setup a brand new Webpack + React project using Yeoman.
Yeoman is a scaffolding tool for web developers. With diffrent generators
we can generate different kinds of web projects quickly by lines of command.
Here’s how it is done:
1 2 3 4 5 6 7 8 |
|
Thanks to generator-react-webpack, after answering some questions from yo
you will get your project setup in seconds.
Easy and quick, right? Here’s what we have got out of the box:
- a project with Webpack and React configured;
- a solution for diffrent environments both for runtime and webpack configuration;
- a flux project structure;
- an optional PostCSS setup
Also this generator can help generate React components via command line.


Pennywall lets you put up instant donation-walls, paywalls, or tip
jars, and share them on social networks.
Pennywall uses
QUID
to accept and process payments as low as 1¢.
- Accept donations for every new blog post
- Charge for your high-resolution photographs
- Collect tips for your podcast episodes
- Monetize your unlisted youtube videos
- Generate as many pennywalls as you like


Adding Tags
In the taglist window, click on the Add Tag button. A window will show where you can name the tag, choose its color and write notes.
Removing Tags
Select the tags you want to remove and click on the Remove Tag button. Multiple tags can be removed.


Trident Group Of Institutions Presents
Udayan 2k18
— THE TECHFEST —
Click on dustbin to open respective branch events.
CSE CIVIL EE EEE ETC MECH


writeVGF, writeVGF_GD, writeVGF_ARR
Synopsis
Writes the contents of a field, a Graphic Display object (red renderable
port) or a group of Graphic Display objects to a dVision VGF format file.
Input Ports
| User Macro |
Name |
Type |
Description |
|
| writeVGF |
in_fld |
Mesh+Node_Data |
single set of field data |
| writeVGF_GD |
obj |
GD Object |
single Graphic Display Object |
| writeVGF_ARR |
top_obj |
GroupObject |
group of Graphic Display Objects |
|
Description
These user macros all write data to dVision VGF format files. The exact purpose of each of these three macros is described below:
-
writeVGF: This macro writes a single set of field data to a VGF file. Both of the other user macros are derieved from this macro.
-
writeVGF_GD: This macro writes a single Graphic Display object (red renderable port) to a VGF file.
-
writeVGF_ARR: This macro writes a GroupObject (red renderable port) to a VGF file. GroupObjects are generated by the ARR library modules and represent an array of separate fields. They are written to the VGF file as separate GEOGROUPs.
These macros parse the appropriate input and then create an ASCII VGF output
file containing the Cell_Sets of 2D elements such as triangles, quads,
lines, polylines and polytristrips. The module takes cell mesh topology
from the input field structure, and writes them out to a file in
ASCII VGF file format.
This format is part of the dVision dVise virtual reality system, which
can store 3D geometric objects in the scene in this format. It is
able to pass normals through if they exist on the input mesh, colors, and
scalar numerical values at nodes using UV texture coordinates.
The cell-set hierarchy is preserved in the file format.
Inputs
Note that each of the user macros has a different input port.
in_fld - writeVGF
Reference to a set of field data that should be written to the VGF file. The field data should consist of Mesh and Node Data.
obj - writeVGF_GD
Reference to a Graphic Display object (red renderable port) that should be written to the VGF file. The field data to be written is extracted from the supplied Graphic Display object.
top_obj - writeVGF_ARR
Reference to a GroupObject (red renderable port) that should be written to the VGF file. The GroupObject should contain a number of child Graphic Display objects. These are output as GEOGROUP blocks in the VGF file. GroupObjects are generated by ARR library modules.
Outputs
(none)
Utility Modules
The User Macro writeVGF uses the low-level module WriteVGFCore and the UI macro WriteVGF_UI. As both of the other User Macros are derived from the writeVGF macro they also make use of these components.
Example
Two example applications are provided. WriteVGFEg demonstrates the use of the writeVGF macro by generating an isosurface and writing that isosurface to a file. WriteVGF_ARR_Eg demonstrates the use of the writeVGF_ARR macro by loading a multiblock set of data and generating a series of visualizations. The isosurface can then be written to a file. If the resultant file is examined then it is apparent that the isosurface is written out in several chunks, one per block of data.
Files
xp_comm_proj/wr_vgf/wvgfmacs.v contains the V definitions of the writeVGF, writeVGF_GD and writeVGF_ARR User Macros, the WriteVGF_UI UI Macro, and the example applications WriteVGFEg and WriteVGF_ARR_Eg.
Other Notes
The WriteVGFMacs library inherits its process. As this library contains
no procedural code, the process is not important.
Author
Ian Curington
Advanced Visual Systems, Ltd.
Hanworth Lane, Chertsey Surrey, UK
KT16 9JX
<EMAIL_ADDRESS>See Also
WriteVGFCore, WriteVGF_UI, WriteVGFEg, WriteVGF_ARR_Eg, Write STL


LearnIt Results
Entity Profiles
Show Graph
Entities
Search
Show All
A-Z
Freq
Sort
Link
Link
:
Confidence:
LearnIt Results
Relation Graph
Relations
Show All
Toggle Instance Panel
Return to Profiles
Relation Types
Confidence:


Quentin Lacombe – Event Horizon
by FACTQuentin Lacombe – Event Horizon
Now showing at London’s 180 The Strand.
The Store X The Vinyl Factory’s new group exhibition at 180 The Strand, TRANSFORMER: A Rebirth Of Wonder, sees Jefferson Hack curate newly commissioned and debut works by Doug Aitken, Sophia Al-Maria & Victoria Sin, Korakrit Arunanondchai, Donna Huanca, Juliana Huxtable, Evan Ifekoya, Dozie Kanu, Quentin Lacombe, Lawrence Lek, Jenn Nkiru, Chen Wei and Harley Weir & George Rouy.
The title of Quentin Lacombe’s photographic book, Event Horizon, on which his installation is based, refers to the perimeter of a black hole – a point of no return, from which light cannot escape and events can no longer be witnessed. Through distorted and sublime forms, Lacombe offers his own cosmological tour of the incomprehensible.
TRANSFORMER: A Rebirth Of Wonder runs from October 2 to December 8 at The Store X 180 The Strand, London WC2R 1EA. The exhibition is open Tuesday through Sunday, 12pm – 7pm and entry is free. Find out more here.
Share this story
Related Stories
Friday, November 15
Thursday, October 17
Thursday, October 17
Thursday, October 10
Tuesday, October 8
Friday, October 4
Friday, October 4
Thursday, October 3
Wednesday, October 2
Wednesday, October 2
More from Exhibitions
Friday, November 15
Friday, November 15
Thursday, October 17
Thursday, October 17
Tuesday, October 8
Friday, October 4
Friday, October 4
Wednesday, October 2
Wednesday, October 2
Wednesday, October 2


Thymely Adventures
Experience Disneyland
Have you ever visited Disneyland and been so overwhelmed you didn't know where to start? Well you're not alone. Let us do the work for you. Fill out the form to the right to get a customized plan for your day.


back to site
James
Bytes
Creator
View more
Email
<EMAIL_ADDRESS>Web
https://jamesbyt.es


Here's some info about the NFL...
The average years of experience is {{ data.1 }} years.
The number of players on a team are {{ data.2}} players.
Players on average are {{ data.3 }} years old.
Average age of teams are {{ data.4 }}.
The average win perentage in the league is {{ data.5 }}.
Which would you like to learn more about, a team or player?


--- layout: default comments: true --- {{ page.title }} {{ page.date | date: '%B %-d, %Y' }} {{ content }} Back Please enable JavaScript to view the comments powered by Disqus.


This is a wonderful journey, from which you will experience the love story of our heroine. In the game, you will act as a Paper Man (which is made of paper by heroine). And he need to travel through photos to get to different places showing in them, As he travels through the photos, the world he lives in will change its size, accordingly, his properties will change, thus he can fulfill different tasks. you will use change in time and space to figure out the puzzle, and find out how to keep moving forward and fetch the ring back, which is in the snowy mountain where hero died. Then you can give the love story a happy ending.
Liar is a game focusing on how to tell a story.
Inspiration coms from the drawings and novels which take things as clues. In the game, you can press "shift" down to find the red clue, and than go to next step.
"Gender Equality" is the foundation of other SDGs. And it's more than a goal in itself.It is a precondition for meeting the chanllenge of reducing poverty, promoting sustainable development and building good governance.
A game consist of 7 levels. Go and enjoy the travel during the period.
You can not only feel the extension when you play the game and you don't want to be outside the edge. You can also feel different things when look into the hints above the screen.


Preparation time
less than 30 mins
Cooking time
over 2 hours
Serves
Serves 4
Wash the scallops well, then place them onto a plate lined with kitchen paper. Cover and chill in the fridge for two hours.
Meanwhile, place the smoking chips into a heavy-based pan over a low to medium heat (you will need to choose a pan that fits a smoking basket or metal colander inside). Heat the smoking chips until they begin to smoke.
Place the whole beetroot into a colander or smoking basket and suspend it over the smoking chips in the pan. Cover the pan and colander or smoking basket with cling film, making sure that none of the smoke can escape.
Remove the pan from the heat and set aside to smoke for 2-3 hours in a well-ventilated place, or preferably outside. (NB: Tea-smoking generates a lot of smoke. Be sure to open the windows and ventilate the room as much as possible.)
When the scallops have chilled and the beetroot has been smoking for two and a half hours, bring a pan of salted water to the boil, add the asparagus and cook for 3-4 minutes, or until just tender. Drain well and set aside.
Heat a large, non-stick frying pan over a medium heat. When the pan is hot, add 1-2 tablespoons of the olive oil. When the oil is smoking, add the chilled scallops and fry for 45-60 seconds.
Turn the scallops over and squeeze over half of the lemon juice, then continue to fry for 45-60 seconds.
Add the cooked crayfish to the pan and squeeze the remaining lemon juice over the scallops and crayfish. Remove the pan from the heat and set aside for 1-2 minutes to rest and absorb the pan juices.
When the crayfish and scallops have cooled, transfer them to a mixing bowl (reserve the pan juices in a bowl and set aside to cool). Add the cooked asparagus, then pour over the remaining olive oil and all of the balsamic vinegar. Stir well to combine, then set aside.
Mix the salad leaves and watercress together in a bowl. When the pan juices have cooled, drizzle them over the salad leaves and watercress, stirring well to coat.
When the beetroot has finished smoking, remove it from the pan in a well-ventilated area, or preferably outside (NB: The pan will release a lot of smoke). Slice the smoked beetroot into 0.5cm/¼in pieces.
To serve, arrange the smoked beetroot slices in the centre of four serving plates so that they overlap each other. Place five asparagus spears on top of the beetroot slices, then place three scallops around the edge of each plate. Place the crayfish on top of the asparagus. Pile the dressed salad alongside. Drizzle the remaining dressing around the edge of the plate and garnish with the mixed herbs.


10 July 2002
Disease Outbreak Reported
The investigation has been hampered by the lack of community
cooperation.
WHO has received reports of 8 suspected cases including 5 deaths of acute
haemorrhagic fever syndrome in Mbomo district, Cuvette Ouest region (see previous report) . Two new suspected cases have
been reported in Mbomo since the last death on 6 June. Health authorities have identified
more than 40 contacts of the suspected cases.


Spring Boot Topics
Introduction
Overview
Pre Requirements
Course Outline
First Spring Boot Project
Spring Boot Directory Structure
Pom.xml File
Application.properties File
RestControllers
Dependencies
Thymeleaf Template Engine
Spring MySql Connection


Quantum Key Distribution - B92¶
The Quantum Key Distribution B92 protocol was proposed in 1992 by Charles Bennett. It is a modified version of the BB84 protocol. This protocol is different from the BB84 in the following ways:
It uses two possible states of qubits being sent instead of four.
Alice and Bob do not need to compare bases at any point.
A detailed description of this protocol can be found here
First, we create a network with three hosts, Alice, Bob and Eve. Alice will send her qubits to Bob and Eve will, or will not, eavesdrop and manipulate the qubits she intercepts. The network will link Alice to Eve, Eve to Alice and Bob, and Bob to Eve. Here is also the place to define which function will Eve run if the eavesdropping is turned on.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | def build_network_b92(eve_interception):
network = Network.get_instance()
network.start()
host_alice = Host('Alice')
host_bob = Host('Bob')
host_eve = Host('Eve')
host_alice.add_connection('Eve')
host_eve.add_connections(['Alice', 'Bob'])
host_bob.add_connection('Eve')
# Adding the connections - Alice wants to transfer an encrypted message to Bob
# The network looks like this: Alice---Eve---Bob
host_alice.delay = 0.3
host_bob.delay = 0.3
# starting
host_alice.start()
host_bob.start()
host_eve.start()
network.add_hosts([host_alice, host_bob, host_eve])
if eve_interception == True:
host_eve.q_relay_sniffing = True
host_eve.q_relay_sniffing_fn = eve_sniffing_quantum
hosts = [host_alice,host_bob,host_eve]
print('Made a network!')
return network, hosts
|
First, a random encryption key of a certain length is generated. The key is a list of binary numbers.
1 2 3 4 5 6 | def generate_key(key_length):
generated_key = []
for i in range(key_length):
generated_key.append(randint(0, 1))
print(f'Generated the key {generated_key}')
return generated_key
|
We now implement the B92 protocol. For each bit in the encrypted key, Alice generates and sends a qubit to Bob. If the bit she wants to send is 0, she sends a \(|0\rangle\), and if the bit is 1, she sends \(|+\rangle\).
Then, after she sends the qubit, she waits for a (classical) message from Bob. If Bob tells her he measured the qubit and extracted the information, she prepares and sends the next one. Otherwise, she sends the information concerning this bit again and again, until a confirmation is received.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | def sender_qkd(alice, secret_key, receiver):
sent_qubit_counter = 0
for bit in secret_key:
success = False
while success == False:
qubit = Qubit(alice)
if bit == 1:
qubit.H()
# If we want to send 0, we'll send |0>
# If we want to send 1, we'll send |+>
alice.send_qubit(receiver, qubit, await_ack = True)
message = alice.get_next_classical(receiver, wait = -1)
if message is not None:
if message.content == 'qubit successfully acquired':
print(f'Alice sent qubit {sent_qubit_counter + 1} to Bob')
success = True
sent_qubit_counter += 1
# if, however, message says Bob failed to measure the qubit,
# Alice will resend it.
|
Bob receives the qubit Alice sent, and randomly chooses a base (rectilinear or diagonal) for the qubit measurement. If he chooses the rectilinear basis, and the measurement yields the state \(|1\rangle\), then Bob knows that Eve’s qubit was \(|+\rangle\), and therefore the bit she sent was 1. Bob sends Alice a classical message after the measurement and tells her whether he succeeded or failed to extract the information.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | def receiver_qkd(bob, key_size, sender):
key_array = []
received_counter = 0
#counts the key bits successfully measured by Bob
while received_counter < key_size:
base = randint(0,1)
# 0 means rectilinear basis and 1 means diagonal basis
qubit = bob.get_qubit(sender,wait = wait_time)
if qubit is not None:
if base == 1:
qubit.H()
bit = qubit.measure()
if bit == 1:
if base == 1:
resulting_key_bit = 0
elif base == 0:
resulting_key_bit = 1
message_to_send = 'qubit successfully acquired'
key_array.append(resulting_key_bit)
received_counter += 1
print(f'Bob received qubit {received_counter}')
else:
message_to_send = 'fail'
bob.send_classical(sender,message_to_send, await_ack = True)
return key_array
|
After sending all of the bits of the encrypted key, Alice and Bob should check whether Eve eavesdropped on the channel. For this purpose, each of them takes for comparison a certain part of the encrypted key they have. Alice classically sends part of the key she has to Bob. He compares it to the part he has. If it’s the same information, he sends her a message informing her that the key was transferred without eavesdropping. If, however, the part he receives is different from what he has, it means eavesdropping occurred and he sends a message to inform Alice about it.
1 2 3 4 5 6 7 8 9 10 11 12 | def check_key_sender(alice, key_check_alice, receiver):
key_check_string = ''.join([str(x) for x in key_check_alice])
print(f'Alice\'s key to check is {key_check_string}')
alice.send_classical(receiver, key_check_string, await_ack=True)
message_from_bob = alice.get_next_classical(receiver, wait = -1)
# Bob tells Alice whether the key part is the same at his end.
# If not - it means Eve eavesdropped.
if message_from_bob is not None:
if message_from_bob.content == 'Success':
print('Key is successfully verified')
elif message_from_bob.content == 'Fail':
print('Key has been corrupted')
|
1 2 3 4 5 6 7 8 9 | def check_key_receiver(bob, key_check_bob,sender):
key_check_bob_string = ''.join([str(x) for x in key_check_bob])
print(f'Bob\'s key to check is {key_check_bob_string}')
key_from_alice = bob.get_next_classical(sender, wait = -1)
if key_from_alice is not None:
if key_from_alice.content == key_check_bob_string:
bob.send_classical(sender, 'Success', await_ack=True)
else:
bob.send_classical(sender, 'Fail', await_ack=True)
|
If the eavesdropping is turned on, Eve runs the function eve_sniffing_quantum. She intercepts a qubit that is sent from Alice to Bob. She measures the qubit with probability 0.5. For the measurement of the qubit, she randomly chooses the basis (rectilinear or diagonal).
1 2 3 4 5 6 7 8 9 10 | def eve_sniffing_quantum(sender,receiver,qubit):
# Eve will manipulate only part of the qubits she intercepts
# She chooses the base in which she measures at random.
if sender == 'Alice':
r = random()
if r > 0.5:
base = randint(0,1)
if base == 1:
qubit.H()
qubit.measure(non_destructive = True)
|
The full example is given below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 | # This example implements the B92 QKD protocol using the QuNetSim package
from qunetsim.components import Host, Network
from qunetsim.objects import Qubit
from qunetsim.objects import Logger
from random import randint, random
Logger.DISABLED = True
wait_time = 60
def eve_sniffing_quantum(sender, receiver, qubit):
# Eve will manipulate only part of the qubits she intercepts
# She chooses the base in which she measures at random.
if sender == 'Alice':
r = random()
if r > 0.5:
base = randint(0, 1)
if base == 1:
qubit.H()
qubit.measure(non_destructive=True)
def build_network_b92(eve_interception):
network = Network.get_instance()
nodes = ['Alice', 'Bob', 'Eve']
network.start(nodes)
host_alice = Host('Alice')
host_bob = Host('Bob')
host_eve = Host('Eve')
host_alice.add_connection('Eve')
host_eve.add_connections(['Alice', 'Bob'])
host_bob.add_connection('Eve')
# adding the connections - Alice wants to transfer an encrypted message to Bob
# The network looks like this: Alice---Eve---Bob
host_alice.delay = 0.3
host_bob.delay = 0.3
# starting
host_alice.start()
host_bob.start()
host_eve.start()
network.add_hosts([host_alice, host_bob, host_eve])
if eve_interception == True:
host_eve.q_relay_sniffing = True
host_eve.q_relay_sniffing_fn = eve_sniffing_quantum
hosts = [host_alice, host_bob, host_eve]
print('Made a network!')
return network, hosts
def generate_key(key_length):
generated_key = []
for i in range(key_length):
generated_key.append(randint(0, 1))
print(f'Generated the key {generated_key}')
return generated_key
def sender_qkd(alice, secret_key, receiver):
sent_qubit_counter = 0
for bit in secret_key:
success = False
while success == False:
qubit = Qubit(alice)
if bit == 1:
qubit.H()
# If we want to send 0, we'll send |0>
# If we want to send 1, we'll send |+>
alice.send_qubit(receiver, qubit, await_ack=True)
message = alice.get_next_classical(receiver, wait=-1)
if message is not None:
if message.content == 'qubit successfully acquired':
print(f'Alice sent qubit {sent_qubit_counter+1} to Bob')
success = True
sent_qubit_counter += 1
# if, however, message says Bob failed to measure the qubit, Alice will resend it.
def receiver_qkd(bob, key_size, sender):
key_array = []
received_counter = 0
# counts the key bits successfully measured by Bob
while received_counter < key_size:
base = randint(0, 1)
# 0 means rectilinear basis and 1 means diagonal basis
qubit = bob.get_qubit(sender, wait=wait_time)
if qubit is not None:
if base == 1:
qubit.H()
bit = qubit.measure()
if bit == 1:
if base == 1:
resulting_key_bit = 0
elif base == 0:
resulting_key_bit = 1
message_to_send = 'qubit successfully acquired'
key_array.append(resulting_key_bit)
received_counter += 1
print(f'Bob received qubit {received_counter}')
else:
message_to_send = 'fail'
bob.send_classical(sender, message_to_send, await_ack=True)
return key_array
def check_key_sender(alice, key_check_alice, receiver):
key_check_string = ''.join([str(x) for x in key_check_alice])
print(f'Alice\'s key to check is {key_check_string}')
alice.send_classical(receiver, key_check_string, await_ack=True)
message_from_bob = alice.get_next_classical(receiver, wait=-1)
# Bob tells Alice whether the key part is the same at his end.
# If not - it means Eve eavesdropped.
if message_from_bob is not None:
if message_from_bob.content == 'Success':
print('Key is successfully verified')
elif message_from_bob.content == 'Fail':
print('Key has been corrupted')
def check_key_receiver(bob, key_check_bob, sender):
key_check_bob_string = ''.join([str(x) for x in key_check_bob])
print(f'Bob\'s key to check is {key_check_bob_string}')
key_from_alice = bob.get_next_classical(sender, wait=-1)
if key_from_alice is not None:
if key_from_alice.content == key_check_bob_string:
bob.send_classical(sender, 'Success', await_ack=True)
else:
bob.send_classical(sender, 'Fail', await_ack=True)
def alice_func(host, bob_id, length_of_check, key_length):
encryption_key_binary = generate_key(key_length)
sender_qkd(host, encryption_key_binary, bob_id)
print('Sent all the qubits sucessfully!')
key_to_test = encryption_key_binary[0:length_of_check]
check_key_sender(host, key_to_test, bob_id)
def bob_func(host, alice_id, length_of_check, key_length):
secret_key_bob = receiver_qkd(host, key_length, alice_id)
key_to_test = secret_key_bob[0:length_of_check]
check_key_receiver(host, key_to_test, alice_id)
def b92_protocol(eve_interception, key_length, length_of_check):
network, hosts = build_network_b92(eve_interception)
alice = hosts[0]
bob = hosts[1]
bob_id = bob.host_id
alice_id = alice.host_id
thread_1 = alice.run_protocol(alice_func, (bob_id, length_of_check, key_length,))
thread_2 = bob.run_protocol(bob_func, (alice_id, length_of_check, key_length,))
thread_1.join()
thread_2.join()
network.stop(True)
exit()
if __name__ == '__main__':
key_length = 10
length_of_check = round(key_length / 2)
# length of part of the key used to check whether Eve listened
eve_interception = True
# the eavesdropping can be turned on and off
b92_protocol(eve_interception, key_length, length_of_check)
|


Name
HPL_pdpanrlN Right-looking panel factorization.
Synopsis
#include "hpl.h"
void
HPL_pdpanrlN(
HPL_T_panel *
PANEL
,
const int
M
,
const int
N
,
const int
ICOFF
,
double *
WORK
);
Description
HPL_pdpanrlN
factorizes a panel of columns that is a sub-array of a
larger one-dimensional panel A using the Right-looking variant of the
usual one-dimensional algorithm. The lower triangular N0-by-N0 upper
block of the panel is stored in no-transpose form (i.e. just like the
input matrix itself).
Bi-directional exchange is used to perform the swap::broadcast
operations at once for one column in the panel. This results in a
lower number of slightly larger messages than usual. On P processes
and assuming bi-directional links, the running time of this function
can be approximated by (when N is equal to N0):
N0 * log_2( P ) * ( lat + ( 2*N0 + 4 ) / bdwth ) +
N0^2 * ( M - N0/3 ) * gam2-3
where M is the local number of rows of the panel, lat and bdwth are
the latency and bandwidth of the network for double precision real
words, and gam2-3 is an estimate of the Level 2 and Level 3 BLAS
rate of execution. The recursive algorithm allows indeed to almost
achieve Level 3 BLAS performance in the panel factorization. On a
large number of modern machines, this operation is however latency
bound, meaning that its cost can be estimated by only the latency
portion N0 * log_2(P) * lat. Mono-directional links will double this
communication cost.
Note that one iteration of the the main loop is unrolled. The local
computation of the absolute value max of the next column is performed
just after its update by the current column. This allows to bring the
current column only once through cache at each step. The current
implementation does not perform any blocking for this sequence of
BLAS operations, however the design allows for plugging in an optimal
(machine-specific) specialized BLAS-like kernel. This idea has been
suggested to us by Fred Gustavson, IBM T.J. Watson Research Center.
Arguments
PANEL (local input/output) HPL_T_panel *
On entry, PANEL points to the data structure containing the
panel information.
M (local input) const int
On entry, M specifies the local number of rows of sub(A).
N (local input) const int
On entry, N specifies the local number of columns of sub(A).
ICOFF (global input) const int
On entry, ICOFF specifies the row and column offset of sub(A)
in A.
WORK (local workspace) double *
On entry, WORK is a workarray of size at least 2*(4+2*N0).
See Also
HPL_dlocmax,
HPL_dlocswpN,
HPL_dlocswpT,
HPL_pdmxswp,
HPL_pdpancrN,
HPL_pdpancrT,
HPL_pdpanllN,
HPL_pdpanllT,
HPL_pdpanrlT.


Use Cases¶
- Example of use: Titanic’s statistics by gender
- Example of use: Predicting the survival of Titanic passengers
Example of use: Titanic’s statistics by gender¶
The following code is an example of how to use this library for Data Science purposes. In this example, we want to know the number of men, women and children who survived or died in the Titanic crash.
In the first part, we will perform some pre-processing (remove some columns, clean some rows that have missing values, replace some value and filter rows) and after that, aggregate the information for adult women.
For explanatory aspects, the input data (Pandas DataFrame) is distributed by COMPSs in 4 fragments using parallelize(). At this point, the programmer no longer has to worry about partitioning the data. All operations will be able to work transparently to the user. The COMPS tasks will be executed in parallel, one for each fragment.
from ddf_library.ddf import DDF
import pandas as pd
df = pd.read_csv('tests/titanic.csv', sep='\t')
ddf1 = DDF().parallelize(df, num_of_parts=4)\
.select(['Sex', 'Age', 'Survived'])\
.clean_missing(['Sex', 'Age'], mode='REMOVE_ROW')\
.replace({0: 'No', 1: 'Yes'}, subset=['Survived'])
ddf_women = ddf1.filter('(Sex == "female") and (Age >= 18)').\
aggregation(group_by=['Survived'],
exprs={'Survived': ['count']},
aliases={'Survived': ["Women"]})
print ddf_women.show()
The image shows the DAG created by COMPSs during the execution. The operations select(), clean_missing(), replace() and filter() are some of them that are ‘one processing stage’ and then, the library was capable of group into a single COMPSs task (which was named task_bundle). In this DAG, the other tasks are referring to the operation of aggregation(). This operations needs certain exchanges of information, so it performs a synchronization of some indices (light data) for submit the minimum amount of tasks from master node. Finally, the last synchronization is performed by show() function (which is an action) to receives the data produced.
Next, we extend the previous code to computate the result also for men and kids.
from ddf_library.ddf import DDF
import pandas as pd
df = pd.read_csv('tests/titanic.csv', sep='\t')
ddf1 = DDF().parallelize(df, num_of_parts=4)\
.select(['Sex', 'Age', 'Survived'])\
.clean_missing(['Sex', 'Age'], mode='REMOVE_ROW')\
.replace({0: 'No', 1: 'Yes'}, subset=['Survived']).cache()
ddf_women = ddf1.filter('(Sex == "female") and (Age >= 18)').\
aggregation(group_by=['Survived'],
exprs={'Survived': ['count']},
aliases={'Survived': ["Women"]})
ddf_kids = ddf1.filter('Age < 18').\
aggregation(group_by=['Survived'],
exprs={'Survived': ['count']},
aliases={'Survived': ["Kids"]})
ddf_men = ddf1.filter('(Sex == "male") and (Age >= 18)').\
aggregation(group_by=['Survived'],
exprs={'Survived': ['count']},
aliases={'Survived': ["Men"]})
ddf_final = ddf_women\
.join(ddf_men, key1=['Survived'], key2=['Survived'], mode='inner')\
.join(ddf_kids, key1=['Survived'], key2=['Survived'], mode='inner')
print ddf_final.show()
This code will produce following result:
| Survived | Women | Men | Kids |
|---|---|---|---|
| No | 8 | 63 | 14 |
| Yes | 24 | 7 | 10 |
Example of use: Predicting the survival of Titanic passengers¶
In this second challenge, based in this blog-post, we want to predict whether a passenger on the titanic would have been survived or not.
First of all, we need to remove some columns (Passenger id, Cabin number and Ticket number) and remove rows with missing values. After that, we need to convert the Sex column to numeric. Because we know all possible values (male or female), we can use a simple replace function to convert them. Name, Age and Fare columns had their values categorized. And finally, we used a StringIndexer to convert Embarked to convert this column to indexes.
After that, we put together all columns (except Survived, which will be the label) in a feature vector and normalize them using Standardscaler. Finally, we divide this data into one part with 70% and 30%. The first part (70%) is used in the classifier (LogisticRegression) training stage and the others 30% is used to test the fitted model. At end, the model can be evaluated by some binary metrics.
df = pd.read_csv('tests/titanic.csv', sep='\t')
titles = {"Mr": 1, "Miss": 2, "Mrs": 3, "Master": 4, "Rare": 5}
def title_checker(row):
for title in titles:
if title in row['Name']:
return titles[title]
return -1
def age_categorizer(row):
category = 7
if row['Age'] <= 11:
category = 0
elif (row['Age'] > 11) and (row['Age'] <= 18):
category = 1
elif (row['Age'] > 18) and (row['Age'] <= 22):
category = 2
elif (row['Age'] > 22) and (row['Age'] <= 27):
category = 3
elif (row['Age'] > 27) and (row['Age'] <= 33):
category = 4
elif (row['Age'] > 33) and (row['Age'] <= 40):
category = 5
elif (row['Age'] > 40) and (row['Age'] <= 66):
category = 6
return category
def fare_categorizer(row):
category = 5
if row['Fare'] <= 7.91:
category = 0
elif (row['Fare'] > 7.91) and (row['Fare'] <= 14.454):
category = 1
elif (row['Fare'] > 14.454) and (row['Fare'] <= 31):
category = 2
elif (row['Fare'] > 31) and (row['Fare'] <= 99):
category = 3
elif (row['Fare'] > 99) and (row['Fare'] <= 250):
category = 4
return category
features = ['Pclass', 'Sex', 'Age', 'SibSp', 'Parch', 'Fare', 'Embarked']
all_columns = features + ['Survived']
ddf1 = DDF().parallelize(df, num_of_parts=4)\
.drop(['PassengerId', 'Cabin', 'Ticket'])\
.clean_missing(all_columns, mode='REMOVE_ROW')\
.replace({'male': 1, 'female': 0}, subset=['Sex'])\
.map(title_checker, 'Name')\
.map(age_categorizer, 'Age')\
.map(fare_categorizer, 'Fare')
from ddf_library.functions.ml.feature import StringIndexer
ddf1 = StringIndexer(input_col='Embarked',
output_col='Embarked').fit_transform(ddf1)
# assembling a group of attributes as features and removing them after
from ddf_library.functions.ml.feature import VectorAssembler
assembler = VectorAssembler(input_col=features, output_col="features")
ddf1 = assembler.transform(ddf1).drop(features)
# scaling using StandardScaler
from ddf_library.functions.ml.feature import StandardScaler
ddf1 = StandardScaler(input_col='features', output_col='features')\
.fit_transform(ddf1)
# 70% to train the model and 30% to test
ddf_train, ddf_test = ddf1.split(0.7)
print "Number of rows to fit the model:", ddf_train.count()
print "Number of rows to test the model:", ddf_test.count()
from ddf_library.functions.ml.classification import LogisticRegression
logr = LogisticRegression(feature_col='features', label_col='Survived',
max_iters=10, pred_col='out_logr').fit(ddf_train)
ddf_test = logr.transform(ddf_test).select(['Survived', 'out_logr'])
from ddf_library.functions.ml.evaluation import BinaryClassificationMetrics
metrics_bin = BinaryClassificationMetrics(label_col='Survived',
true_label=1.0,
pred_col='out_logr',
data=ddf_test)
print "Metrics:\n", metrics_bin.get_metrics()
print "\nConfusion Matrix:\n", metrics_bin.confusion_matrix
This code will produce following result:
Metrics:
| Metric | Value |
|---|---|
| Accuracy | 0.921053 |
| Precision | 0.785714 |
| Recall | 1.000000 |
| F-measure (F1) | 0.880000 |
Confusion Matrix:
| 0.0 | 1.0 | |
|---|---|---|
| 0.0 | 24 | 0 |
| 1.0 | 3 | 11 |


I gave the closing talk at OpenFest 2016. It was about why and how to contribute to open-source software. I talked about the problem of bringing more contributors to open-source, why people should contribute and how it would benefit them. Gave some tips on how to start contributing and do also do open-source at work.
Video should be available soon.
Lightning talk given on Bulgaria PHP conference 2016 about the path of upgrading from PHP 5 to PHP 7.
Technical talk explaining basic concepts li,e Dependency injection, Dependency inversion principle, dependency injection container and going to service providers and reusing service providers across frameworks.
Some projects for reusing containers and service providers mentioned are PSR11 and container-interop.
Composer is a PHP dependency manager. I've shared some tips and tricks on using it which might be useful for more heavy users or package maintainers at a Bulgaria PHP user group meetup.
I've talked at the Bulgarian Web Summit 2014 about development workflow best practices. The main points in the talk were source control, GitHub Flow, unit tests and continuous integration.
I gave a talk at jQuery Bulgaria 2013 conference called 10 things I learned from the jQuery source. It was of course heavily inspired by the two similarly named screen casts by Paul Irish.
I've tried to find 10 new things in the jQuery source and especially some new things which were added to jQuery after his posts.


--- layout: post title: Episode 020 | Gary Pendergast - Making and Breaking Things, Great Power and Responsibility link: http://traffic.libsyn.com/developeronfire/DeveloperOnFire-20-GaryPendergast.mp3 length: 35651584 speaker: Dave Rael duration: '42:42' subtitle: 'Developer On Fire: Gary Pendergast' guest_name: Gary Pendergast image: /assets/images/GaryPendergast.jpg guest_blog: http://pento.net/ guest_twitter: GaryPendergast disqus_url: http://developeronfire.com/Podcast/Episodes/gary-pendergast-making-and-breaking-things-great-power-and-responsibility episode_number: 20 book_recommendations: - { url: "http://www.amazon.com/dp/1449313892/?tag=devonfir-20", title: "Code Simplicity: The Fundamentals of Software", author: "Max Kanat-Alexander"} - { url: "http://www.amazon.com/dp/1118660633/?tag=devonfir-20", title: "The Year Without Pants: WordPress.com and the Future of Work", author: "Scott Berkun"} tags: - { url: "http://www.amazon.com/dp/1449313892/?tag=devonfir-20", title: "Code Simplicity: The Fundamentals of Software", author: "Max Kanat-Alexander"} - { url: "http://www.amazon.com/dp/1118660633/?tag=devonfir-20", title: "The Year Without Pants: WordPress.com and the Future of Work", author: "Scott Berkun"} redirect_from: - "/20/" - "/020/" - "/0020/" - "/gary-pendergast-making-and-breaking-things-great-power-and-responsibility/" - "/Gary-Pendergast/" - "/GaryPendergast/" - "/Podcast/Episodes/20/" - "/Podcast/Episodes/020/" - "/Podcast/Episodes/0020/" - "/Podcast/Episodes/gary-pendergast-making-and-breaking-things-great-power-and-responsibility/" - "/Podcast/Episodes/Gary-Pendergast/" - "/Podcast/Episodes/GaryPendergast/" guid: http://developeronfire.com:80/Podcast/Episodes/gary-pendergast-making-and-breaking-things-great-power-and-responsibility ---
Gary Pendergast works for Automattic, is a WordPress core contributor, and a member of the WordPress core security team. Gary can most often be found in Melbourne, Australia. He enjoys making things, breaking things and fixing things, which keeps life interesting. In his spare time, he has been known to get excited about quality food, interesting beers, strong coffee and live music.
Resources:
Gary's top 3 tips for delivering more value:
1. Make decisions
2. Exercise your body
3. Eat well


Validate Form
Last Name
First Name
Email
Cellphone Number
(E.g.:<PHONE_NUMBER>)
User
Password
Repeat Password
Address
Gender
Choose...
Male
Female
Other
Age
Home Telephone (E.g.:<PHONE_NUMBER>)
Radios
First radio
Second radio
Third disabled radio
Submit
Test
Clear


{% if site.author.use %}
{{ site.author.name }}
© {{ 'now' | date: "%Y" }} {{ site.author.name }} Powered by Jekyll. Design by William Heng.