Stepping Down
Up until now, we've been exploring the X11 Window System from a somewhat high level. We've talked about Windows and Drawables and Pixmaps but we're always talking about them in terms of the protocol. Like, you can "draw with on a Drawable on protocol extension RENDER". Or you can "configure a window with the protocol request ConfigureWindow". But I haven't really told you about how that's done. I think it's about time we dropped from the abstract to the concrete. Today's article won't be about X11, or even the data structures that are inside of it. Today, we're going to start to unravel 2D Graphics. You can explore the things I'm going to talk about on any operating system, in any programming language, or even on paper.
I often see comments like "oh, if only SVG was implemented with WebGL, then it would be fast", and realize that people do not quite understand the challenges and complications of 2D graphics rendering. Despite it going against your intuition, fast, good looking 2D graphics are actually harder and more computationally expensive to accomplish than 3D graphics, at least on traditional consumer GPUs. I hope to eventually explain why, but unfortunately that won't come today.
Even though fast, good-looking 2D graphics rendering being extremely difficult, the basics and principles behind it aren't: they're simple enough that you can write a toy renderer in the span it takes you to read this article. Today, we will be exploring the basics of 2D graphics by writing a software rasterizer of our very own, from the ground up. All of the code you see here was written for this article, from nothing more than basic principles and ideas. It's open source on GitHub, and I've tried to comment it well as a source to learn from. I encourage you to study it.
The Pixel Grid
The X11 articles take place in a hand-written X11 server. Regional Geometry took place, well, in the land of geometry. Today's article takes place...
... on the pixel grid. If you can peel your eyes away from the absolute graphical marvel I've created enough to read on, hopefully you (yes, you!) can learn how to create one of these of your very own. If not, I hope you have a better appreciation for the concepts underlying 2D graphics rasterization.
This series will go on for multiple parts. Today, we're going to start with the basics of 2D graphics: the graphics buffer and its layout, abstract shapes, a basic introduction to sampling theory, lerping and blending colors, transparency, and end it off by adding a bit of antialiasing!
A bit of note about the interactive demos on display in here today. First, I'm presenting a "zoomed in" buffer so you can see the pixels easier. Specifically, each "demo pixel" here is 16 "real pixels" wide, and the same tall. The grid itself is composed of 46 of these "demo pixels" horizontally, and 10 of them vertically, which are basically a few arbitrary constants I chose to make it fit nicely inside these margins, which are 800 "real pixels" wide.
 Graphics programming often takes place in lots of different coordinate spaces like this. After quite a long time of doing it, I still get confused; it's just part of the job description. If you are having trouble, what helps me is to just turn off the monitor, grab some physical pen and paper, and just draw it out. Often times, just drawing and labelling the parts often shows me my confusion.
