It works well on DAGs and other graphs that can be drawn as hierarchies. It reads attributed graph files and writes drawings. By default, the output format dot is the input file with lay‐ out coordinates appended. neato draws undirected graphs using ``spring'' models (see Kamada and Kawai, Information Processing Letters 31:1, April 1989). Input files must be formatted in the dot attributed graph language. By default, the output of neato is the input graph with layout coordinates appended. twopi draws graphs using a radial layout (see G. Wills, Symposium on Graph Drawing GD'97, September, 1997). Basically, one node is chosen as the center and put at the origin. The remaining nodes are placed on a sequence of concentric circles centered about the origin, each a fixed radial distance from the previous circle. All nodes distance 1 from the center are placed on the first circle; all nodes distance 1 from a node on the first circle are placed on the second circle; and so forth. circo draws graphs using a circular layout (see Six and Tollis, GD '99 and ALENEX '99, and Kaufmann and Wiese, GD '02.) The tool identifies biconnected components and draws the nodes of the component on a circle. The block‐cutpoint tree is then laid out using a recursive radial algo‐ rithm. Edge crossings within a circle are minimized by placing as many edges on the circle's perimeter as possible. In particular, if the com‐ ponent is outerplanar, the component will have a planar layout. If a node belongs to multiple non‐trivial biconnected components, the layout puts the node in one of them. By default, this is the first non‐ trivial component found in the search from the root component. fdp draws undirected graphs using a ``spring'' model. It relies on a force‐directed approach in the spirit of Fruchterman and Reingold (cf. Software‐Practice & Experience 21(11), 1991, pp. 1129‐1164). sfdp also draws undirected graphs using the ``spring'' model described above, but it uses a multi-scale approach to produce layouts of large graphs in a reasonably short time. OUTPUT FORMATS Dot uses an extensible plugin mechanism for its output renderers, so to see what output formats your installation of dot supports you can use ``dot -Txxx'' (where xxx is an unlikely format) and check the warning message. Also, The plugin mechanism supports multiple implementations of the output formats. To see what variants are available, use, for exam‐ ple: ``dot -Tpng:'' and to force a particular variant, use, for example: ``dot -Tpng:gd'' Traditionally, dot supports the following: -Tps (PostScript), -Tsvg -Tsvgz (Structured Vector Graphics), -Tfig (XFIG graphics), -Tmif (FrameMaker graphics), -Thpgl (HP pen plotters), and -Tpcl (Laserjet printers), -Tpng -Tgif (bitmap graphics), -Tdia (GTK+ based diagrams), -Timap (imagemap files for httpd servers for each node or edge that has a non‐null "href" attribute.), -Tcmapx (client‐side imagemap for use in html and xhtml). Additional less common or more special‐purpose output formats can be found at http://www.graphviz.org/cvs/doc/info/out‐ put.html.) Alternative plugins providing support for a given output format can be found from the error message resulting from appending a ':' to the for‐ mat. e.g. -Tpng: The first plugin listed is always the default. The -P switch can be used to produce a graph of all output variants sup‐ ported by plugins in the local installation of graphviz. GRAPH FILE LANGUAGE Here is a synopsis of the graph file language, traditionally using the extension .dot, for graphs: [strict] (graph|digraph) name { statement‐list } Is the top level graph. If the graph is strict then multiple edges are not allowed between the same pairs of nodes. If it is a directed graph, indicated by digraph, then the edgeop must be "->". If it is an undi‐ rected graph then the edgeop must be "--". Statements may be: name=val; node [name=val]; edge [name=val]; Set default graph, node, or edge attribute name to val. Any subgraph, node, or edge appearing after this inherits the new default attributes. n0 [name0=val0,name1=val1,...]; Creates node n0 (if it does not already exist) and sets its attributes according to the optional list. n0 edgeop n1 edgeop ... edgeop nn [name0=val0,name1=val1,...]; Creates edges between nodes n0, n1, ..., nn and sets their attributes according to the optional list. Creates nodes as necessary. [subgraph name] { statement‐list } Creates a subgraph. Subgraphs may be used in place of n0, ..., nn in the above statements to create edges. [subgraph name] is optional; if miss‐ ing, the subgraph is assigned an internal name. Comments may be /*C‐like*/ or //C++‐like. Attribute names and values are ordinary (C‐style) strings. The following sections describe attributes that control graph layout. GRAPH ATTRIBUTES size="x,y" sets bounding box of drawing in inches. page="x,y" sets the PostScript pagination unit. ratio=f sets the aspect ratio to f which may be a floating point number, or one of the keywords fill, compress, or auto. layout=engine indicates the preferred layout engine ("dot", "neato", fdp" etc) overriding the default from the basename of the command or the -K commandline option. margin=f sets the page margin (included in the page size). nodesep=f sets the minimum separation between nodes. ranksep=f sets the minimum separation between ranks. ordering=out constrains order of out‐edges in a subgraph according to their file sequence. rankdir=LR|RL|BT requests a left‐to‐right, right‐to‐left, or bottom‐to‐ top, drawing. pagedir=[TBLR][TBLR] sets the major and minor order of pagination. rank=same (or min or max) in a subgraph constrains the rank assignment of its nodes. If a subgraph's name has the prefix cluster, its nodes are drawn in a distinct rectangle of the layout. Clusters may be nested. rotate=90 sets landscape mode. (orientation=land is backward compatible but obsolete.) center=n a non‐zero value centers the drawing on the page. nslimit=f or mclimit=f adjusts the bound on the number of network simplex or mincross iterations by the given ratio. For example, mclimit=2.0 runs twice as long. layers="id:id:id:id" is a sequence of layer identifiers for overlay dia‐ grams. The PostScript array variable layercolorseq sets the assignment of colors to layers. The least index is 1 and each element must be a 3‐element array to be interpreted as a color coordinate. color=colorvalue sets foreground color (bgcolor for background). href="url" the default url for image map files; in PostScript files, the base URL for all relative URLs, as recognized by Acrobat Distiller 3.0 and up. URL="url" ("URL" is a synonym for "href".) stylesheet="file.css" includes a reference to a stylesheet in -Tsvg and -Tsvgz outputs. Ignored by other formats. splines. If set to true, edges are drawn as splines. If set to polyline, edges are drawn as polylines. If set to ortho, edges are drawn as orthogonal polylines. In all of these cases, the nodes may not overlap. If splines=false or splines=line, edges are drawn as line segments. The default is true for dot, and false for all other layouts. (neato‐specific attributes) start=val. Requests random initial placement and seeds the random number generator. If val is not an integer, the process ID or current time is used as the seed. epsilon=n. Sets the cutoff for the solver. The default is 0.1. (twopi‐specific attributes) root=ctr. This specifies the node to be used as the center of the layout. If not specified, twopi will randomly pick one of the nodes that are fur‐ thest from a leaf node, where a leaf node is a node of degree 1. If no leaf nodes exists, an arbitrary node is picked as center. ranksep=val. Specifies the radial distance in inches between the sequence of rings. The default is 0.75. overlap=mode. This specifies what twopi should do if any nodes overlap. If mode is "false", the program uses Voronoi diagrams to adjust the nodes to eliminate overlaps. If mode is "scale", the layout is uniformly scaled up, preserving node sizes, until nodes no longer overlap. The latter technique removes overlaps while preserving symmetry and structure, while the former removes overlaps more compactly but destroys symmetries. If mode is "true" (the default), no repositioning is done. (circo‐specific attributes) root=nodename. Specifies the name of a node occurring in the root block. If the graph is disconnected, the root node attribute can be used to specify additional root blocks. mindist=value. Sets the minimum separation between all nodes. If not specified then circo uses a default value of 1.0. (fdp‐specific attributes) K=val. Sets the default ideal node separation in the layout. maxiter=val. Sets the maximum number of iterations used to layout the graph. start=val. Adjusts the random initial placement of nodes with no speci‐ fied position. If val is is an integer, it is used as the seed for the random number generator. If val is not an integer, a random system‐gen‐ erated integer, such as the process ID or current time, is used as the seed. NODE ATTRIBUTES height=d or width=d sets minimum height or width. Adding fixedsize=true forces these to be the actual size (text labels are ignored). shape=record polygon epsf builtin_polygon builtin_polygon is one of: plaintext ellipse oval circle egg triangle box diamond trapezium parallelogram house hexagon octagon note tab box3d com‐ ponent. (Polygons are defined or modified by the following node attributes: regular, peripheries, sides, orientation, distortion and skew.) epsf uses the node's shapefile attribute as the path name of an external EPSF file to be automatically loaded for the node shape. label=text where text may include escaped newlines \n, \l, or \r for cen‐ ter, left, and right justified lines. The string '\N' value will be replaced by the node name. The string '\G' value will be replaced by the graph name. Record labels may contain recursive box lists delimited by { | }. Port identifiers in labels are set off by angle brackets < >. In the graph file, use colon (such as, node0:port28). fontsize=n sets the label type size to n points. fontname=name sets the label font family name. color=colorvalue sets the outline color, and the default fill color if style=filled and fillcolor is not specified. fillcolor=colorvalue sets the fill color when style=filled. If not spec‐ ified, the fillcolor when style=filled defaults to be the same as the outline color. fontcolor=colorvalue sets the label text color. A colorvalue may be "h,s,v" (hue, saturation, brightness) floating point numbers between 0 and 1, or an X11 color name such as white black red green blue yellow magenta cyan or burlywood, or a "#rrggbb" (red, green, blue, 2 hex characters each) value. style=filled solid dashed dotted bold invis or any Postscript code. layer=id or id:id or "all" sets the node's active layers. The empty string means no layers (invisible). The following attributes apply only to polygon shape nodes: regular=n if n is non‐zero then the polygon is made regular, i.e. symmet‐ ric about the x and y axis, otherwise the polygon takes on the aspect ratio of the label. builtin_polygons that are not already regular are made regular by this attribute. builtin_polygons that are already regu‐ lar are not affected (i.e. they cannot be made asymmetric). peripheries=n sets the number of periphery lines drawn around the poly‐ gon. This value supersedes the number of periphery lines of builtin_polygons. sides=n sets the number of sides to the polygon. n<3 results in an ellipse. This attribute is ignored by builtin_polygons. orientation=f sets the orientation of the first apex of the polygon coun‐ terclockwise from the vertical, in degrees. f may be a floating point number. The orientation of labels is not affected by this attribute. This attribute is added to the initial orientation of builtin_polygons. distortion=f sets the amount of broadening of the top and narrowing of the bottom of the polygon (relative to its orientation). Floating point values between -1 and +1 are suggested. This attribute is ignored by builtin_polygons. skew=f sets the amount of right‐displacement of the top and left‐dis‐ placement of the bottom of the polygon (relative to its orientation). Floating point values between -1 and +1 are suggested. This attribute is ignored by builtin_polygons. href="url" sets the url for the node in imagemap, PostScript and SVG files. The substrings '\N' and '\G' are substituted in the same manner as for the node label attribute. Additionally the substring '\L' is sub‐ stituted with the node label string. URL="url" ("URL" is a synonym for "href".) target="target" is a target string for client‐side imagemaps and SVG, effective when nodes have a URL. The target string is used to determine which window of the browser is used for the URL. Setting it to "_graphviz" will open a new window if it doesn't already exist, or reuse it if it does. If the target string is empty, the default, then no tar‐ get attribute is included in the output. The substrings '\N' and '\G' are substituted in the same manner as for the node label attribute. Additionally the substring '\L' is substituted with the node label string. tooltip="tooltip" is a tooltip string for client‐side imagemaps and SVG, effective when nodes have a URL. The tooltip string defaults to be the same as the label string, but this attribute permits nodes without labels to still have tooltips thus permitting denser graphs. The substrings '\N' and '\G' are substituted in the same manner as for the node label attribute. Additionally the substring '\L' is substituted with the node label string. (circo‐specific attributes) root=true/false. This specifies that the block containing the given node be treated as the root of the spanning tree in the layout. (fdp‐specific attributes) pin=val. If val is "true", the node will remain at its initial position. EDGE ATTRIBUTES minlen=n where n is an integer factor that applies to the edge length (ranks for normal edges, or minimum node separation for flat edges). weight=n where n is the integer cost of the edge. Values greater than 1 tend to shorten the edge. Weight 0 flat edges are ignored for ordering nodes. label=text where text may include escaped newlines \n, \l, or \r for cen‐ tered, left, or right justified lines. If the substring '\T' is found in a label it will be replaced by the tail_node name. If the substring '\H' is found in a label it will be replaced by the head_node name. If the substring '\E' value is found in a label it will be replaced by: tail_node_name->head_node_name If the substring '\G' is found in a label it will be replaced by the graph name. or by: tail_node_name--head_node_name for undirected graphs. fontsize=n sets the label type size to n points. fontname=name sets the label font family name. fontcolor=colorvalue sets the label text color. style=solid dashed dotted bold invis color=colorvalue sets the line color for edges. color=colorvaluelist a ':' separated list of colorvalue creates parallel edges, one edge for each color. dir=forward back both none controls arrow direction. tailclip,headclip=false disables endpoint shape clipping. href="url" sets the url for the node in imagemap, PostScript and SVG files. The substrings '\T', '\H', '\E' and '\G' are substituted in the same manner as for the edge label attribute. Additionally the substring '\L' is substituted with the edge label string. URL="url" ("URL" is a synonym for "href".) target="target" is a target string for client‐side imagemaps and SVG, effective when edges have a URL. If the target string is empty, the default, then no target attribute is included in the output. The sub‐ strings '\T', '\H', '\E' and '\G' are substituted in the same manner as for the edge label attribute. Additionally the substring '\L' is substi‐ tuted with the edge label string. tooltip="tooltip" is a tooltip string for client‐side imagemaps effective when edges have a URL. The tooltip string defaults to be the same as the edge label string. The substrings '\T', '\H', '\E' and '\G' are substi‐ tuted in the same manner as for the edge label attribute. Additionally the substring '\L' is substituted with the edge label string. arrowhead,arrowtail=none, normal, inv, dot, odot, invdot, invodot, tee, empty, invempty, open, halfopen, diamond, odiamond, box, obox, crow. arrowsize (norm_length=10,norm_width=5, inv_length=6,inv_width=7,dot_radius=2) headlabel,taillabel=string for port labels. labelfontcolor,labelfont‐ name,labelfontsize for head and tail labels. The substrings '\T', '\H', '\E' and '\G' are substituted in the same manner as for the edge label attribute. Additionally the substring '\L' is substituted with the edge label string. headhref="url" sets the url for the head port in imagemap, PostScript and SVG files. The substrings '\T', '\H', '\E' and '\G' are substituted in the same manner as for the edge label attribute. Additionally the sub‐ string '\L' is substituted with the edge label string. headURL="url" ("headURL" is a synonym for "headhref".) headtarget="headtarget" is a target string for client‐side imagemaps and SVG, effective when edge heads have a URL. The headtarget string is used to determine which window of the browser is used for the URL. If the headtarget string is empty, the default, then headtarget defaults to the same value as target for the edge. The substrings '\T', '\H', '\E' and '\G' are substituted in the same manner as for the edge label attribute. Additionally the substring '\L' is substituted with the edge label string. headtooltip="tooltip" is a tooltip string for client‐side imagemaps effective when head ports have a URL. The tooltip string defaults to be the same as the headlabel string. The substrings '\T', '\H', and '\E' are substituted in the same manner as for the edge label attribute. Additionally the substring '\L' is substituted with the edge label string. tailhref="url" sets the url for the tail port in imagemap, PostScript and SVG files. The substrings '\T', '\H', '\E' and '\G' are substituted in the same manner as for the edge label attribute. Additionally the sub‐ string '\L' is substituted with the edge label string. tailURL="url" ("tailURL" is a synonym for "tailhref".) tailtarget="tailtarget" is a target string for client‐side imagemaps and SVG, effective when edge tails have a URL. The tailtarget string is used to determine which window of the browser is used for the URL. If the tailtarget string is empty, the default, then tailtarget defaults to the same value as target for the edge. The substrings '\T', '\H', '\E' and '\G' are substituted in the same manner as for the edge label attribute. Additionally the substring '\L' is substituted with the edge label string. tailtooltip="tooltip" is a tooltip string for client‐side imagemaps effective when tail ports have a URL. The tooltip string defaults to be the same as the taillabel string. The substrings '\T', '\H', '\E' and '\G' are substituted in the same manner as for the edge label attribute. Additionally the substring '\L' is substituted with the edge label string. labeldistance and port_label_distance set distance; also labelangle (in degrees CCW) decorate draws line from edge to label. samehead,sametail aim edges having the same value to the same port, using the average landing point. constraint=false causes an edge to be ignored for rank assignment. layer=id or id:id or "all" sets the edge's active layers. The empty string means no layers (invisible). (neato‐specific attributes) w=f sets the weight (spring constant) of an edge to the given floating point value. The default is 1.0; greater values make the edge tend more toward its optimal length. len=f sets the optimal length of an edge. The default is 1.0. (fdp‐specific attributes) weight=f sets the weight of an edge to the given floating point value. The default is 1.0; greater values make the edge tend more toward its optimal length. COMMAND LINE OPTIONS -G sets a default graph attribute. -N sets a default node attribute. -E sets a default edge attribute. Example: -Gsize="7,8" -Nshape=box -Efontsize=8 -lfile loads custom PostScript library files. Usually these define cus‐ tom shapes or styles. If -l is given by itself, the standard library is omitted. -Tlang sets the output language as described above. -n[1|2] (no‐op) If set, neato assumes nodes have already been positioned and all nodes have a pos attribute giving the positions. It then per‐ forms an optional adjustment to remove node‐node overlap, depending on the value of the overlap attribute, computes the edge layouts, depending on the value of the splines attribute, and emits the graph in the appro‐ priate format. If num is supplied, the following actions occur: num = 1 Equivalent to -n. num > 1 Use node positions as specified, with no adjustment to remove node‐node overlaps, and use any edge layouts already specified by the pos attribute. neato computes an edge layout for any edge that does not have a pos attribute. As usual, edge layout is guided by the splines attribute. -Klayout override the default layout engine implied by the command name. -O automatically generate output filenames based on the input filename and the -T format. -P generate a graph of the currently available plugins. -v (verbose) prints various information useful for debugging. -V (version) prints version information and exits. -? prints the usage and exits. EXAMPLES digraph test123 { a -> b -> c; a -> {x y}; b [shape=box]; c [label="hello\nworld",color=blue,fontsize=24, fontname="Palatino-Italic",fontcolor=red,style=filled]; a -> z [label="hi", weight=100]; x -> z [label="multi-line\nlabel"]; edge [style=dashed,color=red]; b -> x; {rank=same; b x} } graph test123 { a -- b -- c; a -- {x y}; x -- c [w=10.0]; x -- y [w=5.0,len=3]; } CAVEATS Edge splines can overlap unintentionally. Flat edge labels are slightly broken. Intercluster edge labels are totally broken. Because unconstrained optimization is employed, node boxes can possibly overlap or touch unrelated edges. All existing spring embedders seem to have this limitation. Apparently reasonable attempts to pin nodes or adjust edge lengths and weights can cause instability. AUTHORS Stephen C. North<EMAIL_ADDRESS>Emden R. Gansner<EMAIL_ADDRESS>John C. Ellson<EMAIL_ADDRESS>The bitmap driver (PNG, GIF etc) is by Thomas Boutell, <http://www.boutell.com/gd> The Truetype font renderer is from the Freetype Project (David Turner, Robert Wilhelm, and Werner Lemberg) (who can be contacted at freetype-devel@lists.lrz-muenchen.de). SEE ALSO This man page contains only a small amount of the information related to the Graphviz layout programs. The most complete information can be found at http://www.graphviz.org/Documentation.php, especially in the on‐line reference pages. Most of these documents are also available in the doc and doc/info subtrees in the source and binary distributions. dotty(1),tcldot(n),xcolors(1),libgraph(3). E. R. Gansner, S. C. North, K. P. Vo, "DAG ‐ A Program to Draw Directed Graphs", Software ‐ Practice and Experience 17(1), 1988, pp. 1047‐1062. E. R. Gansner, E. Koutsofios, S. C. North, K. P. Vo, "A Technique for Drawing Directed Graphs," IEEE Trans. on Soft. Eng. 19(3), 1993, pp. 214‐230. S. North and E. Koutsofios, "Applications of graph visualization", Graph‐ ics Interface 94, pp. 234‐245. E. Koutsofios and S. C. North, "Drawing Graphs with dot," Available on research.att.com in dist/drawdag/dotguide.ps.Z. S. C. North, "NEATO User's Manual". Available on research.att.com in dist/drawdag/neatodoc.ps.Z. 23 August 2004 DOT(1)


