text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <title>View Sources</title>
    <link href="/struts2-showcase-2.0.6/styles/main.css" rel="stylesheet" type="text/css" media="all"/>
    <link href="/struts2-showcase-2.0.6/struts/niftycorners/niftyCorners.css" rel="stylesheet" type="text/css"/>
    <link href="/struts2-showcase-2.0.6/struts/niftycorners/niftyPrint.css" rel="stylesheet" type="text/css" media="print"/>

<link rel="stylesheet" href="/struts2-showcase-2.0.6/struts/xhtml/styles.css" type="text/css"/>

    <link rel="stylesheet" type="text/css" href="/struts2-showcase-2.0.6/struts/tabs.css?config=file%3A%2FC%3A%2Fmol%2Ftools%2Fjakarta-tomcat-5.0.30%2Fwebapps%2Fstruts2-showcase-2.0.6%2FWEB-INF%2Fclasses%2Fstruts-jsf.xml%3A28&page=%2Fjsf%2Femployee%2Fnull&className=org.apache.struts2.showcase.jsf.JsfEmployeeAction">
    <link rel="stylesheet" type="text/css" href="/struts2-showcase-2.0.6/struts/niftycorners/niftyCorners.css?config=file%3A%2FC%3A%2Fmol%2Ftools%2Fjakarta-tomcat-5.0.30%2Fwebapps%2Fstruts2-showcase-2.0.6%2FWEB-INF%2Fclasses%2Fstruts-jsf.xml%3A28&page=%2Fjsf%2Femployee%2Fnull&className=org.apache.struts2.showcase.jsf.JsfEmployeeAction">
    <link rel="stylesheet" type="text/css" href="/struts2-showcase-2.0.6/struts/niftycorners/niftyPrint.css?config=file%3A%2FC%3A%2Fmol%2Ftools%2Fjakarta-tomcat-5.0.30%2Fwebapps%2Fstruts2-showcase-2.0.6%2FWEB-INF%2Fclasses%2Fstruts-jsf.xml%3A28&page=%2Fjsf%2Femployee%2Fnull&className=org.apache.struts2.showcase.jsf.JsfEmployeeAction" media="print">

Struts Showcase

2007/04/06 03:18:43

View Sources

/null

file:/C:/mol/tools/jakarta-tomcat-5.0.30/webapps/struts2-showcase-2.0.6/WEB-INF/classes/struts-jsf.xml

18:
19:     <default-interceptor-ref name="jsfFullStack"/>
20:
21:   </package>
22:
23:   <package name="jsf.employee" extends="jsf" namespace="/jsf/employee">
24:
25:     <action name="list" class="org.apache.struts2.showcase.jsf.JsfEmployeeAction" method="list">
26:       <result name="success" type="jsf" />
27:     </action>
28:     <action name="edit" class="org.apache.struts2.showcase.jsf.JsfEmployeeAction">
29:       <result name="success" type="jsf" />
30:     </action>
31:     <action name="delete" class="org.apache.struts2.showcase.action.EmployeeAction" method="delete">
32:       <result name="error" type="redirect">list.action</result>
33:       <result type="redirect">list.action</result>
34:     </action>
35:
36:   </package>
37:
38: </struts>

/org/apache/struts2/showcase/jsf/JsfEmployeeAction.java

1:
21: package org.apache.struts2.showcase.jsf;
22:
23: import java.util.ArrayList;
24: import java.util.Collection;
25: import java.util.HashMap;
26: import java.util.LinkedHashMap;
27: import java.util.List;
28: import java.util.Map;
29:
30: import org.apache.struts2.showcase.action.EmployeeAction;
31: import org.apache.struts2.showcase.dao.SkillDao;
32: import org.apache.struts2.showcase.model.Employee;
33: import org.apache.struts2.showcase.model.Skill;
34:
35: /**
36:  * Overriding the EmployeeAction to main provide getters returning the data in
37:  * the form required by the JSF components
38:  */
39: public class JsfEmployeeAction extends EmployeeAction {
40:
41:     private static final long serialVersionUID = 1L;
42:
43:     /**
44:      * Creating a default employee and main skill, since the JSF EL can't handle
45:      * creating new objects as necessary
46:      *
47:      */
48:     public JsfEmployeeAction() {
49:         Employee e = new Employee();
50:         e.setMainSkill(new Skill());
51:         setCurrentEmployee(e);
52:     }
53:
54:     private SkillDao skillDao;
55:
56:     public void setSkillDao(SkillDao skillDao) {
57:         this.skillDao = skillDao;
58:     }
59:
60:     /**
61:      * Returning a List because the JSF dataGrid can't handle a Set for some
62:      * reason
63:      */
64:     @Override
65:     public Collection getAvailableItems() {
66:         return new ArrayList(super.getAvailableItems());
67:     }
68:
69:     /**
70:      * Changing the String array into a Map
71:      */
72:     public Map<String, String> getAvailablePositionsAsMap() {
73:         Map<String, String> map = new LinkedHashMap<String, String>();
74:         for (String val : super.getAvailablePositions()) {
75:             map.put(val, val);
76:         }
77:         return map;
78:     }
79:
80:     /**
81:      * Converting the list into a map
82:      */
83:     public Map getAvailableLevelsAsMap() {
84:         Map map = new LinkedHashMap();
85:         for (Object val : super.getAvailableLevels()) {
86:             map.put(val, val);
87:         }
88:         return map;
89:     }
90:
91:     /**
92:      * Converting the Skill object list into a map
93:      */
94:     public Map<String, String> getAvailableSkills() {
95:         Map<String, String> map = new HashMap<String, String>();
96:         for (Object val : skillDao.findAll()) {
97:             Skill skill = (Skill) val;
98:             map.put(skill.getDescription(), skill.getName());
99:         }
100:         return map;
101:     }
102:
103:     /**
104:      * Gets the selected Skill objects as a list
105:      */
106:     public List<String> getSelectedSkillsAsList() {
107:         System.out.println("asked for skills");
108:         List<String> list = new ArrayList<String>();
109:         List skills = super.getSelectedSkills();
110:         if (skills != null) {
111:             for (Object val : skills) {
112:                 if (val instanceof Skill) {
113:                     list.add(((Skill) val).getDescription());
114:                 } else {
115:                     Skill skill = skillDao.getSkill((String) val);
116:                     list.add(skill.getDescription());
117:                 }
118:             }
119:         }
120:         return list;
121:     }
122: }

Navigation

Home

Ajax

Ajax Chat

Action Chaining

Config Browser

Conversion

CRUD

Execute & Wait

File Download

File Upload

Freemarker

Hangman

JavaServer Faces

Person Manager

Tags

Tiles

Token

Validation

Help

        View Sources

Copyright © 2003-2007 The Apache Software Foundation.


text:
//
//  File: %dev-event.c
//  Summary: "Device: Event handler for Win32"
//  Project: "Rebol 3 Interpreter and Run-time (Ren-C branch)"
//  Homepage: https://github.com/metaeducation/ren-c/
//
//=////////////////////////////////////////////////////////////////////////=//
//
// Copyright 2012 REBOL Technologies
// Copyright 2012-2017 Rebol Open Source Contributors
// REBOL is a trademark of REBOL Technologies
//
// See README.md and CREDITS.md for more information.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
//=////////////////////////////////////////////////////////////////////////=//
//
// Processes events to pass to REBOL. Note that events are
// used for more than just windowing.
//

#include <windows.h>
#include "reb-host.h"

#ifndef HWND_MESSAGE
#define HWND_MESSAGE (HWND)-3
#endif

extern void Done_Device(uintptr_t handle, int error);

// Move or remove globals? !?
HWND Event_Handle = 0;          // Used for async DNS
static int Timer_Id = 0;        // The timer we are using

//
//  REBOL_Event_Proc: C
//
// The minimal default event handler.
//
LRESULT CALLBACK REBOL_Event_Proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
{
    switch(msg) {
        case WM_CLOSE:
            DestroyWindow(hwnd);
            break;
        case WM_DESTROY:
            PostQuitMessage(0);
            break;
        default:
            // Default processing that we do not care about:
            return DefWindowProc(hwnd, msg, wparam, lparam);
    }
    return 0;
}

//
//  Init_Events: C
//
// Initialize the event device.
//
// Create a hidden window to handle special events,
// such as timers and async DNS.
//
DEVICE_CMD Init_Events(REBREQ *dr)
{
    REBDEV *dev = cast(REBDEV*, dr);

    // !!! The Windows build of R3-Alpha used a hidden window for message
    // processing.  The only use case was asynchronous DNS, which was a
    // deprecated feature (not being carried forward to IPv6):
    //
    // https://msdn.microsoft.com/en-us/library/windows/desktop/ms741522(v=vs.85).aspx
    //
    // One aspect of making this window is that it requires the HINSTANCE of
    // the application.  That was being passed via a global App_Instance
    // variable:
    //
    // EXTERN_C HINSTANCE App_Instance;  // From Main module.
    //
    // This complicated linking of libRebol, and since the event strategy is
    // being rethought this is #ifdef'd out for now.
    //
    // Long-term, the better way to tunnel such parameters from the host to
    // extensions would likely be to put a HANDLE! in the environment, and
    // then those extensions that require the Windows HINSTANCE could
    // complain if it wasn't there...vs. creating a linker dependency for
    // all clients.
    //
  #if 0
    WNDCLASSEX wc;

    memset(&wc, '\0', sizeof(wc));

    // Register event object class:
    wc.cbSize        = sizeof(wc);
    wc.lpszClassName = L"REBOL-Events";
    wc.hInstance     = App_Instance;
    wc.lpfnWndProc   = REBOL_Event_Proc;

    ATOM atom = RegisterClassEx(&wc);
    if (atom == 0)
        rebFail_OS (GetLastError());

    Event_Handle = CreateWindowEx(
        0,
        wc.lpszClassName,
        wc.lpszClassName,
        0,0,0,0,0,
        HWND_MESSAGE, // used for message-only windows
        NULL, App_Instance, NULL
    );
    if (Event_Handle == NULL)
        rebFail_OS (GetLastError());
  #else
    Event_Handle = NULL;
  #endif

    dev->flags |= RDF_INIT;
    return DR_DONE;
}

//
//  Poll_Events: C
//
// Poll for events and process them.
// Returns 1 if event found, else 0.
//
// MS Notes:
//
// "The PeekMessage function normally does not remove WM_PAINT
// messages from the queue. WM_PAINT messages remain in the queue
// until they are processed."
//
DEVICE_CMD Poll_Events(REBREQ *req)
{
    UNUSED(req);

    MSG msg;
    int flag = DR_DONE;

    // Are there messages to process?
    while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
    {
        flag = DR_PEND;
        if (msg.message == WM_TIMER)
            break;
        DispatchMessage(&msg);
    }

    return flag;    // different meaning compared to most commands
}

//
//  Query_Events: C
//
// Wait for an event, or a timeout (in milliseconds) specified by
// req->length. The latter is used by WAIT as the main timing
// method.
//
DEVICE_CMD Query_Events(REBREQ *req)
{
    // Set timer (we assume this is very fast):
    Timer_Id = SetTimer(0, Timer_Id, req->length, 0);

    // Wait for message or the timer:
    //
    MSG msg;
    if (GetMessage(&msg, NULL, 0, 0))
        DispatchMessage(&msg);

    // Quickly check for other events:
    Poll_Events(0);

    //if (Timer_Id) KillTimer(0, Timer_Id);
    return DR_DONE;
}

