text:
package org.apache.jena.fuseki.server;

import java.util.function.Function;

import org.apache.jena.fuseki.server.Validators.ValidationPolicy;

public class Validator {
    public final ValidationPolicy policy;
    public final Function<String, Boolean> validator;
    public Validator(ValidationPolicy policy, Function<String, Boolean> validator) {
        super();
        this.policy = policy;
        this.validator = validator;
    }
    public String getPolicy() { return policy.label; }
}

redpajama_set_name: RedPajamaGithub


text:
// ==========================================================================
// Project:   SproutCore - JavaScript Application Framework
// Copyright: ©2006-2011 Strobe Inc. and contributors.
//            Portions ©2008-2011 Apple Inc. All rights reserved.
// License:   Licensed under MIT license (see license.js)
// ==========================================================================

sc_require("views/workspace");

/**
  @static
  @type String
  @constant
*/
SC.TO_LEFT = "TOLEFT";

/**
  @static
  @type String
  @constant
*/
SC.TO_RIGHT = "TORIGHT";

/** @class

  NavigationView is very loosely based on UINavigationController:
  that is, it implements a push/pop based API.

  NavigationView checks if the view is NavigationBuildable--that is, if it has

  Views may specify a topToolbar or bottomToolbar property. These will become the
  top or bottom toolbars of the NavigationView (which is, incidentally, a WorkspaceView).

  Of course, this process is animated...

  @author Alex Iskander
  @extends SC.WorkspaceView
  @since SproutCore 1.4
*/
SC.NavigationView = SC.WorkspaceView.extend(
/** @scope SC.NavigationView.prototype */ {

  /** @private */
  _views: null,

  /** @private */
  _current: null,

  /**
    @type SC.View
    @default SC.View
  */
  navigationContentView: SC.View,

  /** @private */
  init: function() {
    sc_super();
    this._views = [];
  },

  /** @private */
  createChildViews: function() {
    sc_super();

    // get the content
    var content = this.get("navigationContentView");

    // instantiate if needed
    if (content.isClass) content = this.createChildView(content);

    // set internal values
    this._defaultContent = this.navigationContentView = content;

    // append to the content view
    this.contentView.appendChild(content);
  },

  /** @private */
  changeNavigationContent: function(view) {
    var top = null, bottom = null;

    // find top and bottom toolbars if we are setting it to a view
    if (view) {
      top = view.get("topToolbar");
      bottom = view.get("bottomToolbar");
    }

    // instantiate top if needed
    if (top && top.isClass) {
      view.set("topToolbar", top = top.create());
    }

    // and now bottom
    if (bottom && bottom.isClass) {
      view.set("bottomToolbar", bottom = bottom.create());
    }

    // batch property changes for efficiency
    this.beginPropertyChanges();

    // update current, etc. etc.
    this._current = view;
    this.set("navigationContentView", view ? view : this._defaultContent);

    // set the top/bottom appropriately
    this.set("topToolbar", top);
    this.set("bottomToolbar", bottom);

    // and we are done
    this.endPropertyChanges();
  },

  /**
    Pushes a view into the navigation view stack. The view may have topToolbar and bottomToolbar properties.

    @param {SC.View} view The view to display
  */
  push: function(view) {
    this._currentDirection = this._current ? SC.TO_LEFT : null;

    // add current view to the stack (if needed)
    if (this._current) this._views.push(this._current);

    // update content now...
    this.changeNavigationContent(view);
  },

  /**
    Pops the current view off the navigation view stack.
  */
  pop: function() {
    this._currentDirection = SC.TO_RIGHT;

    // pop the view
    var view = this._views.pop();

    // set new (old) content view
    this.changeNavigationContent(view);
  },

  /**
    Pops to the specified view on the navigation view stack; the view you pass will become the current view.

    @param {SC.View} toView The view to display
  */
  popToView: function(toView) {
    this._currentDirection = SC.TO_RIGHT;
    var views = this._views,
        idx = views.length - 1,
        view = views[idx];

    // loop back from end
    while (view && view !== toView) {
      this._views.pop();
      idx--;
      view = views[idx];
    }

    // and change the content
    this.changeNavigationContent(view);
  },

  /** @private */
  topToolbarDidChange: function() {
    var active = this.activeTopToolbar, replacement = this.get("topToolbar");

    // if we have an active toolbar, set the build direction and build out
    if (active) {
      if (this._currentDirection !== null) {
        active.set("buildDirection", this._currentDirection);
        this.buildOutChild(active);
      } else {
        this.removeChild(active);
      }
    }

    // if we have a new toolbar, set the build direction and build in
    if (replacement) {
      if (this._currentDirection !== null) {
        replacement.set("buildDirection", this._currentDirection);
        this.buildInChild(replacement);
      } else {
        this.appendChild(replacement);
      }
    }

    // update, and queue retiling
    this.activeTopToolbar = replacement;
    this.invokeOnce("childDidChange");
  }.observes("topToolbar"),

  /** @private */
  bottomToolbarDidChange: function() {
    var active = this.activeBottomToolbar, replacement = this.get("bottomToolbar");

    if (active) {
      if (this._currentDirection !== null) {
        active.set("buildDirection", this._currentDirection);
        this.buildOutChild(active);
      } else {
        this.removeChild(active);
      }
    }
    if (replacement) {
      if (this._currentDirection !== null) {
        replacement.set("buildDirection", this._currentDirection);
        this.buildInChild(replacement);
      } else {
        this.appendChild(replacement);
      }
    }

    this.activeBottomToolbar = replacement;
    this.invokeOnce("childDidChange");
  }.observes("topToolbar"),

  /** @private */
  contentViewDidChange: function() {
    var active = this.activeNavigationContentView, replacement = this.get("navigationContentView");

    // mix in navigationbuilder if needed
    if (!replacement.isNavigationBuilder) {
      replacement.mixin(SC.NavigationBuilder);
    }

    // tiling really needs to happen _before_ animation
    // so, we set "pending" and queue tiling.
    this._pendingBuildOut = active;
    this._pendingBuildIn = replacement;

    this.activeNavigationContentView = replacement;
    this.invokeOnce("childDidChange");
  }.observes("navigationContentView"),

  /** @private */
  childDidChange: function() {
    var replacement = this._pendingBuildIn, active = this._pendingBuildOut;
    if (active) {
      if (this._currentDirection !== null) {
        active.set("buildDirection", this._currentDirection);
        this.contentView.buildOutChild(active);
      } else {
        this.contentView.removeChild(active);
      }
    }

    this._scws_tile();

    if (replacement) {
      if (this._currentDirection !== null) {
        replacement.set("buildDirection", this._currentDirection);
        this.contentView.buildInChild(replacement);
      } else {
        this.contentView.appendChild(replacement);
      }
    }
  }

});


