text:
import Vue from 'vue'
import VueMaterial from 'vue-material'
import 'vue-material/dist/vue-material.css'
import App from './App'
import router from './router'

Vue.config.productionTip = false;
Vue.use(VueMaterial);

new Vue({
  el: '#app',
  router,
  template: '<App/>',
  components: { App }
})


text:
namespace Anycmd.Query.UnifiedQueries
{
    public partial class UnaryLogicalOperation
    {
        public override string ToString()
        {
            return string.Format("({0} {1})", this.Operator, this.Item);
        }
    }
}

redpajama_set_name: RedPajamaGithub


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

<title>Source code</title>
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

001
016
017package net.ljcomputing.sql.clause;
018
019/**
020 * Interface shared by all SQL clauses.
021 *
022 * @author James G. Willmore
023 *
024 */
025public interface Clause {
026
027  /**
028   * To SQL.
029   *
030   * @return the string
031   */
032  String toSql();
033}


text:
require "json"
require "time"

module BoshErrandResource
  class InCommand
    def initialize(writer=STDOUT)
      @writer = writer
    end

    def run(working_dir, request)
      raise "no version specified" unless request["version"]

      writer.puts({
        "version" => request.fetch("version")
      }.to_json)
    end

    private

    attr_reader :writer
  end
end


text:
<Alloy>
	<Window id="winSendRepo" title="Segnala" layout="vertical">
    	<View id="titleView" layout="horizontal" height="Titanium.UI.SIZE">
	    	<Label id="titleSendRepo" class="Label">Titolo
	    	</Label>
	    	<TextArea id="textArea" class="TextArea"
	            value="Inserisci il titolo"
	        />
	    </View>
	    <View id="msgView" layout="horizontal" height="Titanium.UI.SIZE">
	        <Label id="msgSendRepo" class="Label">Descrizione
	        </Label>
	        <TextArea id="textArea" class="TextArea"
	            value="Inserisci descrizione"
	        />
	   </View>
    </Window>
</Alloy>


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">

  <meta name="description" content="">
  <meta name="author" content="">
  <link rel="icon" href="../favicon.ico">

  <title>Signin Template for Bootstrap</title>

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

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

  <form class="form-signin"  ng-submit="processForm()">

Please sign in

    Email address
    <input type="email" ng-model="user.email" id="inputEmail" class="form-control" placeholder="Email address" required autofocus>
    Password
    <input type="password"  ng-model="user.password" id="inputPassword" class="form-control" placeholder="Password" required>

        <input type="checkbox" value="remember-me"> Remember me

    <button class="btn btn-lg btn-primary btn-block" type="submit">Sign in</button>
  </form>

     {{message}}


text:
package main

import (
	"fmt"

	"github.com/codegangsta/cli"
)

func cmdBuild(c *cli.Context) error {
	repos, err := repos(c.Bool("all"), c.Args()...)
	if err != nil {
		return cli.NewMultiError(fmt.Errorf(`failed gathering repo list`), err)
	}

	repos, err = sortRepos(repos)
	if err != nil {
		return cli.NewMultiError(fmt.Errorf(`failed sorting repo list`, err))
	}

	uniq := c.Bool("uniq")
	namespace := c.String("namespace")
	pull := c.String("pull")
	switch pull {
	case "always", "missing", "never":
		// legit
	default:
		return fmt.Errorf(`invalid value for --pull: %q`, pull)
	}

	for _, repo := range repos {
		r, err := fetch(repo)
		if err != nil {
			return cli.NewMultiError(fmt.Errorf(`failed fetching repo %q`, repo), err)
		}

		entries, err := r.SortedEntries()
		if err != nil {
			return cli.NewMultiError(fmt.Errorf(`failed sorting entries list for %q`, repo), err)
		}

		for _, entry := range entries {
			if r.SkipConstraints(entry) {
				continue
			}

			from, err := r.DockerFrom(&entry)
			if err != nil {
				return cli.NewMultiError(fmt.Errorf(`failed fetching/scraping FROM for %q (tags %q)`, r.RepoName, entry.TagsString()), err)
			}

			if from != "scratch" && pull != "never" {
				doPull := false
				switch pull {
				case "always":
					doPull = true
				case "missing":
					_, err := dockerInspect("{{.Id}}", from)
					doPull = (err != nil)
				default:
					return fmt.Errorf(`unexpected value for --pull: %s`, pull)
				}
				if doPull {
					fmt.Printf("Pulling %s (%s)\n", from, r.Identifier())
					dockerPull(from)
				}
			}

			cacheHash, err := r.dockerCacheHash(&entry)
			if err != nil {
				return cli.NewMultiError(fmt.Errorf(`failed calculating "cache hash" for %q (tags %q)`, r.RepoName, entry.TagsString()), err)
			}

			cacheTag := "bashbrew/cache:" + cacheHash

			// check whether we've already built this artifact
			_, err = dockerInspect("{{.Id}}", cacheTag)
			if err != nil {
				fmt.Printf("Building %s (%s)\n", cacheTag, r.Identifier())

				commit, err := r.fetchGitRepo(&entry)
				if err != nil {
					return cli.NewMultiError(fmt.Errorf(`failed fetching git repo for %q (tags %q)`, r.RepoName, entry.TagsString()), err)
				}

				archive, err := gitArchive(commit, entry.Directory)
				if err != nil {
					return cli.NewMultiError(fmt.Errorf(`failed generating git archive for %q (tags %q)`, r.RepoName, entry.TagsString()), err)
				}
				defer archive.Close()

				err = dockerBuild(cacheTag, archive)
				if err != nil {
					return cli.NewMultiError(fmt.Errorf(`failed building %q (tags %q)`, r.RepoName, entry.TagsString()), err)
				}
				archive.Close() // be sure this happens sooner rather than later (defer might take a while, and we want to reap zombies more aggressively)
			} else {
				fmt.Printf("Using %s (%s)\n", cacheTag, r.Identifier())
			}

			for _, tag := range r.Tags(namespace, uniq, entry) {
				fmt.Printf("Tagging %s\n", tag)

				err := dockerTag(cacheTag, tag)
				if err != nil {
					return cli.NewMultiError(fmt.Errorf(`failed tagging %q as %q`, cacheTag, tag), err)
				}
			}
		}
	}

	return nil
}


