text:
<?php

namespace CachetHQ\Cachet\Http\Controllers\Dashboard;

use AltThree\Validator\ValidationException;
use CachetHQ\Cachet\Bus\Commands\Incident\CreateIncidentCommand;
use CachetHQ\Cachet\Bus\Commands\Incident\RemoveIncidentCommand;
use CachetHQ\Cachet\Bus\Commands\Incident\UpdateIncidentCommand;
use CachetHQ\Cachet\Bus\Commands\IncidentUpdate\CreateIncidentUpdateCommand;
use CachetHQ\Cachet\Models\Component;
use CachetHQ\Cachet\Models\ComponentGroup;
use CachetHQ\Cachet\Models\Incident;
use CachetHQ\Cachet\Models\IncidentTemplate;
use GrahamCampbell\Binput\Facades\Binput;
use Illuminate\Contracts\Auth\Guard;
use Illuminate\Routing\Controller;
use Illuminate\Support\Facades\View;

/**
 * This is the incident controller.
 *
 * @author James Brooks <james@alt-three.com>
 */
class IncidentController extends Controller
{
    /**
     * Stores the sub-sidebar tree list.
     *
     * @var array
     */
    protected $subMenu = [];

    /**
     * The guard instance.
     *
     * @var \Illuminate\Contracts\Auth\Guard
     */
    protected $auth;

    /**
     * Creates a new incident controller instance.
     *
     * @param \Illuminate\Contracts\Auth\Guard $auth
     *
     * @return void
     */
    public function __construct(Guard $auth)
    {
        $this->auth = $auth;

        View::share('sub_title', trans('dashboard.incidents.title'));
    }

    /**
     * Shows the incidents view.
     *
     * @return \Illuminate\View\View
     */
    public function showIncidents()
    {
        $incidents = Incident::orderBy('created_at', 'desc')->get();

        return View::make('dashboard.incidents.index')
            ->withPageTitle(trans('dashboard.incidents.incidents').' - '.trans('dashboard.dashboard'))
            ->withIncidents($incidents);
    }

    /**
     * Shows the add incident view.
     *
     * @return \Illuminate\View\View
     */
    public function showAddIncident()
    {
        return View::make('dashboard.incidents.add')
            ->withPageTitle(trans('dashboard.incidents.add.title').' - '.trans('dashboard.dashboard'))
            ->withComponentsInGroups(ComponentGroup::with('components')->get())
            ->withComponentsOutGroups(Component::where('group_id', '=', 0)->get())
            ->withIncidentTemplates(IncidentTemplate::all());
    }

    /**
     * Shows the incident templates.
     *
     * @return \Illuminate\View\View
     */
    public function showTemplates()
    {
        return View::make('dashboard.templates.index')
            ->withPageTitle(trans('dashboard.incidents.templates.title').' - '.trans('dashboard.dashboard'))
            ->withIncidentTemplates(IncidentTemplate::all());
    }

    /**
     * Creates a new incident.
     *
     * @return \Illuminate\Http\RedirectResponse
     */
    public function createIncidentAction()
    {
        try {
            $incident = dispatch(new CreateIncidentCommand(
                Binput::get('name'),
                Binput::get('status'),
                Binput::get('message', null, false, false),
                Binput::get('visible', true),
                Binput::get('component_id'),
                Binput::get('component_status'),
                Binput::get('notify', false),
                Binput::get('stickied', false),
                Binput::get('occurred_at'),
                null,
                []
            ));
        } catch (ValidationException $e) {
            return cachet_redirect('dashboard.incidents.create')
                ->withInput(Binput::all())
                ->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.incidents.add.failure')))
                ->withErrors($e->getMessageBag());
        }

        return cachet_redirect('dashboard.incidents')
            ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.incidents.add.success')));
    }

    /**
     * Shows the add incident template view.
     *
     * @return \Illuminate\View\View
     */
    public function showAddIncidentTemplate()
    {
        return View::make('dashboard.templates.add')
            ->withPageTitle(trans('dashboard.incidents.templates.add.title').' - '.trans('dashboard.dashboard'));
    }

    /**
     * Shows the edit incident template view.
     *
     * @param \CachetHQ\Cachet\Models\IncidentTemplate $template
     *
     * @return \Illuminate\View\View
     */
    public function showEditTemplateAction(IncidentTemplate $template)
    {
        return View::make('dashboard.templates.edit')
            ->withPageTitle(trans('dashboard.incidents.templates.edit.title').' - '.trans('dashboard.dashboard'))
            ->withTemplate($template);
    }

    /**
     * Deletes an incident template.
     *
     * @param \CachetHQ\Cachet\Models\IncidentTemplate $template
     *
     * @return \Illuminate\Http\RedirectResponse
     */
    public function deleteTemplateAction(IncidentTemplate $template)
    {
        $template->delete();

        return cachet_redirect('dashboard.templates')
            ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.incidents.templates.delete.success')));
    }

    /**
     * Creates a new incident template.
     *
     * @return \Illuminate\Http\RedirectResponse
     */
    public function createIncidentTemplateAction()
    {
        try {
            IncidentTemplate::create([
                'name'     => Binput::get('name'),
                'template' => Binput::get('template', null, false, false),
            ]);
        } catch (ValidationException $e) {
            return cachet_redirect('dashboard.templates.create')
                ->withInput(Binput::all())
                ->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.incidents.templates.add.failure')))
                ->withErrors($e->getMessageBag());
        }

        return cachet_redirect('dashboard.templates')
            ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.incidents.templates.add.success')));
    }

    /**
     * Deletes a given incident.
     *
     * @param \CachetHQ\Cachet\Models\Incident $incident
     *
     * @return \Illuminate\Http\RedirectResponse
     */
    public function deleteIncidentAction(Incident $incident)
    {
        dispatch(new RemoveIncidentCommand($incident));

        return cachet_redirect('dashboard.incidents')
            ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.incidents.delete.success')));
    }

    /**
     * Shows the edit incident view.
     *
     * @param \CachetHQ\Cachet\Models\Incident $incident
     *
     * @return \Illuminate\View\View
     */
    public function showEditIncidentAction(Incident $incident)
    {
        return View::make('dashboard.incidents.edit')
            ->withPageTitle(trans('dashboard.incidents.edit.title').' - '.trans('dashboard.dashboard'))
            ->withIncident($incident)
            ->withComponentsInGroups(ComponentGroup::with('components')->get())
            ->withComponentsOutGroups(Component::where('group_id', '=', 0)->get());
    }

    /**
     * Edit an incident.
     *
     * @param \CachetHQ\Cachet\Models\Incident $incident
     *
     * @return \Illuminate\Http\RedirectResponse
     */
    public function editIncidentAction(Incident $incident)
    {
        try {
            $incident = dispatch(new UpdateIncidentCommand(
                $incident,
                Binput::get('name'),
                Binput::get('status'),
                Binput::get('message'),
                Binput::get('visible', true),
                Binput::get('component_id'),
                Binput::get('component_status'),
                Binput::get('notify', true),
                Binput::get('stickied', false),
                Binput::get('occurred_at'),
                null,
                []
            ));
        } catch (ValidationException $e) {
            return cachet_redirect('dashboard.incidents.edit', ['id' => $incident->id])
                ->withInput(Binput::all())
                ->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.incidents.templates.edit.failure')))
                ->withErrors($e->getMessageBag());
        }

        if ($incident->component) {
            $incident->component->update(['status' => Binput::get('component_status')]);
        }

        return cachet_redirect('dashboard.incidents.edit', ['id' => $incident->id])
            ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.incidents.edit.success')));
    }

    /**
     * Edit an incident template.
     *
     * @param \CachetHQ\Cachet\Models\IncidentTemplate $template
     *
     * @return \Illuminate\Http\RedirectResponse
     */
    public function editTemplateAction(IncidentTemplate $template)
    {
        try {
            $template->update(Binput::get('template'));
        } catch (ValidationException $e) {
            return cachet_redirect('dashboard.templates.edit', ['id' => $template->id])
                ->withUpdatedTemplate($template)
                ->withTemplateErrors($e->getMessageBag()->getErrors());
        }

        return cachet_redirect('dashboard.templates.edit', ['id' => $template->id])
            ->withUpdatedTemplate($template);
    }

    /**
     * Shows the incident update form.
     *
     * @param \CachetHQ\Cachet\Models\Incident $incident
     *
     * @return \Illuminate\View\View
     */
    public function showIncidentUpdateAction(Incident $incident)
    {
        return View::make('dashboard.incidents.update')->withIncident($incident);
    }

    /**
     * Creates a new incident update.
     *
     * @param \CachetHQ\Cachet\Models\Incident $incident
     *
     * @return \Illuminate\Http\RedirectResponse
     */
    public function createIncidentUpdateAction(Incident $incident)
    {
        try {
            $incident = dispatch(new CreateIncidentUpdateCommand(
                $incident,
                Binput::get('status'),
                Binput::get('message'),
                $this->auth->user()
            ));
        } catch (ValidationException $e) {
            return cachet_redirect('dashboard.incidents.updates', ['id' => $incident->id])
                ->withInput(Binput::all())
                ->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.incidents.templates.edit.failure')))
                ->withErrors($e->getMessageBag());
        }

        return cachet_redirect('dashboard.incidents')
            ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.incidents.update.success')));
    }
}


text:
/*
 * This file contains private information about the H5L module
 * for dealing with links in an HDF5 file.
 */
#ifndef _H5Lprivate_H
#define _H5Lprivate_H

/* Include package's public header */
#include "H5Lpublic.h"

/* Private headers needed by this file */
#include "H5Gprivate.h"		/* Groups				*/
#include "H5Oprivate.h"		/* Object headers			*/

/**************************/
/* Library Private Macros */
/**************************/

/* Default number of soft links to traverse */
#define H5L_NUM_LINKS   16

/* ========  Link creation property names ======== */
#define H5L_CRT_INTERMEDIATE_GROUP_NAME         "intermediate_group" /* Create intermediate groups flag */

/* ========  Link access property names ======== */
#define H5L_ACS_NLINKS_NAME        "max soft links"         /* Number of soft links to traverse */
#define H5L_ACS_ELINK_PREFIX_NAME  "external link prefix"   /* External link prefix */
#define H5L_ACS_ELINK_FAPL_NAME    "external link fapl"     /* file access property list for external link access */
#define H5L_ACS_ELINK_FLAGS_NAME   "external link flags"    /* file access flags for external link traversal */
#define H5L_ACS_ELINK_CB_NAME      "external link callback" /*  callback function for external link traversal */

/****************************/
/* Library Private Typedefs */
/****************************/

/* User data for path traversal routine for getting link value by index */
typedef struct {
    /* In */
    H5_index_t idx_type;               /* Index to use */
    H5_iter_order_t order;              /* Order to iterate in index */
    hsize_t n;                          /* Offset of link within index */
    size_t size;                        /* Size of user buffer */

    /* Out */
    void *buf;                          /* User buffer */
} H5L_trav_gvbi_t;

/* User data for path traversal routine for getting link info by index */
typedef struct {
    /* In */
    H5_index_t idx_type;               /* Index to use */
    H5_iter_order_t order;              /* Order to iterate in index */
    hsize_t n;                          /* Offset of link within index */

    /* Out */
    H5L_info_t      *linfo;             /* Buffer to return to user */
} H5L_trav_gibi_t;

