text:
const featureScorePercentage = require('../helpers/featureScorePercentage.js');

module.exports = function () {
    const passObj = {
        webm1080p60: false,
        feature_score: 0,
    };
    if ('mediaCapabilities' in navigator) {
        const webm1080p60 = {
            type: 'file',
            video: {
                contentType: 'video/webm',
                width: 1920,
                height: 1080,
                framerate: 60,
            },
        };

        navigator.mediaCapabilities.decodingInfo(webm1080p60).then((result) => {
            passObj.media = (result.supported && result.smooth && result.powerEfficient);
        });

        passObj.feature_score = featureScorePercentage(passObj);

        return passObj;
    }

    return null;
};


text:
package org.apache.camel.component.ssh;

import java.io.InputStream;

public class SshResult {

    /**
     * The value of this header is a {@link InputStream} with the standard error
     * stream of the executable.
     */
    public static final String STDERR = "CamelSshStderr";

    /**
     * The value of this header is the exit value that is returned, after the
     * execution. By convention a non-zero status exit value indicates abnormal
     * termination.

     * Note that the exit value is OS dependent.
     */
    public static final String EXIT_VALUE = "CamelSshExitValue";

    private final String command;

    private final Integer exitValue;

    private final InputStream stdout;

    private final InputStream stderr;

    public SshResult(String command, Integer exitValue, InputStream out, InputStream err) {
        this.command = command;
        this.exitValue = exitValue;
        this.stdout = out;
        this.stderr = err;
    }

    public String getCommand() {
        return command;
    }

    public Integer getExitValue() {
        return exitValue;
    }

    public InputStream getStdout() {
        return stdout;
    }

    public InputStream getStderr() {
        return stderr;
    }

}

redpajama_set_name: RedPajamaGithub


text:
layout: slide
---

<div class="quiz-text quiz-multitext well">
  {{{ slide.content }}}
  {{> buttons }}
</div>


text:
package com.intel.analytics.bigdl.nn

import com.intel.analytics.bigdl.tensor.Tensor
import com.intel.analytics.bigdl.utils.Table
import com.intel.analytics.bigdl.utils.serializer.ModuleSerializationTest

import scala.util.Random

class CDivTableSerialTest extends ModuleSerializationTest {
  override def test(): Unit = {
    val cdivTable = new CDivTable[Float]().setName("cdivTable")
    val input1 = Tensor[Float](10).apply1(e => Random.nextFloat())
    val input2 = Tensor[Float](10).apply1(e => Random.nextFloat())
    var input = new Table()
    input(1.toFloat) = input1
    input(2.toFloat) = input2
    runSerializationTest(cdivTable, input)
  }
}


text:
from __future__ import print_function, unicode_literals

import unittest
import mocker
import weblab.experiment.devices.vm.manager as VirtualMachineManager

import voodoo.configuration as ConfigurationManager
import test.unit.configuration as configuration_module

class VirtualMachineManagerTestCase(mocker.MockerTestCase):

    def setUp(self):
        cfg_manager = ConfigurationManager.ConfigurationManager()
        cfg_manager.append_module(configuration_module)

        self.vmm = VirtualMachineManager.VirtualMachineManager(cfg_manager)

    def tearDown(self):
        pass

    def test_copy_file(self):
        pass

def suite():
    return unittest.makeSuite(VirtualMachineManagerTestCase)

if __name__ == '__main__':
    unittest.main()


text:
#ifndef LKSMITH_UTIL_PLATFORM_H
#define LKSMITH_UTIL_PLATFORM_H

/**
 * Interface for making platform-specific calls.
 */

#include <unistd.h> /* for size_t */

/**
 * Create a name for the current thread.
 *
 * If the platform supports getting the kernel thread ID, we will retrieve
 * that.  Otherwise, we'll create an arbitrary identifier.
 *
 * @param out		(out param) the buffer to write to
 * @param out_len	length of the out buffer
 */
void platform_create_thread_name(char * __restrict out, size_t out_len);

/**
 * Find a function named 'fname' in a library other than the current one.  We
 * need this to forward methods that we have intercepted onwards to the
 * "real" pthreads functions.
 *
 * @param fname		The function name to look for
 *
 * @return		NULL if the function could not be found; the function
 *			pointer otherwise.  Technically, a void pointer should
 *			never be cast to a function pointer, since the C
 *			standard allows them to have different sizes.  However,
 *			the POSIX dlsym functions we're calling ignore this
 *			nicety, and alternative interfaces are not available.
 *			So there seems to be little point in being pedantic about
 *			it in the code.
 */
void* get_dlsym_next(const char *fname);

#endif


text:
/**
 * @file
 * Runs our tests.
 */

'use strict';

import gulp from 'gulp';
import del from 'del';
import sass from 'gulp-sass';
import sassLint from 'gulp-sass-lint';
import mocha from 'gulp-spawn-mocha';
import sassTrue from 'sass-true';

let config = {};

config.sass = {
  src: 'test/sass',
  dest: 'test/css'
}

config.sassOptions = {
  includePaths: [
    config.sass.src,
    'stylesheets',
    'node_modules/sass-true/sass'
  ],
  outputStyle: 'expanded',
}

/**
 * Clean CSS files.
 */
const clean = function() {
  return del([config.sass.dest + '/**/*.css'], { force: true });
};

clean.description = 'Clean CSS files.';
gulp.task('clean', clean);

/**
 * Output CSS.
 */
const styles = function() {
  return gulp.src([config.sass.src + '/**/*.scss'])
    .pipe(sass(config.sassOptions).on('error', sass.logError))
    .pipe(gulp.dest(config.sass.dest));
};

styles.description = 'Outputs CSS.';
gulp.task('styles', styles);

/**
 * Lint everything.
 */
const lint = function() {
  return gulp.src([config.sass.src + '/**/*.scss', 'stylesheets/**/*.scss'])
    .pipe(sassLint())
    .pipe(sassLint.format());
};

lint.description = 'Lint everything.';
gulp.task('lint', lint);

/**
 * Lint everything (and fail).
 */
const lintWithFail = function() {
  return gulp.src([config.sass.src + '/**/*.scss', 'stylesheets/**/*.scss'])
    .pipe(sassLint())
    .pipe(sassLint.format())
    .pipe(sassLint.failOnError());
};

lint.description = 'Lint everything (and fail).';
gulp.task('lint:with-fail', lintWithFail);

/**
 * Run tests.
 */
const test = function() {
  return gulp.src('test/typey-test.js', { read: false })
    .pipe(mocha().on('error', function() { this.emit('end') }));
};

test.description = 'Run tests.';
gulp.task('test', test);

/**
 * Run tests.
 */
const testWithFail = function() {
  return gulp.src('test/typey-test.js', { read: false })
    .pipe(mocha());
};

test.description = 'Run tests (and fail).';
gulp.task('test:with-fail', testWithFail);

/**
 * Build.
 */
const build = gulp.series('clean', 'styles');

build.description = 'Build the test files.';
gulp.task('build', build);

/**
 * Watch, compile, lint and test.
 */
const watch = function(e) {
  gulp.watch([config.sass.src + '/**/*.scss', 'stylesheets/**/*.scss'], gulp.series('build', 'lint', 'test'));
}

watch.description = 'Watch, build, lint and test.';
gulp.task('watch', watch);

// Set the default task to build & watch.
gulp.task('default', gulp.series('build', 'lint', 'test', 'watch'));

/**
 * Travis CI.
 */
const travis = gulp.series('lint:with-fail', 'test:with-fail');

travis.description = 'Test tasks for Travis CI.';
gulp.task('travis', travis);


text:
package org.apache.jackrabbit.core.query;

import java.security.Principal;

import javax.jcr.AccessDeniedException;
import javax.jcr.Node;
import javax.jcr.NodeIterator;
import javax.jcr.RepositoryException;
import javax.jcr.Session;
import javax.jcr.query.Query;
import javax.jcr.query.QueryManager;
import javax.jcr.security.AccessControlPolicy;
import javax.jcr.security.AccessControlPolicyIterator;
import javax.jcr.security.Privilege;

import org.apache.jackrabbit.api.JackrabbitSession;
import org.apache.jackrabbit.api.security.user.User;
import org.apache.jackrabbit.api.security.user.UserManager;
import org.apache.jackrabbit.api.security.JackrabbitAccessControlList;
import org.apache.jackrabbit.test.NotExecutableException;
import org.apache.jackrabbit.test.api.security.AbstractAccessControlTest;

/**
 * SkipDeniedNodesTest checks if nodes are correctly skipped
 * when a session does not have access to it.
 */
public class SkipDeniedNodesTest extends AbstractAccessControlTest {

    private Session anonymous;

    private Node n1;
    private Node n2;
    private Node n3;
    private Node n4;

    protected void setUp() throws Exception {
        super.setUp();
        anonymous = getHelper().getReadOnlySession();

        n1 = testRootNode.addNode(nodeName1);
        n1.setProperty(propertyName1, "a");
        n2 = testRootNode.addNode(nodeName2);
        n2.setProperty(propertyName1, "b");
        n3 = testRootNode.addNode(nodeName3);
        n3.setProperty(propertyName1, "c");
        n4 = testRootNode.addNode(nodeName4);
        n4.setProperty(propertyName1, "d");
        superuser.save();

        JackrabbitAccessControlList acl = getACL(n2.getPath());
        acl.addEntry(getPrincipal(anonymous), privilegesFromName(Privilege.JCR_READ) , false);

        acMgr.setPolicy(n2.getPath(), acl);
        superuser.save();
    }

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

    public void testSkipNodes() throws RepositoryException {
        Node testNode = (Node) anonymous.getItem(testRoot);
        checkSequence(testNode.getNodes(),
                new String[]{n1.getPath(), n3.getPath(), n4.getPath()});

        QueryManager qm = anonymous.getWorkspace().getQueryManager();
        String ntName = n1.getPrimaryNodeType().getName();
        String stmt = testPath + "/element(*, " + ntName + ") order by @" + propertyName1;
        QueryImpl query = (QueryImpl) qm.createQuery(stmt, Query.XPATH);
        query.setOffset(0);
        query.setLimit(2);
        checkSequence(query.execute().getNodes(), new String[]{n1.getPath(), n3.getPath()});

        query = (QueryImpl) qm.createQuery(stmt, Query.XPATH);
        query.setOffset(2);
        query.setLimit(2);
        checkSequence(query.execute().getNodes(), new String[]{n4.getPath()});
    }

    private void checkSequence(NodeIterator nodes, String[] paths)
            throws RepositoryException {
        for (int i = 0; i < paths.length; i++) {
            assertTrue("No more nodes, expected: " + paths[i], nodes.hasNext());
            assertEquals("Wrong sequence", paths[i], nodes.nextNode().getPath());
        }
        assertFalse("No more nodes expected", nodes.hasNext());
    }

    private static Principal getPrincipal(Session session) throws NotExecutableException {
        UserManager userMgr;
        if (!(session instanceof JackrabbitSession)) {
            throw new NotExecutableException();
        }
        try {
            userMgr = ((JackrabbitSession) session).getUserManager();
            User user = (User) userMgr.getAuthorizable(session.getUserID());
            if (user == null) {
                throw new NotExecutableException("cannot get user for userID : " + session.getUserID());
            }
            return user.getPrincipal();
        } catch (RepositoryException e) {
            throw new NotExecutableException();
        }
    }

    private JackrabbitAccessControlList getACL(String path) throws RepositoryException, AccessDeniedException, NotExecutableException {
        AccessControlPolicyIterator it = acMgr.getApplicablePolicies(path);
        while (it.hasNext()) {
            AccessControlPolicy acp = it.nextAccessControlPolicy();
            if (acp instanceof JackrabbitAccessControlList) {
                return (JackrabbitAccessControlList) acp;
            }
        }
        throw new NotExecutableException("No JackrabbitAccessControlList found at " + path + " .");
    }
}


text:
from django.conf.urls import url
from django.contrib import admin
from django.contrib.sitemaps.views import sitemap
from django.views.generic.base import TemplateView

from apps.blog.views import EntryList
from apps.blog.views import EntryDetail
from apps.blog.views import CategoryList
from apps.blog.views import CategoryDetail
from apps.blog.views import TagCloud
from apps.blog.views import TagList
from apps.blog.views import Archivo
from apps.blog.views import BlogFeed
from apps.blog.views import BlogSitemap

