| Option | Value | Default | Description |
|---|---|---|---|
target |
String | '' | The targeted list on which to apply the filter to. |
selActive |
String|Boolean | false | A selector for the initially active filter controls. |
animation |
String, Boolean | slide | Animation mode (slide, fade, delayed-fade, false). |
duration |
String|Boolean | 250 | Animation duration in milliseconds. |


Metal 3D Graphics Part 2: Animated Uniform Data with Synchronization
27 Jul 2018. Categories: MetalRecap
In the previous post we setup the necessary basic code to render a multi-colored triangle using Metal. By doing so we learned about the fundamental concepts of the Metal API:
- A MTLDevice represents the actual GPU.
- A MTLRenderPipelineDescriptor / MTLRenderPipelineState describes what the render pipeline consists of. In particular, this is where we specify what vertex and fragment shaders to use. A
MTLRenderPipelineState
is just a compiled version of aMTLRenderPipelineDescriptor
. - A MTLCommandQueue keeps track of many
MTLCommandBuffer
s that are waiting in line to be executed. - A MTLCommandBuffer represents the entire set of information the GPU needs to execute this pipeline: it contains the pipeline info itself, as well as vertex data and drawing commands that will be fed into the pipeline by the GPU.
- A MTLRenderPassDescriptor is used to configure the interface of the pipeline, but not the interior of the pipeline. It is like the 2 openings of the pipe. For example, a
MTLRenderPassDescriptor
contains information such as the destination resolution to render to. This information is included in eachMTLCommandBuffer
. - A MTLRenderCommandEncoder is used to prepare the vertex data and drawing commands that will be fed into the pipeline.
- A MTLBuffer represents a chunk of data which can be accessed by either the CPU and GPU. We used a
MTLBuffer
to create the vertex data on the CPU, and let the GPU access it in the shader code.
We managed to render a triangle, which looks like this:
This post will build on top of the last post by adding what is called uniform data (or just uniforms) to the rendering process. Use your code from the previous post, or feel free to download my code and use it.
What is a uniform, and what is it good for?
Right now we can render a triangle, but the output of the rendering is always identical. Having the rendering output be different each frame is necessary for almost any real-time graphics application: for example, every 3D video game needs to move the camera around. In future posts we will actually look at moving the camera around in a 3D scene, but for now we will settle for something more modest; a triangle that changes brightness overtime:
Let's brainstorm how we could accomplish this effect. We currently have a MTLBuffer
that contains the vertex data for drawing the triangle. Each vertex data contains the position and color. The vertex data we currently have in it is:
| Color | Position |
|---|---|
| (1, 0, 0, 1) | (-1, -1) |
| (0, 1, 0, 1) | (0, 1) |
| (0, 0, 1, 1) | (1, -1) |
Since we are describing the color of each vertex in this buffer, what we could do is modify the color of each vertex during every new frame. For example, during the second frame we could change the vertex buffer data to:
| Color | Position |
|---|---|
| (0.9, 0, 0, 1) | (-1, -1) |
| (0, 0.9, 0, 1) | (0, 1) |
| (0, 0, 0.9, 1) | (1, -1) |
to make the triangle a bit darker, and so on. Now, this strategy can work, but it's a poor way to go about it. Consider what happens if we have a ton of vertices to render complex shapes. To adjust the brightness of the complex shapes we would need to change the color data for all of the vertices using the CPU. The amount of work the CPU has to do grows linearly with the number of vertices, which is bad news when you want to have a complex scene with lots of vertices.
We can instead achieve this effect by modifying our shader code to make it a bit more general. How can we mathematically make a color darker or brighter? Since bright red is (1, 0, 0, 1)
and the darkest red (that is, pure black) is (0, 0, 0, 1)
, we can simply multiply our color by a number between 0 and 1:
\[
\tilde{c} = c \cdot brightness, \;\; brightness \in [0, 1]
\]
For example, if \(c = (1, 0, 0)\), and \(brightness = 0.9\), then the final color output would be the almost fully-bright red \(\tilde{c} = (0.9, 0, 0)\).
Now, this \(brightness\) variable is what we call a uniform. Like vertex data we use it in our shaders to affect the final pixel color, but it is uniform across all the vertices. While there are 3 vertices, each with different position and color data, there is only 1 \(brightness\) value. I like to think of it as a knob on the control panel of our shader: our shader will take in the vertex data and accordingly render a triangle, and the \(brightness\) know provides a way to adjust the brightness of the rendering output. And who is responsible for turning the knob? The CPU is.
Each frame the CPU can update the brightness, a single floating point number, to affect the rendering of the entire triangle. Much more efficient than modifying every vertex's color data!
Adding uniform parameters to the shader code
Enough talk, let's get on with the code! We will start by first adding the code for our brightness uniform to the shaders. In pseduo-Metal-code, we want to write something like this for our fragment shader:
fragment float4 fragmentShader(VertexOut interpolated [[stage_in]])
{
return brightness * interpolated.color;
}
However, this isn't quite right for 2 reasons: the first is obvious, we need to define the variable brightness
. The second reason will be discussed soon. So how do we define brightness
? That is, how does the CPU pass data (the value of brightness
) to the GPU? It works in essentially the same way as vertex data: we use a MTLBuffer
on the CPU side, and a [[buffer(0)]]
on the GPU side, just like the vertex buffer data that is passed to the vertex shader. First, crack open ShaderDefinitions.h
and add the following struct
definition:
struct FragmentUniforms {
float brightness;
};
This is a struct
that will hold all of the uniforms that will be passed to our fragment shader. Right now it only contains one uniform, brightness
. Then we can add it as a buffer parameter to the fragment shader, and use the brightness
member of the struct to do the multiplication:
fragment float4 fragmentShader(VertexOut interpolated [[stage_in]], constant FragmentUniforms &uniforms [[buffer(0)]])
{
return float4(uniforms.brightness * interpolated.color.rgb, interpolated.color.a);
}
While this code isn't entirely foreign looking since it is similar to the vertex buffer parameter, there are some differences to walk through. Most importantly, we declare the buffer parameter to be constant
instead of device
because each pixel that is rendered will access the same memory location of the buffer (just the since brightness
member). We also have the parameter be a reference (&
) instead of a pointer (*
). They are quite similar and both perform the role of referencing a location in memory, but references can't be used to reference an array of structs, just a single struct. We will not have an array of FragmentUniforms
, unlike for the vertex buffer where we did have an array of 3 Vertex
structs. Since we don't have an array here, we are free to use either a pointer or a reference or a pointer.
Finally, the multiplication is a bit more convoluted than just doing uniforms.brightness * interpolated.color
. This is because the colors are in (r, g, b, a)
format, and we want to make the color darker by decreasing r
, g
and b
, but we want to leave a
(the alpha value) alone. So we grab just the rgb
components of the interpolated color, multiply those by uniforms.brightness
, and repack the result into a float4
with the original alpha value.
This is all the shader code we need to write. If we run this now, we get the following crash:
validateFunctionArguments:3332: failed assertion `Fragment Function(fragmentShader): missing buffer binding at index 0 for uniforms[0].'
This is perfect, Metal tells us directly that the fragment shader is expecting a buffer to be bound at index 0, and we didn't do that yet. Let's get to it!
Creating and binding a uniform buffer
Open up Renderer.swift
, and first define a new buffer in the class:
let fragmentUniformsBuffer: MTLBuffer
Now in the initializer we need to setup this buffer. The buffer will contain the data for only one FragmentUniforms
struct, so we don't use an array but just a direct pointer. Add this below the initialization of the vertex data buffer:
// Create our uniform buffer, and fill it with an initial brightness of 1.0
var initialFragmentUniforms = FragmentUniforms(brightness: 1.0)
fragmentUniformsBuffer = device.makeBuffer(bytes: &initialFragmentUniforms, length: MemoryLayout<FragmentUniforms>.stride, options: [])!
It's important to note that initialFragmentUniforms
is just a temporary instance of FragmentUniforms
: we create it and then copy the data of it into the fragmentUniformsBuffer
, but once the initializer finishes, the actual memory of initialFragmentUniforms
will be gone forever.
Side remark about mutability in Swift: we need
initialFragmentUniforms
to be mutable (usevar
instead oflet
) since a pointer of it is passed tomakeBuffer(...)
. Metal could modifyinitialFragmentUniforms
via this pointer, so we have to markinitialFragmentUniforms
as mutable. Of course Metal doesn't do this, it just benignly copies the data somewhere else, but Swift doesn't know that.
Now we need to bind our fragmentUniformsBuffer
to the fragment shader. Just like the vertex data, we perform this binding every frame using the renderEncoder
. Inside draw(in view: MTKView)
we currently have the code:
// What vertex buffer data to use
renderEncoder.setVertexBuffer(vertexBuffer, offset: 0, index: 0)
// And what to draw
renderEncoder.drawPrimitives(type: .triangle, vertexStart: 0, vertexCount: 3)
This is where we bind the vertex buffer to the buffer at index 0 in the vertex shader. We do the same thing, but with the fragment shader and fragment uniforms by adding the following line before the drawPrimitives
call:
// Bind the fragment uniforms
renderEncoder.setFragmentBuffer(fragmentUniformsBuffer, offset: 0, index: 0)
And now, if we run the app, we get a triangle that looks identical to before. It is the same as before since we used an initial brightness of 1.0
. We can quickly test that brightness
actually works by manually changing the initial value from 1.0
to 0.5
, which should give a darker looking triangle:
Once you are done experiment with it, set the initial value back to 1.0
.
Animating the brightness
Keeping track of time
Right now we have uniform data being initialized on the CPU, and passed to the GPU. But what we really want to do is animate the brightness of the triangle, which means we want to modify the brightness uniform on each frame. The first thing we need to do is start keeping track of time, so that we can base the brightness off of the current time. Our strategy is:
- Keep track of our app's time with a variable
currentTime
. - On each frame compute the difference in time between the current frame and the previous frame. To do so we will have to store the system time of the previous frame in a variable
lastRenderTime
. - Use the time difference to update
currentTime
.
We start by adding these instance variables to the Renderer
class:
// This keeps track of the system time of the last render
var lastRenderTime: CFTimeInterval? = nil
// This is the current time in our app, starting at 0, in units of seconds
var currentTime: Double = 0
Now at the top of draw(in view: MTKView)
we compute the time difference, save the system time to lastRenderTime
, and then use the time difference to update the state:
// Compute dt
let systemTime = CACurrentMediaTime()
let timeDifference = (lastRenderTime == nil) ? 0 : (systemTime - lastRenderTime!)
// Save this system time
lastRenderTime = systemTime
// Update state
update(dt: timeDifference) // TODO: We need to implement this function!
Updating state
Now we just need to implement this update
function to update the currentTime
, and change the brightness:
func update(dt: CFTimeInterval) {
let ptr = fragmentUniformsBuffer.contents().bindMemory(to: FragmentUniforms.self, capacity: 1)
ptr.pointee.brightness = Float(0.5 * cos(currentTime) + 0.5)
currentTime += dt
}
First, we access the memory location of the uniform buffer via .contents()
, and then tell Swift to interpret the memory location as a pointer to a FragmentUniforms
struct (which it is). Then, we write to the brightness
field, setting the brightness to be a cosine wave based on the current time. Using a cosine wave makes the brightness start at 1, and then smoothly animate between 1 and 0:
Finally, we update the currentTime
by adding the time difference. If you run this code now, you should see exactly what we were hoping for, a triangle with smoothly animating brightness:
Synchronizing the CPU and GPU
Unfortunately, the code we currently have is subtly bugged. The output looks fine, but there is actually a race condition that may or may not manifest itself in the future. It's actually an easy fix, but we need to understand what is happening in terms of CPU and GPU coordination.
Each time draw(in view: MTKView)
is called (60 times per second), we use the CPU to update the uniform data, and then tell the GPU to go and render using that uniform data asynchronously. Let's lay the rendering of the first 3 frames in a timeline:
This is fine, and there are not really any problems with this. But what happens if our rendering starts to take too long? Something like this:
In the red highlighted areas, there is a big problem. The GPU is reading from the uniforms buffer while the CPU is simultaneously writing to it (remember, they both share the same physical memory). What exactly will happen here is anyone's guess: it could crash (though this would be far too forgiving), subtly introduce incorrectly rendered pixels, or have no visible effect. It's hard to predict, and hard to track down later. Ignoring this bug that isn't immediately affecting us is the embodiment of this meme:
(Image credit: KC Green, The Nib). The solution is to synchronize the CPU and GPU. What we want to ensure is that the writing to the uniforms buffer by the CPU can not overlap with the GPU's rendering. We accomplish this by using a semaphore. Let's code it really fast, and then explain how the code works. Add this instance variable to the Renderer
class:
let gpuLock = DispatchSemaphore(value: 1)
This creates the semaphore we will use. Then at the very top of draw(in view: MTKView)
add:
gpuLock.wait()
Finally, just before commandBuffer.commit()
, add:
commandBuffer.addCompletedHandler { _ in
self.gpuLock.signal()
}
That's all the code we need to add. Let's walk through how this exactly works. We first initialize the semaphore with a value of 1
. Then, when we call wait
one of two things happen:
- If the semaphore value is greater than 0, it is decremented by 1, and execution continues.
- If the semaphore value is 0, then the CPU waits until the value is greater than 0, after which it will decrement it and continue executing.
So when draw(in view: MTKView)
is called the first time, the value is 1, so wait
changes the value to 0 and moves on. We then update uniforms and encode the drawing. Before the GPU starts drawing (commandBuffer.commit()
), we add a completion handler that will call signal
when the GPU is done drawing. All signal
does is increment the semaphore's value by 1.
This means that the next time draw(in view: MTKView)
is called the CPU will wait to start modifying the uniforms until the previous rendering is complete, which ensures that we do not read and write to the uniforms simultaneously.
The problem of enforcing synchronization between the CPU and GPU is not unique to uniform data: anytime that one of them is reading and the other one is writing (or they are both writing), then you must enforce synchronization. This is almost always the case with uniform data, but is not necessarily the case with vertex data. As always, the complete source code is available for download.
Challenges
- We are currently computing the
brightness
usingcos()
on the CPU, and passing this to the GPU. Instead, try to pass thecurrentTime
to the GPU, and compute thebrightness
on the GPU. - I wrote this post as passing the
brightness
uniform to the fragment shader. But we can accomplish the exact same thing by passing thebrightness
uniform to the vertex shader instead, and in the vertex shader modify the vertex colors before interpolation. Implement it this way instead. - In challenge #2 you achieved the exact same effect by modifying the vertex colors in the vertex shader instead of the fragment shader. Will this always be the case? As an example, try taking the
sqrt()
of each RGB color component in the vertex shader and compare to doing it in the fragment shader. Are they identical? - Use a time uniform to cause the triangle to grow and shrink. (Hint: what happens if you multiply the vertex positions by a number less than 1 or greater than 1?)


{% extends "main/general.html" %} {% block main %}
Your privacy is important to us. It is SetNow's policy to respect your privacy regarding any information we may collect from you across our website, setnow.herokuapp.com, and other sites we own and operate.
We only ask for personal information when we truly need it to provide a service to you. We collect it by fair and lawful means, with your knowledge and consent. We also let you know why we’re collecting it and how it will be used.
We only retain collected information for as long as necessary to provide you with your requested service. What data we store, we’ll protect within commercially acceptable means to prevent loss and theft, as well as unauthorized access, disclosure, copying, use or modification.
We don’t share any personally identifying information publicly or with third-parties, except when required to by law.
Our website may link to external sites that are not operated by us. Please be aware that we have no control over the content and practices of these sites, and cannot accept responsibility or liability for their respective privacy policies.
You are free to refuse our request for your personal information, with the understanding that we may be unable to provide you with some of your desired services.
Your continued use of our website will be regarded as acceptance of our practices around privacy and personal information. If you have any questions about how we handle user data and personal information, feel free to contact us.
This policy is effective as of 9 April 2020.


Perlin received its first release today.
In version 0.1 boolean retrieval including phrase queries, filters and persistence on disk, is supported.
The motivation of this release is not to provide usefull functionality but mainly to get feedback on usage and clearness of the library.
There are still some issues to be resolved for perlin to be a good information retrieval library for boolean retrieval.
These issues are:
- Indexing is incredibly slow
- Loading indices from corrupted data does not yield good or useful errors
- Data in RAM is not compressed
- Indices are non mutable. Once they are create documents can not be added or removed
They will be resolved with perlin 0.2.


Viscountess Weymouth: Why I can't stop thinking about my last Strictly dance
Viscountess Weymouth says she is still reliving her last Strictly dance.
She and her pro partner Aljaz Skorjanec were booted off Strictly Come Dancing following a dance-off with Mike Bushell and Katya Jones.
The Viscountess, 33, told the Daily Mail: “I’m very hard on myself so I keep reliving every moment of that last dance.
“I torture myself about every step, every mistake. I did Strictly with my whole heart, my whole soul. I genuinely put everything into it.”
The judges sparked some criticism for saving BBC sports presenter Bushell from the axe for a third time in the dance-off.
But the Viscountess said: “You have to respect the judges’ decision. I can’t change it. I gave it my best shot.”
She added: “I haven’t lost my marbles but I’m going to miss it massively. I’ll miss Aljaz. He was such an incredible teacher. I didn’t want to let him down.
“I wish I had one more chance. I really do.”


*** User 2017-04-20 14:13:30.532 ***
14:13:30.532 [info] Disabling blocking sync...
*** User 2017-04-20 14:13:30.535 ***
14:13:30.535 [info] Configured peer_service_manager partisan_default_peer_service_manager on node 'node-1@antoine-PC'
*** User 2017-04-20 14:13:31.877 ***
14:13:31.876 [info] Enabling membership...
*** User 2017-04-20 14:13:31.878 ***
14:13:31.877 [info] Disabling blocking sync...
*** User 2017-04-20 14:13:31.881 ***
14:13:31.881 [info] Configured peer_service_manager partisan_default_peer_service_manager on node 'node-2@antoine-PC'
*** User 2017-04-20 14:13:33.213 ***
14:13:33.213 [info] Enabling membership...
*** User 2017-04-20 14:13:33.214 ***
14:13:33.214 [info] Disabling blocking sync...
*** User 2017-04-20 14:13:33.217 ***
14:13:33.217 [info] Configured peer_service_manager partisan_default_peer_service_manager on node 'node-3@antoine-PC'
*** User 2017-04-20 14:13:33.395 ***
Joining node: 'node-3@antoine-PC' to 'runner@antoine-PC' at port 57698
*** User 2017-04-20 14:13:33.395 ***
Joining issued: 'node-3@antoine-PC' to 'runner@antoine-PC' at port 57698
*** User 2017-04-20 14:13:33.395 ***
Joining node: 'node-2@antoine-PC' to 'runner@antoine-PC' at port 48307
*** User 2017-04-20 14:13:33.395 ***
Joining issued: 'node-2@antoine-PC' to 'runner@antoine-PC' at port 48307
*** User 2017-04-20 14:13:33.397 ***
Joining node: 'node-1@antoine-PC' to 'runner@antoine-PC' at port 51724
*** User 2017-04-20 14:13:33.397 ***
Joining issued: 'node-1@antoine-PC' to 'runner@antoine-PC' at port 51724
*** User 2017-04-20 14:13:33.458 ***
Waiting for join to complete with manager: partisan_default_peer_service_manager
*** User 2017-04-20 14:13:33.459 ***
Finished.
*** CT 2017-04-20 14:13:33.459 *** COVER INFO
Adding nodes to cover test: ['runner@antoine-PC']
*** CT 2017-04-20 14:13:33.464 *** COVER INFO
Successfully added nodes to cover test: []
*** User 2017-04-20 14:13:33.464 ***
Case finished: sql_join_uncontracted_latency_test
*** User 2017-04-20 14:13:40.496 ***
14:13:40.496 [info] Application lasp exited with reason: stopped
*** User 2017-04-20 14:13:40.497 ***
14:13:40.497 [info] Application partisan exited with reason: stopped
=== Ended at 2017-04-20 14:13:40
=== successfully completed test case
=== Returned value: ok
Test run history
| Top level test index


Loading...
Speed in km/h
0
CO
2
in kg/h
0
CO2 Emissions
Current:
Average:
Consumption
Current:
Average:
Speed
CO2
Consumption


Jean Mejias
Front-end developer
Designed by Jannoon028 / Freepik
Featured work
Animal_trading_card
Pixel Art Maker
New project soon


The go-nude nudity detection libray takes a jpeg, gif or png image and determines if it contains nudity. Try it below by uploading a thumbnail image, which will be processed in your browser. For example save the small Rubens nude on the right to your disk and then choose it.
The library has been translated from Go into Haxe using TARDIS Go. The Haxe compiler then translated this program to call the library, and the generated library itself, into JS to enable it to run in this page. The translation process is immature and the detection algorithm complex, so small images work best. Finally, be aware that the library does not always give the result you might expect!


Question 1: Explain why is it important to have GPUs and large labeled data sets in order to train CNNs [2]
Because training of CNN involves large amount of matrix calculations, so GPUs’ high calculating speed is important. Large labeled data sets are used to adjust the parameters in the fully connected layers in the network. If only small amount of data is provided, the CNN may not be able to be adjusted to the optimal state.
Question 2: CNNs are usually preferential to MLPs because of their capability of down sampling and its shift-invariant property. Explain briefly how down sampling and the shift-invariant property are achieved in CNN. [4]
Down sampling happens in the polling step. For example, when doing image recognition, only the maximum unit in a 3*3 block is taken. This decrease the size of sample data. The convolution steps extract the features in the data. For example, a convolution kernel may be used to outline the contour of objects, identifying the target wherever it is.
Question 3
- Outline the role of the nearest neighbor algorithm for self-driving cars. [2]
It is a greedy algorithm that can be used to try to find the shortest route from the cars’ position to its destination.
(b) Explain one limitation of the nearest neighbor algorithm [2]
The TSP problem is a NP-hard problem, so this algorithm cannot guarantee finding the shortest route.
Discussions


EAT DRINK MAN WOMAN A film review by James Berardinelli Copyright 1994 James Berardinelli
Rating (0 to 10): 8.9
Date Released: 8/94 (varies) Running Length: 2:04 Rated: No MPAA Rating (Mature themes)
Starring: Sihung Lung, Kuei-Mei-Yang, Chien-Lien Wu, Yu-Wen Wang, Winston Chao, Chao-Jung Chen Director: Ang Lee Producer: Li-Kong Hsu Screenplay: Ang Lee, James Schamus, and Hui-Ling Wang Cinematography: Jong Lin Music: Mader Released by The Samuel Goldwyn Company In Cantonese with subtitles
"Everything is much different in EAT DRINK MAN WOMAN than the other films I've made. It has a bigger cast and a lot more complex story line... I started thinking about families and how they communicate. Sometimes the things children need to hear most are often the things that parents find hardest to say, and vice versa. When that happens, we resort to ritual. For the Chu family, the ritual is the Sunday dinner... At each dinner the family comes together and then something happens that pushes them farther apart." - Ang Lee, writer/director of EAT DRINK MAN WOMAN
Who said foreign films can't be fun?  The oldest, Jia-Jen (Kuei-Mei-Yang), is an unmarried school teacher in her late twenties. The middle daughter, Jia-Chen (Chien-Lien Wu), is a thriving corporate airline executive whose career comes before all else. The youngest, Jia-Ning (Yu-Wen Wang), is a twenty year old romantic who works at a Wendy's fast food joint.
EAT DRINK MAN WOMAN is a more accomplished motion picture than its predecessor--and THE WEDDING BANQUET was good enough in its own right. The comedy is spontaneous and relaxed, the drama is finely-tuned, and the plot is seasoned with unexpected little twists. The script delights in occasional forays just beyond the typical bounds of a screenplay.
Though filmed entirely in Taiwan (Lee's first film not to examine cross-cultural issues), the themes of EAT DRINK MAN WOMAN are universal. The problems faced by the Chu family happen all around the world, and the difficulty of communicating across the generation gap is something almost everyone has experienced at one time or another. Love, especially that of Chu for his daughters, often goes unspoken, for to express emotion is to admit vulnerability.
With an ease that marks the true craftsman, Ang Lee develops a rapport between his characters and the audience. These people have a richness, texture, and depth that no stereotype could hope to match, and which a film like Wayne Wang's THE JOY LUCK CLUB was grasping for. The perfectly-proportioned measures of comedy and drama emerge through character interaction, not as a result of contrived situations and silly one-liners.
For his cast, Lee has chosen a mixture of actors he has and has not previously worked with. The role of Chu was written with veteran performer Sihung Lung in mind. The actor appeared in a similar patriarchal capacity in the director's PUSHING HANDS and THE WEDDING BANQUET. Also returning from THE WEDDING BANQUET are Winston Chao (the reluctant bridegroom then and a co-worker of Jia-Chen's now) and Ah-Leh Gua (the mother then and the obnoxious Mrs. Liang now).
Food is as much a backdrop as a recurring symbol. Chu's failing taste buds parallel his loss for the zest for life. Jia-Chen's love of cooking harkens back to a frustrated childhood desire, and Jia-Ning's work at a Wendy's makes a statement about the infusion of Western culture into modern-day China. Nevertheless, as with THE AGE OF INNOCENCE, which displayed countless dishes guaranteed to whet the appetite, EAT DRINK MAN WOMAN could perhaps be frustrating to any who view it on an empty stomach.
EAT DRINK MAN WOMAN is basted in its own wonderfully seasoned juices. Chu may have lost his taste, but writer/director Ang Lee has definitely not. A treat for those not scared off by subtitles, this movie provides one of the year's most sincere views of family dynamics. Dealing with subjects that could easily have emerged half-baked, Lee instead applies his talent and comes up with something cooked to perfection.
- 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


{% extends '_base.html' %} {% block title %}Not Found{% endblock %} {% block content %} 404 Not Found The page or resource you're trying to find doesn't exist. {% endblock %}


The Failure of Border Enforcement
- 1986-2008 growth
- Undocumented population; 4x
- Border Patrol size: 5x
- Border Patrol hours: 4x
- Border Patrol nominal funding: 20x
From Massey & Pren (2012)
Enforcement Rational
- Neoclassical model
- Increase costs of migrating
Flaws in the rational
- New economics and social capital theory are better fit
- Long history of Mexico-US migration -- high social capital formation
- Persistent labor demand in US
- High wage differences
- Market failures in Mexico
- Long land border
Explaining U.S. Enforcement Policy
Outcomes
- End of circular migration
- Shifts in crossing points
- Strengthening of smuggler organizations
- Political feedback loop
From Massey & Pren (2012)
From Massey & Pren (2012)
From Massey & Pren (2012)


Sit back and relax. Get a freelance designer who takes design to new heights.
Get a designer with proven experience to meet your needs with personalized service and someone who delivers from initial concepts through fulfillment and everything in between.
I have access to a network of industry professionals: photographers, copywriters, web designers and printers with the flexibility and talent to meet your needs. Working together with me to produce creative that delivers on time and
within a budget.
So relax... get a hobby.


This is a project done at HackRVA every year for the RVA Security Conference(RVASec), where a group of us lead by Paul and Morgan build 350 little embedded boards for RVASec. I contribute to the PCB manufacturing, software development, and assembly(SMD placing and hand soldering) of the boards.


| Number of Classes | Line Coverage | Mutation Coverage |
|---|---|---|
| 9 | 89% | 82% |
| Name | Line Coverage | Mutation Coverage |
|---|---|---|
| Analyzer.java | 67% |
100% |
| Matcher.java | 99% |
87% |
| MatcherAction.java | 94% |
71% |
| MatcherExtractAction.java | 92% |
95% |
| MatcherRequireAction.java | 81% |
100% |
| MatchesList.java | 78% |
80% |
| NumberRangeList.java | 100% |
100% |
| NumberRangeVisitor.java | 43% |
83% |
| WordRangeVisitor.java | 81% |
87% |


Logout
Users you have access to
{{ identity.first_name }} {{ identity.middle_name }} {{ identity.last_name }} {{ identity.birthdate }}
Checklists
Status right now
Is permanently housed? {{ status.is_permanently_housed }}
Where right now? {{ status.where_right_now }}
Where staying tonight? {{ status.where_staying_tonight }}
Americans with Disabilities Act alerts
Safety alert
{{ safety_alert }}
Baseline behavior (what's normal this person)
Stakeholders
Appointments
| Datetime | What | Where | Categories | With who? | When | How get there | Why? | Discussion | Is it required | Is approved? | Did go? |
Needs
| Needed by | Written by | Seconded by | Tags | Need | Summary notes | Subtasks | Discussion | Read by |
{% for need in needs %}
| {{ need.needed_by }} | {{ need.written_by }} | {{ need.seconded_by }} | {{ need.tags }} | {{ need.need }} | {{ need.notes }} | {{ need.subtasks }} | {{ need.discussion }} | {{ need.read_by }} |
{% endfor %}
Event timeline
| Start time | Stop time | Good/bad/netural | Summary | Debrief |
HIPAA release of information forms


myHaum Sketch Map
The second product of myHaum used to control light. See the main product.
Relay module
Controls high voltage devices
NodeMCU Unit
Main controller and link to the Internet of Things
Switch
Manually operated for controlling the light
Relay module
Link between the controller and the switch
A Relay is an electrically operated switch. Many relays use an electromagnet to mechanically operate the switch and provide electrical isolation between two circuits.
NodeMCU Unit
Single-board microcontroller
NodeMCU is an open source IoT platform. It includes firmware which runs on the ESP8266 Wi-Fi SoC from Espressif Systems, and hardware which is based on the ESP-12 module.
Switch
ON/OFF depending on your call
In electrical engineering, a switch is an electrical component that can "make" or "break" an electrical circuit, interrupting the current or diverting it from one conductor to another.


NHS dental treatment and NHS wigs and fabric supports
NHS dental treatment - for each course of treatment you will be asked to pay whichever is less:
On the form your dentist asks you to sign, write the number of this certificate and the amount from your certificate.
Dental examinations are free to all in Scotland.
NHS wigs and fabric supports - for each wig or fabric support the most you have to pay is the amount the amount on your certificate. The amount you have to pay could be lower than the cost of the wig or fabric support if the NHS charge is less - the person fitting the wig or fabric support can tell you how much this is.
NHS wigs and fabric supports are free where prescribed and dispensed in Scotland.


Whoops, no page to be displayed here. Since there is only one page on this site,you probably want to checkout the app.


{% extends path+"/layout.html" %} {% block backlink %} Back {% endblock %} {% block leftcol %}
This page will only appear when Secure Data Exchange (SDEX) or Document Repository System (DRS) are unavailable for more than 24 hours. When either of these is unavailable users can still submit a fit note using this service but benefit processing staff won't be able to process it until SDEX/DRS are available again.
This might cause a delay to payment depending on how long SDEX or DRS are down. If a user needs an urgent payment in these circumstances they should call the Get help number. They might advised to take their fit note to a jobcentre to arrange an urgent payment.
Alternative content {% endblock %}


Cult of the Mundane
About
Archives
Tags
Playing with github’s page feature. Site theme taken from
blueface
on GitHub
Find me on
github


| Viewed traffic | Not viewed traffic | |||||||
| Statistics for | Unique visitors | Number of visits | Pages | Hits | Bandwidth | Pages | Hits | Bandwidth |
| sample-site.com | 1,899 | 2,511 | 10,893 | 53,007 | 1.44 GB | 14,028 | 25,583 | 790.61 MB |
| sample-site.com-http | 0 | 0 | 0 | 0 | 0 Bytes | 11,060 | 29,363 | 15.39 MB |
| Total | 1,899 | 2,511 | 10,893 | 53,007 | 1.44 GB | 25,088 | 54,946 | 806.00 MB |


An expert Node.js developer and a Scrum master, Deepak is proficient in many technologies including OO Javascript, J2SE, Spring and has strong knowledge in different frontend scripting technologies. He played a major role in developing frontend and backend for various CMS projects. He is very much fun loving and likes to watch movies on the couch and play cricket, no matter how sunny it is.
Written by Deepak Vishwakarma.


Uart Serial for SAM. More...
#include "compiler.h"
#include "sysclk.h"
#include "uart.h"
#include "usart.h"
#include "conf_uart_serial.h"
Go to the source code of this file.
Classes | |
| struct | uart_rs232_options |
| Input parameters when initializing RS232 and similar modes. More... | |
Typedefs | |
| typedef struct uart_rs232_options | usart_rs232_options_t |
| Input parameters when initializing RS232 and similar modes. More... | |
| typedef usart_rs232_options_t | usart_serial_options_t |
| typedef Usart * | usart_if |
| This type can be used independently to refer to USART module for the architecture used. More... | |
Functions | |
| static void | usart_serial_init (usart_if p_usart, usart_serial_options_t *opt) |
| Initializes the Usart in master mode. More... | |
| static int | usart_serial_putchar (usart_if p_usart, const uint8_t c) |
| Sends a character with the USART. More... | |
| static void | usart_serial_getchar (usart_if p_usart, uint8_t *data) |
| Waits until a character is received, and returns it. More... | |
| static uint32_t | usart_serial_is_rx_ready (usart_if p_usart) |
| Check if Received data is ready. More... | |
| status_code_t | usart_serial_write_packet (usart_if usart, const uint8_t *data, size_t len) |
| Send a sequence of bytes to a USART device. More... | |
| status_code_t | usart_serial_read_packet (usart_if usart, uint8_t *data, size_t len) |
| Receive a sequence of bytes to a USART device. More... | |
Uart Serial for SAM.
Copyright (c) 2011-2015 Atmel Corporation. All rights reserved.
This type can be used independently to refer to USART module for the architecture used.
It refers to the correct type definition for the architecture, ie. USART_t* for XMEGA or avr32_usart_t* for UC3.
| typedef struct uart_rs232_options usart_rs232_options_t |
Input parameters when initializing RS232 and similar modes.
|
inlinestatic |
Waits until a character is received, and returns it.
| p_usart | Base address of the USART instance. |
| data | Data to read |
|
inlinestatic |
Initializes the Usart in master mode.
| p_usart | Base address of the USART instance. |
| opt | Options needed to set up RS232 communication (see usart_options_t). |
|
inlinestatic |
Check if Received data is ready.
| p_usart | Base address of the USART instance. |
| 1 | One data has been received. |
| 0 | No data has been received. |
|
inlinestatic |
Sends a character with the USART.
| p_usart | Base address of the USART instance. |
| c | Character to write. |
| 1 | The character was written. |
| 0 | The function timed out before the USART transmitter became ready to send. |
| status_code_t usart_serial_read_packet | ( | usart_if | usart, |
| uint8_t * | data, | ||
| size_t | len | ||
| ) |
Receive a sequence of bytes to a USART device.
| usart | Base address of the USART instance. |
| data | data buffer to write |
| len | Length of data |
Receive a sequence of bytes to a USART device.
| usart | Base address of the USART instance. |
| data | Data buffer to write |
| len | Length of data |
| status_code_t usart_serial_write_packet | ( | usart_if | usart, |
| const uint8_t * | data, | ||
| size_t | len | ||
| ) |
Send a sequence of bytes to a USART device.
| usart | Base address of the USART instance. |
| data | data buffer to write |
| len | Length of data |
Send a sequence of bytes to a USART device.
| usart | Base address of the USART instance. |
| data | Data buffer to read |
| len | Length of data |


| Nature of Business | Manufacturer | |
|---|---|---|
| Additional Business | Wholesaler, Retailers and Ecommerce | |
| Founders | Priya Bajpai and Sameer Ahmed Attar |
|
| Registered Address | Karnataka, India | |
| Industry | Manufacturing and Trading of Ladies Kurti, Embroidery Kurti, long Kurti, Printed Kurti and Stand Collar Kurti. | |
| Year of Establishment | 2017 | |
| Legal Status of Firm | Pvt Ltd |
Region: South India
Email Id<EMAIL_ADDRESS>Phone Number:<PHONE_NUMBER>
Region – North India
Email Id -<EMAIL_ADDRESS>Phone Number:<PHONE_NUMBER>,<PHONE_NUMBER>
Ready to start your business with us? That's great! Give us a call or send us an email and we will get back to you as soon as possible!
+91-9886860063
+91-8826210547


We use Spotify's secure login to connect to your account. We never see your email or password, nor do we care to. We just want to find you some good music.


| fingerprint {openssl} | R Documentation |
Calculates the OpenSSH fingerprint of a public key. This value should match what you get to see when connecting with SSH to a server. Note that some other systems might use a different algorithm to derive a (different) fingerprint for the same keypair.
fingerprint(key, hashfun = md5)
key |
a public or private key |
hashfun |
which hash function to use to calculate the fingerprint |
mykey <- rsa_keygen() pubkey <- as.list(mykey)$pubkey fingerprint(mykey) fingerprint(pubkey) # Some systems use other hash functions fingerprint(pubkey, sha1) fingerprint(pubkey, sha256) # Other key types fingerprint(dsa_keygen())


OpenUI5 Latest Version is a community run API, serving the urls of the latest available versions from Github.
Documentation for the API is available on Github.
This service has no affiliation to SAP AG or the OpenUI5 team.


Accomomdation
"Martignilas Holiday Home" offers its guests 4/7 beds.
The building is 100 square meters arranged on two levels:
- ground floor: kitchen with wood-burning stove, living room with fireplace, small bathroom;
- upstairs, a bedroom with double bed and a bunk bed, a bedroom with a bunk bed, bathroom with shower, terrace.
Outside there are tables and garden chairs, sunbeds, shower with water heated by the sun, a barbecue.
Prices
Prices per person for a single night, depending on the season:
- April - May - September - October (1 to 4 persons) € 80
- June (minimum 1 to 4 people) € 90
- July (minimum 1 to 4 people) € 100
- August (minimum 1 to 4 people) € 110
- € 20, each additional person over 4
- € 30, for final cleaning
- minimum stay 2 nights
The price includes: satellite TV, crockery, washing machine, gas cooker, electric oven, sheets, towels, blankets, garden furniture. Utilities.


reflection 11 View all BTI Goes International Dev Bootcamp: The Final Weeks Dev Bootcamp: Phase 3, Week 1 Dev Bootcamp: Phase 2, Week 3 Dev Bootcamp: Phase 2, Week 2 Dev Bootcamp: Phase 2, Week 1 Dev Bootcamp: Phase 1, Week 3 Dev Bootcamp: Phase 1, Week 2 Dev Bootcamp: Phase 1, Week 1 Questions Fighting the Good Fight devbootcamp 10 View all Dev Bootcamp: The Final Weeks Dev Bootcamp: Phase 3, Week 1 Dev Bootcamp: Phase 2, Week 3 Dev Bootcamp: Phase 2, Week 2 Dev Bootcamp: Phase 2, Week 1 Dev Bootcamp: Phase 1, Week 3 Dev Bootcamp: Phase 1, Week 2 Dev Bootcamp: Phase 1, Week 1 Stereotype Threat Yoga & Devbootcamp ruby 5 View all Ruby vs. Javascript Ruby Building Blocks Lets Get Classy Method: Map Hash-tastic classes 2 View all Ruby Building Blocks Lets Get Classy culture 2 View all Questions Stereotype Threat stereotypes 2 View all Fighting the Good Fight Stereotype Threat alias 1 View all Method: Map array 1 View all Hash-tastic awareness 1 View all Conflicts + Emotional Awareness basics 1 View all How the Internet Works bti360 1 View all BTI Goes International conflict 1 View all Conflicts + Emotional Awareness css 1 View all CSS Madness destructive 1 View all Method: Map git 1 View all Git vs. Github github 1 View all Git vs. Github gregorc 1 View all Thinking About Thinking hash 1 View all Hash-tastic health 1 View all Sitting is Bad for You internet 1 View all How the Internet Works interpersonal 1 View all Conflicts + Emotional Awareness javascript 1 View all Ruby vs. Javascript lifestyle 1 View all Sitting is Bad for You map 1 View all Method: Map module 1 View all Method: Map modules 1 View all Ruby Building Blocks networking 1 View all How the Internet Works nondestructive 1 View all Method: Map questions 1 View all Questions sedentary 1 View all Sitting is Bad for You simple 1 View all Lets Get Classy sitting 1 View all Sitting is Bad for You travel 1 View all BTI Goes International values 1 View all Fighting the Good Fight yoga 1 View all Yoga & Devbootcamp


Utilitary methods for html forms and related interactions.
Automaticaly jump the focus to the next field once the maxlength has been reached.
selector
selector
String|jQueryObject|DOMElement
Selector of text-based form elements.
kafe.form.autofocusOnNext('.first-name, .last-name, .email');
$('.first-name, .last-name, .email').kafe('form.autofocusOnNext');
Adds a simulated maxlength support for textarea elements.
selector
max
block = false
callback
selector
String|jQueryObject|DOMElement
Selector of text-based form elements.
max
Integer
Maximum number of characters.
[block = false]
Boolean
Optional
Prevent further character entry once the limit is reached.
[callback]
Function
Optional
Callback triggered when the character limit is reached. The current number of characters is provided as the first argument of the callback.
kafe.form.maxLength('.twitter-post', 140, false, function(count) {
console.log(count);
});
$('.twitter-post').kafe('form.maxLength', 140, false, function(count) {
console.log(count);
});
Detects the RETURN key, then triggers a callback.
selector
callback
selector
String|jQueryObject|DOMElement
Selector of text-based form elements.
callback
Function
Function to be fired by the keypress.
kafe.form.onEnter('.search-field', function(input) {
$(input).parents('form').submit();
});
$('.search-field').kafe('form.onEnter', function(input) {
$(input).parents('form').submit();
});
Calculates the password strength value of given fields.
selector
callback
selector
String|jQueryObject|DOMElement
Selector of text-based form elements.
[callback]
Function
Optional
Callback triggered when the value is changed. The calculated strengh value is provided as the first argument of the callback.
kafe.form.passwordStrength('.password', function(strengh) {
console.log(strengh);
});
$('.password').kafe('form.passwordStrength', function(strengh) {
console.log(strengh);
});
Adds support for the placeholder attribute for older browsers (Older than IE10). If applied, a "Placeholder" class will also be present when the placeholder text is shown.
selector
[selector]
String
Optional
Selector of text-based form elements. Defaults to 'input[placeholder], textarea[placeholder]' when left undefined.
kafe.form.placeholder('.search-field');
$('.search-field').kafe('form.placeholder');
Replace elements with a submit button
selector = 'input:submit'
[selector = 'input:submit']
String|jQueryObject|DOMElement
Optional
Elements to replace
kafe.form.replaceSubmit();
$('.Search input:submit').kafe('form.replaceSubmit');
Sanitize form text entry for .NET validator.
selector
selector
String|jQueryObject|DOMElement
Reference to the current .NET form.
kafe.form.sanitizeFormData('#Form1');
$('#Form1').form('form.sanitizeFormData');
Adds support for a pseudo-placeholder attribute for select elements. If applied, a "Placeholder" class will also be present when the placeholder text is shown.
kafe.form.selectPlaceholder();


{% extends "header.html" %} {% block body %}
Now that we've got movement, and boundaries, we need some way of informing our gamer that they 'dun goofed. Just simply exiting the game is rather harsh on our player. Instead, what we want to do is have some sort of "game over" screen. To do this, we need to show some text to the screen.
Our new code is as follows:
import pygame import time pygame.init() display_width = 800 display_height = 600 black = (0,0,0) white = (255,255,255) red = (255,0,0) car_width = 73 gameDisplay = pygame.display.set_mode((display_width,display_height)) pygame.display.set_caption('A bit Racey') clock = pygame.time.Clock() carImg = pygame.image.load('racecar.png') def car(x,y): gameDisplay.blit(carImg,(x,y)) def text_objects(text, font): textSurface = font.render(text, True, black) return textSurface, textSurface.get_rect() def message_display(text): largeText = pygame.font.Font('freesansbold.ttf',115) TextSurf, TextRect = text_objects(text, largeText) TextRect.center = ((display_width/2),(display_height/2)) gameDisplay.blit(TextSurf, TextRect) pygame.display.update() time.sleep(2) game_loop() def crash(): message_display('You Crashed') def game_loop(): x = (display_width * 0.45) y = (display_height * 0.8) x_change = 0 gameExit = False while not gameExit: for event in pygame.event.get(): if event.type == pygame.QUIT: pygame.quit() quit() if event.type == pygame.KEYDOWN: if event.key == pygame.K_LEFT: x_change = -5 if event.key == pygame.K_RIGHT: x_change = 5 if event.type == pygame.KEYUP: if event.key == pygame.K_LEFT or event.key == pygame.K_RIGHT: x_change = 0 x += x_change gameDisplay.fill(white) car(x,y) if x > display_width - car_width or x < 0: crash() pygame.display.update() clock.tick(60) game_loop() pygame.quit() quit()
So the major changes are some new functions, but they all boil down to this line from our main loop:
if x > display_width - car_width or x < 0: crash()
We want to be able to have some sort of handling specific to our users crashing rather than just lumping it in with an exit. So, we know we want to be able to do a crash, so we just need to make a crash function.
So, then we consider what would be the most ideal situation for us to create a crash:
def crash(): message_display('You Crashed')
Since we might want to make a crash more elaborate in the future, we make a specific function, but, for now, we just want to utilize a message_display function. Too bad it doesn't exist! We can see how it might be useful though, so we're going to make one.
def message_display(text): largeText = pygame.font.Font('freesansbold.ttf',115) TextSurf, TextRect = text_objects(text, largeText) TextRect.center = ((display_width/2),(display_height/2)) gameDisplay.blit(TextSurf, TextRect) pygame.display.update() time.sleep(2) game_loop()
So there's our message displaying function, we define the large text, then we define the text and the rectangle that would encompass it. We then center the text, using our width and height variables (the gift that keeps on giving...just imagine deciding you wanted to change dimensions now?). Then we blit this stuff to the surface, remembering this only draws it in the background, and that we need to call "pygame.display.update()."
Easy enough, after the message display, we run back to the game loop, whatever that happens to be. In hindsight, I think the superior choice for the game_loop() function call would actually be in our crash function, after calling message_display. It makes way more sense, since all messages you might want to display shouldn't lead to restarting the game. I advise doing that instead of the way shown in the code here and the video, I am only just now noticing this as I write this a while after writing and filming.
Finally, we realize that, gosh darnit, text_objects doesn't exist yet! Let's finally make that one!
def text_objects(text, font): textSurface = font.render(text, True, black) return textSurface, textSurface.get_rect()
The only fancy thing we're doing here is using .get_rect() to get the rectangle that is somewhat invisible, so we can reference it and center the text.


an Interactive Zoo
*A Requirments & Planning Document
Application Architecture
The following Pages will be working prototypes for this application.
Animal Manager Page Prototype
Documentation: Table of Contents
Documentation: Introduction
Requirements:
The end user requested an application to automate mundane tasks around the Zoo Like Feeding animals, enabling their staff to focus on zoo duties and the growth their organization needs to meet demands. The databaes already exist but some modifications will need to be made to enable these new features.
Business Justification:
With advertisements, in-app purchases, and a subscription model this application can provide a future revenue stream to help the Zoo contribute more into their expansion efforts. The customer is looking for a minimum viable product to help show this concept to the Board of Directors and onboard initial stakeholders.
Phase #2 - will build out the revenue portion and work on building our user base.
Phase #3 - Roll out missing features, requests and deploy dependencies for operations at scale.
THE END
BY: Luke@solidifyinc
Want More...?
Let me know: Luke@jcsc.biz


cns_analytics.entities.Resolution
cns_analytics
entities
Resolution
class Resolution(enum.Enum):
View In Hierarchy
m1
m5
m15
m30
h1
d1
Undocumented


--- layout: creator title: "Ionic Creator" meta_description: "Build amazing hybrid mobile apps with simple drag-and-drop components. The Ionic Creator is coming Summer 2014." body_css: "" header_logo: ---
Ionic Creator lets you rapidly mockup and prototype a real mobile app in minutes. Best of all, it's totally free.
Click, move, and place components onto your screen with our easy drag & drop technology. Choose from a vast library of official Ionic-powered components to build your app with ease.
In a hurry? Kickstart your project with one of Creator's several pre-built templates to kickstart your app's design.


Smart Home Monitoring with Particle Spark Core
20 Nov 2016In this article we are going to use Particle Core (ex-Spark) board to build a simple IoT project. We will use a humidity and temperature sensor (DHT22), sent the data to the Particle cloud and then visualise the measurements in real time.
Particle core is a little board build around a Cortex M3 MCU and the WiFi CC33000 SoC from Texas Instruments. It connects automatically to the Particle cloud platform and it is instantly accesible from the web.
Hardware Configuration
For this project we are going to use the following components:
- Particle Spark Core Board (link)
- DHT22 temperature/humidity sensor (link)
- 10K resistor
- Breadboard
- Jumper Wires
Below are a schematic with all the different components of this project:
The DHT22 sensor has 4 pins. The left pin is the VCC and the right one the GND. Pin2 is the DataOut and Pin3 is not used. We connect Pin2 to the D3 pin of the Particle Core and we also place the 10K resistor between Pin1 and Pin2 of the sensor.
The code
Particle has a web IDE that can be used to write and flash code onto particle devices. Additionally particle offers a Command Line Interface (CLI) to interact with devices and the particle cloud from the terminal. Find more information about how to install an use the CLI here.
We are going to use Adafruit_DHT library for our project. If you are using the web IDE then you can easily find and add the library from “libraries” menu. If you are using the CLI instead then download “Adafruit_DHT.cpp” and “Adafruit_DHT.h” from this repository and save this files inside the same directory with the code below:
#include "Adafruit_DHT.h"
// DHT parameters
#define DHTPIN 3
#define DHTTYPE DHT22
// Variables
int temperature;
int humidity;
// Create an instance of DHT sensor
DHT dht(DHTPIN, DHTTYPE);
void setup() {
// Initialize DHT sensor
dht.begin();
}
void loop() {
// Temperature measurement
temperature = dht.getTempCelcius();
// Humidity measurement
humidity = dht.getHumidity();
// Use publish() function to send the data every 2 seconds on the Particle cloud platform:
Spark.publish("temperature", String(temperature) + " °C");
delay(2000);
Spark.publish("humidity", String(humidity) + "%");
delay(2000);
}
Notes
Before flashing the code we need to know the device id:
$ particle find
and then use the command below to compile and flash the source code:
$ particle flash<PHONE_NUMBER>ABCDEFGHI dht22.ino Adafruit_DHT.cpp Adafruit_DHT.h
Change<PHONE_NUMBER>ABCDEFGHI with your device id.
Visualizing the data
The publish() function we use in our code allow us to sent data directly to the Particle cloud platform. We can see a live visualization of this data by going there:


By BCC
The initiative of LICT is part of the government's plan to create 30,000 direct and 120,000 indirect jobs in the IT and ITES companies under LICT Project in which the World Bank is providing US$ 70 million credit for implementing the Leveraging ICT for growth, Employment and Governance project (LICT) of Bangladesh Computer Council (BCC) under the ICT Division of Posts, Telecommunication and IT Ministry.


Harry Kane thanks Mauricio Pochettino for making his ‘dreams’ come true
by FSA EditorMauricio Pochettino was sacked as Tottenham manager on Tuesday, with captain Harry Kane writing a heartfelt tribute to the coach.
Tottenham captain Harry Kane thanked Mauricio Pochettino for helping him realise his dreams following the Argentinian’s sacking.
Spurs sprung a surprise on Tuesday when they announced Pochettino’s five-and-a-half-year spell as manager had been ended.
Pochettino had enjoyed a fine spell at the club, transforming them into top-four regulars and taking Spurs to their first Champions League final last season, ultimately losing 2-0 to Liverpool.
But after a difficult start to the new campaign, claiming just 14 points from their first 12 matches, chairman Daniel Levy made a drastic decision, with Spurs confirming Jose Mourinho as their new manager on Wednesday.
There remains plenty of respect for Pochettino in the Spurs dressing room, however, with skipper Kane the latest to pay tribute to ex-Southampton boss.
“Gaffer. I’ll be forever thankful to you for helping me achieve my dreams,” Kane wrote on his official Twitter account.
“We’ve had some amazing moments in the last five and a half years that I will never forget.
“You were my manager but my friend as well and I thank you for that relationship. Good luck with your next chapter!”


PyQt5 tutorial(Events and signals)
Fri 13 October 2017 by Little CaptainEvents
GUI applications are
event-driven
. Events are generated mainly by the user of an application. But they can be generated by other means as well; e.g. an Internet connection, a window manager, or a timer. When we call the application'sexec_()
method, theapplication enters
themain loop
. Themain loop
fetches events
andsends them to the objects
.
- event model 有三个参与者
- event source : The event source is the object whose state changes. It generates events.
- event object : The event object (event) encapsulates the state changes in the event source.
- event target : The event target is the object that wants to be notified.
- Event source object delegates the task of handling an event to the event target. (代理设计模式)
- PyQt5 has a unique
signal and slot
mechanism to deal with events. Signals and slots are used for communication between objects. A signal is emitted when a particular event occurs. A slot can be any Python callable. A slot is called when its connected signal is emitted.
Signals and slots
import sys
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import (QWidget, QLCDNumber, QSlider,
QVBoxLayout, QApplication)
class Example(QWidget):
def __init__(self):
super().__init__()
self.initUI()
def initUI(self):
lcd = QLCDNumber(self)
sld = QSlider(Qt.Horizontal, self)
vbox = QVBoxLayout()
vbox.addWidget(lcd)
vbox.addWidget(sld)
self.setLayout(vbox)
# Here we connect a valueChanged signal of the slider
# to the display slot of the lcd number.
sld.valueChanged.connect(lcd.display)
self.setGeometry(300, 300, 250, 150)
self.setWindowTitle('Signal and slot')
self.show()
if __name__ == '__main__':
app = QApplication(sys.argv)
ex = Example()
sys.exit(app.exec_())
Reimplementing event handler
- Events in PyQt5 are processed often by reimplementing event handlers.
import sys
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QWidget, QApplication
class Example(QWidget):
def __init__(self):
super().__init__()
self.initUI()
def initUI(self):
self.setGeometry(300, 300, 250, 150)
self.setWindowTitle('Event handler')
self.show()
# reimplement the keyPressEvent() event handler.
def keyPressEvent(self, e):
if e.key() == Qt.Key_Escape:
self.close()
if __name__ == '__main__':
app = QApplication(sys.argv)
ex = Example()
sys.exit(app.exec_())
Event object
- Event object is a Python object that contains a number of attributes describing the event. Event object is specific to the generated event type.
import sys
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QWidget, QApplication, QGridLayout, QLabel
class Example(QWidget):
def __init__(self):
super().__init__()
self.initUI()
def initUI(self):
grid = QGridLayout()
grid.setSpacing(10)
x = 0
y = 0
self.text = "x: {0}, y: {1}".format(x, y)
self.label = QLabel(self.text, self)
grid.addWidget(self.label, 0, 0, Qt.AlignTop)
# Mouse tracking is disabled by default,
# so the widget only receives mouse move events
# when at least one mouse button is pressed
# while the mouse is being moved.
# If mouse tracking is enabled, the widget receives
# mouse move events even if no buttons are pressed.
self.setMouseTracking(True)
self.setLayout(grid)
self.setGeometry(300, 300, 350, 200)
self.setWindowTitle('Event object')
self.show()
# The e is the event object; it contains data
# about the event that was triggered; in our case,
# a mouse move event. With the x() and y() methods
# we determine the x and y coordinates of the mouse pointer.
# We build the string and set it to the label widget.
def mouseMoveEvent(self, e):
x = e.x()
y = e.y()
text = "x: {0}, y: {1}".format(x, y)
self.label.setText(text)
if __name__ == '__main__':
app = QApplication(sys.argv)
ex = Example()
sys.exit(app.exec_())
Event sender
- Sometimes it is convenient to know which widget is the sender of a signal.
import sys
from PyQt5.QtWidgets import QMainWindow, QPushButton, QApplication
class Example(QMainWindow):
def __init__(self):
super().__init__()
self.initUI()
def initUI(self):
btn1 = QPushButton("Button 1", self)
btn1.move(30, 50)
btn2 = QPushButton("Button 2", self)
btn2.move(150, 50)
btn1.clicked.connect(self.buttonClicked)
btn2.clicked.connect(self.buttonClicked)
self.statusBar()
self.setGeometry(300, 300, 290, 150)
self.setWindowTitle('Event sender')
self.show()
def buttonClicked(self):
# 获取信号发送者
sender = self.sender()
self.statusBar().showMessage(sender.text() + ' was pressed')
if __name__ == '__main__':
app = QApplication(sys.argv)
ex = Example()
sys.exit(app.exec_())
Emitting signals
- Objects created from a QObject can emit signals.
import sys
from PyQt5.QtCore import pyqtSignal, QObject
from PyQt5.QtWidgets import QMainWindow, QApplication
class Communicate(QObject):
# A signal is created with the pyqtSignal() as
# a class attribute of the external Communicate class.
closeApp = pyqtSignal()
class Example(QMainWindow):
def __init__(self):
super().__init__()
self.initUI()
def initUI(self):
self.c = Communicate()
# 连接信号
self.c.closeApp.connect(self.close)
self.setGeometry(300, 300, 290, 150)
self.setWindowTitle('Emit signal')
self.show()
def mousePressEvent(self, event):
# 发送信号
self.c.closeApp.emit()
if __name__ == '__main__':
app = QApplication(sys.argv)
ex = Example()
sys.exit(app.exec_())


Thermaltake Tt Gaming Level 20 RGB Battlestation Gaming Computer Desk; Full Frame RGB LED Lighting W/ 8 Light Effects; Tt RGB Plus Ecosystem & Razer Chroma Sync Compatible; Electric Height Adjustable - Newegg.com Buy Thermaltake Tt Gaming Level 20 RGB Battlestation Gaming Computer Desk; Full Frame RGB LED Lighting W/ 8 Light Effects; Tt RGB Plus Ecosystem & Razer Chroma Sync Compatible; Electric Height Adjustable with fast shipping and top-rate...
wybiral/ipv4scan IoT device scanner. Contribute to wybiral/ipv4scan development by creating an account on GitHub.
Announcing Windows 10 Insider Preview Build 18963 | Windows Experience Blog Hello Windows Insiders, today we’re releasing Windows 10 Insider Preview Build 18963 (20H1) to Windows Insiders in the Fast ring. IMPORTANT: As is normal with builds early in the development cycle,…
Summer vacation 2019 part four My friend Larry from the previous episode mentioned to me that a group of several male and female belted kingfishers had been spotted at the river; I’d never seen kingfishers at our little ri…
Has my Gmail been hacked? How to check if your email has ever been hacked and when ARE you worried that your Gmail may have been hacked? Data breaches are becoming all too common these days, so here’s a handy guide to help you check up on your accounts to make sure you won&…
IrisClasson/SpeakingDiversity Online resources for finding speakers from underrepresented groups - IrisClasson/SpeakingDiversity
Advanced .NET Debugging #2 – Gabriel Weyer – A somewhat technical blog How is Windows launching a managed image?
Advanced .NET Debugging #1 – Gabriel Weyer – A somewhat technical blog Finding the entry point of a native image.
WinDbg #2 - The blocked async – Gabriel Weyer – A somewhat technical blog Troubleshoot blocked async with WinDbg.
Found: World-readable database used to secure buildings around the globe 23-gigabyte database had plain-text passwords, face images, and much more.
The first ever photograph of light as both a particle and wave (Phys.org)—Light behaves both as a particle and as a wave. Since the days of Einstein, scientists have been trying to directly observe both of these aspects of light at the same time. Now, scientists at EPFL have succeeded in capturing the first-ever snap...
WinDbg #1 - The static root – Gabriel Weyer – A somewhat technical blog Pinpointing a static GC root with WindDbg and SOS.
CQRS-Event Sourcing with Event Modeling - Event Store Event sourced systems provide several significant benefits including, scalability, zero data loss, high performance, simplicity, and faster development. For developers new to the pattern understanding how to approach the problem correctly can be challengi...
Web Thing API This document describes a common data model and API for the Web of Things. The Web Thing Description provides a vocabulary for describing physical devices connected to the World Wide Web in a machine readable format with a default JSON encoding. Common de...
Announcing the preview of GitHub Actions for Azure On Thursday, August 8, 2019, GitHub announced the preview of GitHub Actions with support for Continuous Integration and Continuous Delivery (CI/CD). Actions makes it possible to create simple, yet powerful pipelines and automate software compilation and d...
r/programmingcirclejerk - Security consultant here. The fact that Golang has no generic is a huge thing. 60 votes and 36 comments so far on Reddit
Associating threadpool queues with CPU cores. by VSadov · Pull Request #18403 · dotnet/coreclr New implementation of ThreadPool work queues as lock-free queues softly associated with CPU cores. The implementation avoids 1:1 strict mapping between work queues and working threads which is ofte...


This software defense prevents the many flavours of Cross-Site Scripting
First if you want to get an idea of the challenges associated with fixing XSS, watch the following public video: How Fixing Cross-Site Scripting is Like Playing Whack-A-Mole
There are several proven ways to ensure the user input doesn't "pop".
This technique is best fit for pages that are generated on the server side, like in the case of JSP, PHP or ASP. The HTML Encoding example below shows how HTML markup is neutralized by replacing special characters with their corresponding HTML Entities.
StringEscapeUtils.escapeHtml4(request.getParameter("userId")).replace("'", "'");
'"/>
The output encoding countermeasure can be bypassed through alternate encoding attacks. Enforcing the charset prevents such attacks. If the charset of the page is not set, the browser will default to auto detect and strings that would normally be harmless would become executable.
The example below shows how the charset can be enforced using an HTTP header.
Content-type: text/html; charset=UTF8.
Modern applications have moved the UI handling to client side technologies such as React, Angular or JQuery, which have become very popular.
In such applications the danger lies in dynamic updates of the innerHTML attribute. The contentText/innerText attribute should be used instead, like in the case of using the
.text(text) function in jQuery.
A better approach to UI design in modern applications is using widgets or templates.
The example below is from this page, which uses AngularJS.

Hi {{firstName}}! Your level is: '{{userLevelString}}'

 Complete the challenges below to advance to the next level. Click on the challenge name to get more info.

Don't use eval()
. Avoid setTimeout/setInterval
. Do not construct JavaScript function names dynamically.
These measures can reduce the impact of a XSS attack.
X-XSS-Protection: 1; mode=blockenforces the browser XSS filter, not supported by all browsers
Content-Security-Policy: script-src ‘self’prevents the loading of external scripts, requiring the attacker to use large inline payloads. When possible the header is also an effective mitigation against: "Inclusion of Functionality from Untrusted Control Sphere" when possible.


yield precipitation wheat yields temperature climate {border-style increase px;} #ffffff;} Hatfield gaps temperatures water production crop soil productivity North United significant variation Climate factor Change Dakota Great Oklahoma, gap Plains States grain impact Kansas, Plant crops management px; states statewide {font-family analysis change dominant font-size high impacts potential yield. Yield average critical double; effects future grain-filling growing however, maize maximum million offset period plant using years yields. Agricultural Research actual amounts approach attainable availability border-color border-width changing data effect evaluate historical practices response shown solid; soybean {font-style {font-weight Ecol. Egli Figure Front. July Kansas Midwest Pacific Prasad Science Temperature ability affecting bold courier; daily em; explaining factors increasing indices minimum monthly period. positive production. pt;} recent related relationship relationships suggest used variability variable yield,


Fortify Security Center provides filter sets based on the issue template configured for the application. By default, every issue template includes the Quick View and Security Auditor View filter sets. Your organization might have additional filter sets.
The build failure criteria, the NVS calculation, and the Fortify Assessment page depend on the issues filtered by the filter set. For example, if a Quick View filter set is applied and no issues are found, then the build failure criteria determines that there is no reason to set this build to unstable and the NVS is set to zero. The graph summary also shows zero.


Pick some colors!
Background:
Border:
Mess with the border
Width
Dashed
Double
Outset
Don't push this button
Uh-oh!
How psychadelic are you feeling right now?
Psychadelicness
Step out of the astral plane


This dialog makes it straightforward to compare and visualize the numeric values
in a table. To the left simply select how to plot the data (xy plot, histogram
or density) and then select which column(s) to use as the input.
For xy plots one can
also select which values to use for the y axis, and which values to use as the size
and color of the data points.
If the size of the bubbles are too big or too small, change the bubble scaling factor
by clicking the blue "Size" label link.
For histograms the bin size is set automatically, but can be manually set by the user
in the "Bins" box.
If a logarithmic axis is desired this can be choosen under the "Logarithmic Axis" header.
Also note that the x and y axis can be swapped by clicking on one of the blue axis links.
As a default, dragging the mouse selects values in the xy plot. To zoom instead,
select the "Drag to Zoom" option. To clear the selection, simply click
in the plot where there are no data points. Clicking a selected data point will
unselect that data point.
Finally, the plot and selected values in the table can be exported to file from
the conextual options menus found in the upper right corners of the plot and
table.


Wear a Mask
More details and coalition partners to be added soon.
A Coalition With:
- Whatcom DSA
- INK - Imagine No Kages
- The Whatcom Peace & Justice Center
- WWU Shred the Contract
- WWU YDSA
- Racial Justice Coalition(RJC)
- SURJ Whatcom
- Stand Speak Listen
- Sunrise Movement Bellingham
- WWU Community Aid
- Social & Environmental Justice Committee - Bellingham Unitarian Fellowship
- Alternative Library


Toon: The Looney Toons
Looney Tunes has since become a worldwide media franchise, spawning several television series, feature films, comic books, music albums, video games, and amusement park rides, as well as serving as Warner Bros.' flagship franchise.


Season the Cornish hen with salt and set it aside for 10 minutes. In a medium mixing bowl mix the honey, soy sauce, lemon juice, garam masala, ground cumin and lavender flowers.
Evenly rub the Cornish hens with the mixture and let it rest for 10 minutes.
Preheat the oven to 400° F.
In a large heavy bottom skillet heat the oil on high heat. Sear the hens on all sides.
Bake it until the chicken is done, about 35 to 40 minutes.


TcEx¶
tcex.tcex¶
TcEx Framework
-
class
tcex.tcex.
TcEx
(**kwargs)[source]¶ Bases:
object
Provides basic functionality for all types of TxEx Apps.
- Parameters
config (dict, kwargs) – A dictionary containing configuration items typically used by external Apps.
config_file (str, kwargs) – A filename containing JSON configuration items typically used by external Apps.
logger (logging.Logger, kwargs) – An pre-configured instance of logger to use instead of tcex logger.
-
_association_types
()[source]¶ Retrieve Custom Indicator Associations types from the ThreatConnect API.
-
_resources
(custom_indicators=False)[source]¶ Initialize the resource module.
This method will make a request to the ThreatConnect API to dynamically build classes to support custom Indicators. All other resources are available via this class.
Note
Resource Classes can be accessed using
tcex.resources.<Class>
or using tcex.resource(‘<resource name>’).
-
property
args
¶ Argparser args Namespace.
-
batch
(owner, action=None, attribute_write_type=None, halt_on_error=False, playbook_triggers_enabled=None)[source]¶ Return instance of Batch
-
cache
(domain, data_type, ttl_minutes=None, mapping=None)[source]¶ Get instance of the Cache module.
- Parameters
domain (str) – The domain can be either “system”, “organization”, or “local”. When using “organization” the data store can be accessed by any Application in the entire org, while “local” access is restricted to the App writing the data. The “system” option should not be used in almost all cases.
data_type (str) – The data type descriptor (e.g., tc:whois:cache).
ttl_minutes (int) – The number of minutes the cache is valid.
- Returns
An instance of the Cache Class.
- Return type
object
-
data_filter
(data)[source]¶ Return an instance of the Data Filter Class.
A simple helper module to filter results from ThreatConnect API or other data source. For example if results need to be filtered by an unsupported field the module allows you to pass the data array/list in and specify one or more filters to get just the results required.
- Parameters
data (list) – The list of dictionary structure to filter.
- Returns
An instance of DataFilter Class
- Return type
(object)
-
datastore
(domain, data_type, mapping=None)[source]¶ Get instance of the DataStore module.
- Parameters
domain (str) – The domain can be either “system”, “organization”, or “local”. When using “organization” the data store can be accessed by any Application in the entire org, while “local” access is restricted to the App writing the data. The “system” option should not be used in almost all cases.
data_type (str) – The data type descriptor (e.g., tc:whois:cache).
- Returns
An instance of the DataStore Class.
- Return type
object
-
property
default_args
¶ Argparser args Namespace.
-
property
error_codes
¶ Return TcEx error codes.
-
exit
(code=None, msg=None)[source]¶ Application exit method with proper exit code
The method will run the Python standard sys.exit() with the exit code previously defined via
exit_code()
or provided during the call of this method.- Parameters
code (Optional [integer]) – The exit code value for the app.
msg (Optional [string]) – A message to log and add to message tc output.
-
property
exit_code
¶ Return the current exit code.
-
static
expand_indicators
(indicator)[source]¶ Process indicators expanding file hashes/custom indicators into multiple entries.
- Parameters
indicator (string) – ” : ” delimited string
- Returns
a list of indicators split on ” : “.
- Return type
(list)
-
get_type_from_api_entity
(api_entity)[source]¶ Return the object type as a string given a api entity.
- Parameters
api_entity –
Returns:
-
property
group_types
¶ Return all defined ThreatConnect Group types.
- Returns
A list of ThreatConnect Group types.
- Return type
(list)
-
property
group_types_data
¶ Return supported ThreatConnect Group types.
-
handle_error
(code, message_values=None, raise_error=True)[source]¶ Raise RuntimeError
- Parameters
code (integer) – The error code from API or SDK.
message (string) – The error message from API or SDK.
-
property
indicator_associations_types_data
¶ Return ThreatConnect associations type data.
Retrieve the data from the API if it hasn’t already been retrieved.
- Returns
A dictionary of ThreatConnect associations types.
- Return type
(dictionary)
-
property
indicator_types
¶ Return ThreatConnect Indicator types.
Retrieve the data from the API if it hasn’t already been retrieved.
- Returns
A list of ThreatConnect Indicator types.
- Return type
(list)
-
property
indicator_types_data
¶ Return ThreatConnect indicator types data.
Retrieve the data from the API if it hasn’t already been retrieved.
- Returns
A dictionary of ThreatConnect Indicator data.
- Return type
(dict)
-
property
log
¶ Return a valid logger.
-
property
logger
¶ Return logger.
-
message_tc
(message, max_length=255)[source]¶ Write data to message_tc file in TcEX specified directory.
This method is used to set and exit message in the ThreatConnect Platform. ThreatConnect only supports files of max_message_length. Any data exceeding this limit will be truncated. The last <max_length> characters will be preserved.
- Parameters
message (string) – The message to add to message_tc file
-
metric
(name, description, data_type, interval, keyed=False)[source]¶ Get instance of the Metrics module.
- Parameters
name (string) – The name for the metric.
description (string) – The description of the metric.
data_type (string) – The type of metric: Sum, Count, Min, Max, First, Last, and Average.
interval (string) – The metric interval: Hourly, Daily, Weekly, Monthly, and Yearly.
keyed (boolean) – Indicates whether the data will have a keyed value.
- Returns
An instance of the Metrics Class.
- Return type
(object)
-
notification
()[source]¶ Get instance of the Notification module.
- Returns
An instance of the Notification Class.
- Return type
(object)
-
property
parser
¶ Instance tcex args parser.
-
property
playbook
¶ Include the Playbook Module.
Note
Playbook methods can be accessed using
tcex.playbook.<method>
.
-
property
proxies
¶ Format the proxy configuration for Python Requests module.
Generates a dictionary for use with the Python Requests module format when proxy is required for remote connections.
Example Response
{"http": "http://user:pass@<IP_ADDRESS>:3128/"}
- Returns
Dictionary of proxy settings
- Return type
(dictionary)
-
property
rargs
¶ Return argparser args Namespace with Playbook args automatically resolved.
-
request
(session=None)[source]¶ Return an instance of the Request Class.
A wrapper on the Python Requests module that provides a different interface for creating requests. The session property of this instance has built-in logging, session level retries, and preconfigured proxy configuration.
- Returns
An instance of Request Class
- Return type
(object)
-
resource
(resource_type)[source]¶ Get instance of Resource Class with dynamic type.
- Parameters
resource_type – The resource type name (e.g Adversary, User Agent, etc).
- Returns
Instance of Resource Object child class.
- Return type
(object)
-
results_tc
(key, value)[source]¶ Write data to results_tc file in TcEX specified directory.
The TcEx platform support persistent values between executions of the App. This method will store the values for TC to read and put into the Database.
- Parameters
key (string) – The data key to be stored.
value (string) – The data value to be stored.
-
s
(data, errors='strict')[source]¶ Decode value using correct Python 2/3 method.
This method is intended to replace the
to_string()
method with better logic to handle poorly encoded unicode data in Python2 and still work in Python3.- Parameters
data (any) – Data to ve validated and (de)encoded
errors (string) – What method to use when dealing with errors.
- Returns
Return decoded data
- Return type
(string)
-
static
safe_group_name
(group_name, group_max_length=100, ellipsis=True)[source]¶ Truncate group name to match limit breaking on space and optionally add an ellipsis.
Note
Currently the ThreatConnect group name limit is 100 characters.
- Parameters
group_name (string) – The raw group name to be truncated.
group_max_length (int) – The max length of the group name.
ellipsis (boolean) – If true the truncated name will have ‘…’ appended.
- Returns
The truncated group name with optional ellipsis.
- Return type
(string)
-
safe_indicator
(indicator, errors='strict')[source]¶ Format indicator value for safe HTTP request.
- Parameters
indicator (string) – Indicator to URL Encode
errors (string) – The error handler type.
- Returns
The urlencoded string
- Return type
(string)
-
static
safe_rt
(resource_type, lower=False)[source]¶ Format the Resource Type.
Takes Custom Indicator types with a space character and return a safe string.
(e.g. User Agent is converted to User_Agent or user_agent.)
- Parameters
resource_type (string) – The resource type to format.
lower (boolean) – Return type in all lower case
- Returns
The formatted resource type.
- Return type
(string)
-
safe_tag
(tag, errors='strict')[source]¶ Encode and truncate tag to match limit (128 characters) of ThreatConnect API.
- Parameters
tag (string) – The tag to be truncated
- Returns
The truncated tag
- Return type
(string)
-
safe_url
(url, errors='strict')[source]¶ Encode value for safe HTTP request.
- Parameters
url (string) – The string to URL Encode.
- Returns
The urlencoded string.
- Return type
(string)
-
property
service
¶ Include the Service Module.
Note
Service methods can be accessed using
tcex.service.<method>
.
-
property
session
¶ Return an instance of Requests Session configured for the ThreatConnect API.
-
property
session_external
¶ Return an instance of Requests Session configured for the ThreatConnect API.
-
property
ti
¶ Include the Threat Intel Module.
Note
Threat Intell methods can be accessed using
tcex.ti.<method>
.
-
property
token
¶ Return token object.
-
property
utils
¶ Include the Utils module.
Note
Utils methods can be accessed using
tcex.utils.<method>
.


I am currently working for National Instruments as a Staff Software Developer. I started at NI soon after graduating from the University of Toronto in 2013 with a BASc in Electrical Engineering.
Initially I worked on Multisim which is primarily written in C++. I had a chance to work on some fairly old legacy code, including the Berkeley SPICE engine.
Since December of 2014, I have been a maintainer of Chart.js. In that time I have written a lot of the improvements for the version 2 release including multiple axis support and the ability to create new scale types with relative ease. I am also the author of a number of extensions for Chart.js including Chart.Zoom.js, Chart.Annotation.js, and Chart.Smith.js.
To contact me, email me at evert [dot] timberg [at] gmail.com or send me an invitation to connect on social media.


A text completion is one of the new question types on the GRE. It is similar to a sentence completion, but has a few important differences. For one, there can be multiple sentences in a text completion. In fact, the question may sometimes run on for an entire paragraph. That’s because some have as many as three blanks.
The other important difference is that each blank only has three possible answer choices, but you have to get all three correct in order to get the question correct (that amounts to a 1 in 27 chance in guessing).
Now that we know our enemy, below are five important strategies you should follow if you want to do well on text completions:
1. Don’t Dive In
Read the entire stem first. The reason for this strategy is that the first blank is often ambiguous, unless you have read the entire paragraph.
2. Breaking Down the Text Completion
Text Completions are sometimes a paragraph long, so it is easy to get lost in them. A great strategy is trying to understand the big picture. Breaking down the paragraph in your own words (paraphrasing the paragraph) will help you get a grasp on what the sentences are talking about. Then you’re ready for step #3.
3. Use Your Own Words
Here, we’re on familiar footing. Much like the sentence completions and the sentence equivalence questions, we want to use the strategy of putting in our own word(s) in the blank or blanks. To do so, you must always justify your answers not just on the context, but some of the specific words or phrases in the sentence itself. I’ve commonly referred to these word(s) as the clue.
4. The Second (or Third) Blank First
Because the first blank is difficult to deal with, first try finding a word for the second or third blank. Then work your way backwards to the first blank. The caveat—this technique only applies if you can come up with a word for the second or third blank. If you can’t, then work with the first blank.
5. Use the Entire Text Completion as Context
When you’ve finally chosen your two/three answers, plug them back into the blanks. Does the completed sentence make sense with how you earlier paraphrased it?


-
Dig deeper.
Interrogate your endpoints with speed and precision.
Watch How Download Latest -
Go hunting.
Harness digital forensic expertise to proactively find suspicious activities.
Learn how Download Latest -
Stop attackers in their tracks.
Monitor for dangerous events and respond with accuracy and flexibility.
Learn how Download Latest


the and COVID- []. for with The coronavirus from that infection were are cases patients novel respiratory {background was have margin reported which against transmission {border-style SARS-CoV has px;} vaccine #ffffff;} acute infected pneumonia symptoms virus China between can been clinical not number other severe syndrome treatment Health control people prevention sequence there these January also case confirmed found health studies Commission National SARS more showed used ventilation (AY) Wuhan [,]. animal collab: death guidelines receptor should use viral Med age among days disease human measures outbreak possible protective public who Chinese SARS-CoV- based care diagnosis first include market medical px; some spread than years {font-family CFR Peopleâ€™s Republic Wuhan, around caused font-size like models person population ranging research samples therapeutic two Fig.Â MERS-CoV WHO analysis antiviral any both coronaviruses countries different double; infections its most particularly rapid risk spike such therapy this time while (-nCoV) (with -nCoV COVID-. China, Elsevier Engl Infect These Virol [], animals available border-color border-width but during early far globe had having high host identified immune important inactivated including infection. laboratory likely management many mechanical mice nosocomial positive protection psychological recombinant released results significantly similar small solid; strategies study tested those through total viruses {font-style {font-weight (R) ACE Available CDC December Dis New associated bat bats bold cause cells centre children clinically contact courier; deaths development disease, diseases drugs due em; estimated exposure features general how human-to-human humans identity identity) intermediate into inÂ lower major males masks new observed one only origin out pandemic pathogenicity per period potential pressure prevent pt;} rate researchers resource sample seafood suggested unknown vaccines vulnerable well wet within


Thanks to @KeightyLeonard and @zoevkay I will now spend the evening with my brain's background thread obsessing over Ruby object marshaling.
4/23/2015, 5:54:46 PM
Favs: 3
Retweets: 0
link--- layout: tweet ---
Thanks to @KeightyLeonard and @zoevkay I will now spend the evening with my brain's background thread obsessing over Ruby object marshaling.
4/23/2015, 5:54:46 PM
Favs: 3
Retweets: 0
link


Flint, MI Water Crisis Waiting List: Enter property damage and needs. No sensitive information! Tell the client this information will be shared with many organizations to provide service as fast as possible, which may be several weeks. Service is not guaranteed.


This article explains how to deploy portions of a Ruby on Rails application to separate servers with the use of Ruby Gems and Rails Engines.
In the past I used Ruby gems and Rails engines as building blocks of complex Rails applications to get better long term maintainability but this time it started for a different reason.
We were a team of 6 full stack developers and one product owner part of a larger engineering division engaged in a portal re-platforming. Our project had an administration interface for editors to manage different type of content and a public view of it.
Months in to development we were told of a company policy requiring administration interfaces to be deployed on a separate server behind a corporate VPN–another good reasons for it was very different user requests loads between the two portions.
We brainstormed and came out with 3 proposals.
Full service oriented architecture
Split the monolithic application in three applications: admin, public, API. Admin would be reading/writing from the API, public just read.
That service oriented architecture was pushed hard by management but it felt like premature optimization since nothing else was going to use the API but we knew it would introduce problems.
The public and admin applications needed to share significant amount of user interface to allow admins content preview to look like on the public portion.
The overhead of a team of 6 committing work in three separate repositories and deploy three applications to see initial features delivered was going to slow development down.
Multiple apps with Engines on a private server
Split the monolithic application in two: admin, public both depending on two Rails Engines published to a private server: shared_ui
to allow content preview and persistence
containing the database abstraction and ActiveRecord
models.
Similarly to the first proposal maintaining multiple repositories and dealing with local dependencies in development mode would slow down development–now even more because shared engines would have to be git submodules or subtrees as well as being published to a private gem server by multiple developers potentially multiple times per day. This was a recipe for conflict disaster that I saw happening before and wanted to avoid.
Another team used this strategy on a different project and after seeing how inefficient it was I summarized an alternative with components documented here.
One app with local Gems and Engines
We decided to go with one Ruby on Rails application turning the administration and public on and off based on a running mode feature flag.
In order to do this we gradually moved code from the /app
directory in to two entry point component engines: admin_ui
and public_ui
each with their own dependency structure.
The main application would mount the entry point Engines routes based on a unix environment variable like this:
Rails.application.routes.draw do
case AppRunningMode.value
when :admin
mount AdminUi::Engine => "/admin"
when :public
mount PublicUi::Engine => "/"
else
mount AdminUi::Engine => "/admin"
mount PublicUi::Engine => "/"
end
The class method AppRunningMode.value
is just a proxy to the env variable.
So we run the application public portion with:
RUNNING_MODE=public rails s
and the administration portion with:
RUNNING_MODE=admin rails s
With this approach we could run both admin and public in development mode simply omitting that variable.
path 'components' do
gem 'public_ui'
gem 'admin_ui'
end
we only needed the entry points listed in the main Rails application Gemfile thanks to the bundler path
option with block explained more here.
Details about the dependencies
Both admin_ui
and public_ui
depended on a persistence
engine that encapsulated the ActiveRecord
models and a shared_ui
that contained the erb
templates used to display and preview content.
As the application evolved so did the dependency structure–for example the admin had a site_search
component gem encapsulating the logic to update the portal internal search engine when content pieces were published.
Editors were review existing content in the legacy application and mark it for migration–overnight it would be pushed to an Amazon queue and the Rails application would pull and upsert the content in the new database. We didn’t want to mix that logic with the persistence engine but where else? We encapsulated all that behaviour in one component/engine: legacy_migration
–after launch that engine was removed leaving no trace behind about the migration scripts.
Adequate memory usage
We were also able to reduce memory footprint creating a bundle group for the running mode to require only that portion’s gems:
group :public_app do
path 'components' do
gem 'public_ui'
end
end
group :admin_app do
path 'components' do
gem 'admin_ui'
gem 'legacy_migration'
end
end
We only needed the entry point listed in the main Rails application Gemfile thanks to the bundler groups associated with the application running modes–this is explained more here.
I updated this in config/application.rb
:
Bundler.require(*Rails.groups + AppRunningMode.bundler_groups)
to require only the gems in the group we’re on. When bundling for the admin server you can now skip public with:
bundle --without 'public_app'
Summary
You might be wondering couldn’t you achieve this result without engines and gems? Partially. The core idea is a conditional statement wrapping the routes for public and admin but there is more to that. Thanks to components this design was intention revealing and ready to evolve the project to services–perhaps when the team size exceeded 10/12 developers making in process boundaries harder to maintain with team diligence.
I think this was a pragmatic approach using the design we needed to deliver business value but ready to evolve as application aged.
UPDATE: a video of a talk I gave about this at NYC.rb is available on https://www.youtube.com/watch?v=rMOn2H7h3oY


An Embeddable Scripting Engine |
Tweet |
Follow @jx9_engine |
Jx9 Resources & Downloads.
Jx9 Scrpting engine source code
|
Release |
Version |
Size |
Method |
Description |
MD5 |
|
1.7.2 |
371 KB |
HTTP |
This ZIP archive contains all C source code for Jx9 combined into a single source file (the amalgamation). |
|
|
|
Request
access to the Jx9 source tree.
|
Jx9 Scripting engine official documentation
|
Release |
Version |
Size |
Method |
Description |
|
1.7.2 |
1.6 MB |
HTTP |
This ZIP archive contains most of the static HTML files that comprise this website, including all of the tutorials and the C/C++ interface specs and other miscellaneous documentation. To start browsing simply open the index.html file.
|
|
|
1.0 |
1 KB |
HTTP |
Jx9 is released under this Open-Source license. See the licensing page for additional information. |
Jx9 C/C++ examples
Compile and run these C/C++ examples together with the Jx9 source code to generate the desired executable.
|
Release |
Version |
Size |
Method |
Description |
|
1.0 |
5 KB |
HTTP |
Smallest C program that embedded the Jx9 engine. This program compile and execute a simple Jx9 script that display a greeting message, the current system time and the host operating system. |
|
| 1.0 | 6 KB | HTTP | This C program compile a simple Jx9 script that ask the user for three random numbers (64-bit integer) using the built-in fgets(), fputs() functions, populate a JSON array with the given numbers, output the raw array, perform a merge-sort using the built-in sort() function and output the result. | |
| 1.0 | 6 KB | HTTP | This C program compile a simple Jx9 script that generate 25 random numbers between 0 and 1023 inclusive using the built-in rand() function, perform a merge sort using the built-in sort() function and display the result. | |
| 1.0 | 9 KB | HTTP | This
C program compile a simple Jx9 script that expects a command line path
from which all available MP3 are extrcated and their ID3v1 tags (if
available) are outputted. To run this program, simply enter the
executable name and the target directory as follows: test_prog /path/to/my/mp3s |
|
| 1.0 | 9 KB | HTTP | This
C program compile a simple Jx9 script that demonstrate how data is
shared between the host application and the running Jx9 script. The
main() function creates and install two foreign variables named
respectively $my_app and $my_data.
The first is a simple scalar value while the last is a complex JSON
object. these foreign variables are made available to the running
script using the jx9_vm_config() interface with a configuration verb set to JX9_VM_CONFIG_CREATE_VAR. |
|
| 1.0 | 6 KB | HTTP | This
C program compile a simple Jx9 script that demonstrate how the Jx9 scripting engine can be used as a configuration file reader/writer for a host application. This program create a JSON object holding some information (the configuration) that is written to disk in a file named config.json.txt. This file will be later processed by jx9_json_config_read.c |
|
| 1.0 | 6 KB | HTTP | This
C program compile a simple Jx9 script which open the JSON file (the configuration) created by jx9_json_config_write.c and parse its contents into a name value pair using the built-in json_decode(). |
|
|
1.0 |
7 KB |
HTTP |
Introduction to the powerful constant expansion mechanism. |
|
|
1.0 |
19 KB |
HTTP |
Introduction to the implementation of foreign functions plus the related interfaces such as jx9_value_to_int(), jx9_result_string() and so on. |
|
| 1.0 | 26 KB | HTTP |
A ZIP archive of all the C examples defined below. |
Jx9 Interpreter
The Jx9 interpreter is a simple standalone interpreter named jx9 (or jx9.exe on windows) that allows the user to enter and execute Jx9 sources against a Jx9 engine.
|
Release |
Version |
Size |
Method |
Description |
|
1.7.4 |
24 KB |
HTTP |
Source code of the Jx9 interpreter plus more than 40 Jx9 scripts to test against. Note that you need the latest release of the Jx9 engine to compile the interpreter from source. |
|
|
1.7.4 |
197 KB |
HTTP |
Jx9 interpreter precompiled binary for Linux plus more than 40 Jx9 scripts to test against. |
|
|
1.7.4 |
202 KB |
HTTP |
Jx9 interpreter precompiled binary for windows plus more than 40 Jx9 scripts to test against. |


Account
Cart
Login
Don't have an account?
Create Account
Email
We'll never share your email with anyone else.
Password
Log In