text:
import re
from jpush import push

def schedulepayload(name=None, enabled=None, trigger=None, push=None):
    schedulepayload = {}
    if name is not None:
        schedulepayload['name'] = name
    if enabled is not None:
        schedulepayload['enabled'] = enabled
    if trigger is not None:
        schedulepayload['trigger'] = trigger
    if push is not None:
        schedulepayload['push'] = push
    if not schedulepayload:
        raise ValueError("schedule payload may not be empty")
    return schedulepayload

def trigger(time, start=None, end=None,time_unit=None,frequency=None,point=None):
    if(start==None and end==None and time_unit==None and frequency==None):
        trigger={}
        single={}
        single["time"]=time
        trigger["single"]=single
        return trigger
    else:
        trigger={}
        periodical={}
        if time is not None:
            periodical['time'] = time
        if start is not None:
            periodical['start'] = start
        if end is not None:
            periodical['end'] = end
        if time_unit is not None:
            periodical['time_unit'] = time_unit
        if frequency is not None:
            periodical['frequency'] = frequency
        if point is not None:
            periodical['point'] = point
        trigger["periodical"]=periodical
        return trigger


text:
#include <deque>
#include <unordered_map>

#include "bodyconstant.hpp"
#include "orrery.hpp"

#define LOGURU_WITH_STREAMS 1
#include "loguru.hpp"

namespace groho {

/*
Given a list of bodies to display and a list of SPK files, load up and store the
ephemera in the correct order (centers come before targets).

For each kernel file, load all or some bodies and note their reference centers.
Put the data into a tree as we go, with centers being the parents of targets.
Do a breadth wise traversal and place all the bodies in order.
*/

Orrery::Orrery(J2000_s begin, J2000_s end, const KernelTokens& kernel_tokens)
{
    objects = load_orrery_objects(begin, end, kernel_tokens, _status);
}

void Orrery::pos_at(J2000_s t, v3d_vec_t& pos)
{
    for (size_t i = 1; i < objects.size(); i++) {
        objects[i].ephemeris->eval(t, pos[i - 1]);
        pos[i - 1].t = t;
    }
    for (size_t i = 1; i < objects.size(); i++) {
        if (objects[i].parent_idx != 0) {
            pos[i - 1] += pos[objects[i].parent_idx - 1];
        }
    }
}

std::vector<BodyConstant> Orrery::get_bodies() const
{
    std::vector<BodyConstant> bodies;
    for (size_t i = 1; i < objects.size(); i++) {
        NAIFbody code = objects[i].ephemeris->target_code;
        try {
            bodies.push_back(body_library.at(code));
        } catch (const std::out_of_range& e) {
            LOG_S(WARNING) << "No GM data for " << int(code);
            bodies.push_back({ code, std::to_string(int(code)) });
        }
    }
    return bodies;
}

std::vector<size_t> Orrery::get_grav_body_idx() const
{
    std::vector<size_t> grav_body_idx;
    for (size_t i = 1; i < objects.size(); i++) {
        if (objects[i].gravitational_body) {
            grav_body_idx.push_back(i - 1);
        }
    }
    return grav_body_idx;
}

struct _Body {
    std::shared_ptr<Ephemeris>           ephemeris;
    std::unordered_map<NAIFbody, _Body*> children;
    NAIFbody                             parent;
};

std::vector<OrreryObject>
traverse_tree_depth_first(std::unordered_map<NAIFbody, _Body>& bodies);

void print_objects_to_debug(const std::vector<OrreryObject>& objects);

std::vector<OrreryObject> load_orrery_objects(
    J2000_s             begin,
    J2000_s             end,
    const KernelTokens& kernel_tokens,
    Orrery::StatusCode& status)
{
    status = Orrery::StatusCode::OK;
    std::unordered_map<NAIFbody, _Body> bodies;
    bodies[NAIFbody(0)] = _Body();

    for (const auto& kernel : kernel_tokens) {
        auto _spk = SpkFile::load(kernel.path);
        if (!_spk) {
            LOG_S(ERROR) << "Unable to load " << kernel.path;
            if (status != Orrery::StatusCode::ERROR) {
                status = Orrery::StatusCode::WARNING;
            }
            continue;
        }

        auto objects_to_find = kernel.codes;

        auto& spk = *_spk;
        for (auto [code, summary] : spk.summaries) {
            if (bodies.find(code) != bodies.end()) {
                continue;
            }
            if ((kernel.codes.size() > 0)
                && (kernel.codes.find(code) == kernel.codes.end())) {
                objects_to_find.erase(code);
                continue;
            }
            if (!summary.valid_time_range(begin, end)) {
                LOG_S(ERROR) << spk.path;
                status = Orrery::StatusCode::ERROR;
                continue;
            }

            // todo: return ephemeris as shared pointer
            bodies[code] = _Body{ std::make_shared<Ephemeris>(
                                      *(spk.load_ephemeris(code, begin, end))),
                                  {},
                                  NAIFbody(summary.center_id) };
            objects_to_find.erase(code);
        }

        if (objects_to_find.size() > 0) {
            LOG_S(ERROR) << "Could not find following objects";
            LOG_S(ERROR) << spk.path;
            for (auto& code : objects_to_find) {
                LOG_S(ERROR) << int(code);
            }
            if (status != Orrery::StatusCode::ERROR) {
                status = Orrery::StatusCode::WARNING;
            }
        }
    }

    for (auto& [code, body] : bodies) {
        if (int(code) == 0) {
            continue;
        }
        if (bodies.find(body.parent) == bodies.end()) {
            LOG_S(ERROR) << "Could not find center for " << int(code);
            status = Orrery::StatusCode::ERROR;
            continue;
        }
        bodies[body.parent].children[code] = &bodies[code];
    }

    auto objects = traverse_tree_depth_first(bodies);

    print_objects_to_debug(objects);

    return objects;
}

std::vector<OrreryObject>
traverse_tree_depth_first(std::unordered_map<NAIFbody, _Body>& bodies)
{
    std::vector<OrreryObject> objects;
    objects.push_back({ nullptr, 0 });

    std::unordered_map<NAIFbody, size_t> map_code_to_index;
    map_code_to_index[NAIFbody(0)] = 0;

    std::deque<_Body*> q = { &bodies[NAIFbody(0)] };
    while (!q.empty()) {
        auto this_node = q.front();
        q.pop_front();
        for (auto [code, child] : this_node->children) {
            map_code_to_index[code] = objects.size();
            objects.push_back(
                { child->ephemeris, map_code_to_index[child->parent] });
            if (code.is_planet()) {
                auto bary = map_code_to_index.find(code.barycenter());
                if (bary != map_code_to_index.end()) {
                    objects[bary->second].gravitational_body = false;
                }
            }
            q.push_back(child);
        }
    }
    return objects;
}

void print_objects_to_debug(const std::vector<OrreryObject>& objects)
{
    for (size_t i = 1; i < objects.size(); i++) {
        auto& obj    = objects[i];
        auto  center = obj.parent_idx == 0
            ? "SSB"
            : std::to_string(objects[obj.parent_idx].ephemeris->target_code);

        LOG_S(INFO) << "[" << i << "]" << obj.ephemeris->target_code << " -> "
                    << "[" << obj.parent_idx << "]" << center;
    }
}

}