text:
import os
import glob
import string
import platform

import pingo

class DetectionFailed(Exception):
    def __init__(self):
        super(DetectionFailed, self).__init__()
        self.message = 'Pingo is not able to detect your board.'

def _read_cpu_info():
    cpuinfo = {}
    # pattern = '(?P<key>[^\t\n]*)\t{1,2}: (?P<value>\.*)\n'
    with open('/proc/cpuinfo', 'r') as fp:
        for line in fp:
            line = line.strip()
            if line:
                tokens = tuple(
                    token.strip() for token in line.split(':'))
            cpuinfo[tokens[0]] = tokens[-1]
    return cpuinfo

def _find_arduino_dev(system):
    if system == 'Linux':
        # TODO: filter possible devices with glob
        devices = []
        for dev in os.listdir('/dev/'):
            if ('ttyUSB' in dev) or ('ttyACM' in dev):
                devices.append(dev)
        if len(devices) == 1:
            return os.path.join(os.path.sep, 'dev', devices[0])

    elif system == 'Darwin':
        devices = (glob.glob('/dev/tty.usbmodem*')
                   + glob.glob('/dev/tty.usbserial*'))
        if len(devices) == 1:
            return os.path.join(os.path.sep, 'dev', devices[0])
    return False

def get_board():
    machine = platform.machine()
    system = platform.system()

    if machine == 'x86_64':
        if system in ['Linux', 'Darwin']:
            # TODO: Try to find 'Arduino' inside dmesg output
            device = _find_arduino_dev(system)
            if device:
                return pingo.arduino.ArduinoFirmata(device)

        print('Using GhostBoard...')
        # TODO decide which board return
        return pingo.ghost.GhostBoard()

    elif machine == 'i586':
        # TODO: assume it's a Galileo2
        # FIXME: detect Galileo gen1. and Edison
        return pingo.galileo.Galileo2()

    elif machine == 'armv6l':
        # FIXME: Regex does not work.
        # with open('/proc/cpuinfo', 'r') as fp:
        #    info = fp.read()
        # #TODO: Use this code in _read_cpu_info
        # pattern = '(?P<key>[^\t\n]*)\t{1,2}: (?P<value>\.*)\n'

        cpuinfo = _read_cpu_info()
        revision = string.atoi(cpuinfo['Revision'], 16)  # str to hex

        if revision < 16:
            print('Using RaspberryPi...')
            return pingo.rpi.RaspberryPi()
        else:
            print('Using RaspberryPi Model B+...')
            return pingo.rpi.RaspberryPiBPlus()

    elif machine == 'armv7l':
        if system == 'Linux':
            hardware = _read_cpu_info()['Hardware']
            lsproc = os.listdir('/proc/')
            adcx = [p for p in lsproc if p.startswith('adc')]

            if len(adcx) == 6:
                print('Using PcDuino...')
                return pingo.pcduino.PcDuino()

            if 'Generic AM33XX' in hardware:
                print('Using Beaglebone...')
                return pingo.bbb.BeagleBoneBlack()

            if 'SECO i.Mx6 UDOO Board' in hardware:
                print('Using Udoo...')
                return pingo.udoo.Udoo()

            if hardware == 'BCM2709':
                print('Using RaspberryPi 2 Model B...')
                return pingo.rpi.RaspberryPi2B()

    raise DetectionFailed()

# TODO: deprecate legacy "MyBoard" factory name
MyBoard = get_board


text:
package com.sensorberg.sdk.internal;

import com.sensorberg.sdk.Logger;
import com.sensorberg.sdk.internal.interfaces.FileManager;

import android.content.Context;

import java.io.Closeable;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;

public class AndroidFileManager implements FileManager {

    protected final Context context;

    public AndroidFileManager(Context ctx) {
        context = ctx;
    }

    @Override
    public File getFile(String fileName) {
        return new File(context.getFilesDir() + File.separator + fileName);
    }

    @Override
    public void write(Serializable serializableObject, String fileName) {
        write(serializableObject, getFile(fileName));
    }

    @SuppressWarnings("ResultOfMethodCallIgnored")
    @Override
    public void removeFile(String fileName) {
        getFile(fileName).delete();
    }

    @Override
    public boolean write(Serializable object, File file) {
        FileOutputStream fos = null;
        ObjectOutputStream oos = null;
        try {
            fos = new FileOutputStream(file);
            oos = new ObjectOutputStream(fos);
            oos.writeObject(object);
            return true;
        } catch (Exception e) {
            Logger.log.logError("error writing file", e);
        } finally {
            Closeables.close(fos);
            Closeables.close(oos);
        }
        return false;
    }

    @Override
    public Object getContentsOfFileOrNull(File file) {
        FileInputStream fis = null;
        ObjectInputStream ois = null;
        try {
            fis = new FileInputStream(file);
            ois = new ObjectInputStream(fis);
            return ois.readObject();
        } catch (Exception e) {
            Logger.log.logError("error reading file", e);
        } finally {
            Closeables.close(fis);
            Closeables.close(ois);
        }

        return null;
    }

    static class Closeables {

        @SuppressWarnings("EmptyCatchBlock")
        public static void close(Closeable closeable) {
            if (closeable != null) {
                try {
                    closeable.close();
                } catch (IOException e) {

                }
            }
        }
    }
}


text:
<?php

namespace Seahinet\Retailer\ViewModel;

class Shipping extends AbstractViewModel
{

    protected $methods = null;

    public function getMethods()
    {
        if (is_null($this->methods)) {
            $this->methods = $this->getConfig()['system']['shipping']['children'];
        }
        return $this->methods;
    }

