Let's look at the RMagick equivalent of "Hello, world". This program reads an image file named "Cheetah.jpg" and displays1 it on your monitor
1. require "rmagick" 2. include Magick 3. 4. cat = ImageList.new("Cheetah.jpg") 5. cat.display 6. exit
MS Windows users note: The display method does not work on native MS Windows. You must use an external viewer to view the images you create.
Line 1 requires 2 the RMagick.rb file, which defines the Magick module. The Magick module contains 3 major classes, ImageList, Image, and Draw. This section - Basic Concepts - describes the ImageList and Image classes. The Draw class is explained in the Drawing on and adding text to images section, below.
The statement on line 5 creates an imagelist object and initializes it by reading the Cheetah.jpg
file in the current directory.
Line 6 sends the display
method to the object. When you send display
to an imagelist, it causes all the images in the imagelist
to be displayed on the default X Window screen. In this case, the display
method makes a picture of a cheetah appear on your monitor.
Type this program in and try running it now. The
Cheetah.jpg
file is in the ex/images
subdirectory where you installed the RMagick documentation.
The Image and ImageList classes are closely related. An Image object describes one image or one frame in an image with multiple frames. (An animated GIF or a Photoshop image with multiple layers are examples of images with multiple frames.) You can create a image object from an image file such as a GIF, PNG, or JPEG. You can create a image from scratch by specifying its dimensions. You can write an image to disk, display it on a screen, change its size or orientation, convert it to another format, or otherwise modify it using one of over 100 methods.
An ImageList object is a list of images. It contains zero or more images and a scene number. The scene number indicates the current image. The ImageList class includes methods that operate on all the images in the list. Also, with a very few exceptions, any method defined in the Image class can be used as well. Since Image methods always operate on a single image, when an Image method is sent to an imagelist, the ImageList class sends the method to the current image, that is, the image specified by the scene number.
The ImageList class is a subclass of the Array class, so you can use most Array methods to change the images in the imagelist. For example, you can use
the <<
method to add an image to the list.
Going back to the example, let's make one modification.
1. require "rmagick" 2. include Magick 3. 4. cat = ImageList.new("Cheetah.jpg") 5. smallcat = cat.minify 6. smallcat.display 7. exit
The difference is the statement on line 5. This statement sends the
minify
method to the imagelist. The minify
method is an Image method that reduces the size of an image to half its original
size. Remember, since minify
is an Image method, the ImageList class sends minify
to the current (and only) image. The return
value is a new image, half the size of the original.
Line 6 demonstrates the Image class's display
method, which displays a single image on the X Window screen.
Image#display
makes a picture of a (in this case, small) cheetah appear on your monitor.
Here's how to write the small cheetah to a file in GIF format.
1. require "rmagick" 2. include Magick 3. 4. cat = ImageList.new("Cheetah.jpg") 5. smallcat = cat.minify 6. smallcat.display 7. smallcat.write("Small-Cheetah.gif") 8. exit
The statement on line 7 writes the image to a file. Notice that the filename extension is gif
. When writing images, ImageMagick uses the
filename extension to determine what image format to write. In this example, the Small-Cheetah.gif
file will be in the GIF format. Notice how
easy it is to covert an image from one format to another? (For more details, see Image formats and filenames.)
So why, in the previous example, did I create cat
as an ImageList object containing just one image, instead of creating an Image object? No
reason, really. When you only have one image to deal with, imagelists and images are pretty much interchangeable.
Note: In most cases, an Image method does not modify the image to which it is sent. Instead, the method returns a new image, suitably
modified. For example, the resize
method returns a new image, sized as specified. The receiver image is
unaltered. (Following the Ruby convention, when a method alters the receiver object, the method name ends with "!". For example, the
resize!
method resizes the receiver in place.)
You've already seen that you can create an imagelist and initialize it by specifying the name of an image file as the argument to
ImageList.new
. In fact, new
can take any number of file name arguments. If the file contains a single image, new
reads the file, creates an
image, and adds it to the imagelist. If the file is a multi-frame image file, new
adds an image for each frame or layer in the file. Lastly,
new
changes the scene number to point to the last image in the imagelist. In the simple case, new
reads a single image from a
file and sets the scene number to 0.
You can also create an image from scratch by calling
Image.new
. This method takes 2 or 3 arguments. The first argument is the number of columns in the new image (its width). The second argument is the number of rows
(its height). If present, the 3rd argument is a Fill
object. To add a "scratch" image to an imagelist, call
ImageList#new_image
. This method calls Image.new
, adds the new image to the imagelist, and sets the scene number to point to the new image. Scratch images are
good for drawing on or creating images by compositing.
Like many other methods in the Image and ImageList classes,
Image.new
accepts an optional block that can be used to set additional optional parameters. If the block is present,
Image.new
creates a parameter object and yields to the block in the scope of that object. You set the parameters by
calling attribute setter methods defined in the parameter object's class. For example, you can set the background color of a new image to red with the
background_color=
method, as shown here:
require "rmagick" include Magick # Create a 100x100 red image. f = Image.new(100,100) { |options| options.background_color = "red" } f.display exit
Within the parameter block you must use self
so that Ruby knows that this statement is a method call, not an assignment to a variable.
You can create an image by capturing it from the XWindow screen using
Image.capture
. This method can capture the root window, a window identified by name or ID number, or perform an interactive capture whereby you designate the desired
window by clicking it or by drawing a rectangle on the screen with your mouse.
Both the Image class and the ImageList class have
write
methods. Both accept a single argument, the name of the file to be written.
Image#write
simply writes the image to a file. Like the Image#read
method,
write
yields to an optional block that you can use to set parameters that control how the image is written.
If an ImageList object contains only one image, then
ImageList#write
is the same as Image#write
. However, if the imagelist contains multiple images
and the file format (determined by the file name extension, as I mentioned earlier) supports multi-frame images, Image#write
will
automatically create a multi-frame image file.
For example, the following program reads three GIF files and then uses
ImageList#write
to combine all the images in those files (remember, each input file can contain multiple images) into one animated GIF file.
#!/usr/bin/env ruby -w require "rmagick" anim = ImageList.new("start.gif", "middle.gif", "finish.gif") anim.write("animated.gif") exit
RMagick defines 3 methods for displaying images and imagelists. Both the Image class and the ImageList class have a display
method. The
Image#display
method displays the image on the default X Window screen. For imagelists with just one image,
ImageList#display
is identical to Image#display
. However, if the imagelist contains multiple
images, ImageList#display
displays each of the images in turn. With both methods, right-clicking the display window will produce a menu of
other options.
The ImageList#animate
method repeatedly cycles through all the images in an imagelist, displaying each one
in turn. You can control the speed of the animation with the ImageList#delay=
method.
Once you've created an image or imagelist, what can you do with it? The Image and ImageList classes define over 100 methods for examining and modifying images, both individually and in groups. Remember, unless the ImageList class defines a method with the same name, you can send any method defined in the Image class to an instance of the ImageList class. The ImageList class sends the method to the current image and returns the result.
The methods can be classified into the following broad groups. ImageList method descriptions look like this. Some of the listed methods are not available in some releases of ImageMagick. See the method documentation for details.
ImageList, Image, Draw, and Pixel objects are marshaled using custom serialization methods. Images are marshaled with ImageMagick's Binary Large OBject
functions ImageToBlob
(for dumping) and BlobToImage
(for loading).
The Draw class is the third major class in the Magick module. This class defines two kinds of methods, drawing methods and annotation methods.
ImageMagick supports a set of 2D drawing commands that are very similar to the commands and elements defined by the W3C's
Scalable Vector Graphics (SVG) 1.1 Specification. In RMagick, each command (called a
primitive) is implemented as a method in the Draw
class. To draw on an image, simply
Draw
class.draw
method.
The primitive methods do not draw anything directly. When you call a primitive method, you are simply adding the primitive and its arguments to a
list of primitives stored in the Draw
object. To "execute" the primitive list, call draw
. Drawing the primitives does not
destroy them. You can draw on another image by calling draw
again, specifying a different image as the "canvas." Of course you can also draw
on an image with multiple Draw
objects, too. The canvas can be any image or imagelist, created by reading an image file or from scratch using
ImageList#new_image
or Image.new
. (If you pass an imagelist object to draw
, it draws on the current image.)
Here's an illustration of the default drawing coordinate system. The origin is in the top left corner. The x axis extends to the right. The y axis extends downward. The units are pixels. 0° is at 3 o'clock and rotation is clockwise. The units of rotation are usually degrees.3
You can change the default coordinate system by specifying a scaling, rotation, or translation transformation.
(Click the image to see the Ruby program that created it.)
RMagick's primitive methods include methods for drawing points, lines, Bezier curves, shapes such as ellipses and rectangles, and text. Shapes and lines have a fill color and a stroke color. Shapes are filled with the fill color unless the fill opacity is 0. Similarly, shapes are stroked with the stroke color unless the stroke opacity is 0. Text is considered a shape and is stroked and filled. Other rendering properties you can set include the stroke width, antialiasing, stroke patterns, and fill patterns.
As an example, here's the section of the Ruby program that created the circle in the center of the above image.
1. !# /usr/local/bin/ruby -w 2. require "rmagick" 3. 4. canvas = Magick::ImageList.new 5. canvas.new_image(250, 250, Magick::HatchFill.new('white', 'gray90')) 6. 7. circle = Magick::Draw.new 8. circle.stroke('tomato') 9. circle.fill_opacity(0) 10. circle.stroke_opacity(0.75) 11. circle.stroke_width(6) 12. circle.stroke_linecap('round') 13. circle.stroke_linejoin('round') 14. circle.ellipse(canvas.rows/2,canvas.columns/2, 80, 80, 0, 315) 15. circle.polyline(180,70, 173,78, 190,78, 191,62) 16. circle.draw(canvas)
The statements on lines 4 and 5 create the drawing canvas with a single 250x250 image. The HatchFill
object fills the image with light-gray
lines 10 pixels apart. The statement on line 7 creates a Draw object. The method calls on lines 8-15 construct a list of primitives that are "executed" by
the draw
method call on line 16.
The stroke
method sets the stroke color, as seen on line 8. Normally, shapes are filled (opacity = 1.0), but the call to
fill_opacity
on line 9 sets the opacity to 0, so the background will show through the circle. Similarly, the stroke lines are normally
opaque, but the tomato-colored stroke line in this example is made slightly transparent by the call to stroke_opacity
on line 10. The method
calls on lines 11 through 13 set the stroke width and specify the appearance of the line ends and corners.
The ellipse
method call on line 14 describes an circle in the center of the canvas with a radius of 80 pixels. The ellipse occupies 315°
of a circle, starting at 0° (that is, 3 o'clock). The polyline
call on line 15 adds the arrowhead to the circle. The arguments (always an
even number) are the x- and y-coordinates of the points the line passes through.
Finally, the draw
method on line 16 identifies the canvas to be drawn on and executes the stored primitives.
The annotate
method draws text on an image. In its simplest form,
annotate
requires only arguments that describe where to draw the text and the text string.
Most of the time, you'll want to specify text properties such as the font, its size, font styles such as italic, font weights such as bold, the fill and
stroke color, etc. The Draw class defines
attribute writers for this purpose. You can set the desired text properties by calling the attribute writers before calling
annotate
, or you can call them in an image block associated with the annotate
call.
The following example shows how to use annotate
to produce this image.
1. #! /usr/local/bin/ruby -w 2. require "rmagick" 3. 4. # Demonstrate the annotate method 5. 6. Text = 'RMagick' 7. 8. granite = Magick::ImageList.new('granite:') 9. canvas = Magick::ImageList.new 10. canvas.new_image(300, 100, Magick::TextureFill.new(granite)) 11. 12. text = Magick::Draw.new 13. text.font_family = 'helvetica' 14. text.pointsize = 52 15. text.gravity = Magick::CenterGravity 16. 17. text.annotate(canvas, 0,0,2,2, Text) { |options| 18. options.fill = 'gray83' 19. } 20. 21. text.annotate(canvas, 0,0,-1.5,-1.5, Text) { |options| 22. options.fill = 'gray40' 23. } 24. 25. text.annotate(canvas, 0,0,0,0, Text) { |options| 26. options.fill = 'darkred' 27. } 28. 29. canvas.write('rubyname.gif') 30. exit
This program uses three calls to annotate
to produce the "etched" appearance. All three calls have some parameters in common but the fill
color and location are different.
First, the statements in lines 8-10 create the background. See
Fill classes
for information about the TextureFill
class. The "granite:" image format is one of
ImageMagick's built-in image formats. See "Built-in image formats" for more information. The statement on line
12 creates the Draw object that does the annotation. The next 3 lines set the values of the attributes that are common to all 3
annotate
calls.
The first annotate
argument is the image on which the text will be drawn. Arguments 2-5, width
, height
,
x
, and y
, describe a rectangle about which the text is drawn. This rectangle, combined with the value of gravity
,
define the position of the text. When the gravity
value is CenterGravity
the values of
width
and height
are unused.
The first call to annotate
, on lines 17-19, draws the text 2 pixels to the right and down from the center. The
options.fill = 'gray83'
statement sets the text color to light gray. The second call to annotate
, on lines 21-22, draws dark
gray text 1.5 pixels to the left and up from the center. The last call, on lines 25-27, draws the text a third time, in dark red, exactly in the center of
the image.
The next section, "ImageMagick Conventions," describes some conventions that you need to know, such as how ImageMagick determines the graphic format of an image file, etc. The ImageMagick (www.imagemagick.org) web site (from which much of the information in these pages has been taken) offers a lot of detail about ImageMagick. While this web sites doesn't describe RMagick, you can often use the documentation to learn more about a RMagick method by reading about the Magick API the method calls. (In the Reference section of this document, most of the method descriptions include the name of the Magick API that the method calls.) Check out the example programs. Almost every one of the methods is demonstrated in one of the examples.
Good luck!
1The display
and animate
methods do not work on MS Windows. You will have to write the image to a
file and view it with a separate image viewer.
2If you installed RMagick using Rubygems you must set up the RubyGems environment before using RMagick. You can do one of
require 'rubygems'
statement to your programrubygems
to the RUBYOPT environment variable
3The rotation attributes rx
and ry
in the
AffineMatrix
class use radians instead of degrees.


This section of the manual explains in detail how to add an Editize field to a form on an ASP-equipped Web site.
Upgrading?
For information on updating an existing Editize installation to a new release, see below.
Before integrating Editize into your Content Management System (CMS), you should first install it on your Web server and try out one or more of the sample scripts. Once you have verified that the samples work, you can proceed to use Editize anywhere you like on your site.
Your first step should be to copy or upload the contents of the asp
folder of the Editize distribution to a folder on your Web server.
If you use your own computer as a Web server for development purposes, copy
the files in the asp
folder to a folder in your Web root.
 A file in this directory should be accessible with a URL such ashttp://www.yoursite.com/editize/filename
. Upload all of the files in theasp
folder of the Editize distributon to this new folder on your Website.Example 2: Installing on your local test server
If you use Microsoft Internet Information Server (IIS) as a Web server on your Windows computer, the Web root folder isC:\Inetpub\wwwroot
by default. If you use Apache, the Web root folder isC:\Apache\htdocs
by default. Crate a new folder callededitize
in your Web root folder. Copy all of the files in theasp
folder of the Editize distribution to this new folder on your Website.
The folder where you place the Editize files on your server must not be password protected. None of these files is a security risk, so you don't need to worry about them being publically accessible.
Here's a list of the files in the asp
folder with an explanation
of what each one does:
editize.jar |
The Editize Java library file. This contains the Editize applet. |
editize.wsc |
The Editize API for ASP. This Windows Script Component will generate the HTML and JavaScript code neccessary to display the Editize applet on almost any browser or operating system. |
kunststoff.jar |
The Kunststoff Look & Feel. Improves the look of the Editize user interface dramatically, but adds 43KB of Java files for users' browsers to download the first time they visit your site. If you delete this file, Editize will simply run without any visual enhancements, and will load quicker over slow modem connections. |
osx.html |
A small Web page containing JavaScript that Editize uses automatically to behave like a form field on Internet Explorer for Mac OS X. |
Default.asp * |
A sample ASP script written in VBScript that demonstrates how to create Editize form fields compatible with most browsers. |
Default-jscript.asp * |
A sample ASP script written in JScript that demonstrates how to create Editize form fields compatible with most browsers. |
* Files marked with an asterix are sample scripts only, and are not required for Editize to function on your server.
The Editize folder on your server contains a few sample scripts for you to try out. Each of these scripts contains a form with an Editize field in it. When you submit the form, the script should display the HTML document you created in Editize, and allow you to load it back into the original form to edit further.
Open your Web browser and type the URL to load the Default.asp
script in the Editize folder on your Web server into the address
field.
Example 1: Running the sample on your Web Host
If your Web site is hosted by a Web hosting company, the Editize files should now be in a folder in the root of your Web site (e.g.http://www.yoursite.com/editize/
). To load theDefault.asp
sample script, typehttp://www.yoursite.com/editize/Default.asp
into your browser's address field.Example 2: Running the sample on your local test server
If you've placed the Editize files in a folder on your local test server, you should be able to run theDefault.asp
test script by simply typinghttp://localhost/editize/Default.asp
into your browser's address field.
Have a play with the sample form, submit a document, and then re-open it for editing. If you run into any problems, see the Troubleshooting section of this manual. Otherwise, you're good to go!
To slightly simplify the code in your ASP pages and improve performance of the Editize API for ASP, you can register the Windows Script Component on your server. You can only do this if you have direct access to the server, or if your Web host is willing to do it for you.
Complete the following steps (or ask your Web host to complete them for you) to register the Windows Script Component in Windows on your Web server:
editize.wsc
file (found in the asp
directory of this distribution) to a convenient folder on the server computer.
The SYSTEM32
subfolder of the Windows folder (e.g. C:\WINNT\SYSTEM32
)
is a common choice, but you can put it elsewhere if you prefer. Please
note: the file may not reside on a network drive.
The Editize API for ASP is now registered as a Windows Script Component
on your server computer. Should you wish to unregister it at a later date,
simply right-click the file and choose Unregister, and then delete the editize.wsc
file.
If you have any trouble registering the component, please refer to the Troubleshooting section of this manual.
You can now add Editize fields to any form on your site.
As mentioned above, Editize is designed as a drop-in replacement for the HTML <textarea> tag. We will therefore explain how to use it by comparing it with that tag.
Here is a typical HTML form containing a <textarea> tag:
<form action="..." method="post"> <textarea name="example"> This is the document that the textarea will contain initially. </textarea> <input type="submit" value="Submit" /> </form>
The ASP API for Editize is designed so that you can simply replace
the <textarea>
tag with some brief code to put an Editize
field in its place.
To quickly obtain the code to add an Editize to a form in your Web site, use the Code Generator to generate it automatically. Alternatively, read on to learn how to write the code yourself.
Here is an example of the simplest means to invoke Editize as a form field:
<form action="..." method="post"> <% Dim ed Set ed = Server.CreateObject("Editize.aspapi") ed.name = "example" Response.Write ed.DisplayContent("
This is the document that Editize will edit.
") %> <input type="submit" value="Submit" /> </form>
The Server.CreateObject
line in the above will only work if
the Editize Windows Script Component is registered on your Web server (see
Component Registration above). If you are
unable or unwilling to register the component, you can use the following slightly
less efficient syntax:
<form action="..." method="post"> <% Dim ed Set ed = GetObject("script:" & Server.MapPath("editize.wsc")) ed.name = "example" Response.Write ed.DisplayContent("
This is the document that Editize will edit.
") %> <input type="submit" value="Submit" /> </form>
Similarly, in an ASP page set to use JScript as the scripting language:
<form action="..." method="post"> <% var ed = Server.CreateObject("Editize.aspapi"); ed.name = "example"; Response.Write(ed.DisplayContent("
This is the document that Editize will edit.
")); %> <input type="submit" value="Submit" /> </form>
Or with an unregistered component file:
<form action="..." method="post"> <% var ed = GetObject("script:" + Server.MapPath("editize.wsc")); ed.name = "example"; Response.Write(ed.DisplayContent("
This is the document that Editize will edit.
")); %> <input type="submit" value="Submit" /> </form>
The meaning of the 4 lines of VBScript (or 3 lines of JScript) should be
fairly apparent to experienced ASP developers. The first line or two creates
an Editize.aspapi
object, which will do all the work of generating
the HTML and JavaScript code to display the Editize applet as a form
field.
The next line sets the name
property of the object, which is
equivalent to the name
attribute of a <textarea>
tag. You should always specify a field name in this way when you use Editize,
although if you don't a default of editize
will be used.
Finally, the last line displays the Editize field; that is, it
outputs all of the HTML and JavaScript code to place the Editize
field in the page at that point. In this example, we have passed the initial
document to be displayed (the equivalent of the contents of the <textarea>
tag) to the DisplayContent
method. Alternatively, the Display
method, which takes no arguments, can be used to display Editize
with a blank document.
The Editize applet is very configurable. You can customize the formatting applied by the various styles and tools available, and even specify that certain features should be disabled entirely if they are not appropriate for your environment.
By default, the Editize API for ASP enables all of Editize's formatting tools with default format settings. This section demonstrates how to use the properties supported by the Editize API for ASP to modify these defaults.
To set the values of properties, simply specify them as you did for the name
attribute in the simple example above. For instance, to create an Editize
field with a base font of 12-pixel Verdana, you would use the following VBScript
code (or the equivalent JScript):
<form action="..." method="post"> <% Dim ed Set ed = Server.CreateObject("Editize.aspapi") ed.name = "example" ed.basefontface = "Verdana" ' SETS THE FONT FACE ed.basefontsize = 12 ' SETS THE FONT SIZE Response.Write ed.DisplayContent( "
" & _ "This is the document that Editize will edit.
") ?> <input type="submit" value="Submit" /> </form>
Note that you have to set all the properties you want before you call the
Display
or DisplayContent
methods.
A list of all supported properties with examples for each is provided in the Reference section of this manual, or you can use the Code Generator to select all the properties you want from a list and have the code generated for you automatically.
By default, the Insert Image tool in Editize will prompt the user for the URL of the image he or she wishes to insert. Since it can be fairly tedious to hand-type the URL for every image, Editize also provides a method to specify a list of images that users may quickly choose from.
The imglisturl
property lets you set a URL from which Editize
will download a list of images to present it to the user in the Insert
Image dialog. The given URL may refer to a server-side script (e.g. to provide
an up-to-date list of images stored in a content management system). If a
static list of images is all that you need, you can simply point Editize
to a text file of the required format residing on your server.
The documentation for imglisturl
in the Reference section of this manual explains
the required format of the image list. A sample script written in PHP called
imglist.php
that produces a list of all the images in a given
directory and its subdirectories is provided in the php
folder
of this distribution.
The following browsers do not support the standard for JavaScript-to-Java communication, upon which Editize relies:
Editize therefore uses an alternative submission method on these browsers. As a side effect, when the form is submitted using an HTML submit button (<input type="submit">
), that submit button's value is not submitted to the server for processing along with the rest of the form data.
To make HTML submit buttons submit correctly in all supported browsers, you must include the following VBScript code immediately after the closing </form>
tag for the form that contains your Editize field(s):
<% Response.Write ed.EndForm() %>
Here's the JScript equivalent:
<% Response.Write(ed.EndForm()); %>
The EndForm
method of the Editize API shown here outputs some additional HTML and JavaScript code that makes HTML submit buttons work correctly alongside the Editize fields in your form. This code must occur in the page after your form, which is why it must be output separately using this method.
On top of this, Netscape 4.x by default is not supported by the Editize API for ASP, as it contains bugs that prevent this alternative submission method from working properly. By default, Editize fields will be displayed as standard <textarea>
fields in Netscape 4.x.
To run Editize in Netscape 4.x, you need to use the endForm
method as described above, and you must additionally set the ns4support
property of your Editize field(s) to true
:
ed.ns4support = true
Remember, although the call to endForm
goes after your closing </form>
tag, you must set the ns4support
property along with your other Editize field properties before calling Display
or DisplayContent
.
The default.asp and default-jscript.asp sample scripts included in the asp
folder of this archive use the above techniques to provide maximum browser compatibility.
Refer to the documentation for endForm
and ns4support
in the Reference section of this manual for further details.
In most cases, all you need to do to upgrade to a new release of Editize is to upload the new versions of editize.jar
, editize.wsc
, osx.html
, and optionally kunststoff.jar
over the old versions already on your server. It is very important that you replace all of these files, as changes made to one in a particular release often rely on changes made to another.
Occasionally, we add new features to Editize. Very occasionally, we change the way the APIs work. In both of these cases, you may need to make some changes to the page(s) on your site(s) that use Editize to make the new version work the way you expect it to. Always read the Revision History for the new release to find out when such changes are made.


{{/*
Show a menu-bar on the top of a page (including list-page)
It shows toplevel sections as menu in the menu-bar,
and 2nd-level sections as pulldonw menu-items.
The href of each menu-item is its first-page.
*/}}
{{range .Site.Sections }}
{{ if .Sections }}
{{.Title}}
{{ range .Sections.ByTitle }}
{{ partial "href-first-page.html" . }}
{{ end }}


Real Time Path: CARNOT/Toolbox
Purpose This functions puts out the system time in seconds. Output 0 s means January, 1st 0:00
Outputs:


Hong Kong gov’t tears down city’s largest ‘Lennon Wall’ in Tai Po
by Kris ChengHong Kong’s government has torn down the city’s largest pro-democracy “Lennon Wall” outside the Tai Po Market MTR station.
Message boards made up of Post-It notes and other messages have appeared across Hong Kong since large scale protests began more than five months ago. The biggest one in Tai Po stretched across a vast underground tunnel network.
Government cleaners were on Friday sent to peel the messages from the tunnel walls. The workers were accompanied by several police officers.
By 12pm, most posters had been removed.
A resident told RTHK that he had learned a lot about the protest movement from the message boards.
“I am quite disappointed that they are being removed. We have lost a place where we can reflect and remember what has happened in the past [few months],” he said.
Another resident said some of the slogans were inappropriate because they contained expletives. “It’s not so good to have curse words in front of people’s families,” she said.
A third resident said it would be better to have a place for people to express their opinion.
“The cleaning action made it even uglier,” she said. “Political issues should be resolved politically. The government should reflect on what it has done, including police brutality. [Chief Executive] Carrie Lam should also think about the evil deeds she has done.”
Hong Kong has seen over 25 weeks of unrest sparked by a now-withdrawn extradition agreement proposal with mainland China. The movement has evolved into wider calls for democratic reform and police accountability, as well as other demands.
Hong Kong Free Press relies on direct reader support. Help safeguard independent journalism and press freedom as we invest more in freelancers, overtime, safety gear & insurance during this summer’s protests. 10 ways to support us.


Write down your joke giving it a fun and descriptive title.Increase your joke's effectiveness! Use punctuation and line breaks to give it rythm and readability.


Submit
Reset
View Data
AUTO
Start Position
Side
Middle
AUTO Crossed Line
AUTO Scale Block
AUTO Switch Blocks
TELEOP
Scale Blocks
Allied Switch Blocks
Opponent Switch Blocks
Vault Blocks
Parked?
Climbed?
No
Attempted
Yes


armorattachedweapon.lua
--[[ For this example, we will be modifying the Environmental Armour to include an attached weapon; in this case, the Gauss Rifle. The rifle should be automatically equipped and unequipped when the corresponding armor is put on or taken off, and should not be otherwise removable from the character. --]] -- Hook OnEquip to add the weapon to slot 1 (right hand) function OnEquip(equipper, item, slot) -- Is this an environmental armour? if item:GetInternalName() == "bosEnviro" and slot == EQUIP_SLOT_ARMOR then -- Yes, make a weapon entity and equip it local newent = world:CreateEntity("entities/weapons/Rifles/gaussRifle.ent",EQUIP_SLOT_RIGHT) local prevequip,errstr = equipper:EquipItem(newent, EQUIP_SLOT_RIGHT) if errstr ~= nil then -- We failed to equip: This means we got back the entity we tried to -- equip, so just drop it prevequip:Destruct() else -- Succeeded on equipping. This means we may have gotten back the -- character's previously equipped item. Put it in the inventory -- if we got something that isn't the null entity. if prevequip.ClassType ~= "Entity" then equipper:AddToInventory(prevequip) end end end end -- Hook OnUnequip to remove the weapon from slot 1 and destruct it function OnUnequip(equipper, item, slot) -- Is this an environmental armour? if item:GetInternalName() == "bosEnviro" and slot == EQUIP_SLOT_ARMOR then -- Yes, unequip the added item and destruct it -- Not destructing the entity will leak resources local removedent = equipper:UnequipItem(EQUIP_SLOT_RIGHT) removedent:Destruct() end end -- Hook OnCheckUnequip to disallow removal of the weapon when armor is equipped -- Note that this code doesn't work perfectly if the item exists independently -- of the armor; specifically, if the character already has that weapon equipped -- in slot 1, and tries to equip the armor, it will fail. function OnCheckUnequip(equipper, item, slot) -- Is this a gauss rifle in slot 1? if item:GetInternalName() == "gaussRifle" and slot == EQUIP_SLOT_RIGHT then -- Is character wearing environmental armour? if equipper:GetEquippedItem(EQUIP_SLOT_ARMOR):GetInternalName() == "bosEnviro" then -- Yes, disallow the operation return "cannotRemove" end end return end


import RootState from "ember-data/system/model/states";
import Errors from "ember-data/system/model/errors";
import { PromiseObject } from "ember-data/system/promise_proxies";
import { createRelationshipFor } from "ember-data/system/relationships/relationship";
/**
@module ember-data
*/
var get = Ember.get;
var set = Ember.set;
var merge = Ember.merge;
var Promise = Ember.RSVP.Promise;
var forEach = Ember.ArrayPolyfills.forEach;
var map = Ember.ArrayPolyfills.map;
var JSONSerializer;
var retrieveFromCurrentState = Ember.computed('currentState', function(key, value) {
return get(get(this, 'currentState'), key);
}).readOnly();
var _extractPivotNameCache = Object.create(null);
var _splitOnDotCache = Object.create(null);
function splitOnDot(name) {
return _splitOnDotCache[name] || (
_splitOnDotCache[name] = name.split('.')
);
}
function extractPivotName(name) {
return _extractPivotNameCache[name] || (
_extractPivotNameCache[name] = splitOnDot(name)[0]
);
}
/**
The model class that all Ember Data records descend from.
@class Model
@namespace DS
@extends Ember.Object
@uses Ember.Evented
*/
var Model = Ember.Object.extend(Ember.Evented, {
_recordArrays: undefined,
_relationships: undefined,
_loadingRecordArrays: undefined,
/**
If this property is `true` the record is in the `empty`
state. Empty is the first state all records enter after they have
been created. Most records created by the store will quickly
transition to the `loading` state if data needs to be fetched from
the server or the `created` state if the record is created on the
client. A record can also enter the empty state if the adapter is
unable to locate the record.
@property isEmpty
@type {Boolean}
@readOnly
*/
isEmpty: retrieveFromCurrentState,
/**
If this property is `true` the record is in the `loading` state. A
record enters this state when the store asks the adapter for its
data. It remains in this state until the adapter provides the
requested data.
@property isLoading
@type {Boolean}
@readOnly
*/
isLoading: retrieveFromCurrentState,
/**
If this property is `true` the record is in the `loaded` state. A
record enters this state when its data is populated. Most of a
record's lifecycle is spent inside substates of the `loaded`
state.
Example
```javascript
var record = store.createRecord('model');
record.get('isLoaded'); // true
store.find('model', 1).then(function(model) {
model.get('isLoaded'); // true
});
```
@property isLoaded
@type {Boolean}
@readOnly
*/
isLoaded: retrieveFromCurrentState,
/**
If this property is `true` the record is in the `dirty` state. The
record has local changes that have not yet been saved by the
adapter. This includes records that have been created (but not yet
saved) or deleted.
Example
```javascript
var record = store.createRecord('model');
record.get('isDirty'); // true
store.find('model', 1).then(function(model) {
model.get('isDirty'); // false
model.set('foo', 'some value');
model.get('isDirty'); // true
});
```
@property isDirty
@type {Boolean}
@readOnly
*/
isDirty: retrieveFromCurrentState,
/**
If this property is `true` the record is in the `saving` state. A
record enters the saving state when `save` is called, but the
adapter has not yet acknowledged that the changes have been
persisted to the backend.
Example
```javascript
var record = store.createRecord('model');
record.get('isSaving'); // false
var promise = record.save();
record.get('isSaving'); // true
promise.then(function() {
record.get('isSaving'); // false
});
```
@property isSaving
@type {Boolean}
@readOnly
*/
isSaving: retrieveFromCurrentState,
/**
If this property is `true` the record is in the `deleted` state
and has been marked for deletion. When `isDeleted` is true and
`isDirty` is true, the record is deleted locally but the deletion
was not yet persisted. When `isSaving` is true, the change is
in-flight. When both `isDirty` and `isSaving` are false, the
change has persisted.
Example
```javascript
var record = store.createRecord('model');
record.get('isDeleted'); // false
record.deleteRecord();
// Locally deleted
record.get('isDeleted'); // true
record.get('isDirty'); // true
record.get('isSaving'); // false
// Persisting the deletion
var promise = record.save();
record.get('isDeleted'); // true
record.get('isSaving'); // true
// Deletion Persisted
promise.then(function() {
record.get('isDeleted'); // true
record.get('isSaving'); // false
record.get('isDirty'); // false
});
```
@property isDeleted
@type {Boolean}
@readOnly
*/
isDeleted: retrieveFromCurrentState,
/**
If this property is `true` the record is in the `new` state. A
record will be in the `new` state when it has been created on the
client and the adapter has not yet report that it was successfully
saved.
Example
```javascript
var record = store.createRecord('model');
record.get('isNew'); // true
record.save().then(function(model) {
model.get('isNew'); // false
});
```
@property isNew
@type {Boolean}
@readOnly
*/
isNew: retrieveFromCurrentState,
/**
If this property is `true` the record is in the `valid` state.
A record will be in the `valid` state when the adapter did not report any
server-side validation failures.
@property isValid
@type {Boolean}
@readOnly
*/
isValid: retrieveFromCurrentState,
/**
If the record is in the dirty state this property will report what
kind of change has caused it to move into the dirty
state. Possible values are:
- `created` The record has been created by the client and not yet saved to the adapter.
- `updated` The record has been updated by the client and not yet saved to the adapter.
- `deleted` The record has been deleted by the client and not yet saved to the adapter.
Example
```javascript
var record = store.createRecord('model');
record.get('dirtyType'); // 'created'
```
@property dirtyType
@type {String}
@readOnly
*/
dirtyType: retrieveFromCurrentState,
/**
If `true` the adapter reported that it was unable to save local
changes to the backend for any reason other than a server-side
validation error.
Example
```javascript
record.get('isError'); // false
record.set('foo', 'valid value');
record.save().then(null, function() {
record.get('isError'); // true
});
```
@property isError
@type {Boolean}
@readOnly
*/
isError: false,
/**
If `true` the store is attempting to reload the record form the adapter.
Example
```javascript
record.get('isReloading'); // false
record.reload();
record.get('isReloading'); // true
```
@property isReloading
@type {Boolean}
@readOnly
*/
isReloading: false,
/**
The `clientId` property is a transient numerical identifier
generated at runtime by the data store. It is important
primarily because newly created objects may not yet have an
externally generated id.
@property clientId
@private
@type {Number|String}
*/
clientId: null,
/**
All ember models have an id property. This is an identifier
managed by an external source. These are always coerced to be
strings before being used internally. Note when declaring the
attributes for a model it is an error to declare an id
attribute.
```javascript
var record = store.createRecord('model');
record.get('id'); // null
store.find('model', 1).then(function(model) {
model.get('id'); // '1'
});
```
@property id
@type {String}
*/
id: null,
/**
@property currentState
@private
@type {Object}
*/
currentState: RootState.empty,
/**
When the record is in the `invalid` state this object will contain
any errors returned by the adapter. When present the errors hash
typically contains keys corresponding to the invalid property names
and values which are an array of error messages.
```javascript
record.get('errors.length'); // 0
record.set('foo', 'invalid value');
record.save().then(null, function() {
record.get('errors').get('foo'); // ['foo should be a number.']
});
```
@property errors
@type {DS.Errors}
*/
errors: Ember.computed(function() {
var errors = Errors.create();
errors.registerHandlers(this, function() {
this.send('becameInvalid');
}, function() {
this.send('becameValid');
});
return errors;
}).readOnly(),
/**
Create a JSON representation of the record, using the serialization
strategy of the store's adapter.
`serialize` takes an optional hash as a parameter, currently
supported options are:
- `includeId`: `true` if the record's ID should be included in the
JSON representation.
@method serialize
@param {Object} options
@return {Object} an object whose values are primitive JSON values only
*/
serialize: function(options) {
var store = get(this, 'store');
return store.serialize(this, options);
},
/**
Use [DS.JSONSerializer](DS.JSONSerializer.html) to
get the JSON representation of a record.
`toJSON` takes an optional hash as a parameter, currently
supported options are:
- `includeId`: `true` if the record's ID should be included in the
JSON representation.
@method toJSON
@param {Object} options
@return {Object} A JSON representation of the object.
*/
toJSON: function(options) {
if (!JSONSerializer) { JSONSerializer = requireModule("ember-data/serializers/json_serializer")["default"]; }
// container is for lazy transform lookups
var serializer = JSONSerializer.create({ container: this.container });
return serializer.serialize(this, options);
},
/**
Fired when the record is loaded from the server.
@event didLoad
*/
didLoad: Ember.K,
/**
Fired when the record is updated.
@event didUpdate
*/
didUpdate: Ember.K,
/**
Fired when the record is created.
@event didCreate
*/
didCreate: Ember.K,
/**
Fired when the record is deleted.
@event didDelete
*/
didDelete: Ember.K,
/**
Fired when the record becomes invalid.
@event becameInvalid
*/
becameInvalid: Ember.K,
/**
Fired when the record enters the error state.
@event becameError
*/
becameError: Ember.K,
/**
@property data
@private
@type {Object}
*/
data: Ember.computed(function() {
this._data = this._data || {};
return this._data;
}).readOnly(),
_data: null,
init: function() {
this._super();
this._setup();
},
_setup: function() {
this._changesToSync = {};
this._deferredTriggers = [];
this._data = {};
this._attributes = {};
this._inFlightAttributes = {};
this._relationships = {};
/*
implicit relationships are relationship which have not been declared but the inverse side exists on
another record somewhere
For example if there was
```
App.Comment = DS.Model.extend({
name: DS.attr()
})
```
but there is also
```
App.Post = DS.Model.extend({
name: DS.attr(),
comments: DS.hasMany('comment')
})
```
would have a implicit post relationship in order to be do things like remove ourselves from the post
when we are deleted
*/
this._implicitRelationships = Object.create(null);
var model = this;
//TODO Move into a getter for better perf
this.constructor.eachRelationship(function(key, descriptor) {
model._relationships[key] = createRelationshipFor(model, descriptor, model.store);
});
},
/**
@method send
@private
@param {String} name
@param {Object} context
*/
send: function(name, context) {
var currentState = get(this, 'currentState');
if (!currentState[name]) {
this._unhandledEvent(currentState, name, context);
}
return currentState[name](this, context);
},
/**
@method transitionTo
@private
@param {String} name
*/
transitionTo: function(name) {
// POSSIBLE TODO: Remove this code and replace with
// always having direct references to state objects
var pivotName = extractPivotName(name);
var currentState = get(this, 'currentState');
var state = currentState;
do {
if (state.exit) { state.exit(this); }
state = state.parentState;
} while (!state.hasOwnProperty(pivotName));
var path = splitOnDot(name);
var setups = [], enters = [], i, l;
for (i=0, l=path.length; i<l; i++) {
state = state[path[i]];
if (state.enter) { enters.push(state); }
if (state.setup) { setups.push(state); }
}
for (i=0, l=enters.length; i<l; i++) {
enters[i].enter(this);
}
set(this, 'currentState', state);
for (i=0, l=setups.length; i<l; i++) {
setups[i].setup(this);
}
this.updateRecordArraysLater();
},
_unhandledEvent: function(state, name, context) {
var errorMessage = "Attempted to handle event `" + name + "` ";
errorMessage += "on " + String(this) + " while in state ";
errorMessage += state.stateName + ". ";
if (context !== undefined) {
errorMessage += "Called with " + Ember.inspect(context) + ".";
}
throw new Ember.Error(errorMessage);
},
withTransaction: function(fn) {
var transaction = get(this, 'transaction');
if (transaction) { fn(transaction); }
},
/**
@method loadingData
@private
@param {Promise} promise
*/
loadingData: function(promise) {
this.send('loadingData', promise);
},
/**
@method loadedData
@private
*/
loadedData: function() {
this.send('loadedData');
},
/**
@method notFound
@private
*/
notFound: function() {
this.send('notFound');
},
/**
@method pushedData
@private
*/
pushedData: function() {
this.send('pushedData');
},
/**
Marks the record as deleted but does not save it. You must call
`save` afterwards if you want to persist it. You might use this
method if you want to allow the user to still `rollback()` a
delete after it was made.
Example
```javascript
App.ModelDeleteRoute = Ember.Route.extend({
actions: {
softDelete: function() {
this.controller.get('model').deleteRecord();
},
confirm: function() {
this.controller.get('model').save();
},
undo: function() {
this.controller.get('model').rollback();
}
}
});
```
@method deleteRecord
*/
deleteRecord: function() {
this.send('deleteRecord');
},
/**
Same as `deleteRecord`, but saves the record immediately.
Example
```javascript
App.ModelDeleteRoute = Ember.Route.extend({
actions: {
delete: function() {
var controller = this.controller;
controller.get('model').destroyRecord().then(function() {
controller.transitionToRoute('model.index');
});
}
}
});
```
@method destroyRecord
@return {Promise} a promise that will be resolved when the adapter returns
successfully or rejected if the adapter returns with an error.
*/
destroyRecord: function() {
this.deleteRecord();
return this.save();
},
/**
@method unloadRecord
@private
*/
unloadRecord: function() {
if (this.isDestroyed) { return; }
this.send('unloadRecord');
},
/**
@method clearRelationships
@private
*/
clearRelationships: function() {
this.eachRelationship(function(name, relationship) {
var rel = this._relationships[name];
if (rel){
//TODO(Igor) figure out whether we want to clear or disconnect
rel.clear();
rel.destroy();
}
}, this);
},
disconnectRelationships: function() {
this.eachRelationship(function(name, relationship) {
this._relationships[name].disconnect();
}, this);
var model = this;
forEach.call(Ember.keys(this._implicitRelationships), function(key) {
model._implicitRelationships[key].disconnect();
});
},
reconnectRelationships: function() {
this.eachRelationship(function(name, relationship) {
this._relationships[name].reconnect();
}, this);
var model = this;
forEach.call(Ember.keys(this._implicitRelationships), function(key) {
model._implicitRelationships[key].reconnect();
});
},
/**
@method updateRecordArrays
@private
*/
updateRecordArrays: function() {
this._updatingRecordArraysLater = false;
get(this, 'store').dataWasUpdated(this.constructor, this);
},
/**
When a find request is triggered on the store, the user can optionally pass in
attributes and relationships to be preloaded. These are meant to behave as if they
came back from the server, except the user obtained them out of band and is informing
the store of their existence. The most common use case is for supporting client side
nested URLs, such as `/posts/1/comments/2` so the user can do
`store.find('comment', 2, {post:1})` without having to fetch the post.
Preloaded data can be attributes and relationships passed in either as IDs or as actual
models.
@method _preloadData
@private
@param {Object} preload
*/
_preloadData: function(preload) {
var record = this;
//TODO(Igor) consider the polymorphic case
forEach.call(Ember.keys(preload), function(key) {
var preloadValue = get(preload, key);
var relationshipMeta = record.constructor.metaForProperty(key);
if (relationshipMeta.isRelationship) {
record._preloadRelationship(key, preloadValue);
} else {
get(record, '_data')[key] = preloadValue;
}
});
},
_preloadRelationship: function(key, preloadValue) {
var relationshipMeta = this.constructor.metaForProperty(key);
var type = relationshipMeta.type;
if (relationshipMeta.kind === 'hasMany'){
this._preloadHasMany(key, preloadValue, type);
} else {
this._preloadBelongsTo(key, preloadValue, type);
}
},
_preloadHasMany: function(key, preloadValue, type) {
Ember.assert("You need to pass in an array to set a hasMany property on a record", Ember.isArray(preloadValue));
var record = this;
var recordsToSet = map.call(preloadValue, function(recordToPush) {
return record._convertStringOrNumberIntoRecord(recordToPush, type);
});
//We use the pathway of setting the hasMany as if it came from the adapter
//because the user told us that they know this relationships exists already
this._relationships[key].updateRecordsFromAdapter(recordsToSet);
},
_preloadBelongsTo: function(key, preloadValue, type){
var recordToSet = this._convertStringOrNumberIntoRecord(preloadValue, type);
//We use the pathway of setting the hasMany as if it came from the adapter
//because the user told us that they know this relationships exists already
this._relationships[key].setRecord(recordToSet);
},
_convertStringOrNumberIntoRecord: function(value, type) {
if (Ember.typeOf(value) === 'string' || Ember.typeOf(value) === 'number'){
return this.store.recordForId(type, value);
}
return value;
},
/**
Returns an object, whose keys are changed properties, and value is
an [oldProp, newProp] array.
Example
```javascript
App.Mascot = DS.Model.extend({
name: attr('string')
});
var person = store.createRecord('person');
person.changedAttributes(); // {}
person.set('name', 'Tomster');
person.changedAttributes(); // {name: [undefined, 'Tomster']}
```
@method changedAttributes
@return {Object} an object, whose keys are changed properties,
and value is an [oldProp, newProp] array.
*/
changedAttributes: function() {
var oldData = get(this, '_data');
var newData = get(this, '_attributes');
var diffData = {};
var prop;
for (prop in newData) {
diffData[prop] = [oldData[prop], newData[prop]];
}
return diffData;
},
/**
@method adapterWillCommit
@private
*/
adapterWillCommit: function() {
this.send('willCommit');
},
/**
If the adapter did not return a hash in response to a commit,
merge the changed attributes and relationships into the existing
saved data.
@method adapterDidCommit
*/
adapterDidCommit: function(data) {
set(this, 'isError', false);
if (data) {
this._data = data;
} else {
Ember.mixin(this._data, this._inFlightAttributes);
}
this._inFlightAttributes = {};
this.send('didCommit');
this.updateRecordArraysLater();
if (!data) { return; }
Ember.keys(data).map(this.notifyPropertyChange, this);
},
/**
@method adapterDidDirty
@private
*/
adapterDidDirty: function() {
this.send('becomeDirty');
this.updateRecordArraysLater();
},
/**
@method updateRecordArraysLater
@private
*/
updateRecordArraysLater: function() {
// quick hack (something like this could be pushed into run.once
if (this._updatingRecordArraysLater) { return; }
this._updatingRecordArraysLater = true;
Ember.run.schedule('actions', this, this.updateRecordArrays);
},
/**
@method setupData
@private
@param {Object} data
*/
setupData: function(data) {
Ember.assert("Expected an object as `data` in `setupData`", Ember.typeOf(data) === 'object');
Ember.merge(this._data, data);
this.pushedData();
Ember.keys(data).map(this.notifyPropertyChange, this);
},
materializeId: function(id) {
set(this, 'id', id);
},
materializeAttributes: function(attributes) {
Ember.assert("Must pass a hash of attributes to materializeAttributes", !!attributes);
merge(this._data, attributes);
},
materializeAttribute: function(name, value) {
this._data[name] = value;
},
/**
If the model `isDirty` this function will discard any unsaved
changes
Example
```javascript
record.get('name'); // 'Untitled Document'
record.set('name', 'Doc 1');
record.get('name'); // 'Doc 1'
record.rollback();
record.get('name'); // 'Untitled Document'
```
@method rollback
*/
rollback: function() {
this._attributes = {};
if (get(this, 'isError')) {
this._inFlightAttributes = {};
set(this, 'isError', false);
}
//Eventually rollback will always work for relationships
//For now we support it only out of deleted state, because we
//have an explicit way of knowing when the server acked the relationship change
if (get(this, 'isDeleted')) {
this.reconnectRelationships();
}
if (get(this, 'isNew')) {
this.clearRelationships();
}
if (!get(this, 'isValid')) {
this._inFlightAttributes = {};
}
this.send('rolledBack');
Ember.keys(this._data).map(this.notifyPropertyChange, this);
},
toStringExtension: function() {
return get(this, 'id');
},
/**
Save the record and persist any changes to the record to an
external source via the adapter.
Example
```javascript
record.set('name', 'Tomster');
record.save().then(function(){
// Success callback
}, function() {
// Error callback
});
```
@method save
@return {Promise} a promise that will be resolved when the adapter returns
successfully or rejected if the adapter returns with an error.
*/
save: function() {
var promiseLabel = "DS: Model#save " + this;
var resolver = Ember.RSVP.defer(promiseLabel);
this.get('store').scheduleSave(this, resolver);
this._inFlightAttributes = this._attributes;
this._attributes = {};
return PromiseObject.create({
promise: resolver.promise
});
},
/**
Reload the record from the adapter.
This will only work if the record has already finished loading
and has not yet been modified (`isLoaded` but not `isDirty`,
or `isSaving`).
Example
```javascript
App.ModelViewRoute = Ember.Route.extend({
actions: {
reload: function() {
this.controller.get('model').reload().then(function(model) {
// do something with the reloaded model
});
}
}
});
```
@method reload
@return {Promise} a promise that will be resolved with the record when the
adapter returns successfully or rejected if the adapter returns
with an error.
*/
reload: function() {
set(this, 'isReloading', true);
var record = this;
var promiseLabel = "DS: Model#reload of " + this;
var promise = new Promise(function(resolve){
record.send('reloadRecord', resolve);
}, promiseLabel).then(function() {
record.set('isReloading', false);
record.set('isError', false);
return record;
}, function(reason) {
record.set('isError', true);
throw reason;
}, "DS: Model#reload complete, update flags")['finally'](function () {
record.updateRecordArrays();
});
return PromiseObject.create({
promise: promise
});
},
// FOR USE DURING COMMIT PROCESS
adapterDidUpdateAttribute: function(attributeName, value) {
// If a value is passed in, update the internal attributes and clear
// the attribute cache so it picks up the new value. Otherwise,
// collapse the current value into the internal attributes because
// the adapter has acknowledged it.
if (value !== undefined) {
this._data[attributeName] = value;
this.notifyPropertyChange(attributeName);
} else {
this._data[attributeName] = this._inFlightAttributes[attributeName];
}
this.updateRecordArraysLater();
},
/**
@method adapterDidInvalidate
@private
*/
adapterDidInvalidate: function(errors) {
var recordErrors = get(this, 'errors');
function addError(name) {
if (errors[name]) {
recordErrors.add(name, errors[name]);
}
}
this.eachAttribute(addError);
this.eachRelationship(addError);
},
/**
@method adapterDidError
@private
*/
adapterDidError: function() {
this.send('becameError');
set(this, 'isError', true);
},
/**
Override the default event firing from Ember.Evented to
also call methods with the given name.
@method trigger
@private
@param {String} name
*/
trigger: function() {
var length = arguments.length;
var args = new Array(length - 1);
var name = arguments[0];
for (var i = 1; i < length; i++ ){
args[i - 1] = arguments[i];
}
Ember.tryInvoke(this, name, args);
this._super.apply(this, arguments);
},
triggerLater: function() {
var length = arguments.length;
var args = new Array(length);
for (var i = 0; i < length; i++ ){
args[i] = arguments[i];
}
if (this._deferredTriggers.push(args) !== 1) {
return;
}
Ember.run.schedule('actions', this, '_triggerDeferredTriggers');
},
_triggerDeferredTriggers: function() {
for (var i=0, l= this._deferredTriggers.length; i<l; i++) {
this.trigger.apply(this, this._deferredTriggers[i]);
}
this._deferredTriggers.length = 0;
},
willDestroy: function() {
this._super();
this.clearRelationships();
},
// This is a temporary solution until we refactor DS.Model to not
// rely on the data property.
willMergeMixin: function(props) {
Ember.assert('`data` is a reserved property name on DS.Model objects. Please choose a different property name for ' + this.constructor.toString(), !props.data);
}
});
Model.reopenClass({
/**
Alias DS.Model's `create` method to `_create`. This allows us to create DS.Model
instances from within the store, but if end users accidentally call `create()`
(instead of `createRecord()`), we can raise an error.
@method _create
@private
@static
*/
_create: Model.create,
/**
Override the class' `create()` method to raise an error. This
prevents end users from inadvertently calling `create()` instead
of `createRecord()`. The store is still able to create instances
by calling the `_create()` method. To create an instance of a
`DS.Model` use [store.createRecord](DS.Store.html#method_createRecord).
@method create
@private
@static
*/
create: function() {
throw new Ember.Error("You should not call `create` on a model. Instead, call `store.createRecord` with the attributes you would like to set.");
}
});
export default Model;


Multi Body Simulation¶
The Lotus solver interacts between two types of objects. A type ‘body’ and a type ‘fluid’. The ‘body’ holds the geometry and its mappings. The ‘fluid’ defines a fluid type, which contains the velocity and pressure fields, along with the Poisson solver data.
In order to carry out Multi Body Simulations (MBS), one must create a type ‘set’, which contains the various geometries.
The mapping .or. , similar to the AND logical operator, allows the user to combine predefined geometries together, which are found in ‘geom_lib/analitic.f90’.
- Create a type ‘set’
- Initiate the ‘set’ with one of the predefined geometries
- Add predefined geometries until obtained the required geometry.
- Assign the ‘set’ to the type ‘body’
One of the advantages of Lotus’s mapping system is that one can for example use the .and. mapping to obtain the opposite result. That is that the resultant geometry is the intersection of two or more geometries.
Relevant files within the repos directory:
- oop/body.f90
- oop/fluid.f90
- geom_lib/analitic.f90
- geom_lib/map.f90


fun setCardInputListener(listener: CardInputListener?): Unit
listener - A CardInputListener to be notified of changes to the user's focused field
listener


{title:'Marshalling', created:'9.0.0'}
The juneau-marshall library includes easy-to-use and highly customizable serializers and parsers based around a common API. It allows you to marshall Java POJOs directly to and from a wide variety of language types without the need for intermediate Document Object Models making them extremely efficient.
Supported languages include:
The default serializers can often be used to serialize POJOs in a single line of code:
|
Parsing back into POJOs is equally simple for any of the supported languages. Language fragments are also supported.
|
Marshalling support is provided for a wide variety of POJO types including:
Marshallers like the one shown above are pairings of serializers and parsers. Serializers and parsers are builder-based using fluent methods allowing you to quickly create, clone, and modify them in single lines of code.
|
Many POJOs such as primitives, beans, collections, arrays, and classes with various known constructors and methods are serializable out-of-the-box.
Swaps allow you to replace non-serializable objects with serializable equivalents. The {@link oaj.swaps} package contains a variety of predefined swaps.
|
Any POJO that doesn't fit into the category of a bean/collection/array/primitive and doesn't have a swap associated with it is converted to simple strings. By default, various instance and static methods and constructors on POJO classes are automatically detected and supported for marshalling a POJO to and from a string.
Beans and POJO classes, methods, fields, and constructors can also be annotated with a variety of annotations to customize how they are marshalled:
|
As a general rule, any capabilities provided by bean annotations can be programmatically specified via the builder APIs. This allows the marshallers to be used equivalently on either your own code that you have access to, or external code where you only have access to binaries.
Serializers and parsers can also be configured using annotations.
|
Config annotations are extensively used in the REST Servlet APIs to configure how POJOs are marshalled through REST interfaces.
Config variables also support embedded variables for resolving settings at runtime.
|
Default values for config settings can be overridden via system properties or environment variables. For example, the system property "BeanContext.sortProperties" or environment variable "BEANCONTEXT_SORTPROPERTIES" can be used to set the default value for the sort properties setting.
Bean annotations can also be programmatically attached to POJOs using config annototations like so:
|
The {@link oaj.json.Json5Serializer} class can be used to serialized POJOs into JSON 5 notation.
JSON 5 is similar to JSON except for the following:
|
|
JSON 5 is still valid Javascript. The advantage to simplified JSON is you can represent it in a Java String in minimal form with minimal escaping. This is particularly useful in cases such as unit testing where you can easily validate POJOs by simplifying them to JSON 5 and do a simple string comparison.
| WriterSerializer
The Marshalling API also supports UON (URL-Encoded Object Notation). It allows JSON-like data structures (OBJECT, ARRAY, NUMBER, BOOLEAN, STRING, NULL) in HTTP constructs (query parameters, form parameters, headers, URL parts) without violating RFC2396. This allows POJOs to be converted directly into these HTTP constructs which is not possible in other languages such as JSON.
| (
| id=1,
| name=
The Marshalling API also supports schema-based OpenAPI serialization. It allows HTTP parts to be marshalled to-and-from POJOs based on OpenAPI schema definitions.
|
Schema-based serialization and parsing is used heavily in both the server and client REST APIs with built-in schema validations support in various HTTP part annotations.
|
The {@link oaj.collections.JsonMap} and {@link oaj.collections.JsonList} collections classes allow you
to programmatically build generic JSON data structures. They are similar in concept to
|
These classes provide lots of convenience methods including:
{@link oaj.serializer.SerializerSet} and {@link oaj.parser.ParserSet} classes allow serializers and parsers
to be retrieved by W3C-compliant HTTP Accept
and Content-Type
values:
|
The {@link oaj.svl} package defines an API for a language called "Simple Variable Language".
In a nutshell, Simple Variable Language (or SVL) is text that contains variables of the form
Variables can be recursively nested within the varKey (e.g.
|
The SVL variables are used widely throughout various annotations defined in Juneau allowing many features to be configured via external sources such as configuration files or environment variables/system properties. The SVL APIs are extensible allowing for the addition of new types of variables.


- NAME
- unload - Unload machine code
- SYNOPSIS
- DESCRIPTION
- -nocomplain
- -keeplibrary
- --
- UNLOAD OPERATION
- UNLOAD HOOK PROTOTYPE
- NOTES
- PORTABILITY ISSUES
- Unix
- BUGS
- EXAMPLE
- SEE ALSO
- KEYWORDS
unload - Unload machine code
unload ?switches? fileName
unload ?switches? fileName packageName
unload ?switches? fileName packageName interp
This command tries to unload shared libraries previously loaded
with load from the application's address space. fileName
is the name of the file containing the library file to be unload; it
must be the same as the filename provided to load for
loading the library.
The packageName argument is the name of the package (as
determined by or passed to load), and is used to
compute the name of the unload procedure; if not supplied, it is
computed from fileName in the same manner as load.
The interp argument is the path name of the interpreter from
which to unload the package (see the interp manual entry for
details); if interp is omitted, it defaults to the
interpreter in which the unload command was invoked.
If the initial arguments to unload start with - then
they are treated as switches. The following switches are
currently supported:
- -nocomplain
-
Suppresses all error messages. If this switch is given, unload will
never report an error.
- -keeplibrary
-
This switch will prevent unload from issuing the operating system call
that will unload the library from the process.
- --
-
Marks the end of switches. The argument following this one will
be treated as a fileName even if it starts with a -.
When a file containing a shared library is loaded through the
load command, Tcl associates two reference counts to the library
file. The first counter shows how many times the library has been
loaded into normal (trusted) interpreters while the second describes how many
times the library has been loaded into safe interpreters. As a file containing
a shared library can be loaded only once by Tcl (with the first load
call on the file), these counters track how many interpreters use the library.
Each subsequent call to load after the first simply increments the
proper reference count.
unload works in the opposite direction. As a first step, unload
will check whether the library is unloadable: an unloadable library exports
a special unload procedure. The name of the unload procedure is determined by
packageName and whether or not the target interpreter
is a safe one. For normal interpreters the name of the initialization
procedure will have the form pkg_Unload, where pkg
is the same as packageName except that the first letter is
converted to upper case and all other letters
are converted to lower case. For example, if packageName is
foo or FOo, the initialization procedure's name will
be Foo_Unload.
If the target interpreter is a safe interpreter, then the name
of the initialization procedure will be pkg_SafeUnload
instead of pkg_Unload.
If unload determines that a library is not unloadable (or unload
functionality has been disabled during compilation), an error will be returned.
If the library is unloadable, then unload will call the unload
procedure. If the unload procedure returns TCL_OK, unload will proceed
and decrease the proper reference count (depending on the target interpreter
type). When both reference counts have reached 0, the library will be
detached from the process.
The unload procedure must match the following prototype:
typedef int Tcl_PackageUnloadProc(Tcl_Interp *interp, int flags);
The interp argument identifies the interpreter from which the
library is to be unloaded. The unload procedure must return
TCL_OK or TCL_ERROR to indicate whether or not it completed
successfully; in the event of an error it should set the interpreter's result
to point to an error message. In this case, the result of the
unload command will be the result returned by the unload procedure.
The flags argument can be either TCL_UNLOAD_DETACH_FROM_INTERPRETER
or TCL_UNLOAD_DETACH_FROM_PROCESS. In case the library will remain
attached to the process after the unload procedure returns (i.e. because
the library is used by other interpreters),
TCL_UNLOAD_DETACH_FROM_INTERPRETER will be defined. However, if the
library is used only by the target interpreter and the library will be
detached from the application as soon as the unload procedure returns,
the flags argument will be set to TCL_UNLOAD_DETACH_FROM_PROCESS.
The unload command cannot unload libraries that are statically
linked with the application.
If fileName is an empty string, then the packageName argument must
be specified.
If packageName is omitted or specified as an empty string,
Tcl tries to guess the name of the package.
This may be done differently on different platforms.
The default guess, which is used on most UNIX platforms, is to
take the last element of fileName, strip off the first
three characters if they are lib, and use any following
alphabetic and underline characters as the module name.
For example, the command unload libxyz4.2.so uses the module
name xyz and the command unload bin/last.so {} uses the
module name last.
- Unix
-
Not all unix operating systems support library unloading. Under such
an operating system unload returns an error (unless -nocomplain
has been specified).
If the same file is loaded by different fileNames, it will
be loaded into the process's address space multiple times. The
behavior of this varies from system to system (some systems may
detect the redundant loads, others may not). In case a library has been
silently detached by the operating system (and as a result Tcl thinks the
library is still loaded), it may be dangerous to use
unload on such a library (as the library will be completely detached
from the application while some interpreters will continue to use it).
If an unloadable module in the file foobar.dll had been loaded
using the load command like this (on Windows):
load c:/some/dir/foobar.dll
then it would be unloaded like this:
unload c:/some/dir/foobar.dll
This allows a C code module to be installed temporarily into a
long-running Tcl program and then removed again (either because it is
no longer needed or because it is being updated with a new version)
without having to shut down the overall Tcl process.
info sharedlibextension, load, safe
binary code, unloading, safe interpreter, shared library
Copyright © 1995-1997 Roger E. Critchlow Jr.
Copyright © 2003 George Petasis <petasis(at)iit.demokritos.gr>.


{#{% extends "team/base.html" %}#}
{% load user_tags %}
{% load staticfiles %}
{% block css %}
{% endblock %}
{% block pageTitle %}
Bookings
{% endblock %}
{% block content %}
{# #}
| Bkg Creation Date |
Shipment Date |
Delivered Date |
Booking ID |
LR Number(s) |
Company Name (Booked By) |
Company Code (Booked By) |
Company Name (Consignor) |
Company Name (Consignee) |
Customer Name (to Be Billed) |
Customer Code (to Be Billed) |
From |
To |
Truck Number |
Truck Type |
Party Weight |
Party Rate |
Freight Revenue |
Additional charges if any |
Remarks for additional charge |
Discount/ Deductions |
Remarks for Discount / Deductions |
Net Invoice Amt receivable |
Refund Amt due |
Refund Amt Paid |
In Ward Payments (CNCA) |
In Ward Payments (others) |
TDS deducted by Customers |
Credit Note (CNC) |
Debit Note (DNC) |
Balance Amt receivable |
Invoice Status |
Invoice Number |
Invoice Date |
Supplier Name |
Supplier Code |
Supplier Weight |
Supplier Rate |
Freight to Supplier |
Loading Chgs |
Unloading Chgs |
Detention Chgs |
Any other deduction |
Remarks for other deduction |
TDS Deducted from Suppliers |
Total Amount to Supplier |
Total Out Ward Payment |
Credit Note - Supplier (CNS) |
Debit Note - Supplier (DNS) |
Balance Amt Payable |
POD Status |
Source Office |
Destination Office |
{#
#}
{% endblock %}
{% block js %}
{% endblock %}


mvn io.quarkus:quarkus-maven-plugin:create -DprojectGroupId=com.company -DprojectArtifactId=sample-kogito -Dextensions="kogito"
Once the project is generated, import it into your Eclipse IDE. Simply build the project with maven and start the application (as before you have the option to start it using Quarkus dev mode, using JVM mode or using native image mode - we will use Quarkus dev mode in this example)
Open your command line and go into the newly created sample-kogito folder
mvn clean package quarkus:dev
You're now ready to implement your business logic that can be composed of business processes, rules, decision tables, java services and more.
mvn clean package
java -jar target/jbpm-quarkus-example-{version}-runner.jar
or on Windows
java -jar target\jbpm-quarkus-example-{version}-runner.jar
mvn clean package -Pnative
./target/jbpm-quarkus-example-{version}-runner
mvn archetype:generate -DarchetypeGroupId=org.kie.kogito -DarchetypeArtifactId=kogito-springboot-archetype -DarchetypeVersion=0.1.3 -DgroupId=com.company -DartifactId=sample-kogito
Included in the project out-of-the-box that allows to test the generated application. Simply build the project with maven and start the application (as before you have the option to start it using SpringBoot maven plugin or as a normal Java service - we will use the SpringBoot maven plugin in this example)
Open your command line and go into the newly created sample-kogito folder.
mvn clean package spring-boot:run
You're now ready to implement your business logic that can be composed of business processes, rules, decision tables, java services and more.
mvn clean package
java -jar target/jbpm-springboot-example-{version}.jar
or on Windows
java -jar target\jbpm-springboot-example-{version}.jar


Powered With Help From
Weather Underground
https://www.wunderground.com/
The Movie Database
https://www.themoviedb.org/?language=en
Twitter Developer Oauth
https://developer.twitter.com/en/docs/basics/authentication/overview/oauth
tmdbv3
https://www.npmjs.com/package/tmdbv3
published by mikaelemilsson
node-weatherunderground
https://www.npmjs.com/package/node-weatherunderground
published by jgeller


|
SideCar
|
Files | |
| file | BinaryVideo.h [code] |
| file | CircularBuffer.h [code] |
| file | Complex.h [code] |
| file | Decimator.h [code] |
| file | Extraction.h [code] |
| file | GUID.h [code] |
| file | Header.h [code] |
| file | LoaderRegistry.h [code] |
| file | MetaTypeInfo.h [code] |
| file | PRIMessage.h [code] |
| file | RadarConfig.h [code] |
| file | RadarConfigFileWatcher.h [code] |
| file | RawVideo.h [code] |
| file | RawVideoHeader.h [code] |
| file | Segments.h [code] |
| file | Track.h [code] |
| file | TSPI.h [code] |
| file | Video.h [code] |
| file | VMEHeader.h [code] |


Fallout Simulator
Click here to download the game
Click here to download the source code(requires pygame module)


Manage View/Edit Users
Event: 2019 Fourth of July Picnic and Fireworks
0 Item(s) Selected
|
Can Edit
|
User Name
|
Region/Consulate
|
|---|---|---|
|
|
Test User 1 (Event Owner)
|
Mission Gotham
|
|
|
Test User 2
|
Mission Gotham
|
|
|
Test User 3
|
Mission Gotham
|
|
|
Test User 4
|
Mission Gotham
|
|
|
Test User 5
|
Mission Gotham
|
|
|
Test User 6
|
Mission Gotham
|
|
|
Test User7
|
Mission Gotham
|
|
|
Test User 8
|
Mission Gotham
|
|
|
Test User 9
|
Mission Gotham
|
|
|
Test User 10
|
Mission Gotham
|
|
|
Test User 11
|
Mission Gotham
|
|
|
Test User 12
|
Mission Gotham
|
|
|
Test User 13
|
Mission Gotham
|
|
|
Test User 14
|
Mission Gotham
|
|
|
Test User 8
|
Mission Gotham
|
|
|
Test User 15
|
Mission Gotham
|
|
|
Test User 16
|
Mission Gotham
|
|
|
Test User 8
|
Mission Gotham
|
|
|
Test User 17
|
Mission Gotham
|
|
|
Test User 18
|
Mission Gotham
|
|
|
Test User 19
|
Mission Gotham
|
|
|
Test User 20
|
Mission Gotham
|
|
|
Test User 21
|
Mission Gotham
|
|
|
Test User 22
|
Mission Gotham
|
|
|
Test User 23
|
Mission Gotham
|
|
|
Test User 24
|
Mission Gotham
|
|
|
Test User 25
|
Mission Gotham
|
|
|
Test User 26
|
Mission Gotham
|
|
|
Test User 27
|
Mission Gotham
|


--- layout: default --- {% include resumes.html %} {% include experience.html %} {% include projectsX.html %} {% include skills.html %}


Kayak Wireframe: Travel itinerary info gathered on this page
Google News: Jumping off point to pick which news article to read page
Wikipedia: Replacing encyclopedia


Consulting
Interested in hiring me?
I do statistical consulting and program reviews in mathematics, statistics, and data science. I can also advise colleges on starting a data science program.
Experience
- Program Review, Monmouth University
Spring 2022
Reviewed the Moumouth University Mathematics Departments mathematical and statistical programs. - Statistical Consultant, Contamination Source Investigation
Fall 2019—present
Helped with various statistical procedures including establishing Level of Detection and modeling probabilities of testing people positive with pooled and unpooled testing. - Statistical Consultant, Wright Labs
Fall 2019—present
Worked with implementing and analyzing output from various statistical routines including SparCC and SourceTracker.


Previous Demo
Back to the Codrops Article
Circular Progress Button
Implementation of Colin Garvin's
Submit Button
Default progress button (success and error)
Submit
Submit
Elastic version, with some easings (success, error)
Submit
Submit
If you enjoyed this demo you might also like:
Progress Button Styles
Animated SVG Icons


Potluck Planner was built by a dedicated team of web developers at Lambda School who love potlucks but didn't enjoy all the planning involved. We knew that there had to be an easy way to organize the event, and for all of the guests to know exactly what to bring and how much.


Gold Price News & Forecast: XAU/USD remains vulnerable below 100-day SMA
by Yohay ElamGold: failure to capitalize on momentum may disappoint bulls
The failure of gold to push ahead in its recovery momentum will come as a disappointment for the bulls. Even as safe-haven flows have begun to resume on Wednesday, the gold price closed lower and runs the risk that this tepid rally has already run out of steam. The band of overhead supply between $1474/$1480 has come in to act as a barrier to the recovery and yesterday’s high at $1279 is notable. Read more...
Gold Technical Analysis: Remains vulnerable below 100-day SMA
Gold seems to have stalled its recent corrective bounce from three-month lows and witnessed a modest pullback from previous support, now turned resistance near 100-day SMA.
Meanwhile, the commodity has been trending lower over the past two months or so along a descending trend-channel, which clearly points to a well-established near-term downtrend. Read more...


Skill is very important in the life of every human being. The reason why many technicians earn more money than
some university graduates is because we acquire more practical skills.
Skill acquisition is the ability to be trained on a particular task or function and become an expert in it.
A skilled person can survive in any environment.
As water is essential to human life, so is skill training and acquisition needed in the life of every
serious minded human being.
REASONS FOR SKILL AQUISITION
People may acquire different skills for the following reasons
As survival strategy: people acquire certain skills in order to make a living out of it and for
survival.
Managing emergency situation: some people may learn some skills to enable them handle emergency
situations
To be self-reliant: some people learn skill in order to be self reliant. They may not want to work for
government or private employers.


Monaco Editor Parcel Bundler Sample
This sample shows how to load a small subset of the editor:
- Only the core editor and the find widget
- Only the json language coloring
To run this sample, you need to:
$/browser-esm-parcel> npm install -g parcel-bundler
$/browser-esm-parcel> npm install .
$/browser-esm-parcel> npm run build
$/browser-esm-parcel> npm run simpleserver
Then, open http://localhost:9999.


I am a Product Manager during the weekdays. I used to be a programmer, but
now I just dabble in writing scripts that improve my life. This site is my
personal blog and represents only my opinions and hobbies not those of my
employer. The blog is here to house my personal projects for role-playing,
video games, programming, DIY and cooking. I also like to post notes here
about things I learned during my programming experiences at work or with
personal projects. I often times write posts on answers to problems that
caused me some headaches or time to resolve. For me the resolution is the
key and the blog post is there to keep me from repeating the same mistake
twice. I have also started up my own Patreon where I post FREE battlemaps
for Forgotten Realms. I will link to those posts from this site as well.
If you like what I do click the become a patron button below.


Nexial comes with a utility to assist in finding the appId
(or appPackage
) and
appActivity
via the corresponding .apk
file (Android app). With this utility, one can
find the appId
for the mobile » launchApp(app)
command, as well as the appPackage
and appActivity
for setting up a
mobile profile. Here's how to run the nexial-apk-manifest
utility:
On Windows:
cd %NEXIAL_HOME% cd bin\mobile nexial-apk-manifest.cmd -a [FULLY_QUALIFIED_PATH_TO_YOUR_APK_FILE]On Linux/MacOS:
cd $NEXIAL_HOME cd bin/mobile ./nexial-apk-manifest.sh -a [FULLY_QUALIFIED_PATH_TO_YOUR_APK_FILE]Here's an example output of this utility:
appPackage
.


Lyon Coding
by Ray Lyon
Twitter
Instagram
Live Chicken Feed
Information
Live feed turns off at sunset
Otherwise on all day
This is a new feature we're trying out
Eggs laid 4-29-16 and 5-6-16
Total of 14 eggs
One year old
Name is Scarlet
Breed-Australorp
Info on Australorp


aptitude-create-state-bundle - bundle the current aptitude state
aptitude-create-state-bundle [<options>...] <output-file>
aptitude-create-state-bundle produces a compressed archive storing the files that are required to replicate the current package archive state. The following files and directories are included in the bundle:
h'-04'(buh'+03'c
$HOME/.aptitude
h'-04'(buh'+03'c
/var/lib/aptitude
h'-04'(buh'+03'c
/var/lib/apt
h'-04'(buh'+03'c
/var/cache/apt/*.bin
h'-04'(buh'+03'c
/etc/apt
h'-04'(buh'+03'c
/var/lib/dpkg/status
The output of this program can be used as an argument to aptitude-run-state-bundle(1).
--force-bzip2
Override the autodetection of which compression algorithm to use. By default, aptitude-create-state-bundle uses bzip2(1) if it is available, and gzip(1) otherwise. Passing this option forces the use of bzip2 even if it doesn*(Aqt appear to be available.
--force-gzip
Override the autodetection of which compression algorithm to use. By default, aptitude-create-state-bundle uses bzip2(1) if it is available, and gzip(1) otherwise. Passing this option forces the use of gzip even if bzip2 is available.
--help
Print a brief usage message, then exit.
--print-inputs
Instead of creating a bundle, display a list of the files and directories that the program would include if it generated a bundle.
The bundle file is simply a tar(1) file compressed with bzip2(1) or gzip(1), with each of the input directory trees rooted at (lq.(rq.
aptitude-run-state-bundle(1), aptitude(8), apt(8)
Daniel Burrows<EMAIL_ADDRESS>Author.
Copyright 2007 Daniel Burrows.
This manual page is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This manual page is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.


There are basically two parts of what we plan to do: one is the fundation, the other are the tools and platforms. Thus we started with the basic knowledge, which is a good way for us to learn and know more about what we are going to do. Then we built applications such as the CLDR Datebase and related best practices. Finally we crafted prodcuts and platforms so that people can get access to what they want at ease.


AVIRAL SRIVASTAVA
Hii There ! It's me Aviral.
🖋 VIT'24
🕸 Frontend Developer
🧑💻 Coding Enthusiest
☕ Coffee Lover
Wave at me to Know More👋


TAMOC Package Manual¶
| Release: | 1.1 |
|---|---|
| Date: | Nov 08, 2017 |
This guides provides the documentation for the Texas A&M Oilspill Calculator
TAMOC
package.
Parts of the Documentation¶
Model Overview¶
The following files summarize the model release notes and licensing.
User’s Guides¶
A few examples of how to use the modules in TAMOC
are provided in the
following user guides along with comprehensive references to the included
./bin
scripts.
- Ambient Module Users Guide
- Seawater Module Users Guide
- Chemical Properties Users Guide
- Discrete Bubble Model Users Guide
- Dispersed Phases User’s Guide
- Sintef Module User’s Guide
- Params Module User’s Guide
- Single Bubble Model Users Guide
- Stratified Plume Model User’s Guide
- Bent Plume Model User’s Guide
Module Documentation¶
Each of the modules, classes, methods, and functions provided with TAMOC
are throughly documented in the source code. The following pages collect
this source code documentation for web presentation.
- Overview of Ambient Module
- Overview of the Seawater Module
- Overview of Chemical Properties
- Overview of Discrete Bubble Model (DBM) Module
- Overview of Dispersed Phases Module
- Overview of Sintef Module
- Overview of Params Module
- Overview of Single Bubble Model Module
- Overview of Stratified Plume Model Module
- Overview of Bent Plume Model Module
- Reference
- Unit Tests


Extension Options
Things EDU Plus should do:
Save latest user ID
Save latest user password
[* Obviously, this is risky if any other person can access your browser.
Only use if you are the only one using the browser.]
Autofill the login Captcha
Other options:
Smart Focus
Some statistics:
Usernames automatically filled:
Passwords automatically filled:
Captchas automatically filled:


You're invited to the wedding of the century!
Join us Saturday, June 4, 2022 at 4pm for the wedding of Collin Gould and Kaitlyn Marino
The ceremony and reception will both be held at Carolina Grove in Hillsborough, NC
Carolina Grove
1001 Lipscomb Grove Church Rd
Hillsborough, NC 27278


Learning the rust book
Network Programming with Rust
Who this book is for
This book’s target audience is a software engineer who is interested in writing networking software using Rust.
What this book covers
What this book covers
Chapter 1,
Introduction to Client/Server Networking, starts the book with a gentle introduction to computer networking from the ground up. This includes IP addressing, TCP/UDP, and DNS. This forms the basis of our discussions in later chapters.
Chapter 2,
Introduction to Rust and its Ecosystem, contains an introduction to Rust. This is an overall introduction that should be good enough to get the reader started. We do assume some familiarity with programming.
Getting started with Rust
The Rust toolchain installer is available at: https://www.rustup.rs/. The following commands will install all three versions of the toolchain on a system. For the examples in this book, we will use a Linux machine running Ubuntu 16.04. While most of Rust should not depend on the OS, there can be minor differences.
We will point out any strict dependencies on the OS:
$ curl https://sh.rustup.rs -sSf | sh
source $HOME/.cargo/env
- rustup install nightly beta We will need to put Cargo’s bin directory to our PATH by editing .bashrc. Run the following to do that:
$ echo “export PATH=$HOME/.cargo/bin:$PATH” >> ~/.bashrc A Rust installation comes with a lot of documentation built in; they can be accessed by running the following command. This should open up the documentation in a browser window:
rustup doc The next step is to set up a Rust project and run it, all using Cargo:
cargo new –bin hello-rust This tells Cargo to set up a new project called hello-rust in the current directory. Cargo will create a directory of that name and set up the basic structure. Since the type of this project is set to be a binary, Cargo will generate a file called main.rs which will have an empty main function, the entry point for the application. The other (default) option here is that of a library, in this case, a file named lib.rs will be generated. The file named Cargo.toml has a bunch of metadata for the current project and is used by Cargo. All source code is located in the src directory:
$ cargo run
Introduction to the borrow checker
// chapter2/ownership-heap-fixed.rs
fn main() {
let s = String::from("Test");
heap_example(s);
}
fn heap_example(input: String) {
let mystr = input;
let _otherstr = mystr.clone(); // if ... let _otherstr = mystr; note: move occurs because `mystr` has type `std::string::String`, which does not implement the `Copy` trait
println!("{}", mystr);
}
$ rustc ownership-heap-fixed.rs && ./ownership-heap-fixed Test
// chapter2/lifetime.rs
fn main() {
let v1 = vec![1, 2, 3, 4, 5];
let v2 = vec![1, 2];
println!("{:?}", longer_vector(&v1, &v2));
}
fn longer_vector(x: &[i32], y: &[i32]) -> &[i32] { //errors help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from `x` or `y`
if x.len() > y.len() { x } else { y }
}
fn longer_vector<'a>(x: &'a[i32], y: &'a[i32]) -> &'a[i32] { //right
if x.len() > y.len() { x } else { y }
}
p96 reviewer
It become some difficuld… Generics and the trait system
// chapter2/generic-function.rs
struct Tuple<T> {
first: T,
second: T,
}
fn main() {
let tuple_u32: Tuple<u32> = Tuple {first: 4u32, second: 2u32 };
let tuple_u64: Tuple<u64> = Tuple {first: 5u64, second: 6u64 };
println!("{}", sum(tuple_u32));
println!("{}", sum(tuple_u64));
let tuple: Tuple<String> = Tuple {first: "One".to_owned(), second: "Two".to_owned() };
println!("{}", sum(tuple));
}
fn sum<T>(tuple: Tuple<T>) -> T
{
tuple.first + tuple.second
}
This fails to compile, and the compiler throws the following error:
$ rustc generic-function.rs
error[E0369]: binary operation +
cannot be applied to type T
–> generic-function-error.rs:18:5
|
18 | tuple.first + tuple.second
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: T
might need a bound for std::ops::Add
error: aborting due to previous error
// We constrain the possible types of T to those which implement the Add trait
fn sum
It is to be reviewer P97-106
- Higher-order functions
Chapter 3,
TCP and UDP Using Rust, dives into using Rust for networking. We start with basic socket programming using the standard library. We then look at some crates from the ecosystem that can be used for network programming.
Chapter 4,
Data Serialization, Deserialization, and Parsing, explains that an important aspect of networked computing is handling data. This chapter is an introduction to serializing and deserializing data using Serde. We also look at parsing using nom and other frameworks.
Chapter 5,
Application Layer Protocols, moves up a layer to look at protocols that operate above TCP/IP. We look at a few crates to work with, such as RPC, SMTP, FTP, and TFTP.
Chapter 6,
Talking HTTP in the Internet, explains that arguably the most common application of the internet is HTTP. We look at crates such as Hyper and Rocket which are used for writing HTTP servers and clients.
Chapter 7,
Asynchronous Network Programming Using Tokio, looks at the Tokio stack for asynchronous programming using futures, streams, and event loops.
Chapter 8, Security,
delves into securing the services we have described so far. This is using certificates and secret keys.
Chapter 9, Appendix,
discusses a number of crates have appeared that propose alternate ways of doing things already covered in this book. This includes the async/await syntax, parsing using Pest, and so on. We will discuss some of these in the appendix.
code
The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/Network-Programming-with-Rust. We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!
words:
related the sake of simplicity revolutionized prominent protocols Eventually silos proximity hierarchy imperative brutally engagements architectural Heap memory
1977 In networking, a Request For Comment (RFC) is a document that describes how a proposed system should work. These are the first steps towards standardizing a protocol or a system. The term internet was first used in RFC 675, which proposed a standard for TCP.
Physical layer: It defines how data is transmitted in the physical medium in terms of its electrical and physical characteristics. This can either be by wire, fiber optic, or a wireless medium. Data link layer: It defines how data is transmitted between two nodes connected by a physical medium. This layer deals with prioritization between multiple parties trying to access the wire simultaneously. Another important function of this layer is to include some redundancy in the transmitted bits to minimize errors during transmission. This is referred to as coding. Network layer: It defines how packets (made up of multiple units of data) are transmitted between networks. Thus, this layer needs to define how to identify hosts and networks uniquely. Transport layer: It defines mechanisms to reliably deliver variable length messages to hosts (in the same or different networks). This layer defines a stream of packets that the receiver can then listen to. Session layer: It defines how applications running on hosts should communicate. This layer needs to differentiate between applications running on the same host and deliver packets to them. Presentation layer: It defines common formats for data representation so that different applications can interlink seamlessly. In some cases, this layer also takes care of security. Application layer: It defines how user-centric applications should send and receive data. An example is the web browser (a user-centric application) using HTTP (an application layer protocol) to talk to a web server.
Typically, each computer in a network will have a local DNS server configured in the file /etc/resolv.conf. In most cases, this points to the ISP’s DNS server. This might also point to the home Wi-Fi router’s DNS server. In that case, the DNS will transparently proxy requests to the ISP’s DNS server. The OS will then query that server, asking the IP of the given name www.google.com.
TCP header format


This page lists every file in the Archive, sorted by date. (The last update of the file, not the date it first entered the Archive.) Note that this list is based on filesystem timestamps, which may be inaccurate -- or just plain wrong -- for various reasons. Please do not consider them infallible.


Toggle navigation
Product
new
Home
Team
Roadmap
Investors
Contact us
Product
new
Singular
UDAP Middleware
Harvest Wallet
UMedia
CERT-Wallet
UDGE
Download
Harvest Wallet
Android Version MVP (2018.10.12)
An ERC721 and UDAP Singular Style Asset Wallet
USA
China


--- title: y layout: posts author: mrmrs awslink: https://s3-us-west-1.amazonaws.com/vimgifs/y.gif ---
y stands for yank, which is equivalent to the concept of copying text. But it's a bit more powerful.


Tab 1
Tab 2
Tab 3
Name:
Age:
10
20
Yard:
1
2
Team:
Price:
Comment:
Do you wish to save?
Yes
No
Cancel