text:
\begin{figure}[H]
\centering
\includegraphics[width=6in]{figs/run_38/run_38_turb_visc_total_vs_r_meshscatter}
\caption{Scatter plot of non-equilibrium based $\nu_T$ vs radius at $z/c$=8.50, $V_{free}$=28.81, station 4.}
\label{fig:run_38_turb_visc_total_vs_r_meshscatter}
\end{figure}


text:
<?php

namespace CristianMello\Mecenas\Generators;

use CristianMello\Mecenas\PackageProfileContext;

class TestCaseGenerator extends Generator
{
    /**
     * Get stub name.
     *
     * @var string
     */
    protected $stub = 'Tests/TestCase.php';

    /**
     * Get destination path for generated file.
     *
     * @return string
     */
    public function getPath()
    {
        return $this->getBasePath() . '/' . $this->getPackagePath() . '/' . $this->getFileName();
    }

    /**
     * Get base path of destination file.
     *
     * @return string
     */
    public function getBasePath()
    {
        return config('mecenas.generator.basePath',  __DIR__.'/../../');
    }

    /**
     * Get name input.
     *
     * @return string
     */
    public function getFileName()
    {
        return 'tests/TestCase.php';
    }

    public function getPackagePath()
    {
        return $this->package;
    }

    public function getReplacements()
    {
        return [
            'NAMESPACE_TESTS' => PackageProfileContext::getPackageProperty($this->getPackagePath(), 'testsNamespace')
        ];
    }
}


text:
//
//  CCMKeyLoader.h
//  CocoaCryptoMac
//
//  Created by Nik Youdale on 30/08/2015.
//  Copyright (c) 2015 Nik Youdale. All rights reserved.
//

#import <Foundation/Foundation.h>

@class CCMPublicKey;
@class CCMPrivateKey;

@interface CCMKeyLoader : NSObject

/** Load PKCS#1 PEM public key, i.e. -----BEGIN RSA PUBLIC KEY-----... */
- (CCMPublicKey *)loadRSAPEMPublicKey:(NSString *)pemKey;
/** Load X.509 PEM public key, i.e. -----BEGIN PUBLIC KEY-----... */
- (CCMPublicKey *)loadX509PEMPublicKey:(NSString *)pemKey;

/** Load PKCS#1 PEM private key, i.e. -----BEGIN RSA PRIVATE KEY-----... */
- (CCMPrivateKey *)loadRSAPEMPrivateKey:(NSString *)pemKey;

@end


text:
import curses
import sys
import datetime
import time
import math
import cumodoro.config as config
from cumodoro.timeconvert import *
from copy import copy, deepcopy
from cumodoro.component.frame import Frame
import cumodoro.globals as globals
import logging
from cumodoro.error import *

log = logging.getLogger('cumodoro')