    public function getInputBoxes($code)
    {
        foreach ($this->methods[$code]['children'] as $key => $item) {
            if ($key === 'model') {
                yield '';
            } else {
                $class = empty($item['view_model']) ? '\\Seahinet\\Lib\\ViewModel\\Template' : $item['view_model'];
                if (in_array($item['type'], ['select', 'checkbox', 'radio', 'multiselect']) && !isset($item['options']) && isset($item['source'])) {
                    $item['options'] = (new $item['source'])->getSourceArray();
                }
                $item['value'] = $this->getConfig()['s' . $this->getRetailer()['store_id'] . '/shipping/' . $code . '/' . $key];
                $box = new $class;
                $box->setVariables([
                    'key' => $code . '/' . $key,
                    'item' => $item,
                    'parent' => $this
                ]);
                yield $box->setTemplate('page/renderer/' . $item['type'], false);
            }
        }
    }

}


text:
layout: book
title: "84k"
author: "Claire North"
isbn: "9791028115333"
editor: "Bragelonne"
---
![Couverture](/img/9791028115333.jpg)Théo Miller connaît la valeur de la vie humaine - jusqu'au dernier centime.

Au Bureau d'audit des crimes, son rôle consiste à évaluer chaque dossier qui lui est confié et à s'assurer que les criminels paient intégralement leur dette à la société.

Mais lorsque son amour d'enfance est assassinée, tout change. Cette mort est la seule qui ne peut se résumer à une ligne de plus dans un bilan annuel.

Car si les puissants de ce monde peuvent tuer en toute impunité, il arrive parfois que le compte n'y soit pas.


text:
import itertools
import re
import numpy as np
import os
import time

import SyntaxValidator as sv

import unittest
import RangeParserMasks as rp

import UnitTests_TestDicts as td

class testRangeParserMasks(unittest.TestCase):

    def testRanges(self):

        types_list = [td.basicHandsPlain, td.basicHandsVars, td.basicHandsBrackets]
        test_list = [td.basicHands1, td.basicHands2, td.basicHands3]
        macros_list = [td.macros1, td.macros2, td.macros3]
        long_list = [td.dictOne, td.dictTwo, td.dictThree, td.dictFour, td.dictFive, td.dictSix, td.dictSeven, td.dictEight]

        all_list = types_list+test_list+macros_list+long_list

        for testDict in long_list:

            for myKey in testDict:

                rangeCards,rangeMask = rp.evaluate(myKey)
                self.assertTrue(len(rangeCards)==testDict[myKey],msg="Range mismatch {} {} {}".format(myKey,len(rangeCards),testDict[myKey]))

tester = testRangeParserMasks()
tester.testRanges()


text:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>execution::bulk_guarantee</title>
<link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../boost_asio.html" title="Boost.Asio">
<link rel="up" href="../reference.html" title="Reference">
<link rel="prev" href="execution__bulk_execute.html" title="execution::bulk_execute">
<link rel="next" href="execution__bulk_guarantee_t.html" title="execution::bulk_guarantee_t">

Home
Libraries
People
FAQ
More

execution::bulk_guarantee

A
        special value used for accessing the execution::bulk_guarantee_t
        property.

constexpr bulk_guarantee_t bulk_guarantee;

        Requirements

        Header: boost/asio/execution/bulk_guarantee.hpp

        Convenience header: boost/asio/execution.hpp

Copyright © 2003-2021 Christopher
      M. Kohlhoff

        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


text:
scriptDir=$0
scriptDir=${scriptDir/\/export-monitoring.sh/$''}
libDir=$scriptDir'/lib'

if [  -d "libDir" ]; then
    echo "Runtimes library does not exist - make sure you are running the "
    echo "archive with 'dist' in the name, not the one labeled: 'source'."
    exit
fi

if [ -x "$JAVA_HOME/bin/java" ]; then
    JAVA="$JAVA_HOME/bin/java"
else
    JAVA=`which java`
fi

echo "Using ${JAVA} as Java Runtime"

if [ ! -x "$JAVA" ]; then
    echo "Could not find any executable java binary. Please install java in your PATH and/or set JAVA_HOME"
    exit 1
fi

[[ ${DIAG_DEBUG} != "" ]] && export DIAG_DEBUG_OPTS=" -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=8000,suspend=y"

[[ ${DIAG_JAVA_OPTS} == "" ]] && export DIAG_JAVA_OPTS="-Xms256m -Xmx2000m"

echo "Using ${DIAG_JAVA_OPTS} ${DIAG_DEBUG_OPTS} for options."
"$JAVA" $DIAG_JAVA_OPTS ${DIAG_DEBUG_OPTS} -cp ${scriptDir}/config:${scriptDir}/lib/*  com.elastic.support.monitoring.MonitoringExportApp "$@"


text:
package org.robolectric.shadows;

import static android.content.Context.KEYGUARD_SERVICE;
import static android.os.Build.VERSION_CODES.M;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.robolectric.Shadows.shadowOf;

import android.app.KeyguardManager;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RuntimeEnvironment;
import org.robolectric.TestRunners;
import org.robolectric.annotation.Config;

@RunWith(TestRunners.MultiApiSelfTest.class)
public class ShadowKeyguardManagerTest {

  private KeyguardManager manager;

  @Before
  public void setUp() {
    manager = (KeyguardManager) RuntimeEnvironment.application.getSystemService(KEYGUARD_SERVICE);
  }

  @Test
  public void testIsInRestrcitedInputMode() {

    assertThat(manager.inKeyguardRestrictedInputMode()).isFalse();
    ShadowKeyguardManager shadowMgr = shadowOf(manager);
    shadowMgr.setinRestrictedInputMode(true);
    assertThat(manager.inKeyguardRestrictedInputMode()).isTrue();
  }

  @Test
  public void testShouldBeAbleToDisableTheKeyguardLock() throws Exception {
    KeyguardManager.KeyguardLock lock = manager.newKeyguardLock(KEYGUARD_SERVICE);
    assertTrue(shadowOf(lock).isEnabled());

    lock.disableKeyguard();
    assertFalse(shadowOf(lock).isEnabled());

    lock.reenableKeyguard();
    assertTrue(shadowOf(lock).isEnabled());
  }

  @Test
  @Config(minSdk = M)
  public void isKeyguardSecure() {
    assertThat(manager.isKeyguardSecure()).isFalse();

    ShadowKeyguardManager shadowMgr = shadowOf(manager);
    shadowMgr.setIsKeyguardSecure(true);

    assertThat(manager.isKeyguardSecure()).isTrue();
  }

  @Test
  @Config(minSdk = M)
  public void isDeviceSecure() {
    assertThat(manager.isDeviceSecure()).isFalse();

    ShadowKeyguardManager shadowMgr = shadowOf(manager);
    shadowMgr.setIsDeviceSecure(true);

    assertThat(manager.isDeviceSecure()).isTrue();
  }
}


text:
simple Python script to easily delete albums on Google Play Music

lists all the albums in your google play music collection and lets you delete them with one key stroke

needs gmusicapi library, install it with pip

You need to enter your Google account data in the script. If you're using 2 factor authentication, create an app-specific password (https://security.google.com/settings/security/apppasswords)


text:
import BaseEvented from './BaseEvented';
import {helper} from './helper';
import IDBStore from './IDBStore';
/**
 * this class depends on axemclion/IndexedDBShim
 * @class com.sesamtv.core.util.store.IndexedDBStore
 * @extends com.sesamtv.core.util.BaseEvented
 */
