licify=32" out.avi The filter accepts the slice height as parameter. If the parameter is not specified it will use the default value of 16. Adding this in the beginning of filter chains should make filtering faster due to better use of the memory cache. smartblur Blur the input video without impacting the outlines. The filter accepts the following parameters: luma_radius:luma_strength:luma_threshold[:chroma_radius:chroma_strength:chroma_threshold] Parameters prefixed by luma indicate that they work on the luminance of the pixels whereas parameters prefixed by chroma refer to the chrominance of the pixels. If the chroma parameters are not set, the luma parameters are used for either the luminance and the chrominance of the pixels. luma_radius or chroma_radius must be a float number in the range [0.1,5.0] that specifies the variance of the gaussian filter used to blur the image (slower if larger). luma_strength or chroma_strength must be a float number in the range [-1.0,1.0] that configures the blurring. A value included in [0.0,1.0] will blur the image whereas a value included in [-1.0,0.0] will sharpen the image. luma_threshold or chroma_threshold must be an integer in the range [-30,30] that is used as a coefficient to determine whether a pixel should be blurred or not. A value of 0 will filter all the image, a value included in [0,30] will filter flat areas and a value included in [-30,0] will filter edges. split Split input video into several identical outputs. The filter accepts a single parameter which specifies the number of outputs. If unspecified, it defaults to 2. For example ffmpeg -i INPUT -filter_complex split=5 OUTPUT will create 5 copies of the input video. For example: [in] split [splitout1][splitout2]; [splitout1] crop=100:100:0:0 [cropout]; [splitout2] pad=200:200:100:100 [padout]; will create two separate outputs from the same input, one cropped and one padded. super2xsai Scale the input by 2x and smooth using the Super2xSaI (Scale and Interpolate) pixel art scaling algorithm. Useful for enlarging pixel art images without reducing sharpness. swapuv Swap U & V plane. thumbnail Select the most representative frame in a given sequence of consecutive frames. It accepts as argument the frames batch size to analyze (default N=100); in a set of N frames, the filter will pick one of them, and then handle the next batch of N frames until the end. Since the filter keeps track of the whole frames sequence, a bigger N value will result in a higher memory usage, so a high value is not recommended. The following example extract one picture each 50 frames: thumbnail=50 Complete example of a thumbnail creation with ffmpeg: ffmpeg -i in.avi -vf thumbnail,scale=300:200 -frames:v 1 out.png tile Tile several successive frames together. It accepts as argument the tile size (i.e. the number of lines and columns) in the form "wxh". For example, produce 8x8 PNG tiles of all keyframes (-skip_frame nokey) in a movie: ffmpeg -skip_frame nokey -i file.avi -vf 'scale=128:72,tile=8x8' -an -vsync 0 keyframes%03d.png The -vsync 0 is necessary to prevent ffmpeg from duplicating each output frame to accomodate the originally detected frame rate. tinterlace Perform various types of temporal field interlacing. Frames are counted starting from 1, so the first input frame is considered odd. This filter accepts a single parameter specifying the mode. Available modes are: merge, 0 Move odd frames into the upper field, even into the lower field, generating a double height frame at half framerate. drop_odd, 1 Only output even frames, odd frames are dropped, generating a frame with unchanged height at half framerate. drop_even, 2 Only output odd frames, even frames are dropped, generating a frame with unchanged height at half framerate. pad, 3 Expand each frame to full height, but pad alternate lines with black, generating a frame with double height at the same input framerate. interleave_top, 4 Interleave the upper field from odd frames with the lower field from even frames, generating a frame with unchanged height at half framerate. interleave_bottom, 5 Interleave the lower field from odd frames with the upper field from even frames, generating a frame with unchanged height at half framerate. interlacex2, 6 Double frame rate with unchanged height. Frames are inserted each containing the second temporal field from the previous input frame and the first temporal field from the next input frame. This mode relies on the top_field_first flag. Useful for interlaced video displays with no field synchronisation. Numeric values are deprecated but are accepted for backward compatibility reasons. Default mode is "merge". transpose Transpose rows with columns in the input video and optionally flip it. It accepts a parameter representing an integer, which can assume the values: 0, 4 Rotate by 90 degrees counterclockwise and vertically flip (default), that is: L.R L.l . . -> . . l.r R.r 1, 5 Rotate by 90 degrees clockwise, that is: L.R l.L . . -> . . l.r r.R 2, 6 Rotate by 90 degrees counterclockwise, that is: L.R R.r . . -> . . l.r L.l 3, 7 Rotate by 90 degrees clockwise and vertically flip, that is: L.R r.R . . -> . . l.r l.L For values between 4-7 transposition is only done if the input video geometry is portrait and not landscape. unsharp Sharpen or blur the input video. It accepts the following parameters: luma_msize_x:luma_msize_y:luma_amount:chroma_msize_x:chroma_msize_y:chroma_amount Negative values for the amount will blur the input video, while positive values will sharpen. All parameters are optional and default to the equivalent of the string '5:5:1.0:5:5:0.0'. luma_msize_x Set the luma matrix horizontal size. It can be an integer between 3 and 13, default value is 5. luma_msize_y Set the luma matrix vertical size. It can be an integer between 3 and 13, default value is 5. luma_amount Set the luma effect strength. It can be a float number between -2.0 and 5.0, default value is 1.0. chroma_msize_x Set the chroma matrix horizontal size. It can be an integer between 3 and 13, default value is 5. chroma_msize_y Set the chroma matrix vertical size. It can be an integer between 3 and 13, default value is 5. chroma_amount Set the chroma effect strength. It can be a float number between -2.0 and 5.0, default value is 0.0. # Strong luma sharpen effect parameters unsharp=7:7:2.5 # Strong blur of both luma and chroma parameters unsharp=7:7:-2:7:7:-2 # Use the default values with B<ffmpeg> ffmpeg -i in.avi -vf "unsharp" out.mp4 vflip Flip the input video vertically. ffmpeg -i in.avi -vf "vflip" out.avi yadif Deinterlace the input video ("yadif" means "yet another deinterlacing filter"). It accepts the optional parameters: mode:parity:auto. mode specifies the interlacing mode to adopt, accepts one of the following values: 0 output 1 frame for each frame 1 output 1 frame for each field 2 like 0 but skips spatial interlacing check 3 like 1 but skips spatial interlacing check Default value is 0. parity specifies the picture field parity assumed for the input interlaced video, accepts one of the following values: 0 assume top field first 1 assume bottom field first -1 enable automatic detection Default value is -1. If interlacing is unknown or decoder does not export this information, top field first will be assumed. auto specifies if deinterlacer should trust the interlaced flag and only deinterlace frames marked as interlaced 0 deinterlace all frames 1 only deinterlace frames marked as interlaced Default value is 0. VIDEO SOURCES Below is a description of the currently available video sources. buffer Buffer video frames, and make them available to the filter chain. This source is mainly intended for a programmatic use, in particular through the interface defined in libavfilter/vsrc_buffer.h. It accepts a list of options in the form of key=value pairs separated by ":". A descroption of the accepted options follows. video_size Specify the size (width and height) of the buffered video frames. pix_fmt A string representing the pixel format of the buffered video frames. It may be a number corresponding to a pixel format, or a pixel format name. time_base Specify the timebase assumed by the timestamps of the buffered frames. time_base Specify the frame rate expected for the video stream. pixel_aspect Specify the sample aspect ratio assumed by the video frames. sws_param Specify the optional parameters to be used for the scale filter which is automatically inserted when an input change is detected in the input size or format. For example: buffer=size=320x240:pix_fmt=yuv410p:time_base=1/24:pixel_aspect=1/1 will instruct the source to accept video frames with size 320x240 and with format "yuv410p", assuming 1/24 as the timestamps timebase and square pixels (1:1 sample aspect ratio). Since the pixel format with name "yuv410p" corresponds to the number 6 (check the enum PixelFormat definition in libavutil/pixfmt.h), this example corresponds to: buffer=size=320x240:pixfmt=6:time_base=1/24:pixel_aspect=1/1 Alternatively, the options can be specified as a flat string, but this syntax is deprecated: width:height:pix_fmt:time_base.num:time_base.den:pixel_aspect.num:pixel_aspect.den[:sws_param] cellauto Create a pattern generated by an elementary cellular automaton. The initial state of the cellular automaton can be defined through the filename, and pattern options. If such options are not specified an initial state is created randomly. At each new frame a new row in the video is filled with the result of the cellular automaton next generation. The behavior when the whole frame is filled is defined by the scroll option. This source accepts a list of options in the form of key=value pairs separated by ":". A description of the accepted options follows. filename, f Read the initial cellular automaton state, i.e. the starting row, from the specified file. In the file, each non-whitespace character is considered an alive cell, a newline will terminate the row, and further characters in the file will be ignored. pattern, p Read the initial cellular automaton state, i.e. the starting row, from the specified string. Each non-whitespace character in the string is considered an alive cell, a newline will terminate the row, and further characters in the string will be ignored. rate, r Set the video rate, that is the number of frames generated per second. Default is 25. random_fill_ratio, ratio Set the random fill ratio for the initial cellular automaton row. It is a floating point number value ranging from 0 to 1, defaults to 1/PHI. This option is ignored when a file or a pattern is specified. random_seed, seed Set the seed for filling randomly the initial row, must be an integer included between 0 and UINT32_MAX. If not specified, or if explicitly set to -1, the filter will try to use a good random seed on a best effort basis. rule Set the cellular automaton rule, it is a number ranging from 0 to 255. Default value is 110. size, s Set the size of the output video. If filename or pattern is specified, the size is set by default to the width of the specified initial state row, and the height is set to width * PHI. If size is set, it must contain the width of the specified pattern string, and the specified pattern will be centered in the larger row. If a filename or a pattern string is not specified, the size value defaults to "320x518" (used for a randomly generated initial state). scroll If set to 1, scroll the output upward when all the rows in the output have been already filled. If set to 0, the new generated row will be written over the top row just after the bottom row is filled. Defaults to 1. start_full, full If set to 1, completely fill the output with generated rows before outputting the first frame. This is the default behavior, for disabling set the value to 0. stitch If set to 1, stitch the left and right row edges together. This is the default behavior, for disabling set the value to 0. Examples · Read the initial state from pattern, and specify an output of size 200x400. cellauto=f=pattern:s=200x400 · Generate a random initial row with a width of 200 cells, with a fill ratio of 2/3: cellauto=ratio=2/3:s=200x200 · Create a pattern generated by rule 18 starting by a single alive cell centered on an initial row with width 100: cellauto=p=@s=100x400:full=0:rule=18 · Specify a more elaborated initial pattern: cellauto=p='@@ @ @@':s=100x400:full=0:rule=18 mandelbrot Generate a Mandelbrot set fractal, and progressively zoom towards the point specified with start_x and start_y. This source accepts a list of options in the form of key=value pairs separated by ":". A description of the accepted options follows. end_pts Set the terminal pts value. Default value is 400. end_scale Set the terminal scale value. Must be a floating point value. Default value is 0.3. inner Set the inner coloring mode, that is the algorithm used to draw the Mandelbrot fractal internal region. It shall assume one of the following values: black Set black mode. convergence Show time until convergence. mincol Set color based on point closest to the origin of the iterations. period Set period mode. Default value is mincol. bailout Set the bailout value. Default value is 10.0. maxiter Set the maximum of iterations performed by the rendering algorithm. Default value is 7189. outer Set outer coloring mode. It shall assume one of following values: iteration_count Set iteration cound mode. normalized_iteration_count set normalized iteration count mode. Default value is normalized_iteration_count. rate, r Set frame rate, expressed as number of frames per second. Default value is "25". size, s Set frame size. Default value is "640x480". start_scale Set the initial scale value. Default value is 3.0. start_x Set the initial x position. Must be a floating point value between -100 and 100. Default value is -0.743643887037158704752191506114774. start_y Set the initial y position. Must be a floating point value between -100 and 100. Default value is -0.131825904205311970493132056385139. mptestsrc Generate various test patterns, as generated by the MPlayer test filter. The size of the generated video is fixed, and is 256x256. This source is useful in particular for testing encoding features. This source accepts an optional sequence of key=value pairs, separated by ":". The description of the accepted options follows. rate, r Specify the frame rate of the sourced video, as the number of frames generated per second. It has to be a string in the format frame_rate_num/frame_rate_den, an integer number, a float number or a valid video frame rate abbreviation. The default value is "25". duration, d Set the video duration of the sourced video. The accepted syntax is: [-]HH:MM:SS[.m...] [-]S+[.m...] See also the function "av_parse_time()". If not specified, or the expressed duration is negative, the video is supposed to be generated forever. test, t Set the number or the name of the test to perform. Supported tests are: dc_luma dc_chroma freq_luma freq_chroma amp_luma amp_chroma cbp mv ring1 ring2 all Default value is "all", which will cycle through the list of all tests. For example the following: testsrc=t=dc_luma will generate a "dc_luma" test pattern. frei0r_src Provide a frei0r source. To enable compilation of this filter you need to install the frei0r header and configure FFmpeg with "--enable-frei0r". The source supports the syntax: <size>:<rate>:<src_name>[{=|:}<param1>:<param2>:...:<paramN>] size is the size of the video to generate, may be a string of the form widthxheight or a frame size abbreviation. rate is the rate of the video to generate, may be a string of the form num/den or a frame rate abbreviation. src_name is the name to the frei0r source to load. For more information regarding frei0r and how to set the parameters read the section frei0r in the description of the video filters. For example, to generate a frei0r partik0l source with size 200x200 and frame rate 10 which is overlayed on the overlay filter main input: frei0r_src=200x200:10:partik0l=1234 [overlay]; [in][overlay] overlay life Generate a life pattern. This source is based on a generalization of John Conway's life game. The sourced input represents a life grid, each pixel represents a cell which can be in one of two possible states, alive or dead. Every cell interacts with its eight neighbours, which are the cells that are horizontally, vertically, or diagonally adjacent. At each interaction the grid evolves according to the adopted rule, which specifies the number of neighbor alive cells which will make a cell stay alive or born. The rule option allows to specify the rule to adopt. This source accepts a list of options in the form of key=value pairs separated by ":". A description of the accepted options follows. filename, f Set the file from which to read the initial grid state. In the file, each non-whitespace character is considered an alive cell, and newline is used to delimit the end of each row. If this option is not specified, the initial grid is generated randomly. rate, r Set the video rate, that is the number of frames generated per second. Default is 25. random_fill_ratio, ratio Set the random fill ratio for the initial random grid. It is a floating point number value ranging from 0 to 1, defaults to 1/PHI. It is ignored when a file is specified. random_seed, seed Set the seed for filling the initial random grid, must be an integer included between 0 and UINT32_MAX. If not specified, or if explicitly set to -1, the filter will try to use a good random seed on a best effort basis. rule Set the life rule. A rule can be specified with a code of the kind "SNS/BNB", where NS and NB are sequences of numbers in the range 0-8, NS specifies the number of alive neighbor cells which make a live cell stay alive, and NB the number of alive neighbor cells which make a dead cell to become alive (i.e. to "born"). "s" and "b" can be used in place of "S" and "B", respectively. Alternatively a rule can be specified by an 18-bits integer. The 9 high order bits are used to encode the next cell state if it is alive for each number of neighbor alive cells, the low order bits specify the rule for "borning" new cells. Higher order bits encode for an higher number of neighbor cells. For example the number 6153 = "(12<<9)+9" specifies a stay alive rule of 12 and a born rule of 9, which corresponds to "S23/B03". Default value is "S23/B3", which is the original Conway's game of life rule, and will keep a cell alive if it has 2 or 3 neighbor alive cells, and will born a new cell if there are three alive cells around a dead cell. size, s Set the size of the output video. If filename is specified, the size is set by default to the same size of the input file. If size is set, it must contain the size specified in the input file, and the initial grid defined in that file is centered in the larger resulting area. If a filename is not specified, the size value defaults to "320x240" (used for a randomly generated initial grid). stitch If set to 1, stitch the left and right grid edges together, and the top and bottom edges also. Defaults to 1. mold Set cell mold speed. If set, a dead cell will go from death_color to mold_color with a step of mold. mold can have a value from 0 to 255. life_color Set the color of living (or new born) cells. death_color Set the color of dead cells. If mold is set, this is the first color used to represent a dead cell. mold_color Set mold color, for definitely dead and moldy cells. Examples · Read a grid from pattern, and center it on a grid of size 300x300 pixels: life=f=pattern:s=300x300 · Generate a random grid of size 200x200, with a fill ratio of 2/3: life=ratio=2/3:s=200x200 · Specify a custom rule for evolving a randomly generated grid: life=rule=S14/B34 · Full example with slow death effect (mold) using ffplay: ffplay -f lavfi life=s=300x200:mold=10:r=60:ratio=0.1:death_color=#C83232:life_color=#00ff00,scale=1200:800:flags=16 color, nullsrc, rgbtestsrc, smptebars, testsrc The "color" source provides an uniformly colored input. The "nullsrc" source returns unprocessed video frames. It is mainly useful to be employed in analysis / debugging tools, or as the source for filters which ignore the input data. The "rgbtestsrc" source generates an RGB test pattern useful for detecting RGB vs BGR issues. You should see a red, green and blue stripe from top to bottom. The "smptebars" source generates a color bars pattern, based on the SMPTE Engineering Guideline EG 1-1990. The "testsrc" source generates a test video pattern, showing a color pattern, a scrolling gradient and a timestamp. This is mainly intended for testing purposes. These sources accept an optional sequence of key=value pairs, separated by ":". The description of the accepted options follows. color, c Specify the color of the source, only used in the "color" source. It can be the name of a color (case insensitive match) or a 0xRRGGBB[AA] sequence, possibly followed by an alpha specifier. The default value is "black". size, s Specify the size of the sourced video, it may be a string of the form widthxheight, or the name of a size abbreviation. The default value is "320x240". rate, r Specify the frame rate of the sourced video, as the number of frames generated per second. It has to be a string in the format frame_rate_num/frame_rate_den, an integer number, a float number or a valid video frame rate abbreviation. The default value is "25". sar Set the sample aspect ratio of the sourced video. duration, d Set the video duration of the sourced video. The accepted syntax is: [-]HH[:MM[:SS[.m...]]] [-]S+[.m...] See also the function "av_parse_time()". If not specified, or the expressed duration is negative, the video is supposed to be generated forever. decimals, n Set the number of decimals to show in the timestamp, only used in the "testsrc" source. The displayed timestamp value will correspond to the original timestamp value multiplied by the power of 10 of the specified value. Default value is 0. For example the following: testsrc=duration=5.3:size=qcif:rate=10 will generate a video with a duration of 5.3 seconds, with size 176x144 and a frame rate of 10 frames per second. The following graph description will generate a red source with an opacity of 0.2, with size "qcif" and a frame rate of 10 frames per second. color=c=red@0.2:s=qcif:r=10 If the input content is to be ignored, "nullsrc" can be used. The following command generates noise in the luminance plane by employing the "mp=geq" filter: nullsrc=s=256x256, mp=geq=random(1)*255:128:128 VIDEO SINKS Below is a description of the currently available video sinks. buffersink Buffer video frames, and make them available to the end of the filter graph. This sink is mainly intended for a programmatic use, in particular through the interface defined in libavfilter/buffersink.h. It does not require a string parameter in input, but you need to specify a pointer to a list of supported pixel formats terminated by -1 in the opaque parameter provided to "avfilter_init_filter" when initializing this sink. nullsink Null video sink, do absolutely nothing with the input video. It is mainly useful as a template and to be employed in analysis / debugging tools. MULTIMEDIA FILTERS Below is a description of the currently available multimedia filters. asendcmd, sendcmd Send commands to filters in the filtergraph. These filters read commands to be sent to other filters in the filtergraph. "asendcmd" must be inserted between two audio filters, "sendcmd" must be inserted between two video filters, but apart from that they act the same way. The specification of commands can be provided in the filter arguments with the commands option, or in a file specified by the filename option. These filters accept the following options: commands, c Set the commands to be read and sent to the other filters. filename, f Set the filename of the commands to be read and sent to the other filters. Commands syntax A commands description consists of a sequence of interval specifications, comprising a list of commands to be executed when a particular event related to that interval occurs. The occurring event is typically the current frame time entering or leaving a given time interval. An interval is specified by the following syntax: <START>[-<END>] <COMMANDS>; The time interval is specified by the START and END times. END is optional and defaults to the maximum time. The current frame time is considered within the specified interval if it is included in the interval [START, END), that is when the time is greater or equal to START and is lesser than END. COMMANDS consists of a sequence of one or more command specifications, separated by ",", relating to that interval. The syntax of a command specification is given by: [<FLAGS>] <TARGET> <COMMAND> <ARG> FLAGS is optional and specifies the type of events relating to the time interval which enable sending the specified command, and must be a non- null sequence of identifier flags separated by "+" or "|" and enclosed between "[" and "]". The following flags are recognized: enter The command is sent when the current frame timestamp enters the specified interval. In other words, the command is sent when the previous frame timestamp was not in the given interval, and the current is. leave The command is sent when the current frame timestamp leaves the specified interval. In other words, the command is sent when the previous frame timestamp was in the given interval, and the current is not. If FLAGS is not specified, a default value of "[enter]" is assumed. TARGET specifies the target of the command, usually the name of the filter class or a specific filter instance name. COMMAND specifies the name of the command for the target filter. ARG is optional and specifies the optional list of argument for the given COMMAND. Between one interval specification and another, whitespaces, or sequences of characters starting with "#" until the end of line, are ignored and can be used to annotate comments. A simplified BNF description of the commands specification syntax follows: <COMMAND_FLAG> ::= "enter" | "leave" <COMMAND_FLAGS> ::= <COMMAND_FLAG> [(+|"|")<COMMAND_FLAG>] <COMMAND> ::= ["[" <COMMAND_FLAGS> "]"] <TARGET> <COMMAND> [<ARG>] <COMMANDS> ::= <COMMAND> [,<COMMANDS>] <INTERVAL> ::= <START>[-<END>] <COMMANDS> <INTERVALS> ::= <INTERVAL>[;<INTERVALS>] Examples · Specify audio tempo change at second 4: asendcmd=c='4.0 atempo tempo 1.5',atempo · Specify a list of drawtext and hue commands in a file. # show text in the interval 5-10 5.0-10.0 [enter] drawtext reinit 'fontfile=FreeSerif.ttf:text=hello world', [leave] drawtext reinit 'fontfile=FreeSerif.ttf:text='; # desaturate the image in the interval 15-20 15.0-20.0 [enter] hue reinit s=0, [enter] drawtext reinit 'fontfile=FreeSerif.ttf:text=nocolor', [leave] hue reinit s=1, [leave] drawtext reinit 'fontfile=FreeSerif.ttf:text=color'; # apply an exponential saturation fade-out effect, starting from time 25 25 [enter] hue s=exp(t-25) A filtergraph allowing to read and process the above command list stored in a file test.cmd, can be specified with: sendcmd=f=test.cmd,drawtext=fontfile=FreeSerif.ttf:text='',hue asetpts, setpts Change the PTS (presentation timestamp) of the input frames. "asetpts" works on audio frames, "setpts" on video frames. Accept in input an expression evaluated through the eval API, which can contain the following constants: FRAME_RATE frame rate, only defined for constant frame-rate video PTS the presentation timestamp in input N the count of the input frame, starting from 0. NB_CONSUMED_SAMPLES the number of consumed samples, not including the current frame (only audio) NB_SAMPLES the number of samples in the current frame (only audio) SAMPLE_RATE audio sample rate STARTPTS the PTS of the first frame STARTT the time in seconds of the first frame INTERLACED tell if the current frame is interlaced T the time in seconds of the current frame TB the time base POS original position in the file of the frame, or undefined if undefined for the current frame PREV_INPTS previous input PTS PREV_INT previous input time in seconds PREV_OUTPTS previous output PTS PREV_OUTT previous output time in seconds Examples · Start counting PTS from zero setpts=PTS-STARTPTS · Apply fast motion effect: setpts=0.5*PTS · Apply slow motion effect: setpts=2.0*PTS · Set fixed rate of 25 frames per second: setpts=N/(25*TB) · Set fixed rate 25 fps with some jitter: setpts='1/(25*TB) * (N + 0.05 * sin(N*2*PI/25))' · Apply an offset of 10 seconds to the input PTS: setpts=PTS+10/TB settb, asettb Set the timebase to use for the output frames timestamps. It is mainly useful for testing timebase configuration. It accepts in input an arithmetic expression representing a rational. The expression can contain the constants "AVTB" (the default timebase), "intb" (the input timebase) and "sr" (the sample rate, audio only). The default value for the input is "intb". Examples · Set the timebase to 1/25: settb=1/25 · Set the timebase to 1/10: settb=0.1 · Set the timebase to 1001/1000: settb=1+0.001 · Set the timebase to 2*intb: settb=2*intb · Set the default timebase value: settb=AVTB concat Concatenate audio and video streams, joining them together one after the other. The filter works on segments of synchronized video and audio streams. All segments must have the same number of streams of each type, and that will also be the number of streams at output. The filter accepts the following named parameters: n Set the number of segments. Default is 2. v Set the number of output video streams, that is also the number of video streams in each segment. Default is 1. a Set the number of output audio streams, that is also the number of video streams in each segment. Default is 0. The filter has v+a outputs: first v video outputs, then a audio outputs. There are nx(v+a) inputs: first the inputs for the first segment, in the same order as the outputs, then the inputs for the second segment, etc. Related streams do not always have exactly the same duration, for various reasons including codec frame size or sloppy authoring. For that reason, related synchronized streams (e.g. a video and its audio track) should be concatenated at once. The concat filter will use the duration of the longest stream in each segment (except the last one), and if necessary pad shorter audio streams with silence. For this filter to work correctly, all segments must start at timestamp 0. All corresponding streams must have the same parameters in all segments; the filtering system will automatically select a common pixel format for video streams, and a common sample format, sample rate and channel layout for audio streams, but other settings, such as resolution, must be converted explicitly by the user. Different frame rates are acceptable but will result in variable frame rate at output; be sure to configure the output file to handle it. Examples: · Concatenate an opening, an episode and an ending, all in bilingual version (video in stream 0, audio in streams 1 and 2): ffmpeg -i opening.mkv -i episode.mkv -i ending.mkv -filter_complex \ '[0:0] [0:1] [0:2] [1:0] [1:1] [1:2] [2:0] [2:1] [2:2] concat=n=3:v=1:a=2 [v] [a1] [a2]' \ -map '[v]' -map '[a1]' -map '[a2]' output.mkv · Concatenate two parts, handling audio and video separately, using the (a)movie sources, and adjusting the resolution: movie=part1.mp4, scale=512:288 [v1] ; amovie=part1.mp4 [a1] ; movie=part2.mp4, scale=512:288 [v2] ; amovie=part2.mp4 [a2] ; [v1] [v2] concat [outv] ; [a1] [a2] concat=v=0:a=1 [outa] Note that a desync will happen at the stitch if the audio and video streams do not have exactly the same duration in the first file. showspectrum Convert input audio to a video output, representing the audio frequency spectrum. The filter accepts the following named parameters: size, s Specify the video size for the output. Default value is "640x480". The usage is very similar to the showwaves filter; see the examples in that section. showwaves Convert input audio to a video output, representing the samples waves. The filter accepts the following named parameters: n Set the number of samples which are printed on the same column. A larger value will decrease the frame rate. Must be a positive integer. This option can be set only if the value for rate is not explicitly specified. rate, r Set the (approximate) output frame rate. This is done by setting the option n. Default value is "25". size, s Specify the video size for the output. Default value is "600x240". Some examples follow. · Output the input file audio and the corresponding video representation at the same time: amovie=a.mp3,asplit[out0],showwaves[out1] · Create a synthetic signal and show it with showwaves, forcing a framerate of 30 frames per second: aevalsrc=sin(1*2*PI*t)*sin(880*2*PI*t):cos(2*PI*200*t),asplit[out0],showwaves=r=30[out1] MULTIMEDIA SOURCES Below is a description of the currently available multimedia sources. amovie This is the same as src_movie source, except it selects an audio stream by default. movie Read audio and/or video stream(s) from a movie container. It accepts the syntax: movie_name[:options] where movie_name is the name of the resource to read (not necessarily a file but also a device or a stream accessed through some protocol), and options is an optional sequence of key=value pairs, separated by ":". The description of the accepted options follows. format_name, f Specifies the format assumed for the movie to read, and can be either the name of a container or an input device. If not specified the format is guessed from movie_name or by probing. seek_point, sp Specifies the seek point in seconds, the frames will be output starting from this seek point, the parameter is evaluated with "av_strtod" so the numerical value may be suffixed by an IS postfix. Default value is "0". streams, s Specifies the streams to read. Several streams can be specified, separated by "+". The source will then have as many outputs, in the same order. The syntax is explained in the Stream specifiers chapter. Two special names, "dv" and "da" specify respectively the default (best suited) video and audio stream. Default is "dv", or "da" if the filter is called as "amovie". stream_index, si Specifies the index of the video stream to read. If the value is -1, the best suited video stream will be automatically selected. Default value is "-1". Deprecated. If the filter is called "amovie", it will select audio instead of video. loop Specifies how many times to read the stream in sequence. If the value is less than 1, the stream will be read again and again. Default value is "1". Note that when the movie is looped the source timestamps are not changed, so it will generate non monotonically increasing timestamps. This filter allows to overlay a second video on top of main input of a filtergraph as shown in this graph: input -----------> deltapts0 --> overlay --> output ^ | movie --> scale--> deltapts1 -------+ Some examples follow. · Skip 3.2 seconds from the start of the avi file in.avi, and overlay it on top of the input labelled as "in": movie=in.avi:seek_point=3.2, scale=180:-1, setpts=PTS-STARTPTS [movie]; [in] setpts=PTS-STARTPTS, [movie] overlay=16:16 [out] · Read from a video4linux2 device, and overlay it on top of the input labelled as "in": movie=/dev/video0:f=video4linux2, scale=180:-1, setpts=PTS-STARTPTS [movie]; [in] setpts=PTS-STARTPTS, [movie] overlay=16:16 [out] · Read the first video stream and the audio stream with id 0x81 from dvd.vob; the video is connected to the pad named "video" and the audio is connected to the pad named "audio": movie=dvd.vob:s=v:0+#0x81 [video] [audio] METADATA FFmpeg is able to dump metadata from media files into a simple UTF-8-encoded INI-like text file and then load it back using the metadata muxer/demuxer. The file format is as follows: 1. A file consists of a header and a number of metadata tags divided into sections, each on its own line. 2. The header is a ';FFMETADATA' string, followed by a version number (now 1). 3. Metadata tags are of the form 'key=value' 4. Immediately after header follows global metadata 5. After global metadata there may be sections with per-stream/per-chapter metadata. 6. A section starts with the section name in uppercase (i.e. STREAM or CHAPTER) in brackets ('[', ']') and ends with next section or end of file. 7. At the beginning of a chapter section there may be an optional timebase to be used for start/end values. It must be in form 'TIMEBASE=num/den', where num and den are integers. If the timebase is missing then start/end times are assumed to be in milliseconds. Next a chapter section must contain chapter start and end times in form 'START=num', 'END=num', where num is a positive integer. 8. Empty lines and lines starting with ';' or '#' are ignored. 9. Metadata keys or values containing special characters ('=', ';', '#', '\' and a newline) must be escaped with a backslash '\'. 10. Note that whitespace in metadata (e.g. foo = bar) is considered to be a part of the tag (in the example above key is 'foo ', value is ' bar'). A ffmetadata file might look like this: ;FFMETADATA1 title=bike\\shed ;this is a comment artist=FFmpeg troll team [CHAPTER] TIMEBASE=1/1000 START=0 #chapter ends at 0:01:00 END=60000 title=chapter \#1 [STREAM] title=multi\ line 2014-07-25 FFMPEG(1)