CSSForm is a YUI module that makes it easy to display good looking forms on your website.
Default Form
Multi-Column Form (with YUI Grids)
Multi-column forms such as the one below can be created by pulling down YUI Grids.
Stacked Form
Apply stacked label styling to any form by applying the yui3-form-stacked
classname.
Aligned Form
Aligned forms are great for standard forms that look well-aligned. The labels are right-aligned against the form input controls.
Grouped Inputs
Grouped inputs are great for grouping small sets of text-based input elements. They work well for sign-up forms, and look natural on mobile devices.
Input Sizing
You can take advantage of YUI Grids and the yui3-input-block
class to create fluid width inputs in practically any size that you want.
Invalid Inputs
Add the required attribute to any form control.
Disabled Inputs
Add the disabled attribute to any form control.
Rounded Form
Add the yui3-input-rounded classname to any form control.


iOS Related Projects
Gem Town
Title:
Gem Town(an iOS game)
Date: 08/03/2011
Description:
This is a classic match-3 board game, which has iPhone/iPad versions, and developed based on cocos2d.
I developed it for about 10 days with graphics outsourcing, and it is great to launch a game in App Store and watch the downloads each day.
It's not so good in revenue, but it proves something in App Store marketing, and leads me to the correct way in developing a good game.
Links:
- iPhone: iPhone Version
- iPad: iPad Version
Perceptual Ability Test
Title:
Perceptual Ability Test
Date: 11/17/2011
Description:
Perceptual Ability Test app has angle ranking, cube counting, top-front-end, hole punch and pattern folding. Hundreds of practice problems to get you ready for the DAT exam. Perceptual ability testing has never been more enjoyable! You will be ready for the PAT portion of the DAT test in no time.
Links:
Python Related Projects
Freshfanatic
Title:
FreshFanatic(A Django Based Site)
Date: 08/11/2010
Description:
I developed this site 2 years ago, using Django framework(esp. the satchmo). freshfanatic.com is an e-Commerce site, which needs lot of adding/editing/deleting operations each day, so we refined the admin interface to make these easy.
It's good to hear from the employer that the site was as good as he was expecting, even beyond his expectation in some points. This makes me really happy.
The site is different from what it was 2 years ago, but I think most of code base is still there.
Links:
- Site: FreshFanatic
Enchanted Diamonds
Title:
Enchanted Diamonds(A Django Based ecommerce Site)
Date: 10/11/2010
Description:
I developed this site 2 years ago, using Django framework(esp. the satchmo). enchanteddiamonds.com is an e-Commerce site, which sells diamonds online.
Quoted from the site:
Enchanted Diamonds is creating a new way to shop for diamonds. Our main interest is your satisfaction and we know that the educated buyer is the happiest customer. That is the reason why we will take the time to personally connect with you, our customer in order to show you what to look for and what to avoid when buying a diamond.
Links:
- Site: Enchanted Diamonds