admin.autodiscover()
sitemaps = {"blog": BlogSitemap}

urlpatterns = [
    # Portada
    url(r'^$', EntryList.as_view(), name='index'),
    url(r'^amp/$', EntryList.as_view(), name='amp_index'),

    # robots.txt y otros archivos de texto
    url(r'^robots\.txt$',
        TemplateView.as_view(template_name='blog/textos/robots.txt', content_type='text/plain'), name='robots'),
    url(r'^socialmedia\.txt$',
        TemplateView.as_view(template_name='blog/textos/socialmedia.txt', content_type='text/plain'),
        name='socialmedia'),
    url(r'^keybase\.txt$',
        TemplateView.as_view(template_name='blog/textos/keybase.txt', content_type='text/plain'), name='keybase'),

    # Páginas sin relación con modelos en apps.blog
    url(r'^archivo/amp/$', Archivo.as_view(), name='amp_archivo'),
    url(r'^archivo/$', Archivo.as_view(), name='archivo'),
    url(r'^buscar/$', TemplateView.as_view(template_name='blog/buscar.html'), name='buscar'),
    url(r'^rss/$', BlogFeed(), name='rss_feed'),
    url(r'^sitemap\.xml$', sitemap, {'sitemaps': sitemaps}),

    # URIs relacionadas con etiquetas
    url(r'^tag/$', TagCloud.as_view(), name='tag_cloud'),
    url(r'^tag/(?P<slug>[-\w]+)/$', TagList.as_view(), name='tag_list'),

    # Las categorías entran en conflicto con las etiquetas
    url(r'^cats/$', CategoryList.as_view(), name='cats'),
    url(r'^(?P<slug>[-\w]+)/amp/$', CategoryDetail.as_view(), name="amp_cat_detail"),
    url(r'^(?P<slug>[-\w]+)/$', CategoryDetail.as_view(), name="cat_detail"),

    # Esta es la última entrada porque captura everything
    url(r'^(?P<cat>[-\w]+)/(?P<slug>[-\w]+)/amp/$', EntryDetail.as_view(), name="amp_entry_detail"),
    url(r'^(?P<cat>[-\w]+)/(?P<slug>[-\w]+)/$', EntryDetail.as_view(), name="entry_detail"),
]


text:
package com.jing.dao;

import java.util.List;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import com.jing.vo.Category2;

public class Category2Dao extends HibernateDaoSupport {

	private Category2 findByHQL(String hql, Object... params) {
		@SuppressWarnings("unchecked")
		List<Category2> category2s = this.getHibernateTemplate().find(hql, params);
		if (category2s == null || category2s.size() == 0) {
			return null;
		}
		return category2s.get(0);
	}

	@SuppressWarnings("unchecked")
	public List<Category2> findCategory2sByCategory1Id(Integer category1Id) {
		return this.getHibernateTemplate().find("from Category2 where c1no=?", category1Id);
	}

	public Category2 findCategory2ById(Integer category2Id) {
		this.getHibernateTemplate().clear();
		return this.findByHQL("from Category2 where id=?", category2Id);
	}

}


text:
package http

import (
	"github.com/micro/go-micro/v2"
	"github.com/micro/go-micro/v2/server"
)

// WithBackend provides an option to set the http backend url
func WithBackend(url string) micro.Option {
	return func(o *micro.Options) {
		// get the router
		r := o.Server.Options().Router

		// not set
		if r == nil {
			r = DefaultRouter
			o.Server.Init(server.WithRouter(r))
		}

		// check its a http router
		if httpRouter, ok := r.(*Router); ok {
			httpRouter.Backend = url
		}
	}
}

// WithRouter provides an option to set the http router
func WithRouter(r server.Router) micro.Option {
	return func(o *micro.Options) {
		o.Server.Init(server.WithRouter(r))
	}
}


text:
/*
 * LegMotionBase.cpp
 *
 *  Created on: Mar 10, 2015
 *      Author: Péter Fankhauser
 *   Institute: ETH Zurich, Autonomous Systems Lab
 */
#include <free_gait_core/leg_motion/LegMotionBase.hpp>
#include <free_gait_core/leg_motion/Footstep.hpp>
#include <free_gait_core/leg_motion/EndEffectorTarget.hpp>
#include <free_gait_core/leg_motion/EndEffectorTrajectory.hpp>
#include <free_gait_core/leg_motion/LegMode.hpp>
#include <free_gait_core/leg_motion/JointTrajectory.hpp>

namespace free_gait {

LegMotionBase::LegMotionBase(LegMotionBase::Type type, LimbEnum limb)
    : type_(type),
      limb_(limb),
      hasContactAtStart_(false)
{
}

LegMotionBase::~LegMotionBase()
{
}

LegMotionBase::LegMotionBase(const LegMotionBase& other) :
    type_(other.type_),
    limb_(other.limb_),
    hasContactAtStart_(other.hasContactAtStart_)
{
  if (other.surfaceNormal_) surfaceNormal_.reset(new Vector(*(other.surfaceNormal_)));
}

LegMotionBase& LegMotionBase::operator=(const LegMotionBase& other)
{
  type_ = other.type_;
  limb_ = other.limb_;
  hasContactAtStart_ = other.hasContactAtStart_;
  if (other.surfaceNormal_) surfaceNormal_.reset(new Vector(*(other.surfaceNormal_)));
  return *this;
}

std::unique_ptr<LegMotionBase> LegMotionBase::clone() const
{
  throw std::runtime_error("LegMotionBase::clone() not implemented.");
}

LegMotionBase::Type LegMotionBase::getType() const
{
  return type_;
}

LimbEnum LegMotionBase::getLimb() const
{
  return limb_;
}

LegMotionBase::TrajectoryType LegMotionBase::getTrajectoryType() const
{
  throw std::runtime_error("LegMotionBase::getTrajectoryType() not implemented.");
}

const ControlSetup LegMotionBase::getControlSetup() const
{
  throw std::runtime_error("LegMotionBase::getControlSetup() not implemented.");
}

bool LegMotionBase::prepareComputation(const State& state, const Step& step, const AdapterBase& adapter)
{
  throw std::runtime_error("LegMotionBase::prepareComputation() not implemented.");
}

bool LegMotionBase::needsComputation() const
{
  throw std::runtime_error("LegMotionBase::needsComputation() not implemented.");
}

bool LegMotionBase::compute()
{
  throw std::runtime_error("LegMotionBase::compute() not implemented.");
}

bool LegMotionBase::isComputed() const
{
  throw std::runtime_error("LegMotionBase::isComputed() not implemented.");
}

void LegMotionBase::reset()
{
  throw std::runtime_error("LegMotionBase::reset() not implemented.");
}

double LegMotionBase::getDuration() const
{
  throw std::runtime_error("LegMotionBase::getDuration() not implemented.");
}

bool LegMotionBase::hasSurfaceNormal() const
{
  return (bool)(surfaceNormal_);
}

const Vector& LegMotionBase::getSurfaceNormal() const
{
  if (!hasSurfaceNormal()) throw std::runtime_error("LegMotionBase::getSurfaceNormal(): No surface normal available.");
  else return (*surfaceNormal_);
}

void LegMotionBase::setSurfaceNormal(const Vector& surfaceNormal)
{
  surfaceNormal_.reset(new Vector(surfaceNormal));
}

bool LegMotionBase::isIgnoreContact() const
{
  throw std::runtime_error("LegMotionBase::isIgnoreContact() not implemented.");
}

bool LegMotionBase::isIgnoreForPoseAdaptation() const
{
  throw std::runtime_error("LegMotionBase::isIgnoreForPoseAdaptation() not implemented.");
}

bool LegMotionBase::hasContactAtStart() const
{
  return hasContactAtStart_;
}

std::ostream& operator<< (std::ostream& out, const LegMotionBase& legMotion)
{
  out << "Limb: " << legMotion.getLimb() << std::endl;
  out << "Type: " << legMotion.getType() << std::endl;
  out << "Is computed: " << (legMotion.isComputed() ? "True" : "False") << std::endl;
  out << "Control setup: " << legMotion.getControlSetup() << std::endl;
  out << "Duration: " << legMotion.getDuration() << std::endl;
  switch (legMotion.getType()) {
    case LegMotionBase::Type::Footstep:
      out << (dynamic_cast<const Footstep&>(legMotion));
      break;
    case LegMotionBase::Type::EndEffectorTarget:
      out << (dynamic_cast<const EndEffectorTarget&>(legMotion));
      break;
    case LegMotionBase::Type::EndEffectorTrajectory:
      out << (dynamic_cast<const EndEffectorTrajectory&>(legMotion));
      break;
    case LegMotionBase::Type::LegMode:
      out << (dynamic_cast<const LegMode&>(legMotion));
      break;
    case LegMotionBase::Type::JointTrajectory:
      out << (dynamic_cast<const JointTrajectory&>(legMotion));
      break;
    default:
      throw std::runtime_error("LegMotionBase::operator<< not implemented for this type.");
      break;
  }
  out << "Has contact at start: " << (legMotion.hasContactAtStart() ? "True" : "False") << std::endl;
  out << "Ignores contact: " << (legMotion.isIgnoreContact() ? "True" : "False") << std::endl;
  out << "Ignored for pose adaptation: " << (legMotion.isIgnoreForPoseAdaptation() ? "True" : "False") << std::endl;
  out << "Surface normal: ";
  if (legMotion.hasSurfaceNormal()) {
    out << legMotion.getSurfaceNormal() << std::endl;
  } else {
    out << "None" << std::endl;
  }
  out << std::endl;
  return out;
}

std::ostream& operator<< (std::ostream& out, const LegMotionBase::Type& type)
{
  switch (type) {
    case LegMotionBase::Type::Footstep:
      out << "Footstep";
      return out;
    case LegMotionBase::Type::LegMode:
      out << "LegMode";
      return out;
    case LegMotionBase::Type::EndEffectorTarget:
      out << "EndEffectorTarget";
      return out;
    case LegMotionBase::Type::EndEffectorTrajectory:
      out << "EndEffectorTrajectory";
      return out;
    case LegMotionBase::Type::JointTarget:
      out << "JointTarget";
      return out;
    case LegMotionBase::Type::JointTrajectory:
      out << "JointTrajectory";
      return out;
    default:
      out << "Undefined";
      return out;
  }
}

double LegMotionBase::mapTimeWithinDuration(const double time) const
{
  return time <= getDuration() ? time : getDuration();
}

} /* namespace */


text:
var gulp = require('gulp');
var args = require('yargs').argv;
var browserSync = require('browser-sync');
var bs = browserSync.create();
var config = require('./gulp.config')();
var del = require('del');
var path = require('path');
var nib = require('nib');
var _ = require('lodash');
var $ = require('gulp-load-plugins')({ lazy: true });
var port = process.env.PORT || config.defaultPort;
gulp.task('help', $.taskListing);
gulp.task('default', ['help']);

gulp.task('styles', ['clean-styles'], function () {
    log('Compiling Stylus --> CSS');
    return gulp
        .src(config.stylus)
        .pipe($.plumber())
        .pipe($.stylus({use: nib()}))
        .pipe($.autoprefixer({browsers: ['last 2 version', '> 5%']}))
        .pipe(gulp.dest(config.temp))
        .pipe(bs.stream());
});
gulp.task('git.a', ['fonts'], function () {
  log('adding to git repo');
  return gulp
    .src(config.build)
    .pipe($.plumber())
    .pipe($.git.add())
});
gulp.task('git.c', ['git.a'], function () {
  log('commit');
  return gulp
    .src(config.build)
    .pipe($.plumber())
    .pipe($.git.add())
});
gulp.task("jade", function () {
  log('Compiling Jade to HTML');
  return gulp.src(config.jade)
    .pipe($.plumber())
    .pipe($.newer({ dest: config.scripts, ext: '.html' }))
    .pipe($.jade())
    .pipe(gulp.dest(config.scripts))
});
gulp.task('jade:watch', ['jade'], bs.reload);

gulp.task('fonts', function () {
  log('Copying fonts');
  return gulp
    .src(config.fonts)
    .pipe(gulp.dest(config.build + 'fonts'));
});