--- layout: page ---
|
Darrell is a biologist with an interest in using underutilized insect systems to address fundamental questions in evolution, genetics and ecology. His research foci include sexual competition and conflict, visual signal evolution, host-endosymbiont biology and co-evolution, and in predicting/appraising adaptive evolution.
|
||
|
Kate is a philosopher-biologist with interests in how methodological tools are used to make claims about genetic causes. Her current research focuses on the prevalence and degree of gene-environment covariance in heritability estimates.
|
||
|
Mandy is the lab manager, head butterfly-tamer, and the reason anything works.
|
||
|
|
||
|
|
||
|
|


PEER_INIT |
Channel: 0 |
This packet is sent during direct connection initialization between two ICQ clients. It is sent by the originator of the connection to start the handshake and by the receiver directly after it has sent the PEER_INITACK packet as a reply to the originator's PEER_INIT. The values after the COOKIE field have been added for v7.
Parameters
| Data type | Content | Name | Description |
| BYTE | ff | CMD | The command: connect. |
| WORD.L | 08 00 | TCPVER | The peer-to-peer version this packet uses. |
| WORD.L | 2b 00 | LENGTH | The length of the following data in bytes. |
| DWORD.L | xx xx xx xx | DESTUIN | The UIN this packet is sent to. |
| WORD.L | 00 00 | UNKNOWN | Unknown: empty. |
| DWORD.L | xx xx xx xx | OURPORT | The port the sender listens on. |
| DWORD.L | xx xx xx xx | OURUIN | The UIN of the sender. |
| DWORD | xx xx xx xx | OURREMIP | The IP of the sender as the server sees it. |
| DWORD | xx xx xx xx | OURINTIP | The local IP of the sender. |
| BYTE | 04 | TCPFLAGS | TCP connection flags. |
| DWORD.L | xx xx xx xx | OURPORT2 | The sender's "other" port. |
| DWORD.L | xx xx xx xx | COOKIE | The connection cookie the server gave for this pair of UINs. |
| DWORD.L | 50 00 00 00 | UNKNOWN | Unknown: 0x50 = 80. |
| DWORD.L | 03 00 00 00 | UNKNOWN | Unknown: 0x3 = 3. |
| DWORD.L | 00 00 00 00 | UNKNOWN | Unknown: empty. |
Examples
21:39:26 Outgoing TCP packet: ff 08 00 2b 00 d9 1f 37 - 01 00 00 18 8d 00 00 c7 ...+ .Ù.7 .... ...Ç 54 7f 09 25 29 c4 c1 25 - 29 c4 c1 04 18 8d 00 00 T.% )ÄÁ% )ÄÁ. .... e6 be 09 98 50 00 00 00 - 03 00 00 00 00 00 00 00 æ?.. P... .... ....
Attribution
Submitted by: tadu@gmx.de.