What doesn't help is blind trial and error. If you are serious about graphics programming, you
will eventually reach a point when things go wrong, and you'll start peppering x*8
and (y+15)/8
into your code in a vain attempt to just get everything to match up
correctly. You will start fiddling with your plus and minus signs, wildly reversing your
translations and rotations at random in desperation. You might find yourself even getting close,
but later on, finding that it breaks something else. It's OK, and we've all been there. I did it
multiple times writing this article. Just take a break, come back, and try to figure out what's
really going on.
... To prevent any confusion like this, let's start at the beginning.
Coordinates
While I'm sure everyone here doesn't need this refresher, let's over some notation and basic math for how to address pixels in this grid. We often treat pixel buffers as large arrays in memory, and we usually leave them one-dimensional, and do the math ourselves to find a specific index for a given position.
Buffer layouts in the real world have a lot of subtleties: stride alignment, endianness, pixel formats. If you don't know what any of those things are, don't worry, I'll explain them later, though perhaps not in this specific article. In this article series, we'll be using the convention established by HTML5's ImageData API. We see this pixel grid as a giant, one-dimensional array of bytes, with each pixel taking four bytes: red, green, blue, alpha, in that order.
We can find the index of the first byte of a pixel, and vice versa, with some very simple math:
var BYTES_PER_PIXEL = 4;
function indexForPixelLocation(imageData, x, y) {
return (y * imageData.width + x) * BYTES_PER_PIXEL;
}
function pixelLocationForIndex(imageData, idx) {
var pixelIdx = Math.floor(idx / BYTES_PER_PIXEL);
var y = Math.floor(pixelIdx / imageData.width);
var x = pixelIdx % imageData.width;
return { x: x, y: y };
}
Familiarize yourselves with what these functions do — they convert from the x and y coordinates of pixels on the grid to their index into the array of pixels. Pixels go from top left to bottom right, first in the X direction, then in the Y direction. The top left of the pixel grid is at 0, 0 at index 0. The next pixel in the array, which starts at index 4, is located directly to the right.
Let's Draw a Rectangle
Now that we've established ourselves with the format of the pixel grid, let's try drawing a rectangle. For simplicity's sake, let's just fill it with black for now.
function fillPixel(imageData, x, y) {
var idx = indexForPixelLocation(imageData, x, y);
imageData.data[idx + 0] = 0; // Red
imageData.data[idx + 1] = 0; // Green
imageData.data[idx + 2] = 0; // Blue
imageData.data[idx + 3] = 255; // Alpha
}
function fillRectangle(imageData, x1, y1, width, height) {
for (var y = y1; y < y1 + height; y++)
for (var x = x1; x < x1 + width; x++)
fillPixel(imageData, x, y);
}
And let's try it out!
This should be pretty straightforward, but there are a few pecularities I do want to go over. First, it may strike some of you as odd to iterate over the "y" first. Graphics programmers often think about things in rows. This is a holdover from early computer graphics, and it's for performance reasons — if you think about the memory layout of our pixel grid, you'll notice that I'm iterating over the indexes in order. While RAM does stand for "random access memory", CPUs cheat and have things called "caches". Just know that it is cheaper to write to indexes in order than it is to actually access randomly.
You will often see this pattern, iterating over the rows, rather than the columns, come up in graphics algorithms, even for things that aren't pixel grids or such. This will become more apparent when we start going over more complex topics.
It should also hopefully be pretty clear how to replace this "black" with another color, so I won't bother explaining that. I will, however, up the ante. Let's try filling this rectangle with something a bit more fancy. ... Let's try a gradient.
Space and Time
Gradients aren't actually that tricky, but we do need some basic grounding in one of the most fundamental concepts of computer graphics: linear interpolation, or, the "lerp" for short. Yes, lerping is that important that we give it a special abbreviation, which can even be used as a verb.
It's actually a simple concept. A lerp takes two values, a position parameter, often called time, and returns something in between. A time of 0 gives you the first value. 1 gives you the second value. 0.5 gives you the value halfway in between both.
function lerp(a, b, t) {
return (a * (1.0 - t)) + (b * t);
// It's also sometimes written as:
// return a + ((b - a) * t);
// ... which might be easier to read for some people.
// The two are mathematically equivalent.
}
function draw(imageData, secs) {
var startX = 1;
var endX = 38;
var x = Math.floor(lerp(startX, endX, secs));
var y = 1;
fillRectangle(imageData, x, y, 8, 8);
}
A few more notes. This time variable is often called "t", but I've also seen "position" or "pos", and "alpha". I don't like "position" because I use that to mean a point on our pixel grid, and I don't like "alpha" since it's confusing when we already have an "alpha channel", which is completely unrelated to the lerp here.
The time parameter, "t", is between 0 and 1. In this case, we derive it from the number of seconds that have passed in the animation, so it is quite literally "time". One obvious thing we can do is to warp time. We can multiply to speed it up, divide it to slow it down, but we can also warp it in more fancy ways. For instance, to make it slow down near the ends, we can warp "t" by passing it through a famous easing curve known as "smoothstep":
function lerp(a, b, t) {
return (a * (1.0 - t)) + (b * t);
}
function smoothstep(t) {
return t*t*(3 - t*2);
}
function draw(imageData, secs) {
var startX = 1;
var endX = 38;
var smoothSecs = smoothstep(secs);
var x = Math.floor(lerp(startX, endX, smoothSecs));
var y = 1;
fillRectangle(imageData, x, y, 8, 8);
}
... which looks a bit easier on the eyes. Even though "t" stems from the word "time", as in the math-y "f(t)" sense of the word, it's important to realize that we can use it for more than just time, and we can lerp more than just the rectangle's position. For instance, we can lerp between two colors with just a bit more code.
function newRGB(r, g, b) {
return { r: r, g: g, b: b };
}
// Lerp between colors "color1" and "color2".
function lerpRGB(color1, color2, t) {
var newR = lerp(color1.r, color2.r, t);
var newG = lerp(color1.g, color2.g, t);
var newB = lerp(color1.b, color2.b, t);
return newRGB(newR, newG, newB);
}
This isn't doing anything more fancy than just doing a lerp across all three components in a color, and if we draw a ton of 1px-wide rectangles that all use this:
function fillPixel(imageData, x, y, rgb) {
var idx = indexForPixelLocation(imageData, x, y);
imageData.data[idx + 0] = rgb.r;
imageData.data[idx + 1] = rgb.g;
imageData.data[idx + 2] = rgb.b;
imageData.data[idx + 3] = 255; // Alpha
}
function fillRectangle(imageData, rgb, x1, y1, width, height) {
for (var y = y1; y < y1 + height; y++)
for (var x = x1; x < x1 + width; x++)
fillPixel(imageData, x, y, rgb);
}
function draw(imageData) {
var startX = 1;
var endX = 45;
var y = 1, width = 1, height = 8;
var red = newRGB(255, 0, 0);
var blue = newRGB(0, 0, 255);
for (var x = startX; x < endX; x++) {
var t = (x - startX) / (endX - startX);
var rgb = lerpRGB(red, blue, t);
fillRectangle(imageData, rgb, x, y, width, height);
}
}
... we end up with a smooth transition between the colors, also known as a "linear gradient".
Styling our Rectangle
Let's try applying this knowledge to our rectangle drawing code. The biggest change here is that we'll need to modify what colors we draw based on the position in the image. To help us out, let's introduce a new concept, known as the "fill style". We pass the fill style our position, and it returns a color for that position.
// Basic fill style.
function newSolidFill(rgb) {
return function(x, y) {
// A solid fill returns the same color, no matter the position.
return rgb;
};
}
function newRadialGradient(centerX, centerY, radius, centerRGB, edgeRGB) {
return function(x, y) {
// Calculate distance from the center point. Basic Pythagoras.
var distX = x - centerX, distY = y - centerY;
var distance = Math.sqrt(distX*distX + distY*distY);
// If we're outside the circle, then just return the color at the edge.
// This is a choice -- we could instead choose to repeat or ping-pong
// between the colors.
if (distance >= radius)
return edgeRGB;
// Translate the [0, radius] ranged value to a [0, 1] ranged value
// so we can lerp the colors.
var t = distance / radius;
return lerpRGB(centerRGB, edgeRGB, t);
};
}
// The same code as above, but slightly adapted to handle fill styles
// and custom colors.
function fillRectangle(imageData, fillStyle, x1, y1, width, height) {
for (var y = y1; y < y1 + height; y++) {
for (var x = x1; x < x1 + width; x++) {
var rgb = fillStyle(x, y);
fillPixel(imageData, x, y, rgb);
}
}
}
function draw(imageData, secs) {
var startX = 1;
var endX = 38;
var smoothSecs = smoothstep(secs);
var x = Math.floor(lerp(startX, endX, smoothSecs));
var y = 1;
fillRectangle(imageData, x, y, 8, 8);
}
function draw(imageData) {
var x = 20 + Math.floor(Math.cos(t / 500) * 16);
var y = 1;
var red = newRGB(255, 0, 0), blue = newRGB(0, 0, 255);
var gradient = newRadialGradient(x + 4, y + 4, 6, red, blue);
fillRectangle(imageData, gradient, x, y, 8, 8);
}
After we have this ability to lerp between two different colors, the rest of the complexity here is dedicated to figuring out which time "t" we should be using. In the case of a radial gradient, it's actually just the distance from the center point, normalized against the radius.
As an exercise, try working out, using this base, how to have arbitrary gradient stops at different time values, rather than just two colors at the starts and ends.
Drawing Other Shapes
Now that we've become familiarized with the concepts of rendering boxes and fills, let's try our hand at something a tad bit more fancy — rendering other shapes. To start with, we'll actually just draw the shape we just taught ourselves how to draw above: circles. We just learned above how to calculate the time "t" of a point x, y against any circle, and you can visualize that a real circle is simply a bunch of those points where we're inside the radius. So we can just run over our pixel grid, test when we're "inside" the circle, and if so, choose to fill in the pixel.
The only complication here is that we have to pick some start and end bounds for where we start iterating. We could use our entire pixel grid, but we know a bunch of pixels will never be filled in. We need a tight set of pixels. Thankfully, for a circle, it's quite easy to compute: it has a width and height of twice the radius.
function fillCircle(imageData, fillStyle, centerX, centerY, radius) {
var x1 = centerX - radius, y1 = centerY - radius;
var x2 = centerX + radius, y2 = centerY + radius;
for (var y = y1; y < y2; y++) {
for (var x = x1; x < x2; x++) {
var distX = (x - centerX), distY = (y - centerY);
var distance = Math.sqrt(distX*distX + distY*distY);
if (distance <= radius) {
var rgb = fillStyle(x, y);
fillPixel(imageData, x, y, rgb);
}
}
}
}
Oof. What happened here? This doesn't look very... circular. At this point, it might be tempting to just try to brute force your way through the code: changing the <= above to a single <, adding various + 1 and -1s throughout.
There is actually nothing wrong with the above code in the abstract. Instead of this being a simple implementation detail change, the issue with this algorithm is actually a more fundamental and conceptual one, one that causes us to rethink a bit about how we're viewing the pixel grid. You might also have spotted it above in the radial gradient example: the gradient isn't centered, it's sort of down and to the right. These are both related problems.
Sample Location
When we do something like the above when we draw — iterate over a bunch of pixels, and then test whether a pixel should be in or out, we're making use of a concept known as sampling. Basically, we have some functional concept of a shape, like a circle, and we can give it different x and y points and it tells us whether they are inside or outside of the circle. But what do these points actually mean?
Well, we know that in our pixel grid, each one of these numbers corresponds to a pixel. But have we thought about the abstract space where these circle descriptions live? We're talking about a circle centered at, let's say, 5, 5, with a radius of 10. We have to have some concept of mapping this abstract space to the pixel grid. Up until now, we haven't thought about this and have been hacking it together based on what makes sense. But to get this right, we need to think more closely about the relationship between the two.
I'm going to cheat, and for my next figure, show you what this abstract space circle looks like we've been using so far, laid on top of the pixel grid.
Maybe the revelation is clear now about what's actually going on. If not, don't worry. Right now, when we test each pixel against the abstract space circle, we've been testing whether the top left of the square is inside the abstract circle. When you think about it, though, that doesn't quite make sense. Really, what we're trying to ask is "is more than 50% of the pixel square inside the circle". Using something like the pixel's center would more accurately answer that question.
We can do this by adjusting our fillCircle function to test distance against the pixel's center in the abstract space. Since pixel centers are halfway between pixels, all we need to do is add 0.5 to both dimensions before calculating the distance.
function fillCircle(imageData, fillStyle, centerX, centerY, radius) {
var x1 = centerX - radius, y1 = centerY - radius;
var x2 = centerX + radius, y2 = centerY + radius;
for (var y = y1; y < y2; y++) {
for (var x = x1; x < x2; x++) {
var distX = (x - centerX + 0.5), distY = (y - centerY + 0.5);
var distance = Math.sqrt(distX*distX + distY*distY);
if (distance <= radius) {
var rgb = fillStyle(x, y);
fillPixel(imageData, x, y, rgb);
}
}
}
}
That looks a lot better. This also explains the bizarre gradient bug we were seeing earlier. When we were comparing distances in the gradients, we were also comparing distances with the top left of the pixel, rather than the pixel's center. I'll leave it as an exercise to the reader to fix that one.
If you've worked with graphics APIs before, like HTML5 <canvas>, you might have had to add these 0.5 increments yourselves, e.g. to lines, to make the resulting line look sharp. This is because a line is basically a "thin" rectangle which is lineWidth wide, and centered upon the position you give it. HTML5 <canvas> also uses this "pixel center" sampling strategy. Giving it a bit of thought (imagine a vertical rectangle "growing" in width from a pixel's center), and it should be obvious why you need to add 0.5 offsets yourself, and why using a lineWidth on offsets without the 0.5 looked acceptable.
Transparency and Blending
OK, so now we have basic shapes, and basic fills. What would be really cool is to try to add transparency, and to blend multiple shapes together. This is actually easier than you think, at least for a toy implementation. But first, the theory. As a term stolen from the visual effects industry, blending multiple transparent shapes together is formally called "alpha compositing", though I don't like that term very much, for reasons that will become clearer as the rest of the article goes on. I prefer "blending".
For our toy implementation, we'll make some simplifications. Our resulting pixel grid is designed to be displayed directly on my monitor. Since my monitor isn't transparent (at least not yet!), we won't bother changing its storage, and just assume it's full opaque. However, we'll add a new parameter to our fill color: alpha, or the "A" in "RGBA". Alpha is commonly taken to be identical with "transparency", though this isn't fully accurate, as we'll see later (and one of my personal pet peeves)!
We'll also be a bit more formal about our fill parameters. We'll call the fill pattern the
"source image", and we'll call the pixel grid that's being filled the "destination image". To blend
an RGBA "source image" into the opaque "destination image", instead of just setting the values like
the old fillPixel
did... we lerp them!
function newRGBA(r, g, b, a) {
return { r: r, g: g, b: b, a: a };
}
function getPixel(imageData, x, y) {
var idx = indexForPixelLocation(imageData, x, y);
return newRGB(imageData.data[idx + 0],
imageData.data[idx + 1],
imageData.data[idx + 2]);
}
function blendPixel(imageData, x, y, src) {
var dst = getPixel(imageData, x, y);
// Lerp using the src's alpha to blend.
var blended = lerpRGBA(dst, src, src.a);
fillPixel(imageData, x, y, blended);
}
It's a bit clunky, but it works fine. If you think about it, it makes sense too: at 0% alpha, you want the untouched pixel grid (the destination), and at 100% alpha, you want the source fully filled in between, and at 50%, you want half of one, half of the other.
Anti-aliasing
So, this is looking a lot better. We have shapes, we have colors and gradients. But it still doesn't look great. The edges are all "jaggies", like you might see out of the Pencil tool in Photoshop or something made entirely in MS Paint. Looking at the zoomed in pixel grid vs. the abstract one, it should be obvious what the problem is: the pixel grid is much, much coarser than the abstract grid! In signal processing terms, we're aliased: to construct our pixel grid, we're sampling from a much higher frequency space, the abstract grid, and that results in aliasing artifacts.
... OK. If that was a bit too technical, here's a quick signal processing intro: the word "frequency" just means "how fast things change". In our case, these "changes" are basically "how fast" our circle is changing, in the abstract grid case, and how fast our pixels are allowed to change, in the concrete grid case. Our abstract circle changes from "being inside" to "being outside" much faster than how often the grid can change, or, at a "higher frequency".
... Erm, that might also be too technical. Imagine a rectangle in our abstract grid that changes rapidly from black to white over and over again.  This is known as a moire pattern, and it happens when we can't sample fast enough or fine enough for the source.
Signal processing theory tells us that in order to prevent artifacts like this, we have two options: sample faster, or just remove the high frequencies altogether. Computer graphics implementations, conceptually, do the former, and then downsample using a special filter that blends the pixels to avoid artifacts.
... OK. That might have been a bit technical. Let's back to code. The easiest way to sample at a high frequency is to literally just sample more. This is an approach known as supersampling, since we're sampling at a higher, or "more super", frequency. Before we do it though, we're going to need to refactor our code a bit and introduce a bit of infrastructure so we can sample at arbitrary points. The first thing we're going to do is take that if statement testing if the point is inside the circle, and move it out into a new function.
function insideCircle(centerX, centerY, radius, sampleX, sampleY) {
var distX = (sampleX - centerX), distY = (sampleY - centerY);
var distance = Math.sqrt(distX*distX + distY*distY);
return (distance <= radius);
}
We also remove the "center pixel" 0.5 bias, because this will be part of our passed in sample point. This gives us a nice functional sampling test. Now, for each pixel, we're going to sample it 16 different times, and collect the results. Watch closely. The code is going to be a bit hairy, but I'll explain it afterwards.
function fillCircle(imageData, fillStyle, centerX, centerY, radius) {
// Sample the shape 16 times in a 4x4 grid.
var nSubpixelsX = 4;
var nSubpixelsY = 4;
var x1 = Math.floor(centerX - radius), y1 = Math.floor(centerY - radius);
var x2 = Math.ceil(centerX + radius), y2 = Math.ceil(centerY + radius);
for (var y = y1; y < y2; y++) {
for (var x = x1; x < x2; x++) {
// Compute the coverage by sampling the circle at "subpixel"
// locations and counting the number of subpixels turned on.
var coverage = 0;
for (var subpixelY = 0; subpixelY < nSubpixelsY; subpixelY++) {
for (var subpixelX = 0; subpixelX < nSubpixelsX; subpixelX++) {
// Sample the center of the subpixel.
var sampX = x + ((subpixelX + 0.5) / nSubpixelsX);
var sampY = y + ((subpixelY + 0.5) / nSubpixelsY);
if (insideCircle(centerX, centerY, radius, sampX, sampY))
coverage += 1;
}
}
coverage /= nSubpixelsY * nSubpixelsY;
// Quick optimization: if we're fully outside the circle,
// we don't need to compute the fill.
if (coverage === 0)
continue;
var rgba = fillStyle(x, y);
// Apply coverage to the alpha.
rgba = newRGBA(rgba.r, rgba.g, rgba.b, rgba.a * coverage);
blendPixel(imageData, x, y, rgba);
}
}
}
There's quite a lot to go through here, but the core important idea is that for each pixel, we're sampling the abstract grid 16 times, and then using that as an average to figure out "how solid" this pixel should be. In essence, we're faking a more compact pixel grid by adding a bit of fuzziness to the edges. There's a few more important conceptual details here: first, we can't represent all colors with these "fuzzed edges". We are trading color depth for the appearance of more space. This is why it's hard to "un-anti-alias" pictures in Photoshop if you've ever tried to remove a background or similar: because some of the original color was lost!
Secondly, note the use of the word coverage, which tells you how much of the concrete pixel was covered by the abstract shape. Note that we also put this coverage value into the alpha of our source, even though it's conceptually not a transparent image. This is important: the alpha channel of an image isn't only just for transparency, it's also used for pixel coverage, though they do end up blending the same, and so we tend to combine the two into one channel.
One other thing: You might notice that I'm not computing the fill style at every subsample, only the shape's coverage. This is an optimization known in the 3D graphics world as multisampling. The hope is that the fill color of just the pixel's center really doesn't change from an average of all possible sample points, but the coverage does. When you go into a game's advanced settings and turn on "MSAAx16", this is exactly the algorithm that runs there.
You might also notice that the animation still seems a bit "jerky". This is because I'm drawing
the circle locked to the pixel grid with a Math.floor
. But now we can represent
arbitrary sample points thanks to proper antialiasing. Taking the Math.floor
lets
us draw with something like drawCircle(3.5, 2.32, 6.7);
, to pull some numbers at
a hat. Our abstract grid can represent fractions of pixels just perfectly, and, with us taking
multiple samples, our circle should look a lot more... well... circular, with fractional
sample positions.
I've also slowed down time and given you a visualizer tool to see the subpixel sampling in action. Just hover over a pixel to see the details of it.
Also, now that we can draw shapes starting at any pixel, we have to be a bit more careful computing
the bounding box to help accomodate this. Note the additions of Math.floor
and
Math.ceil
above; I sneakily put those in there, but they are required for this to work
correctly. Otherwise, the X and Y values we pass to blendImage
would be fractional,
and our attempts at setting the memory array would fail on fractional indexes.
And last, I should mention. Super- or multisampling are not the only approaches to doing antialasing. Another approach here is to use analytic methods to figure out how much area the shape actually covers. The common algorithm for this is commonly attributed to Raph Levien in the libart rendering library. I might do an interactive article for this some other day, but for now, I'll link to Sean Barrett, who has an excellent whiteboard explanation up on his website. The sampling approaches are easier to understand, much more visualizable and obvious to the theory, and give us pretty great results.
Coming up next...
This was probably already a huge article to read through. Thank you for making it to the bottom!  As always, this is only the starting point of a much deeper subject. I welcome all comments and questions, including ideas for additional demos to help make hard-to-understand concepts either. Email me, open a GitHub issue, play around with the code and see what you can make happen. The code for every single demo seen today is open-source, with extra comments about what's going on. It's also a bit more complete and refactored than what you see in the article itself. Perhaps you can take some inspiration from that!
My plan is that next time, we'll expand on graphics further with fun things like linear transformations, more shapes, like complex filled polygons, bezier curves, and maybe a bit of extra fun stuff with perspective-textured triangles. That said, these plans aren't finalized, and if you would like me to cover something extra, ideas are always welcome!
Thank you to everyone that left comments on the last article I made. This article has been a long time coming. Since my last one was written, I've made a personal decision to leave the Linux, X11, and Wayland worlds mostly behind. However, I'm still at a job where I interact with graphics every day, and I, of course, will never tire of teaching people stuff. Even if it takes me a year to actually finish an article. I'm hoping the expanded focus will help a lot with my motivation, though.