gulp.task('images', ['favicon'], function () {
  log('Copying and compressing the images');
  var pngFilter = $.filter(config.images + '/*.jpg', { restore: true });
  return gulp
    .src(config.images)
    .pipe($.imagemin({ optimizationLevel: 6 }))
    .pipe(pngFilter)
    .pipe($.smushit())
    .pipe(pngFilter.restore)
    .pipe(gulp.dest(config.build + 'img'));
});

gulp.task('copy-weird-directories', function () {
  log('copy weird direct');
  var s = 'scripts/common/directives/';

  return gulp
    .src(config.client + s + "*.html")
    .pipe(gulp.dest(config.build + s));
});

gulp.task('favicon', function () {
  log('copy favicon');

  return gulp
    .src(config.client + "favicon.ico")
    .pipe(gulp.dest(config.build));
});

gulp.task('copy-weird-directories2', function () {
  log('copy weird direct');
  var s = 'scripts/common/directives/';

  return gulp
    .src(config.client + "assets/**/*")
    .pipe(gulp.dest(config.build + 'assets'));
});

gulp.task('remove-temp-folders', function (done) {
  var delconfig = [].concat(config.build, config.temp);
  log('Cleaning: ' + $.util.colors.blue(delconfig));
  del(delconfig, done);
});
gulp.task('clean-fonts', function (done) {
  cleaner(config.build + 'fonts/**/*.*', done);
});
gulp.task('clean-images', function (done) {
  cleaner(config.build + 'images/**/*.*', done);
});
gulp.task('clean-styles', function (done) {
  cleaner(config.temp + '**/*.css', done);
});
gulp.task('clean-js-html-from-tmp-folders', function (done) {
  var files = [].concat(
    config.temp + '**/*.js',
    config.build + '**/*.html',
    config.build + 'js/**/*.js'
  );
  cleaner(files, done);
});

gulp.task('stylus-watcher', function () {
  gulp.watch([config.stylus], ['styles']);
});

gulp.task('angular-templatecache', ['clean-js-html-from-tmp-folders'], function () {
  // if (process.env.NODE_ENV === 'dev') {
  //     return;
  // }
  log('Creating AngularJS $templateCache');
  return gulp
    .src(config.htmltemplates)
    .pipe($.minifyHtml({ empty: true }))
    .pipe($.angularTemplatecache(
      config.templateCache.file,
      config.templateCache.options
    ))
    .pipe(gulp.dest(config.temp));
});

gulp.task('wiredep', function () {
  log('Wire up the bower css, js and our app js into the html');
  var options = config.getWiredepDefaultOptions();
  var wiredep = require('wiredep').stream;
  return gulp
    .src(config.index)
    .pipe(wiredep(options))
    .pipe($.inject(gulp.src(config.js)))
    .pipe(gulp.dest(config.client));
});

gulp.task('inject-styles-to-app-index', ['wiredep', 'styles', 'angular-templatecache'], function () {
  log('Wire up the app css into the html, and call wiredep ');
  return gulp
    .src(config.index)
    .pipe($.inject(gulp.src(config.css), { relative: true }))
    .pipe(gulp.dest(config.client));
});

gulp.task('build', ['buildFlow', 'fonts',  'images'], function () {

});

gulp.task('copy assets', function () {
  log('copy assets');

  return gulp
    .src(config.client + "assets/**/*")
    .pipe(gulp.dest(config.build + 'assets'));
});

gulp.task('injectCache', ['inject-styles-to-app-index'], function () {
  var templateCache = config.temp + config.templateCache.file;
  return gulp
    .src(config.index)
    .pipe($.plumber())
    .pipe($.inject(
      gulp.src(templateCache, { read: false }), {
        starttag: '<!-- inject:templates:js -->'
        , relative: true
      }))
    .pipe(gulp.dest(config.client));
});

gulp.task('optimize', ['inject-styles-to-app-index'], function () {
  log('Optimizing the javascript, css, html');
  del(config.build);
  // var assets = $.useref.assets({ searchPath: './app' });
  var cssFilter = $.filter('**/*.css', { restore: true });
  var jsLibFilter = $.filter('**/' + config.optimized.lib, { restore: true });
  var jsAppFilter = $.filter('**/' + config.optimized.app, { restore: true });

  return gulp
    .src(config.index)
    .pipe($.plumber())
    // .pipe(assets)
    .pipe(cssFilter)
    .pipe($.csso())
    .pipe(cssFilter.restore)
    .pipe(jsLibFilter)
    .pipe($.uglify({ mangle: false }))
    .pipe(jsLibFilter.restore)
    .pipe(jsAppFilter)
    .pipe($.ngAnnotate())
    .pipe($.uglify())
    .pipe($.rev())
    .pipe(jsAppFilter.restore)
    // .pipe(assets.restore())
    .pipe($.useref())
    .pipe($.revReplace())
    .pipe(gulp.dest(config.build))
    .pipe($.rev.manifest())
    .pipe(gulp.dest(config.build));
});

var templateCache = config.temp + config.templateCache.file;

gulp.task('copy-templates-js-to-build-folder', ['optimize'], function () {
  return gulp.src(templateCache)
    .pipe(gulp.dest(config.build));
});

gulp.task('copy-to-build-prep-css', ['injecting-build-index-with-angular-templates'], function () {
  return gulp.src(config.temp + "/**/*.css")
    .pipe($.minifyCss({ compatibility: 'ie8' }))
    .pipe(gulp.dest(config.build));
});

gulp.task('injecting-build-index-with-angular-templates', ['copy-templates-js-to-build-folder'], function () {
  return gulp
    .src(config.build + 'index.html')
    .pipe($.inject(gulp.src(config.build + config.templateCache.file, { read: false }), {
      starttag: '<!-- inject:templates:js -->',
      relative: true
    }))
    .pipe(gulp.dest(config.build));
});

gulp.task('buildFlow', ['copy-to-build-prep-css'], function () {
  log('Building everything');
  var msg = { title: 'gulp build',
    subtitle: 'Deployed to the build folder',
    message: 'Running `gulp serve-build`'
  };
  //del(config.temp);
  log(msg);
  notify(msg);

  return gulp
    .src(config.build + 'index.html')
    .pipe($.inject(gulp.src(config.build + "main.css"), {
      starttag: '<!-- inject:css -->',
      relative: true
    }))
    .pipe($.minifyHtml())
    .pipe(gulp.dest(config.build));
})
/**
 * Bump the version
 * --type=pre will bump the prerelease version *.*.*-x
 * --type=patch or no flag will bump the patch version *.*.x
 * --type=minor will bump the minor version *.x.*
 * --type=major will bump the major version x.*.*
 * --version=1.2.3 will bump to a specific version and ignore other flags
 */
gulp.task('bump', function () {
  var msg = 'Bumping versions';
  var type = args.type;
  var version = args.version;
  var options = {};
  if (version) {
    options.version = version;
    msg += ' to ' + version;
  } else {
    options.type = type;
    msg += ' for a ' + type;
  }
  log(msg);
  return gulp
    .src(config.packages)
    .pipe($.print())
    .pipe($.bump(options))
    .pipe(gulp.dest(config.root));
});

gulp.task('serve-build', ['build'], function () {
  serve(false /* isDev */);
  gulp.run('git.c');
});
gulp.task('serve-dev', ['inject-styles-to-app-index'], function () {
  serve(true /* isDev */);
});
gulp.task('test', ['vet', 'angular-templatecache'], function (done) {
  startTests(true /* singleRun */, done);
});
gulp.task('autotest', ['vet', 'angular-templatecache'], function (done) {
  startTests(false /* singleRun */, done);
});

////////////
function serve(isDev) {
  var nodeOptions = {
    script: config.nodeServer,
    delayTime: 0.5,
    env: {
      'PORT': port,
      'NODE_ENV': isDev ? 'dev' : 'build'
    },
    ext: 'js',
    //ignore:['./app/scripts/**/*.js']
    watch: ['./routes']
  };
  return $.nodemon(nodeOptions)
    .on('restart', function (ev) {
      log('*** nodemon restarted');
      log('files changed on restart:\n' + ev);
      setTimeout(function () {
        browserSync.notify('reloading now ...');
        browserSync.reload({ stream: false });
      }, config.browserReloadDelay);
    })
    .on('start', function () {
      log('*** nodemon started');
      startBrowserSync(isDev);
    })
    .on('crash', function () {
      log('*** nodemon crashed: script crashed for some reason');
    })
    .on('exit', function () {
      log('*** nodemon exited cleanly');
    });
}

function changeEvent(event) {
  var srcPattern = new RegExp('/.*(?=/' + config.source + ')/');
  log('File ' + event.path.replace(srcPattern, '') + ' ' + event.type);
}

function notify(options) {
  var notifier = require('node-notifier');
  var notifyOptions = {
    sound: 'Bottle',
    contentImage: path.join(__dirname, 'gulp.png'),
    icon: path.join(__dirname, 'gulp.png')
  };
  _.assign(notifyOptions, options);
  notifier.notify(notifyOptions);
}

function startBrowserSync(isDev) {
  if (args.nosync || browserSync.active) {
    return;
  }
  log('Starting browser-sync on port ' + port);
  if (isDev) {
    gulp.watch([config.stylusAll], ['styles'])
      .on('change', function (event) {
        changeEvent(event);
        browserSync.reload();
      });
    gulp.watch([config.jade], ['jade:watch'])
      .on('change', function (event) {
        console.log('reload hererer');
        browserSync.reload();
      });
    gulp.watch([config.js], bs.reload);
  } else {
    gulp.watch([config.stylus, config.js, config.html], ['optimize', browserSync.reload])
      .on('change', function (event) {
        changeEvent(event);
      });
  }
  var options = {
    proxy: 'localhost:' + port,
    port: 3000,
    files: isDev ? [
      config.client + 'scripts/**/*.js',
      config.client + 'scripts/**/*.jade',
      config.root + 'views/*.jade',
      config.client + '*.html',
      '!' + config.stylus,
      config.temp + '**/*.css'
    ] : [],
    ghostMode: false,
    injectChanges: true,
    logFileChanges: true,
    logLevel: 'debug',
    notify: false,
    reloadDelay: 100 //1000
  };
  browserSync(options);
}

function cleaner(path, done) {
  log('Cleaning: ' + $.util.colors.blue(path));
  del(path, done);
}

function log(msg) {
  if (typeof(msg) === 'object') {
    for ( var item in msg ) {
      if (msg.hasOwnProperty(item)) {
        $.util.log($.util.colors.blue(msg[item]));
      }
    }
  } else {
    $.util.log($.util.colors.blue(msg));
  }
}


text:
div {
    width: 400px;
    height: 200px;
    border: 4px dashed red;
    margin:  20px auto;
    box-sizing: border-box;

}

.a{
    background-image: url("../img/op1.jpg");
    background-size: cover;
    background-repeat: no-repeat;
    border-radius: 10%;
    border: 4px outset darkgoldenrod;
    box-sizing: border-box;
}

[src]{
    border: 10px groove black;
}
[contenteditable]{
    width: 500px;
    height: 300px;
    border: 4px dashed blue;
    }
a:link{
    color: red;
}
a:visited{
    color: yellow;
}
a:hover{
    color: black;
}
a:active{
    color: springgreen;
}


text:
import React from 'react';
import { Route, IndexRoute } from 'react-router';
import About from '../containers/About';
import App from '../containers/App';
import Home from '../containers/Home';

/**
 * The React routes for both the server and the client.
 */
export default (
    <Route path="/" component={ App }>
        <IndexRoute component={ Home } />
        <Route path="about" component={ About } />
    </Route>
)


text:
from __future__ import unicode_literals
from django.contrib import admin

from symposion.schedule.models import (
    Schedule,
    Day,
    Room,
    SlotKind,
    Slot,
    SlotRoom,
    Presentation,
)

class DayInline(admin.StackedInline):
    model = Day
    extra = 2

class SlotKindInline(admin.StackedInline):
    model = SlotKind

class ScheduleAdmin(admin.ModelAdmin):
    model = Schedule
    inlines = [DayInline, SlotKindInline]

class SlotRoomInline(admin.TabularInline):
    model = SlotRoom
    extra = 1

class SlotAdmin(admin.ModelAdmin):
    list_filter = ("day", "kind")
    list_display = [
        "day",
        "start",
        "end",
        "kind",
        "rooms_display",
        "content_override",
    ]
    inlines = [SlotRoomInline]