//
//  Connect_Events: C
//
// Simply keeps the request pending for polling purposes.
// Use Abort_Device to remove it.
//
DEVICE_CMD Connect_Events(REBREQ *req)
{
    UNUSED(req);

    return DR_PEND; // keep pending
}

/***********************************************************************
**
**  Command Dispatch Table (RDC_ enum order)
**
***********************************************************************/

static DEVICE_CMD_CFUNC Dev_Cmds[RDC_MAX] = {
    Init_Events,            // init device driver resources
    0,  // RDC_QUIT,        // cleanup device driver resources
    0,  // RDC_OPEN,        // open device unit (port)
    0,  // RDC_CLOSE,       // close device unit
    0,  // RDC_READ,        // read from unit
    0,  // RDC_WRITE,       // write to unit
    Poll_Events,
    Connect_Events,
    Query_Events,
};

DEFINE_DEV(Dev_Event, "OS Events", 1, Dev_Cmds, RDC_MAX, sizeof(REBREQ));

redpajama_set_name: RedPajamaGithub


text:
using System;
using System.Collections.Generic;
using System.Linq;

using Foundation;
using UIKit;
using MonoTouch.Dialog;

namespace MTDReflectionWalkthrough
{
	[Register ("AppDelegate")]
    public partial class AppDelegate : UIApplicationDelegate
	{
		UIWindow window;
		UINavigationController nav;

		public override bool FinishedLaunching (UIApplication app, NSDictionary options)
		{

			window = new UIWindow (UIScreen.MainScreen.Bounds);

			var expense = new Expense ();
			var bctx = new BindingContext (null, expense, "Create a task");
			var dvc = new DialogViewController (bctx.Root);

			nav = new UINavigationController(dvc);

			window.RootViewController = nav;
			window.MakeKeyAndVisible ();

			return true;
		}
	}
}


text:
export default function (env, callback) {

  // uses 'wintersmith-contents' as implemented in 'wintersmith-sitemap':
  // https://github.com/xavierdutreilh/wintersmith-sitemap
  var getPages = (contents) => {
      return env.helpers.contents.list(contents).filter( (item) =>
        item instanceof env.plugins.MarkdownPage );
  };

  var robotsView = function (env, locals, contents, templates, callback) {
    var {url, sitemap, noindex} = locals,
        ua = "User-agent: *";

    // Global block, skip the rest
    if (noindex) return callback(null, new Buffer(ua + "\nDisallow: /"));

    var disallowedPages =
        getPages(contents)
        .filter( page => page.metadata.noindex )
        .map( page => `Disallow: ${page.url}`);

    var sitemapURL = sitemap ? (`Sitemap: ${url}/${sitemap}`) : null;

    var robots = []
        .concat(ua, disallowedPages, sitemapURL)
        .join('\n');

    callback(null, new Buffer(robots));
  };

  class Robots extends env.plugins.Page {

    get filename() {
      return 'robots.txt';
    }
    getFilename() { return this.filename; }

    get view() {
      return robotsView;
    }
    getView() { return this.view; }

  }

  env.registerGenerator('robots', (contents, callback) => {
    var tree = {'robots.txt' : new Robots()};
    callback(null, tree);
  });

  callback();
}


text:
<?php
/**
 * PhpUnderControl_TaskMQFile_Test
 *
 * 针对 ../../MQ/File.php Task_MQ_File 类的PHPUnit单元测试
 *
 * @author: dogstar 20160430
 */

require_once dirname(__FILE__) . '/../test_env.php';

if (!class_exists('Task_MQ_File')) {
    require dirname(__FILE__) . '/../../MQ/File.php';
}

class PhpUnderControl_TaskMQFile_Test extends PHPUnit_Framework_TestCase
{
    public $taskMQFile;

    protected function setUp()
    {
        parent::setUp();

        $this->taskMQFile = new Task_MQ_File();
    }

    protected function tearDown()
    {
    }

    /**
     * @group testAdd
     */
    public function testAdd()
    {
        $service = 'Task_MQ_File_Default.Index';
        $params = array (
            'username' => 'dogstar',
        );

        $rs = $this->taskMQFile->add($service, $params);
        $rs = $this->taskMQFile->add($service, $params);
        $rs = $this->taskMQFile->add($service, $params);
    }

    /**
     * @group testPop
     */
    public function testPop()
    {
        $service = 'Task_MQ_File_Default.Index';
        $num = 2;

        $rs = $this->taskMQFile->pop($service, $num);
        $this->assertCount($num, $rs);
    }

}


text:
using namespace concurrency;
using namespace Microsoft::WRL;
using namespace Platform;
using namespace Windows::Foundation;
using namespace Windows::Devices::AllJoyn;
using namespace org::alljoyn::Notification;

NotificationWatcher::NotificationWatcher(AllJoynBusAttachment^ busAttachment) :
    m_aboutListener(nullptr)
{
    m_busAttachment = busAttachment;
    m_weak = new WeakReference(this);
    m_busAttachmentStateChangedToken.Value = 0;
}

NotificationWatcher::~NotificationWatcher()
{
    UnregisterFromBus();
}

void NotificationWatcher::UnregisterFromBus()
{
    if (nullptr != m_aboutListener)
    {
        PCSTR interfaces[] = { "org.alljoyn.Notification" };
        alljoyn_busattachment_cancelwhoimplements_interfaces(
            AllJoynHelpers::GetInternalBusAttachment(m_busAttachment),
            interfaces,
            _countof(interfaces));

        alljoyn_busattachment_unregisteraboutlistener(AllJoynHelpers::GetInternalBusAttachment(m_busAttachment), m_aboutListener);
        alljoyn_aboutlistener_destroy(m_aboutListener);
        m_aboutListener = nullptr;
    }
    if ((nullptr != m_busAttachment) && (0 != m_busAttachmentStateChangedToken.Value))
    {
        m_busAttachment->StateChanged -= m_busAttachmentStateChangedToken;
    }
}

void NotificationWatcher::OnAnnounce(
    _In_ PCSTR name,
    _In_ uint16_t version,
    _In_ alljoyn_sessionport port,
    _In_ alljoyn_msgarg objectDescriptionArg,
    _In_ const alljoyn_msgarg aboutDataArg)
{
    UNREFERENCED_PARAMETER(version);
    UNREFERENCED_PARAMETER(aboutDataArg);

    alljoyn_aboutobjectdescription objectDescription = alljoyn_aboutobjectdescription_create_full(objectDescriptionArg);

    if (alljoyn_aboutobjectdescription_hasinterface(objectDescription, "org.alljoyn.Notification"))
    {
        AllJoynServiceInfo^ args = ref new AllJoynServiceInfo(
            AllJoynHelpers::MultibyteToPlatformString(name),
            AllJoynHelpers::GetObjectPath(objectDescription, "org.alljoyn.Notification"),
            port);
        Added(this, args);
    }
    alljoyn_aboutobjectdescription_destroy(objectDescription);
}

void NotificationWatcher::BusAttachmentStateChanged(_In_ AllJoynBusAttachment^ sender, _In_ AllJoynBusAttachmentStateChangedEventArgs^ args)
{
    if (args->State == AllJoynBusAttachmentState::Connected)
    {
        alljoyn_aboutlistener_callback callbacks =
        {
            AllJoynHelpers::AnnounceHandler<NotificationWatcher>
        };
        m_aboutListener = alljoyn_aboutlistener_create(&callbacks, m_weak);

        alljoyn_busattachment_registeraboutlistener(AllJoynHelpers::GetInternalBusAttachment(sender), m_aboutListener);
        PCSTR interfaces[] = { "org.alljoyn.Notification" };

        auto status = alljoyn_busattachment_whoimplements_interfaces(
            AllJoynHelpers::GetInternalBusAttachment(sender),
            interfaces,
            _countof(interfaces));
        if (ER_OK != status)
        {
            StopInternal(status);
        }
    }
    else if (args->State == AllJoynBusAttachmentState::Disconnected)
    {
        StopInternal(ER_BUS_STOPPING);
    }
}

void NotificationWatcher::Start()
{
    if (nullptr == m_busAttachment)
    {
        StopInternal(ER_FAIL);
        return;
    }

    int32 result = AllJoynHelpers::CreateInterfaces(m_busAttachment, c_NotificationIntrospectionXml);
    if (result != AllJoynStatus::Ok)
    {
        StopInternal(result);
        return;
    }

    m_busAttachmentStateChangedToken = m_busAttachment->StateChanged += ref new TypedEventHandler<AllJoynBusAttachment^, AllJoynBusAttachmentStateChangedEventArgs^>(this, &NotificationWatcher::BusAttachmentStateChanged);
    m_busAttachment->Connect();
}

void NotificationWatcher::Stop()
{
    StopInternal(AllJoynStatus::Ok);
}

void NotificationWatcher::StopInternal(int32 status)
{
    UnregisterFromBus();
    Stopped(this, ref new AllJoynProducerStoppedEventArgs(status));
}


text:
@implementation Input_GlobalKey_Cell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
    }
    return self;
}

- (void)awakeFromNib
{
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)configWithImgName:(NSString *)imgStr andPlaceholder:(NSString *)phStr andValue:(NSString *)valueStr{
    self.myImgView.image = [UIImage imageNamed:imgStr];
    self.textField.placeholder = phStr;
    self.textField.text = valueStr;
}

- (IBAction)textValueChanged:(UITextField *)sender {
    if (self.textValueChangedBlock) {
        self.textValueChangedBlock(self.textField.text);
    }
}

#pragma mark - UIView
- (void)layoutSubviews {
    [super layoutSubviews];
    self.backgroundView = nil;
    self.backgroundColor = [UIColor clearColor];
    self.contentView.frame = CGRectMake(kPaddingLeftWidth, 0, kScreen_Width - 2*kPaddingLeftWidth, self.contentView.frame.size.height);
    self.contentView.layer.borderColor = [[UIColor colorWithHexString:@"0x999999" andAlpha:0.5] CGColor];
    self.contentView.layer.borderWidth = 0.5;
    self.contentView.layer.cornerRadius = 22;
    self.contentView.layer.masksToBounds = YES;
    self.textField.clearButtonMode = UITextFieldViewModeWhileEditing;
}

@end


text:
title: How to add/edit your own project files (Advanced)
date: '2017-04-10T00:00:00Z'
---

So you know your GitHub from your BitBucket or you know your Gcode from your STL. Welcome..
<!--more-->

As well as the super simple "Add" system you can have more control over your projects on Open Assistive by adding & maintaining your own project files. There are a few different ways in achieving this depending on your level of knowledge of GitHub and Markdown;