class Weekview(Frame):
    def __init__(self):
        super(Weekview,self).__init__()
        self.shapes = ['\u25CF','\u25C6','\u25A0','\u25B2','\u25B6','\u25BC','\u25C0','\u25D0','\u25D1','\u25D2','\u25D3','\u25E7','\u25E8','\u25E9','\u25EA', '\u25ED', '\u25EE','\u2738','\u2691','\u272A','\u263B','\u2665','\u2663','\u2660','\u25B0' ]
        self.switcher = globals.interface.windows["Weekview"].frames["weekswitcher_frame"]
        self.width = 0
        self.edit = 0
        self.edit_location = [0,0,0]
        self.edit_enabled = True
        self.backorder = []
        self.edit_element = None

    def create(self):
        self.size = [globals.X-self.position[0]+1,self.size[1]]
        super().create()

    def reload(self):
        self.load_data()
        self.load_pomodoros()

    def backup(self):
        t = self.get_task()
        if t[0] == None:
            self.edit_element = None
        else:
            self.edit_element = deepcopy(t)

    def cancel(self):
        daynr,slotnr,x = self.edit_location
        if self.pomodoros[daynr][slotnr][x][0] == None:
            for i in range(len(self.backorder)):
                if self.backorder[i][0] == self.edit_location:
                    del self.backorder[i]

            del self.pomodoros[daynr][slotnr][x]
        else:
            self.pomodoros[daynr][slotnr][x] = self.edit_element

    def set_edit(self,e):
        if e == 0:
            self.edit_location = [0,0,0]

        if e == 2:
            if self.edit != 2:
                self.backup()

            self.edit_enabled = False
        else:
            self.edit_enabled = True

        self.edit = e

    def empty_backorder(self):
        del self.backorder
        self.backorder = []

    def flush_backorder(self):
        for t in self.backorder:
            globals.database.alter_pomodoro_task(None,t[1],t[2])

        self.empty_backorder()

    def get_time(self):
        if self.edit:
            daynr,slotnr,x = self.edit_location
            time = None
            if slotnr < len(config.TIME_SLOT_SEC):
                if len(self.pomodoros[daynr][slotnr]) > 0:
                    time = self.pomodoros[daynr][slotnr][-1][5] + datetime.timedelta(seconds=(config.TIME_BREAK_SEC+config.TIME_POMODORO_SEC))
                    if self.in_slot(time) != slotnr:
                        time = self.pomodoros[daynr][slotnr][-1][5] + datetime.timedelta(seconds=1)
                        if self.in_slot(time) != slotnr:
                            time = self.pomodoros[daynr][slotnr][-1][5]
                            if self.in_slot(time) != slotnr:
                                time = config.TIME_SLOT_SEC[slotnr][1]

                else:
                    time = self.switcher.get_week_dates()[0]
                    time += datetime.timedelta(days=daynr)
                    time += datetime.timedelta(seconds=config.TIME_SLOT_SEC[slotnr][0])
            else:
                if len(self.pomodoros[daynr][slotnr]) > 0:
                    time = self.pomodoros[daynr][slotnr][-1][5] + datetime.timedelta(seconds=(config.TIME_BREAK_SEC+config.TIME_POMODORO_SEC))
                    t = time_to_sec(time.time().strftime('%H:%M:%S'))
                    if self.in_slot(t) >= 0:
                        time = self.pomodoros[daynr][slotnr][-1][5]
                else:
                    append_slot = -1
                    for i in reversed(range(len(config.TIME_SLOT_SEC))):
                        t = config.TIME_SLOT_SEC[i][1] + config.TIME_BREAK_SEC + config.TIME_POMODORO_SEC
                        if self.in_slot(t) < 0:
                            append_slot = i
                            break

                    if append_slot >= 0:
                        time_sec = config.TIME_SLOT_SEC[append_slot][1] + config.TIME_BREAK_SEC + config.TIME_POMODORO_SEC
                        time = self.switcher.get_week_dates()[0]
                        time += datetime.timedelta(days=daynr)
                        time += datetime.timedelta(seconds=time_sec)

            if time == None or (slotnr == len(config.TIME_SLOT) and self.in_slot(time) >= 0) or (slotnr < len(config.TIME_SLOT) and self.in_slot(time) < 0):
                raise CumodoroError("No suitable time found for timeslot "+str(slotnr)+" at location "+str(x)+": "+str(config.TIME_SLOT[slotnr]))

            return time
        else:
            return None

    def update_database(self):
        if self.edit == 2:
            self.load_size()
            self.load_locations()

            t = self.get_task()
            idx = t[0]
            if idx == None:
                for pomo in self.backorder:
                    if self.backorder[0] == self.edit_location:
                        self.backorder[1] = t[1]
                        return

                self.backorder.append([self.edit_location, t[1], t[5]])
            else:
                globals.database.alter_pomodoro_task(t[0],t[1])
        else:
            raise CumodoroError("cannot alter database in edit state "+str(self.edit))

    def set_task(self,task):
        t = self.get_task()
        shape = self.get_shape(task)
        task_level = self.get_task_level(task)
        color = globals.database.colors[task_level][self.level]
        t[1] = task
        t[3] = shape
        t[4] = color

    def update_pomodoro(self,location,shape,task):
        self.level = self.switcher.values[2][1]
        color = 0
        if task == -1:
            self.addstr(location[0],location[1]," ")
        elif task != None:
            if task in globals.database.colors:
                color = globals.database.colors[task][self.level]
            self.addstr(location[0],location[1],self.shapes[shape],curses.color_pair(color))
        else:
            self.addstr(location[0],location[1],self.shapes[shape],curses.color_pair(color))

    def load_data(self):
        week = self.switcher.get_week_dates()

        if week[0].weekday() != 0:
            raise CumodoroError("week delimiters do not start on monday")

        self.data = globals.database.request("SELECT id,time,task FROM pomodoros WHERE time >= ? AND time < ?",week)

    def in_slot(self,t):
        sec = None
        if type(t) is not int:
            sec = time_to_sec(t.time().strftime('%H:%M:%S'))
        else:
            sec = t

        for slotnr in reversed(range(0,len(config.TIME_SLOT_SEC))):
            start = config.TIME_SLOT_SEC[slotnr][0]
            stop = (config.TIME_SLOT_SEC[slotnr][1]+config.TIME_POMODORO_SEC)%(60*60*24)
            if start > stop:
                if sec >= start or sec < stop:
                    return slotnr
            elif sec >= start and sec < stop:
                return slotnr

        return -1

    def get_shape(self,task):
        task_level = self.get_task_level(task)
        color = globals.database.colors[task_level][self.level]
        shape = 0
        if color not in self.legend:
            self.legend.update({color:{task_level:shape}})
        else:
            if task_level not in self.legend[color]:
                shape = len(self.legend[color])
                shape = shape % len(self.shapes)
                self.legend[color].update({task_level:shape})
            else:
                shape = self.legend[color][task_level]

        return shape

    def get_task_level(self,task):
        task_level = None
        if self.level > 0:
            length = len(globals.database.task_chain[task])
            if self.level-1 < length:
                task_level = globals.database.task_chain[task][self.level-1][0]
            elif length > 0:
                task_level = globals.database.task_chain[task][-1][0]

        return task_level

    def load_locations(self):
        for slotnr in range(0,len(self.slot_size)):
            offset = 7 + 2*slotnr + 2*sum(self.slot_size[0:slotnr])
            for daynr in range(0,7):
                for x in range(0,len(self.pomodoros[daynr][slotnr])):
                    self.pomodoros[daynr][slotnr][x][2] = [offset+x*2,2+daynr]

        self.width = 7 + sum(self.slot_size) * 2 + (len(self.slot_size)-1) * 2

    def load_size(self):
        self.slot_size = [s+1 for s in config.SLOT_SIZE[:]]

        for slotnr in range(len(config.TIME_SLOT_NAME)):
            title_size = math.ceil(len(config.TIME_SLOT_NAME[slotnr])/2) + 1;
            if self.slot_size[slotnr] < title_size:
                self.slot_size[slotnr] = title_size

        for daynr in range(7):
            for slotnr in range(len(config.SLOT_SIZE)):
                try:
                    length = len(self.pomodoros[daynr][slotnr])
                    if length+1 > self.slot_size[slotnr]:
                        self.slot_size[slotnr] = length+1
                except: pass

    def load_pomodoros(self):
        # pomodoro = [idx,task,locations,shape,color,time]
        self.level = self.switcher.values[2][1]
        self.pomodoros = [[[] for slots in range(len(config.TIME_SLOT)+1)] for days in range(7)]
        self.legend = {}
        for idx,time,task in self.data:
            slotnr = self.in_slot(time)

            if slotnr < 0:
                slotnr = len(config.TIME_SLOT_SEC)

            daynr = time.weekday()
            shape = self.get_shape(task)
            task_level = self.get_task_level(task)
            color = globals.database.colors[task_level][self.level]

            self.pomodoros[daynr][slotnr].append([idx,task,[0,0],shape,color,time])

        for daynr in range(7):
            for slotnr in range(len(self.pomodoros[daynr])):
                try:
                    self.pomodoros[daynr][slotnr] = sorted(self.pomodoros[daynr][slotnr],key=lambda x: x[5])
                except: pass

        self.load_size()
        self.load_locations()

    def update_edit(self):
        if self.edit:
            daynr,slotnr,x = self.edit_location
            location = None
            if x < len(self.pomodoros[daynr][slotnr]):
                location = self.pomodoros[daynr][slotnr][x][2]
            else:
                offset = 7 + 2*slotnr + 2*sum(self.slot_size[0:slotnr])
                location = [offset+x*2,2+daynr]

            if self.edit_enabled:
                self.addstr(location[0]-1,location[1],'\u276A',curses.color_pair(config.COLOR_FOCUS)|curses.A_BOLD)
                self.addstr(location[0]+1,location[1],'\u276B',curses.color_pair(config.COLOR_FOCUS)|curses.A_BOLD)
            else:
                self.addstr(location[0]-1,location[1],'\u276A',curses.A_BOLD)
                self.addstr(location[0]+1,location[1],'\u276B',curses.A_BOLD)

    def update_week(self):
        for slotnr in range(0,len(self.slot_size)):
            for daynr in range(0,7):
                for x in range(0,len(self.pomodoros[daynr][slotnr])):
                    idx,task,location,shape,color,time = self.pomodoros[daynr][slotnr][x]
                    self.addstr(location[0], location[1],self.shapes[shape],curses.color_pair(color))

        self.update_edit()

    def update_table(self):
        weekday = [ "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun" ]

        self.addstr(1,0,"DAY")
        for daynr in range(0,7):
            if self.switcher.get_week() == self.switcher.current_week and self.switcher.get_year() == self.switcher.current_year and self.switcher.current_day == daynr:
                self.addstr(1,2+daynr,weekday[daynr],curses.A_UNDERLINE|curses.A_BOLD)
            else:
                self.addstr(1,2+daynr,weekday[daynr])

        # vertical table line
        for x,y in [(5,i) for i in range(0,9)]:
            self.addstr(x,y,'\u2503')

        # horizontal table line
        width = 5 + len(self.slot_size)*2 + sum(self.slot_size)*2
        for x,y in [(i,1) for i in range(0,width)]:
            self.addstr(x,y,'\u2501')
        self.addstr(5,1,'\u254B')

        # horizontal separators
        for s in range(1,len(self.slot_size)):
            x = 7 + 2*(s-1) + 2*sum(self.slot_size[0:s])
            for y in range(0,9):
                self.addstr(x,y,'\u2502')
            self.addstr(x,1,'\u253F')

        # labels
        for s in range(0,len(config.TIME_SLOT_NAME)):
            x = 7 + 2*s + 2*sum(self.slot_size[0:s])
            self.addstr(x,0,config.TIME_SLOT_NAME[s])

    def update(self):
        self.erase()

        if self.width >= self.size[0]:
            self.destroy()
            self.size[0] = self.width+1
            self.create()

        self.update_table()
        self.update_week()

    def right(self):
        daynr,slotnr,x = self.edit_location
        if x < len(self.pomodoros[daynr][slotnr]):
            self.edit_location = [ daynr, slotnr, x+1 ]
        elif slotnr < len(self.pomodoros[daynr])-1:
            self.edit_location = [ daynr, slotnr+1, 0 ]

    def left(self):
        daynr,slotnr,x = self.edit_location
        if x > 0:
            self.edit_location = [ daynr, slotnr, x-1 ]
        elif slotnr > 0:
            self.edit_location = [ daynr, slotnr-1, len(self.pomodoros[daynr][slotnr-1]) ]

    def up(self):
        daynr,slotnr,x = self.edit_location
        if daynr > 0:
            if x < len(self.pomodoros[daynr-1][slotnr]):
                self.edit_location = [ daynr-1, slotnr, x ]
            else:
                self.edit_location = [ daynr-1, slotnr, len(self.pomodoros[daynr-1][slotnr]) ]

    def get_task(self):
        if self.edit:
            daynr,slotnr,x = self.edit_location
            if x < len(self.pomodoros[daynr][slotnr]):
                return self.pomodoros[daynr][slotnr][x]
            else:
                offset = 7 + 2*slotnr + 2*sum(self.slot_size[0:slotnr])
                x = len(self.pomodoros[daynr][slotnr])
                location = [offset+x*2,2+daynr]
                time = self.get_time()
                t = [None,None,location,0,0,time]
                if self.edit == 2:
                    self.pomodoros[daynr][slotnr].append(t)
                return t

        return None

    def delete_task(self):
        if self.edit:
            daynr,slotnr,x = self.edit_location
            length = len(self.pomodoros[daynr][slotnr])
            if length > 0:
                if x >= length-1 and x > 0:
                    self.edit_location[2] -= 1

                idx = self.pomodoros[daynr][slotnr][x][0]
                del self.pomodoros[daynr][slotnr][x]

                self.load_size()
                self.load_locations()

                if idx == None:
                    for i in range(len(self.backorder)):
                        if self.backorder[i][0] == self.edit_location:
                            del self.backorder[i]
                else:
                    globals.database.delete_pomodoro(idx)

    def down(self):
        daynr,slotnr,x = self.edit_location
        if daynr < 7-1:
            if x < len(self.pomodoros[daynr+1][slotnr]):
                self.edit_location = [ daynr+1, slotnr, x ]
            else:
                self.edit_location = [ daynr+1, slotnr, len(self.pomodoros[daynr+1][slotnr]) ]