export default
class IndexedDBWrapper extends BaseEvented {

    constructor(config) {
        super();
        this.config = {
            dbName: '',
            version: 1,
            stores: {},
            operatorMapping: {
                "eq": "=",
                "gt": ">",
                "gte": ">=",
                "lt": "<",
                "lte": "<="
            },
            forceShim: false,
            timeFormat: /^(\d{4})(-(\d{2}))??(-(\d{2}))??(T(\d{2}):(\d{2})(:(\d{2}))??(\.(\d+))??(([\+\-]{1}\d{2}:\d{2})|Z)??)??$/,
            schema: {}
        };
        config && helper.mixin(this.config, config);

    }

    indexedDB() {
        return window.indexedDB
            || window.msIndexedDB
            || window.mozIndexedDB
            || window.webkitIndexedDB;
    }

    open(dbConfig) {
        var self = this;
        this.config.dbName = dbConfig.dbName;
        this.config.version = dbConfig.version;
        return new Promise((resolve, reject) => {
            var req = this.indexedDB().open(this.config.dbName, this.config.version);
            req.onsuccess = function (evt) {
                // Better use "this" than "req" to get the result to avoid problems with
                // garbage collection.
                // db = req.result;
                self.db = this.result;
                self.db.onerror = function (evt) {
                    //global error
                    self.emit('error', evt.target.error.message);
                };
                resolve(self.db);

            };
            req.onerror = function (evt) {
                reject(evt.target.error);
            };
            req.onupgradeneeded = function (e) {
                console.log('onupgradeneeded');
                self.db = this.result;
                if (!dbConfig.schema || dbConfig.schema.length === 0) {
                    throw new Error('no schema defined, can not upgrade');
                }
                if (e.oldVersion >= dbConfig.schema[dbConfig.schema.length - 1].version) {
                    return;
                }
                self.config.oldVersion = e.oldVersion;
                self.schema(dbConfig.schema);
            };
        });
    }

    schema(schemas) {
        this.config.schema = schemas;
        schemas.forEach(function (schema) {
            if (schema.version > this.config.oldVersion) {
                this._schema(schema.schema);
            }
        }, this);
    }

    /**
     *
     * @param schema
     */
    _schema(schema) {
        var thisDB = this.db;
        Object.keys(schema).forEach(function (storeName) {
            var storeConf = schema[storeName], objectStore;
            if (thisDB.objectStoreNames.contains(storeName)) {
                objectStore = thisDB.transaction([storeName], 'readwrite').objectStore(storeName);
                //for upgrading
                if (storeConf.alter) {
                    storeConf.alter.forEach(function (alter) {
                        if (alter.param) {
                            objectStore[alter.action].apply(objectStore, alter.param);
                        } else {
                            objectStore[alter.action]();
                        }
                    });
                }
            } else {
                objectStore = thisDB.createObjectStore(storeName, storeConf.keyPath);
            }
            if (storeConf.indexes) {
                Object.keys(storeConf.indexes).forEach(function (idxName) {
                    var idxConf = storeConf.indexes[idxName];
                    objectStore.createIndex(idxName, idxConf.index, {
                        unique: idxConf.unique
                    });
                });
            }
        }, this);
    }

    store(storeName) {
        if (this.config.stores[storeName]) {
            return this.config.stores[storeName];
        }
        if (this.db.objectStoreNames.contains(storeName)) {
            return this.config.stores[storeName] = new IDBStore(this, storeName);
        }
    }

    /**
     * items format:
     *
     *
     * {"put":[],"delete":[],"upsert":[{
     *  "index":"myIndex",
     *  "key":["_id","username"]
     *  "data":{
     *      "_id":123123,
     *      "username":"admin",
     *      "key":null
     *  },
     *  "merge":true
     * }]}
     *
     * or
     *
     *      [
     *          {method:'add',data:{...}},
     *          {method:'delete',data:keyPathValue},
     *          {method:'delete',data:indexValue,index:'id'}
     *      ]
     *
     * @param {Object} items
     * @param {String} [storeName]
     * @returns {Promise}
     */
    bulk(items, storeName) {
        var self = this;
        return new Promise((resolve, reject)=> {
            var parsedItems = [], item,
                itemStore = this.getStore(storeName, 'readwrite', {
                    onerror: function (evt) {
                        var error = evt.target.error;
                        error.storeName = storeName;
                        error.item = item;
                        reject(error);
                    }
                }), res = [];

            if (Array.isArray(items)) {
                parsedItems = items;
            } else {
                Object.keys(items).forEach(function (method) {
                    parsedItems = parsedItems.concat(items[method].map(function (data) {
                        return {
                            method: method,
                            data: data
                        };
                    }));
                });
            }

            function putNext(evt) {
                var req;
                if (evt) {
                    res.push(this.result);
                }
                if (parsedItems.length) {
                    item = parsedItems.shift();
                    if (item.method === 'upsert') {
                        if (item.data.index) {
                            if (itemStore.indexNames.contains(item.data.index)) {
                                if (!item.data.key) {
                                    item.data.key = item.data.index;
                                }
                                req = itemStore.index(item.data.index)
                                    .get(Array.isArray(item.data.key) ? item.data.key.map(function (k) {
                                        return item.data.data[k];
                                    }) : item.data.data[item.data.key]);

                            } else {
                                return reject(new Error('index name not found'));
                            }
                        } else {
                            req = itemStore.get(item.data.data[itemStore.keyPath]);
                        }
                        req.onsuccess = function (evt) {
                            if (this.result) {
                                if (item.data.merge) {
                                    item.data.data = self.mergeData(this.result, item.data.data);
                                } else {
                                    if (item.data.key) {
                                        if (Array.isArray(item.data.key)) {
                                            item.data.key.forEach(function (k) {
                                                item.data.data[k] = this.result[k];
                                            }, this);
                                        } else {
                                            item.data.data[item.data.key] = this.result[item.data.key];
                                        }
                                    }
                                    item.data.data[itemStore.keyPath] = this.result[itemStore.keyPath];
                                }
                            }
                            itemStore.put(item.data.data).onsuccess = putNext;
                        }
                    } else {
                        if (item.index) {
                            req = itemStore.index(item.index)[item.method](item.data);
                        } else {
                            req = itemStore[item.method](item.data);
                        }
                        req.onsuccess = putNext;
                    }

                } else {
                    resolve({
                        results: res,
                        store: storeName
                    });
                }
            }

            putNext();
        });
    }