Datafiles model is no longer in use.
closed
by Kevin Reiss at 2022-05-18 03:20:04.labeled
by Kevin Reiss at 2022-05-18 03:54:50.If this works well, we should add this task to the other smaller rails projects with admin users (lockers, repec).
unassigned
by Jane Sandberg at 2022-05-18 03:20:59.labeled
by Kevin Reiss at 2022-05-18 03:54:37.Use of datafiles is deprecated for new items. The only content related to datafiles in the system is legacy.
closed
by Kevin Reiss at 2022-05-18 12:51:57.labeled
by Kevin Reiss at 2022-05-18 12:52:46.renamed
by Kevin Reiss at 2022-05-18 12:53:01.assigned
by None at 2022-05-18 13:08:12.labeled
by None at 2022-05-18 13:11:21.assigned
by None at 2022-05-18 15:21:50.closed
by Christina Chortaria at 2022-05-18 16:30:56.deployed
by None at 2022-05-18 16:31:55.head_ref_deleted
by Christina Chortaria at 2022-05-18 17:44:02.closed
by None at 2022-05-18 18:26:30.head_ref_force_pushed
by Christina Chortaria at 2022-05-18 14:17:49.closed
by Christina Chortaria at 2022-05-18 16:21:58.reopened
by Christina Chortaria at 2022-05-18 16:29:11.head_ref_force_pushed
by Christina Chortaria at 2022-05-18 16:30:15.ready_for_review
by Christina Chortaria at 2022-05-18 16:31:11.deployed
by None at 2022-05-18 16:31:55.referenced
by None at 2022-05-18 18:26:30.merged
by None at 2022-05-18 18:26:30.closed
by None at 2022-05-18 18:26:30.head_ref_deleted
by None at 2022-05-18 18:26:31.closed
by None at 2022-05-17 22:38:33.closes #203
ready_for_review
by None at 2022-05-17 22:34:07.review_requested
by None at 2022-05-17 22:34:18.renamed
by None at 2022-05-18 15:23:52.assigned
by None at 2022-05-18 18:31:38.labeled
by None at 2022-05-19 00:07:58.Superseded by #30.
closed
by None at 2022-05-19 00:08:00.head_ref_deleted
by None at 2022-05-19 00:08:01.closed
by Kevin Reiss at 2022-05-18 17:22:10.closed
by Christina Chortaria at 2022-05-18 18:22:20.referenced
by Kevin Reiss at 2022-05-18 17:22:10.merged
by Kevin Reiss at 2022-05-18 17:22:10.closed
by Kevin Reiss at 2022-05-18 17:22:10.head_ref_deleted
by Kevin Reiss at 2022-05-18 17:22:11.head_ref_restored
by Christina Chortaria at 2022-05-18 18:22:49.referenced
by Christina Chortaria at 2022-05-18 18:22:57.convert_to_draft
by Christina Chortaria at 2022-05-18 18:45:46.head_ref_force_pushed
by Christina Chortaria at 2022-05-18 18:51:18.ready_for_review
by Christina Chortaria at 2022-05-18 18:52:12.referenced
by Max Kadel at 2022-05-18 19:03:39.merged
by Max Kadel at 2022-05-18 19:03:39.closed
by Max Kadel at 2022-05-18 19:03:39.head_ref_deleted
by Max Kadel at 2022-05-18 19:03:40.unassigned
by None at 2022-05-18 19:08:59.I kind of like the idea of one button, when clicked, giving you options for what you want to alert folks to. It would be cleaner and I think would serve the same purpose. @sdellis , what are your thoughts?
@kelea99 my first thought on this is that the Statement on Harmful Content page does not allow users to report harmful content. It just says we are working on a form that will arrive at some point in the future. My thoughts are that this ticket will be blocked until we can get the appropriate forms in place for reporting.
As for the single button, our recent usability testing with Finding Aids was that it was unintuitive for folks to use a single button for both "suggesting a correction" and "reporting harmful language". If the label were generic enough (i.e., "report a problem"), then it might work to have a dropdown of options. I would advocate for an "Other" option for anything we haven't listed.
One additional issue is that we do not always know where a user is seeing the problem. How will we provide enough contextual information if we are sending the user from the viewer off to another site to report the problem? For example, it could be in a paragraph on page 325 of an ACLU manuscript in an unknown component and unless the user can convey all the correct information manually, we may have trouble tracking it down. We also don't know where to forward the report without the contextual information that tells us who is responsible for taking action, so it would become someone's task to locate the problem and then route the correspondence accordingly.
Finally, people who are reporting harmful content and offensive language may want to do so anonymously as they may fear repercussions. We should have this conversation as opening up such a channel could subject those who manage the queue of complaints to harmful content as an anonymous form could be easily abused.
Our colleagues have worked hard on this statement and recommendation. What can we do to ensure we respect that work and implement the output of their time and research?
Full recommendation from that working group is here: https://lib-confluence.princeton.edu/display/COM/Statement+on+Harmful+Content
My reading of this recommendation is that part of the goal is to show that we're taking harmful content seriously as a profession and masking it behind extra buttons or pages will bury its importance. With that in mind, I'd like to repeat the options I've heard so far with some inline questions:
I don't know if this is feasible or practical, but one idea I had was to make the alert icon open up a menu or otherwise expand to show a few sentences that would briefly explain the options for reporting items or engaging with us., including links to the takedown form, and other forms as they are ready to link to. Doing this in the viewer instead of a separate page would address the concern that @sdellis raised above about losing the referrer URL (which I agree is essential in those forms to make the feedback actionable). In theory, I could imagine adding even more info to the URL (such as which page the viewer is displaying) to make this even more granular than it is now.
If it helps, I was on this group and can give my two cents: 1. Is the lack of a form a blocker for the dissemination of our statement? The recommendations are important to see as multiple, versus an all or nothing. The importance of disseminating/making discoverable our dynamic statement on harmful content was a priority for the group and something we felt we could do now versus waiting. The full statement has already been edited to include the great work folks have done in PULFAlight, and will be updated again when similar forms are available in other platforms. I will say, when we shared our work with folks doing similar initiatives at other institutions that have implemented forms/feedback mechanisms, all parties confirmed that they had zero feedback for this issue to date. 2. That is really good information to have, @sdellis with regard to the user testing of the buttons combined versus broken out and what those buttons go to (i.e. how will we know what they are commenting on, if it goes to a form?). I wonder if we should ask ourselves what makes sense to have as a link in the viewer versus a button/buttons within the application. what is redundant? what works better where? I hope this is making sense.
I may have misunderstood. This ticket is not about implementing a way to report harmful content or description, it's about making people aware of our statements and policies. Just to be clear, the Statement on Harmful Content provides no information on who to contact or how. I think if we care about this issue (which we all do) we need to provide a good user experience for actually reporting harmful language. A bad experience or dead end is going to make it look like we threw it together to check a DEI box without actually investing in the goal.
Also, if it's placed on the viewer, where do we put the content warning for content that is not digitized? Or are we only warning users about digital content?
FWIW, the icons I've seen for reporting problems are typically "word bubbles with an exclamation mark" or a flag (for flagging problems).
I like the idea of a word bubble with exclamation mark icon that triggers a pulldown menu with each of these links.
mentioned
by Shaun Ellis at 2022-05-18 12:41:38.subscribed
by Shaun Ellis at 2022-05-18 12:41:38.mentioned
by Kim Leaman at 2022-05-18 15:52:17.subscribed
by Kim Leaman at 2022-05-18 15:52:17.mentioned
by Shaun Ellis at 2022-05-18 17:01:00.subscribed
by Shaun Ellis at 2022-05-18 17:01:00.mentioned
by Shaun Ellis at 2022-05-18 17:56:33.subscribed
by Shaun Ellis at 2022-05-18 17:56:33.@christinach I think we can close this one. Please confirm.
yes we can close it
mentioned
by Christina Chortaria at 2022-05-18 03:22:04.subscribed
by Christina Chortaria at 2022-05-18 03:22:04.closed
by Christina Chortaria at 2022-05-18 03:58:48.@mzelesky @regineheberlein I believe this is an old issue duplicating work that was just concluded. Re-open if you think this needs further discussion.
closed
by Kevin Reiss at 2022-05-18 03:18:09.mentioned
by None at 2022-05-18 03:18:09.subscribed
by None at 2022-05-18 03:18:09.mentioned
by None at 2022-05-18 03:18:10.subscribed
by None at 2022-05-18 03:18:10.referenced
by None at 2022-05-18 12:16:26.merged
by None at 2022-05-18 12:16:26.closed
by None at 2022-05-18 12:16:27.head_ref_deleted
by None at 2022-05-18 12:16:27.labeled
by Kevin Reiss at 2022-05-18 16:30:08.labeled
by Christina Chortaria at 2022-05-18 18:16:32.deployed
by None at 2022-05-18 13:03:27.deployed
by None at 2022-05-18 17:50:47.deployed
by None at 2022-05-18 17:58:51.referenced
by Christina Chortaria at 2022-05-18 19:02:04.merged
by Christina Chortaria at 2022-05-18 19:02:04.closed
by Christina Chortaria at 2022-05-18 19:02:04.head_ref_deleted
by Christina Chortaria at 2022-05-18 19:02:05.ready_for_review
by Max Kadel at 2022-05-18 19:44:18.deployed
by None at 2022-05-18 19:44:57.labeled
by Kevin Reiss at 2022-05-18 03:04:36.labeled
by Kevin Reiss at 2022-05-18 17:19:30.closed
by James R. Griffin III at 2022-05-18 14:31:33.review_requested
by James R. Griffin III at 2022-05-18 14:05:53.referenced
by James R. Griffin III at 2022-05-18 14:31:33.merged
by James R. Griffin III at 2022-05-18 14:31:33.closed
by James R. Griffin III at 2022-05-18 14:31:33.head_ref_deleted
by James R. Griffin III at 2022-05-18 14:31:34.If we want to prototype this without hitting the ORCID API we could create a route (e.g. /orcid/lookup/:id
) that receives an ORCID and returns the correct information as JSON to the client. We could use the data in this other ticket https://github.com/pulibrary/rdss-catchall/issues/60 as a starting point.
closed
by Bess Sadler at 2022-05-18 19:14:44.ready_for_review
by Hector Correa at 2022-05-18 19:04:07.referenced
by Bess Sadler at 2022-05-18 19:14:44.merged
by Bess Sadler at 2022-05-18 19:14:44.closed
by Bess Sadler at 2022-05-18 19:14:44.head_ref_deleted
by Bess Sadler at 2022-05-18 19:14:45.May be able to utilize the data here to may solr synonyms https://en.wiktionary.org/wiki/Appendix:English_given_names
This was confirmed as completed by @kayiwa and @carolyncole
closed
by James R. Griffin III at 2022-05-18 14:09:23.mentioned
by Francis Kayiwa at 2022-05-18 14:09:23.subscribed
by Francis Kayiwa at 2022-05-18 14:09:23.mentioned
by None at 2022-05-18 14:09:23.subscribed
by None at 2022-05-18 14:09:23.@sdellis I was able to confirm with @slogue today that we can remove the New finding aids text and just leave the access link.
Is this something that we can do out of cycle?
mentioned
by Shaun Ellis at 2022-05-18 17:40:12.subscribed
by Shaun Ellis at 2022-05-18 17:40:12.mentioned
by None at 2022-05-18 17:40:12.subscribed
by None at 2022-05-18 17:40:12.We can fix it here: https://github.com/pulibrary/pulfalight/blob/main/app/views/catalog/_hours.html.erb
assigned
by Kate Lynch at 2022-05-18 15:16:36.labeled
by None at 2022-05-18 22:33:04.Superseded by #26.
closed
by None at 2022-05-18 22:33:06.head_ref_deleted
by None at 2022-05-18 22:33:07.labeled
by None at 2022-05-18 23:53:59.labeled
by None at 2022-05-18 23:53:59.Superseded by #707.
closed
by None at 2022-05-18 23:54:00.head_ref_deleted
by None at 2022-05-18 23:54:01.referenced
by None at 2022-05-18 13:16:58.merged
by None at 2022-05-18 13:16:58.closed
by None at 2022-05-18 13:16:58.head_ref_deleted
by None at 2022-05-18 13:16:59.


