The Raspberry Pi (RPi) has a very underpowered CPU but a very powerful GPU. Using the GPU is not well documented. This chapter looks at drawing, rendering images, etc, using the GPU.
In many ways this chapter is a walk-through of some of the examples
in the RPi's /opt/vc/src/hello_pi
directory.
These are written by a variety of authors, too many to acknowledge
individually. Thanks to all of you!
We discussed OpenMAX in general in the chapter OpenMAX, applying it to sound on the RPi and other systems. OpenMAX is an extremely difficult API to work with - if you have any sense you will walk away right now. By dom: "I have written a fair bit of openmax client code and find it very hard. You have to get an awful lot right before you get anything useful out. Just lots of OMX_ErrorInvalidState, and OMX_ErrorBadParameter messages if you are lucky. Nothing happening at all if you are not..." dom is quite correct - I estimate that my productivity in dealing with this API is done from the proverbial 10 lines per day to less than 10 lines per week. And lots of that is staring at the screen in complete bewilderment as to why it isn't working, with no error messages or anything to tell me what is going on (or isn't).
Just to add a wrinkle to OpenMAX's complexity, you have to be careful to get all the flags correct in compiling programs - or, guess what? - things don't work then either. I suspect it is things like word-alignment that are critical, but I've haven't checked OpenMAX in detail. Here are what seems to work:
INCLUDES = -DSTANDALONE -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -DTARGET_POSIX -D_LINUX -fPIC \
-DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -U_FORTIFY_SOURCE -Wall -g \
-DHAVE_LIBOPENMAX=2 -DOMX -DOMX_SKIP64BIT -ftree-vectorize -pipe -DUSE_EXTERNAL_OMX -DHAVE_LIBBCM_HOST \
-DUSE_EXTERNAL_LIBBCM_HOST -DUSE_VCHIQ_ARM -Wno-psabi -I/opt/vc/include/ -I/opt/vc/include/interface/vcos/pthreads \
-I/opt/vc/include/interface/vmcs_host/linux -I./ -I/opt/vc/src/hello_pi/libs/ilclient -I/opt/vc/src/hello_pi/libs/vgfont
LDFLAGS = -Wl,--whole-archive -lilclient -L/opt/vc/lib/ -lopenmaxil -lbcm_host -lvcos -lvchiq_arm \
-lpthread -lrt -L/opt/vc/src/hello_pi/libs/ilclient -L/opt/vc/src/hello_pi/libs/vgfont \
-Wl,--no-whole-archive -rdynamic
You are welcome to try reducing the number of flags - good luck!
Execution of an OpenMAX component is driven by a state-transition model.
A component will start in the Loaded
state, transition to the
Idle
state and then to the Executing
state.
At least, that is the idea. In practice, the state transitions will
only occur for a component when conditions are exactly
right for that component.
The hardest transition to get right is from Loaded
to
Idle
. Any enabled component has ports which have to be set up
and if that is not done exactly right then nothing will happen.
Being exactly right means that all of the
resources such as buffers have to be allocated and configured
correctly, which is often not so easy.
So most programmers seem to default to disabling
all of a component's ports at the beginning in order that this
transition will occur, and then try enabling them afterwards.
[The dramatic over-emphasis in this section is the result of
bitter experience, both by myself and - I am sure - all of
the other OpenMAX programmers!]
The RPI has a library ilclient
intended to make things easier.
This library is not directly portable - it relies on
VideoCore VC threads.
This could presumably be replaced. The primary assistance that it appears
to give to me is:
ilclient
library manages those callbacks for you
in a generic manner
That sounds awful, essentially turning concurrent programming into sequential programming, but in fact it doesn't matter much: much of the execution flow is just waiting in one thread or another, and this just reduces the number of threads you have to think of... It's also a protective style of programming: by call and wait at least you have some chance of pinning down where your program has silently ground to a halt.
For example, a port for a component may be in disabled state. You can't allocate buffers for it until a call has been made to enable it. Then buffers can be allocated. After that (assuming no other issues) the port should be able to transition to enabled state. So wait for that to occur, to ensure that it does. Typical code is
// enable output port of decoder
OMX_SendCommand(decoder->imageDecoder->handle,
OMX_CommandPortEnable,
decoder->imageDecoder->outPort, NULL);
// and allocate a buffer
int ret = OMX_AllocateBuffer(decoder->imageDecoder->handle,
&decoder->pOutputBufferHeader,
decoder->imageDecoder->
outPort,
NULL,
portdef.nBufferSize);
printf("Output port buffer allocated\n");
if (ret != OMX_ErrorNone) {
perror("Eror allocating buffer");
return OMXJPEG_ERROR_MEMORY;
}
// wait for enable to complete
ilclient_wait_for_event(decoder->imageDecoder->component,
OMX_EventCmdComplete,
OMX_CommandPortEnable, 1,
decoder->imageDecoder->outPort, 1, 0,
TIMEOUT_MS);
printf("Decoder output port enabled\n");
Calls to the ilclient
library will sometimes
throw error messages such as this
assertion failure:ilclient.c:747:ilclient_change_component_state():error == OMX_ErrorNone
Program received signal SIGABRT, Aborted.
0xb6e41bfc in raise () from /lib/arm-linux-gnueabihf/libc.so.6
This doesn't tell you where in your code the call was made, and gives a totally useless error message.
Okay (you may think), run it
inside a debugger such as gdb
and when it stops,
ask for a backtrace:
(gdb) where
#0 0xb6e41bfc in raise () from /lib/arm-linux-gnueabihf/libc.so.6
#1 0xb6e4597c in abort () from /lib/arm-linux-gnueabihf/libc.so.6
#2 0xb6f825a4 in ?? () from /opt/vc/lib/libvcos.so
#3 0xb6f825a4 in ?? () from /opt/vc/lib/libvcos.so
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb)
Ho hum, no luck there! You need to run the program inside the
debugger to figure out which ilclient
call
broke, stepping past each ilclient
call until one
of them breaks. In this case, it was a call to
ilclient_change_component_state
(about the fifth such call I had made).
Then run the program again, this time stepping into
the offending call. Then you can see the details of each
call made: in my case I was trying to change state with
insufficient resources set:
(gdb)
365 ilclient_change_component_state(decoder->imageRender->component,
(gdb) step
ilclient_change_component_state (comp=0x4b150, state=OMX_StateExecuting)
at ilclient.c:746
746 error = OMX_SendCommand(comp->comp, OMX_CommandStateSet, state, NULL);
(gdb) next
747 vc_assert(error == OMX_ErrorNone);
(gdb) print error
$1 = OMX_ErrorInsufficientResources
That's very tedious. Welcome to OpenMAX programming.
The ilclient
library has a convenience function
to create a component, ilclient_create_component
.
This takes four parameters.
The first is an
ILCLIENT_T
which an application gets by a
call to ilclient_init()
.
The second is the address to store the component.
The third is a 'simple' form of the component's name.
Now this isn't the name used in the OpenMAX specification.
And it isn't the actual name of the component.
For an image decoder object these are
image_decoder
and
OMX.broadcom.image_decode
respectively.
The name used is formed by dropping
OMX.broadcom.
from the component's name,
to give image_decode
.
The full list of Broadcom components is at
VMCS-X OpenMAX IL Components
and this lists the names used.
The fourth parameter is a bit-wise OR of several flags.
A major one is ILCLIENT_DISABLE_ALL_PORTS
which - as might be expected - disables all ports of the
component, to make it easier to transition to idle state
later. Two other significant flags are
ILCLIENT_ENABLE_INPUT_BUFFERS
and
ILCLIENT_ENABLE_OUTPUT_BUFFERS
.
Now these don't actually enable any buffers for the ports,
create buffers, or apparently do anything really useful.
However, if you don't enable the appropriate buffers here
and later try to actually enable them using
an OMX_CommandPortEnable
command,
then the library will throw a cryptic error
message complaining about an illegal operation.
I suppose that is trying to ensure that you only
make valid calls for that component, but I wish the
error was not so un-helpful.
A typical component creation will look like
ilclient_create_component(decoder->client,
&decoder->imageDecoder->component,
"image_decode",
ILCLIENT_DISABLE_ALL_PORTS
|
ILCLIENT_ENABLE_INPUT_BUFFERS
|
ILCLIENT_ENABLE_OUTPUT_BUFFERS)
OpenMAX on the RPi has a standard component
OMX.broadcom.image_decode
.
The RPi documentation for it is
here . It has two ports. The input port has (3) buffers to take a JPEG
image, and one output port for the decoded image.
The input buffers have a default size, and if the image is large you just
cycle through them, filling and emptying each buffer in turn.
The program starts off fairly easily in main
by reading the JPEG file into a byte-buffer of the right size.
The call to bcm_host_init
is required to
initialise the Broadcom libraries. The JPEG image decoder
is then created and asked to decode the image.
int
main(int argc, char *argv[])
{
OPENMAX_JPEG_DECODER *pDecoder;
char *sourceImage;
size_t imageSize;
int s;
if (argc < 2) {
printf("Usage: %s <filename>\n", argv[0]);
return -1;
}
FILE *fp = fopen(argv[1], "rb");
if (!fp) {
printf("File %s not found.\n", argv[1]);
}
fseek(fp, 0L, SEEK_END);
imageSize = ftell(fp);
fseek(fp, 0L, SEEK_SET);
sourceImage = malloc(imageSize);
assert(sourceImage != NULL);
s = fread(sourceImage, 1, imageSize, fp);
assert(s == imageSize);
fclose(fp);
bcm_host_init();
s = setupOpenMaxJpegDecoder(&pDecoder);
assert(s == 0);
s = decodeImage(pDecoder, sourceImage, imageSize);
assert(s == 0);
cleanup(pDecoder);
free(sourceImage);
return 0;
}
The call to setupOpenMaxJpegDecoder
builds some
data structures and calls to prepareImageDecoder
to initialise the decoder and startupImageDecoder
to move it into executing state, so that it can then decode
the image.
int
setupOpenMaxJpegDecoder(OPENMAX_JPEG_DECODER ** pDecoder)
{
*pDecoder = malloc(sizeof(OPENMAX_JPEG_DECODER));
if (pDecoder[0] == NULL) {
perror("malloc decoder");
return OMXJPEG_ERROR_MEMORY;
}
memset(*pDecoder, 0, sizeof(OPENMAX_JPEG_DECODER));
if ((pDecoder[0]->client = ilclient_init()) == NULL) {
perror("ilclient_init");
return OMXJPEG_ERROR_ILCLIENT_INIT;
}
if (OMX_Init() != OMX_ErrorNone) {
ilclient_destroy(pDecoder[0]->client);
perror("OMX_Init");
return OMXJPEG_ERROR_OMX_INIT;
}
// prepare the image decoder
int ret = prepareImageDecoder(pDecoder[0]);
if (ret != OMXJPEG_OK)
return ret;
ret = startupImageDecoder(pDecoder[0]);
if (ret != OMXJPEG_OK)
return ret;
return OMXJPEG_OK;
}
The call to prepareImageDecoder
creates the
component and establishes its input and output port numbers
(which should be 320 and 321 respectively by the OpenMAX
specification). These two ports are disabled, but they
are enabled to have buffers.
The function startupImageDecoder
is a heavy-duty
function. It has to establish the format that it will
accept from the input file by
// set input image format
OMX_IMAGE_PARAM_PORTFORMATTYPE imagePortFormat;
memset(&imagePortFormat, 0, sizeof(OMX_IMAGE_PARAM_PORTFORMATTYPE));
imagePortFormat.nSize = sizeof(OMX_IMAGE_PARAM_PORTFORMATTYPE);
imagePortFormat.nVersion.nVersion = OMX_VERSION;
imagePortFormat.nPortIndex = decoder->imageDecoder->inPort;
imagePortFormat.eCompressionFormat = OMX_IMAGE_CodingJPEG;
OMX_SetParameter(decoder->imageDecoder->handle,
OMX_IndexParamImagePortFormat, &imagePortFormat);
Then it queries for the buffer requirements, building an
OMX_PARAM_PORTDEFINITIONTYPE portdef
structure and populating it with a get parameter call.
// get buffer requirements
OMX_PARAM_PORTDEFINITIONTYPE portdef;
portdef.nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE);
portdef.nVersion.nVersion = OMX_VERSION;
portdef.nPortIndex = decoder->imageDecoder->inPort;
OMX_GetParameter(decoder->imageDecoder->handle,
OMX_IndexParamPortDefinition, &portdef);
Then we can make a call to enable the input port, allocate the input buffers and wait for the port to become enabled
// enable the port and setup the buffers
OMX_SendCommand(decoder->imageDecoder->handle,
OMX_CommandPortEnable,
decoder->imageDecoder->inPort, NULL);
decoder->inputBufferHeaderCount = portdef.nBufferCountActual;
// allocate pointer array
decoder->ppInputBufferHeader =
(OMX_BUFFERHEADERTYPE **) malloc(sizeof(void) *
decoder->inputBufferHeaderCount);
// allocate each buffer
int i;
for (i = 0; i < decoder->inputBufferHeaderCount; i++) {
if (OMX_AllocateBuffer(decoder->imageDecoder->handle,
&decoder->ppInputBufferHeader[i],
decoder->imageDecoder->inPort,
(void *) i,
portdef.nBufferSize) != OMX_ErrorNone) {
perror("Allocate decode buffer");
return OMXJPEG_ERROR_MEMORY;
}
}
// wait for port enable to complete - which it should once buffers are
// assigned
int ret =
ilclient_wait_for_event(decoder->imageDecoder->component,
OMX_EventCmdComplete,
OMX_CommandPortEnable, 0,
decoder->imageDecoder->inPort, 0,
0, TIMEOUT_MS);
if (ret != 0) {
fprintf(stderr, "Did not get port enable %d\n", ret);
return OMXJPEG_ERROR_EXECUTING;
}
Finally, we can move the component into executing state. But being paranoic about the behaviour of this API, we wait to ensure that it actually does make the state transition requested:
// start executing the decoder
ret = OMX_SendCommand(decoder->imageDecoder-gt;handle,
OMX_CommandStateSet, OMX_StateExecuting, NULL);
if (ret != 0) {
fprintf(stderr, "Error starting image decoder %x\n", ret);
return OMXJPEG_ERROR_EXECUTING;
}
ret = ilclient_wait_for_event(decoder-gt;imageDecoder-gt;component,
OMX_EventCmdComplete,
OMX_StateExecuting, 0, 0, 1, 0,
TIMEOUT_MS);
if (ret != 0) {
fprintf(stderr, "Did not receive executing stat %d\n", ret);
// return OMXJPEG_ERROR_EXECUTING;
}
The function decodeImage
starts up normally enough.
It loads the input buffers in a circular fashion
from the JPEG image loaded
into the sourceImage
array.
Each buffer is emptied by a call to
OMX_EmptyThisBuffer
. When the entire image
has been loaded, the final buffer has the
OMX_BUFFERFLAG_EOS
flag set to indicate
that the image is complete.
The snag with this component is that you don't know how large the decoded
image will be until the decoder has done at least some work on it.
So while the input buffers can be assigned statically up front,
filled and emptied, we don't know what the size of the
output buffer should be.
Fortunately OpneMAX manages this
by raising
a PortSettingsChanged
event
when enough information is gained from the JPEG image
to know the size of the decoded image.
If we were into concurrent programming, we would catch
a PortSettingsChanged
event in an
event handling thread and work from there.
The ilclient
library tries to force a
sequential mode of operation. So whenever a buffer
is emptied, the application will go into a loop
either waiting for a PortSettingsChanged
event to occur and timing out after 5 milliseconds
(I think)
if it doesn't or exiting if the input buffer is empty.
This code is a bit messy!
// wait for buffer to empty or port changed event
int done = 0;
while ((done == 0) || (decoder->pOutputBufferHeader == NULL)) {
if (decoder->pOutputBufferHeader == NULL) {
ret =
ilclient_wait_for_event
(decoder->imageDecoder->component,
OMX_EventPortSettingsChanged,
decoder->imageDecoder->outPort, 0, 0, 1, 0, 5);
if (ret == 0) {
portSettingsChanged(decoder);
}
} else {
ret =
ilclient_remove_event(decoder->imageDecoder->component,
OMX_EventPortSettingsChanged,
decoder->imageDecoder->outPort,
0, 0, 1);
if (ret == 0)
portSettingsChangedAgain(decoder);
}
// check to see if buffer is now empty
if (pBufHeader->nFilledLen == 0)
done = 1;
if ((done == 0)
|| (decoder->pOutputBufferHeader == NULL)) {
printf("Buffer is now size %d\n", pBufHeader->nFilledLen);
sleep(1);
}
}
If a PortSettingsChanged
event occurs,
the application calls portSettingsChanged
in the main thread. This queries the (single) output port
for the width and height values now set, switches
the component to enabled state, allocates a buffer
and waits for it to move to enabled state.
We can also collect information about the
format of the decoded image as well as other
features such as size.
Once the output buffer has been created, we can make a
call to fill the buffer. We should only have to do this once,
so a flag bFilled
is used to control this.
// fill the buffer if we have created the buffer
if (bFilled == 0) {
if ((decoder->pOutputBufferHeader == NULL)) {
portSettingsChanged(decoder);
}
OMX_PARAM_U32TYPE param;
param.nSize = sizeof(OMX_PARAM_U32TYPE);
param.nVersion.nVersion = OMX_VERSION;
param.nPortIndex = decoder->imageDecoder->outPort;
OMX_GetParameter(decoder->imageDecoder->handle,
OMX_IndexParamActiveStream, ¶m);
printf("Active stream %d\n", param.nU32);
printf("Trying to fill output buffer\n");
printState(decoder->imageDecoder->handle);
ret = OMX_FillThisBuffer(decoder->imageDecoder->handle,
decoder->pOutputBufferHeader);
if (ret != OMX_ErrorNone) {
perror("Filling output buffer");
fprintf(stderr, "Error code %x\n", ret);
return OMXJPEG_ERROR_MEMORY;
}
bFilled = 1;
}
Once the input buffers have been filled and emptied
the output buffer has been sized, allocated and
a call made to fill it, the application has nothing
to do but wait until the output buffer is filled.
OpenMAX should generate a OMX_BUFFERFLAG_EOS
when this happens, so we just wait
// wait for end of stream events
int ret =
ilclient_wait_for_event(decoder->imageDecoder->component,
OMX_EventBufferFlag,
decoder->imageDecoder->outPort, 1,
OMX_BUFFERFLAG_EOS, 1,
0, 2);
if (ret != 0) {
fprintf(stderr, "No EOS event on image decoder %d\n", ret);
} else {
fprintf(stderr, "EOS event on image decoder %d\n", ret);
}
Ooops! the EOS event doesn't seem to get generated in practice (contrary to the specification) but the program seems to work anyway :-(.
At this point we can do something like save the decoded image to a file, or do further processing.
The final code is jpeg-decoder.c
There are two principal colour formats used for images: YUV and RGB.
It is
simple to translate from one to the other.
But the Broadcom image_decode
component won't do any
translation: it will only give you YUV images.
This is according to the OpenMAX specifications for a JPEG
decoder. If you want RGB, you have to do it yourself
or use another Broadcom component,
the resize
component. This is not a standard
OpenMAX component (see below).
If you want to connect two or more OpenMAX components then these two components have to be able to pass information between them. This means that the port formats must be the same between one component's output port and the next component's input port, and there must be a means of transferring from output buffers to input buffers.
OpenMAX supplies two methods to do this:
Doing it yourself is always supported. In this case the client has to work out compatable port formats, and co-ordinate buffers. For example, when one component fills a buffer the client could copy it to the next component's input buffer. This is inefficient. Or the client could use the first component's output buffer as the next component's input buffer. But that would mean that the shared buffer would not be free for the first component to refill until the second component had received a buffer-empty event. Messy.
The alternative is tunnelling where the client asks the components to do all this for them. The OpenMAX components support tunnelling, which makes life a lot easier.
Tunnelling is used to connect two ports. It can only be done
when the two components are in the Loaded state or when the
ports are disabled. The call OMX_SetupTunnel
will then connect the two ports as in
// establish tunnel between decoder output and resizer input
OMX_SetupTunnel(decoder->imageDecoder->handle,
decoder->imageDecoder->outPort,
decoder->imageResizer->handle,
decoder->imageResizer->inPort);
A typical use of this is to disable the relevant ports
while they are in Idle state, and then to fill and empty
the input buffers of the first component. This will
trigger a PortSettingsChanged
event on the first
component's output port. At this point, with formats
and things like image sizes determined, the two
ports can be connected by a tunnel.
There is no need to allocate buffers: the tunnel does that.
The OpenMAX component image_resize
will decode a JPEG image, but only to YUV format.
Broadcom has an additional non-standard component
resize
which can not only resize
an uncompresssed image but also convert it
to RGB format.
Matt Ownby and Anthong Sale did a marvellous job
of unravelling the sequence of steps required
to set up tunnelling between a decoder and resizer.
Their logic is captured in the portSettingsChanged
function. This adds tunnelling to the
decoder program given earlier.
int
portSettingsChanged(OPENMAX_JPEG_DECODER * decoder)
{
OMX_PARAM_PORTDEFINITIONTYPE portdef;
// need to setup the input for the resizer with the output of the
// decoder
portdef.nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE);
portdef.nVersion.nVersion = OMX_VERSION;
portdef.nPortIndex = decoder->imageDecoder->outPort;
OMX_GetParameter(decoder->imageDecoder->handle,
OMX_IndexParamPortDefinition, &portdef);
unsigned int uWidth =
(unsigned int) portdef.format.image.nFrameWidth;
unsigned int uHeight =
(unsigned int) portdef.format.image.nFrameHeight;
// tell resizer input what the decoder output will be providing
portdef.nPortIndex = decoder->imageResizer->inPort;
OMX_SetParameter(decoder->imageResizer->handle,
OMX_IndexParamPortDefinition, &portdef);
// establish tunnel between decoder output and resizer input
OMX_SetupTunnel(decoder->imageDecoder->handle,
decoder->imageDecoder->outPort,
decoder->imageResizer->handle,
decoder->imageResizer->inPort);
// enable ports
OMX_SendCommand(decoder->imageDecoder->handle,
OMX_CommandPortEnable,
decoder->imageDecoder->outPort, NULL);
OMX_SendCommand(decoder->imageResizer->handle,
OMX_CommandPortEnable,
decoder->imageResizer->inPort, NULL);
// put resizer in idle state (this allows the outport of the decoder
// to become enabled)
OMX_SendCommand(decoder->imageResizer->handle,
OMX_CommandStateSet, OMX_StateIdle, NULL);
// wait for state change complete
ilclient_wait_for_event(decoder->imageResizer->component,
OMX_EventCmdComplete,
OMX_CommandStateSet, 1,
OMX_StateIdle, 1, 0, TIMEOUT_MS);
// once the state changes, both ports should become enabled and the
// resizer
// output should generate a settings changed event
ilclient_wait_for_event(decoder->imageDecoder->component,
OMX_EventCmdComplete,
OMX_CommandPortEnable, 1,
decoder->imageDecoder->outPort, 1, 0,
TIMEOUT_MS);
ilclient_wait_for_event(decoder->imageResizer->component,
OMX_EventCmdComplete, OMX_CommandPortEnable, 1,
decoder->imageResizer->inPort, 1, 0,
TIMEOUT_MS);
ilclient_wait_for_event(decoder->imageResizer->component,
OMX_EventPortSettingsChanged,
decoder->imageResizer->outPort, 1, 0, 1, 0,
TIMEOUT_MS);
ilclient_disable_port(decoder->imageResizer->component,
decoder->imageResizer->outPort);
// query output buffer requirements for resizer
portdef.nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE);
portdef.nVersion.nVersion = OMX_VERSION;
portdef.nPortIndex = decoder->imageResizer->outPort;
OMX_GetParameter(decoder->imageResizer->handle,
OMX_IndexParamPortDefinition, &portdef);
// change output color format and dimensions to match input
portdef.format.image.eCompressionFormat = OMX_IMAGE_CodingUnused;
portdef.format.image.eColorFormat = OMX_COLOR_Format32bitABGR8888;
portdef.format.image.nFrameWidth = uWidth;
portdef.format.image.nFrameHeight = uHeight;
portdef.format.image.nStride = 0;
portdef.format.image.nSliceHeight = 0;
portdef.format.image.bFlagErrorConcealment = OMX_FALSE;
OMX_SetParameter(decoder->imageResizer->handle,
OMX_IndexParamPortDefinition, &portdef);
// grab output requirements again to get actual buffer size
// requirement (and buffer count requirement!)
OMX_GetParameter(decoder->imageResizer->handle,
OMX_IndexParamPortDefinition, &portdef);
// move resizer into executing state
ilclient_change_component_state(decoder->imageResizer->component,
OMX_StateExecuting);
// show some logging so user knows it's working
printf
("Width: %u Height: %u Output Color Format: 0x%x Buffer Size: %u\n",
(unsigned int) portdef.format.image.nFrameWidth,
(unsigned int) portdef.format.image.nFrameHeight,
(unsigned int) portdef.format.image.eColorFormat,
(unsigned int) portdef.nBufferSize);
fflush(stdout);
// enable output port of resizer
OMX_SendCommand(decoder->imageResizer->handle,
OMX_CommandPortEnable,
decoder->imageResizer->outPort, NULL);
int ret = OMX_AllocateBuffer(decoder->imageResizer->handle,
&decoder->pOutputBufferHeader,
decoder->imageResizer->
outPort,
NULL,
portdef.nBufferSize);
if (ret != OMX_ErrorNone) {
perror("Eror allocating buffer");
return OMXJPEG_ERROR_MEMORY;
}
ilclient_wait_for_event(decoder->imageResizer->component,
OMX_EventCmdComplete,
OMX_CommandPortEnable, 1,
decoder->imageResizer->outPort, 1, 0,
TIMEOUT_MS);
return OMXJPEG_OK;
}
The only change we make to their code is to add a function
to dump the decoded and converted RGB image as a TGA file.
The function save_image_as_TGA
is called
when the output buffer of the resizer is non-empty.
Just a few wrinkles in this. The image has a height and width.
The resizer will have aligned those up to a 16-byte
multiple, the Stride and the SliceHeight.
We have asked for a 32-bit format
( OMX_COLOR_Format32bitABGR8888
)
and so we have to specify this. The TGA format is specified
here.
The co-ordinate system between TGA and the Broadcom is inverted.
We are lazy here because it simplifies the code, and save the
image upside down. The source is almost completely
from the RPi /opt/vc/src/hello_pi/hello_jpeg/jpeg.c
program, here as decodejpeg2rgb.c:
In order to display am image we need to render it
on some output device. There is no specific component to
render images. Broadcom has a video_render
which will accept both a video stream or a single image.
Now this component only has one input port, and that port is
a video port. If we want to take an image from an output
image port, we would have to play some format
conversion games. Or, we can connect an image output port
to a video input port by using a tunnel, and let the
components sort it out themselves. This is much easier!
To render a JPEG image, we only need to use an
image_decode
and a video_render
component. We need to set up the input port for the decoder
as in the last example. The video render component has no
output port so nothing needs to be done for that.
The two ports which are connected by a tunnel do all necessary
setups and conversions themselves. So this is actually
simpler than the last program: load and empty input
buffers with the JPEG image, setup the tunnel
when port settings change, and ... that's
it! Note that we still defer setting up the tunnel
until the port settings have changed - otherwise
the buffer sizes would be wrong.
The program is renderjpeg.c
Tunnelling gives an end-to-end means of decoding and rendering an image. If we wanted to do things in the middle - say, overlay some text - we would need to have access to the intermediate stages. In this section we repeat the previous section, but without using tunnelling.
We have to explicitly manage the communication between the decode and render components. For the decode component, we have to allocate a buffer. We don't want to copy data between decode and render buffers so the render component uses the decoder's output buffers. Then as the decoder fills its output buffer, the render component empties that same buffer.
There are multiple hiccups along the way
memcpy
because the decoder has a structure for an
image while the render has a
structure for a video, and these
do not align.
// need to setup the input for the render with the output of the
// decoder
portdef.nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE);
portdef.nVersion.nVersion = OMX_VERSION;
portdef.nPortIndex = decoder->imageDecoder->outPort;
OMX_GetParameter(decoder->imageDecoder->handle,
OMX_IndexParamPortDefinition, &portdef);
// Get default values of render
rportdef.nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE);
rportdef.nVersion.nVersion = OMX_VERSION;
rportdef.nPortIndex = decoder->imageRender->inPort;
rportdef.nBufferSize = portdef.nBufferSize;
ret = OMX_GetParameter(decoder->imageRender->handle,
OMX_IndexParamPortDefinition, &rportdef);
// tell render input what the decoder output will be providing
//Copy some
rportdef.format.video.nFrameWidth = portdef.format.image.nFrameWidth;
rportdef.format.video.nFrameHeight = portdef.format.image.nFrameHeight;
rportdef.format.video.nStride = portdef.format.image.nStride;
rportdef.format.video.nSliceHeight = portdef.format.image.nSliceHeight;
ret = OMX_SetParameter(decoder->imageRender->handle,
OMX_IndexParamPortDefinition, &rportdef);
NULL
ret = OMX_AllocateBuffer(decoder->imageDecoder->handle,
&decoder->pOutputBufferHeader,
decoder->imageDecoder->
outPort,
NULL,
portdef.nBufferSize);
// and share it with the renderer
// which has 3 default buffers, 2 minimum
decoder->ppRenderInputBufferHeader =
(OMX_BUFFERHEADERTYPE **) malloc(sizeof(void) *
decoder->renderInputBufferHeaderCount);
ret = OMX_UseBuffer(decoder->imageRender->handle,
&decoder->ppRenderInputBufferHeader[0],
decoder->imageRender->inPort,
NULL,
rportdef.nBufferSize,
decoder->pOutputBufferHeader->pBuffer);
int n;
for (n = 1; n < decoder->renderInputBufferHeaderCount; n++) {
printState(decoder->imageRender->handle);
ret = OMX_UseBuffer(decoder->imageRender->handle,
&
amp;decoder->ppRenderInputBufferHeader[n],
decoder->imageRender->inPort,
NULL,
0,
NULL);
}
UseBuffer
call, the field
nAllocLen
does not get set correctly
(how do we know: because of an illegal parameter
error, and then using the debugger to guess at what
isn't right).
decoder->ppRenderInputBufferHeader[0]->nAllocLen =
decoder->pOutputBufferHeader->nAllocLen;
Apart from that, it is the usual games of playing with state, enabling and disabling ports until it works
The RPi has a useful GPU. Programming it using OpenMAX is hard work, though. This chapter has covered some of the issues. The topic is explored more in my book Programming the Raspberry Pi's GPU


http://<IP_ADDRESS>:8887 (local web server URL)
Thanks for trying out Web Server for Chrome. This is BETA quality software. Please, give me feedback about which features you need added to make this useful for you.
MIT License
And of course, leave a nice review leave a nice review to help others find this software


A collaborative real-time code editor for Github Gists.
Much instant, very wow, try it now!
Or take a look at some of the recent public gists


Gistified
Create code snippets with syntax highlight and language recognition
View all gists
Create new gist


How to ride
Bus
Buses are the backbone of the Metro Transit system, providing 55 million rides annually on local, express and suburban routes. Learn how to ride these convenient routes right in your neighborhood, many with built-in transit advantages.
METRO
The METRO network offers fast, frequent, all-day service, with light-rail trains on the Blue and Green lines and bus rapid transit service on the A and C lines. Pay before you board these lines that stop less often to keep you moving more.
Northstar
Northstar Commuter Rail service operates mainly during rush hours with six trips each direction each weekday, less frequently on weekends, and serves Vikings and Twins games. Northstar trains have onboard restrooms, work tables, power outlets and free Wi-Fi.
Easy to pay
On local buses, pay as you board with cash (exact fare only), the Metro Transit app or Go-To Cards. On METRO lines, buy a ticket from the machine on the platform with cash, credit or debit cards – just remember to pay before boarding. While onboard, be ready to show your proof of payment: your ticket, Metro Transit app or Go-To Card/pass.
Safety is a shared responsibility
Metro Transit’s number one priority is making sure that you arrive at your destination safely. Safety is a shared responsibility. You can help by reporting unusual or dangerous behavior to a transit employee or submitting a report discreetly using Text to Safety at<PHONE_NUMBER>.
Bring your bike!
All Metro Transit buses and trains have free bike racks so you can pedal for part of your trip and ride for the rest. Each bus accommodates two bikes, there’s room for four bikes in every METRO rail car.
Become a registered carpooler
Carpoolers save on gas and use the MnPass lanes on I-394, I-35W and I-35E for free! Save yourself time and money by doubling up with a fellow commuter. It’s easy and secure to create a profile and search our database of others looking to share the ride.
Follow the code of conduct
This code of conduct applies to all customers. Some parts of the code are just common sense; others are dictated by state law.
Failure to pay for your ride can result in a $180 fine. Pay as you board a bus or be ready to show proof that you have paid your fare on METRO lines. METRO tickets, transfers, Go-To Cards and passes are not transferable to someone else – you cannot lend them, give them away or sell them.
Interfering with the safe operation of a transit vehicle is not only hazardous to you and everyone else, it’s illegal. If you threaten the driver or another passenger, you could be arrested.
There is no smoking on buses or trains, in bus shelters or at transit station platforms, including e-cigarettes. If you must smoke, leave the bus shelter or platform area.
Designated seats at the front of every bus and clearly marked seats on every train are reserved for seniors and customers with disabilities. Please surrender your seat to these customers when they board.
It’s illegal to play music or podcasts on public transportation without headphones.
If you need to use your phone while you ride, remember you’ve got a built-in audience.
Respect others who will ride after you. Keep your feet off the seats and take litter with you when you exit.
Using profanity or derogatory statements is not tolerated. Use of this language can get you removed from the bus or train and your riding privileges canceled for 30 days.
Food and alcohol are not allowed on buses or trains. Non-alcoholic drinks are allowed – as long as they’re in containers with sealed lids.

Pets are welcome on buses and trains as long as they are kept in animal carriers. Service animals are exempt.


Nadal eager to play Davis Cup, says Spain captain Bruguera
Madrid - Spain captain Sergi Bruguera said on Sunday that Rafael Nadal is "doing well" and wants to play at the inaugural Davis Cup Finals, despite his exertions at the ATP Finals this week.
Hosts Spain play their first tie against Russia in Madrid on Tuesday.
The 33-year-old Nadal was knocked out at the pool stage in London, but did secure the year-end world number one ranking ahead of Novak Djokovic.
Nadal was a fitness doubt for the season-ending event at the O2 Arena after pulling out of the Paris Masters with an abdominal injury, but managed to produce rousing comebacks in wins over Daniil Medvedev and Stefanos Tsitsipas.
"The truth is that he's in a great moment," said Bruguera on the eve of the tournament. "He is doing well and is eager to compete."
Five-time champions Spain have been handed a difficult draw in Group B with ties against reigning champions Croatia and Russia.
Bruguera said that Spain would not be favourites to progress from the group.
"On clay, I can't remember the last time Spain lost a Davis Cup tie," he said.
"But this (hard) surface is what we usually get when we play away from home. We find it more difficult."
Croatia will be led at the 18-team competition by former US Open champion Marin Cilic and Borna Coric, while Russia boast world No 17 Karen Khachanov and the in-form Andrey Rublev.
Nadal will receive support from Spanish number two Roberto Bautista Agut, Pablo Carreno Busta, Feliciano Lopez and Marcel Granollers.


Simple Barchart (Webcharts) - This is a simple bar chart showing counts of medals won by country at the 2012 summer Olympics. Made with Webcharts.


Before Change
except AttributeError as e:
if not exception: exception = e
except Exception: pass
try:
return __set_pixel_spacing_pydicom(hdr, spacing)
except AttributeError as e:
if not exception: exception = e
except Exception: pass
try:
return __set_pixel_spacing_itk(hdr, spacing)
except AttributeError as e:
if not exception: exception = e
After Change
@type spacing sequence
try:
if __is_header_nibabel(hdr):
__set_pixel_spacing_nibabel(hdr, spacing)
elif __is_header_pydicom(hdr):
__set_pixel_spacing_pydicom(hdr, spacing)
elif __is_header_itk(hdr):
__set_pixel_spacing_itk(hdr, spacing)
else:
raise Exception()
except AttributeError as e:
raise e
except Exception:
raise AttributeError("The provided header {} is of unknown type or does not support setting of pixel spacing.".format(type(hdr)))


Including jQuery!
-
jQuery is just a javascript file. It's no different than the files that we've written so far.
-
How to include jQuery?
-
Through jquery file.
-
Through the downloading link. It is a lot easier and simpler to use because we don't
have to download a copy of Jay query for every application that we make.
-
we can get the current link from googling "cdn jquery link" .
-
If we open up the console we can actually type the word jQuery and hit enter.
And if we don't get an error that tells us that the query is correctly added to our application.


|
Cheetah/Savanna API
|
Public Member Functions | |
| def | __init__ (self, layout_list) |
| def | add_node (self, node_dict) |
| def | get_node_containing_code (self, code) |
| def | codes_per_node (self) |
| def | shared_nodes (self) |
| def | ppn (self) |
| def | validate (self, ppn, codes_per_node, shared_nodes) |
| def | as_data_list (self) |
| def | serialize_to_dict (self) |
| def | copy (self) |
| def | group_codes_by_node (self) |
| def | populate_remaining (self, rc_names, ppn) |
| def | default_no_share_layout (cls, ppn, code_names) |
Public Attributes | |
| layout_list | |
| layout_map | |
Class representing options on how to organize a multi-exe task across many nodes. It is the scheduler model's job to take this and produce the correct scheduler and runner options to make this happen, or raise an error if it's not possible. Note that this will generally be different for each machine unless it is very simple and suppored uniformly by all desired machines. A layout is represented as a list of dictionaries, where each dictionary described codes to be run together on a single node. The keys are the names of the codes, and the values are the number of processes to assign to each.
Definition at line 6 of file node_layout.py.
| def codar.savanna.node_layout.NodeLayout.__init__ | ( | self, | |
| layout_list | |||
| ) |
Definition at line 20 of file node_layout.py.
| def codar.savanna.node_layout.NodeLayout.add_node | ( | self, | |
| node_dict | |||
| ) |
Add a node to an existing layout, e.g. add sosflow.
Definition at line 43 of file node_layout.py.
| def codar.savanna.node_layout.NodeLayout.as_data_list | ( | self | ) |
Definition at line 114 of file node_layout.py.
| def codar.savanna.node_layout.NodeLayout.codes_per_node | ( | self | ) |
Definition at line 55 of file node_layout.py.
| def codar.savanna.node_layout.NodeLayout.copy | ( | self | ) |
Definition at line 129 of file node_layout.py.
| def codar.savanna.node_layout.NodeLayout.default_no_share_layout | ( | cls, | |
| ppn, | |||
| code_names | |||
| ) |
Create a layout object for the specified codes and ppn, where each code uses max procs on it's own node.
Definition at line 173 of file node_layout.py.
| def codar.savanna.node_layout.NodeLayout.get_node_containing_code | ( | self, | |
| code | |||
| ) |
Get node dict containing the specified code. Raises KeyError if not found.
Definition at line 50 of file node_layout.py.
| def codar.savanna.node_layout.NodeLayout.group_codes_by_node | ( | self | ) |
Return a list of dicts, where each list represents codes on a node, and a dict key for ppn Example: [ {sim,analysis1}, {analysis2}, {viz} ]. Must take Summit NodeConfigs into account
Definition at line 132 of file node_layout.py.
| def codar.savanna.node_layout.NodeLayout.populate_remaining | ( | self, | |
| rc_names, | |||
| ppn | |||
| ) |
Definition at line 161 of file node_layout.py.
| def codar.savanna.node_layout.NodeLayout.ppn | ( | self | ) |
Definition at line 61 of file node_layout.py.
| def codar.savanna.node_layout.NodeLayout.serialize_to_dict | ( | self | ) |
Get a copy of the data list passed to the constructor, suitable for JSON serialization.
Definition at line 117 of file node_layout.py.
| def codar.savanna.node_layout.NodeLayout.shared_nodes | ( | self | ) |
Definition at line 58 of file node_layout.py.
| def codar.savanna.node_layout.NodeLayout.validate | ( | self, | |
| ppn, | |||
| codes_per_node, | |||
| shared_nodes | |||
| ) |
Given a machine ppn and max numer of codes (e.g. 4 on cori), raise a ValueError if the specified layout won't fit. Dont modify this yet, this is being used by the tests
Definition at line 96 of file node_layout.py.
| codar.savanna.node_layout.NodeLayout.layout_list |
Definition at line 34 of file node_layout.py.
| codar.savanna.node_layout.NodeLayout.layout_map |
Definition at line 35 of file node_layout.py.


Mutation tester to work in conjunction with JUnit.
What does a "T" output mean?
The mutation caused the unit tests to take longer than expected
(possibly having put the code into an infinite loop). Jumble gives
the coder the benefit of the doubt in such situations.
Can Jumble ever incorrectly report an arithmetic problem?
Yes. Certain combinations of operations and constants give the same
result for different examples. For example,
y = x * sign;
y = x / sign;
give the same result for sign = +1 or sign = -1.
Can Jumble ever incorrectly report a conditional problem?
Yes. Certain pieces of code can be modified without invalidating the
code. One example of this is where a condition is used to select
different code for performance reasons rather than correctness.
Suppose f1(x) and f2(x) compute the same function but are exhibit
different performance depending on x. Valid code might then be
int foo(int x) {
return x < 10 ? f1(x) : f2(x);
}
mutating the condition x < 10 would not change the correctness of the
code only the speed. Unless there is a very sensitive speed test this
modification is likely to pass unit tests.


Due to security reasons, a password reset is required. Please click on the below reset button to receive a reset password link in your email to access your account!
We already have your information from your previous orders! Please click on the below reset button to receive a reset password link in your email to assign a password to access your account now!


It's time for a character to display his incredible musical talent! The stage is set, an audience gathers, he begins to sing and...
Whoa! Where'd this choir come from?
It's the Invisible Backup Band!
When a single character begins to sing or play a musical instrument a capella, he will immediately be accompanied by suitable background instrumentals, vocals or both (and maybe even some neat stage effects) with no conceivable source. Piano, guitar, sax, gospel choir... you name it and it will be a member of the Invisible Backup Band.
Every musical thrives on this concept.
May or may not accompany Magic Music. Compare Summon Backup Dancers.
Examples:
- Magical Angel Creamy Mami: Creamy Mami has this effect as part of her Magical Girl powers, which is how she ended up with a career as an idol singer.
- In a more literal sense, an episode of A Little Snow Fairy Sugar has the musical accompaniment played by fairies that nobody can see or hear.
- The scene in Mobile Suit Gundam Wing where Quatre and Trowa play a duet on violin and flute, respectively, while there are also drums and guitar in the background. Apparently a couple of Maganac soldiers were playing right behind the camera.
- Azmaria Hendric of Chrono Crusade has a gospel chorus and a soft church organ playing beneath her songs. She also uses Magic Music.
- The titular character of Kobato. uses hers in the first episode. She's accompanied not only by a piano, but also by synth effects, a spotlight, and flower petals.
- Lampshaded in Ouran Highschool Host Club: Haruhi is seen singing with beautiful music the background, when someone accidentally unplugs the music player.
- Fancy Lala has one in the anime Magical Stage Fancy Lala.
- In Macross Frontier, when Ranka begins to sing in public for the first time, initially you can see a guitarist at a nearby music shop add some of his strings to her performance (it helps that she's singing a very popular and well-known song). This doesn't, however, explain the full drums and keyboard accompaniment.
- Hime Chen Otogi Chikku Idol Lilpri does this whenever they "Himechen" (the shows name for their transformation).
- In The World is Still Beautiful, Princess Nike has a magic song that causes it to rain. One has to assume that it also causes backing instrumentals to come in out of nowhere.
- Justified in Senki Zesshou Symphogear as a secondary function of the girls' Disco Tech armor.
- Lampshaded in Disney's Mickey, Donald, Goofy: The Three Musketeers, where, after Pete finishes singing his Villain Song, he wonders why the music stopped.
- Parodied a bit in Monty Python and the Holy Grail (of course). Any time Herbert even mentions wanting to sing, music starts to play. —Only to be followed by his father Letting the Air Out of the Band
No Singing!
- Subverted in There's Something About Mary: Every time the theme music was played, a breakaway shot showed two musicians, normally playing from an implausible position.
- Used straight in Girl in Gold Boots with solo guitarist Critter being accompanied by harmonica and other instruments from nowhere.
- Eegah!! While camping in the desert, Arch Hall Jr plays a guitar song, and ghostly doo-wop vocals back him up.
- Wild Rebels gives the the (anti-)hero a horn accompaniment as he plays guitar for the love interest in the forest.
- Road to Zanzibar discusses this together with Mickey Mousing in Conversational Troping during an Old-Fashioned Rowboat Date which ends with Bing Crosby conducting the invisible orchestra to accompany him while he sings the Love Theme:
"What killed me is that from nowhere, an orchestra started. You know, violins and everything, right in the middle of a jungle. Isn't that silly?"
- Subverted in Blazing Saddles. Just as you're wondering where the music is coming from, Bart rides past Count Basie and His Orchestra.
- Harpo Marx's harp solos are typically accompanied by an invisible orchestra playing quietly in the background. Chico's piano solos are more often unaccompanied, but when he plays "Collegiate" in Horse Feathers the orchestra accompanying him obviously isn't with him in the hotel suite.
- The musical pocket watch in For a Few Dollars More is accompanied with what sounds like an orchestra and a mariachi band.
- Happens several times in Camp Rock, most noticeably when Shane is singing to Mitchie by the lake. This is very Narmy as the movie is heavily promoted as not being a musical but a "movie with music".
- Most of the songs in Tenacious D in The Pick of Destiny have, at the very least, invisible drummers and bass guitarists. A couple also have a guitar playing out of nowhere, or an electric guitar playing when Kage and Jables only have acoustic guitars. "Classico" is probably the only song without an invisible backup band.
- A running joke during the making of Star Wars was how come there's sound in space to accompany the fancy special effects shots? George Lucas would claim there was a huge backing orchestra floating around in spacesuits.
- Sort of parodied in Rock 'n' Roll High School: Riff Randall is daydreaming about Joey Ramone serenading her in her bedroom, and even though a full-band recording of "I Want You Around" is being used in the scene, it appears that he's only being backed up by Johnny Ramone on acoustic guitar. Then she opens the bathroom door and it turns out that Dee Dee and Marky were playing bass and drums in there the whole time.
- In Ferris Bueller's Day Off, Cameron is accompanied by a ghostly offscreen chorus while singing sadly to himself in bed.
- A good chunk of the songs in Rags are just the characters singing in the street, a pawn shop, or on stage with no equipment, and yet they'll inexplicably be accompanied by instruments, auto-tuning, and layered vocals.
- Wizards of the Lost Kingdom 2 does this with a background character so it's easier to overlook. The Dark One's tavern employs just one fiddle player to serenade patrons, but he somehow makes the music of an entire medieval string band. Eagle-eyed viewers may notice that he isn't actually touching the fiddle strings most of the time.
- In the Granada TV adaptation of The Red-Headed League, Sherlock Holmes is accompanied by an imaginary orchestra as he whistles a theme from the concert he attended the previous night.
- "Once More With Feeling", the Buffy the Vampire Slayer episode. Played straight, lampshaded ("That would explain the huge backing orchestra I couldn't see and the synchronised dancing from the room service chaps"), and even slightly averted. ("She needs backup! Anya, Tara...")
- Lampshaded in an episode of Sesame Street with Shari Lewis and Lamb Chop as the episode's guest stars. Shari, Lamb Chop, and Big Bird sing the song "Perfect as a Pig" to Suey the Pig to boost her confidence in being a pig. When the invisible choir echoes the last line of every voice, all four look around for the source and give each other confused looks.
- Frequently, the characters will call out "Music maestro!" or "Hit it!" when cueing their invisible orchestra. One episode instead had Baby Bear about to sing a song, asking someone off-screen to hit the play button on the music player.
- Naturally, this happens a lot in Glee. Sometimes, however, it's averted rather hilariously.
- In one instance, Jesse and Rachel are singing Lionel Richie's "Hello" together. Jesse is shown playing the piano, but string and percussion instruments are heard as well. At first, this appears to be an example of this trope; however, the camera then zooms out to reveal an actual back-up band, materialized out of nowhere.
- In another, Rachel is speaking with her mother, and suggests they sing a song together. After the latter agrees, Rachel calls for her pianist, who again shows up from out of nowhere. Rachel explains "he's always around".
- Speaking of Glee, in the Community episode "Regional Holiday Music" which parodied said show specifically made fun of this trope. The Glee club coach tries to convince Abed to join by playing a song on the piano, only to jump up from it for a singing/dancing routine a few lines in. The music continues.
Abed: How is your piano still playing this song?Mr. Rad: Glee is the answer when questions are wrong!
- In a similar vein, the TV edition of Fame uses this trope religiously. For example, the song "I Still Believe In Me" is sung by Coco (in her actress' last regular episode) with Bruno accompanying on piano; about 30 seconds in strings kick in from out of nowhere and stick around for the rest of the song. Averted in the parent film where almost all the music is done by the characters/extras.
- In Twin Peaks, James' song he sings while playing guitar in the episode "Coma" has bass and percussion come out of nowhere halfway through.
- Happens all the time in Make Room for Daddy, since Danny sings a song in almost every episode. Not unrealistic when he's performing at the Copa with his orchestra behind him... but it invariably happens when he's playing the piano and singing at home. Cue Invisible Backup Orchestra! Usually you get applause at the end of the song too, but not always, leading you to wonder why the live audience didn't like that particular performance.
- Due to their reliance on lipsyncing, the Macy's Thanksgiving Day Parade has raised this trope to an art form.
- Mystery Science Theater 3000 loves to poke fun at this trope whenever it pops up in a movie they're watching:
- Wild Rebels: When the (anti-)hero is playing guitar for the love interest in the forest, and a horn accompaniment suddenly breaks in:
Crow: Thank you, Brother Squirrel, for the horn!
- Eegah: While camping in the desert, Arch Hall Jr plays a guitar song, and ghostly vocals back him up. "I see he remembered to bring the Isley Brothers camping with him."
- The Girl in Gold Boots: Solo guitarist Critter performs multiple times, accompanied by harmonica and other instruments from nowhere. "I love the way you play the harmonica with your ass!"
- Wizards of the Lost Kingdom 2: The local Bad-Guy Bar has the music of a full medieval band, but the only musician in sight is a single fiddle player.
Jonah: That fiddle player in the back is the real talent. I mean, how's he getting all these sounds from one instrument?
Crow: And the fiddler's doing all that without even touching the strings! Bravo!
- Wild Rebels: When the (anti-)hero is playing guitar for the love interest in the forest, and a horn accompaniment suddenly breaks in:
- Two Cellos is a frequent offender. In "Highway to Hell" a drummer accompanies them as soon as they start playing, and in "Thunderstruck" there's apparently a third cello playing along invisibly.
- Sonny Eclipse, the animatronic intergalactic lounge lizard at the Magic Kingdom's Cosmic Ray's Starlight Cafe has his Space Angels, who are even the subject of a tribute song that mentions how much he appreciates them even with being unable to see them.
- This happens quite a bit in Ar tonelico, whenever one of the Reyvateils sings, thanks to their Song Server manifesting the song right as they imagine it, while they sing the main melody.
- It pops up in Dragon Age: Origins, in a scene at the camp.
- This shows up in The Legend of Zelda: Spirit Tracks and probably a few of the other games in the series.
- Inverted in LocoRoco, everybody is aware of game's background music and sing to it. It's played straight in a few cutscenes.
- In No More Heroes, Dr Peace sings a rousing tune (with full accompaniment, natch) when Travis meets him in an empty baseball stadium. Given that he's singing over the PA system, it's possible that's where the music track is coming from.
- Averted in Gitaroo Man. In every stage, the background music is provided by a trio of kids dressed in animal costumes. They only have a pair of cymbals, a ukulele, and an accordion, but somehow they're able to provide the entire soundtrack on their own. According to their in-game bio, being a backup band is their sworn duty.
- Inverted in Dr. Horrible's Sing-Along Blog, where Bad Horse writes letters to scan with his theme tune, and a chorus made up of three of the musical's writers dressed as cowboys lean in from off screen to sing along.
- The Arkenhammer of Erfworld functions like this, allowing the attuned user (Stanley) to "Rock Out" by using it like an air-guitar. This confers some massive combat bonuses and is the Titanic aspect of dance fighting. Dance fighting in general seems to use this trope when invoked, but not to nearly the same impressive degree (the Arkenhammer almost deafened Parson when demonstrated in an enclosed space).
- Another lampshade hanging: The Music Meister from Batman: The Brave and the Bold had brass and strings for him during one song, synth for another, and crunchy guitar and piano for yet another, even though he had no visible means of producing that music until his big finale, when he was standing in front of a giant stereo system.
- And yet another lampshade hanging in Phineas and Ferb episode Rollercoaster: The Musical.
We should do it again! This time, as a musical! Whadya say? We'll do all the same things, except we'll break into spontaneous singing and choreography with no discernable music source!
- Occasionally shows up in Family Guy, singing faux-slogans as the punchline of various jokes.


keyboard_arrow_up
keyboard_arrow_down
keyboard_arrow_left
keyboard_arrow_right
SPACE
A
B
RESTART
TURBO MODE
Loading...
Failed to load Scratch.
No such Scratch ID or an error has occurred.


I was sixteen at the time, and had been selling weed and acid for three months or so. I was doing well at it, making quite a bit of money, and smoking herb for free, and was quite happy all around. So, it came to pass that one day I had a sheet of KISS acid laying around. I had tripped eight or nine times before, but I had only taken three hits at most, and hadn't really experienced the intense visuals I had heard and read so much about.
So, on a Saturday before I went to a large concert with some friends, I decided to test my limits. I took out the sheet (it was called Darkstar, because it had the Darkstar skating logo on the back) from my stash and cut off nine big hits, and promptly ate them. It was one thirty or so. My mindset at the time was one of anticipation, although once I had eaten the hits there was a bit of anxiety.
I smoked a joint and waited for the acid to kick in while I watched cartoons. It was about two in the afternoon when I felt the first tingle of acid. I started tap my feet while I watched tv, and then the jaw clenching started in. I could feel that this was this was going to be a big one.
The last time I checked the clock was at three thirty. At this point, my mind was starting to turn over at itself. I was pacing back and forth in my room, muttering to myself, thinking about my life.  My friends were supposed to come pick me up at four, and I decided to go outside and smoke a cigarette and wait for them. I had been in a dark house until this point, and when I walked outside, it was like getting hit in the head. The sun was incredibly bright, and the asphalt and concrete seemed to bubbling under the heat. I stood for a moment, unsure of what to do, and then decided to stay on the porch and smoke for a while.
As I sat on the porch, the street started to squirm back and forth. I had gotten a few visuals like this before, and I watched, enjoying it.  The sun reflected off the side window of the car, and the light stabbed me in the eyes. My friends arrived after a while, and as soon as my friend Ryan saw me, he knew I was tripping.
By this point, I decided that there was no way I could handle a concert in the sun today. I told Ryan I wasn't going, and he asked if I wanted anyone to stay with me. In retrospect, this would have been a good idea, but at the time the mere idea of having to relate to anyone seemed terrifying, so I declined. They left (the metal on the car dripping off as it drove away) and I went inside to my room.
At this point, I started losing touch of where I was and what was going on. I kept on closing my eyes and decending (acending?) to some different level. Inside my head, my thoughts had turned from self-critical to simple curiosity. I spent along time thinking about losing my virignity, and then suddenly began to think about my bar mitzvah. I wondered mostly about what exactly these things meant, and how they had changed me.
Finally, I couldn't stand it any longer, and I had to get out. So I ran to my backyard and laid down in the grass (at this point, it was almost dark outside).  I got up and walked to my front yard and looked down the road.
This is when the first real hallucination started. The road was neon and shimmering, and along it raced numbers and letters. The numbers would approach me, and as they passed I would feel a soft breeze go over me. The world had transformed itself. I looked at the road and could taste it. Once again, I retreated to my room.
 I wanted so badly to leave, but at the same time felt that the world was a dangerous place. So I stayed in my room and watched the walls. The walls were convulsing, like a muscle, and small shapes kept popping up, like they were directly under the paint. Then a grinning demon face came up from the wall, and looked at me.  At this point I had forgotten I had taken the acid and simply watched in horror. As I looked up, the celeing contained a body, floating slowly back and forth. I retreated to a corner and watched as my room continued to meld and morph itself. It reminded my of a Disney cartoon, when everything is kind of dancing. I was sure I was losing my mind, sure that there was no way my mind could handle all of this without breaking.
Finally, at some point, I decided that I needed music. With much difficulty, I selected a Pavement album (Crooked Rain, Crooked Rain) and started listening to it. I don't remember the CD, but Pavement did get me started thinking about weed. Suddenly, I remembered that I had a half pound of the stuff sitting in my closet. Weed was the answer, I suddenly saw. I grabbed my purple bong and loaded a bowl, again with much difficulty (the weed squirmed under my touch, and it was very hard to get it to go into the bowl). I don't know how many bowls I smoked, but I smoked a lot. I smoked like it was the only way to survive, which I felt it was. Finally, I felt like I was returning to reality. Things were still squirming a bit when I looked at them, but I knew that this was just because I had taken acid, and that there was a fundamentally solid reality beneath this.
I looked at a clock and was shocked to see that it was nearly eleven in the morning. I had been tripping for twenty hours or so. I got up and called my friend Ryan on his cell phone.  The food was actually incredibly good, and I felt extremely good. The world was no longer dangerous, but a warm and gentle place. After I ate, I went over to Ryan's for a while, and ended up falling asleep over there.
That was two years ago, I have never taken that much acid again. I've also never lost contact with reality that degree again.  In the future, I may try to test my limits again. However, this time I will have a friend I know I can trust with me, and remember to have my bong out and ready for duty.
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


my movie list
Add New Movie
Movie Name
Movie Category
Issue Year
clear list
Remove
Movie Name
Movie Category
Issue Year


[1] Seems to press a command compared to locate your parked car as what it if this kind of satillites quick rerouting.
[2] Seems to press a command compared to locate your parked car as what it the powered base seems very complete and quit picking up can appreciate the 350.


We have a number of trip packages for our clients but you can also design your own trip. All our tours include gorilla tracking at Bwindi Impenetrable National Park.
Our packages include the following
Our 21 days trip starts with pick up from Kampala. This trip includes the most important and well known places and national parks in Uganda. We take a tour around the country starting with the source of the Nile in Jinja, Kidepo valley national park, Queen Elizabeth National Park, Semiliki National Park, Queen Elizabeth National Park, Bwindi Impenetrable National Park.
More Information...Our 14 days trip starts with pick up from Kampala. This trip includes the most important and well known places and national parks in Uganda. We take a tour around the country starting with the source of the Nile in Jinja, Kidepo valley national park, Queen Elizabeth National Park, Semiliki National Park, Bwindi Impenetrable National Park.
More Information...Our 7 days trip starts with pick up from Kampala. This trip includes the most important and well known places and national parks in Uganda. We take a tour around the country starting with Queen Elizabeth National Park, Lake Mburo National Park. Bwindi Impenetrable National Park.
More Information...Our 4 days trip brings you the best experience as we track the mountain gorillas at Bwindi Impenetrable National Park and also a tour to Lake Bunyonyi.
More Information...


Beta This is a test version of the layout of this page. Take the survey to help us improve it
National Statistics
The attainment of young people aged 19 in the 2011 to 2012 academic year.
Reference Id: SFR13/2013
Publication type: Statistical First Release
Publication data: Local Authority data
Local Authority data: LA data
Region: England
Release date: 27 March 2013
Coverage status: Final
Publication Status: Published
Statistics on level 2 and 3 attainment by age 19 are published as ‘Level 2 and 3 attainment by young people in England measured using matched administrative data: attainment by age 19 in 2012’ and include data from England covering overall level 2 and 3 attainment by age, cohort, qualification type, and institution type. It also includes breakdowns by gender, ethnicity, special educational needs (SEN) and eligibility for free school meals (FSM) for those in state schools at age 15, and measures for attainment of level 2 English and maths. Local authority data is available for both overall level 2 and 3 and breakdowns by FSM.
The latest statistics report on the period up to 2011 to 2012 and update those previously released on 19 April 2012. The main points are:


Enter your information below and the Super Galactic Age Calculator will calculate your age for each of the planets in the solar system (and Pluto!).


{{shipment.OrderNumber + '-' + item.OrderLineNumber}}
:
{{shipment.OrderNumber || '-'}}
:
{{item.OrderLineNumber || '-'}}
:
{{item.OrderedQuantity || '0'}}
:
{{item.Quantity || '0'}}
:
{{item.DeliveredQuantity || '0'}}
:
{{shipment.LorryNumber || '-'}}
:
{{shipment.GateEntryNumber || '-'}}


--- title: 404 Not Found permalink: 404.html sitemap: false ---
Snap!
Our Homepage should have complete information and working links!
Foremast Home


Turkish Open: Eddie Pepperell disqualified after running out of balls
| Turkish Airlines Open day three leaderboard |
|---|
| -18: M Schwab (Aus); -15: T Hatton (Eng), R Fisher (Eng), R MacIntyre (Sco), P Reed (US), B Hebert (Fra) |
| Selected others: -13: S Jamieson (Sco); -12: L Westwood (Eng); -11: R Ramsay (Sco); -9: J Rose (Eng), D Willett (Eng) |
England's Eddie Pepperell was disqualified from the Turkish Open after running out of balls on the 13th hole of his third round.
Pepperell, 28, who started on the 10th tee, hit his approach to the fourth hole into the water around the green.
He had several more attempts, losing "four or five balls" according to Martin Kaymer, who said the incident was like a scene from the film Tin Cup.
"I have never seen anything like that before," said Kaymer.
"I only watched it on television, in 'Tin Cup'. This is the first time I have seen it live."
Pepperell was officially disqualified for failing to complete the hole and had been two over for his round when he exited the tournament; he could face punishment from the European Tour.
German Kaymer, who was playing alongside Pepperell with South Africa George Coetzee, added: "Eddie hit his shots to the green then came over to tell us he had run out of balls.
"Then he walked off. I thought he lost four or five. We are about 80% sure it was five, 20% four.
"He did not ask if he could borrow one from me or George. It did not look like he wanted to play. He did not putt with his putter on the third hole; he putted with a wedge. So there was a lot happening."
Meanwhile, England's Tyrrell Hatton shot a seven-under-par 65 to move into contention for Sunday's final round.
Hatton, 28, carded an eagle and six birdies to reach 15 under par but trails Austria's outright leader Matthias Schwab by three shots.
Four players share second place with Hatton, including England's Ross Fisher and Scotland's Robert MacIntyre.
England's Justin Rose fell nine shots off the pace with a round of one over.
Rose, who has won this event in the previous two years, had started the third round just two strokes behind Schwab, who is seeking his first win on the European Tour.
Scotland's Richie Ramsay fired the joint-lowest round of the day to reach 11 under overall as nine birdies helped him shoot an eight-under-par round of 64.
Leader Schwab has enjoyed impressive form recently, with top-five finishes at the Italian Open and WGC-HSBC Champions and settled any third-round nerves with an opening-hole eagle and two further birdies by the turn.
"The game plan is going to be the same as it's been for the last three days," said Schwab. "The course is gettable and there are a lot of birdies out there so I'll just stay aggressive because pars won't be enough."


- UI/UX designers - We hire freelance UI/UX specialists for our
projects through the marketplace at HK Cocoon.
- Open source software developers - We are very interested in
partnering with other open source developers, particularly those
working in software visualization and financial technology.
- Quantitative finance and science researchers<
- Software beta testers


FIXDLSRPS(1) FIXDLSRPS(1) NAME fixdlsrps - filter to fix DviLaser/PS documents to work with PSUtils SYNOPSIS fixdlsrps < dvilaser.ps > Fixed.ps DESCRIPTION Fixdlsrps is a perl filter which "fixes" PostScript generated from the DviLaser/PS driver so that it works correctly with Angus Duggan's psutils package. AUTHOR Copyright (C) Angus J. C. Duggan 1991-1995 SEE ALSO psbook(1), psselect(1), pstops(1), epsffit(1), psnup(1), psresize(1), psmerge(1), fixscribeps(1), getafm(1), fixdlsrps(1), fixfmps(1), fixps‐ ditps(1), fixpspps(1), fixtpps(1), fixwfwps(1), fixwpps(1), fixwwps(1), extractres(1), includeres(1), showchar(1) TRADEMARKS PostScript is a trademark of Adobe Systems Incorporated. PSUtils Release 1 Patchlevel 17 FIXDLSRPS(1)


--- layout: post title: As I Lie Awake at Night date: '2006-11-20T00:00:00-05:00' tags: - '2006' tumblr_url: http://poetry.liabogoev.com/post/49085079137/as-i-lie-awake-at-night ---
As I lie awake at night,
Submerged in endless thought,
I think, wonder and try,
As all my dreams are wrought.
My thoughts flow onto paper,
My pencil point grows dull,
As I write and dream and think,
My pencil almost gone.
The inferno that my pencil writes,
The infinity of night,
I am almost asleep, almost there,
And I know it will be alright…


JavaScript Stop Light - Coding Challenge
Goal
Create a stop light that is operated by buttons.
Rules
- Use only HTML, CSS & JavaScript. Do not use jQuery.
- The event handler must be connected in JavaScript. Do not use
onClick=""
in HTML
Resources
Instructions
-
This project has a /images folder which contains one 'on' and one 'off' image for each of the 3 stop light colors. Manipulate the source property of
elements to switch the state of the 3 light colors.
-
Write a function named
changeLight()
that takes one parameter which is the color of the light to be turned-on and changes which pictures are displayed sot that the the correct color light is lit and the others are off.
Extra Credit
Use a timer to operate the light


Experimenting and Learning
Feel free to contact me if you don't understand anything
This project is maintained by HishamElreedy
اللهم لا علم لنا الأ ما علمتنا به انك انت علام الغيوب
A \(50\Omega\) Source has \(2W\) maximum available power. Determine its Thevenin and Norton equivalent circuits.
$$R_{source}=R_{thevenin}=50\Omega$$ as if we turned off source and see from output terminal we will find only it $$P_{max}={{V_{thevenin}}^2 \over 4R_{thevening}}=2W$$ $$V_{th}=20V$$ $$I_{norton}={V_{thevenin} \over R_{thevenin}}=0.4A$$
If the source of Problem (1) is to be connected to a load of impedance \(75-j25 \Omega\), design the required matching network. Hence, determine its Z, Y and ABCD parameters.
$$Z=\begin{bmatrix}Z_{11} & Z_{12}\\Z_{21} & Z_{22}\end{bmatrix}, Y=\begin{bmatrix}Y_{11} & Y_{12}\\Y_{21} & Y_{22}\end{bmatrix}, T=\begin{bmatrix}A & B\\C & D\end{bmatrix}$$ $$\begin{bmatrix}V_{1} \\ V_{2}\end{bmatrix}=\begin{bmatrix}Z_{11} & Z_{12}\\Z_{21} & Z_{22}\end{bmatrix}\begin{bmatrix}I_{1} \\ I_{2}\end{bmatrix}$$ $$Z_{11}=\left.\frac{V_1}{I_1}\right\vert_{I_2=0}=75-j25$$ $$Z_{12}=\left.\frac{V_2}{I_1}\right\vert_{I_2=0}=75-j25$$ $$Z_{21}=\left.\frac{V_1}{I_2}\right\vert_{I_1=0}=75-j25$$ $$Z_{22}=\left.\frac{V_2}{I_2}\right\vert_{I_1=0}=75-j25$$


message
ALSET Jest Problem
Write your code to pass tests.
Save File
Run Tests
Test Result
Complete Logs


Evan Campbell-Weiner
Home
Resume
Projects
Contact
This page is currently being developed! I am so sorry for any inconvenience this may cause you. Please checkout the contact page for further information.


Dialog Demo
This program allows you to test multiple kinds of interaction with the broader
environment, including displaying a dialog box with multiple items, displaying a dialog
prompt with free-form input, and requesting a FIFO resource, such as a file on disk.
Note: the behaviour will differ depending on the environment this program runs
in. If the application runs at the top level, Hipe itself will service the requests
with system-standard prompts. If the application runs within a framing manager that
supports these actions, the framing manager will manage the requests instead. Nothing
happens if the framing manager does not implement these functions.