1. Host your descriptor file yourself. Create a plain-text file called `YourProjectName.md` in a folder accessible by the world. This could be a dropbox folder that you then share - or it could be on a webserver somewhere. It needs to have some 'metadata' in the header which looks like this:

	```---
	title: 'Title here'
	authors: 'willwade, phewett'
	download_url: 'https://www.dropbox.com/sh/0eagft7ugo3xkz0/AAC_WJHVssyY3yMiVgv3aVq-a?dl=1'
	project_url: 'https://www.dropbox.com/sh/0eagft7ugo3xkz0/AAC_WJHVssyY3yMiVgv3aVq-a?dl=0'
	description: 'short description here'
	license: "MIT or nothing"
	image: path/to/your/image/relative-to-your-file/should-be-500px-high/image.png
	---
	```

	So a little background detail on those fields:
	* title: The long title of your project
	* authors: could be a single name or several. Try and not put your email address here unless you want to be spammed
	* download_url: This is the URL for people to simply download the binary or final file (e.g. STL file or zip)
	* project_url: Whats the URL of your project home page? (could be the URL of this very readme file if you don't have one)
	* description: This is a short, brief one-line description
	* license: what Licence, if any, are you using (NB: It really helps if you do). [Have a read of this for more information and some suggestions](/2017/05/choose-a-licence.-please./).
	* image: Do you have an image? If so add the path to it here. NB: we crop it to 500px wide and will make a thumb from it. You have been warned!

	You can then add any content you like to the body (i.e. after that last ---). Note though it has to be [markdown formatted](https://daringfireball.net/projects/markdown/).

	E.g.

			This is the main body of your project here. Use markdown syntax
			## Caeleste quinque nocturnae artus cum

			Lorem markdownum hac suis doloris: lenire capientibus caput est bracchia; ora
			molle nos venisse artes, sub. [Ceu se et](http://www.luxque.io/vicina.html), est
			anima nurus dedit miserabilis et interea possumus lacessas nec **et orbem
			orbem** videns nec increvit.

	Once you are happy with this add your file using the add feature [here](http://openassistive.org/add). Fingers crossed it all works! (If you have any issues [drop us a line](http://openassistive.org/contact). You may have found a bug!)

	NB: In time we will change this so your files will get updated nightly. Hold tight though till we add this! For now - just re-add your file if it needs updating.

2. Fork the [OpenATFrontend project](http://github.com/openassistive/OpenATFrontEnd) and add/edit the items directly (files can be found in [/master/content/item](https://github.com/openassistive/OpenATFrontEnd/tree/master/content/item). You may want to install [Hugo](http://gohugo.io) and run ``hugo server`` locally to test out what it looks like.  Then do a Pull request when ready.  For detailed instructions visit [http://help.github.com/fork-a-repo/](http://help.github.com/fork-a-repo/). Just do a Pull request when you are ready.

3. Edit directly to the project. If we physically know you - or you make a number of pull requests we will consider adding you as a team member. Just drop us a line!

3. Write your own code to interact with the backend. There is some docs you can find about this here: http://api.openassistive.org/docs/v1/


text:
define(['durandal/app', 'plugins/router', 'knockout', 'mods/search'],
        function(app, router, ko, searchmod) {

            return {
                items: searchmod.calendaritems,
                breadcrumbitems: searchmod.breadcrumbitems
            };

        });


text:
this.recline = this.recline || {};
this.recline.View = this.recline.View || {};

(function($, my) {
    my.FHSlickGrid = my.SlickGrid.extend({
        initialize: function(modelEtc) {
            var self = this;
            this.el = $(this.el);
            this.el.addClass('recline-slickgrid');
            _.bindAll(this, 'render');
            this.model.records.bind('add', this.render);
            this.model.records.bind('reset', this.render);
            this.model.records.bind('remove', this.render);
            this.model.records.bind('change', this.onRecordChanged, this);
            // language change event
            this.model.bind('change:language', this.onChangeLanguage, this);

            var state = _.extend({
                    hiddenColumns: [],
                    columnsOrder: [],
                    columnsSort: {},
                    columnsWidth: [],
                    columnsEditor: [],
                    options: {},
                    fitColumns: false
                }, modelEtc.state

            );
            this.state = new recline.Model.ObjectState(state);
        },

        render: function() {
            var self = this;

            var options = _.extend({
                enableCellNavigation: true,
                enableColumnReorder: true,
                explicitInitialization: true,
                syncColumnCellResize: true,
                forceFitColumns: this.state.get('fitColumns')
            }, self.state.get('gridOptions'));

            // We need all columns, even the hidden ones, to show on the column picker
            var columns = [];
            // custom formatter as default one escapes html
            // plus this way we distinguish between rendering/formatting and computed value (so e.g. sort still works ...)
            // row = row index, cell = cell index, value = value, columnDef = column definition, dataContext = full row values
            var formatter = function(row, cell, value, columnDef, dataContext) {
                var field = self.model.fields.get(columnDef.id);
                if (field.renderer) {
                    return field.renderer(value, field, dataContext);
                } else {
                    return value;
                }
            }
            _.each(this.model.fields.toJSON(),function(field){
                var column = {
                    id:field['id'],
                    name:field['label'],
                    field:field['id'],
                    sortable: true,
                    minWidth: 80,
                    formatter: formatter
                };

                var widthInfo = _.find(self.state.get('columnsWidth'),function(c){return c.column == field.id});
                if (widthInfo){
                    column['width'] = widthInfo.width;
                }

                var editInfo = _.find(self.state.get('columnsEditor'),function(c){return c.column == field.id});
                if (editInfo){
                    column['editor'] = editInfo.editor;
                }
                columns.push(column);
            });

            // Restrict the visible columns
            var visibleColumns = columns.filter(function(column) {
                return _.indexOf(self.state.get('hiddenColumns'), column.id) == -1;
            });

            // Order them if there is ordering info on the state
            if (this.state.get('columnsOrder') && this.state.get('columnsOrder').length > 0) {
                visibleColumns = visibleColumns.sort(function(a,b){
                    return _.indexOf(self.state.get('columnsOrder'),a.id) > _.indexOf(self.state.get('columnsOrder'),b.id) ? 1 : -1;
                });
                columns = columns.sort(function(a,b){
                    return _.indexOf(self.state.get('columnsOrder'),a.id) > _.indexOf(self.state.get('columnsOrder'),b.id) ? 1 : -1;
                });
            }

            // Move hidden columns to the end, so they appear at the bottom of the
            // column picker
            var tempHiddenColumns = [];
            for (var i = columns.length -1; i >= 0; i--){
                if (_.indexOf(_.pluck(visibleColumns,'id'),columns[i].id) == -1){
                    tempHiddenColumns.push(columns.splice(i,1)[0]);
                }
            }
            columns = columns.concat(tempHiddenColumns);

            // Transform a model object into a row
            function toRow(m) {
                var row = {};
                self.model.fields.each(function(field){
                    row[field.id] = m.getFieldValueUnrendered(field);
                });
                return row;
            }

            function RowSet() {
                var models = [];
                var rows = [];

                this.push = function(model, row) {
                    models.push(model);
                    rows.push(row);
                }

                this.getLength = function() { return rows.length; }
                this.getItem = function(index) { return rows[index];}
                this.getItemMetadata= function(index) { return {};}
                this.getModel= function(index) { return models[index]; }
                this.getModelRow = function(m) { return models.indexOf(m);}
                this.updateItem = function(m,i) {
                    rows[i] = toRow(m);
                    models[i] = m
                };
            };

            var data = new RowSet();

            this.model.records.each(function(doc){
                data.push(doc, toRow(doc));
            });

            this.grid = new Slick.Grid(this.el, data, visibleColumns, options);

            // Column sorting
            var sortInfo = this.model.queryState.get('sort');
            if (sortInfo){
                var column = sortInfo[0].field;
                var sortAsc = !(sortInfo[0].order == 'desc');
                this.grid.setSortColumn(column, sortAsc);
            }

            this.grid.onSort.subscribe(function(e, args){
                var order = (args.sortAsc) ? 'asc':'desc';
                var sort = [{
                    field: args.sortCol.field,
                    order: order
                }];
                self.model.query({sort: sort});
            });

            this.grid.onColumnsReordered.subscribe(function(e, args){
                self.state.set({columnsOrder: _.pluck(self.grid.getColumns(),'id')});
            });

            this.grid.onColumnsResized.subscribe(function(e, args){
                var columns = args.grid.getColumns();
                var defaultColumnWidth = args.grid.getOptions().defaultColumnWidth;
                var columnsWidth = [];
                _.each(columns,function(column){
                    if (column.width != defaultColumnWidth){
                        columnsWidth.push({column:column.id,width:column.width});
                    }
                });
                self.state.set({columnsWidth:columnsWidth});
            });

            this.grid.onCellChange.subscribe(function (e, args) {
                // We need to change the model associated value
                //
                var grid = args.grid;
                var model = data.getModel(args.row);
                var field = grid.getColumns()[args.cell]['id'];
                var v = {};
                v[field] = args.item[field];
                model.set(v);
            });

            this.grid.onDblClick.subscribe(function (e, args){
                var cell = this.getCellFromEvent(e)
                var record = this.getData().getModel(cell.row);
                self.trigger("doubleclick", record);
            });

            this.columnpicker = new Slick.Controls.FHColumnPicker(columns, this.grid,
                _.extend(options,{state:this.state}));

            if (self.visible){
                self.grid.init();
                self.rendered = true;
            } else {
                // Defer rendering until the view is visible
                self.rendered = false;
            }

            return this;
        },

        // set columns to show on the grid - meant to be used after grid is init-ed, if not, grid will be init-ed first
        setColumns: function(columnsToShow) {
            if(!columnsToShow.length)
                return;
            var self = this;
            var visibleColumns = [];
            var hiddenColumnsIds = [];
            var formatter = function(row, cell, value, columnDef, dataContext) {
                var field = self.model.fields.get(columnDef.id);
                if (field.renderer) {
                    return field.renderer(value, field, dataContext);
                } else {
                    return value;
                }
            };
            _.each(this.model.fields.toJSON(),function(field){
                // check if this column is in put to show list
                var foundColumn = _.find(columnsToShow, function(columnName){
                    return field['id'] == columnName;
                });
                if(foundColumn){
                    var column = {
                        id:field['id'],
                        name:field['label'],
                        field:field['id'],
                        sortable: true,
                        minWidth: 80,
                        formatter: formatter
                    };

                    var widthInfo = _.find(self.state.get('columnsWidth'),function(c){return c.column == field.id});
                    if (widthInfo){
                        column['width'] = widthInfo.width;
                    }

                    var editInfo = _.find(self.state.get('columnsEditor'),function(c){return c.column == field.id});
                    if (editInfo){
                        column['editor'] = editInfo.editor;
                    }
                    visibleColumns.push(column);
                }
                else
                {
                    hiddenColumnsIds.push(field['id']);
                }
            });
            if (!this.rendered){
                if (!this.grid){
                    this.render();
                }
                this.grid.init();
                this.rendered = true;
            }
            this.grid.setColumns(visibleColumns);
            this.state.set({hiddenColumns:hiddenColumnsIds});
        },

        onChangeLanguage: function(model, new_lang, changes){
            if(this.grid)
            {
                // get visible columns
                var columns = [];
                _.each(this.grid.getColumns(), function(column, index){
                    columns.push(column.id);
                });
                this.setColumns(columns);
                var formatter = function(row, cell, value, columnDef, dataContext) {
                    var field = self.model.fields.get(columnDef.id);
                    if (field.renderer) {
                        return field.renderer(value, field, dataContext);
                    } else {
                        return value;
                    }
                };
                // push all columns with updated labels
                this.columnpicker.updateColumns(model.fields.map(function(field){
                    return  {
                        id:field.get('id'),
                        name:field.get('label'),
                        field:field.get('id'),
                        sortable: true,
                        minWidth: 80,
                        formatter: formatter
                    };
                }));
                this.grid.render();
            }
        }
    });
})(jQuery, recline.View);

/*
 * Context menu for the column picker, adapted from
 * http://mleibman.github.com/SlickGrid/examples/example-grouping
 *
 */
(function ($) {
    function FHSlickColumnPicker(columns, grid, options) {
        var $menu;
        var columnCheckboxes;

        var defaults = {
            fadeSpeed:250
        };

        function init() {
            grid.onHeaderContextMenu.subscribe(handleHeaderContextMenu);
            options = $.extend({}, defaults, options);

            $menu = $('<ul class="dropdown-menu slick-contextmenu" style="display:none;position:absolute;z-index:20;" />').appendTo(document.body);

            $menu.bind('mouseleave', function (e) {
                $(this).fadeOut(options.fadeSpeed)
            });
            $menu.bind('click', updateColumn);

        }

        function handleHeaderContextMenu(e, args) {
            e.preventDefault();
            $menu.empty();
            columnCheckboxes = [];

            var $li, $input;
            for (var i = 0; i < columns.length; i++) {
                $li = $('<li />').appendTo($menu);
                $input = $('<input type="checkbox" />').data('column-id', columns[i].id).attr('id','slick-column-vis-'+columns[i].id);
                columnCheckboxes.push($input);

                if (grid.getColumnIndex(columns[i].id) != null) {
                    $input.attr('checked', 'checked');
                }
                $input.appendTo($li);
                $('<label />')
                    .text(columns[i].name)
                    .attr('for','slick-column-vis-'+columns[i].id)
                    .appendTo($li);
            }
            $('<li/>').addClass('divider').appendTo($menu);
            $li = $('<li />').data('option', 'autoresize').appendTo($menu);
            $input = $('<input type="checkbox" />').data('option', 'autoresize').attr('id','slick-option-autoresize');
            $input.appendTo($li);
            $('<label />')
                .text('Force fit columns')
                .attr('for','slick-option-autoresize')
                .appendTo($li);
            if (grid.getOptions().forceFitColumns) {
                $input.attr('checked', 'checked');
            }

            $menu.css('top', e.pageY - 10)
                .css('left', e.pageX - 10)
                .fadeIn(options.fadeSpeed);
        }

        function updateColumn(e) {
            if ($(e.target).data('option') == 'autoresize') {
                var checked;
                if ($(e.target).is('li')){
                    var checkbox = $(e.target).find('input').first();
                    checked = !checkbox.is(':checked');
                    checkbox.attr('checked',checked);
                } else {
                    checked = e.target.checked;
                }

                if (checked) {
                    grid.setOptions({forceFitColumns:true});
                    grid.autosizeColumns();
                } else {
                    grid.setOptions({forceFitColumns:false});
                }
                options.state.set({fitColumns:checked});
                return;
            }

            if (($(e.target).is('li') && !$(e.target).hasClass('divider')) ||
                $(e.target).is('input')) {
                if ($(e.target).is('li')){
                    var checkbox = $(e.target).find('input').first();
                    checkbox.attr('checked',!checkbox.is(':checked'));
                }
                var visibleColumns = [];
                var hiddenColumnsIds = [];
                $.each(columnCheckboxes, function (i, e) {
                    if ($(this).is(':checked')) {
                        visibleColumns.push(columns[i]);
                    } else {
                        hiddenColumnsIds.push(columns[i].id);
                    }
                });

                if (!visibleColumns.length) {
                    $(e.target).attr('checked', 'checked');
                    return;
                }

                grid.setColumns(visibleColumns);
                options.state.set({hiddenColumns:hiddenColumnsIds});
            }
        }
        init();

        this.updateColumns = function(newColumns){
            columns = newColumns;
        }
    }

    // Slick.Controls.ColumnPicker
    $.extend(true, window, { Slick:{ Controls:{ FHColumnPicker: FHSlickColumnPicker }}});
})(jQuery);


text:
namespace com.github.zvreifnitz.JsonLib.Mapper.Simple.Impl
{
    internal sealed class UIntConverter : ConverterBase<uint>
    {
        public override void ToJson(IJsonContext context, IJsonWriter writer, uint instance)
        {
            writer.WriteRaw(instance.ToString(DefaultCultureInfo));
        }

        public override void FromJson(IJsonContext context, IJsonReader reader, out uint instance)
        {
            if (reader.GetNextToken() != JsonToken.Number ||
                !uint.TryParse(reader.ReadValue(), IntegerNumberStyle, DefaultCultureInfo, out instance))
            {
                instance = ThrowInvalidJsonException<uint>();
            }
        }
    }
}


text:
package org.apache.poi.hslf.record;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;

import org.apache.poi.hslf.exceptions.HSLFException;
import org.apache.poi.hslf.model.textproperties.TextPropCollection;
import org.apache.poi.hslf.model.textproperties.TextPropCollection.TextPropType;
import org.apache.poi.util.LittleEndian;
import org.apache.poi.util.LittleEndianOutputStream;
import org.apache.poi.util.POILogFactory;
import org.apache.poi.util.POILogger;

/**
 * TxMasterStyleAtom atom (4003).
 *

 * Stores default character and paragraph styles.
 * The atom instance value is the text type and is encoded like the txstyle field in
 * TextHeaderAtom. The text styles are located in the MainMaster container,
 * except for the "other" style, which is in the Document.Environment container.
 *

 *

 *  This atom can store up to 5 pairs of paragraph+character styles,
 *  each pair describes an indent level. The first pair describes
 *  first-level paragraph with no indentation.
 *

 *
 *  @author Yegor Kozlov
 */
public final class TxMasterStyleAtom extends RecordAtom {
    private static final POILogger LOG = POILogFactory.getLogger(TxMasterStyleAtom.class);

    /**
     * Maximum number of indentation levels allowed in PowerPoint documents
     */
    public static final int MAX_INDENT = 5;

    private byte[] _header;
    private static long _type = 4003;
    private byte[] _data;

    private List<TextPropCollection> paragraphStyles;
    private List<TextPropCollection> charStyles;

    protected TxMasterStyleAtom(byte[] source, int start, int len) {
        _header = new byte[8];
        System.arraycopy(source,start,_header,0,8);

        _data = new byte[len-8];
        System.arraycopy(source,start+8,_data,0,_data.length);

        //read available styles
        try {
            init();
        } catch (Exception e){
            LOG.log(POILogger.WARN, "Exception when reading available styles", e);
        }
    }

    /**
     * We are of type 4003
     *
     * @return type of this record
     * @see RecordTypes#TxMasterStyleAtom
     */
    public long getRecordType() {
        return _type;
    }

    /**
     * Write the contents of the record back, so it can be written
     *  to disk
     */
    public void writeOut(OutputStream out) throws IOException {
        // Write out the (new) header
        out.write(_header);

        // Write out the record data
        out.write(_data);

    }

    /**
     * Returns array of character styles defined in this record.
     *
     * @return character styles defined in this record
     */
    public List<TextPropCollection> getCharacterStyles(){
        return charStyles;
    }

    /**
     * Returns array of paragraph styles defined in this record.
     *
     * @return paragraph styles defined in this record
     */
    public List<TextPropCollection> getParagraphStyles(){
        return paragraphStyles;
    }

    /**
     * Return type of the text.
     * Must be a constant defined in TextHeaderAtom
     *
     * @return type of the text
     * @see TextHeaderAtom
     */
    public int getTextType(){
        //The atom instance value is the text type
        return LittleEndian.getShort(_header, 0) >> 4;
    }

    /**
     * parse the record data and initialize styles
     */
    protected void init(){
        //type of the text
        int type = getTextType();

        int head;
        int pos = 0;

        //number of indentation levels
        short levels = LittleEndian.getShort(_data, 0);
        pos += LittleEndian.SHORT_SIZE;

        paragraphStyles = new ArrayList<TextPropCollection>(levels);
        charStyles = new ArrayList<TextPropCollection>(levels);

        for(short i = 0; i < levels; i++) {
            TextPropCollection prprops = new TextPropCollection(0, TextPropType.paragraph);
            if (type >= TextHeaderAtom.CENTRE_BODY_TYPE) {
                // Fetch the 2 byte value, that is safe to ignore for some types of text
                short indentLevel = LittleEndian.getShort(_data, pos);
                prprops.setIndentLevel(indentLevel);
                pos += LittleEndian.SHORT_SIZE;
            } else {
                prprops.setIndentLevel((short)-1);
            }

            head = LittleEndian.getInt(_data, pos);
            pos += LittleEndian.INT_SIZE;

            pos += prprops.buildTextPropList( head, _data, pos);
            paragraphStyles.add(prprops);

            head = LittleEndian.getInt(_data, pos);
            pos += LittleEndian.INT_SIZE;
            TextPropCollection chprops = new TextPropCollection(0, TextPropType.character);
            pos += chprops.buildTextPropList( head, _data, pos);
            charStyles.add(chprops);
        }
    }

    /**
     * Updates the rawdata from the modified paragraph/character styles
     *
     * @since POI 3.14-beta1
     */
    public void updateStyles() {
        int type = getTextType();

        try {
            ByteArrayOutputStream bos = new ByteArrayOutputStream();
            LittleEndianOutputStream leos = new LittleEndianOutputStream(bos);
            int levels = paragraphStyles.size();
            leos.writeShort(levels);

            TextPropCollection prdummy = new TextPropCollection(0, TextPropType.paragraph);
            TextPropCollection chdummy = new TextPropCollection(0, TextPropType.character);

            for (int i=0; i<levels; i++) {
                prdummy.copy(paragraphStyles.get(i));
                chdummy.copy(charStyles.get(i));
                if (type >= TextHeaderAtom.CENTRE_BODY_TYPE) {
                    leos.writeShort(prdummy.getIndentLevel());
                }

                // Indent level is not written for master styles
                prdummy.setIndentLevel((short)-1);
                prdummy.writeOut(bos, true);
                chdummy.writeOut(bos, true);
            }

            _data = bos.toByteArray();
            leos.close();

            LittleEndian.putInt(_header, 4, _data.length);
        } catch (IOException e) {
            throw new HSLFException("error in updating master style properties", e);
        }
    }
}


text:
package config

import (
	"encoding/json"
	"io/ioutil"
	"path"
	"strings"
	"time"
)

var (
	currConfig string
	configs    map[string]*FluentConfig
)

func SetCurrentConfig(configFile string) {
	currConfig = configFile
}

func GetCurrentConfig() string {
	return currConfig
}

func LoadConfig(configFile string) *FluentConfig {
	if configFile == "" {
		configFile = path.Join(".", "config.json")
	}

	if configs != nil {
		cfg, _ := configs[configFile]
		if cfg != nil {
			return cfg
		}
	}

	byt, err := ioutil.ReadFile(configFile)
	if err != nil {
		panic(err)
	}

	config := &FluentConfig{}
	if err := json.Unmarshal(byt, &config); err != nil {
		panic(err)
	}

	if configs == nil {
		configs = make(map[string]*FluentConfig, 1)
	}
	configs[configFile] = config

	return config
}

func ParamAsBool(params map[string]interface{}, param string) (result bool, ok bool) {
	if params != nil {
		result, ok = params[param].(bool)
	}
	return
}

func ParamAsDuration(params map[string]interface{}, param string) (result time.Duration, ok bool) {
	if params != nil {
		var f float64
		f, ok = params[param].(float64)
		if ok {
			result = time.Duration(f)
		}
	}
	return
}

func ParamAsDurationWithLimit(params map[string]interface{}, param string, min time.Duration, max time.Duration) (result time.Duration, ok bool) {
	if params != nil {
		var f float64
		f, ok = params[param].(float64)
		if ok {
			result = time.Duration(f)
			if result < min {
				result = min
			}
			if result > max && max > min {
				result = max
			}
		}
	}
	return
}

func ParamAsFloat(params map[string]interface{}, param string) (result float64, ok bool) {
	if params != nil {
		result, ok = params[param].(float64)
	}
	return
}

func ParamAsFloatWithLimit(params map[string]interface{}, param string, min float64, max float64) (result float64, ok bool) {
	if params != nil {
		result, ok = params[param].(float64)
		if ok {
			if result < min {
				result = min
			}
			if result > max && max > min {
				result = max
			}
		}
	}
	return
}

func ParamAsInt(params map[string]interface{}, param string) (result int, ok bool) {
	if params != nil {
		var f float64
		f, ok = params[param].(float64)
		if ok {
			result = int(f)
		}
	}
	return
}

func ParamAsIntWithLimit(params map[string]interface{}, param string, min int, max int) (result int, ok bool) {
	if params != nil {
		var f float64
		f, ok = params[param].(float64)
		if ok {
			result = int(f)
			if result < min {
				result = min
			}
			if result > max && max > min {
				result = max
			}
		}
	}
	return
}

func ParamAsInt32(params map[string]interface{}, param string) (result int32, ok bool) {
	if params != nil {
		var f float64
		f, ok = params[param].(float64)
		if ok {
			result = int32(f)
		}
	}
	return
}

func ParamAsInt32WithLimit(params map[string]interface{}, param string, min int32, max int32) (result int32, ok bool) {
	if params != nil {
		var f float64
		f, ok = params[param].(float64)
		if ok {
			result = int32(f)
			if result < min {
				result = min
			}
			if result > max && max > min {
				result = max
			}
		}
	}
	return
}

func ParamAsInt64(params map[string]interface{}, param string) (result int64, ok bool) {
	if params != nil {
		var f float64
		f, ok = params[param].(float64)
		if ok {
			result = int64(f)
		}
	}
	return
}

func ParamAsInt64WithLimit(params map[string]interface{}, param string, min int64, max int64) (result int64, ok bool) {
	if params != nil {
		var f float64
		f, ok = params[param].(float64)
		if ok {
			result = int64(f)
			if result < min {
				result = min
			}
			if result > max && max > min {
				result = max
			}
		}
	}
	return
}

func ParamAsUint(params map[string]interface{}, param string) (result uint, ok bool) {
	if params != nil {
		var f float64
		f, ok = params[param].(float64)
		if ok {
			result = uint(f)
		}
	}
	return
}

func ParamAsUintWithLimit(params map[string]interface{}, param string, min uint, max uint) (result uint, ok bool) {
	if params != nil {
		var f float64
		f, ok = params[param].(float64)
		if ok {
			result = uint(f)
			if result < min {
				result = min
			}
			if result > max && max > min {
				result = max
			}
		}
	}
	return
}

func ParamAsUint32(params map[string]interface{}, param string) (result uint32, ok bool) {
	if params != nil {
		var f float64
		f, ok = params[param].(float64)
		if ok {
			result = uint32(f)
		}
	}
	return
}

func ParamAsUint32WithLimit(params map[string]interface{}, param string, min uint32, max uint32) (result uint32, ok bool) {
	if params != nil {
		var f float64
		f, ok = params[param].(float64)
		if ok {
			result = uint32(f)
			if result < min {
				result = min
			}
			if result > max && max > min {
				result = max
			}
		}
	}
	return
}

func ParamAsUint64(params map[string]interface{}, param string) (result uint64, ok bool) {
	if params != nil {
		var f float64
		f, ok = params[param].(float64)
		if ok {
			result = uint64(f)
		}
	}
	return
}

func ParamAsUint64WithLimit(params map[string]interface{}, param string, min uint64, max uint64) (result uint64, ok bool) {
	if params != nil {
		var f float64
		f, ok = params[param].(float64)
		if ok {
			result = uint64(f)
			if result < min {
				result = min
			}
			if result > max && max > min {
				result = max
			}
		}
	}
	return
}

func ParamAsString(params map[string]interface{}, param string) (result string, ok bool) {
	if params != nil {
		result, ok = params[param].(string)
		if ok {
			result = strings.TrimSpace(result)
		}
	}
	return
}


text:
function removeWhiteSpaceOnlyTextNodes(node)
{
    for (var i = 0; i < node.childNodes.length; i++) {
        var child = node.childNodes[i];
        if (child.nodeType === Node.TEXT_NODE && child.nodeValue.trim().length == 0) {
            node.removeChild(child);
            i--;
        } else if (child.nodeType === Node.ELEMENT_NODE || child.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
            removeWhiteSpaceOnlyTextNodes(child);
        }
    }
    if (node.shadowRoot) {
        removeWhiteSpaceOnlyTextNodes(node.shadowRoot);
    }
}

function convertTemplatesToShadowRootsWithin(node) {
    var nodes = node.querySelectorAll("template");
    for (var i = 0; i < nodes.length; ++i) {
        var template = nodes[i];
        var mode = template.getAttribute("data-mode");
        var parent = template.parentNode;
        parent.removeChild(template);
        var shadowRoot;
        if (!mode || mode == 'v0'){
            shadowRoot = parent.createShadowRoot();
        } else {
            shadowRoot = parent.attachShadow({'mode': mode});
        }
        var expose = template.getAttribute("data-expose-as");
        if (expose)
            window[expose] = shadowRoot;
        if (template.id)
            shadowRoot.id = template.id;
        var fragments = document.importNode(template.content, true);
        shadowRoot.appendChild(fragments);

        convertTemplatesToShadowRootsWithin(shadowRoot);
    }
}

function isShadowHost(node)
{
    return node && node.nodeType == Node.ELEMENT_NODE && node.shadowRoot;
}

function isIFrameElement(element)
{
    return element && element.nodeName == 'IFRAME';
}

// Returns node from shadow/iframe tree "path".
function getNodeInComposedTree(path)
{
    var ids = path.split('/');
    var node = document.getElementById(ids[0]);
    for (var i = 1; node != null && i < ids.length; ++i) {
        if (isIFrameElement(node))
            node = node.contentDocument.getElementById(ids[i]);
        else if (isShadowHost(node))
            node = node.shadowRoot.getElementById(ids[i]);
        else
            return null;
    }
    return node;
}


text:
layout: page
title: Charm Diamond Research Seminar
date: 2016-05-24
author: Randy Lindsey
tags: weekly links, java
status: published
summary: Mauris dignissim tellus et leo commodo, sed lobortis tortor.
banner: images/banner/meeting-01.jpg
booking:
  startDate: 01/31/2019
  endDate: 02/03/2019
  ctyhocn: LAWOKHX
  groupCode: CDRS
published: true
---
Phasellus ultrices orci ac nunc consectetur interdum. Praesent augue libero, auctor sit amet lacus quis, malesuada pulvinar quam. Maecenas ac tellus euismod, bibendum erat sed, commodo diam. Aliquam erat volutpat. Quisque quis vestibulum neque. Duis sit amet neque rutrum, condimentum turpis at, mattis odio. Aenean in semper neque, non mollis dui.

* Integer posuere elit non laoreet efficitur
* Pellentesque pellentesque justo laoreet efficitur efficitur
* Nam sagittis odio sed nisi venenatis sodales
* Fusce non odio et erat consectetur consectetur.

Quisque odio elit, posuere lobortis elit non, tincidunt finibus enim. Nullam iaculis leo sit amet ultrices consequat. Maecenas nec leo tempor, eleifend tortor quis, tristique nibh. Phasellus ultricies id sem sed congue. Proin convallis pellentesque magna. Cras fringilla justo ut iaculis commodo. Mauris nisl ex, dapibus nec est in, tincidunt molestie ante. Donec ullamcorper condimentum libero eu fermentum. Phasellus tempor lorem ac lectus ultricies finibus. Mauris at consequat justo. Fusce ullamcorper turpis vitae orci suscipit volutpat. Maecenas ac pellentesque urna, nec venenatis libero. Nullam mattis imperdiet enim, quis interdum turpis elementum in. Morbi id enim dui. Sed elementum finibus risus, ac placerat nunc iaculis non. Cras non quam sapien.
Curabitur felis eros, aliquam et mauris eget, lacinia gravida dui. Maecenas sed lacinia neque. Curabitur dapibus ex ut tincidunt congue. Mauris fringilla vehicula ultricies. Quisque ut quam massa. Interdum et malesuada fames ac ante ipsum primis in faucibus. Aliquam aliquam turpis id ipsum tincidunt efficitur. Aenean nec lectus odio. Aenean in leo neque.


text:
import expect from 'expect.js';
import sinon from 'sinon';

import objectAssign from '../../src/helper/object-assign';
import objectHelper from '../../src/helper/object';
import windowHelper from '../../src/helper/window';

describe('helpers', function() {
  describe('getKeysNotIn', function() {
    it('should return the list of keys not allowed', function() {
      var object = {
        attr1: 'attribute_1',
        attr2: 'attribute_2',
        attr3: 'attribute_3'
      };

      var notAllowed = ['attr1', 'attr2', 'attr4'];

      var keysList = objectHelper.getKeysNotIn(object, notAllowed);

      expect(keysList).to.eql(['attr3']);
    });

    it('should return an empty list', function() {
      var object = {
        attr1: 'attribute_1',
        attr2: 'attribute_2',
        attr3: 'attribute_3'
      };

      var notAllowed = ['attr1', 'attr2', 'attr3'];

      var keysList = objectHelper.getKeysNotIn(object, notAllowed);

      expect(keysList).to.eql([]);
    });

    it('should return an all the keys', function() {
      var object = {
        attr1: 'attribute_1',
        attr2: 'attribute_2',
        attr3: 'attribute_3'
      };

      var notAllowed = ['attr5', 'attr6', 'attr7'];

      var keysList = objectHelper.getKeysNotIn(object, notAllowed);

      expect(keysList).to.eql(['attr1', 'attr2', 'attr3']);
    });

    it('should return another empty list', function() {
      var object = {};

      var notAllowed = ['attr5', 'attr6', 'attr7'];

      var keysList = objectHelper.getKeysNotIn(object, notAllowed);

      expect(keysList).to.eql([]);
    });
  });

  describe('pick', function() {
    it('should return only the requested attributes', function() {
      var object = {
        attr1: 'attribute_1',
        attr2: 'attribute_2',
        attr3: 'attribute_3'
      };

      var newObject = objectHelper.pick(object, ['attr1', 'attr2']);

      expect(newObject).to.eql({
        attr1: 'attribute_1',
        attr2: 'attribute_2'
      });

      expect(object).to.eql({
        attr1: 'attribute_1',
        attr2: 'attribute_2',
        attr3: 'attribute_3'
      });
    });

    it('should ignore missing keys', function() {
      var object = {
        attr1: 'attribute_1',
        attr3: 'attribute_3'
      };

      var newObject = objectHelper.pick(object, ['attr1', 'attr2']);

      expect(newObject).to.eql({
        attr1: 'attribute_1'
      });

      expect(object).to.eql({
        attr1: 'attribute_1',
        attr3: 'attribute_3'
      });
    });
  });

  describe('extend', function() {
    it('should merge objects attributes', function() {
      var object1 = {
        attr1: 'attribute_1',
        attr2: 'attribute_2'
      };

      var object2 = {
        attr3: 'attribute_3'
      };

      var newObject = objectHelper.extend(object1, object2);

      expect(newObject).to.eql({
        attr1: 'attribute_1',
        attr2: 'attribute_2',
        attr3: 'attribute_3'
      });

      expect(object1).to.eql({
        attr1: 'attribute_1',
        attr2: 'attribute_2'
      });

      expect(object2).to.eql({
        attr3: 'attribute_3'
      });
    });

    it('shold merge objects attributes with polyfill', function() {
      sinon.stub(objectAssign, 'get').callsFake(function() {
        return objectAssign.objectAssignPolyfill;
      });

      var object1 = {
        attr1: 'attribute_1',
        attr2: 'attribute_2'
      };

      var object2 = {
        attr3: 'attribute_3'
      };

      var newObject = objectHelper.extend(object1, object2);

      expect(newObject).to.eql({
        attr1: 'attribute_1',
        attr2: 'attribute_2',
        attr3: 'attribute_3'
      });

      expect(object1).to.eql({
        attr1: 'attribute_1',
        attr2: 'attribute_2'
      });

      expect(object2).to.eql({
        attr3: 'attribute_3'
      });

      objectAssign.get.restore();
    });

    it('shold merge objects attributes and override the first object ones', function() {
      var object1 = {
        attr1: 'attribute_1',
        attr2: 'attribute_2'
      };

      var object2 = {
        attr2: 'attribute_2_2',
        attr3: 'attribute_3'
      };

      var newObject = objectHelper.extend(object1, object2);

      expect(newObject).to.eql({
        attr1: 'attribute_1',
        attr2: 'attribute_2_2',
        attr3: 'attribute_3'
      });

      expect(object1).to.eql({
        attr1: 'attribute_1',
        attr2: 'attribute_2'
      });

      expect(object2).to.eql({
        attr2: 'attribute_2_2',
        attr3: 'attribute_3'
      });
    });
  });

  describe('merge', function() {
    it('shold merge without pick', function() {
      var object1 = {
        attr1: 'attribute_1',
        attr2: 'attribute_2',
        attr3: 'attribute_3'
      };

      var object2 = {
        attrA: 'attribute_A',
        attrB: 'attribute_B',
        attrC: 'attribute_C'
      };

      var newObject = objectHelper.merge(object1).with(object2);

      expect(newObject).to.eql({
        attr1: 'attribute_1',
        attr2: 'attribute_2',
        attr3: 'attribute_3',
        attrA: 'attribute_A',
        attrB: 'attribute_B',
        attrC: 'attribute_C'
      });

      expect(object1).to.eql({
        attr1: 'attribute_1',
        attr2: 'attribute_2',
        attr3: 'attribute_3'
      });

      expect(object2).to.eql({
        attrA: 'attribute_A',
        attrB: 'attribute_B',
        attrC: 'attribute_C'
      });
    });

    it('shold merge picking attributes of the base object', function() {
      var object1 = {
        attr1: 'attribute_1',
        attr2: 'attribute_2',
        attr3: 'attribute_3'
      };

      var object2 = {
        attrA: 'attribute_A',
        attrB: 'attribute_B',
        attrC: 'attribute_C'
      };

      var newObject = objectHelper
        .merge(object1, ['attr1', 'attr2'])
        .with(object2);

      expect(newObject).to.eql({
        attr1: 'attribute_1',
        attr2: 'attribute_2',
        attrA: 'attribute_A',
        attrB: 'attribute_B',
        attrC: 'attribute_C'
      });

      expect(object1).to.eql({
        attr1: 'attribute_1',
        attr2: 'attribute_2',
        attr3: 'attribute_3'
      });

      expect(object2).to.eql({
        attrA: 'attribute_A',
        attrB: 'attribute_B',
        attrC: 'attribute_C'
      });
    });

    it('shold merge picking attributes of the second object', function() {
      var object1 = {
        attr1: 'attribute_1',
        attr2: 'attribute_2',
        attr3: 'attribute_3'
      };

      var object2 = {
        attrA: 'attribute_A',
        attrB: 'attribute_B',
        attrC: 'attribute_C'
      };

      var newObject = objectHelper
        .merge(object1)
        .with(object2, ['attrA', 'attrC']);

      expect(newObject).to.eql({
        attr1: 'attribute_1',
        attr2: 'attribute_2',
        attr3: 'attribute_3',
        attrA: 'attribute_A',
        attrC: 'attribute_C'
      });

      expect(object1).to.eql({
        attr1: 'attribute_1',
        attr2: 'attribute_2',
        attr3: 'attribute_3'
      });

      expect(object2).to.eql({
        attrA: 'attribute_A',
        attrB: 'attribute_B',
        attrC: 'attribute_C'
      });
    });

    it('should merge picking attributes of both objects', function() {
      var object1 = {
        attr1: 'attribute_1',
        attr2: 'attribute_2',
        attr3: 'attribute_3'
      };

      var object2 = {
        attrA: 'attribute_A',
        attrB: 'attribute_B',
        attrC: 'attribute_C'
      };

      var newObject = objectHelper
        .merge(object1, ['attr2', 'attr3'])
        .with(object2, ['attrA', 'attrC']);

      expect(newObject).to.eql({
        attr2: 'attribute_2',
        attr3: 'attribute_3',
        attrA: 'attribute_A',
        attrC: 'attribute_C'
      });

      expect(object1).to.eql({
        attr1: 'attribute_1',
        attr2: 'attribute_2',
        attr3: 'attribute_3'
      });

      expect(object2).to.eql({
        attrA: 'attribute_A',
        attrB: 'attribute_B',
        attrC: 'attribute_C'
      });
    });
  });

  describe('the disallow list', function() {
    it('should return all the attributes that are allowed to be used', function() {
      var object = {
        attr1: 'attribute_1',
        attr2: 'attribute_2',
        attr3: 'attribute_3'
      };

      var newObject = objectHelper.blacklist(object, ['attr1', 'attr2']);

      expect(newObject).to.eql({
        attr3: 'attribute_3'
      });

      expect(object).to.eql({
        attr1: 'attribute_1',
        attr2: 'attribute_2',
        attr3: 'attribute_3'
      });
    });
  });

  describe('toSnakeCase', function() {
    it('should change the casing to all the attributes', function() {
      var object = {
        attrName1: 'attribute_1',
        attrName22: 'attribute_2',
        attrNAME3: 'attribute_3',
        attrNULL: null,
        arrayAtt: ['one', 'two'],
        someObj: {
          objAtt1: 'asd',
          objAtt2: '123',
          innerArrayAtt: ['one', 'two']
        }
      };

      var newObject = objectHelper.toSnakeCase(object);

      expect(object).to.eql({
        attrName1: 'attribute_1',
        attrName22: 'attribute_2',
        attrNAME3: 'attribute_3',
        attrNULL: null,
        arrayAtt: ['one', 'two'],
        someObj: {
          objAtt1: 'asd',
          objAtt2: '123',
          innerArrayAtt: ['one', 'two']
        }
      });

      expect(newObject.array_att).to.be.an('array');
      expect(newObject.some_obj.inner_array_att).to.be.an('array');

      expect(newObject).to.eql({
        attr_name_1: 'attribute_1',
        attr_name_22: 'attribute_2',
        attr_name_3: 'attribute_3',
        attr_null: null,
        array_att: ['one', 'two'],
        some_obj: {
          obj_att_1: 'asd',
          obj_att_2: '123',
          inner_array_att: ['one', 'two']
        }
      });
    });

    it('should change the casing to all the allowed attributes', function() {
      var object = {
        attrName1: 'attribute_1',
        attrName22: 'attribute_2',
        attrNAME3: 'attribute_3'
      };

      var newObject = objectHelper.toSnakeCase(object, ['attrName22']);

      expect(object).to.eql({
        attrName1: 'attribute_1',
        attrName22: 'attribute_2',
        attrNAME3: 'attribute_3'
      });

      expect(newObject).to.eql({
        attr_name_1: 'attribute_1',
        attrName22: 'attribute_2',
        attr_name_3: 'attribute_3'
      });
    });
  });

  describe('toCamelCase', function() {
    it('should change the casing to all the attributes', function() {
      var object = {
        attr_name_1: 'attribute_1',
        attr_name_22: 'attribute_2',
        attr__name_3: 'attribute_3',
        attr_null: null,
        arr_att: ['one', 'two'],
        some_obj: {
          obj_att_1: 'asdf',
          obj_att_2: '1234',
          inner_array_att: ['one', 'two']
        }
      };

      var newObject = objectHelper.toCamelCase(object);

      expect(newObject).to.eql({
        attrName1: 'attribute_1',
        attrName22: 'attribute_2',
        attrName3: 'attribute_3',
        attrNull: null,
        arrAtt: ['one', 'two'],
        someObj: {
          objAtt1: 'asdf',
          objAtt2: '1234',
          innerArrayAtt: ['one', 'two']
        }
      });
    });

    it('should not break the string', function() {
      var object = 'some random string';

      var newObject = objectHelper.toCamelCase(object);

      expect(object).to.eql('some random string');

      expect(newObject).to.be.a('string');

      expect(newObject).to.eql('some random string');
    });

    it('should change the casing to all the allowed attributes', function() {
      var object = {
        attr_name_1: 'attribute_1',
        attr_name_22: 'attribute_2',
        attr__name_3: 'attribute_3'
      };

      var newObject = objectHelper.toCamelCase(object, ['attr_name_22']);

      expect(object).to.eql({
        attr_name_1: 'attribute_1',
        attr_name_22: 'attribute_2',
        attr__name_3: 'attribute_3'
      });

      expect(newObject).to.eql({
        attrName1: 'attribute_1',
        attr_name_22: 'attribute_2',
        attrName3: 'attribute_3'
      });
    });

    it('should keep original property as well', function() {
      var object = {
        attr_name_1: 'attribute_1',
        attr_name_22: 'attribute_2',
        attr__name_3: 'attribute_3',
        attr_null: null,
        arr_att: ['one', 'two'],
        some_obj: {
          obj_att_1: 'asdf',
          obj_att_2: '1234',
          inner_array_att: ['one', 'two']
        }
      };

      var newObject = objectHelper.toCamelCase(object, [], {
        keepOriginal: true
      });

      expect(newObject).to.eql({
        attrName1: 'attribute_1',
        attr_name_1: 'attribute_1',
        attrName22: 'attribute_2',
        attr_name_22: 'attribute_2',
        attrName3: 'attribute_3',
        attr__name_3: 'attribute_3',
        attrNull: null,
        attr_null: null,
        arrAtt: ['one', 'two'],
        arr_att: ['one', 'two'],
        someObj: {
          objAtt1: 'asdf',
          obj_att_1: 'asdf',
          objAtt2: '1234',
          obj_att_2: '1234',
          innerArrayAtt: ['one', 'two'],
          inner_array_att: ['one', 'two']
        },
        some_obj: {
          objAtt1: 'asdf',
          obj_att_1: 'asdf',
          objAtt2: '1234',
          obj_att_2: '1234',
          innerArrayAtt: ['one', 'two'],
          inner_array_att: ['one', 'two']
        }
      });
    });

    it('do not change a property if it already exists in the object', function() {
      var object = { attrName1: 'attr1', attr_name_1: 'attr_1' };
      var object2 = { attr_name_1: 'attr_1', attrName1: 'attr1' };
      var newObject = objectHelper.toCamelCase(object, [], {
        keepOriginal: true
      });
      var newObject2 = objectHelper.toCamelCase(object2, [], {
        keepOriginal: true
      });
      expect(newObject).to.eql({ attrName1: 'attr1', attr_name_1: 'attr_1' });
      expect(newObject2).to.eql({ attr_name_1: 'attr_1', attrName1: 'attr1' });
    });
  });
  describe('getOriginFromUrl', function() {
    it('should return undefined if there is no url', function() {
      expect(objectHelper.getOriginFromUrl()).to.be(undefined);
      expect(objectHelper.getOriginFromUrl('')).to.be(undefined);
      expect(objectHelper.getOriginFromUrl(null)).to.be(undefined);
    });
    it('should use an anchor to parse the url and return the origin', function() {
      var url = 'https://test.com/example';
      expect(objectHelper.getOriginFromUrl(url)).to.be('https://test.com');
    });
    it('should use add the `port` when available', function() {
      var url = 'https://localhost:3000/example';
      expect(objectHelper.getOriginFromUrl(url)).to.be(
        'https://localhost:3000'
      );
    });
  });
  describe('getLocationFromUrl', function() {
    const mapping = {
      'https://localhost:3000/foo?id=1': {
        href: 'https://localhost:3000/foo?id=1',
        protocol: 'https:',
        host: 'localhost:3000',
        hostname: 'localhost',
        port: '3000',
        pathname: '/foo',
        search: '?id=1',
        hash: ''
      },
      'https://auth0.com/foo': {
        href: 'https://auth0.com/foo',
        protocol: 'https:',
        host: 'auth0.com',
        hostname: 'auth0.com',
        port: undefined,
        pathname: '/foo',
        search: '',
        hash: ''
      },
      'https://auth0.com#access_token=foo': {
        href: 'https://auth0.com#access_token=foo',
        protocol: 'https:',
        host: 'auth0.com',
        hostname: 'auth0.com',
        port: undefined,
        pathname: '',
        search: '',
        hash: '#access_token=foo'
      },
      'file://electron-app/foo?id=1': {
        href: 'file://electron-app/foo?id=1',
        protocol: 'file:',
        host: 'electron-app',
        hostname: 'electron-app',
        port: undefined,
        pathname: '/foo',
        search: '?id=1',
        hash: ''
      }
    };
    for (const url in mapping) {
      it('should map urls correctly: ' + url, function() {
        expect(objectHelper.getLocationFromUrl(url)).to.be.eql(mapping[url]);
      });
    }
  });
  describe('trimUserDetails', function() {
    var options;
    function getTrimmed() {
      return objectHelper.trimUserDetails(options);
    }
    beforeEach(function() {
      options = {
        email: '   me@example.com   ',
        phoneNumber: '   +16505555555   ',
        username: '   johndoe   '
      };
    });
    it('should trim the username, email, and phoneNumber in an options object', function() {
      expect(getTrimmed()).to.eql({
        email: 'me@example.com',
        phoneNumber: '+16505555555',
        username: 'johndoe'
      });
    });
    it('should not mutate the original options object', function() {
      expect(options)
        .to.not.equal(getTrimmed())
        .and.eql({
          email: '   me@example.com   ',
          phoneNumber: '   +16505555555   ',
          username: '   johndoe   '
        });
    });
    it('should only trim username & email--not other properties', function() {
      options.otherAttribute = '   stay untrimmed my friend   ';
      expect(getTrimmed()).to.eql({
        email: 'me@example.com',
        otherAttribute: '   stay untrimmed my friend   ',
        phoneNumber: '+16505555555',
        username: 'johndoe'
      });
    });
    it('should not fail when username, email, and/or phoneNumber are absent', function() {
      options = {
        attr1: 'attribute_1',
        attr2: 'attribute_2',
        attr3: 'attribute_3'
      };
      expect(getTrimmed()).to.eql(options);
      options = {
        attr1: 'attribute_1',
        attr2: 'attribute_2',
        username: '   johndoe   '
      };
      expect(getTrimmed()).to.eql({
        attr1: 'attribute_1',
        attr2: 'attribute_2',
        username: 'johndoe'
      });
      options = {
        attr1: 'attribute_1',
        attr2: 'attribute_2',
        email: '   email@example.com   '
      };
      expect(getTrimmed()).to.eql({
        attr1: 'attribute_1',
        attr2: 'attribute_2',
        email: 'email@example.com'
      });
      options = {
        attr1: 'attribute_1',
        attr2: 'attribute_2',
        phoneNumber: '   +16505555555   '
      };
      expect(getTrimmed()).to.eql({
        attr1: 'attribute_1',
        attr2: 'attribute_2',
        phoneNumber: '+16505555555'
      });
    });
  });

  describe('setPropertyValue', function() {
    it('can set a property at the first level of the object', function() {
      var obj = {
        one: 1,
        two: 2,
        three: 3
      };

      objectHelper.updatePropertyOn(obj, 'one', 'one');

      expect(obj).to.eql({
        one: 'one',
        two: 2,
        three: 3
      });
    });

    it('can set a nested property', function() {
      var obj = {
        one: {
          two: {
            three: 3
          }
        }
      };

      objectHelper.updatePropertyOn(obj, 'one.two.three', 'three');

      expect(obj).to.eql({
        one: {
          two: {
            three: 'three'
          }
        }
      });
    });

    it("does not add new values if the key doesn't already exist", function() {
      var obj = {
        one: {
          two: {
            three: 3
          }
        }
      };

      objectHelper.updatePropertyOn(obj, 'one.two.four', 4);

      expect(obj).to.eql({
        one: {
          two: {
            three: 3
          }
        }
      });
    });
  });
});


text:
namespace Tn.DeviceManager.Measurements
{
    public enum OrderType
    {
        Ascending,
        Descending
    }
}


text:
{% extends 'base.html' %}
{% load i18n %}
{% block content %}

{% trans "Confirm assigment" %}

{% blocktrans with object=object %}Are you sure you want to assing "{{institution}}" to monitoring "{{monitoring}}"?{% endblocktrans %}

<form method="POST">
  {% csrf_token %}
  <button type="submit" class="btn btn-primary">
    {% trans 'Assign' %}
  </button>
</form>
{% endblock %}


text:
import showIndexPage from "./action/index/show";
import showContactsIndexPage from "./action/contacts/index";
import showContactPage from "./action/contacts/show";
import createContactPage from "./action/contacts/create";
import editContactPage from "./action/contacts/edit";
import deleteContactPage from "./action/contacts/delete";

export var routes = {
    "": "home",
    "contacts": "contacts",
    "contacts/create": "contact-create",
    "contacts/:id/edit": "contact-edit",
    "contacts/:id/delete": "contact-delete",
    "contacts/:id/view": "contact"
};

export var actions = {
    "home": showIndexPage,
    "contacts": showContactsIndexPage,
    "contact-create": createContactPage,
    "contact-edit": editContactPage,
    "contact-delete": deleteContactPage,
    "contact": showContactPage
};


text:
* How exactly are we planning to filter
    * lodash (?). Maia to discuss more with us.
* Visualization tools
    * Lets make a decision on which tool we want to visualize.
    * Tableau vs D3 vs Chart.js- Pros and Cons
        * Tableau we would be sending data to external server. What is their API limit and Security policy?
        * Should we really be dependent on an external server for doing filtering if we can just do filtering in the client side?
        * Which one has better integration with IE11?
* Algorithms we will be using
    * We should include everything as an algorithm that we are doing that is not normal or usual.
    * I asked the prof and he mentioned we do not need to focus and worry about this as our thing is pretty straightforward.
* Database Design
    * We should have it in 3rd Normal Form.
    * Our Database Instance is deployed on AWS via RDS.
* App Deployment
    * Stephen suggests AWS. We can easily integrate our deployed database it.
    * Seems fairly straightforward.
* API deisgn
    * We should talk about all the external libraries that we are using.
    * And a description of our own REST API.
    * Coast Capital DO NOT WANT dynamic-created queries.
* Security
    * Slides say that Coast Capital want everything encrypted. So, we would have to set it up over HTTPS instead of HTTP.
    * Dont think it will be too hard.
* Potential tradeoffs:
    * Tradeoffs between fast vs good vs cheap. And how they impact stuff like quality, security, peroformance, etc

# Minutes

TO BE POSTED AFTER THE MEETING.


text:
package org.apache.james.mailbox.hbase;

import java.io.IOException;
import org.apache.james.mailbox.AbstractMailboxManagerTest;
import org.apache.james.mailbox.MailboxSession;
import org.apache.james.mailbox.acl.GroupMembershipResolver;
import org.apache.james.mailbox.acl.MailboxACLResolver;
import org.apache.james.mailbox.acl.SimpleGroupMembershipResolver;
import org.apache.james.mailbox.acl.UnionMailboxACLResolver;
import org.apache.james.mailbox.exception.BadCredentialsException;
import org.apache.james.mailbox.exception.MailboxException;
import static org.apache.james.mailbox.hbase.HBaseNames.*;
import org.apache.james.mailbox.hbase.mail.HBaseModSeqProvider;
import org.apache.james.mailbox.hbase.mail.HBaseUidProvider;
import org.junit.After;
import org.junit.Before;
import org.slf4j.LoggerFactory;

/**
 * HBaseMailboxManagerTest that extends the StoreMailboxManagerTest.
 *
 */
public class HBaseMailboxManagerTest extends AbstractMailboxManagerTest {

    private static final HBaseClusterSingleton CLUSTER = HBaseClusterSingleton.build();

    /**
     * Setup the mailboxManager.

     * @throws Exception
     */
    @Before
    public void setup() throws Exception {
        ensureTables();
        clearTables();
        createMailboxManager();
    }

    private void ensureTables() throws IOException {
        CLUSTER.ensureTable(MAILBOXES_TABLE, new byte[][]{MAILBOX_CF});
        CLUSTER.ensureTable(MESSAGES_TABLE,
                new byte[][]{MESSAGES_META_CF, MESSAGE_DATA_HEADERS_CF, MESSAGE_DATA_BODY_CF});
        CLUSTER.ensureTable(SUBSCRIPTIONS_TABLE, new byte[][]{SUBSCRIPTION_CF});
    }

    private void clearTables() {
        CLUSTER.clearTable(MAILBOXES);
        CLUSTER.clearTable(MESSAGES);
        CLUSTER.clearTable(SUBSCRIPTIONS);
    }

    /**
     * Close the system session and entityManagerFactory
     *
     * @throws MailboxException
     * @throws BadCredentialsException
     */
    @After
    public void tearDown() throws Exception {
        deleteAllMailboxes();
        MailboxSession session = getMailboxManager().createSystemSession("test", LoggerFactory.getLogger("Test"));
        session.close();
    }

    /* (non-Javadoc)i deve
     * @see org.apache.james.mailbox.MailboxManagerTest#createMailboxManager()
     */
    @Override
    protected void createMailboxManager() throws MailboxException {
        final HBaseUidProvider uidProvider = new HBaseUidProvider(CLUSTER.getConf());
        final HBaseModSeqProvider modSeqProvider = new HBaseModSeqProvider(CLUSTER.getConf());
        final HBaseMailboxSessionMapperFactory mapperFactory = new HBaseMailboxSessionMapperFactory(CLUSTER.getConf(),
                uidProvider, modSeqProvider);

        final MailboxACLResolver aclResolver = new UnionMailboxACLResolver();
        final GroupMembershipResolver groupMembershipResolver = new SimpleGroupMembershipResolver();

        final HBaseMailboxManager manager = new HBaseMailboxManager(mapperFactory, null, aclResolver,
                groupMembershipResolver);
        manager.init();

        setMailboxManager(manager);

        deleteAllMailboxes();
    }

    private void deleteAllMailboxes() throws BadCredentialsException, MailboxException {
        MailboxSession session = getMailboxManager().createSystemSession("test", LoggerFactory.getLogger("Test"));
        try {
            ((HBaseMailboxManager) mailboxManager).deleteEverything(session);
        } catch (MailboxException e) {
            e.printStackTrace();
        }
        session.close();
    }
}


text:
ClassMethods
============

.. toctree::
   :maxdepth: 3
   :titlesonly:

Constants
---------

Files
-----

  * `lib/neo4j/active_rel/property.rb:27 <https://github.com/neo4jrb/neo4j/blob/master/lib/neo4j/active_rel/property.rb#L27>`_

Methods
-------

.. _`Neo4j/ActiveRel/Property/ClassMethods#creates_unique_rel`:

**#creates_unique_rel**

  .. hidden-code-block:: ruby

     def creates_unique_rel
       @unique = true
     end

.. _`Neo4j/ActiveRel/Property/ClassMethods#end_class`:

**#end_class**

  .. hidden-code-block:: ruby

     alias_method :end_class,    :to_class

.. _`Neo4j/ActiveRel/Property/ClassMethods#extract_association_attributes!`:

**#extract_association_attributes!**
  Extracts keys from attributes hash which are relationships of the model
  TODO: Validate separately that relationships are getting the right values?  Perhaps also store the values and persist relationships on save?

  .. hidden-code-block:: ruby

     def extract_association_attributes!(attributes)
       {}.tap do |relationship_props|
         attributes.each_key do |key|
           relationship_props[key] = attributes.delete(key) if [:from_node, :to_node].include?(key)
         end
       end
     end

.. _`Neo4j/ActiveRel/Property/ClassMethods#id_property_name`:

**#id_property_name**

  .. hidden-code-block:: ruby

     def id_property_name
       false
     end

.. _`Neo4j/ActiveRel/Property/ClassMethods#load_entity`:

**#load_entity**

  .. hidden-code-block:: ruby

     def load_entity(id)
       Neo4j::Node.load(id)
     end

.. _`Neo4j/ActiveRel/Property/ClassMethods#start_class`:

**#start_class**

  .. hidden-code-block:: ruby

     alias_method :start_class,  :from_class

.. _`Neo4j/ActiveRel/Property/ClassMethods#unique?`:

**#unique?**

  .. hidden-code-block:: ruby

     def unique?
       !!@unique
     end


text:
var passport = require('passport');
var logger = require('../services/logger');
var dbService = require('./dbservice');
var tokencleaner = require('./tokencleaner');
var oauth2orize = require('oauth2orize');
var uuid = require('uuid');
var BearerStrategy = require('passport-http-bearer').Strategy;
var LocalStrategy = require('passport-local').Strategy;
var logger = require('../services/logger');

var server = oauth2orize.createServer();

var expireDate = function(){
  var date = new Date();
  var expireDays = parseFloat(process.env.TOKEN_EXPIRES_DAYS || 14);
  var expireMillis = expireDays * 24 * 60 * 60 * 1000;
  date.setTime(date.getTime() + expireMillis);
  return date;
};

passport.use(new BearerStrategy(async function(token, cb) {
  try {
  var token = await dbService.Token.findByPk(token, {include: [dbService.User]});
    if(token === undefined || token === null)
      return cb(null, false);
    if(new Date(token.expires) <= new Date()) {
      await token.destroy()
      return cb(null, false);
    }
    var user = token.User;
    cb(null, user);
    return user;
  } catch(err) {
    cb(err);
  }
}));

passport.use(new LocalStrategy(async function(username, password, done) {
  try {
    var user = await dbService.User.findOne({where: {username: dbService.normalizeUsername(username)}});
    if (!user)
      throw new Error("Bad credentials");
    var passwordValid = await user.validatePassword(password);
    if(!passwordValid)
      throw new Error("Bad credentials");
    done(null, user);
    return null;
  } catch(err) {
    done(err);
  }
}));

server.exchange(oauth2orize.exchange.password(async function(client, username, password, scope, done) {
  try {
    var user = await dbService.User.findOne({where: {username: dbService.normalizeUsername(username)}});
    if (!user)
      throw new Error("Bad credentials");
    var passwordValid = await user.validatePassword(password);
    if(!passwordValid)
      throw new Error("Bad credentials");
    var createToken = async function(remainingAttempts){
      var accessToken = uuid.v4();
      try {
        await user.createToken({id: accessToken, expires: expireDate()});
        done(null, accessToken);
        return tokencleaner.rescheduleCleaner();
      } catch(err) {
        logger.logException(err);
        remainingAttempts--;
        if(remainingAttempts > 0)
          return createToken(remainingAttempts);
        throw new Error("Cannot create token");
      }
    };
    await createToken(5);
  } catch(err) {
    done(err);
  }
}));

var allowRegistration= function(){
  return JSON.parse(process.env.ALLOW_REGISTRATION || false);
};

var logout = async function(token){
  var foundToken = await dbService.Token.findByPk(token);
  if(foundToken === null || foundToken === undefined){
    logger.logger.error("Token %s does not exist", token)
    throw new Error("Cannot delete non-existing token");
  }
  return foundToken.destroy();
};

exports.allowRegistration = allowRegistration;
exports.oauth2server = server;
exports.logout = logout;


text:
:man_page: bson_cross_platform_notes

Cross Platform Notes
====================

.. toctree::
  :titlesonly:

  endianness
  threading


text:
//
// Copyright (c) 2008-2011, Kenneth Bell
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//

namespace DiscUtils.Net.Dns
{
    using System;
    using System.Collections.Generic;
    using System.Net;
    using System.Net.NetworkInformation;
    using System.Net.Sockets;

    /// <summary>
    /// Implements the (conventional) unicast DNS protocol.
    /// </summary>
    public sealed class UnicastDnsClient : DnsClient
    {
        private ushort _nextTransId;
        private IPEndPoint[] _servers;

        private int responseTimeout = 2000;
        private int maxRetries = 3;

        /// <summary>
        /// Initializes a new instance of the UnicastDnsClient class.
        /// </summary>
        /// <remarks>
        /// This constructor attempts to detect the DNS servers in use by the local
        /// OS, and use those servers.
        /// </remarks>
        public UnicastDnsClient()
            : this(GetDefaultDnsServers())
        {
        }

        /// <summary>
        /// Initializes a new instance of the UnicastDnsClient class, using nominated DNS servers.
        /// </summary>
        /// <param name="servers">The servers to use (non-standard ports may be specified).</param>
        public UnicastDnsClient(params IPEndPoint[] servers)
        {
            _nextTransId = (ushort)new Random().Next();
            _servers = servers;
        }

        /// <summary>
        /// Initializes a new instance of the UnicastDnsClient class, using nominated DNS servers.
        /// </summary>
        /// <param name="servers">The servers to use (the default DNS port, 53, is used).</param>
        public UnicastDnsClient(params IPAddress[] servers)
        {
            _nextTransId = (ushort)new Random().Next();
            _servers = new IPEndPoint[servers.Length];
            for (int i = 0; i < servers.Length; ++i)
            {
                _servers[i] = new IPEndPoint(servers[i], 53);
            }
        }

        /// <summary>
        /// Flushes any cached DNS records.
        /// </summary>
        public override void FlushCache()
        {
            // Nothing to do.
        }

        /// <summary>
        /// Looks up a record in DNS.
        /// </summary>
        /// <param name="name">The name to lookup.</param>
        /// <param name="type">The type of record requested.</param>
        /// <returns>The records returned by the DNS server, if any.</returns>
        public override ResourceRecord[] Lookup(string name, RecordType type)
        {
            ushort transactionId = _nextTransId++;
            string normName = NormalizeDomainName(name);

            using (UdpClient udpClient = new UdpClient(0))
            {
                IAsyncResult result = udpClient.BeginReceive(null, null);

                PacketWriter writer = new PacketWriter(1800);
                Message msg = new Message();
                msg.TransactionId = transactionId;
                msg.Flags = new MessageFlags(false, OpCode.Query, false, false, false, false, ResponseCode.Success);
                msg.Questions.Add(new Question() { Name = normName, Type = type, Class = RecordClass.Internet });

                msg.WriteTo(writer);

                byte[] msgBytes = writer.GetBytes();

                foreach (var server in _servers)
                {
                    udpClient.Send(msgBytes, msgBytes.Length, server);
                }

                for (int i = 0; i < maxRetries; ++i)
                {
                    DateTime now = DateTime.UtcNow;
                    while (result.AsyncWaitHandle.WaitOne(Math.Max(responseTimeout - (DateTime.UtcNow - now).Milliseconds, 0)))
                    {
                        try
                        {
                            IPEndPoint sourceEndPoint = null;
                            byte[] packetBytes = udpClient.EndReceive(result, ref sourceEndPoint);
                            PacketReader reader = new PacketReader(packetBytes);

                            Message response = Message.Read(reader);

                            if (response.TransactionId == transactionId)
                            {
                                return response.Answers.ToArray();
                            }
                        }
                        catch
                        {
                            // Do nothing - bad packet (probably...)
                        }
                    }
                }
            }

            return null;
        }

        private static IPAddress[] GetDefaultDnsServers()
        {
            Dictionary<IPAddress, object> addresses = new Dictionary<IPAddress, object>();

            foreach (var nic in NetworkInterface.GetAllNetworkInterfaces())
            {
                if (nic.OperationalStatus == OperationalStatus.Up)
                {
                    foreach (var address in nic.GetIPProperties().DnsAddresses)
                    {
                        if (address.AddressFamily == AddressFamily.InterNetwork && !addresses.ContainsKey(address))
                        {
                            addresses.Add(address, null);
                        }
                    }
                }
            }

            IPAddress[] addressArray = new IPAddress[addresses.Count];
            addresses.Keys.CopyTo(addressArray, 0);
            return addressArray;
        }
    }
}


text:
(
	function( angular ) {

		'use strict';

		// Angular App Start
		let app = angular
			.module(
				'dropularDemo',
				[
					'dropular',
				]
			)
		;

		// Configuration Phase
		app.config( Configuration );

		function Configuration( $logProvider ) {

			// Just for Debug purpose
			$logProvider.debugEnabled( true );

		};

		Configuration.$inject = [ '$logProvider' ];

		// Start
		// Run, run, run
		app.run( Run );

		function Run( $log ) {

			$log.info( '%c Dropular Demo app, ready to rock ✌', 'color:#f1c40f' );

		};

		Run
			.$inject = [
				'$log',
			]
		;

		// Controllers
		// Main
		app.controller( 'Main', MainController );

		function MainController(
			$log,
			Dropular
		) {

			// Settings of this application
			const configuration = {
				accessToken: 'your-access-code',
				clientId: 'your-client-id',
				debug: true,
			};

			let vm = angular.extend(
				this,
				{
					dropular: null,
				}
			);

			$log.info( '%c MainController', 'color:#f1c40f' );

			// Init Dropangular
			vm.dropular = Dropular.init( configuration );
			vm.dropular
				.filesListFolder( { path: '' } )
				.then( response => $log.info( response.entries ) )
			;

		};

		MainController
			.$inject = [
				'$log',
				'Dropular',
			]
		;

	}
)( angular );


text:
package dev.flutter;

import android.os.Bundle;
import androidx.annotation.Nullable;
import androidx.test.runner.AndroidJUnitRunner;
import dev.flutter.scenariosui.ScreenshotUtil;

public class TestRunner extends AndroidJUnitRunner {
  @Override
  public void onCreate(@Nullable Bundle arguments) {
    ScreenshotUtil.onCreate();
    super.onCreate(arguments);
  }

  @Override
  public void finish(int resultCode, @Nullable Bundle results) {
    ScreenshotUtil.finish();
    super.finish(resultCode, results);
  }
}