I was born and raised in Austin, TX but my real roots reach all the way to Poland and Russia.
My passion: Yoga! it's one of the most powerful methods for tapping into your fullest power. I wrote my Master's thesis on the concept of honing in on this power through mindfulness meditation.
 I have dozens of bookmarks from gift shops and bookstores from all over the country!


System Architect Picture "Timepoint Valued Qualifier"
Parent Diagram:
Phenomenon Qualifier
(OMT Object Model)


Hi,
Just tried to upgrade my emoncms to latest version following procedure here: http://emoncms.org/site/docs/upgrading
Followed instructions all the way to step 7. My data is not being updated. Trying the test: http://localhost/emoncms/input/post.json?csv=100,200,300 returns OK in the browser so that seems to work OK.
If I try posting data as follows: http://<IP_ADDRESS>/emoncms/node/set.json?nodeid=10&data=20,20,20,20&api...
I get the following error: Fatal error: Call to a member function fetch_array() on a non-object in /var/www/emoncms/Modules/node/node_model.php on line 194
I have tried rebooting the Pi but it no longer works.
Any ideas?
Re: Upgrade Emoncms Fails
Have you tried "Update and Check"? From the main view select Admin --->Click on the Update and Check button.
I was getting similar error messages after a new install, I selected the Update and Check and several things were "fixed" with that process. Give it a go and let us know what you found out.
Re: Upgrade Emoncms Fails
Hi,
There is no Admin in my emoncms main view. However, I can get to it by typing http://x.x.x.x/emoncms/admin/view
I then click on update and check and get the message database is up to date - nothing to do and it still does not work.
Re: Upgrade Emoncms Fails
OK I got rid of the fatal error - not sure how but it is gone now.
However, am I missing something? I was expecting once updated the existing inputs would just update when data was received from the EmoncmsTx V2 nodes - this is not happening. I noticed the nodes page in emoncms and tried creating a node but again nothing gets updated.
If I update from my web browser with: http://<IP_ADDRESS>/emoncms/node/set.json?nodeid=10&data=20,20,20,20&api... my inputs do not update although I get an updated a few seconds ago on my nodes page but no values get updated.
Any ideas?
Re: Upgrade Emoncms Fails
The node module is an alternative posting method to the input module, if you post to either you will not see any change in the other. Do you see any data in the input page if you use http://localhost/emoncms/input/post.json?csv=100,200,300 as in your 1st post ?
If yes then you are the on the right track, using the upgrade path you have (re)moves the whole emoncms directory and only reinstalls emoncms itself without any modules, if you are using rfm2pi you will need to either reinstall https://github.com/emoncms/raspberrypi or install the newly developed emonHub (or oem gateway),
Paul
Re: Upgrade Emoncms Fails
Hi,
Thanks for the info. I see data in the input page using: http://localhost/emoncms/input/post.json?csv=100,200,300
So I have moved the whole emoncms directory as you say and when I compared the Modules directories between emoncms_old and emoncms_new there are a lot of differences. So I now realise that I need to install the following modules into the new emoncms:
git clone https://github.com/emoncms/raspberrypi.git
git clone https://github.com/emoncms/event.git
git clone https://github.com/emoncms/openbem.git
git clone https://github.com/emoncms/energy.git
git clone https://github.com/emoncms/notify.git
git clone https://github.com/emoncms/report.git
git clone https://github.com/emoncms/packetgen.git
git clone https://github.com/elyobelyob/mqtt.git
I had just assumed that following the upgrade instructions would do all I need but I see still have a bit to learn!
Anyhow thanks for your help Paul - you got me going in the right direction to get it upgraded and working.