/* User data for path traversal routine for getting name by index */
typedef struct {
    /* In */
    H5_index_t idx_type;                /* Index to use */
    H5_iter_order_t order;              /* Order to iterate in index */
    hsize_t n;                          /* Offset of link within index */
    size_t size;                        /* Size of name buffer */

    /* Out */
    char *name;                         /* Buffer to return name to user */
    ssize_t name_len;                   /* Length of full name */
} H5L_trav_gnbi_t;

/* User data for path traversal routine for removing link by index */
typedef struct {
    /* In */
    H5_index_t idx_type;               /* Index to use */
    H5_iter_order_t order;              /* Order to iterate in index */
    hsize_t n;                          /* Offset of link within index */
} H5L_trav_rmbi_t;

/* Structure for external link traversal callback property */
typedef struct H5L_elink_cb_t {
    H5L_elink_traverse_t      func;
    void                      *user_data;
} H5L_elink_cb_t;

/*****************************/
/* Library Private Variables */
/*****************************/

/******************************/
/* Library Private Prototypes */
/******************************/

/* General operations on links */
H5_DLL herr_t H5L_init(void);
H5_DLL herr_t H5L_link(const H5G_loc_t *new_loc, const char *new_name,
    H5G_loc_t *obj_loc, hid_t lcpl_id);
H5_DLL herr_t H5L_link_object(const H5G_loc_t *new_loc, const char *new_name,
    H5O_obj_create_t *ocrt_info, hid_t lcpl_id);
H5_DLL herr_t H5L_create_hard(H5G_loc_t *cur_loc, const char *cur_name,
    const H5G_loc_t *link_loc, const char *link_name, hid_t lcpl_id);
H5_DLL herr_t H5L_create_soft(const char *target_path, const H5G_loc_t *cur_loc,
    const char *cur_name, hid_t lcpl_id);
H5_DLL herr_t H5L_move(const H5G_loc_t *src_loc, const char *src_name,
    const H5G_loc_t *dst_loc, const char *dst_name, hbool_t copy_flag,
    hid_t lcpl_id);
H5_DLL htri_t H5L_exists_tolerant(const H5G_loc_t *loc, const char *name);
H5_DLL herr_t H5L_get_info(const H5G_loc_t *loc, const char *name,
    H5L_info_t *linkbuf/*out*/);
H5_DLL herr_t H5L_delete(const H5G_loc_t *loc, const char *name);
H5_DLL herr_t H5L_get_val(const H5G_loc_t *loc, const char *name, void *buf/*out*/,
    size_t size);
H5_DLL herr_t H5L_register_external(void);

/* User-defined link functions */
H5_DLL herr_t H5L_register(const H5L_class_t *cls);
H5_DLL herr_t H5L_unregister(H5L_type_t id);
H5_DLL const H5L_class_t *H5L_find_class(H5L_type_t id);

#endif /* _H5Lprivate_H */

redpajama_set_name: RedPajamaGithub


text:
<TITLE>Review for Hilary and Jackie (1998)</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css">

Hilary and Jackie (1998)

reviewed by
Craig Roush

HILARY AND JACKIE

*** (out of 4) - a good movie

Release Date: January 22, 1999
Starring: Emily Watson, Rachel Griffiths, David Morrissey, James Frain,
Charles Dance, Celia Imrie
Directed by: Anand Tucker
Distributed by: October Films
MPAA Rating: R (language, sexuality)
URL: http://www.execpc.com/~kinnopio/reviews/1999/hilary.htm

Not since 1996's SHINE, which starred Geoffrey Rush as pianist David
Helfgott, has a movie so defiantly laid bare the lives of world-class
musicians. In fact, if one were to watch these films together, it would
almost certainly stand as a convincing argument that a life of music
naturally leads to all varieties of social ills. Yet HILARY AND JACKIE,
the sophomore effort from director Anand Tucker, has something more to
say -- it softly but strongly explores the complex relationships of
sibling rivalry and love in a very compelling tale.

Emily Watson and Rachel Griffiths are the leads in this tale, playing
the sisters Du Pré. Both musicians from childhood, Hilary (Griffiths) is
renowned flutist while Jacqueline (Watson) is easily as skilled on the
cello. The two comepete for and win many honors as children and as young
women, both together and seperate. Their careers as musicians surpass
and then bow to one another's, and although their lives take very
different paths -- Hilary settles down to marriage and a family while
Rachel skips across the globe on a world concert tour -- they are bound
together by their deep family love.

The performances of Watson and Griffiths are excellent in style and
substance. They contrast each other wonderfully, and while Watson's
portrayal of Jackie Du Pré is at times eccentric and perhaps
unsympathetic, both characters are charged with emotion. The Frank
Cottrell Boyce script, which is based on the book by Hilary and Piers Du
Pré, brings a great deal of depth to these characters as well.

The script is also to be commended for its well-polished dual nature.
Cottrell Boyce adopts a style which one might expect to see in a mystery
thriller (which was in fact the case with David Koepp and Robert Towne's
script for MISSION: IMPOSSIBLE) and skillfully molds it to the story of
two rising musicians on different courses to fame. The latter parts of
his script are controversial to say the least, and the rather depressing
ending takes the wind out of an envigorating story. Some will leave this
movie feeling disenfranchised. Nevertheless, HILARY AND JACKIE is a
movie that reaches an upper echelon of contemporary cinema through solid
fundamentals and is a decent watch all around.

all contents © 1999 Craig Roush

--
Craig Roush
kinnopio@execpc.com
--
Kinnopio's Movie Reviews
http://www.execpc.com/~kinnopio

The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).

The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.

Please direct comments/criticisms of the review to relevant newsgroups.

Broken URLs inthe reviews are the responsibility of the author.

The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.

Related links: index of all rec.arts.movies.reviews reviews


text:
using System;
using System.Collections.Generic;
using System.Text;
using FBPLib;

namespace Components
{
    /** Replicate a stream of Packets to 'n' output streams, where
*  each Packet points at a String.
* Note: this is a specific variant of the general Replicate verb (q.v.)
**/
    [InPort("IN")]
    [OutPort("OUT", arrayPort=true)]
    [ComponentDescription("Replicates input stream and sends copies to array port OUT")]
    public class ReplString : Component
    {
        internal static string _copyright =
                "Copyright 2007, 2008, 2009, J. Paul Morrison.  At your option, you may copy, " +
                "distribute, or make derivative works under the terms of the Clarified Artistic License, " +
                "based on the Everything Development Company's Artistic License.  A document describing " +
                "this License may be found at http://www.jpaulmorrison.com/fbp/artistic2.htm. " +
                "THERE IS NO WARRANTY; USE THIS PRODUCT AT YOUR OWN RISK.";

        IInputPort _inport;
        OutputPort[] _outportArray;

        public override void Execute() /* throws Throwable */ {

            int no = _outportArray.Length;

            Packet p;
            long count = 0;
            while ((p = _inport.Receive()) != null)
            {
                ++count;
                string o = (string)p.Content;
                Drop(p);

                for (int i = 0; i < no; i++)
                {
                    string o2 = o + "";

                    Packet p2 = Create(o2);
                    _outportArray[i].Send(p2);

                    // else System.out.println( "Line written " + count + " by" + getName());
                }
            }
            Console.Out.WriteLine("Repl complete. " + Name);
        }
        /*
        public override Object[] Introspect()
        {
            return new Object[] {
		"replicates input stream at port IN and sends them to array port OUT",
		"IN", "input", Type.GetType("System.Object"),
			"input stream",
		"OUT", "output", Type.GetType("System.Object"),
			"multiple output streams"};
        }
        */
        public override void OpenPorts()
        {

            _inport = OpenInput("IN");
           // _inport.SetType(Type.GetType("System.Object"));

            _outportArray = OpenOutputArray("OUT");

        }
    }

}


text:
package com.google.security.zynamics.binnavi.Gui.MainWindow.ProjectTree;

import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.net.URL;

import javax.swing.JFrame;
import javax.swing.JPopupMenu;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.TreePath;

import com.google.common.base.Preconditions;
import com.google.security.zynamics.binnavi.Database.CDatabaseManager;
import com.google.security.zynamics.binnavi.Gui.Actions.CActionProxy;
import com.google.security.zynamics.binnavi.Gui.MainWindow.ProjectTree.Actions.CAddDatabaseAction;
import com.google.security.zynamics.binnavi.Gui.MainWindow.ProjectTree.Nodes.IProjectTreeNode;
import com.google.security.zynamics.binnavi.Gui.MainWindow.ProjectTree.Nodes.Root.CRootNode;
import com.google.security.zynamics.binnavi.Help.CHelpFunctions;
import com.google.security.zynamics.binnavi.Help.IHelpInformation;
import com.google.security.zynamics.binnavi.Help.IHelpProvider;
import com.google.security.zynamics.zylib.gui.dndtree.DNDTree;
import com.google.security.zynamics.zylib.gui.jtree.IconNodeRenderer;
import com.google.security.zynamics.zylib.gui.jtree.TreeHelpers;

/**
 * The project tree is the tree in the main window where all databases, projects, address spaces,
 * modules, views, and so on are displayed.
 *
 */
public final class CProjectTree extends DNDTree implements IHelpProvider {
  /**
   * Used for serialization.
   */
  private static final long serialVersionUID = 1615290227300451827L;

  /**
   * There is a default popup associated with the tree that is shown when the user right-clicks on
   * the tree but doesn't hit a node.
   */
  private final JPopupMenu m_popup = new JPopupMenu();

  /**
   * The root node of the project tree is a hidden dummy node.
   */
  private final CRootNode m_rootNode;

  /**
   * Tree model of the project tree.
   */
  private final CProjectTreeModel m_treeModel;

  /**
   * Creates a new project tree component.
   *
   * @param parent Parent window used for dialogs.
   * @param databaseManager Provides the database information that is shown in the tree.
   */
  public CProjectTree(final JFrame parent, final CDatabaseManager databaseManager) {
    // ATTENTION: DO NOT USE SETPREFERREDSIZE IN THIS TREE. TREES THAT HAVE A PREFERRED
    // SIZE ARE NOT CORRECTLY SCROLLED IF THEY ARE PLACED IN JSPLITPANES.

    Preconditions.checkNotNull(databaseManager, "IE01840: Database manager object can't be null");

    m_treeModel = new CProjectTreeModel(this);
    setModel(m_treeModel);

    CProjectTreeDragHandlerInitializer.initialize(parent, this, databaseManager);

    // Initialize the handler for showing popup context menus
    addMouseListener(new InternalMouseListener());

    setScrollsOnExpand(false);
    setRootVisible(false);

    // Set the root node of the tree.
    m_rootNode = new CRootNode(this, databaseManager);
    m_treeModel.setRoot(m_rootNode);

    // Each node has its own custom icon.
    setCellRenderer(new IconNodeRenderer()); // ATTENTION: UNDER NO CIRCUMSTANCES MOVE THIS LINE
                                             // ABOVE THE SETROOT LINE

    m_popup.add(CActionProxy.proxy(new CAddDatabaseAction(this)));
  }

  /**
   * Passes double-click events to the nodes to handle them.
   *
   * @param event The event to handle.
   */
  private void handleDoubleClick(final MouseEvent event) {
    final IProjectTreeNode selectedNode =
        (IProjectTreeNode) TreeHelpers.getNodeAt(this, event.getX(), event.getY());

    if (selectedNode == null) {
      return;
    }

    selectedNode.doubleClicked();
  }

