--- layout: post title: Closures in JavaScript date: 2014-02-03 13:35:49.000000000 -05:00 type: post published: true status: publish categories: - JavaScript tags: [] meta: _edit_last: '2' _css_code: "div#social a img {\r\n padding: 0px;\r\n margin: 10px 3px 0 0;\r\n}" author: login<EMAIL_ADDRESS>email<EMAIL_ADDRESS>display_name: Aimee Knight first_name: Aimee last_name: Knight ---
I'm pleased to report that my decision to begin the Nashville Software School's fourth cohort has been a wise one. I'm currently four weeks in to the first half of the program, and although intense, I'm loving each and every moment. We're snowed in today, so I'm going to write a brief post in place of my usual commute time.
Up until this week, I'd understood closures only at face value... I could explain what they were, but hadn't reached the point of knowing how to really utilize them in my code. So, I want to record some notes explaining how they work, and an instance for using them effectively.
Every function, comes with an associated environment. JavaScript Allonge states this wonderfully; "Every time a function is invoked, a new environment is created. The "x" in a expression that we call a “variable” is itself an expression that is evaluated by looking up the value in the environment." When you define a function, within another function, the inner function's environment, also includes the outer function's environment.
Closures in JavaScript also mean that a functions variable values are set when the function is called... not when it's defined. With loops, this can get tricky! I've added some additional comments to the snippet below from Mark Story's blog explaining how this works. Essentially, we first define a function "clicker". Then, we call clicker within our loop to create a closure which captures each number, and ensures our event listener is set according to i's current iteration value.
{% highlight javascript %} var numbers = [1, 2, 3, 4, 5]; for (var i in numbers) { var num = numbers[i]; var anchor = document.createElement('A'); anchor.setAttribute('href', '#'); anchor.appendChild(document.createTextNode(num)); document.body.appendChild(anchor); // attach event handler via an outer function that when called below // returns the inner function to be attached // with number set to the current environment value for i var clicker = function(number) { return function (event) { event.preventDefault(); console.log('My number is ' + number); }; }; // functions variable values are set when the function is called, so... // call clicker before existing the loop to pass in the current value of i anchor.addEventListener('click', clicker(num), false); } {% endhighlight %}Of course, there are a lot more examples of use cases for closures. In class, we've been using closures to create private properties for our classes.
Well, I've got a lot of code to write, and a lot of great material to read. I hope to post at least once monthly in order to highlight topics we're covering at NSS. Take care.


define ->
series: (tasks, callback) ->
tasks = tasks.slice 0
next = (cb) ->
return cb() if tasks.length is 0
task = tasks.shift()
task -> next cb
result = (cb) -> next cb
result(callback) if callback?
result
parallel: (tasks, callback) ->
count = tasks.length
result = (cb) ->
return cb() if count is 0
for task in tasks
task ->
count--
cb() if count is 0
result(callback) if callback?
result


The above icon is liked to Google Maps. It uses a small library to detect whether or not the user is on iOS.
By doing this, we can ensure that all users on iOS and Android will have this link open in their native maps app. If the user is on desktop, they will get Google Maps on desktop.
Before implimenting this code, you would want to update the lat and long to the variables used in your application.


Ezekiel 1:9
Their wings were joined one to another; they turned not when they went; they went every one straight forward.


{{_ 'Welcome to your reward page! Jobayan offers you points that correspond to ranks that your account can achieve. Explore these achievements and unlock badges to entice job seekers with your engagement.'}}
{{_ 'Begin unlocking! Points are easily earned as long as you’re active in your Jobayan account. Every activity corresponds to points (i.e. Promoting a post can earn you 500pts), and every point corresponds to level and rank. Just keep using your Jobayan account for you and your job seekers and earn masters ranks to make your company stand out.'}}
| 500 PTS | {{_ 'Promoting a Post'}} |
| 200 PTS | {{_ 'Signing Up'}} |
| 200 PTS | {{_ 'Job Posting'}} |
| 100 PTS | {{_ 'Click Interested'}} |
| 15 PTS | {{_ 'Updating Profile'}} |
| 10 PTS | {{_ 'Downloading a Resume'}} |
| 1 PT | {{_ 'Viewing a Search Page'}} |
| 1 PT | {{_ 'Viewing a Detail Page'}} |
| 1 PT | {{_ 'Purchasing Credit 1:1'}} |
| {{_ 'LVL'}} | {{_ 'POINTS'}} | {{_ 'Rank'}} |
|---|---|---|
| 1-4 | 75++ | {{_ 'Just Starting'}} |
| 5-9 | 460++ | {{_ 'New Recruiter'}} |
| 10-19 | 1,230++ | {{_ 'Junior Recruiter'}} |
| 20-29 | 4,545++ | {{_ 'Active Recruiter'}} |
| 30-39 | 13,440++ | {{_ 'Ninja Recruiter'}} |
| 40-49 | 37,300++ | {{_ 'Samurai Recruiter'}} |
| 50-59 | 101,410++ | {{_ 'Rockstar Company'}} |
| 60-69 | 273,820++ | {{_ 'VIP Company'}} |
| 70-79 | 737,700++ | {{_ 'Super Company'}} |
| 80-89 | 1,986,145++ | {{_ 'Grand Company'}} |
| 90-99 | 5,346,410++ | {{_ 'Epic Company'}} |
| 100++ | 14,391,235++ | {{_ 'Be the first to unlock!'}} |


|
||||||||||
| PREV NEXT | FRAMES NO FRAMES |
| Packages that use Lang | |
|---|---|
| prettify.lang | All languages that comes with release. |
| prettify.parser | The Prettify parser. |
| Uses of Lang in prettify.lang |
|---|
| Subclasses of Lang in prettify.lang | |
|---|---|
class |
LangAppollo
This is similar to the lang-appollo.js in JavaScript Prettify. |
class |
LangBasic
This is similar to the lang-basic.js in JavaScript Prettify. |
class |
LangClj
This is similar to the lang-clj.js in JavaScript Prettify. |
class |
LangCss
This is similar to the lang-css.js in JavaScript Prettify. |
protected static class |
LangCss.LangCssKeyword
|
protected static class |
LangCss.LangCssString
|
class |
LangDart
This is similar to the lang-dart.js in JavaScript Prettify. |
class |
LangErlang
This is similar to the lang-erlang.js in JavaScript Prettify. |
class |
LangGo
This is similar to the lang-go.js in JavaScript Prettify. |
class |
LangHs
This is similar to the lang-hs.js in JavaScript Prettify. |
class |
LangLisp
This is similar to the lang-lisp.js in JavaScript Prettify. |
class |
LangLlvm
This is similar to the lang-ml.js in JavaScript Prettify. |
class |
LangLua
This is similar to the lang-lua.js in JavaScript Prettify. |
class |
LangMatlab
This is similar to the lang-ml.js in JavaScript Prettify. |
protected static class |
LangMatlab.LangMatlabIdentifier
|
protected static class |
LangMatlab.LangMatlabOperator
|
class |
LangMl
This is similar to the lang-ml.js in JavaScript Prettify. |
class |
LangMumps
This is similar to the lang-mumps.js in JavaScript Prettify. |
class |
LangN
This is similar to the lang-n.js in JavaScript Prettify. |
class |
LangPascal
This is similar to the lang-appollo.js in JavaScript Prettify. |
class |
LangR
This is similar to the lang-r.js in JavaScript Prettify. |
class |
LangRd
This is similar to the lang-rd.js in JavaScript Prettify. |
class |
LangScala
This is similar to the lang-scala.js in JavaScript Prettify. |
class |
LangSql
This is similar to the lang-sql.js in JavaScript Prettify. |
class |
LangTcl
This is similar to the lang-tcl.js in JavaScript Prettify. |
class |
LangTex
This is similar to the lang-tex.js in JavaScript Prettify. |
class |
LangVb
This is similar to the lang-vb.js in JavaScript Prettify. |
class |
LangVhdl
This is similar to the lang-vhdl.js in JavaScript Prettify. |
class |
LangWiki
This is similar to the lang-wiki.js in JavaScript Prettify. |
protected static class |
LangWiki.LangWikiMeta
|
class |
LangXq
This is similar to the lang-xq.js in JavaScript Prettify. |
class |
LangYaml
This is similar to the lang-yaml.js in JavaScript Prettify. |
| Fields in prettify.lang with type parameters of type Lang | |
|---|---|
protected java.util.List<Lang> |
Lang.extendedLangs
See LangCss for example. |
| Methods in prettify.lang that return types with arguments of type Lang | |
|---|---|
java.util.List<Lang> |
Lang.getExtendedLangs()
Get the extended languages list. |
| Method parameters in prettify.lang with type arguments of type Lang | |
|---|---|
void |
Lang.setExtendedLangs(java.util.List<Lang> extendedLangs)
Set extended languages. |
| Uses of Lang in prettify.parser |
|---|
| Method parameters in prettify.parser with type arguments of type Lang | |
|---|---|
protected java.util.List<java.lang.String> |
Prettify.getFileExtensionsFromClass(java.lang.Class<? extends Lang> clazz)
|
void |
Prettify.register(java.lang.Class<? extends Lang> clazz)
Register language handler. |
|
||||||||||
| PREV NEXT | FRAMES NO FRAMES |


These sandwiches are the best I've ever tasted, for sure. I now eat them every day - breakfast, lunch and dinner.
Mr Smith, Professional sandwich tasterFlu and cold are both caused by viruses, but completely different ones. There are many viruses that can cause a cold, but only a few that can cause a flu. Cold symptoms are not sudden and develop over a few days. The flu has a rapid onset within 3-6 hours. The flu hits hard and includes sudden symptoms like high fever, aches and pains.
Your college nurse
The closest pharmacist
Your GP or for more urgent care please go to the emergency room
You can call 111 for more information
If you have a life-threatening medical emergency, call 999
DISCLAIMER:
This is not a medical website. Any advice provided here is purely informational. Please consult a medical care specialist listed above for more details.


Workshops Professional Development, How-To, and More Professional Development Workshops Color Columns and Rows The Distance Formula Titles How-to Sessions NTI Introduction Introduction to Alternate Formats Introduction to Alt Tags Optical Character Recognition (OCR) Supplemental Alternative Methods For Charts Captioning


arrow_back
BACK
person
Full Name
Loading
Questions
0
Answers
0
User's questions
Question not found
Title
skjdks cdkjsdc skdjcs kdjc sdkcj skdcj sdkcj skdcj sdkjc sd
Loading ...


The Copernican is a blog by Vasudevan Mukunth, a science writer from Bangalore, India (but a Chennaikaran at heart).


--- title: ROCKET functions keywords: fastai sidebar: home_sidebar summary: "ROCKET (RandOm Convolutional KErnel Transform) functions for univariate and multivariate time series using GPU." description: "ROCKET (RandOm Convolutional KErnel Transform) functions for univariate and multivariate time series using GPU." nb_path: "nbs/111_models.ROCKET.ipynb" ---
bs = 16
c_in = 7 # aka channels, features, variables, dimensions
c_out = 2
seq_len = 15
xb = torch.randn(bs, c_in, seq_len).to(default_device())
m = ROCKET(c_in, seq_len, n_kernels=1_000, kss=[7, 9, 11]) # 1_000 for testing with a cpu. Default is 10k with a gpu!
test_eq(m(xb).shape, [bs, 2_000])
from tsai.data.all import *
from tsai.models.utils import *
X, y, splits = get_UCR_data('OliveOil', split_data=False)
tfms = [None, TSRegression()]
batch_tfms = TSStandardize(by_var=True)
dls = get_ts_dls(X, y, splits=splits, tfms=tfms, batch_tfms=batch_tfms, shuffle_train=False, drop_last=False)
model = build_ts_model(ROCKET, dls=dls, n_kernels=1_000) # 1_000 for testing with a cpu. Default is 10k with a gpu!
X_train, y_train = create_rocket_features(dls.train, model)
X_valid, y_valid = create_rocket_features(dls.valid, model)
X_train.shape, X_valid.shape


Apache™ FOP: Configuration
Configuration File Basics
The Apache™ FOP configuration file is an XML file containing a variety of settings that are useful for controlling FOP's behavior, and for helping it find resources that you wish it to use.
The easiest way to get started using a FOP configuration file is to copy the sample found at {fop-dir}/conf/fop.xconf
to a location of your choice, and then to edit it according to your needs. It contains templates for the various configuration options, most of which are commented out. Remove the comments and change the settings for entries that you wish to use. Be sure to follow any instructions, including comments which specify the value range. Also, since the configuration file is XML, be sure to keep it well-formed.
Making Configuration Available to FOP
After creating your configuration file, you must tell FOP how to find it:
-
If running FOP from the command-line, see the "-c" command-line option in Running FOP.
-
If running FOP as an embedded application, see Embedding, Using a Configuration File.
See Setting the Configuration Programmatically for instructions on how to do so in an embedded environment.
Summary of the General Configuration Options
| Element | Data Type (for the value) | Description | Default Value |
|---|---|---|---|
| base | URL or directory | Specifies the base URL based on which relative URL will be resolved. | current directory |
| font-base | URL or directory | Specifies the base URL based on which relative font URLs will be resolved. | base URL/directory (above) |
| hyphenation-base | URL or directory | Specifies the base URL based on which relative URLs to hyphenation pattern files will be resolved. If not specified, support for user-supplied hyphenation patterns remains disabled. | disabled |
| source-resolution | Integer, dpi | Resolution in dpi (dots per inch) which is used internally to determine the pixel size for SVG images and bitmap images without resolution information. | 72 dpi |
| target-resolution | Integer, dpi | Resolution in dpi (dots per inch) used to specify the output resolution for bitmap images generated by bitmap renderers (such as the TIFF renderer) and by bitmaps generated by Apache Batik for filter effects and such. | 72 dpi |
| strict-configuration | Boolean (true, false) | Setting this option to 'true' will cause FOP to strictly verify the contents of the FOP configuration file to ensure that defined resources (such as fonts and base URLs/directories) are valid and available to FOP. Any errors found will cause FOP to immediately raise an exception. | false |
| strict-validation | Boolean (true, false) | Setting this option to 'false' causes FOP to be more forgiving about XSL-FO validity, for example, you're allowed to specify a border on a region-body which is supported by some FO implementations but is non-standard. Note that such a border would currently have no effect in Apache FOP. | true |
| break-indent-inheritance | Boolean (true, false) | Setting this option to 'true' causes FOP to use an alternative rule set to determine text indents specified through margins, start-indent and end-indent. Many commercial FO implementations have chosen to break the XSL specification in this aspect. This option tries to mimic their behaviour. Please note that Apache FOP may still not behave exactly like those implementations either because FOP has not fully matched the desired behaviour and because the behaviour among the commercial implementations varies. The default for this option (i.e. false) is to behave exactly like the specification describes. | false |
| default-page-settings | n/a | Specifies the default width and height of a page if "auto" is specified for either or both values. Use "height" and "width" attributes on the default-page-settings element to specify the two values. | "height" 11 inches, "width" 8.26 inches |
| prefer-renderer | boolean (true, false) | By default, FOP prefers the newer output implementations based on the IFDocumentHandler interface. If no such implementation can be found for a given MIME type, it looks for an implementation of the Renderer interface. If necessary, you can invert the lookup order to prefer the Renderer variant over the IFDocumentHandler variant by setting this value to true. |
false |
| use-cache | boolean (true, false) | All fonts information that has been gathered as a result of "directory" or "auto-detect" font configurations will be cached for future rendering runs. This setting should improve performance on systems where fonts have been configured using the "directory" or "auto-detect" tag mechanisms. By default this option is switched on. | true |
| cache-file | String | This option specifies the file/directory path of the fop cache file. This option can also be specified on the command-line using the -cache option. This file is currently only used to cache font triplet information for future reference. | $ |
| renderers | (see text below) | Contains the configuration for each renderer. See below. | N/A |
This is an excerpt from the example configuration file coming with FOP:
<fop version="1.0">

<strict-configuration>true</strict-configuration>

<strict-validation>true</strict-validation>

<base>./</base>

./

<source-resolution>72</source-resolution>

<target-resolution>72</target-resolution>

<default-page-settings height="11in" width="8.26in"/>

</fop>
Image Loading Customization
Apache FOP uses the image loading framework from Apache XML Graphics Commons to load images using various plug-ins. Every image loader plug-in has a hard-coded usage penalty that influences which solution is chosen if there are multiple possibilities to load an image. Sometimes, though, these penalties need to be tweaked and this can be done in the FOP configuration. An example:
<fop version="1.0">
[..]
<image-loading>
<penalty value="10000"
class="org.apache.xmlgraphics.image.loader.impl.ImageLoaderRawCCITTFax"/>
<penalty value="INFINITE"
class="org.apache.xmlgraphics.image.loader.impl.ImageLoaderInternalTIFF"/>
</image-loading>
<renderers....
</fop>
The first penalty element increases the penalty for the raw CCITT loader. This practically forces the decoding of CCITT compressed TIFF images except if there are no TIFF codecs available.
The second penalty element sets an "infinite" penalty for the TIFF loader using the internal TIFF codec. This practically disables that plug-in as it will never be chosen as a possible solution.
Negative penalties are possible to promote a plug-in but a negative penalty sum will be treated as zero penalty in most cases. For more details on the image loading framework, please consult the documentation there.
Renderer configuration
Each Renderer has its own configuration section which is identified by the MIME type the Renderer is written for, ex. "application/pdf" for the PDF Renderer.
The configuration for the PDF Renderer could look like this:
<renderers>
<renderer mime="application/pdf">
<filterList>

<value>flate</value>
</filterList>
<fonts>

</fonts>
</renderer>
<renderer mime="application/postscript">

The details on the font configuration can be found on the separate Fonts page. Note especially the section entitled Register Fonts with FOP.
Special Settings for the PDF Renderer
The configuration element for the PDF renderer contains two elements. One is for the font configuration (please follow the link above) and one is for the "filter list". The filter list controls how the individual objects in a PDF file are encoded. By default, all objects get "flate" encoded (i.e. simply compressed with the same algorithm that is also used in ZIP files). Most users don't need to change that setting. For debugging purposes, it may be desired not to compress the internal objects at all so the generated PDF commands can be read. In that case, you can simply use the following filter list. The second filter list (type="image") ensures that all images still get compressed but also ASCII-85 encoded so the produced PDF file is still easily readable in a text editor.
<renderer mime="application/pdf">
<filterList>
<value>null</value>
</filterList>
<filterList type="image">
<value>flate</value>
<value>ascii-85</value>
</filterList>
<fonts....
</renderer>
Another (optional) setting specific to the PDF Renderer is an output color profile, an ICC color profile which indicates the target color space the PDF file is generated for. This setting is mainly used in conjunction with the PDF/X feature. An example:
<renderer mime="application/pdf">
<filterList...
<output-profile>C:\FOP\Color\EuropeISOCoatedFOGRA27.icc</output-profile>
<fonts....
</renderer>
Some people don't have high requirements on color fidelity but instead want the smallest PDF file sizes possible. In this case it's possible to disable the default sRGB color space which XSL-FO requires. This will cause RGB colors to be generated as device-specific RGB. Please note that this option is unavailable (and will cause an error) if you enable PDF/A or PDF/X functionality or if you specify an output profile. This setting will make the PDF about 4KB smaller. To disable the sRGB color space add the following setting:
<renderer mime="application/pdf">
<filterList...
<disable-srgb-colorspace>true</disable-srgb-colorspace>
<fonts....
</renderer>
FOP supports encryption of PDF output, thanks to Patrick C. Lankswert. This feature is commonly used to prevent unauthorized viewing, printing, editing, copying text from the document and doing annotations. It is also possible to ask the user for a password in order to view the contents. Note that there already exist third party applications which can decrypt an encrypted PDF without effort and allow the aforementioned operations, therefore the degree of protection is limited. For further information about features and restrictions regarding PDF encryption, look at the documentation coming with Adobe Acrobat or the technical documentation on the Adobe web site.
<renderer mime="application/pdf">
<encryption-params>
<user-password>testuserpass</user-password>
<owner-password>testownerpass</owner-password>
<noprint/>
<nocopy/>
<noedit/>
<noannotations/>
</encryption-params>
</renderer>
Special Settings for the PostScript Renderer
Besides the normal font configuration (the same "fonts" element as for the PDF renderer) the PostScript renderer has an additional setting to force landscape pages to be rotated to fit on a page inserted into the printer in portrait mode. Set the value to "true" to activate this feature. The default is "false". Example:
<renderer mime="application/postscript">
<auto-rotate-landscape>true</auto-rotate-landscape>
<fonts>

</fonts>
</renderer>
Special Settings for the PCL Renderer
Non-standard fonts for the PCL renderer are made available through the Java2D subsystem which means that you don't have to do any custom font configuration in this case but you have to use the font names offered by Java.
Additionally, there are certain settings that control how the renderer handles various elements.
<renderer mime="application/vnd.hp-PCL">
<rendering>quality</rendering>
<text-rendering>bitmap</text-rendering>
</renderer>
The default value for the "rendering" setting is "speed" which causes borders to be painted as plain rectangles. In this mode, no special borders (dotted, dashed etc.) are available. If you want support for all border modes, set the value to "quality" as indicated above. This will cause the borders to be painted as bitmaps.
The default value for the "text-rendering" setting is "auto" which paints the base fonts using PCL fonts. Non-base fonts are painted as bitmaps through Java2D. If the mix of painting methods results in unwelcome output, you can set this to "bitmap" which causes all text to be rendered as bitmaps.
Special Settings for the AFP Renderer
Additionally, there are certain settings that control how the renderer handles various elements.
<renderer mime="application/x-afp">
<images mode="b+w" bits-per-pixel="8" native="true"/>
<renderer-resolution>240</renderer-resolution>

<resource-group-file>resources.afp</resource-group-file>
</renderer>
The default value for the images "mode" setting is "b+w" (black and white). When the images "mode" setting is "b+w" a "bits-per-pixel" setting can be provided to aid the grayscale conversion process. With this setting all images referenced in your source document are converted to an IOCA FS45 grayscale bitmap image form. When the setting is "color" all images are converted to an IOCA FS45 color bitmap image form. When "native" setting is "true", all images encountered (TIFF, GIF, JPEG and Encapsulated Postscript etc.) will be embedded directly in the datastream in their native form using a MO:DCA Object Container.
The default value for the "renderer-resolution" is 240 dpi.
By default if there is no configuration definition for "resource-group-file", external resources will be placed in a file called resources.afp.
When it does not work
FOP searches the configuration file for the information it expects, at the position it expects. When that information is not present, FOP will not complain, it will just continue. When there is other information in the file, FOP will not complain, it will just ignore it. That means that when your configuration information is in the file but in a different XML element, or in a different XML path, than FOP expects, it will be silently ignored.
Check the following possibilities:
-
The format of the configuration file has changed considerably between FOP 0.20.5 and FOP 1.0 and its beta versions. Did you convert your file to the new format?
-
The FOP distribution contains a schema for configuration files, at src/foschema/fop-configuration.xsd. Did you validate your configuration file against it? Add the following schema location to the
schema
element::::xml
and run the configuration file through a validating schema parser. Note that the schema cannot detect all errors, and that it is stricter about the order of some elements than FOP itself is.
- Run FOP in debug mode (command line option
-d
). This makes FOP report which configuration information it finds. Check if FOP finds what you expect.


{% for resource in collections.resources %}
{% include "./partials/polaroid-link.html" %}
{% endfor %}
{% for resource in collections.worksheets %}
{% include "./partials/polaroid-link.html" %}
{% endfor %}


|
José
|
URL-safe Base64 Encoding & Decoding. More...
Functions | |
| size_t | jose_b64_dec (const json_t *i, void *o, size_t ol) |
| Decodes a URL-safe Base64 JSON string to a buffer. More... | |
| jose_io_t * | jose_b64_dec_io (jose_io_t *next) |
| Creates a new IO object which performs URL-safe Base64 decoding. More... | |
| size_t | jose_b64_dec_buf (const void *i, size_t il, void *o, size_t ol) |
| Decodes a URL-safe Base64 buffer to an output buffer. More... | |
| json_t * | jose_b64_dec_load (const json_t *i) |
| Decodes a JSON string from a URL-safe Base64 JSON string. More... | |
| json_t * | jose_b64_enc (const void *i, size_t il) |
| Encodes data to a URL-safe Base64 JSON string. More... | |
| jose_io_t * | jose_b64_enc_io (jose_io_t *next) |
| Creates a new IO object which performs URL-safe Base64 encoding. More... | |
| size_t | jose_b64_enc_buf (const void *i, size_t il, void *o, size_t ol) |
| Encodes data to a URL-safe Base64 buffer. More... | |
| json_t * | jose_b64_enc_dump (const json_t *i) |
| Encodes the input JSON as a URL-safe Base64 JSON string. More... | |
URL-safe Base64 Encoding & Decoding.
| size_t jose_b64_dec | ( | const json_t * | i, |
| void * | o, | ||
| size_t | ol | ||
| ) |
Decodes a URL-safe Base64 JSON string to a buffer.
If o
is NULL, the number of output bytes necessary is returned.
This function will never write more than ol
bytes. If the output buffer is too small, an error will occur.
| i | The input URL-safe Base64 JSON string. |
| o | The output buffer (may be NULL). |
| ol | The size of the output buffer. |
Creates a new IO object which performs URL-safe Base64 decoding.
All data written to the returned IO object will be decoded before passing it on to the next IO object in the chain.
| next | The next IO object in the chain. |
| size_t jose_b64_dec_buf | ( | const void * | i, |
| size_t | il, | ||
| void * | o, | ||
| size_t | ol | ||
| ) |
Decodes a URL-safe Base64 buffer to an output buffer.
If o
is NULL, the number of output bytes necessary is returned.
This function will never write more than ol
bytes. If the output buffer is too small, an error will occur.
| i | The input URL-safe Base64 buffer. |
| il | The size of the data in the input buffer. |
| o | The output buffer. |
| ol | The size of the output buffer. |
| json_t* jose_b64_dec_load | ( | const json_t * | i | ) |
Decodes a JSON string from a URL-safe Base64 JSON string.
| i | The input URL-safe Base64 JSON string containing JSON data. |
| json_t* jose_b64_enc | ( | const void * | i, |
| size_t | il | ||
| ) |
Encodes data to a URL-safe Base64 JSON string.
| i | The input buffer. |
| il | The size of the data in the input buffer. |
Creates a new IO object which performs URL-safe Base64 encoding.
All data written to the returned IO object will be encoded before passing it on to the next IO object in the chain.
| next | The next IO object in the chain. |
| size_t jose_b64_enc_buf | ( | const void * | i, |
| size_t | il, | ||
| void * | o, | ||
| size_t | ol | ||
| ) |
Encodes data to a URL-safe Base64 buffer.
If o
is NULL, the number of output bytes necessary is returned.
This function will never write more than ol
bytes. If the output buffer is too small, an error will occur.
| i | The input buffer. |
| il | The size of the data in the input buffer. |
| o | The output URL-safe Base64 buffer. |
| ol | The size of the output buffer. |
| json_t* jose_b64_enc_dump | ( | const json_t * | i | ) |
Encodes the input JSON as a URL-safe Base64 JSON string.
| i | The input JSON data. |


Submit any saved applications before then - you won't be able to access them after that date. For new applications, consider waiting until the replacement service launches on 6 April 2022.


Sign Out
sentence
ACTOR-SECTION
country
show all
agent...
show all
from:
not sure
to:
commit
VERB-SECTION
not sure
verb....
show all
commit
TARGET-SECTION
country
show all
agent...
show all
from:
not sure
to:
commit


No
The when
directive allows the Pipeline to determine whether the stage should
be executed depending on the given condition.
The when
directive must contain at least one condition.
If the when
directive contains more than one condition,
all the child conditions must return true for the stage to execute.
This is the same as if the child conditions were nested in an allOf
condition
(see the examples below). If an anyOf
condition is used, note that the condition skips remaining tests as soon as the first "true" condition is found.
More complex conditional structures can be built
using the nesting conditions: not
, allOf
, or anyOf
.
Nesting conditions may be nested to any arbitrary depth.
Required |
No |
|---|---|
Parameters |
None |
Allowed |
Inside a |
Execute the stage when the branch being built matches the branch
pattern given, for example: when { branch 'master' }
. Note that this only works on
a multibranch Pipeline.
Execute the stage when the build is building a tag.
Example: when { buildingTag() }
Execute the stage if the build’s SCM changelog contains a given regular expression pattern,
for example: when { changelog '.*^\\[DEPENDENCY\\] .+$' }
Execute the stage if the build’s SCM changeset contains one or more files matching the given string or glob.
Example: when { changeset "**/*.js" }
By default the path matching will be case insensitive, this can be turned off with the caseSensitive
parameter,
for example: when { changeset glob: "ReadMe.*", caseSensitive: true }
Executes the stage if the current build is for a "change request"
(a.k.a. Pull Request on GitHub and Bitbucket, Merge Request on GitLab or Change in Gerrit etc.).
When no parameters are passed the stage runs on every change request,
for example: when { changeRequest() }
.
By adding a filter attribute with parameter to the change request,
the stage can be made to run only on matching change requests.
Possible attributes are
id
, target
, branch
, fork
, url
, title
, author
, authorDisplayName
, and authorEmail
.
Each of these corresponds to
a CHANGE_*
environment variable, for example: when { changeRequest target: 'master' }
.
The optional parameter comparator
may be added after an attribute
to specify how any patterns are evaluated for a match:
EQUALS
for a simple string comparison (the default),
GLOB
for an ANT style path glob (same as for example changeset
), or
REGEXP
for regular expression matching.
Example: when { changeRequest authorEmail<EMAIL_ADDRESS>comparator: 'REGEXP' }
Execute the stage when the specified environment variable is set
to the given value, for example: when { environment name: 'DEPLOY_TO', value: 'production' }
Execute the stage when the expected value is equal to the actual value,
for example: when { equals expected: 2, actual: currentBuild.number }
Execute the stage when the specified Groovy expression evaluates
to true, for example: when { expression { return params.DEBUG_BUILD } }
Note that when returning strings from your expressions they must be converted to booleans or return null
to evaluate to false. Simply returning "0" or "false" will still evaluate to "true".
Execute the stage if the TAG_NAME
variable matches the given pattern.
Example: when { tag "release-*" }
.
If an empty pattern is provided the stage will execute if the TAG_NAME
variable exists
(same as buildingTag()
).
The optional parameter comparator
may be added after an attribute
to specify how any patterns are evaluated for a match:
EQUALS
for a simple string comparison,
GLOB
(the default) for an ANT style path glob (same as for example changeset
), or
REGEXP
for regular expression matching.
For example: when { tag pattern: "release-\\d+", comparator: "REGEXP"}
Execute the stage when the nested condition is false.
Must contain one condition.
For example: when { not { branch 'master' } }
Execute the stage when all of the nested conditions are true.
Must contain at least one condition.
For example: when { allOf { branch 'master'; environment name: 'DEPLOY_TO', value: 'production' } }
Execute the stage when at least one of the nested conditions is true.
Must contain at least one condition.
For example: when { anyOf { branch 'master'; branch 'staging' } }
when
before entering the stage’s `agent
By default, the when
condition for a stage
will be evaluated after
entering the agent
for that stage
, if one is defined. However, this can
be changed by specifying the beforeAgent
option within the when
block. If beforeAgent
is set to true
, the when
condition will be
evaluated first, and the agent
will only be entered if the when
condition evaluates to true.
pipeline {
agent any
stages {
stage('Example Build') {
steps {
echo 'Hello World'
}
}
stage('Example Deploy') {
when {
branch 'production'
}
steps {
echo 'Deploying'
}
}
}
}
pipeline {
agent any
stages {
stage('Example Build') {
steps {
echo 'Hello World'
}
}
stage('Example Deploy') {
when {
branch 'production'
environment name: 'DEPLOY_TO', value: 'production'
}
steps {
echo 'Deploying'
}
}
}
}
pipeline {
agent any
stages {
stage('Example Build') {
steps {
echo 'Hello World'
}
}
stage('Example Deploy') {
when {
allOf {
branch 'production'
environment name: 'DEPLOY_TO', value: 'production'
}
}
steps {
echo 'Deploying'
}
}
}
}
pipeline {
agent any
stages {
stage('Example Build') {
steps {
echo 'Hello World'
}
}
stage('Example Deploy') {
when {
branch 'production'
anyOf {
environment name: 'DEPLOY_TO', value: 'production'
environment name: 'DEPLOY_TO', value: 'staging'
}
}
steps {
echo 'Deploying'
}
}
}
}
pipeline {
agent any
stages {
stage('Example Build') {
steps {
echo 'Hello World'
}
}
stage('Example Deploy') {
when {
expression { BRANCH_NAME ==~ /(production|staging)/ }
anyOf {
environment name: 'DEPLOY_TO', value: 'production'
environment name: 'DEPLOY_TO', value: 'staging'
}
}
steps {
echo 'Deploying'
}
}
}
}
pipeline {
agent none
stages {
stage('Example Build') {
steps {
echo 'Hello World'
}
}
stage('Example Deploy') {
agent {
label "some-label"
}
when {
beforeAgent true
branch 'production'
}
steps {
echo 'Deploying'
}
}
}
}


https://github.com/mdiazcl/fuzzbunch-debian
Install instructions etc in the github
How to run?
After you install everything you can use fuzzbunch doing the following:
export WINEPREFIX=$HOME/.wine-fuzzbunch
cd $HOME/.wine-fuzzbunch/drive_c/fuzzbunch-debian/windows
wine cmd.exe
python fb.py
How to Install
Step 1: Install wine (Remember to be able to run wine32)
apt update
apt install wine winbind winetricks
Since fuzzbunch uses windows32 libraries, we are going to setup our own wine32 environment, also this will prevent to break any wine application that you are already using.
# Install wine32
dpkg --add-architecture i386 && apt-get update && apt-get install wine32
# Start a wine32 environment
WINEPREFIX="$HOME/.wine-fuzzbunch" WINEARCH=win32 wine wineboot
# Change WINEPREFIX for this session (modify your .bashrc accordingly if you want to make it permanent)
export WINEPREFIX=$HOME/.wine-fuzzbunch
Step 2: Add python and fuzzbunch to PATH
wine regedit.exe
Select: HKEY_CURRENT_USER\Environment
Right Click Add String Value
Type: String
Name: PATH
Value: c:\\windows;c:\\windows\\system;C:\\Python26;C:\\fuzzbunch-debian\\windows\\fuzzbunch
Step 3: Get files from GIT
cd $HOME/.wine-fuzzbunch/drive_c
git clone https://github.com/mdiazcl/fuzzbunch-debian.git
That will get you something like this:
fuzzbunch-debian/
├── installers
├── logs
└── windows
├── Bin
├── exploits
├── fuzzbunch
├── implants
├── lib
├── listeningposts
├── payloads
├── Resources
├── specials
├── storage
└── touches
Step 4: Install Python2.6 and pywin32 (winetrick will install both)
winetricks python26
If you are having issues, Install each module (python-2.6 and pywin32-219.win32.py2.6) from the installer folder.
Step 5: Run fuzzbunch
Switch to fuzzbunch folder
cd $HOME/.wine-fuzzbunch/drive_c/fuzzbunch-debian/windows
wine cmd.exe
That should get us C:\fuzzbunch-debian\windows> prompt. Run fuzzbunch (fb.py)
python fb.py
That's it, Fuzzbunch it's up and running! Use it by your own responsability and for internal and authorized only purposes!


Getting Started with OpenShift
After installing OpenShift with the mobile addon as described in minishift_install.inc.adoc you can log into OpenShift using the credentials:
User: developer
Password: <any value if using Minishift>
A project is automatically created for you, and typically you use that project to provision and configure everything you need to use mobile services.
When you start OpenShift for the first time, the mobile addon may require some time to complete and mobile services might not appear in the service catalog for a few minutes.
See the guide on how to local_development.adoc


Animal magnetism: Steve McCurry's menagerie – in pictures
by Steve McCurryThe legendary US photographer’s favourite shots of creatures and how they interact with humans feature in Animals, his latest book
A mahout and his elephant at a sanctuary, Chiang Mai, Thailand, 2010
Mahouts dedicate their lives to caring for a specific elephant. Animals is published this month by Taschen
Photograph: Steve McCurry
A teenage boy with an albino rat, Chennai, India, 1996
Photograph: Steve McCurry
A young nomad with his goat, Litang, Tibet, 2001
I photographed this nomad boy and his family’s goat near Litang, a major centre of Tibetan culture. With an elevation of nearly 4,000 metres (13,000 ft) it has a subarctic climate characterised by long, cold winters, and short summers. These goats produce fine cashmere wool highly prized for clothing and textiles.
Photograph: Steve McCurry
Snow monkey in Jigokudani Yaen-koen park, Yamanouchi, Japan, 2018
Photograph: Steve McCurry
A man reads a newspaper with a dog. Rome, Italy, 1994
Photograph: Steve McCurry
Monk and Cat, Aranyaprathet, Thailand, 1998
I photographed this novice monk studying Buddhist writings in the late afternoon at a monastery in Aranyaprathet, near the Thai border with Cambodia. I watched the changing light as the monks went about both the mundane and sacred duties of their day. With the simple use of wood and fabric, of shades of saffron from mustard gold to deep orange, their environment was serene.
Photograph: Steve McCurry
A girl from the Kara tribe holds a rooster, Dus Village, Omo Valley, Ethiopia
Photograph: Steve McCurry
A boy rests against a cow, Kathmandu, Nepal, 2013
Cows have been designated the national animal in Nepal. They roam freely, and are considered sacred by the 80% of Nepalis who are Hindu.
Photograph: Steve McCurry
Tourists lounge poolside as an elephant passes, Bentota, Sri Lanka, 1995
Photograph: Steve McCurry
A shepherd walks with a herd of sheep near Magdeburg in the former German Democratic Republic, 1989
Photograph: Steve McCurry


 I'll kill myself against the wall at 300 an hour."
VIDEO - The Aprilia RS-GP catches fire in a straight, and Andrea returns to the pit-box: "Enough! I said it ten times that the bike's not working. It ends here, today."
by Marco Caregnato"Enough... I'm done... you're all nuts, nuts. Enough. Enough for today. I'll kill myself against the wall, against the wall at 300 an hour. I said it ten times that the bike wasn't working, it wasn't working!"
Here's the video:
An episode that made Andrea Iannone lose his patience. During one of his rounds, after having recently mounted new tires, Iannone was riding the straight in Valencia when something happened, as you can clearly see from the photos. The engine of his RS-GP had a technical problem on the straight, and the bike started to catch fire near the engine.
Iannone kept his cool, slowing to a stop near the ride-off area, with the rear wheel covered in oil and the bike still standing, holding it by its left handlebar. A commissioner intervened quickly, putting out the fire, but the following scenes are maybe even worse than the images of Iannone alongside his motorcycle in the ride-off area.
When he returned to the pit-box he began to raise his voice and point towards the technicians, including an astonished Romano Albesiano. Iannone was really angry, since he had a big scare, considering how fast he was going when the technical problem occurred. Things went well, but the consequences could have been disastrous.


Gershon Elber, May 1991
Eric S. Raymond, Sep 1992
Toshio Kuratomi, May 2004
Gershon wrote: "This library was written because I couldn't find anything similar and I wanted one. I was inspired by the RLE Utah tool kit, which I hoped to port to an IBM PC, but found it to be too machine specific, and its compression ratio too low. I compromised on the GIF format, but I am not sure how long 8 bits per pixel will be enough."
This document explains the GIF library code in directory `lib'. The code is collected into libgif.a which is used in all the utilities in `util'. It can be used in any application needs to read/write the GIF file format. This document does not explain the GIF file format and assumes you know it, at least to the level of the GIF file structure.
When a GIF file is opened, a GIF file descriptor is created which is a pointer to GifFileType structure as follows:
typedef struct GifFileType {
int SWidth, SHeight, /* Screen dimensions. */
SColorResolution, /* How many colors can we generate? */
SBackGroundColor; /* I hope you understand this one... */
ColorMapObject *SColorMap; /* NULL if not exists. */
int ImageCount; /* Number of current image */
GifImageDesc Image; /* Block describing current image */
struct SavedImage *SavedImages; /* Use this to accumulate file state */
VoidPtr Private; /* The regular user should not mess with this one! */
} GifFileType;
This structure was copied from gif_lib.h - the header file for the GIF
library. Any application program that uses the libgif.a library should
include it. Members beginning with S refer to GIF Screen; others hold
properties of the current image (a GIF file may have more than one image)
or point to allocated store used by various routines.The user almost never writes into this structure (exception: it may occasionally useful to alter things in the SavedImages array), but can read any of these items at any time it is valid (image information is invalid until first image was read/write).
As the library needs to keep its own internal data, a Private pointer to hidden data is included. Applications should ignore this item.
The library has no static data. This means that it is fully reentrant and any number of GIF files (up to memory limits) can be opened for read/write. Instead of the static data, internal structure pointed by the Private pointer is used.
The library allocates its own memory dynamically, on opening of files, and releases that once closed. The user is never required to allocate any memory for any of the functions of this library nor to free them directly.
In order to reduce disk access, the file buffer is increased to FILE_BUFFER_SIZE (defined in gif_lib.h). The library was compiled in large model on the PC as the memory allocated per file is quite big: about 17k for decoding (DGIF_LIB.C), and 32k for encoding (EGIF_LIB.C), excluding the FILE_BUFFER_SIZE.
Here is a module summary:
Most of the routines return GIF_ERROR (see gif_lib.h) if something went wrong, GIF_OK otherwise. After an error return, the code in the gif_err.c module can be used to do something about it.
In addition, a module to parse command line arguments is supplied. This module is called getarg.c and its headers are in getarg.h. See the header of getarg.c for details on its usage.
GifFileType *DGifOpenFileName(char *GifFileName)
Open a new GIF file using the given GifFileName, and read its Screen
information.
If any error occurs, NULL is returned and the error handler can be
used to get the exact error (see gif_err.c).
The file is opened in binary mode, and its buffer size is set to
FILE_BUFFER_SIZE bytes.
GifFileType *DGifOpenFileHandle(int GifFileHandle)
Open a new GIF file using the given GifFileHandle, and read its Screen
information.If any error occurs, NULL is returned and the error handler can be used to get the exact error (see gif_err.c).
The file is opened in binary mode, and its buffer size is set to FILE_BUFFER_SIZE bytes.
Once you have acquired a handle on a GIF, there are two ways to read it in. The high-level function
int DGifSlurp(GifFileType)
reads the rest of a complete (possibly multi-image) GIF file from the
indicated file handle into in-core allocated structures. It returns
GIF_OK on success, GIF_ERROR on failure.Once you have done this, all image, raster, and extension-block data in the GIF is accessable in the SavedImages member (see the structures in fif_lib.h). When you have modified the image to taste, write it out with EGifSpew().
If you are handling large images on a memory-limited machine, you may need to use the following functions for sequential read.
int DGifGetScreenDesc(GifFileType *GifFile)
Reads the screen information into the GifFile structure. Note this
routine is automatically called once a file is opened, and therefore
usually need not be called explicitly.Returns GIF_ERROR if something went wrong, GIF_OK otherwise.
int DGifGetRecordType(GifFileType *GifFile, GifRecordType *GifType)
As the GIF file can have different records in arbitrary order, this
routine should be called once the file was open to detect the next
record type, and act upon it. It can return these types in GifType:
int DGifGetImageDesc(GifFileType *GifFile)
Reads image information into the GifFile structure.
Returns GIF_ERROR if something went wrong, GIF_OK otherwise.
int DGifGetLine(GifFileType *GifFile, PixelType *GifLine, int GifLineLen)
Load a block of pixels from the GIF file. The line can be
of any length. More than that, this routine may be interleaved with
DGifGetPixel until all pixels have been read.Returns GIF_ERROR if something went wrong, GIF_OK otherwise.
int DGifGetPixel(GifFileType *GifFile, PixelType GifPixel)
Loads one pixel from the GIF file. This routine may be interleaved
with DGifGetLine, until all pixels are
read. Because of the overhead per each call, use of this routine is
not recommended.Returns GIF_ERROR if something went wrong, GIF_OK otherwise.
int DGifGetComment(GifFileType *GifFile, char *GifComment)
Load a comment from the GIF file. Because DGifGetRecordType will
only tell if the record is of type extension, this routine should be
called iff it is known %100 that is must be a comment.For the definition of a comment, see EGifPutComment. Returns GIF_ERROR if something went wrong, GIF_OK otherwise.
int DGifGetExtension(
GifFileType *GifFile,
int *GifExtCode,
ByteType **GifExtension)
Loads an extension block from the GIF file. Extension blocks
are optional in GIF files. This routine should be followed by
DGifGetExtensionNext.Returns GIF_ERROR if something went wrong, GIF_OK otherwise.
int DGifGetExtensionNext(GifFileType *GifFile, ByteType **GifExtension)
As extensions may contain more than one block, use this routine to
continue after DGifGetExtension, until *GifExtension is NULL.Returns GIF_ERROR if something went wrong, GIF_OK otherwise.
int DGifGetCode(
GifFileType *GifFile,
int *GifCodeSize, ByteType **GifCodeBlock)
It sometimes may be desired to read the compressed code as is
without decoding it. This routine does exactly that (with
DGifGetCodeNext), and can be used instead of DGifGetLine.This compressed code information can be written out using the EGifPutCode/EGifPutCodeNext sequence (see gifpos.c for example). Returns GIF_ERROR if something went wrong, GIF_OK otherwise.
int DGifGetCodeNext(GifFileType *GifFile, ByteType **GifCodeBlock)
See DGifGetCode above.
int DGifGetLZCodes(GifFileType *GifFile, int *GifCode)
This routine can be called instead of DGifGetLine/DGifGetPixel or
DGifGetCode/DGifGetCodeNext to get the 12 bits LZ codes of the images.
It will be used mainly for debugging purposes (see GifText.c for
example).Returns GIF_ERROR if something went wrong, GIF_OK otherwise.
int DGifCloseFile(GifFileType *GifFile)
Close GIF file and free all memory allocated for it. GifFile should
not be used after this routine has been called.Returns GIF_ERROR if something went wrong, GIF_OK otherwise.
int EGifSpew(GifFileType *GifFile, int GifFileHandle)Writes a complete (possibly multi-image) GIF file to the indicated file handle from in-core allocated structures created by a previous DGifSlurp() or equivalent operations. Its arguments are a GIF file descriptor (as above) and an ordinary output file descriptor.
The file is written with a GIF87 stamp unless it contains one of the four special extension blocks defined in GIF89, in which case it is written with a GIF89 stamp.
If you are handling large images on a memory-limited machine, you may need to use the following functions for sequential write.
GifFileType *EGifOpenFileName(char *GifFileName, int GifTestExistance)
Open a new GIF file using the given GifFileName. If GifTestExistance
is TRUE, and file exists, the file is not destroyed, and NULL
returned.If any error occurs, NULL is returned and the error handler can be used to get the exact error (see gif_err.c).
The file is opened in binary mode, and its buffer size is set to FILE_BUFFER_SIZE bytes.
GifFileType *EGifOpenFileHandle(int GifFileHandle)
Open a new GIF file using the given GifFileHandle.If any error occurs, NULL is returned and the error handler can be used to get the exact error (see gif_err.c).
The file is opened in binary mode, and its buffer size is set to FILE_BUFFER_SIZE bytes.
void EGifSetGifVersion(char *Version)
Sets the GIF version of all files opened, until another call to this
routine is made. Version is a 3 characters string of the form "87a"
or "89a". No test is made to validate this string.
int EGifPutScreenDesc(GifFileType *GifFile,
int GifWidth, int GifHeight,
int GifColorRes, int GifBackGround,
ColorMapObject *GifColorMap)
Update the GifFile Screen parameters, in GifFile structure and in
the real file. If error occurs, returns GIF_ERROR (see gif_lib.h),
otherwise GIF_OK.This routine should be called immediately after the GIF file was opened.
int EGifPutImageDesc(GifFileType *GifFile,
int GifLeft, int GifTop,
int Width, int GifHeight,
int GifInterlace,
ColorMapObject *GifColorMap)
Update GifFile Image parameters, in GifFile structure and in the real
file. if error occurs returns GIF_ERROR (see gif_lib.h), otherwise
GIF_OK.This routine should be called each time a new image must be dumped to the file.
int EGifPutLine(GifFileType *GifFile, PixelType *GifLine, int GifLineLen)
Dumps a block of pixels out to the GIF file. The slab can be
of any length. More than that, this routine may be interleaved with
, until all pixels have been sent.Returns GIF_ERROR if something went wrong, GIF_OK otherwise.
int EGifPutPixel(GifFileType *GifFile, PixelType GifPixel)
Dumps one pixel to the GIF file. This routine may be interleaved with
EGifPutLine, until all pixels were sent.
Because of the overhead for each call, use of this routine is not
recommended.Returns GIF_ERROR if something went wrong, GIF_OK otherwise.
int EGifPutComment(GifFileType *GifFile, char *GifComment)
Uses extension GIF records to save a string as a comment is the file.
The extension code is 'C' (for Comment).Returns GIF_ERROR if something went wrong, GIF_OK otherwise.
int EGifPutExtension(
GifFileType *GifFile,
int GifExtCode,
int GifExtLen,
void *GifExtension)
Dumps the given extension block into the GIF file. Extension blocks
are optional in GIF file. Extension blocks of more than 255 bytes or
more than one block are not supported in this function. Please use
EGifPutExtensionFirst, EGifPutExtensionNext, and EGifPutExtensionLast
if your extension blocks may fall into this category.Returns GIF_ERROR if something went wrong, GIF_OK otherwise.
int EGifPutExtensionFirst(
GifFileType * GifFile,
int GifExtCode,
int GifExtLen,
const VoidPtr GifExtension)
Dumps the beginning of a GIF extension block to a GIF file. Extension blocks
are optional in GIF files. This function outputs the meta information
necessary to a GIF extension block and the extension data described in the
GifExtension argument.Further blocks of the GIF Extension should be dumped using EGifPutExtensionNext. When finished with this extension block, EGifPutExtensionLast should be called to output the block termination.
Returns GIF_ERROR if something went wrong, GIF_OK otherwise.
int EGifPutExtensionNext(
GifFileType * GifFile,
int GifExtCode,
int GifExtLen,
const VoidPtr GifExtension)
Dumps a subblock of a GIF extension to a GIF File. Extension blocks are
optional in GIF files. This function will write the Extension Data in
GifExtension to the file as a subblock of the preceding Extension Block.
Repeat calling of this function until all data subblocks have been output.Note that EGifPutExtensionFirst needs to be called before any calls to this function. EGifPutExtensionLast should be called to finish the Extension block after all data subblocks have been output.
Returns GIF_ERROR if something went wrong, GIF_OK otherwise.
int EGifPutExtensionLast(
GifFileType * GifFile,
int GifExtCode,
int GifExtLen,
const VoidPtr GifExtension)
Dumps an optional GIF extension data subblock and the GIF extension block
terminator to a GIF File. Extension blocks are optional in GIF files. This
function will write the Extension Data in GifExtension to the file as a
subblock of the preceding Extension Block. Then it will output the GIF
extension block terminator to end the current Extension block. As a special
case, if GifExtLen is zero, the function will assume there isn't another
data block to output and will simply write the block terminator.Note that a call to EGifPutExtensionFirst is needed to open the GIF Extension Block prior to calling this function.
Returns GIF_ERROR if something went wrong, GIF_OK otherwise.
int EGifPutCode(
GifFileType *GifFile,
int *GifCodeSize,
ByteType **GifCodeBlock)
It sometimes may be desired to write the compressed code as is
without decoding it. For example a filter for a GIF file that change
only screen size (GifPos), does not need the exact pixel values.
Piping out the compressed image as is makes this process much
faster.This routine does exactly that (with EGifPutCodeNext), and can be used instead of EGifPutLine. You'll usually use this with the DGifGetCode/DgifGetCodeNext routines, which reads the compressed code, while EGifPutCode/EGifPutCodeNext write it out. See gifpos.c for example.
Returns GIF_ERROR if something went wrong, GIF_OK otherwise.
int EGifPutCodeNext(GifFileType *GifFile, ByteType **GifCodeBlock)
See EGifPutCode above.
int EGifCloseFile(GifFileType *GifFile)
Close a GIF file and free all memory allocated for it. gif-file$
should not be used, once this routine was called.Returns GIF_ERROR if something went wrong, GIF_OK otherwise.
ColorMapObject *MakeMapObject(int ColorCount, GifColorType *ColorMap)
Allocate storage for a color map object with the given number of
RGB triplet slots. If the second argument is non-NULL, initialize
the color table portion of the new map from it. Returns NULL if
memory is exhausted or if the size is not a power of 2 <= 256.
void FreeMapObject(ColorMapObject *Object)
Free the storage occupied by a ColorMapObject that is no longer needed.
ColorMapObject *UnionColorMap(
ColorMapObject *ColorIn1, ColorMapObject *ColorIn2,
GifPixelType ColorTransIn2[])
Create the union of two given color maps and return it. If the result
won't fit into 256 colors, NULL is returned, the allocated union
otherwise. ColorIn1 is copied as it to ColorUnion, while colors from
ColorIn2 are copied iff they didn't exist before. ColorTransIn2 maps
the old ColorIn2 into ColorUnion color map table.
SavedImage *GifAttachImage(GifFileType *GifFile)
Add an image block to the SavedImages array. The image block is
initially zeroed out. This image block will be seen by any following
EGifSpew() calls.
The GIF utility font support includes entry points for drawing legends on in-core images, drawing boxes and rectangles, and boxing text. These entry points are as follows:
void DrawText(
SavedImage *Image,
const int x, const int y,
const char *legend,
const int color)
Draw text using the 8x8 utility font on the saved image. Upper left
corner of the text is at image pixel (x, y). Use the specified
color index.
void DrawBox(SavedImage *Image,
const int x, const int y,
const int w, const int h,
const int color)
Draw a box on the saved image. Upper left corner of the box is at
image pixels (x, y), width is w, height is h. Use the specified color
index.
void DrawRectangle(SavedImage *Image,
const int x, const int y,
const int w, const int h,
const int color)
Draw a (filled) rectangle on the saved image. Upper left corner of
the box is at image pixels (x, y), width is w, height is h. Use the
specified color index.
void DrawBoxedText(SavedImage *Image,
const int x, const int y,
const char *legend,
const int border,
const int bg, const int fg)
Draw text on a filled rectangle. The rectangle will be sized to fit
the text, with upper left hand corner at (x, y) on the saved image.
The `border' argument specifies a pixel margin around the text. The
`bg' argument is the color table index to fill the rectangle with;
`fg' is the color table index to draw the text with.This function interprets some characters in the legend string specially. A tab (\t) is interpreted as a command to center the following text in the box. A carriage return (\r) is interpreted as a request for a line break.
void PrintGifError(void)
Print a one-line diagnostic on the last giflib error to stderr.
int GifLastError(void)
Return the number of the last giflib error, and clear the error.
The error types are defined in gif_lib.h.Note it is the user's responsibility to call the file closing routine, so the file will be closed (if was opened), and allocated memory will be released.
int DumpScreen2Gif(char *FileName, int ReqGraphDriver, int ReqGraphMode1,
int ReqGraphMode2)
Dumps the whole device buffer as specified by GraphDriver and
GraphMode (as defined in TC 2.0 graphics.h) into FileName as GIF file.
Current devices supported:
1. Hercules. 2. EGA, EGA64, EGAMONO (all modes - see TC graphics.h). 3. VGA (all modes - see TC graphics.h). 4. SVGA_SPECIAL. This mode is special and not supported by Borland graphics.h. ReqGraphDriver must be equal to 999, and ReqGraphMode is ignored. This modes assumes 800 by 600 in 16 colors. Returns GIF_ERROR if something went wrong, GIF_OK otherwise. 5. SGI 4D using gl graphic library - window dump. 6. X11 window dump.
int GAGetArgs(int argc, char **argv, char *CtrlStr, ...)
Main routine of this module. Given argc & argv as received by
the main procedure, the command line CtrlStr, and the addresses of
all parameters, parse the command line, and update the parameters.The CtrlStr defines what types of variables should follow. Look at the beginning of getarg.c for exact usage.
Returns 0 if successful, error number (as defined by getarg.h) otherwise.
void GAPrintErrMsg(int Error)
If an error occurred in GAGetARgs, this routine may be used to print
one line diagnostic to stderr.
void GAPrintHowTo(char *CtrlStr)
Given the same CtrlStr as for GAGetArgs, can be used to print a one line
'how to use'.
A sequential filter skeleton will usually look like the example file giffiltr.c in util.
Please look at the utilities in the util directory for more ideas once you feel comfortable with these skeletons. Also try to follow the coding standards of this package if you want the maintainer to officially add your new utility to it.


16 January 2012 - The Ministry of Health (MoH) of the Kingdom of Cambodia has announced a confirmed case of human infection with avian influenza A (H5N1) virus.
The case was a 2 year-old male from Banteay Meanchey Province. He developed symptoms on 3 January 2012 and was admitted to hospital on 9 January 2012. He is on Tamiflu and has been ventilated.
 He is the 19th person in Cambodia to become infected with the H5N1 virus; to date, 16 of these cases have died from complications of the disease.
The National and local Rapid Response Teams (RRT) are conducting outbreak investigation and response following the national protocol. Hospital staff who had contact with the case have been offered oseltamivir. To date, none of the human contacts have tested positive for A (H5N1).


Meat thief with 231 convictions caught smuggling drugs into prison given chance to go straight
Paul Cox, of Durham, was told he has six months to prove he can stay offence-free or he will be jailed
by Rob KennedyA drug addict with 231 previous convictions who was caught smuggling narcotics into a prison has been given six months to prove he can stay out of trouble.
Paul Cox was visiting an inmate at HMP Northumberland when he was spotted handing over a package containing 50 xanax tablets.
The 42-year-old went on to steal hundreds of pounds worth of meat and chocolates during a series of shop thefts, Newcastle Crown Court.
He was facing a prison sentence but a judge decided to give him until next March to see if he can remain offence free - promising if he does, he may consider sparing him custody.
Recorder Paul Reid told Cox: "You are facing a period inside again and that is the almost inevitable outcome or would have been were I to sentence you today.
"But the sentence for this lengthy period of appalling behaviour cannot be measured in years, rather in months.
"I'm going to defer the sentencing hearing until March 6.
"You have to stay out of trouble. If you do, when you come back, having had a period free of offending, the chances are I will impose a custodial sentence but will suspend it. So it's a matter entirely for you."
The court heard it was on March 21 last year that Cox went to HMP Northumberland.
During a visit, he was seen reaching down into his trousers, bringing something out and placing it on a table, which the prisoner slid across the table to himself.
Cox, of Redwood Flats, Brandon, County Durham, told police pressure was being put on the inmate, whose relative he was living with, and he agreed to help.
He pleaded guilty to conveying a banned article into prison and nine offences of theft from shops - including high value meat and chocolates.
The court heard of his 231 previous convictions, 136 are for acquisitive crime, mainly shop thefts and he also previously served a seven year sentence for supplying heroin.
Michael Hodson, defending, said: "His antecedents are quite frankly appalling.
"He was stealing items which were easily sold and are attributable to his addiction.
"He owed debts because he is a drug addict and he was encouraged to take those drugs into prison, no doubt to pay off some drug debt."
Mr Hodson added that Cox was the carer for his mentally ill partner and he had also been attacked with pepper or CS gas.


The dvisvgm package converts DVI, EPS and PDF files to SVG format.
This package is known to build and work properly using an LFS-10.1 platform.
Download (HTTP): https://github.com/mgieseki/dvisvgm/releases/download/2.11.1/dvisvgm-2.11.1.tar.gz
Download MD5 sum: 2eb037bd599c7f9af9fc3d176de97b86
Download size: 3.0 MB
Estimated disk space required: 334 MB (49 MB installed, add 959 MB for the tests)
Estimated build time: 0.8 SBU (add 0.6 SBU for the tests, both using parallelism=4)
Brotli-1.0.9, ghostscript-9.53.3 and Potrace-1.16
asciidoc-9.1.0 with xmlto-0.0.28 and libxslt-1.1.34 (see command explanations), dblatex (with the above) and xxHash (the current version is included in the tarball)
User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/dvisvgm
To enable the build system to link to libkpathsea.so
, as the root
user create a symlink from /usr/lib
:
ln -svf /opt/texlive/2020/lib/libkpathsea.so /usr/lib
The testsuite assumes that a modern version of Python has been installed as plain
python. Changing this
to use python3
requires a sed to one of Makefile.in
files, but that gets regenerated when autoreconf is run, so the sed
must come after that.
Install dvisvgm by running the following commands:
sed -i 's/python/&3/' tests/Makefile.in && autoreconf -fiv && ./configure \ --bindir=/opt/texlive/2020/bin/${TEXARCH} \ --mandir=/opt/texlive/2020/texmf-dist/doc/man \ --with-kpathsea=/opt/texlive/2020 && make
To test the results, issue: make check.
Now, as the root
user:
make install
ln -svf /opt/texlive/2020/lib/libkpathsea.so /usr/lib: Without this, the program will not link correctly,
autoreconf -fiv: The versions of autoconf and automake used when this package was created are older than the current versions in LFS. That causes 'make' to fail when it reaches the 'tests' subdirectory unless autoreconf is forced to install missing (i.e. newer) auxiliary files.
--with-kpathsea=/opt/texlive/2020:
This allows the build system to find the headers for kpathsea
Last updated on 2021-02-25 10:46:48 -0800


What's CynthiaOS?
CynthiaOS is an attempt to build a fast, secure, and light-weight Unix-like operating system.
The name was just random choice I thought was catchy, and later found that it's a Greek origin name meaning "from Mount Cynthus", cool I guess.
I am doing this in order to learn the core concepts of Computer Science and it's implementation. I started this out of curiosity and it occured to me that building an Operating System from scratch would be a great idea even though I know nothing about it.
This operating system will be focused on security, performance, and portability. As a security researcher myself, I am hoping to learn more about low-level vulnerabilities, OS privilege escalations, etc throughout my journey of making this operating system.
I am planning to write this OS in the Rust Programming Language.
Release When?
Not in the near future, I am doing this in my spare time so it will take a while for a complete release although you can see the journey on the CynthiaOS GitHub Organization and I will occasionaly write updates on this blog.
My Plans
I am thinking about a lot of ideas and as a single person, I don't think I can implement them all but with the contributions from open-source, it would be a little easier. For example, I have plans to build a CynthiaSDK for developing apps specifically for CynthiaOS and Windows/Linux application support by default which I don't even know if it's feasible but I am thinking wine, Lutris, subsystems and all that.
And to support games and GPU intensive applications, I would have to write GPU drivers and stuff, this will be exciting! I don't even know if I will complete this or if I just procrastinate and forget about this. I really want to release this and make it a very usable operating system just like the one you're using right now except if you're "that" guy.
Contact Me
<EMAIL_ADDRESS>| Twitter/@mufeedvh | GitHub/@mufeedvh


The File 'TestConfig.txt'
This file contains all lines of Fabric7.ini. The file is used during start of the program to check whether Fabric7.ini is complete, and the lines are in the right order. Never touch this file!


Disney+ is now live in Australia and New Zealand: here’s how to sign up
by Stephen LambrechtsDisney+ is now live in Australia and New Zealand: here’s how to sign up
Start watching Disney+ right now
(Image credit: Disney Plus)
The wait is over – Disney+, the most highly-anticipated new streaming service of the year, has finally arrived in Australia and New Zealand, offering subscribers the ability to stream a huge library of movies and shows from Disney's vast catalogue.
Disney+ subscribers will gain exclusive access to both classic and original TV series and films from Disney's properties, including Disney, Pixar, Star Wars, Marvel and National Geographic and even 20th Century Fox.
- Star Wars on Disney+: every movie and TV show at launch and beyond
- Marvel on Disney+: every superhero movie and TV show
- Best Disney+ shows: what you should stream right now
If you want to stream the live-action Star Wars series The Mandalorian, or Marvel's upcoming original shows The Falcon and the Winter Soldier, Loki, Hawkeye and WandaVision, the only way to do so is with a Disney+ subscription.
Subscribers will also be able to access a massive back catalogue of animated shows, such as Saturday morning classics like DuckTales, Gargoyles and X-Men: The Animated Series, and even the first 29 seasons of The Simpsons, available to stream in its entirety in Australia and New Zealand for the first time ever.
How to sign up for Disney+ in Australia
In Australia, Disney+ has a free 7-day trial to begin with, after which the streaming service is available in two ways: a month-to-month subscription or a discounted yearly subscription.
Of course, if you're a mega Disney fan and are already convinced you will love Disney+, you could opt to pay for a full year upfront, at the discounted price of AU$89.99, which effectively grants you two free months of the service when compared to the monthly subscription over the same period.
How to sign up for Disney+ in New Zealand
Just like in Australia, Disney+ is being offered in New Zealand with two subscription options: a monthly subscription and a discounted yearly bundle. As above, these paid subscription options follow an initial free 7-day trial period.
For one month of Disney+, the price is NZ$9.99. As with all month-to-month subscriptions, it will automatically renew itself at the end of the month unless you cancel it.
If you want to save some money in the long run, a yearly subscription for NZ$99.99 is the way to go, as you will essentially get 12 months of Disney+ for the price of 10.


2. API Reference¶
2.1. Application¶
-
class
crocus.application.
Application
(loop=asyncio.get_event_loop(), handlers=RouteDict(), middlewares=[], **kwargs)¶ -
loop
¶ evento loop to be used
-
handlers
¶ Used to store route handlers.
-
middlewares
¶ Stores application middlewares.
-
config
¶ All values used in **kwargs will be stored in this property.
Usefull to store session keys, database objects, etc.
-
add_handler
(method, path, fn)¶ Adds a handler for a given http method and path.
-
use
(*args)¶ Adds async function(s) handlers as a middleware.
-
post
(path, fn)¶ Adds a post handler for a given path.
-
get
(path, fn)¶ Adds a get handler for a given path.
-
put
(path, fn)¶ Adds a put handler for a given path.
-
delete
(path, fn)¶ Adds a delete handler for a given path.
-
patch
(path, fn)¶ Adds a patch handler for a given path.
-
head
(path, fn)¶ Adds a head handler for a given path.
-
options
(path, fn)¶ Adds a options handler for a given path.
-
trace
(path, fn)¶ Adds a trace handler for a given path.
-
connect
(path, fn)¶ Adds a connect handler for a given path.
-
all
(path, fn)¶ Adds a handler for all http methods whithin given path.
-
run
(host='<IP_ADDRESS>', port=5000)¶ Runs the application in a given host and port.
-
2.2. Handlers¶
Every request handler is a python async function which uses two arguments: a request and a response.
async def handler(req, res):
data = await some_action(req.data)
res.status = 201 #default is 200
res.write(json.dumps(data))
await res.end()
2.3. Middlewares¶
Middlewares use the same async functions as handlers, but they are executed before the handler itself.
Middlewares are useful for changing or validating request data.You can also end a request in a middleware before it reaches the designated handler, in this case the middleware functions needs to return the “finish” method from the response object (otherwise the request will go on).
async def bodyparser(req, res):
try:
req.body = json.loads(req.body)
except except json.decoder.JSONDecodeError:
res.status = 400
res.write(json.dumps({'error': 'invalid json'}))
await res.end()
return res.finish() #mandatory if middleware needs to end the current request
2.4. Request¶
-
class
crocus.request.
Request
(method=None, path=None, headers={}, body=None, params={}, content_type=None, params=DynamicObject())¶ -
method
¶ request http method
-
path
¶ http request path (without query string)
-
headers
¶ http request headers in key:value format, it is not case sensitive whilte retrieving a header.
-
query
¶ url query string in a key:value (dict) format.
-
body
¶ request content body
-
content_type
¶ request body content-type (if any). default is application/octet-stream
-
params
¶ DynamicObject that stores dyanmic url parameters.
-
app
¶ A DynamicObject which stores the application config data
-
prepare
()¶ async method that prepares the request (parse headers, path, body, etc)
-
parse_headers
()¶ parses the http headers (called by prepare)
-
parse_path
()¶ parses the request path (route params, query string, etc)
-
2.5. Response¶
-
class
crocus.response.
Response
¶ -
status
¶ response http status code
-
header
(key, value=None, defaults=None)¶ HTTP response reader manipultion.
If only key is provided it return its value (returns the default value is not found).
It sets a header value if provided with a key and value.
-
write
(chunk)¶ writes a response content chunk
-
end
(chunk=None)¶ ends the request stream (option chunk can be provided).
-
finish
()¶ returns a finish code to notify the application that the middleware should end the request
-
2.6. Server¶
-
class
crocus.helpers.
Server
(handlers=RouteDict(), middlewares={}, config=DynamicObject())¶ Implementation of aiohttp.server.ServerHttpProtocol to handle event loop requests.
Config stores the application config data to be used in every request handler.
2.7. Helpers¶
-
class
crocus.helpers.
DynamicObject
(**kwargs)¶ An object that can store any property, returns None if the property does not exist.
-
from_json
(data)¶ creates a instance object from a json string
-
from_dict(data):
creates an instance object from a dictionary
-
-
class
crocus.helpers.
Dict
¶ A dictionary (collections.MutableMapping) used to store headers. It is case insensitive when retrieving values.
-
class
crocus.helpers.
RouteDict
¶ Implementation of collections.MutableMapping it stores the server routes and handlers.