Custom Harmony Tutorial
Abundant Music uses a quite sophisticated harmonic rythm generator that supports different phrases and phrase groups.
It also supports custom harmonic rythms which allows the user to enter any scale and chord using the 12 equal temperament tuning.
Setting Up
We are just going to compose a single phrase in this tutorial so we'll use a custom song structure by setting "Overwrite Song Structure" to true. Also, make sure that there is only one "Verse 1" in the song structure.
Then, add a "song part type override info" for "Verse 1" and set "Override phrase group type" to true. Set the "Phrase group type" to "Single custom harmony".
Scroll down and set the "Custom harmony indices" to 1. If you set it to 0, the default harmonic rythm is used instead.
We are also going to force our custom harmony to use the main time signature. Select the "Parameters" tab and set "Set custom harmony numerator" to true.
Harmonic Rythm
In the "Details" tab, at the bottom, there is a list called "Harmony Elements" where you can add custom harmonic rythms.
Click on the "+ Simple Harmony Sequence" button and then click on the item that appears in the list.
Set "Length Mode" to "Count and Length Pattern", "Count" to 5 and "Chord Roots" to "0 1 3 4 0". This will give a common progression I, II, IV, V, I. Then set the "Length pattern" to "1 0.5 0.5 1 1" to determine the lengths (in measures) of the harmonic rythm.
We will now spice up the harmony with some seventh chords. Add a chord type to the "Chord Types" list and set it to "Seventh". Then set the "Chord Type Indices" to "0 1 1 1 0" which will set the middle chords to seventh.
We will now invert some of the chords by setting "Chord inversions" to "0 1 0 1 0", which will now give the progression I, II65, IV7, V65, I.
There! Now we have a nice little harmonic rythm that we have complete control over. We will now move on to constrain how the voice lines can move within this harmonic rythm.
Voice Line Constraints
Sometimes it is very useful to partly control the voice lines when you create your own harmonic rythm. Sometimes you want to steer the melody to the tonic in the final measure or prevent it from doing so etc. It is also possible to add constraints to avoid bad voice leading in those cases the default/classical voice leading planner fails to detect that something sounds like crap.
Abundant Music has a lot of different voice leading constraints built in but so far it currently only exposes the "Voice Chord Note Constraint". With this constraint, you can penalize that certain voice lines move to certain notes in the chord.
We are going to penalize the melody if it moves to the tonic and create an imperfect cadence, which also suits the progression well.
More Options
As you can see, there are many more options for harmonic rythms. You can define your own scale types by setting the "Custom Scales" property. The input is the absolute semi-tone offsets of the chromatic scale (12-TET). The default value "0 2 4 5 7 9 11" gives the major scale. Use comma "," to enter more custom scales.
You can then use "Custom Scale Indices" to index the scales you have entered.
Every scale has a number of "modes". For example, major and minor scale has 7 different modes which you can access by changing "Scale Modes". These can also be negative.
Chords can also be customized. Just change the chord type to "Custom" and use the "Custom Chords" property to select what scale notes to use in the chord.
It is possible to use the "original" rythm for the harmony by setting "Length Mode" to "Rythm Only". Then the total length will determine how long the harmonic rythm becomes. The total length can be overwritten by the "original" total length, which is probably a good idea since the rythm and total length are coupled.
Multiple Harmonic Rythms
You can create several custom harmonic rythms. To use them, just index them from the custom song structure parts (the index starts at 1 for the custom harmonies).
If you have a phrase group that has two or more phrases, you can just list the harmony indices that you want to use in order.