  /**
   * Shows a popup menu that depends on the node that was clicked.
   *
   * @param event The event to handle.
   */
  private void showPopupMenu(final MouseEvent event) {
    final IProjectTreeNode selectedNode =
        (IProjectTreeNode) TreeHelpers.getNodeAt(this, event.getX(), event.getY());

    if (selectedNode == null) {
      // Show the default menu
      m_popup.show(this, event.getX(), event.getY());
    } else {
      setSelectionPath(new TreePath(((DefaultMutableTreeNode) selectedNode).getPath()));

      final JPopupMenu menu = selectedNode.getPopupMenu();

      if (menu != null) {
        menu.show(this, event.getX(), event.getY());
      }
    }
  }

  @Override
  public IHelpInformation getHelpInformation() {
    return new IHelpInformation() {
      @Override
      public String getText() {
        return "The Project Tree gives a quick overview of the BinNavi databases you have configured and the data stored in the databases.";
      }

      @Override
      public URL getUrl() {
        return CHelpFunctions.urlify(CHelpFunctions.MAIN_WINDOW_FILE);
      }
    };
  }

  @Override
  public CProjectTreeModel getModel() {
    return m_treeModel;
  }

  /**
   * Returns the root node of the project tree.
   *
   * @return The root node of the project tree.
   */
  public CRootNode getRootNode() {
    return m_rootNode;
  }

  /**
   * Handles double-clicks and right-clicks on nodes.
   */
  private class InternalMouseListener extends MouseAdapter {
    @Override
    public void mouseClicked(final MouseEvent event) {
      if ((event.getClickCount() == 2) && (event.getButton() == MouseEvent.BUTTON1)) {
        handleDoubleClick(event);
      }
    }

    @Override
    public void mousePressed(final MouseEvent event) {
      if (event.isPopupTrigger()) {
        showPopupMenu(event);
      }
    }

    @Override
    public void mouseReleased(final MouseEvent event) {
      if (event.isPopupTrigger()) {
        showPopupMenu(event);
      }
    }
  }
}


text:
/*Santiago Zubieta*/
#include <iostream>
#include <numeric>
#include <fstream>
#include <climits>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <queue>
#include <list>
#include <map>
#include <set>
#include <stack>
#include <deque>
#include <vector>
#include <string>
#include <cstdlib>
#include <cassert>
#include <sstream>
#include <iterator>
#include <algorithm>
using namespace std;

map<unsigned long long,unsigned long long> mapa;

unsigned long long partirMonedas(unsigned long long n){
	if(n<12){
		return n;
	}
	else{
		if(mapa[n]){
			return mapa[n];
		}
		mapa[n] = partirMonedas(n/2) + partirMonedas(n/3) + partirMonedas(n/4);
		return mapa[n];
	}
}
int main(){
	unsigned long long n;
    while(scanf("%llu",&n)!=EOF){
		n = partirMonedas(n);
		printf("%llu\n",n);
	}
}


text:
from django.test import TestCase
from django.db.models import fields
from django.db.models.signals import post_save

from django_mixins import MixinBase, ModelBase

class PostSaveReveicerTests(TestCase):

    def test_receiver_must_provide_args(self):

        class DummyMixinWithFieldsPostSave(MixinBase):

            instance = None
            created=None
            raw = None
            using = None
            update_fields = None

            field_a = fields.TextField()
            field_b = fields.TextField()

            @classmethod
            def _postSave(cls, model, instance=None, created=False, raw=False, using=None, update_fields=None, **extraargs):

                instance.instance = instance
                instance.created = created
                instance.raw = raw
                instance.using = using
                instance.update_fields = update_fields

        class MockedWithFieldsPostSave(ModelBase, DummyMixinWithFieldsPostSave):

            def save(self, force_insert=False, force_update=False, using=None,
                     update_fields=None):

                post_save.send(sender=MockedWithFieldsPostSave, instance=self, created=False, raw=False, using=using, update_fields=update_fields)

        args = (1, 'a')
        kwargs = {'field_b' : 'b'}

        m = MockedWithFieldsPostSave(*args, **kwargs)
        created = False
        raw = False
        using = object()
        update_fields=['field_a']
        m.save(using=using, update_fields=update_fields)
        self.assertEqual(m.instance, m, msg = '_postSave should have provided instance.')
        self.assertEqual(m.created, created, msg = '_postSave should have provided created.')
        self.assertEqual(m.raw, raw, msg = '_postSave should have provided raw.')
        self.assertEqual(m.using, using, msg = '_postSave should have provided using.')
        self.assertListEqual(m.update_fields, update_fields, msg = '_postSave should have provided update_fields.')


text:
casper.options.viewportSize = {width: 1024, height: 768};
var testCount = 2;
casper.test.begin("Testing Reddit", testCount, function redditTest(test) {
    casper.start("http://www.reddit.com/r/programming", function() {
    	test.assertTitleMatch(/programming/, "Title is what we'd expect");
    	//Click "new link"
    	casper.click("a[href*='/programming/new/']");
      casper.wait(20000, function() {
        this.echo("I've waited for ten seconds.");
      });
    	casper.waitForUrl(/\/programming\/new\/$/, function() {
    		test.assertElementCount("p.title", 25, "25 links on first page");
    		casper.capture("../images/reddit-programming-new.png");
    	});
    }).run(function() {
        test.done();
    });
});


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">

<title>CURLOPT_SSL_OPTIONS man page</title>
<meta name="generator" content="roffit">

NAME

CURLOPT_SSL_OPTIONS - set SSL behavior options
SYNOPSIS

#include <curl/curl.h>

CURLcode curl_easy_setopt(CURL *handle, CURLOPT_SSL_OPTIONS, long bitmask);
DESCRIPTION

Pass a long with a bitmask to tell libcurl about specific SSL behaviors.

CURLSSLOPT_ALLOW_BEAST is the only supported bit and by setting this the user will tell libcurl to not attempt to use any workarounds for a security flaw in the SSL3 and TLS1.0 protocols.  If this option isn't used or this bit is set to 0, the SSL layer libcurl uses may use a work-around for this flaw although it might cause interoperability problems with some (older) SSL implementations. WARNING: avoiding this work-around lessens the security, and by setting this option to 1 you ask for exactly that.
DEFAULT

0
PROTOCOLS

All TLS-based protocols
EXAMPLE

TODO
AVAILABILITY

Added in 7.25.0
RETURN VALUE

Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
SEE ALSO

CURLOPT_SSLVERSION, CURLOPT_SSL_CIPHER_LIST,

 This HTML page was made with roffit.


text:
<!DOCTYPE html>

        <meta charset="UTF-8">
        <title>Sports Pasta</title>
        <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=yes' name='viewport'>

        <link href="css/bootstrap.min.css" rel="stylesheet" type="text/css" />

        <link href="css/font-awesome.min.css" rel="stylesheet" type="text/css" />

        <link href="css/ionicons.min.css" rel="stylesheet" type="text/css" />

        <link href="css/morris/morris.css" rel="stylesheet" type="text/css" />

        <link href="css/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css" rel="stylesheet" type="text/css" />

        <link href="css/AdminLTE.css" rel="stylesheet" type="text/css" />

		<link href="css/font-awesome.css" rel="stylesheet" type="text/css" />

		<link href="css/flexslider.css" rel="stylesheet" type="text/css" />
		<link href="css/sequencejs-qubico.css" rel="stylesheet" type="text/css" />

        <link href="css/slider.css" rel="stylesheet" type="text/css" />
        <link href="css/datepicker.css" rel="stylesheet" type="text/css" />
        <link href="css/datepicker3.css" rel="stylesheet" type="text/css" />
        <link href="css/lightbox.css" rel="stylesheet" type="text/css">
		<link href="css/SportsPasta.css" rel="stylesheet" type="text/css" />
        <link href="css/bootstrap-select.css" rel="stylesheet" type="text/css" />
        <link href="css/bootstrap-select.min.css" rel="stylesheet" type="text/css" />

		<link href="css/sp1.css" rel="stylesheet" type="text/css" />

        <link href="http://fonts.googleapis.com/css?family=Lato:100,300,400,700,300italic,400italic,700italic|Lustria" rel="stylesheet" type="text/css" />

		<link rel="stylesheet" href="css/jquery.fancybox.css?v=2.1.5" type="text/css" media="screen" />

		<link rel="stylesheet" href="css/jquery.fancybox-buttons.css?v=1.0.5" type="text/css" media="screen" />

		<link rel="stylesheet" href="css/jquery.fancybox-thumbs.css?v=1.0.7" type="text/css" media="screen" />

					<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#site-nav">

					</button>

						SportsPasta

							Home

							About

							Services

							Team

							Portfolio

							Prices

							News

							Contact

							Blog

Ajax Blog

Standard Blog

Single Blog Post

Gallery

My Photos.....My Videos

Album:

                        <select >
                            <option></option>
                            <option>Add a new album</option>
                            <option>CBSE School Meet</option>
                            <option>GWR Annual Day</option>

                        </select>
                <button type="button" class="btn btn-primary btn-md btn-lead lighten" data-toggle="modal" data-target="#AddAlbum">Dummy Add Album button</button>

CBSE School Meet
<button type="button" class="btn btn-primary btn-md btn-lead lighten" data-toggle="modal" data-target="#EditAlbum">Edit this album</button>

                Note: Show captions. Add hover delete, edit caption buttons.

                                <button type="button" class="btn btn-primary btn-md btn-lead lighten">Add More Photos</button>

©2014 SportsPasta by SportsPasta

				Text and imagery in this website are for demo purposes only and have nothing to do with Qthemes.

                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">�</button>

Create a new Album

                    You can create a new album here.

                    Album Name
                    <input id="to" placeholder="Give your album a nice name" type="text" class="form-control" value="CBSE School Meet, Me Playing cricket"  />

                    Match
                    <textarea id="msg1" class="form-control" rows="5" placeholder="This should be a match lookup/match selector">This should be a match lookup/match selector</textarea>

                    <input type="radio" name="r1"> Public</input>
                    <input type="radio" name="r1" checked> Private</input>

                    Cancel
                    Save

                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">�</button>

Edit Album

                    You can change the album details and privacy here

                    Album Name
                    <input id="to" placeholder="Give your album a nice name" type="text" class="form-control" value="CBSE School Meet, Me Playing cricket"  />

                    Match
                    <textarea id="msg1" class="form-control" rows="5" placeholder="This should be a match lookup/match selector">This should be a match lookup/match selector</textarea>

                    <input type="radio" name="r1"> Public</input>
                    <input type="radio" name="r1" checked> Private</input>

                    Cancel
                    Save


text:
<?php
/**
 * Created by PhpStorm.
 * User: yury
 * Date: 05.12.2016
 * Time: 21:17
 */

namespace Taita\Roxot;

/**
 * Class ReplacePlayer
 * @package Taita\Roxot
 */
class ReplacePlayer extends Item implements ItemInterface
{
    /**
     * @var string
     */
    protected $iconSpan = "";

    /**
     * @param Match $match
     */
    public function analyze(Match $match)
    {
        $details = $this->getDetails();
        $team = $match->getTeam($details['team']);
        $team->replacePlayer($details['inPlayerNumber'], $details['outPlayerNumber']);
        $team->getPlayerByNumber($details['inPlayerNumber'])->setFirstMinute($this->time);
        $team->getPlayerByNumber($details['outPlayerNumber'])->setLastMinute($this->time);
    }
}