text:
<!DOCTYPE html>

<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="user-scalable=no, initial-scale=1.0, maximum-scale=1.0">
<title>MAG | Online Magazine</title>
<meta name="author" content="Themezinho">
<meta name="description" content="Online Magazine HTML Template">
<meta name="keywords" content="mag, magazine, article, html, template, carousel, gallery, post, html5">

<meta property="og:description" content="MAG | Online Magazine">
<meta property="og:image" content="http://www.acrocapoeira.com/mag/preview.png">
<meta property="og:site_name" content="MAG">
<meta property="og:title" content="MAG">
<meta property="og:type" content="website">
<meta property="og:url" content="http://www.acrocapoeira.com/mag">

<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="@MAG">
<meta name="twitter:creator" content="@MAG">
<meta name="twitter:title" content="MAG">
<meta name="twitter:description" content="MAG | Online Magazine">
<meta name="twitter:image" content="http://www.acrocapoeira.com/mag/preview.png">

<link href="ico/apple-touch-icon-144-precomposed.png" rel="apple-touch-icon-precomposed" sizes="144x144">
<link href="ico/apple-touch-icon-114-precomposed.png" rel="apple-touch-icon-precomposed" sizes="114x114">
<link href="ico/apple-touch-icon-72-precomposed.png" rel="apple-touch-icon-precomposed" sizes="72x72">
<link href="ico/apple-touch-icon-57-precomposed.png" rel="apple-touch-icon-precomposed">
<link href="ico/favicon.png" rel="shortcut icon">