The DOMTypeInfo
interface represent a type used by DOMElement
or DOMAttr
nodes, specified in the schemas associated with the document.
More...
#include <DOMTypeInfo.hpp>
Public Types | |
Public Contants | |
| enum | DerivationMethods { DERIVATION_RESTRICTION = 0x001, DERIVATION_EXTENSION = 0x002, DERIVATION_UNION = 0x004, DERIVATION_LIST = 0x008 } |
These are the available values for the derivationMethod parameter used by the method | |
Public Member Functions | |
Destructor | |
| virtual | ~DOMTypeInfo () |
| Destructor. | |
| virtual const XMLCh * | getTypeName () const =0 |
Returns The name of a type declared for the associated DOMElement or DOMAttr , or null if unknown. | |
| virtual const XMLCh * | getTypeNamespace () const =0 |
The namespace of the type declared for the associated DOMElement or DOMAttr or null if the DOMElement does not have declaration or if no namespace information is available. | |
| virtual bool | isDerivedFrom (const XMLCh *typeNamespaceArg, const XMLCh *typeNameArg, DerivationMethods derivationMethod) const =0 |
| This method returns if there is a derivation between the reference type definition, i.e. | |
Protected Member Functions | |
Hidden constructors | |
| DOMTypeInfo () |
The DOMTypeInfo
interface represent a type used by DOMElement
or DOMAttr
nodes, specified in the schemas associated with the document.
The type is a pair of a namespace URI and name properties, and depends on the document's schema.
These are the available values for the derivationMethod parameter used by the method DOMTypeInfo::isDerivedFrom()
.
It is a set of possible types of derivation, and the values represent bit positions. If a bit in the derivationMethod parameter is set to 1, the corresponding type of derivation will be taken into account when evaluating the derivation between the reference type definition and the other type definition. When using the isDerivedFrom method, combining all of them in the derivationMethod parameter is equivalent to invoking the method for each of them separately and combining the results with the OR boolean function. This specification only defines the type of derivation for XML Schema.
In addition to the types of derivation listed below, please note that:
DERIVATION_EXTENSION:
If the document's schema is an XML Schema [XML Schema Part 1], this constant represents the derivation by extension. The reference type definition is derived by extension from the other type definition if the other type definition can be reached recursively following the {base type definition} property from the reference type definition, and at least one of the derivation methods involved is an extension.
DERIVATION_LIST:
If the document's schema is an XML Schema [XML Schema Part 1], this constant represents the list. The reference type definition is derived by list from the other type definition if there exists two type definitions T1 and T2 such as the reference type definition is derived from T1 by DERIVATION_RESTRICTION or DERIVATION_EXTENSION, T2 is derived from the other type definition by DERIVATION_RESTRICTION, T1 has {variety} list, and T2 is the {item type definition}. Note that T1 could be the same as the reference type definition, and T2 could be the same as the other type definition.
DERIVATION_RESTRICTION:
If the document's schema is an XML Schema [XML Schema Part 1], this constant represents the derivation by restriction if complex types are involved, or a restriction if simple types are involved. The reference type definition is derived by restriction from the other type definition if the other type definition is the same as the reference type definition, or if the other type definition can be reached recursively following the {base type definition} property from the reference type definition, and all the derivation methods involved are restriction.
DERIVATION_UNION:
If the document's schema is an XML Schema [XML Schema Part 1], this constant represents the union if simple types are involved. The reference type definition is derived by union from the other type definition if there exists two type definitions T1 and T2 such as the reference type definition is derived from T1 by DERIVATION_RESTRICTION or DERIVATION_EXTENSION, T2 is derived from the other type definition by DERIVATION_RESTRICTION, T1 has {variety} union, and one of the {member type definitions} is T2. Note that T1 could be the same as the reference type definition, and T2 could be the same as the other type definition.
| xercesc::DOMTypeInfo::DOMTypeInfo | ( | ) | [inline, protected] |
| virtual xercesc::DOMTypeInfo::~DOMTypeInfo | ( | ) | [inline, virtual] |
Destructor.
| virtual const XMLCh* xercesc::DOMTypeInfo::getTypeName | ( | ) | const [pure virtual] |
Returns The name of a type declared for the associated DOMElement
or DOMAttr
, or null if unknown.
DOMElement
or DOMAttribute
, or null if unknown. | virtual const XMLCh* xercesc::DOMTypeInfo::getTypeNamespace | ( | ) | const [pure virtual] |
The namespace of the type declared for the associated DOMElement
or DOMAttr
or null if the DOMElement
does not have declaration or if no namespace information is available.
DOMElement
or DOMAttr
or null if the DOMElement
does not have declaration or if no namespace information is available. | virtual bool xercesc::DOMTypeInfo::isDerivedFrom | ( | const XMLCh * | typeNamespaceArg, | |
| const XMLCh * | typeNameArg, | |||
| DerivationMethods | derivationMethod | |||
| ) | const [pure virtual] |
This method returns if there is a derivation between the reference type definition, i.e.
the DOMTypeInfo on which the method is being called, and the other type definition, i.e. the one passed as parameters.
| typeNamespaceArg | The namespace of the other type definition. | |
| typeNameArg | The name of the other type definition. | |
| derivationMethod | The type of derivation and conditions applied between two types, as described in the list of constants provided in this interface. |


ppmtoxpm(1) ppmtoxpm(1) NAME ppmtoxpm - convert a portable pixmap into an X11 pixmap SYNOPSIS ppmtoxpm [-name=xpmname] [-rgb=rgb-textfile] [-alphamask=pgmfile] [ppm‐ file] Minimum unique abbrevations are acceptable. DESCRIPTION Reads a portable pixmap as input. Produces X11 pixmap (version 3) as output which can be loaded directly by the XPM library. For example, to convert the file "dot" (found in /usr/include/X11/bit‐ maps), from xbm to xpm one could specify xbmtopbm dot | ppmtoxpm -name dot or, with a rgb text file (in the local directory) xbmtopbm dot | ppmtoxpm -name dot -rgb rgb.txt OPTIONS -name=xpmname The -name option allows you to specify the prefix string which is printed in the resulting XPM output. If not specified, will default to the filename (without extension) of the <ppmfile> argu‐ ment. If you do not specify -name or ppmfile, (i.e. your input is from Standad Input), the prefix string defaults to the string no‐ name. rgb=rgb-textfile The -rgb option allows you to specify an X11 rgb text file for the lookup of color name mnemonics. This rgb text file is typically the /usr/lib/X11/rgb.txt of the MIT X11 distribution, but any file using the same format may be used. When specified and a RGB value from the ppm input matches a RGB value from the <rgb-textfile>, then the corresponding color name mnemonic is printed in the XPM's colormap. If you don't specify -rgb or if the RGB values don't match, then ppmtoxpm produces the color specifications in the #RGB, #RRGGBB, #RRRGGGBBB, or #RRRRGGGGBBBB hexadecimal format. -alphamask=pgmfile This option names a PGM file to use as an alpha (transparency) mask. The file must contain an image the same dimensions as the input image. ppmtoxpm marks as transparent any pixel whose posi‐ tion in the alpha mask image is at most half white. If you don't specify -alphamask, ppmtoxpm makes all pixels in the output opaque. ppmcolormask is one way to generate an alpha mask file. You might also generate it by extracting transparency information from an XPM file with the -alphaout option to xpmtoppm. There are similar options on other Netpbm converters that convert from formats that include transparency information too. LIMITATIONS An option to match the closest (rather than exact) color name mnemonic from the rgb text would be a desirable enhancement. Truncation of the least significant bits of a RGB value may result in nonexact matches when performing color name mnemonic lookups. SEE ALSO ppmcolormask(1), xpmtoppm(1), ppm(5) XPM Manual by Arnaud Le Hors<EMAIL_ADDRESS>AUTHOR Copyright (C) 1990 by Mark W. Snitily. Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documen‐ tation. This software is provided "as is" without express or implied warranty. This tool was developed for Schlumberger Technologies, ATE Division, and with their permission is being made available to the public with the above copyright notice and permission notice. Upgraded to XPM2 by Paul Breslaw, Mecasoft SA, Zurich, Switzerland<EMAIL_ADDRESS>Thu Nov 8 16:01:17 1990 Upgraded to XPM version 3 by Arnaud Le Hors<EMAIL_ADDRESS>Tue Apr 9 1991 Tue Apr 9 1991 ppmtoxpm(1)