    getStore(storeName, mode, opt) {
        var trans = this.openTransaction(storeName, mode, opt);
        return trans.objectStore(storeName);
    }

    mergeData(src, data) {
        Object.keys(data).forEach(function (k) {
            if (data[k] === null) {
                delete src[k];
            } else {
                src[k] = data[k];
            }
        });
        return src;
    }

    openTransaction(storeName, mode, opt) {
        opt = opt || {};
        var trans = this.db.transaction(storeName, mode);
        if ('oncomplete' in opt) {
            trans.oncomplete = opt.oncomplete;
        }
        if ('onabort' in opt) {
            trans.onabort = opt.onabort;
        }
        if ('onerror' in opt) {
            trans.onerror = opt.onerror;
        }
        return trans;
    }

    dropDB() {
        this.close();
        return this.indexedDB().deleteDatabase(this.config.dbName);
    }

    close() {
        return this.db.close();
    }

}


text:
#ifndef __GPU_SYSCALL_HELPER_HH__
#define __GPU_SYSCALL_HELPER_HH__

#include "arch/isa.hh"
#include "base/types.hh"
#include "cpu/thread_context.hh"

#if THE_ISA == ARM_ISA
    // Currently supports 32-bit ARM platform
    #define __POINTER_SIZE__ 4
    #define __POINTER_MASK__ 0xFFFFFFFF

    // Helper functions for unpacking data on 32-bit targets. NOTE: This code
    // assumes that the data is laid out little-endian, as on x86 hosts.
    template <typename T>
    T unpackData(uint8_t *package, unsigned index) {
        return (T) *((T*)&package[index]);
    }

    template <typename T>
    T unpackPointer(uint8_t *package, unsigned index) {
        return (T) ((Addr)unpackData<T>(package, index) & __POINTER_MASK__);
    }

#elif THE_ISA == X86_ISA
    // Currently supports 64-bit x86 platform
    #define __POINTER_SIZE__ 8
    #define __POINTER_MASK__ 0xFFFFFFFFFFFFFFFF
#else
    #error Currently gem5-gpu is only known to support x86 and ARM
#endif

typedef struct gpucall {
    int total_bytes;
    int num_args;
    Addr arg_lengths;
    Addr args;
    Addr ret;
} gpusyscall_t;

class GPUSyscallHelper {
    ThreadContext* tc;
    Addr sim_params_ptr;
    gpusyscall_t sim_params;
    int* arg_lengths;
    unsigned char* args;
    int total_bytes;

    // Without being too invasive in the CUDA syscalls code, temporarily hold
    // the current unpackaged parameter for the calling function to grab in
    // this variable. TODO: Eventually convert the getParam() function to a
    // template function that handles casting appropriately for the CUDA
    // syscalls functions to avoid messy casting and dereferencing.
    unsigned char* live_param;

    void decode_package();
    void readBlob(Addr addr, uint8_t* p, int size, ThreadContext *tc);
    void readString(Addr addr, uint8_t* p, int size, ThreadContext *tc);
    void writeBlob(Addr addr, uint8_t* p, int size,
                   ThreadContext *tc, bool is_ptr);
  public:
    GPUSyscallHelper(ThreadContext* _tc, gpusyscall_t* _call_params = NULL);
    ~GPUSyscallHelper();
    void* getParam(int index, bool is_ptr = false);
    void setReturn(unsigned char* retValue, size_t size, bool is_ptr = false);
    ThreadContext* getThreadContext() { return tc; }
    void readBlob(Addr addr, uint8_t* p, int size) {
        readBlob(addr, p, size, tc);
    }
    void readString(Addr addr, uint8_t* p, int size) {
        readString(addr, p, size, tc);
    }
    void writeBlob(Addr addr, uint8_t* p, int size, bool is_ptr = false) {
        writeBlob(addr, p, size, tc, is_ptr);
    }
};

#endif


text:
Cantina: Assets
============

Asset aggregator and minifier for Cantina applications.

**Note:** Currently very specific to a particular use-case (RequireJS/Marionette/Plain CSS).

Provides
--------

- **app.assets** - The Assets API

Configuration
-------------

Specify your app's CSS and JS files via `styles` and `scripts` keys,
respectively, in your conf. Then setup how `cantina-assets` should handle them:

```js
{
  "assets": {
    "optimize": "enabled" // Will run all optimizers on `app.start()`
    "css": {
      "foo": { // Custom namespaces allow for multiple aggregates.
        "root": "/path/to/dir",
        "dirs": [ // Additional directories from which to fetch "/public" files.
          "/path/to/assets",
          "/another/path"
        ],
        "aggregate": true,
        "prefix": true,
        "minify": true,
        "serve": true
        "match": [ // Define an array of RegEx patterns to match files against.
          "^/foo"
        ],
        "exclude": [ // Define an array of RegEx patterns to exclude files.
          "^do",
          "not",
          "want$"
        ]
      }
    },
    "js": {
      "bar": {
        "aggregate": true,
        "minify": true,
        "serve": true
        "match": [
          "^/bar"
        ]
      }
    },
    "templates": {
      "baz": {
        "aggregate": true,
        "minify": false
      }
    }
  }
}
```

Usage
-----

If `app.conf.get('assets:optimize') === 'enabled'` then your assets will be run
through the optimization steps as soon as `app.start()` is called, respecting
all flags per namespace.

API
---

**app.assets.[css|js|templates].aggregate (namespace, cb)**

Aggregates asset files into one file, as per the conf's namespace definition.