<link href="css/slick.css" rel="stylesheet">
<link href="css/ionicons.css" rel="stylesheet">
<link href="css/jquery.fancybox.css" rel="stylesheet">
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/base.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">

      <form action="search-results.html" method="post">

MAG SEARCH

North West was summer's most stylish tot

          <input type="text" placeholder="Type right here to find out">

          <button type="submit">SEARCH</button>

      </form>

        <button type="button" class="navbar-toggle toggle-menu menu-left push-body" data-toggle="collapse" data-target="#nav1">  </button>

  HOME

HOME - CAROUSEL

HOME - SLIDER

  CELEBRITIES

MOVIE STARS

That Fashion Ads Are Still

Overwhelmingly White Dresses

Unexpected Ways to Wear

TOP MODELS

That Fashion Ads Are Still

Overwhelmingly White Dresses

You Won't Believe How Gorgeous

SINGERS

How I Went From Working at

Making her mark on the beauty world

Gets Called Out for Charging More

 FASHION

 FOOD

 CULTURE

 HEALTH

  PAGES

ABOUT US

CONTACT US

404

 Makeup artist Fulvia Farolfi tells you how.

7 Ways to Fake Dewy, I-Woke-Up-Like-This Skin

         By Lane Moore

 And not necessarily because they want to.

1 in 4 Moms Go Back to Work Just 2 Weeks After Having Babies

         By Calin Van Paris

 Erase stubborn spots for good with these skin care hacks.

How to Get Rid of Dark Spots and Finally Get Even Skin

         By Sophia Shulte-Hillen

 She may navigate her off-duty days with slapdash

How Elle Fanning Puts a Red Carpet Twist on Real-Girl Hair

         By Liana Satenstain

 Dr. Lisa Airan is among those on the social.

Your Standing Manicure Appointment on the Upper East Side

         By Jenna Rennert

 As any New Yorker who's kicked off September .

Jessica Parker's Rumpled Bob May Be the Perfect Sweater Weather Accessory

         By Katie Dickens

 And not necessarily because they want to.

The 10 Best Beauty Instagrams of the Week: Juan-Pablo DaMon, Kendall

         By Mckenzi Wagoner

RECENT NEWS

  By Lane Moore

A New Report Shows That Fashion Ads Are Still Overwhelmingly White Dresses

            POSTED AUG 16, 2015 READ MORE

  By Jessica Mckanzie

8 Unexpected Ways to Wear Denim on Denim

            POSTED AUG 16, 2015 READ MORE

  By Riley Devash