End Of The Month Update
January 2021
After working with Kotlin for the
past few weeks, I've gotten a
better understanding of it.
However, I've returned to java to finish
my current project. My current progress
for theproject is going well. It should
be completed by next week.
New Year
January 2021
The New Year hasn't changed much.
My laptop has started to encounter
some internal errors Until the
internal problems are resolved,
I can't develop any android applications.
Blog Update
December 2020
Implemented new page android tips
I wanted to update my website but
im encountering alot of errors
read moreProfile Update
19 October 2020
I decided to upgrade this
with a profile picture by
a software called inkscape
read moreLong Weekend
October 2020
Long weekend is coming up
the public was told to use
the countries scanning app.
read moreDevelopment
September 2020
Recently I have been taking
online course for the language
Kotlin, Im going to use these
skils to make a project
read moreRevision
August 2020
I went back through my
University notes and looked
into prototyping. If I only
found Figma eariler
read moreUpskilling
July 2020
The fundamentals of programming
are important to understand
what is needed to resolve any
issues
read moreImprovements
June 2020
June 2020
Security is becoming more
important with the ever
evolving technological trends
read moreInstall IDLE
April 2020
I have finally Installed the
android studio program on my
linux operating system.
read moreStatus
March 2020
Covid-19 is still here. It
has been challenging to get
through this month. I would
called in to cover someones
shift
Covid-19
February 2020 update
New Zealand has announced
the first patient with
Covid-19.
Update
February 2020
February is finally here.
Covid-19 around the world
has not changed.
New Year
January 2020
The Christmas season is finally
over. Hopefully the grocery
shopping will go back to normal.
Christmas
December 2019
I won't have time for any
upskilling because the christmas
shifts are here.
Blog
November 2019
One month of working with
elementary os. Encountering some
problems atleast I can do my
daily tasks.
New
October 2019
I am currently working I have
very little time to access my
laptop. I changed to an linux
operating system in the hopes
of becoming more productive.


You will need the internet address of the iCalendar feed (copy it from the practice tool site after clicking on "Get iCal Feed").
At this point you should see your calender(s) in the main window, and a list of calendars on the left side
Once you click OK, and click OK again on the next dialog, you will be subscribed to the calendar you selected in the practice tool. If you ever want to remove this calendar in the future, just right click on the calendar (under Other Calendars) and choose Delete.


Simply add the classname SubtleTemplate to any element that should serve as a sub-template.
SubtleTemplate
That node and all of its children will be used as a new template for whatever key you add after it. EG: SubtleTemplate whatever_key
SubtleTemplate whatever_key
EG:


Mongoose 2.7.x
What's Mongoose?
Mongoose is a MongoDB object modeling tool designed to work in an asynchronous environment.
Defining a model is as easy as:
var Comments = new Schema({
title : String
, body : String
, date : Date
});
var BlogPost = new Schema({
author : ObjectId
, title : String
, body : String
, buf : Buffer
, date : Date
, comments : [Comments]
, meta : {
votes : Number
, favs : Number
}
});
var Post = mongoose.model('BlogPost', BlogPost);
Installation
The recommended way is through the excellent NPM:
$ npm install mongoose
Otherwise, you can check it in your repository and then expose it:
$ git clone git://github.com/LearnBoost/mongoose.git node_modules/mongoose/
And install dependency modules written on package.json
.
Then you can require
it:
require('mongoose')
Connecting to MongoDB
First, we need to define a connection. If your app uses only one database, you should use mongoose.connect
. If you need to create additional connections, use mongoose.createConnection
.
Both connect
and createConnection
take a mongodb://
URI, or the parameters host, database, port, options
.
var mongoose = require('mongoose');
mongoose.connect('mongodb://localhost/my_database');
Once connected, the open
event is fired on the Connection
instance. If you're using mongoose.connect
, the Connection
is mongoose.connection
. Otherwise, mongoose.createConnection
return value is a Connection
.
Important! Mongoose buffers all the commands until it's connected to the database. This means that you don't have to wait until it connects to MongoDB in order to define models, run queries, etc.
Defining a Model
Models are defined through the Schema
interface.
var Schema = mongoose.Schema
, ObjectId = Schema.ObjectId;
var BlogPost = new Schema({
author : ObjectId
, title : String
, body : String
, date : Date
});
Aside from defining the structure of your documents and the types of data you're storing, a Schema handles the definition of:
- Validators (async and sync)
- Defaults
- Getters
- Setters
- Indexes
- Middleware
- Methods definition
- Statics definition
- Plugins
- DBRefs
The following example shows some of these features:
var Comment = new Schema({
name : { type: String, default: 'hahaha' }
, age : { type: Number, min: 18, index: true }
, bio : { type: String, match: /[a-z]/ }
, date : { type: Date, default: Date.now }
, buff : Buffer
});
// a setter
Comment.path('name').set(function (v) {
return capitalize(v);
});
// middleware
Comment.pre('save', function (next) {
notify(this.get('email'));
next();
});
Take a look at the example in examples/schema.js
for an end-to-end example of a typical setup.
Accessing a Model
Once we define a model through mongoose.model('ModelName', mySchema)
, we can access it through the same function
var myModel = mongoose.model('ModelName');
Or just do it all at once
var MyModel = mongoose.model('ModelName', mySchema);
We can then instantiate it, and save it:
var instance = new MyModel();
instance.my.key = 'hello';
instance.save(function (err) {
//
});
Or we can find documents from the same collection
MyModel.find({}, function (err, docs) {
// docs.forEach
});
You can also findOne
, findById
, update
, etc. For more details check out this link.
Important! If you opened a separate connection using mongoose.createConnection()
but attempt to access the model through mongoose.model('ModelName')
it will not work as expected since it is not hooked up to an active db connection. In this case access your model through the connection you created:
var conn = mongoose.createConnection('your connection string');
var MyModel = conn.model('ModelName', schema);
var m = new MyModel;
m.save() // works
vs
var conn = mongoose.createConnection('your connection string');
var MyModel = mongoose.model('ModelName', schema);
var m = new MyModel;
m.save() // does not work b/c the default connection object was never connected
Embedded Documents
In the first example snippet, we defined a key in the Schema that looks like:
comments: [Comments]
Where Comments
is a Schema
we created. This means that creating embedded documents is as simple as:
// retrieve my model
var BlogPost = mongoose.model('BlogPost');
// create a blog post
var post = new BlogPost();
// create a comment
post.comments.push({ title: 'My comment' });
post.save(function (err) {
if (!err) console.log('Success!');
});
The same goes for removing them:
BlogPost.findById(myId, function (err, post) {
if (!err) {
post.comments[0].remove();
post.save(function (err) {
// do something
});
}
});
Embedded documents enjoy all the same features as your models. Defaults, validators, middleware. Whenever an error occurs, it's bubbled to the save()
error callback, so error handling is a snap!
Mongoose interacts with your embedded documents in arrays atomically, out of the box.
Middleware
Middleware is one of the most exciting features about Mongoose. Middleware takes away all the pain of nested callbacks.
Middleware are defined at the Schema level and are applied for the methods init
(when a document is initialized with data from MongoDB), save
(when a document or embedded document is saved).
There's two types of middleware:
Serial
Serial middleware are defined like:.pre(method, function (next, methodArg1, methodArg2, ...) { // ... })
They're executed one after the other, when each middleware calls
next
.You can also intercept the
method
's incoming arguments via your middleware -- noticemethodArg1
,methodArg2
, etc in thepre
definition above. See section "Intercepting and mutating method arguments" below.Parallel
Parallel middleware offer more fine-grained flow control, and are defined like:.pre(method, true, function (next, done, methodArg1, methodArg2) { // ... })
Parallel middleware can
next()
immediately, but the final argument will be called when all the parallel middleware have calleddone()
.
Error handling
If any middleware calls next
or done
with an Error
instance, the flow is interrupted, and the error is passed to the function passed as an argument.
For example:
schema.pre('save', function (next) {
// something goes wrong
next(new Error('something went wrong'));
});
// later...
myModel.save(function (err) {
// err can come from a middleware
});
Intercepting and mutating method arguments
You can intercept method arguments via middleware.
For example, this would allow you to broadcast changes about your Documents every time someone set
s a path in your Document to a new value:
schema.pre('set', function (next, path, val, typel) {
// `this` is the current Document
this.emit('set', path, val);
// Pass control to the next pre
next();
});
Moreover, you can mutate the incoming method
arguments so that subsequent middleware see different values for those arguments. To do so, just pass the new values to next
:
.pre(method, function firstPre (next, methodArg1, methodArg2) {
// Mutate methodArg1
next("altered-" + methodArg1.toString(), methodArg2);
})
// pre declaration is chainable
.pre(method, function secondPre (next, methodArg1, methodArg2) {
console.log(methodArg1);
// => 'altered-originalValOfMethodArg1'
console.log(methodArg2);
// => 'originalValOfMethodArg2'
// Passing no arguments to `next` automatically passes along the current argument values
// i.e., the following `next()` is equivalent to `next(methodArg1, methodArg2)`
// and also equivalent to, with the example method arg
// values, `next('altered-originalValOfMethodArg1', 'originalValOfMethodArg2')`
next();
})
Schema gotcha
type
, when used in a schema has special meaning within Mongoose. If your schema requires using type
as a nested property you must use object notation:
new Schema({
broken: { type: Boolean }
, asset : {
name: String
, type: String // uh oh, it broke. asset will be interpreted as String
}
});
new Schema({
works: { type: Boolean }
, asset : {
name: String
, type: { type: String } // works. asset is an object with a type property
}
});
API docs
You can find the Dox generated API docs here.
Getting support
Please subscribe to the Google Groups mailing list.
Join #mongoosejs on freenode.
Driver access
The driver being used defaults to node-mongodb-native and is directly accessible through YourModel.collection
. Note: using the driver directly bypasses all Mongoose power-tools like validation, getters, setters, hooks, etc.
Mongoose Plugins
Take a peek at the plugins page to see contributions from the community. Add your own!
Contributing to Mongoose
Cloning the repository
Make a fork of mongoose
, then clone it in your computer. The v2.x
branch contains the current stable release, and the master
branch the next upcoming major release.
Guidelines
- Please write inline documentation for new methods or class members.
- Please write tests and make sure your tests pass.
- Before starting to write code, look for existing tickets or create one for your specific issue (unless you're addressing something that's clearly broken). That way you avoid working on something that might not be of interest or that has been addressed already in a different branch.
Credits
- Guillermo Rauch -<EMAIL_ADDRESS>- Guille
- Nathan White - nw
- Brian Noguchi - bnoguchi
- Aaron Heckmann - aheckmann
License
Copyright (c) 2010-2012 LearnBoost<EMAIL_ADDRESS>Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


| Template Name | EPMFullResult |
| Status | Approved. This example WSDL is offered as a template for implementing web services using HR-XML. The target namespace is intended to be replaced with one belonging to the implementer. WSDL faults are included as placeholders. These could be used as is, removed, or replaced with those appropriate for the implementation. |
| Date | 2007-04-15 |
| Description | Defines an operation to process a full performance appraisal result. |
| Related Scenarios | Interactions between an EPM system and a talent management system requiring a full performance appraisal result (e.g., Learning Management Systems, Competency Management Systems, etc.) |
| Message Name | Content |
| Acknowledge | hrxml:Acknowledgement |
| ProcessEPMFullResult | hrxml:EPMResult |
| ProcessEPMFullResultFault | hrxml:FaultExtensible (Placeholder of type xs:any) |
| Operation | Description |
| ProcessEPMFullResult | ..... input: ProcessEPMFullResult ..... output: Acknowledge ..... fault: ProcessEPMFullResultFault |


Members
randomSeedReproductionCmd :function|undefined
A function that takes a random seed and returns the command to reproduce that seed. Use this to customize the output when using ConsoleReporter in a different command line tool.
Type:
- function | undefined
showColors :Boolean|undefined
Whether to colorize the output
Type:
- Boolean | undefined
- Default Value:
- false


| Key | Description | ||||
|---|---|---|---|---|---|
| Donut2D Plugin | Donut2D plugin takes responsibility to paint donuts | ||||
| Donut2D | Donut2D is defined by it's center and inner and outer radius | ||||
| Donut2D Slice | Donut2D Slice has to be registered in donut with value and theme color | ||||
| Stroke,Fill, Effect | Create beautiful donut with stroke, fill and effects. | ||||
| Labels | Put labels on slice with bounded, radial, border or path labels. | ||||
| Listener | Allow donut action listening and create animation with effect, label or user intents. | ||||


Plugin Information |
|---|
View Personal View on the plugin site for more information. |
Hudson Personal View Plugin
intention
to provide a possibility for every user to have it's own filter of hudson-jobs
(we have in our hudson nearly 1000 jobs and the list is very long)
download
http://download.jenkins-ci.org/plugins/hudson-pview-plugin/
usage samples
configuration
usage as filtered view
usage as Step in Tree
changelog
V 1.8 (Jan 3, 2011)
- Translation updates
- Fix one little typo
V 1.7 (Jan 12, 2010)
- FIXED
- filter works now also at the root of the "step in view"
V 1.6
- FIXED
- RSS feed are now working on all views
- Extended
- Step In view is now on the fly filterable by everyone
- Filtered view is now on the fly filterable by everyone
- default value for path delimiter is global configurable
- default regexp for filtered view is global configurable
V 1.5
- FIXED
default value of shown projects in the step in view is now set from 0 to 30
V 1.4
- FIXED
if I run hudson at / instead of /hudson it works.\
I think it might be line 116 of PViewLinkAction which checks for\
req.getOriginalRequestURI().startsWith(URL_PVIEW_SI_VIEW)...\
If hudson is run with any prefix then this check probably fails. - Extended
a new option per server up to how many jobs the jobs in the stepin-view will be shown
V 1.2
fixes empty user configuration
V 1.1
extension of the personal view
- every user has possibility to decide which columns will be shown
additional tree view
- every user has the possibility to decide where the tree should be located
- every user can administer it's own delimiter which is used as path delimiter
V 1.0
initial release


|
MSS(MCUSimpleScheduler)
v.0.2.1
|
MSS Memory module API definitions, data types, and functions (enabled only if (MSS_TASK_USE_MEM == TRUE)) More...
MSS Memory Handles | |
| typedef struct mss_mem_tbl_t * | mss_mem_t |
| #define | MSS_MEM_INVALID_HDL ((mss_mem_t)NULL) |
MSS Memory API Functions | |
| mss_mem_t | mss_mem_create (uint8_t block_size, uint8_t num_of_blocks) |
| create memory block list, once created can not be deleted | |
| void * | mss_mem_alloc (mss_mem_t hdl) |
| allocate a memory block | |
| void | mss_mem_free (mss_mem_t hdl, void *data) |
| free a memory block (return to free list) |
MSS Memory module API definitions, data types, and functions (enabled only if (MSS_TASK_USE_MEM == TRUE))
| typedef struct mss_mem_tbl_t* mss_mem_t |
mss_mem_t mss memory handle data type
| void* mss_mem_alloc | ( | mss_mem_t | hdl | ) |
allocate a memory block
mss_mem_alloc
| [in] | hdl | memory blocks handle |
| mss_mem_t mss_mem_create | ( | uint8_t | block_size, |
| uint8_t | num_of_blocks | ||
| ) |
create memory block list, once created can not be deleted
mss_mem_create
| [in] | block_size | size of a single memory block in bytes |
| [in] | num_of_blocks | number of memory blocks to be created |
| void mss_mem_free | ( | mss_mem_t | hdl, |
| void * | data | ||
| ) |
free a memory block (return to free list)
mss_mem_free
| [in] | hdl | memory blocks handle |
| [in] | data | pointer of the data to be freed |


Troops, Fall Inline!
March 3, 2016
When learning CSS Layout principles, there are several concepts that are difficult to grasp. What's the difference between a class selector and an id selector and when would you use each? What are the differences between static, relative, absolute, and fixed positioning? What are margin, border, and padding and how do they relate to each other? In this blog post, we'll be tackling the concept of the display attribute, and its values of block, inline, and inline-block.
Every html element has a default display attribute. Many of the most common 'top-level' original html elements have 'display: block'. Block means "don't put anything else on this line. Put the following element on the next line." HTML elements having block display include paragraph <p> and header elements such as <h1>. When you have a <p> or an <h1>, do you ever (by default) see anything to the right of it? No! That's because they are block elements. No matter how short the paragraph or header is, you will not see anything to the right of it.
An inline element, by contrast, expects to have other inline elements to its left and to its right. Typical 'display: inline' elements include text, anchor, and span. The flow of these elements is "inline" like normal text.
The creation of the inline-block value for display was motivated by a problem. Designers wanted to have "blocks" of content that not only could be stacked on top of each other, but that could also be set next to each other, side-by-side. Such a "block" would only take up part of the width of the page, with adjacent "blocks" of content flowing "inline" across the page. But the original definition of the HTML 'inline' value was mainly concerned with text, and didn't provide any ability to set a width or height, because text has an inherent width and height that would be followed implicitly. But when laying out boxes of content across a page you want very precise control over width and height of the boxes. For example, you might want 3 boxes of content across the page to all have the same width and the same height.
To overcome the limitations of the 'block' and 'inline' display values, and allow separate boxes of content to be laid out across the page, the display value 'inline-block' was created. Elements with 'display: inline-block' flow across the page just like inline elements such as text, anchor, and span, but they can also be given specific widths and heights just like block elements.
'Display: inline' is used for elements that should flow across the page like text, and for which it isn't important to exert extra or specific control over the width or height because the inherent width and height of the element are sufficient.
'Display: inline-block' is used for elements that should flow across the page, but for which it is important to specify a particular width and/or height that is not inherent in the element. For example: 3 separate boxes of content of equal width and height that you want to appear across the page.
'Display: float' is another option, not addressed here, that is often used where 'display: inline-block' would also be appropriate. 'Display: float' and 'display: inline-block' each have their advantages, disadvantges, and quirks but can usually accomplish much the same thing. The differences and uses of 'display: float' and 'display: inline-block' are too extensive to be delved into in this post and will have to wait until a future post.


Thank you for visiting Pat's Salmon Cookies! We are happy to have you here and look forward to getting your feedback on our wonderful cookies! Our ingredients are locally sourced and we do our best to choose from sustainable fisheries partnering with local small businesses.
Check out our cool stuff!
Want to buy cookies? Or rep our cool new shirts? We also have cookie cutters!
Cookies
T-shirts
Cookie cutters
Ready to put in your order? Let's walk through the process and get your goodies on the road!
Insert ordering form
Section or additional page for payment
We may have started as a team but we feel like a family!
Quinnat was the inspiration and start of our amazing journey to this point. Quinnat found us while we were camping at Point Hope, Alaska. We got caught in a storm and Quinnat became the only food we had for two days! In their honor we hope you enjoy the salmon products as much as we do.
We would love to hear from you!
Insert contact us form
If you would like to book a tour of our kitchen please contact us at


If you are seeing this screen, you have successfully launched the DataTorrent Gateway. You may need to change a few configuration items to complete your DataTorrent setup. Press "continue" below to continue with this setup wizard.


Assignment 01
In this assignment, you will learn how to run deep learning experiments using the ElastiCluster-ClusterJob computing model. In particular, each of you will build your own personal SLURM cluster on Google Compute Engine (GCE) using elasticluster and then run massive computational experiments using clusterjob.
Please follow the following steps to setup your cluster and run experiments. This documents only contains the detail of setting up your cluster and testing that it works properly with GPUs. Once these steps are completed, you should conduct your experiments as assigned to you on Canvas. The details of the experiment will only be available via Stanford Canvas website to students who are taking this course for credit.
Acknowledgements
- We would like to thank Google Cloud Platform Education Grants Team for their generosity and kindness in providing Stats285 course with cloud computing grant.
- We would like to thank ElastiCluster team especially Dr. Riccardo Murri for their help and collaboration on this project.
FAQ
Please visit the frequently asked questions before you submit a question on our Google group.
ElastiCluster-ClusterJob Computing Model
- Claim Your Google Cloud Credit
- Implement ElastiCluster-ClusterJob model
- Run Your Experiment and Submit CJ Package to Canvas
Part-1: Claim Your Google Cloud Credit
- Claim your $300 Google Compute Credit. You will also get $300 free credit from Google Cloud as a first time user by setting up your Billing Account. However, these 300$ allows only very limited CPU-only computation.
Part-2 Implement ElastiCluster-ClusterJob Model
Follow instructions at Painless Computing Models for Ambitious Data Science to implement the ElastiCluster-ClusterJob model.
Run Your Experiment and Submit CJ Package to Canvas
Please run the Deep Learning experiment assigned to you and submit the reproducible CJ package on Canvas.


In the first part of this blog we looked at the theory and some examples. In this blog we will continue with configuring and managin the DAG.
In this case we have an environment which consists out of two multirole Exchange 2013 servers. Because this is not an odd amount we will need to use a file share witness. Ideally this fileshare witness is placed on another Exchange server (for example your CAS) but it can also be located on an generic server.
First step is to prepare our FSW. It is important the Exchange Trusted Subsystem is a member of the local administrators group of the server. This because Exchange uses this account under the hood to perform the needed actions.
If the server doesn’t contain the File Server feature add it by using the following Powershell cmdlet:
Add-WindowsFeature FS-FileServer
Once these actions have been performed we can continue with configuring our DAG.
If you are familiar with DAG’s from Exchange 2010 pay attention to the next step. You will need to pre-stage the Cluster Name Object (CNO). Open ADUC and create a computeraccount which matches the name you want to give to the DAG, for example DAG01. After creating the object disable the account and get the properties of the object. Select the security tab and add the computeraccount of the computer which will be the first member of the DAG. Repeat this last step for the Exchange Trusted Subsystem security group.
Of course you can also script the creation of this object. Fellow The UC Architects member Michel de Rooij has created a script which can be found here.
Next step is to create the DAG, we will use the Exchange Management Shell for this:
New-DatabaseAvailabilityGroup -Name Exchange_DAG01 -WitnessServer FS01 -WitnessDirectory C:\Exchange_DAG01 -DatabaseAvailabilityGroupIpAddresses <IP_ADDRESS>
By using the cmdlet above we will create a DAG which has the name DAG01 and assign FS01 as the witness server. On the FS01 a directory will be created called Exchange_DAG01. As last step we will assign an IP address to the DAG <IP_ADDRESS>.
Now we have created the DAG it’s time to add the mailbox servers to it. This can be done by using the Add-DatabaseAvailabilityGroupServer cmdlet:
Add-DatabaseAvailabilityGroupServer -Identity DAG01 -MailboxServer EX01
Remark: If the Windows Failover Clustering components are missing the cmdlet will install then automatically. Keep in mind that this might require a restart of your Exchange Server. The cmdlet will in that case only install the components and will not add the server to the DAG. So if the server is rebooted run the cmdlet again to add the server to the DAG. However it may not be required to reboot the server in that case the server will be added to the DAG directly.
Once the first server is completed repeat the same step for the other server:
Add-DatabaseAvailabilityGroupServer -Identity DAG01 -MailboxServer EX02
To finish the configuration of the DAG we will need to add the additional copies of the databases. For adding a copy you will need to use the Add-MailboxDatabaseCopy cmdlet:
Add-MailboxDatabaseCopy -Identity MBDB01 -MailboxServer EX02 -ActivationPreference 2
After the copy is added you will need to restart the Microsoft Exchange Information Store service on the target server. This has to do with the “Managed Store” as introduced in Exchange 2013. Collegue Exchange MVP Tony Redmond published a nice blog. So if you want to know the indept details I recommend to visit this page.
This will add a copy of the database called MBDB01 to mailboxserver EX02 and will set the activation preference to 2.
Repeat the step for the database hosted by EX02:
Add-MailboxDatabaseCopy -Identity MBDB02 -MailboxServer EX01 -ActivationPreference 2
Once the cmdlets have been ran you can use the Get-MailboxDatabaseCopyStatus cmdlet to verify the status of the databases and its copies:
In the example above the first copy is mounted and the content index state is healthy. However for the second copy of the database the content index is FailedAndSuspended. In case of a *over this results in users who will start to have issues when searching their mailbox.
To fix this issue we need to run the Update-MailboxDatabaseCopy cmdlet like this:
Update-MailboxDatabaseCopy -Identity MBDB01\EX02 –CatalogOnly
After the confirmation the catalog will be updated on the second copy:
Let’s look at another issue:
In this case the second copy failed completely so we do have to update both the database and the catalog:
Update-MailboxDatabaseCopy -Identity MBDB02\EX01
After confirming the reseed is performed and both the database and catalog should be healthy again.
If we want to perform maintenance on the DAG members we will need to put the member in maintenance mode. This can be done by using the StartDagServerMaintenance script which can be found in the default script directory of Exchange.
By adding the Server parameter we can specify a server which we would like to put in maintenance. Once this is done it will check if the PAM role and which databases are currently activated on the server and will try to move them to another DAG member.
Once we have performed some maintenance on EX02 we will need to take it back in production. This can be done by using the StopDagServerMaintenance script:
.\StopDagServerMaitenance.ps 1 –Server EX02
Once this script has been executed verify if the databases are healthy using the Get-MailboxDatabaseCopyStatus cmdlet. The script will not re-balance the databases so we will need to do this manually. To move the active database we need to run the Move-ActiveDatabase cmdlet:
Move-ActiveMailboxDatabase MBDB02 –ActivateOnServer EX02
After confirming the activation on the other server the database will be moved to EX02.
Here ends the second part of the Exchange Alphabet about Database Availability Groups. In this part we had a look how to create a DAG and perform several operations


Complimentary Shipping & Returns
Purchases made online can be returned or exchanged within 30 days; plus shipping is on us.
Learn More
Drop a Hint
Let us tell someone special what you’re wishing for.
Drop a Hint
Size Guide
Determine your bracelet, necklace or ring size.
Size Guide


--- layout: post title: 'Resolutions.  (Right arm sleeve. Badgers, lions, clan MacLean, or something. Something fierce.)
Turn 40 in England.
Use more multimedia in my writing (or whatever it is kids these days call it. Create better graphics, use audio and video, etc).
Get a "Techmeme" headline for Hack Education. Break more news in general.


Drag the p element back and forth between the two rectangles:
Drag me!
Note: drag events are not supported in Internet Explorer 8 and earlier versions or Safari 5.1 and earlier versions.
nanda


These annotations allow us to define the link between our persistent classes and the database without configuration files


Hello, my name is Kai Yoshino. Welcome to my website!
I am a Senior in the Informatics department at the University of Washington. I am looking for experience in the field of software development. I started coding when I came to the UW and have been in love with it ever since. I particularly enjoy web development and android development. I have had plenty of computer programming experience here at the UW and I am ready to put my practice to good use!  I have been performing music for almost a decade and have spent lots of my life listening and learning about it. Other hobbies of mine include photography, hiking and biking.
If you are looking for a passionate, hardworking and capable programmer, I would love to hear from you. Take a look at some of my work below!
Connect With Me:
Want to get into contact with me? Email me at<EMAIL_ADDRESS>Feel free to also connect with me on LinkedIn. Thank you for taking a look at my website!


{PAGE_HEADER}
{CONTAINER.0}
{ONXSHOP_REQUEST_filter #bo/component/ecommerce/promotion_filter}
{ONXSHOP_REQUEST_promotion #bo/component/ecommerce/promotion_list}


--- layout: post title: Little links date: 2009-04-20 00:00:00 categories: business interfaces-&-interaction software-development ---


image-base64 Demo
https://lh3.googleusercontent.com/-3MDH11Vx9ks/AAAAAAAAAAI/AAAAAAAAknQ/8R1zCRvd0RQ/s100-p-rw-no/photo.jpg
{{save}}
{{saveMe}}


47+ Norway Cup Logo Pics. Check cup 2020 page and find many useful statistics with chart. Norway cup is the largest.
Norway cup utelukker utenlandske lag. Coca cola fountain cup open happiness. See more ideas about world cup logo, cup logo, flags of the world.
2,000+ vectors, stock photos & psd files.
Stilig «norway cup» logo i front (uten årstall), samt lomme tilpasset hodetelefoner. Check them all out below and tell us your favourite in the. See more ideas about football logo, logos, logo young. We have 307 free cup vector logos, logo templates and icons.


--- layout: post title: "My Week in Review" date: 2020-03-08 20:00:00 +0000 image: https://s3.amazonaws.com/audreywatters/2019-03-10-seattle.jpg imagecredits: https://www.flickr.com/photos/104318263@N04/16578391865 ---
The manuscript is back in the hands of MIT Press. I am really pleased with how it finally came together, after much thinking and rethinking of what I wanted the book to do. Now, I'm in the process of securing permissions. Wheee.
HEWN, No. 344 via substack.com
I'm starting to get a bit worried about what my spring is going to look like. I have a lot of speaking gigs lined up, but they're starting to be canceled. And don't get me wrong. I totally understand the necessity of canceling events under these circumstances.
This past week: the Bay Area. Upcoming week: Travel has been canceled or postponed. We are now, for the next few weeks at least, at home in Seattle.
I haven't done a good job keeping up with what I've read or watched lately. Nor have I been keeping up with this weekly update either. Things are tough all over. I'll try to do better.
Icon credits: The Noun Project


Use the guide to prepare good looking posts! The theme has a sidebar in the post layout which consists of post image, recent posts and facebook like box. Thi...
Read
Elements
Jun 10, 2016
Below elements can be used just by adding certain classes to regular html elements. Since the theme is based on Bootstrap, you can use any bootstrap class in...
Read
Post with no image
Jun 9, 2016
When there is no image mentioned in the front-matter, default image will be displayed. You can change this image to any other one that suits your needs.
Read


{{#markdown}}
Currently we are dealing with a few parties, but we also need to support also a large number of parties.
Therefore, we want to have `pagination` support.
With pagination we can break the array of parties down to pages so the user won't have to scroll down to find a party,
but also and even more important, we can fetch only a few parties at a time instead of all the parties collection for better performance.
The interesting thing about pagination is that it is dependent on the filters we want to put on top of the collection, for example,
if we are in page 3, but we change how we sort the collection, we should get different results, same thing with search - if we start
a search, there might be not enough results for 3 pages.
For AngularJS developers, this chapter will show how powerful Meteor is.
In the official AngularJS tutorial, we added sorting and search that only worked on the client side, which in real world scenarios are not so helpful.
Now, in this chapter we are going to perform a real-time search, sort and paginate that will run all the way to the server.
# angular-meteor pagination support
What we want to achieve with angular-meteor is server-based reactive pagination.
That is no simple task, but using angular-meteor could make life a lot simpler.
To achieve server-based reactive pagination we need to have support for pagination in the server as well as in the client.
That means that our publish function for the parties collection would have to change and also the way that we subscribe to that publication.
So first let's take care of our server-side.
In our `parties.js` file in the server directory we are going to add the `options` variable to the publish method like this:
Meteor.publish("parties", function (options) {
return Parties.find({
$or:[
{$and:[
{"public": true},
{"public": {$exists: true}}
]},
{$and:[
{owner: this.userId},
{owner: {$exists: true}}
]}
]}, options);
});
Now our publish method receives an options arguments which we then pass to the `Parties.find()` function call.
This will allow us to send arguments to the find function's modifier right from the subscribe call. The options object can
contain properties like `skip`, `sort` and `limit` which we will shortly use ourselves - [Collection Find](http://docs.meteor.com/#/full/find).
Let's get back to our client code. We now need to change our subscribe call with options we want to set for pagination.
What are those parameters that we want to set on the options argument? In order to have pagination in our
parties list we will need to save the current page, the number of parties per page and the sort order. So let's add these parameters to our scope
in the top of the controller in `client/controllers/partiesList.js` file.
$scope.page = 1;
$scope.perPage = 3;
$scope.sort = { name: 1 };
That's cool, but let's do something with these variables except defining them. So where we want to use them is when we call the subscribe method.
But right now, we are subscribing to the collection in the short form which doesn't get parameters:
$scope.parties = $meteor.collection(Parties).subscribe('parties');
So first we need to add the [$meteor.subscribe](/api/subscribe) service and call it separately:
$scope.parties = $meteor.collection(Parties);
$meteor.subscribe('parties');
Now let's send the parameters in the options object:
$meteor.subscribe('parties', {
limit: parseInt($scope.perPage),
skip: parseInt(($scope.page - 1) * $scope.perPage),
sort: $scope.sort
});
So we built an object that contains 3 properties:
* **limit** - how many parties to send per page
* **skip** - the number of parties we want to start with which is the current page minus one times the parties per page
* **sort** - the sorting of the collection in [MongoDB syntax](http://docs.mongodb.org/manual/reference/method/cursor.sort/)
Now we also need to add the sort modifier to the way we get the collection data from the Minimongo.
That is because the sorting is not saved when the data is sent from the server to the client.
So to make sure our data is sorted also on the client need to defined is also in the parties collection.
To do that we are going to replace the `Parties` collection parameter with a [cursor](http://docs.meteor.com/#/full/mongo_cursor) for that parties collection:
$scope.parties = $meteor.collection(function() {
return Parties.find({}, {
sort : $scope.sort
});
});
# pagination directive
Now we need a UI to change and move between the pages.
In AngularJS's eco system there are a lot of directives for handling pagination.
Our personal favorite is [angular-utils-pagination](https://github.com/michaelbromley/angularUtils/tree/master/src/directives/pagination).
To add the directive add it's Meteor package to the project:
meteor add angularutils:pagination
Add it as a dependency to our Angular app in `app.js`:
angular.module('socially',['angular-meteor', 'ui.router', 'angularUtils.directives.dirPagination']);
Now let's add the directive in `parties-list.ng.html` , change the ng-repeat of parties to this:
and after the UL closes add this directive:
As you can see, dir-paginate list takes the number of objects in a page (that we defined before) but also takes the total number items (we will get to that soon).
With this bindings it calculates what buttons of pages it should display inside the dir-pagination-controls directive.
On the dir-pagination-controls directive there is a method `on-page-change` and there we can call our own function.
so we call `pageChanged` function with the new selection as a parameter.
Let's create the pageChanged function inside the partiesList controller `(client/controllers/partiesList.js)`:
$scope.pageChanged = function(newPage) {
$scope.page = newPage;
};
Now every time we change the page, the scope variable will change accordingly and update the bind method that watches it.
* Notice that the buttons of the directive doesn't look very nice now because we haven't added any design and CSS to our application, we will do it later on.
# Getting total count of a collection
Getting a total count of a collection might seem easy, but there is a problem.
The client only holds the number of object that it subscribed to. That means that if the client is not subscribed to the whole array calling find().count on a collection will result in a partial count.
So we need access in the client for the total count even if we are not subscribed to the whole collection.
For that we can use the [tmeasday:publish-counts](https://github.com/percolatestudio/publish-counts) package. In the command line:
meteor add tmeasday:publish-counts
This package helps to publish the count of a cursor, in real time without dependency on the subscribe method.
Inside the `server/parties.js` file, add the following code inside the `Meteor.publish("parties" ` function, at the beginning of the function. before the existing return statement:
Counts.publish(this, 'numberOfParties', Parties.find({
$or:[
{$and:[
{'public': true},
{'public': {$exists: true}}
]},
{$and:[
{owner: this.userId},
{owner: {$exists: true}}
]}
]}), { noReady: true });
So the file should look like this now:
Meteor.publish("parties", function (options) {
Counts.publish(this, 'numberOfParties', Parties.find({
$or:[
{$and:[
{'public': true},
{'public': {$exists: true}}
]},
{$and:[
{owner: this.userId},
{owner: {$exists: true}}
]}
]}), { noReady: true });
return Parties.find({
$or:[
{$and:[
{'public': true},
{'public': {$exists: true}}
]},
{$and:[
{owner: this.userId},
{owner: {$exists: true}}
]}
]} ,options);
});
As you can see, we query only the parties that should be available to that specific client, but without the options variable so we get the full
number of parties.
* We are passing `{ noReady: true }` in the last argument so that the publication will be ready only after the our main cursor is ready - [readiness](https://github.com/percolatestudio/publish-counts#readiness).
Now on the client we have access to the Counts collection.
Let's save that in the `client/controllers/partiesList.js` file when the subscription finishes successful (using the promise $meteor.subscribe returns):
$meteor.subscribe('parties', {
limit: parseInt($scope.perPage),
skip: parseInt(($scope.page - 1) * $scope.perPage),
sort: $scope.sort
}).then(function(){
$scope.partiesCount = $meteor.object(Counts ,'numberOfParties', false);
});
Now the partiesCount will hold the number of parties and will send it to the directive in the `parties-list.ng.html` (which we already defined earlier).
But there is a problem - try to create a few parties and then change pages... the subscription won't run again!
# Reactive variables
Meteor is relaying deeply on the concept of [reactivity](http://docs.meteor.com/#/full/reactivity).
This means that is a [reactive variable](http://docs.meteor.com/#/full/reactivevar) changes, Meteor is aware of that with it's [Tracker object](http://docs.meteor.com/#/full/tracker_autorun).
But Angular's scope variables are only watched by Angular and are not reactive vars for Meteor...
For that angular-meteor created [getReactively](/api/getReactively) - a way to make an Angular scope variable to a reactive variable.
In order to make the subscription run each time something changes in one of the parameters, we need to place it inside an autorun block.
To do that, we are going to use the [$meteor.autorun](/api/utils) function:
$meteor.autorun($scope, function() {
$meteor.subscribe('parties', {
limit: parseInt($scope.perPage),
skip: parseInt(($scope.page - 1) * $scope.perPage),
sort: $scope.sort
}).then(function(){
$scope.partiesCount = $meteor.object(Counts ,'numberOfParties', false);
});
});
But this still won't help us because there is no reactive variables inside, so let's use [getReactively](/api/getReactively) for that:
$meteor.autorun($scope, function() {
$meteor.subscribe('parties', {
limit: parseInt($scope.getReactively('perPage')),
skip: (parseInt($scope.getReactively('page')) - 1) * parseInt($scope.getReactively('perPage')),
sort: $scope.getReactively('sort')
}).then(function(){
$scope.partiesCount = $meteor.object(Counts ,'numberOfParties', false);
});
});
What's happening here is that `getReactively` returns a reactive variable that fires a changed event every time the scope variable changes,
and then autorun knows to execute it's given function again.
This will cause the subscription to re-run again with the new options parameter and we will get the correct data from the server.
$meteor.collection is also listening to reactive variables so let's change our $scope.parties initialization as well:
$scope.parties = $meteor.collection(function() {
return Parties.find({}, {
sort : $scope.getReactively('sort')
});
});
Now run the app.
Create lots of parties and see that you can see only 3 at a time and you can scroll between the pages with the directive that populates the number of pages automatically.
# Changing the sort reactively
We haven't placed anywhere in the UI a way to change sorting so let's do that right now.
So in the HTML template, let's add a sorting dropdown inside the UL:
Parties:
in the controller lets associate that dropdown to $scope.sort:
$scope.$watch('orderProperty', function(){
if ($scope.orderProperty)
$scope.sort = {name: parseInt($scope.orderProperty)};
});
and also initialize it at the beginning:
$scope.sort = { name: 1 };
$scope.orderProperty = '1';
Now we don't have to do anything other than that. $scope.getReactively will take care of updating the subscription for us
when the sort changes. So all we have left is to sit back and enjoy out pagination working like a charm.
We made a lot of changes so please check the step's code [here](https://github.com/Urigo/meteor-angular-socially/compare/step_14...step_15)
to make sure you have everything needed and run the application.
# Reactive Search
Now that we have the basis for pagination, all we have left is to add reactive server-side searching of parties. That means
that we will be able to enter a search string and have the app search for parties that match that name in the server and
return only the relevant results! That is pretty awesome, and we are going to do all that only in several lines of code. So
let's get started.
As before, let's add the server side support. We need to add a new argument to our publish method which will hold the
requested search string. We will call it..... searchString! Here it goes:
Meteor.publish("parties", function (options, searchString) {
Yep that was simple. Now we are going to filter the correct results using mongo's regex ability. We are going to add this
line at two places where we are using `find`, in publish Counts and in the return of the parties cursor:
'name' : { '$regex' : '.*' + searchString || '' + '.*', '$options' : 'i' },
So `server/parties.js` should look like that:
Meteor.publish("parties", function (options, searchString) {
if (searchString == null)
searchString = '';
Counts.publish(this, 'numberOfParties', Parties.find({
'name' : { '$regex' : '.*' + searchString || '' + '.*', '$options' : 'i' },
$or:[
{$and:[
{"public": true},
{"public": {$exists: true}}
]},
{$and:[
{owner: this.userId},
{owner: {$exists: true}}
]}
]}), { noReady: true });
return Parties.find({
'name' : { '$regex' : '.*' + searchString || '' + '.*', '$options' : 'i' },
$or:[
{$and:[
{"public": true},
{"public": {$exists: true}}
]},
{$and:[
{owner: this.userId},
{owner: {$exists: true}}
]}
]} ,options);
});
As you can see this will filter all the parties with a name that contains the searchString.
* we added also if (searchString == null) searchString = ''; so that if we won't get that parameter we will just return the whole collection.
Now let's move on to the client side.
First let's place a search input into our template and bind it into a 'search' scope variable:
Parties:
And all we have left to do is call the subscribe method with our reactive scope variable:
$meteor.subscribe('parties', {
limit: parseInt($scope.getReactively('perPage')),
skip: (parseInt($scope.getReactively('page')) - 1) * parseInt($scope.getReactively('perPage')),
sort: $scope.getReactively('sort')
}, $scope.getReactively('search')).then(function() {
Wow that is all that is needed to have a fully reactive search with pagination! Quite amazing right?
# Stopping a subscription
There is only one problem in our app right now - if you will go into the party details page and then go back, the pagination and search will stop working.
The reason is that we are calling a different subscription on the same collection inside the partyDetails controller..
So to fix that, we will have to close that subscription after the partyDetails controller is destroyed.
We can do that by the calling `$scope.$meteorSubscribe` method. It will **automatically close** the subscription when the scope gets destroyed.
First remove the subscription from $meteor.object:
$scope.party = $meteor.object(Parties, $stateParams.partyId);
And now add the subscribe function:
$scope.$meteorSubscribe('parties');
That's it.
In case you want to stop it manually before the scope closes you can use the subscription handle from the $meteorSubscribe function:
var savedSubscriptionHandle = null;
$scope.$meteorSubscribe('parties').then(function(subscriptionHandle){
// You can use the subscription handle to stop the subscription if you want
savedSubscriptionHandle = subscriptionHandle;
});
// When you want to manually close the subscription
savedSubscriptionHandle.stop();
For more information look at [$meteorSubscribe API](/api/subscribe).
# Summary
Now we have full pagination with search and sorting for client and server side with the help of Meteor's options and Angular's directives.
{{/markdown}}


Algo
Phantoms
Home
(current)
About
Team
More
RoadMap to your DSA
Contribute to Project
DSA Problems
Suggested Books
Contact
Contact Us
Name
*
Email
*
Subject
*
Comment or Message
*
Submit


Hi There! Welcome!
This is a basic angular application created to demostrate a few core angular
functionalities.
What we have here is a basic angular application where users can
Create posts
List posts
Use the navigation bar or
Click here
to try it out.