class RoomAdmin(admin.ModelAdmin):
    list_display = ["name", "order", "schedule"]
    list_filter = ["schedule"]
    ordering = ["order"]

class PresentationAdmin(admin.ModelAdmin):
    model = Presentation
    list_display = ("title", "slug", "speaker", "section", "slot")
    list_filter = ["section", "slot__kind", "cancelled"]
    prepopulated_fields = {"slug": ("title",)}
    search_fields = ("title", "speaker__name")

admin.site.register(Day)
admin.site.register(SlotKind, list_display=["label", "schedule"])
admin.site.register(SlotRoom, list_display=["slot", "room"])
admin.site.register(Schedule, ScheduleAdmin)
admin.site.register(Room, RoomAdmin)
admin.site.register(Slot, SlotAdmin)
admin.site.register(Presentation, PresentationAdmin)


text:
namespace bsoncxx {
BSONCXX_INLINE_NAMESPACE_BEGIN
namespace document {

///
/// A read-only, non-owning view of a BSON document.
///
class BSONCXX_API view {
   public:
    class BSONCXX_API const_iterator;
    using iterator = const_iterator;

    ///
    /// Default constructs a view. The resulting view will be initialized to point at
    /// an empty BSON document.
    ///
    view();

    ///
    /// Constructs a view from a buffer. The caller is responsible for ensuring that
    /// the lifetime of the resulting view is a subset of the buffer's.
    ///
    /// @param data
    ///   A buffer containing a valid BSON document.
    /// @param length
    ///   The size of the buffer, in bytes.
    ///
    view(const std::uint8_t* data, std::size_t length);

    ///
    /// @returns A const_iterator to the first element of the document.
    ///
    const_iterator cbegin() const;

    ///
    /// @returns A const_iterator to the past-the-end element of the document.
    ///
    const_iterator cend() const;

    ///
    /// @returns A const_iterator to the first element of the document.
    ///
    const_iterator begin() const;

    ///
    /// @returns A const_iterator to the past-the-end element of the document.
    ///
    const_iterator end() const;

    ///
    /// Finds the first element of the document with the provided key. If there is
    /// no such element, the past-the-end iterator will be returned. The runtime of
    /// find() is linear in the length of the document. This method only searches
    /// the top-level document, and will not recurse to any subdocuments.
    ///
    /// @remark In BSON, keys are not required to be unique. If there are multiple
    /// elements with a matching key in the document, the first matching element from
    /// the start will be returned.
    ///
    /// @param key
    ///   The key to search for.
    ///
    /// @return An iterator to the matching element, if found, or the past-the-end iterator.
    ///
    const_iterator find(stdx::string_view key) const;

    ///
    /// Finds the first element of the document with the provided key. If there is no
    /// such element, the invalid document::element will be returned. The runtime of operator[]
    /// is linear in the length of the document.
    ///
    /// @param key
    ///   The key to search for.
    ///
    /// @return The matching element, if found, or the invalid element.
    ///
    element operator[](stdx::string_view key) const;

    ///
    /// Access the raw bytes of the underlying document.
    ///
    /// @return A (non-owning) pointer to the view's buffer.
    ///
    const std::uint8_t* data() const;

    ///
    /// Gets the length of the underlying buffer.
    ///
    /// @remark This is not the number of elements in the document.
    /// To compute the number of elements, use std::distance.
    ///
    /// @return The length of the document, in bytes.
    ///
    std::size_t length() const;

    ///
    /// Checks if the underlying document is empty, i.e. it is equivalent to
    /// the trivial document '{}'.
    ///
    /// @return true if the underlying document is empty.
    ///
    bool empty() const;

    ///
    /// @{
    ///
    /// Compare two document views for (in)-equality
    ///
    /// @relates view
    ///
    friend BSONCXX_API bool BSONCXX_CALL operator==(view, view);
    friend BSONCXX_API bool BSONCXX_CALL operator!=(view, view);
    ///
    /// @}
    ///

   private:
    const std::uint8_t* _data;
    std::size_t _length;
};

///
/// A const iterator over the contents of a document view.
///
/// This iterator type provides a const forward iterator interface to document
/// view elements.
///
class BSONCXX_API view::const_iterator {
   public:
    ///
    /// std::iterator_traits
    ///
    using value_type = element;
    using reference = element&;
    using pointer = element*;
    using iterator_category = std::forward_iterator_tag;
    using difference_type = std::ptrdiff_t;

    const_iterator();
    explicit const_iterator(const element& element);

    reference operator*();
    pointer operator->();

    const_iterator& operator++();
    const_iterator operator++(int);

    ///
    /// @{
    ///
    /// Compares two const_iterators for (in)-equality
    ///
    /// @relates view::const_iterator
    ///
    friend BSONCXX_API bool BSONCXX_CALL operator==(const const_iterator&, const const_iterator&);
    friend BSONCXX_API bool BSONCXX_CALL operator!=(const const_iterator&, const const_iterator&);
    ///
    /// @}
    ///

   private:
    element _element;
};

}  // namespace document
BSONCXX_INLINE_NAMESPACE_END
}  // namespace bsoncxx

#include <bsoncxx/config/postlude.hpp>


text:
Queries the PANW Autofocus Threat Intelligence System. This sub-playbook is the same as the generic polling sub-playbook besides that it provides outputs in the playbook. The reason for that is that in Autofocus its impossible to query the results of the same query more than once so the outputs have to be in the polling context.

This playbook implements polling by continuously running the command in Step #2 until the operation completes.
The remote action should have the following structure:

1. Initiate the operation.
2. Poll to check if the operation completed.
3. (optional) Get the results of the operation.

## Dependencies
This playbook uses the following sub-playbooks, integrations, and scripts.

## Sub-playbooks
This playbook does not use any sub-playbooks.

## Integrations
This playbook does not use any integrations.

## Scripts
* PrintErrorEntry
* RunPollingCommand
* ScheduleGenericPolling

## Commands
This playbook does not use any commands.

## Playbook Inputs
---

| **Name** | **Description** | **Default Value** | **Required** |
| --- | --- | --- | --- |
| Ids | The list of IDs to poll. | - | Required |
| PollingCommandName | The name of the polling command to run. | - | Required |
| PollingCommandArgName | The argument name of the polling command. | ids | Required |
| Interval | The frequency that the polling command will run (in minutes). | 1 | Required |
| Timeout | The amount of time to poll before declaring a timeout and resuming the playbook (in minutes). | 10 | Required |
| dt | The DT filter for polling IDs. Polling will stop when no results are returned. Use single quotes. For example, `WildFire.Report(val.Status!==''Success'').SHA256`. | - |Required |
| AdditionalPollingCommandArgNames | The Names of additional arguments for the polling command. For example, "arg1,arg2,...". | - | Optional |
| AdditionalPollingCommandArgValues | The values of the additional arguments for the polling command. For example, "value1,value2,...". | - | Optional |

## Playbook Outputs
---

| **Path** | **Description** | **Type** |
| --- | --- | --- |
| AutoFocus.SessionsResults | The results of Autofocus sessions search. | string |
| AutoFocus.SamplesResults | The results of Autofocus sample search. | string |
| AutoFocus.TopTagResults | The results of Autofocus tags search. | string |