text:
                    Add new client

The following form can be used to create new clients.

                <form id="add_client_form" class="form" method="post" action="<?=site_url('api/add_client')?>">

                    <legend>Basic info</legend>

                        <input type="text" class="form-control" name="client_name" placeholder="Name">

                        <select class="form-control" name="client_type">
                            <option disabled selected>Select type...</option>

                            <option value="Owner">Owner</option>
                            <option value="Dealer">Dealer</option>
                            <option value="Auction">Auction</option>
                            <option value="Showroom">Showroom</option>

                        </select>

                        <input type="text" class="form-control" name="client_phone" placeholder="Phone">

                    <legend>Location</legend>

                        <input type="text" class="form-control" name="client_address" placeholder="Address">

                        <select class="form-control" name="client_country">
                            <option disabled selected>Select country...</option>

                            <?php foreach ($countries as $country): ?>
                                <option value="<?php echo $country['name'] ?>"><?php echo $country['name'] ?></option>
                            <?php endforeach ?>

                        </select>

                    <legend></legend>

                        <input type="submit" class="btn btn-primary" value="Add">

                        <a href="<?=site_url('client')?>" class="btn btn-link">Cancel

                </form>


text:
//=============================================================================================================

//=============================================================================================================
// INCLUDES
//=============================================================================================================

#include "pluginitem.h"
#include "arrow.h"

#include <QGraphicsScene>
#include <QGraphicsSceneContextMenuEvent>
#include <QMenu>
#include <QPainter>

//=============================================================================================================
// USED NAMESPACES
//=============================================================================================================

using namespace MNESCAN;

//=============================================================================================================
// DEFINE MEMBER METHODS
//=============================================================================================================

PluginItem::PluginItem(SCSHAREDLIB::AbstractPlugin::SPtr pPlugin, QMenu *contextMenu, QGraphicsItem *parent)
: QGraphicsPolygonItem(parent)
, m_pPlugin(pPlugin)
, m_iWidth(60)
, m_iHeight(40)
, m_contextMenu(contextMenu)
{
    QPainterPath path;
    m_qLinearGradientFace = QLinearGradient(m_iWidth/2, -10, m_iWidth/2, m_iHeight);
    m_qLinearGradientFace.setColorAt(1, Qt::white);
    m_qPolygon << QPointF(-m_iWidth/2, -m_iHeight/2) << QPointF(m_iWidth/2, -m_iHeight/2)
               << QPointF(m_iWidth/2, m_iHeight/2) << QPointF(-m_iWidth/2, m_iHeight/2)
               << QPointF(-m_iWidth/2, -m_iHeight/2);
    switch (m_pPlugin->getType()) {
//        case StartEnd:
//            m_qColorContour = QColor(79, 136, 187);
//            m_qLinearGradientFace.setColorAt(0, QColor(234, 239, 247));
//            break;
        case SCSHAREDLIB::AbstractPlugin::_IAlgorithm:
            m_qColorContour = QColor(98, 152, 61);
            m_qLinearGradientFace.setColorAt(0, QColor(235, 241, 233));
            break;
        case SCSHAREDLIB::AbstractPlugin::_ISensor:
            m_qColorContour = QColor(79, 136, 187);
            m_qLinearGradientFace.setColorAt(0, QColor(234, 239, 247));
            break;
        default:
            m_qColorContour = QColor(125, 125, 125);
            m_qLinearGradientFace.setColorAt(0, QColor(125, 125, 125));
            break;
    }
    setBrush(m_qLinearGradientFace);
    setPen(QPen(m_qColorContour,1));
    setPolygon(m_qPolygon);
    setFlag(QGraphicsItem::ItemIsMovable, true);
    setFlag(QGraphicsItem::ItemIsSelectable, true);
    setFlag(QGraphicsItem::ItemSendsGeometryChanges, true);
}

//=============================================================================================================

PluginItem::~PluginItem()
{
    m_pPlugin->unload();
}

//=============================================================================================================

void PluginItem::paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget)
{
    auto textSize = painter->fontMetrics().size(Qt::TextSingleLine, m_pPlugin->getName());
    int iHorizontalSpacing = 4;
    int iVerticalSpacing = 4;

    resizeAsRectangle(textSize.width() + 2 * iHorizontalSpacing,
                      textSize.height() + 2 * iVerticalSpacing);

    QGraphicsPolygonItem::paint(painter, option, widget);

    painter->setPen(QPen(m_qColorContour, 1));

//    QString sKind("");
//    switch (m_diagramType) {
//        case StartEnd:
//            break;
//        case Algorithm:
//            sKind = QString("Tool");
//            break;
//        case Sensor:
//            sKind = QString("Sensor");
//            break;
//        default:
//            sKind = QString("IO");
//            break;
//    }

    painter->drawText(-m_iWidth/2 + iHorizontalSpacing, iVerticalSpacing, m_pPlugin->getName());
}

//=============================================================================================================

void PluginItem::removeArrow(Arrow *arrow)
{
    int index = arrows.indexOf(arrow);

    if (index != -1)
        arrows.removeAt(index);
}

//=============================================================================================================

void PluginItem::removeArrows()
{
    foreach (Arrow *arrow, arrows) {
        arrow->startItem()->removeArrow(arrow);
        arrow->endItem()->removeArrow(arrow);
        scene()->removeItem(arrow);
        delete arrow;
    }
}

//=============================================================================================================

void PluginItem::addArrow(Arrow *arrow)
{
    arrows.append(arrow);
}

//=============================================================================================================

QPixmap PluginItem::image() const
{
    QPixmap pixmap(m_iWidth, m_iHeight);
    pixmap.fill(Qt::transparent);
    QPainter painter(&pixmap);
    painter.setPen(QPen(m_qColorContour, 2));
    painter.translate(m_iWidth/2, m_iHeight/2);

    painter.drawPolyline(m_qPolygon);

    painter.drawText(-m_iWidth/2+4,-m_iHeight/2+14,m_pPlugin->getName().mid(0,10));

    return pixmap;
}

//=============================================================================================================

void PluginItem::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
{
    scene()->clearSelection();
    setSelected(true);
    m_contextMenu->exec(event->screenPos());
}

//=============================================================================================================

QVariant PluginItem::itemChange(GraphicsItemChange change, const QVariant &value)
{
    if (change == QGraphicsItem::ItemPositionChange) {
        foreach (Arrow *arrow, arrows) {
            arrow->updatePosition();
        }
    }

    return value;

//    if (change == ItemPositionChange && scene()) {
//        // value is the new position.
//        QPointF newPos = value.toPointF();
//        QRectF rect = scene()->sceneRect();
//        if (!rect.contains(newPos)) {
//            // Keep the item inside the scene rect.
//            newPos.setX(qMin(rect.right(), qMax(newPos.x(), rect.left())));
//            newPos.setY(qMin(rect.bottom(), qMax(newPos.y(), rect.top())));
//            return newPos;
//        }
//    }

//    return QGraphicsItem::itemChange(change, value);
}

//=============================================================================================================

void PluginItem::resizeAsRectangle(int width, int height)
{
    if(m_iWidth == width && m_iHeight == height){
        return;
    }

    m_iWidth = width;
    m_iHeight = height;

    m_qPolygon = QPolygonF({QPointF(-m_iWidth/2, -m_iHeight/2),
                            QPointF(m_iWidth/2, -m_iHeight/2),
                            QPointF(m_iWidth/2, m_iHeight/2),
                            QPointF(-m_iWidth/2, m_iHeight/2),
                            QPointF(-m_iWidth/2, -m_iHeight/2)});

    this->setPolygon(m_qPolygon);
}


text:
require "pry"

@events = {}

# Implement the block via `yield` or `&block` keywords

# `yield` (yield)
# `block.call()` via (&block)

# def event(name) #, &block)
#   puts "ALERT: #{name}" if yield
# end

def event(name, &block)
  # convert blocks to `Proc`s and stores them in a hash
  # has is a top-level instance variable so it is visible
  binding.pry

  @events[name] = block # still a proc...I haven't called `call()`
end

def setup(&block)
  @setups << block
end

event "the sky is falling" do
  @sky_height < 300
end

event "it's getting closer" do
  @sky_height < @mountains_height
end

setup do
  puts "Setting up sky"
  @sky_height = 100
end

setup do
  puts "Setting up mountains"
  @mountains_height = 200
end

# Setting up sky
# Setting up mountains
# ALERT: the sky is falling
# Setting up sky
# Setting up mountains
# ALERT: it's getting closer


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="highlight">#C38097</color>
    <color name="normal">#FCEFA1</color>
</resources>


text:
package pl.panryba.mc.sponge.interfaces;

public interface FishItemEnchantment {
    int getMaxLevel();
    int getStartLevel();
    void apply(int level);
}


text:
#import <iWorkImport/TSPObject.h>

@class NSArray, NSString;

// Not exported
@interface KNRecordingEventTrack : TSPObject
{
    NSString *mType;
    NSArray *mEvents;
}

@property(readonly, nonatomic) NSArray *events; // @synthesize events=mEvents;
@property(readonly, nonatomic) NSString *type; // @synthesize type=mType;
- (id)eventTrackByReplacingSegmentAfterTime:(double)arg1 withEventTrack:(id)arg2;
- (void)dealloc;
- (id)initWithContext:(id)arg1;
- (id)initWithContext:(id)arg1 type:(id)arg2 events:(id)arg3;

@end


text:
title: Building an E-commerce site with Shopify
examples:
  - label: Gatsby Shopify Starter
    href: "https://github.com/gatsbyjs/gatsby-starter-shopify"
---