There can be no thought of finishing for "aiming for the stars." Both figuratively and literally, it is a task to occupy the generations. And no matter how much progress one makes, there is always the thrill of just beginning.
Page title (h1)
It suddenly struck me that that tiny pea, pretty and blue, was the Earth.  I didn't feel like a giant. I felt very, very small. (lead paragraph)
There can be no thought of finishing for "aiming for the stars." Both figuratively and literally, it is a task to occupy the generations. And no matter how much progress one makes, there is always the thrill of just beginning.
It suddenly struck me that that tiny pea, pretty and blue, was the Earth.  I didn't feel like a giant. I felt very, very small.
There can be no thought of finishing for "aiming for the stars." Both figuratively and literally, it is a task to occupy the generations. And no matter how much progress one makes, there is always the thrill of just beginning.
Second section heading (h2)
Heading within a section (h3)
It suddenly struck me that that tiny pea, pretty and blue, was the Earth.  I didn't feel like a giant. I felt very, very small.
There can be no thought of finishing for "aiming for the stars." Both figuratively and literally, it is a task to occupy the generations. And no matter how much progress one makes, there is always the thrill of just beginning.
Heading within a section (h3)
It suddenly struck me that that tiny pea, pretty and blue, was the Earth.  I didn't feel like a giant. I felt very, very small.
This bit has a list between paragraphs (h4)
It suddenly struck me that that tiny pea, pretty and blue, was the Earth.  I didn't feel like a giant. I felt very, very small.
There can be no thought of finishing for "aiming for the stars." Both figuratively and literally, it is a task to occupy the generations. And no matter how much progress one makes, there is always the thrill of just beginning.
Bulleted list, item 1
Bulleted list, item 2. Thie one is long enough to be able to wrap to the next line, so we can see list item leading in combination with list item spacing.
List item 3
There can be no thought of finishing for "aiming for the stars." Both figuratively and literally, it is a task to occupy the generations. And no matter how much progress one makes, there is always the thrill of just beginning.
Bulleted list, item 1
Bulleted list, item 2. Thie one is long enough to be able to wrap to the next line, so we can see list item leading in combination with list item spacing.
List item 3
Here's another section (h2)
Lorem ipsum dolor sit amet, consectetur adipisicing
elit. Neque ipsa voluptatibus soluta nobis unde quisquam
temporibus magnam debitis quidem. Ducimus ratione
corporis nesciunt earum vel est quaerat blanditiis
dolore ipsa?
Display heading
Heading level 1
Heading level 2
Heading level 3
Heading level 4
Heading level 5
Heading level 6
There can be no thought of finishing for "aiming for the stars." Both figuratively and literally, it is a task to occupy the generations. And no matter how much progress one makes, there is always the thrill of just beginning.
Page title (h1)
It suddenly struck me that that tiny pea, pretty and blue, was the Earth.  I didn't feel like a giant. I felt very, very small. (lead paragraph)
There can be no thought of finishing for "aiming for the stars." Both figuratively and literally, it is a task to occupy the generations. And no matter how much progress one makes, there is always the thrill of just beginning.
It suddenly struck me that that tiny pea, pretty and blue, was the Earth.  I didn't feel like a giant. I felt very, very small.
There can be no thought of finishing for "aiming for the stars." Both figuratively and literally, it is a task to occupy the generations. And no matter how much progress one makes, there is always the thrill of just beginning.
Second section heading (h2)
Heading within a section (h3)
It suddenly struck me that that tiny pea, pretty and blue, was the Earth.  I didn't feel like a giant. I felt very, very small.
There can be no thought of finishing for "aiming for the stars." Both figuratively and literally, it is a task to occupy the generations. And no matter how much progress one makes, there is always the thrill of just beginning.
Heading within a section (h3)
It suddenly struck me that that tiny pea, pretty and blue, was the Earth.  I didn't feel like a giant. I felt very, very small. (subheader paragraph)
This bit has a list between paragraphs (h4)
It suddenly struck me that that tiny pea, pretty and blue, was the Earth.  I didn't feel like a giant. I felt very, very small.
There can be no thought of finishing for "aiming for the stars." Both figuratively and literally, it is a task to occupy the generations. And no matter how much progress one makes, there is always the thrill of just beginning.
Bulleted list, item 1
Bulleted list, item 2. Thie one is long enough to be able to wrap to the next line, so we can see list item leading in combination with list item spacing.
List item 3
There can be no thought of finishing for "aiming for the stars." Both figuratively and literally, it is a task to occupy the generations. And no matter how much progress one makes, there is always the thrill of just beginning.
Bulleted list, item 1
Bulleted list, item 2. Thie one is long enough to be able to wrap to the next line, so we can see list item leading in combination with list item spacing.
List item 3
Here's another section (h2)
Lorem ipsum dolor sit amet, consectetur adipisicing
elit. Neque ipsa voluptatibus soluta nobis unde quisquam
temporibus magnam debitis quidem. Ducimus ratione
corporis nesciunt earum vel est quaerat blanditiis
dolore ipsa?
Heading 2
If you have received financial aid offers, use this tool to compare school data.If you have received financial aid offers, use this tool to compare school data. If you have received financial aid offers, use this tool to compare school data. If you have received financial aid offers, use this tool to compare school data.
If you have received financial aid offers, use this tool to compare school data.If you have received financial aid offers, use this tool to compare school data. If you have received financial aid offers, use this tool to compare school data. If you have received financial aid offers, use this tool to compare school data.
Heading 3
If you have received financial aid offers, use this tool to compare school data.If you have received financial aid offers, use this tool to compare school data. If you have received financial aid offers, use this tool to compare school data. If you have received financial aid offers, use this tool to compare school data.
If you have received financial aid offers, use this tool to compare school data.If you have received financial aid offers, use this tool to compare school data. If you have received financial aid offers, use this tool to compare school data. If you have received financial aid offers, use this tool to compare school data.
Heading 4
If you have received financial aid offers, use this tool to compare school data.If you have received financial aid offers, use this tool to compare school data. If you have received financial aid offers, use this tool to compare school data. If you have received financial aid offers, use this tool to compare school data.
If you have received financial aid offers, use this tool to compare school data.If you have received financial aid offers, use this tool to compare school data. If you have received financial aid offers, use this tool to compare school data. If you have received financial aid offers, use this tool to compare school data.