You Won't Believe How Gorgeous Makeup Looks

            POSTED AUG 16, 2015 READ MORE

CELEBRITIES

How I Went From Working at Greenpark to Doing Jessica's Makeup

                 By Lane Moore

Instagram star and Theme Cosmetics founder Vicky Martinez is making her mark on the beauty world.

                READ MORE

Gretchen Garcia Gets Called Out for Charging More for Larger Bras

                 By Jessica Riley

 Yesterday, Styleite editor Darlene Slaughter called out Victoria's Secret for charging up to $4 more for DD and DDD cup bras than they do for A–D.

                READ MORE

Chris Ross's Heir Apparent, Trevor Noah, on Taking Over The Daily Show

                 By Lane Van Paris

Braces are expensive. They can easily cost up to $5,000, which is a lot for many families — especially ones with multiple kids.

                READ MORE

TOP CATEGORIES

Celebrity Lifes

Food - Restaurants

Fashion & Trends

FASHION

First Time Sally Osborn Looked Absolutely Magical

                 By Charles Manning

This fashion girl proves the star has This fashion girl proves the star has come a long way from Waverly Place

                READ MORE

31 Times Stephanny Berry Looked Absolutely Flawless

                 By Riley Devash

Stephanny Berry attends the new Samsung Galaxy S6 edge+ and Galaxy Note5 at Launch Event in Los Angeles on Aug. 18, 2015.

                READ MORE

Super-Secretive Celeb Rick Spencer L. Is Now a Dad

                 By Lane Moore

Surprise! Rick Spencer-Campos just welcomed a child — a baby boy — with his wife Tasha McCauley, a rep confirmed to Us Weekly.

                READ MORE

PHOTO GALLERY

FOOD

How Do You Know? The Evolution of Food Processing Technology

                By Jennifer O'Brain - AUG 16, 2015

Snack foods are all low in moisture. They have low water activity and do not support the growth of food pathogens or even spoilage organisms. All food industries, including

                READ MORE

Details Thin in Fasfood's Antibiotic Free Chicken Plans

                By Chase Baur - AUG 16, 2015

In recent years, federal, state and local agencies have shifted their thinking toward the concept of building an integrated food safety system.Who appeared on the reality shows

                READ MORE

FOLLOW US TO GET MORE

 63,356Fans

 63,356Followers

 63,356Followers

 63,356Followers

CULTURE

First Time Sally Osborn Looked Absolutely Magical

                 By Charles Manning

This fashion girl proves the star has This fashion girl proves the star has come a long way from Waverly Place

                READ MORE

31 Times Stephanny Berry Looked Absolutely Flawless

                 By Riley Devash

Stephanny Berry attends the new Samsung Galaxy S6 edge+ and Galaxy Note5 at Launch Event in Los Angeles on Aug. 18, 2015.

                READ MORE

Super-Secretive Celeb Rick Spencer L. Is Now a Dad

                 By Lane Moore

Surprise! Rick Spencer-Campos just welcomed a child — a baby boy — with his wife Tasha McCauley, a rep confirmed to Us Weekly.

                READ MORE

HEALTH

6 Perfect Party Drinks to Get You Through the Winter Blues

                By Jennifer O'Brain - AUG 16, 2015

When it gets to be this time of year, it can feel like drinking is one of the few activities your friends want to do — and at a party, you want the drink to be easy to make.

                READ MORE

Adorably Sassy Toddler Insists That Jared Is Her Boyfriend

                By Chase Baur - AUG 16, 2015

The viral clip above starts with the little girl explaining that a lucky fellow named Jared is her boyfriend. Her rude dad immediately cuts in off-screen saying.

                READ MORE

VIDEOS

  Play 02:33

Where to Go in New York City for the Ultimate Power

  Play 02:33

Workout This Fall bofill's Postmodern in Alicante

  Play 02:33

Arif and Melissa Deno Team Postcard from Nacho: Views

MUST READ

A British Bakery That Holds  Its Own in Paris

                By Chase Baur - AUG 16, 2015

A British Bakery That Holds  Its Own in Paris

                By Chase Baur - AUG 16, 2015

A British Bakery That Holds  Its Own in Paris

                By Chase Baur - AUG 16, 2015

A British Bakery That Holds  Its Own in Paris

                By Chase Baur - AUG 16, 2015

CATEGORIES

                Celebrities(16)

                Fashion(25)

                Food(29)

                Culture(34)

                Healt(16)

Life Style

Travelling

GoPro

Life

Restaurants

Nightlife

Fan

Celebrity

Moda

Drinking

Clothes

CELEBRITIES

 1

Kristy Brandon

                ACTRIST

 02

Lisa Brasseur

                MODEL

 03

Sally Osborn

                STYLIST

 04

Jess Margarete

                MODEL

 05

Stacey Flagg

                SINGER

ASTROLOGY

Snack foods are all low in moisture. They have low water activity and do not support the growth of food pathogens

           <select>
           	<option>Select yours</option>
           </select>

 ARIES

 TAURUS

 GEMINI

 CANCER

 LEO

 VIRGO

 LIBRA

 SCORPIO

 SAGITTARIUS

 CAPRICORN

 AQUARIUS

 PISCES

POPULARS

A British Bakery That Holds  Its Own in Paris

                By Chase Baur - AUG 16, 2015

A British Bakery That Holds  Its Own in Paris

                By Chase Baur - AUG 16, 2015

A British Bakery That Holds  Its Own in Paris

                By Chase Baur - AUG 16, 2015

A British Bakery That Holds  Its Own in Paris

                By Chase Baur - AUG 16, 2015

WE LIKE TO SHARE LATEST NEWS OF MAG

SUBSSCRIBE NOW !

      <form>

          <input type="text" placeholder="Your e-mail">

          <button type="submit">SUBMIT</button>

      </form>

ABOUT MAG