title or tooltip -- use proper quotes too display correctly
My first paragraph.
My second paragraph.
HTML5 tags are not case sensitive but Use Lowercase Tags always
Use HTML headings for headings only. Don't use headings to make text BIG or bold. Search engines use your headings to index the structure and content of your web pages. Users skim your pages by its headings. It is important to use headings to show the document structure. h1 headings should be main headings, followed by h2 headings, then the less important h3, and so on.
Bold Italic Underline
Most browsers will display HTML correctly even if you forget the end tag but XHTML, do not allow you to skip the end tag
paragraph 1 2 3 4
poem -- predefine 1 2 3 4
This W3Schools is a link <-- The href Attribute
br - tag use for enter next line known as Empty HTML Elements
Google link head -- nothing to do with HTML headings, contains meta data are not displayed, placed between the "html" tag and the "body" tag
meta / meta data -- used to define the character set, and other information about the HTML document
hr -- tag creates a HTML Horizontal Rules/ line in an HTML page.
This is a paragraph.
This is a paragraph.
comment using --
color red
courier font -- paragraph.
paragraph font size -- 160%
Centered paragraph
left paragraph
right paragraph
justify paragraph
This text is normal.
This text is bold -- without any extra importance..
This text is strong -- with added semantic importance.
This text is italic -- without any extra importance.
This text is emphasized -- with added semantic importance.
My favorite color is --deleted (removed) text. blue red.
My favorite inserted (added) text color is red.
This is subscripted text.
This is superscripted text.
q --shortquote-- for short Quotations element defines a quoted section
WWF's goal is to: Build a future where people live in harmony with nature.
blockquote-- for Long Quotations element defines a quoted section, Browsers usually indent blockquote elements.
Here is a quote from WWF's website:
For 50 years, WWF has been protecting the future of nature. The world's leading conservation organization, WWF works in 100 countries and is supported by 1.2 million members in the United States and close to 5 million globally.
abbr for Abbreviations -- defines an abbreviation or an acronym give useful information to browsers, translation systems and search-engines.
The WHO was founded in 1948.
cite -- elements in italic. defines the title of a work.
The Scream by Edward Munch. Painted in 1893 bdo-- element is used to override the Reverse current text direction: --
This text will be written from right to left
Address -- Contact Information, element defines contact information (author/owner) of a document or article, usually displayed in italic. Most browsers will add a line break before and after the element.
AddressThe samp element represents sample output from a computer program:
demo.example.com login: Apr 12 09:10:17 Linux 2.6.10-grsec+gg3+e+fhs6b+nfs+gr0501+++p3+c4a+gr2b-reslog-v6.189
var x = 5;
var y = 6;
document.getElementById("demo").innerHTML = x + y;
Einstein wrote: E = mc2.


Riddle
Get in touch
Home
About
Work
Contact
I’m a freelance
digital designer
, with +10 years of experience
All
Web design
Digital design
3D Renedering
Brand Identity
+ See Project
+ See Project
+ See Project
+ See Project
+ See Project
+ See Project
+ See Project
+ See Project


| redistribute {pbdDMAT} | R Documentation |
Takes either an R matrix and distributes it as a distributed matrix, or takes a distributed matrix and redistributes it across a (possibly) new BLACS context, using a (possibly) new blocking dimension.
reblock(dx, bldim = dx@bldim, ICTXT = .pbd_env$ICTXT) redistribute(dx, bldim = dx@bldim, ICTXT = .pbd_env$ICTXT)
dx |
numeric distributed matrix |
bldim |
the blocking dimension for block-cyclically distributing the matrix across the process grid. |
ICTXT |
BLACS context number for return. |
distribute()
takes an R matrix x
stored on the processes in
some fashion and distributes it across the process grid belonging to
ICTXT
. If a process is to call distribute()
and does not yet
have any ownership of the matrix x
, then that process should store
NULL
for x
.
How one might typically use this is to read in a non-distributed matrix on
the first process, store that result as the R matrix x
, and then have
the other processes store NULL
for x
. Then calling
distribute()
returns the distributed matrix which was distributed
according to the options bldim
and ICTXT
.
Using an ICTXT
value other than zero is not recommended unless you
have a good reason to. Use of other such contexts should only be considered
for advanced users, preferably those with knowledge of ScaLAPACK.
redistribute()
takes a distributed matrix and redistributes it to the
(possibly) new process grid with BLACS context ICTXT
and with the
(possibly) new blocking dimension bldim
. The original BLACS context
is dx@ICTXT
and the original blocking dimension is dx@bldim
.
These two functions are essentially simple wrappers for the ScaLAPACK
function PDGEMR2D, with the above described behavior. Of note, for
distribute()
, dx@ICTXT
and ICTXT
must share at least one
process in common. Likewise for redistribute()
with xCTXT
and
ICTXT
.
Very general redistributions can be done with redistribute()
, but
thinking in these terms is an acquired skill. For this reason, several
simple interfaces to this function have been written.
Returns a distributed matrix.
## Not run: # Save code in a file "demo.r" and run with 2 processors by # > mpiexec -np 2 Rscript demo.r library(pbdDMAT, quiet = TRUE) init.grid() if (comm.rank()==0){ x <- matrix(1:16, ncol=4) } else { x <- NULL } dx <- distribute(x, bldim=c(4,4)) print(dx) dx <- redistribute(dx, bldim=c(3,3)) print(dx) finalize() ## End(Not run)


VTA
grievance management system
Select Type of the Complainer
student
parent
staff
non-teaching staff
grievance cell member
admin
Register
Already have an account ?
Login


iOS Roaming Settings
Setting 1:
Loading...
[
Increment value 1
]
Setting 2:
Loading...
[
Increment value 2
]
Setting 3:
Loading...
[
Increment value 3
]


Before Change
// postsubmits from the kubeflow/manifests repo
for repo in repos:
for key, value in repo.items():
if value == "https://github.com/kubeflow/manifests/archive/master.tar.gz":
repo["uri"] = str("https://github.com/kubeflow/manifests/archive/pull/" + str(
os.getenv("PULL_NUMBER")) + "/head.tar.gz")
logging.info(str(config_spec))
return config_spec
def kfctl_deploy_kubeflow(app_path, project, use_basic_auth, use_istio, config_path, kfctl_path, build_and_apply):
After Change
// See https://github.com/kubernetes/test-infra/blob/45246b09ed105698aa8fb928b7736d14480def29/prow/jobs.md//job-environment-variables // pylint: disable=line-too-long
elif os.getenv("PULL_BASE_SHA"):
version = os.getenv("PULL_BASE_SHA")
if version:
repo["uri"] = ("https://github.com/kubeflow/manifests/archive/"
"{0}.tar.gz").format(version)