**app.assets.[css|js|templates].minify (namespace, cb)**

Minifies asset files (only applies if they are aggregated as well).

**app.assets.css.prefix (namespace, cb)**

Adds certain vendor-prefixes to CSS attributes (only applies if they are aggregated as well).

**app.assets.[css|js|templates].serve (namespace, cb)**

Serves the optimized assets via [dish](https://www.github.com/carlos8f/node-dish) (only applies if they are aggregated as well).

**app.assets.[css|js|templates].[aggregate|minify|prefix|serve]All (cb)**

Runs modifier on all namespaces.

**app.assets.[css|js|templates].optimize (cb)**

Runs all modifiers on all namespaces.

- - -

### Developed by [Terra Eclipse](http://www.terraeclipse.com)
Terra Eclipse, Inc. is a nationally recognized political technology and
strategy firm located in Santa Cruz, CA and Washington, D.C.


text:
package com.bitdubai.sub_app.wallet_factory.ui.fragments;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;

import com.bitdubai.fermat_android_api.layer.definition.wallet.FermatFragment;
import com.bitdubai.fermat_api.layer.all_definition.enums.WalletCategory;
import com.bitdubai.fermat_api.layer.all_definition.enums.WalletType;
import com.bitdubai.fermat_api.layer.all_definition.navigation_structure.Activity;
import com.bitdubai.fermat_api.layer.all_definition.navigation_structure.Fragment;
import com.bitdubai.fermat_api.layer.all_definition.navigation_structure.MainMenu;
import com.bitdubai.fermat_api.layer.all_definition.navigation_structure.MenuItem;
import com.bitdubai.fermat_api.layer.all_definition.navigation_structure.SideMenu;
import com.bitdubai.fermat_api.layer.all_definition.navigation_structure.StatusBar;
import com.bitdubai.fermat_api.layer.all_definition.navigation_structure.Tab;
import com.bitdubai.fermat_api.layer.all_definition.navigation_structure.TabStrip;
import com.bitdubai.fermat_api.layer.all_definition.navigation_structure.TitleBar;
import com.bitdubai.fermat_api.layer.all_definition.navigation_structure.WalletNavigationStructure;
import com.bitdubai.fermat_api.layer.all_definition.navigation_structure.enums.Activities;
import com.bitdubai.fermat_api.layer.all_definition.navigation_structure.enums.Fragments;
import com.bitdubai.fermat_api.layer.all_definition.navigation_structure.interfaces.FermatCallback;
import com.bitdubai.fermat_api.layer.dmp_module.wallet_manager.InstalledWallet;
import com.bitdubai.sub_app.wallet_factory.R;

import java.util.ArrayList;

/**
 * Available projects fragment to clone
 *
 * @author Francisco Vasquez
 * @author Matias Furszy
 * @version 1.0
 */
public class AvailableProjectsFragmentOld extends FermatFragment implements FermatCallback{

    /**
     * Views
     */
    private View rootView;
    private ListView listView;

    private ArrayList<InstalledWallet> wallets;

    public static FermatFragment newInstance() {
        return new AvailableProjectsFragmentOld();
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        /*
        wallets = new ArrayList<>();
        Wallet wallet = new Wallet();
        wallet.setNavigation(startWalletNavigationStructure());
        wallets.add(wallet);
        wallets.add(wallet);
        wallets.add(wallet);
        wallets.add(wallet);
        wallets.add(wallet);
        wallets.add(wallet);
        wallets.add(wallet);
        wallets.add(wallet);
        */
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        rootView = inflater.inflate(R.layout.factory_available_projects_old_fragment, container, false);

        listView = (ListView) rootView.findViewById(R.id.projects);
        ArrayAdapter<InstalledWallet> adapter = new ArrayAdapter<InstalledWallet>(getActivity(), android.R.layout.simple_list_item_1, wallets);
        listView.setAdapter(adapter);

        listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
                /**
                 * Francisco por ahora pasale de primer parametro la estructura de navegación y de segundo la InstalledWallet,
                 *
                 * Usá el metodo ese de changeActivity, y pasale esos parametros, despues lo que va a hacer esto es pintarte en la pantalla toda la wallet con tu estructura de navegación
                 * y los fragmentos nuevos que acabas de poner
                 */
//

                Object[] o = new Object[2];
                o[0] = (Object) startWalletNavigationStructure();
                o[1] = (Object) wallets.get(i);

                //TODO: Como tercer parametro me tenes que pasar el Skin de la wallet que vas a cambiar así lo pinto por pantalla y se va cambiando

                //TODO: tenes que conseguir el skin desde el tu module o desde algún lado
                //o[2] = (Object)

                o[3] = this;
                changeActivity(Activities.CWP_WALLET_FACTORY_EDIT_WALLET.getCode(), o);
            }
        });

        return rootView;
    }

    /**
     * Meanwhile
     *
     * @return
     */

    private WalletNavigationStructure startWalletNavigationStructure() {

        Activity runtimeActivity;
        Fragment runtimeFragment;
        WalletNavigationStructure runtimeWalletNavigationStructure;
        TitleBar runtimeTitleBar;
        SideMenu runtimeSideMenu;
        MainMenu runtimeMainMenu;
        MenuItem runtimeMenuItem;
        TabStrip runtimeTabStrip;
        StatusBar runtimeStatusBar;

        Tab runtimeTab;

        String publicKey;

        runtimeWalletNavigationStructure = new WalletNavigationStructure();
        runtimeWalletNavigationStructure.setWalletCategory(WalletCategory.REFERENCE_WALLET.getCode());
        runtimeWalletNavigationStructure.setWalletType(WalletType.REFERENCE.getCode());
        publicKey = "test_wallet";
        runtimeWalletNavigationStructure.setPublicKey(publicKey);
        //listWallets.put(publicKey, runtimeWalletNavigationStructure);

        runtimeActivity = new Activity();
        runtimeActivity.setType(Activities.CWP_WALLET_RUNTIME_WALLET_BASIC_WALLET_BITDUBAI_VERSION_1_MAIN);
        runtimeActivity.setColor("#8bba9e");
        runtimeWalletNavigationStructure.addActivity(runtimeActivity);
        runtimeWalletNavigationStructure.setStartActivity(runtimeActivity.getType());

        runtimeTitleBar = new TitleBar();
        runtimeTitleBar.setLabel("bitDubai bitcoin Wallet");
        runtimeTitleBar.setLabelSize(16);

        runtimeActivity.setTitleBar(runtimeTitleBar);
        runtimeActivity.setColor("#72af9c");
        //runtimeActivity.setColor("#d07b62");

        runtimeStatusBar = new com.bitdubai.fermat_api.layer.all_definition.navigation_structure.StatusBar();
        runtimeStatusBar.setColor("#72af9c");

        runtimeActivity.setStatusBar(runtimeStatusBar);

        runtimeTabStrip = new TabStrip();

        runtimeTabStrip.setTabsColor("#8bba9e");

        runtimeTabStrip.setTabsTextColor("#FFFFFF");

        runtimeTabStrip.setTabsIndicateColor("#72af9c");

        runtimeTab = new Tab();
        runtimeTab.setLabel("Send");
        runtimeTab.setFragment(Fragments.CWP_WALLET_RUNTIME_WALLET_BITCOIN_ALL_BITDUBAI_SEND);
        runtimeTabStrip.addTab(runtimeTab);

        runtimeTab = new Tab();
        runtimeTab.setLabel("Balance");
        runtimeTab.setFragment(Fragments.CWP_WALLET_RUNTIME_WALLET_BITCOIN_ALL_BITDUBAI_BALANCE);
        runtimeTabStrip.addTab(runtimeTab);
        runtimeTabStrip.setStartItem(1);

        runtimeTab = new Tab();
        runtimeTab.setLabel("Receive");
        runtimeTab.setFragment(Fragments.CWP_WALLET_RUNTIME_WALLET_BITCOIN_ALL_BITDUBAI_RECEIVE);
        runtimeTabStrip.addTab(runtimeTab);
        /*
        runtimeTab = new Tab();
        runtimeTab.setLabel("Transactions");
        runtimeTab.setFragment(Fragments.CWP_WALLET_RUNTIME_WALLET_BITCOIN_ALL_BITDUBAI_TRANSACTIONS);
        runtimeTabStrip.addTab(runtimeTab);

        runtimeTab = new Tab();
        runtimeTab.setLabel("Money request");
        runtimeTab.setFragment(Fragments.CWP_WALLET_RUNTIME_WALLET_BITCOIN_ALL_BITDUBAI_MONEY_REQUEST);
        runtimeTabStrip.addTab(runtimeTab);

        */

        runtimeTab = new Tab();
        runtimeTab.setLabel("Contacts");
        runtimeTab.setFragment(Fragments.CWP_WALLET_RUNTIME_WALLET_BITCOIN_ALL_BITDUBAI_CONTACTS);
        runtimeTabStrip.addTab(runtimeTab);

        runtimeTabStrip.setDividerColor(0x72af9c);
        //runtimeTabStrip.setBackgroundColor("#72af9c");
        runtimeActivity.setTabStrip(runtimeTabStrip);

        runtimeFragment = new Fragment();
        runtimeFragment.setType(Fragments.CWP_WALLET_RUNTIME_WALLET_BITCOIN_ALL_BITDUBAI_BALANCE.getKey());
        runtimeActivity.addFragment(Fragments.CWP_WALLET_RUNTIME_WALLET_BITCOIN_ALL_BITDUBAI_BALANCE.getKey(), runtimeFragment);

        runtimeFragment = new Fragment();
        runtimeFragment.setType(Fragments.CWP_WALLET_RUNTIME_WALLET_BITCOIN_ALL_BITDUBAI_SEND.getKey());
        runtimeFragment.setBack(Fragments.CWP_WALLET_RUNTIME_WALLET_BITCOIN_ALL_BITDUBAI_CONTACTS.getKey());
        runtimeActivity.addFragment(Fragments.CWP_WALLET_RUNTIME_WALLET_BITCOIN_ALL_BITDUBAI_SEND.getKey(), runtimeFragment);

        runtimeFragment = new Fragment();
        runtimeFragment.setType(Fragments.CWP_WALLET_RUNTIME_WALLET_BITCOIN_ALL_BITDUBAI_RECEIVE.getKey());
        runtimeActivity.addFragment(Fragments.CWP_WALLET_RUNTIME_WALLET_BITCOIN_ALL_BITDUBAI_RECEIVE.getKey(), runtimeFragment);

//        runtimeFragment = new Fragment();
//        runtimeFragment.setType(Fragments.CWP_WALLET_RUNTIME_WALLET_BITCOIN_ALL_BITDUBAI_TRANSACTIONS);
//        runtimeActivity.addFragment(Fragments.CWP_WALLET_RUNTIME_WALLET_BITCOIN_ALL_BITDUBAI_TRANSACTIONS,runtimeFragment);

        runtimeFragment = new Fragment();
        runtimeFragment.setType(Fragments.CWP_WALLET_RUNTIME_WALLET_BITCOIN_ALL_BITDUBAI_MONEY_REQUEST.getKey());
        runtimeFragment.setBack(Fragments.CWP_WALLET_RUNTIME_WALLET_BITCOIN_ALL_BITDUBAI_CONTACTS.getKey());
        runtimeActivity.addFragment(Fragments.CWP_WALLET_RUNTIME_WALLET_BITCOIN_ALL_BITDUBAI_MONEY_REQUEST.getKey(), runtimeFragment);

        runtimeFragment = new Fragment();
        runtimeFragment.setType(Fragments.CWP_WALLET_RUNTIME_WALLET_BITCOIN_ALL_BITDUBAI_CONTACTS.getKey());
        runtimeActivity.addFragment(Fragments.CWP_WALLET_RUNTIME_WALLET_BITCOIN_ALL_BITDUBAI_CONTACTS.getKey(), runtimeFragment);

        runtimeFragment = new Fragment();
        runtimeFragment.setType(Fragments.CWP_WALLET_RUNTIME_WALLET_BITCOIN_ALL_BITDUBAI_CREATE_CONTACTS.getKey());
        runtimeFragment.setBack(Fragments.CWP_WALLET_RUNTIME_WALLET_BITCOIN_ALL_BITDUBAI_CONTACTS.getKey());
        runtimeActivity.addFragment(Fragments.CWP_WALLET_RUNTIME_WALLET_BITCOIN_ALL_BITDUBAI_CREATE_CONTACTS.getKey(), runtimeFragment);

        //Navigation

        runtimeSideMenu = new SideMenu();

        runtimeMenuItem = new MenuItem();
        runtimeMenuItem.setLabel("Contacts");
        runtimeMenuItem.setIcon("contacts");
        runtimeMenuItem.setLinkToActivity(Activities.CWP_WALLET_RUNTIME_WALLET_BASIC_WALLET_BITDUBAI_VERSION_1_TRANSACTIONS);
        runtimeSideMenu.addMenuItem(runtimeMenuItem);
        runtimeSideMenu.addMenuItem(runtimeMenuItem);

        runtimeMenuItem = new MenuItem();
        runtimeMenuItem.setLabel("Transactions");
        runtimeMenuItem.setIcon("transactions");
        runtimeMenuItem.setLinkToActivity(Activities.CWP_WALLET_RUNTIME_WALLET_BASIC_WALLET_BITDUBAI_VERSION_1_TRANSACTIONS);
        runtimeSideMenu.addMenuItem(runtimeMenuItem);

        runtimeMenuItem = new MenuItem();
        runtimeMenuItem.setLabel("Payment request");
        runtimeMenuItem.setIcon("Payment_request");
        runtimeMenuItem.setLinkToActivity(Activities.CWP_WALLET_RUNTIME_WALLET_BASIC_WALLET_BITDUBAI_VERSION_1_TRANSACTIONS);
        runtimeSideMenu.addMenuItem(runtimeMenuItem);

        runtimeMenuItem = new MenuItem();
        runtimeMenuItem.setLabel("Settings");
        runtimeMenuItem.setIcon("Settings");
        runtimeMenuItem.setLinkToActivity(Activities.CWP_WALLET_RUNTIME_WALLET_BASIC_WALLET_BITDUBAI_VERSION_1_TRANSACTIONS);
        runtimeSideMenu.addMenuItem(runtimeMenuItem);

        runtimeMenuItem = new MenuItem();
        runtimeMenuItem.setLabel("Exit");
        runtimeSideMenu.addMenuItem(runtimeMenuItem);

        runtimeActivity.setSideMenu(runtimeSideMenu);

        //fin navigation

        /**
         * Menu
         */

        runtimeMainMenu = new MainMenu();
        runtimeMenuItem = new MenuItem();
        runtimeMenuItem.setLabel("Settings");
        runtimeMainMenu.addMenuItem(runtimeMenuItem);

        runtimeActivity.setMainMenu(runtimeMainMenu);

        /**
         *  Fin de menu
         */

        /**
         * Transaction Activity
         */

        runtimeActivity = new Activity();
        runtimeActivity.setType(Activities.CWP_WALLET_RUNTIME_WALLET_BASIC_WALLET_BITDUBAI_VERSION_1_TRANSACTIONS);
        runtimeActivity.setColor("#8bba9e");
        runtimeActivity.setBackActivity(Activities.CWP_WALLET_RUNTIME_WALLET_BASIC_WALLET_BITDUBAI_VERSION_1_MAIN);

        runtimeWalletNavigationStructure.addActivity(runtimeActivity);

        runtimeTitleBar = new TitleBar();
        runtimeTitleBar.setLabel("bitdubai bitcoin Wallet");
        runtimeTitleBar.setLabelSize(16);
        runtimeActivity.setTitleBar(runtimeTitleBar);
        runtimeActivity.setColor("#72af9c");
        //runtimeActivity.setColor("#d07b62");
        runtimeActivity.setBackActivity(Activities.CWP_WALLET_RUNTIME_WALLET_BASIC_WALLET_BITDUBAI_VERSION_1_MAIN);

        runtimeStatusBar = new com.bitdubai.fermat_api.layer.all_definition.navigation_structure.StatusBar();
        runtimeStatusBar.setColor("#72af9c");

        runtimeActivity.setStatusBar(runtimeStatusBar);

        runtimeActivity.setStartFragment(Fragments.CWP_WALLET_RUNTIME_WALLET_BITCOIN_ALL_BITDUBAI_TRANSACTIONS.getKey());

        runtimeFragment = new Fragment();
        runtimeFragment.setType(Fragments.CWP_WALLET_RUNTIME_WALLET_BITCOIN_ALL_BITDUBAI_TRANSACTIONS.getKey());
        runtimeActivity.addFragment(Fragments.CWP_WALLET_RUNTIME_WALLET_BITCOIN_ALL_BITDUBAI_TRANSACTIONS.getKey(), runtimeFragment);

        //Navigation

        runtimeSideMenu = new SideMenu();

        runtimeMenuItem = new MenuItem();
        runtimeMenuItem.setLabel("Personal Wallets");
        runtimeSideMenu.addMenuItem(runtimeMenuItem);

        runtimeMenuItem = new MenuItem();
        runtimeMenuItem.setLabel("Shops");
        runtimeSideMenu.addMenuItem(runtimeMenuItem);

        runtimeMenuItem = new MenuItem();
        runtimeMenuItem.setLabel("Commercial wallets");
        runtimeSideMenu.addMenuItem(runtimeMenuItem);

        runtimeMenuItem = new MenuItem();
        runtimeMenuItem.setLabel("Factory Projects");
        runtimeMenuItem.setLinkToActivity(Activities.CWP_WALLET_FACTORY_MAIN);
        runtimeSideMenu.addMenuItem(runtimeMenuItem);

        runtimeMenuItem = new MenuItem();
        runtimeMenuItem.setLabel("Published Wallets");
        runtimeSideMenu.addMenuItem(runtimeMenuItem);

        runtimeMenuItem = new MenuItem();
        runtimeMenuItem.setLabel("Wallet Store");
        runtimeMenuItem.setLinkToActivity(Activities.CWP_WALLET_STORE_MAIN_ACTIVITY);
        runtimeSideMenu.addMenuItem(runtimeMenuItem);

        runtimeMenuItem = new MenuItem();
        runtimeMenuItem.setLabel("Exit");
        runtimeSideMenu.addMenuItem(runtimeMenuItem);

        runtimeActivity.setSideMenu(runtimeSideMenu);

        //fin navigation

        return runtimeWalletNavigationStructure;
    }

    @Override
    public void onTouchView(Object v) {

    }

    @Override
    public int getCallBackId() {
        return 0;
    }
}


text:
from vision import ffmpeg

f = ffmpeg.extract("/csail/vision-videolabelme/databases/video_adapt/demos/bottle_table.mov",
fps = None, size = (100, 100))
i = iter(f)

print len(f)

for t in f:
    print t.size