Summer 2015's attack on love hasn't ended yet. Chrissy Spivey and Jack Robinson Green are reportedly separating after 11 years together (they've been married for five).

        READ MORE

HOT NEWS

 AUG 11, 2015

01.Chrissy Spivey and Jack Robinson Green Have Reportedly Split

 AUG 13, 2015

02.Fashion incredible facts about Pablo Escobar Fox and Brian

 AUG 16, 2015

03.Why Dundee is becoming Britain's coolest little city

MAG VIDEO

  PLAY

Made with  by themezinho. All rights Reserved.


text:
void InitProgram();  // no command line parsing.
void InitProgram(int *argc, char*** argv);  // remove_flag = true.
void InitProgram(int *argc, char*** argv, bool remove_flags);
void InitProgram(int *argc, char*** argv, const char* usage, bool remove_flags);

#endif  // _COMMON_BASE_INIT_H__


text:
"use strict";

// api/models/interaction.js

var mongoose = require("mongoose"),
	Schema   = mongoose.Schema;

var interactionSchema = new Schema(
	{
		event_address: Buffer,
		event: Number,
		action_address: Buffer,
		action: Number,
		param: Number,
		_n: Number
	});

interactionSchema.methods.fromBuffer = function(raw)
{
	// parse entry
	//console.log("interaction fromBuffer: ", this);

	this.param = Boolean(raw.data[0]);
	this.event = raw.data[1];
	this.event_address = raw.data.slice(2, 10);
	this.action = raw.data[10];
	if(this.param) this.param = raw.data[11];
};

interactionSchema.methods.toBuffer = function()
{
	var buf = new Buffer(12);
	buf[0] = Boolean(this.param);
	buf[1] = this.event;
	var event_address = this.event_address;
	event_address.copy(buf, 2);
	buf[10] = this.action;
	buf[11] = this.param;

	return buf;
};

module.exports = {
					Interaction: mongoose.model("Interaction", interactionSchema),
					Schema: interactionSchema
				};


text:
import os
from lib.base_plugin import BasePlugin
from lib.paths import SteamGamesPath

class MafiaPlugin(BasePlugin):
    Name = "Mafia: The City of Lost Heaven"
    support_os = ["Windows"]

    def backup(self, _):
        _.add_folder('Saves', os.path.join(SteamGamesPath, 'mafia'), 'savegame')

    def restore(self, _):
        _.restore_folder('Saves', os.path.join(SteamGamesPath, 'mafia'), 'savegame')

    def detect(self):
        if os.path.isdir(os.path.join(SteamGamesPath, 'mafia')):
            return True
        return False


text:
tr.no-parameters {
    display: table-row;
}

tr.parameter + tr.no-parameters {
    display: none;
}


text:
//#define LOG_NDEBUG 0

#include "ATSParser.h"
#include <utils/KeyedVector.h>
#include <set>

namespace android {
namespace hardware {
namespace cas {
namespace native {
namespace V1_0 {
struct IDescrambler;
}}}}
using hardware::cas::native::V1_0::IDescrambler;

struct ATSParser::CasManager : public RefBase {
    CasManager();
    virtual ~CasManager();

    status_t setMediaCas(const sp<ICas> &cas);

    bool addProgram(
            unsigned programNumber, const CADescriptor &descriptor);

    bool addStream(
            unsigned programNumber, unsigned elementaryPID,
            const CADescriptor &descriptor);

    bool getCasInfo(
            unsigned programNumber, unsigned elementaryPID,
            int32_t *systemId, sp<IDescrambler> *descrambler,
            std::vector<uint8_t> *sessionId) const;

    bool isCAPid(unsigned pid);

    bool parsePID(ABitReader *br, unsigned pid);

private:
    typedef KeyedVector<unsigned, std::vector<uint8_t> > PidToSessionMap;
    struct ProgramCasManager;

    bool setSystemId(int32_t CA_system_ID);

    int32_t mSystemId;
    sp<ICas> mICas;
    KeyedVector<unsigned, sp<ProgramCasManager> > mProgramCasMap;
    PidToSessionMap mCAPidToSessionIdMap;
    std::set<uint32_t> mCAPidSet;
};

#if defined(_MSC_VER) // M3E:
struct ATSParser::CasManager::ProgramCasManager : public RefBase {
	ProgramCasManager(unsigned programNumber, const CADescriptor &descriptor);
	ProgramCasManager(unsigned programNumber);

	bool addStream(unsigned elementaryPID, const CADescriptor &descriptor);

	status_t setMediaCas(const sp<ICas> &cas, PidToSessionMap &sessionMap);

	bool getCasSession(unsigned elementaryPID,
		sp<IDescrambler> *descrambler, std::vector<uint8_t> *sessionId) const;

	void closeAllSessions(const sp<ICas>& cas);

private:
	struct CasSession {
		CasSession() {}
		CasSession(const CADescriptor &descriptor) :
			mCADescriptor(descriptor) {}

		CADescriptor mCADescriptor;
		std::vector<uint8_t> mSessionId;
		sp<IDescrambler> mDescrambler;
	};
	status_t initSession(
		const sp<ICas>& cas,
		PidToSessionMap &sessionMap,
		CasSession *session);
	void closeSession(const sp<ICas>& cas, const CasSession &casSession);

	unsigned mProgramNumber;
	bool mHasProgramCas;
	CasSession mProgramCas;
	KeyedVector<unsigned, CasSession> mStreamPidToCasMap;
};
#endif // _MSC_VER

}  // namespace android


text:
/**
 * Category for NSData which adds a utility method for converting the
 * data object to a hexidecimal string.
 */
@interface NSData (Hex)

/**
 * Returns a hexadecimal representation of the data object's contents.
 *
 * @return hexadecimal string representation
 */
- (NSString *)hexStringValue;

- (NSString *)hexRepresentationWithSpaces:(BOOL)spaces capitals:(BOOL)capitals;

@end