"Hey baby, hey baby, hey" (baby, baby) Girls say, girls say, "Hey baby, hey baby, hey" When you rock your hips you know that it amazes me "Hey baby, hey baby, hey" (baby, baby) Boys say, boys say "Hey baby, hey baby, hey" All the boys get the girls in the back |


JS Assignment 1
1. Create a function, which will take 4 parameters, and return the
greater then between them.
2. Create a function, which will take current date, and return your age.
Note. date format should be dd/mm/yyyy.
3. Create a function, which will take 4 numbers and store inside an
array.
4. Create a function, which will take numbers from two input field,
return as result and result should be depend upon your operators.
5. Create a form, which will take some input from input fields, store in
a local storage on browser. Show the results in the table format.
| User Name |
Email |
Phone Number |
Birthday Date |


Projects
XSlider
Sketches
gpgpu-particle-bravo
instanced_skinned_mesh
Tools
Word2html
Tencent Chat Client
Tencent TRTC Client
CodeSandbox
2021/5/22
<model-viewer> test (external)


Session
The session is on {{s.session.sessionDate | date : 'mediumDate' }} from {{s.session.startingTime}} to {{s.session.endingTime}} at {{s.session.village.villageName}}
Notified Sessions will be shown here. You can mark attendance and give feedback of notified session.


Preparation time
less than 30 mins
Cooking time
less than 10 mins
Serves
Serves 4
Dietary
Add some texture to a simple salad with crunchy spring vegetables. Serve with homemade dressing and garlic bread for a healthy light lunch.
This meal is
low calorie
and provides 296 kcal, 13.2g protein, 38.9g carbohydrate (of which 7.2g sugars), 9.2g fat (of which 1.5g saturates), 8.4g fibre and 0.9g salt per portion.
Bring a large pan of salted water to the boil. Place the peas, asparagus and sugar-snap peas in the pan and simmer for 3 minutes. Drain, then refresh under cold running water.
Transfer the vegetables to a large bowl with the courgette ribbons and fennel and mix together.
For the dressing, whisk together the lemon rind and juice, mustard, honey, parsley and half the oil in a separate bowl. Toss the vegetables in the dressing.
Preheat the grill to a hot setting.
For the garlic bread, rub the cut sides of the rolls with the garlic clove, drizzle over the remaining oil, then place the rolls on a baking sheet under the grill and toast on both sides.
Divide the salad between four plates, place the garlic bread alongside and serve.


Nicola Sturgeon plans to help Scottish households save on energy bills
by Scotsman ReporterFirst Minister Nicola Sturgeon will unveil SNP plans to help households save hundreds of pounds on their energy bills on a campaign visit to East Renfrewshire.
Ms Sturgeon joined Kirsten Oswald, SNP candidate for East Renfrewshire, to meet voters and activists at Cafe Roma in Clarkston on Sunday.
Meanwhile, Scottish Liberal Democrat campaign chairman Alex Cole-Hamilton and Edinburgh North and Leith candidate Bruce Wilson will be canoeing down the Water of Leith helping clear up plastic to highlight the party's commitment to improving the environment and developing a sustainable future.
READ MORE:
Scottish council's parking ticket blunder could lead to drivers claiming almost £500,000 in refunds
READ MORE:
Jeremy Corbyn fails to clarify his campaign stance in a second EU referendum
Scottish Conservatives will be campaigning in Glasgow.
Speaking ahead of the visit to East Renfrewshire, Ms Sturgeon said: "If elected, SNP MPs will push for legislation to tackle some of the financial pressures facing families, and which are being made worse by Brexit, including bringing forward a scheme to help households save hundreds of pounds on their energy bills.
"With households spending around 30 billion on gas and electricity each year - an average of around £1,123 - the introduction of a national switching service will help to alleviate some of the financial strains facing households and to ensure people get the best deal possible."


Class: Aws::CognitoIdentityProvider::Types::SchemaAttributeType
| Relationships & Source Files | |
| Super Chains via Extension / Inclusion / Inheritance | |
|
Class Chain:
self,
Struct
|
|
|
Instance Chain:
self,
::Aws::Structure ,
Struct
|
|
| Inherits: |
Struct
|
| Defined in: | gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/types.rb |
Overview
A list of the user attributes and their properties in your user pool.
The attribute schema contains standard attributes, custom attributes
with a custom:
prefix, and developer attributes with a dev:
prefix. For more information, see User pool attributes.
 You can create and update developer-only attributes only with IAM-authenticated API operations. Use app client read/write permissions instead.
Constant Summary
Instance Attribute Summary
-
#attribute_data_type ⇒ String
rw
The data format of the values for your attribute.
-
#developer_only_attribute ⇒ Boolean
rw
You should use [WriteAttributes][1] in the user pool client to control how attributes can be mutated for new use cases instead of using DeveloperOnlyAttribute
. -
#mutable ⇒ Boolean
rw
Specifies whether the value of the attribute can be changed.
-
#name ⇒ String
rw
The name of your user pool attribute, for example
username
orcustom:costcenter
. -
#number_attribute_constraints ⇒ Types::NumberAttributeConstraintsType
rw
Specifies the constraints for an attribute of the number type.
-
#required ⇒ Boolean
rw
Specifies whether a user pool attribute is required.
-
#string_attribute_constraints ⇒ Types::StringAttributeConstraintsType
rw
Specifies the constraints for an attribute of the string type.
Instance Method Summary
::Aws::Structure
- Included
| #to_hash | Alias for Structure#to_h. |
Instance Attribute Details
#attribute_data_type ⇒ String
(rw)
The data format of the values for your attribute.
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/types.rb', line 7091
class SchemaAttributeType < Struct.new( :name, :attribute_data_type, :developer_only_attribute, :mutable, :required, :number_attribute_constraints, :string_attribute_constraints) SENSITIVE = [] include Aws::Structure end
#developer_only_attribute ⇒ Boolean
(rw)
DeveloperOnlyAttribute
.
Specifies whether the attribute type is developer only. This
attribute can only be modified by an administrator. Users won't be
able to modify this attribute using their access token. For example,
DeveloperOnlyAttribute
can be modified using
AdminUpdateUserAttributes but can't be updated using
UpdateUserAttributes.
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/types.rb', line 7091
class SchemaAttributeType < Struct.new( :name, :attribute_data_type, :developer_only_attribute, :mutable, :required, :number_attribute_constraints, :string_attribute_constraints) SENSITIVE = [] include Aws::Structure end
#mutable ⇒ Boolean
(rw)
Specifies whether the value of the attribute can be changed.
Any user pool attribute whose value you map from an IdP attribute
must be mutable, with a parameter value of true
. Amazon Cognito
updates mapped attributes when users sign in to your application
through an IdP. If an attribute is immutable, Amazon Cognito throws
an error when it attempts to update the attribute. For more
information, see Specifying Identity Provider Attribute Mappings
for Your User Pool.
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/types.rb', line 7091
class SchemaAttributeType < Struct.new( :name, :attribute_data_type, :developer_only_attribute, :mutable, :required, :number_attribute_constraints, :string_attribute_constraints) SENSITIVE = [] include Aws::Structure end
#name ⇒ String
(rw)
The name of your user pool attribute, for example username
or
custom:costcenter
.
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/types.rb', line 7091
class SchemaAttributeType < Struct.new( :name, :attribute_data_type, :developer_only_attribute, :mutable, :required, :number_attribute_constraints, :string_attribute_constraints) SENSITIVE = [] include Aws::Structure end
#number_attribute_constraints ⇒ Types::NumberAttributeConstraintsType (rw)
Specifies the constraints for an attribute of the number type.
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/types.rb', line 7091
class SchemaAttributeType < Struct.new( :name, :attribute_data_type, :developer_only_attribute, :mutable, :required, :number_attribute_constraints, :string_attribute_constraints) SENSITIVE = [] include Aws::Structure end
#required ⇒ Boolean
(rw)
Specifies whether a user pool attribute is required. If the attribute is required and the user doesn't provide a value, registration or sign-in will fail.
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/types.rb', line 7091
class SchemaAttributeType < Struct.new( :name, :attribute_data_type, :developer_only_attribute, :mutable, :required, :number_attribute_constraints, :string_attribute_constraints) SENSITIVE = [] include Aws::Structure end
#string_attribute_constraints ⇒ Types::StringAttributeConstraintsType (rw)
Specifies the constraints for an attribute of the string type.
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/types.rb', line 7091
class SchemaAttributeType < Struct.new( :name, :attribute_data_type, :developer_only_attribute, :mutable, :required, :number_attribute_constraints, :string_attribute_constraints) SENSITIVE = [] include Aws::Structure end


Home
Things to do
Country Features
Compare Countries
Download Map
Contibutors
Venkatesh
Pradnyesh
Abhishek
Nikhil
Want to Know More?
Click Let's Go
World FactBook
First Time ?
Let's Go


ProximityReminder
Check reminders
Add Reminder
| Reminder Id | |
| Enabled? | |
| Description | |
| When? |
Start:
End:
Reccurring:
|
| Where? |
Within
|
| Place description | |
| Select location |
|
Reminders
Places
Not connected to webinos