In this tutorial, you will set up a new Gatsby website that fetches product data from [Shopify](https://www.shopify.com). The site displays a list of all products on a product listing page, and a page for every product in the store.

If you're already comfortable with Gatsby and Shopify, you might want to check out our [Shopify Starter Demo](https://shopify-demo.gatsbyjs.com/), a proof of concept showcasing 10,000 products and 30,000 SKUs (variants).
You can clone the starter, host it on Gatsby and connect it to your own Shopify data to develop your own proof of concept in as little as an hour.

## Setting up your Shopify account

1. Create a new [Shopify account](https://www.shopify.com) and store if you don't have one.
2. Create a private app in your store by navigating to `Apps`, then `Manage private apps`.
3. Create a new private app, with any "Private app name" and add the following under the `Active Permissions for this App` section:
   - `Read access` for `Products`
   - `Read access` for `Product listings` if you want to use Shopify's Product Collections in your Gatsby site
   - `Read access` for `Orders` if you want to use order information in your Gatsby site
   - `Read access` for `Inventory` and `Locations` if you want to use location information in your Gatsby site
4. Enable the [Shopify Storefront API](https://help.shopify.com/en/api/storefront-api) by checking the box that says "Allow this app to access your storefront data using Storefront API". Make sure to also grant access to `Read product tags`, `Read and modify checkouts`, and `Read customer tags` by checking their corresponding boxes.
5. Copy the password, you'll need it to configure your plugin below.

## Set up the Gatsby Shopify plugin

1. If you do not already have one ready, [create a Gatsby site](/docs/quick-start).

2. Install the [`gatsby-source-shopify`](/plugins/gatsby-source-shopify/) plugin.

```shell
npm install gatsby-source-shopify
```

3. Enable and configure the plugin in your `gatsby-config.js` file, replacing [app-password] with the password you copied above and [yourstore.myshopify.com] with the canonical address of your store.

```javascript:title=/gatsby-config.js
plugins: [
    {
      resolve: `gatsby-source-shopify`,
      options: {
        password: [app-password],
        storeUrl: [yourstore.myshopify.com],
      },
    },
]
```

_Note: You will likely not want to put your `password` and `storeUrl` directly in your `gatsby-config.js` file but rather, use an environment variable. Check out the [Gatsby Shopify starter](https://github.com/gatsbyjs/gatsby-starter-shopify) for an example of how to do that._

4. Run `gatsby develop` and make sure the site compiles successfully.

## Querying Shopify data and listing products

Open the Gatsby GraphiQL interface by visiting `http://localhost:8000/___graphql`. With at least one example product added into Shopify you should see several new types of nodes in the Explorer tab, like `allShopifyProduct`. To query all products in your store sorted by title, try running the query:

```graphql
{
  allShopifyProduct(sort: { title: ASC }) {
    edges {
      node {
        title
        shopifyId
        description
        priceRangeV2 {
          maxVariantPrice {
            amount
          }
          minVariantPrice {
            amount
          }
        }
        status
      }
    }
  }
}
```

To add a simple page listing all products, add a new file at `/src/pages/products.js`.

```jsx:title=/src/pages/products.js
import React from "react"
import { Link, graphql } from "gatsby"

import Layout from "../components/layout"

const ProductsPage = ({ data }) => (
  <Layout>
    <h1>Products</h1>
    <ul>
      {data.allShopifyProduct.edges.map(({ node }) => (
        <li key={node.shopifyId}>
          <h3>
            <Link to={`/products/${node.handle}`}>{node.title}</Link>
            {" - "}${node.priceRangeV2.minVariantPrice.amount}
          </h3>
          <p>{node.description}</p>
        </li>
      ))}
    </ul>
  </Layout>
)

export default ProductsPage

export const query = graphql`
  {
    allShopifyProduct(sort: { title: ASC }) {
      edges {
        node {
          title
          shopifyId
          description
          handle
          priceRangeV2 {
            minVariantPrice {
              amount
            }
          }
        }
      }
    }
  }
`
```

## Generating a page for each product

You can [programmatically create pages](/docs/tutorial/part-7/) in Gatsby for every product in your Shopify store.

Create a template for your product pages by adding a new file, `/src/templates/product.js`.

```jsx:title=/src/templates/product.js
import React from "react"

import Layout from "../components/layout"

const ProductTemplate = ({ pageContext }) => {
  const { product } = pageContext
  return (
    <Layout>
      <h1>{product.title}</h1>
      <div>{product.description}</div>
    </Layout>
  )
}

export default ProductTemplate
```

Edit your `gatsby-node.js` file and add the following code. This queries all Shopify products with GraphQL, then creates a page using the template in `product.js`. Each page gets assigned a URL in the format of `/products/[product handle]`.

```javascript:title=/gatsby-node.js
const path = require(`path`)
exports.createPages = async ({ graphql, actions }) => {
  const { createPage } = actions
  // Query for all products in Shopify
  const result = await graphql(`
    query {
      allShopifyProduct(sort: { title: ASC }) {
        edges {
          node {
            title
            images {
              originalSrc
            }
            shopifyId
            handle
            description
            priceRangeV2 {
              maxVariantPrice {
                amount
              }
              minVariantPrice {
                amount
              }
            }
            status
          }
        }
      }
    }
  `)
  // Iterate over all products and create a new page using a template
  // The product "handle" is generated automatically by Shopify
  result.data.allShopifyProduct.edges.forEach(({ node }) => {
    createPage({
      path: `/products/${node.handle}`,
      component: path.resolve(`./src/templates/product.js`),
      context: {
        product: node,
      },
    })
  })
}
```

## Additional Resources

- [Gatsby Shopify Starter](https://shopify-demo.gatsbyjs.com/)


text:
#if defined(__SPLIT_KERNEL__) || defined(__KERNEL_CUDA__)
#  define __ATOMIC_PASS_WRITE__
#endif

CCL_NAMESPACE_BEGIN

ccl_device_inline void kernel_write_pass_float(ccl_global float *buffer, float value)
{
  ccl_global float *buf = buffer;
#ifdef __ATOMIC_PASS_WRITE__
  atomic_add_and_fetch_float(buf, value);
#else
  *buf += value;
#endif
}

ccl_device_inline void kernel_write_pass_float3(ccl_global float *buffer, float3 value)
{
#ifdef __ATOMIC_PASS_WRITE__
  ccl_global float *buf_x = buffer + 0;
  ccl_global float *buf_y = buffer + 1;
  ccl_global float *buf_z = buffer + 2;

  atomic_add_and_fetch_float(buf_x, value.x);
  atomic_add_and_fetch_float(buf_y, value.y);
  atomic_add_and_fetch_float(buf_z, value.z);
#else
  ccl_global float3 *buf = (ccl_global float3 *)buffer;
  *buf += value;
#endif
}

ccl_device_inline void kernel_write_pass_float4(ccl_global float *buffer, float4 value)
{
#ifdef __ATOMIC_PASS_WRITE__
  ccl_global float *buf_x = buffer + 0;
  ccl_global float *buf_y = buffer + 1;
  ccl_global float *buf_z = buffer + 2;
  ccl_global float *buf_w = buffer + 3;

  atomic_add_and_fetch_float(buf_x, value.x);
  atomic_add_and_fetch_float(buf_y, value.y);
  atomic_add_and_fetch_float(buf_z, value.z);
  atomic_add_and_fetch_float(buf_w, value.w);
#else
  ccl_global float4 *buf = (ccl_global float4 *)buffer;
  *buf += value;
#endif
}

#ifdef __DENOISING_FEATURES__
ccl_device_inline void kernel_write_pass_float_variance(ccl_global float *buffer, float value)
{
  kernel_write_pass_float(buffer, value);

  /* The online one-pass variance update that's used for the megakernel can't easily be implemented
   * with atomics, so for the split kernel the E[x^2] - 1/N * (E[x])^2 fallback is used. */
  kernel_write_pass_float(buffer + 1, value * value);
}

#  ifdef __ATOMIC_PASS_WRITE__
#    define kernel_write_pass_float3_unaligned kernel_write_pass_float3
#  else
ccl_device_inline void kernel_write_pass_float3_unaligned(ccl_global float *buffer, float3 value)
{
  buffer[0] += value.x;
  buffer[1] += value.y;
  buffer[2] += value.z;
}
#  endif

ccl_device_inline void kernel_write_pass_float3_variance(ccl_global float *buffer, float3 value)
{
  kernel_write_pass_float3_unaligned(buffer, value);
  kernel_write_pass_float3_unaligned(buffer + 3, value * value);
}
#endif /* __DENOISING_FEATURES__ */

CCL_NAMESPACE_END


text:
/**
 * A function used by Babel to transpile JSX code into jQuery elements
 */
function buildElement(type, props, ...children) {
    // We need to require jQuery inside of this method because `require()`
    // will work different after mocha's magic "before" method runs.
    //
    // This allows us to use the jQuery instance provided by our jsdom
    // instance.
    let $ = require("jquery");

    // Is our element a TextNode?
    if (props === undefined) {
        // Type will be the text content, which can simply be returned here
        return type;

    // Is our element a Plugin?
    } else if (type.render) {
        // Render the plugin with the passed-in click handler
        return type.render(props && props.onClick);

    // Otherwise, build the element with jQuery
    } else {
        let $el = $("<" + type + ">");

        // Iterate through props
        if (props !== null) {
            for (let propName in props) {
                // onClick gets turned into a jQuery event handler
                // TODO: Handle props like onHover, onFocus, etc.
                if (propName === "onClick") {
                    let handler = props[propName];
                    $el.click(handler);

                // Some passed-in props need to be set with $.attr
                // Currently we do this for role and aria-*
                } else if (/^aria-/.test(propName) || propName === "role") {
                    let value = props[propName];
                    $el.attr(propName, value);

                // All other props can go right to $.prop
                } else {
                    let value = props[propName];
                    $el.prop(propName, value);
                }
            }
        }

        // Recurse through the children and append each resulting element to
        // the parent
        children.forEach((child) => {
            $el.append(buildElement(child));
        });

        return $el;
    }
}

module.exports = buildElement;


text:
<link rel="stylesheet" href="<?php echo base_url();?>assets/admin/css/demo.css" type="text/css" media="screen" />

<a href="<?php echo site_url('county');?>">County

County create

County create

<?php
$error_msg = $this->session->flashdata('error_msg');
if (!empty($error_msg)) {
	?>

<?php echo $error_msg;?>

    <?php
}
?>

County create

                            <form id="form0" action="<?php echo site_url('county/addCountyFormSubmission/')?>"  method="post"  enctype="multipart/form-data">

                                    Name County

                                        <input class="xlarge validate[required]" type="text" name="name_county" id="name_county" />

                                        <input type="submit" class="button blue" value="Add county" />

                            </form>


text:
// Copyright � 2002-2005 Canoo Engineering AG, Switzerland.
package com.canoo.webtest.engine;

import com.canoo.webtest.ant.WebtestTask;
import com.canoo.webtest.self.LogCatchingTestCase;
import org.apache.tools.ant.Project;

import java.io.File;

/**
 * Tests for {@link com.canoo.webtest.engine.ContextHelper}.
 * @author Marc Guillemot
 * @author Paul King
 */
public class ContextHelperTest extends LogCatchingTestCase
{
    /**
     * Tests that no exception is thrown when an IOException occurs but that it gets logged.
     */
    public void testWriteResponseFileIOExceptionHandling() {
        ContextHelper.writeResponseFile(null, new File(""));
        assertTrue(getSpoofAppender().allMessagesToString().indexOf("Failed writing current response to") > -1);
    }

    public void testDefineAsCurrentResponseWhenNoPreviousResponsePresent() {
        // Setup Context
        Project project = new Project();
        final WebtestTask webTest = new WebtestTask();
        webTest.setName("TestWebTest");
        webTest.setProject(project);
        Context context = new Context(webTest);
        Configuration config = new Configuration(webTest);
        config.setContext(context);
        config.setProject(project);
        config.execute();

        String expectedUrl = "http://foo.bar/";
        String expectedContent = "foo";
        String expectedContentType = "text/plain";

        ContextHelper.defineAsCurrentResponse(context, expectedContent, expectedContentType, expectedUrl);

        assertEquals(expectedUrl, context.getCurrentResponse().getUrl().toString());
        assertEquals(expectedContent, context.getCurrentResponse().getWebResponse().getContentAsString());
        assertEquals(expectedContentType, context.getCurrentResponse().getWebResponse().getContentType());
    }

    protected void setUp() throws Exception {
        super.setUp();
        setUpCatchLoggerMessages();
    }

    protected void tearDown() throws Exception {
        super.tearDown();
        tearDownCatchLoggerMessages();
    }
}


text:
package dynamodb

import (
	"context"
	"fmt"

	"github.com/Clever/wag/samples/v8/gen-go-db-only/db"
	"github.com/Clever/wag/samples/v8/gen-go-db-only/models"
	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/awserr"
	"github.com/aws/aws-sdk-go/service/dynamodb"
	"github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute"
	"github.com/aws/aws-sdk-go/service/dynamodb/dynamodbiface"
	"github.com/go-openapi/strfmt"
)

var _ = strfmt.DateTime{}

// ThingAllowingBatchWritesTable represents the user-configurable properties of the ThingAllowingBatchWrites table.
type ThingAllowingBatchWritesTable struct {
	DynamoDBAPI        dynamodbiface.DynamoDBAPI
	Prefix             string
	TableName          string
	ReadCapacityUnits  int64
	WriteCapacityUnits int64
}

// ddbThingAllowingBatchWritesPrimaryKey represents the primary key of a ThingAllowingBatchWrites in DynamoDB.
type ddbThingAllowingBatchWritesPrimaryKey struct {
	Name    string `dynamodbav:"name"`
	Version int64  `dynamodbav:"version"`
}

// ddbThingAllowingBatchWrites represents a ThingAllowingBatchWrites as stored in DynamoDB.
type ddbThingAllowingBatchWrites struct {
	models.ThingAllowingBatchWrites
}

func (t ThingAllowingBatchWritesTable) name() string {
	if t.TableName != "" {
		return t.TableName
	}
	return fmt.Sprintf("%s-thing-allowing-batch-writess", t.Prefix)
}

func (t ThingAllowingBatchWritesTable) create(ctx context.Context) error {
	if _, err := t.DynamoDBAPI.CreateTableWithContext(ctx, &dynamodb.CreateTableInput{
		AttributeDefinitions: []*dynamodb.AttributeDefinition{
			{
				AttributeName: aws.String("name"),
				AttributeType: aws.String("S"),
			},
			{
				AttributeName: aws.String("version"),
				AttributeType: aws.String("N"),
			},
		},
		KeySchema: []*dynamodb.KeySchemaElement{
			{
				AttributeName: aws.String("name"),
				KeyType:       aws.String(dynamodb.KeyTypeHash),
			},
			{
				AttributeName: aws.String("version"),
				KeyType:       aws.String(dynamodb.KeyTypeRange),
			},
		},
		ProvisionedThroughput: &dynamodb.ProvisionedThroughput{
			ReadCapacityUnits:  aws.Int64(t.ReadCapacityUnits),
			WriteCapacityUnits: aws.Int64(t.WriteCapacityUnits),
		},
		TableName: aws.String(t.name()),
	}); err != nil {
		return err
	}
	return nil
}

func (t ThingAllowingBatchWritesTable) saveThingAllowingBatchWrites(ctx context.Context, m models.ThingAllowingBatchWrites) error {
	data, err := encodeThingAllowingBatchWrites(m)
	if err != nil {
		return err
	}
	_, err = t.DynamoDBAPI.PutItemWithContext(ctx, &dynamodb.PutItemInput{
		TableName: aws.String(t.name()),
		Item:      data,
		ExpressionAttributeNames: map[string]*string{
			"#NAME":    aws.String("name"),
			"#VERSION": aws.String("version"),
		},
		ConditionExpression: aws.String("attribute_not_exists(#NAME) AND attribute_not_exists(#VERSION)"),
	})
	if err != nil {
		if aerr, ok := err.(awserr.Error); ok {
			switch aerr.Code() {
			case dynamodb.ErrCodeConditionalCheckFailedException:
				return db.ErrThingAllowingBatchWritesAlreadyExists{
					Name:    m.Name,
					Version: m.Version,
				}
			case dynamodb.ErrCodeResourceNotFoundException:
				return fmt.Errorf("table or index not found: %s", t.name())
			}
		}
		return err
	}
	return nil
}
func (t ThingAllowingBatchWritesTable) saveArrayOfThingAllowingBatchWrites(ctx context.Context, ms []models.ThingAllowingBatchWrites) error {
	if len(ms) > maxDynamoDBBatchItems {
		return fmt.Errorf("saveArrayOfThingAllowingBatchWrites received %d items to save, which is greater than the maximum of %d", len(ms), maxDynamoDBBatchItems)
	}

	if len(ms) == 0 {
		return nil
	}

	batch := make([]*dynamodb.WriteRequest, len(ms))
	for i := range ms {
		data, err := encodeThingAllowingBatchWrites(ms[i])
		if err != nil {
			return err
		}
		batch[i] = &dynamodb.WriteRequest{
			PutRequest: &dynamodb.PutRequest{
				Item: data,
			},
		}
	}
	tname := t.name()
	for {
		if out, err := t.DynamoDBAPI.BatchWriteItemWithContext(ctx, &dynamodb.BatchWriteItemInput{
			RequestItems: map[string][]*dynamodb.WriteRequest{
				tname: batch,
			},
		}); err != nil {
			return fmt.Errorf("BatchWriteItem: %v", err)
		} else if out.UnprocessedItems != nil && len(out.UnprocessedItems[tname]) > 0 {
			batch = out.UnprocessedItems[tname]
		} else {
			break
		}
	}
	return nil
}

func (t ThingAllowingBatchWritesTable) deleteArrayOfThingAllowingBatchWrites(ctx context.Context, ms []models.ThingAllowingBatchWrites) error {
	if len(ms) > maxDynamoDBBatchItems {
		return fmt.Errorf("deleteArrayOfThingAllowingBatchWrites received %d items to delete, which is greater than the maximum of %d", len(ms), maxDynamoDBBatchItems)
	}

	if len(ms) == 0 {
		return nil
	}

	batch := make([]*dynamodb.WriteRequest, len(ms))
	for i := range ms {
		key, err := dynamodbattribute.MarshalMap(ddbThingAllowingBatchWritesPrimaryKey{
			Name:    ms[i].Name,
			Version: ms[i].Version,
		})
		if err != nil {
			return err
		}

		batch[i] = &dynamodb.WriteRequest{
			DeleteRequest: &dynamodb.DeleteRequest{
				Key: key,
			},
		}
	}
	tname := t.name()
	for {
		if out, err := t.DynamoDBAPI.BatchWriteItemWithContext(ctx, &dynamodb.BatchWriteItemInput{
			RequestItems: map[string][]*dynamodb.WriteRequest{
				tname: batch,
			},
		}); err != nil {
			return fmt.Errorf("BatchWriteItem: %v", err)
		} else if out.UnprocessedItems != nil && len(out.UnprocessedItems[tname]) > 0 {
			batch = out.UnprocessedItems[tname]
		} else {
			break
		}
	}
	return nil
}

func (t ThingAllowingBatchWritesTable) getThingAllowingBatchWrites(ctx context.Context, name string, version int64) (*models.ThingAllowingBatchWrites, error) {
	key, err := dynamodbattribute.MarshalMap(ddbThingAllowingBatchWritesPrimaryKey{
		Name:    name,
		Version: version,
	})
	if err != nil {
		return nil, err
	}
	res, err := t.DynamoDBAPI.GetItemWithContext(ctx, &dynamodb.GetItemInput{
		Key:            key,
		TableName:      aws.String(t.name()),
		ConsistentRead: aws.Bool(true),
	})
	if err != nil {
		if aerr, ok := err.(awserr.Error); ok {
			switch aerr.Code() {
			case dynamodb.ErrCodeResourceNotFoundException:
				return nil, fmt.Errorf("table or index not found: %s", t.name())
			}
		}
		return nil, err
	}

	if len(res.Item) == 0 {
		return nil, db.ErrThingAllowingBatchWritesNotFound{
			Name:    name,
			Version: version,
		}
	}

	var m models.ThingAllowingBatchWrites
	if err := decodeThingAllowingBatchWrites(res.Item, &m); err != nil {
		return nil, err
	}

	return &m, nil
}

func (t ThingAllowingBatchWritesTable) scanThingAllowingBatchWritess(ctx context.Context, input db.ScanThingAllowingBatchWritessInput, fn func(m *models.ThingAllowingBatchWrites, lastThingAllowingBatchWrites bool) bool) error {
	scanInput := &dynamodb.ScanInput{
		TableName:      aws.String(t.name()),
		ConsistentRead: aws.Bool(!input.DisableConsistentRead),
		Limit:          input.Limit,
	}
	if input.StartingAfter != nil {
		exclusiveStartKey, err := dynamodbattribute.MarshalMap(input.StartingAfter)
		if err != nil {
			return fmt.Errorf("error encoding exclusive start key for scan: %s", err.Error())
		}
		// must provide only the fields constituting the index
		scanInput.ExclusiveStartKey = map[string]*dynamodb.AttributeValue{
			"name":    exclusiveStartKey["name"],
			"version": exclusiveStartKey["version"],
		}
	}
	totalRecordsProcessed := int64(0)
	var innerErr error
	err := t.DynamoDBAPI.ScanPagesWithContext(ctx, scanInput, func(out *dynamodb.ScanOutput, lastPage bool) bool {
		items, err := decodeThingAllowingBatchWritess(out.Items)
		if err != nil {
			innerErr = fmt.Errorf("error decoding %s", err.Error())
			return false
		}
		for i := range items {
			if input.Limiter != nil {
				if err := input.Limiter.Wait(ctx); err != nil {
					innerErr = err
					return false
				}
			}
			isLastModel := lastPage && i == len(items)-1
			if shouldContinue := fn(&items[i], isLastModel); !shouldContinue {
				return false
			}
			totalRecordsProcessed++
			// if the Limit of records have been passed to fn, don't pass anymore records.
			if input.Limit != nil && totalRecordsProcessed == *input.Limit {
				return false
			}
		}
		return true
	})
	if innerErr != nil {
		return innerErr
	}
	return err
}

func (t ThingAllowingBatchWritesTable) getThingAllowingBatchWritessByNameAndVersion(ctx context.Context, input db.GetThingAllowingBatchWritessByNameAndVersionInput, fn func(m *models.ThingAllowingBatchWrites, lastThingAllowingBatchWrites bool) bool) error {
	if input.VersionStartingAt != nil && input.StartingAfter != nil {
		return fmt.Errorf("Can specify only one of input.VersionStartingAt or input.StartingAfter")
	}
	if input.Name == "" {
		return fmt.Errorf("Hash key input.Name cannot be empty")
	}
	queryInput := &dynamodb.QueryInput{
		TableName: aws.String(t.name()),
		ExpressionAttributeNames: map[string]*string{
			"#NAME": aws.String("name"),
		},
		ExpressionAttributeValues: map[string]*dynamodb.AttributeValue{
			":name": &dynamodb.AttributeValue{
				S: aws.String(input.Name),
			},
		},
		ScanIndexForward: aws.Bool(!input.Descending),
		ConsistentRead:   aws.Bool(!input.DisableConsistentRead),
	}
	if input.Limit != nil {
		queryInput.Limit = input.Limit
	}
	if input.VersionStartingAt == nil {
		queryInput.KeyConditionExpression = aws.String("#NAME = :name")
	} else {
		queryInput.ExpressionAttributeNames["#VERSION"] = aws.String("version")
		queryInput.ExpressionAttributeValues[":version"] = &dynamodb.AttributeValue{
			N: aws.String(fmt.Sprintf("%d", *input.VersionStartingAt)),
		}
		if input.Descending {
			queryInput.KeyConditionExpression = aws.String("#NAME = :name AND #VERSION <= :version")
		} else {
			queryInput.KeyConditionExpression = aws.String("#NAME = :name AND #VERSION >= :version")
		}
	}
	if input.StartingAfter != nil {
		queryInput.ExclusiveStartKey = map[string]*dynamodb.AttributeValue{
			"version": &dynamodb.AttributeValue{
				N: aws.String(fmt.Sprintf("%d", input.StartingAfter.Version)),
			},
			"name": &dynamodb.AttributeValue{
				S: aws.String(input.StartingAfter.Name),
			},
		}
	}

	totalRecordsProcessed := int64(0)
	var pageFnErr error
	pageFn := func(queryOutput *dynamodb.QueryOutput, lastPage bool) bool {
		if len(queryOutput.Items) == 0 {
			return false
		}
		items, err := decodeThingAllowingBatchWritess(queryOutput.Items)
		if err != nil {
			pageFnErr = err
			return false
		}
		hasMore := true
		for i := range items {
			if lastPage == true {
				hasMore = i < len(items)-1
			}
			if !fn(&items[i], !hasMore) {
				return false
			}
			totalRecordsProcessed++
			// if the Limit of records have been passed to fn, don't pass anymore records.
			if input.Limit != nil && totalRecordsProcessed == *input.Limit {
				return false
			}
		}
		return true
	}

	err := t.DynamoDBAPI.QueryPagesWithContext(ctx, queryInput, pageFn)
	if err != nil {
		if aerr, ok := err.(awserr.Error); ok {
			switch aerr.Code() {
			case dynamodb.ErrCodeResourceNotFoundException:
				return fmt.Errorf("table or index not found: %s", t.name())
			}
		}
		return err
	}
	if pageFnErr != nil {
		return pageFnErr
	}

	return nil
}

func (t ThingAllowingBatchWritesTable) deleteThingAllowingBatchWrites(ctx context.Context, name string, version int64) error {
	key, err := dynamodbattribute.MarshalMap(ddbThingAllowingBatchWritesPrimaryKey{
		Name:    name,
		Version: version,
	})
	if err != nil {
		return err
	}
	_, err = t.DynamoDBAPI.DeleteItemWithContext(ctx, &dynamodb.DeleteItemInput{
		Key:       key,
		TableName: aws.String(t.name()),
	})
	if err != nil {
		if aerr, ok := err.(awserr.Error); ok {
			switch aerr.Code() {
			case dynamodb.ErrCodeResourceNotFoundException:
				return fmt.Errorf("table or index not found: %s", t.name())
			}
		}
		return err
	}

	return nil
}

// encodeThingAllowingBatchWrites encodes a ThingAllowingBatchWrites as a DynamoDB map of attribute values.
func encodeThingAllowingBatchWrites(m models.ThingAllowingBatchWrites) (map[string]*dynamodb.AttributeValue, error) {
	return dynamodbattribute.MarshalMap(ddbThingAllowingBatchWrites{
		ThingAllowingBatchWrites: m,
	})
}

// decodeThingAllowingBatchWrites translates a ThingAllowingBatchWrites stored in DynamoDB to a ThingAllowingBatchWrites struct.
func decodeThingAllowingBatchWrites(m map[string]*dynamodb.AttributeValue, out *models.ThingAllowingBatchWrites) error {
	var ddbThingAllowingBatchWrites ddbThingAllowingBatchWrites
	if err := dynamodbattribute.UnmarshalMap(m, &ddbThingAllowingBatchWrites); err != nil {
		return err
	}
	*out = ddbThingAllowingBatchWrites.ThingAllowingBatchWrites
	return nil
}

// decodeThingAllowingBatchWritess translates a list of ThingAllowingBatchWritess stored in DynamoDB to a slice of ThingAllowingBatchWrites structs.
func decodeThingAllowingBatchWritess(ms []map[string]*dynamodb.AttributeValue) ([]models.ThingAllowingBatchWrites, error) {
	thingAllowingBatchWritess := make([]models.ThingAllowingBatchWrites, len(ms))
	for i, m := range ms {
		var thingAllowingBatchWrites models.ThingAllowingBatchWrites
		if err := decodeThingAllowingBatchWrites(m, &thingAllowingBatchWrites); err != nil {
			return nil, err
		}
		thingAllowingBatchWritess[i] = thingAllowingBatchWrites
	}
	return thingAllowingBatchWritess, nil
}


text:
/* eslint no-console: [0] */
'use strict'

const Template = require('trailpack-proxy-email').Template

module.exports = class Order extends Template {
  created(order) {
    let orderItems = '
Order Items
'
    orderItems = orderItems + `

      Name
      Qty
      Price

`

    orderItems = orderItems + order.order_items.map(item => {
      return `

  ${ item.name }
  ${item.quantity }
  ${ this.app.services.ProxyCartService.formatCurrency(item.calculated_price, order.currency)}

`
    }).join('\n')

    orderItems = orderItems + '

'

    let taxes = '', taxesTotal = ''
    if (order.tax_lines.length > 0) {
      taxes = '
Taxes
\n'
      taxes = taxes + order.tax_lines.map(item => {
        return `<p>${ item.name } ${ this.app.services.ProxyCartService.formatCurrency(item.price, order.currency)}</p>`
      }).join('\n')

      taxesTotal = `<p>Taxes: ${ this.app.services.ProxyCartService.formatCurrency(order.total_tax, order.currency)}</p>`
    }

    let shipping = '', shippingTotal = ''
    if (order.shipping_lines.length > 0) {
      shipping = '
Shipping
\n'
      shipping = shipping + order.shipping_lines.map(item => {
        return `<p>${ item.name } ${ this.app.services.ProxyCartService.formatCurrency(item.price, order.currency)}</p>`
      }).join('\n')

      shippingTotal = `<p>Shipping: ${ this.app.services.ProxyCartService.formatCurrency(order.total_shipping, order.currency)}</p>`
    }

    let discounted = '', discountedTotal = ''
    if (order.discounted_lines.length > 0) {
      discounted = '
discounted
\n'
      discounted = discounted + order.discounted_lines.map(item => {
        return `<p>${ item.name } - ${ this.app.services.ProxyCartService.formatCurrency(item.price, order.currency)}</p>`
      }).join('\n')

      discountedTotal = `<p>Discounts: - ${ this.app.services.ProxyCartService.formatCurrency(order.total_discounts, order.currency)}</p>\n`
    }

    let overrides = '', overridesTotal = ''
    if (order.pricing_overrides.length > 0) {
      overrides = '
Price Overrides
\n'
      overrides = overrides + order.pricing_overrides.map(item => {
        return `<p>${ item.name } - ${ this.app.services.ProxyCartService.formatCurrency(item.price, order.currency)}</p>`
      }).join('\n')

      overridesTotal = `<p>Price Overrides: - ${ this.app.services.ProxyCartService.formatCurrency(order.total_discounts, order.currency)}</p>\n`
    }

    return `
Order ${ order.name } Created

Dear ${order.Customer ? order.Customer.getSalutation() : 'Customer'},

Your order was created and is being processed.

Order Number: ${ order.name }

${orderItems}${discounted}${overrides}${shipping}${taxes}

------------------------

Subtotal: ${ this.app.services.ProxyCartService.formatCurrency(order.subtotal_price, order.currency)}

${discountedTotal}${overridesTotal}${shippingTotal}${taxesTotal}

Total: ${ this.app.services.ProxyCartService.formatCurrency(order.total_price, order.currency)}

------------------------

Thank you!
`
  }

  updated(order) {
    const orderItems = order.order_items.map(item => {
      return `<p>${ item.name } x ${item.quantity } - ${ this.app.services.ProxyCartService.formatCurrency(item.calculated_price, order.currency)}</p>`
    }).join('\n')

    return `
Order ${ order.name } was updated

Dear ${order.Customer ? order.Customer.getSalutation() : 'Customer'},

Your order has been updated.

Order Number: ${ order.name }

Order Items

${orderItems}

Thank you!
`
  }

  cancelled(order) {
    const orderItems = order.order_items.map(item => {
      return `<p>${ item.name } x ${item.quantity } - ${ this.app.services.ProxyCartService.formatCurrency(item.calculated_price, order.currency)}</p>`
    }).join('\n')

    let refunded
    if (order.refunded_lines.length > 0) {
      refunded = '
Refunded
'
      refunded = refunded + order.refunded_lines.map(item => {
        return `<p>${ item.name } - ${ this.app.services.ProxyCartService.formatCurrency(item.price, order.currency)}</p>`
      }).join('\n')
    }

    return `
Order ${ order.name } Cancelled

Dear ${order.Customer ? order.Customer.getSalutation() : 'Customer'},

Your order has been cancelled.

Order Number: ${ order.name }

Order Items

${orderItems}
${refunded}

------------------------

Subtotal: ${ this.app.services.ProxyCartService.formatCurrency(order.subtotal_price, order.currency)}

Total: ${ this.app.services.ProxyCartService.formatCurrency(order.total_price, order.currency)}

Refunded: ${ this.app.services.ProxyCartService.formatCurrency(order.total_refunds, order.currency)}

------------------------

Thank you!
`
  }

  fulfilled(order) {
    const orderItems = order.order_items.map(item => {
      return `<p>${ item.name } x ${item.quantity } - ${ this.app.services.ProxyCartService.formatCurrency(item.calculated_price, order.currency)}</p>`
    }).join('\n')

    return `
Order ${ order.name } Fulfilled

Dear ${order.Customer ? order.Customer.getSalutation() : 'Customer'},

Your order has been fulfilled.

Order Number: ${ order.name }

Order Items

${orderItems}

Thank you!
`
  }

  failed(order) {
    const orderItems = order.order_items.map(item => {
      return `<p>${ item.name } x ${item.quantity } - ${ this.app.services.ProxyCartService.formatCurrency(item.calculated_price, order.currency)}</p>`
    }).join('\n')

    return `
Order ${ order.name } failed to process

Dear ${order.Customer ? order.Customer.getSalutation() : 'Customer'},

Your payment failed.

Order Number: ${ order.name }

Order Items

${orderItems}

------------------------

Subtotal: ${ this.app.services.ProxyCartService.formatCurrency(order.subtotal_price, order.currency)}

Total: ${ this.app.services.ProxyCartService.formatCurrency(order.total_price, order.currency)}

Total Still Due: ${ this.app.services.ProxyCartService.formatCurrency(order.total_due, order.currency)}

------------------------

Thank you!
`
  }

  /**
   *
   * @param order
   * @returns {string}
   */
  paid(order) {
    const orderItems = order.order_items.map(item => {
      return `<p>${ item.name } x ${item.quantity } - ${ this.app.services.ProxyCartService.formatCurrency(item.calculated_price, order.currency)}</p>`
    }).join('\n')

    return `
Order ${ order.name } Receipt

Dear ${order.Customer ? order.Customer.getSalutation() : 'Customer'},

Your payment is complete.

Order Number: ${ order.name }

Order Items

${orderItems}

------------------------

Subtotal: ${ this.app.services.ProxyCartService.formatCurrency(order.subtotal_price, order.currency)}

Total: ${ this.app.services.ProxyCartService.formatCurrency(order.total_price, order.currency)}

------------------------

Thank you!
`
  }

  /**
   *
   * @param order
   * @returns {string}
   */
  partiallyPaid(order) {
    const orderItems = order.order_items.map(item => {
      return `<p>${ item.name } x ${item.quantity } - ${ this.app.services.ProxyCartService.formatCurrency(item.calculated_price, order.currency)}</p>`
    }).join('\n')

    return `
Order ${ order.name } Receipt

Dear ${order.Customer ? order.Customer.getSalutation() : 'Customer'},

Your order has been partially paid.

Order Number: ${ order.name }

Order Items

${orderItems}

------------------------

Subtotal: ${ this.app.services.ProxyCartService.formatCurrency(order.subtotal_price, order.currency)}

Total: ${ this.app.services.ProxyCartService.formatCurrency(order.total_price, order.currency)}

Total Still Due: ${ this.app.services.ProxyCartService.formatCurrency(order.total_due, order.currency)}

------------------------

Thank you!
`
  }

  refunded(order) {
    const orderItems = order.order_items.map(item => {
      return `<p>${ item.name } x ${item.quantity } - ${this.app.services.ProxyCartService.formatCurrency(item.calculated_price, order.currency)}</p>`
    }).join('\n')

    return `
Order ${ order.name } Refunded

Dear ${order.Customer ? order.Customer.getSalutation() : 'Customer'},

Your payment has been refunded.

Order Number: ${ order.name }

Order Items

${orderItems}

------------------------

Subtotal: ${ this.app.services.ProxyCartService.formatCurrency(order.subtotal_price, order.currency)}

Total: ${ this.app.services.ProxyCartService.formatCurrency(order.total_price, order.currency)}

Refunded: ${ this.app.services.ProxyCartService.formatCurrency(order.total_refunds, order.currency)}

------------------------

Thank you!
`
  }
}


text:
======
Resume
======

* Email: congkevin@gmail.com
* LinkedIn: https://www.linkedin.com/in/shen-cong-48b15944/
* GitHub: https://github.com/kevincong

Summary of Qualification
------------------------

* Balanced proficiency with Python_, Java_ and `C/C++`_, able to adapt new programming languages quickly when needed.
* 4-year professional experience with back-end Python based WSGI_ web frameworks (eg. Tornado_, webapp2_, Flask_). Familiar with SQL_ (eg. PostgreSQL_, MySQL_) and NoSQL_ (eg. MongoDB_, `Google Cloud Datastore`_). Experienced with several modern front-end web technologies including HTML_, JavaScript_, CSS_, React_ \+ Redux_, AngularJS_, jQuery_, Sass_/Less_, `Twitter Bootstrap`_.
* Strong ability to code in distributed computing framework, such as `Apache Spark`_ (Scala) and `MapReduce`_ (Java). Familiar with the `Hadoop`_ ecosystem and `Google Cloud`_ ecosystem for processing big data.
* Solid understanding of common `machine learning`_ algorithms, `neural networks`_. Familiar with `Numpy`_, `Pandas`_, `TensorFlow`_, `Keras`_, `iPython Notebook`_, `LaTeX`_, etc. Experienced with batch and streaming data mining processing using `Apache Spark MLlib`_, `Google Cloud BigQuery`_ and `Google Cloud Dataflow`_.
* Experienced with Python deployment automation tool (eg. Fabric_, setuptools_). Familiar with deployment with large scale, including nginx_ load balancing, containers (eg. Docker_), container management tools (eg. Kubernetes_).
* Experienced both `Google Cloud Platform`_ and `Amazon AWS`_ cloud computing platforms.
* Familiar with command line environment, source control (eg. Git_) and Vim_, JIRA_ AGILE_ project management tools.
* Strong mathematical background, familiar with common topics in statistics, linear algebra, calculus and optimization.
* Strong communication, presentation and technical writing skills; wide breadth of knowledge; high sense of responsibility; detail-oriented; self discipline; strong ability of self-learning; enthusiastic team worker.

Work Experience
---------------

* Full Stack Developer, `Chefhero Inc.`_, Toronto, ON, 2015 - 2017
    * Prototype and develop the core product of the online ordering platform called Chefhero that connects restaurants with multiple food vendors. Lead developer and architect with its admin system, responsible for both frontend and backend using series of products in the `Google Cloud Platform`_.
    * Research and develop a recommender system for Chefhero using `Google Cloud Pub\/Sub`_, `Google Cloud Dataflow`_, `Google Cloud Dataproc`_ with `Apache Spark MLlib`_.
    * Discover a semi-automated data recovery method using `Google Cloud BigQuery`_, which eventually becomes the major data source for the data analytics team.

* Full Stack Developer, `WhoKnows Inc.`_, Toronto, ON, 2013 - 2015
    * A 5-10 people agile startup company which focus on expertise auto-discovery and collaboration, based on tracking user web browsing activities.
    * Design and develop web server back end with Python Tornado_. Also experienced MongoDB_ data migration, OAuth2_ integration with LinkedIn, Google, `IMAP connector`_, Webpage scraping using BeautifulSoup_, and analytics tracking by using Mixpanel_, HubSpot_.
    * Develop client side web interface. eg. user profile page, signup/login page, admin system pages, invite pages, using some front-end frameworks such as AngularJS_, Less_, jQuery_.
    * Key role on prototyping and developing the patented browser plugin (`Omni Layer`_) on modern browsers (eg. `Chrome Extensions`_, `Firefox XUL`_).

* Web Application Developer, `IBM Canada`_, Markham, ON, 2012
    * 8-month internship. Develop and maintain the website for `Center of Advanced Studies`_ (CAS) Research department.
    * Involved developing a dynamic website for annual conference CASCON_. The website allows user to register and login to the system, submit workshop/exhibition proposals online. Also an administrator system used by staff members to review user's submissions.
    * Responsible for develop and maintain the static informational website of the department for both external and internal.

Education
---------

* `Bachelor of Computer Science`_, `University of Waterloo`_, 2008 - 2012, 2017 - 2018
    * Focused on `Intro to Machine Learning`_, `Artificial Intelligence`_, `Data-Intensive Distributed Computing`_, `Distributed Systems`_, `Numeric Computation for Financial Modeling`_.
* `A.Y.Jackson Secondary School`_, North York, ON, 2005 - 2008

Activities and Interests
------------------------

* Strong interest in modern web technologies, big data, AI and blockchain. Attended online courses on Coursera_, edX_, Udacity_ and Udemy_ for topics like big data, machine learning and ReactJS.
* Enjoy playing piano, tennis, badminton, snooker, and running. Participated in `Toronto Waterfront Marathon Run`_, `White Oak Tennis Club`_, `UW Badminton Club`_.

.. Hyperlink Destinations:

.. _Python: http://python.org
.. _C/C++: http://www.cplusplus.com/
.. _Java: https://www.java.com/en/
.. _WSGI: https://en.wikipedia.org/wiki/Web_Server_Gateway_Interface
.. _Tornado: http://www.tornadoweb.org/en/stable/
.. _webapp2: https://webapp2.readthedocs.io/en/latest/
.. _Flask: http://flask.pocoo.org/
.. _SQL: https://en.wikipedia.org/wiki/SQL
.. _PostgreSQL: https://www.postgresql.org/
.. _MySQL: https://www.mysql.com/
.. _NoSQL: https://en.wikipedia.org/wiki/NoSQL
.. _MongoDB: https://www.mongodb.com/
.. _Google Cloud Datastore: https://cloud.google.com/datastore/
.. _Apache Spark: https://spark.apache.org/
.. _MapReduce: http://hadoop.apache.org/docs/current/hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapReduceTutorial.html
.. _Hadoop: http://hadoop.apache.org/
.. _Google Cloud: https://cloud.google.com/
.. _Fabric: http://www.fabfile.org/
.. _setuptools: https://setuptools.readthedocs.io/en/latest/
.. _nginx: https://nginx.org/en/docs/
.. _Docker: https://www.docker.com/
.. _Kubernetes: https://kubernetes.io/
.. _distributed system: https://en.wikipedia.org/wiki/Distributed_computing
.. _Google Cloud Platform: https://cloud.google.com/
.. _Amazon AWS: https://aws.amazon.com/
.. _machine learning: https://en.wikipedia.org/wiki/Machine_learning
.. _neural networks: https://en.wikipedia.org/wiki/Artificial_neural_network
.. _Numpy: http://www.numpy.org/
.. _Pandas: https://pandas.pydata.org/
.. _TensorFlow: https://www.tensorflow.org/
.. _Keras: https://keras.io/
.. _iPython Notebook: https://ipython.org/notebook.html
.. _LaTeX: https://www.latex-project.org/
.. _Apache Spark MLlib: https://spark.apache.org/docs/latest/ml-guide.html
.. _Google Cloud BigQuery: https://cloud.google.com/bigquery/
.. _Google Cloud Dataflow: https://cloud.google.com/dataflow/
.. _HTML: https://developer.mozilla.org/en-US/docs/Web/HTML
.. _JavaScript: https://developer.mozilla.org/en-US/docs/Web/JavaScript
.. _CSS: https://developer.mozilla.org/en-US/docs/Web/CSS
.. _React: https://facebook.github.io/react/docs/hello-world.html
.. _Redux: http://redux.js.org/
.. _AngularJS: https://angularjs.org/
.. _jQuery: http://api.jquery.com/
.. _Sass: http://sass-lang.com/
.. _Less: http://lesscss.org/
.. _Twitter Bootstrap: https://getbootstrap.com/
.. _Git: https://git-scm.com/
.. _Vim: http://www.vim.org/
.. _JIRA: https://www.atlassian.com/software/jira
.. _AGILE: https://en.wikipedia.org/wiki/Agile_software_development

.. _Chefhero Inc.: https://chefhero.com/
.. _Google Cloud Pub\/Sub: https://cloud.google.com/pubsub/
.. _Google Cloud Dataproc: https://cloud.google.com/dataproc/
.. _WhoKnows Inc.: https://corp.whoknows.com/
.. _OAuth2: https://oauth.net/2/
.. _IMAP connector: https://en.wikipedia.org/wiki/Internet_Message_Access_Protocol
.. _BeautifulSoup: https://www.crummy.com/software/BeautifulSoup/
.. _Mixpanel: https://mixpanel.com/
.. _HubSpot: https://www.hubspot.com/
.. _Omni Layer: http://www.google.com/patents/US20140279821
.. _Chrome Extensions: https://developer.chrome.com/extensions
.. _Firefox XUL: https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL
.. _IBM Canada: https://www.ibm.com/ca-en/
.. _Center of Advanced Studies: https://www-01.ibm.com/ibm/cas/canada/index.jsp
.. _CASCON: https://www-01.ibm.com/ibm/cas/cascon/index.jsp

.. _Bachelor of Computer Science: https://cs.uwaterloo.ca/
.. _University of Waterloo: https://uwaterloo.ca/
.. _Intro to Machine Learning: https://cs.uwaterloo.ca/~y328yu/mycourses/489/index.html
.. _Artificial Intelligence: https://cs.uwaterloo.ca/~jhoey/teaching/cs486/
.. _Data-Intensive Distributed Computing: https://lintool.github.io/bigdata-2018w/index.html
.. _Distributed Systems: https://cs.uwaterloo.ca/~alkiswan/Classes/CS454/index.html
.. _Numeric Computation for Financial Modeling: https://www.student.cs.uwaterloo.ca/~cs476/
.. _A.Y.Jackson Secondary School: http://schoolweb.tdsb.on.ca/ayjackson/
.. _Coursera: https://www.coursera.org/
.. _edX: https://www.edx.org/
.. _Udacity: https://www.udacity.com/
.. _Udemy: https://www.udemy.com/
.. _Toronto Waterfront Marathon Run: http://www.torontowaterfrontmarathon.com/event-info/half-marathon/
.. _White Oak Tennis Club: http://www.whiteoaksparktennis.com/
.. _UW Badminton Club: http://www.badmintonclub.uwaterloo.ca/about/index.html