VGCONVERT
Section: Maintenance Commands (8)Updated: LVM TOOLS 2.02.95(2)-RHEL6 (2012-10-16)
Index Return to Main Contents
NAME
vgconvert - convert volume group metadata formatSYNOPSIS
vgconvert [-d|--debug] [-h|--help] [-t|--test] [-v|--verbose] [--labelsector] [-M|--metadatatypetype] [--pvmetadatacopies#copies] [--metadatasizesize] [--version] VolumeGroupName [VolumeGroupName...]DESCRIPTION
vgconvert converts VolumeGroupName metadata from one format to another provided that the metadata fits into the same space.OPTIONS
See lvm(8) and pvcreate(8) for options.EXAMPLE
Convert volume group vg1 from LVM1 metadata format to the new LVM2 metadata format.RECOVERY
Use pvscan(8) to see which PVs lost their metadata. Run pvcreate(8) with the --uuid and --restorefile options on each such PV to reformat it as it was, using the archive file that vgconvert(8) created at the start of the procedure. Finally run vgcfgrestore(8) with that archive file to restore the original metadata.SEE ALSO
lvm(8), pvcreate(8), vgcfgrestore(8)
Index
This document was created by man2html, using the manual pages.
Time: 05:34:31 GMT, December 24, 2015


Fruit juice size
Small
Medium
Large
I like cherry
I like banana
Required fields are followed by
*
.
Name:
*
Name:
*
Name:
*
Banana
Cherry
Lemon
Banana
Cherry
Lemon
Carrot
Eggplant
Potato
Banana
Cherry
Lemon
What's your favorite fruit?
Apple
Banana
Blackberry
Blueberry
Lemon
Lychee
Peach
Pear
What is your favorite meal?
Soup
Curry
Pizza
This a
submit button
When are you available this summer?
75/100
75


The aim of the proposal is: To enable interIIT players to choose a diet according to their individual nutritional needs.
This proposal will be implemented in the following way:
1. In order to come up with a balanced diet plan, interIIT captains, PTIs, coaches and senior players will be contacted.
2. It will be optimised for the Gymkhana budget, which is currently ₹52 per day per person.
3. The diet plan will be approved by a nutritionist selected by the Hall Management Committee.
4.The Technology Students’ Gymkhana will announce a detailed quotation to canteens with the approval of the President, Technology Students’ Gymkhana.
5. A contract will be awarded based on the cost per specified item and a quality check.
6.An approval from the hall warden will be obtained for the canteen to be able to sell the specified products.
7. InterIIT players will be given coupons, which can then be reimbursed at the canteen.
This proposal will be very beneficial to the student community because:
1. Vegetarians would be able to choose a suitable replacement, such as protein shakes, sprouts, etc instead of egg.
2. There will be a wider choice of food and nutritional supplements.
3. InterIIT players will be able to have their dinner at the canteen itself in case they are late for dinner in their respective mess.
4. Food and nutrition is an important aspect of health and fitness, and this initiative will greatly improve these aspects.
The aim of this proposal is: To create a fun weekend for sports and games along the lines of freshers orientation program held by social and cultural societies.
The proposed sports carnival will have the following features:
1. It will be a compact weekend event encompassing various sports and games.
2. The event will be open to all postgraduate students, research scholars and undergraduate first year students.
3. Students register in teams of three and take part in various events.
4. The sports involved are tennis, football, archery, rollerblading, athletics and wall climbing.
5. Each event will be a short task, the completion of which gives standard po
ints. 6. In tennis, two teams are pitted against each other for a set time limit. The number of points won by each team is the standard points won in this event.
7. In football, two teams play against each other for a fixed time limit of five minutes. The number of goals scored per team is the standard points won by the respective teams in this event.
8. In archery, five tries are given per team. The total points scored is the standard points won in this event.
9. In athletics, standard points will be assigned based on the time taken by the team contestants in a 100m dash.
10. In rollerblading and wall climbing, no standard points will be assigned as such, but goodies will be distributed to the teams who successfully complete the task assigned.
This proposal will greatly benefit the general population on campus in these ways:
1. This will encourage bonding of freshers over sports.
2. It will promote a culture of recreational sports.
3. It will encourage a personal onetoone interaction with senior players and interIIT captains.
4. Sports are found to be quite popular will be included in the open IIT sports tournaments
5. This will integrate more postgraduate students and research scholars into the sports community.
The aim of this proposal is: To conduct a series of mentoring workshops for initiate newbies into a sport of their choice.
The timeline for the execution of this proposal will be as follows:
1. Senior players, interIIT players, PTIs and captains will be consulted at the start of the semester.
2. Suitable dates will be drawn up in the autumn semester before the Open IIT events begin.
This proposal will greatly benefit the general population on campus in these ways:
1. This will encourage bonding of freshers over sports.
2. It will encourage a personal onetoone interaction with senior players and interIIT captains.
3. Sports are found to be quite popular will be included in the open IIT sports tournaments
4. This will integrate more postgraduate students and research scholars into the sports community.


20230829<EMAIL_ADDRESS>This is the repo for course content for TCD's witidtm elective module. (TEU00311) The canonical URL for this is https://down.dsg.cs.tcd.ie/witidtm/. On github, this is https://github.com/sftcd/witidtm. The content should be identical.
We'll be using the TCD Blackboard tool for assignments etc. Apologies that only registered students can see that material.
Lecture slides etc are below.
This year the module is fully in-person, with no streaming and no recordings.
Our lecture slots are:
We have labs in ORI LG36 on Thursday 21st and 28th September instead of lectures. Here's a map of TCD showing where to find LG36, and here's a diagram showing where the door is (it's non-obvious:-).
We'll still do an online "office hour" session on Monday's at 1100, just drop in to the "office hour" blackboard session, and chat as you want.
Lecture content will accumulate here as we go. Be aware that the content will change, even sometimes at the last minute!
You can look at the materials from previous years below or the 2019 stuff here. This year's content will re-use some of earlier stuff, likely modifed, and some things will be new.
You can also enjoy (heh:-) the 2021 recordings or 2020 recordings if you want.
Stephen's sessions:
Eoin's sessions:
Dave's sessions:
Guest lectures:
Assignments:
Lab slides:
News-ish things:
Lab/Assignment slides:
Stephen's sessions:
Eoin's links/sessions:
Dave's sessions:
Guest sessions:
Stephen's sessions:
Eoin's sesions:
Dave's sessions:
Sessions with guests:
Notes/stories: - voter identification - 700M LinkedIn a/cs scraped


game. ParticleEmitter
Source: game2/
a type of object used to continuously generate particles
Properties
Methods
- accelerate(deltaSpd)
- accelerateOnFrame(gameManager, dT)
- accelerateXY(x, y)
- canCollide(object)
- collides(obj)
- copyAcceleration()
- copyPosition()
- copySpeed()
- createParticle(lifeTime, position, angle, speed)
- createParticles(number)
- getAcceleration()
- getColliderRadius()
- getColliderRect()
- getEmitDistance()
- getEmitRate()
- getMaxAngle()
- getMinAngle()
- getParticleGenerator()
- getParticlesMaxLifeTime()
- getParticlesMinLifeTime()
- getPosition()
- getRadius()
- getRect()
- getRenderRadius()
- getRenderRect()
- getRotationSpeed()
- getSizeReduceFactor()
- getSpeed()
- getSpeedDampFactor()
- isInCollisionLayer(layer)
- isOutOfRect(rect[, marginX][, marginY])
- isRunning()
- kill(gameManager)
- maintainInRect(rect, marginX, marginY)
- move(delta)
- moveOnFrame(gameManager, dT)
- moveXY(x, y)
- onCollision(gameManager, object)
- onDeath(gameManager)
- onFinished(gameManager)
- onFrame(gameManager, dT)
- prepareCollision()
- render(context2d)
- renderDebug(context2d)
- restart()
- rotate(radians)
- rotateOnFrame(gameManager, dT)
- scale(factor)
- setAcceleration(acc)
- setAccelerationXY(x, y)
- setAngles(min, max)
- setCollider(collider)
- setEmitDistance(emitDistance)
- setEmitRate(rate)
- setMaxAngle(max)
- setMinAngle(min)
- setParticleGenerator(generator)
- setParticlesLifeTime(min[, max])
- setParticlesMaxLifeTime()
- setParticlesMinLifeTime(mlt)
- setPosition(pos)
- setPositionXY(x, y)
- setRenderer(renderer)
- setRotationSpeed(radPerSec)
- setSizeReduceFactor(factor)
- setSpeed(spd)
- setSpeedDampFactor(factor)
- setSpeedXY(x, y)
- stop()
new ParticleEmitter(position, rate, max)
Parameters
| Name | Type | Optional | Description |
|---|---|---|---|
|
position |
|
||
|
rate |
number |
|
|
|
max |
number |
|
Defaults to |
- Extends
- game.Object
Properties
accel unknown
- Inherited from
- game.Object#accel
bodyLayer unknown
the body layer of this object. As it is generally common to all objects of the same class, this attribute is generally defined in the prototype of the class, but you can do it anywhere you want for your objects. This number defines where the body of the object is located. If an other object want to be able to collide with it, it must have the same number in its game.Object#collisionLayers array.
- Inherited from
- game.Object#bodyLayer
collisionLayers unknown
the collision layers of this object. As it is generally common to all objects of the same class, this attribute is generally defined in the prototype of the class, but you can do it anywhere you want for your objects. This array defines which objects this object can collide with. To collide with an object, this array must contain the bodyLayer value.
- Inherited from
- game.Object#collisionLayers
emitDistance number
emited number
number of particles emitted. equal to -1 if the emitter is paused, this value is equal to -1. When the emitter is restarted, this value is set to 0.
emitedParticles Array of game.Particle
a list of all living particles in the game. Used to perform actions such as speed damping or size damping.
max number
maximum number of particles this emitter can create in its lifetime. When this number is reached, the emitter stops creating particles and when no particles are living anymore, the emitter kills itself. If this value is equal to 0, the maximum is disabled : the emitter will continuously create particles until the game is over.
maxAngle number
maxLifeTime number
maxSpeed number
minAngle number
minLifeTime number
minSpeed number
particleGenerator game.particleGenerator
position unknown
- Inherited from
- game.Object#position
rate number
number of particles created in one second.
reduceSizeFactor number
renderLayer unknown
the render layer of this object. As it is generally common to all objects of the same class, this attribute is generally defined in the prototype of the class, but you can do it anywhere you want for your objects. The default value is game.RenderLayer.OBJ1; This attributes is used to define an order for the objects to be drawn on the screen, and must be part of the game.RenderLayer enumeration, or an other number if you handle it in your own game map.
- Inherited from
- game.Object#renderLayer
speed unknown
- Inherited from
- game.Object#speed
speedDampFactor number
Methods
accelerate(deltaSpd) → game.Object
increase the object's speed according to the parameter
Parameter
| Name | Type | Optional | Description |
|---|---|---|---|
|
deltaSpd |
|
|
- Inherited from
- game.Object#accelerate
- Returns
-
this
accelerateOnFrame(gameManager, dT)
called by the onFrame method. increase speed according acceleration.
Parameters
| Name | Type | Optional | Description |
|---|---|---|---|
|
gameManager |
|
|
|
|
dT |
|
|
- Inherited from
- game.Object#accelerateOnFrame
accelerateXY(x, y) → game.Object
increase the object's speed according to the parameters
Parameters
| Name | Type | Optional | Description |
|---|---|---|---|
|
x |
|
|
|
|
y |
|
|
- Inherited from
- game.Object#accelerateXY
- Returns
-
this
canCollide(object) → boolean
returns whether or not this objects can collide with other objects. Particles emitters do not collide.
Parameter
| Name | Type | Optional | Description |
|---|---|---|---|
|
object |
|
- Returns
-
boolean
false
collides(obj) → boolean
returns true if the instances collides with the parameter object. This method is called after <!-- the canCollide method and before the onCollision method, for both objects
Parameter
| Name | Type | Optional | Description |
|---|---|---|---|
|
obj |
|
|
- Inherited from
- game.Object#collides
- Returns
copyAcceleration() → (utils.geometry2d.Vec2 or Vec2)
returns a copy of the acceleration of the object.
- Inherited from
- game.Object#copyAcceleration
- Returns
copyPosition() → (utils.geometry2d.Vec2 or Vec2)
returns a copy of the position of the object
- Inherited from
- game.Object#copyPosition
- Returns
copySpeed() → utils.geometry2d.Vec2
returns a copy of the speed of the object
- Inherited from
- game.Object#copySpeed
- Returns
createParticle(lifeTime, position, angle, speed) → game.Particle
create a particle using the particle generator.
Parameters
| Name | Type | Optional | Description |
|---|---|---|---|
|
lifeTime |
number |
|
|
|
position |
|
||
|
angle |
number |
|
|
|
speed |
number |
|
- Returns
createParticles(number) → Array of game.Particle
create the specified number of particles using random values for lifeTime, position, angle and speed
Parameter
| Name | Type | Optional | Description |
|---|---|---|---|
|
number |
number |
|
- Returns
-
Array of game.Particle
getAcceleration() → (Vec2 or utils.geometry2d.Vec2)
returns the acceleration of the object, or Vec2.ZERO if the attrbute does not exist.
- Inherited from
- game.Object#getAcceleration
- Returns
getColliderRadius() → number
returns the radius of the collider or 0 if it doesn't exist.
- Inherited from
- game.Object#getColliderRadius
- Returns
getColliderRect() → utils.geometry2d.Rect
returns the Rect containing the object's collider, or at least the position.
- Inherited from
- game.Object#getColliderRect
- Returns
getEmitDistance() → number
returns the distance from the emitter center the particles are created at.
- Returns
-
number
getEmitRate() → number
returns the number of particles created per second
- Returns
-
number
getMaxAngle() → number
returns the maximum emission angle.
- Returns
-
number
getMinAngle() → number
returns the minimum emission angle.
- Returns
-
number
getParticleGenerator() → game.particleGenerator
returns the particleGenerator that generates all particles
- Returns
getParticlesMaxLifeTime() → number
returns the maximum lifetime of the particles created.
- Returns
-
number
getParticlesMinLifeTime() → number
returns the minimum lifetime of the particles created.
- Returns
-
number
getPosition() → Vec2
returns the position of the object, or Vec2.ZERO if the attribute does not exist.
- Inherited from
- game.Object#getPosition
- Returns
getRadius() → number
returns the radius of the object, ie the maximum between the radius of the collider and the one of the renderer if they exists, or 0.
- Inherited from
- game.Object#getRadius
- Returns
getRect() → utils.geometry2d.Rect
returns the Rect containing the object, ie the collider and the renderer if they exists, and the position point.
- Inherited from
- game.Object#getRect
- Returns
getRenderRadius() → number
returns the radius of the renderer or 0 if it doesn't exist.
- Inherited from
- game.Object#getRenderRadius
- Returns
getRenderRect() → utils.geometry2d.Rect
returns the Rect containing the object's renderer, or at least the position.
- Inherited from
- game.Object#getRenderRect
- Returns
getRotationSpeed() → number
returns the rotation speed (in radians per second) of the object if it exists, or 0.
- Inherited from
- game.Object#getRotationSpeed
- Returns
getSizeReduceFactor() → number
returns the size reduce factor
- Returns
-
number
getSpeed() → utils.geometry2d.Vec2
returns the speed of the object, or Vec2.ZERO if the attribute does not exist.
- Inherited from
- game.Object#getSpeed
- Returns
getSpeedDampFactor() → number
returns the speed damping factor.
- Returns
-
number
isInCollisionLayer(layer) → boolean
returns true if this object can collide with objects which are in the specified layer.
Parameter
| Name | Type | Optional | Description |
|---|---|---|---|
|
layer |
|
|
- Inherited from
- game.Object#isInCollisionLayer
- Returns
isOutOfRect(rect[, marginX][, marginY]) → boolean
returns whether or not the object is outside the specified rectangle.
Parameters
| Name | Type | Optional | Description |
|---|---|---|---|
|
rect |
|
|
|
|
marginX |
|
Yes |
Defaults to |
|
marginY |
|
Yes |
Defaults to |
- Inherited from
- game.Object#isOutOfRect
- Returns
isRunning() → boolean
returns true if the emitter is creating particles every frame (i.e if it hasn't been stopped and if the maximum hasn't been reached).
- Returns
-
boolean
kill(gameManager)
kills the object and removes it from the game before the next frame. The onDeath method is then called
Parameter
| Name | Type | Optional | Description |
|---|---|---|---|
|
gameManager |
|
|
- Inherited from
- game.Object#kill
maintainInRect(rect, marginX, marginY) → utils.geometry2d.Vec2
maintains the object inside the specified rectangle. you can call this method inside the game.Object#moveOnFrame method, for example, to make sure the object does not go out of a rectangle. This function returns the vector used to move the object inside the rectangle.
Parameters
| Name | Type | Optional | Description |
|---|---|---|---|
|
rect |
|
|
|
|
marginX |
|
|
Defaults to |
|
marginY |
|
|
- Inherited from
- game.Object#maintainInRect
- Returns
move(delta) → game.Object
moves the object of the specified translation.
Parameter
| Name | Type | Optional | Description |
|---|---|---|---|
|
delta |
|
|
- Inherited from
- game.Object#move
- Returns
-
this
moveOnFrame(gameManager, dT)
called by the onFrame method. moves according speed.
Parameters
| Name | Type | Optional | Description |
|---|---|---|---|
|
gameManager |
|
|
|
|
dT |
|
|
- Inherited from
- game.Object#moveOnFrame
moveXY(x, y) → game.Object
moves the object according to the specified translation coordinates
Parameters
| Name | Type | Optional | Description |
|---|---|---|---|
|
x |
|
|
|
|
y |
|
|
- Inherited from
- game.Object#moveXY
- Returns
-
this
onCollision(gameManager, object)
called by the game manager on the collision with the specified object.
Parameters
| Name | Type | Optional | Description |
|---|---|---|---|
|
gameManager |
|
|
|
|
object |
|
|
- Inherited from
- game.Object#onCollision
onDeath(gameManager)
called by the game manager the moment the object is removed from the game.
Parameter
| Name | Type | Optional | Description |
|---|---|---|---|
|
gameManager |
|
|
- Inherited from
- game.Object#onDeath
onFinished(gameManager)
method called by the object itself when all particles are generated and dead. kills the emitter
Parameter
| Name | Type | Optional | Description |
|---|---|---|---|
|
gameManager |
|
onFrame(gameManager, dT)
called every frame by the game manager. creates the needed particles and add them to the game, change their size and speed, ...
Parameters
| Name | Type | Optional | Description |
|---|---|---|---|
|
gameManager |
|
||
|
dT |
number |
|
prepareCollision()
called at the beginning of the collision part of a frame, after the game manager has called the onFrame method for all objects. This method is only called for objects with a bodyLayer greater or equal to 0.
- Inherited from
- game.Object#prepareCollision
render(context2d)
called by the game map to draw the object on the canvas
Parameter
| Name | Type | Optional | Description |
|---|---|---|---|
|
context2d |
|
|
- Inherited from
- game.Object#render
renderDebug(context2d)
call this function if you want to draw debug informations on the canvas. draws the collider.
Parameter
| Name | Type | Optional | Description |
|---|---|---|---|
|
context2d |
|
|
- Inherited from
- game.Object#renderDebug
restart()
restarts the particle emission by setting the game.ParticleEmitter#emited
attribute to 0.
rotate(radians)
rotates the emitter, changing the min and max angles
Parameter
| Name | Type | Optional | Description |
|---|---|---|---|
|
radians |
number |
|
rotateOnFrame(gameManager, dT)
called by the onFrame method. rotate according to rotation speed if exists.
Parameters
| Name | Type | Optional | Description |
|---|---|---|---|
|
gameManager |
|
|
|
|
dT |
|
|
- Inherited from
- game.Object#rotateOnFrame
scale(factor) → game.Object
change the object size by multiplying it's dimensions by the given factor
Parameter
| Name | Type | Optional | Description |
|---|---|---|---|
|
factor |
|
|
- Inherited from
- game.Object#scale
- Returns
-
this
setAcceleration(acc) → game.Object
sets the acceleration of the object to the specified one if the attribute exists, useless otherwise
Parameter
| Name | Type | Optional | Description |
|---|---|---|---|
|
acc |
|
|
- Inherited from
- game.Object#setAcceleration
- Returns
-
this
setAccelerationXY(x, y)
sets the acceleration coordinates of the object to the specified values if the attribute exists, useless otherwise
Parameters
| Name | Type | Optional | Description |
|---|---|---|---|
|
x |
|
|
|
|
y |
|
|
- Inherited from
- game.Object#setAccelerationXY
setAngles(min, max)
sets the maximum and minimum emission angles to the specified values.
Parameters
| Name | Type | Optional | Description |
|---|---|---|---|
|
min |
number |
|
|
|
max |
number |
|
setCollider(collider)
sets the collider
attribute of the object.
Parameter
| Name | Type | Optional | Description |
|---|---|---|---|
|
collider |
|
|
- Inherited from
- game.Object#setCollider
setEmitDistance(emitDistance)
sets the distance from the emitter center the particles are created at.
Parameter
| Name | Type | Optional | Description |
|---|---|---|---|
|
emitDistance |
number |
|
setEmitRate(rate)
sets the number of particles created per second
Parameter
| Name | Type | Optional | Description |
|---|---|---|---|
|
rate |
number |
|
setMaxAngle(max)
sets the maximum emission angle to the specified value.
Parameter
| Name | Type | Optional | Description |
|---|---|---|---|
|
max |
number |
|
setMinAngle(min)
sets the minimum emission angle to the specified value.
Parameter
| Name | Type | Optional | Description |
|---|---|---|---|
|
min |
number |
|
setParticleGenerator(generator)
sets the particle generator of the particle emitter.
Parameter
| Name | Type | Optional | Description |
|---|---|---|---|
|
generator |
|
setParticlesLifeTime(min[, max])
sets the minimum and maximum lifetime of the particles created. The actual lifetime of the particles will be a random value between the maximum and the minimum.
Parameters
| Name | Type | Optional | Description |
|---|---|---|---|
|
min |
number |
|
|
|
max |
number |
Yes |
if max < min, then max = min. Defaults to |
setParticlesMaxLifeTime()
sets the maximum lifetime of the particles created.
Parameter
| Name | Type | Optional | Description |
|---|---|---|---|
|
mlt. |
number |
|
no check is performed to make sure the maximum is above or equal to the maximum. |
setParticlesMinLifeTime(mlt)
sets the minimum lifetime of the particles created.
Parameter
| Name | Type | Optional | Description |
|---|---|---|---|
|
mlt |
number |
|
setPosition(pos) → game.Object
sets the position of the object to the specified one if the attribute exists, creates it otherwise
Parameter
| Name | Type | Optional | Description |
|---|---|---|---|
|
pos |
|
|
- Inherited from
- game.Object#setPosition
- Returns
-
this
setPositionXY(x, y) → game.Object
sets the position of the object to the specified coordinates if the attribute exists, creates it otherwise
Parameters
| Name | Type | Optional | Description |
|---|---|---|---|
|
x |
|
|
|
|
y |
|
|
- Inherited from
- game.Object#setPositionXY
- Returns
-
this
setRenderer(renderer)
sets the renderer
attribute of the object.
Parameter
| Name | Type | Optional | Description |
|---|---|---|---|
|
renderer |
|
|
- Inherited from
- game.Object#setRenderer
setRotationSpeed(radPerSec)
set the rotation speed of the object to the specified value in radians per seconds.
Parameter
| Name | Type | Optional | Description |
|---|---|---|---|
|
radPerSec |
|
|
- Inherited from
- game.Object#setRotationSpeed
setSizeReduceFactor(factor)
sets the size reduce factor
Parameter
| Name | Type | Optional | Description |
|---|---|---|---|
|
factor |
number |
|
setSpeed(spd) → game.Object
sets the speed of the object to the specified one if the attribute exists, creates it otherwise
Parameter
| Name | Type | Optional | Description |
|---|---|---|---|
|
spd |
|
|
- Inherited from
- game.Object#setSpeed
- Returns
-
this
setSpeedDampFactor(factor)
sets the speed damping factor.
Parameter
| Name | Type | Optional | Description |
|---|---|---|---|
|
factor |
number |
|
setSpeedXY(x, y) → game.Object
sets the speed coordinates of the object to the specified values if the attribute exists, creates it otherwise
Parameters
| Name | Type | Optional | Description |
|---|---|---|---|
|
x |
|
|
|
|
y |
|
|
- Inherited from
- game.Object#setSpeedXY
- Returns
-
this
stop()
stops the particle emission by setting the game.ParticleEmitter#emited
attribute to 0.


2CARS
2
CARS
Fork by Erik Martínez
@2014 NO POWER-UP
GAME OVER
SCORE
0
BEST
0
0
Your device can't play audio


Docker Viewer
Docker System Info
Refresh
Images
Containers
Images
Refresh
Delete All
Id
Tag
Created
Size
Containers
Containers
Refresh
Delete All
Name
Image
Network
State


The following is random text that is placed on new lines with the paragraph elements:
ohadisfgbdsaohfbsdahiofbsdaho
ohadisfgbdsaohfbsdahiofbsdahof
fffffffffffffbhosdibfhosdvfasdjbf
gascvzxgjcvgxjvhfbsdakhfbhjvdfsdhfbvhjvfdsjvjsvhhvdsa
This line use the Bring Attention To element to make James bold
This line use the Strong Importance element to make James bold
This line use the I element to make James italics
This line use the The Emphasis element to make James italics
The following are my favorite colors. They are an ordered list:
The following are my favorite colors. They are an unordered list:


Hi!
This is an introduction so that the page doesn't aruptly start off with my mini-biography.
The fact that it's starting with useless information still bothers me, though.
Scroll down because the introduction ends here.
Me in a nutshell
I am a human.
Call me by a gender-unspecific pronoun please.
Favorite game: Minecraft, though I don't play it much, I don't play any other game so...
Favorite social network: Scratch, though some people think it's not social media. We both don't seem to understand each other.
Favorite species: Sheep, unless that's just the general term for a group of species, then whatever one is the cutest one, I guess.
Favorite sport: I don't like sports in general. Including math competitions. That's a sport too.

My name is Sean. Nice to meat you.
Outcomes of me being productive
When it comes to being productive, I've made a couple of things.
I've mostly been on Scratch and so here's one of my best projects.
All of my CSS/JS/HTML tests are unsafely located here.
I've also made a conlang called Eyo. It's not a valid language yet since no one else knows it. ;-;
In Minecraft, I've made a few simple one command block creations, but I don't remember where I kept them so I guess there's no point in showing that off.
And to conclude my bragging rights, my fastest mile time is at least 9 minutes. :P


--- layout: newsstory title: VERY VERY WET match: Yeltz P Cirencester P ---
The whole country's been hit by some awful weather over the last few days, so it was no surprise that the game against Cirencester was called off early Saturday morning because of a waterlogged pitch. As all the other games were off as well, obviously there's been no effect to the table.
Everyone was saddened by hearing of the death of Brendan's father this week. He's had to go to Jamaica for a couple of weeks to sort things out leaving team affairs in the hands of Mark Taylor, Neil Smith and Tim Clarke.
Weather permitting, we've got Evesham at home on Tuesday in the Worcester Senior Cup replay, before a game of real consequence at home to Weston in a very important promotion game. Come on!


Search for a job, task or resume
Denver, CO
·
Preview this post
Denver, CO
·
Preview this post
SUMMARY
APPLICANTS
JOB BOARD
INTERVIEWS
ACTIVITY
BROADCAST
NOTIFICATIONS
| JOB DESCRIPTION | EDIT |
| POSITION TITLE | Software Developer |
| LOCATION | Denver, CO |
| EMPLOYMENT TYPE | Full-time |
| EXPERIENCE | Entry-level |
| STATUS | Open |
| DESCRIPTION | The Software Developer is responsible for interacting with and providing quality assistance to all radical computers, responsible for keeping up-to-date in the various product shizzle; helping the bidness reduce web page loading times while doing a backhand spring and eating a cuban sandwich. |
| HIRING LEAD | Tina Tizzy |
| APPROVED SALARY | $58,000 |
Link to this Job
Lorem ipsum dolor sit amet, consectetur adipis cing elit. Integer mollis neque eget vestibpend.
Use the Button Widget
This widget embeds the buttons for sharing the job for submitting a resume on your website.
Upload Resumes by Email
You can automatically upload multiple resumes to this job by emailing the address below.


Contact Us
To contact us simply fill the form below. Please take a minute reading both our
FAQ
(frequently asked questionss) and our
TOS
(terms of service) before sending any messages regarding our services.


--- layout: post title: Encapsulate function calls with Reflection.Emit categories: - .Net - .NET - C# - CSharp - delegates - emit - English - Expression - reflection - Reflection.Emit - TypeBuilder status: publish type: post published: true meta: _edit_last: '1' _jd_tweet_this: 'yes' _jd_twitter: '' _wp_jd_clig: '' _wp_jd_bitly: '' _wp_jd_wp: http://www.logv.ws/?p=63 _wp_jd_yourls: '' _wp_jd_url: '' _wp_jd_target: '' _jd_wp_twitter: ! 'a:2:{i:0;s:82:"New post: Encapsulate function calls with Reflection.Emit http://www.logv.ws/?p=63";i:1;s:85:"Post Edited: Encapsulate function calls with Reflection.Emit http://www.logv.ws/?p=63";}' --- My current spare time project YAAF had some requirement that I need to intercept calls to a function. The interceptor then decides if the function gets called or not. But I wanted to parameters to be encapsulated, so the interceptor does not have access to them. The easiest way to do this was a simple delegate that will be passed to the interceptor and represents the complete context needed to call the callee when the interceptor decides to do so. But how to do it? With lambda expressions that is easy so I created a sample like this:
class TestClass { private ITest _instance; public Action Foo(string blah, string blub) { Action bar = () =>; _instance.Foobar(blah, blub); return bar; } }This does exactly what I want! It creates a delegate the encapsulates the complete call. In order to be able to create the same with Reflection.Emit I had a look at the resulting IL code. And I was a little bit surprised but look yourself what the compiler generates.
.method public hidebysig instance class [mscorlib]System.Action Foo ( string blah, string blub ) cil managed { // Method begins at RVA 0x20b4 // Code size 47 (0x2f) .maxstack 3 .locals init ( [0] class [mscorlib]System.Action bar, [1] class AttributeTest.TestClass/'<>c__DisplayClass1' 'CS$<>8__locals2', [2] class [mscorlib]System.Action CS$1$0000 ) IL_0000: newobj instance void AttributeTest.TestClass/'<>c__DisplayClass1'::.ctor() IL_0005: stloc.1 IL_0006: ldloc.1 IL_0007: ldarg.1 IL_0008: stfld string AttributeTest.TestClass/'<>c__DisplayClass1'::blah IL_000d: ldloc.1 IL_000e: ldarg.2 IL_000f: stfld string AttributeTest.TestClass/'<>c__DisplayClass1'::blub IL_0014: ldloc.1 IL_0015: ldarg.0 IL_0016: stfld class AttributeTest.TestClass AttributeTest.TestClass/'<>c__DisplayClass1'::'<>4__this' IL_001b: nop IL_001c: ldloc.1 IL_001d: ldftn instance void AttributeTest.TestClass/'<>c__DisplayClass1'::'Ok this looks a bit different from what expected and what's this strange class /'<>c__DisplayClass1'. Lets have a look at that class too:b__0'() IL_0023: newobj instance void [mscorlib]System.Action::.ctor(object, native int) IL_0028: stloc.0 IL_0029: ldloc.0 IL_002a: stloc.2 IL_002b: br.s IL_002d IL_002d: ldloc.2 IL_002e: ret }
[CompilerGenerated] private sealed class <>c__DisplayClass1 { public TestClass <>4__this; public string blah; public string blub; public <>c__DisplayClass1() { base..ctor(); } public voidLooks like the compiler created a wrapper class for this delegate call. The class holds all the fields needed to perform the call and a parameterless void that contains the code I wrote in the expression. The compiler than replaced my code with code that at first creates a instance of the wrapper, then fills all the parameters according to the call I want to be encapsulated and then creates a delegate that points to the created instances method that represents the expression. Ok lets try this at home ;-) I created a little console project that looks like this:b__0() { this.<>4__this._instance.Foobar(this.blah, this.blub); } }
static void Main(string[] args) { var instance = new Test(); var builder = new DelegateBuilder(); var deleg = builder.GetDelegate(instance, "TestTheBest", "Test call"); deleg(); }It creates an instance of Test and DelegateBuilder and then tells the DelegateBuilder instance to build a delegate for the function TestTheBest with the parameter "Test call". This delegate holds all the needed information to perform the operation just like the compiler did, but how to do this at runtime? Lets have a closer look to the builders GetDelegateMethod:
public Action GetDelegateThis method uses Reflection.Emit to create a new class and a delegate just like the compiler did. At first a new Type is declared that holds a reference to instance on which the delegate should invoke the function(T instance, string methodName, params object[] param) { var toInvoke = typeof(T).GetMethod(methodName); var wrapperType = this._moduleBuilder.DefineType(toInvoke.Name + "InvokeWrapper", TypeAttributes.AutoClass | TypeAttributes.Sealed | TypeAttributes.Public); var that = wrapperType.DefineField("_that", toInvoke.DeclaringType, FieldAttributes.Public); var fields = new Dictionary (); var parameters = toInvoke.GetParameters(); foreach (ParameterInfo parameter in parameters) { var field = wrapperType.DefineField(parameter.Name, parameter.ParameterType, FieldAttributes.Public); fields.Add(parameter.Name, field); } var method = wrapperType.DefineMethod("Run", MethodAttributes.Public); var ilMethod = method.GetILGenerator(); ilMethod.Emit(OpCodes.Ldarg_0); ilMethod.Emit(OpCodes.Ldfld, that); foreach (var parameter in parameters) { ilMethod.Emit(OpCodes.Ldarg_0); ilMethod.Emit(OpCodes.Ldfld, fields[parameter.Name]); } ilMethod.Emit(OpCodes.Callvirt, toInvoke); ilMethod.Emit(OpCodes.Ret); var ctor = wrapperType.DefineConstructor(MethodAttributes.Public, CallingConventions.Standard, new[] { toInvoke.DeclaringType }.Concat(param.Select(i => i.GetType())).ToArray()); var ilConstructor = ctor.GetILGenerator(); ilConstructor.Emit(OpCodes.Ldarg_0); ilConstructor.Emit(OpCodes.Ldarg_1); ilConstructor.Emit(OpCodes.Stfld, that); for (int i = 0; i < parameters.Length; i++) { ilConstructor.Emit(OpCodes.Ldarg_0); ilConstructor.Emit(OpCodes.Ldarg, i + 2); //1 is that ilConstructor.Emit(OpCodes.Stfld, fields[parameters[i].Name]); } ilConstructor.Emit(OpCodes.Ret); var type = wrapperType.CreateType(); var wrapperInstance = type.GetConstructor(new[] { toInvoke.DeclaringType }.Concat(param.Select(i => i.GetType())).ToArray()) .Invoke(new object[] {instance}.Concat(param).ToArray()); return (Action)Delegate.CreateDelegate(typeof(Action), wrapperInstance, "Run"); }
var toInvoke = typeof(T).GetMethod(methodName); var wrapperType = this._moduleBuilder.DefineType(toInvoke.Name + "InvokeWrapper", TypeAttributes.AutoClass | TypeAttributes.Sealed | TypeAttributes.Public); var that = wrapperType.DefineField("_that", toInvoke.DeclaringType, FieldAttributes.Public);The filed to the instance is named 'that' since I found the '_this' of the compiler a bit missleading. Then it adds fields for all parameters of the function that should be called to the new type:
var fields = new DictionaryOnce I have the fields to store parameters I add a 'Run" method that has no parameters and is the method that gets invoked by the delegate:(); var parameters = toInvoke.GetParameters(); foreach (ParameterInfo parameter in parameters) { var field = wrapperType.DefineField(parameter.Name, parameter.ParameterType, FieldAttributes.Public); fields.Add(parameter.Name, field); }
var method = wrapperType.DefineMethod("Run", MethodAttributes.Public); var ilMethod = method.GetILGenerator(); ilMethod.Emit(OpCodes.Ldarg_0); ilMethod.Emit(OpCodes.Ldfld, that); foreach (var parameter in parameters) { ilMethod.Emit(OpCodes.Ldarg_0); ilMethod.Emit(OpCodes.Ldfld, fields[parameter.Name]); } ilMethod.Emit(OpCodes.Callvirt, toInvoke); ilMethod.Emit(OpCodes.Ret);This function consists of code that loads the 'that' instance on the stack and then places all the parameters for the method on the stack. After that it calls the target method on the 'that' instance. Now that I have a method I can invoke, I still need a constructor to create an instance and fill the fields.
var ctor = wrapperType.DefineConstructor(MethodAttributes.Public, CallingConventions.Standard, new[] { toInvoke.DeclaringType }.Concat(param.Select(i => i.GetType())).ToArray()); var ilConstructor = ctor.GetILGenerator(); ilConstructor.Emit(OpCodes.Ldarg_0); ilConstructor.Emit(OpCodes.Ldarg_1); ilConstructor.Emit(OpCodes.Stfld, that); for (int i = 0; i < parameters.Length; i++) { ilConstructor.Emit(OpCodes.Ldarg_0); ilConstructor.Emit(OpCodes.Ldarg, i + 2); //1 is that ilConstructor.Emit(OpCodes.Stfld, fields[parameters[i].Name]); } ilConstructor.Emit(OpCodes.Ret);The constructor signature startet with the that parameter, which is of the type óf the instance the target method should be invoked, and is followed by the function parameters. The Body of the constructor then stores its parameters in the conresponding fields. After that I am done with creating the new type and so I build it:
var type = wrapperType.CreateType();And now I need a instance of the new type to create a delegate that points to its 'Run' Method.
var wrapperInstance = type.GetConstructor(new[] { toInvoke.DeclaringType }.Concat(param.Select(i => i.GetType())).ToArray()) .Invoke(new object[] {instance}.Concat(param).ToArray());The instance is created with simple reflection by invoking the constuctor with all the parameters. And finally the delegate is created:
return (Action)Delegate.CreateDelegate(typeof(Action), wrapperInstance, "Run");Now I have a delegate that points to the newly created instances 'Run' method and can be executed without any parameter. Currently this code is pretty damn ineffective and will perform pretty bad compared to the compiler generated version. But this just a sample to show what is possible. If you would like to use this in production you should optimize it further, but also there won't be much benefit about a compile time version, so why am I doing this? Because I can ;-) , but also to use this in my AOP framework where I will need such a functionality. Even if you aren't working at the edge of the CLR this should provide you a nice view into what the compiler does behind the scenes and it is alway good to know what your code really does. This does not mean you should count on any of these implementation details on the compiler side, it might occur that Microsoft changes the behaviour.


{% load static wagtailcore_tags wagtailimages_tags blogapp_tags el_pagination_tags wagtailmd %}
{% comment %} {% endcomment %}Really friendly beginner books on web design and web app development. Learn more here.
New to using the command line or terminal? Get this free illustrated zine! Learn more here.