#include <knn.h>
List of all members.
Classes |
| class | Neighbors |
Public Member Functions |
| | KNearestNeighbor (int dimIn, int dimOut) |
| | ~KNearestNeighbor () |
| void | clear () |
| void | exportFile (const char *fileName) |
| void | importFile (const char *fileName) |
| void | saveFile (const char *fileName) |
| void | loadFile (const char *fileName, bool append) |
| void | calculate (const float *vecInput, float *vecOutput, int numNeighbors=1) |
| void | train (const float *vecInput, const float *vecOutput, float weight=1.0f, float alpha=1.0f) |
| void | optimizeTraining (bool enable, float maxError, float maxDistance, int maxSamples=0) |
| int | getNumberOfSamples () |
Protected Member Functions |
| void | append (const float *vecInput, const float *vecOutput, float weight=1.0f, float alpha=1.0f) |
| void | writeStream (ofstream *file) |
| void | readStream (ifstream *file, bool append) |
| float | vecDistQ (const float *vecA, const float *vecB, int dim) |
| void | kNN (const float *input, int dimension, const float *samples, int numSamples, Neighbors *neighbors) |
| float | kNNOutput (const float *sampleOutput, int dimOutput, int idxOutput, const float *sampleWeight, const float *sampleAlpha, int numSamples, Neighbors *neighbors) |
Protected Attributes |
|
int | dimIn |
|
int | dimOut |
|
int | numSamples |
|
floatVector | sampleInput |
|
floatVector | sampleOutput |
|
floatVector | sampleAlpha |
|
floatVector | sampleWeight |
|
bool | enableOptimize |
|
float | maxError |
|
float | maxDistance |
|
int | maxSamples |
Friends |
|
class | KNearestNeighborHashed |
Detailed Description
Implentation of the k-Nearest Neighbor algorithm Features:
Constructor & Destructor Documentation
| Sys::ArtificialIntelligence::LazyLearning::KNearestNeighbor::KNearestNeighbor |
( |
int |
dimIn, |
|
|
int |
dimOut |
|
) |
| |
Creates a new instance of KNearestNeighbor
- Parameters:
-
| dimIn | - The dimension of input vectors (cannot be changed later) |
| dimOut | - The dimension of output vectors (cannot be changed later) |
- Exceptions:
-
| std::invalid_argument | - if an invalid parameter is declared (dimIn or dimOut less than 1) |
| Sys::ArtificialIntelligence::LazyLearning::KNearestNeighbor::~KNearestNeighbor |
( |
| ) |
|
Frees all reserved ressources
Member Function Documentation
| void Sys::ArtificialIntelligence::LazyLearning::KNearestNeighbor::append |
( |
const float * |
vecInput, |
|
|
const float * |
vecOutput, |
|
|
float |
weight = 1.0f , |
|
|
float |
alpha = 1.0f |
|
) |
| [protected] |
Adds a training set (input- and desired output vector)
- Parameters:
-
| vecInput | - Pointer to an input vector. The number of elements must fit the delcared "dimIn" in the constructor. |
| vecOutput | - Desired output vector for the input vector. The number of elements must fit the delcared "dimOut" in the constructor. |
| weight | - [Optional] strength of influence of the sample vector (1.0f by default) |
| alpha | - [Optional] range of influence of the sample vector (1.0f by default) |
- Exceptions:
-
| std::bad_alloc | - if memory allcation fails |
- Returns:
- - none
| void Sys::ArtificialIntelligence::LazyLearning::KNearestNeighbor::calculate |
( |
const float * |
vecInput, |
|
|
float * |
vecOutput, |
|
|
int |
numNeighbors = 1 |
|
) |
| |
Calculates an output vector for the declared input vector. For the calculation the k-Nearest Neighbor algorithm is used. It searches the k (declared in numNeighbors) nearest neighbor vectors for the input vector (*vecInput). As metric the euclidean distance is used (vectors are considered as points here). The dimension of the input vector (*vecInput) and output vector (*vecOutput) must fit the dimensions declared in the constructor (dimIn and dimOut).
- Parameters:
-
| vecInput | - Pointer to an float array which is used as input. The number of elements must fit the delcared "dimIn" in the constructor. |
| vecOutput | - Pointer to an float array which will be filled with the output vector. The number of elements must fit the delcared "dimOut" in the constructor. |
| numNeighbors | - [Optional] How many neighbors are used for interpolation (1 by default) |
- Exceptions:
-
| std::invalid_argument | - if an invalid parameter is declared (NULL-pointer) |
| std::bad_alloc | - if memory allcation fails |
- Returns:
- - none
| void Sys::ArtificialIntelligence::LazyLearning::KNearestNeighbor::clear |
( |
| ) |
|
Removes all training data
- Returns:
- - none
| void Sys::ArtificialIntelligence::LazyLearning::KNearestNeighbor::exportFile |
( |
const char * |
fileName | ) |
|
Writes the whole training data to an ASCII text file. If the file already exits it will be overwritten.
- Parameters:
-
| *fileName | - Path to file which should be created |
- Exceptions:
-
| ios_base::failure | - if opening or writing the file fails |
- Returns:
- - none
| int Sys::ArtificialIntelligence::LazyLearning::KNearestNeighbor::getNumberOfSamples |
( |
| ) |
|
returns the current number of samples added with the train() method
- Returns:
- - number of added samples
| void Sys::ArtificialIntelligence::LazyLearning::KNearestNeighbor::importFile |
( |
const char * |
fileName | ) |
|
Append sample data from an ASCII text file
- Parameters:
-
| *fileName | - Path to file which should be opened |
- Exceptions:
-
| ios_base::failure | - if opening or reading the file fails |
| std::bad_alloc | - if memory allcation fails |
- Returns:
- - none
| void Sys::ArtificialIntelligence::LazyLearning::KNearestNeighbor::kNN |
( |
const float * |
input, |
|
|
int |
dimension, |
|
|
const float * |
samples, |
|
|
int |
numSamples, |
|
|
Neighbors * |
neighbors |
|
) |
| [protected] |
kNN is an implentation of the k-Nearest Neighbor algorithm. It searches the k (declared in numNeighbors) nearest neighbor vectors (in the declared samples array) for the input vector (*input). The declared dimension must fit the dimension within the sample vectors in the sample array. As metric the euclidean distance is used. The nearest neighbors are stored in ascending oder (entry with smallest distance first)
- Parameters:
-
| *input | - pointer to the input vector |
| dimension | - dimension of input vector and sample vectors |
| *samples | - pointer to sample vectors |
| numSamples | - number of sample vectors available |
| *neighbors | - pointer to an array of neighbors |
- Returns:
- - none
| float Sys::ArtificialIntelligence::LazyLearning::KNearestNeighbor::kNNOutput |
( |
const float * |
sampleOutput, |
|
|
int |
dimOutput, |
|
|
int |
idxOutput, |
|
|
const float * |
sampleWeight, |
|
|
const float * |
sampleAlpha, |
|
|
int |
numSamples, |
|
|
Neighbors * |
neighbors |
|
) |
| [protected] |
Calculates the final output for the nearest neighbours determined by the kNN function. The output is weighted by the quadratic distance to the input vector.
- Parameters:
-
| *sampleOutput | - Pointer to an array of output values (index must fit to the index in sample vectors) |
| dimOutput | - dimension of final output vector |
| idxOutput | - current component index of the output vector |
| *sampleWeight | - Pointer to an array of weight values (index must fit to the index in sample vectors) |
| *sampleAlpha | - Pointer to an array of "alpha" values (index must fit to the index in sample vectors) |
| numSamples | - number of sample vectors available |
| *neighbors | - pointer to an array of neighbors filled by a previous call to kNN() |
- Returns:
- output - float value
| void Sys::ArtificialIntelligence::LazyLearning::KNearestNeighbor::loadFile |
( |
const char * |
fileName, |
|
|
bool |
append |
|
) |
| |
Loads sample data from an binary file
- Parameters:
-
| *fileName | - Path to file which should be opened |
| append | - true if samples should be appended, false if samples should be replaced |
- Returns:
- - none
| void Sys::ArtificialIntelligence::LazyLearning::KNearestNeighbor::optimizeTraining |
( |
bool |
enable, |
|
|
float |
maxError, |
|
|
float |
maxDistance, |
|
|
int |
maxSamples = 0 |
|
) |
| |
Enables or disables optimized training(disabled by default). If enabled the distance and the difference of the output to the nearest neighbor is checked. If the distance is smaller than "maxDistance" or the relative difference of the output is smaller than "maxError" then no new training set is added. This helps to make sure that the number of traing sets do not grow too fast. However, the train() method can execute substantially slower.
- Parameters:
-
| enable | - enables or disables optimization (disabled by default) |
| maxError | - maximum tolerable relative error (in this case no new traning data is added, instead the old data gets updated) |
| maxDistance | - maximum tolerable distance the input vector can have to its nearest neighbor (otherwise a new traing set is added) |
| maxSamples | - maximum number of samples which can be added with train(). Use "0" if you don't want declare a maximum |
- Returns:
- - none
| void Sys::ArtificialIntelligence::LazyLearning::KNearestNeighbor::readStream |
( |
ifstream * |
file, |
|
|
bool |
append |
|
) |
| [protected] |
Reads samples from an binary stream
- Parameters:
-
| *file | - stream instance |
| append | - true if samples should be appended, false if samples should be replaced |
- Returns:
- - "true" if successfully, "false" if failed
| void Sys::ArtificialIntelligence::LazyLearning::KNearestNeighbor::saveFile |
( |
const char * |
fileName | ) |
|
Saves the whole sample data to a binary file. If the file already exits it will be overwritten.
- Parameters:
-
| *fileName | - Path to file which should be created |
- Exceptions:
-
| ios_base::failure | - if opening or writing the file fails |
- Returns:
- - none
| void Sys::ArtificialIntelligence::LazyLearning::KNearestNeighbor::train |
( |
const float * |
vecInput, |
|
|
const float * |
vecOutput, |
|
|
float |
weight = 1.0f , |
|
|
float |
alpha = 1.0f |
|
) |
| |
Adds a training set (input- and desired output vector)
- Parameters:
-
| vecInput | - Pointer to an input vector. The number of elements must fit the delcared "dimIn" in the constructor. |
| vecOutput | - Desired output vector for the input vector. The number of elements must fit the delcared "dimOut" in the constructor. |
| weight | - [Optional] strength of influence of the sample vector (1.0f by default) |
| alpha | - [Optional] range of influence of the sample vector (1.0f by default) |
- Exceptions:
-
| std::invalid_argument | - if an invalid parameter is declared (NULL-pointer) |
| std::bad_alloc | - if memory allcation fails |
- Returns:
- - none
| float Sys::ArtificialIntelligence::LazyLearning::KNearestNeighbor::vecDistQ |
( |
const float * |
vecA, |
|
|
const float * |
vecB, |
|
|
int |
dim |
|
) |
| [inline, protected] |
Calculate the squared euclidean distance between the two vectors (vectors are considered as points here)
- Parameters:
-
| *vecA | - pointer to first vector |
| *vecB | - pointer to second vector |
| dim | - dimension of both vectors |
- Returns:
- - quadratic distance as float
| void Sys::ArtificialIntelligence::LazyLearning::KNearestNeighbor::writeStream |
( |
ofstream * |
file | ) |
[protected] |
Saves all samples to a stream
- Parameters:
-
- Exceptions:
-
| ios_base::failure | - if opening or writing the file fails |
- Returns:
- - "true" if successfully, "false" if failed
The documentation for this class was generated from the following files:
- knearestneighbor/knn.h
- knearestneighbor/knn.cpp