<!-- Playbook PNG image comes here -->
## Playbook Image
---
![AutoFocusPolling](https://github.com/demisto/content/raw/cc9fb76a907ec5e86d6cdac7a8820d1828c52e02/Packs/AutoFocus/doc_files/AutoFocusPolling.png)


text:
<title>
Backroom deals to set up a war on Iraq
</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<?php include "../../legacy-includes/Script.htmlf" ?>

<?php include "../../legacy-includes/TopLogo.htmlf" ?>

<?php include "../../legacy-includes/TopAd.htmlf" ?>

<?php include "../../legacy-includes/LeftButtons.htmlf" ?>

<?php include "../../legacy-includes/BodyInsert.htmlf" ?>

WHICH SIDE ARE YOU ON?

Backroom deals to set up a war on Iraq

By Sharon Smith | September 13, 2002 | Page 7

AS BUSH administration officials took to the airwaves on the Sunday morning talk shows last weekend to make the case for war on Iraq, there was a seeming role reversal.

Vice President Dick Cheney--previously adamant on the U.S. government's right to "go it alone" in a war against Iraq--said on Meet the Press that the U.S. is "trying very hard not to be unilateralist."

Meanwhile, on Fox News Sunday, Secretary of State Colin Powell--who insisted in recent weeks on the need for United Nations (UN) backing for war--was sending a different message. "The president will retain all of his authority and options to act in a way that may be appropriate for us to act unilaterally to defend ourselves," Powell said.

These statements are evidence that members of the Bush administration are not nearly as divided as they have appeared to be over war in Iraq. The entire administration has been unified on the U.S.'s key war aims since the start of the "war on terrorism."

Bush used the September 11 attacks as an excuse to launch an open-ended war aimed at furthering the ability of the U.S., as the world's sole superpower, to intervene militarily anywhere in the world to defend its interests. There are two components to this overarching goal--first, establishing the U.S.'s right to "go it alone" against its enemies; second, its right to launch "pre-emptive" wars for "regime change."

The debate between the unilateralists and multilateralists in the Bush administration developed in recent weeks as it became increasingly clear that the U.S. would need to sacrifice its first goal in order to achieve the second in the case of Iraq.

Over the summer, as the international outcry against war on Iraq grew, domestic support for the war also plummeted. An ABC News poll on August 29 showed just 56 percent of people in favor--down from 78 percent last November--of U.S. military action against Iraq to force Saddam Hussein from power.

Support for war on Iraq rises to 65 percent if the U.S. launches a multilateral war (the figure for Europeans rises to 60 percent), according to a survey commissioned by the Chicago Council on Foreign Relations and the German Marshall Fund.

This explains the Bush administration's new willingness to garner international support. But war is no less likely than it was before--and when it starts, it will be no more justified, even with the blessing of the UN.

After all, the UN endorsed the 1991 Gulf War--seven weeks of carpet-bombing that killed between 100,000 and 200,000 Iraqis. The UN has also backed 12 years of murderous sanctions on Iraq that have killed well over 1 million civilians, half of them children under the age of 5.

Today, behind all the rhetoric about Iraq's "weapons of mass destruction" emanating from both sides of the Atlantic, backroom deals are being struck to satisfy the real interests of the global powers.

When Bush and Blair met at Camp David last weekend, the focus was on "how to craft a Security Council resolution that will allow the Chinese to abstain and that will secure acquiescence, if not the backing, of the Russians and the French," according to Financial Times columnist Philip Stephens.

Meanwhile, "U.S. diplomats--diligently laying down groundwork for war--are brandishing carrots and sticks at numerous countries," wrote left-wing syndicated columnist Norman Solomon.

The U.S. is sweetening the pot with assurances to Russia and France that their business interests in Iraq--including lucrative contracts now frozen because of UN sanctions--will be strengthened under a post-Saddam government. As Dmitry Trenin, of the Carnegie Moscow Center, predicted, Russia "will not cast a veto [at the UN] because…that would mean restarting a confrontation with the U.S."

Newsweek columnist Fareed Zakaria laid out the case for UN backing as nothing more than an exercise in public relations. "Even if the inspections do not produce the perfect crisis," Zakaria wrote, "Washington will still be better off for having tried because it would be seen to have made every effort to avoid war."

<?php include "../../legacy-includes/BottomNavLinks.htmlf" ?>

<?php include "../../legacy-includes/RightAdFolder.htmlf" ?>


text:
#region copyright
// <copyright file="HttpHelper.cs" >
// Copyright (c) 2016 All Rights Reserved
// Licensed under MIT
// </copyright>
// <author>Raj Bandi</author>
// <date>26/6/2016</date>
// <summary></summary>
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace RiseSharp.Core.Helpers
{
   public static class HttpHelper
    {

    }
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">

    <title>Backup a Raspberry Pi | www.keithwechsler.com</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
    <meta name="description" content="I've started using a Raspberry Pi 3 to learn some new technologies.  I want to be able to backup the files from the SD card used by the system because I don't want to lose the configure and startup fi">
<meta name="keywords" content="Raspberry Pi">
<meta property="og:type" content="article">
<meta property="og:title" content="Backup a Raspberry Pi">
<meta property="og:url" content="http://www.keithwechsler.com/2018/01/06/Backup-A-Raspberry_Pi/index.html">
<meta property="og:site_name" content="www.keithwechsler.com">
<meta property="og:description" content="I've started using a Raspberry Pi 3 to learn some new technologies.  I want to be able to backup the files from the SD card used by the system because I don't want to lose the configure and startup fi">
<meta property="og:locale" content="en">
<meta property="og:image" content="http://www.keithwechsler.com/images/RaspberryPi/diskutil.png">
<meta property="og:image" content="http://www.keithwechsler.com/images/RaspberryPi/file-before-zip.png">
<meta property="og:image" content="http://www.keithwechsler.com/images/RaspberryPi/file-after-zip.png">
<meta property="og:updated_time" content="2018-01-06T19:05:16.358Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Backup a Raspberry Pi">
<meta name="twitter:description" content="I've started using a Raspberry Pi 3 to learn some new technologies.  I want to be able to backup the files from the SD card used by the system because I don't want to lose the configure and startup fi">
<meta name="twitter:image" content="http://www.keithwechsler.com/images/RaspberryPi/diskutil.png">
<meta name="twitter:creator" content="@uk1fan">
<link rel="publisher" href="KeithWechsler">

        <link rel="alternate" type="application/atom+xml" title="www.keithwechsler.com" href="/atom.xml" />

    <link rel="stylesheet" href="/libs/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="/libs/open-sans/styles.css">
    <link rel="stylesheet" href="/libs/source-code-pro/styles.css">

    <link rel="stylesheet" href="/css/style.css">

        <link rel="stylesheet" href="/libs/lightgallery/css/lightgallery.min.css">

        <link rel="stylesheet" href="/libs/justified-gallery/justifiedGallery.min.css">

        <meta name="google-site-verification" content="google7a3eefcf79d423b5.html" />

                www.keithwechsler.com

                    Home

                    Archives

                    Categories

                    Tags

                    About

    <form class="search-form">
        <input type="text" class="ins-search-input search-form-input" placeholder="Search" />
        <button type="submit" class="search-form-submit"></button>
    </form>

            <input type="text" class="ins-search-input" placeholder="Type something..." />

                    Home

                    Archives

                    Categories

                    Tags

                    About

        <input type="text" class="ins-search-input search-form-input" placeholder="Search" />

Keith Wechsler

Sr. Software Engineer

            Ashland, KY USA
            FOLLOW

                11
                posts

                5
                tags

            Backup a Raspberry Pi

            <time datetime="2018-01-06T15:45:00.000Z" itemprop="datePublished">2018-01-06</time>

        Utilites

        Raspberry Pi

I've started using a Raspberry Pi 3 to learn some new technologies.  I want to be able to backup the files from the SD card used by the system because I don't want to lose the configure and startup files and have to start from scratch if something goes awry.

The easiest process that I found was to load the SD card into my MacBook, which has a SD slot, and just copy the image.  After inserting the card, you need to determine the name of the drive to be backed up.  From a bash prompt, use the diskutil utility to list the drives in your machine.

diskutil command

1

diskutil list

From these results, you can see that 16 GB Linux disk is disk2.  You feed this value into the dd command and use the rdisk (raw disk) to speed up the operation:

dd

1

sudo dd if=/dev/rdisk2 of=raspbian.stretch.setup bs=1m

This will create the file raspbian.stretch.setup in the current directory:

To reduce the size of the backup, you can use the zip command to compress the file.

zip

1

zip -r stretch.setup raspbian.stretch.setup

You can see that the filesize has been deflated 86% from 16 GB to 2 GB.  The next step in the process would be to delete the original file.

I plan to try and write a Python script to automate this process.  Maybe you'll see a blog post on that process if I do.

    Share

        Comments

            Newer

                    Raspberry Pi - Access to the Filesystem

            Older

JavaScript30

        Please enable JavaScript to view the comments powered by Disqus.

recent

Utilites

Raspberry Pi - Network Tunnel

<time datetime="2018-01-09T00:00:00.000Z" itemprop="datePublished">2018-01-08</time>

Utilites

Raspberry Pi - Access to the Filesystem

<time datetime="2018-01-07T20:00:00.000Z" itemprop="datePublished">2018-01-07</time>

Utilites

Backup a Raspberry Pi

<time datetime="2018-01-06T15:45:00.000Z" itemprop="datePublished">2018-01-06</time>

Internet

JavaScript30

<time datetime="2016-12-09T04:02:06.000Z" itemprop="datePublished">2016-12-08</time>

Internet

Hosting a Static Site on Github

<time datetime="2016-12-07T04:40:17.000Z" itemprop="datePublished">2016-12-06</time>

categories

Electronics1

Internet6

Office1

Utilites3

tags

Gadget1

Raspberry Pi4

Site1

Web1

Web Development4

tag cloud

            Gadget Raspberry Pi Site Web Web Development

archives

January 20183

December 20163

March 20162

February 20161

December 20151

November 20151

            © 2018 Keith Wechsler

            Powered by Hexo. Theme by PPOffice


text:
// Copyright (C) 2009 The Android Open Source Project
//
// 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.

package com.google.gerrit.launcher;

import static java.util.concurrent.TimeUnit.DAYS;
import static java.util.concurrent.TimeUnit.MILLISECONDS;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.net.JarURLConnection;
import java.net.URL;
import java.net.URLClassLoader;
import java.security.CodeSource;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.List;
import java.util.SortedMap;
import java.util.TreeMap;
import java.util.jar.Attributes;
import java.util.jar.JarFile;
import java.util.jar.Manifest;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;

/** Main class for a JAR file to run code from "WEB-INF/lib". */
public final class GerritLauncher {
  private static final String pkg = "com.google.gerrit.pgm";
  public static final String NOT_ARCHIVED = "NOT_ARCHIVED";

  public static void main(final String argv[]) throws Exception {
    System.exit(mainImpl(argv));
  }

  private static int mainImpl(final String argv[]) throws Exception {
    if (argv.length == 0) {
      File me;
      try {
        me = getDistributionArchive();
      } catch (FileNotFoundException e) {
        me = null;
      }

      String jar = me != null ? me.getName() : "gerrit.war";
      System.err.println("Gerrit Code Review " + getVersion(me));
      System.err.println("usage: java -jar " + jar + " command [ARG ...]");
      System.err.println();
      System.err.println("The most commonly used commands are:");
      System.err.println("  init           Initialize a Gerrit installation");
      System.err.println("  daemon         Run the Gerrit network daemons");
      System.err.println("  gsql           Run the interactive query console");
      System.err.println("  version        Display the build version number");
      System.err.println();
      System.err.println("  ls             List files available for cat");
      System.err.println("  cat FILE       Display a file from the archive");
      System.err.println();
      return 1;
    }

    // Special cases, a few global options actually are programs.
    //
    if ("-v".equals(argv[0]) || "--version".equals(argv[0])) {
      argv[0] = "version";
    } else if ("-p".equals(argv[0]) || "--cat".equals(argv[0])) {
      argv[0] = "cat";
    } else if ("-l".equals(argv[0]) || "--ls".equals(argv[0])) {
      argv[0] = "ls";
    }

    // Run the application class
    //
    final ClassLoader cl = libClassLoader();
    Thread.currentThread().setContextClassLoader(cl);
    return invokeProgram(cl, argv);
  }

  private static String getVersion(final File me) {
    if (me == null) {
      return "";
    }

    try {
      final JarFile jar = new JarFile(me);
      try {
        Manifest mf = jar.getManifest();
        Attributes att = mf.getMainAttributes();
        String val = att.getValue(Attributes.Name.IMPLEMENTATION_VERSION);
        return val != null ? val : "";
      } finally {
        jar.close();
      }
    } catch (IOException e) {
      return "";
    }
  }

  private static int invokeProgram(final ClassLoader loader,
      final String[] origArgv) throws Exception {
    String name = origArgv[0];
    final String[] argv = new String[origArgv.length - 1];
    System.arraycopy(origArgv, 1, argv, 0, argv.length);

    Class<?> clazz;
    try {
      try {
        String cn = name;
        if (cn.equals(cn.toLowerCase())) {
          StringBuilder buf = new StringBuilder();
          buf.append(Character.toUpperCase(cn.charAt(0)));
          for (int i = 1; i < cn.length(); i++) {
            if (cn.charAt(i) == '-' && i + 1 < cn.length()) {
              i++;
              buf.append(Character.toUpperCase(cn.charAt(i)));
            } else {
              buf.append(cn.charAt(i));
            }
          }
          cn = buf.toString();
        }
        clazz = Class.forName(pkg + "." + cn, true, loader);
      } catch (ClassNotFoundException cnfe) {
        if (name.equals(name.toLowerCase())) {
          clazz = Class.forName(pkg + "." + name, true, loader);
        } else {
          throw cnfe;
        }
      }
    } catch (ClassNotFoundException cnfe) {
      System.err.println("fatal: unknown command " + name);
      System.err.println("      (no " + pkg + "." + name + ")");
      return 1;
    }

    final Method main;
    try {
      main = clazz.getMethod("main", argv.getClass());
    } catch (SecurityException e) {
      System.err.println("fatal: unknown command " + name);
      return 1;
    } catch (NoSuchMethodException e) {
      System.err.println("fatal: unknown command " + name);
      return 1;
    }

    final Object res;
    try {
      if ((main.getModifiers() & Modifier.STATIC) == Modifier.STATIC) {
        res = main.invoke(null, new Object[] {argv});
      } else {
        res = main.invoke(clazz.newInstance(), new Object[] {argv});
      }
    } catch (InvocationTargetException ite) {
      if (ite.getCause() instanceof Exception) {
        throw (Exception) ite.getCause();
      } else if (ite.getCause() instanceof Error) {
        throw (Error) ite.getCause();
      } else {
        throw ite;
      }
    }
    if (res instanceof Number) {
      return ((Number) res).intValue();
    } else {
      return 0;
    }
  }

  private static ClassLoader libClassLoader() throws IOException {
    final File path;
    try {
      path = getDistributionArchive();
    } catch (FileNotFoundException e) {
      if (NOT_ARCHIVED == e.getMessage()) {
        // Assume the CLASSPATH was made complete by the calling process,
        // as we are likely being run from within a developer's IDE.
        //
        return GerritLauncher.class.getClassLoader();
      }
      throw e;
    }

    final SortedMap<String, URL> jars = new TreeMap<String, URL>();
    try {
      final ZipFile zf = new ZipFile(path);
      try {
        final Enumeration<? extends ZipEntry> e = zf.entries();
        while (e.hasMoreElements()) {
          final ZipEntry ze = e.nextElement();
          if (ze.isDirectory()) {
            continue;
          } else if (ze.getName().startsWith("WEB-INF/lib/")) {
            extractJar(zf, ze, jars);
          } else if (ze.getName().startsWith("WEB-INF/pgm-lib/")) {
            extractJar(zf, ze, jars);
          }
        }
      } finally {
        zf.close();
      }
    } catch (IOException e) {
      throw new IOException("Cannot obtain libraries from " + path, e);
    }

    if (jars.isEmpty()) {
      return GerritLauncher.class.getClassLoader();
    }

    // The extension API needs to be its own ClassLoader, along
    // with a few of its dependencies. Try to construct this first.
    List<URL> extapi = new ArrayList<URL>();
    move(jars, "gerrit-extension-api-", extapi);
    move(jars, "guice-", extapi);
    move(jars, "javax.inject-1.jar", extapi);
    move(jars, "aopalliance-1.0.jar", extapi);
    move(jars, "guice-servlet-", extapi);
    move(jars, "tomcat-servlet-api-", extapi);

    ClassLoader parent = ClassLoader.getSystemClassLoader();
    if (!extapi.isEmpty()) {
      parent = new URLClassLoader(
          extapi.toArray(new URL[extapi.size()]),
          parent);
    }
    return new URLClassLoader(
        jars.values().toArray(new URL[jars.size()]),
        parent);
  }

  private static void extractJar(ZipFile zf, ZipEntry ze,
      SortedMap<String, URL> jars) throws IOException {
    File tmp = createTempFile(safeName(ze), ".jar");
    FileOutputStream out = new FileOutputStream(tmp);
    try {
      InputStream in = zf.getInputStream(ze);
      try {
        byte[] buf = new byte[4096];
        int n;
        while ((n = in.read(buf, 0, buf.length)) > 0) {
          out.write(buf, 0, n);
        }
      } finally {
        in.close();
      }
    } finally {
      out.close();
    }

    String name = ze.getName();
    jars.put(
        name.substring(name.lastIndexOf('/'), name.length()),
        tmp.toURI().toURL());
  }

  private static void move(SortedMap<String, URL> jars,
      String prefix,
      List<URL> extapi) {
    SortedMap<String, URL> matches = jars.tailMap(prefix);
    if (!matches.isEmpty()) {
      String first = matches.firstKey();
      if (first.startsWith(prefix)) {
        extapi.add(jars.remove(first));
      }
    }
  }

  private static String safeName(final ZipEntry ze) {
    // Try to derive the name of the temporary file so it
    // doesn't completely suck. Best if we can make it
    // match the name it was in the archive.
    //
    String name = ze.getName();
    if (0 <= name.lastIndexOf('/')) {
      name = name.substring(name.lastIndexOf('/') + 1);
    }
    if (0 <= name.lastIndexOf('.')) {
      name = name.substring(0, name.lastIndexOf('.'));
    }
    if (name.isEmpty()) {
      name = "code";
    }
    return name;
  }

  private static File myArchive;

  /**
   * Locate the JAR/WAR file we were launched from.
   *
   * @return local path of the Gerrit WAR file.
   * @throws FileNotFoundException if the code cannot guess the location.
   */
  public static File getDistributionArchive() throws FileNotFoundException {
    if (myArchive == null) {
      myArchive = locateMyArchive();
    }
    return myArchive;
  }

  private static File locateMyArchive() throws FileNotFoundException {
    final ClassLoader myCL = GerritLauncher.class.getClassLoader();
    final String myName =
        GerritLauncher.class.getName().replace('.', '/') + ".class";

    final URL myClazz = myCL.getResource(myName);
    if (myClazz == null) {
      throw new FileNotFoundException("Cannot find JAR: no " + myName);
    }

    // ZipFile may have the path of our JAR hiding within itself.
    //
    try {
      Field nameField = ZipFile.class.getDeclaredField("name");
      nameField.setAccessible(true);

      JarFile jar = ((JarURLConnection) myClazz.openConnection()).getJarFile();
      File path = new File((String) nameField.get(jar));
      if (path.isFile()) {
        return path;
      }
    } catch (Exception e) {
      // Nope, that didn't work. Try a different method.
      //
    }

    // Maybe this is a local class file, running under a debugger?
    //
    if ("file".equals(myClazz.getProtocol())) {
      final File path = new File(myClazz.getPath());
      if (path.isFile() && path.getParentFile().isDirectory()) {
        throw new FileNotFoundException(NOT_ARCHIVED);
      }
    }

    // The CodeSource might be able to give us the source as a stream.
    // If so, copy it to a local file so we have random access to it.
    //
    final CodeSource src =
        GerritLauncher.class.getProtectionDomain().getCodeSource();
    if (src != null) {
      try {
        final InputStream in = src.getLocation().openStream();
        try {
          final File tmp = createTempFile("gerrit_", ".zip");
          final FileOutputStream out = new FileOutputStream(tmp);
          try {
            final byte[] buf = new byte[4096];
            int n;
            while ((n = in.read(buf, 0, buf.length)) > 0) {
              out.write(buf, 0, n);
            }
          } finally {
            out.close();
          }
          return tmp;
        } finally {
          in.close();
        }
      } catch (IOException e) {
        // Nope, that didn't work.
        //
      }
    }

    throw new FileNotFoundException("Cannot find local copy of JAR");
  }

  private static boolean temporaryDirectoryFound;
  private static File temporaryDirectory;

  /**
   * Creates a temporary file within the application's unpack location.
   *

   * The launcher unpacks the nested JAR files into a temporary directory,
   * allowing the classes to be loaded from local disk with standard Java APIs.
   * This method constructs a new temporary file in the same directory.
   *

   * The method first tries to create {@code prefix + suffix} within the
   * directory under the assumption that a given {@code prefix + suffix}
   * combination is made at most once per JVM execution. If this fails (e.g. the
   * named file already exists) a mangled unique name is used and returned
   * instead, with the unique string appearing between the prefix and suffix.
   *

   * Files created by this method will be automatically deleted by the JVM when
   * it terminates. If the returned file is converted into a directory by the
   * caller, the caller must arrange for the contents to be deleted before the
   * directory is.
   *

   * If supported by the underlying operating system, the temporary directory
   * which contains these temporary files is accessible only by the user running
   * the JVM.
   *
   * @param prefix prefix of the file name.
   * @param suffix suffix of the file name.
   * @return the path of the temporary file. The returned object exists in the
   *         filesystem as a file; caller may need to delete and recreate as a
   *         directory if a directory was preferred.
   * @throws IOException the file could not be created.
   */
  public static synchronized File createTempFile(String prefix, String suffix)
      throws IOException {
    if (!temporaryDirectoryFound) {
      final File d = File.createTempFile("gerrit_", "_app", tmproot());
      if (d.delete() && d.mkdir()) {
        // Try to lock the directory down to be accessible by us.
        // We first have to remove all permissions, then add back
        // only the owner permissions.
        //
        d.setWritable(false, false /* all */);
        d.setReadable(false, false /* all */);
        d.setExecutable(false, false /* all */);

        d.setWritable(true, true /* owner only */);
        d.setReadable(true, true /* owner only */);
        d.setExecutable(true, true /* owner only */);

        d.deleteOnExit();
        temporaryDirectory = d;
      }
      temporaryDirectoryFound = true;
    }

    if (temporaryDirectory != null) {
      // If we have a private directory and this name has not yet
      // been used within the private directory, create it as-is.
      //
      final File tmp = new File(temporaryDirectory, prefix + suffix);
      if (tmp.createNewFile()) {
        tmp.deleteOnExit();
        return tmp;
      }
    }

    if (!prefix.endsWith("_")) {
      prefix += "_";
    }

    final File tmp = File.createTempFile(prefix, suffix, temporaryDirectory);
    tmp.deleteOnExit();
    return tmp;
  }

  private static File tmproot() {
    File tmp;
    String gerritTemp = System.getenv("GERRIT_TMP");
    if (gerritTemp != null && gerritTemp.length() > 0) {
      tmp = new File(gerritTemp);
    } else {
      // Try to find the user's home directory. If we can't find it
      // return null so the JVM's default temporary directory is used
      // instead. This is probably /tmp or /var/tmp.
      //
      String userHome = System.getProperty("user.home");
      if (userHome == null || "".equals(userHome)) {
        userHome = System.getenv("HOME");
        if (userHome == null || "".equals(userHome)) {
          System.err.println("warning: cannot determine home directory");
          System.err.println("warning: using system temporary directory instead");
          return null;
        }
      }

      // Ensure the home directory exists. If it doesn't, try to make it.
      //
      final File home = new File(userHome);
      if (!home.exists()) {
        if (home.mkdirs()) {
          System.err.println("warning: created " + home.getAbsolutePath());
        } else {
          System.err.println("warning: " + home.getAbsolutePath() + " not found");
          System.err.println("warning: using system temporary directory instead");
          return null;
        }
      }

      // Use $HOME/.gerritcodereview/tmp for our temporary file area.
      //
      tmp = new File(new File(home, ".gerritcodereview"), "tmp");
    }
    if (!tmp.exists() && !tmp.mkdirs()) {
      System.err.println("warning: cannot create " + tmp.getAbsolutePath());
      System.err.println("warning: using system temporary directory instead");
      return null;
    }

    // Try to clean up any stale empty directories. Assume any empty
    // directory that is older than 7 days is one of these dead ones
    // that we can clean up.
    //
    final File[] tmpEntries = tmp.listFiles();
    if (tmpEntries != null) {
      final long now = System.currentTimeMillis();
      final long expired = now - MILLISECONDS.convert(7, DAYS);
      for (final File tmpEntry : tmpEntries) {
        if (tmpEntry.isDirectory() && tmpEntry.lastModified() < expired) {
          final String[] all = tmpEntry.list();
          if (all == null || all.length == 0) {
            tmpEntry.delete();
          }
        }
      }
    }

    try {
      return tmp.getCanonicalFile();
    } catch (IOException e) {
      return tmp;
    }
  }

  private GerritLauncher() {
  }
}


text:
<!DOCTYPE html>

    <title>Mines Game - Development</title>
    <meta http-equiv="content-type" content="text/html;charset=UTF-8" />

    <link rel="stylesheet" type="text/css" href="http://stcamp.net/examples/demo_pages.css" />

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

        Right Mines

RightJS Based Mines Game - Development

Demo

About

The Right Mines Game

Copyright © 2010 Nikolay V. Nemshilov


text:
'use strict';

// Contents of: test/karma.conf.js
module.exports = function (config) {
  config.set({
    basePath: '',

    files: [
      // libraries
      'bower_components/angular/angular.js',
      'bower_components/angular-mocks/angular-mocks.js',
      'bower_components/d3/d3.js',
      'bower_components/c3/c3.js',

      // the directives
      'src/js/directive.js', // module has to be loaded first
      'src/js/**/*.js',

      // test
      'test/*_spec.js'
    ],

    singleRun: true,

    // Start these browsers, currently available:
    // - Chrome
    // - ChromeCanary
    // - Firefox
    // - Opera
    // - Safari (only Mac)
    // - PhantomJS
    // - IE (only Windows)
    browsers: ['PhantomJS'],

    frameworks: ['jasmine'],

    preprocessors: {
      'src/js/**/*.js': ['coverage']
    },

    plugins: [
      'karma-jasmine',
      'karma-coverage',
      'karma-phantomjs-launcher',
      'karma-firefox-launcher',
      'karma-coveralls'
    ],

    // test results reporter to use
    // possible values: 'dots', 'progress', 'junit'
    reporters: ['progress', 'coverage', 'coveralls'],

    coverageReporter: {
      type: 'lcov', // lcov or lcovonly are required for generating lcov.info files
      dir: 'coverage/'
    }

  });
};


text:
void Application::InitVariables(void)
{
	////Change this to your name and email
	//m_sProgrammer = "Alberto Bobadilla - labigm@rit.edu";

	////Alberto needed this at this position for software recording.
	//m_pWindow->setPosition(sf::Vector2i(710, 0));

	//Set the position and target of the camera
	//(I'm at [0,0,10], looking at [0,0,0] and up is the positive Y axis)
	m_pCameraMngr->SetPositionTargetAndUp(AXIS_Z * 10.0f, ZERO_V3, AXIS_Y);

	//Allocate the memory for the shapes
	m_pCube = new MyMesh();
	m_pCube->GenerateCube(1.0f, C_RED);
	m_pCone = new MyMesh();
	m_pCone->GenerateCone(0.5f, 1.0f, 7, C_ORANGE);
	m_pCylinder = new MyMesh();
	m_pCylinder->GenerateCylinder(0.5f, 1.0f, 7, C_YELLOW);
	m_pTube = new MyMesh();
	m_pTube->GenerateTube(0.5f, 0.35f, 1.0f, 7, C_GREEN);
	m_pSphere = new MyMesh();
	m_pSphere->GenerateSphere(0.5f, 3, C_BLUE);
	m_pTorus = new MyMesh();
	m_pTorus->GenerateTorus(0.5f, 0.30f, 7, 7, C_VIOLET);

	//Make Mesh object
	m_pMesh = new MyMesh();
	int primitive = 0;
	switch (primitive)
	{
	default:
		m_pMesh->GenerateCube(2.0f, C_CYAN);
		break;
	case 1:
		m_pMesh->GenerateCone(1.0f, 2.0f, 10, C_CYAN);
		break;
	case 2:
		m_pMesh->GenerateCylinder(1.0f, 2.0f, 10, C_CYAN);
		break;
	case 3:
		m_pMesh->GenerateTube(1.0f, 0.7f, 1.0f, 10, C_CYAN);
		break;
	case 4:
		m_pMesh->GenerateSphere(1.0f, 5, C_CYAN);
		break;
	case 5:
		m_pMesh->GenerateTorus(1.0f, 0.6f, 10, 10, C_CYAN);
		break;
	}
}
void Application::Update(void)
{
	//Update the system so it knows how much time has passed since the last call
	m_pSystem->Update();

	//Is the arcball active?
	ArcBall();

	//Is the first person camera active?
	CameraRotation();
}
void Application::Display(void)
{
	// Clear the screen
	ClearScreen();

	//Calculate the model, view and projection matrix
	matrix4 m4Projection = m_pCameraMngr->GetProjectionMatrix();
	matrix4 m4View = m_pCameraMngr->GetViewMatrix();
	m_pMesh->Render(m4Projection, m4View, ToMatrix4(m_qArcBall));

	//Get some variable to position and rotate the other shapes out of the origin
	double dAngle = 360.0 / 6.0;
	vector3 v3Position;
	static uint uClock = m_pSystem->GenClock();
	static double dTimer = m_pSystem->GetDeltaTime(uClock);
	dTimer += m_pSystem->GetDeltaTime(uClock);

	//Cube
	v3Position = vector3(glm::sin(glm::radians(dAngle * 0)) * 3.0f, glm::cos(glm::radians(dAngle * 0)) * 3.0f, 0.0f);
	m_pCube->Render(m4Projection, m4View, glm::rotate(glm::translate(v3Position), static_cast<float>(dTimer) * 20.0f, AXIS_X));

	//Cone
	v3Position = vector3(glm::sin(glm::radians(dAngle * 1)) * 3.0f, glm::cos(glm::radians(dAngle * 1)) * 3.0f, 0.0f);
	m_pCone->Render(m4Projection, m4View, glm::rotate(glm::translate(v3Position), static_cast<float>(dTimer) * 20.0f, AXIS_X));

	//Cylinder
	v3Position = vector3(glm::sin(glm::radians(dAngle * 2)) * 3.0f, glm::cos(glm::radians(dAngle * 2)) * 3.0f, 0.0f);
	m_pCylinder->Render(m4Projection, m4View, glm::rotate(glm::translate(v3Position), static_cast<float>(dTimer) * 20.0f, AXIS_X));

	//Tube
	v3Position = vector3(glm::sin(glm::radians(dAngle * 3)) * 3.0f, glm::cos(glm::radians(dAngle * 3)) * 3.0f, 0.0f);
	m_pTube->Render(m4Projection, m4View, glm::rotate(glm::translate(v3Position), static_cast<float>(dTimer) * 20.0f, AXIS_X));

	//Sphere
	v3Position = vector3(glm::sin(glm::radians(dAngle * 4)) * 3.0f, glm::cos(glm::radians(dAngle * 4)) * 3.0f, 0.0f);
	m_pSphere->Render(m4Projection, m4View, glm::rotate(glm::translate(v3Position), static_cast<float>(dTimer) * 20.0f, AXIS_X));

	//Tourus
	v3Position = vector3(glm::sin(glm::radians(dAngle * 5)) * 3.0f, glm::cos(glm::radians(dAngle * 5)) * 3.0f, 0.0f);
	m_pTorus->Render(m4Projection, m4View, glm::rotate(glm::translate(v3Position), static_cast<float>(dTimer) * 20.0f, AXIS_X));

	// draw a skybox
	m_pMeshMngr->AddSkyboxToRenderList();

	//render list call
	m_uRenderCallCount = m_pMeshMngr->Render();

	//clear the render list
	m_pMeshMngr->ClearRenderList();

	//draw gui
	DrawGUI();

	//end the current frame (internally swaps the front and back buffers)
	m_pWindow->display();
}
void Application::Release(void)
{
	SafeDelete(m_pMesh);
	SafeDelete(m_pCube);
	SafeDelete(m_pCone);
	SafeDelete(m_pCylinder);
	SafeDelete(m_pTube);
	SafeDelete(m_pSphere);
	SafeDelete(m_pTorus);

	//release GUI
	ShutdownGUI();
}


text:
* Removing port number from local directory. [#182](https://github.com/motemen/ghq/pull/182) ([gmidorii](https://github.com/gmidorii))

## [v0.12.5](https://github.com/motemen/ghq/compare/v0.12.4...v0.12.5) (2019-05-28)

* refine local cloning path detection [#181](https://github.com/motemen/ghq/pull/181) ([Songmu](https://github.com/Songmu))
* Adjust metafiles [#179](https://github.com/motemen/ghq/pull/179) ([Songmu](https://github.com/Songmu))

## [v0.12.4](https://github.com/motemen/ghq/compare/v0.12.3...v0.12.4) (2019-05-24)

* make archive [#178](https://github.com/motemen/ghq/pull/178) ([Songmu](https://github.com/Songmu))

## [v0.12.3](https://github.com/motemen/ghq/compare/v0.12.2...v0.12.3) (2019-05-16)

* [fix] Ignore files which seems to system hidden file in walking [#176](https://github.com/motemen/ghq/pull/176) ([Songmu](https://github.com/Songmu))
* [fix] Fix the list if symlink is in the same directory [#174](https://github.com/motemen/ghq/pull/174) ([at-grandpa](https://github.com/at-grandpa))
* [refactoring] introduce Songmu/gitconfig [#175](https://github.com/motemen/ghq/pull/175) ([Songmu](https://github.com/Songmu))
* [refactoring] Get ghq.completeUser strictly as a boolean value [#172](https://github.com/motemen/ghq/pull/172) ([Songmu](https://github.com/Songmu))

## [v0.12.2](https://github.com/motemen/ghq/compare/v0.12.1...v0.12.2) (2019-05-12)

* [fix] remove extra / from ref when path has "/" prefix [#167](https://github.com/motemen/ghq/pull/167) ([sakihet](https://github.com/sakihet))
* [fix] refine local cloning path detection [#171](https://github.com/motemen/ghq/pull/171) ([Songmu](https://github.com/Songmu))
* [fix] skip go-import mod in detectGoImport [#170](https://github.com/motemen/ghq/pull/170) ([Songmu](https://github.com/Songmu))
* [fix] even if the GHQ_ROOT directory doesn't exist, don't raise an error [#168](https://github.com/motemen/ghq/pull/168) ([Songmu](https://github.com/Songmu))

## [v0.12.1](https://github.com/motemen/ghq/compare/v0.12.0...v0.12.1) (2019-05-07)

* update deps [#164](https://github.com/motemen/ghq/pull/164) ([Songmu](https://github.com/Songmu))

## [v0.12.0](https://github.com/motemen/ghq/compare/v0.11.2...v0.12.0) (2019-05-07)

* get lock using repoPath to avoid duplicate get on import [#163](https://github.com/motemen/ghq/pull/163) ([Songmu](https://github.com/Songmu))
* separate gitutil package from main and utilize it [#162](https://github.com/motemen/ghq/pull/162) ([Songmu](https://github.com/Songmu))
* support deep directory in GitRepository like 'github.com/motemen/ghq/logger' [#161](https://github.com/motemen/ghq/pull/161) ([Songmu](https://github.com/Songmu))
* Test enhancement [#160](https://github.com/motemen/ghq/pull/160) ([Songmu](https://github.com/Songmu))
* add TestLocalRepository_VCS [#159](https://github.com/motemen/ghq/pull/159) ([Songmu](https://github.com/Songmu))

## [v0.11.2](https://github.com/motemen/ghq/compare/v0.11.1...v0.11.2) (2019-05-06)

* [bugfix] walk up directory when finding VCS of LocalRepository to avaid panics [#158](https://github.com/motemen/ghq/pull/158) ([Songmu](https://github.com/Songmu))
* bzr pull --overwrite same as go get [#157](https://github.com/motemen/ghq/pull/157) ([Songmu](https://github.com/Songmu))

## [v0.11.1](https://github.com/motemen/ghq/compare/v0.11.0...v0.11.1) (2019-05-05)

* [feature] List vcs option [#155](https://github.com/motemen/ghq/pull/155) ([msh5](https://github.com/msh5))
* [testing] add TestDoImport [#156](https://github.com/motemen/ghq/pull/156) ([Songmu](https://github.com/Songmu))
* [fix] fix findVCSBackend and add tests [#154](https://github.com/motemen/ghq/pull/154) ([Songmu](https://github.com/Songmu))
* [fix] Make sure the directory exists with the exact name [#145](https://github.com/motemen/ghq/pull/145) ([knu](https://github.com/knu))
* [bugfix] Fix fossil support [#153](https://github.com/motemen/ghq/pull/153) ([Songmu](https://github.com/Songmu))
* [testing] add TestDoList_query [#152](https://github.com/motemen/ghq/pull/152) ([Songmu](https://github.com/Songmu))
* [testing] add TestRunInDirSilently [#151](https://github.com/motemen/ghq/pull/151) ([Songmu](https://github.com/Songmu))
* [testing] add more tests in TestDoLook [#150](https://github.com/motemen/ghq/pull/150) ([Songmu](https://github.com/Songmu))
* [testing] add TestDoLook [#149](https://github.com/motemen/ghq/pull/149) ([Songmu](https://github.com/Songmu))
* [refactoring] remove NewFakeRunner which not used [#148](https://github.com/motemen/ghq/pull/148) ([Songmu](https://github.com/Songmu))
* [refactoring] Commonize doGet and doImport processing for refactoring [#147](https://github.com/motemen/ghq/pull/147) ([Songmu](https://github.com/Songmu))
* [testing] add test for `ghq root` [#146](https://github.com/motemen/ghq/pull/146) ([Songmu](https://github.com/Songmu))

## [v0.11.0](https://github.com/motemen/ghq/compare/v0.10.2...v0.11.0) (2019-05-01)

* Delete codes for the services turned down (Google Code and JazzHub) [#144](https://github.com/motemen/ghq/pull/144) ([Songmu](https://github.com/Songmu))
* reduce linter warnings [#143](https://github.com/motemen/ghq/pull/143) ([Songmu](https://github.com/Songmu))
* remove ghq.import.<subcommand> feature [#137](https://github.com/motemen/ghq/pull/137) ([Songmu](https://github.com/Songmu))
* Remove gomega [#142](https://github.com/motemen/ghq/pull/142) ([Songmu](https://github.com/Songmu))
* Streamline VCS detection for local repositories [#141](https://github.com/motemen/ghq/pull/141) ([Songmu](https://github.com/Songmu))
* introduce table driven test in TestCommandGet [#140](https://github.com/motemen/ghq/pull/140) ([Songmu](https://github.com/Songmu))
* "bzr" as Bazaar [#139](https://github.com/motemen/ghq/pull/139) ([Songmu](https://github.com/Songmu))
* Support bazaar [#87](https://github.com/motemen/ghq/pull/87) ([shigemk2](https://github.com/shigemk2))
* [experimental] support parallel import by using --parallel option [#136](https://github.com/motemen/ghq/pull/136) ([Songmu](https://github.com/Songmu))
* add -silent option to get and import [#135](https://github.com/motemen/ghq/pull/135) ([Songmu](https://github.com/Songmu))
* Stop exec on unix in the look subcommand in order to share code with windows [#134](https://github.com/motemen/ghq/pull/134) ([Songmu](https://github.com/Songmu))
* [list] accept url as a query [#133](https://github.com/motemen/ghq/pull/133) ([Songmu](https://github.com/Songmu))
* adjust NewURL() [#132](https://github.com/motemen/ghq/pull/132) ([Songmu](https://github.com/Songmu))

## [v0.10.2](https://github.com/motemen/ghq/compare/v0.10.1...v0.10.2) (2019-04-28)

* Fix `ghq root` [#131](https://github.com/motemen/ghq/pull/131) ([knu](https://github.com/knu))

## [v0.10.1](https://github.com/motemen/ghq/compare/v0.10.0...v0.10.1) (2019-04-28)

* Remove panics [#130](https://github.com/motemen/ghq/pull/130) ([Songmu](https://github.com/Songmu))
* generally loggers should output STDERR by default [#129](https://github.com/motemen/ghq/pull/129) ([Songmu](https://github.com/Songmu))
* Care the case if the query contains a hostname in list subcommand [#128](https://github.com/motemen/ghq/pull/128) ([Songmu](https://github.com/Songmu))
* don't panic when the current working directory doesn't exist. [#127](https://github.com/motemen/ghq/pull/127) ([Songmu](https://github.com/Songmu))
* canonicalize root paths to absolute [#126](https://github.com/motemen/ghq/pull/126) ([Songmu](https://github.com/Songmu))
* List symlinks to repos [#125](https://github.com/motemen/ghq/pull/125) ([Songmu](https://github.com/Songmu))
* rename package s/utils/cmdutil/ [#124](https://github.com/motemen/ghq/pull/124) ([Songmu](https://github.com/Songmu))
* separate logger package from utils [#123](https://github.com/motemen/ghq/pull/123) ([Songmu](https://github.com/Songmu))

## [v0.10.0](https://github.com/motemen/ghq/compare/v0.9.0...v0.10.0) (2019-04-27)

* drop mitchellh/go-homedir dependency [#122](https://github.com/motemen/ghq/pull/122) ([Songmu](https://github.com/Songmu))
* introduce Go Modules and adjust releng files [#121](https://github.com/motemen/ghq/pull/121) ([Songmu](https://github.com/Songmu))
* Add a dummy CVS backend to recognize and skip CVS working directories [#115](https://github.com/motemen/ghq/pull/115) ([knu](https://github.com/knu))
* add -l option on get command which immediately look after get [#112](https://github.com/motemen/ghq/pull/112) ([kuboon](https://github.com/kuboon))
* add support for Fossil SCM [#98](https://github.com/motemen/ghq/pull/98) ([motemen](https://github.com/motemen))
* Use parsed username also with ssh for Git [#101](https://github.com/motemen/ghq/pull/101) ([jjv](https://github.com/jjv))
* Add ghq.completeUser config to disable user completion of `ghq get` [#118](https://github.com/motemen/ghq/pull/118) ([k0kubun](https://github.com/k0kubun))
* ghq get --vcs=<vcs> [#72](https://github.com/motemen/ghq/pull/72) ([motemen](https://github.com/motemen))
* warn if executable was not found when RunCommand [#70](https://github.com/motemen/ghq/pull/70) ([motemen](https://github.com/motemen))
* support `meta name="go-import"` to detect Go repository [#120](https://github.com/motemen/ghq/pull/120) ([Songmu](https://github.com/Songmu))
* support refs which start with URL Authority in ghq get [#119](https://github.com/motemen/ghq/pull/119) ([Songmu](https://github.com/Songmu))

## [v0.9.0](https://github.com/motemen/ghq/compare/v0.8.0...v0.9.0) (2018-11-26)

* Use new constructor for logger [#104](https://github.com/motemen/ghq/pull/104) ([raviqqe](https://github.com/raviqqe))
* fix typo direcotry -> directory [#93](https://github.com/motemen/ghq/pull/93) ([naofumi-fujii](https://github.com/naofumi-fujii))

## [v0.8.0](https://github.com/motemen/ghq/compare/v0.7.4...v0.8.0) (2017-08-22)

- [breaking feature] If given URL does not contain / character, treat the URL as `https://github.com/<USERNAME>/<URL>`, where USERNAME is GitHub username obtained from `ghq.user` Git configuration variable, GITHUB_USER or USER (USERNAME in Windows) environment variables thanks to @b4b4r07 (#81)
- [maintenance] Fix building configuration thanks to @south37 (#85), @smizy (#82)

## [v0.7.4](https://github.com/motemen/ghq/compare/v0.7.3...v0.7.4) (2016-03-07)

* support path list in GHQ_ROOT [#71](https://github.com/motemen/ghq/pull/71) ([hatotaka](https://github.com/hatotaka))

## [v0.7.3](https://github.com/motemen/ghq/compare/v0.7.2...v0.7.3) (2016-03-02)

* Github relative [#43](https://github.com/motemen/ghq/pull/43) ([mattn](https://github.com/mattn))

## [v0.7.2](https://github.com/motemen/ghq/compare/v0.7.1...v0.7.2) (2015-12-11)

* Revert "Merge pull request #54 from maoe/skip-non-vcs-dirs" [#66](https://github.com/motemen/ghq/pull/66) ([motemen](https://github.com/motemen))

## [v0.7.1](https://github.com/motemen/ghq/compare/v0.7...v0.7.1) (2015-08-06)

* Fix an issue of listing with directories containing symlinks [#61](https://github.com/motemen/ghq/pull/61) ([motemen](https://github.com/motemen))

## [v0.7](https://github.com/motemen/ghq/compare/v0.6...v0.7) (2015-08-03)

* Support for Bluemix DevOps Git service [#56](https://github.com/motemen/ghq/pull/56) ([uetchy](https://github.com/uetchy))
* GHQ_ROOT environment variable to override the root [#59](https://github.com/motemen/ghq/pull/59) ([motemen](https://github.com/motemen))
* Add darcs backend [#55](https://github.com/motemen/ghq/pull/55) ([maoe](https://github.com/maoe))
* fix failing test [#58](https://github.com/motemen/ghq/pull/58) ([motemen](https://github.com/motemen))
* Skip non-VCS directories for performance [#54](https://github.com/motemen/ghq/pull/54) ([maoe](https://github.com/maoe))
* fix test [#57](https://github.com/motemen/ghq/pull/57) ([motemen](https://github.com/motemen))
* `look` command accepts remote repository url too. [#51](https://github.com/motemen/ghq/pull/51) ([ryotarai](https://github.com/ryotarai))
* Add GHQ_LOOK env variable to a new shell executed by `ghq look` [#47](https://github.com/motemen/ghq/pull/47) ([superbrothers](https://github.com/superbrothers))

## [v0.6](https://github.com/motemen/ghq/compare/v0.5...v0.6) (2014-11-20)

* support gist URLs [#46](https://github.com/motemen/ghq/pull/46) ([motemen](https://github.com/motemen))
* Return exit status 1 for clone failure [#45](https://github.com/motemen/ghq/pull/45) ([k0kubun](https://github.com/k0kubun))

## [v0.5](https://github.com/motemen/ghq/compare/v0.4...v0.5) (2014-10-11)

* fixup docs and zsh completion [#44](https://github.com/motemen/ghq/pull/44) ([motemen](https://github.com/motemen))
* Add 'root' subcommand completion [#42](https://github.com/motemen/ghq/pull/42) ([syohex](https://github.com/syohex))
* Include zsh completion into release zip files [#41](https://github.com/motemen/ghq/pull/41) ([itiut](https://github.com/itiut))
* Add --all option to the root command [#40](https://github.com/motemen/ghq/pull/40) ([aaa707](https://github.com/aaa707))
* import: Accept the same clone flags with get command [#37](https://github.com/motemen/ghq/pull/37) ([eagletmt](https://github.com/eagletmt))
* accept SCP-like URL (git@github.com) for import command [#35](https://github.com/motemen/ghq/pull/35) ([mkanai](https://github.com/mkanai))
* Add root command [#34](https://github.com/motemen/ghq/pull/34) ([aaa707](https://github.com/aaa707))
* Set exit code of `look` which failed [#33](https://github.com/motemen/ghq/pull/33) ([fujimura](https://github.com/fujimura))
* Re-implement `ghq import` [#31](https://github.com/motemen/ghq/pull/31) ([motemen](https://github.com/motemen))
* use go-homedir for distributing compiled binaries [#32](https://github.com/motemen/ghq/pull/32) ([motemen](https://github.com/motemen))
* Fix for latest github.com/codegangsta/cli [#28](https://github.com/motemen/ghq/pull/28) ([syohex](https://github.com/syohex))

## 0.4 (2014-06-26)

- [feature] Support per-URL configuration variables e.g. `ghq.<URL>.vcs` to skip VCS backend auto-detection
- [fix] Fixed path problems of SCP-like URLs thanks to @osamu2001 (#20)
- [fix] `ghq get -u` now updates work tree for Mercurial repositories thanks to @troter (#19)
- And typo fixes thanks to @sorah, @dtan4 (#17, #18)

## 0.3 (2014-06-17)

- [feature] `ghq get -shallow` to perform a shallow clone
- [feature] Use GitHub token for `ghq import starred` if specified thanks to @makimoto (#16)
- [fix] Resolve ghq.root's symlinks thanks to @sorah (#15)

## 0.2 (2014-06-10)

- [feature] Support SCP-like repository URLs thanks to @kentaro (#1)
- [feature] Support GitHub:Enterprise repository URLs thanks to @kentaro (#2)
- [fix] Fix issue that default config variable was never used thanks to @Sixeight (#3)
- [fix] Support Windows environment thanks to @mattn (#5)
- [feature] `ghq get -p` to clone GitHub repositories with SSH thanks to @moznion (#7)
- [feature] Support any remotes other than GitHub and Google Code thanks to @tcnksm (#8, #13)
- [feature] Improve zsh completion thanks to @mollifier (#12)
- [feature] Support `ghq get git` for GitHub repositories with user and project name same thanks to @Sixeight (#14)
- And documentation updates thanks to @kentaro, @tricknotes (#6, #9)

## 0.1 (2014-06-01)

- Initial release


text:
/**
 * @ngdoc service
 * @name Filters
 *
 * @param {$log} $log
 * @param {Storage} Storage
 *
 * @ngInject
 */
function filters($log, Storage) {

  const self = this;

  const DATATYPE_FLAG_NAME = 'include_data_types';
  const LOOP_FLAG_NAME = 'include_loops';
  const DISJOINT_NODE_FLAG_NAME = 'include_disjoint_node';
  const SUBCLASS_FLAG_NAME = 'include_subclass_relations';

  let includeLoops;
  let includeDataTypes;
  let includeDisjointNode;
  let includeSubclassRelations;

  self.init = function () {
    includeLoops = Storage.getItem(LOOP_FLAG_NAME) || 'true';
    Storage.setItem(LOOP_FLAG_NAME, includeLoops);

    includeDataTypes = Storage.getItem(DATATYPE_FLAG_NAME) || 'true';
    Storage.setItem(DATATYPE_FLAG_NAME, includeDataTypes);

    includeDisjointNode = Storage.getItem(DISJOINT_NODE_FLAG_NAME) || 'false';
    Storage.setItem(DISJOINT_NODE_FLAG_NAME, includeDisjointNode);

    includeSubclassRelations = Storage.getItem(SUBCLASS_FLAG_NAME) || 'true';
    Storage.setItem(SUBCLASS_FLAG_NAME, includeSubclassRelations);
  };

  self.getIncludeLoops = function () {
    return (includeLoops === 'true');
  };

  /**
   * Toggle property loops and return new setting.
   *
   * @return {boolean} true if property loops are shown, false otherwise
   */
  self.toggleLoops = function () {
    includeLoops = (self.getIncludeLoops()) ? 'false' : 'true';
    Storage.setItem(LOOP_FLAG_NAME, includeLoops);

    $log.debug(`[Filters] Property loops are now ${self.getIncludeLoops() ? 'shown' : 'hidden' }.`);

    return self.getIncludeLoops();
  };

  self.getIncludeDataTypes = function () {
    return (includeDataTypes === 'true');
  };

  /**
   * Toggles data types and returns new setting.
   *
   * @return {boolean} true if data types are included, false otherwise
   */
  self.toggleDataTypes = function () {
    includeDataTypes = (self.getIncludeDataTypes()) ? 'false' : 'true';
    Storage.setItem(DATATYPE_FLAG_NAME, includeDataTypes);

    $log.debug(`[Filters] Data types are now ${self.getIncludeLoops() ? 'shown' : 'hidden'}.`);

    return self.getIncludeDataTypes();
  };

  self.getIncludeDisjointNode = function () {
    return (includeDisjointNode === 'true');
  };

  /**
   * Toggles disjoint nodes and returns new setting.
   *
   * @return {boolean} true if disjoint nodes are included, false otherwise
   */
  self.toggleDisjointNode = function () {
    includeDisjointNode = self.getIncludeDisjointNode() ? 'false' : 'true';
    Storage.setItem(DISJOINT_NODE_FLAG_NAME, includeDisjointNode);

    $log.debug(`[Filters] Disjoint nodes are now ${self.getIncludeDisjointNode() ? 'shown' : 'hidden'}.`);

    return self.getIncludeDisjointNode();
  };

  self.getIncludeSubclassRelations = function () {
    return (includeSubclassRelations === 'true');
  };

  /**
   * Toggles subclass relations and returns new setting.
   *
   * @return {boolean} true if subclass relations are included, false otherwise
   */
  self.toggleSubclassRelations = function () {
    includeSubclassRelations = self.getIncludeSubclassRelations() ? 'false' : 'true';
    Storage.setItem(SUBCLASS_FLAG_NAME, includeSubclassRelations);

    $log.debug(`[Filters] Subclass relations are now ${self.getIncludeSubclassRelations() ? 'shown' : 'hidden'}.`);

    return self.getIncludeSubclassRelations();
  };

  self.init();

}

export default filters;