| What is it? | ||
| Imlib 2 is the successor
to Imlib. It is NOT a newer version - it is a completely new library. Imlib
2 can be installed alongside Imlib 1.x without any problems since they
are effectively different libraries - BUT they Have very similar functionality.
Imlib 2 does the following:
Imlib 2 can run without a display, so it can be easily used for background image processing for web sites or servers - it only requires the X libraries to be installed - that is all - it does not require an XServer to run unless you wish to display images. The interface is simple - once you get used to it, the functions do exactly what they say they do. |
||
| A Simple Example | ||
The best way to start
is to show a simple example of an Imlib2 program. This one will load an
image of any format you have a loader installed for (all loaders are dynamic
code objects that Imlib2 will use and update automatically runtime - anyone
is free to write a loader. All that has to be done is for the object to
be dropped into the loaders directory with the others and all Imlib2 programs
will automatically be able to use it - without a restart).
/* standard headers */ #include <X11/Xlib.h> #include <Imlib2.h> #include <stdio.h> #include <string.h> /* main program */ int main(int argc, char **argv) { /* an image handle */ Imlib_Image image; /* if we provided < 2 arguments after the command - exit */ if (argc != 3) exit(1); /* load the image */ image = imlib_load_image(argv[1]); /* if the load was successful */ if (image) { char *tmp; /* set the image we loaded as the current context image to work on */ imlib_context_set_image(image); /* set the image format to be the format of the extension of our last */ /* argument - i.e. .png = png, .tif = tiff etc. */ tmp = strrchr(argv[2], '.'); if(tmp) imlib_image_set_format(tmp + 1); /* save the image */ imlib_save_image(argv[2]); } }Now to compile this |
||
| How Image Loading Works | ||
It is probably a
good idea to discuss how Imlib2 actually loads an Image so the programmer
knows what is going on, how to take advantage of the optimizations already
there and to explain why things work as they do.
|
||
| A more advanced Example | ||
This is a more comprehensive
example that should show off a fair number of features of imlib2. The code
this was based off can be found in Imlib2's test directory. This covers
a lot of the core of Imlib2's API so you should have a pretty good idea
on how it works if you understand this code snippet.
/* include X11 stuff */ #include <X11/Xlib.h> /* include Imlib2 stuff */ #include <Imlib2.h> /* sprintf include */ #include <stdio.h> /* some globals for our window & X display */ Display *disp; Window win; Visual *vis; Colormap cm; int depth; /* the program... */ int main(int argc, char **argv) { /* events we get from X */ XEvent ev; /* areas to update */ Imlib_Updates updates, current_update; /* our virtual framebuffer image we draw into */ Imlib_Image buffer; /* a font */ Imlib_Font font; /* our color range */ Imlib_Color_Range range; /* our mouse x, y coordinates */ int mouse_x = 0, mouse_y = 0; /* connect to X */ disp = XOpenDisplay(NULL); /* get default visual , colormap etc. you could ask imlib2 for what it */ /* thinks is the best, but this example is intended to be simple */ vis = DefaultVisual(disp, DefaultScreen(disp)); depth = DefaultDepth(disp, DefaultScreen(disp)); cm = DefaultColormap(disp, DefaultScreen(disp)); /* create a window 640x480 */ win = XCreateSimpleWindow(disp, DefaultRootWindow(disp), 0, 0, 640, 480, 0, 0, 0); /* tell X what events we are interested in */ XSelectInput(disp, win, ButtonPressMask | ButtonReleaseMask | PointerMotionMask | ExposureMask); /* show the window */ XMapWindow(disp, win); /* set our cache to 2 Mb so it doesn't have to go hit the disk as long as */ /* the images we use use less than 2Mb of RAM (that is uncompressed) */ imlib_set_cache_size(2048 * 1024); /* set the font cache to 512Kb - again to avoid re-loading */ imlib_set_font_cache_size(512 * 1024); /* add the ./ttfonts dir to our font path - you'll want a notepad.ttf */ /* in that dir for the text to display */ imlib_add_path_to_font_path("./ttfonts"); /* set the maximum number of colors to allocate for 8bpp and less to 128 */ imlib_set_color_usage(128); /* dither for depths < 24bpp */ imlib_context_set_dither(1); /* set the display , visual, colormap and drawable we are using */ imlib_context_set_display(disp); imlib_context_set_visual(vis); imlib_context_set_colormap(cm); imlib_context_set_drawable(win); /* infinite event loop */ for (;;) { /* image variable */ Imlib_Image image; /* width and height values */ int w, h, text_w, text_h; /* init our updates to empty */ updates = imlib_updates_init(); /* while there are events form X - handle them */ do { XNextEvent(disp, &ev); switch (ev.type) { case Expose: /* window rectangle was exposed - add it to the list of */ /* rectangles we need to re-render */ updates = imlib_update_append_rect(updates, ev.xexpose.x, ev.xexpose.y, ev.xexpose.width, ev.xexpose.height); break; case ButtonPress: /* if we click anywhere in the window, exit */ exit(0); break; case MotionNotify: /* if the mouse moves - note it */ /* add a rectangle update for the new mouse position */ image = imlib_load_image("./test_images/mush.png"); imlib_context_set_image(image); w = imlib_image_get_width(); h = imlib_image_get_height(); imlib_context_set_image(image); imlib_free_image(); /* the old position - so we wipe over where it used to be */ updates = imlib_update_append_rect(updates, mouse_x - (w / 2), mouse_y - (h / 2), w, h); font = imlib_load_font("notepad/30"); if (font) { char text[4096]; imlib_context_set_font(font); sprintf(text, "Mouse is at %i, %i", mouse_x, mouse_y); imlib_get_text_size(text, &text_w, &text_h); imlib_free_font(); updates = imlib_update_append_rect(updates, 320 - (text_w / 2), 240 - (text_h / 2), text_w, text_h); } mouse_x = ev.xmotion.x; mouse_y = ev.xmotion.y; /* the new one */ updates = imlib_update_append_rect(updates, mouse_x - (w / 2), mouse_y - (h / 2), w, h); font = imlib_load_font("notepad/30"); if (font) { char text[4096]; imlib_context_set_font(font); sprintf(text, "Mouse is at %i, %i", mouse_x, mouse_y); imlib_get_text_size(text, &text_w, &text_h); imlib_free_font(); updates = imlib_update_append_rect(updates, 320 - (text_w / 2), 240 - (text_h / 2), text_w, text_h); } default: /* any other events - do nothing */ break; } } while (XPending(disp)); /* no more events for now ? ok - idle time so lets draw stuff */ /* take all the little rectangles to redraw and merge them into */ /* something sane for rendering */ updates = imlib_updates_merge_for_rendering(updates, 640, 480); for (current_update = updates; current_update; current_update = imlib_updates_get_next(current_update)) { int up_x, up_y, up_w, up_h; /* find out where the first update is */ imlib_updates_get_coordinates(current_update, &up_x, &up_y, &up_w, &up_h); /* create our buffer image for rendering this update */ buffer = imlib_create_image(up_w, up_h); /* we can blend stuff now */ imlib_context_set_blend(1); /* fill the window background */ /* load the background image - you'll need to have some images */ /* in ./test_images lying around for this to actually work */ image = imlib_load_image("./test_images/bg.png"); /* we're working with this image now */ imlib_context_set_image(image); /* get its size */ w = imlib_image_get_width(); h = imlib_image_get_height(); /* now we want to work with the buffer */ imlib_context_set_image(buffer); /* if the iimage loaded */ if (image) { /* blend image onto the buffer and scale it to 640x480 */ imlib_blend_image_onto_image(image, 0, 0, 0, w, h, - up_x, - up_y, 640, 480); /* working with the loaded image */ imlib_context_set_image(image); /* free it */ imlib_free_image(); } /* draw an icon centered around the mouse position */ image = imlib_load_image("./test_images/mush.png"); imlib_context_set_image(image); w = imlib_image_get_width(); h = imlib_image_get_height(); imlib_context_set_image(buffer); if (image) { imlib_blend_image_onto_image(image, 0, 0, 0, w, h, mouse_x - (w / 2) - up_x, mouse_y - (h / 2) - up_y, w, h); imlib_context_set_image(image); imlib_free_image(); } /* draw a gradient on top of things at the top left of the window */ /* create a range */ range = imlib_create_color_range(); imlib_context_set_color_range(range); /* add white opaque as the first color */ imlib_context_set_color(255, 255, 255, 255); imlib_add_color_to_color_range(0); /* add an orange color, semi-transparent 10 units from the first */ imlib_context_set_color(255, 200, 10, 100); imlib_add_color_to_color_range(10); /* add black, fully transparent at the end 20 units away */ imlib_context_set_color(0, 0, 0, 0); imlib_add_color_to_color_range(20); /* draw the range */ imlib_context_set_image(buffer); imlib_image_fill_color_range_rectangle(- up_x, - up_y, 128, 128, -45.0); /* free it */ imlib_free_color_range(); /* draw text - centered with the current mouse x, y */ font = imlib_load_font("notepad/30"); if (font) { char text[4096]; /* set the current font */ imlib_context_set_font(font); /* set the image */ imlib_context_set_image(buffer); /* set the color (black) */ imlib_context_set_color(0, 0, 0, 255); /* print text to display in the buffer */ sprintf(text, "Mouse is at %i, %i", mouse_x, mouse_y); /* query the size it will be */ imlib_get_text_size(text, &text_w, &text_h); /* draw it */ imlib_text_draw(320 - (text_w / 2) - up_x, 240 - (text_h / 2) - up_y, text); /* free the font */ imlib_free_font(); } /* don't blend the image onto the drawable - slower */ imlib_context_set_blend(0); /* set the buffer image as our current image */ imlib_context_set_image(buffer); /* render the image at 0, 0 */ imlib_render_image_on_drawable(up_x, up_y); /* don't need that temporary buffer image anymore */ imlib_free_image(); } /* if we had updates - free them */ if (updates) imlib_updates_free(updates); /* loop again waiting for events */ } return 0; } |
||
| API Reference | ||
This is a list of all the Imlib2 API calls and what each of them do. You should familiarize yourself well with this API so you have a good idea of what can be done. void imlib_context_set_display(Display *display);Sets the current X display to be used for rendering of images to drawables. You do not need to set this if you do not intend to render an image to an X drawable. If you do you will need to set this. If you change displays just set this to the new display pointer. Do not use a Display pointer if you have closed that display already - also note that if you close a display connection and continue to render using Imlib2 without setting the display pointer to NULL or something new, crashes may occur.void imlib_context_set_visual(Visual *visual); This sets the current visual to use when rendering images to drawables or producing pixmaps. You need to set this for anything to render to a drawable or produce any pixmaps (this can be the default visual).void imlib_context_set_colormap(Colormap colormap); Sets the colormap to use when rendering to drawables and allocating colors. You must set this to the colormap you are using to render any images or produce any pixmaps (this can be the default colormap).void imlib_context_set_drawable(Drawable drawable); This sets the X drawable to which images will be rendered when you call a render call in Imlib2. This may be either a pixmap or a window. You must set this to render anything.void imlib_context_set_mask(Pixmap mask); This sets the 1-bit deep pixmap to be drawn to when rendering to generate a mask pixmap. This is only useful if the image you are rendering has alpha. Set this to 0 to not render a pixmap mask.void imlib_context_set_dither_mask(char dither_mask); Selects if, you are rendering to a mask, or producing pixmap masks from images, if the mask is to be dithered or not. passing in 1 for dither_mask means the mask pixmap will be dithered, 0 means it will not be dithered.void imlib_context_set_anti_alias(char anti_alias); Toggles "anti-aliased" scaling of images. This isn't quite correct since it's actually super and sub pixel sampling that it turns on and off, but anti-aliasing is used for having "smooth" edges to lines and shapes and this means when images are scaled they will keep their smooth appearance. Passing in 1 turns this on and 0 turns it off.void imlib_context_set_dither(char dither); Sets the dithering flag for rendering to a drawable or when pixmaps are produced. This affects the color image appearance by enabling dithering. Dithering slows down rendering but produces considerably better results. this option has no effect foe rendering in 24 bit and up, but in 16 bit and lower it will dither, producing smooth gradients and much better quality images. setting dither to 1 enables it and 0 disables it.void imlib_context_set_blend(char blend); When rendering an image to a drawable, Imlib2 is able to blend the image directly onto the drawable during rendering. setting this to 1 will enable this. If the image has no alpha channel this has no effect. Setting it to 0 will disable this.void imlib_context_set_color_modifier(Imlib_Color_Modifier color_modifier); This sets the current color modifier used for rendering pixmaps or images to a drawable or images onto other images. Color modifiers are lookup tables that map the values in the red, green, blue and alpha channels to other values in the same channel when rendering, allowing for fades, color correction etc. to be done whilst rendering. pass in NULL as the color_modifier to disable the color modifier for rendering.void imlib_context_set_operation(Imlib_Operation operation); When Imlib2 draws an image onto another or an image onto a drawable it is able to do more than just blend the result on using the given alpha channel of the image. It is also able to do saturating additive, subtractive and a combination of the both (called reshade) rendering. The default mode is IMLIB_OP_COPY. you can also set it to IMLIB_OP_ADD, IMLIB_OP_SUBTRACT or IMLIB_OP_RESHADE. Use this function to set the rendering operation. IMLIB_OP_COPY performs basic alpha blending: DST = (SRC * A) + (DST * (1 - A)). IMLIB_OP_ADD does DST = DST + (SRC * A). IMLIB_OP_SUBTRACT does DST = DST - (SRC * A) and IMLIB_OP_RESHADE does DST = DST + (((SRC - 0.5) / 2) * A).void imlib_context_set_font(Imlib_Font font); This function sets the current font to use when rendering text. you should load the font first with imlib_load_font().void imlib_context_set_direction(Imlib_Text_Direction direction); This sets the direction in which to draw text in terms of simple 90 degree orientations or an arbitrary angle. The direction can be one of IMLIB_TEXT_TO_RIGHT, IMLIB_TEXT_TO_LEFT, IMLIB_TEXT_TO_DOWN, IMLIB_TEXT_TO_UP or IMLIB_TEXT_TO_ANGLE. The default is IMLIB_TEXT_TO_RIGHT. If you use IMLIB_TEXT_TO_ANGLE, you will also have to set the angle with imlib_context_set_angle().void imlib_context_set_angle(double angle); This sets the angle at which text strings will be drawn if the text direction has been set to IMLIB_TEXT_TO_ANGLE with imlib_context_set_direction().void imlib_context_set_color(int red, int green, int blue, int alpha); This sets the color with which text, lines and rectangles are drawn when being rendered onto an image. Values for red, green, blue and alpha are between 0 and 255 - any other values have undefined results.void imlib_context_set_color_cmya(int cyan, magenta, int yellow, int alpha); This sets the color in CMYA space. Values for cyan, magenta, yellow and alpha are between 0 and 255 - any other values have undefined results.void imlib_context_set_color_hsva(float hue, float saturation, float value, int alpha); This sets the color in HSVA space. Values for hue are between 0 and 360, values for saturation and value between 0 and 1, and values for alpha are between 0 and 255 - any other values have undefined results.void imlib_context_set_color_hlsa(float hue, float lightness, float saturation, int alpha); This sets the color in HLSA space. Values for hue are between 0 and 360, values for lightness and saturation between 0 and 1, and values for alpha are between 0 and 255 - any other values have undefined results.void imlib_context_set_color_range(Imlib_Color_Range color_range); This sets the current color range to use for rendering gradients.void imlib_context_set_progress_function(Imlib_Progress_Function progress_function); This sets the progress function to be called back whilst loading images. Set this to the function to be called, or set it to NULL to disable progress callbacks whilst loading.void imlib_context_set_progress_granularity(char progress_granularity); This hints as to how often to call the progress callback. 0 means as often as possible. 1 means whenever 15 more of the image has been decoded, 10 means every 10% of the image decoding, 50 means every 50% and 100 means only call at the end. Values outside of the range 0-100 are undefined.void imlib_context_set_image(Imlib_Image image); This sets the current image Imlib2 will be using with its function calls.void imlib_context_set_filter(Imlib_Filter filter); This sets the current filter to be used when applying filters to images. Set this to NULL to disable filters.Display *imlib_context_get_display(void); This returns the current display used for Imlib2's display context.Visual *imlib_context_get_visual(void); Returns the current visual used for Imlib2's context.Colormap imlib_context_get_colormap(void); Returns the current Colormap used for Imlib2's context.Drawable imlib_context_get_drawable(void); Returns the current Drawable used for Imlib2's context.Pixmap imlib_context_get_mask(void); Returns the current pixmap destination to be used to render a mask into.char imlib_context_get_dither_mask(void); Returns the current mode for dithering pixmap masks. 1 means dithering is enabled and 0 means it is not.char imlib_context_get_anti_alias(void); Returns if Imlib2 currently will smoothly scale images. 1 means it will and 0 means it will not.char imlib_context_get_dither(void); Returns if image data is rendered with dithering currently. 1 means yes and 0 means no.char imlib_context_get_blend(void); Returns if Imlib2 will blend images onto a drawable whilst rendering to that drawable. 1 means yes and 0 means no.Imlib_Color_Modifier imlib_context_get_color_modifier(void); Returns the current colormodifier being used.Imlib_Operation imlib_context_get_operation(void); Returns the current operation mode.Imlib_Font imlib_context_get_font(void); Returns the current font.double imlib_context_get_angle(void); Returns the current angle used to render text at if the direction is IMLIB_TEXT_TO_ANGLE.Imlib_Text_Direction imlib_context_get_direction(void); Returns the current direction to render text in.void imlib_context_get_color(int *red, int *green, int *blue, int *alpha); Returns the current color for rendering text, rectangles and lines.void imlib_context_get_color_cmya(int *cyan, int *magenta, int *yellow, int *alpha); Returns the current color for rendering text, rectangles and lines in CMYA space.void imlib_context_get_color_hsva(float *hue, float *saturation, float *value, int *alpha); Returns the current color for rendering text, rectangles and lines in HSVA space.void imlib_context_get_color_hlsa(float *hue, float * lightness, float *saturation, int *alpha); Returns the current color for rendering text, rectangles and lines in HLSA space.Imlib_Color *imlib_context_get_imlib_color(void); Returns the current color as a color struct. Do NOT free this pointer.Imlib_Color_Range imlib_context_get_color_range(void); Return the current color range being used for gradients.Imlib_Progress_Function imlib_context_get_progress_function(void); Return the current progress function being used.char imlib_context_get_progress_granularity(void); Get the current progress granularity being used.Imlib_Image imlib_context_get_image(void); Return the current context image.Imlib_Filter imlib_context_get_filter(void); Get the current context image filter.int imlib_get_cache_size(void); Return the current size of the image cache in bytes. The cache is a unified cache used for image data AND pixmaps.void imlib_set_cache_size(int bytes); Set the cache size. The size is in bytes. Setting the cache size to 0 effectively flushes the cache and keeps the cache size at 0 until set to another value. Whenever you set the cache size Imlib2 will flush as many old images and pixmap from the cache as needed until the current cache usage is less than or equal to the cache size.int imlib_get_color_usage(void); Get the number of colors Imlib2 currently at a maximum is allowed to allocate for rendering. The default is 256.void imlib_set_color_usage(int max); Set the maximum number of colors you would like Imlib2 to allocate for you when rendering. The default ids 256. This has no effect in depths greater than 8 bit.void imlib_flush_loaders(void); If you want Imlib2 to forcibly flush any cached loaders it has and re-load them from disk (this is useful if the program just installed a new loader and does not want to wait till Imlib2 deems it an optimal time to rescan the loaders)int imlib_get_visual_depth(Display *display, Visual *visual); Convenience function that returns the depth of a visual for that display.Visual *imlib_get_best_visual(Display *display, int screen, int *depth_return); Returns the visual for that display and screen that Imlib2 thinks will give you the best quality output. depth_return should point to an int that will be filled with the depth of that visual too.Imlib_Image imlib_load_image(const char *file); This function loads an image from disk located at the path specified by file. Please see the "How image loading works" section for more detail. Returns an image handle on success or NULL on failure.Imlib_Image imlib_load_image_immediately(const char *file); Loads an image from disk located at the path specified by file. This forces the image data to be decoded at load time too, instead of decoding being deferred until it is needed. Returns an image handle on success or NULL on failure.Imlib_Image imlib_load_image_without_cache(const char *file); This loads the image without looking in the cache first. Returns an image handle on success or NULL on failure.Imlib_Image imlib_load_image_immediately_without_cache(const char *file); Loads the image without deferred image data decoding (i.e. it is decoded straight away) and without looking in the cache. Returns an image handle on success or NULL on failure.Imlib_Image imlib_load_image_with_error_return(const char *file, Imlib_Load_Error *error_return); This loads an image at the path file on disk. If it succeeds it returns a valid image handle, if not NULL is returned and the error_return pointed to is set to the detail of the error.void imlib_free_image(void); This frees the image that is set as the current image in Imlib2's context.void imlib_free_image_and_decache(void); Frees the current image in Imlib2's context AND removes it from the cache.int imlib_image_get_width(void); Returns the width in pixels of the current image in Imlib2's context.int imlib_image_get_height(void); Returns the height in pixels of the current image in Imlib2's context.const char *imlib_image_get_filename(void); This returns the filename for the file that is set as the current context. The pointer returned is only valid as long as no operations cause the filename of the image to change. Saving the file with a different name would cause this. It is suggested you duplicate the string if you wish to continue to use the string for later processing. Do not free the string pointer returned by this function.DATA32 *imlib_image_get_data(void); This returns a pointer to the image data in the image set as the image for the current context. When you get this pointer it is assumed you are planning on writing to the data, thus once you do this the image can no longer be used for caching - in fact all images cached from this one will also be affected when you put the data back. If this matters it is suggested you clone the image first before playing with the image data. The image data is returned in the format of a DATA32 (32 bits) per pixel in a linear array ordered from the top left of the image to the bottom right going from left to right each line. Each pixel has the upper 8 bits as the alpha channel and the lower 8 bits are the blue channel - so a pixel's bits are ARGB (from most to least significant, 8 bits per channel). You must put the data back at some point.DATA32 *imlib_image_get_data_for_reading_only(void); This functions the same way as imlib_image_get_data(), but returns a pointer expecting the program to NOT write to the data returned (it is for inspection purposes only). Writing to this data has undefined results. The data does not need to be put back.void imlib_image_put_back_data(DATA32 *data); This will put back data when it was obtained by imlib_image_get_data(). The data must be the same pointer returned by imlib_image_get_data(). This operated on the current context image.char imlib_image_has_alpha(void); Returns 1 if the current context image has an alpha channel, or 0 if it does not (the alpha data space is still there and available - just "unused").void imlib_image_set_changes_on_disk(void); By default Imlib2 will not check the timestamp of an image on disk and compare it with the image in its cache - this is to minimize disk activity when using the cache. Call this function and it will flag the current context image as being liable to change on disk and Imlib2 will check the timestamp of the image file on disk and compare it with the cached image when it next needs to use this image in the cache.void imlib_image_get_border(Imlib_Border *border); This function fills the Imlib_Border structure to which border points to with the values of the border of the current context image. The border is the area at the edge of the image that does not scale with the rest of the image when resized - the borders remain constant in size. This is useful for scaling bevels at the edge of images differently to the image center.void imlib_image_set_border(Imlib_Border *border); This sets the border of the current context image to the values contained in the Imlib_Border structure border points to.void imlib_image_set_format(const char *format); This sets the format of the current image. This is used for when you wish to save an image in a different format that it was loaded in, or if the image currently has no file format associated with it.void imlib_image_set_irrelevant_format(char irrelevant); This sets if the format value of the current image is irrelevant for caching purposes - by default it is. pass irrelevant as 1 to make it irrelevant and 0 to make it relevant for caching.void imlib_image_set_irrelevant_border(char irrelevant); This sets if the border of the current image is irrelevant for caching purposes. By default it is. Set irrelevant to 1 to make it irrelevant, and 0 to make it relevant.void imlib_image_set_irrelevant_alpha(char irrelevant); This sets if the alpha channel status of the current image (i.e. if there is or is not one) is important for caching purposes. By default it is not. Set irrelevant to 1 to make it irrelevant and 0 to make it relevant.char *imlib_image_format(void); This returns the current image's format. Do not free this string. Duplicate it if you need it for later use.void imlib_image_set_has_alpha(char has_alpha); Sets the alpha flag for the current image. Set has_alpha to 1 to enable the alpha channel in the current image, or 0 to disable it.void imlib_render_pixmaps_for_whole_image(Pixmap *pixmap_return, Pixmap *mask_return); This function will create a pixmap of the current image (and a mask if the image has an alpha value) and return the id's of the pixmap and mask to the pixmap_return and mask_return pixmap id's. You must free these pixmaps using Imlib2's free function imlib_free_pixmap_and_mask();.void imlib_render_pixmaps_for_whole_image_at_size(Pixmap *pixmap_return, Pixmap *mask_return, int width, int height); This function works just like imlib_render_pixmaps_for_whole_image(), but will scale the output result to the width and height specified. Scaling is done before depth conversion so pixels used for dithering don't grow large.void imlib_free_pixmap_and_mask(Pixmap pixmap); This will free the pixmap (and any mask generated in association with that pixmap). The pixmap will remain cached until the image the pixmap was generated from is dirtied or decached, or the cache is flushed.void imlib_render_image_on_drawable(int x, int y); This renders the current image onto the current drawable at the x, y pixel location specified without scaling.void imlib_render_image_on_drawable_at_size(int x, int y, int width, int height); This will render the current image onto the current drawable at the x, y location specified AND scale the image to the width and height specified.void imlib_render_image_part_on_drawable_at_size(int source_x, int source_y, int source_width, int source_height, int x, int y, int width, int height); This renders the source x, y, width, height pixel rectangle from the current image onto the current drawable at the x, y location scaled to the width and height specified.void imlib_blend_image_onto_image(Imlib_Image source_image, char merge_alpha, int source_x, int source_y, int source_width, int source_height, int destination_x, int destination_y, int destination_width, int destination_height); This will blend the source rectangle x, y, width, height from the source_image onto the current image at the destination x, y location scaled to the width and height specified. If merge_alpha is set to 1 it will also modify the destination image alpha channel, otherwise the destination alpha channel is left untouched.Imlib_Image imlib_create_image(int width, int height); This creates a new blank image of size width and height. The contents of this image at creation time are undefined (they could be garbage memory). You are free to do whatever you like with this image. It is not cached. On success an image handle is returned - on failure NULL is returned.Imlib_Image imlib_create_image_using_data(int width, int height, DATA32 *data); This creates an image from the image data specified with the width and height specified. The image data must be in the same format as imlib_image_get_data() would return. You are responsible for freeing this image data once the image is freed - Imlib2 will not do that for you. This is useful for when you already have static buffers of the same format Imlib2 uses (many video grabbing devices use such a format) and wish to use Imlib2 to render the results onto another image, or X drawable. You should free the image when you are done with it. Imlib2 returns a valid image handle on success or NULL on failureImlib_Image imlib_create_image_using_copied_data(int width, int height, DATA32 *data); This works the same way as imlib_create_image_using_data() but Imlib2 copies the image data to the image structure. You may now do whatever you wish with the original data as it will not be needed anymore. Imlib2 returns a valid image handle on success or NULL on failure.Imlib_Image imlib_create_image_from_drawable(Pixmap mask, int x, int y, int width, int height, char need_to_grab_x); This will return an image (using the mask to determine the alpha channel) from the current drawable. If the mask is 0 it will not create a useful alpha channel in the image. It will create an image from the x, y, width , height rectangle in the drawable. If need_to_grab_x is 1 it will also grab the X Server to avoid possible race conditions in grabbing. If you have not already grabbed the server you MUST set this to 1. Imlib2 returns a valid image handle on success or NULL on failure.Imlib_Image imlib_create_scaled_image_from_drawable(Pixmap mask, int source_x, int source_y, int source_width, int source_height, int destination_width, int destination_height, char need_to_grab_x, char get_mask_from_shape); This will create an image from the current drawable (optionally using the mask pixmap specified to determine alpha transparency) and scale the grabbed data first before converting to an actual image (to minimize reads from the frame buffer which can be slow). The source x, y, width, height rectangle will be grabbed, scaled to the destination width and height, then converted to an image. If need_to_grab_x is set to 1, X is grabbed (set this to 1 unless you have already grabbed the server) and if get_mask_from_shape and the current drawable is a window its shape is used for determining the alpha channel. If successful this function will return a valid image handle, otherwise NULL is returned.char imlib_copy_drawable_to_image(Pixmap mask, int x, int y, int width, int height, int destination_x, int destination_y, char need_to_grab_x); This routine will grab a section of the current drawable (optionally using the pixmap provided as a corresponding mask for that drawable - if mask is 0 this is not used). It grabs the x, y, width, height rectangle and places it at the destination x, y location in the current image. If need_to_grab_x is 1 it will grab and ungrab the server whilst doing this - you need to do this if you have not already grabbed the server.Imlib_Image imlib_clone_image(void); This creates an exact duplicate of the current image and returns a valid image handle on success, or NULL on failure.Imlib_Image imlib_create_cropped_image(int x, int y, int width, int height); This creates a duplicate of a x, y, width, height rectangle in the current image and returns a valid image handle on success, or NULL on failure.Imlib_Image imlib_create_cropped_scaled_image(int source_x, int source_y, int source_width, int source_height, int destination_width, int destination_height); This function works the same as imlib_create_cropped_image() but will scale the new image to the new destination width and height whilst cropping.Imlib_Updates imlib_updates_clone(Imlib_Updates updates); This function creates a duplicate of the updates list passed into the function.Imlib_Updates imlib_update_append_rect(Imlib_Updates updates, int x, int y, int w, int h); This function appends an update rectangle to the updates list passed in (if the updates is NULL it will create a new updates list) and returns a handle to the modified updates list (the handle may be modified so only use the new updates handle returned)Imlib_Updates imlib_updates_merge(Imlib_Updates updates, int w, int h); This function takes an updates list, and modifies it by merging overlapped rectangles and lots of tiny rectangles into larger rectangles to minimize the number of rectangles in the list for optimized redrawing. The new updates handle is now valid and the old one passed in is not.Imlib_Updates imlib_updates_merge_for_rendering(Imlib_Updates updates, int w, int h); This works almost exactly as imlib_updates_merge() but is more lenient on the spacing between update rectangles - if they are very close it amalgamates 2 smaller rectangles into 1 larger one.void imlib_updates_free(Imlib_Updates updates); This frees an updates list.Imlib_Updates imlib_updates_get_next(Imlib_Updates updates); This gets the next update in the updates list relative to the one passed in.void imlib_updates_get_coordinates(Imlib_Updates updates, int *x_return, int *y_return, int *width_return, int *height_return); This returns the coordinates of an update.void imlib_updates_set_coordinates(Imlib_Updates updates, int x, int y, int width, int height); This modifies the coordinates of an update in an updates list.void imlib_render_image_updates_on_drawable(Imlib_Updates updates, int x, int y); Given an updates list (preferable already merged for rendering) this will render the corresponding parts of the image to the current drawable at an offset of x, y in the drawable.Imlib_Updates imlib_updates_init(void); This initializes an updates list before you add any updates to it or merge it for rendering etc.Imlib_Updates imlib_updates_append_updates(Imlib_Updates updates, Imlib_Updates appended_updates); This appends one updates list (appended_updates) to the updates list (updates) and returns the new list.void imlib_image_flip_horizontal(void); This will flip/mirror the current image horizontally.void imlib_image_flip_vertical(void); This will flip/mirror the current image vertically.void imlib_image_flip_diagonal(void); This will flip/mirror the current image diagonally (good for quick and dirty 90 degree rotations if used before to after a horizontal or vertical flip).void imlib_image_orientate(int orientation); This will perform 90 degree rotations on the current image. Passing in orientation does not rotate, 1 rotates clockwise by 90 degree, 2, rotates clockwise by 180 degrees, 3 rotates clockwise by 270 degrees.void imlib_image_blur(int radius); This will blur the current image. A radius of 0 has no effect, 1 and above determine the blur matrix radius that determine how much to blur the image.void imlib_image_sharpen(int radius); This sharpens the current image. The radius affects how much to sharpen by.void imlib_image_tile_horizontal(void); This modifies an image so it will tile seamlessly horizontally if used as a tile (i.e. drawn multiple times horizontally)void imlib_image_tile_vertical(void); This modifies an image so it will tile seamlessly vertically if used as a tile (i.e. drawn multiple times vertically)void imlib_image_tile(void); This modifies an image so it will tile seamlessly horizontally and vertically if used as a tile (i.e. drawn multiple times horizontally and vertically)Imlib_Font imlib_load_font(const char *font_name); This function will load a truetype font from the first directory in the font path that contains that font. The font name format is "font_name/size". For example. If there is a font file called blum.ttf somewhere in the font path you might use "blum/20" to load a 20 pixel sized font of blum. If the font cannot be found NULL is returned.void imlib_free_font(void); This frees the current font.void imlib_text_draw(int x, int y, const char *text); Call this function to draw the null-byte terminated string text using the current font on the current image at the x, y location (x, y denoting the top left corner of the font string)void imlib_text_draw_with_return_metrics(int x, int y, const char *text, int *width_return, int *height_return, int *horizontal_advance_return, int *vertical_advance_return); This function works just like imlib_text_draw() but also returns the width and height of the string drawn, and horizontal_advance_return returns the number of pixels you should advance horizontally to draw another string (useful if you are drawing a line of text word by word) and vertical_advance_return does the same for the vertical direction (i.e. drawing text line by line).void imlib_get_text_size(const char *text, int *width_return, int *height_return); This function returns the width and height in pixels the text string would use up if drawn with the current font.void imlib_get_text_advance(const char *text, int *horizontal_advance_return, int *vertical_advance_return); This function returns the advance horizontally and vertically in pixels the next text string would need to be placed at for the current font. The advances are not adjusted for rotation so you will have to translate the advances (which are calculated as if the text was drawn horizontally from left to right) depending on the text orientation.int imlib_get_text_inset(const char *text); This function returns the inset of the first character of the text string passed in using the current font and returns that value in pixels.void imlib_add_path_to_font_path(const char *path); This function adds the directory path to the end of the current list of directories to scan for fonts.void imlib_remove_path_from_font_path(const char *path); This function removes all directories in the font path that match the path specified.char **imlib_list_font_path(int *number_return); This returns a list of strings that are the directories in the font path. Do not free this list or change it in any way. If you add or delete members of the font path this list will be invalid. If you intend to use this list later duplicate it for your own use. The number of elements in the array of strings is put into number_return.int imlib_text_get_index_and_location(const char *text, int x, int y, int *char_x_return, int *char_y_return, int *char_width_return, int *char_height_return); This will return the character number in the string text using the current font at the x, y pixel location which is an offset relative to the top left of that string. -1 is returned if there is no character there. If there is a character, character x, y, width and height are also filled in.void imlib_text_get_location_at_index(const char *text, int index, int *char_x_return, int *char_y_return, int *char_width_return, int *char_height_return); This will return the geometry of the character at index index in the text string using the current font.char **imlib_list_fonts(int *number_return); This returns a list of fonts imlib2 can find in its font path.void imlib_free_font_list(char **font_list, int number); This will free the font list returned by imlib_list_fonts().int imlib_get_font_cache_size(void); This returns the font cache size in bytes.void imlib_set_font_cache_size(int bytes); This sets the font cache in bytes. Whenever you set the font cache size Imlib2 will flush fonts from the cache until the memory used by fonts is less than or equal to the font cache size. Setting the size to 0 effectively frees all speculatively cached fonts.void imlib_flush_font_cache(void); This will cause a flush of all speculatively cached fonts from the font cache.int imlib_get_font_ascent(void); Returns the current font's ascent value in pixels.int imlib_get_font_descent(void); Returns the current font's descent value in pixels.int imlib_get_maximum_font_ascent(void); Returns the current font's maximum ascent extent.int imlib_get_maximum_font_descent(void); Returns the current font's maximum descent extent.Imlib_Color_Modifier imlib_create_color_modifier(void); This function creates a new empty color modifier and returns a valid handle on success. NULL is returned on failure.void imlib_free_color_modifier(void); Calling this function frees the current color modifier.void imlib_modify_color_modifier_gamma(double gamma_value); This function modifies the current color modifier by adjusting the gamma by the value specified. The color modifier is modified not set, so calling this repeatedly has cumulative effects. A gamma of 1.0 is normal linear, 2.0 brightens and 0.5 darkens etc. Negative values are not allows.void imlib_modify_color_modifier_brightness(double brightness_value); This function modifies the current color modifier by adjusting the brightness by the value specified. The color modifier is modified not set, so calling this repeatedly has cumulative effects. brightness values of 0 do not affect anything. -1.0 will make things completely black and 1.0 will make things all white. Values in-between vary brightness linearly.void imlib_modify_color_modifier_contrast(double contrast_value); This function modifies the current color modifier by adjusting the contrast by the value specified. The color modifier is modified not set, so calling this repeatedly has cumulative effects. Contrast of 1.0 does nothing. 0.0 will merge to gray, 2.0 will double contrast etc.void imlib_set_color_modifier_tables(DATA8 *red_table, DATA8 *green_table, DATA8 *blue_table, DATA8 *alpha_table); This function explicitly copies the mapping tables from the table pointers passed into this function into those of the current color modifier. Tables are 256 entry arrays of DATA8 which are a mapping of that channel value to a new channel value. A normal mapping would be linear (v[0] = 0, v[10] = 10, v[50] = 50, v[200] = 200, v[255] = 255).void imlib_get_color_modifier_tables(DATA8 *red_table, DATA8 *green_table, DATA8 *blue_table, DATA8 *alpha_table); This copies the table values from the current color modifier into the pointers to mapping tables specified. They must have 256 entries and be DATA8 format.void imlib_reset_color_modifier(void); This function resets the current color modifier to have linear mapping tables.void imlib_apply_color_modifier(void); This uses the current color modifier and modifies the current image using the mapping tables in the current color modifier.void imlib_apply_color_modifier_to_rectangle(int x, int y, int width, int height); This works the same way as imlib_apply_color_modifier() but only modifies a selected rectangle in the current image.Imlib_Updates imlib_image_draw_line(int x1, int y1, int x2, int y2, char make_updates); Draw a line using the current color on the current image from coordinates x1, y1 to x2, y2. If make_updates is 1 it will also return an update you can use for an updates list, otherwise it returns NULL.void imlib_image_draw_rectangle(int x, int y, int width, int height); This draws the outline of a rectangle on the current image at the x, y coordinates with a size of width and height pixels, using the current color.void imlib_image_fill_rectangle(int x, int y, int width, int height); This draws a filled rectangle on the current image at the x, y coordinates with a size of width and height pixels, using the current color.void imlib_image_copy_alpha_to_image(Imlib_Image image_source, int x, int y); This copies the alpha channel of the source image to the x, y coordinates of the current image, replacing the alpha channel there.void imlib_image_copy_alpha_rectangle_to_image(Imlib_Image image_source, int x, int y, int width, int height, int destination_x, int destination_y); This copies the source x, y, width, height rectangle alpha channel from the source image and replaces the alpha channel on the destination image at the x, y, coordinates.void imlib_image_scroll_rect(int x, int y, int width, int height, int delta_x, int delta_y); This scrolls a rectangle at x, y, width, height within the current image by the delta x, y distance (in pixels).void imlib_image_copy_rect(int x, int y, int width, int height, int new_x, int new_y); This copies a rectangle of size width, height at the x, y location specified in the current image to a new location x, y in the same image.Imlib_Color_Range imlib_create_color_range(void); This creates a new empty color range and returns a valid handle to that color range.void imlib_free_color_range(void); This frees the current color range.void imlib_add_color_to_color_range(int distance_away); This adds the current color to the current color range at a distance_away distance from the previous color in the range (if it's the first color in the range this is irrelevant).void imlib_image_fill_color_range_rectangle(int x, int y, int width, int height, double angle); This fills a rectangle of width and height at the x, y location specified in the current image with a linear gradient of the current color range at an angle of angle degrees with 0 degrees being vertical from top to bottom going clockwise from there.void imlib_image_fill_hsva_color_range_rectangle(int x, int y, int width, int height, double angle); This fills a rectangle of width and height at the x, y location specified in the current image with a linear gradient in HSVA color space of the current color range at an angle of angle degrees with 0 degrees being vertical from top to bottom going clockwise from there.void imlib_image_query_pixel(int x, int y, Imlib_Color *color_return); This fills the color_return color structure with the color of the pixel in the current image that is at the x, y location specified.void imlib_image_query_pixel_cmya(int x, int y, int *cyan, int *magenta, int *yellow, int *alpha); This returns the CMYA color of the pixel in the current image that is at the x, y location specified.void imlib_image_query_pixel_hsva(int x, int y, float *hue, float *saturation, float *value, int *alpha); This returns the HSVA color of the pixel in the current image that is at the x, y location specified.void imlib_image_query_pixel_hlsa(int x, int y, float *hue, float *lightness, float *saturation, int *alpha); This returns the HLSA color of the pixel in the current image that is at the x, y location specified.void imlib_image_attach_data_value(const char *key, void *data, int value, Imlib_Data_Destructor_Function destructor_function); This attaches data to the current image with the string key of key, and the data of data and an integer of value. The destructor function, if not NULL is called when this image is freed so the destructor can free the data, if this is needed.void *imlib_image_get_attached_data(const char *key); This returns the data attached to the current image with the key specified. NULL is returned if no data could be found with that key on the current image.int imlib_image_get_attached_value(const char *key); This returns the value attached to the current image with the specified key. If none could be found 0 is returned.void imlib_image_remove_attached_data_value(const char *key); This detaches the data & value attached with the specified key from the current image.void imlib_image_remove_and_free_attached_data_value(const char *key); This removes the data and value attached to the current image with the specified key and also calls the destructor function that was supplied when attaching it.void imlib_save_image(const char *filename); This saves the current image in the format specified by the current image's format settings to the filename specified.void imlib_save_image_with_error_return(const char *filename, Imlib_Load_Error *error_return); This works the same way imlib_save_image() works, but will set the error_return to an error value if the save fails.Imlib_Image imlib_create_rotated_image(double angle); This creates an new copy of the current image, but rotated by angle degrees. On success it returns a valid image handle, otherwise NULL.void imlib_blend_image_onto_image_at_angle(Imlib_Image source_image, char merge_alpha, int source_x, int source_y, int source_width, int source_height, int destination_x, int destination_y, int angle_x, int angle_y); This function works just like imlib_blend_image_onto_image_skewed() except you cannot skew an image (v_angle_x and v_angle_y are 0).void imlib_blend_image_onto_image_skewed(Imlib_Image source_image, char merge_alpha, int source_x, int source_y, int source_width, int source_height, int destination_x, int destination_y, int h_angle_x, int h_angle_y, int v_angle_x, int v_angle_y); This will blend the source rectangle x, y, width, height from the source_image onto the current image at the destination x, y location.void imlib_render_image_on_drawable_skewed(int source_x, int source_y, int source_width, int source_height, int destination_x, int destination_y, int h_angle_x, int h_angle_y, int v_angle_x, int v_angle_y); This works just like imlib_blend_image_onto_image_skewed(), except it blends the image onto the current drawable instead of the current image.void imlib_render_image_on_drawable_at_angle(int source_x, int source_y, int source_width, int source_height, int destination_x, int destination_y, int angle_x, int angle_y); This function works just like imlib_render_image_on_drawable_skewed() except you cannot skew an image (v_angle_x and v_angle_y are 0).void imlib_context_set_cliprect(int x, int y, int w, int h); Sets the current clipping rectangle to (x,y w*h). The clipping rectangle effects all image drawing functions and prevents the area outside the rectangle from being edited. Set w to 0 to disable clipping.int imlib_clip_line(int x0, int y0, int x1, int y1, int xmin, int xmax, int ymin, int ymax, int *clip_x0, int *clip_y0, int *clip_x1, int *clip_y1); A utility function to return clipped line coordinates.void imlib_polygon_new(void); Returns a new polygon object with no points set.void imlib_polygon_free(ImlibPolygon poly); Frees a polygon object.void imlib_polygon_add_point(ImlibPolygon poly, int x, int y); Adds the point (x,y) to a polygon object. The point will be added to the end of the polygon's internal point list. The points are drawn in order, from the first to the last.void imlib_image_draw_polygon(ImlibPolygon poly, unsigned char closed); Draws a polygon onto the current context image. Points which have been added to the polygon are drawn in sequence, first to last. The final point will be joined with the first point if closed is non-zero.void imlib_image_fill_polygon(ImlibPolygon poly); Fill the area defined by the polygon on the current context image with the current context colour.void imlib_polygon_get_bounds(ImlibPolygon poly, int *px1, int *py1, int *px2, int *py2); Calculate the bounding area of the polygon. (px1, py1) defines the upper left corner of the bounding box and (px2, py2) defines it's lower right corner.unsigned char imlib_polygon_contains_point(ImlibPolygon poly, int x, int y); Returns non-zero if the point (x,y) is within the area defined by the polygon.void imlib_image_draw_ellipse(int xc, int yc, int a, int b); Draw an ellipse on the current context image. The ellipse is defined as (x-xc)^2/a^2 + (y-yc)^2/b^2 = 1. This means that the point (xc,yc) marks the center of the ellipse, a defines the horizontal amplitude of the ellipse, and b defines the vertical amplitude.void imlib_image_fill_ellipse(int xc, int yc, int a, int b); Fills an ellipse on the current context image using the current context colour. The ellipse is defined as (x-xc)^2/a^2 + (y-yc)^2/b^2 = 1. This means that the point (xc,yc) marks the center of the ellipse, a defines the horizontal amplitude of the ellipse, and b defines the vertical amplitude.void imlib_image_filter(void); Imlib_Filter imlib_create_filter(int initsize); void imlib_free_filter(void); void imlib_filter_set(int xoff, int yoff, int a, int r, int g, int b); void imlib_filter_set_alpha(int xoff, int yoff, int a, int r, int g, int b); void imlib_filter_set_red(int xoff, int yoff, int a, int r, int g, int b); void imlib_filter_set_green(int xoff, int yoff, int a, int r, int g, int b); void imlib_filter_set_blue(int xoff, int yoff, int a, int r, int g, int b); void imlib_filter_constants(int a, int r, int g, int b); void imlib_filter_divisors(int a, int r, int g, int b); void imlib_apply_filter( char *script, ... ); Imlib 2 Dynamic Filters Imlib2 has built in features allowing filters and effects to be applied at run time through a very small scripting language, this is similar to that of script-fu found in the GIMP (http://www.gimp.org). There are two parts to the system, the client library call ``imlib_apply_filter'' and the library side filters. The library side filters are synonymous with image loaders. To run a script on an image you need to set the context image then call:
imlib_apply_filter( script_string, ... ); The script_string variable is made up of the script language, which is very simple and made up of only function calls. Functions calls look like this:
filter name( key=value [, ...] ); Where,
filter name is the name of the filter you wish to apply the program, or the result of another filter. eg.
bump_map( map=tint(red=50,tint=200), blue=10 ); This example would bump map using a a map generated from the tint filter. It is also possible to pass application information to the filters via the usage of the [] operator. When the script is being compiled the script engine looks on the parameters passed to it and picks up a pointer for every [] found. eg2.
imlib_apply_filter( "tint( x=[], y=[], red=255, alpha=55 );", &myxint, &myyint ); This will cause a tint to the current image at (myxint,myyint) to be done. This is very useful for when you want the filters to dynamically change according to program variables. The system is very quick as the code is pseudo-compiled and then run. The advantage of having the scripting system allows customization of the image manipulations, this is particularly useful in applications that allow modifications to be done (eg. image viewers). Filter Library There are three functions that must be in every filter library
void init( struct imlib_filter_info *info ); - Called once on loading of the filter
info - a structure passed to the filter to be filled in with information about the filter
info->name - Name of the filter library
void deinit(); - Called when the filter is closed
/* Called every time a filter the library exports is called */ void *exec( char *filter, void *im, pIFunctionParam params ); filter - The name of the filter being asked for im - The image that the filter should be applied against params - A linked list of parameters. The best way to get all the values is such: Declare all parameters and initialize them to there default values.Current Macros are:for( ptr = params; ptr != NULL; ptr = ptr->next ) { ..MACRO TO GET VALUE.. }eg.ASSIGN_INT( keyname, local variable ) ASSIGN_DATA8( keyname, local variable ) ASSIGN_IMAGE( keyname, local variable )int r = 50; IFunctionParam *ptr; for( ptr = params; ptr != NULL; ptr = ptr->next ) { ASSIGN_INT( "red", r ); } If the value "red" is not passed to the filter then it will remain at 50, but it a value is passed, it will be assign to r. return type - Imlib_Image, this is the result of filter.
|
||


|
Designing the physical interface involves the actual ergonomics and tactile feel of a system - the bits a user pushes and pulls! Physical interfaces can successfully help give a game far more convincing feel and atmosphere. Two examples used often in games are car steering wheels and light pistols, and more recently "rumble-packs" which vibrate. These give games an extra dimension, sometimes including physical feedback. In a recent debate the Managing Director of Amazon Books claimed his researchers had found a preference amongst staff for using hand-held tablets when reading electronic documents. This seemed to identify a need to read away from a computer, with a portable interface. Seemingly, the closest to (a non-computer) "reality" as possible appears to win greatest satisfaction. |


In your location can't use this website due to domestic laws. Please read our Terms and Conditions document before you will decide to use our website.
We have right defined your location?


Welcome to the Great Number Game
I am thinking of a number between 1 and 100
Take a Guess!
{%if test==None%}
{%elif test=='high'%}
Too High!
{%elif test=='low'%}
Too Low!
>
{%elif test=='nailed'%}
Killed it
{%endif%}


The World Wide Web is a collection of webpages, images and interactive content (Web applications) connected together by links (Hyperlinks - commonly abbreviated to link) .
These two elements communicate via HTTP (Hyper Text Transfer Protocol). The browser sends a request and the webserver returns the requested webpage.
The browser requests a page by clicking on a Hyperlink which contains a reference to a URL (Uniorm Resource Locator) which is unique to each page on the web.
Webpages are documents of type HTML (HyperText Markup Language).
HTML comprises four key types of things:
The contents of an HTML Document is made up of Elements.
All Elements are rectangluar in shape.
HTML <tags> are used to markup these Elements.
These <tags> tell the browser how to handle the individual elements of the webpage.
Most Elements are written with an opening tag, content and a closing tag.
eg. <tag>content</tag>..
The are also a number of tags which are referred to as void tags which don't have either content or a closing tag.
Examples:
The image element:
(note: the 'alt' attribute is not compulsory but is important as it is what will be displayed if there is an error/break in the link to the image url. It is also helpful for blind users.)
The Line Break element:

Like my brother Mark, computers are stupid, they do what you ask ... nothing more, nothing less.
Remember, you are far smarter than the computer, it will only do exactly what you ask it. It has no ability to make a 'best guess' as most humans can if it receives a slightly ambiguous/incorrect instructrution.
So remember: Exact instructions (syntax) must be used. Small typos will NOT be forgiven.
Mark a serious teenage wiseass at the time asks:
''Mum, more tea?''
'Yes, please' she replies.
Mark proceeds to pour tea all over the table.
'What do you think you're doing?' Mum demands.
'You never said you wanted it in a cup' was the too clever reply.
Lesson learned!!


China sails 1st indigenous aircraft carrier through Taiwan Strait
Taipei: China has sent its first domestically manufactured aircraft carrier, known as 002, across the Taiwan Strait, the island’s Ministry of National Defence confirmed. The carrier was closely followed over the weekend by US and Japanese military ships, and came just after Taiwanese President Tsai Ing-wen announced her running mate for the upcoming elections in January 2020, which she will contest as a representative of the ruling and independence Democratic Progressive Party, Efe news reported.
The Ministry confirmed that 002 sailed from north to south with its frigates and the Taiwanese armed forces also deployed their joint monitoring mechanism, which includes surveillance aircraft and other surface vessels to track Chinese ships and try to deter them. “The southbound Chinese vessels stayed on China’s side of the Taiwan’s Strait’s imaginary median line and was closely followed by US Navy’s USG Wayne E. Mayer (DDG 108) and JS Shimakaze (DDG-172) of Japan’s Maritime Self Defense Force,” it said on Sunday.
The Chinese vessels entered the Taiwan Strait from the north on Saturday night to conduct a series of maritime tests, and was scheduled to move to the South China Sea, where Beijing is locked in territorial dispute with several Southeast Asian countries. (IANS)
Also Read: France and European partners to Retaliate European Aircraft Subsidies
Also Watch: Govt all set to push for the contentious Citizenship Bill in the winter session of Parliament


@{krait.set_content_type(ext="html" )}
We are searching for a worthy opponent...
Match found!
Already in queue


|
NVTX++
3.0
C++ convenience wrappers for NVTX.
|
A RAII object for creating a NVTX range within a domain that can be created and destroyed on different threads. More...
#include <nvtx3.hpp>
Public Member Functions | |
| domain_process_range (event_attributes const &attr) noexcept | |
| Construct a new domain process range object. More... | |
| template<typename First , typename... Args, typename = typename std::enable_if<not std::is_same< event_attributes, typename std::decay<First>>::value>> | |
| domain_process_range (First const &first, Args const &...args) noexcept | |
| Construct a new domain process range object. More... | |
| constexpr | domain_process_range () noexcept |
| Construct a new domain process range object. | |
| ~domain_process_range () noexcept | |
Destroy the domain_process_range ending the range. | |
| domain_process_range (domain_process_range const &)=delete | |
| domain_process_range & | operator= (domain_process_range const &)=delete |
| domain_process_range (domain_process_range &&other) noexcept | |
| domain_process_range & | operator= (domain_process_range &&other) noexcept |
A RAII object for creating a NVTX range within a domain that can be created and destroyed on different threads.
When constructed, begins a NVTX range in the specified domain. Upon destruction, ends the NVTX range.
Similar to nvtx3::domain_thread_range
, the only difference being that domain_process_range
can start and end on different threads.
Use of nvtx3::domain_thread_range
should be preferred unless one needs the ability to start and end a range on different threads.
domain_process_range
is moveable, but not copyable.
| D | Type containing name member used to identify the domain to which the domain_process_range belongs. Else, domain::global to indicate that the global NVTX domain should be used. |
|
inlineexplicitnoexcept |
Construct a new domain process range object.
| attr |
|
inlineexplicitnoexcept |
Construct a new domain process range object.
| first | |
| args |


Regular Table
| STATES |
BEATLES |
MEATS |
| Alaska |
Ringo |
Ham |
| Ohio |
George |
Chicken |
| Florida |
Paul |
Turkey |
Cell that spans two columns
| Name |
Telephone |
| Bill Gates |
55577854 |
55577855 |
Cell that spans two rows
| Name: |
Bill Gates |
| Telephone: |
55577854 |
| 55577855 |
Table Caption
Monthly savings
| Month |
Savings |
| January |
$100 |
| February |
$50 |
Table with merged cells
This table gives some statistics about fruit
flies: average height and weight, and percentage
with red eyes (for both males and females).
A test table with merged cells
|
Average |
Red eyes |
| height |
weight |
| Males |
1.9 |
0.003 |
40% |
| Females |
1.7 |
0.002 |
43% |


PostgreSQL (pronounced Post-Gres-Q-L.) is an enhancement of the POSTGRES database management system, a DBMS research prototype developed at the University of California-Berkeley in the 1990s. PostgreSQL is open source and supported by an active developer community. It runs on a variety of hardware and software platforms with excellent performance. See http://www.postgresql.org for more information.
The PostgreSQL binary distribution can be used with Jena. As of PostgreSQL version 8, there are native binaries for Linux and MS Windows. PostgreSQL version 7 requires Cygwin to run on MS Windows and is more complicated to install.
If you prefer the source code distribution, see the instructions at http://www.postgresql.org for downloading and building from the source.
Jena supports both memory models and database models. In general, a Jena program may use both types of models identically. However, there are some differences in how the models are created.
Persistent models are created in the same way for any database system:
- Load the JDBC driver. This enables the Jena program to communicate with the database instance.
- Create a database connection. This creates a Java object for a database connection.
- Create a ModelMaker for the database
- Create a Model for existing or new data.
Jena stores all models in a single database using whatever database (name) is specified on the database connection. See the Jena Database Release Notes for details on the physical layout.


Position
I'm static. I follow the flow!
I'm relative. I'm in the flow but top, left, right and bottom properties move me around.
I'm absolute. I'm outside the flow so you'll have to position me manually. My position is relative to the closest parent with relative positioning.
I'm fixed to the top of the page!


Git Achievements Rank
#
user
unlocked
points
{% for entry in rank %}
{{ forloop.counter }}
{{ entry.user }}
{{ entry.unlocked_count }} / {{ entry.achievements_count }}
{{ entry.points }}
{% endfor %}
For more information and help, try these resources:
Git achievements
Git achievements rank
Copyright © 2011
Jonhnny Weslley


Test CORS
HTTP Method
URL
Supports credentials
Custom headers
Note: Requests with custom headers will be preflighted
Test!


| Spreckels
Academy of Bilingual Studies Magnet provides students
in Grades K-5 with an opportunity to gain exposure to the Spanish
language. Students participate in an appropriate grade level Spanish
language development program 30-45 minutes, four days a week,
in a culturally integrated setting. Teachers have developed a
sequence for Spanish instruction that outlines the Spanish language
concepts and vocabulary to be taught at each grade level. Spreckels
offers a challenging academic program in which all students are
taught literacy, math, science, social studies, art, and music
in English. Spanish speaking students are provided primary language
support. The Spreckels PTA is very active and provides enriching
activities for all students which includes funding for field trips,
assemblies, 5th grade promotion activities and school supplies.
Spreckels Features:
- Computer
and Music Prep Time
- Reduced
class size at grades 4 & 5 (25-29 students)
- Seminar
classrooms for grades 3, 4, and 5
- Cinco de
Mayo & Day of the Child celebration
- Basic Skills
Teacher for students in need of additional academic support
- Counselor
on site 3 days a week
- Nurse on
site 2 days a week
Community
Partnerships:
Bank of
America
La Jolla Plaza
The Titan Corporation
Cluster
Order:
Cluster
3
Cluster 2
Cluster 1
For registration
and tour information please call our office.
|
|
Mission Statement
The purpose of our magnet is to expose all students at Spreckels Magnet to the Spanish Language and cultures of the many Spanish speaking countries.
Vision Statement
After completion of six years of Spanish study, we want students to be able to participate in
conversations over familiar topics in Spanish.
As a staff, we want to continue to make Spanish a priority in the school day, even though the
minutes are so limited for all that must be accomplished. This includes continuing to refine our
curriculum and renewed commitments from the total staff to be a part of the magnet.
Our school must become and stay a group of educators committed to making Spanish as a
Second Language a priority.
SMART Goals: How will we mark our progress toward our vision?
• Academic goal: To develop Spanish language skills in all students and expose them to the
cultural pieces of Spanish speaking countries around the world by following a sequential
curriculum.
• Academic goal: To make adequate yearly progress for all our English Learners by using daily
Focused English Language Development and having students appropriately grouped for
learning.
• Magnet program goal: To continue to work together as a staff to refine and implement a quality
Spanish as a Second Language Program for our students.
• Magnet enrollment goal: Historically, Spreckels has attracted many students to our magnet.
However, with the changes in the enrollment deadlines for 2009-10, there is a fear that
prospective parents may not know to submit the application by February 15, 2009, or may not
be prepared to make this decision by the deadline.
Tours
and Parent Events:
|


Consider the case where country A does not report any trade data at all. What do we do? In such cases it makes sense to use mirrored trade data. In a nutshell, using the mirrored data approach we can reconstruct trade data for country A, even if the country itself does not report andy trade figures, by looking at all trade flows in which country A participated. For example, you can reconstruct country A’s exports to country B by looking at country B’s imports from country A.
Do note, however, that this method is not free of limitations. Most importantly, the reliability of the mirrored trade data for country A depends on the data availability of trade data made available by A’s trading partners and may potentially be systematically biased. Secondly, as comtrade trade data undergoes constant revisions and updates, changes in the mirrored aggregate are more likely than with non-mirrored data.
These words of caution aside, the function download_Comtrade()
offers an easy option perform mirror data extracts. Below, we first revisit Example 4 from the Get Started guide provides a simple introduction to this topic. Next, we turn to somewhat more involved user cases.
First, load the package.
In Example 4 we reconstructed Austria’s export to Germany by looking at Germany’s imports from Austria by setting is.mirrorData = TRUE
. As you can see, variable reporter
now is returned as country name + "mirrored"
, indicating that the the data was derived from a mirrored data query.
mirrX_AT_DE <- download_Comtrade(
year = "2018",
frequency = "annual",
countries = "Austria",
partners = "Germany",
nomenclature = "H3",
commodity = "ag6",
select.stats = "trade_value_usd",
direction = "exports",
type = "commodities",
is.mirrorData = TRUE
)
mirrX_AT_DE
#> # A tibble: 4,056 x 8
#> classification period trade_flow reporter partner commodity_code commodity trade_value_usd
#> <chr> <int> <chr> <chr> <chr> <chr> <chr> <dbl>
#> 1 H3 2018 Export Austria mirrored Germany 010110 Live horses/asses~ 578079
#> 2 H3 2018 Export Austria mirrored Germany 010190 Live horses/asses~ 17717
#> 3 H3 2018 Export Austria mirrored Germany 010210 Live bovine anima~ 75642
#> 4 H3 2018 Export Austria mirrored Germany 010290 Live bovine anima~ 4329765
#> 5 H3 2018 Export Austria mirrored Germany 010391 Live swine other ~ 916695
#> 6 H3 2018 Export Austria mirrored Germany 010392 Live swine other ~ 219879
#> 7 H3 2018 Export Austria mirrored Germany 010410 Live sheep 778978
#> 8 H3 2018 Export Austria mirrored Germany 010420 Live goats 45964
#> 9 H3 2018 Export Austria mirrored Germany 010511 Live fowls of spe~ 6716350
#> 10 H3 2018 Export Austria mirrored Germany 010512 Live turkeys, wei~ 2194
#> # ... with 4,046 more rows
Conceptually, reported imports by Germany from Austria and reported mirrored exports by Austria to Germany are identical by definition. Note that in the query below we can use either tradecode
names or abbreviations as input arguments for tradecode
as provided in table Trade Classifications.
IM_DE_AT <- download_Comtrade(
year = "2018",
frequency = "annual",
countries = "Germany",
partners = "Austria",
nomenclature = "HS2007",
commodity = "ag6",
select.stats = "trade_value_usd",
direction = "imports",
type = "commodities",
is.mirrorData = FALSE
)
IM_DE_AT %>%
summarise(sum(trade_value_usd)) %>%
pull() / mirrX_AT_DE %>%
summarise(sum(trade_value_usd)) %>%
pull()
#> [1] 1
comtradeRggregator
also offers simple options to download mirrored global trade data by downloading mirrored bilateral trade flows and aggregating it up to mirrored global trade data. In the simple example below, we download mirrored trade data for Austria. By setting countries = "World"
, the package will create a mirrored data query for all global economies for the provided specification of year, trade flow, nomenclature, level of aggregation etc., and create a ready-to-use data frame.
In other words, to get the first mirrored export commodity flow for commodity group 01 - Live animals; animal products
in the query below, data from all countries that import this commodity from Austria are queried and aggregated. Then, when aggregating the final data set, the ‘order’ of the trade flows is reversed, i.e. the previously downloaded imports are labelled as mirrored exports. This reversal is highlighted in column reporter
.
In elaborate cases such as the one above it is advisable to keep any temporarily downloaded data by setting rm.temporaryFiles = FALSE
, and, ideally, to have access to an authenticated account; see here for more information.
AT_mirr <- download_Comtrade(
year = "2018",
frequency = "annual",
countries = "Austria",
partners = "World",
nomenclature = "HS2007",
commodity = "ag2",
select.stats = "trade_value_usd",
direction = "all",
type = "commodities",
is.mirrorData = TRUE,
rm.temporaryFiles = FALSE,
build.Comtrade = TRUE,
)
AT_mirr
#> # A tibble: 363 x 8
#> classification period trade_flow reporter partner commodity_code commodity ~ trade_value_usd
#> <chr> <int> <chr> <chr> <chr> <chr> <chr> ~ <dbl>
#> 1 H3 2018 Export Austria mirrored World 01 Live animals;~ 146122111
#> 2 H3 2018 Export Austria mirrored World 02 Meat and edib~<PHONE_NUMBER>
#> 3 H3 2018 Export Austria mirrored World 03 Fish and crus~ 10067362
#> 4 H3 2018 Export Austria mirrored World 04 Dairy produce~<PHONE_NUMBER>
#> 5 H3 2018 Export Austria mirrored World 05 Products of a~ 79271602
#> 6 H3 2018 Export Austria mirrored World 06 Live trees an~ 26938801
#> 7 H3 2018 Export Austria mirrored World 07 Edible vegeta~ 142130800
#> 8 H3 2018 Export Austria mirrored World 08 Edible fruit ~ 209962703
#> 9 H3 2018 Export Austria mirrored World 09 Coffee, tea, ~ 116804431
#> 10 H3 2018 Export Austria mirrored World 10 Cereals ~ 544971227
#> # ... with 353 more rows
Let’s say you want to download monthly mirror trade data starting in 2019 at the HS 6-digit level for a handful of countries for which there is no trade data available on comtrade.
While there are multiple areas where both comtrade and WITS offer similar functionality to the comtradeRggregator
package, this is a scenario where both alternatives are tedious to work with:
WITS does offer a straight-forward integration of mirror data, but there are (at the time of writing this documentation in 2021) no options available to query monthly data;
Comtrade does over the most recent and granular trade data, but there is no option to query mirror data.
Using comtradeRggregator
, the this query can be put together with a couple of line sof code.
comtradeRggregator
First, we want to define list of countries for extraction. The two examples we use here are Afghanistan and the Democratic Republic of the Congo. To double-check the correct spelling of the country names we use is.available_Comtrade()
with option is.fuzzy = TRUE
. Below I run the check for the Democratic Republic of the Congo only. However, for large queries it is advisable to double-check that all country names are correct before setting up the actual data query. If you don’t do that, and are unlucky in the sense that a particular country name is spelled differently in comtrade, your data query will return an error.
is.available_Comtrade(
is.contained = "Congo",
is.fuzzy = TRUE,
frequency = "annual",
nomenclature = "HS",
year = '2019'
)
#> # A tibble: 2 x 2
#> country year
#> <chr> <dbl>
#> 1 Dem. Rep. of the Congo 2019
#> 2 Congo 2019
The final list of countries we want to query is:
country_list = c("Afghanistan", "Dem. Rep. of the Congo")
When setting up this more elaborate query, there are a few things we should keep in mind:
It makes sense to break up this query into two parts: a download for the years 2019 and 2020, and a separate query for 2021. The reason for this is that at the time of writing this tutorial, trade data for all 12 months was available for 2019 and 2020, but not for 2021 as this would make download_Comtrade()
throw an error message.
It is advisable to keep any temporarily downloaded data by setting rm.temporaryFiles = FALSE
. I also want to save the temporary files in a different location specified in variable my_location
, so I also specify location.temporaryFiles = my_location
in the query below.
In an ideal world, you will have access to an authenticated account (see here). I do, so I’m also providing my comtrade authentication token as part of the query.
Note that for the first query we are not specifying the parameter month
which, by default, will return data for all 12 months. Also, note that monthly comtrade data is only available following the HS combined nomenclature.
Finally, as we do not want to overwhelm the API, we reduce the number of extracted countries per sub-query to three, i.e. ext_cnt = 3
, instead of the default of five, and increase the cool-down period between the separate queries from five to ten seconds between rounds by setting speed = 10
. These last two steps are optional and only serve illustrative purposes.
With all of this out of the way, the final monthly mirror data query for 2019 and 2020 looks like this:
mirr_part1 <- download_Comtrade(
year = c("2019", "2020"),
frequency = "monthly",
countries = country_list,
partners = "World",
nomenclature = "HS",
commodity = "ag6",
select.stats = "trade_value_usd",
direction = "all",
type = "commodities",
is.mirrorData = TRUE,
rm.temporaryFiles = FALSE,
location.temporaryFiles = my_location,
build.Comtrade = TRUE,
token = my_token,
ext_cnt = 3,
sleep = 10
)
For the 2021 query, we first want to find the last month of 2021 for which trade data is available. This makes sense because we do not want to run a query for a month where no trade data is available as this would make download_Comtrade()
throw an error message.
To check the data availability, you can either use the is.available_Comtrade()
function, or the data file Comtrade_DA
which I am doing below. As you can see, at the time of writing this tutorial, the most recent monthly trade data is July 2021.
Comtrade_DA %>%
mutate(yr = substr(ps, 1, 4), mnth = substr(ps, 5,6)) %>%
filter(freq == "MONTHLY" & yr == '2021' ) %>%
summarise(x = max(mnth))
#> # A tibble: 1 x 1
#> x
#> <chr>
#> 1 09
The query for 2021 is identical to the first one with the exception of parameter month = c(1:7)
.
mirr_part2 <- download_Comtrade(
year = c("2021"),
frequency = "monthly",
month = c(1:7),
countries = country_list,
partners = "World",
nomenclature = "HS",
commodity = "ag6",
select.stats = "trade_value_usd",
direction = "all",
type = "commodities",
is.mirrorData = TRUE,
rm.temporaryFiles = FALSE,
location.temporaryFiles = my_location,
build.Comtrade = TRUE,
token = my_token,
ext_cnt = 3,
sleep = 10
)


Welcome to PageFetch, a fun game for kids and adults!
You have three minutes to help me fetch pages around the web using a search engine. You'll get more points the better your search is, and there are bonuses up for grabs if you don't throw pages away!
Enjoy the game!


When working with JavaScript a fundamental concept you need to understand is variable scope.
In most other programming languages a variable scope is controlled by where it falls in brackets({ }) but not in JavaScript. JavaScript variable scope is controlled by function scope. Meaning that if a variable is declared outside of a function it is a global variable. Also that if a variable is declared in a function it is local to that function and cannot be accessed outside of its scope.
//Can be accessed by any other code var someVar = "Is global"; function someFunc() { //Can only be accessed code inside of someFunc var someOtherVar = "Is local"; }
But be warned when you are inside of a function you must use the “var” keyword or else the variable is now global.
function someFunc() { someVar = "A var"; } someFunc(); console.log(someVar); //prints "A var"


XCUIElement
extension XCUIElement
XCUIElement
extension contains additional methods for handling swipes, tapping on elements or clearing text fields.
The isVisible
property indicates if the element exists and is hittable.
There are cases where checking only hittable
property is not working as expected.
The text
property can be used to retrieve value from text field as String
.
swipe(from:to:)
is an alternative to swipeUp
, swipeDown
, swipeLeft
and swipeBottom
methods provided by XCTest
.
It lets you specify coordinates on the screen (relative to the view on which the method is called).
Example:
let scroll = app.scrollViews.element
scroll.swipe(from: CGVector(dx: 0, dy: 0), to: CGVector(dx: 1, dy: 1))
swipe(to:avoid:from:)
variation scrolls the screen until given element becomes visible.
Note that XCTest
automatically does the scrolling during tap()
, but the method is still useful in some situations,
for example to reveal element from behind keyboard.
Example:
let scroll = app.scrollViews.element
let button = scroll.buttons.element
scroll.swipe(to: button)
swipe(to:times:avoid:from:until:)
, and two specialized method swipe(to:untilExist:times:avoid:from:)
and swipe(to:untilVisible:times:avoid:from:)
,
swipes scroll view to given direction until condition will be satisfied or in case of specialised methods element would exist or will be visible.
It is a useful method to scroll collection view to reveal an element. In collection view, only a few cells are available in the hierarchy.
To scroll to given element you have to provide swipe direction.
It is not possible to detect when the end of the scroll was reached, that is why the maximum number of swipes is required (by default 10).
The method will stop when the maximum number of swipes is reached or when the condition will be satisfied.
Example:
let collectionView = app.collectionViews.element
let element = collectionView.staticTexts["More"]
collectionView.swipe(to: .down, untilVisible: element)
clearTextField()
and clear(andType:)
provides straightforward method to delete text from text field and then type the provided string.
tap(withOffset:app:orientation:)
performs tap()
on given coordinates (relative to the receiving element).
Can be used to test view where position of the tap matters. It’s also possible to tap a subview (like table view cell), without actually queuing that subview.
smartCoordinate(withNormalizedOffset:app:orientation:)
is an replacement of the coordinate(withNormalizedOffset:)
from XCUIElement
.
XCUICoordinate
has an open issue. Coordinates works correctly only in portrait orientation.
This method and SmartXCUICoordinate
was implemented as a workaround based on glebon gist.
let element = app.tableViews.element
element.smartCoordinate(withNormalizedOffset: CGVector(dx: 0.5, dy: 0.5)).tap()
-
Default number of swipes.
Declaration
Swift
public class var defaultSwipesCount: Int { get }
-
Perform swipe gesture on this view by swiping between provided points.
It is an alternative to
swipeUp
,swipeDown
,swipeLeft
andswipeBottom
methods provided byXCTest
. It lets you specify coordinates on the screen (relative to the view on which the method is called).Example:
let scroll = app.scrollViews.element scroll.swipe(from: CGVector(dx: 0, dy: 0), to: CGVector(dx: 1, dy: 1))
-
Swipes scroll view to reveal given element.
Example:
let scroll = app.scrollViews.element let button = scroll.buttons.element scroll.swipe(to: button)
Note
XCTest
automatically does the scrolling duringtap()
, but the method is still useful in some situations, for example to reveal element from behind keyboard, navigation bar or user defined element.Note
This method assumes that element is scrollable and at least partially visible on the screen.
-
Swipes scroll view to given direction until condition will be satisfied.
A useful method to scroll collection view to reveal an element. In collection view, only a few cells are available in the hierarchy. To scroll to given element you have to provide swipe direction. It is not possible to detect when the end of the scroll was reached, that is why the maximum number of swipes is required (by default 10). The method will stop when the maximum number of swipes is reached or when the condition will be satisfied.
Example:
let collectionView = app.collectionViews.element let element = collectionView.staticTexts["More"] collectionView.swipe(to: .down, until: element.exists)
-
Swipes scroll view to given direction until element would exist.
A useful method to scroll collection view to reveal an element. In collection view, only a few cells are available in the hierarchy. To scroll to given element you have to provide swipe direction. It is not possible to detect when the end of the scroll was reached, that is why the maximum number of swipes is required (by default 10). The method will stop when the maximum number of swipes is reached or when the given element will appear in the view hierarchy.
Example:
let collectionView = app.collectionViews.element let element = collectionView.staticTexts["More"] collectionView.swipe(to: .down, untilExist: element)
Note
This method will not scroll until the view will be visible. To do this call
swipe(to:untilVisible:times:avoid:app:)
after this method. -
Swipes scroll view to given direction until element would be visible.
A useful method to scroll collection view to reveal an element. In collection view, only a few cells are available in the hierarchy. To scroll to given element you have to provide swipe direction. It is not possible to detect when the end of the scroll was reached, that is why the maximum number of swipes is required (by default 10). The method will stop when the maximum number of swipes is reached or when the given element will be visible.
Example:
let collectionView = app.collectionViews.element let element = collectionView.staticTexts["More"] collectionView.swipe(to: .down, untilVisible: element)
Note
This method will not scroll until the view will be visible. To do this call
swipe(to:avoid:from:)
after this method.
-
Indicates if the element is currently visible on the screen.
Example:
let button = app.buttons.element button.tap() XCTAssertTrue(button.isVisible)
Declaration
Swift
var isVisible: Bool { get }
-
Returns
value
as a StringExample:
let textField = app.textFields.element let text = textField.text
Note
It will fail ifvalue
is not aString
type.Declaration
Swift
var text: String { get }
-
Remove text from textField or secureTextField.
Example:
let textField = app.textFields.element textField.clearTextField()
-
Remove text from textField and enter new value.
Useful if there is chance that the element contains text already. This helper method will execute
clearTextField
and then type the provided string.Example:
let textField = app.textFields.element textField.clear(andType: "text")


Gateway
BOT
08-Dec-18 07:10 PM
[telegram] <PTYX11> That one made me laugh
[telegram] <Zong_1> ily bro (re @PTYX11: That one made me laugh)
[telegram] <Zong_1> KMD team: thank you, and keep doing good work.
[telegram] <PTYX11> (re @Zong_1: KMD team: thank you, and keep doing good work.)
[telegram] <Zong_1> hows it going sir? finally able to take a break after like 1yr of grueling work? (re @PTYX11: )
[telegram] <PTYX11> Very good, the year has flown by very fast. I think that's a sign of how many things have been happening. We all look forward to taking some time off for the holidays though
[telegram] <Zong_1> I miss hearing your voice in instructional videos
[telegram] <PTYX11> So we can recharge for 2019
[telegram] <Zong_1> excuse me *if this was posted in an update, but was wondering, is integrating the ZEC Sapling update a priority for the team at all? (re @PTYX11: So we can recharge for 2019)
(edited)
[telegram] <Zong_1> I would guess probably not, mainly due to the mountain of other things that take precedence, but if anything can be gleaned, id be appreciative to know
[telegram] <PTYX11> Actually the December 15th update is for the sapling implementation
[telegram] <PTYX11> So it's coming very soon
[telegram] <Zong_1> wonderful!
please excuse my ignorance, very grateful for the expedient update (re @PTYX11: Actually the December 15th update is for the sapling implementation)
[telegram] <Zong_1> the 4gb to 40mb reduction is quite something
[telegram] <Zong_1> anyways, thank you PTYX
[telegram] <Zong_1> happy holidays to you and the KMD team, make sure to give JL some extra cookies for me
[telegram] <Bram4> Hello, anybody can invite me back to pirate telegram, i got kicked i guess?
[telegram] <PTYX11> The same to you my friend (re @Zong_1: happy holidays to you and the KMD team, make sure to give JL some extra cookies for me)
[telegram] <PTYX11> Here is the link https://discord.gg/p9axwD (re @Bram4: Hello, anybody can invite me back to pirate telegram, i got kicked i guess?)
[telegram] <Bram4> Im already in the discord
[telegram] <Sergio> @piratechain (re @Bram4: Hello, anybody can invite me back to pirate telegram, i got kicked i guess?)
[telegram] <PTYX11> I didn't know pirate had a telegram
[telegram] <Sergio> Thats the link
[telegram] <Bram4> Yeah, but cant get in, got kicked.. i know there are admins here who are also there.. so thats why i ask
[telegram] <Sergio> Ask @Acura360 (re @Bram4: Yeah, but cant get in, got kicked.. i know there are admins here who are also there.. so thats why i ask)
[telegram] <Bram4> Thanks, will do! (re @Sergio: Ask @Acura360)
[telegram] <crypto> Any news hardfork
[telegram] <PTYX11> It's not a contentious hard fork. It's a major update. The sapling update to be more accurate
[telegram] <Acura360> t.me/piratechain (re @Bram4: Thanks, will do!)
[telegram] <crypto> It's is real?
[telegram] <crypto> Admin
[telegram] <Constantini21> Yes (re @crypto: It's is real?)
[telegram] <crypto> Good (re @Constantini21: Yes)
[telegram] <Constantini21> But first news is incorrect
[telegram] <Constantini21> It's updated isn't hard fork
[telegram] <Zong_1> as PTYX mentioned earlier, it will be to include the Sapling upgrade from ZEC repo
[telegram] <crypto> So 15 dec no news


§65. That the legislature of the Territory may from time to time establish and alter the boundaries of election districts and voting precincts and apportion the senators and representatives to be elected from such districts.
On change of districts, see also §§32 and 38, above.


Yatra is the most enticing, creative, and modern Travel Agency Premium HTML5 template suitable for any Travel or travel agency websites.Easy to use & customize, design & code quality, responsive theme, creative sliders, flexibility, tons of premade pages, shortcodes, Multiple portfolio options, Multiple blog options responsive and quick support – these are the outstanding features and quality to make us stand out from the crowd.
This template has smooth animation, clean features, modern and unique design which make your website more beautiful. This template was built in HTML5 and CSS3, with parallax image effects and CSS animations to make it even more appealing and dynamic
Whole template is divided in to several folders and their content defines by the folder names easily.
Yatra is based on Bootstrap Grid that can help you rapidly develop sites that look beautiful at any size, be it a laptop screen or mobile devices.
The syntax is simple and it's effective cross browser, but the awesome part is that it also has the flexibility to go mobile like a champ. You can really easily customize all part of site or build new.
You don't need any special markup. Please follow like as below image.
For more informations, please visit http://www.idangero.us/swiper/
You don't need any special markup. Please follow like as below image.
Yatra - Travel Agency HTML Template used fontawesome, Flaticon font for its icons requirement and no images has been used for any icon. A complete list of icons along with the class names can be found here:
To use an icon on any page of the theme use the below code:
All fontawesome icons class name will always start with the fa- . There are several sizes for icons are predefined in the fonts.css inside css folder. i.e. fa-lg, fa-2x, fa-3x where as flaticon start with flaticon-
All Images are taken from Pexels. All photos published on Unsplash are licensed under Creative Commons Zero which means you can copy, modify, distribute and use the photos for free, including commercial purposes, without asking permission from or providing attribution to the photographer or Unsplash.
Once again, thank you so much for purchasing this template. As I said at the beginning, I'd be glad to help you if you have any questions relating to this template. No guarantees, but I'll do my best to assist.
If you have a more general question relating to the template on ThemeForest, basic HTML/CSS/JavaScript related questions, you might consider visiting the forums and asking your question in the "Item Discussion" section.
Best Regards,
CN-InfoTech


I am a Masters in Computer Engineering Graduate from University of British Columbia, Vancouver, Canada. I have done Bachelors in Computer Science from Guru Nanak Dev University, a State University in India.
I worked as a Software Developer here at Kodak Canada, Burnaby ULC, and interned as software developer at Veenus Software Solutions and my university. I have experience building scalable applications using the Microservices Architecture, Docker, Kubernetes and AWS as our platform for cloud computing services. I have experience working in an Agile environment for SDLC with regular code reviews, weekly sprints, scrum meetings, regression tests and building release Pipelines.
Implemented a Full Stack Web Application built using Node.js, Express for back-end server, PostgreSQL for databases that store user information and helps provide ranking to the users based on number of entries, react for frontend and Docker for deploying the app on Heroku. The users sign in and provide the URL of image, the app in turn authenticates the user, uses the third-party Image Recognition API, Clarifai detects the faces on the images and returns the ranking of the user as well as provides the images with detected faces back to the users.
Built a movie reviews app on Blockchain with front end in React and Solidity for backend for users to login, search for movies based on location and cinema, read their reviews, book tickets for the movie, make payments, get receipts, get refund on cancelling movies as well as leaving a review before signing out. The admin of the app can also use the app to add new locations, cinemas as well as new movies to a particular theatre. The reviews and ratings were deduced based on the timestamps of when the user signed in and signed out of the movie theatres and the money transfer is using Ganache.
Developed unified website for information on both trains as well as flights was built using advance java technologies like JSPs, JSFs, Java Servlets, AJAX, Java APIs, JDBC Connectivity, Socket Programming as well as using HTML, CSS, Bootstrap, JavaScript and jQuery. The site fetched live information about the flights and trains from APIs in JSON format and provided the travelers the information on their schedules, berth status, seat availability, delays, arrivals, departures,select seats, make payments for the selected seats, get receipts and checkout.
Developed a BookStore website using Java, Spring, Hibernate, MySQL. The website allows the users to browse for books by category, by keywords or fuzzy search, then view book info like summary, availabilty add books to their cart and then checkout. The administrator comes into play in the backend part. He/she monitors the booklist, can add mdify or delete the book list. The guest can signup and then login to access his profile that will have the payment and shipping history bound to his account. After checking out, the user views the books in cart and confirms payment/shipping details.
+1(236)5587886
Email Here


Project for Security classes to check how Spring Boot Security reacts with attacks
Bartłomiej Bielecki
Jacek Polak


Acegi behavior
This section looks at the work Acegi does when receiving requests. This section is as much about HTTP security on the servler and client-sides as it is about Acegi.
We look in more detail at these scenario's:
The next sub-sections look at each of these scenario's in more detail.
Copyright © 2007, Steven Devijver
This help file has been generated by the freeware version of HelpNDoc


This line of text is meant to be treated as deleted text.This line of text is meant to be treated as no longer accurate.
This line of text is meant to be treated as an addition to the document. This line of text will render as underlinedrendered as bold text
Left aligned text.
Center aligned text.
Right aligned text.
Justified text.
No wrap text.
upper text.
kind of learning
Twitter, Inc.
795 Folsom Ave, Suite 600
San Francisco, CA 94107
P:<PHONE_NUMBER>
to be or not to be that is the question.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.