|
Guting Paper Implementation
Implementation of paper on Optimal Divide-and-Conquer to Compute Measure and Contour for a Set of Iso-Rectangles by Ralf Hartmut Guting
|
Ctree object is used in StripeContour. More...
#include <ctree.hpp>
Public Member Functions | |
| Ctree () | |
| Default Constructor. | |
| Ctree (coord x, lru side) | |
| Constructor accepting coord and lru. More... | |
| Ctree (coord x, lru side, Ctree *lson, Ctree *rson) | |
| Constructor accepting four parameters. More... | |
| bool | ptreq (const Ctree *first, const Ctree *second) const |
| Function to compare two Ctree pointers. Checks if the pointers point to same Ctree. If not, it compares the contents of the two Ctrees. More... | |
| bool | ptrneq (const Ctree *first, const Ctree *second) const |
| Negation of Ctree::ptreq function. More... | |
| bool | operator== (const Ctree &C) const |
| Function to compare two Ctree objects, including their children. More... | |
| bool | operator!= (const Ctree &C) const |
| Function to compare two Ctree objects, including their children. More... | |
| bool | operator< (const Ctree &C) const |
| Function to order the Ctree objects. Priority for ordering - x > side > lson > rson. More... | |
Public Attributes | |
| coord | x |
| coord stored in Ctree | |
| lru | side |
| Denotes whether coord x is left(starting) or right(ending) | |
| Ctree * | lson |
| Pointer to left child. | |
| Ctree * | rson |
| Pointer to right child. | |
Ctree object is used in StripeContour.
Constructor accepting coord and lru.
| [in] | x | coord x |
| [in] | side | lru side |
Constructor accepting four parameters.
| [in] | x | coord x |
| [in] | side | lru side |
| [in] | lson | pointer to left child |
| [in] | rson | pointer to right child |
|
inline |
Function to compare two Ctree objects, including their children.
|
inline |
Function to order the Ctree objects. Priority for ordering - x > side > lson > rson.
|
inline |
Function to compare two Ctree objects, including their children.
Function to compare two Ctree pointers. Checks if the pointers point to same Ctree. If not, it compares the contents of the two Ctrees.
Negation of Ctree::ptreq function.


Rules
Every player starts at 0 point
The game ends when one player has reached the predetermined score.
When a goal is scored, one point is added to every player except the player who get scored.
After each goal the puck is placed in the zone of the one who scored or is put in-between every human player


Building Apps: Dependencies (tclib)¶
Summary¶
The tclib
CLI tool provides a simple interface to download required Python modules in a self-contained folder in the project directory. This “lib” directory allows all dependencies to be bundled within the App. The App dependencies should be defined in the requirements.txt file in the project directory.
Warning
For clients using macOS ® that have Python installed via Homebrew, there is a known bug that requires the creation of a setup.cfg
file in the same directory as requirements.txt
. The setup.cfg
file should have the following code at minimum:
[install]
prefix=
Usage¶
To get the latest usage for tclib
, run tclib -h
.
Important
Running the tcinit
command overwrites any existing “lib” directory.
usage: tclib [-h] [--app_name APP_NAME] [--app_path APP_PATH]
[--config CONFIG] [--no_cache_dir] [--branch BRANCH]
optional arguments:
-h, --help Show this help message and exit
--app_name APP_NAME (Advanced) Fully qualified path of App.
--app_path APP_PATH (Advanced) Fully qualified path of App.
--config CONFIG (Advanced) Configuration file for gen lib. (Default:
tcex.json)
--no_cache_dir Do not use pip cache directory.
--branch BRANCH Build tcex from specified git branch instead of
downloading from PyPi.
Common Usage¶
To build the “lib” directory for the current project, the following is the most common command. This command can also be used to add or remove any changes made to requirements.
tclib
If using a PIP cache, it is sometimes required to tell pip
to ignore the cache in order to pick up the latest package from pypi. Adding the --no_cache_dir
flag to the command will force tclib
to ignore any local cache directory.
tclib --no_cache_dir
Using a Configuration File¶
By default, the tcex.json configuration file will be loaded if it exists. If the configuration includes the lib_versions
parameter array, the tclib
command will use the values defined in the configuration to build the “lib” directories.
Linux
<...snipped>
"lib_versions": [{
"lib_dir": "lib_2.7.13",
"python_executable": "~/.pyenv/versions/2.7.13/bin/python"
},
{
"lib_dir": "lib_3.4.6",
"python_executable": "~/.pyenv/versions/3.4.6/bin/python"
},
{
"lib_dir": "lib_3.5.3",
"python_executable": "~/.pyenv/versions/3.5.3/bin/python"
},
{
"lib_dir": "lib_3.6.5",
"python_executable": "~/.pyenv/versions/3.6.5/bin/python"
}
],
<snipped...>
For ease of management, when building multiple Apps the tcex.json file can contain environment vars defining the Python version (e.g., $env.PY36 for export PY36='3.6.5'
).
<...snipped>
{
"lib_dir": "lib_$env.PY36",
"python_executable": "~/.pyenv/versions/$env.PY36/bin/python"
}
<snipped...>
Windows
<...snipped>
{
"lib_versions": [{
"lib_dir": "lib_2.7.13",
"python_executable": "~\\AppData\\Local\\Programs\\Python\\Python27\\python.exe"
}, {
"lib_dir": "lib_3.6.5",
"python_executable": "~\\AppData\\Local\\Programs\\Python\\Python36\\python.exe"
}]
}
<snipped...>
macOS® is a registered trademark of Apple, Inc.


Amazon offers ad-supported free music streaming service
by The Jakarta PostAmazon.com Inc said on Monday it has introduced an ad-supported free version of its music streaming service Amazon Music, taking on rival Spotify Technology which has nearly 140 million users for its free version.
Amazon offers paid plans for its music service starting at $9.99 per month and it is also part of its prime bundle. The company launched a free version of its music service for Alexa users on Echo devices in September.
Spotify, the world's most popular music streaming service, also offers a "freemium" model that includes a free ad-supported version along with a paid ad-free version at $9.99 per month.
Read also
However, Apple Inc's Apple Music offers only paid subscription service for $9.99 per month and accounts for nearly a fifth of the paid music streaming market, according to Counterpoint Research.
Amazon shares were up nearly 0.5 percent, while those of rival Spotify fell about 5 percent.


uiSelectFocuser
ui.selectTree
Force activation of uiSelect on uiSelectFocus scope event
select
<? ui-select-focuser> ... </?>


Before starting the study, please make sure your environment is distraction-free, and put your browser is in fullscreen mode.
On each task, you will see some grids with colored pixels to the left of the screen (Task Demonstration Grids), a large grid with colored pixels in the middle of the screen (Main Input Grid), and an empty grid to the right of the screen (Main Output Grid).
The Task Demonstration Grids are example pairs of input-output solutions. Your job is to figure out the relationship between input and output from the Task Demonstration Grids, and use that knowledge to fill out the Main Output Grid based on the pattern in the Main Input Grid.
To fill out the Main Output Grid, select a pixel color from the color picker below the grid, and click on pixels to color them in. You have the option to copy over the pixels from the Main Input Grid to the Main Output grid by clicking on the "Copy from Input" button. Clicking on the "Reset Grid" button will unfill all pixels in the Main Output Grid. Once you have completed your solution, click on the green "Submit" button.
If your solution is correct, you will proceed to the next task. If it is incorrect, you have up to 3 tries to get the correct solution. Solve the tasks as quickly but accurately as possible.


§664-36 Appeal. Any party aggrieved by the judgment of the court may appeal therefrom to the intermediate appellate court, subject to chapter 602, in the manner and within the time provided for civil appeals from the circuit courts. [L 1886, c 69, §6; am L 1888, c 26, §6; am L 1907, c 56, §6; RL 1925, §2941; RL 1935, §3682; am L 1939, c 19, §4; RL 1945, §10223; RL 1955, §234-35; HRS §664-36; am L 1972, c 90, §6(q); am L 2004, c 202, §77; am L 2006, c 94, §1; am L 2010, c 109, §1]
Case Notes
Findings may not be set aside unless clearly erroneous, HRCP rule 52(a) being applicable. 54 H. 174, 504 P.2d 1330 (1973).
Cases prior to adoption of the Hawaii Rules of Civil Procedure.
Court authorized on appeal to render such judgment as shall be just and equitable. 9 H. 651 (1895); 10 H. 174 (1895). Evidence insufficient. 10 H. 133 (1895); 10 H. 453 (1896). Record. 21 H. 173, 174 (1912).
Findings, weight. 23 H. 595, 601 (1917); 24 H. 47, 53 (1917).


| # | First Name | Last Name | Username |
|---|---|---|---|
| 0 | James | Smith | jsmith |
| 1 | John | Johnson | jjohnson |
| 2 | Robert | Williams | rwilliams |
| 3 | Michael | Jones | mjones |
| 4 | Wiliam | Brown | wbrown |
| 5 | David | Davis | ddavis |
| 6 | Richard | Miller | rmiller |
| 7 | Charles | Wilson | cwilson |
| 8 | Joseph | Moore | jmoore |
| 9 | Thomas | Taylor | ttaylor |


---
title: Is Programmatic Advertising the Future of Marketing? - HBR
date: '2015-06-23T08:23:39+05:30'
tags:
- ml
tumblr_url: https://sureshshanmugam.com/post/122219053284/is-programmatic-advertising-the-future-of
---
Is Programmatic Advertising the Future of Marketing? - HBR


I am a Full-Stack Developer who is design-minded. Most of my work has been with JavaScript. Although I am currently in love with the M.E.R.N. stack, I always enjoy learning and working with new technologies. You can view my resume here, and you can view some of my latest projects down below.
A React.js application that allows users to search for and locate hotel rooms. This app features Google Maps API integration and allows users to filter the search results based on certain parameters, in which case the results will automatically re-render to display updated search results.
A Computer Vision application that uses realtime object detection to identify books and shoes. I created and trained the deep learning model using IBM Cloud Annotations and IBM Watson Machine Learning. The application itself was forked from Github. I only made visual changes to the app and optimized for mobile. This is hosted on Heroku and is SSL-encrypted using Cloudflare.
A Node.js app that uses Cheerio.js to scrape the web (FinViz.com) for news articles, and stores them in a MongoDB database. Links to those articles are then pulled from the database and displayed on the homepage, and users can also create/delete comments on each article. This app uses mLab for hosting the database.


The Adroid platform has many features for increase the security in the device. Those features can really provide more power to protect ours information, but the Android is open source, that meaning all strategy used can be validated by all those wants know how they work.
At this moment we will verify the Pattern Lock Screen security feature. The feature protect your device with a draw pattern on the screen, but, this pattern has some limitations that lead us how we can break this security item.
Let's explain three those limitations:
a) First of all, the discussion universe is very limited, we have only nine dots in the screen. This limitation has a important contribution for break the pattern, because when we use a brute-force strategy, we will have less possibilities to test;
b) We can not pass a dot more the once. This limitation increase the item (a), because we have a set of nine items and they can not duplicated, we have a combinatorial analysis problem to solve;
c) The minimum of dots used in the patter can not be less than four;
How we can see, that's all about math.
In this combinatorial problem we have the situation:
Nine distinct elements.
They can be arranged in one of theses possibilities:
4x4 ; 5x5 ; 6x6 ; 7x7 ; 8x8 ; 9x9
So, let's make some considerations:
Do you remember the initial figure? We can see those dots with a Cartesian plain:
So, we have know nine dot in the plain. This is important because in the Android's source code, that is exactly the same way how they are treated. For simplification, we can set a number representing each one of those dots:
If you get the Android source code on the GitHub, you can navigate into the package com/android/internal/widget:
you will see two important classes:
Well, let's see those two classes more close:
On the file LockPatternUtils.java in line 797, we have the important method patternToHash, this method receive a list of LockPatternView.Cell objects and returns byte array to be persisted in your device.
Well, only we can do is use this method to create a rain table with all possible hashes SHA-1. This rain table will be used in a attack brute-force.
Let's see how LockPatternView.Cell looks like:
the code of this class Cell end in line 187. We will need this class too.
So, all we can do is create a class Cell with the same structure, and use a little creativity to generate a rain table with all possible values.
The algorithm to create a rain table with combination 9 elements, 4x4 is:
Well, not so beautiful, but they do what i want ;-). With the same algorithm and a little modification we can have the method for 5-6-7-8-9 rain table. The file resulted in this process looks like:
All we can do is get the patters when it is saved on device. But how can we do this? Its very simple: "Use the force Luke, and the force will be with you, allways.", read the source code!!!
In the class LockSettingsService.java, we can see clearly:
In line 73 we found the name of the file. And in the same file, we can found how the system use this information:
So, at this moment we have a way to attack with brute-force a patter protection.
So let's see a sample:
Remember the pattern in the first image in this article. This pattern create a file gesture.key with this content:
View with vi on Linux
All we can do is get any hex editor and visualize this content, i do prefer the hex editor
dhex but you are free to use whatever you want.
If you make you rain table with the algorithm explained here you have now six files, each one with all possibilities of a combination pattern. Use the value get in dhex: 810B89341057265D720605CF83A00FFF7981E116
All we have to do now is use some way to find this content into the rain table. I am currently using the following script:
$ cat *.tb | grep "$(xxd -l 16 -u -g 16 gesture.key | cut -d \ -f2)"
[1][5][9][6][3][2][8][7][4] = [810B89341057265D720605CF83A00FFF7981E116]
How you can imagine, [1][5][9][6][3][2][8][7][4] represents the sequence to be performed in the pattern to access the phone.
That's all. Tanks.


Introduction
15 million Americans have food allergies. More and more young people are suffering from food allergies with the number of allergic children growing.
We found that fear of getting a reaction when dining out impairs their social aspect of life and the exhausting process of searching and communicating also increase their anxiety.
Thus, we designed a humane chatbot that provides restaurants’ allergy accommodation information based on users’ allergens on the instant messaging platforms young adults are familiar with.
This project was selected as the finalist (Top 12) in CHI 2017 Student Design Competition.
My Role
In a team of 5, I worked as the user researcher, UX designer and video producer.
Tool
- Sketch
- Principle
- Adobe Premiere


There are few ways to come to Multimedia University. Please take note this event ends at around 3:00AM, most of the public transportation are not operating at the hour.
If you are coming from outside Cyberjaya/Putrajaya, you need to take KLIA Transit to Multimedia University. Fare starts from RM4.70 and up to RM25.00.
Please take note that KLIA Transit does not go directly to Multimedia Universty. You need to take Public Bus or Taxi from Putrajaya Sentral to Multimedia Unversity.
Nadi Putra is the only public bus service operating in Cyberjaya/Putrajaya area. Take Nadi Putra T520 from Putrajaya Sentral and alight at Multimedia University. The fare from Putrajaya Sentral to Multimedia University is RM1. Please take not Nadi Putra does not accept Touch 'n Go.
Taxi is available in Cyberjaya area. The fare from Putrajaya Sentral to Multimedia University is usually RM12.
Parking is available at Multimedia University. Use Google Maps or Wave to navigate to Multimedia University.


?Hl
L.
.
H
A
0
1
2
cm
3
4
’
5
6
7
copy
8
9
right
reser
10
ved
i
lRDEN
[?
Èfa
01529879
Legend -
Level of confidence that token is an accurately-transcribed word
extremely low
very low
low
undetermined
medium
high
very high


Hung Tran is an undergraduate student of computer science pursuing a bachelor of science at UC San Diego.
Created an Android application for measuring human reaction time and decision making to stimuli in comparison to previously run experiments on rats
Designed an implementation of a pathfinding algorithm in C# to provide framework for a turn based strategy game


Simulations are believed by no one except those who conducted them.
Experimental results are believed by everyone except those who conducted them.
ANONYMOUS
The SMASHI project aims to predict modern Water Balance of the Small Aral Sea based on various state-of-the-art physically-based and machine learning modelling approaches which dynamically assimilate new sources of climate reanalysis, remote sensing, and field survey data.
Try the Small Aral Sea Water Balance App!


[1]
amazing from when you first arrive , for a glass of champagne , until you leave .
[2]
a party of three and it was quite cramped when the sofa bed was up .


While on vacation, tourists may find it difficult and expensive to rent cars and purchase insurance if they lack an international driving license. Public transit can also be difficult to navigate in foreign languages. Public bike sharing systems breaches the barrier of other expensive transit options and offers a healthier alternative to exploration.
BikeRack allows users to pre-plan their destinations by locating city bike stations worldwide, allowing for an eco-friendly, affordable method of transit while travelling.
Use our search feature and enter a city, country or company name.
BikeRack will display
a list of bike sharing stations based on your input.
By selecting city or
country, view all bike sharing stations within the vicinity.
By selecting company, view all locations
that the company services.
Optionally, create an account with us by signing up, or log in if you already
have an account to access additional features!
BikeRack is a project created by a team of 4 university students at the University of Toronto.


"When quoting multiple consecutive paragraphs of text, be sure to follow this hard and fast rule:
"Begin each paragraph with quote marks.
"Do not close every paragraph with quote marks.
"The only paragraph which should have both open and close quotes is the final paragraph being quoted."


Simulations
The following pages (which you can reach via the thumbnails below) are a series of experiments of ways of simulation hydrologic and meterologic processes. These were originally in C, then C++ then Java and lately in JavaScript/WebGL. As a result of this process, what is here is by no means complete, but as I finish the JavaScript/WebGL conversions I will post them here.


New Blog Format Professional Blog of Ed Smith
This is an attempt at blogging with new platform, Jekyll. I had been using Drupal but grew frustrated with the amount of bloat it comes with.
Bear with me while I learn how to use this.
This is an attempt at blogging with new platform, Jekyll. I had been using Drupal but grew frustrated with the amount of bloat it comes with.
Bear with me while I learn how to use this.


Travis/Williamson County 2021 Voter Turnout
by Charlie Henry
UNOFFICIAL - Through All of Early Voting


Urban Legend * * * 1/2 (out of * * * * ) Directed by Jamie Blanks. Cast: Alicia Witt, Jared Leto, Rebecca Gayheart, Tara Reid, Michael Rosenbaum, Loretta Devine, Joshua Jackson, John Neville, Natasha Gregson Wagner, Danielle Harris, Robert Englund. Running Time: 100 minutes.  Back in the early 1980's, there was a slasher movie craze, and it eventually burned out because the films simply weren't any good, reaching for the lowest-common-denominator in filmmaking. But then 1996's "Scream," a genre-shattering horror flick suddenly revived the genre, and since then we have been bombarded with new horror movies, and the strange thing is, ever since then, they could be divided easily into two categories: the great ("Scream," "Scream 2," "I Know What You Did Last Summer") and the awful ("An American Werewolf in Paris," "Wishmaster"). Usually you can tell before you see one of these little fright items whether they are going to be worthwhile or not. And luckily, the new slasher film, "Urban Legend," directed by newcomer Jamie Blanks, fits in the former category: the great. "Urban Legend" stars Alicia Witt (TV's "Cybill") as Natalie, a student of the fictional northeastern college Pendleton University, who becomes convinced after several dead bodies show up that a psychopathic killer is on the loose, murdering people in ways that are based on urban legends (i.e. an axe-wielding killer hiding in the backseat of your car, a babysitter receiving threatening phone calls that are coming from inside the house, etc.). Complicating the story even more is the myth that at the college 25 year ago, a muder spree took place, and the sole survivor was Mr. Wexler (Robert Englund), who, surprise!, is currently teaching the American Folklore class at Pendleton U. As in the "Scream" movies, "Urban Legend" has a lot of fun toying with its audience on who the killer is: could it be Mr. Wexler; Paul (Jared Leto), a journalism major and potential boyfriend of Natalie; the school's janitor; or any number of the other students and staff. Regardless of this minor similarity to "Scream," "Urban Legend" is an original because of the extremely clever, ingenious storyline. Practically no popular legend is left unturned, and all of them are used to spooky effect. There are many things that separate this from those 80's stalk-and-slash movies: the characters aren't all one-dimensional airheads, and the performances are from mostly talented up-and-coming actors; the writing is sharp and often funny, with many in-jokes and tributes to other movies, most noticably "Halloween"; the killer's identity is, for most of the running time, unpredictable; and most importantly, it is actually scary, with many effective, suspenseful set-pieces. Two particular moments that are especially nerve-wracking is the opening scene, set at a gas station, and another set at a radio station. The picture runs at a brisk pace, and is consistently entertaining. The technical credits are superb, particularly the moody cinematography which casts the college as an ominous character of its own, and the down-beat music score. Another plus is that there are very few songs in the movie, and like some of the great genre works, like "Halloween" and "The Exorcist," it relies more on instrumental scores. If there is a negative thing about the resurgence of the horror genre, it is usually the climax, which reveals the killer's identity and then becomes an example of overacting, and loses its frightening grip. Not here. In "Urban Legend," the villain, whom will remain nameless, obviously has a lot of fun, and it becomes both menacing and strangely humorous. Oh, and one last thing that is worth mentioning: Loretta Devine, who plays the school's black security guard who is obsessed with Pam Grier and blaxploitation movies, is a standout, stealing every scene she's in. "Urban Legend" is one of the very best of the recent slasher offerings, because it mixes its laughs and chills with more smoothness and grace than usual, and it proves that just because it's a horror movie where people are brutally murdered doesn't mean it still can't be intelligent and impressive filmmaking.
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


| About Dailyrotten |
|
Feedback
If you like this page, hate it, or would like to suggest changes,
<EMAIL_ADDRESS>is listening. This page
is experimental and somewhat different from what we usually offer, so please
do send your feedback.
Adding Stories
If you are a rotten newshound and you would like to suggest a story,
visit our submit page to
send us the URL. Stories that are accepted will have your name credited.
Posting Comments
In order to post comments to stories, you will have to
create an account.
Accounts will generally be validated within 24 hours, and of
course will be disabled if there is abuse.
Viewership
On the first full day this page went live, 100,000 people visited this Rotten
News page. Of course that was the day after the WTC attacks, so that number is
somewhat distorted. Right now this page gets between 50,000 and 75,000 people
every day.
Linking
We encourage everyone to link to this page; if you like it, others probably
will as well.
Other Rotten
Rotten
Gaping Maw
Celebrity Morgue
Mugshots
Rotten Store
Rate My Poo
Rate My Kitten
Penny Postcards
Phallic
Boners
Home
Make Dailyrotten your start page
|
|
|
November 22, 2001
CIA run anonymous web service closes
Washtech | Submitted by: Soylent
Safeweb, which provided web surfing anonymization and which
was largely backed by the CIA, has turned off the service. It was
intended for use by surfers in despotic countries to prevent
web censorship, but who knows exactly what intelligence data would
be quietly gathered by the CIA during its operation.
|
|
Read article...
|
|
Turkey was asking for it
Youngstown Vindicator | Submitted by: Soylent
"That turkey has been in the neighborhood for months," Warren said.
"I saw the turkey around those homes before this happened. The turkey
never bothered anyone, but now, three days before Thanksgiving, we
have an officer chasing it with a shotgun." [I think the answer is quite
obvious: Dinner.]
|
|
Read article...
|
|
Nintendo game sparks police raid
The Vancouver Province | Submitted by: Soylent
A busybody neighbor spying through a window saw what she thought was
a firearm, but a police SWAT team later determined to be a Nintendo
gaming system. The complaint was over a "male with a gun passed out in
a basement surrounded by drug paraphernalia." The drug paraphernalia,
we can only assume, was Pixiesticks and Zotz, or their Canadian equivalents.
|
|
Read article...
|
|
Air Canada security sucks
Globe and Mail | Submitted by: Soylent
Canadian reporter tests airline security, even boarding airliners with
box cutters, not merely once but four times: all of them successfully penetrating security. What is Air Canada's reaction? They demand
that the reporter state in writing that she will not try to
do it again.  In fact, it seems more
probable that indeed it was shot down, from the distribution of the
wreckage to the circumstances witnessed by certain air traffic controllers.
"Controllers have also learned that an F-16 fighter closely pursued hijacked
United Airlines Flight 93 until it crashed in southwestern Pennsylvania,
the employee said." This article dated two days after the attacks, pointed
out by the Unknown News folks.
|
|
Read article...
|
|
Music tycoon jailed over boys
Sydney Morning Herald | Submitted by: Ross
Music industry mogul Jonathan King, formerly involved with such bands as
Genesis and the Bay City Rollers, is in jail for seven years because of
a hobby of his.
"Prosecutor David Jeremy said King invited the boys to his home, where he
showed them sexy pictures and films and then assaulted them. Afterward, he
gave them gifts, including records and T-shirts and sometimes took them
home in his brown Rolls-Royce."
|
|
Read article...
|
|
A place we call the Zoo
London Times | Submitted by: Soylent
Documenting the often bizarre treatment of Western prisoners by the
Taliban, though while not torturous, at least somewhat confusing:
"The youngest of the German prisoners, Kati Jellinek, 29, was blonde
and of particular interest to the Taleban. When she was arrested, five
men with Kalashnikovs demanded that she pack, unpack and repack
her underwear." [In full compliance with Islamic Law, no doubt.]
|
|
Read article...
|
|
The Eyesore Awards
Scotsman | Submitted by: Soylent
Mediocrity will be rewarded wherever it is found.
"Six contenders have been nominated for the most dismal place in
Scotland. Dumbarton and Cumbernauld town centres, the Exchange and
Haymarket Station in Edinburgh, together with Aviemore and Gretna Green,
are in the running for the Plook on the Plinth Award."
|
|
Read article...
|
|
|
|
|


#include <image_ops.h>
Resize quantized images
to size
using quantized bilinear interpolation.
Input images and output images must be quantized types.
Arguments:
[batch, height, width, channels]
.new_height, new_width
. The new size for the images.Optional attributes (see Attrs
):
Returns:
Output
resized_images: 4-D with shape [batch, new_height, new_width, channels]
.Output
out_minOutput
out_max
Constructors and Destructors |
|
|---|---|
QuantizedResizeBilinear(const ::tensorflow::Scope & scope, ::tensorflow::Input images, ::tensorflow::Input size, ::tensorflow::Input min, ::tensorflow::Input max)
|
|
QuantizedResizeBilinear(const ::tensorflow::Scope & scope, ::tensorflow::Input images, ::tensorflow::Input size, ::tensorflow::Input min, ::tensorflow::Input max, const QuantizedResizeBilinear::Attrs & attrs)
|
Public attributes |
|
|---|---|
operation
|
|
out_max
|
|
out_min
|
|
resized_images
|
Public static functions |
|
|---|---|
AlignCorners(bool x)
|
Structs |
|
|---|---|
|
tensorflow:: |
Optional attribute setters for QuantizedResizeBilinear. |
Operation operation
::tensorflow::Output out_max
::tensorflow::Output out_min
::tensorflow::Output resized_images
QuantizedResizeBilinear( const ::tensorflow::Scope & scope, ::tensorflow::Input images, ::tensorflow::Input size, ::tensorflow::Input min, ::tensorflow::Input max )
QuantizedResizeBilinear( const ::tensorflow::Scope & scope, ::tensorflow::Input images, ::tensorflow::Input size, ::tensorflow::Input min, ::tensorflow::Input max, const QuantizedResizeBilinear::Attrs & attrs )
Attrs AlignCorners( bool x )


Files CCore/inc/Move.h CCore/src/Move.cpp
Files CCore/inc/ToMoveCtor.h CCore/src/ToMoveCtor.cpp
First of all, CCore Move is not a C++ move. Don't mess it up. Move is designed to solve the following task: assume you have an object and you want to move it to another memory location. Once you have an appropriate block of memory, you need to create the copy of the object there and destroy the original object as the one operation. Unlike the copy operation, Move can be implemented as an efficient operation for a wide range of types. This is because we don't need to create an additional state, we just have to replace the existing one into another memory location. So before the operation we have the object and the raw memory, after we have the raw memory and the moved object.
There is a technical difficulty with the Move implementation: C++ requires a some constructor call for the object creation and the destructor call for the object life-time termination (with some minor exceptions). To make the moving derivable we have to use the Move constructor as the implementation point for it.
template <class T> concept bool SwapMovableType = NothrowDefaultCtorType<T> && Has_objSwap<T> ; template <class T> concept bool ReplaceableType = Has_objMove<T> || Has_ToMoveCtor<T> || MoveCtorType<T> || SwapMovableType<T> || CopyCtorType<T> ; template <CopyCtorType T> T * CopyMove(T *obj,Place<void> place) noexcept; // for efficiently copyable classes template <SwapMovableType T> T * SwapMove(T *obj,Place<void> place) noexcept; // for classes with objSwap() and efficient default constructor template <MoveCtorType T> T * MoveMove(T *obj,Place<void> place) noexcept; // for classes with std move template <Has_ToMoveCtor T> T * CtorMove(T *obj,Place<void> place) noexcept; // for classes with Move constructor template <ReplaceableType T> T * Move(T *obj,Place<void> place) noexcept; // general
Normally you should use the function Move() for Move operation. If the destined type is a class type with the method objMove(), it is called to do the job. Otherwise, if the destined type has a Move constructor, CtorMove() is used. Otherwise, if the destined type is std movable, MoveMove() is used. Otherwise, if the destined type is a class type with the method objSwap() and has efficient default constructor, the SwapMove() is used. Finally, CopyMove() is called for copyable types. It is assumed, that such types are efficiently copyable, otherwise a warning is emitted.
The most convenient way to make a class movable is to define the method objSwap() and make it both swappable and movable. But for the sake of efficiency, you may define the method objMove() or the Move constructor. Consider the following example:
struct S { A a; // class A has Move constructor B b; // type B is efficiently copyable C c; // class C has Move constructor // swap/move objects void objSwap(S &obj) { Swap(a,obj.a); Swap(b,obj.b); Swap(c,obj.c); } explicit S(ToMoveCtor<S> obj) // the Move constructor signature : a(ToMoveCtor(obj->a)), // member move with its Move constructor b(obj->b), // member move by copying c(ToMoveCtor(obj->c)) // member move with its Move constructor { } };
The reason to define the Move constructor is to support the further derivation of it. The Move constructor is called in the following context: an object is being moving, the original object will be destroyed by the call of destructor right after Move constructor is finished. Here is the template for the moving of Resource Host Types.
class H : NoCopy { private: ResourceHandle h; // Small Data Type public: H() noexcept { SetNull(h); } H(A a,B b,C c) { h=New(a,b,c); } ~H() { if( NotNull(h) ) Delete(h); } // may help compiler to eliminate the following // // SetNull(h); // if( NotNull(h) ) Delete(h); // end-of-object-life-time; // // sequence of actions // move objects explicit H(ToMoveCtor<H> obj) { h=obj->h; SetNull(obj->h); } };
The class ToMoveCtor<T> is a simple wrapper over the pointer to the type T:
/* struct ToMoveCtor<T> */
template <class T>
struct ToMoveCtor
{
T *obj;
explicit ToMoveCtor(T &obj_) { obj=&obj_; }
T * operator -> () const { return obj; }
template <class S>
ToMoveCtor<S> cast() const { return ToMoveCtor<S>(*obj); }
};
It is solely introduced to designate Move constructors. The method cast() can be used to "touch" a base class subobject in the Move constructor's body.
The method objMove() must follow this pattern:
class SomeClass { public: SomeClass * objMove(Place<void> place); };
It is rarely needed. It must replace the object into another memory location, given by the argument, and return the pointer to the new object. The original object is destroyed after this operation.
The Move constructor of some class looks like:
class SomeClass { public: SomeClass(ToMoveCtor<SomeClass> obj); };
It is a special class member and it is used by the CtorMove() like this:
template <Has_ToMoveCtor T> T * CtorMove(T *obj,Place<void> place) noexcept { T *ret=new(place) T(ObjToMove(*obj)); obj->~T(); return ret; }
This constructor must move the object, and it may assume, that the original object is destroyed right after the move operation. This is different than the C++ move constructor (more relaxed).
Moving with C++ move constructor is performed the same way:
template <MoveCtorType T> T * MoveMove(T *obj,Place<void> place) noexcept { T *ret=new(place) T(std::move(*obj)); obj->~T(); return ret; }
This is the SwapMove():
template <SwapMovableType T> T * SwapMove(T *obj,Place<void> place) noexcept { T *ret=new(place) T(); Swap(*obj,*ret); obj->~T(); return ret; }
It is performed by the creating the default object at the new memory location, then swapping the states with the original object and, finally, by the destroying the original object. This is the model way to do the moving. Other ways must achieve the same result, by more efficiently.