code
stringlengths
2
1.05M
repo_name
stringlengths
4
116
path
stringlengths
3
991
language
stringclasses
30 values
license
stringclasses
15 values
size
int32
3
1.05M
<?php /* * This file is part of NodalFlow. * (c) Fabrice de Stefanis / https://github.com/fab2s/NodalFlow * This source file is licensed under the MIT license which you will * find in the LICENSE file or at https://opensource.org/licenses/MIT */ namespace fab2s\NodalFlow\Nodes; use fab2s\NodalFlow\Flows\FlowInterface; use fab2s\NodalFlow\NodalFlowException; /** * Class BranchNode */ class BranchNode extends PayloadNodeAbstract implements BranchNodeInterface { /** * This Node is a Branch * * @var bool */ protected $isAFlow = true; /** * @var FlowInterface */ protected $payload; /** * Instantiate the BranchNode * * @param FlowInterface $payload * @param bool $isAReturningVal * * @throws NodalFlowException */ public function __construct(FlowInterface $payload, bool $isAReturningVal) { // branch Node does not (yet) support traversing parent::__construct($payload, $isAReturningVal, false); } /** * Execute the BranchNode * * @param mixed|null $param * * @return mixed */ public function exec($param = null) { // in the branch case, we actually exec a Flow return $this->payload->exec($param); } }
fab2s/NodalFlow
src/Nodes/BranchNode.php
PHP
mit
1,307
<!--Navigation bar--> <nav class="navbar navbar-default navbar-fixed-top"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" [routerLink]="['/']">Club Membership</a> </div> <div class="collapse navbar-collapse" id="myNavbar"> <ul class="nav navbar-nav navbar-right"> <li><a [routerLink]="['/']">ABOUT</a></li> <li><a [routerLink]="['/']">SERVICES</a></li> <li><a [routerLink]="['/']">CLUBS</a></li> <li><a [routerLink]="['/']">FORM</a></li> </ul> </div> </div> </nav>
muronchik/clubmembership-angular
src/app/components/nav/nav-custom.component.html
HTML
mit
803
Ubench [![Build Status](https://travis-ci.org/devster/ubench.svg?branch=master)](https://travis-ci.org/devster/ubench) ====== Ubench is a PHP micro library for benchmark > https://github.com/devster/ubench Installation ------------ ### Old school ### require `src/Ubench.php` in your project. ### Composer ### Add this to your composer.json ```json { "require": { "devster/ubench": "~2.0.0" } } ``` Usage ----- ```php require_once 'src/Ubench.php'; $bench = new Ubench; $bench->start(); // Execute some code $bench->end(); // Get elapsed time and memory echo $bench->getTime(); // 156ms or 1.123s echo $bench->getTime(true); // elapsed microtime in float echo $bench->getTime(false, '%d%s'); // 156ms or 1s echo $bench->getMemoryPeak(); // 152B or 90.00Kb or 15.23Mb echo $bench->getMemoryPeak(true); // memory peak in bytes echo $bench->getMemoryPeak(false, '%.3f%s'); // 152B or 90.152Kb or 15.234Mb // Returns the memory usage at the end mark echo $bench->getMemoryUsage(); // 152B or 90.00Kb or 15.23Mb // Runs `Ubench::start()` and `Ubench::end()` around a callable // Accepts a callable as the first parameter. Any additional parameters will be passed to the callable. $result = $bench->run(function ($x) { return $x; }, 1); echo $bench->getTime(); ``` License ------- Ubench is licensed under the MIT License
GCModeller-Cloud/php-dotnet
Framework/Debugger/Ubench/README.md
Markdown
mit
1,357
/* * Generated by class-dump 3.3.4 (64 bit). * * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. */ #import "NSObject.h" @class NSMutableDictionary, NSString; // Not exported @interface GQZArchive : NSObject { NSMutableDictionary *mEntries; id <GQZArchiveInputStream> mInput; _Bool mIsEncrypted; NSString *mFilename; } - (id)filename; - (_Bool)isEncrypted; - (id)entryNames; - (id)entryWithName:(id)arg1; - (void)dealloc; - (id)initWithData:(id)arg1 collapseCommonRootDirectory:(_Bool)arg2; - (id)initWithPath:(id)arg1 collapseCommonRootDirectory:(_Bool)arg2; @end
matthewsot/CocoaSharp
Headers/PrivateFrameworks/iWorkImport/GQZArchive.h
C
mit
628
/* * mysplit.c - Another handy routine for testing your tiny shell * * usage: mysplit <n> * Fork a child that spins for <n> seconds in 1-second chunks. */ #include <stdio.h> #include <unistd.h> #include <stdlib.h> #include <sys/types.h> #include <sys/wait.h> #include <signal.h> int main(int argc, char **argv) { int i, secs; if (argc != 2) { fprintf(stderr, "Usage: %s <n>\n", argv[0]); exit(0); } secs = atoi(argv[1]); if (fork() == 0) { /* child */ for (i=0; i < secs; i++) sleep(1); exit(0); } /* parent waits for child to terminate */ wait(NULL); exit(0); }
heapsters/shelldon
routines/mysplit.c
C
mit
640
/* * Copyright (c) 1982, 1986, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)fs.h 8.13 (Berkeley) 3/21/95 * $FreeBSD: src/sys/ufs/ffs/fs.h,v 1.39 2003/02/22 00:19:26 mckusick Exp $ */ #ifndef _UFS_FFS_FS_H_ #define _UFS_FFS_FS_H_ /* * Each disk drive contains some number of filesystems. * A filesystem consists of a number of cylinder groups. * Each cylinder group has inodes and data. * * A filesystem is described by its super-block, which in turn * describes the cylinder groups. The super-block is critical * data and is replicated in each cylinder group to protect against * catastrophic loss. This is done at `newfs' time and the critical * super-block data does not change, so the copies need not be * referenced further unless disaster strikes. * * For filesystem fs, the offsets of the various blocks of interest * are given in the super block as: * [fs->fs_sblkno] Super-block * [fs->fs_cblkno] Cylinder group block * [fs->fs_iblkno] Inode blocks * [fs->fs_dblkno] Data blocks * The beginning of cylinder group cg in fs, is given by * the ``cgbase(fs, cg)'' macro. * * Depending on the architecture and the media, the superblock may * reside in any one of four places. For tiny media where every block * counts, it is placed at the very front of the partition. Historically, * UFS1 placed it 8K from the front to leave room for the disk label and * a small bootstrap. For UFS2 it got moved to 64K from the front to leave * room for the disk label and a bigger bootstrap, and for really piggy * systems we check at 256K from the front if the first three fail. In * all cases the size of the superblock will be SBLOCKSIZE. All values are * given in byte-offset form, so they do not imply a sector size. The * SBLOCKSEARCH specifies the order in which the locations should be searched. */ #define SBLOCK_FLOPPY 0 #define SBLOCK_UFS1 8192 #define SBLOCK_UFS2 65536 #define SBLOCK_PIGGY 262144 #define SBLOCKSIZE 8192 #define SBLOCKSEARCH \ { SBLOCK_UFS2, SBLOCK_UFS1, SBLOCK_FLOPPY, SBLOCK_PIGGY, -1 } /* * Max number of fragments per block. This value is NOT tweakable. */ #define MAXFRAG 8 /* * Addresses stored in inodes are capable of addressing fragments * of `blocks'. File system blocks of at most size MAXBSIZE can * be optionally broken into 2, 4, or 8 pieces, each of which is * addressable; these pieces may be DEV_BSIZE, or some multiple of * a DEV_BSIZE unit. * * Large files consist of exclusively large data blocks. To avoid * undue wasted disk space, the last data block of a small file may be * allocated as only as many fragments of a large block as are * necessary. The filesystem format retains only a single pointer * to such a fragment, which is a piece of a single large block that * has been divided. The size of such a fragment is determinable from * information in the inode, using the ``blksize(fs, ip, lbn)'' macro. * * The filesystem records space availability at the fragment level; * to determine block availability, aligned fragments are examined. */ /* * MINBSIZE is the smallest allowable block size. * In order to insure that it is possible to create files of size * 2^32 with only two levels of indirection, MINBSIZE is set to 4096. * MINBSIZE must be big enough to hold a cylinder group block, * thus changes to (struct cg) must keep its size within MINBSIZE. * Note that super blocks are always of size SBSIZE, * and that both SBSIZE and MAXBSIZE must be >= MINBSIZE. */ #define MINBSIZE 4096 /* * The path name on which the filesystem is mounted is maintained * in fs_fsmnt. MAXMNTLEN defines the amount of space allocated in * the super block for this name. */ #define MAXMNTLEN 468 /* * The volume name for this filesystem is maintained in fs_volname. * MAXVOLLEN defines the length of the buffer allocated. */ #define MAXVOLLEN 32 /* * There is a 128-byte region in the superblock reserved for in-core * pointers to summary information. Originally this included an array * of pointers to blocks of struct csum; now there are just a few * pointers and the remaining space is padded with fs_ocsp[]. * * NOCSPTRS determines the size of this padding. One pointer (fs_csp) * is taken away to point to a contiguous array of struct csum for * all cylinder groups; a second (fs_maxcluster) points to an array * of cluster sizes that is computed as cylinder groups are inspected, * and the third points to an array that tracks the creation of new * directories. A fourth pointer, fs_active, is used when creating * snapshots; it points to a bitmap of cylinder groups for which the * free-block bitmap has changed since the snapshot operation began. */ #define NOCSPTRS ((128 / sizeof(void *)) - 4) /* * A summary of contiguous blocks of various sizes is maintained * in each cylinder group. Normally this is set by the initial * value of fs_maxcontig. To conserve space, a maximum summary size * is set by FS_MAXCONTIG. */ #define FS_MAXCONTIG 16 /* * MINFREE gives the minimum acceptable percentage of filesystem * blocks which may be free. If the freelist drops below this level * only the superuser may continue to allocate blocks. This may * be set to 0 if no reserve of free blocks is deemed necessary, * however throughput drops by fifty percent if the filesystem * is run at between 95% and 100% full; thus the minimum default * value of fs_minfree is 5%. However, to get good clustering * performance, 10% is a better choice. hence we use 10% as our * default value. With 10% free space, fragmentation is not a * problem, so we choose to optimize for time. */ #define MINFREE 8 #define DEFAULTOPT FS_OPTTIME /* * Grigoriy Orlov <gluk@ptci.ru> has done some extensive work to fine * tune the layout preferences for directories within a filesystem. * His algorithm can be tuned by adjusting the following parameters * which tell the system the average file size and the average number * of files per directory. These defaults are well selected for typical * filesystems, but may need to be tuned for odd cases like filesystems * being used for sqiud caches or news spools. */ #define AVFILESIZ 16384 /* expected average file size */ #define AFPDIR 64 /* expected number of files per directory */ /* * The maximum number of snapshot nodes that can be associated * with each filesystem. This limit affects only the number of * snapshot files that can be recorded within the superblock so * that they can be found when the filesystem is mounted. However, * maintaining too many will slow the filesystem performance, so * having this limit is a good idea. */ #define FSMAXSNAP 20 /* * Used to identify special blocks in snapshots: * * BLK_NOCOPY - A block that was unallocated at the time the snapshot * was taken, hence does not need to be copied when written. * BLK_SNAP - A block held by another snapshot that is not needed by this * snapshot. When the other snapshot is freed, the BLK_SNAP entries * are converted to BLK_NOCOPY. These are needed to allow fsck to * identify blocks that are in use by other snapshots (which are * expunged from this snapshot). */ #define BLK_NOCOPY ((ufs2_daddr_t)(1)) #define BLK_SNAP ((ufs2_daddr_t)(2)) /* * Sysctl values for the fast filesystem. */ #define FFS_ADJ_REFCNT 1 /* adjust inode reference count */ #define FFS_ADJ_BLKCNT 2 /* adjust inode used block count */ #define FFS_BLK_FREE 3 /* free range of blocks in map */ #define FFS_DIR_FREE 4 /* free specified dir inodes in map */ #define FFS_FILE_FREE 5 /* free specified file inodes in map */ #define FFS_SET_FLAGS 6 /* set filesystem flags */ #define FFS_MAXID 7 /* number of valid ffs ids */ /* * Command structure passed in to the filesystem to adjust filesystem values. */ #define FFS_CMD_VERSION 0x19790518 /* version ID */ struct fsck_cmd { int32_t version; /* version of command structure */ int32_t handle; /* reference to filesystem to be changed */ int64_t value; /* inode or block number to be affected */ int64_t size; /* amount or range to be adjusted */ int64_t spare; /* reserved for future use */ }; /* * Per cylinder group information; summarized in blocks allocated * from first cylinder group data blocks. These blocks have to be * read in from fs_csaddr (size fs_cssize) in addition to the * super block. */ struct csum { int32_t cs_ndir; /* number of directories */ int32_t cs_nbfree; /* number of free blocks */ int32_t cs_nifree; /* number of free inodes */ int32_t cs_nffree; /* number of free frags */ }; struct csum_total { int64_t cs_ndir; /* number of directories */ int64_t cs_nbfree; /* number of free blocks */ int64_t cs_nifree; /* number of free inodes */ int64_t cs_nffree; /* number of free frags */ int64_t cs_numclusters; /* number of free clusters */ int64_t cs_spare[3]; /* future expansion */ }; /* * Super block for an FFS filesystem. */ struct fs { int32_t fs_firstfield; /* historic filesystem linked list, */ int32_t fs_unused_1; /* used for incore super blocks */ int32_t fs_sblkno; /* offset of super-block in filesys */ int32_t fs_cblkno; /* offset of cyl-block in filesys */ int32_t fs_iblkno; /* offset of inode-blocks in filesys */ int32_t fs_dblkno; /* offset of first data after cg */ int32_t fs_old_cgoffset; /* cylinder group offset in cylinder */ int32_t fs_old_cgmask; /* used to calc mod fs_ntrak */ int32_t fs_old_time; /* last time written */ int32_t fs_old_size; /* number of blocks in fs */ int32_t fs_old_dsize; /* number of data blocks in fs */ int32_t fs_ncg; /* number of cylinder groups */ int32_t fs_bsize; /* size of basic blocks in fs */ int32_t fs_fsize; /* size of frag blocks in fs */ int32_t fs_frag; /* number of frags in a block in fs */ /* these are configuration parameters */ int32_t fs_minfree; /* minimum percentage of free blocks */ int32_t fs_old_rotdelay; /* num of ms for optimal next block */ int32_t fs_old_rps; /* disk revolutions per second */ /* these fields can be computed from the others */ int32_t fs_bmask; /* ``blkoff'' calc of blk offsets */ int32_t fs_fmask; /* ``fragoff'' calc of frag offsets */ int32_t fs_bshift; /* ``lblkno'' calc of logical blkno */ int32_t fs_fshift; /* ``numfrags'' calc number of frags */ /* these are configuration parameters */ int32_t fs_maxcontig; /* max number of contiguous blks */ int32_t fs_maxbpg; /* max number of blks per cyl group */ /* these fields can be computed from the others */ int32_t fs_fragshift; /* block to frag shift */ int32_t fs_fsbtodb; /* fsbtodb and dbtofsb shift constant */ int32_t fs_sbsize; /* actual size of super block */ int32_t fs_spare1[2]; /* old fs_csmask */ /* old fs_csshift */ int32_t fs_nindir; /* value of NINDIR */ int32_t fs_inopb; /* value of INOPB */ int32_t fs_old_nspf; /* value of NSPF */ /* yet another configuration parameter */ int32_t fs_optim; /* optimization preference, see below */ int32_t fs_old_npsect; /* # sectors/track including spares */ int32_t fs_old_interleave; /* hardware sector interleave */ int32_t fs_old_trackskew; /* sector 0 skew, per track */ int32_t fs_id[2]; /* unique filesystem id */ /* sizes determined by number of cylinder groups and their sizes */ int32_t fs_old_csaddr; /* blk addr of cyl grp summary area */ int32_t fs_cssize; /* size of cyl grp summary area */ int32_t fs_cgsize; /* cylinder group size */ int32_t fs_spare2; /* old fs_ntrak */ int32_t fs_old_nsect; /* sectors per track */ int32_t fs_old_spc; /* sectors per cylinder */ int32_t fs_old_ncyl; /* cylinders in filesystem */ int32_t fs_old_cpg; /* cylinders per group */ int32_t fs_ipg; /* inodes per group */ int32_t fs_fpg; /* blocks per group * fs_frag */ /* this data must be re-computed after crashes */ struct csum fs_old_cstotal; /* cylinder summary information */ /* these fields are cleared at mount time */ int8_t fs_fmod; /* super block modified flag */ int8_t fs_clean; /* filesystem is clean flag */ int8_t fs_ronly; /* mounted read-only flag */ int8_t fs_old_flags; /* old FS_ flags */ u_char fs_fsmnt[MAXMNTLEN]; /* name mounted on */ u_char fs_volname[MAXVOLLEN]; /* volume name */ u_int64_t fs_swuid; /* system-wide uid */ int32_t fs_pad; /* due to alignment of fs_swuid */ /* these fields retain the current block allocation info */ int32_t fs_cgrotor; /* last cg searched */ void *fs_ocsp[NOCSPTRS]; /* padding; was list of fs_cs buffers */ u_int8_t *fs_contigdirs; /* # of contiguously allocated dirs */ struct csum *fs_csp; /* cg summary info buffer for fs_cs */ int32_t *fs_maxcluster; /* max cluster in each cyl group */ u_int *fs_active; /* used by snapshots to track fs */ int32_t fs_old_cpc; /* cyl per cycle in postbl */ int32_t fs_maxbsize; /* maximum blocking factor permitted */ int64_t fs_sparecon64[17]; /* old rotation block list head */ int64_t fs_sblockloc; /* byte offset of standard superblock */ struct csum_total fs_cstotal; /* cylinder summary information */ ufs_time_t fs_time; /* last time written */ int64_t fs_size; /* number of blocks in fs */ int64_t fs_dsize; /* number of data blocks in fs */ ufs2_daddr_t fs_csaddr; /* blk addr of cyl grp summary area */ int64_t fs_pendingblocks; /* blocks in process of being freed */ int32_t fs_pendinginodes; /* inodes in process of being freed */ int32_t fs_snapinum[FSMAXSNAP];/* list of snapshot inode numbers */ int32_t fs_avgfilesize; /* expected average file size */ int32_t fs_avgfpdir; /* expected # of files per directory */ int32_t fs_save_cgsize; /* save real cg size to use fs_bsize */ int32_t fs_sparecon32[26]; /* reserved for future constants */ int32_t fs_flags; /* see FS_ flags below */ int32_t fs_contigsumsize; /* size of cluster summary array */ int32_t fs_maxsymlinklen; /* max length of an internal symlink */ int32_t fs_old_inodefmt; /* format of on-disk inodes */ u_int64_t fs_maxfilesize; /* maximum representable file size */ int64_t fs_qbmask; /* ~fs_bmask for use with 64-bit size */ int64_t fs_qfmask; /* ~fs_fmask for use with 64-bit size */ int32_t fs_state; /* validate fs_clean field */ int32_t fs_old_postblformat; /* format of positional layout tables */ int32_t fs_old_nrpos; /* number of rotational positions */ int32_t fs_spare5[2]; /* old fs_postbloff */ /* old fs_rotbloff */ int32_t fs_magic; /* magic number */ }; /* Sanity checking. */ #ifdef CTASSERT CTASSERT(sizeof(struct fs) == 1376); #endif /* * Filesystem identification */ #define FS_UFS1_MAGIC 0x011954 /* UFS1 fast filesystem magic number */ #define FS_UFS2_MAGIC 0x19540119 /* UFS2 fast filesystem magic number */ #define FS_OKAY 0x7c269d38 /* superblock checksum */ #define FS_42INODEFMT -1 /* 4.2BSD inode format */ #define FS_44INODEFMT 2 /* 4.4BSD inode format */ /* * Preference for optimization. */ #define FS_OPTTIME 0 /* minimize allocation time */ #define FS_OPTSPACE 1 /* minimize disk fragmentation */ /* * Filesystem flags. * * The FS_UNCLEAN flag is set by the kernel when the filesystem was * mounted with fs_clean set to zero. The FS_DOSOFTDEP flag indicates * that the filesystem should be managed by the soft updates code. * Note that the FS_NEEDSFSCK flag is set and cleared only by the * fsck utility. It is set when background fsck finds an unexpected * inconsistency which requires a traditional foreground fsck to be * run. Such inconsistencies should only be found after an uncorrectable * disk error. A foreground fsck will clear the FS_NEEDSFSCK flag when * it has successfully cleaned up the filesystem. The kernel uses this * flag to enforce that inconsistent filesystems be mounted read-only. * The FS_INDEXDIRS flag when set indicates that the kernel maintains * on-disk auxiliary indexes (such as B-trees) for speeding directory * accesses. Kernels that do not support auxiliary indicies clear the * flag to indicate that the indicies need to be rebuilt (by fsck) before * they can be used. * * FS_ACLS indicates that ACLs are administratively enabled for the * file system, so they should be loaded from extended attributes, * observed for access control purposes, and be administered by object * owners. FS_MULTILABEL indicates that the TrustedBSD MAC Framework * should attempt to back MAC labels into extended attributes on the * file system rather than maintain a single mount label for all * objects. */ #define FS_UNCLEAN 0x01 /* filesystem not clean at mount */ #define FS_DOSOFTDEP 0x02 /* filesystem using soft dependencies */ #define FS_NEEDSFSCK 0x04 /* filesystem needs sync fsck before mount */ #define FS_INDEXDIRS 0x08 /* kernel supports indexed directories */ #define FS_ACLS 0x10 /* file system has ACLs enabled */ #define FS_MULTILABEL 0x20 /* file system is MAC multi-label */ #define FS_FLAGS_UPDATED 0x80 /* flags have been moved to new location */ /* * Macros to access bits in the fs_active array. */ #define ACTIVECGNUM(fs, cg) ((fs)->fs_active[(cg) / (NBBY * sizeof(int))]) #define ACTIVECGOFF(cg) (1 << ((cg) % (NBBY * sizeof(int)))) /* * The size of a cylinder group is calculated by CGSIZE. The maximum size * is limited by the fact that cylinder groups are at most one block. * Its size is derived from the size of the maps maintained in the * cylinder group and the (struct cg) size. */ #define CGSIZE(fs) \ /* base cg */ (sizeof(struct cg) + sizeof(int32_t) + \ /* old btotoff */ (fs)->fs_old_cpg * sizeof(int32_t) + \ /* old boff */ (fs)->fs_old_cpg * sizeof(u_int16_t) + \ /* inode map */ howmany((fs)->fs_ipg, NBBY) + \ /* block map */ howmany((fs)->fs_fpg, NBBY) +\ /* if present */ ((fs)->fs_contigsumsize <= 0 ? 0 : \ /* cluster sum */ (fs)->fs_contigsumsize * sizeof(int32_t) + \ /* cluster map */ howmany(fragstoblks(fs, (fs)->fs_fpg), NBBY))) /* * The minimal number of cylinder groups that should be created. */ #define MINCYLGRPS 4 /* * Convert cylinder group to base address of its global summary info. */ #define fs_cs(fs, indx) fs_csp[indx] /* * Cylinder group block for a filesystem. */ #define CG_MAGIC 0x090255 struct cg { int32_t cg_firstfield; /* historic cyl groups linked list */ int32_t cg_magic; /* magic number */ int32_t cg_old_time; /* time last written */ int32_t cg_cgx; /* we are the cgx'th cylinder group */ int16_t cg_old_ncyl; /* number of cyl's this cg */ int16_t cg_old_niblk; /* number of inode blocks this cg */ int32_t cg_ndblk; /* number of data blocks this cg */ struct csum cg_cs; /* cylinder summary information */ int32_t cg_rotor; /* position of last used block */ int32_t cg_frotor; /* position of last used frag */ int32_t cg_irotor; /* position of last used inode */ int32_t cg_frsum[MAXFRAG]; /* counts of available frags */ int32_t cg_old_btotoff; /* (int32) block totals per cylinder */ int32_t cg_old_boff; /* (u_int16) free block positions */ int32_t cg_iusedoff; /* (u_int8) used inode map */ int32_t cg_freeoff; /* (u_int8) free block map */ int32_t cg_nextfreeoff; /* (u_int8) next available space */ int32_t cg_clustersumoff; /* (u_int32) counts of avail clusters */ int32_t cg_clusteroff; /* (u_int8) free cluster map */ int32_t cg_nclusterblks; /* number of clusters this cg */ int32_t cg_niblk; /* number of inode blocks this cg */ int32_t cg_initediblk; /* last initialized inode */ int32_t cg_sparecon32[3]; /* reserved for future use */ ufs_time_t cg_time; /* time last written */ int64_t cg_sparecon64[3]; /* reserved for future use */ u_int8_t cg_space[1]; /* space for cylinder group maps */ /* actually longer */ }; /* * Macros for access to cylinder group array structures */ #define cg_chkmagic(cgp) ((cgp)->cg_magic == CG_MAGIC) #define cg_inosused(cgp) \ ((u_int8_t *)((u_int8_t *)(cgp) + (cgp)->cg_iusedoff)) #define cg_blksfree(cgp) \ ((u_int8_t *)((u_int8_t *)(cgp) + (cgp)->cg_freeoff)) #define cg_clustersfree(cgp) \ ((u_int8_t *)((u_int8_t *)(cgp) + (cgp)->cg_clusteroff)) #define cg_clustersum(cgp) \ ((int32_t *)((u_int8_t *)(cgp) + (cgp)->cg_clustersumoff)) /* * Turn filesystem block numbers into disk block addresses. * This maps filesystem blocks to device size blocks. */ #define fsbtodb(fs, b) ((b) << (fs)->fs_fsbtodb) #define dbtofsb(fs, b) ((b) >> (fs)->fs_fsbtodb) /* * Cylinder group macros to locate things in cylinder groups. * They calc filesystem addresses of cylinder group data structures. */ #define cgbase(fs, c) (((ufs2_daddr_t)(fs)->fs_fpg) * (c)) #define cgdmin(fs, c) (cgstart(fs, c) + (fs)->fs_dblkno) /* 1st data */ #define cgimin(fs, c) (cgstart(fs, c) + (fs)->fs_iblkno) /* inode blk */ #define cgsblock(fs, c) (cgstart(fs, c) + (fs)->fs_sblkno) /* super blk */ #define cgtod(fs, c) (cgstart(fs, c) + (fs)->fs_cblkno) /* cg block */ #define cgstart(fs, c) \ ((fs)->fs_magic == FS_UFS2_MAGIC ? cgbase(fs, c) : \ (cgbase(fs, c) + (fs)->fs_old_cgoffset * ((c) & ~((fs)->fs_old_cgmask)))) /* * Macros for handling inode numbers: * inode number to filesystem block offset. * inode number to cylinder group number. * inode number to filesystem block address. */ #define ino_to_cg(fs, x) ((x) / (fs)->fs_ipg) #define ino_to_fsba(fs, x) \ ((ufs2_daddr_t)(cgimin(fs, ino_to_cg(fs, x)) + \ (blkstofrags((fs), (((x) % (fs)->fs_ipg) / INOPB(fs)))))) #define ino_to_fsbo(fs, x) ((x) % INOPB(fs)) /* * Give cylinder group number for a filesystem block. * Give cylinder group block number for a filesystem block. */ #define dtog(fs, d) ((d) / (fs)->fs_fpg) #define dtogd(fs, d) ((d) % (fs)->fs_fpg) /* * Extract the bits for a block from a map. * Compute the cylinder and rotational position of a cyl block addr. */ #define blkmap(fs, map, loc) \ (((map)[(loc) / NBBY] >> ((loc) % NBBY)) & (0xff >> (NBBY - (fs)->fs_frag))) /* * The following macros optimize certain frequently calculated * quantities by using shifts and masks in place of divisions * modulos and multiplications. */ #define blkoff(fs, loc) /* calculates (loc % fs->fs_bsize) */ \ ((loc) & (fs)->fs_qbmask) #define fragoff(fs, loc) /* calculates (loc % fs->fs_fsize) */ \ ((loc) & (fs)->fs_qfmask) #define lfragtosize(fs, frag) /* calculates ((off_t)frag * fs->fs_fsize) */ \ (((off_t)(frag)) << (fs)->fs_fshift) #define lblktosize(fs, blk) /* calculates ((off_t)blk * fs->fs_bsize) */ \ (((off_t)(blk)) << (fs)->fs_bshift) /* Use this only when `blk' is known to be small, e.g., < NDADDR. */ #define smalllblktosize(fs, blk) /* calculates (blk * fs->fs_bsize) */ \ ((blk) << (fs)->fs_bshift) #define lblkno(fs, loc) /* calculates (loc / fs->fs_bsize) */ \ ((loc) >> (fs)->fs_bshift) #define numfrags(fs, loc) /* calculates (loc / fs->fs_fsize) */ \ ((loc) >> (fs)->fs_fshift) #define blkroundup(fs, size) /* calculates roundup(size, fs->fs_bsize) */ \ (((size) + (fs)->fs_qbmask) & (fs)->fs_bmask) #define fragroundup(fs, size) /* calculates roundup(size, fs->fs_fsize) */ \ (((size) + (fs)->fs_qfmask) & (fs)->fs_fmask) #define fragstoblks(fs, frags) /* calculates (frags / fs->fs_frag) */ \ ((frags) >> (fs)->fs_fragshift) #define blkstofrags(fs, blks) /* calculates (blks * fs->fs_frag) */ \ ((blks) << (fs)->fs_fragshift) #define fragnum(fs, fsb) /* calculates (fsb % fs->fs_frag) */ \ ((fsb) & ((fs)->fs_frag - 1)) #define blknum(fs, fsb) /* calculates rounddown(fsb, fs->fs_frag) */ \ ((fsb) &~ ((fs)->fs_frag - 1)) /* * Determine the number of available frags given a * percentage to hold in reserve. */ #define freespace(fs, percentreserved) \ (blkstofrags((fs), (fs)->fs_cstotal.cs_nbfree) + \ (fs)->fs_cstotal.cs_nffree - \ (((off_t)((fs)->fs_dsize)) * (percentreserved) / 100)) /* * Determining the size of a file block in the filesystem. */ #define blksize(fs, ip, lbn) \ (((lbn) >= NDADDR || (ip)->i_size >= smalllblktosize(fs, (lbn) + 1)) \ ? (fs)->fs_bsize \ : (fragroundup(fs, blkoff(fs, (ip)->i_size)))) #define sblksize(fs, size, lbn) \ (((lbn) >= NDADDR || (size) >= ((lbn) + 1) << (fs)->fs_bshift) \ ? (fs)->fs_bsize \ : (fragroundup(fs, blkoff(fs, (size))))) /* * Number of inodes in a secondary storage block/fragment. */ #define INOPB(fs) ((fs)->fs_inopb) #define INOPF(fs) ((fs)->fs_inopb >> (fs)->fs_fragshift) /* * Number of indirects in a filesystem block. */ #define NINDIR(fs) ((fs)->fs_nindir) extern int inside[], around[]; extern u_char *fragtbl[]; #endif
nathansamson/OMF
external/frisbee/imagezip/ffs/fs.h
C
mit
26,375
\hypertarget{dir_a39a2e34196bbb4cf212587eee358088}{}\section{C\+:/\+Users/\+Tim-\/\+Mobil/\+Documents/\+Arduino/libraries/\+N\+B\+H\+X711/src Directory Reference} \label{dir_a39a2e34196bbb4cf212587eee358088}\index{C\+:/\+Users/\+Tim-\/\+Mobil/\+Documents/\+Arduino/libraries/\+N\+B\+H\+X711/src Directory Reference@{C\+:/\+Users/\+Tim-\/\+Mobil/\+Documents/\+Arduino/libraries/\+N\+B\+H\+X711/src Directory Reference}} \subsection*{Files} \begin{DoxyCompactItemize} \item file \hyperlink{_n_b_h_x711_8cpp}{N\+B\+H\+X711.\+cpp} \item file \hyperlink{_n_b_h_x711_8h}{N\+B\+H\+X711.\+h} \end{DoxyCompactItemize}
whandall/NBHX711
doc/latex/dir_a39a2e34196bbb4cf212587eee358088.tex
TeX
mit
611
<?PHP /** * password view. * * includes form for username and email to send password to user. * */ ?> <div id="content_area"> <div class="row" id="login"> <!--login box--> <div class="col-xs-24" > <?php //begins the login form. echo form_open(base_url().'Account/password'); //display error messages if (isset($message_display)) { echo $message_display; } if (isset($error_message)) { echo "<div class='alert alert-danger text-center' role='alert'>"; echo $error_message; echo validation_errors(); echo "</div>"; //display error_msg } //login form itself echo '<h5 class="text-center">Provide your username and email address.</h5>'; ?> <label>Username :</label> <p> <input type="text" name="username" id="name" placeholder="username"/> </p> <label>Email :</label> <p> <input type="email" name="email" id="email" placeholder="email@email.com"/> </p> <!-- End of the form, begin submit button --> <div class='submit_button_container text-center'> <button type="submit" class="btn btn-primary btn-center" name="submit"/>Get Password</button> <!--Link to retrieve username --> <div style="padding-top:10px"> <?php echo anchor('Account/username','Forgot Username?') ?> </div> </div><!-- end submit button container --> <?php echo form_close(); ?> </div> <!-- end login div --> </div> </div><!-- end content_area div --> </div> <?PHP /*End of file login.php*/ /*Location: ./application/veiws/Account/password.php*/
rshanecole/TheFFFL
views/account/password.php
PHP
mit
2,088
using System; using System.Threading; using MonoTouch.Foundation; using MonoTouch.UIKit; namespace vplan { public class PrefManager { NSUserDefaults locstore = new NSUserDefaults(); bool notified = false; public PrefManager () { refresh (); } protected void refresh () { locstore.Synchronize (); } public int getInt (string key) { int val; val = locstore.IntForKey (key); return val; } public string getString (string key) { string val; val = locstore.StringForKey (key); return val; } public void setInt (string key, int val) { locstore.SetInt (val, key); refresh (); } public void setString (string key, string val) { locstore.SetString (val, key); refresh (); } } }
reknih/informant-ios
vplan/vplan.Kit/PrefManager.cs
C#
mit
743
/* DISKSPD Copyright(c) Microsoft Corporation All rights reserved. MIT License Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "StdAfx.h" #include "XmlResultParser.UnitTests.h" #include "Common.h" #include "xmlresultparser.h" #include <stdlib.h> #include <vector> using namespace WEX::TestExecution; using namespace WEX::Logging; using namespace std; namespace UnitTests { void XmlResultParserUnitTests::Test_ParseResults() { Profile profile; TimeSpan timeSpan; Target target; XmlResultParser parser; Results results; results.fUseETW = false; double fTime = 120.0; results.ullTimeCount = PerfTimer::SecondsToPerfTime(fTime); // First group has 1 core SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION systemProcessorInfo = {}; systemProcessorInfo.UserTime.QuadPart = static_cast<LONGLONG>(fTime * 30 * 100000); systemProcessorInfo.IdleTime.QuadPart = static_cast<LONGLONG>(fTime * 45 * 100000); systemProcessorInfo.KernelTime.QuadPart = static_cast<LONGLONG>(fTime * 70 * 100000); results.vSystemProcessorPerfInfo.push_back(systemProcessorInfo); // Second group has a maximum of 4 cores with 2 active SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION zeroSystemProcessorInfo = { 0 }; zeroSystemProcessorInfo.UserTime.QuadPart = static_cast<LONGLONG>(fTime * 0 * 100000); zeroSystemProcessorInfo.IdleTime.QuadPart = static_cast<LONGLONG>(fTime * 100 * 100000); zeroSystemProcessorInfo.KernelTime.QuadPart = static_cast<LONGLONG>(fTime * 100 * 100000); results.vSystemProcessorPerfInfo.push_back(zeroSystemProcessorInfo); results.vSystemProcessorPerfInfo.push_back(zeroSystemProcessorInfo); results.vSystemProcessorPerfInfo.push_back(zeroSystemProcessorInfo); results.vSystemProcessorPerfInfo.push_back(zeroSystemProcessorInfo); // TODO: multiple target cases, full profile/result variations target.SetPath("testfile1.dat"); target.SetCacheMode(TargetCacheMode::DisableOSCache); target.SetWriteThroughMode(WriteThroughMode::On); target.SetThroughputIOPS(1000); timeSpan.AddTarget(target); timeSpan.SetCalculateIopsStdDev(true); TargetResults targetResults; targetResults.sPath = "testfile1.dat"; targetResults.ullFileSize = 10 * 1024 * 1024; targetResults.ullReadBytesCount = 4 * 1024 * 1024; targetResults.ullReadIOCount = 6; targetResults.ullWriteBytesCount = 2 * 1024 * 1024; targetResults.ullWriteIOCount = 10; targetResults.ullBytesCount = targetResults.ullReadBytesCount + targetResults.ullWriteBytesCount; targetResults.ullIOCount = targetResults.ullReadIOCount + targetResults.ullWriteIOCount; // TODO: Histogram<float> readLatencyHistogram; // TODO: Histogram<float> writeLatencyHistogram; // TODO: IoBucketizer writeBucketizer; targetResults.readBucketizer.Initialize(1000, timeSpan.GetDuration()); for (size_t i = 0; i < timeSpan.GetDuration(); i++) { // add an io halfway through the bucket's time interval targetResults.readBucketizer.Add(i*1000 + 500, 0); } ThreadResults threadResults; threadResults.vTargetResults.push_back(targetResults); results.vThreadResults.push_back(threadResults); vector<Results> vResults; vResults.push_back(results); // just throw away the computername and reset the timestamp - for the ut, it's // as useful (and simpler) to verify statics as anything else. Reconstruct // processor topo to a fixed example as well. SystemInformation system; system.ResetTime(); system.sComputerName.clear(); system.processorTopology._ulProcCount = 5; system.processorTopology._ulActiveProcCount = 3; system.processorTopology._vProcessorGroupInformation.clear(); system.processorTopology._vProcessorGroupInformation.emplace_back((BYTE)1, (BYTE)1, (WORD)0, (KAFFINITY)0x1); system.processorTopology._vProcessorGroupInformation.emplace_back((BYTE)4, (BYTE)2, (WORD)1, (KAFFINITY)0x6); system.processorTopology._vProcessorNumaInformation.clear(); system.processorTopology._vProcessorNumaInformation.emplace_back((DWORD)0, (WORD)0, (KAFFINITY)0x1); system.processorTopology._vProcessorNumaInformation.emplace_back((DWORD)1, (WORD)1, (KAFFINITY)0x6); ProcessorSocketInformation socket; socket._vProcessorMasks.emplace_back((WORD)0, (KAFFINITY)0x1); socket._vProcessorMasks.emplace_back((WORD)1, (KAFFINITY)0x6); system.processorTopology._vProcessorSocketInformation.clear(); system.processorTopology._vProcessorSocketInformation.push_back(socket); system.processorTopology._vProcessorHyperThreadInformation.clear(); system.processorTopology._vProcessorHyperThreadInformation.emplace_back((WORD)0, (KAFFINITY)0x1); system.processorTopology._vProcessorHyperThreadInformation.emplace_back((WORD)1, (KAFFINITY)0x6); // finally, add the timespan to the profile and dump. profile.AddTimeSpan(timeSpan); string sResults = parser.ParseResults(profile, system, vResults); // stringify random text, quoting "'s and adding newline/preserving tabs // gc some.txt |% { write-host $("`"{0}\n`"" -f $($_ -replace "`"","\`"" -replace "`t","\t")) } const char *pcszExpectedOutput = \ "<Results>\n" " <System>\n" " <ComputerName></ComputerName>\n" " <Tool>\n" " <Version>" DISKSPD_NUMERIC_VERSION_STRING "</Version>\n" " <VersionDate>" DISKSPD_DATE_VERSION_STRING "</VersionDate>\n" " </Tool>\n" " <RunTime></RunTime>\n" " <ProcessorTopology>\n" " <Group Group=\"0\" MaximumProcessors=\"1\" ActiveProcessors=\"1\" ActiveProcessorMask=\"0x1\"/>\n" " <Group Group=\"1\" MaximumProcessors=\"4\" ActiveProcessors=\"2\" ActiveProcessorMask=\"0x6\"/>\n" " <Node Node=\"0\" Group=\"0\" Processors=\"0x1\"/>\n" " <Node Node=\"1\" Group=\"1\" Processors=\"0x6\"/>\n" " <Socket>\n" " <Group Group=\"0\" Processors=\"0x1\"/>\n" " <Group Group=\"1\" Processors=\"0x6\"/>\n" " </Socket>\n" " <HyperThread Group=\"0\" Processors=\"0x1\"/>\n" " <HyperThread Group=\"1\" Processors=\"0x6\"/>\n" " </ProcessorTopology>\n" " </System>\n" " <Profile>\n" " <Progress>0</Progress>\n" " <ResultFormat>text</ResultFormat>\n" " <Verbose>false</Verbose>\n" " <TimeSpans>\n" " <TimeSpan>\n" " <CompletionRoutines>false</CompletionRoutines>\n" " <MeasureLatency>false</MeasureLatency>\n" " <CalculateIopsStdDev>true</CalculateIopsStdDev>\n" " <DisableAffinity>false</DisableAffinity>\n" " <Duration>10</Duration>\n" " <Warmup>5</Warmup>\n" " <Cooldown>0</Cooldown>\n" " <ThreadCount>0</ThreadCount>\n" " <RequestCount>0</RequestCount>\n" " <IoBucketDuration>1000</IoBucketDuration>\n" " <RandSeed>0</RandSeed>\n" " <Targets>\n" " <Target>\n" " <Path>testfile1.dat</Path>\n" " <BlockSize>65536</BlockSize>\n" " <BaseFileOffset>0</BaseFileOffset>\n" " <SequentialScan>false</SequentialScan>\n" " <RandomAccess>false</RandomAccess>\n" " <TemporaryFile>false</TemporaryFile>\n" " <UseLargePages>false</UseLargePages>\n" " <DisableOSCache>true</DisableOSCache>\n" " <WriteThrough>true</WriteThrough>\n" " <WriteBufferContent>\n" " <Pattern>sequential</Pattern>\n" " </WriteBufferContent>\n" " <ParallelAsyncIO>false</ParallelAsyncIO>\n" " <StrideSize>65536</StrideSize>\n" " <InterlockedSequential>false</InterlockedSequential>\n" " <ThreadStride>0</ThreadStride>\n" " <MaxFileSize>0</MaxFileSize>\n" " <RequestCount>2</RequestCount>\n" " <WriteRatio>0</WriteRatio>\n" " <Throughput unit=\"IOPS\">1000</Throughput>\n" " <ThreadsPerFile>1</ThreadsPerFile>\n" " <IOPriority>3</IOPriority>\n" " <Weight>1</Weight>\n" " </Target>\n" " </Targets>\n" " </TimeSpan>\n" " </TimeSpans>\n" " </Profile>\n" " <TimeSpan>\n" " <TestTimeSeconds>120.00</TestTimeSeconds>\n" " <ThreadCount>1</ThreadCount>\n" " <RequestCount>0</RequestCount>\n" " <ProcCount>3</ProcCount>\n" " <CpuUtilization>\n" " <CPU>\n" " <Group>0</Group>\n" " <Id>0</Id>\n" " <UsagePercent>55.00</UsagePercent>\n" " <UserPercent>30.00</UserPercent>\n" " <KernelPercent>25.00</KernelPercent>\n" " <IdlePercent>45.00</IdlePercent>\n" " </CPU>\n" " <CPU>\n" " <Group>1</Group>\n" " <Id>1</Id>\n" " <UsagePercent>0.00</UsagePercent>\n" " <UserPercent>0.00</UserPercent>\n" " <KernelPercent>0.00</KernelPercent>\n" " <IdlePercent>100.00</IdlePercent>\n" " </CPU>\n" " <CPU>\n" " <Group>1</Group>\n" " <Id>2</Id>\n" " <UsagePercent>0.00</UsagePercent>\n" " <UserPercent>0.00</UserPercent>\n" " <KernelPercent>0.00</KernelPercent>\n" " <IdlePercent>100.00</IdlePercent>\n" " </CPU>\n" " <Average>\n" " <UsagePercent>18.33</UsagePercent>\n" " <UserPercent>10.00</UserPercent>\n" " <KernelPercent>8.33</KernelPercent>\n" " <IdlePercent>81.67</IdlePercent>\n" " </Average>\n" " </CpuUtilization>\n" " <Iops>\n" " <ReadIopsStdDev>0.000</ReadIopsStdDev>\n" " <IopsStdDev>0.000</IopsStdDev>\n" " <Bucket SampleMillisecond=\"1000\" Read=\"1\" Write=\"0\" Total=\"1\" ReadMinLatencyMilliseconds=\"0.000\" ReadMaxLatencyMilliseconds=\"0.000\" ReadAvgLatencyMilliseconds=\"0.000\" ReadLatencyStdDev=\"0.000\" WriteMinLatencyMilliseconds=\"0.000\" WriteMaxLatencyMilliseconds=\"0.000\" WriteAvgLatencyMilliseconds=\"0.000\" WriteLatencyStdDev=\"0.000\"/>\n" " <Bucket SampleMillisecond=\"2000\" Read=\"1\" Write=\"0\" Total=\"1\" ReadMinLatencyMilliseconds=\"0.000\" ReadMaxLatencyMilliseconds=\"0.000\" ReadAvgLatencyMilliseconds=\"0.000\" ReadLatencyStdDev=\"0.000\" WriteMinLatencyMilliseconds=\"0.000\" WriteMaxLatencyMilliseconds=\"0.000\" WriteAvgLatencyMilliseconds=\"0.000\" WriteLatencyStdDev=\"0.000\"/>\n" " <Bucket SampleMillisecond=\"3000\" Read=\"1\" Write=\"0\" Total=\"1\" ReadMinLatencyMilliseconds=\"0.000\" ReadMaxLatencyMilliseconds=\"0.000\" ReadAvgLatencyMilliseconds=\"0.000\" ReadLatencyStdDev=\"0.000\" WriteMinLatencyMilliseconds=\"0.000\" WriteMaxLatencyMilliseconds=\"0.000\" WriteAvgLatencyMilliseconds=\"0.000\" WriteLatencyStdDev=\"0.000\"/>\n" " <Bucket SampleMillisecond=\"4000\" Read=\"1\" Write=\"0\" Total=\"1\" ReadMinLatencyMilliseconds=\"0.000\" ReadMaxLatencyMilliseconds=\"0.000\" ReadAvgLatencyMilliseconds=\"0.000\" ReadLatencyStdDev=\"0.000\" WriteMinLatencyMilliseconds=\"0.000\" WriteMaxLatencyMilliseconds=\"0.000\" WriteAvgLatencyMilliseconds=\"0.000\" WriteLatencyStdDev=\"0.000\"/>\n" " <Bucket SampleMillisecond=\"5000\" Read=\"1\" Write=\"0\" Total=\"1\" ReadMinLatencyMilliseconds=\"0.000\" ReadMaxLatencyMilliseconds=\"0.000\" ReadAvgLatencyMilliseconds=\"0.000\" ReadLatencyStdDev=\"0.000\" WriteMinLatencyMilliseconds=\"0.000\" WriteMaxLatencyMilliseconds=\"0.000\" WriteAvgLatencyMilliseconds=\"0.000\" WriteLatencyStdDev=\"0.000\"/>\n" " <Bucket SampleMillisecond=\"6000\" Read=\"1\" Write=\"0\" Total=\"1\" ReadMinLatencyMilliseconds=\"0.000\" ReadMaxLatencyMilliseconds=\"0.000\" ReadAvgLatencyMilliseconds=\"0.000\" ReadLatencyStdDev=\"0.000\" WriteMinLatencyMilliseconds=\"0.000\" WriteMaxLatencyMilliseconds=\"0.000\" WriteAvgLatencyMilliseconds=\"0.000\" WriteLatencyStdDev=\"0.000\"/>\n" " <Bucket SampleMillisecond=\"7000\" Read=\"1\" Write=\"0\" Total=\"1\" ReadMinLatencyMilliseconds=\"0.000\" ReadMaxLatencyMilliseconds=\"0.000\" ReadAvgLatencyMilliseconds=\"0.000\" ReadLatencyStdDev=\"0.000\" WriteMinLatencyMilliseconds=\"0.000\" WriteMaxLatencyMilliseconds=\"0.000\" WriteAvgLatencyMilliseconds=\"0.000\" WriteLatencyStdDev=\"0.000\"/>\n" " <Bucket SampleMillisecond=\"8000\" Read=\"1\" Write=\"0\" Total=\"1\" ReadMinLatencyMilliseconds=\"0.000\" ReadMaxLatencyMilliseconds=\"0.000\" ReadAvgLatencyMilliseconds=\"0.000\" ReadLatencyStdDev=\"0.000\" WriteMinLatencyMilliseconds=\"0.000\" WriteMaxLatencyMilliseconds=\"0.000\" WriteAvgLatencyMilliseconds=\"0.000\" WriteLatencyStdDev=\"0.000\"/>\n" " <Bucket SampleMillisecond=\"9000\" Read=\"1\" Write=\"0\" Total=\"1\" ReadMinLatencyMilliseconds=\"0.000\" ReadMaxLatencyMilliseconds=\"0.000\" ReadAvgLatencyMilliseconds=\"0.000\" ReadLatencyStdDev=\"0.000\" WriteMinLatencyMilliseconds=\"0.000\" WriteMaxLatencyMilliseconds=\"0.000\" WriteAvgLatencyMilliseconds=\"0.000\" WriteLatencyStdDev=\"0.000\"/>\n" " <Bucket SampleMillisecond=\"10000\" Read=\"1\" Write=\"0\" Total=\"1\" ReadMinLatencyMilliseconds=\"0.000\" ReadMaxLatencyMilliseconds=\"0.000\" ReadAvgLatencyMilliseconds=\"0.000\" ReadLatencyStdDev=\"0.000\" WriteMinLatencyMilliseconds=\"0.000\" WriteMaxLatencyMilliseconds=\"0.000\" WriteAvgLatencyMilliseconds=\"0.000\" WriteLatencyStdDev=\"0.000\"/>\n" " </Iops>\n" " <Thread>\n" " <Id>0</Id>\n" " <Target>\n" " <Path>testfile1.dat</Path>\n" " <BytesCount>6291456</BytesCount>\n" " <FileSize>10485760</FileSize>\n" " <IOCount>16</IOCount>\n" " <ReadBytes>4194304</ReadBytes>\n" " <ReadCount>6</ReadCount>\n" " <WriteBytes>2097152</WriteBytes>\n" " <WriteCount>10</WriteCount>\n" " <Iops>\n" " <ReadIopsStdDev>0.000</ReadIopsStdDev>\n" " <IopsStdDev>0.000</IopsStdDev>\n" " <Bucket SampleMillisecond=\"1000\" Read=\"1\" Write=\"0\" Total=\"1\" ReadMinLatencyMilliseconds=\"0.000\" ReadMaxLatencyMilliseconds=\"0.000\" ReadAvgLatencyMilliseconds=\"0.000\" ReadLatencyStdDev=\"0.000\" WriteMinLatencyMilliseconds=\"0.000\" WriteMaxLatencyMilliseconds=\"0.000\" WriteAvgLatencyMilliseconds=\"0.000\" WriteLatencyStdDev=\"0.000\"/>\n" " <Bucket SampleMillisecond=\"2000\" Read=\"1\" Write=\"0\" Total=\"1\" ReadMinLatencyMilliseconds=\"0.000\" ReadMaxLatencyMilliseconds=\"0.000\" ReadAvgLatencyMilliseconds=\"0.000\" ReadLatencyStdDev=\"0.000\" WriteMinLatencyMilliseconds=\"0.000\" WriteMaxLatencyMilliseconds=\"0.000\" WriteAvgLatencyMilliseconds=\"0.000\" WriteLatencyStdDev=\"0.000\"/>\n" " <Bucket SampleMillisecond=\"3000\" Read=\"1\" Write=\"0\" Total=\"1\" ReadMinLatencyMilliseconds=\"0.000\" ReadMaxLatencyMilliseconds=\"0.000\" ReadAvgLatencyMilliseconds=\"0.000\" ReadLatencyStdDev=\"0.000\" WriteMinLatencyMilliseconds=\"0.000\" WriteMaxLatencyMilliseconds=\"0.000\" WriteAvgLatencyMilliseconds=\"0.000\" WriteLatencyStdDev=\"0.000\"/>\n" " <Bucket SampleMillisecond=\"4000\" Read=\"1\" Write=\"0\" Total=\"1\" ReadMinLatencyMilliseconds=\"0.000\" ReadMaxLatencyMilliseconds=\"0.000\" ReadAvgLatencyMilliseconds=\"0.000\" ReadLatencyStdDev=\"0.000\" WriteMinLatencyMilliseconds=\"0.000\" WriteMaxLatencyMilliseconds=\"0.000\" WriteAvgLatencyMilliseconds=\"0.000\" WriteLatencyStdDev=\"0.000\"/>\n" " <Bucket SampleMillisecond=\"5000\" Read=\"1\" Write=\"0\" Total=\"1\" ReadMinLatencyMilliseconds=\"0.000\" ReadMaxLatencyMilliseconds=\"0.000\" ReadAvgLatencyMilliseconds=\"0.000\" ReadLatencyStdDev=\"0.000\" WriteMinLatencyMilliseconds=\"0.000\" WriteMaxLatencyMilliseconds=\"0.000\" WriteAvgLatencyMilliseconds=\"0.000\" WriteLatencyStdDev=\"0.000\"/>\n" " <Bucket SampleMillisecond=\"6000\" Read=\"1\" Write=\"0\" Total=\"1\" ReadMinLatencyMilliseconds=\"0.000\" ReadMaxLatencyMilliseconds=\"0.000\" ReadAvgLatencyMilliseconds=\"0.000\" ReadLatencyStdDev=\"0.000\" WriteMinLatencyMilliseconds=\"0.000\" WriteMaxLatencyMilliseconds=\"0.000\" WriteAvgLatencyMilliseconds=\"0.000\" WriteLatencyStdDev=\"0.000\"/>\n" " <Bucket SampleMillisecond=\"7000\" Read=\"1\" Write=\"0\" Total=\"1\" ReadMinLatencyMilliseconds=\"0.000\" ReadMaxLatencyMilliseconds=\"0.000\" ReadAvgLatencyMilliseconds=\"0.000\" ReadLatencyStdDev=\"0.000\" WriteMinLatencyMilliseconds=\"0.000\" WriteMaxLatencyMilliseconds=\"0.000\" WriteAvgLatencyMilliseconds=\"0.000\" WriteLatencyStdDev=\"0.000\"/>\n" " <Bucket SampleMillisecond=\"8000\" Read=\"1\" Write=\"0\" Total=\"1\" ReadMinLatencyMilliseconds=\"0.000\" ReadMaxLatencyMilliseconds=\"0.000\" ReadAvgLatencyMilliseconds=\"0.000\" ReadLatencyStdDev=\"0.000\" WriteMinLatencyMilliseconds=\"0.000\" WriteMaxLatencyMilliseconds=\"0.000\" WriteAvgLatencyMilliseconds=\"0.000\" WriteLatencyStdDev=\"0.000\"/>\n" " <Bucket SampleMillisecond=\"9000\" Read=\"1\" Write=\"0\" Total=\"1\" ReadMinLatencyMilliseconds=\"0.000\" ReadMaxLatencyMilliseconds=\"0.000\" ReadAvgLatencyMilliseconds=\"0.000\" ReadLatencyStdDev=\"0.000\" WriteMinLatencyMilliseconds=\"0.000\" WriteMaxLatencyMilliseconds=\"0.000\" WriteAvgLatencyMilliseconds=\"0.000\" WriteLatencyStdDev=\"0.000\"/>\n" " <Bucket SampleMillisecond=\"10000\" Read=\"1\" Write=\"0\" Total=\"1\" ReadMinLatencyMilliseconds=\"0.000\" ReadMaxLatencyMilliseconds=\"0.000\" ReadAvgLatencyMilliseconds=\"0.000\" ReadLatencyStdDev=\"0.000\" WriteMinLatencyMilliseconds=\"0.000\" WriteMaxLatencyMilliseconds=\"0.000\" WriteAvgLatencyMilliseconds=\"0.000\" WriteLatencyStdDev=\"0.000\"/>\n" " </Iops>\n" " </Target>\n" " </Thread>\n" " </TimeSpan>\n" "</Results>"; #if 0 HANDLE h; DWORD written; h = CreateFileW(L"g:\\xmlresult-received.txt", GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); WriteFile(h, sResults.c_str(), (DWORD)sResults.length(), &written, NULL); VERIFY_ARE_EQUAL(sResults.length(), written); CloseHandle(h); h = CreateFileW(L"g:\\xmlresult-expected.txt", GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); WriteFile(h, pcszExpectedOutput, (DWORD)strlen(pcszExpectedOutput), &written, NULL); VERIFY_ARE_EQUAL((DWORD)strlen(pcszExpectedOutput), written); CloseHandle(h); printf("--\n%s\n", sResults.c_str()); printf("-------------------------------------------------\n"); printf("--\n%s\n", pcszExpectedOutput); #endif VERIFY_ARE_EQUAL(0, strcmp(sResults.c_str(), pcszExpectedOutput)); } void XmlResultParserUnitTests::Test_ParseProfile() { Profile profile; XmlResultParser parser; TimeSpan timeSpan; Target target; timeSpan.AddTarget(target); profile.AddTimeSpan(timeSpan); string s = parser.ParseProfile(profile); const char *pcszExpectedOutput = "<Profile>\n" " <Progress>0</Progress>\n" " <ResultFormat>text</ResultFormat>\n" " <Verbose>false</Verbose>\n" " <TimeSpans>\n" " <TimeSpan>\n" " <CompletionRoutines>false</CompletionRoutines>\n" " <MeasureLatency>false</MeasureLatency>\n" " <CalculateIopsStdDev>false</CalculateIopsStdDev>\n" " <DisableAffinity>false</DisableAffinity>\n" " <Duration>10</Duration>\n" " <Warmup>5</Warmup>\n" " <Cooldown>0</Cooldown>\n" " <ThreadCount>0</ThreadCount>\n" " <RequestCount>0</RequestCount>\n" " <IoBucketDuration>1000</IoBucketDuration>\n" " <RandSeed>0</RandSeed>\n" " <Targets>\n" " <Target>\n" " <Path></Path>\n" " <BlockSize>65536</BlockSize>\n" " <BaseFileOffset>0</BaseFileOffset>\n" " <SequentialScan>false</SequentialScan>\n" " <RandomAccess>false</RandomAccess>\n" " <TemporaryFile>false</TemporaryFile>\n" " <UseLargePages>false</UseLargePages>\n" " <WriteBufferContent>\n" " <Pattern>sequential</Pattern>\n" " </WriteBufferContent>\n" " <ParallelAsyncIO>false</ParallelAsyncIO>\n" " <StrideSize>65536</StrideSize>\n" " <InterlockedSequential>false</InterlockedSequential>\n" " <ThreadStride>0</ThreadStride>\n" " <MaxFileSize>0</MaxFileSize>\n" " <RequestCount>2</RequestCount>\n" " <WriteRatio>0</WriteRatio>\n" " <Throughput>0</Throughput>\n" " <ThreadsPerFile>1</ThreadsPerFile>\n" " <IOPriority>3</IOPriority>\n" " <Weight>1</Weight>\n" " </Target>\n" " </Targets>\n" " </TimeSpan>\n" " </TimeSpans>\n" "</Profile>\n"; //VERIFY_ARE_EQUAL(pcszExpectedOutput, s.c_str()); VERIFY_ARE_EQUAL(strlen(pcszExpectedOutput), s.length()); VERIFY_IS_TRUE(!strcmp(pcszExpectedOutput, s.c_str())); } void XmlResultParserUnitTests::Test_ParseTargetProfile() { Target target; string sResults; char pszExpectedOutput[4096]; int nWritten; const char *pcszOutputTemplate = \ "<Target>\n" " <Path>testfile1.dat</Path>\n" " <BlockSize>65536</BlockSize>\n" " <BaseFileOffset>0</BaseFileOffset>\n" " <SequentialScan>false</SequentialScan>\n" " <RandomAccess>false</RandomAccess>\n" " <TemporaryFile>false</TemporaryFile>\n" " <UseLargePages>false</UseLargePages>\n" " <DisableOSCache>true</DisableOSCache>\n" " <WriteThrough>true</WriteThrough>\n" " <WriteBufferContent>\n" " <Pattern>sequential</Pattern>\n" " </WriteBufferContent>\n" " <ParallelAsyncIO>false</ParallelAsyncIO>\n" " <StrideSize>65536</StrideSize>\n" " <InterlockedSequential>false</InterlockedSequential>\n" " <ThreadStride>0</ThreadStride>\n" " <MaxFileSize>0</MaxFileSize>\n" " <RequestCount>2</RequestCount>\n" " <WriteRatio>0</WriteRatio>\n" " <Throughput%s>%s</Throughput>\n" // 2 param " <ThreadsPerFile>1</ThreadsPerFile>\n" " <IOPriority>3</IOPriority>\n" " <Weight>1</Weight>\n" "</Target>\n"; target.SetPath("testfile1.dat"); target.SetCacheMode(TargetCacheMode::DisableOSCache); target.SetWriteThroughMode(WriteThroughMode::On); // Base case - no limit nWritten = sprintf_s(pszExpectedOutput, sizeof(pszExpectedOutput), pcszOutputTemplate, "", "0"); VERIFY_IS_GREATER_THAN(nWritten, 0); sResults = target.GetXml(0); VERIFY_ARE_EQUAL(sResults, pszExpectedOutput); // IOPS - with units target.SetThroughputIOPS(1000); nWritten = sprintf_s(pszExpectedOutput, sizeof(pszExpectedOutput), pcszOutputTemplate, " unit=\"IOPS\"", "1000"); VERIFY_IS_GREATER_THAN(nWritten, 0); sResults = target.GetXml(0); VERIFY_ARE_EQUAL(sResults, pszExpectedOutput); // BPMS - not specified with units in output target.SetThroughput(1000); nWritten = sprintf_s(pszExpectedOutput, sizeof(pszExpectedOutput), pcszOutputTemplate, "", "1000"); VERIFY_IS_GREATER_THAN(nWritten, 0); sResults = target.GetXml(0); VERIFY_ARE_EQUAL(sResults, pszExpectedOutput); } }
microsoft/diskspd
UnitTests/XmlResultParser/XmlResultParser.UnitTests.cpp
C++
mit
26,838
/** @jsx h */ import h from '../../helpers/h' export const schema = { blocks: { paragraph: { marks: [{ type: 'bold' }, { type: 'underline' }], }, }, } export const input = ( <value> <document> <paragraph> one <i>two</i> three </paragraph> </document> </value> ) export const output = ( <value> <document> <paragraph>one two three</paragraph> </document> </value> )
ashutoshrishi/slate
packages/slate/test/schema/custom/node-mark-invalid-default.js
JavaScript
mit
437
/* ======================================================================== * DOM-based Routing * Based on http://goo.gl/EUTi53 by Paul Irish * * Only fires on body classes that match. If a body class contains a dash, * replace the dash with an underscore when adding it to the object below. * * .noConflict() * The routing is enclosed within an anonymous function so that you can * always reference jQuery with $, even when in .noConflict() mode. * * Google CDN, Latest jQuery * To use the default WordPress version of jQuery, go to lib/config.php and * remove or comment out: add_theme_support('jquery-cdn'); * ======================================================================== */ (function($) { // Use this variable to set up the common and page specific functions. If you // rename this variable, you will also need to rename the namespace below. var Sage = { // All pages 'common': { init: function() { // JavaScript to be fired on all pages }, finalize: function() { // JavaScript to be fired on all pages, after page specific JS is fired } }, // Home page 'home': { init: function() { // JavaScript to be fired on the home page }, finalize: function() { // JavaScript to be fired on the home page, after the init JS } }, // About us page, note the change from about-us to about_us. 'about_us': { init: function() { // JavaScript to be fired on the about us page } } }; // The routing fires all common scripts, followed by the page specific scripts. // Add additional events for more control over timing e.g. a finalize event var UTIL = { fire: function(func, funcname, args) { var fire; var namespace = Sage; funcname = (funcname === undefined) ? 'init' : funcname; fire = func !== ''; fire = fire && namespace[func]; fire = fire && typeof namespace[func][funcname] === 'function'; if (fire) { namespace[func][funcname](args); } }, loadEvents: function() { // Fire common init JS UTIL.fire('common'); // Fire page-specific init JS, and then finalize JS $.each(document.body.className.replace(/-/g, '_').split(/\s+/), function(i, classnm) { UTIL.fire(classnm); UTIL.fire(classnm, 'finalize'); }); // Fire common finalize JS UTIL.fire('common', 'finalize'); } }; // Load Events $(document).ready(UTIL.loadEvents); })(jQuery); // Fully reference jQuery after this point. $(document).ready(function(){ $("#sidebar-home ul li").addClass( "col-md-3 col-sm-6" ); $("#sidebar-home div").addClass( "clearfix" ); });
erikkowalski/hoe-sage-8.1.0
assets/scripts/main.js
JavaScript
mit
2,737
#pragma once #include "interface/types.h" inline uintptr_t get_return_address() { uintptr_t ret; asm volatile("movq 8(%%rbp), %0" : "=r"(ret) : : "memory"); return ret; }
stmobo/Kraftwerk
os/include/arch/x86-64/debug.h
C
mit
174
import {bootstrap} from '@angular/platform-browser-dynamic'; import {ROUTER_PROVIDERS} from '@angular/router-deprecated'; import {HTTP_PROVIDERS} from '@angular/http'; import {AppComponent} from './app.component'; import {LoggerService} from './blocks/logger.service'; bootstrap(AppComponent, [ LoggerService, ROUTER_PROVIDERS, HTTP_PROVIDERS ]);
IMAMBAKS/data_viz_pa
app/main.ts
TypeScript
mit
352
package org.apache.shiro.grails.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import org.apache.shiro.authz.Permission; @Target({ElementType.FIELD, ElementType.METHOD}) @Retention(RetentionPolicy.RUNTIME) public @interface PermissionRequired { Class<? extends Permission> type(); /** * The name of the role required to be granted this authorization. */ String target() default "*"; String actions() default ""; }
putin266/Vote
target/work/plugins/shiro-1.2.1/src/java/org/apache/shiro/grails/annotations/PermissionRequired.java
Java
mit
572
local r = require('restructure') local ArrayT = r.Array describe('Array', function() describe('decode', function() it( 'should decode fixed length', function() local stream = r.DecodeStream.new(string.char(1, 2, 3, 4, 5)) local array = ArrayT.new(r.uint8, 4) assert.are.same({1, 2, 3, 4}, array:decode(stream)) end) it( 'should decode fixed amount of bytes', function() local stream = r.DecodeStream.new(string.char(1, 2, 3, 4, 5)) local array = ArrayT.new(r.uint16, 4, 'bytes') assert.are.same({258, 772}, array:decode(stream)) end) it( 'should decode length from parent key', function() local stream = r.DecodeStream.new(string.char(1, 2, 3, 4, 5)) local array = ArrayT.new(r.uint8, 'len') assert.are.same({1, 2, 3, 4}, array:decode(stream, { len = 4 })) end) it( 'should decode amount of bytes from parent key', function() local stream = r.DecodeStream.new(string.char(1, 2, 3, 4, 5)) local array = ArrayT.new(r.uint16, 'len', 'bytes') assert.are.same({258, 772}, array:decode(stream, { len = 4 })) end) it( 'should decode length as number before array', function() local stream = r.DecodeStream.new(string.char(4, 1, 2, 3, 4, 5)) local array = ArrayT.new(r.uint8, r.uint8) local val = array:decode(stream) local exp = {1,2,3,4} for i, v in ipairs(val) do assert.are_equal(exp[i], v) end end) it( 'should decode amount of bytes as number before array', function() local stream = r.DecodeStream.new(string.char(4, 1, 2, 3, 4, 5)) local array = ArrayT.new(r.uint16, r.uint8, 'bytes') local val = array:decode(stream) local exp = {258, 772} for i, v in ipairs(val) do assert.are_equal(exp[i], v) end end) it( 'should decode length from function', function() local stream = r.DecodeStream.new(string.char(1, 2, 3, 4, 5)) local array = ArrayT.new(r.uint8, function() return 4 end) assert.are.same({1, 2, 3, 4}, array:decode(stream)) end) it( 'should decode amount of bytes from function', function() local stream = r.DecodeStream.new(string.char(1, 2, 3, 4, 5)) local array = ArrayT.new(r.uint16, function() return 4 end, 'bytes') assert.are.same({258, 772}, array:decode(stream)) end) it( 'should decode to the end of the parent if no length is given', function() local stream = r.DecodeStream.new(string.char(1, 2, 3, 4, 5)) local array = ArrayT.new(r.uint8) assert.are.same({1, 2, 3, 4}, array:decode(stream, {_length = 4, _startOffset = 0})) end) it( 'should decode to the end of the stream if no parent and length is given', function() local stream = r.DecodeStream.new(string.char(1, 2, 3, 4)) local array = ArrayT.new(r.uint8) assert.are.same({1, 2, 3, 4}, array:decode(stream)) end) end) describe('size', function() it( 'should use array length', function() local array = ArrayT.new(r.uint8, 10) assert.are_equal(4, array:size({1, 2, 3, 4})) end) it( 'should add size of length field before string', function() local array = ArrayT.new(r.uint8, r.uint8) assert.are_equal(5, array:size({1, 2, 3, 4})) end) it( 'should use defined length if no value given', function() local array = ArrayT.new(r.uint8, 10) assert.are_equal(10, array:size()) end) end) describe('encode', function() it( 'should encode using array length', function() local stream = r.EncodeStream.new() local array = ArrayT.new(r.uint8, 10) array:encode(stream, {1, 2, 3, 4}) assert.are.same((string.char(1, 2, 3, 4)), stream:getContents()) end) it( 'should encode length as number before array', function() local stream = r.EncodeStream.new() local array = ArrayT.new(r.uint8, r.uint8) array:encode(stream, {1, 2, 3, 4}) assert.are.same((string.char(4, 1, 2, 3, 4)), stream:getContents()) end) it( 'should add pointers after array if length is encoded at start', function() local stream = r.EncodeStream.new() local array = ArrayT.new(r.Pointer.new(r.uint8, r.uint8), r.uint8) array:encode(stream, {1, 2, 3, 4}) assert.are.same((string.char(4,5, 6, 7, 8, 1, 2, 3, 4)), stream:getContents()) end) end) end)
deepakjois/luarestructure
spec/Array_spec.lua
Lua
mit
4,372
module.exports = { before: [function () { console.log('global beforeAll1'); }, 'alias1'], 'alias1': 'alias2', 'alias2': function () { console.log('global beforeAll2'); }, 'One': function () { this.sum = 1; }, 'plus one': function () { this.sum += 1; }, 'equals two': function () { if (this.sum !== 2) { throw new Error(this.sum + ' !== 2'); } } };
twolfson/doubleshot
test/test_files/complex_global_hooks/content.js
JavaScript
mit
399
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Submission 121</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0"> <img src="gallery/submissions/121.jpg" height="400"> </body> </html>
heyitsgarrett/envelopecollective
gallery_submission.php-id=121.html
HTML
mit
367
## 0.0.2 30-08-2016 * Fixed pin to mimic the old logic PR#4 ## 0.0.1 29-08-2016 * First version
senecajs-labs/seneca-pin
CHANGES.md
Markdown
mit
99
exports.__esModule = true; exports.parseServerOptionsForRunCommand = parseServerOptionsForRunCommand; exports.parseRunTargets = parseRunTargets; var _cordova = require('../cordova'); var cordova = babelHelpers.interopRequireWildcard(_cordova); var _cordovaProjectJs = require('../cordova/project.js'); var _cordovaRunnerJs = require('../cordova/runner.js'); var _cordovaRunTargetsJs = require('../cordova/run-targets.js'); // The architecture used by MDG's hosted servers; it's the architecture used by // 'meteor deploy'. var main = require('./main.js'); var _ = require('underscore'); var files = require('../fs/files.js'); var deploy = require('../meteor-services/deploy.js'); var buildmessage = require('../utils/buildmessage.js'); var auth = require('../meteor-services/auth.js'); var authClient = require('../meteor-services/auth-client.js'); var config = require('../meteor-services/config.js'); var Future = require('fibers/future'); var runLog = require('../runners/run-log.js'); var utils = require('../utils/utils.js'); var httpHelpers = require('../utils/http-helpers.js'); var archinfo = require('../utils/archinfo.js'); var catalog = require('../packaging/catalog/catalog.js'); var stats = require('../meteor-services/stats.js'); var Console = require('../console/console.js').Console; var projectContextModule = require('../project-context.js'); var release = require('../packaging/release.js'); var DEPLOY_ARCH = 'os.linux.x86_64'; // The default port that the development server listens on. var DEFAULT_PORT = '3000'; // Valid architectures that Meteor officially supports. var VALID_ARCHITECTURES = { "os.osx.x86_64": true, "os.linux.x86_64": true, "os.linux.x86_32": true, "os.windows.x86_32": true }; // __dirname - the location of the current executing file var __dirnameConverted = files.convertToStandardPath(__dirname); // Given a site name passed on the command line (eg, 'mysite'), return // a fully-qualified hostname ('mysite.meteor.com'). // // This is fairly simple for now. It appends 'meteor.com' if the name // doesn't contain a dot, and it deletes any trailing dots (the // technically legal hostname 'mysite.com.' is canonicalized to // 'mysite.com'). // // In the future, you should be able to make this default to some // other domain you control, rather than 'meteor.com'. var qualifySitename = function (site) { if (site.indexOf(".") === -1) site = site + ".meteor.com"; while (site.length && site[site.length - 1] === ".") site = site.substring(0, site.length - 1); return site; }; // Display a message showing valid Meteor architectures. var showInvalidArchMsg = function (arch) { Console.info("Invalid architecture: " + arch); Console.info("The following are valid Meteor architectures:"); _.each(_.keys(VALID_ARCHITECTURES), function (va) { Console.info(Console.command(va), Console.options({ indent: 2 })); }); }; // Utility functions to parse options in run/build/test-packages commands function parseServerOptionsForRunCommand(options, runTargets) { var parsedServerUrl = parsePortOption(options.port); // XXX COMPAT WITH 0.9.2.2 -- the 'mobile-port' option is deprecated var mobileServerOption = options['mobile-server'] || options['mobile-port']; var parsedMobileServerUrl = undefined; if (mobileServerOption) { parsedMobileServerUrl = parseMobileServerOption(mobileServerOption); } else { var isRunOnDeviceRequested = _.any(runTargets, function (runTarget) { return runTarget.isDevice; }); parsedMobileServerUrl = detectMobileServerUrl(parsedServerUrl, isRunOnDeviceRequested); } return { parsedServerUrl: parsedServerUrl, parsedMobileServerUrl: parsedMobileServerUrl }; } function parsePortOption(portOption) { var parsedServerUrl = utils.parseUrl(portOption); if (!parsedServerUrl.port) { Console.error("--port must include a port."); throw new main.ExitWithCode(1); } return parsedServerUrl; } function parseMobileServerOption(mobileServerOption) { var optionName = arguments.length <= 1 || arguments[1] === undefined ? 'mobile-server' : arguments[1]; var parsedMobileServerUrl = utils.parseUrl(mobileServerOption, { protocol: 'http://' }); if (!parsedMobileServerUrl.host) { Console.error('--' + optionName + ' must include a hostname.'); throw new main.ExitWithCode(1); } return parsedMobileServerUrl; } function detectMobileServerUrl(parsedServerUrl, isRunOnDeviceRequested) { // If we are running on a device, use the auto-detected IP if (isRunOnDeviceRequested) { var myIp = undefined; try { myIp = utils.ipAddress(); } catch (error) { Console.error('Error detecting IP address for mobile app to connect to:\n' + error.message + '\nPlease specify the address that the mobile app should connect\nto with --mobile-server.'); throw new main.ExitWithCode(1); } return { protocol: 'http://', host: myIp, port: parsedServerUrl.port }; } else { // We are running a simulator, use localhost return { protocol: 'http://', host: 'localhost', port: parsedServerUrl.port }; } } function parseRunTargets(targets) { return targets.map(function (target) { var targetParts = target.split('-'); var platform = targetParts[0]; var isDevice = targetParts[1] === 'device'; if (platform == 'ios') { return new _cordovaRunTargetsJs.iOSRunTarget(isDevice); } else if (platform == 'android') { return new _cordovaRunTargetsJs.AndroidRunTarget(isDevice); } else { Console.error('Unknown run target: ' + target); throw new main.ExitWithCode(1); } }); } ; /////////////////////////////////////////////////////////////////////////////// // options that act like commands /////////////////////////////////////////////////////////////////////////////// // Prints the Meteor architecture name of this host main.registerCommand({ name: '--arch', requiresRelease: false, pretty: false, catalogRefresh: new catalog.Refresh.Never() }, function (options) { Console.rawInfo(archinfo.host() + "\n"); }); //Prints the Meteor log about the versions main.registerCommand({ name:'--about', requiresRelease: false, catalogRefresh: new catalog.Refresh.Never() }, function (options){ if (release.current === null) { if (!options.appDir) throw new Error("missing release, but not in an app?"); Console.error("This project was created with a checkout of Meteor, rather than an " + "official release, and doesn't have a release number associated with " + "it. You can set its release with " + Console.command("'meteor update'") + "."); return 1; } if (release.current.isCheckout()) { var gitLog = utils.runGitInCheckout('log', '--format=%h%d', '-n 1').trim(); Console.error("Unreleased, running from a checkout at " + gitLog); return 1; } var dirname = files.convertToStandardPath(__dirname); var about = files.readFile(files.pathJoin(dirname, 'about.txt'), 'utf8'); console.log(about); }); // Prints the current release in use. Note that if there is not // actually a specific release, we print to stderr and exit non-zero, // while if there is a release we print to stdout and exit zero // (making this useful to scripts). // XXX: What does this mean in our new release-free world? main.registerCommand({ name: '--version', requiresRelease: false, pretty: false, catalogRefresh: new catalog.Refresh.Never() }, function (options) { if (release.current === null) { if (!options.appDir) throw new Error("missing release, but not in an app?"); Console.error("This project was created with a checkout of Meteor, rather than an " + "official release, and doesn't have a release number associated with " + "it. You can set its release with " + Console.command("'meteor update'") + "."); return 1; } if (release.current.isCheckout()) { var gitLog = utils.runGitInCheckout('log', '--format=%h%d', '-n 1').trim(); Console.error("Unreleased, running from a checkout at " + gitLog); return 1; } Console.info(release.current.getDisplayName()); }); // Internal use only. For automated testing. main.registerCommand({ name: '--long-version', requiresRelease: false, pretty: false, catalogRefresh: new catalog.Refresh.Never() }, function (options) { if (files.inCheckout()) { Console.error("checkout"); return 1; } else if (release.current === null) { // .meteor/release says "none" but not in a checkout. Console.error("none"); return 1; } else { Console.rawInfo(release.current.name + "\n"); Console.rawInfo(files.getToolsVersion() + "\n"); return 0; } }); // Internal use only. For automated testing. main.registerCommand({ name: '--requires-release', requiresRelease: true, pretty: false, catalogRefresh: new catalog.Refresh.Never() }, function (options) { return 0; }); /////////////////////////////////////////////////////////////////////////////// // run /////////////////////////////////////////////////////////////////////////////// var runCommandOptions = { requiresApp: true, maxArgs: Infinity, options: { port: { type: String, short: "p", 'default': DEFAULT_PORT }, 'mobile-server': { type: String }, // XXX COMPAT WITH 0.9.2.2 'mobile-port': { type: String }, 'app-port': { type: String }, 'debug-port': { type: String }, production: { type: Boolean }, 'raw-logs': { type: Boolean }, settings: { type: String }, test: { type: Boolean, 'default': false }, verbose: { type: Boolean, short: "v" }, // With --once, meteor does not re-run the project if it crashes // and does not monitor for file changes. Intentionally // undocumented: intended for automated testing (eg, cli-test.sh), // not end-user use. #Once once: { type: Boolean }, // Don't run linter on rebuilds 'no-lint': { type: Boolean }, // Allow the version solver to make breaking changes to the versions // of top-level dependencies. 'allow-incompatible-update': { type: Boolean } }, catalogRefresh: new catalog.Refresh.Never() }; main.registerCommand(_.extend({ name: 'run' }, runCommandOptions), doRunCommand); function doRunCommand(options) { Console.setVerbose(!!options.verbose); // Additional args are interpreted as run targets var runTargets = parseRunTargets(options.args); var _parseServerOptionsForRunCommand = parseServerOptionsForRunCommand(options, runTargets); var parsedServerUrl = _parseServerOptionsForRunCommand.parsedServerUrl; var parsedMobileServerUrl = _parseServerOptionsForRunCommand.parsedMobileServerUrl; var projectContext = new projectContextModule.ProjectContext({ projectDir: options.appDir, allowIncompatibleUpdate: options['allow-incompatible-update'], lintAppAndLocalPackages: !options['no-lint'] }); main.captureAndExit("=> Errors while initializing project:", function () { // We're just reading metadata here --- we'll wait to do the full build // preparation until after we've started listening on the proxy, etc. projectContext.readProjectMetadata(); }); if (release.explicit) { if (release.current.name !== projectContext.releaseFile.fullReleaseName) { console.log("=> Using %s as requested (overriding %s)", release.current.getDisplayName(), projectContext.releaseFile.displayReleaseName); console.log(); } } var appHost = undefined, appPort = undefined; if (options['app-port']) { var appPortMatch = options['app-port'].match(/^(?:(.+):)?([0-9]+)?$/); if (!appPortMatch) { Console.error("run: --app-port must be a number or be of the form 'host:port' ", "where port is a number. Try", Console.command("'meteor help run'") + " for help."); return 1; } appHost = appPortMatch[1] || null; // It's legit to specify `--app-port host:` and still let the port be // randomized. appPort = appPortMatch[2] ? parseInt(appPortMatch[2]) : null; } if (options['raw-logs']) runLog.setRawLogs(true); // Velocity testing. Sets up a DDP connection to the app process and // runs phantomjs. // // NOTE: this calls process.exit() when testing is done. if (options['test']) { options.once = true; var serverUrlForVelocity = 'http://' + (parsedServerUrl.host || "localhost") + ':' + parsedServerUrl.port; var velocity = require('../runners/run-velocity.js'); velocity.runVelocity(serverUrlForVelocity); } var cordovaRunner = undefined; if (!_.isEmpty(runTargets)) { main.captureAndExit('', 'preparing Cordova project', function () { var cordovaProject = new _cordovaProjectJs.CordovaProject(projectContext, { settingsFile: options.settings, mobileServerUrl: utils.formatUrl(parsedMobileServerUrl) }); cordovaRunner = new _cordovaRunnerJs.CordovaRunner(cordovaProject, runTargets); cordovaRunner.checkPlatformsForRunTargets(); }); } var runAll = require('../runners/run-all.js'); return runAll.run({ projectContext: projectContext, proxyPort: parsedServerUrl.port, proxyHost: parsedServerUrl.host, appPort: appPort, appHost: appHost, debugPort: options['debug-port'], settingsFile: options.settings, buildOptions: { minifyMode: options.production ? 'production' : 'development', buildMode: options.production ? 'production' : 'development' }, rootUrl: process.env.ROOT_URL, mongoUrl: process.env.MONGO_URL, oplogUrl: process.env.MONGO_OPLOG_URL, mobileServerUrl: utils.formatUrl(parsedMobileServerUrl), once: options.once, cordovaRunner: cordovaRunner }); } /////////////////////////////////////////////////////////////////////////////// // debug /////////////////////////////////////////////////////////////////////////////// main.registerCommand(_.extend({ name: 'debug' }, runCommandOptions), function (options) { options['debug-port'] = options['debug-port'] || '5858'; return doRunCommand(options); }); /////////////////////////////////////////////////////////////////////////////// // shell /////////////////////////////////////////////////////////////////////////////// main.registerCommand({ name: 'shell', requiresRelease: false, requiresApp: true, pretty: false, catalogRefresh: new catalog.Refresh.Never() }, function (options) { if (!options.appDir) { Console.error("The " + Console.command("'meteor shell'") + " command must be run", "in a Meteor app directory."); } else { var projectContext = new projectContextModule.ProjectContext({ projectDir: options.appDir }); // Convert to OS path here because shell/server.js doesn't know how to // convert paths, since it exists in the app and in the tool. require('../shell-client.js').connect(files.convertToOSPath(projectContext.getMeteorShellDirectory())); throw new main.WaitForExit(); } }); /////////////////////////////////////////////////////////////////////////////// // create /////////////////////////////////////////////////////////////////////////////// main.registerCommand({ name: 'create', maxArgs: 1, options: { list: { type: Boolean }, example: { type: String }, 'package': { type: Boolean } }, catalogRefresh: new catalog.Refresh.Never() }, function (options) { // Creating a package is much easier than creating an app, so if that's what // we are doing, do that first. (For example, we don't springboard to the // latest release to create a package if we are inside an app) if (options['package']) { var packageName = options.args[0]; // No package examples exist yet. if (options.list && options.example) { Console.error("No package examples exist at this time."); Console.error(); throw new main.ShowUsage(); } if (!packageName) { Console.error("Please specify the name of the package."); throw new main.ShowUsage(); } utils.validatePackageNameOrExit(packageName, { detailedColonExplanation: true }); // When we create a package, avoid introducing a colon into the file system // by naming the directory after the package name without the prefix. var fsName = packageName; if (packageName.indexOf(":") !== -1) { var split = packageName.split(":"); if (split.length > 2) { // It may seem like this check should be inside package version parser's // validatePackageName, but we decided to name test packages like this: // local-test:prefix:name, so we have to support building packages // with at least two colons. Therefore we will at least try to // discourage people from putting a ton of colons in their package names // here. Console.error(packageName + ": Package names may not have more than one colon."); return 1; } fsName = split[1]; } var packageDir; if (options.appDir) { packageDir = files.pathResolve(options.appDir, 'packages', fsName); } else { packageDir = files.pathResolve(fsName); } var inYourApp = options.appDir ? " in your app" : ""; if (files.exists(packageDir)) { Console.error(packageName + ": Already exists" + inYourApp); return 1; } var transform = function (x) { var xn = x.replace(/~name~/g, packageName).replace(/~fs-name~/g, fsName); // If we are running from checkout, comment out the line sourcing packages // from a release, with the latest release filled in (in case they do want // to publish later). If we are NOT running from checkout, fill it out // with the current release. var relString; if (release.current.isCheckout()) { xn = xn.replace(/~cc~/g, "//"); var rel = catalog.official.getDefaultReleaseVersion(); // the no-release case should never happen except in tests. relString = rel ? rel.version : "no-release"; } else { xn = xn.replace(/~cc~/g, ""); relString = release.current.getDisplayName({ noPrefix: true }); } // If we are not in checkout, write the current release here. return xn.replace(/~release~/g, relString); }; try { files.cp_r(files.pathJoin(__dirnameConverted, '..', 'static-assets', 'skel-pack'), packageDir, { transformFilename: function (f) { return transform(f); }, transformContents: function (contents, f) { if (/(\.html|\.js|\.css)/.test(f)) return new Buffer(transform(contents.toString()));else return contents; }, ignore: [/^local$/] }); } catch (err) { Console.error("Could not create package: " + err.message); return 1; } var displayPackageDir = files.convertToOSPath(files.pathRelative(files.cwd(), packageDir)); // Since the directory can't have colons, the directory name will often not // match the name of the package exactly, therefore we should tell people // where it was created. Console.info(packageName + ": created in", Console.path(displayPackageDir)); return 0; } // Suppose you have an app A, and from some directory inside that // app, you run 'meteor create /my/new/app'. The new app should use // the latest available Meteor release, not the release that A // uses. So if we were run from inside an app directory, and the // user didn't force a release with --release, we need to // springboard to the correct release and tools version. // // (In particular, it's not sufficient to create the new app with // this version of the tools, and then stamp on the correct release // at the end.) if (!release.current.isCheckout() && !release.forced) { if (release.current.name !== release.latestKnown()) { throw new main.SpringboardToLatestRelease(); } } var exampleDir = files.pathJoin(__dirnameConverted, '..', '..', 'examples'); var examples = _.reject(files.readdir(exampleDir), function (e) { return e === 'unfinished' || e === 'other' || e[0] === '.'; }); if (options.list) { Console.info("Available examples:"); _.each(examples, function (e) { Console.info(Console.command(e), Console.options({ indent: 2 })); }); Console.info(); Console.info("Create a project from an example with " + Console.command("'meteor create --example <name>'") + "."); return 0; }; var appPathAsEntered; if (options.args.length === 1) appPathAsEntered = options.args[0];else if (options.example) appPathAsEntered = options.example;else throw new main.ShowUsage(); var appPath = files.pathResolve(appPathAsEntered); if (files.findAppDir(appPath)) { Console.error("You can't create a Meteor project inside another Meteor project."); return 1; } var appName; if (appPathAsEntered === "." || appPathAsEntered === "./") { // If trying to create in current directory appName = files.pathBasename(files.cwd()); } else { appName = files.pathBasename(appPath); } var transform = function (x) { return x.replace(/~name~/g, appName); }; // These file extensions are usually metadata, not app code var nonCodeFileExts = ['.txt', '.md', '.json', '.sh']; var destinationHasCodeFiles = false; // If the directory doesn't exist, it clearly doesn't have any source code // inside itself if (files.exists(appPath)) { destinationHasCodeFiles = _.any(files.readdir(appPath), function thisPathCountsAsAFile(filePath) { // We don't mind if there are hidden files or directories (this includes // .git) and we don't need to check for .meteor here because the command // will fail earlier var isHidden = /^\./.test(filePath); if (isHidden) { // Not code return false; } // We do mind if there are non-hidden directories, because we don't want // to recursively check everything to do some crazy heuristic to see if // we should try to creat an app. var stats = files.stat(filePath); if (stats.isDirectory()) { // Could contain code return true; } // Check against our file extension white list var ext = files.pathExtname(filePath); if (ext == '' || _.contains(nonCodeFileExts, ext)) { return false; } // Everything not matched above is considered to be possible source code return true; }); } if (options.example) { if (destinationHasCodeFiles) { Console.error('When creating an example app, the destination directory can only contain dot-files or files with the following extensions: ' + nonCodeFileExts.join(', ') + '\n'); return 1; } if (examples.indexOf(options.example) === -1) { Console.error(options.example + ": no such example."); Console.error(); Console.error("List available applications with", Console.command("'meteor create --list'") + "."); return 1; } else { files.cp_r(files.pathJoin(exampleDir, options.example), appPath, { // We try not to check the project ID into git, but it might still // accidentally exist and get added (if running from checkout, for // example). To be on the safe side, explicitly remove the project ID // from example apps. ignore: [/^local$/, /^\.id$/] }); } } else { var toIgnore = [/^local$/, /^\.id$/]; if (destinationHasCodeFiles) { // If there is already source code in the directory, don't copy our // skeleton app code over it. Just create the .meteor folder and metadata toIgnore.push(/(\.html|\.js|\.css)/); } files.cp_r(files.pathJoin(__dirnameConverted, '..', 'static-assets', 'skel'), appPath, { transformFilename: function (f) { return transform(f); }, transformContents: function (contents, f) { if (/(\.html|\.js|\.css)/.test(f)) return new Buffer(transform(contents.toString()));else return contents; }, ignore: toIgnore }); } // We are actually working with a new meteor project at this point, so // set up its context. var projectContext = new projectContextModule.ProjectContext({ projectDir: appPath, // Write .meteor/versions even if --release is specified. alwaysWritePackageMap: true, // examples come with a .meteor/versions file, but we shouldn't take it // too seriously allowIncompatibleUpdate: true }); main.captureAndExit("=> Errors while creating your project", function () { projectContext.readProjectMetadata(); if (buildmessage.jobHasMessages()) return; projectContext.releaseFile.write(release.current.isCheckout() ? "none" : release.current.name); if (buildmessage.jobHasMessages()) return; // Any upgrader that is in this version of Meteor doesn't need to be run on // this project. var upgraders = require('../upgraders.js'); projectContext.finishedUpgraders.appendUpgraders(upgraders.allUpgraders()); projectContext.prepareProjectForBuild(); }); // No need to display the PackageMapDelta here, since it would include all of // the packages (or maybe an unpredictable subset based on what happens to be // in the template's versions file). var appNameToDisplay = appPathAsEntered === "." ? "current directory" : '\'' + appPathAsEntered + '\''; var message = 'Created a new Meteor app in ' + appNameToDisplay; if (options.example && options.example !== appPathAsEntered) { message += ' (from \'' + options.example + '\' template)'; } message += "."; Console.info(message + "\n"); // Print a nice message telling people we created their new app, and what to // do next. Console.info("To run your new app:"); if (appPathAsEntered !== ".") { // Wrap the app path in quotes if it contains spaces var appPathWithQuotesIfSpaces = appPathAsEntered.indexOf(' ') === -1 ? appPathAsEntered : '\'' + appPathAsEntered + '\''; // Don't tell people to 'cd .' Console.info(Console.command("cd " + appPathWithQuotesIfSpaces), Console.options({ indent: 2 })); } Console.info(Console.command("meteor"), Console.options({ indent: 2 })); Console.info(""); Console.info("If you are new to Meteor, try some of the learning resources here:"); Console.info(Console.url("https://www.meteor.com/learn"), Console.options({ indent: 2 })); Console.info(""); }); /////////////////////////////////////////////////////////////////////////////// // build /////////////////////////////////////////////////////////////////////////////// var buildCommands = { minArgs: 1, maxArgs: 1, requiresApp: true, options: { debug: { type: Boolean }, directory: { type: Boolean }, architecture: { type: String }, 'mobile-settings': { type: String }, server: { type: String }, // XXX COMPAT WITH 0.9.2.2 "mobile-port": { type: String }, verbose: { type: Boolean, short: "v" }, 'allow-incompatible-update': { type: Boolean } }, catalogRefresh: new catalog.Refresh.Never() }; main.registerCommand(_.extend({ name: 'build' }, buildCommands), function (options) { return buildCommand(options); }); // Deprecated -- identical functionality to 'build' with one exception: it // doesn't output a directory with all builds but rather only one tarball with // server/client programs. // XXX COMPAT WITH 0.9.1.1 main.registerCommand(_.extend({ name: 'bundle', hidden: true }, buildCommands), function (options) { Console.error("This command has been deprecated in favor of " + Console.command("'meteor build'") + ", which allows you to " + "build for multiple platforms and outputs a directory instead of " + "a single tarball. See " + Console.command("'meteor help build'") + " " + "for more information."); Console.error(); return buildCommand(_.extend(options, { _serverOnly: true })); }); var buildCommand = function (options) { Console.setVerbose(!!options.verbose); // XXX output, to stderr, the name of the file written to (for human // comfort, especially since we might change the name) // XXX name the root directory in the bundle based on the basename // of the file, not a constant 'bundle' (a bit obnoxious for // machines, but worth it for humans) // Error handling for options.architecture. We must pass in only one of three // architectures. See archinfo.js for more information on what the // architectures are, what they mean, et cetera. if (options.architecture && !_.has(VALID_ARCHITECTURES, options.architecture)) { showInvalidArchMsg(options.architecture); return 1; } var bundleArch = options.architecture || archinfo.host(); var projectContext = new projectContextModule.ProjectContext({ projectDir: options.appDir, serverArchitectures: _.uniq([bundleArch, archinfo.host()]), allowIncompatibleUpdate: options['allow-incompatible-update'] }); main.captureAndExit("=> Errors while initializing project:", function () { projectContext.prepareProjectForBuild(); }); projectContext.packageMapDelta.displayOnConsole(); // options['mobile-settings'] is used to set the initial value of // `Meteor.settings` on mobile apps. Pass it on to options.settings, // which is used in this command. if (options['mobile-settings']) { options.settings = options['mobile-settings']; } var appName = files.pathBasename(options.appDir); var cordovaPlatforms = undefined; var parsedMobileServerUrl = undefined; if (!options._serverOnly) { cordovaPlatforms = projectContext.platformList.getCordovaPlatforms(); if (process.platform === 'win32' && !_.isEmpty(cordovaPlatforms)) { Console.warn('Can\'t build for mobile on Windows. Skipping the following platforms: ' + cordovaPlatforms.join(", ")); cordovaPlatforms = []; } else if (process.platform !== 'darwin' && _.contains(cordovaPlatforms, 'ios')) { cordovaPlatforms = _.without(cordovaPlatforms, 'ios'); Console.warn("Currently, it is only possible to build iOS apps \ on an OS X system."); } if (!_.isEmpty(cordovaPlatforms)) { // XXX COMPAT WITH 0.9.2.2 -- the --mobile-port option is deprecated var mobileServerOption = options.server || options["mobile-port"]; if (!mobileServerOption) { // For Cordova builds, require '--server'. // XXX better error message? Console.error("Supply the server hostname and port in the --server option " + "for mobile app builds."); return 1; } parsedMobileServerUrl = parseMobileServerOption(mobileServerOption, 'server'); } } else { cordovaPlatforms = []; } var buildDir = projectContext.getProjectLocalDirectory('build_tar'); var outputPath = files.pathResolve(options.args[0]); // get absolute path // Unless we're just making a tarball, warn if people try to build inside the // app directory. if (options.directory || !_.isEmpty(cordovaPlatforms)) { var relative = files.pathRelative(options.appDir, outputPath); // We would like the output path to be outside the app directory, which // means the first step to getting there is going up a level. if (relative.substr(0, 3) !== '..' + files.pathSep) { Console.warn(); Console.labelWarn("The output directory is under your source tree.", "Your generated files may get interpreted as source code!", "Consider building into a different directory instead (" + Console.command("meteor build ../output") + ")", Console.options({ indent: 2 })); Console.warn(); } } var bundlePath = options.directory ? options._serverOnly ? outputPath : files.pathJoin(outputPath, 'bundle') : files.pathJoin(buildDir, 'bundle'); stats.recordPackages({ what: "sdk.bundle", projectContext: projectContext }); var bundler = require('../isobuild/bundler.js'); var bundleResult = bundler.bundle({ projectContext: projectContext, outputPath: bundlePath, buildOptions: { minifyMode: options.debug ? 'development' : 'production', // XXX is this a good idea, or should linux be the default since // that's where most people are deploying // default? i guess the problem with using DEPLOY_ARCH as default // is then 'meteor bundle' with no args fails if you have any local // packages with binary npm dependencies serverArch: bundleArch, buildMode: options.debug ? 'development' : 'production' }, providePackageJSONForUnavailableBinaryDeps: !!process.env.METEOR_BINARY_DEP_WORKAROUND }); if (bundleResult.errors) { Console.error("Errors prevented bundling:"); Console.error(bundleResult.errors.formatMessages()); return 1; } if (!options._serverOnly) files.mkdir_p(outputPath); if (!options.directory) { main.captureAndExit('', 'creating server tarball', function () { try { var outputTar = options._serverOnly ? outputPath : files.pathJoin(outputPath, appName + '.tar.gz'); files.createTarball(files.pathJoin(buildDir, 'bundle'), outputTar); } catch (err) { buildmessage.exception(err); files.rm_recursive(buildDir); } }); } if (!_.isEmpty(cordovaPlatforms)) { (function () { var cordovaProject = undefined; main.captureAndExit('', function () { buildmessage.enterJob({ title: "preparing Cordova project" }, function () { cordovaProject = new _cordovaProjectJs.CordovaProject(projectContext, { settingsFile: options.settings, mobileServerUrl: utils.formatUrl(parsedMobileServerUrl) }); var plugins = cordova.pluginVersionsFromStarManifest(bundleResult.starManifest); cordovaProject.prepareFromAppBundle(bundlePath, plugins); }); for (var _iterator = cordovaPlatforms, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { if (_isArray) { if (_i >= _iterator.length) break; platform = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) break; platform = _i.value; } buildmessage.enterJob({ title: 'building Cordova app for ' + cordova.displayNameForPlatform(platform) }, function () { var buildOptions = []; if (!options.debug) buildOptions.push('--release'); cordovaProject.buildForPlatform(platform, buildOptions); var buildPath = files.pathJoin(projectContext.getProjectLocalDirectory('cordova-build'), 'platforms', platform); var platformOutputPath = files.pathJoin(outputPath, platform); files.cp_r(buildPath, files.pathJoin(platformOutputPath, 'project')); if (platform === 'ios') { files.writeFile(files.pathJoin(platformOutputPath, 'README'), 'This is an auto-generated XCode project for your iOS application.\n\nInstructions for publishing your iOS app to App Store can be found at:\nhttps://github.com/meteor/meteor/wiki/How-to-submit-your-iOS-app-to-App-Store\n', "utf8"); } else if (platform === 'android') { var apkPath = files.pathJoin(buildPath, 'build/outputs/apk', options.debug ? 'android-debug.apk' : 'android-release-unsigned.apk'); if (files.exists(apkPath)) { files.copyFile(apkPath, files.pathJoin(platformOutputPath, options.debug ? 'debug.apk' : 'release-unsigned.apk')); } files.writeFile(files.pathJoin(platformOutputPath, 'README'), 'This is an auto-generated Gradle project for your Android application.\n\nInstructions for publishing your Android app to Play Store can be found at:\nhttps://github.com/meteor/meteor/wiki/How-to-submit-your-Android-app-to-Play-Store\n', "utf8"); } }); } }); })(); } files.rm_recursive(buildDir); }; /////////////////////////////////////////////////////////////////////////////// // lint /////////////////////////////////////////////////////////////////////////////// main.registerCommand({ name: 'lint', maxArgs: 0, requiresAppOrPackage: true, options: { 'allow-incompatible-updates': { type: Boolean } }, catalogRefresh: new catalog.Refresh.Never() }, function (options) { var packageDir = options.packageDir; var appDir = options.appDir; var projectContext = null; // if the goal is to lint the package, don't include the whole app if (packageDir) { // similar to `meteor publish`, create a fake project var tempProjectDir = files.mkdtemp('meteor-package-build'); projectContext = new projectContextModule.ProjectContext({ projectDir: tempProjectDir, explicitlyAddedLocalPackageDirs: [packageDir], packageMapFilename: files.pathJoin(packageDir, '.versions'), alwaysWritePackageMap: true, forceIncludeCordovaUnibuild: true, allowIncompatibleUpdate: options['allow-incompatible-update'], lintPackageWithSourceRoot: packageDir }); main.captureAndExit("=> Errors while setting up package:", function () { return( // Read metadata and initialize catalog. projectContext.initializeCatalog() ); }); var versionRecord = projectContext.localCatalog.getVersionBySourceRoot(packageDir); if (!versionRecord) { throw Error("explicitly added local package dir missing?"); } var packageName = versionRecord.packageName; var constraint = utils.parsePackageConstraint(packageName); projectContext.projectConstraintsFile.removeAllPackages(); projectContext.projectConstraintsFile.addConstraints([constraint]); } // linting the app if (!projectContext && appDir) { projectContext = new projectContextModule.ProjectContext({ projectDir: appDir, serverArchitectures: [archinfo.host()], allowIncompatibleUpdate: options['allow-incompatible-update'], lintAppAndLocalPackages: true }); } main.captureAndExit("=> Errors prevented the build:", function () { projectContext.prepareProjectForBuild(); }); var bundlePath = projectContext.getProjectLocalDirectory('build'); var bundler = require('../isobuild/bundler.js'); var bundle = bundler.bundle({ projectContext: projectContext, outputPath: null, buildOptions: { minifyMode: 'development' } }); var displayName = options.packageDir ? 'package' : 'app'; if (bundle.errors) { Console.error('=> Errors building your ' + displayName + ':\n\n' + bundle.errors.formatMessages()); throw new main.ExitWithCode(2); } if (bundle.warnings) { Console.warn(bundle.warnings.formatMessages()); return 1; } return 0; }); /////////////////////////////////////////////////////////////////////////////// // mongo /////////////////////////////////////////////////////////////////////////////// main.registerCommand({ name: 'mongo', maxArgs: 1, options: { url: { type: Boolean, short: 'U' } }, requiresApp: function (options) { return options.args.length === 0; }, pretty: false, catalogRefresh: new catalog.Refresh.Never() }, function (options) { var mongoUrl; var usedMeteorAccount = false; if (options.args.length === 0) { // localhost mode var findMongoPort = require('../runners/run-mongo.js').findMongoPort; var mongoPort = findMongoPort(options.appDir); // XXX detect the case where Meteor is running, but MONGO_URL was // specified? if (!mongoPort) { Console.info("mongo: Meteor isn't running a local MongoDB server."); Console.info(); Console.info('This command only works while Meteor is running your application locally. Start your application first with \'meteor\' and then run this command in a new terminal. This error will also occur if you asked Meteor to use a different MongoDB server with $MONGO_URL when you ran your application.'); Console.info(); Console.info('If you\'re trying to connect to the database of an app you deployed with ' + Console.command("'meteor deploy'") + ', specify your site\'s name as an argument to this command.'); return 1; } mongoUrl = "mongodb://127.0.0.1:" + mongoPort + "/meteor"; } else { // remote mode var site = qualifySitename(options.args[0]); config.printUniverseBanner(); mongoUrl = deploy.temporaryMongoUrl(site); usedMeteorAccount = true; if (!mongoUrl) // temporaryMongoUrl() will have printed an error message return 1; } if (options.url) { console.log(mongoUrl); } else { if (usedMeteorAccount) auth.maybePrintRegistrationLink(); process.stdin.pause(); var runMongo = require('../runners/run-mongo.js'); runMongo.runMongoShell(mongoUrl); throw new main.WaitForExit(); } }); /////////////////////////////////////////////////////////////////////////////// // reset /////////////////////////////////////////////////////////////////////////////// main.registerCommand({ name: 'reset', // Doesn't actually take an argument, but we want to print an custom // error message if they try to pass one. maxArgs: 1, requiresApp: true, catalogRefresh: new catalog.Refresh.Never() }, function (options) { if (options.args.length !== 0) { Console.error("meteor reset only affects the locally stored database."); Console.error(); Console.error("To reset a deployed application use"); Console.error(Console.command("meteor deploy --delete appname"), Console.options({ indent: 2 })); Console.error("followed by"); Console.error(Console.command("meteor deploy appname"), Console.options({ indent: 2 })); return 1; } // XXX detect the case where Meteor is running the app, but // MONGO_URL was set, so we don't see a Mongo process var findMongoPort = require('../runners/run-mongo.js').findMongoPort; var isRunning = !!findMongoPort(options.appDir); if (isRunning) { Console.error("reset: Meteor is running."); Console.error(); Console.error("This command does not work while Meteor is running your application.", "Exit the running Meteor development server."); return 1; } var localDir = files.pathJoin(options.appDir, '.meteor', 'local'); files.rm_recursive(localDir); Console.info("Project reset."); }); /////////////////////////////////////////////////////////////////////////////// // deploy /////////////////////////////////////////////////////////////////////////////// main.registerCommand({ name: 'deploy', minArgs: 1, maxArgs: 1, options: { 'delete': { type: Boolean, short: 'D' }, debug: { type: Boolean }, settings: { type: String }, // No longer supported, but we still parse it out so that we can // print a custom error message. password: { type: String }, // Override architecture to deploy whatever stuff we have locally, even if // it contains binary packages that should be incompatible. A hack to allow // people to deploy from checkout or do other weird shit. We are not // responsible for the consequences. 'override-architecture-with-local': { type: Boolean }, 'allow-incompatible-update': { type: Boolean } }, requiresApp: function (options) { return !options['delete']; }, catalogRefresh: new catalog.Refresh.Never() }, function (options) { var site = qualifySitename(options.args[0]); config.printUniverseBanner(); if (options['delete']) { return deploy.deleteApp(site); } if (options.password) { Console.error("Setting passwords on apps is no longer supported. Now there are " + "user accounts and your apps are associated with your account so " + "that only you (and people you designate) can access them. See the " + Console.command("'meteor claim'") + " and " + Console.command("'meteor authorized'") + " commands."); return 1; } var loggedIn = auth.isLoggedIn(); if (!loggedIn) { Console.error("To instantly deploy your app on a free testing server,", "just enter your email address!"); Console.error(); if (!auth.registerOrLogIn()) return 1; } // Override architecture iff applicable. var buildArch = DEPLOY_ARCH; if (options['override-architecture-with-local']) { Console.warn(); Console.labelWarn("OVERRIDING DEPLOY ARCHITECTURE WITH LOCAL ARCHITECTURE.", "If your app contains binary code, it may break in unexpected " + "and terrible ways."); buildArch = archinfo.host(); } var projectContext = new projectContextModule.ProjectContext({ projectDir: options.appDir, serverArchitectures: _.uniq([buildArch, archinfo.host()]), allowIncompatibleUpdate: options['allow-incompatible-update'] }); main.captureAndExit("=> Errors while initializing project:", function () { projectContext.prepareProjectForBuild(); }); projectContext.packageMapDelta.displayOnConsole(); var buildOptions = { minifyMode: options.debug ? 'development' : 'production', buildMode: options.debug ? 'development' : 'production', serverArch: buildArch }; var deployResult = deploy.bundleAndDeploy({ projectContext: projectContext, site: site, settingsFile: options.settings, buildOptions: buildOptions }); if (deployResult === 0) { auth.maybePrintRegistrationLink({ leadingNewline: true, // If the user was already logged in at the beginning of the // deploy, then they've already been prompted to set a password // at least once before, so we use a slightly different message. firstTime: !loggedIn }); } return deployResult; }); /////////////////////////////////////////////////////////////////////////////// // logs /////////////////////////////////////////////////////////////////////////////// main.registerCommand({ name: 'logs', minArgs: 1, maxArgs: 1, catalogRefresh: new catalog.Refresh.Never() }, function (options) { var site = qualifySitename(options.args[0]); return deploy.logs(site); }); /////////////////////////////////////////////////////////////////////////////// // authorized /////////////////////////////////////////////////////////////////////////////// main.registerCommand({ name: 'authorized', minArgs: 1, maxArgs: 1, options: { add: { type: String, short: "a" }, remove: { type: String, short: "r" }, list: { type: Boolean } }, pretty: function (options) { // pretty if we're mutating; plain if we're listing (which is more likely to // be used by scripts) return options.add || options.remove; }, catalogRefresh: new catalog.Refresh.Never() }, function (options) { if (options.add && options.remove) { Console.error("Sorry, you can only add or remove one user at a time."); return 1; } if ((options.add || options.remove) && options.list) { Console.error("Sorry, you can't change the users at the same time as", "you're listing them."); return 1; } config.printUniverseBanner(); auth.pollForRegistrationCompletion(); var site = qualifySitename(options.args[0]); if (!auth.isLoggedIn()) { Console.error("You must be logged in for that. Try " + Console.command("'meteor login'")); return 1; } if (options.add) return deploy.changeAuthorized(site, "add", options.add);else if (options.remove) return deploy.changeAuthorized(site, "remove", options.remove);else return deploy.listAuthorized(site); }); /////////////////////////////////////////////////////////////////////////////// // claim /////////////////////////////////////////////////////////////////////////////// main.registerCommand({ name: 'claim', minArgs: 1, maxArgs: 1, catalogRefresh: new catalog.Refresh.Never() }, function (options) { config.printUniverseBanner(); auth.pollForRegistrationCompletion(); var site = qualifySitename(options.args[0]); if (!auth.isLoggedIn()) { Console.error("You must be logged in to claim sites. Use " + Console.command("'meteor login'") + " to log in. If you don't have a " + "Meteor developer account yet, create one by clicking " + Console.command("'Sign in'") + " and then " + Console.command("'Create account'") + " at www.meteor.com."); Console.error(); return 1; } return deploy.claim(site); }); /////////////////////////////////////////////////////////////////////////////// // test-packages /////////////////////////////////////////////////////////////////////////////// // // Test your local packages. // main.registerCommand({ name: 'test-packages', maxArgs: Infinity, options: { port: { type: String, short: "p", 'default': DEFAULT_PORT }, 'mobile-server': { type: String }, // XXX COMPAT WITH 0.9.2.2 'mobile-port': { type: String }, 'debug-port': { type: String }, deploy: { type: String }, production: { type: Boolean }, settings: { type: String }, velocity: { type: Boolean }, verbose: { type: Boolean, short: "v" }, // Undocumented. See #Once once: { type: Boolean }, // Undocumented. To ensure that QA covers both // PollingObserveDriver and OplogObserveDriver, this option // disables oplog for tests. (It still creates a replset, it just // doesn't do oplog tailing.) 'disable-oplog': { type: Boolean }, // Undocumented flag to use a different test driver. 'driver-package': { type: String, 'default': 'test-in-browser' }, // Sets the path of where the temp app should be created 'test-app-path': { type: String }, // Undocumented, runs tests under selenium 'selenium': { type: Boolean }, 'selenium-browser': { type: String }, // Undocumented. Usually we just show a banner saying 'Tests' instead of // the ugly path to the temporary test directory, but if you actually want // to see it you can ask for it. 'show-test-app-path': { type: Boolean }, // hard-coded options with all known Cordova platforms ios: { type: Boolean }, 'ios-device': { type: Boolean }, android: { type: Boolean }, 'android-device': { type: Boolean }, // This could theoretically be useful/necessary in conjunction with // --test-app-path. 'allow-incompatible-update': { type: Boolean }, // Don't print linting messages for tested packages 'no-lint': { type: Boolean }, // allow excluding packages when testing all packages. // should be a comma-separated list of package names. 'exclude': { type: String } }, catalogRefresh: new catalog.Refresh.Never() }, function (options) { Console.setVerbose(!!options.verbose); var runTargets = parseRunTargets(_.intersection(Object.keys(options), ['ios', 'ios-device', 'android', 'android-device'])); var _parseServerOptionsForRunCommand2 = parseServerOptionsForRunCommand(options, runTargets); var parsedServerUrl = _parseServerOptionsForRunCommand2.parsedServerUrl; var parsedMobileServerUrl = _parseServerOptionsForRunCommand2.parsedMobileServerUrl; // Find any packages mentioned by a path instead of a package name. We will // load them explicitly into the catalog. var packagesByPath = _.filter(options.args, function (p) { return p.indexOf('/') !== -1; }); // Make a temporary app dir (based on the test runner app). This will be // cleaned up on process exit. Using a temporary app dir means that we can // run multiple "test-packages" commands in parallel without them stomping // on each other. var testRunnerAppDir = options['test-app-path'] || files.mkdtemp('meteor-test-run'); // Download packages for our architecture, and for the deploy server's // architecture if we're deploying. var serverArchitectures = [archinfo.host()]; if (options.deploy && DEPLOY_ARCH !== archinfo.host()) serverArchitectures.push(DEPLOY_ARCH); // XXX Because every run uses a new app with its own IsopackCache directory, // this always does a clean build of all packages. Maybe we can speed up // repeated test-packages calls with some sort of shared or semi-shared // isopack cache that's specific to test-packages? See #3012. var projectContext = new projectContextModule.ProjectContext({ projectDir: testRunnerAppDir, // If we're currently in an app, we still want to use the real app's // packages subdirectory, not the test runner app's empty one. projectDirForLocalPackages: options.appDir, explicitlyAddedLocalPackageDirs: packagesByPath, serverArchitectures: serverArchitectures, allowIncompatibleUpdate: options['allow-incompatible-update'], lintAppAndLocalPackages: !options['no-lint'] }); main.captureAndExit("=> Errors while setting up tests:", function () { // Read metadata and initialize catalog. projectContext.initializeCatalog(); }); // Overwrite .meteor/release. projectContext.releaseFile.write(release.current.isCheckout() ? "none" : release.current.name); var packagesToAdd = getTestPackageNames(projectContext, options.args); // filter out excluded packages var excludedPackages = options.exclude && options.exclude.split(','); if (excludedPackages) { packagesToAdd = _.filter(packagesToAdd, function (p) { return !_.some(excludedPackages, function (excluded) { return p.replace(/^local-test:/, '') === excluded; }); }); } // Use the driver package // Also, add `autoupdate` so that you don't have to manually refresh the tests packagesToAdd.unshift("autoupdate", options['driver-package']); var constraintsToAdd = _.map(packagesToAdd, function (p) { return utils.parsePackageConstraint(p); }); // Add the packages to our in-memory representation of .meteor/packages. (We // haven't yet resolved constraints, so this will affect constraint // resolution.) This will get written to disk once we prepareProjectForBuild, // either in the Cordova code below, right before deploying below, or in the // app runner. (Note that removeAllPackages removes any comments from // .meteor/packages, but that's OK since this isn't a real user project.) projectContext.projectConstraintsFile.removeAllPackages(); projectContext.projectConstraintsFile.addConstraints(constraintsToAdd); // Write these changes to disk now, so that if the first attempt to prepare // the project for build hits errors, we don't lose them on // projectContext.reset. projectContext.projectConstraintsFile.writeIfModified(); // The rest of the projectContext preparation process will happen inside the // runner, once the proxy is listening. The changes we made were persisted to // disk, so projectContext.reset won't make us forget anything. var cordovaRunner = undefined; if (!_.isEmpty(runTargets)) { main.captureAndExit('', 'preparing Cordova project', function () { var cordovaProject = new _cordovaProjectJs.CordovaProject(projectContext, { settingsFile: options.settings, mobileServerUrl: utils.formatUrl(parsedMobileServerUrl) }); cordovaRunner = new _cordovaRunnerJs.CordovaRunner(cordovaProject, runTargets); projectContext.platformList.write(cordovaRunner.platformsForRunTargets); cordovaRunner.checkPlatformsForRunTargets(); }); } options.cordovaRunner = cordovaRunner; if (options.velocity) { var serverUrlForVelocity = 'http://' + (parsedServerUrl.host || "localhost") + ':' + parsedServerUrl.port; var velocity = require('../runners/run-velocity.js'); velocity.runVelocity(serverUrlForVelocity); } return runTestAppForPackages(projectContext, _.extend(options, { mobileServerUrl: utils.formatUrl(parsedMobileServerUrl) })); }); // Returns the "local-test:*" package names for the given package names (or for // all local packages if packageNames is empty/unspecified). var getTestPackageNames = function (projectContext, packageNames) { var packageNamesSpecifiedExplicitly = !_.isEmpty(packageNames); if (_.isEmpty(packageNames)) { // If none specified, test all local packages. (We don't have tests for // non-local packages.) packageNames = projectContext.localCatalog.getAllPackageNames(); } var testPackages = []; main.captureAndExit("=> Errors while collecting tests:", function () { _.each(packageNames, function (p) { buildmessage.enterJob("trying to test package `" + p + "`", function () { // If it's a package name, look it up the normal way. if (p.indexOf('/') === -1) { if (p.indexOf('@') !== -1) { buildmessage.error("You may not specify versions for local packages: " + p); return; // recover by ignoring } // Check to see if this is a real local package, and if it is a real // local package, if it has tests. var version = projectContext.localCatalog.getLatestVersion(p); if (!version) { buildmessage.error("Not a known local package, cannot test"); } else if (version.testName) { testPackages.push(version.testName); } else if (packageNamesSpecifiedExplicitly) { // It's only an error to *ask* to test a package with no tests, not // to come across a package with no tests when you say "test all // packages". buildmessage.error("Package has no tests"); } } else { // Otherwise, it's a directory; find it by source root. version = projectContext.localCatalog.getVersionBySourceRoot(files.pathResolve(p)); if (!version) { throw Error("should have been caught when initializing catalog?"); } if (version.testName) { testPackages.push(version.testName); } // It is not an error to mention a package by directory that is a // package but has no tests; this means you can run `meteor // test-packages $APP/packages/*` without having to worry about the // packages that don't have tests. } }); }); }); return testPackages; }; var runTestAppForPackages = function (projectContext, options) { var buildOptions = { minifyMode: options.production ? 'production' : 'development', buildMode: options.production ? 'production' : 'development' }; if (options.deploy) { // Run the constraint solver and build local packages. main.captureAndExit("=> Errors while initializing project:", function () { projectContext.prepareProjectForBuild(); }); // No need to display the PackageMapDelta here, since it would include all // of the packages! buildOptions.serverArch = DEPLOY_ARCH; return deploy.bundleAndDeploy({ projectContext: projectContext, site: options.deploy, settingsFile: options.settings, buildOptions: buildOptions, recordPackageUsage: false }); } else { var runAll = require('../runners/run-all.js'); return runAll.run({ projectContext: projectContext, proxyPort: options.port, debugPort: options['debug-port'], disableOplog: options['disable-oplog'], settingsFile: options.settings, banner: options['show-test-app-path'] ? null : "Tests", buildOptions: buildOptions, rootUrl: process.env.ROOT_URL, mongoUrl: process.env.MONGO_URL, oplogUrl: process.env.MONGO_OPLOG_URL, mobileServerUrl: options.mobileServerUrl, once: options.once, recordPackageUsage: false, selenium: options.selenium, seleniumBrowser: options['selenium-browser'], cordovaRunner: options.cordovaRunner, // On the first run, we shouldn't display the delta between "no packages // in the temp app" and "all the packages we're testing". If we make // changes and reload, though, it's fine to display them. omitPackageMapDeltaDisplayOnFirstRun: true }); } }; /////////////////////////////////////////////////////////////////////////////// // rebuild /////////////////////////////////////////////////////////////////////////////// main.registerCommand({ name: 'rebuild', maxArgs: Infinity, hidden: true, requiresApp: true, catalogRefresh: new catalog.Refresh.Never(), 'allow-incompatible-update': { type: Boolean } }, function (options) { var projectContextModule = require('../project-context.js'); var projectContext = new projectContextModule.ProjectContext({ projectDir: options.appDir, forceRebuildPackages: options.args.length ? options.args : true, allowIncompatibleUpdate: options['allow-incompatible-update'] }); main.captureAndExit("=> Errors while rebuilding packages:", function () { projectContext.prepareProjectForBuild(); }); projectContext.packageMapDelta.displayOnConsole(); Console.info("Packages rebuilt."); }); /////////////////////////////////////////////////////////////////////////////// // login /////////////////////////////////////////////////////////////////////////////// main.registerCommand({ name: 'login', options: { email: { type: Boolean } }, catalogRefresh: new catalog.Refresh.Never() }, function (options) { return auth.loginCommand(_.extend({ overwriteExistingToken: true }, options)); }); /////////////////////////////////////////////////////////////////////////////// // logout /////////////////////////////////////////////////////////////////////////////// main.registerCommand({ name: 'logout', catalogRefresh: new catalog.Refresh.Never() }, function (options) { return auth.logoutCommand(options); }); /////////////////////////////////////////////////////////////////////////////// // whoami /////////////////////////////////////////////////////////////////////////////// main.registerCommand({ name: 'whoami', catalogRefresh: new catalog.Refresh.Never(), pretty: false }, function (options) { return auth.whoAmICommand(options); }); /////////////////////////////////////////////////////////////////////////////// // organizations /////////////////////////////////////////////////////////////////////////////// var loggedInAccountsConnectionOrPrompt = function (action) { var token = auth.getSessionToken(config.getAccountsDomain()); if (!token) { Console.error("You must be logged in to " + action + "."); auth.doUsernamePasswordLogin({ retry: true }); Console.info(); } token = auth.getSessionToken(config.getAccountsDomain()); var conn = auth.loggedInAccountsConnection(token); if (conn === null) { // Server rejected our token. Console.error("You must be logged in to " + action + "."); auth.doUsernamePasswordLogin({ retry: true }); Console.info(); token = auth.getSessionToken(config.getAccountsDomain()); conn = auth.loggedInAccountsConnection(token); } return conn; }; // List the organizations of which the current user is a member. main.registerCommand({ name: 'admin list-organizations', minArgs: 0, maxArgs: 0, pretty: false, catalogRefresh: new catalog.Refresh.Never() }, function (options) { var token = auth.getSessionToken(config.getAccountsDomain()); if (!token) { Console.error("You must be logged in to list your organizations."); auth.doUsernamePasswordLogin({ retry: true }); Console.info(); } var url = config.getAccountsApiUrl() + "/organizations"; try { var result = httpHelpers.request({ url: url, method: "GET", useSessionHeader: true, useAuthHeader: true }); var body = JSON.parse(result.body); } catch (err) { Console.error("Error listing organizations."); return 1; } if (result.response.statusCode === 401 && body && body.error === "invalid_credential") { Console.error("You must be logged in to list your organizations."); // XXX It would be nice to do a username/password prompt here like // we do for the other orgs commands. return 1; } if (result.response.statusCode !== 200 || !body || !body.organizations) { Console.error("Error listing organizations."); return 1; } if (body.organizations.length === 0) { Console.info("You are not a member of any organizations."); } else { Console.rawInfo(_.pluck(body.organizations, "name").join("\n") + "\n"); } return 0; }); main.registerCommand({ name: 'admin members', minArgs: 1, maxArgs: 1, options: { add: { type: String }, remove: { type: String }, list: { type: Boolean } }, pretty: function (options) { // pretty if we're mutating; plain if we're listing (which is more likely to // be used by scripts) return options.add || options.remove; }, catalogRefresh: new catalog.Refresh.Never() }, function (options) { if (options.add && options.remove) { Console.error("Sorry, you can only add or remove one member at a time."); throw new main.ShowUsage(); } config.printUniverseBanner(); var username = options.add || options.remove; var conn = loggedInAccountsConnectionOrPrompt(username ? "edit organizations" : "show an organization's members"); if (username) { // Adding or removing members try { conn.call(options.add ? "addOrganizationMember" : "removeOrganizationMember", options.args[0], username); } catch (err) { Console.error("Error " + (options.add ? "adding" : "removing") + " member: " + err.reason); return 1; } Console.info(username + " " + (options.add ? "added to" : "removed from") + " organization " + options.args[0] + "."); } else { // Showing the members of an org try { var result = conn.call("showOrganization", options.args[0]); } catch (err) { Console.error("Error showing organization: " + err.reason); return 1; } var members = _.pluck(result, "username"); Console.rawInfo(members.join("\n") + "\n"); } return 0; }); /////////////////////////////////////////////////////////////////////////////// // self-test /////////////////////////////////////////////////////////////////////////////// // XXX we should find a way to make self-test fully self-contained, so that it // ignores "packageDirs" (ie, it shouldn't fail just because you happen to be // sitting in an app with packages that don't build) main.registerCommand({ name: 'self-test', minArgs: 0, maxArgs: 1, options: { changed: { type: Boolean }, 'force-online': { type: Boolean }, slow: { type: Boolean }, galaxy: { type: Boolean }, browserstack: { type: Boolean }, history: { type: Number }, list: { type: Boolean }, file: { type: String }, exclude: { type: String } }, hidden: true, catalogRefresh: new catalog.Refresh.Never() }, function (options) { if (!files.inCheckout()) { Console.error("self-test is only supported running from a checkout"); return 1; } var selftest = require('../tool-testing/selftest.js'); // Auto-detect whether to skip 'net' tests, unless --force-online is passed. var offline = false; if (!options['force-online']) { try { require('../utils/http-helpers.js').getUrl("http://www.google.com/"); } catch (e) { if (e instanceof files.OfflineError) offline = true; } } var compileRegexp = function (str) { try { return new RegExp(str); } catch (e) { if (!(e instanceof SyntaxError)) throw e; Console.error("Bad regular expression: " + str); return null; } }; var testRegexp = undefined; if (options.args.length) { testRegexp = compileRegexp(options.args[0]); if (!testRegexp) { return 1; } } var fileRegexp = undefined; if (options.file) { fileRegexp = compileRegexp(options.file); if (!fileRegexp) { return 1; } } var excludeRegexp = undefined; if (options.exclude) { excludeRegexp = compileRegexp(options.exclude); if (!excludeRegexp) { return 1; } } if (options.list) { selftest.listTests({ onlyChanged: options.changed, offline: offline, includeSlowTests: options.slow, galaxyOnly: options.galaxy, testRegexp: testRegexp, fileRegexp: fileRegexp }); return 0; } var clients = { browserstack: options.browserstack }; return selftest.runTests({ // filtering options onlyChanged: options.changed, offline: offline, includeSlowTests: options.slow, galaxyOnly: options.galaxy, testRegexp: testRegexp, fileRegexp: fileRegexp, excludeRegexp: excludeRegexp, // other options historyLines: options.history, clients: clients }); }); /////////////////////////////////////////////////////////////////////////////// // list-sites /////////////////////////////////////////////////////////////////////////////// main.registerCommand({ name: 'list-sites', minArgs: 0, maxArgs: 0, pretty: false, catalogRefresh: new catalog.Refresh.Never() }, function (options) { auth.pollForRegistrationCompletion(); if (!auth.isLoggedIn()) { Console.error("You must be logged in for that. Try " + Console.command("'meteor login'") + "."); return 1; } return deploy.listSites(); }); /////////////////////////////////////////////////////////////////////////////// // admin get-machine /////////////////////////////////////////////////////////////////////////////// main.registerCommand({ name: 'admin get-machine', minArgs: 1, maxArgs: 1, options: { json: { type: Boolean }, verbose: { type: Boolean, short: "v" }, // By default, we give you a machine for 5 minutes. You can request up to // 15. (MDG can reserve machines for longer than that.) minutes: { type: Number } }, pretty: false, catalogRefresh: new catalog.Refresh.Never() }, function (options) { // Check that we are asking for a valid architecture. var arch = options.args[0]; if (!_.has(VALID_ARCHITECTURES, arch)) { showInvalidArchMsg(arch); return 1; } // Set the minutes. We will check validity on the server. var minutes = options.minutes || 5; // In verbose mode, we let you know what is going on. var maybeLog = function (string) { if (options.verbose) { Console.info(string); } }; try { maybeLog("Logging into the get-machines server ..."); var conn = authClient.loggedInConnection(config.getBuildFarmUrl(), config.getBuildFarmDomain(), "build-farm"); } catch (err) { authClient.handleConnectionError(err, "get-machines server"); return 1; } try { maybeLog("Reserving machine ..."); // The server returns to us an object with the following keys: // username & sshKey : use this to log in. // host: what you login into // port: port you should use // hostKey: RSA key to compare for safety. var ret = conn.call('createBuildServer', arch, minutes); } catch (err) { authClient.handleConnectionError(err, "build farm"); return 1; } conn.close(); // Possibly, the user asked us to return a JSON of the data and is going to process it // themselves. In that case, let's do that and exit. if (options.json) { var retJson = { 'username': ret.username, 'host': ret.host, 'port': ret.port, 'key': ret.sshKey, 'hostKey': ret.hostKey }; Console.rawInfo(JSON.stringify(retJson, null, 2) + "\n"); return 0; } // Record the SSH Key in a temporary file on disk and give it the permissions // that ssh-agent requires it to have. var tmpDir = files.mkdtemp('meteor-ssh-'); var idpath = tmpDir + '/id'; maybeLog("Writing ssh key to " + idpath); files.writeFile(idpath, ret.sshKey, { encoding: 'utf8', mode: 256 }); // Add the known host key to a custom known hosts file. var hostpath = tmpDir + '/host'; var addendum = ret.host + " " + ret.hostKey + "\n"; maybeLog("Writing host key to " + hostpath); files.writeFile(hostpath, addendum, 'utf8'); // Finally, connect to the machine. var login = ret.username + "@" + ret.host; var maybeVerbose = options.verbose ? "-v" : "-q"; var connOptions = [login, "-i" + idpath, "-p" + ret.port, "-oUserKnownHostsFile=" + hostpath, maybeVerbose]; var printOptions = connOptions.join(' '); maybeLog("Connecting: " + Console.command("ssh " + printOptions)); var child_process = require('child_process'); var future = new Future(); if (arch.match(/win/)) { // The ssh output from Windows machines is buggy, it can overlay your // existing output on the top of the screen which is very ugly. Force the // screen cleaning to assist. Console.clear(); } var sshCommand = child_process.spawn("ssh", connOptions, { stdio: 'inherit' }); // Redirect spawn stdio to process sshCommand.on('error', function (err) { if (err.code === "ENOENT") { if (process.platform === "win32") { Console.error("Could not find the `ssh` command in your PATH.", "Please read this page about using the get-machine command on Windows:", Console.url("https://github.com/meteor/meteor/wiki/Accessing-Meteor-provided-build-machines-from-Windows")); } else { Console.error("Could not find the `ssh` command in your PATH."); } future['return'](1); } }); sshCommand.on('exit', function (code, signal) { if (signal) { // XXX: We should process the signal in some way, but I am not sure we // care right now. future['return'](1); } else { future['return'](code); } }); var sshEnd = future.wait(); return sshEnd; }); /////////////////////////////////////////////////////////////////////////////// // admin progressbar-test /////////////////////////////////////////////////////////////////////////////// // A test command to print a progressbar. Useful for manual testing. main.registerCommand({ name: 'admin progressbar-test', options: { secs: { type: Number, 'default': 20 }, spinner: { type: Boolean, 'default': false } }, hidden: true, catalogRefresh: new catalog.Refresh.Never() }, function (options) { buildmessage.enterJob({ title: "A test progressbar" }, function () { var doneFuture = new Future(); var progress = buildmessage.getCurrentProgressTracker(); var totalProgress = { current: 0, end: options.secs, done: false }; var i = 0; var n = options.secs; if (options.spinner) { totalProgress.end = undefined; } var updateProgress = function () { i++; if (!options.spinner) { totalProgress.current = i; } if (i === n) { totalProgress.done = true; progress.reportProgress(totalProgress); doneFuture['return'](); } else { progress.reportProgress(totalProgress); setTimeout(updateProgress, 1000); } }; setTimeout(updateProgress); doneFuture.wait(); }); }); /////////////////////////////////////////////////////////////////////////////// // dummy /////////////////////////////////////////////////////////////////////////////// // Dummy test command. Used for automated testing of the command line // option parser. main.registerCommand({ name: 'dummy', options: { ething: { type: String, short: "e", required: true }, port: { type: Number, short: "p", 'default': DEFAULT_PORT }, url: { type: Boolean, short: "U" }, 'delete': { type: Boolean, short: "D" }, changed: { type: Boolean } }, maxArgs: 2, hidden: true, pretty: false, catalogRefresh: new catalog.Refresh.Never() }, function (options) { var p = function (key) { if (_.has(options, key)) return JSON.stringify(options[key]); return 'none'; }; Console.info(p('ething') + " " + p('port') + " " + p('changed') + " " + p('args')); if (options.url) Console.info('url'); if (options['delete']) Console.info('delete'); }); /////////////////////////////////////////////////////////////////////////////// // throw-error /////////////////////////////////////////////////////////////////////////////// // Dummy test command. Used to test that stack traces work from an installed // Meteor tool. main.registerCommand({ name: 'throw-error', hidden: true, catalogRefresh: new catalog.Refresh.Never() }, function () { throw new Error("testing stack traces!"); // #StackTraceTest this line is found in tests/source-maps.js }); //# sourceMappingURL=commands.js.map
lpinto93/meteor
tools/cli/commands.js
JavaScript
mit
76,122
# MilkshakeAndMouse An online store for organic/cruelty free merchandise.
Wimsy113/MilkshakeAndMouse
README.md
Markdown
mit
75
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!-- saved from url=(0037)http://notefeeder.heroku.com/500.html --> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <link href="/stylesheets/front_page.css" media="screen" rel="stylesheet" type="text/css"> <title>notefeeder: whoops!</title> </head> <body> <h1> <a href="http://notefeeder.heroku.com/">note feeder</a> <div id="underline"></div> </h1> <div class="content_area"> <h2>Whoops!</h2> <p> The change you tried to make was rejected<br/> Either your messing around with things or we have a problem. </p> If you think this is a real error and you've got a minute I'd really appresheate an email with the url you were trying to reach and maybe a short description of whatever you were trying to doing. <p> email: davidhampgonsavles(at)gmail.com </p> <div id="error_code">error 404</div> </div> </body></html>
davidhampgonsalves/notefeeder
public/422.html
HTML
mit
1,097
from attributes import * from constants import * # ------------------------------------------------------------------------------ # class UnitManager (Attributes) : """ UnitManager class -- manages a pool """ # -------------------------------------------------------------------------- # def __init__ (self, url=None, scheduler='default', session=None) : Attributes.__init__ (self) # -------------------------------------------------------------------------- # def add_pilot (self, pid) : """ add (Compute or Data)-Pilot(s) to the pool """ raise Exception ("%s.add_pilot() is not implemented" % self.__class__.__name__) # -------------------------------------------------------------------------- # def list_pilots (self, ptype=ANY) : """ List IDs of data and/or compute pilots """ raise Exception ("%s.list_pilots() is not implemented" % self.__class__.__name__) # -------------------------------------------------------------------------- # def remove_pilot (self, pid, drain=False) : """ Remove pilot(s) (does not cancel the pilot(s), but removes all units from the pilot(s). `drain` determines what happens to the units which are managed by the removed pilot(s). If `True`, the pilot removal is delayed until all units reach a final state. If `False` (the default), then `RUNNING` units will be canceled, and `PENDING` units will be re-assinged to the unit managers for re-scheduling to other pilots. """ raise Exception ("%s.remove_pilot() is not implemented" % self.__class__.__name__) # -------------------------------------------------------------------------- # def submit_unit (self, description) : """ Instantiate and return (Compute or Data)-Unit object(s) """ raise Exception ("%s.submit_unit() is not implemented" % self.__class__.__name__) # -------------------------------------------------------------------------- # def list_units (self, utype=ANY) : """ List IDs of data and/or compute units """ raise Exception ("%s.list_units() is not implemented" % self.__class__.__name__) # -------------------------------------------------------------------------- # def get_unit (self, uids) : """ Reconnect to and return (Compute or Data)-Unit object(s) """ raise Exception ("%s.get_unit() is not implemented" % self.__class__.__name__) # -------------------------------------------------------------------------- # def wait_unit (self, uids, state=[DONE, FAILED, CANCELED], timeout=-1.0) : """ Wait for given unit(s) to enter given state """ raise Exception ("%s.wait_unit() is not implemented" % self.__class__.__name__) # -------------------------------------------------------------------------- # def cancel_units (self, uids) : """ Cancel given unit(s) """ raise Exception ("%s.cancel_unit() is not implemented" % self.__class__.__name__) # ------------------------------------------------------------------------------ #
JensTimmerman/radical.pilot
docs/architecture/api_draft/unit_manager.py
Python
mit
3,311
'use strict'; angular.module('terminaaliApp') .factory('Auth', function Auth($location, $rootScope, $http, User, $cookieStore, $q) { var currentUser = {}; if($cookieStore.get('token')) { currentUser = User.get(); } return { /** * Authenticate user and save token * * @param {Object} user - login info * @param {Function} callback - optional * @return {Promise} */ login: function(user, callback) { var cb = callback || angular.noop; var deferred = $q.defer(); $http.post('/auth/local', { email: user.email, password: user.password }). success(function(data) { $cookieStore.put('token', data.token); currentUser = User.get(); deferred.resolve(data); return cb(); }). error(function(err) { this.logout(); deferred.reject(err); return cb(err); }.bind(this)); return deferred.promise; }, /** * Delete access token and user info * * @param {Function} */ logout: function() { $cookieStore.remove('token'); currentUser = {}; }, /** * Create a new user * * @param {Object} user - user info * @param {Function} callback - optional * @return {Promise} */ createUser: function(user, callback) { var cb = callback || angular.noop; return User.save(user, function(data) { $cookieStore.put('token', data.token); currentUser = User.get(); return cb(user); }, function(err) { this.logout(); return cb(err); }.bind(this)).$promise; }, /** * Change password * * @param {String} oldPassword * @param {String} newPassword * @param {Function} callback - optional * @return {Promise} */ changePassword: function(oldPassword, newPassword, callback) { var cb = callback || angular.noop; return User.changePassword({ id: currentUser._id }, { oldPassword: oldPassword, newPassword: newPassword }, function(user) { return cb(user); }, function(err) { return cb(err); }).$promise; }, /** * Gets all available info on authenticated user * * @return {Object} user */ getCurrentUser: function() { return currentUser; }, /** * Check if a user is logged in * * @return {Boolean} */ isLoggedIn: function() { return currentUser.hasOwnProperty('role'); }, /** * Waits for currentUser to resolve before checking if user is logged in */ isLoggedInAsync: function(cb) { if(currentUser.hasOwnProperty('$promise')) { currentUser.$promise.then(function() { cb(true); }).catch(function() { cb(false); }); } else if(currentUser.hasOwnProperty('role')) { cb(true); } else { cb(false); } }, /** * Check if a user is an admin * * @return {Boolean} */ isAdmin: function() { return currentUser.role === 'admin'; }, /** * Get auth token */ getToken: function() { return $cookieStore.get('token'); } }; });
henrikre/terminaali
client/components/auth/auth.service.js
JavaScript
mit
3,575
$(document).ready(function(){ var toggleMuffEditor = function(stat=false){ $("#muff-opt").remove(); // bind event if(stat){ $(".muff").mouseover(function() { $("#muff-opt").remove(); muffShowOptions($(this)); $(window).scroll(function(){ $("#muff-opt").remove(); }) }); }else{// unbind event $(".muff").unbind("mouseover"); } }; function muffShowOptions( e ){ var t = ""; var id = e.attr("data-muff-id"); var title = e.attr("data-muff-title"); var p = e.offset(); var opttop = p.top + 15; var optleft = p.left + 5; if(e.hasClass("muff-div")){ t="div"; }else if(e.hasClass("muff-text")){ t="text"; }else if(e.hasClass("muff-a")){ t="link"; }else if(e.hasClass("muff-img")){ t="image"; } if(!title){ title = t;} // check position is beyond document if((p.left + 25 + 75) > $(window).width()){ optleft -= 75; } var opt = "<div id='muff-opt' style='position:absolute;top:"+opttop+"px;left:"+optleft+"px;z-index:99998;display:none;'>"; opt += "<a href='admin/"+t+"/"+id+"/edit' class='mbtn edit'></a>"; opt += "<a href='admin/"+t+"/delete/' class='mbtn delete' data-mod='"+t+"' data-id='"+id+"'></a>"; opt += "<span>"+title+"</span>"; opt += "</div>"; $("body").prepend(opt); $("#muff-opt").slideDown(300); $("body").find("#muff-opt > a.delete").click(function(e){ var path = $(this).attr('href'); var mod = $(this).attr('data-mod'); // e.preventDefault(); swal({ title: "Are you sure?", text: "You are about to delete this "+mod, type: "warning", showCancelButton: true, confirmButtonColor: "#DD6B55", confirmButtonText: "Yes, delete it!", cancelButtonText: "Cancel", closeOnConfirm: true, closeOnCancel: true }, function(isConfirm){ if (isConfirm) { // window.location.href = path; proceedDelete(path, id); } }); return false; }); } toggleMuffEditor(false); // set checkbox editor event $("input[name=cb-muff-editor]").click(function(){ if($(this).is(':checked')){ toggleMuffEditor(true); } else{ toggleMuffEditor(false) } }); function proceedDelete(path, id){ var newForm = jQuery('<form>', { 'action': path, 'method': 'POST', 'target': '_top' }).append(jQuery('<input>', { 'name': '_token', 'value': $("meta[name=csrf-token]").attr("content"), 'type': 'hidden' })).append(jQuery('<input>', { 'name': 'id', 'value': id, 'type': 'hidden' })); newForm.hide().appendTo("body").submit(); } // $(".opt-div a.delete, .w-conf a.delete, .w-conf-hvr a.delete").click(function(e){ // var path = $(this).attr('href'); // var mod = $(this).attr('data-mod'); // // e.preventDefault(); // swal({ // title: "Are you sure?", // text: "You are about to delete this "+mod, // type: "warning", // showCancelButton: true, // confirmButtonColor: "#DD6B55", // confirmButtonText: "Yes, delete it!", // cancelButtonText: "Cancel", // closeOnConfirm: true, // closeOnCancel: true // }, // function(isConfirm){ // if (isConfirm) { // window.location.href = path; // } // }); // return false; // }); // top nav click $(".top-nav>li").click(function(){ var i = $(this).find('.dropdown-menu'); toggleClassExcept('.top-nav .dropdown-menu', 'rmv', 'active', i); i.toggleClass("active"); }); /** toggle a certain class except the given object * works with li and lists * @param id identifier * @param a action * @param c class * @param ex object */ function toggleClassExcept(id, a, c, ex){ $(id).each(function(){ switch(a){ case 'remove': case 'rmv': if(!$(this).is(ex)) $(this).removeClass(c); break; case 'add': if(!$(this).is(ex)) $(this).addClass(c); break; default: break; } }); } $(".w-add .muff-add").click(function(event){ event.preventDefault(); var b = $(this); var newForm = jQuery('<form>', { 'action': b.data('href'), 'method': 'GET', 'target': '_top' }).append(jQuery('<input>', { 'name': '_token', 'value': $("meta[name=csrf-token]").attr("content"), 'type': 'hidden' })).append(jQuery('<input>', { 'name': 'url', 'value': $("meta[name=muffin-url]").attr("content"), 'type': 'hidden' })).append(jQuery('<input>', { 'name': 'location', 'value': b.data("loc"), 'type': 'hidden' })); // console.log(newForm); newForm.hide().appendTo("body").submit(); }) // TAGs //var tagArea = '.tag-area'; if($('.tagarea')[0]){ var backSpace; var close = '<a class="close"></a>'; var PreTags = $('.tagarea').val().trim().split(" "); $('.tagarea').after('<ul class="tag-box"></ul>'); for (i=0 ; i < PreTags.length; i++ ){ var pretag = PreTags[i].split("_").join(" "); if($('.tagarea').val().trim() != "" ) $('.tag-box').append('<li class="tags"><input type="hidden" name="tags[]" value="'+pretag+'">'+pretag+close+'</li>'); } $('.tag-box').append('<li class="new-tag"><input class="input-tag" type="text"></li>'); // unbind submit form when pressing enter $('.input-tag').on('keyup keypress', function(e) { var keyCode = e.keyCode || e.which; if (keyCode === 13) { e.preventDefault(); return false; } }); // Taging $('.input-tag').bind("keydown", function (kp) { var tag = $('.input-tag').val().trim(); if(tag.length > 0){ $(".tags").removeClass("danger"); if(kp.keyCode == 13 || kp.keyCode == 9){ $(".new-tag").before('<li class="tags"><input type="hidden" name="tags[]" value="'+tag+'">'+tag+close+'</li>'); $(this).val(''); }} else {if(kp.keyCode == 8 ){ if($(".new-tag").prev().hasClass("danger")){ $(".new-tag").prev().remove(); }else{ $(".new-tag").prev().addClass("danger"); } } } }); //Delete tag $(".tag-box").on("click", ".close", function() { $(this).parent().remove(); }); $(".tag-box").click(function(){ $('.input-tag').focus(); }); // Edit $('.tag-box').on("dblclick" , ".tags", function(cl){ var tags = $(this); var tag = tags.text().trim(); $('.tags').removeClass('edit'); tags.addClass('edit'); tags.html('<input class="input-tag" value="'+tag+'" type="text">') $(".new-tag").hide(); tags.find('.input-tag').focus(); tag = $(this).find('.input-tag').val() ; $('.tags').dblclick(function(){ tags.html(tag + close); $('.tags').removeClass('edit'); $(".new-tag").show(); }); tags.find('.input-tag').bind("keydown", function (edit) { tag = $(this).val() ; if(edit.keyCode == 13){ $(".new-tag").show(); $('.input-tag').focus(); $('.tags').removeClass('edit'); if(tag.length > 0){ tags.html('<input type="hidden" name="tags[]" value="'+tag+'">'+tag + close); } else{ tags.remove(); } } }); }); } // sorting // $(function() { // $( ".tag-box" ).sortable({ // items: "li:not(.new-tag)", // containment: "parent", // scrollSpeed: 100 // }); // $( ".tag-box" ).disableSelection(); // }); });
johnguild/muffincms
src/Public/main/js/muffincms.js
JavaScript
mit
7,581
--- layout: page title: Version history permalink: "setup/en/releasenotes/" language: en --- #### vNext * __New__ FileCopy Add-In: parameter sourceTimeFilter also for FILE and SFTP protocol. #### 1.4.5 * __New__ New Add-In List2Csv to export SharePoint Online lists to CSV files. * __New__ New add-in SharepointToDB to export items from SharePoint Online document libraries or lists to a database. * __New__ FileCopy Add-In: Files can be downloaded from SharePoint Online document libraries. * __New__ SharepointEraser Add-In: New parameters "subFolder" and "recursive". * __New__ display of the alarm history (list of the most recently sent alarms). * __BREAKING CHANGE__ FileCopy FileCopy Add-In: If "destinationProtocol" = SHAREPOINT, the URL to the document library must be specified again in the "destinationSystem" parameter. #### 1.4.3 * __New__ Ldap2CSV Add-In: New data type "bitmask" * __New__ Csv2Database Add-In: New parameter "fileNameColumn" * __New__ display of utilization * __Error__ Csv2Database Add-In: Overly long texts are shortened to the length of the database field * __Error__ WebConnect: : JSON return value formatting corrected, logging improved * __Error__ OneMessageAddIn: OneMessageAddIn: Error corrected if no trace was used #### 1.4.1 * __Error__ instances of OneOffixxDocumentCreator not running in parallel * __Error__ Csv2Database Add-In: Support of tabs as separators, support of column names with special characters * __New__ FileCopy Add-In: New parameter "skipExistingFiles" #### 1.4.0 * __New__ FileCopy Add-In: Support for a "Filter" event with which another Add-In can manipulate the file to be copied * __New__ TextReplace add-in * __New__ MailSender Add-In: Support of TLS and authentication * __New__ configurator role can be defined for each instance * __New__ display of version number and modification date of an add-in * __New__ Improved display of alerts for many email addresses * __New__ Improved display of rule execution time in the overview * __New__ statistics can be updated manually * __New__ statistics can also be displayed as tables * __New__ context menu in log analysis for filtering log entries for an instance * __Error__ Users who are not in the configurator role can no longer copy or delete instances via the context menu * __Error__ Parameter values ​​containing XML tags could not be saved correctly * __Error__ Multi-line parameters were not handled correctly (DatabaseToCsv, DatabaseMaintenance, Dispatcher, Csv2Database) * __Error__ No more session timeout in web administration #### 1.3.0 * __New__ DatabaseMaintenance Add-In: Possibility to execute any SQL command * __New__ The order of the statistics can be changed using drag and drop * __New__ New parameter type for multi-line texts (see DatabaseToCsv, DatabaseMaintenance, Dispatcher, Csv2Database) * __New__ display of the OneConnexx version in the web administration, reference to incompatible versions #### 1.2.1 * __New__ list of installations is sorted alphabetically by name * __New__ FileEraser Add-In supports multiple search patterns * __New__ page "Alerting" is now a subpage of "Monitoring" * __New__ New page "Statistics" * __New__ Improved display for small screen widths (e.g. mobile devices) * __New__ possibility to check rules only on certain days of the week or days of the month * __New__ Standard texts can be defined in Web.config for new alarms * __New__ option in log analysis to display the latest entries at the top * __New__ rules and alarms can be exported as an Excel file * __New__ rules and alerts can be filtered according to active / inactive * __New__ option to issue alerts only in the event of rule violations and not for every faulty transaction * __New__ FileCopy Add-In: Possibility to upload files> 2MB to SharePoint Online * __New__ Xls2Csv add-in * __New__ Csv2Database add-in * __Error__ If the list of installations contained old entries with the same port number, the wrong connection string may have been used * __Error__ FileCopy Add-In: deleting and archiving on SFTP Server did not work * __Error__ FileCopy Add-In: If parameters were set by a Dispatcher Add-In and the configuration changed at the same time, the parameters were reset again * __Error__ FileCopy Add-In: file name is written to transaction * __Error__ FileCopy Add-In: Absolute paths now also work with the SFTP protocol * __Error__ FileCopy Add-In: FTPS supports newer protocols * __Error__ Ldap2CSV: Date format now also works for date fields * __Error__ Immediately after renaming an instance, parameter changes were not saved * __Error__ Improved bug behavior when moving instances to interfaces * __Error__ In the HTML view, changes to the email text of alerts were not saved * __Error__ Encoding Error loading transactions on the "monitoring" * __Error__ log analysis did not work if there are other files in the "Logs" directory * __Error__ Real-time log is reset each time the page is reloaded, otherwise the browser freezes with large amounts of data * __Error__ Ldap2CSV, Xml2Csv: Ldap2CSV, Xml2Csv: double quotation marks if necessary #### 1.1.4 * __Error__ corrected bizagi / OneMessage transformation #### 1.1.3 * __New__ status of the checkbox and interfaces on the Monitoring / Overview page is saved in a cookie * __Error__ corrected wrong English date format to the Monitoring page / Overview * __Error__ corrected wrong English date format to the Monitoring page / Overview #### 1.1.2 * __New__ tandard add-in "OneMessageAdapter" * __New__ context menu in the tree for instances, add-ins and groups * __Error__ error message in web administration if 'installation' directory is missing * __Error__ grouping by add-in or group is saved permanently * __Error__ order of the instances within a group was not always saved correctly * __Error__ 'Last 5 min' button on the log analysis page did not update the start time * __Error__ log files are now written in UTF-8 by default #### 1.1.0 * __New__ OneConnexx installations are saved under %ProgramData%\Sevitec\OneConnexx\Installations and can no longer be added manually in the web administration
Sevitec/oneconnexx-docs
_pages/setup/en/releasenotes.md
Markdown
mit
6,144
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = undefined; var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn'); var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); var _inherits2 = require('babel-runtime/helpers/inherits'); var _inherits3 = _interopRequireDefault(_inherits2); var _react = require('react'); var _react2 = _interopRequireDefault(_react); var _objectAssign = require('object-assign'); var _objectAssign2 = _interopRequireDefault(_objectAssign); var _rcTable = require('rc-table'); var _rcTable2 = _interopRequireDefault(_rcTable); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } var __assign = undefined && undefined.__assign || Object.assign || function (t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) { if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } } return t; }; var Table = function (_React$Component) { (0, _inherits3["default"])(Table, _React$Component); function Table() { (0, _classCallCheck3["default"])(this, Table); return (0, _possibleConstructorReturn3["default"])(this, _React$Component.apply(this, arguments)); } Table.prototype.render = function render() { var _props = this.props, columns = _props.columns, dataSource = _props.dataSource, direction = _props.direction, scrollX = _props.scrollX, titleFixed = _props.titleFixed; var _props2 = this.props, style = _props2.style, className = _props2.className; var restProps = (0, _objectAssign2["default"])({}, this.props); ['style', 'className'].forEach(function (prop) { if (restProps.hasOwnProperty(prop)) { delete restProps[prop]; } }); var table = void 0; // 默认纵向 if (!direction || direction === 'vertical') { if (titleFixed) { table = _react2["default"].createElement(_rcTable2["default"], __assign({}, restProps, { columns: columns, data: dataSource, className: "am-table", scroll: { x: true }, showHeader: false })); } else { table = _react2["default"].createElement(_rcTable2["default"], __assign({}, restProps, { columns: columns, data: dataSource, className: "am-table", scroll: { x: scrollX } })); } } else if (direction === 'horizon') { columns[0].className = 'am-table-horizonTitle'; table = _react2["default"].createElement(_rcTable2["default"], __assign({}, restProps, { columns: columns, data: dataSource, className: "am-table", showHeader: false, scroll: { x: scrollX } })); } else if (direction === 'mix') { columns[0].className = 'am-table-horizonTitle'; table = _react2["default"].createElement(_rcTable2["default"], __assign({}, restProps, { columns: columns, data: dataSource, className: "am-table", scroll: { x: scrollX } })); } return _react2["default"].createElement("div", { className: className, style: style }, table); }; return Table; }(_react2["default"].Component); exports["default"] = Table; Table.defaultProps = { dataSource: [], prefixCls: 'am-table' }; module.exports = exports['default'];
forwk1990/wechart-checkin
antd-mobile-custom/antd-mobile/lib/table/index.web.js
JavaScript
mit
3,649
package jp.opap.material.model import java.util.UUID import jp.opap.data.yaml.Node import jp.opap.material.data.Collections.{EitherSeq, Seqs} import jp.opap.material.facade.GitLabRepositoryLoaderFactory.GitlabRepositoryInfo import jp.opap.material.model.RepositoryConfig.RepositoryInfo import jp.opap.material.model.Warning.GlobalWarning import scala.util.matching.Regex case class RepositoryConfig(repositories: List[RepositoryInfo]) object RepositoryConfig { val PATTERN_ID: Regex = "^[a-z0-9_-]+$".r val WARNING_INVALID_ID: String = "%1$s - このIDは不正です。IDは、 /^[a-z0-9_-]+$/ でなければなりません。" val WARNING_NO_SUCH_PROTOCOL: String = "%1$s - そのような取得方式はありません。" val WARNING_DUPLICATED_ID: String = "%1$s - このIDは重複しています。" /** * 取得するリポジトリの情報を表現するクラスです。 */ trait RepositoryInfo { /** * システム内での、このリポジトリの識別子です。 * システム内で一意かつ、ファイル名として正しい文字列でなければなりません。 */ val id: String /** * このリポジトリの名称です。ウェブページ上で表示されます。 */ val title: String } def fromYaml(document: Node): (List[Warning], RepositoryConfig) = { def extractItem(node: Node): Either[Warning, RepositoryInfo] = { withWarning(GlobalContext) { val id = node("id").string.get.toLowerCase if (PATTERN_ID.findFirstIn(id).isEmpty) throw DeserializationException(WARNING_INVALID_ID.format(id), Option(node)) node("protocol").string.get match { case "gitlab" => GitlabRepositoryInfo(id, node("title").string.get, node("host").string.get, node("namespace").string.get, node("name").string.get) case protocol => throw DeserializationException(WARNING_NO_SUCH_PROTOCOL.format(protocol), Option(node)) } } } def validate(warnings: List[Warning], config: RepositoryConfig): (List[Warning], RepositoryConfig) = { val duplications = config.repositories.groupByOrdered(info => info.id) .filter(entry => entry._2.size > 1) val duplicationSet = duplications.map(_._1).toSet val c = config.copy(repositories = config.repositories.filter(r => !duplicationSet.contains(r.id))) val w = duplications.map(entry => new GlobalWarning(UUID.randomUUID(), WARNING_DUPLICATED_ID.format(entry._1))) (warnings ++ w, c) } val repositories = withWarnings(GlobalContext) { val items = document("repositories").list.map(extractItem).toList items.left -> RepositoryConfig(items.right.toList) } validate(repositories._1.toList, repositories._2.getOrElse(RepositoryConfig(List()))) } }
opap-jp/material-explorer
rest/src/main/scala/jp/opap/material/model/RepositoryConfig.scala
Scala
mit
2,845
const _cache = Dict{AbstractString,Array}() function fetch_word_list(filename::AbstractString) haskey(_cache, filename) && return _cache[filename] try io = open(filename, "r") words = map(x -> chomp(x), readlines(io)) close(io) ret = convert(Array{UTF8String,1}, words) _cache[filename] = ret return ret catch error("Failed to fetch word list from $(filename)") end end
slundberg/Languages.jl
src/utils.jl
Julia
mit
408
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_11) on Sun Aug 31 14:44:00 IST 2014 --> <title>Uses of Class org.symboltable.Edge</title> <meta name="date" content="2014-08-31"> <link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class org.symboltable.Edge"; } } catch(err) { } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../org/symboltable/package-summary.html">Package</a></li> <li><a href="../../../org/symboltable/Edge.html" title="class in org.symboltable">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../index-files/index-1.html">Index</a></li> <li><a href="../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../index.html?org/symboltable/class-use/Edge.html" target="_top">Frames</a></li> <li><a href="Edge.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="Uses of Class org.symboltable.Edge" class="title">Uses of Class<br>org.symboltable.Edge</h2> </div> <div class="classUseContainer">No usage of org.symboltable.Edge</div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../org/symboltable/package-summary.html">Package</a></li> <li><a href="../../../org/symboltable/Edge.html" title="class in org.symboltable">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../index-files/index-1.html">Index</a></li> <li><a href="../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../index.html?org/symboltable/class-use/Edge.html" target="_top">Frames</a></li> <li><a href="Edge.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>
shivam091/Symbol-Table
Symbol Table/doc/org/symboltable/class-use/Edge.html
HTML
mit
4,022
# Parser.Many&lt;T&gt; method Always succeeds. The value is a collection of as many items as can be successfully parsed. ```csharp public static IParser<IReadOnlyList<T>> Many<T>(this IParser<T> parser) ``` ## See Also * interface [IParser&lt;T&gt;](../IParser-1.md) * class [Parser](../Parser.md) * namespace [Faithlife.Parsing](../../Faithlife.Parsing.md) <!-- DO NOT EDIT: generated by xmldocmd for Faithlife.Parsing.dll -->
Faithlife/Parsing
docs/Faithlife.Parsing/Parser/Many.md
Markdown
mit
436
using System.ComponentModel; namespace NSysmon.Collector.HAProxy { /// <summary> /// Current server statuses /// </summary> public enum ProxyServerStatus { [Description("Status Unknown!")] None = 0, //Won't be populated for backends [Description("Server is up, status normal.")] ActiveUp = 2, [Description("Server has not responded to checks in a timely manner, going down.")] ActiveUpGoingDown = 8, [Description("Server is responsive and recovering.")] ActiveDownGoingUp = 6, [Description("Backup server is up, status normal.")] BackupUp = 3, [Description("Backup server has not responded to checks in a timely manner, going down.")] BackupUpGoingDown = 9, [Description("Backup server is responsive and recovering.")] BackupDownGoingUp = 7, [Description("Server is not checked.")] NotChecked = 4, [Description("Server is down and receiving no requests.")] Down = 10, [Description("Server is in maintenance and receiving no requests.")] Maintenance = 5, [Description("Front end is open to receiving requests.")] Open = 1 } public static class ProxyServerStatusExtensions { public static string ShortDescription(this ProxyServerStatus status) { switch (status) { case ProxyServerStatus.ActiveUp: return "Active"; case ProxyServerStatus.ActiveUpGoingDown: return "Active (Up -> Down)"; case ProxyServerStatus.ActiveDownGoingUp: return "Active (Down -> Up)"; case ProxyServerStatus.BackupUp: return "Backup"; case ProxyServerStatus.BackupUpGoingDown: return "Backup (Up -> Down)"; case ProxyServerStatus.BackupDownGoingUp: return "Backup (Down -> Up)"; case ProxyServerStatus.NotChecked: return "Not Checked"; case ProxyServerStatus.Down: return "Down"; case ProxyServerStatus.Maintenance: return "Maintenance"; case ProxyServerStatus.Open: return "Open"; //case ProxyServerStatus.None: default: return "Unknown"; } } public static bool IsBad(this ProxyServerStatus status) { switch (status) { case ProxyServerStatus.ActiveUpGoingDown: case ProxyServerStatus.BackupUpGoingDown: case ProxyServerStatus.Down: return true; default: return false; } } } }
clearwavebuild/nsysmon
NSysmon.Collector/HAProxy/ProxyServerStatus.cs
C#
mit
2,906
import datetime from django.contrib.contenttypes.models import ContentType from django.utils import timezone from .models import Action def create_action(user, verb, target=None): now = timezone.now() last_minute = now - datetime.timedelta(seconds=60) similar_actions = Action.objects.filter(user_id=user.id, verb=verb, created__gte=last_minute) if target: target_ct = ContentType.objects.get_for_model(target) similar_actions = Action.objects.filter(target_ct=target_ct, target_id=target.id) if not similar_actions: action = Action(user=user, verb=verb, target=target) action.save() return True return False
EssaAlshammri/django-by-example
bookmarks/bookmarks/actions/utils.py
Python
mit
679
package engine; import java.awt.Color; import java.awt.Graphics2D; import java.awt.Point; public class CircleShape extends Shape { double radius; //radius of shape public CircleShape(double rad, Vector2D v, double r, double d, Color c) { super(v, r, d, c); radius = rad; } @Override public void calculateInertia() { mass = radius * radius * Math.PI * density; inertia = radius * radius * mass; } @Override public void paint(Graphics2D g) { super.paint(g); vector.readyPoint(); g.fillOval((int) (x - radius), (int) (y - radius), (int) radius * 2, (int) radius * 2); g.drawOval((int) (x - radius), (int) (y - radius), (int) radius * 2, (int) radius * 2); g.setColor(Color.BLACK); g.drawLine((int) (x), (int) (y), (int) (x + Math.cos(rotation) * radius), (int) (y + Math.sin(rotation) * radius)); } @Override public boolean contains(Point.Double p) { return p.distanceSq(x, y) < radius * radius; } }
bjornenalfa/GA
src/engine/CircleShape.java
Java
mit
1,041
Deprecated. See: - [TRex Collection](https://github.com/Raphhh/trex-collection): PHP helpers for collections. - [TRex Reflection](https://github.com/Raphhh/trex-reflection): PHP tool to reflect callables an types. - [TRex parser](https://github.com/Raphhh/trex-parser): PHP tool to parse code and extract statements. - [TRex Cli](https://github.com/Raphhh/trex-cli): Command process helper.
Raphhh/trex
README.md
Markdown
mit
396
sandbox.lua =========== A pure-lua solution for running untrusted Lua code. The default behavior is restricting access to "dangerous" functions in Lua, such as `os.execute`. It's possible to provide extra functions via the `options.env` parameter. Infinite loops are prevented via the `debug` library. For now, sandbox.lua only works with Lua 5.1.x. Usage ===== Require the module like this: ``` lua local sandbox = require 'sandbox' ``` ### sandbox.protect `sandbox.protect(f)` (or `sandbox(f)`) produces a sandboxed version of `f`. `f` can be a Lua function or a string with Lua code. A sandboxed function works as regular functions as long as they don't access any insecure features: ```lua local sandboxed_f = sandbox(function() return 'hey' end) local msg = sandboxed_f() -- msg is now 'hey' ``` Sandboxed options can not access unsafe Lua modules. (See the [source code](https://github.com/kikito/sandbox.lua/blob/master/sandbox.lua#L35) for a list) When a sandboxed function tries to access an unsafe module, an error is produced. ```lua local sf = sandbox.protect(function() os.execute('rm -rf /') -- this will throw an error, no damage done end) sf() -- error: os.execute not found ``` Sandboxed functions will eventually throw an error if they contain infinite loops: ```lua local sf = sandbox.protect(function() while true do end end) sf() -- error: quota exceeded ``` ### options.quota `sandbox.lua` prevents infinite loops from halting the program by hooking the `debug` library to the sandboxed function, and "counting instructions". When the instructions reach a certain limit, an error is produced. This limit can be tweaked via the `quota` option. But default, it is 500000. It is not possible to exhaust the machine with infinite loops; the following will throw an error after invoking 500000 instructions: ``` lua sandbox.run('while true do end') -- raise errors after 500000 instructions sandbox.run('while true do end', {quota=10000}) -- raise error after 10000 instructions ``` Note that if the quota is low enough, sandboxed functions that do lots of calculations might fail: ``` lua local f = function() local count = 1 for i=1, 400 do count = count + 1 end return count end sandbox.run(f, {quota=100}) -- raises error before the function ends ``` ### options.env Use the `env` option to inject additional variables to the environment in which the sandboxed function is executed. local msg = sandbox.run('return foo', {env = {foo = 'This is a global var on the the environment'}}) Note that the `env` variable will be modified by the sandbox (adding base modules like `string`). The sandboxed code can also modify it. It is recommended to discard it after use. local env = {amount = 1} sandbox.run('amount = amount + 1', {env = env}) assert(env.amount == 2) ### sandbox.run `sandbox.run(f)` sanboxes and executes `f` in a single line. `f` can be either a string or a function You can pass `options` param, and it will work like in `sandbox.protect`. Any extra parameters will just be passed to the sandboxed function when executed. In other words, `sandbox.run(f, o, ...)` is equivalent to `sandbox.protect(f,o)(...)`. Notice that if `f` throws an error, it is *NOT* captured by `sandbox.run`. Use `pcall` if you want your app to be immune to errors, like this: ``` lua local ok, result = pcall(sandbox.run, 'error("this just throws an error")') ``` Installation ============ Just copy sandbox.lua wherever you need it. License ======= This library is released under the MIT license. See MIT-LICENSE.txt for details Specs ===== This project uses [telescope](https://github.com/norman/telescope) for its specs. In order to run them, install it and then: ``` cd /path/to/where/the/spec/folder/is tsc spec/* ``` I would love to use [busted](http://olivinelabs.com/busted/), but it has some incompatibility with `debug.sethook(f, "", quota)` and the tests just hanged up.
APItools/sandbox.lua
README.md
Markdown
mit
3,966
<?xml version="1.0" ?><!DOCTYPE TS><TS language="ms_MY" version="2.1"> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About DarkSwift</source> <translation type="unfinished"/> </message> <message> <location line="+39"/> <source>&lt;b&gt;DarkSwift&lt;/b&gt; version</source> <translation type="unfinished"/> </message> <message> <location line="+41"/> <source>Copyright © 2009-2014 The Bitcoin developers Copyright © 2012-2014 The NovaCoin developers Copyright © 2014 The DarkSwift developers</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source> This is experimental software. Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard.</source> <translation type="unfinished"/> </message> </context> <context> <name>AddressBookPage</name> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>Address Book</source> <translation type="unfinished"/> </message> <message> <location line="+22"/> <source>Double-click to edit address or label</source> <translation>Klik dua kali untuk mengubah alamat atau label</translation> </message> <message> <location line="+27"/> <source>Create a new address</source> <translation>Cipta alamat baru</translation> </message> <message> <location line="+14"/> <source>Copy the currently selected address to the system clipboard</source> <translation>Salin alamat terpilih ke dalam sistem papan klip</translation> </message> <message> <location line="-11"/> <source>&amp;New Address</source> <translation type="unfinished"/> </message> <message> <location line="-46"/> <source>These are your DarkSwift addresses for receiving payments. You may want to give a different one to each sender so you can keep track of who is paying you.</source> <translation type="unfinished"/> </message> <message> <location line="+60"/> <source>&amp;Copy Address</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Show &amp;QR Code</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Sign a message to prove you own a DarkSwift address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>Delete the currently selected address from the list</source> <translation type="unfinished"/> </message> <message> <location line="-14"/> <source>Verify a message to ensure it was signed with a specified DarkSwift address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Verify Message</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>&amp;Delete</source> <translation>&amp;Padam</translation> </message> <message> <location filename="../addressbookpage.cpp" line="+65"/> <source>Copy &amp;Label</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>&amp;Edit</source> <translation type="unfinished"/> </message> <message> <location line="+250"/> <source>Export Address Book Data</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>Fail yang dipisahkan dengan koma</translation> </message> <message> <location line="+13"/> <source>Error exporting</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation type="unfinished"/> </message> </context> <context> <name>AddressTableModel</name> <message> <location filename="../addresstablemodel.cpp" line="+144"/> <source>Label</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Address</source> <translation>Alamat</translation> </message> <message> <location line="+36"/> <source>(no label)</source> <translation type="unfinished"/> </message> </context> <context> <name>AskPassphraseDialog</name> <message> <location filename="../forms/askpassphrasedialog.ui" line="+26"/> <source>Passphrase Dialog</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>Enter passphrase</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>New passphrase</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Repeat new passphrase</source> <translation type="unfinished"/> </message> <message> <location line="+33"/> <source>Serves to disable the trivial sendmoney when OS account compromised. Provides no real security.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>For staking only</source> <translation type="unfinished"/> </message> <message> <location filename="../askpassphrasedialog.cpp" line="+35"/> <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;10 or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Encrypt wallet</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>This operation needs your wallet passphrase to unlock the wallet.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Unlock wallet</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to decrypt the wallet.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Decrypt wallet</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Change passphrase</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Enter the old and new passphrase to the wallet.</source> <translation type="unfinished"/> </message> <message> <location line="+46"/> <source>Confirm wallet encryption</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR COINS&lt;/b&gt;!</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Are you sure you wish to encrypt your wallet?</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source> <translation type="unfinished"/> </message> <message> <location line="+103"/> <location line="+24"/> <source>Warning: The Caps Lock key is on!</source> <translation type="unfinished"/> </message> <message> <location line="-133"/> <location line="+60"/> <source>Wallet encrypted</source> <translation type="unfinished"/> </message> <message> <location line="-58"/> <source>DarkSwift will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your coins from being stolen by malware infecting your computer.</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <location line="+7"/> <location line="+44"/> <location line="+6"/> <source>Wallet encryption failed</source> <translation type="unfinished"/> </message> <message> <location line="-56"/> <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <location line="+50"/> <source>The supplied passphrases do not match.</source> <translation type="unfinished"/> </message> <message> <location line="-38"/> <source>Wallet unlock failed</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <location line="+12"/> <location line="+19"/> <source>The passphrase entered for the wallet decryption was incorrect.</source> <translation type="unfinished"/> </message> <message> <location line="-20"/> <source>Wallet decryption failed</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Wallet passphrase was successfully changed.</source> <translation type="unfinished"/> </message> </context> <context> <name>BitcoinGUI</name> <message> <location filename="../bitcoingui.cpp" line="+282"/> <source>Sign &amp;message...</source> <translation type="unfinished"/> </message> <message> <location line="+251"/> <source>Synchronizing with network...</source> <translation type="unfinished"/> </message> <message> <location line="-319"/> <source>&amp;Overview</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show general overview of wallet</source> <translation type="unfinished"/> </message> <message> <location line="+17"/> <source>&amp;Transactions</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Browse transaction history</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>&amp;Address Book</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Edit the list of stored addresses and labels</source> <translation type="unfinished"/> </message> <message> <location line="-13"/> <source>&amp;Receive coins</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show the list of addresses for receiving payments</source> <translation type="unfinished"/> </message> <message> <location line="-7"/> <source>&amp;Send coins</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>E&amp;xit</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Quit application</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Show information about DarkSwift</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>About &amp;Qt</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show information about Qt</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>&amp;Options...</source> <translation>Pilihan</translation> </message> <message> <location line="+4"/> <source>&amp;Encrypt Wallet...</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Backup Wallet...</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>&amp;Change Passphrase...</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+259"/> <source>~%n block(s) remaining</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+6"/> <source>Downloaded %1 of %2 blocks of transaction history (%3% done).</source> <translation type="unfinished"/> </message> <message> <location line="-256"/> <source>&amp;Export...</source> <translation type="unfinished"/> </message> <message> <location line="-64"/> <source>Send coins to a DarkSwift address</source> <translation type="unfinished"/> </message> <message> <location line="+47"/> <source>Modify configuration options for DarkSwift</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <source>Export the data in the current tab to a file</source> <translation type="unfinished"/> </message> <message> <location line="-14"/> <source>Encrypt or decrypt wallet</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Backup wallet to another location</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Change the passphrase used for wallet encryption</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>&amp;Debug window</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Open debugging and diagnostic console</source> <translation type="unfinished"/> </message> <message> <location line="-5"/> <source>&amp;Verify message...</source> <translation type="unfinished"/> </message> <message> <location line="-202"/> <source>DarkSwift</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Wallet</source> <translation type="unfinished"/> </message> <message> <location line="+180"/> <source>&amp;About DarkSwift</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>&amp;Show / Hide</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>Unlock wallet</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>&amp;Lock Wallet</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Lock wallet</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>&amp;File</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>&amp;Settings</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>&amp;Help</source> <translation type="unfinished"/> </message> <message> <location line="+12"/> <source>Tabs toolbar</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Actions toolbar</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <location line="+9"/> <source>[testnet]</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <location line="+60"/> <source>DarkSwift client</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+75"/> <source>%n active connection(s) to DarkSwift network</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+40"/> <source>Downloaded %1 blocks of transaction history.</source> <translation type="unfinished"/> </message> <message> <location line="+413"/> <source>Staking.&lt;br&gt;Your weight is %1&lt;br&gt;Network weight is %2&lt;br&gt;Expected time to earn reward is %3</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Not staking because wallet is locked</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Not staking because wallet is offline</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Not staking because wallet is syncing</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Not staking because you don&apos;t have mature coins</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="-403"/> <source>%n second(s) ago</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="-312"/> <source>About DarkSwift card</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show information about DarkSwift card</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <source>&amp;Unlock Wallet...</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+297"/> <source>%n minute(s) ago</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n hour(s) ago</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n day(s) ago</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+6"/> <source>Up to date</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Catching up...</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Last received block was generated %1.</source> <translation type="unfinished"/> </message> <message> <location line="+59"/> <source>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Confirm transaction fee</source> <translation type="unfinished"/> </message> <message> <location line="+27"/> <source>Sent transaction</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Incoming transaction</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Date: %1 Amount: %2 Type: %3 Address: %4 </source> <translation type="unfinished"/> </message> <message> <location line="+100"/> <location line="+15"/> <source>URI handling</source> <translation type="unfinished"/> </message> <message> <location line="-15"/> <location line="+15"/> <source>URI can not be parsed! This can be caused by an invalid DarkSwift address or malformed URI parameters.</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>Backup Wallet</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Wallet Data (*.dat)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Backup Failed</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>There was an error trying to save the wallet data to the new location.</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+76"/> <source>%n second(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n minute(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n hour(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n day(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+18"/> <source>Not staking</source> <translation type="unfinished"/> </message> <message> <location filename="../bitcoin.cpp" line="+109"/> <source>A fatal error occurred. DarkSwift can no longer continue safely and will quit.</source> <translation type="unfinished"/> </message> </context> <context> <name>ClientModel</name> <message> <location filename="../clientmodel.cpp" line="+90"/> <source>Network Alert</source> <translation type="unfinished"/> </message> </context> <context> <name>CoinControlDialog</name> <message> <location filename="../forms/coincontroldialog.ui" line="+14"/> <source>Coin Control</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>Quantity:</source> <translation type="unfinished"/> </message> <message> <location line="+32"/> <source>Bytes:</source> <translation type="unfinished"/> </message> <message> <location line="+48"/> <source>Amount:</source> <translation type="unfinished"/> </message> <message> <location line="+32"/> <source>Priority:</source> <translation type="unfinished"/> </message> <message> <location line="+48"/> <source>Fee:</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>Low Output:</source> <translation type="unfinished"/> </message> <message> <location filename="../coincontroldialog.cpp" line="+551"/> <source>no</source> <translation type="unfinished"/> </message> <message> <location filename="../forms/coincontroldialog.ui" line="+51"/> <source>After Fee:</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>Change:</source> <translation type="unfinished"/> </message> <message> <location line="+69"/> <source>(un)select all</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Tree mode</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>List mode</source> <translation type="unfinished"/> </message> <message> <location line="+45"/> <source>Amount</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Label</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Address</source> <translation>Alamat</translation> </message> <message> <location line="+5"/> <source>Date</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Confirmations</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Confirmed</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Priority</source> <translation type="unfinished"/> </message> <message> <location filename="../coincontroldialog.cpp" line="-515"/> <source>Copy address</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy label</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <location line="+26"/> <source>Copy amount</source> <translation type="unfinished"/> </message> <message> <location line="-25"/> <source>Copy transaction ID</source> <translation type="unfinished"/> </message> <message> <location line="+24"/> <source>Copy quantity</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Copy fee</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy after fee</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy bytes</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy priority</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy low output</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy change</source> <translation type="unfinished"/> </message> <message> <location line="+317"/> <source>highest</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>high</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>medium-high</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>medium</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>low-medium</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>low</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>lowest</source> <translation type="unfinished"/> </message> <message> <location line="+155"/> <source>DUST</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>yes</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>This label turns red, if the transaction size is bigger than 10000 bytes. This means a fee of at least %1 per kb is required. Can vary +/- 1 Byte per input.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Transactions with higher priority get more likely into a block. This label turns red, if the priority is smaller than &quot;medium&quot;. This means a fee of at least %1 per kb is required.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>This label turns red, if any recipient receives an amount smaller than %1. This means a fee of at least %2 is required. Amounts below 0.546 times the minimum relay fee are shown as DUST.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>This label turns red, if the change is smaller than %1. This means a fee of at least %2 is required.</source> <translation type="unfinished"/> </message> <message> <location line="+37"/> <location line="+66"/> <source>(no label)</source> <translation type="unfinished"/> </message> <message> <location line="-9"/> <source>change from %1 (%2)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>(change)</source> <translation type="unfinished"/> </message> </context> <context> <name>EditAddressDialog</name> <message> <location filename="../forms/editaddressdialog.ui" line="+14"/> <source>Edit Address</source> <translation>Alamat</translation> </message> <message> <location line="+11"/> <source>&amp;Label</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>The label associated with this address book entry</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>&amp;Address</source> <translation>Alamat</translation> </message> <message> <location line="+10"/> <source>The address associated with this address book entry. This can only be modified for sending addresses.</source> <translation type="unfinished"/> </message> <message> <location filename="../editaddressdialog.cpp" line="+20"/> <source>New receiving address</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>New sending address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Edit receiving address</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Edit sending address</source> <translation type="unfinished"/> </message> <message> <location line="+76"/> <source>The entered address &quot;%1&quot; is already in the address book.</source> <translation type="unfinished"/> </message> <message> <location line="-5"/> <source>The entered address &quot;%1&quot; is not a valid DarkSwift address.</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Could not unlock wallet.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>New key generation failed.</source> <translation type="unfinished"/> </message> </context> <context> <name>GUIUtil::HelpMessageBox</name> <message> <location filename="../guiutil.cpp" line="+420"/> <location line="+12"/> <source>DarkSwift-Qt</source> <translation type="unfinished"/> </message> <message> <location line="-12"/> <source>version</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Usage:</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>command-line options</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>UI options</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Set language, for example &quot;de_DE&quot; (default: system locale)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Start minimized</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show splash screen on startup (default: 1)</source> <translation type="unfinished"/> </message> </context> <context> <name>OptionsDialog</name> <message> <location filename="../forms/optionsdialog.ui" line="+14"/> <source>Options</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>&amp;Main</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. Fee 0.01 recommended.</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>Pay transaction &amp;fee</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>Reserved amount does not participate in staking and is therefore spendable at any time.</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>Reserve</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>Automatically start DarkSwift after logging in to the system.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Start DarkSwift on system login</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Detach block and address databases at shutdown. This means they can be moved to another data directory, but it slows down shutdown. The wallet is always detached.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Detach databases at shutdown</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>&amp;Network</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Automatically open the DarkSwift client port on the router. This only works when your router supports UPnP and it is enabled.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Map port using &amp;UPnP</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Connect to the DarkSwift network through a SOCKS proxy (e.g. when connecting through Tor).</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Connect through SOCKS proxy:</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>Proxy &amp;IP:</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>IP address of the proxy (e.g. 127.0.0.1)</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>&amp;Port:</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>Port of the proxy (e.g. 9050)</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>SOCKS &amp;Version:</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>SOCKS version of the proxy (e.g. 5)</source> <translation type="unfinished"/> </message> <message> <location line="+36"/> <source>&amp;Window</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Show only a tray icon after minimizing the window.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Minimize to the tray instead of the taskbar</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>M&amp;inimize on close</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>&amp;Display</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>User Interface &amp;language:</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>The user interface language can be set here. This setting will take effect after restarting DarkSwift.</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>&amp;Unit to show amounts in:</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Choose the default subdivision unit to show in the interface and when sending coins.</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>Whether to show DarkSwift addresses in the transaction list or not.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Display addresses in transaction list</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Whether to show coin control features or not.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Display coin &amp;control features (experts only!)</source> <translation type="unfinished"/> </message> <message> <location line="+71"/> <source>&amp;OK</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>&amp;Cancel</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>&amp;Apply</source> <translation type="unfinished"/> </message> <message> <location filename="../optionsdialog.cpp" line="+55"/> <source>default</source> <translation type="unfinished"/> </message> <message> <location line="+149"/> <location line="+9"/> <source>Warning</source> <translation type="unfinished"/> </message> <message> <location line="-9"/> <location line="+9"/> <source>This setting will take effect after restarting DarkSwift.</source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>The supplied proxy address is invalid.</source> <translation type="unfinished"/> </message> </context> <context> <name>OverviewPage</name> <message> <location filename="../forms/overviewpage.ui" line="+14"/> <source>Form</source> <translation type="unfinished"/> </message> <message> <location line="+33"/> <location line="+231"/> <source>The displayed information may be out of date. Your wallet automatically synchronizes with the DarkSwift network after a connection is established, but this process has not completed yet.</source> <translation type="unfinished"/> </message> <message> <location line="-160"/> <source>Stake:</source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>Unconfirmed:</source> <translation type="unfinished"/> </message> <message> <location line="-107"/> <source>Wallet</source> <translation type="unfinished"/> </message> <message> <location line="+49"/> <source>Spendable:</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Your current spendable balance</source> <translation type="unfinished"/> </message> <message> <location line="+71"/> <source>Immature:</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Mined balance that has not yet matured</source> <translation type="unfinished"/> </message> <message> <location line="+20"/> <source>Total:</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Your current total balance</source> <translation type="unfinished"/> </message> <message> <location line="+46"/> <source>&lt;b&gt;Recent transactions&lt;/b&gt;</source> <translation type="unfinished"/> </message> <message> <location line="-108"/> <source>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</source> <translation type="unfinished"/> </message> <message> <location line="-29"/> <source>Total of coins that was staked, and do not yet count toward the current balance</source> <translation type="unfinished"/> </message> <message> <location filename="../overviewpage.cpp" line="+113"/> <location line="+1"/> <source>out of sync</source> <translation type="unfinished"/> </message> </context> <context> <name>QRCodeDialog</name> <message> <location filename="../forms/qrcodedialog.ui" line="+14"/> <source>QR Code Dialog</source> <translation type="unfinished"/> </message> <message> <location line="+59"/> <source>Request Payment</source> <translation type="unfinished"/> </message> <message> <location line="+56"/> <source>Amount:</source> <translation type="unfinished"/> </message> <message> <location line="-44"/> <source>Label:</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>Message:</source> <translation type="unfinished"/> </message> <message> <location line="+71"/> <source>&amp;Save As...</source> <translation type="unfinished"/> </message> <message> <location filename="../qrcodedialog.cpp" line="+62"/> <source>Error encoding URI into QR Code.</source> <translation type="unfinished"/> </message> <message> <location line="+40"/> <source>The entered amount is invalid, please check.</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Resulting URI too long, try to reduce the text for label / message.</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>Save QR Code</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>PNG Images (*.png)</source> <translation type="unfinished"/> </message> </context> <context> <name>RPCConsole</name> <message> <location filename="../forms/rpcconsole.ui" line="+46"/> <source>Client name</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <location line="+23"/> <location line="+26"/> <location line="+23"/> <location line="+23"/> <location line="+36"/> <location line="+53"/> <location line="+23"/> <location line="+23"/> <location filename="../rpcconsole.cpp" line="+348"/> <source>N/A</source> <translation type="unfinished"/> </message> <message> <location line="-217"/> <source>Client version</source> <translation type="unfinished"/> </message> <message> <location line="-45"/> <source>&amp;Information</source> <translation type="unfinished"/> </message> <message> <location line="+68"/> <source>Using OpenSSL version</source> <translation type="unfinished"/> </message> <message> <location line="+49"/> <source>Startup time</source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>Network</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Number of connections</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>On testnet</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Block chain</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Current number of blocks</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Estimated total blocks</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Last block time</source> <translation type="unfinished"/> </message> <message> <location line="+52"/> <source>&amp;Open</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Command-line options</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Show the DarkSwift-Qt help message to get a list with possible DarkSwift command-line options.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Show</source> <translation type="unfinished"/> </message> <message> <location line="+24"/> <source>&amp;Console</source> <translation type="unfinished"/> </message> <message> <location line="-260"/> <source>Build date</source> <translation type="unfinished"/> </message> <message> <location line="-104"/> <source>DarkSwift - Debug window</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>DarkSwift Core</source> <translation type="unfinished"/> </message> <message> <location line="+279"/> <source>Debug log file</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Open the DarkSwift debug log file from the current data directory. This can take a few seconds for large log files.</source> <translation type="unfinished"/> </message> <message> <location line="+102"/> <source>Clear console</source> <translation type="unfinished"/> </message> <message> <location filename="../rpcconsole.cpp" line="-33"/> <source>Welcome to the DarkSwift RPC console.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Use up and down arrows to navigate history, and &lt;b&gt;Ctrl-L&lt;/b&gt; to clear screen.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Type &lt;b&gt;help&lt;/b&gt; for an overview of available commands.</source> <translation type="unfinished"/> </message> </context> <context> <name>SendCoinsDialog</name> <message> <location filename="../forms/sendcoinsdialog.ui" line="+14"/> <location filename="../sendcoinsdialog.cpp" line="+182"/> <location line="+5"/> <location line="+5"/> <location line="+5"/> <location line="+6"/> <location line="+5"/> <location line="+5"/> <source>Send Coins</source> <translation type="unfinished"/> </message> <message> <location line="+76"/> <source>Coin Control Features</source> <translation type="unfinished"/> </message> <message> <location line="+20"/> <source>Inputs...</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>automatically selected</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>Insufficient funds!</source> <translation type="unfinished"/> </message> <message> <location line="+77"/> <source>Quantity:</source> <translation type="unfinished"/> </message> <message> <location line="+22"/> <location line="+35"/> <source>0</source> <translation type="unfinished"/> </message> <message> <location line="-19"/> <source>Bytes:</source> <translation type="unfinished"/> </message> <message> <location line="+51"/> <source>Amount:</source> <translation type="unfinished"/> </message> <message> <location line="+22"/> <location line="+86"/> <location line="+86"/> <location line="+32"/> <source>0.00 BOST</source> <translation type="unfinished"/> </message> <message> <location line="-191"/> <source>Priority:</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>medium</source> <translation type="unfinished"/> </message> <message> <location line="+32"/> <source>Fee:</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>Low Output:</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>no</source> <translation type="unfinished"/> </message> <message> <location line="+32"/> <source>After Fee:</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>Change</source> <translation type="unfinished"/> </message> <message> <location line="+50"/> <source>custom change address</source> <translation type="unfinished"/> </message> <message> <location line="+106"/> <source>Send to multiple recipients at once</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Add &amp;Recipient</source> <translation type="unfinished"/> </message> <message> <location line="+20"/> <source>Remove all transaction fields</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Clear &amp;All</source> <translation type="unfinished"/> </message> <message> <location line="+28"/> <source>Balance:</source> <translation>Baki</translation> </message> <message> <location line="+16"/> <source>123.456 BOST</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>Confirm the send action</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>S&amp;end</source> <translation type="unfinished"/> </message> <message> <location filename="../sendcoinsdialog.cpp" line="-173"/> <source>Enter a DarkSwift address (e.g. Sjz75uKHzUQJnSdzvpiigEGxseKkDhQToX)</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>Copy quantity</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy fee</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy after fee</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy bytes</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy priority</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy low output</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy change</source> <translation type="unfinished"/> </message> <message> <location line="+86"/> <source>&lt;b&gt;%1&lt;/b&gt; to %2 (%3)</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Confirm send coins</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Are you sure you want to send %1?</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source> and </source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>The recipient address is not valid, please recheck.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>The amount to pay must be larger than 0.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>The amount exceeds your balance.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>The total exceeds your balance when the %1 transaction fee is included.</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Duplicate address found, can only send to each address once per send operation.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Error: Transaction creation failed.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation type="unfinished"/> </message> <message> <location line="+251"/> <source>WARNING: Invalid DarkSwift address</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>(no label)</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>WARNING: unknown change address</source> <translation type="unfinished"/> </message> </context> <context> <name>SendCoinsEntry</name> <message> <location filename="../forms/sendcoinsentry.ui" line="+14"/> <source>Form</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>A&amp;mount:</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Pay &amp;To:</source> <translation type="unfinished"/> </message> <message> <location line="+24"/> <location filename="../sendcoinsentry.cpp" line="+25"/> <source>Enter a label for this address to add it to your address book</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>&amp;Label:</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <source>The address to send the payment to (e.g. Sjz75uKHzUQJnSdzvpiigEGxseKkDhQToX)</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Choose address from address book</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Alt+A</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Paste address from clipboard</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Remove this recipient</source> <translation type="unfinished"/> </message> <message> <location filename="../sendcoinsentry.cpp" line="+1"/> <source>Enter a DarkSwift address (e.g. Sjz75uKHzUQJnSdzvpiigEGxseKkDhQToX)</source> <translation type="unfinished"/> </message> </context> <context> <name>SignVerifyMessageDialog</name> <message> <location filename="../forms/signverifymessagedialog.ui" line="+14"/> <source>Signatures - Sign / Verify a Message</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <location line="+124"/> <source>&amp;Sign Message</source> <translation type="unfinished"/> </message> <message> <location line="-118"/> <source>You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <source>The address to sign the message with (e.g. Sjz75uKHzUQJnSdzvpiigEGxseKkDhQToX)</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <location line="+203"/> <source>Choose an address from the address book</source> <translation type="unfinished"/> </message> <message> <location line="-193"/> <location line="+203"/> <source>Alt+A</source> <translation type="unfinished"/> </message> <message> <location line="-193"/> <source>Paste address from clipboard</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation type="unfinished"/> </message> <message> <location line="+12"/> <source>Enter the message you want to sign here</source> <translation type="unfinished"/> </message> <message> <location line="+24"/> <source>Copy the current signature to the system clipboard</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>Sign the message to prove you own this DarkSwift address</source> <translation type="unfinished"/> </message> <message> <location line="+17"/> <source>Reset all sign message fields</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <location line="+146"/> <source>Clear &amp;All</source> <translation type="unfinished"/> </message> <message> <location line="-87"/> <location line="+70"/> <source>&amp;Verify Message</source> <translation type="unfinished"/> </message> <message> <location line="-64"/> <source>Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack.</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>The address the message was signed with (e.g. Sjz75uKHzUQJnSdzvpiigEGxseKkDhQToX)</source> <translation type="unfinished"/> </message> <message> <location line="+40"/> <source>Verify the message to ensure it was signed with the specified DarkSwift address</source> <translation type="unfinished"/> </message> <message> <location line="+17"/> <source>Reset all verify message fields</source> <translation type="unfinished"/> </message> <message> <location filename="../signverifymessagedialog.cpp" line="+27"/> <location line="+3"/> <source>Enter a DarkSwift address (e.g. Sjz75uKHzUQJnSdzvpiigEGxseKkDhQToX)</source> <translation type="unfinished"/> </message> <message> <location line="-2"/> <source>Click &quot;Sign Message&quot; to generate signature</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Enter DarkSwift signature</source> <translation type="unfinished"/> </message> <message> <location line="+82"/> <location line="+81"/> <source>The entered address is invalid.</source> <translation type="unfinished"/> </message> <message> <location line="-81"/> <location line="+8"/> <location line="+73"/> <location line="+8"/> <source>Please check the address and try again.</source> <translation type="unfinished"/> </message> <message> <location line="-81"/> <location line="+81"/> <source>The entered address does not refer to a key.</source> <translation type="unfinished"/> </message> <message> <location line="-73"/> <source>Wallet unlock was cancelled.</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Private key for the entered address is not available.</source> <translation type="unfinished"/> </message> <message> <location line="+12"/> <source>Message signing failed.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Message signed.</source> <translation type="unfinished"/> </message> <message> <location line="+59"/> <source>The signature could not be decoded.</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <location line="+13"/> <source>Please check the signature and try again.</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>The signature did not match the message digest.</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Message verification failed.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Message verified.</source> <translation type="unfinished"/> </message> </context> <context> <name>TransactionDesc</name> <message> <location filename="../transactiondesc.cpp" line="+19"/> <source>Open until %1</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="-2"/> <source>Open for %n block(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+8"/> <source>conflicted</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>%1/offline</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>%1/unconfirmed</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>%1 confirmations</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <source>Status</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+7"/> <source>, broadcast through %n node(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+4"/> <source>Date</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Source</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Generated</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <location line="+17"/> <source>From</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <location line="+22"/> <location line="+58"/> <source>To</source> <translation type="unfinished"/> </message> <message> <location line="-77"/> <location line="+2"/> <source>own address</source> <translation type="unfinished"/> </message> <message> <location line="-2"/> <source>label</source> <translation type="unfinished"/> </message> <message> <location line="+37"/> <location line="+12"/> <location line="+45"/> <location line="+17"/> <location line="+30"/> <source>Credit</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="-102"/> <source>matures in %n more block(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+2"/> <source>not accepted</source> <translation type="unfinished"/> </message> <message> <location line="+44"/> <location line="+8"/> <location line="+15"/> <location line="+30"/> <source>Debit</source> <translation type="unfinished"/> </message> <message> <location line="-39"/> <source>Transaction fee</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Net amount</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Message</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Comment</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Transaction ID</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Generated coins must mature 510 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to &quot;not accepted&quot; and it won&apos;t be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Debug information</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Transaction</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Inputs</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Amount</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>true</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>false</source> <translation type="unfinished"/> </message> <message> <location line="-211"/> <source>, has not been successfully broadcast yet</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>unknown</source> <translation type="unfinished"/> </message> </context> <context> <name>TransactionDescDialog</name> <message> <location filename="../forms/transactiondescdialog.ui" line="+14"/> <source>Transaction details</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>This pane shows a detailed description of the transaction</source> <translation type="unfinished"/> </message> </context> <context> <name>TransactionTableModel</name> <message> <location filename="../transactiontablemodel.cpp" line="+226"/> <source>Date</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Type</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Address</source> <translation>Alamat</translation> </message> <message> <location line="+0"/> <source>Amount</source> <translation type="unfinished"/> </message> <message> <location line="+60"/> <source>Open until %1</source> <translation type="unfinished"/> </message> <message> <location line="+12"/> <source>Confirmed (%1 confirmations)</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="-15"/> <source>Open for %n more block(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+6"/> <source>Offline</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Unconfirmed</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Confirming (%1 of %2 recommended confirmations)</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Conflicted</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Immature (%1 confirmations, will be available after %2)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>This block was not received by any other nodes and will probably not be accepted!</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Generated but not accepted</source> <translation type="unfinished"/> </message> <message> <location line="+42"/> <source>Received with</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Received from</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Sent to</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Payment to yourself</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Mined</source> <translation type="unfinished"/> </message> <message> <location line="+38"/> <source>(n/a)</source> <translation type="unfinished"/> </message> <message> <location line="+190"/> <source>Transaction status. Hover over this field to show number of confirmations.</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Date and time that the transaction was received.</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Type of transaction.</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Destination address of transaction.</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Amount removed from or added to balance.</source> <translation type="unfinished"/> </message> </context> <context> <name>TransactionView</name> <message> <location filename="../transactionview.cpp" line="+55"/> <location line="+16"/> <source>All</source> <translation type="unfinished"/> </message> <message> <location line="-15"/> <source>Today</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>This week</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>This month</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Last month</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>This year</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Range...</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Received with</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Sent to</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>To yourself</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Mined</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Other</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Enter address or label to search</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Min amount</source> <translation type="unfinished"/> </message> <message> <location line="+34"/> <source>Copy address</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy label</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy transaction ID</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Edit label</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show transaction details</source> <translation type="unfinished"/> </message> <message> <location line="+144"/> <source>Export Transaction Data</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>Fail yang dipisahkan dengan koma</translation> </message> <message> <location line="+8"/> <source>Confirmed</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Date</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Type</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Label</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Address</source> <translation>Alamat</translation> </message> <message> <location line="+1"/> <source>Amount</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>ID</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Error exporting</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation type="unfinished"/> </message> <message> <location line="+100"/> <source>Range:</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>to</source> <translation type="unfinished"/> </message> </context> <context> <name>WalletModel</name> <message> <location filename="../walletmodel.cpp" line="+206"/> <source>Sending...</source> <translation type="unfinished"/> </message> </context> <context> <name>bitcoin-core</name> <message> <location filename="../bitcoinstrings.cpp" line="+33"/> <source>DarkSwift version</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Usage:</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Send command to -server or DarkSwiftd</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>List commands</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Get help for a command</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Options:</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Specify configuration file (default: DarkSwift.conf)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Specify pid file (default: DarkSwiftd.pid)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Specify wallet file (within data directory)</source> <translation type="unfinished"/> </message> <message> <location line="-1"/> <source>Specify data directory</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Set database cache size in megabytes (default: 25)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Set database disk log size in megabytes (default: 100)</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Listen for connections on &lt;port&gt; (default: 15714 or testnet: 25714)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Maintain at most &lt;n&gt; connections to peers (default: 125)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Connect to a node to retrieve peer addresses, and disconnect</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Specify your own public address</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Bind to given address. Use [host]:port notation for IPv6</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Stake your coins to support network and gain reward (default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Threshold for disconnecting misbehaving peers (default: 100)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source> <translation type="unfinished"/> </message> <message> <location line="-44"/> <source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source> <translation type="unfinished"/> </message> <message> <location line="+51"/> <source>Detach block and address databases. Increases shutdown time (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+109"/> <source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation type="unfinished"/> </message> <message> <location line="-5"/> <source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds </source> <translation type="unfinished"/> </message> <message> <location line="-87"/> <source>Listen for JSON-RPC connections on &lt;port&gt; (default: 15715 or testnet: 25715)</source> <translation type="unfinished"/> </message> <message> <location line="-11"/> <source>Accept command line and JSON-RPC commands</source> <translation type="unfinished"/> </message> <message> <location line="+101"/> <source>Error: Transaction creation failed </source> <translation type="unfinished"/> </message> <message> <location line="-5"/> <source>Error: Wallet locked, unable to create transaction </source> <translation type="unfinished"/> </message> <message> <location line="-8"/> <source>Importing blockchain data file.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Importing bootstrap blockchain data file.</source> <translation type="unfinished"/> </message> <message> <location line="-88"/> <source>Run in the background as a daemon and accept commands</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Use the test network</source> <translation type="unfinished"/> </message> <message> <location line="-24"/> <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source> <translation type="unfinished"/> </message> <message> <location line="-38"/> <source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source> <translation type="unfinished"/> </message> <message> <location line="+117"/> <source>Error initializing database environment %s! To recover, BACKUP THAT DIRECTORY, then remove everything from it except for wallet.dat.</source> <translation type="unfinished"/> </message> <message> <location line="-20"/> <source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source> <translation type="unfinished"/> </message> <message> <location line="+61"/> <source>Warning: Please check that your computer&apos;s date and time are correct! If your clock is wrong DarkSwift will not work properly.</source> <translation type="unfinished"/> </message> <message> <location line="-31"/> <source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source> <translation type="unfinished"/> </message> <message> <location line="-18"/> <source>Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup.</source> <translation type="unfinished"/> </message> <message> <location line="-30"/> <source>Attempt to recover private keys from a corrupt wallet.dat</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Block creation options:</source> <translation type="unfinished"/> </message> <message> <location line="-62"/> <source>Connect only to the specified node(s)</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Discover own IP address (default: 1 when listening and no -externalip)</source> <translation type="unfinished"/> </message> <message> <location line="+94"/> <source>Failed to listen on any port. Use -listen=0 if you want this.</source> <translation type="unfinished"/> </message> <message> <location line="-90"/> <source>Find peers using DNS lookup (default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Sync checkpoints policy (default: strict)</source> <translation type="unfinished"/> </message> <message> <location line="+83"/> <source>Invalid -tor address: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Invalid amount for -reservebalance=&lt;amount&gt;</source> <translation type="unfinished"/> </message> <message> <location line="-82"/> <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: 5000)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: 1000)</source> <translation type="unfinished"/> </message> <message> <location line="-16"/> <source>Only connect to nodes in network &lt;net&gt; (IPv4, IPv6 or Tor)</source> <translation type="unfinished"/> </message> <message> <location line="+28"/> <source>Output extra debugging information. Implies all other -debug* options</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Output extra network debugging information</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Prepend debug output with timestamp</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>SSL options: (see the Bitcoin Wiki for SSL setup instructions)</source> <translation type="unfinished"/> </message> <message> <location line="-74"/> <source>Select the version of socks proxy to use (4-5, default: 5)</source> <translation type="unfinished"/> </message> <message> <location line="+41"/> <source>Send trace/debug info to console instead of debug.log file</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Send trace/debug info to debugger</source> <translation type="unfinished"/> </message> <message> <location line="+28"/> <source>Set maximum block size in bytes (default: 250000)</source> <translation type="unfinished"/> </message> <message> <location line="-1"/> <source>Set minimum block size in bytes (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="-29"/> <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source> <translation type="unfinished"/> </message> <message> <location line="-42"/> <source>Specify connection timeout in milliseconds (default: 5000)</source> <translation type="unfinished"/> </message> <message> <location line="+109"/> <source>Unable to sign checkpoint, wrong checkpointkey? </source> <translation type="unfinished"/> </message> <message> <location line="-80"/> <source>Use UPnP to map the listening port (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="-1"/> <source>Use UPnP to map the listening port (default: 1 when listening)</source> <translation type="unfinished"/> </message> <message> <location line="-25"/> <source>Use proxy to reach tor hidden services (default: same as -proxy)</source> <translation type="unfinished"/> </message> <message> <location line="+42"/> <source>Username for JSON-RPC connections</source> <translation type="unfinished"/> </message> <message> <location line="+47"/> <source>Verifying database integrity...</source> <translation type="unfinished"/> </message> <message> <location line="+57"/> <source>WARNING: syncronized checkpoint violation detected, but skipped!</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Warning: Disk space is low!</source> <translation type="unfinished"/> </message> <message> <location line="-2"/> <source>Warning: This version is obsolete, upgrade required!</source> <translation type="unfinished"/> </message> <message> <location line="-48"/> <source>wallet.dat corrupt, salvage failed</source> <translation type="unfinished"/> </message> <message> <location line="-54"/> <source>Password for JSON-RPC connections</source> <translation type="unfinished"/> </message> <message> <location line="-84"/> <source>%s, you must set a rpcpassword in the configuration file: %s It is recommended you use the following random password: rpcuser=DarkSwiftrpc rpcpassword=%s (you do not need to remember this password) The username and password MUST NOT be the same. If the file does not exist, create it with owner-readable-only file permissions. It is also recommended to set alertnotify so you are notified of problems; for example: alertnotify=echo %%s | mail -s &quot;DarkSwift Alert&quot; admin@foo.com </source> <translation type="unfinished"/> </message> <message> <location line="+51"/> <source>Find peers using internet relay chat (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Sync time with other nodes. Disable if time on your system is precise e.g. syncing with NTP (default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>When creating transactions, ignore inputs with value less than this (default: 0.01)</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Allow JSON-RPC connections from specified IP address</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Send commands to node running on &lt;ip&gt; (default: 127.0.0.1)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Require a confirmations for change (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Enforce transaction scripts to use canonical PUSH operators (default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Upgrade wallet to latest format</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Set key pool size to &lt;n&gt; (default: 100)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Rescan the block chain for missing wallet transactions</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>How many blocks to check at startup (default: 2500, 0 = all)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>How thorough the block verification is (0-6, default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Imports blocks from external blk000?.dat file</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Use OpenSSL (https) for JSON-RPC connections</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Server certificate file (default: server.cert)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Server private key (default: server.pem)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source> <translation type="unfinished"/> </message> <message> <location line="+53"/> <source>Error: Wallet unlocked for staking only, unable to create transaction.</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <source>WARNING: Invalid checkpoint found! Displayed transactions may not be correct! You may need to upgrade, or notify developers.</source> <translation type="unfinished"/> </message> <message> <location line="-158"/> <source>This help message</source> <translation type="unfinished"/> </message> <message> <location line="+95"/> <source>Wallet %s resides outside data directory %s.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Cannot obtain a lock on data directory %s. DarkSwift is probably already running.</source> <translation type="unfinished"/> </message> <message> <location line="-98"/> <source>DarkSwift</source> <translation type="unfinished"/> </message> <message> <location line="+140"/> <source>Unable to bind to %s on this computer (bind returned error %d, %s)</source> <translation type="unfinished"/> </message> <message> <location line="-130"/> <source>Connect through socks proxy</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Allow DNS lookups for -addnode, -seednode and -connect</source> <translation type="unfinished"/> </message> <message> <location line="+122"/> <source>Loading addresses...</source> <translation type="unfinished"/> </message> <message> <location line="-15"/> <source>Error loading blkindex.dat</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Error loading wallet.dat: Wallet corrupted</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Error loading wallet.dat: Wallet requires newer version of DarkSwift</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Wallet needed to be rewritten: restart DarkSwift to complete</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error loading wallet.dat</source> <translation type="unfinished"/> </message> <message> <location line="-16"/> <source>Invalid -proxy address: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="-1"/> <source>Unknown network specified in -onlynet: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="-1"/> <source>Unknown -socks proxy version requested: %i</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Cannot resolve -bind address: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Cannot resolve -externalip address: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="-24"/> <source>Invalid amount for -paytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+44"/> <source>Error: could not start node</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Sending...</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Invalid amount</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Insufficient funds</source> <translation type="unfinished"/> </message> <message> <location line="-34"/> <source>Loading block index...</source> <translation type="unfinished"/> </message> <message> <location line="-103"/> <source>Add a node to connect to and attempt to keep the connection open</source> <translation type="unfinished"/> </message> <message> <location line="+122"/> <source>Unable to bind to %s on this computer. DarkSwift is probably already running.</source> <translation type="unfinished"/> </message> <message> <location line="-97"/> <source>Fee per KB to add to transactions you send</source> <translation type="unfinished"/> </message> <message> <location line="+55"/> <source>Invalid amount for -mininput=&lt;amount&gt;: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>Loading wallet...</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Cannot downgrade wallet</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Cannot initialize keypool</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Cannot write default address</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Rescanning...</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Done loading</source> <translation type="unfinished"/> </message> <message> <location line="-167"/> <source>To use the %s option</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Error</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>You must set rpcpassword=&lt;password&gt; in the configuration file: %s If the file does not exist, create it with owner-readable-only file permissions.</source> <translation type="unfinished"/> </message> </context> </TS>
DarkSwift/DarkSwift
src/qt/locale/bitcoin_ms_MY.ts
TypeScript
mit
107,393
# Worker Glass [Unmaintained] **Note**: This library is no longer in use in the Karafka ecosystem. It was developed for Karafka versions prior to `1.0`. If you're using this library and want to take it over, please ping us. [![Build Status](https://github.com/karafka/worker-glass/workflows/ci/badge.svg)](https://github.com/karafka/worker-glass/actions?query=workflow%3Aci) [![Gem Version](https://badge.fury.io/rb/worker-glass.svg)](http://badge.fury.io/rb/worker-glass) [![Join the chat at https://gitter.im/karafka/karafka](https://badges.gitter.im/karafka/karafka.svg)](https://gitter.im/karafka/karafka) WorkerGlass provides optional timeout and after failure (reentrancy) for background processing worker engines (like Sidekiq, Resque, etc). ## Reentrancy If you don't know what is reentrancy, you can read about it [here](http://dev.mensfeld.pl/2014/05/ruby-rails-sinatra-background-processing-reentrancy-for-your-workers-is-a-must-be/). ## Setup If you want to use timeout and/or reentrancy, please add appropriate modules into your worker. WorkerGlass allows to configure following options: | Method | Arguments | Description | |------------------|-----------|------------------------------------------------------------------------------------------| | self.logger= | Logger | Set logger which will be used by Worker Glass (if not defined, null logger will be used) | ## Usage WorkerGlass has few submodules that you can prepend to your workers to obtain given functionalities: | Module | Description | |-------------------------|-------------------------------------------------------------------| | WorkerGlass::Reentrancy | Provides additional reentrancy layer if anything goes wrong | | WorkerGlass::Timeout | Allows to set a timeout after which a given worker task will fail | ### WorkerGlass::Timeout If you want to provide timeouts for your workers, just prepend WorkerGlass::Timeout to your worker and set the timeout value: ```ruby class Worker2 prepend WorkerGlass::Timeout self.timeout = 60 # 1 minute timeout def perform(first_param, second_param, third_param) SomeService.new.process(first_param, second_param, third_param) end end Worker2.perform_async(example1, example2, example3) ``` ### WorkerGlass::Reentrancy If you want to provide reentrancy for your workers, just prepend WorkerGlass::Reentrancy to your worker and define **after_failure** method that will be executed upon failure: ```ruby class Worker3 prepend WorkerGlass::Reentrancy def perform(first_param, second_param, third_param) SomeService.new.process(first_param, second_param, third_param) end def after_failure(first_param, second_param, third_param) SomeService.new.reset_state(first_param, second_param, third_param) end end Worker3.perform_async(example1, example2, example3) ``` ## References * [Karafka framework](https://github.com/karafka/karafka) * [Worker Glass Actions CI](https://github.com/karafka/worker-glass/actions?query=workflow%3Aci) * [Worker Glass Coditsu](https://app.coditsu.io/karafka/repositories/worker-glass) ## Note on contributions First, thank you for considering contributing to Worker Glass! It's people like you that make the open source community such a great community! Each pull request must pass all the RSpec specs and meet our quality requirements. To check if everything is as it should be, we use [Coditsu](https://coditsu.io) that combines multiple linters and code analyzers for both code and documentation. Once you're done with your changes, submit a pull request. Coditsu will automatically check your work against our quality standards. You can find your commit check results on the [builds page](https://app.coditsu.io/karafka/repositories/worker-glass/builds/commit_builds) of Worker Glass repository.
karafka/sidekiq-glass
README.md
Markdown
mit
3,985
import { assign, forEach, isArray } from 'min-dash'; var abs= Math.abs, round = Math.round; var TOLERANCE = 10; export default function BendpointSnapping(eventBus) { function snapTo(values, value) { if (isArray(values)) { var i = values.length; while (i--) if (abs(values[i] - value) <= TOLERANCE) { return values[i]; } } else { values = +values; var rem = value % values; if (rem < TOLERANCE) { return value - rem; } if (rem > values - TOLERANCE) { return value - rem + values; } } return value; } function mid(element) { if (element.width) { return { x: round(element.width / 2 + element.x), y: round(element.height / 2 + element.y) }; } } // connection segment snapping ////////////////////// function getConnectionSegmentSnaps(context) { var snapPoints = context.snapPoints, connection = context.connection, waypoints = connection.waypoints, segmentStart = context.segmentStart, segmentStartIndex = context.segmentStartIndex, segmentEnd = context.segmentEnd, segmentEndIndex = context.segmentEndIndex, axis = context.axis; if (snapPoints) { return snapPoints; } var referenceWaypoints = [ waypoints[segmentStartIndex - 1], segmentStart, segmentEnd, waypoints[segmentEndIndex + 1] ]; if (segmentStartIndex < 2) { referenceWaypoints.unshift(mid(connection.source)); } if (segmentEndIndex > waypoints.length - 3) { referenceWaypoints.unshift(mid(connection.target)); } context.snapPoints = snapPoints = { horizontal: [] , vertical: [] }; forEach(referenceWaypoints, function(p) { // we snap on existing bendpoints only, // not placeholders that are inserted during add if (p) { p = p.original || p; if (axis === 'y') { snapPoints.horizontal.push(p.y); } if (axis === 'x') { snapPoints.vertical.push(p.x); } } }); return snapPoints; } eventBus.on('connectionSegment.move.move', 1500, function(event) { var context = event.context, snapPoints = getConnectionSegmentSnaps(context), x = event.x, y = event.y, sx, sy; if (!snapPoints) { return; } // snap sx = snapTo(snapPoints.vertical, x); sy = snapTo(snapPoints.horizontal, y); // correction x/y var cx = (x - sx), cy = (y - sy); // update delta assign(event, { dx: event.dx - cx, dy: event.dy - cy, x: sx, y: sy }); }); // bendpoint snapping ////////////////////// function getBendpointSnaps(context) { var snapPoints = context.snapPoints, waypoints = context.connection.waypoints, bendpointIndex = context.bendpointIndex; if (snapPoints) { return snapPoints; } var referenceWaypoints = [ waypoints[bendpointIndex - 1], waypoints[bendpointIndex + 1] ]; context.snapPoints = snapPoints = { horizontal: [] , vertical: [] }; forEach(referenceWaypoints, function(p) { // we snap on existing bendpoints only, // not placeholders that are inserted during add if (p) { p = p.original || p; snapPoints.horizontal.push(p.y); snapPoints.vertical.push(p.x); } }); return snapPoints; } eventBus.on('bendpoint.move.move', 1500, function(event) { var context = event.context, snapPoints = getBendpointSnaps(context), target = context.target, targetMid = target && mid(target), x = event.x, y = event.y, sx, sy; if (!snapPoints) { return; } // snap sx = snapTo(targetMid ? snapPoints.vertical.concat([ targetMid.x ]) : snapPoints.vertical, x); sy = snapTo(targetMid ? snapPoints.horizontal.concat([ targetMid.y ]) : snapPoints.horizontal, y); // correction x/y var cx = (x - sx), cy = (y - sy); // update delta assign(event, { dx: event.dx - cx, dy: event.dy - cy, x: event.x - cx, y: event.y - cy }); }); } BendpointSnapping.$inject = [ 'eventBus' ];
pedesen/diagram-js
lib/features/bendpoints/BendpointSnapping.js
JavaScript
mit
4,283
var changeSpan; var i = 0; var hobbies = [ 'Music', 'HTML5', 'Learning', 'Exploring', 'Art', 'Teaching', 'Virtual Reality', 'The Cosmos', 'Unity3D', 'Tilemaps', 'Reading', 'Butterscotch', 'Drawing', 'Taking Photos', 'Smiles', 'The Poetics of Space', 'Making Sounds', 'Board games', 'Travelling', 'Sweetened condensed milk' ]; function changeWord() { changeSpan.textContent = hobbies[i]; i++; if (i >= hobbies.length) i = 0; } function init() { console.log('initialising scrolling text'); changeSpan = document.getElementById("scrollingText"); nIntervId = setInterval(changeWord, 950); changeWord(); } if (document.addEventListener) { init(); } else { init(); }
oddgoo/oddgoo.com
static/js/hobbies.js
JavaScript
mit
725
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>CodePen - A Pen by Justin Kams</title> </head> <body> <html> <head> <title>The Basics of The Web and HTML</title> </head> <body> <h2>The Basics of The Web and HTML</h2> <p><em></em></p> <p><em><h3>The Basics of the World Wide Web</h3></em> The world wide web is a collection of computers with html files on them. The computers communcate and share the html files when the user requests it in the browser. When a person goes to a web page like <a href="www.google.com">www.google.com</a>, their computer sends a HTTP Request to a server. The server finds the appropriate<b> HTML</b> document and sends it back to the user's computer where a web browser interprets the page and displays it on the user's screen.</p> <p><em><h3>HTML</h3></em> <b>HTML</b> stands for <em>Hypertext Markup Language</em>. <b>HTML</b> documents form the majority of the content on the web. <b>HTML</b> documents contain text content which describes <em>"what you see"</em> and markup which describes <em>"how it looks"</em>. This video gives a good overview.</p> <p><em><h3>Tags and Elements</h3></em> <b>HTML</b> documents are made of <b>HTML</b> elements. When writing <b>HTML</b>, we tell browsers the type of each element by using <b>HTML</b> tags. This video explains the distinction well.</p> <p><em><h3>HTML Attributes</h3></em> There are many attributes. One for starters is the anchor tag. The anchor tag is used to include links in the material. These tags would be nested in the less than greater brackets, and consist of <em>'a href="link" /a'</em>. View this webpage for a <a href="http://www.w3schools.com/tags/tag_a.asp">description</a>. </p> <p><em><h3>Images</h3></em> Images can be added to web content. These tags will again have the less than and greater than brackets surrounding them, and consist of <em>'img src="url" alt="text"'</em>. These tags are known as void tags and do not need content included. Also the alt attribute at the end of the tag, diplays text in the event the image request is broken. </p> <p><em><h3>Whitespace</h3></em> Browsers automatically put text on one line, unless told othrwise. To render text on multiple lines, use the tag <em>'br'</em> which stands for break, or <em>'p'</em>, which stands for paragraph. </p> <p><em><h3>Why Computers are Stupid</h3></em> Computers are stupid because they interpret instructions literally. This makes them very unforgiving since a small mistake by a programmer can cause huge problems in a program.</p> <p><em><h3>Inline vs Block Elements</h3></em> HTML elements are either inline or block. Block elements form an <em>"invisible box"</em> around the content inside of them.</p> <p><em><h3>HTML Document</h3></em> Lastly a typical html document will be ordered as follows: <ol> <li>!DOCTYPE HTML</li> <li>html</li> <li>head</li> <li>/head</li> <li>body</li> <li>tags 'content' /tags</li> <li>/body</li> <li>/html</li> </ol> </p> </body> </html> </body> </html>
westlyheinrich/getting-started-with-html
index.html
HTML
mit
3,084
<?php namespace App\Http\ViewComposers; use App\Models\Character; use App\Models\Message; use Illuminate\Database\Eloquent\Builder; use Illuminate\Support\Arr; use Illuminate\Support\Facades\Auth; use Illuminate\View\View; class CharacterMessagesComposer { /** * Bind data to the view. * * @param View $view * @return void */ public function compose(View $view) { $data = $view->getData(); /** @var Character $currentCharacter */ /** @var Character $otherCharacter */ $currentCharacter = Auth::user()->character; $otherCharacter = Arr::get($data, 'character'); $messages = Message::query()->where(function (Builder $query) use ($currentCharacter, $otherCharacter) { $query->where([ 'to_id' => $currentCharacter->id, 'from_id' => $otherCharacter->id, ]); })->orWhere(function (Builder $query) use ($currentCharacter, $otherCharacter) { $query->where([ 'to_id' => $otherCharacter->id, 'from_id' => $currentCharacter->id, ]); })->orderByDesc('created_at')->paginate(5); $otherCharacter->sentMessages()->whereIn('id', $messages->pluck('id'))->markAsRead(); $contentLimit = Message::CONTENT_LIMIT; $view->with(compact('messages', 'currentCharacter', 'otherCharacter', 'contentLimit')); } }
mchekin/rpg
app/Http/ViewComposers/CharacterMessagesComposer.php
PHP
mit
1,435
--- layout: default archive: true --- <script src="https://apis.google.com/js/platform.js" async defer></script> <article class="post"> <header> <h1>{{ page.title }}</h1> <h2 class="headline">{{ page.date | date:"%B %-d, %Y" }}</h2> </header> <section id="post-body"> {{content}} {% assign post = page %} {% if post.tags.size > 0 %} {% capture tags_content %}Posted with {% if post.tags.size == 1 %}<i class="fa fa-tag"></i>{% else %}<i class="fa fa-tags"></i>{% endif %}: {% endcapture %} {% for post_tag in post.tags %} {% for data_tag in site.data.tags %} {% if data_tag.slug == post_tag %} {% assign tag = data_tag %} {% endif %} {% endfor %} {% if tag %} {% capture tags_content_temp %}{{ tags_content }}<a href="/blog/tag/{{ tag.slug }}/">{{ tag.name }}</a>{% if forloop.last == false %}, {% endif %}{% endcapture %} {% assign tags_content = tags_content_temp %} {% endif %} {% endfor %} {% else %} {% assign tags_content = '' %} {% endif %} </section> </article> <footer id="post-meta" class="clearfix"> <form style="border:1px solid #ccc;padding:3px;text-align:center;" action="https://tinyletter.com/MozillaTN" method="post" target="popupwindow" onsubmit="window.open('https://tinyletter.com/MozillaTN', 'popupwindow', 'scrollbars=yes,width=800,height=600');return true"><p><label for="tlemail">Enter your email address To our Community Mailing List</label></p><p><input type="text" style="width:140px" name="email" id="tlemail" /></p><input type="hidden" value="1" name="embed"/><input type="submit" value="Subscribe" /> </form> {% assign author = site.data.people[page.author] %} <a href="/about/{{ page.author }}"> <img class="avatar" src="{{ author.gravatar}}"> <div> <span class="dark">{{ author.name }}</span> </div> </a> <p>{{ tags_content }}</p> <section id="sharing"> {% include share.html %} </section> </footer> {% include pagination.html %} <!-- Disqus comments --> {% if site.disqus %} <div class="archive readmore"> <h3>Comments</h3> {% include disqus.html %} </div> {% endif %} <!-- Archive post list --> {% if page.archive %} <ul id="post-list" class="archive readmore"> <h3>Read more</h3> {% for post in site.posts limit:10 %} <li> <a href="{{ site.baseurl }}{{ post.url | remove_first: '/' }}">{{ post.title }}<aside class="dates">{{ post.date | date:"%b %d" }}</aside></a> </li> {% endfor %} </ul> {% endif %}
MozillaTN/mozillatn.github.io
_layouts/post.html
HTML
mit
2,663
from src.tools.dictionaries import PostLoadedDict # Utility class ################################################ class ServerImplementationDict(PostLoadedDict): def __missing__(self, key): try: return super().__missing__(key) except KeyError: return NotImplemented ################################################ class Server(): def __init__(self, shortname, loader): # Not preloaded # loaders must produce dictionaries (or an appropriate iterable) # with the required keys. # The reason for this is that code for certain servers need not be loaded # if it's not going to be used at all # It also prevents import loop collisions. global __ServerImplementationDict self.__data = ServerImplementationDict(loader) self.__shortname = shortname @property def shortname(self): # This is the only property provided from above return self.__shortname def __str__(self): return str(self.__shortname) # All other properties must come from canonical sources # provided by the server loader # CONSTANTS (STRINGS, BOOLEANS, INTS, ETC.) @property def name(self): return self.__data['str_name'] @property def internal_shortname(self): return self.__data['str_shortname'] @property def beta(self): return self.__data['bool_tester'] # CLASSES # 1- Credentials: @property def Auth(self): # I really don't know how to call this. return self.__data['cls_auth'] @property def auth_fields(self): return self.__data['list_authkeys'] # 2- Server Elements: @property def Player(self): return self.__data['cls_player'] @property def Tournament(self): return self.__data['cls_tournament']
juanchodepisa/sbtk
SBTK_League_Helper/src/interfacing/servers.py
Python
mit
1,946
import { GraphQLInputObjectType, GraphQLID, GraphQLList, GraphQLBoolean, } from 'graphql'; import RecipientTypeEnum from './RecipientTypeEnum'; import MessageTypeEnum from './MessageTypeEnum'; import NoteInputType from './NoteInputType'; import TranslationInputType from './TranslationInputType'; import CommunicationInputType from './CommunicationInputType'; const MessageInputType = new GraphQLInputObjectType({ name: 'MessageInput', fields: { parentId: { type: GraphQLID, }, note: { type: NoteInputType, }, communication: { type: CommunicationInputType, }, subject: { type: TranslationInputType, }, enforceEmail: { type: GraphQLBoolean, }, isDraft: { type: GraphQLBoolean, }, recipients: { type: new GraphQLList(GraphQLID), }, recipientType: { type: RecipientTypeEnum }, messageType: { type: MessageTypeEnum }, }, }); export default MessageInputType;
nambawan/g-old
src/data/types/MessageInputType.js
JavaScript
mit
979
{% macro scenario_tabs(selected,num,path, id) %} <div class="section-tabs js-tabs clearfix mb20"> <ul> {% set navs = [ {url:"timeline-review",label:"Timeline"}, {url:"details-fme",label:"Details"}, {url:"evidence-portal",label:"Evidence"}, {url:"appointment",label:"Appointment"} ] %} {% for item in navs %} <li {% if item.url == selected %} class="active"{% endif %}><a href="/fha/scrutiny-scenarios/scenario7/{{ item.url }}/">{{ item.label }}</a></li> {% endfor %} </ul> </div> {% endmacro %}
dwpdigitaltech/healthanddisability
app/views/fha/scrutiny-scenarios/scenario7/_macros_nav_scenario7.html
HTML
mit
573
#include <boost/lexical_cast.hpp> #include <disccord/models/user.hpp> namespace disccord { namespace models { user::user() : username(""), avatar(), email(), discriminator(0), bot(false), mfa_enabled(), verified() { } user::~user() { } void user::decode(web::json::value json) { entity::decode(json); username = json.at("username").as_string(); // HACK: use boost::lexical_cast here since it safely // validates values auto str_js = json.at("discriminator"); discriminator = boost::lexical_cast<uint16_t>(str_js.as_string()); #define get_field(var, conv) \ if (json.has_field(#var)) { \ auto field = json.at(#var); \ if (!field.is_null()) { \ var = decltype(var)(field.conv()); \ } else { \ var = decltype(var)::no_value(); \ } \ } else { \ var = decltype(var)(); \ } get_field(avatar, as_string); bot = json.at("bot").as_bool(); //get_field(bot, as_bool); get_field(mfa_enabled, as_bool); get_field(verified, as_bool); get_field(email, as_string); #undef get_field } void user::encode_to(std::unordered_map<std::string, web::json::value> &info) { entity::encode_to(info); info["username"] = web::json::value(get_username()); info["discriminator"] = web::json::value(std::to_string(get_discriminator())); if (get_avatar().is_specified()) info["avatar"] = get_avatar(); info["bot"] = web::json::value(get_bot()); if (get_mfa_enabled().is_specified()) info["mfa_enabled"] = get_mfa_enabled(); if (get_verified().is_specified()) info["verified"] = get_verified(); if (get_email().is_specified()) info["email"] = get_email(); } #define define_get_method(field_name) \ decltype(user::field_name) user::get_##field_name() { \ return field_name; \ } define_get_method(username) define_get_method(discriminator) define_get_method(avatar) define_get_method(bot) define_get_method(mfa_enabled) define_get_method(verified) define_get_method(email) util::optional<std::string> user::get_avatar_url() { if (get_avatar().is_specified()) { std::string url = "https://cdn.discordapp.com/avatars/" + std::to_string(get_id()) + "/" + get_avatar().get_value()+".png?size=1024"; return util::optional<std::string>(url); } else return util::optional<std::string>::no_value(); } #undef define_get_method } }
FiniteReality/disccord
lib/models/user.cpp
C++
mit
3,213
package com.full360.voltdbscala import org.voltdb.client.ClientResponse /** * Exception thrown when the status of a client response if not success * @param message the detail message of this exception */ case class ClientResponseStatusException(message: String) extends Exception(message) object ClientResponseStatusException { def apply(clientResponse: ClientResponse): ClientResponseStatusException = { val status = (clientResponse.getStatusString, clientResponse.getStatus) new ClientResponseStatusException(s"""Stored procedure replied with status: "${status._1}". Code: ${status._2}""") } } /** * Exception thrown when an asynchronous procedure call is not queued * @param message the detail message of this exception */ case class ProcedureNotQueuedException(message: String) extends Exception(message)
full360/voltdbscala
src/main/scala/com/full360/voltdbscala/exceptions.scala
Scala
mit
832
// // UIView+WebCacheOperation.h // SKWebImage // // Created by 侯森魁 on 2019/8/23. // Copyright © 2019 侯森魁. All rights reserved. // #import <UIKit/UIKit.h> #import "SKWebImageCompat.h" #import "SKWebImageManager.h" NS_ASSUME_NONNULL_BEGIN @interface UIView (WebCacheOperation) /** Set the image load operation (storage in a view based dictionary) @param operation <#operation description#> */ - (void)sk_setImageloadOperation:(nullable id)operation forKey:(nullable NSString *)key; /** Cancel all operation for the current UiView and key @param key <#key description#> */ - (void)sk_cancelImageLoadOperationWithKey:(nullable NSString *)key; /** Just remove the operation corresponding to the UIView and key without cancelling them @param key <#key description#> */ - (void)sk_removeImageLoadOperationWithKey:(nullable NSString *)key; @end NS_ASSUME_NONNULL_END
housenkui/SKStruct
SKProject01/SKWebImage/lib/Categories/UIView+WebCacheOperation.h
C
mit
899
// // ///////////////////////////////////////////////////////////////////////////// // // Copyright 2014 Autodesk, Inc. All rights reserved. // // Use of this software is subject to the terms of the Autodesk license // agreement provided at the time of installation or download, or which // otherwise accompanies this software in either electronic or hard copy form. // ////////////////////////////////////////////////////////////////////////////// // // // truetypetext.h - General-purpose TrueType functions // // DESCRIPTION: // // This header file contains declarations of general-purpose truetype text // functions provided with the AcUtil library and DLL. // #ifndef _TRUETYPETEXT_H_ #define _TRUETYPETEXT_H_ #define UC_DEGREE_SYMBOL 0x00B0 #define UC_PLUSMINUS_SYMBOL 0x00B1 #define UC_PHI_SYMBOL 0x00D8 // The Character 'phi' (substitute for diameter) #define UC_DIAMETER_SYMBOL 0x2205 // Most fonts do not have this. typedef void (*LineSegmentCallback) (const AcGePoint3d &, const AcGePoint3d &, const void *); struct TextParams { double height; // Text Height double width_scale; // Width Scale Factor double oblique_angle; // Obliquing/Italics Angle double rotation_angle; // Rotation Angle double spacing; // Inter Character Spacing Percent short flags; // Text Generation Flags }; class Scores { private: int m_overline; int m_underline; int m_strikethrough; AcGePoint3d m_position; AcGePoint3d m_over_point[2]; AcGePoint3d m_under_point[2]; AcGePoint3d m_strikethrough_point[2]; AcGePoint3d m_bbox[4]; TextParams const * m_pTextParams; LineSegmentCallback m_pLineSegmentCB; void * m_pAction; AcGiContext * m_pContext; #define ON 1 #define OFF 0 public: Scores(AcGiContext * pContext, TextParams const * pTextParams, LineSegmentCallback pLineSegment, void * pAction); ~Scores () {}; void over_score (const wchar_t* text, int length); void under_score (const wchar_t * text, int length); void strikethrough_score(const wchar_t * text, int length); void close_scores (const wchar_t * text, int length); void draw_vector (AcGePoint3d const & p1, AcGePoint3d const & p2); }; void process_uc_string ( WCHAR * uc_string, int & uc_length, TextParams const * tp, BOOL draw_scores, LineSegmentCallback line_segment = NULL, void * action = NULL); void process_underoverline( const WCHAR * uc_string, int uc_length, TextParams const * tp, LineSegmentCallback line_segment, void * action = NULL); int convert_to_unicode( const char * pMultiByteString, int nMultiByteLength, WCHAR * pUnicodeString, int & nUnicodeLength, bool bInformUser); int convert_to_unicode( UINT iCharset, const char * pMultiByteString, int nMultiByteLength, WCHAR * pUnicodeString, int & nUnicodeLength, bool bInformUser); class TrueTypeUnicodeBuffer { public: TrueTypeUnicodeBuffer(LPCTSTR text, int length, bool raw, int charset) : m_bDynamicBuffer(false), m_bValid(true) { if (length < -1) { m_iLen = -length - 1; m_pBuffer = (LPWSTR)text; return; } if (length != -1) m_iLen = length; else { const size_t nLen = ::wcslen(text); #ifdef ASSERT #define TrueTypeText_Assert ASSERT #elif defined(assert) #define TrueTypeText_Assert assert #elif defined(_ASSERTE) #define TrueTypeText_Assert _ASSERTE #else #define TrueTypeText_Assert(x) #endif TrueTypeText_Assert(nLen < 0x7FFFFFFE); // 2G-1 sanity check TrueTypeText_Assert(nLen == (int)nLen); // 64-bit portability m_iLen = (int)nLen; } if (!raw) { // only need temporary string if converting %% sequences size_t nSize; if (m_iLen + 1 > m_kBufferLen) { m_bDynamicBuffer = true; m_pBuffer = new WCHAR [m_iLen + 1]; nSize = m_iLen + 1; if (!m_pBuffer) { m_bValid = false; return; } } else { m_pBuffer = m_sBuffer; nSize = m_kBufferLen; } _tcsncpy_s(m_pBuffer, nSize, text, m_iLen); m_pBuffer[m_iLen] = 0; } else { // It is okay to cast away constness here -- we only call process_underoverline // which takes a const pointer m_pBuffer = const_cast<wchar_t *>(text); } } ~TrueTypeUnicodeBuffer() { if (m_bDynamicBuffer) delete [] m_pBuffer; } LPWSTR buf() const { return m_pBuffer; } int len() const { return m_iLen; } bool valid() const { return m_bValid; } private: static const int m_kBufferLen = 256; bool m_bValid; LPWSTR m_pBuffer; int m_iLen; bool m_bDynamicBuffer; WCHAR m_sBuffer[m_kBufferLen]; }; #endif // _TRUETYPETEXT_H_
kevinzhwl/ObjectARXCore
2015/inc/truetypetext.h
C
mit
5,684
using System; using System.Collections.Generic; using System.Linq; using System.Text; using ASPPatterns.Chap7.Library.Services.Views; namespace ASPPatterns.Chap7.Library.Services.Messages { public class FindMembersResponse : ResponseBase { public IEnumerable<MemberView> MembersFound { get; set; } } }
liqipeng/helloGithub
Book-Code/ASP.NET Design Pattern/ASPPatternsc07/ASPPatterns.Chap7.Library/ASPPatterns.Chap7.Library.Services/Messages/FindMembersResponse.cs
C#
mit
327
let _ = require('underscore'), React = require('react'); class Icon extends React.Component { render() { let className = "icon " + this.props.icon; let other = _.omit(this.props.icon, "icon"); return ( <span className={className} role="img" {...other}></span> ); } } Icon.propTypes = { icon: React.PropTypes.string.isRequired }; module.exports = Icon;
legendary-code/chaos-studio-web
app/src/js/components/Icon.js
JavaScript
mit
433
using System.IO; namespace Mandro.Utils.Setup { public class DirectoryHelper { public DirectoryHelper() { } public static void CopyDirectory(string sourceDirName, string destDirName, bool copySubDirs) { // Get the subdirectories for the specified directory. DirectoryInfo dir = new DirectoryInfo(sourceDirName); DirectoryInfo[] dirs = dir.GetDirectories(); if (!dir.Exists) { throw new DirectoryNotFoundException( "Source directory does not exist or could not be found: " + sourceDirName); } // If the destination directory doesn't exist, create it. if (!Directory.Exists(destDirName)) { Directory.CreateDirectory(destDirName); } // Get the files in the directory and copy them to the new location. FileInfo[] files = dir.GetFiles(); foreach (FileInfo file in files) { string temppath = Path.Combine(destDirName, file.Name); file.CopyTo(temppath, true); } // If copying subdirectories, copy them and their contents to new location. if (copySubDirs) { foreach (DirectoryInfo subdir in dirs) { string temppath = Path.Combine(destDirName, subdir.Name); CopyDirectory(subdir.FullName, temppath, copySubDirs); } } } } }
mandrek44/Mandro.Utils
Mandro.Utils/Setup/DirectoryHelper.cs
C#
mit
1,605
import { NotificationType } from 'vscode-languageclient' export enum Status { ok = 1, warn = 2, error = 3 } export interface StatusParams { state: Status } export const type = new NotificationType<StatusParams>('standard/status')
chenxsan/vscode-standardjs
client/src/utils/StatusNotification.ts
TypeScript
mit
241
import React from 'react'; import IconBase from './../components/IconBase/IconBase'; export default class ChevronDown extends React.Component { render() { if(this.props.bare) { return <g> <path d="M256,298.3L256,298.3L256,298.3l174.2-167.2c4.3-4.2,11.4-4.1,15.8,0.2l30.6,29.9c4.4,4.3,4.5,11.3,0.2,15.5L264.1,380.9 c-2.2,2.2-5.2,3.2-8.1,3c-3,0.1-5.9-0.9-8.1-3L35.2,176.7c-4.3-4.2-4.2-11.2,0.2-15.5L66,131.3c4.4-4.3,11.5-4.4,15.8-0.2L256,298.3 z"></path> </g>; } return <IconBase> <path d="M256,298.3L256,298.3L256,298.3l174.2-167.2c4.3-4.2,11.4-4.1,15.8,0.2l30.6,29.9c4.4,4.3,4.5,11.3,0.2,15.5L264.1,380.9 c-2.2,2.2-5.2,3.2-8.1,3c-3,0.1-5.9-0.9-8.1-3L35.2,176.7c-4.3-4.2-4.2-11.2,0.2-15.5L66,131.3c4.4-4.3,11.5-4.4,15.8-0.2L256,298.3 z"></path> </IconBase>; } };ChevronDown.defaultProps = {bare: false}
fbfeix/react-icons
src/icons/ChevronDown.js
JavaScript
mit
819
const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin'); const HtmlWebpackPlugin = require('html-webpack-plugin'); const WatchMissingNodeModulesPlugin = require('react-dev-utils/WatchMissingNodeModulesPlugin'); const webpack = require('webpack'); const paths = require('./tools/paths'); const env = { 'process.env.NODE_ENV': JSON.stringify('development') }; module.exports = { devtool: 'cheap-module-eval-source-map', entry: [ require.resolve('./tools/polyfills'), 'webpack-dev-server/client?http://localhost:3000', 'webpack/hot/only-dev-server', 'react-hot-loader/patch', './src/index' ], output: { filename: 'static/js/bundle.js', path: paths.appDist, pathinfo: true, publicPath: '/' }, module: { rules: [ // Default loader: load all assets that are not handled // by other loaders with the url loader. // Note: This list needs to be updated with every change of extensions // the other loaders match. // E.g., when adding a loader for a new supported file extension, // we need to add the supported extension to this loader too. // Add one new line in `exclude` for each loader. // // "file" loader makes sure those assets get served by WebpackDevServer. // When you `import` an asset, you get its (virtual) filename. // In production, they would get copied to the `dist` folder. // "url" loader works like "file" loader except that it embeds assets // smaller than specified limit in bytes as data URLs to avoid requests. // A missing `test` is equivalent to a match. { exclude: [ /\.html$/, /\.js$/, /\.scss$/, /\.json$/, /\.svg$/, /node_modules/ ], use: [{ loader: 'url-loader', options: { limit: 10000, name: 'static/media/[name].[hash:8].[ext]' } }] }, { test: /\.js$/, enforce: 'pre', include: paths.appSrc, use: [{ loader: 'xo-loader', options: { // This loader must ALWAYS return warnings during development. If // errors are emitted, no changes will be pushed to the browser for // testing until the errors have been resolved. emitWarning: true } }] }, { test: /\.js$/, include: paths.appSrc, use: [{ loader: 'babel-loader', options: { // This is a feature of `babel-loader` for webpack (not Babel itself). // It enables caching results in ./node_modules/.cache/babel-loader/ // directory for faster rebuilds. cacheDirectory: true } }] }, { test: /\.scss$/, use: [ 'style-loader', { loader: 'css-loader', options: { importLoaders: 2 } }, 'postcss-loader', 'sass-loader' ] }, { test: /\.svg$/, use: [{ loader: 'file-loader', options: { name: 'static/media/[name].[hash:8].[ext]' } }] } ] }, plugins: [ new HtmlWebpackPlugin({ inject: true, template: paths.appHtml }), new webpack.DefinePlugin(env), new webpack.HotModuleReplacementPlugin(), new webpack.NoEmitOnErrorsPlugin(), // Watcher doesn't work well if you mistype casing in a path so we use // a plugin that prints an error when you attempt to do this. // See https://github.com/facebookincubator/create-react-app/issues/240 new CaseSensitivePathsPlugin(), // If you require a missing module and then `npm install` it, you still have // to restart the development server for Webpack to discover it. This plugin // makes the discovery automatic so you don't have to restart. // See https://github.com/facebookincubator/create-react-app/issues/186 new WatchMissingNodeModulesPlugin(paths.appNodeModules) ], // Some libraries import Node modules but don't use them in the browser. // Tell Webpack to provide empty mocks for them so importing them works. node: { fs: 'empty', net: 'empty', tls: 'empty' } };
hn3etta/VS2015-React-Redux-Webpack-Front-end-example
webpack.config.js
JavaScript
mit
3,928
// // SA_DiceEvaluator.h // // Copyright (c) 2016 Said Achmiz. // // This software is licensed under the MIT license. // See the file "LICENSE" for more information. #import <Foundation/Foundation.h> @class SA_DiceBag; @class SA_DiceExpression; /************************************************/ #pragma mark SA_DiceEvaluator class declaration /************************************************/ @interface SA_DiceEvaluator : NSObject /************************/ #pragma mark - Properties /************************/ @property NSUInteger maxDieCount; @property NSUInteger maxDieSize; /****************************/ #pragma mark - Public methods /****************************/ -(SA_DiceExpression *) resultOfExpression:(SA_DiceExpression *)expression; @end
achmizs/SA_Dice
SA_DiceEvaluator.h
C
mit
763
<?php namespace BackOfficeBundle\Entity; use Doctrine\ORM\EntityRepository; /** * PosteCollaborateurRepository * * This class was generated by the Doctrine ORM. Add your own custom * repository methods below. */ class PosteCollaborateurRepository extends EntityRepository { }
elmabdgrub/azplatform
src/BackOfficeBundle/Entity/PosteCollaborateurRepository.php
PHP
mit
284
/* database.h Author: Pixel Flash Server database.h contains the class definition for the database class used by the cuCare server to store data persistently */ #ifndef DATABASE_H #define DATABASE_H #include <QtSql> #include <QDebug> class Database { public: Database(); ~Database(); QSqlQuery query(QString query_string); void close(); bool opened(); private: QSqlDatabase db; }; #endif // DATABASE_H
jmehic/cuCare
server/database.h
C
mit
438
// ========================================================================== // snd_app // ========================================================================== // Copyright (c) 2006-2012, Knut Reinert, FU Berlin // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of Knut Reinert or the FU Berlin nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE // ARE DISCLAIMED. IN NO EVENT SHALL KNUT REINERT OR THE FU BERLIN BE LIABLE // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH // DAMAGE. // // ========================================================================== // Author: Your Name <your.email@example.net> // ========================================================================== #include <seqan/basic.h> #include <seqan/sequence.h> #include <seqan/arg_parse.h> // ========================================================================== // Classes // ========================================================================== // -------------------------------------------------------------------------- // Class AppOptions // -------------------------------------------------------------------------- // This struct stores the options from the command line. // // You might want to rename this to reflect the name of your app. struct AppOptions { // Verbosity level. 0 -- quiet, 1 -- normal, 2 -- verbose, 3 -- very verbose. int verbosity; // The first (and only) argument of the program is stored here. seqan::CharString text; AppOptions() : verbosity(1) {} }; // ========================================================================== // Functions // ========================================================================== // -------------------------------------------------------------------------- // Function parseCommandLine() // -------------------------------------------------------------------------- seqan::ArgumentParser::ParseResult parseCommandLine(AppOptions & options, int argc, char const ** argv) { // Setup ArgumentParser. seqan::ArgumentParser parser("snd_app"); // Set short description, version, and date. setShortDescription(parser, "Put a Short Description Here"); setVersion(parser, "0.1"); setDate(parser, "July 2012"); // Define usage line and long description. addUsageLine(parser, "[\\fIOPTIONS\\fP] \"\\fITEXT\\fP\""); addDescription(parser, "This is the application skelleton and you should modify this string."); // We require one argument. addArgument(parser, seqan::ArgParseArgument(seqan::ArgParseArgument::STRING, "TEXT")); addOption(parser, seqan::ArgParseOption("q", "quiet", "Set verbosity to a minimum.")); addOption(parser, seqan::ArgParseOption("v", "verbose", "Enable verbose output.")); addOption(parser, seqan::ArgParseOption("vv", "very-verbose", "Enable very verbose output.")); // Add Examples Section. addTextSection(parser, "Examples"); addListItem(parser, "\\fBsnd_app\\fP \\fB-v\\fP \\fItext\\fP", "Call with \\fITEXT\\fP set to \"text\" with verbose output."); // Parse command line. seqan::ArgumentParser::ParseResult res = seqan::parse(parser, argc, argv); // Only extract options if the program will continue after parseCommandLine() if (res != seqan::ArgumentParser::PARSE_OK) return res; // Extract option values. if (isSet(parser, "quiet")) options.verbosity = 0; if (isSet(parser, "verbose")) options.verbosity = 2; if (isSet(parser, "very-verbose")) options.verbosity = 3; seqan::getArgumentValue(options.text, parser, 0); return seqan::ArgumentParser::PARSE_OK; } // -------------------------------------------------------------------------- // Function main() // -------------------------------------------------------------------------- // Program entry point. int main(int argc, char const ** argv) { // Parse the command line. seqan::ArgumentParser parser; AppOptions options; seqan::ArgumentParser::ParseResult res = parseCommandLine(options, argc, argv); // If there was an error parsing or built-in argument parser functionality // was triggered then we exit the program. The return code is 1 if there // were errors and 0 if there were none. if (res != seqan::ArgumentParser::PARSE_OK) return res == seqan::ArgumentParser::PARSE_ERROR; std::cout << "EXAMPLE PROGRAM\n" << "===============\n\n"; // Print the command line arguments back to the user. if (options.verbosity > 0) { std::cout << "__OPTIONS____________________________________________________________________\n" << '\n' << "VERBOSITY\t" << options.verbosity << '\n' << "TEXT \t" << options.text << "\n\n"; } return 0; }
bkahlert/seqan-research
raw/pmsb13/pmsb13-data-20130530/sources/130wu1dgzoqmxyu2/2013-04-09T10-23-18.897+0200/sandbox/my_sandbox/apps/snd_app/snd_app.cpp
C++
mit
6,165
% % Primera página del documento \begin{titlepage} \begin{scriptsize}\noindent Facultad de Informática.\\ Ingeniería en Informática.\\ Ingeniería del Software.\\ Proyecto: Everywhere House Control. \end{scriptsize}\\ \vfill \begin{center} \begin{Large} \textbf{Documento de análisis} \end{Large} \end{center} \vfill \begin{flushright} \begin{scriptsize} \begin{tabular}{lll} Creado por & Gutierrez, Hector & Guzman, Fernando\\ & Ladrón, Alejandro & Maldonado, Miguel Alexander\\ & Morales, Álvaro & Ochoa, Victor\\ & Rey, José Antonio & Saavendra, Luis Antonio\\ & Tirado, Colin & Vicente, Victor\\ \end{tabular} \end{scriptsize} \end{flushright} \end{titlepage} \thispagestyle{empty} \cleardoublepage \newpage % % Tabla de contenidos, etc. \pagenumbering{Roman} \tableofcontents \newpage \thispagestyle{empty} \cleardoublepage \newpage \pagenumbering{arabic} \raggedbottom \interfootnotelinepenalty 10000 \input{3.Analisis/ERS.tex} % % % % % % Fin del cuerpo
EverywhereHouseControl/Documentation
3.Analisis/Analisis.tex
TeX
mit
1,176
<?php /** * @file * Contains \Drupal\shortcut\ShortcutSetStorageControllerInterface. */ namespace Drupal\shortcut; use Drupal\Core\Entity\EntityStorageControllerInterface; use Drupal\shortcut\ShortcutSetInterface; /** * Defines a common interface for shortcut entity controller classes. */ interface ShortcutSetStorageControllerInterface extends EntityStorageControllerInterface { /** * Assigns a user to a particular shortcut set. * * @param \Drupal\shortcut\ShortcutSetInterface $shortcut_set * An object representing the shortcut set. * @param $account * A user account that will be assigned to use the set. */ public function assignUser(ShortcutSetInterface $shortcut_set, $account); /** * Unassigns a user from any shortcut set they may have been assigned to. * * The user will go back to using whatever default set applies. * * @param $account * A user account that will be removed from the shortcut set assignment. * * @return bool * TRUE if the user was previously assigned to a shortcut set and has been * successfully removed from it. FALSE if the user was already not assigned * to any set. */ public function unassignUser($account); /** * Delete shortcut sets assigned to users. * * @param \Drupal\shortcut\ShortcutSetInterface $entity * Delete the user assigned sets belonging to this shortcut. */ public function deleteAssignedShortcutSets(ShortcutSetInterface $entity); /** * Get the name of the set assigned to this user. * * @param \Drupal\user\Plugin\Core\Entity\User * The user account. * * @return string * The name of the shortcut set assigned to this user. */ public function getAssignedToUser($account); /** * Get the number of users who have this set assigned to them. * * @param \Drupal\shortcut\ShortcutSetInterface $shortcut_set * The shortcut to count the users assigned to. * * @return int * The number of users who have this set assigned to them. */ public function countAssignedUsers(ShortcutSetInterface $shortcut_set); }
augustash/d8.dev
core/modules/shortcut/lib/Drupal/shortcut/ShortcutSetStorageControllerInterface.php
PHP
mit
2,130
using System; using System.Collections.Generic; using System.Reactive.Linq; using System.Reactive.Threading.Tasks; using MS.Core; namespace System.Runtime.Remoting.Contexts { public static class __ContextAttribute { public static IObservable<System.Boolean> IsNewContextOK( this IObservable<System.Runtime.Remoting.Contexts.ContextAttribute> ContextAttributeValue, IObservable<System.Runtime.Remoting.Contexts.Context> newCtx) { return Observable.Zip(ContextAttributeValue, newCtx, (ContextAttributeValueLambda, newCtxLambda) => ContextAttributeValueLambda.IsNewContextOK(newCtxLambda)); } public static IObservable<System.Reactive.Unit> Freeze( this IObservable<System.Runtime.Remoting.Contexts.ContextAttribute> ContextAttributeValue, IObservable<System.Runtime.Remoting.Contexts.Context> newContext) { return ObservableExt.ZipExecute(ContextAttributeValue, newContext, (ContextAttributeValueLambda, newContextLambda) => ContextAttributeValueLambda.Freeze(newContextLambda)); } public static IObservable<System.Boolean> Equals( this IObservable<System.Runtime.Remoting.Contexts.ContextAttribute> ContextAttributeValue, IObservable<System.Object> o) { return Observable.Zip(ContextAttributeValue, o, (ContextAttributeValueLambda, oLambda) => ContextAttributeValueLambda.Equals(oLambda)); } public static IObservable<System.Int32> GetHashCode( this IObservable<System.Runtime.Remoting.Contexts.ContextAttribute> ContextAttributeValue) { return Observable.Select(ContextAttributeValue, (ContextAttributeValueLambda) => ContextAttributeValueLambda.GetHashCode()); } public static IObservable<System.Boolean> IsContextOK( this IObservable<System.Runtime.Remoting.Contexts.ContextAttribute> ContextAttributeValue, IObservable<System.Runtime.Remoting.Contexts.Context> ctx, IObservable<System.Runtime.Remoting.Activation.IConstructionCallMessage> ctorMsg) { return Observable.Zip(ContextAttributeValue, ctx, ctorMsg, (ContextAttributeValueLambda, ctxLambda, ctorMsgLambda) => ContextAttributeValueLambda.IsContextOK(ctxLambda, ctorMsgLambda)); } public static IObservable<System.Reactive.Unit> GetPropertiesForNewContext( this IObservable<System.Runtime.Remoting.Contexts.ContextAttribute> ContextAttributeValue, IObservable<System.Runtime.Remoting.Activation.IConstructionCallMessage> ctorMsg) { return ObservableExt.ZipExecute(ContextAttributeValue, ctorMsg, (ContextAttributeValueLambda, ctorMsgLambda) => ContextAttributeValueLambda.GetPropertiesForNewContext(ctorMsgLambda)); } public static IObservable<System.String> get_Name( this IObservable<System.Runtime.Remoting.Contexts.ContextAttribute> ContextAttributeValue) { return Observable.Select(ContextAttributeValue, (ContextAttributeValueLambda) => ContextAttributeValueLambda.Name); } } }
RixianOpenTech/RxWrappers
Source/Wrappers/mscorlib/System.Runtime.Remoting.Contexts.ContextAttribute.cs
C#
mit
3,328
# -*- coding: utf-8 -*- # # Copyright (C) 2008 John Paulett (john -at- paulett.org) # Copyright (C) 2009, 2011, 2013 David Aguilar (davvid -at- gmail.com) # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. """Python library for serializing any arbitrary object graph into JSON. jsonpickle can take almost any Python object and turn the object into JSON. Additionally, it can reconstitute the object back into Python. The object must be accessible globally via a module and must inherit from object (AKA new-style classes). Create an object:: class Thing(object): def __init__(self, name): self.name = name obj = Thing('Awesome') Use jsonpickle to transform the object into a JSON string:: import jsonpickle frozen = jsonpickle.encode(obj) Use jsonpickle to recreate a Python object from a JSON string:: thawed = jsonpickle.decode(frozen) .. warning:: Loading a JSON string from an untrusted source represents a potential security vulnerability. jsonpickle makes no attempt to sanitize the input. The new object has the same type and data, but essentially is now a copy of the original. .. code-block:: python assert obj.name == thawed.name If you will never need to load (regenerate the Python class from JSON), you can pass in the keyword unpicklable=False to prevent extra information from being added to JSON:: oneway = jsonpickle.encode(obj, unpicklable=False) result = jsonpickle.decode(oneway) assert obj.name == result['name'] == 'Awesome' """ import sys, os from music21 import common sys.path.append(common.getSourceFilePath() + os.path.sep + 'ext') from jsonpickle import pickler from jsonpickle import unpickler from jsonpickle.backend import JSONBackend from jsonpickle.version import VERSION # ensure built-in handlers are loaded __import__('jsonpickle.handlers') __all__ = ('encode', 'decode') __version__ = VERSION json = JSONBackend() # Export specific JSONPluginMgr methods into the jsonpickle namespace set_preferred_backend = json.set_preferred_backend set_encoder_options = json.set_encoder_options load_backend = json.load_backend remove_backend = json.remove_backend enable_fallthrough = json.enable_fallthrough def encode(value, unpicklable=True, make_refs=True, keys=False, max_depth=None, backend=None, warn=False, max_iter=None): """Return a JSON formatted representation of value, a Python object. :param unpicklable: If set to False then the output will not contain the information necessary to turn the JSON data back into Python objects, but a simpler JSON stream is produced. :param max_depth: If set to a non-negative integer then jsonpickle will not recurse deeper than 'max_depth' steps into the object. Anything deeper than 'max_depth' is represented using a Python repr() of the object. :param make_refs: If set to False jsonpickle's referencing support is disabled. Objects that are id()-identical won't be preserved across encode()/decode(), but the resulting JSON stream will be conceptually simpler. jsonpickle detects cyclical objects and will break the cycle by calling repr() instead of recursing when make_refs is set False. :param keys: If set to True then jsonpickle will encode non-string dictionary keys instead of coercing them into strings via `repr()`. :param warn: If set to True then jsonpickle will warn when it returns None for an object which it cannot pickle (e.g. file descriptors). :param max_iter: If set to a non-negative integer then jsonpickle will consume at most `max_iter` items when pickling iterators. >>> encode('my string') '"my string"' >>> encode(36) '36' >>> encode({'foo': True}) '{"foo": true}' >>> encode({'foo': True}, max_depth=0) '"{\\'foo\\': True}"' >>> encode({'foo': True}, max_depth=1) '{"foo": "True"}' """ if backend is None: backend = json return pickler.encode(value, backend=backend, unpicklable=unpicklable, make_refs=make_refs, keys=keys, max_depth=max_depth, warn=warn) def decode(string, backend=None, keys=False): """Convert a JSON string into a Python object. The keyword argument 'keys' defaults to False. If set to True then jsonpickle will decode non-string dictionary keys into python objects via the jsonpickle protocol. >>> str(decode('"my string"')) 'my string' >>> decode('36') 36 """ if backend is None: backend = json return unpickler.decode(string, backend=backend, keys=keys) # json.load(),loads(), dump(), dumps() compatibility dumps = encode loads = decode
arnavd96/Cinemiezer
myvenv/lib/python3.4/site-packages/music21/ext/jsonpickle/__init__.py
Python
mit
5,049
require 'spec_helper' describe "beings/show" do before(:each) do @being = FactoryGirl.create(:being) @being.randomize! end end
slabgorb/populinator-0
spec/views/beings/show.html.haml_spec.rb
Ruby
mit
142
import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Set; class ProteinTranslator { private static final Integer CODON_LENGTH = 3; private static final Map<String, String> CODON_TO_PROTEIN = Map.ofEntries( Map.entry("AUG", "Methionine"), Map.entry("UUU", "Phenylalanine"), Map.entry("UUC", "Phenylalanine"), Map.entry("UUA", "Leucine"), Map.entry("UUG", "Leucine"), Map.entry("UCU", "Serine"), Map.entry("UCC", "Serine"), Map.entry("UCA", "Serine"), Map.entry("UCG", "Serine"), Map.entry("UAU", "Tyrosine"), Map.entry("UAC", "Tyrosine"), Map.entry("UGU", "Cysteine"), Map.entry("UGC", "Cysteine"), Map.entry("UGG", "Tryptophan")); private static final Set<String> STOP_CODONS = Set.of("UAA", "UAG", "UGA"); public List<String> translate(final String rnaSequence) { final List<String> codons = splitIntoCodons(rnaSequence); List<String> proteins = new ArrayList<>(); for (String codon : codons) { if (STOP_CODONS.contains(codon)) { return proteins; } proteins.add(translateCodon(codon)); } ; return proteins; } private static List<String> splitIntoCodons(final String rnaSequence) { final List<String> codons = new ArrayList<>(); for (int i = 0; i < rnaSequence.length(); i += CODON_LENGTH) { codons.add(rnaSequence.substring(i, Math.min(rnaSequence.length(), i + CODON_LENGTH))); } return codons; } private static String translateCodon(final String codon) { return CODON_TO_PROTEIN.get(codon); } }
rootulp/exercism
java/protein-translation/src/main/java/ProteinTranslator.java
Java
mit
1,679
# -*- coding: utf-8 -*- """ Created on Wed Sep 09 13:04:53 2015 * If TimerTool.exe is running, kill the process. * If input parameter is given, start TimerTool and set clock resolution Starts TimerTool.exe and sets the clock resolution to argv[0] ms Ex: python set_clock_resolution 0.5 @author: marcus """ import time, datetime from socket import gethostname, gethostbyname import os import numpy as np def main(): my_path = os.path.join('C:',os.sep,'Share','sync_clocks') os.chdir(my_path) # Initial timestamps t1 = time.clock() t2 = time.time() t3 = datetime.datetime.now() td1 = [] td2 = [] td3 = [] for i in xrange(100): td1.append(time.clock()-t1) td2.append(time.time() -t2) td3.append((datetime.datetime.now()-t3).total_seconds()) time.sleep(0.001) # Create text file and write header t = datetime.datetime.now() ip = gethostbyname(gethostname()).split('.')[-1] f_name = '_'.join([ip,'test_clock_res',str(t.year),str(t.month),str(t.day), str(t.hour),str(t.minute),str(t.second)]) f = open(f_name+'.txt','w') f.write('%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n' % ('mean_clock','median_clock','sd_clock', 'mean_time','median_time','sd_time', 'mean_datetime','median_datetime','sd_datetime',)) # Write results to text file f.write('%.2f\t%.2f\t%.2f\t%.2f\t%.2f\t%.2f\t%.2f\t%.2f\t%.2f\n' % (np.mean(np.diff(td1))*1000, np.median(np.diff(td1))*1000,np.std(np.diff(td1))*1000, np.mean(np.diff(td2))*1000, np.median(np.diff(td2))*1000,np.std(np.diff(td2))*1000, np.mean(np.diff(td3))*1000, np.median(np.diff(td3))*1000,np.std(np.diff(td3))*1000)) f.close() if __name__ == "__main__": main()
marcus-nystrom/share-gaze
sync_clocks/test_clock_resolution.py
Python
mit
1,930
<?php use Illuminate\Database\Seeder; use jeremykenedy\LaravelRoles\Models\Permission; class PermissionsTableSeeder extends Seeder { /** * Run the database seeds. * * @return void */ public function run() { /* * Add Permissions * */ if (Permission::where('name', '=', 'Can View Users')->first() === null) { Permission::create([ 'name' => 'Can View Users', 'slug' => 'view.users', 'description' => 'Can view users', 'model' => 'Permission', ]); } if (Permission::where('name', '=', 'Can Create Users')->first() === null) { Permission::create([ 'name' => 'Can Create Users', 'slug' => 'create.users', 'description' => 'Can create new users', 'model' => 'Permission', ]); } if (Permission::where('name', '=', 'Can Edit Users')->first() === null) { Permission::create([ 'name' => 'Can Edit Users', 'slug' => 'edit.users', 'description' => 'Can edit users', 'model' => 'Permission', ]); } if (Permission::where('name', '=', 'Can Delete Users')->first() === null) { Permission::create([ 'name' => 'Can Delete Users', 'slug' => 'delete.users', 'description' => 'Can delete users', 'model' => 'Permission', ]); } if (Permission::where('name', '=', 'Super Admin Permissions')->first() === null) { Permission::create([ 'name' => 'Super Admin Permissions', 'slug' => 'perms.super-admin', 'description' => 'Has Super Admin Permissions', 'model' => 'Permission', ]); } if (Permission::where('name', '=', 'Admin Permissions')->first() === null) { Permission::create([ 'name' => 'Admin Permissions', 'slug' => 'perms.admin', 'description' => 'Has Admin Permissions', 'model' => 'Permission', ]); } if (Permission::where('name', '=', 'Moderator Permissions')->first() === null) { Permission::create([ 'name' => 'Moderator Permissions', 'slug' => 'perms.moderator', 'description' => 'Has Moderator Permissions', 'model' => 'Permission', ]); } if (Permission::where('name', '=', 'Writer Permissions')->first() === null) { Permission::create([ 'name' => 'Writer Permissions', 'slug' => 'perms.writer', 'description' => 'Has Writer Permissions', 'model' => 'Permission', ]); } if (Permission::where('name', '=', 'User Permissions')->first() === null) { Permission::create([ 'name' => 'User Permissions', 'slug' => 'perms.user', 'description' => 'Has User Permissions', 'model' => 'Permission', ]); } } }
jeremykenedy/larablog
database/seeds/PermissionsTableSeeder.php
PHP
mit
3,481
#------------------------------------------------------------------------------- # osx.cmake # Fips cmake settings file for OSX target platform. #------------------------------------------------------------------------------- set(FIPS_PLATFORM OSX) set(FIPS_PLATFORM_NAME "osx") set(FIPS_MACOS 1) set(FIPS_OSX 1) set(FIPS_POSIX 1) set(CMAKE_XCODE_GENERATE_SCHEME 1) # define configuration types set(CMAKE_CONFIGURATION_TYPES Debug Release) if (FIPS_OSX_UNIVERSAL) set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64") endif() # FIXME: define standard frame works that are always linked set(FIPS_OSX_STANDARD_FRAMEWORKS Foundation IOKit) # compiler flags set(CMAKE_CXX_FLAGS "-fstrict-aliasing -Wno-expansion-to-defined -Wno-multichar -Wall -Wextra -Wno-unknown-pragmas -Wno-ignored-qualifiers -Wno-long-long -Wno-overloaded-virtual -Wno-unused-volatile-lvalue -Wno-deprecated-writable-strings") set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG") set(CMAKE_CXX_FLAGS_DEBUG "-O0 -D_DEBUG_ -D_DEBUG -DFIPS_DEBUG=1 -ggdb") set(CMAKE_C_FLAGS "-fstrict-aliasing -Wno-multichar -Wall -Wextra -Wno-expansion-to-defined -Wno-unknown-pragmas -Wno-ignored-qualifiers -Wno-long-long -Wno-overloaded-virtual -Wno-unused-volatile-lvalue -Wno-deprecated-writable-strings") set(CMAKE_C_FLAGS_RELEASE "-O3 -DNDEBUG") set(CMAKE_C_FLAGS_DEBUG "-O0 -D_DEBUG_ -D_DEBUG -DFIPS_DEBUG=1 -g") set(CMAKE_EXE_LINKER_FLAGS "-ObjC -dead_strip -lpthread") set(CMAKE_EXE_LINKER_FLAGS_DEBUG "") set(CMAKE_EXE_LINKER_FLAGS_RELEASE "") # need to set some flags directly as Xcode attributes set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++14") set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++") # stack-checking? enabling this leads may generate binaries # that are not backward compatible to older macOS versions option(FIPS_OSX_USE_STACK_CHECKING "Enable/disable stack checking" OFF) if (FIPS_OSX_USE_STACK_CHECKING) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstack-check") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstack-check") else() set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-stack-check") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-stack-check") endif() # ARC on/off? option(FIPS_OSX_USE_ARC "Enable/disable Automatic Reference Counting" OFF) if (FIPS_OSX_USE_ARC) set(CMAKE_XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC "YES") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fobjc-arc") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fobjc-arc") else() set(CMAKE_XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC "NO") endif() # exceptions on/off? if (FIPS_EXCEPTIONS) set(CMAKE_XCODE_ATTRIBUTE_GCC_ENABLE_CPP_EXCEPTIONS "YES") else() set(CMAKE_XCODE_ATTRIBUTE_GCC_ENABLE_CPP_EXCEPTIONS "NO") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions") endif() # rtti on/off? if (FIPS_RTTI) set(CMAKE_XCODE_ATTRIBUTE_GCC_ENABLE_CPP_RTTI "YES") else() set(CMAKE_XCODE_ATTRIBUTE_GCC_ENABLE_CPP_RTTI "NO") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti") endif() # clang address sanitizer? if (FIPS_CLANG_ADDRESS_SANITIZER) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address") endif() # clang 'save-optimization-record'? if (FIPS_CLANG_SAVE_OPTIMIZATION_RECORD) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsave-optimization-record") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsave-optimization-record") endif() # update cache variables for cmake gui set(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE STRING "Config Type" FORCE) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" CACHE STRING "Generic C++ Compiler Flags" FORCE) set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}" CACHE STRING "C++ Debug Compiler Flags" FORCE) set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}" CACHE STRING "C++ Release Compiler Flags" FORCE) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}" CACHE STRING "Generic C Compiler Flags" FORCE) set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}" CACHE STRING "C Debug Compiler Flags" FORCE) set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}" CACHE STRING "C Release Compiler Flags" FORCE) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}" CACHE STRING "Generic Linker Flags" FORCE) set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG}" CACHE STRING "Debug Linker Flags" FORCE) set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}" CACHE STRING "Release Linker Flags" FORCE) # set the build type to use if (NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Compile Type" FORCE) endif() set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS Debug Release)
floooh/fips
cmake-toolchains/osx.cmake
CMake
mit
4,722
# MpiSyncManager Aplikasi Mpi Sync Manager
trogalko/MpiSyncManager
README.md
Markdown
mit
43
using System; using System.Collections.Generic; using System.Linq; using Microsoft.Xna.Framework; namespace TrueSync.Physics2D { // Original Code by Steven Lu - see http://www.box2d.org/forum/viewtopic.php?f=3&t=1688 // Ported to Farseer 3.0 by Nicolás Hormazábal internal struct ShapeData { public Body Body; public FP Max; public FP Min; // absolute angles } /// <summary> /// This is a comprarer used for /// detecting angle difference between rays /// </summary> internal class RayDataComparer : IComparer<FP> { #region IComparer<FP> Members int IComparer<FP>.Compare(FP a, FP b) { FP diff = (a - b); if (diff > 0) return 1; if (diff < 0) return -1; return 0; } #endregion } /* Methodology: * Force applied at a ray is inversely proportional to the square of distance from source * AABB is used to query for shapes that may be affected * For each RIGID BODY (not shape -- this is an optimization) that is matched, loop through its vertices to determine * the extreme points -- if there is structure that contains outlining polygon, use that as an additional optimization * Evenly cast a number of rays against the shape - number roughly proportional to the arc coverage * - Something like every 3 degrees should do the trick although this can be altered depending on the distance (if really close don't need such a high density of rays) * - There should be a minimum number of rays (3-5?) applied to each body so that small bodies far away are still accurately modeled * - Be sure to have the forces of each ray be proportional to the average arc length covered by each. * For each ray that actually intersects with the shape (non intersections indicate something blocking the path of explosion): * - Apply the appropriate force dotted with the negative of the collision normal at the collision point * - Optionally apply linear interpolation between aforementioned Normal force and the original explosion force in the direction of ray to simulate "surface friction" of sorts */ /// <summary> /// Creates a realistic explosion based on raycasting. Objects in the open will be affected, but objects behind /// static bodies will not. A body that is half in cover, half in the open will get half the force applied to the end in /// the open. /// </summary> public sealed class RealExplosion : PhysicsLogic { /// <summary> /// Two degrees: maximum angle from edges to first ray tested /// </summary> private static readonly FP MaxEdgeOffset = FP.Pi / 90; /// <summary> /// Ratio of arc length to angle from edges to first ray tested. /// Defaults to 1/40. /// </summary> public FP EdgeRatio = 1.0f / 40.0f; /// <summary> /// Ignore Explosion if it happens inside a shape. /// Default value is false. /// </summary> public bool IgnoreWhenInsideShape = false; /// <summary> /// Max angle between rays (used when segment is large). /// Defaults to 15 degrees /// </summary> public FP MaxAngle = FP.Pi / 15; /// <summary> /// Maximum number of shapes involved in the explosion. /// Defaults to 100 /// </summary> public int MaxShapes = 100; /// <summary> /// How many rays per shape/body/segment. /// Defaults to 5 /// </summary> public int MinRays = 5; private List<ShapeData> _data = new List<ShapeData>(); private RayDataComparer _rdc; public RealExplosion(World world) : base(world, PhysicsLogicType.Explosion) { _rdc = new RayDataComparer(); _data = new List<ShapeData>(); } /// <summary> /// Activate the explosion at the specified position. /// </summary> /// <param name="pos">The position where the explosion happens </param> /// <param name="radius">The explosion radius </param> /// <param name="maxForce">The explosion force at the explosion point (then is inversely proportional to the square of the distance)</param> /// <returns>A list of bodies and the amount of force that was applied to them.</returns> public Dictionary<Fixture, TSVector2> Activate(TSVector2 pos, FP radius, FP maxForce) { AABB aabb; aabb.LowerBound = pos + new TSVector2(-radius, -radius); aabb.UpperBound = pos + new TSVector2(radius, radius); Fixture[] shapes = new Fixture[MaxShapes]; // More than 5 shapes in an explosion could be possible, but still strange. Fixture[] containedShapes = new Fixture[5]; bool exit = false; int shapeCount = 0; int containedShapeCount = 0; // Query the world for overlapping shapes. World.QueryAABB( fixture => { if (fixture.TestPoint(ref pos)) { if (IgnoreWhenInsideShape) { exit = true; return false; } containedShapes[containedShapeCount++] = fixture; } else { shapes[shapeCount++] = fixture; } // Continue the query. return true; }, ref aabb); if (exit) return new Dictionary<Fixture, TSVector2>(); Dictionary<Fixture, TSVector2> exploded = new Dictionary<Fixture, TSVector2>(shapeCount + containedShapeCount); // Per shape max/min angles for now. FP[] vals = new FP[shapeCount * 2]; int valIndex = 0; for (int i = 0; i < shapeCount; ++i) { PolygonShape ps; CircleShape cs = shapes[i].Shape as CircleShape; if (cs != null) { // We create a "diamond" approximation of the circle Vertices v = new Vertices(); TSVector2 vec = TSVector2.zero + new TSVector2(cs.Radius, 0); v.Add(vec); vec = TSVector2.zero + new TSVector2(0, cs.Radius); v.Add(vec); vec = TSVector2.zero + new TSVector2(-cs.Radius, cs.Radius); v.Add(vec); vec = TSVector2.zero + new TSVector2(0, -cs.Radius); v.Add(vec); ps = new PolygonShape(v, 0); } else ps = shapes[i].Shape as PolygonShape; if ((shapes[i].Body.BodyType == BodyType.Dynamic) && ps != null) { TSVector2 toCentroid = shapes[i].Body.GetWorldPoint(ps.MassData.Centroid) - pos; FP angleToCentroid = FP.Atan2(toCentroid.y, toCentroid.x); FP min = FP.MaxValue; FP max = FP.MinValue; FP minAbsolute = 0.0f; FP maxAbsolute = 0.0f; for (int j = 0; j < ps.Vertices.Count; ++j) { TSVector2 toVertex = (shapes[i].Body.GetWorldPoint(ps.Vertices[j]) - pos); FP newAngle = FP.Atan2(toVertex.y, toVertex.x); FP diff = (newAngle - angleToCentroid); diff = (diff - FP.Pi) % (2 * FP.Pi); // the minus pi is important. It means cutoff for going other direction is at 180 deg where it needs to be if (diff < 0.0f) diff += 2 * FP.Pi; // correction for not handling negs diff -= FP.Pi; if (FP.Abs(diff) > FP.Pi) continue; // Something's wrong, point not in shape but exists angle diff > 180 if (diff > max) { max = diff; maxAbsolute = newAngle; } if (diff < min) { min = diff; minAbsolute = newAngle; } } vals[valIndex] = minAbsolute; ++valIndex; vals[valIndex] = maxAbsolute; ++valIndex; } } Array.Sort(vals, 0, valIndex, _rdc); _data.Clear(); bool rayMissed = true; for (int i = 0; i < valIndex; ++i) { Fixture fixture = null; FP midpt; int iplus = (i == valIndex - 1 ? 0 : i + 1); if (vals[i] == vals[iplus]) continue; if (i == valIndex - 1) { // the single edgecase midpt = (vals[0] + FP.PiTimes2 + vals[i]); } else { midpt = (vals[i + 1] + vals[i]); } midpt = midpt / 2; TSVector2 p1 = pos; TSVector2 p2 = radius * new TSVector2(FP.Cos(midpt), FP.Sin(midpt)) + pos; // RaycastOne bool hitClosest = false; World.RayCast((f, p, n, fr) => { Body body = f.Body; if (!IsActiveOn(body)) return 0; hitClosest = true; fixture = f; return fr; }, p1, p2); //draws radius points if ((hitClosest) && (fixture.Body.BodyType == BodyType.Dynamic)) { if ((_data.Any()) && (_data.Last().Body == fixture.Body) && (!rayMissed)) { int laPos = _data.Count - 1; ShapeData la = _data[laPos]; la.Max = vals[iplus]; _data[laPos] = la; } else { // make new ShapeData d; d.Body = fixture.Body; d.Min = vals[i]; d.Max = vals[iplus]; _data.Add(d); } if ((_data.Count > 1) && (i == valIndex - 1) && (_data.Last().Body == _data.First().Body) && (_data.Last().Max == _data.First().Min)) { ShapeData fi = _data[0]; fi.Min = _data.Last().Min; _data.RemoveAt(_data.Count - 1); _data[0] = fi; while (_data.First().Min >= _data.First().Max) { fi.Min -= FP.PiTimes2; _data[0] = fi; } } int lastPos = _data.Count - 1; ShapeData last = _data[lastPos]; while ((_data.Count > 0) && (_data.Last().Min >= _data.Last().Max)) // just making sure min<max { last.Min = _data.Last().Min - FP.PiTimes2; _data[lastPos] = last; } rayMissed = false; } else { rayMissed = true; // raycast did not find a shape } } for (int i = 0; i < _data.Count; ++i) { if (!IsActiveOn(_data[i].Body)) continue; FP arclen = _data[i].Max - _data[i].Min; FP first = TSMath.Min(MaxEdgeOffset, EdgeRatio * arclen); int insertedRays = FP.Ceiling((((arclen - 2.0f * first) - (MinRays - 1) * MaxAngle) / MaxAngle)).AsInt(); if (insertedRays < 0) insertedRays = 0; FP offset = (arclen - first * 2.0f) / ((FP)MinRays + insertedRays - 1); //Note: This loop can go into infinite as it operates on FPs. //Added FPEquals with a large epsilon. for (FP j = _data[i].Min + first; j < _data[i].Max || MathUtils.FPEquals(j, _data[i].Max, 0.0001f); j += offset) { TSVector2 p1 = pos; TSVector2 p2 = pos + radius * new TSVector2(FP.Cos(j), FP.Sin(j)); TSVector2 hitpoint = TSVector2.zero; FP minlambda = FP.MaxValue; List<Fixture> fl = _data[i].Body.FixtureList; for (int x = 0; x < fl.Count; x++) { Fixture f = fl[x]; RayCastInput ri; ri.Point1 = p1; ri.Point2 = p2; ri.MaxFraction = 50f; RayCastOutput ro; if (f.RayCast(out ro, ref ri, 0)) { if (minlambda > ro.Fraction) { minlambda = ro.Fraction; hitpoint = ro.Fraction * p2 + (1 - ro.Fraction) * p1; } } // the force that is to be applied for this particular ray. // offset is angular coverage. lambda*length of segment is distance. FP impulse = (arclen / (MinRays + insertedRays)) * maxForce * 180.0f / FP.Pi * (1.0f - TrueSync.TSMath.Min(FP.One, minlambda)); // We Apply the impulse!!! TSVector2 vectImp = TSVector2.Dot(impulse * new TSVector2(FP.Cos(j), FP.Sin(j)), -ro.Normal) * new TSVector2(FP.Cos(j), FP.Sin(j)); _data[i].Body.ApplyLinearImpulse(ref vectImp, ref hitpoint); // We gather the fixtures for returning them if (exploded.ContainsKey(f)) exploded[f] += vectImp; else exploded.Add(f, vectImp); if (minlambda > 1.0f) hitpoint = p2; } } } // We check contained shapes for (int i = 0; i < containedShapeCount; ++i) { Fixture fix = containedShapes[i]; if (!IsActiveOn(fix.Body)) continue; FP impulse = MinRays * maxForce * 180.0f / FP.Pi; TSVector2 hitPoint; CircleShape circShape = fix.Shape as CircleShape; if (circShape != null) { hitPoint = fix.Body.GetWorldPoint(circShape.Position); } else { PolygonShape shape = fix.Shape as PolygonShape; hitPoint = fix.Body.GetWorldPoint(shape.MassData.Centroid); } TSVector2 vectImp = impulse * (hitPoint - pos); fix.Body.ApplyLinearImpulse(ref vectImp, ref hitPoint); if (!exploded.ContainsKey(fix)) exploded.Add(fix, vectImp); } return exploded; } } }
Xaer033/YellowSign
YellowSignUnity/Assets/ThirdParty/Networking/TrueSync/Physics/Farseer/Common/PhysicsLogic/RealExplosion.cs
C#
mit
16,308
<?php /* * This file is part of the Sonata project. * * (c) Thomas Rabaix <thomas.rabaix@sonata-project.org> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Sonata\MediaBundle\Tests\Validator; use Sonata\MediaBundle\Provider\Pool; use Sonata\MediaBundle\Validator\Constraints\ValidMediaFormat; use Sonata\MediaBundle\Validator\FormatValidator; class FormatValidatorTest extends \PHPUnit_Framework_TestCase { public function testValidate() { $pool = new Pool('defaultContext'); $pool->addContext('test', array(), array('format1' => array())); $gallery = $this->getMock('Sonata\MediaBundle\Model\GalleryInterface'); $gallery->expects($this->once())->method('getDefaultFormat')->will($this->returnValue('format1')); $gallery->expects($this->once())->method('getContext')->will($this->returnValue('test')); // Prefer the Symfony 2.5+ API if available if (class_exists('Symfony\Component\Validator\Context\ExecutionContext')) { $contextClass = 'Symfony\Component\Validator\Context\ExecutionContext'; } else { $contextClass = 'Symfony\Component\Validator\ExecutionContext'; } $context = $this->getMock($contextClass, array(), array(), '', false); $context->expects($this->never())->method('addViolation'); $validator = new FormatValidator($pool); $validator->initialize($context); $validator->validate($gallery, new ValidMediaFormat()); } public function testValidateWithValidContext() { $pool = new Pool('defaultContext'); $pool->addContext('test'); $gallery = $this->getMock('Sonata\MediaBundle\Model\GalleryInterface'); $gallery->expects($this->once())->method('getDefaultFormat')->will($this->returnValue('format1')); $gallery->expects($this->once())->method('getContext')->will($this->returnValue('test')); // Prefer the Symfony 2.5+ API if available if (class_exists('Symfony\Component\Validator\Context\ExecutionContext')) { $contextClass = 'Symfony\Component\Validator\Context\ExecutionContext'; } else { $contextClass = 'Symfony\Component\Validator\ExecutionContext'; } $context = $this->getMock($contextClass, array(), array(), '', false); $context->expects($this->once())->method('addViolation'); $validator = new FormatValidator($pool); $validator->initialize($context); $validator->validate($gallery, new ValidMediaFormat()); } }
DevKhater/YallaWebSite
vendor/sonata-project/media-bundle/Tests/Validator/FormatValidatorTest.php
PHP
mit
2,647
--- layout: page title: "2016Google校招笔试-Not So Random" subheadline: teaser: "今天参加宣讲会模拟面试的题目,来源Google APAC 2016 University Graduates Test Round E Problem C。Google开始校招了,而我还是这么弱鸡..." categories: - share - algorithm tags: - Algorithm header: no image: thumb: gallery-example-4-thumb.jpg title: gallery-example-4.jpg caption: Google 2016 ACPC University Graduates Test Round E最后排名,我想说的是老印真是厉害。 caption_url: https://code.google.com/codejam/contest/8264486/scoreboard# --- # 题目描述 有一个随机数字生成函数,对于一个输入X,有A/100的概率生成 ```X AND K```,有B/100的概率生成 ```X OR K``` ,有C/100的概率生成 ```X XOR K``` 。 0 ≤ X, K ≤ 10^9,0 ≤ A, B, C ≤ 100,A+B+C = 100。 现在假设有N个这样的随机数字生成函数,问最后输出数字的期望值。 # 思路 对于数字二进制下的每一位只有两种状态**0**或者**1**,同时每一位相互独立,所以可以分开考虑每一位,就算出经过N步之后每一位为1的概率,则最后的期望可以表示为:$ expect = \sum_{j=0}^{31} {p_j * (1 << j)} $ ,$p_j$表示经过N步随机数字生成函数后第j位为1的概率。 所以,有DP: 令dp[i][j][s]表示经过i步随机数字生成函数后第j位状态为s的概率,s = 0 / 1,有状态转移方程: ```If (k & (1 << j)) > 0 :``` ```dp[i][j][0] += dp[i-1][j][0] * a / 100``` ```dp[i][j][0] += dp[i-1][j][1] * c / 100``` ```dp[i][j][1] += dp[i-1][j][1] * a / 100``` ```dp[i][j][1] += dp[i-1][j][0] * b / 100``` ```dp[i][j][1] += dp[i-1][j][1] * b / 100``` ```dp[i][j][1] += dp[i-1][j][0] * c / 100``` ```Else :``` ```dp[i][j][0] += dp[i-1][j][0] * a / 100``` ```dp[i][j][0] += dp[i-1][j][1] * a / 100``` ```dp[i][j][0] += dp[i-1][j][0] * b / 100``` ```dp[i][j][0] += dp[i-1][j][0] * c / 100``` ```dp[i][j][1] += dp[i-1][j][1] * b / 100``` ```dp[i][j][1] += dp[i-1][j][1] * c / 100``` 初始化,则根据X的每一位0或者1,对dp[0][j][0]和dp[0][j][1]赋值1或者0。 # 代码 <pre class="brush: cpp; highlight: [23, 35] auto-links: true; collapse: true" id = "simpleblock"> #include <bits/stdc++.h> using namespace std; #define clr(x,c) memset(x, c, sizeof(x)) #define pb push_back #define mp make_pair #define pii pair<int, int> #define psi pair<string, int> #define inf 0x3f3f3f3f typedef long long lld; const int N = 111111; const int M = 31; // x & k >= 0, bit(31) = 0 double dp[N][M][2]; double solve() { double ret = 0.0; int n, x, k, a, b, c; cin >> n >> x >> k >> a >> b >> c; // init clr(dp, 0); for (int j = 0; j < M; ++j) { if ( x & (1 << j) ) { dp[0][j][0] = 0.0; dp[0][j][1] = 1.0; } else { dp[0][j][0] = 1.0; dp[0][j][1] = 0.0; } } // dp for (int j = 0; j < M; ++j) { for (int i = 1; i <= n; ++i) { if ( k & (1 << j) ) { dp[i][j][0] += dp[i-1][j][0] * a / 100; dp[i][j][0] += dp[i-1][j][1] * c / 100; dp[i][j][1] += dp[i-1][j][1] * a / 100; dp[i][j][1] += (dp[i-1][j][0] + dp[i-1][j][1]) * b / 100; dp[i][j][1] += dp[i-1][j][0] * c / 100; } else { dp[i][j][0] += (dp[i-1][j][0] + dp[i-1][j][1]) * a / 100; dp[i][j][0] += dp[i-1][j][0] * b / 100; dp[i][j][0] += dp[i-1][j][0] * c / 100; dp[i][j][1] += dp[i-1][j][1] * b / 100; dp[i][j][1] += dp[i-1][j][1] * c / 100; } } ret += dp[n][j][1] * (1 << j); } return ret; } int main () { freopen("F:/#test-data/in.txt", "r", stdin); freopen("F:/#test-data/out.txt", "w", stdout); ios::sync_with_stdio(false); cin.tie(0); cout << fixed << showpoint; int t; cin >> t; for (int cas = 1; cas <= t; ++cas) { cout << "Case #" << cas << ": "; cout << setprecision(9) << solve() << endl; } return 0; } </pre>
goudan-er/goudan-er.github.io
_posts/Algorithm/2016-05-09-Google-APAC-2016-RoundE-Problem-C.md
Markdown
mit
4,098
require "rails_helper" describe Linter::Shellcheck do it_behaves_like "a linter" do let(:lintable_files) { %w(foo.sh foo.zsh foo.bash) } let(:not_lintable_files) { %w(foo.js) } end describe "#file_review" do it "returns a saved and incomplete file review" do commit_file = build_commit_file(filename: "lib/a.sh") linter = build_linter result = linter.file_review(commit_file) expect(result).to be_persisted expect(result).not_to be_completed end it "schedules a review job" do build = build(:build, commit_sha: "foo", pull_request_number: 123) commit_file = build_commit_file(filename: "lib/a.sh") allow(LintersJob).to receive(:perform_async) linter = build_linter(build) linter.file_review(commit_file) expect(LintersJob).to have_received(:perform_async).with( filename: commit_file.filename, commit_sha: build.commit_sha, linter_name: "shellcheck", pull_request_number: build.pull_request_number, patch: commit_file.patch, content: commit_file.content, config: "--- {}\n", linter_version: nil, ) end end end
thoughtbot/hound
spec/models/linter/shellcheck_spec.rb
Ruby
mit
1,185
-- This query extracts dose+durations of neuromuscular blocking agents -- Note: we assume that injections will be filtered for carevue as they will have starttime = stopttime. -- Get drug administration data from CareVue and MetaVision -- metavision is simple and only requires one temporary table with drugmv as ( select icustay_id, orderid , rate as vaso_rate , amount as vaso_amount , starttime , endtime from inputevents_mv where itemid in ( 222062 -- Vecuronium (664 rows, 154 infusion rows) , 221555 -- Cisatracurium (9334 rows, 8970 infusion rows) ) and statusdescription != 'Rewritten' -- only valid orders and rate is not null -- only continuous infusions ) , drugcv1 as ( select icustay_id, charttime -- where clause below ensures all rows are instance of the drug , 1 as drug -- the 'stopped' column indicates if a drug has been disconnected , max(case when stopped in ('Stopped','D/C''d') then 1 else 0 end) as drug_stopped -- we only include continuous infusions, therefore expect a rate , max(case -- for "free form" entries (itemid >= 40000) rate is not available when itemid >= 40000 and amount is not null then 1 when itemid < 40000 and rate is not null then 1 else 0 end) as drug_null , max(case -- for "free form" entries (itemid >= 40000) rate is not available when itemid >= 40000 then coalesce(rate, amount) else rate end) as drug_rate , max(amount) as drug_amount from inputevents_cv where itemid in ( 30114 -- Cisatracurium (63994 rows) , 30138 -- Vecuronium (5160 rows) , 30113 -- Atracurium (1163 rows) -- Below rows are less frequent ad-hoc documentation, but worth including! , 42174 -- nimbex cc/hr (207 rows) , 42385 -- Cisatracurium gtt (156 rows) , 41916 -- NIMBEX inputevents_cv (136 rows) , 42100 -- cistatracurium (132 rows) , 42045 -- nimbex mcg/kg/min (78 rows) , 42246 -- CISATRICARIUM CC/HR (70 rows) , 42291 -- NIMBEX CC/HR (48 rows) , 42590 -- nimbex inputevents_cv (38 rows) , 42284 -- CISATRACURIUM DRIP (9 rows) , 45096 -- Vecuronium drip (2 rows) ) group by icustay_id, charttime UNION -- add data from chartevents select icustay_id, charttime -- where clause below ensures all rows are instance of the drug , 1 as drug -- the 'stopped' column indicates if a drug has been disconnected , max(case when stopped in ('Stopped','D/C''d') then 1 else 0 end) as drug_stopped , max(case when valuenum <= 10 then 0 else 1 end) as drug_null -- educated guess! , max(case when valuenum <= 10 then valuenum else null end) as drug_rate , max(case when valuenum > 10 then valuenum else null end) as drug_amount from chartevents where itemid in ( 1856 -- Vecuronium mcg/min (8 rows) , 2164 -- NIMBEX MG/KG/HR (243 rows) , 2548 -- nimbex mg/kg/hr (103 rows) , 2285 -- nimbex mcg/kg/min (85 rows) , 2290 -- nimbex mcg/kg/m (32 rows) , 2670 -- nimbex (38 rows) , 2546 -- CISATRACURIUMMG/KG/H (7 rows) , 1098 -- cisatracurium mg/kg (36 rows) , 2390 -- cisatracurium mg/hr (15 rows) , 2511 -- CISATRACURIUM GTT (4 rows) , 1028 -- Cisatracurium (208 rows) , 1858 -- cisatracurium (351 rows) ) group by icustay_id, charttime ) , drugcv2 as ( select v.* , sum(drug_null) over (partition by icustay_id order by charttime) as drug_partition from drugcv1 v ) , drugcv3 as ( select v.* , first_value(drug_rate) over (partition by icustay_id, drug_partition order by charttime) as drug_prevrate_ifnull from drugcv2 v ) , drugcv4 as ( select icustay_id , charttime -- , (CHARTTIME - (LAG(CHARTTIME, 1) OVER (partition by icustay_id, drug order by charttime))) AS delta , drug , drug_rate , drug_amount , drug_stopped , drug_prevrate_ifnull -- We define start time here , case when drug = 0 then null -- if this is the first instance of the drug when drug_rate > 0 and LAG(drug_prevrate_ifnull,1) OVER ( partition by icustay_id, drug, drug_null order by charttime ) is null then 1 -- you often get a string of 0s -- we decide not to set these as 1, just because it makes drugnum sequential when drug_rate = 0 and LAG(drug_prevrate_ifnull,1) OVER ( partition by icustay_id, drug order by charttime ) = 0 then 0 -- sometimes you get a string of NULL, associated with 0 volumes -- same reason as before, we decide not to set these as 1 -- drug_prevrate_ifnull is equal to the previous value *iff* the current value is null when drug_prevrate_ifnull = 0 and LAG(drug_prevrate_ifnull,1) OVER ( partition by icustay_id, drug order by charttime ) = 0 then 0 -- If the last recorded rate was 0, newdrug = 1 when LAG(drug_prevrate_ifnull,1) OVER ( partition by icustay_id, drug order by charttime ) = 0 then 1 -- If the last recorded drug was D/C'd, newdrug = 1 when LAG(drug_stopped,1) OVER ( partition by icustay_id, drug order by charttime ) = 1 then 1 when (CHARTTIME - (LAG(CHARTTIME, 1) OVER (partition by icustay_id, drug order by charttime))) > (interval '8 hours') then 1 else null end as drug_start FROM drugcv3 ) -- propagate start/stop flags forward in time , drugcv5 as ( select v.* , SUM(drug_start) OVER (partition by icustay_id, drug order by charttime) as drug_first FROM drugcv4 v ) , drugcv6 as ( select v.* -- We define end time here , case when drug = 0 then null -- If the recorded drug was D/C'd, this is an end time when drug_stopped = 1 then drug_first -- If the rate is zero, this is the end time when drug_rate = 0 then drug_first -- the last row in the table is always a potential end time -- this captures patients who die/are discharged while on drug -- in principle, this could add an extra end time for the drug -- however, since we later group on drug_start, any extra end times are ignored when LEAD(CHARTTIME,1) OVER ( partition by icustay_id, drug order by charttime ) is null then drug_first else null end as drug_stop from drugcv5 v ) -- -- if you want to look at the results of the table before grouping: -- select -- icustay_id, charttime, drug, drug_rate, drug_amount -- , drug_stopped -- , drug_start -- , drug_first -- , drug_stop -- from drugcv6 order by icustay_id, charttime; , drugcv7 as ( select icustay_id , charttime as starttime , lead(charttime) OVER (partition by icustay_id, drug_first order by charttime) as endtime , drug, drug_rate, drug_amount, drug_stop, drug_start, drug_first from drugcv6 where drug_first is not null -- bogus data and drug_first != 0 -- sometimes *only* a rate of 0 appears, i.e. the drug is never actually delivered and icustay_id is not null -- there are data for "floating" admissions, we don't worry about these ) -- table of start/stop times for event , drugcv8 as ( select icustay_id , starttime, endtime , drug, drug_rate, drug_amount, drug_stop, drug_start, drug_first from drugcv7 where endtime is not null and drug_rate > 0 and starttime != endtime ) -- collapse these start/stop times down if the rate doesn't change , drugcv9 as ( select icustay_id , starttime, endtime , case when LAG(endtime) OVER (partition by icustay_id order by starttime, endtime) = starttime AND LAG(drug_rate) OVER (partition by icustay_id order by starttime, endtime) = drug_rate THEN 0 else 1 end as drug_groups , drug, drug_rate, drug_amount, drug_stop, drug_start, drug_first from drugcv8 where endtime is not null and drug_rate > 0 and starttime != endtime ) , drugcv10 as ( select icustay_id , starttime, endtime , drug_groups , SUM(drug_groups) OVER (partition by icustay_id order by starttime, endtime) as drug_groups_sum , drug, drug_rate, drug_amount, drug_stop, drug_start, drug_first from drugcv9 ) , drugcv as ( select icustay_id , min(starttime) as starttime , max(endtime) as endtime , drug_groups_sum , drug_rate , sum(drug_amount) as drug_amount from drugcv10 group by icustay_id, drug_groups_sum, drug_rate ) -- now assign this data to every hour of the patient's stay -- drug_amount for carevue is not accurate SELECT icustay_id , starttime, endtime , drug_rate, drug_amount from drugcv UNION SELECT icustay_id , starttime, endtime , drug_rate, drug_amount from drugmv order by icustay_id, starttime;
MIT-LCP/mimic-code
mimic-iii/concepts/durations/neuroblock_dose.sql
SQL
mit
9,203
cryptocurrency-market-data ========================== Experiments in cryptocurrency market data parsing/processing
rnicoll/cryptocurrency-market-data
README.md
Markdown
mit
116
#ifndef ABB_VALUE_H #define ABB_VALUE_H #include <type_traits> #include <tuple> namespace abb { class und_t {}; class pass_t {}; const und_t und; const pass_t pass; template<typename Value> struct is_und : std::is_same<Value, und_t> {}; template<typename Value> struct is_pass : std::is_same<Value, pass_t> {}; template<typename Value> struct is_special : std::integral_constant<bool, is_und<Value>::value || is_pass<Value>::value> {}; template<typename T> class inplace_args; template<typename Ret, typename... Args> class inplace_args<Ret(Args...)> : private std::tuple<Args...> { public: using std::tuple<Args...>::tuple; template<std::size_t Index> typename std::tuple_element<Index, std::tuple<Args...>>::type const& get() const { return std::get<Index>(*this); } }; template<typename Ret = pass_t, typename... Args> inplace_args<Ret(Args &&...)> inplace(Args &&... args) { return inplace_args<Ret(Args &&...)>(std::forward<Args>(args)...); } namespace internal { template<typename Arg> struct normalize_arg { typedef Arg type; }; template<typename Ret, typename... Args> struct normalize_arg<inplace_args<Ret(Args...)>> { static_assert(!is_special<Ret>::value, "Expected inplace_args to contain valid object type"); typedef Ret type; }; template<typename Arg> struct normalize_arg<std::reference_wrapper<Arg>> { typedef Arg & type; }; template<typename Arg> using normalize_arg_t = typename normalize_arg<Arg>::type; template<typename Value> struct normalize_value { typedef void type(normalize_arg_t<Value>); }; template<> struct normalize_value<und_t> { typedef und_t type; }; template<typename Return, typename... Args> struct normalize_value<Return(Args...)> {}; template<typename... Args> struct normalize_value<void(Args...)> { typedef void type(normalize_arg_t<Args>...); }; template<> struct normalize_value<void> { typedef void type(); }; } // namespace internal template<typename Arg> using get_result_t = typename Arg::result; template<typename Arg> using get_reason_t = typename Arg::reason; template<typename Value> using normalize_value_t = typename internal::normalize_value<Value>::type; template<typename Value, typename OtherValue> struct is_value_substitutable : std::integral_constant< bool, std::is_same<Value, OtherValue>::value || std::is_same<OtherValue, und_t>::value > {}; namespace internal { template<typename... Types> struct common_value {}; template<> struct common_value<> { typedef und_t type; }; template<typename Type> struct common_value<Type> { typedef Type type; }; template<typename First, typename Second> struct common_value<First, Second> { typedef typename std::conditional<is_und<First>::value, Second, First>::type type; static_assert(is_value_substitutable<type, Second>::value, "Incompatible types"); }; template<typename First, typename Second, typename... Types> struct common_value<First, Second, Types...> : common_value<typename common_value<First, Second>::type, Types...> {}; } // namespace internal template<typename... Types> using common_value_t = typename internal::common_value<Types...>::type; } // namespace abb #endif // ABB_VALUE_H
rusek/abb-cpp
include/abb/value.h
C
mit
3,236
//================================================================================================= /*! // \file blazemark/blaze/TDVecSMatMult.h // \brief Header file for the Blaze transpose dense vector/sparse matrix multiplication kernel // // Copyright (C) 2012-2020 Klaus Iglberger - All Rights Reserved // // This file is part of the Blaze library. You can redistribute it and/or modify it under // the terms of the New (Revised) BSD License. Redistribution and use in source and binary // forms, with or without modification, are permitted provided that the following conditions // are met: // // 1. Redistributions of source code must retain the above copyright notice, this list of // conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other materials // provided with the distribution. // 3. Neither the names of the Blaze development group nor the names of its contributors // may be used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT // SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED // TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR // BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN // ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH // DAMAGE. */ //================================================================================================= #ifndef _BLAZEMARK_BLAZE_TDVECSMATMULT_H_ #define _BLAZEMARK_BLAZE_TDVECSMATMULT_H_ //************************************************************************************************* // Includes //************************************************************************************************* #include <blazemark/system/Types.h> namespace blazemark { namespace blaze { //================================================================================================= // // KERNEL FUNCTIONS // //================================================================================================= //************************************************************************************************* /*!\name Blaze kernel functions */ //@{ double tdvecsmatmult( size_t N, size_t F, size_t steps ); //@} //************************************************************************************************* } // namespace blaze } // namespace blazemark #endif
camillescott/boink
include/goetia/sketches/sketch/vec/blaze/blazemark/blazemark/blaze/TDVecSMatMult.h
C
mit
3,056
/* * Copyright 2015 Google Inc. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ var THREE = require('./three-math.js'); var PredictionMode = { NONE: 'none', INTERPOLATE: 'interpolate', PREDICT: 'predict' } // How much to interpolate between the current orientation estimate and the // previous estimate position. This is helpful for devices with low // deviceorientation firing frequency (eg. on iOS8 and below, it is 20 Hz). The // larger this value (in [0, 1]), the smoother but more delayed the head // tracking is. var INTERPOLATION_SMOOTHING_FACTOR = 0.01; // Angular threshold, if the angular speed (in deg/s) is less than this, do no // prediction. Without it, the screen flickers quite a bit. var PREDICTION_THRESHOLD_DEG_PER_S = 0.01; //var PREDICTION_THRESHOLD_DEG_PER_S = 0; // How far into the future to predict. window.WEBVR_PREDICTION_TIME_MS = 80; // Whether to predict or what. window.WEBVR_PREDICTION_MODE = PredictionMode.PREDICT; function PosePredictor() { this.lastQ = new THREE.Quaternion(); this.lastTimestamp = null; this.outQ = new THREE.Quaternion(); this.deltaQ = new THREE.Quaternion(); } PosePredictor.prototype.getPrediction = function(currentQ, rotationRate, timestamp) { // If there's no previous quaternion, output the current one and save for // later. if (!this.lastTimestamp) { this.lastQ.copy(currentQ); this.lastTimestamp = timestamp; return currentQ; } // DEBUG ONLY: Try with a fixed 60 Hz update speed. //var elapsedMs = 1000/60; var elapsedMs = timestamp - this.lastTimestamp; switch (WEBVR_PREDICTION_MODE) { case PredictionMode.INTERPOLATE: this.outQ.copy(currentQ); this.outQ.slerp(this.lastQ, INTERPOLATION_SMOOTHING_FACTOR); // Save the current quaternion for later. this.lastQ.copy(currentQ); break; case PredictionMode.PREDICT: var axisAngle; if (rotationRate) { axisAngle = this.getAxisAngularSpeedFromRotationRate_(rotationRate); } else { axisAngle = this.getAxisAngularSpeedFromGyroDelta_(currentQ, elapsedMs); } // If there is no predicted axis/angle, don't do prediction. if (!axisAngle) { this.outQ.copy(currentQ); this.lastQ.copy(currentQ); break; } var angularSpeedDegS = axisAngle.speed; var axis = axisAngle.axis; var predictAngleDeg = (WEBVR_PREDICTION_TIME_MS / 1000) * angularSpeedDegS; // If we're rotating slowly, don't do prediction. if (angularSpeedDegS < PREDICTION_THRESHOLD_DEG_PER_S) { this.outQ.copy(currentQ); this.lastQ.copy(currentQ); break; } // Calculate the prediction delta to apply to the original angle. this.deltaQ.setFromAxisAngle(axis, THREE.Math.degToRad(predictAngleDeg)); // DEBUG ONLY: As a sanity check, use the same axis and angle as before, // which should cause no prediction to happen. //this.deltaQ.setFromAxisAngle(axis, angle); this.outQ.copy(this.lastQ); this.outQ.multiply(this.deltaQ); // Use the predicted quaternion as the new last one. //this.lastQ.copy(this.outQ); this.lastQ.copy(currentQ); break; case PredictionMode.NONE: default: this.outQ.copy(currentQ); } this.lastTimestamp = timestamp; return this.outQ; }; PosePredictor.prototype.setScreenOrientation = function(screenOrientation) { this.screenOrientation = screenOrientation; }; PosePredictor.prototype.getAxis_ = function(quat) { // x = qx / sqrt(1-qw*qw) // y = qy / sqrt(1-qw*qw) // z = qz / sqrt(1-qw*qw) var d = Math.sqrt(1 - quat.w * quat.w); return new THREE.Vector3(quat.x / d, quat.y / d, quat.z / d); }; PosePredictor.prototype.getAngle_ = function(quat) { // angle = 2 * acos(qw) // If w is greater than 1 (THREE.js, how can this be?), arccos is not defined. if (quat.w > 1) { return 0; } var angle = 2 * Math.acos(quat.w); // Normalize the angle to be in [-π, π]. if (angle > Math.PI) { angle -= 2 * Math.PI; } return angle; }; PosePredictor.prototype.getAxisAngularSpeedFromRotationRate_ = function(rotationRate) { if (!rotationRate) { return null; } var screenRotationRate; if (/iPad|iPhone|iPod/.test(navigator.platform)) { // iOS: angular speed in deg/s. var screenRotationRate = this.getScreenAdjustedRotationRateIOS_(rotationRate); } else { // Android: angular speed in rad/s, so need to convert. rotationRate.alpha = THREE.Math.radToDeg(rotationRate.alpha); rotationRate.beta = THREE.Math.radToDeg(rotationRate.beta); rotationRate.gamma = THREE.Math.radToDeg(rotationRate.gamma); var screenRotationRate = this.getScreenAdjustedRotationRate_(rotationRate); } var vec = new THREE.Vector3( screenRotationRate.beta, screenRotationRate.alpha, screenRotationRate.gamma); /* var vec; if (/iPad|iPhone|iPod/.test(navigator.platform)) { vec = new THREE.Vector3(rotationRate.gamma, rotationRate.alpha, rotationRate.beta); } else { vec = new THREE.Vector3(rotationRate.beta, rotationRate.alpha, rotationRate.gamma); } // Take into account the screen orientation too! vec.applyQuaternion(this.screenTransform); */ // Angular speed in deg/s. var angularSpeedDegS = vec.length(); var axis = vec.normalize(); return { speed: angularSpeedDegS, axis: axis } }; PosePredictor.prototype.getScreenAdjustedRotationRate_ = function(rotationRate) { var screenRotationRate = { alpha: -rotationRate.alpha, beta: rotationRate.beta, gamma: rotationRate.gamma }; switch (this.screenOrientation) { case 90: screenRotationRate.beta = - rotationRate.gamma; screenRotationRate.gamma = rotationRate.beta; break; case 180: screenRotationRate.beta = - rotationRate.beta; screenRotationRate.gamma = - rotationRate.gamma; break; case 270: case -90: screenRotationRate.beta = rotationRate.gamma; screenRotationRate.gamma = - rotationRate.beta; break; default: // SCREEN_ROTATION_0 screenRotationRate.beta = rotationRate.beta; screenRotationRate.gamma = rotationRate.gamma; break; } return screenRotationRate; }; PosePredictor.prototype.getScreenAdjustedRotationRateIOS_ = function(rotationRate) { var screenRotationRate = { alpha: rotationRate.alpha, beta: rotationRate.beta, gamma: rotationRate.gamma }; // Values empirically derived. switch (this.screenOrientation) { case 90: screenRotationRate.beta = -rotationRate.beta; screenRotationRate.gamma = rotationRate.gamma; break; case 180: // You can't even do this on iOS. break; case 270: case -90: screenRotationRate.alpha = -rotationRate.alpha; screenRotationRate.beta = rotationRate.beta; screenRotationRate.gamma = rotationRate.gamma; break; default: // SCREEN_ROTATION_0 screenRotationRate.alpha = rotationRate.beta; screenRotationRate.beta = rotationRate.alpha; screenRotationRate.gamma = rotationRate.gamma; break; } return screenRotationRate; }; PosePredictor.prototype.getAxisAngularSpeedFromGyroDelta_ = function(currentQ, elapsedMs) { // Sometimes we use the same sensor timestamp, in which case prediction // won't work. if (elapsedMs == 0) { return null; } // Q_delta = Q_last^-1 * Q_curr this.deltaQ.copy(this.lastQ); this.deltaQ.inverse(); this.deltaQ.multiply(currentQ); // Convert from delta quaternion to axis-angle. var axis = this.getAxis_(this.deltaQ); var angleRad = this.getAngle_(this.deltaQ); // It took `elapsed` ms to travel the angle amount over the axis. Now, // we make a new quaternion based how far in the future we want to // calculate. var angularSpeedRadMs = angleRad / elapsedMs; var angularSpeedDegS = THREE.Math.radToDeg(angularSpeedRadMs) * 1000; // If no rotation rate is provided, do no prediction. return { speed: angularSpeedDegS, axis: axis }; }; module.exports = PosePredictor;
lacker/universe
vr_webpack/webvr-polyfill/src/pose-predictor.js
JavaScript
mit
8,628
<?php namespace Kuxin\Helper; /** * Class Collect * * @package Kuxin\Helper * @author Pakey <pakey@qq.com> */ class Collect { /** * 获取内容 * * @param $data * @return bool|mixed|string */ public static function getContent($data, $header = [], $option = []) { if (is_string($data)) $data = ['rule' => $data, 'charset' => 'auto']; if (strpos($data['rule'], '[timestamp]') || strpos($data['rule'], '[时间]')) { $data['rule'] = str_replace(['[timestamp]', '[时间]'], [time() - 64566122, date('Y-m-d H:i:s')], $data['rule']); } elseif (isset($data['usetimestamp']) && $data['usetimestamp'] == 1) { $data['rule'] .= (strpos($data['rule'], '?') ? '&_ptcms=' : '?_ptcms=') . (time() - 13456867); } if (isset($data['method']) && strtolower($data['method']) == 'post') { $content = Http::post($data['rule'], [], $header, $option); } else { $content = Http::get($data['rule'], [], $header, $option); } if ($content) { // 处理编码 if (empty($data['charset']) || !in_array($data['charset'], ['auto', 'utf-8', 'gbk'])) { $data['charset'] = 'auto'; } // 检测编码 if ($data['charset'] == 'auto') { if (preg_match('/[;\s\'"]charset[=\'\s]+?big/i', $content)) { $data['charset'] = 'big5'; } elseif (preg_match('/[;\s\'"]charset[=\'"\s]+?gb/i', $content) || preg_match('/[;\s\'"]encoding[=\'"\s]+?gb/i', $content)) { $data['charset'] = 'gbk'; } elseif (mb_detect_encoding($content) != 'UTF-8') { $data['charset'] = 'gbk'; } } // 转换 switch ($data['charset']) { case 'gbk': $content = mb_convert_encoding($content, 'UTF-8', 'GBK'); break; case 'big5': $content = mb_convert_encoding($content, 'UTF-8', 'big-5'); $content = big5::toutf8($content); break; case 'utf-16': $content = mb_convert_encoding($content, 'UTF-8', 'UTF-16'); default: } //错误标识 if (!empty($data['error']) && strpos($content, $data['error']) !== false) { return ''; } if (!empty($data['replace'])) { $content = self::replace($content, $data['replace']); } return $content; } return ''; } /** * 根据正则批量获取 * * @param mixed $pregArr 正则 * @param string $code 源内容 * @param int $needposition 确定是否需要间距数字 * @return array|bool */ public static function getMatchAll($pregArr, $code, $needposition = 0) { if (is_numeric($pregArr)) { return $pregArr; } elseif (is_string($pregArr)) { $pregArr = ['rule' => self::parseMatchRule($pregArr)]; } elseif (empty($pregArr['rule'])) { return []; } if (!self::isreg($pregArr['rule'])) return []; $pregstr = '{' . $pregArr['rule'] . '}'; $pregstr .= empty($pregArr['option']) ? '' : $pregArr['option']; $matchvar = $match = []; if (!empty($pregstr)) { if ($needposition) { preg_match_all($pregstr, $code, $match, PREG_SET_ORDER + PREG_OFFSET_CAPTURE); } else { preg_match_all($pregstr, $code, $match); } } if (is_array($match)) { if ($needposition) { foreach ($match as $var) { if (is_array($var)) { $matchvar[] = $var[count($var) - 1]; } else { $matchvar[] = $var; } } } else { if (isset($match['2'])) { $count = count($match); foreach ($match['1'] as $k => $v) { if ($v == '') { for ($i = 2; $i < $count; $i++) { if (!empty($match[$i][$k])) { $match['1'][$k] = $match[$i][$k]; break; } } } } } if (isset($match['1'])) { $matchvar = $match['1']; } else { return false; } } if (!empty($pregArr['replace'])) { foreach ($matchvar as $k => $v) { $matchvar[$k] = self::replace($v, $pregArr['replace']); } } return $matchvar; } return []; } /** * 根据正则获取指定数据 单个 * * @param mixed $pregArr 正则 * @param string $code 源内容 * @return bool|string */ public static function getMatch($pregArr, $code) { if (is_numeric($pregArr)) { return $pregArr; } elseif (empty($pregArr) || (isset($pregArr['rule']) && empty($pregArr['rule']))) { return ''; } elseif (is_string($pregArr)) { $pregArr = ['rule' => self::parseMatchRule($pregArr), 'replace' => []]; } if (!self::isreg($pregArr['rule'])) return $pregArr['rule']; $pregstr = '{' . $pregArr['rule'] . '}'; $pregstr .= empty($pregArr['option']) ? '' : $pregArr['option']; preg_match($pregstr, $code, $match); if (isset($match['1'])) { if (empty($pregArr['replace'])) { return $match['1']; } else { return self::replace($match[1], $pregArr['replace']); } } return ''; } /** * 内容替换 支持正则批量替换 * * @param string $con 代替换的内容 * @param array $arr 替换规则数组 单个元素如下 * array( * 'rule'=>'规则1',//♂后面表示要替换的 内容 * 'option'=>'参数', * 'method'=>1,//1 正则 0普通 * v ), * @return mixed */ public static function replace($con, array $arr) { foreach ($arr as $v) { if (!empty($v['rule'])) { $tmp = explode('♂', $v['rule']); $rule = $tmp['0']; $replace = isset($tmp['1']) ? $tmp['1'] : ''; $v['option'] = isset($v['option']) ? $v['option'] : ''; if ($v['method'] == 1) { //正则 $con = preg_replace("{" . $rule . "}{$v['option']}", $replace, $con); } else { if (strpos($v['option'], 'i') === false) { $con = str_replace($rule, $replace, $con); } else { $con = str_ireplace($rule, $replace, $con); } } } } return $con; } /** * 处理链接,根据当前页面地址得到完整的链接地址 * * @param string $url 当前链接 * @param string $path 当前页面地址 * @return string */ public static function parseUrl($url, $path) { if ($url) { if (strpos($url, '://') === false) { if (substr($url, 0, 1) == '/') { $tmp = parse_url($path); $url = $tmp['scheme'] . '://' . $tmp['host'] . $url; } elseif (substr($url, 0, 3) == '../') { $url = dirname($path) . substr($url, 2); } elseif (substr($path, -1) == '/') { $url = $path . $url; } else { $url = dirname($path) . '/' . $url; } } return $url; } else { return ''; } } /** * 内容切割方式 * * @param string $strings 要切割的内容 * @param string $argl 左侧标识 如果带有.+?则为正则模式 * @param string $argr 右侧标识 如果带有.+?则为正则模式 * @param bool $lt 是否包含左切割字符串 * @param bool $gt 是否包含右切割字符串 * @return string */ public static function cut($strings, $argl, $argr, $lt = false, $gt = false) { if (!$strings) return (""); if (strpos($argl, ".+?")) { $argl = strtr($argl, ["/" => "\/"]); if (preg_match("/" . $argl . "/", $strings, $match)) $argl = $match[0]; } if (strpos($argr, ".+?")) { $argr = strtr($argr, ["/" => "\/"]); if (preg_match("/" . $argr . "/", $strings, $match)) $argr = $match[0]; } $args = explode($argl, $strings); $args = explode($argr, $args[1]); $args = $args[0]; if ($args) { if ($lt) $args = $argl . $args; if ($gt) $args .= $argr; } else { $args = ""; } return ($args); } /** * 简写规则转化 * * @param $rules * @return array|string */ public static function parseMatchRule($rules) { $replace_pairs = [ '{' => '\{', '}' => '\}', '[内容]' => '(.*?)', '[数字]' => '\d*', '[空白]' => '\s*', '[任意]' => '.*?', '[参数]' => '[^\>\<]*?', '[属性]' => '[^\>\<\'"]*?', ]; if (is_array($rules)) { $rules['rule'] = strtr($rules['rule'], $replace_pairs); return $rules; } return strtr($rules, $replace_pairs); } /** * 是否正则 * * @param $str * @return bool */ public static function isreg($str) { return (strpos($str, ')') !== false || strpos($str, '(') !== false); } /** * @param $data * @return array */ public static function parseListData($data) { $list = []; $num = 0; foreach ($data as $v) { if ($v) { if ($num) { if ($num != count($v)) return []; } else { $num = count($v); } } } foreach ($data as $k => $v) { if ($v) { foreach ($v as $kk => $vv) { $list[$kk][$k] = $vv; } } else { for ($i = 0; $i < $num; $i++) { $list[$i][$k] = ''; } } } return $list; } }
pakey/PTFrameWork
kuxin/helper/collect.php
PHP
mit
11,227
/** * JS for the player character. * * * * */ import * as Consts from './consts'; var leftLeg; var rightLeg; var leftArm; var rightArm; const BODY_HEIGHT = 5; const LEG_HEIGHT = 5; const HEAD_HEIGHT = Consts.BLOCK_WIDTH * (3/5); const SKIN_COLORS = [0xFADCAB, 0x9E7245, 0x4F3F2F]; const BASE_MAT = new THREE.MeshLambertMaterial({color: 0xFF0000}); export var Player = function() { THREE.Object3D.call(this); this.position.y += BODY_HEIGHT / 2 + LEG_HEIGHT / 2 + HEAD_HEIGHT / 2 + HEAD_HEIGHT; this.moveLeft = false; this.moveRight = false; this.moveUp = false; this.moveDown = false; this.orientation = "backward"; var scope = this; var legGeo = new THREE.BoxGeometry(Consts.BLOCK_WIDTH / 2, LEG_HEIGHT, Consts.BLOCK_WIDTH / 2); var armGeo = new THREE.BoxGeometry(Consts.BLOCK_WIDTH / 2, BODY_HEIGHT, Consts.BLOCK_WIDTH / 2); // Base mat(s) var redMaterial = new THREE.MeshLambertMaterial({color: 0xFF2E00}); var blueMaterial = new THREE.MeshLambertMaterial({color: 0x23A8FC}); var yellowMaterial = new THREE.MeshLambertMaterial({color: 0xFFD000}); // Skin color mat, only used for head var skinColor = SKIN_COLORS[Math.floor(Math.random() * SKIN_COLORS.length)] var skinMat = new THREE.MeshLambertMaterial({color: skinColor}); // Body material var bodyFrontMat = new THREE.MeshPhongMaterial({color: 0xFFFFFF}); var bodyFrontTexture = new THREE.TextureLoader().load("img/tetratowerbodyfront.png", function(texture) { bodyFrontMat.map = texture; bodyFrontMat.needsUpdate = true; }) var bodyMat = new THREE.MultiMaterial([ redMaterial, redMaterial, redMaterial, redMaterial, bodyFrontMat, bodyFrontMat ]); var armSideMat = new THREE.MeshLambertMaterial({color: 0xFFFFFF}) var armTopMat = new THREE.MeshLambertMaterial({color: 0xFFFFFF}); var armMat = new THREE.MultiMaterial([ armSideMat, armSideMat, armTopMat, armTopMat, armSideMat, armSideMat ]); // Leg material var legSideMat = new THREE.MeshLambertMaterial({color: 0xFFFFFF}) var legMat = new THREE.MultiMaterial([ legSideMat, legSideMat, blueMaterial, blueMaterial, legSideMat, legSideMat ]); var legTexture = new THREE.TextureLoader().load("/img/tetratowerleg.png", function (texture) { legSideMat.map = texture; legSideMat.needsUpdate = true; }); var textureURL; switch (skinColor) { case SKIN_COLORS[0]: textureURL = "/img/tetratowerarm_white.png"; break; case SKIN_COLORS[1]: textureURL = "/img/tetratowerarm_brown.png"; break; case SKIN_COLORS[2]: textureURL = "/img/tetratowerarm_black.png"; break; default: textureURL = "/img/tetratowerarm.png"; break; } var armTexture = new THREE.TextureLoader().load(textureURL, function(texture) { armSideMat.map = texture; armSideMat.needsUpdate = true; }); var armTopTexture = new THREE.TextureLoader().load("img/tetratowerarmtop.png", function(texture) { armTopMat.map = texture; armTopMat.needsUpdate = true; }) // Create a body var bodyGeo = new THREE.BoxGeometry(Consts.BLOCK_WIDTH, BODY_HEIGHT, Consts.BLOCK_WIDTH / 2); var body = new THREE.Mesh(bodyGeo, bodyMat); this.add(body); // Create some leggy legs leftLeg = new THREE.Mesh(legGeo, legMat); this.add(leftLeg) leftLeg.translateX(-Consts.BLOCK_WIDTH / 4); leftLeg.translateY(-(LEG_HEIGHT + BODY_HEIGHT) / 2); rightLeg = new THREE.Mesh(legGeo, legMat); this.add(rightLeg); rightLeg.translateX(Consts.BLOCK_WIDTH / 4); rightLeg.translateY(-(LEG_HEIGHT + BODY_HEIGHT) / 2); // Create the arms leftArm = new THREE.Mesh(armGeo, armMat); this.add(leftArm); leftArm.translateX(-(Consts.BLOCK_WIDTH / 4 + Consts.BLOCK_WIDTH / 2)); rightArm = new THREE.Mesh(armGeo, armMat); this.add(rightArm); rightArm.translateX((Consts.BLOCK_WIDTH / 4 + Consts.BLOCK_WIDTH / 2)); // Now add a head var headGeo = new THREE.BoxGeometry(Consts.BLOCK_WIDTH * (3/5), Consts.BLOCK_WIDTH * (3/5), Consts.BLOCK_WIDTH * (3/5)); var head = new THREE.Mesh(headGeo, skinMat); this.add(head); head.translateY((BODY_HEIGHT + HEAD_HEIGHT) / 2); // And a fashionable hat var hatBodyGeo = new THREE.BoxGeometry(HEAD_HEIGHT * 1.05, HEAD_HEIGHT * (4/5), HEAD_HEIGHT * 1.05); var hatBody = new THREE.Mesh(hatBodyGeo, yellowMaterial); head.add(hatBody); hatBody.translateY(HEAD_HEIGHT * (4/5)); var hatBrimGeo = new THREE.BoxGeometry(HEAD_HEIGHT * 1.05, HEAD_HEIGHT / 5, HEAD_HEIGHT * 0.525); var hatBrim = new THREE.Mesh(hatBrimGeo, yellowMaterial); head.add(hatBrim); hatBrim.translateZ((HEAD_HEIGHT * 1.05) / 2 + (HEAD_HEIGHT * 0.525 / 2)); hatBrim.translateY(HEAD_HEIGHT / 2); // Add some listeners var onKeyDown = function(event) { switch(event.keyCode) { case 38: // up case 87: // w scope.moveForward = true; break; case 40: // down case 83: // s scope.moveBackward = true; break; case 37: // left case 65: // a scope.moveLeft = true; break; case 39: // right case 68: // d scope.moveRight = true; break; } } var onKeyUp = function(event) { switch(event.keyCode) { case 38: // up case 87: // w scope.moveForward = false; break; case 40: // down case 83: // s scope.moveBackward = false; break; case 37: // left case 65: // a scope.moveLeft = false; break; case 39: // right case 68: // d scope.moveRight = false; break; } } document.addEventListener('keydown', onKeyDown, false); document.addEventListener('keyup', onKeyUp, false); } Player.prototype = new THREE.Object3D(); Player.prototype.constructor = Player; THREE.Object3D.prototype.worldToLocal = function ( vector ) { if ( !this.__inverseMatrixWorld ) this.__inverseMatrixWorld = new THREE.Matrix4(); return vector.applyMatrix4( this.__inverseMatrixWorld.getInverse( this.matrixWorld )); }; THREE.Object3D.prototype.lookAtWorld = function( vector ) { vector = vector.clone(); this.parent.worldToLocal( vector ); this.lookAt( vector ); };
Bjorkbat/tetratower
js/src/player.js
JavaScript
mit
6,258
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_112-google-v7) on Fri Jul 21 13:02:32 PDT 2017 --> <title>Resetter</title> <meta name="date" content="2017-07-21"> <link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Resetter"; } } catch(err) { } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../index-all.html">Index</a></li> <li><a href="../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../org/robolectric/annotation/RealObject.html" title="annotation in org.robolectric.annotation"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li>Next&nbsp;Class</li> </ul> <ul class="navList"> <li><a href="../../../index.html?org/robolectric/annotation/Resetter.html" target="_top">Frames</a></li> <li><a href="Resetter.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Required&nbsp;|&nbsp;</li> <li>Optional</li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Element</li> </ul> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">org.robolectric.annotation</div> <h2 title="Annotation Type Resetter" class="title">Annotation Type Resetter</h2> </div> <div class="contentContainer"> <div class="description"> <ul class="blockList"> <li class="blockList"> <hr> <br> <pre>@Documented @Retention(value=RUNTIME) @Target(value=METHOD) public @interface <span class="memberNameLabel">Resetter</span></pre> <div class="block"><p>Indicates that the annotated method is used to reset static state in a shadow.</p></div> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../index-all.html">Index</a></li> <li><a href="../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage"><script type="text/javascript" src="../../../highlight.pack.js"></script> <script type="text/javascript"><!-- hljs.initHighlightingOnLoad(); //--></script></div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../org/robolectric/annotation/RealObject.html" title="annotation in org.robolectric.annotation"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li>Next&nbsp;Class</li> </ul> <ul class="navList"> <li><a href="../../../index.html?org/robolectric/annotation/Resetter.html" target="_top">Frames</a></li> <li><a href="Resetter.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Required&nbsp;|&nbsp;</li> <li>Optional</li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Element</li> </ul> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>
robolectric/robolectric.github.io
javadoc/3.4/org/robolectric/annotation/Resetter.html
HTML
mit
5,317
blocklevel = ["blockquote", "div", "form", "p", "table", "video", "h1", "h2", "h3", "h4", "h5", "h6", "hr", "details", "article", "header", "main"] def normalizeEnter(src): #Deletes all user defined for readability reason existing line breaks that are issues for the HTML output for elem in blocklevel: while src.find("\r<" + elem) > -1: src = src.replace("\r<" + elem, "<" + elem) while src.find("</" + elem + ">\r") > -1: src = src.replace("</" + elem + ">\r", "</" + elem + ">") while src.find(">\r") > -1: src = src.replace(">\r", ">") #It is really needed, it created some other bugs?! while src.find("\r</") > -1: src = src.replace("\r</", "</") ##It is really needed, it created some other bugs?! return src def main(islinput, inputfile, pluginData, globalData): currentIndex = 0 for item in islinput: item = normalizeEnter(item) #Deletes not wanted line breaks in order to prevent the problem we have with Markdown. islinput[currentIndex] = item currentIndex += 1 return islinput, pluginData, globalData
ValorNaram/isl
inputchangers/002.py
Python
mit
1,044
<?php namespace App\Models; use Illuminate\Database\Eloquent\Model; class DataQuestionnaire extends Model { protected $fillable = ['game_question', 'game_opponent_evaluation', 'study_evaluation']; /** * Relationship with parent DataParticipant. * * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function data_participant() { return $this->belongsTo('App\Models\DataParticipant'); } }
mihaiconstantin/game-theory-tilburg
app/Models/DataQuestionnaire.php
PHP
mit
460
# riemann-stream Stream events from Riemann on CLI
alexforrow/riemann-stream
README.md
Markdown
mit
51
_rm: file format elf32-i386 Disassembly of section .text: 00000000 <main>: #include "stat.h" #include "user.h" int main(int argc, char *argv[]) { 0: 55 push %ebp 1: 89 e5 mov %esp,%ebp 3: 83 e4 f0 and $0xfffffff0,%esp 6: 83 ec 20 sub $0x20,%esp int i; if(argc < 2){ 9: 83 7d 08 01 cmpl $0x1,0x8(%ebp) d: 7f 19 jg 28 <main+0x28> printf(2, "Usage: rm files...\n"); f: c7 44 24 04 43 08 00 movl $0x843,0x4(%esp) 16: 00 17: c7 04 24 02 00 00 00 movl $0x2,(%esp) 1e: e8 54 04 00 00 call 477 <printf> exit(); 23: e8 cf 02 00 00 call 2f7 <exit> } for(i = 1; i < argc; i++){ 28: c7 44 24 1c 01 00 00 movl $0x1,0x1c(%esp) 2f: 00 30: eb 4f jmp 81 <main+0x81> if(unlink(argv[i]) < 0){ 32: 8b 44 24 1c mov 0x1c(%esp),%eax 36: 8d 14 85 00 00 00 00 lea 0x0(,%eax,4),%edx 3d: 8b 45 0c mov 0xc(%ebp),%eax 40: 01 d0 add %edx,%eax 42: 8b 00 mov (%eax),%eax 44: 89 04 24 mov %eax,(%esp) 47: e8 fb 02 00 00 call 347 <unlink> 4c: 85 c0 test %eax,%eax 4e: 79 2c jns 7c <main+0x7c> printf(2, "rm: %s failed to delete\n", argv[i]); 50: 8b 44 24 1c mov 0x1c(%esp),%eax 54: 8d 14 85 00 00 00 00 lea 0x0(,%eax,4),%edx 5b: 8b 45 0c mov 0xc(%ebp),%eax 5e: 01 d0 add %edx,%eax 60: 8b 00 mov (%eax),%eax 62: 89 44 24 08 mov %eax,0x8(%esp) 66: c7 44 24 04 57 08 00 movl $0x857,0x4(%esp) 6d: 00 6e: c7 04 24 02 00 00 00 movl $0x2,(%esp) 75: e8 fd 03 00 00 call 477 <printf> break; 7a: eb 0e jmp 8a <main+0x8a> if(argc < 2){ printf(2, "Usage: rm files...\n"); exit(); } for(i = 1; i < argc; i++){ 7c: 83 44 24 1c 01 addl $0x1,0x1c(%esp) 81: 8b 44 24 1c mov 0x1c(%esp),%eax 85: 3b 45 08 cmp 0x8(%ebp),%eax 88: 7c a8 jl 32 <main+0x32> printf(2, "rm: %s failed to delete\n", argv[i]); break; } } exit(); 8a: e8 68 02 00 00 call 2f7 <exit> 0000008f <stosb>: "cc"); } static inline void stosb(void *addr, int data, int cnt) { 8f: 55 push %ebp 90: 89 e5 mov %esp,%ebp 92: 57 push %edi 93: 53 push %ebx asm volatile("cld; rep stosb" : 94: 8b 4d 08 mov 0x8(%ebp),%ecx 97: 8b 55 10 mov 0x10(%ebp),%edx 9a: 8b 45 0c mov 0xc(%ebp),%eax 9d: 89 cb mov %ecx,%ebx 9f: 89 df mov %ebx,%edi a1: 89 d1 mov %edx,%ecx a3: fc cld a4: f3 aa rep stos %al,%es:(%edi) a6: 89 ca mov %ecx,%edx a8: 89 fb mov %edi,%ebx aa: 89 5d 08 mov %ebx,0x8(%ebp) ad: 89 55 10 mov %edx,0x10(%ebp) "=D" (addr), "=c" (cnt) : "0" (addr), "1" (cnt), "a" (data) : "memory", "cc"); } b0: 5b pop %ebx b1: 5f pop %edi b2: 5d pop %ebp b3: c3 ret 000000b4 <strcpy>: #include "user.h" #include "x86.h" char* strcpy(char *s, char *t) { b4: 55 push %ebp b5: 89 e5 mov %esp,%ebp b7: 83 ec 10 sub $0x10,%esp char *os; os = s; ba: 8b 45 08 mov 0x8(%ebp),%eax bd: 89 45 fc mov %eax,-0x4(%ebp) while((*s++ = *t++) != 0) c0: 90 nop c1: 8b 45 08 mov 0x8(%ebp),%eax c4: 8d 50 01 lea 0x1(%eax),%edx c7: 89 55 08 mov %edx,0x8(%ebp) ca: 8b 55 0c mov 0xc(%ebp),%edx cd: 8d 4a 01 lea 0x1(%edx),%ecx d0: 89 4d 0c mov %ecx,0xc(%ebp) d3: 0f b6 12 movzbl (%edx),%edx d6: 88 10 mov %dl,(%eax) d8: 0f b6 00 movzbl (%eax),%eax db: 84 c0 test %al,%al dd: 75 e2 jne c1 <strcpy+0xd> ; return os; df: 8b 45 fc mov -0x4(%ebp),%eax } e2: c9 leave e3: c3 ret 000000e4 <strcmp>: int strcmp(const char *p, const char *q) { e4: 55 push %ebp e5: 89 e5 mov %esp,%ebp while(*p && *p == *q) e7: eb 08 jmp f1 <strcmp+0xd> p++, q++; e9: 83 45 08 01 addl $0x1,0x8(%ebp) ed: 83 45 0c 01 addl $0x1,0xc(%ebp) } int strcmp(const char *p, const char *q) { while(*p && *p == *q) f1: 8b 45 08 mov 0x8(%ebp),%eax f4: 0f b6 00 movzbl (%eax),%eax f7: 84 c0 test %al,%al f9: 74 10 je 10b <strcmp+0x27> fb: 8b 45 08 mov 0x8(%ebp),%eax fe: 0f b6 10 movzbl (%eax),%edx 101: 8b 45 0c mov 0xc(%ebp),%eax 104: 0f b6 00 movzbl (%eax),%eax 107: 38 c2 cmp %al,%dl 109: 74 de je e9 <strcmp+0x5> p++, q++; return (uchar)*p - (uchar)*q; 10b: 8b 45 08 mov 0x8(%ebp),%eax 10e: 0f b6 00 movzbl (%eax),%eax 111: 0f b6 d0 movzbl %al,%edx 114: 8b 45 0c mov 0xc(%ebp),%eax 117: 0f b6 00 movzbl (%eax),%eax 11a: 0f b6 c0 movzbl %al,%eax 11d: 29 c2 sub %eax,%edx 11f: 89 d0 mov %edx,%eax } 121: 5d pop %ebp 122: c3 ret 00000123 <strlen>: uint strlen(char *s) { 123: 55 push %ebp 124: 89 e5 mov %esp,%ebp 126: 83 ec 10 sub $0x10,%esp int n; for(n = 0; s[n]; n++) 129: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp) 130: eb 04 jmp 136 <strlen+0x13> 132: 83 45 fc 01 addl $0x1,-0x4(%ebp) 136: 8b 55 fc mov -0x4(%ebp),%edx 139: 8b 45 08 mov 0x8(%ebp),%eax 13c: 01 d0 add %edx,%eax 13e: 0f b6 00 movzbl (%eax),%eax 141: 84 c0 test %al,%al 143: 75 ed jne 132 <strlen+0xf> ; return n; 145: 8b 45 fc mov -0x4(%ebp),%eax } 148: c9 leave 149: c3 ret 0000014a <memset>: void* memset(void *dst, int c, uint n) { 14a: 55 push %ebp 14b: 89 e5 mov %esp,%ebp 14d: 83 ec 0c sub $0xc,%esp stosb(dst, c, n); 150: 8b 45 10 mov 0x10(%ebp),%eax 153: 89 44 24 08 mov %eax,0x8(%esp) 157: 8b 45 0c mov 0xc(%ebp),%eax 15a: 89 44 24 04 mov %eax,0x4(%esp) 15e: 8b 45 08 mov 0x8(%ebp),%eax 161: 89 04 24 mov %eax,(%esp) 164: e8 26 ff ff ff call 8f <stosb> return dst; 169: 8b 45 08 mov 0x8(%ebp),%eax } 16c: c9 leave 16d: c3 ret 0000016e <strchr>: char* strchr(const char *s, char c) { 16e: 55 push %ebp 16f: 89 e5 mov %esp,%ebp 171: 83 ec 04 sub $0x4,%esp 174: 8b 45 0c mov 0xc(%ebp),%eax 177: 88 45 fc mov %al,-0x4(%ebp) for(; *s; s++) 17a: eb 14 jmp 190 <strchr+0x22> if(*s == c) 17c: 8b 45 08 mov 0x8(%ebp),%eax 17f: 0f b6 00 movzbl (%eax),%eax 182: 3a 45 fc cmp -0x4(%ebp),%al 185: 75 05 jne 18c <strchr+0x1e> return (char*)s; 187: 8b 45 08 mov 0x8(%ebp),%eax 18a: eb 13 jmp 19f <strchr+0x31> } char* strchr(const char *s, char c) { for(; *s; s++) 18c: 83 45 08 01 addl $0x1,0x8(%ebp) 190: 8b 45 08 mov 0x8(%ebp),%eax 193: 0f b6 00 movzbl (%eax),%eax 196: 84 c0 test %al,%al 198: 75 e2 jne 17c <strchr+0xe> if(*s == c) return (char*)s; return 0; 19a: b8 00 00 00 00 mov $0x0,%eax } 19f: c9 leave 1a0: c3 ret 000001a1 <gets>: char* gets(char *buf, int max) { 1a1: 55 push %ebp 1a2: 89 e5 mov %esp,%ebp 1a4: 83 ec 28 sub $0x28,%esp int i, cc; char c; for(i=0; i+1 < max; ){ 1a7: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp) 1ae: eb 4c jmp 1fc <gets+0x5b> cc = read(0, &c, 1); 1b0: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp) 1b7: 00 1b8: 8d 45 ef lea -0x11(%ebp),%eax 1bb: 89 44 24 04 mov %eax,0x4(%esp) 1bf: c7 04 24 00 00 00 00 movl $0x0,(%esp) 1c6: e8 44 01 00 00 call 30f <read> 1cb: 89 45 f0 mov %eax,-0x10(%ebp) if(cc < 1) 1ce: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 1d2: 7f 02 jg 1d6 <gets+0x35> break; 1d4: eb 31 jmp 207 <gets+0x66> buf[i++] = c; 1d6: 8b 45 f4 mov -0xc(%ebp),%eax 1d9: 8d 50 01 lea 0x1(%eax),%edx 1dc: 89 55 f4 mov %edx,-0xc(%ebp) 1df: 89 c2 mov %eax,%edx 1e1: 8b 45 08 mov 0x8(%ebp),%eax 1e4: 01 c2 add %eax,%edx 1e6: 0f b6 45 ef movzbl -0x11(%ebp),%eax 1ea: 88 02 mov %al,(%edx) if(c == '\n' || c == '\r') 1ec: 0f b6 45 ef movzbl -0x11(%ebp),%eax 1f0: 3c 0a cmp $0xa,%al 1f2: 74 13 je 207 <gets+0x66> 1f4: 0f b6 45 ef movzbl -0x11(%ebp),%eax 1f8: 3c 0d cmp $0xd,%al 1fa: 74 0b je 207 <gets+0x66> gets(char *buf, int max) { int i, cc; char c; for(i=0; i+1 < max; ){ 1fc: 8b 45 f4 mov -0xc(%ebp),%eax 1ff: 83 c0 01 add $0x1,%eax 202: 3b 45 0c cmp 0xc(%ebp),%eax 205: 7c a9 jl 1b0 <gets+0xf> break; buf[i++] = c; if(c == '\n' || c == '\r') break; } buf[i] = '\0'; 207: 8b 55 f4 mov -0xc(%ebp),%edx 20a: 8b 45 08 mov 0x8(%ebp),%eax 20d: 01 d0 add %edx,%eax 20f: c6 00 00 movb $0x0,(%eax) return buf; 212: 8b 45 08 mov 0x8(%ebp),%eax } 215: c9 leave 216: c3 ret 00000217 <stat>: int stat(char *n, struct stat *st) { 217: 55 push %ebp 218: 89 e5 mov %esp,%ebp 21a: 83 ec 28 sub $0x28,%esp int fd; int r; fd = open(n, O_RDONLY); 21d: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp) 224: 00 225: 8b 45 08 mov 0x8(%ebp),%eax 228: 89 04 24 mov %eax,(%esp) 22b: e8 07 01 00 00 call 337 <open> 230: 89 45 f4 mov %eax,-0xc(%ebp) if(fd < 0) 233: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 237: 79 07 jns 240 <stat+0x29> return -1; 239: b8 ff ff ff ff mov $0xffffffff,%eax 23e: eb 23 jmp 263 <stat+0x4c> r = fstat(fd, st); 240: 8b 45 0c mov 0xc(%ebp),%eax 243: 89 44 24 04 mov %eax,0x4(%esp) 247: 8b 45 f4 mov -0xc(%ebp),%eax 24a: 89 04 24 mov %eax,(%esp) 24d: e8 fd 00 00 00 call 34f <fstat> 252: 89 45 f0 mov %eax,-0x10(%ebp) close(fd); 255: 8b 45 f4 mov -0xc(%ebp),%eax 258: 89 04 24 mov %eax,(%esp) 25b: e8 bf 00 00 00 call 31f <close> return r; 260: 8b 45 f0 mov -0x10(%ebp),%eax } 263: c9 leave 264: c3 ret 00000265 <atoi>: int atoi(const char *s) { 265: 55 push %ebp 266: 89 e5 mov %esp,%ebp 268: 83 ec 10 sub $0x10,%esp int n; n = 0; 26b: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp) while('0' <= *s && *s <= '9') 272: eb 25 jmp 299 <atoi+0x34> n = n*10 + *s++ - '0'; 274: 8b 55 fc mov -0x4(%ebp),%edx 277: 89 d0 mov %edx,%eax 279: c1 e0 02 shl $0x2,%eax 27c: 01 d0 add %edx,%eax 27e: 01 c0 add %eax,%eax 280: 89 c1 mov %eax,%ecx 282: 8b 45 08 mov 0x8(%ebp),%eax 285: 8d 50 01 lea 0x1(%eax),%edx 288: 89 55 08 mov %edx,0x8(%ebp) 28b: 0f b6 00 movzbl (%eax),%eax 28e: 0f be c0 movsbl %al,%eax 291: 01 c8 add %ecx,%eax 293: 83 e8 30 sub $0x30,%eax 296: 89 45 fc mov %eax,-0x4(%ebp) atoi(const char *s) { int n; n = 0; while('0' <= *s && *s <= '9') 299: 8b 45 08 mov 0x8(%ebp),%eax 29c: 0f b6 00 movzbl (%eax),%eax 29f: 3c 2f cmp $0x2f,%al 2a1: 7e 0a jle 2ad <atoi+0x48> 2a3: 8b 45 08 mov 0x8(%ebp),%eax 2a6: 0f b6 00 movzbl (%eax),%eax 2a9: 3c 39 cmp $0x39,%al 2ab: 7e c7 jle 274 <atoi+0xf> n = n*10 + *s++ - '0'; return n; 2ad: 8b 45 fc mov -0x4(%ebp),%eax } 2b0: c9 leave 2b1: c3 ret 000002b2 <memmove>: void* memmove(void *vdst, void *vsrc, int n) { 2b2: 55 push %ebp 2b3: 89 e5 mov %esp,%ebp 2b5: 83 ec 10 sub $0x10,%esp char *dst, *src; dst = vdst; 2b8: 8b 45 08 mov 0x8(%ebp),%eax 2bb: 89 45 fc mov %eax,-0x4(%ebp) src = vsrc; 2be: 8b 45 0c mov 0xc(%ebp),%eax 2c1: 89 45 f8 mov %eax,-0x8(%ebp) while(n-- > 0) 2c4: eb 17 jmp 2dd <memmove+0x2b> *dst++ = *src++; 2c6: 8b 45 fc mov -0x4(%ebp),%eax 2c9: 8d 50 01 lea 0x1(%eax),%edx 2cc: 89 55 fc mov %edx,-0x4(%ebp) 2cf: 8b 55 f8 mov -0x8(%ebp),%edx 2d2: 8d 4a 01 lea 0x1(%edx),%ecx 2d5: 89 4d f8 mov %ecx,-0x8(%ebp) 2d8: 0f b6 12 movzbl (%edx),%edx 2db: 88 10 mov %dl,(%eax) { char *dst, *src; dst = vdst; src = vsrc; while(n-- > 0) 2dd: 8b 45 10 mov 0x10(%ebp),%eax 2e0: 8d 50 ff lea -0x1(%eax),%edx 2e3: 89 55 10 mov %edx,0x10(%ebp) 2e6: 85 c0 test %eax,%eax 2e8: 7f dc jg 2c6 <memmove+0x14> *dst++ = *src++; return vdst; 2ea: 8b 45 08 mov 0x8(%ebp),%eax } 2ed: c9 leave 2ee: c3 ret 000002ef <fork>: name: \ movl $SYS_ ## name, %eax; \ int $T_SYSCALL; \ ret SYSCALL(fork) 2ef: b8 01 00 00 00 mov $0x1,%eax 2f4: cd 40 int $0x40 2f6: c3 ret 000002f7 <exit>: SYSCALL(exit) 2f7: b8 02 00 00 00 mov $0x2,%eax 2fc: cd 40 int $0x40 2fe: c3 ret 000002ff <wait>: SYSCALL(wait) 2ff: b8 03 00 00 00 mov $0x3,%eax 304: cd 40 int $0x40 306: c3 ret 00000307 <pipe>: SYSCALL(pipe) 307: b8 04 00 00 00 mov $0x4,%eax 30c: cd 40 int $0x40 30e: c3 ret 0000030f <read>: SYSCALL(read) 30f: b8 05 00 00 00 mov $0x5,%eax 314: cd 40 int $0x40 316: c3 ret 00000317 <write>: SYSCALL(write) 317: b8 10 00 00 00 mov $0x10,%eax 31c: cd 40 int $0x40 31e: c3 ret 0000031f <close>: SYSCALL(close) 31f: b8 15 00 00 00 mov $0x15,%eax 324: cd 40 int $0x40 326: c3 ret 00000327 <kill>: SYSCALL(kill) 327: b8 06 00 00 00 mov $0x6,%eax 32c: cd 40 int $0x40 32e: c3 ret 0000032f <exec>: SYSCALL(exec) 32f: b8 07 00 00 00 mov $0x7,%eax 334: cd 40 int $0x40 336: c3 ret 00000337 <open>: SYSCALL(open) 337: b8 0f 00 00 00 mov $0xf,%eax 33c: cd 40 int $0x40 33e: c3 ret 0000033f <mknod>: SYSCALL(mknod) 33f: b8 11 00 00 00 mov $0x11,%eax 344: cd 40 int $0x40 346: c3 ret 00000347 <unlink>: SYSCALL(unlink) 347: b8 12 00 00 00 mov $0x12,%eax 34c: cd 40 int $0x40 34e: c3 ret 0000034f <fstat>: SYSCALL(fstat) 34f: b8 08 00 00 00 mov $0x8,%eax 354: cd 40 int $0x40 356: c3 ret 00000357 <link>: SYSCALL(link) 357: b8 13 00 00 00 mov $0x13,%eax 35c: cd 40 int $0x40 35e: c3 ret 0000035f <mkdir>: SYSCALL(mkdir) 35f: b8 14 00 00 00 mov $0x14,%eax 364: cd 40 int $0x40 366: c3 ret 00000367 <chdir>: SYSCALL(chdir) 367: b8 09 00 00 00 mov $0x9,%eax 36c: cd 40 int $0x40 36e: c3 ret 0000036f <dup>: SYSCALL(dup) 36f: b8 0a 00 00 00 mov $0xa,%eax 374: cd 40 int $0x40 376: c3 ret 00000377 <getpid>: SYSCALL(getpid) 377: b8 0b 00 00 00 mov $0xb,%eax 37c: cd 40 int $0x40 37e: c3 ret 0000037f <sbrk>: SYSCALL(sbrk) 37f: b8 0c 00 00 00 mov $0xc,%eax 384: cd 40 int $0x40 386: c3 ret 00000387 <sleep>: SYSCALL(sleep) 387: b8 0d 00 00 00 mov $0xd,%eax 38c: cd 40 int $0x40 38e: c3 ret 0000038f <uptime>: SYSCALL(uptime) 38f: b8 0e 00 00 00 mov $0xe,%eax 394: cd 40 int $0x40 396: c3 ret 00000397 <putc>: #include "stat.h" #include "user.h" static void putc(int fd, char c) { 397: 55 push %ebp 398: 89 e5 mov %esp,%ebp 39a: 83 ec 18 sub $0x18,%esp 39d: 8b 45 0c mov 0xc(%ebp),%eax 3a0: 88 45 f4 mov %al,-0xc(%ebp) write(fd, &c, 1); 3a3: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp) 3aa: 00 3ab: 8d 45 f4 lea -0xc(%ebp),%eax 3ae: 89 44 24 04 mov %eax,0x4(%esp) 3b2: 8b 45 08 mov 0x8(%ebp),%eax 3b5: 89 04 24 mov %eax,(%esp) 3b8: e8 5a ff ff ff call 317 <write> } 3bd: c9 leave 3be: c3 ret 000003bf <printint>: static void printint(int fd, int xx, int base, int sgn) { 3bf: 55 push %ebp 3c0: 89 e5 mov %esp,%ebp 3c2: 56 push %esi 3c3: 53 push %ebx 3c4: 83 ec 30 sub $0x30,%esp static char digits[] = "0123456789ABCDEF"; char buf[16]; int i, neg; uint x; neg = 0; 3c7: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp) if(sgn && xx < 0){ 3ce: 83 7d 14 00 cmpl $0x0,0x14(%ebp) 3d2: 74 17 je 3eb <printint+0x2c> 3d4: 83 7d 0c 00 cmpl $0x0,0xc(%ebp) 3d8: 79 11 jns 3eb <printint+0x2c> neg = 1; 3da: c7 45 f0 01 00 00 00 movl $0x1,-0x10(%ebp) x = -xx; 3e1: 8b 45 0c mov 0xc(%ebp),%eax 3e4: f7 d8 neg %eax 3e6: 89 45 ec mov %eax,-0x14(%ebp) 3e9: eb 06 jmp 3f1 <printint+0x32> } else { x = xx; 3eb: 8b 45 0c mov 0xc(%ebp),%eax 3ee: 89 45 ec mov %eax,-0x14(%ebp) } i = 0; 3f1: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp) do{ buf[i++] = digits[x % base]; 3f8: 8b 4d f4 mov -0xc(%ebp),%ecx 3fb: 8d 41 01 lea 0x1(%ecx),%eax 3fe: 89 45 f4 mov %eax,-0xc(%ebp) 401: 8b 5d 10 mov 0x10(%ebp),%ebx 404: 8b 45 ec mov -0x14(%ebp),%eax 407: ba 00 00 00 00 mov $0x0,%edx 40c: f7 f3 div %ebx 40e: 89 d0 mov %edx,%eax 410: 0f b6 80 bc 0a 00 00 movzbl 0xabc(%eax),%eax 417: 88 44 0d dc mov %al,-0x24(%ebp,%ecx,1) }while((x /= base) != 0); 41b: 8b 75 10 mov 0x10(%ebp),%esi 41e: 8b 45 ec mov -0x14(%ebp),%eax 421: ba 00 00 00 00 mov $0x0,%edx 426: f7 f6 div %esi 428: 89 45 ec mov %eax,-0x14(%ebp) 42b: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) 42f: 75 c7 jne 3f8 <printint+0x39> if(neg) 431: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 435: 74 10 je 447 <printint+0x88> buf[i++] = '-'; 437: 8b 45 f4 mov -0xc(%ebp),%eax 43a: 8d 50 01 lea 0x1(%eax),%edx 43d: 89 55 f4 mov %edx,-0xc(%ebp) 440: c6 44 05 dc 2d movb $0x2d,-0x24(%ebp,%eax,1) while(--i >= 0) 445: eb 1f jmp 466 <printint+0xa7> 447: eb 1d jmp 466 <printint+0xa7> putc(fd, buf[i]); 449: 8d 55 dc lea -0x24(%ebp),%edx 44c: 8b 45 f4 mov -0xc(%ebp),%eax 44f: 01 d0 add %edx,%eax 451: 0f b6 00 movzbl (%eax),%eax 454: 0f be c0 movsbl %al,%eax 457: 89 44 24 04 mov %eax,0x4(%esp) 45b: 8b 45 08 mov 0x8(%ebp),%eax 45e: 89 04 24 mov %eax,(%esp) 461: e8 31 ff ff ff call 397 <putc> buf[i++] = digits[x % base]; }while((x /= base) != 0); if(neg) buf[i++] = '-'; while(--i >= 0) 466: 83 6d f4 01 subl $0x1,-0xc(%ebp) 46a: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 46e: 79 d9 jns 449 <printint+0x8a> putc(fd, buf[i]); } 470: 83 c4 30 add $0x30,%esp 473: 5b pop %ebx 474: 5e pop %esi 475: 5d pop %ebp 476: c3 ret 00000477 <printf>: // Print to the given fd. Only understands %d, %x, %p, %s. void printf(int fd, char *fmt, ...) { 477: 55 push %ebp 478: 89 e5 mov %esp,%ebp 47a: 83 ec 38 sub $0x38,%esp char *s; int c, i, state; uint *ap; state = 0; 47d: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp) ap = (uint*)(void*)&fmt + 1; 484: 8d 45 0c lea 0xc(%ebp),%eax 487: 83 c0 04 add $0x4,%eax 48a: 89 45 e8 mov %eax,-0x18(%ebp) for(i = 0; fmt[i]; i++){ 48d: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp) 494: e9 7c 01 00 00 jmp 615 <printf+0x19e> c = fmt[i] & 0xff; 499: 8b 55 0c mov 0xc(%ebp),%edx 49c: 8b 45 f0 mov -0x10(%ebp),%eax 49f: 01 d0 add %edx,%eax 4a1: 0f b6 00 movzbl (%eax),%eax 4a4: 0f be c0 movsbl %al,%eax 4a7: 25 ff 00 00 00 and $0xff,%eax 4ac: 89 45 e4 mov %eax,-0x1c(%ebp) if(state == 0){ 4af: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) 4b3: 75 2c jne 4e1 <printf+0x6a> if(c == '%'){ 4b5: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp) 4b9: 75 0c jne 4c7 <printf+0x50> state = '%'; 4bb: c7 45 ec 25 00 00 00 movl $0x25,-0x14(%ebp) 4c2: e9 4a 01 00 00 jmp 611 <printf+0x19a> } else { putc(fd, c); 4c7: 8b 45 e4 mov -0x1c(%ebp),%eax 4ca: 0f be c0 movsbl %al,%eax 4cd: 89 44 24 04 mov %eax,0x4(%esp) 4d1: 8b 45 08 mov 0x8(%ebp),%eax 4d4: 89 04 24 mov %eax,(%esp) 4d7: e8 bb fe ff ff call 397 <putc> 4dc: e9 30 01 00 00 jmp 611 <printf+0x19a> } } else if(state == '%'){ 4e1: 83 7d ec 25 cmpl $0x25,-0x14(%ebp) 4e5: 0f 85 26 01 00 00 jne 611 <printf+0x19a> if(c == 'd'){ 4eb: 83 7d e4 64 cmpl $0x64,-0x1c(%ebp) 4ef: 75 2d jne 51e <printf+0xa7> printint(fd, *ap, 10, 1); 4f1: 8b 45 e8 mov -0x18(%ebp),%eax 4f4: 8b 00 mov (%eax),%eax 4f6: c7 44 24 0c 01 00 00 movl $0x1,0xc(%esp) 4fd: 00 4fe: c7 44 24 08 0a 00 00 movl $0xa,0x8(%esp) 505: 00 506: 89 44 24 04 mov %eax,0x4(%esp) 50a: 8b 45 08 mov 0x8(%ebp),%eax 50d: 89 04 24 mov %eax,(%esp) 510: e8 aa fe ff ff call 3bf <printint> ap++; 515: 83 45 e8 04 addl $0x4,-0x18(%ebp) 519: e9 ec 00 00 00 jmp 60a <printf+0x193> } else if(c == 'x' || c == 'p'){ 51e: 83 7d e4 78 cmpl $0x78,-0x1c(%ebp) 522: 74 06 je 52a <printf+0xb3> 524: 83 7d e4 70 cmpl $0x70,-0x1c(%ebp) 528: 75 2d jne 557 <printf+0xe0> printint(fd, *ap, 16, 0); 52a: 8b 45 e8 mov -0x18(%ebp),%eax 52d: 8b 00 mov (%eax),%eax 52f: c7 44 24 0c 00 00 00 movl $0x0,0xc(%esp) 536: 00 537: c7 44 24 08 10 00 00 movl $0x10,0x8(%esp) 53e: 00 53f: 89 44 24 04 mov %eax,0x4(%esp) 543: 8b 45 08 mov 0x8(%ebp),%eax 546: 89 04 24 mov %eax,(%esp) 549: e8 71 fe ff ff call 3bf <printint> ap++; 54e: 83 45 e8 04 addl $0x4,-0x18(%ebp) 552: e9 b3 00 00 00 jmp 60a <printf+0x193> } else if(c == 's'){ 557: 83 7d e4 73 cmpl $0x73,-0x1c(%ebp) 55b: 75 45 jne 5a2 <printf+0x12b> s = (char*)*ap; 55d: 8b 45 e8 mov -0x18(%ebp),%eax 560: 8b 00 mov (%eax),%eax 562: 89 45 f4 mov %eax,-0xc(%ebp) ap++; 565: 83 45 e8 04 addl $0x4,-0x18(%ebp) if(s == 0) 569: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 56d: 75 09 jne 578 <printf+0x101> s = "(null)"; 56f: c7 45 f4 70 08 00 00 movl $0x870,-0xc(%ebp) while(*s != 0){ 576: eb 1e jmp 596 <printf+0x11f> 578: eb 1c jmp 596 <printf+0x11f> putc(fd, *s); 57a: 8b 45 f4 mov -0xc(%ebp),%eax 57d: 0f b6 00 movzbl (%eax),%eax 580: 0f be c0 movsbl %al,%eax 583: 89 44 24 04 mov %eax,0x4(%esp) 587: 8b 45 08 mov 0x8(%ebp),%eax 58a: 89 04 24 mov %eax,(%esp) 58d: e8 05 fe ff ff call 397 <putc> s++; 592: 83 45 f4 01 addl $0x1,-0xc(%ebp) } else if(c == 's'){ s = (char*)*ap; ap++; if(s == 0) s = "(null)"; while(*s != 0){ 596: 8b 45 f4 mov -0xc(%ebp),%eax 599: 0f b6 00 movzbl (%eax),%eax 59c: 84 c0 test %al,%al 59e: 75 da jne 57a <printf+0x103> 5a0: eb 68 jmp 60a <printf+0x193> putc(fd, *s); s++; } } else if(c == 'c'){ 5a2: 83 7d e4 63 cmpl $0x63,-0x1c(%ebp) 5a6: 75 1d jne 5c5 <printf+0x14e> putc(fd, *ap); 5a8: 8b 45 e8 mov -0x18(%ebp),%eax 5ab: 8b 00 mov (%eax),%eax 5ad: 0f be c0 movsbl %al,%eax 5b0: 89 44 24 04 mov %eax,0x4(%esp) 5b4: 8b 45 08 mov 0x8(%ebp),%eax 5b7: 89 04 24 mov %eax,(%esp) 5ba: e8 d8 fd ff ff call 397 <putc> ap++; 5bf: 83 45 e8 04 addl $0x4,-0x18(%ebp) 5c3: eb 45 jmp 60a <printf+0x193> } else if(c == '%'){ 5c5: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp) 5c9: 75 17 jne 5e2 <printf+0x16b> putc(fd, c); 5cb: 8b 45 e4 mov -0x1c(%ebp),%eax 5ce: 0f be c0 movsbl %al,%eax 5d1: 89 44 24 04 mov %eax,0x4(%esp) 5d5: 8b 45 08 mov 0x8(%ebp),%eax 5d8: 89 04 24 mov %eax,(%esp) 5db: e8 b7 fd ff ff call 397 <putc> 5e0: eb 28 jmp 60a <printf+0x193> } else { // Unknown % sequence. Print it to draw attention. putc(fd, '%'); 5e2: c7 44 24 04 25 00 00 movl $0x25,0x4(%esp) 5e9: 00 5ea: 8b 45 08 mov 0x8(%ebp),%eax 5ed: 89 04 24 mov %eax,(%esp) 5f0: e8 a2 fd ff ff call 397 <putc> putc(fd, c); 5f5: 8b 45 e4 mov -0x1c(%ebp),%eax 5f8: 0f be c0 movsbl %al,%eax 5fb: 89 44 24 04 mov %eax,0x4(%esp) 5ff: 8b 45 08 mov 0x8(%ebp),%eax 602: 89 04 24 mov %eax,(%esp) 605: e8 8d fd ff ff call 397 <putc> } state = 0; 60a: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp) int c, i, state; uint *ap; state = 0; ap = (uint*)(void*)&fmt + 1; for(i = 0; fmt[i]; i++){ 611: 83 45 f0 01 addl $0x1,-0x10(%ebp) 615: 8b 55 0c mov 0xc(%ebp),%edx 618: 8b 45 f0 mov -0x10(%ebp),%eax 61b: 01 d0 add %edx,%eax 61d: 0f b6 00 movzbl (%eax),%eax 620: 84 c0 test %al,%al 622: 0f 85 71 fe ff ff jne 499 <printf+0x22> putc(fd, c); } state = 0; } } } 628: c9 leave 629: c3 ret 0000062a <free>: static Header base; static Header *freep; void free(void *ap) { 62a: 55 push %ebp 62b: 89 e5 mov %esp,%ebp 62d: 83 ec 10 sub $0x10,%esp Header *bp, *p; bp = (Header*)ap - 1; 630: 8b 45 08 mov 0x8(%ebp),%eax 633: 83 e8 08 sub $0x8,%eax 636: 89 45 f8 mov %eax,-0x8(%ebp) for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 639: a1 d8 0a 00 00 mov 0xad8,%eax 63e: 89 45 fc mov %eax,-0x4(%ebp) 641: eb 24 jmp 667 <free+0x3d> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 643: 8b 45 fc mov -0x4(%ebp),%eax 646: 8b 00 mov (%eax),%eax 648: 3b 45 fc cmp -0x4(%ebp),%eax 64b: 77 12 ja 65f <free+0x35> 64d: 8b 45 f8 mov -0x8(%ebp),%eax 650: 3b 45 fc cmp -0x4(%ebp),%eax 653: 77 24 ja 679 <free+0x4f> 655: 8b 45 fc mov -0x4(%ebp),%eax 658: 8b 00 mov (%eax),%eax 65a: 3b 45 f8 cmp -0x8(%ebp),%eax 65d: 77 1a ja 679 <free+0x4f> free(void *ap) { Header *bp, *p; bp = (Header*)ap - 1; for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 65f: 8b 45 fc mov -0x4(%ebp),%eax 662: 8b 00 mov (%eax),%eax 664: 89 45 fc mov %eax,-0x4(%ebp) 667: 8b 45 f8 mov -0x8(%ebp),%eax 66a: 3b 45 fc cmp -0x4(%ebp),%eax 66d: 76 d4 jbe 643 <free+0x19> 66f: 8b 45 fc mov -0x4(%ebp),%eax 672: 8b 00 mov (%eax),%eax 674: 3b 45 f8 cmp -0x8(%ebp),%eax 677: 76 ca jbe 643 <free+0x19> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) break; if(bp + bp->s.size == p->s.ptr){ 679: 8b 45 f8 mov -0x8(%ebp),%eax 67c: 8b 40 04 mov 0x4(%eax),%eax 67f: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx 686: 8b 45 f8 mov -0x8(%ebp),%eax 689: 01 c2 add %eax,%edx 68b: 8b 45 fc mov -0x4(%ebp),%eax 68e: 8b 00 mov (%eax),%eax 690: 39 c2 cmp %eax,%edx 692: 75 24 jne 6b8 <free+0x8e> bp->s.size += p->s.ptr->s.size; 694: 8b 45 f8 mov -0x8(%ebp),%eax 697: 8b 50 04 mov 0x4(%eax),%edx 69a: 8b 45 fc mov -0x4(%ebp),%eax 69d: 8b 00 mov (%eax),%eax 69f: 8b 40 04 mov 0x4(%eax),%eax 6a2: 01 c2 add %eax,%edx 6a4: 8b 45 f8 mov -0x8(%ebp),%eax 6a7: 89 50 04 mov %edx,0x4(%eax) bp->s.ptr = p->s.ptr->s.ptr; 6aa: 8b 45 fc mov -0x4(%ebp),%eax 6ad: 8b 00 mov (%eax),%eax 6af: 8b 10 mov (%eax),%edx 6b1: 8b 45 f8 mov -0x8(%ebp),%eax 6b4: 89 10 mov %edx,(%eax) 6b6: eb 0a jmp 6c2 <free+0x98> } else bp->s.ptr = p->s.ptr; 6b8: 8b 45 fc mov -0x4(%ebp),%eax 6bb: 8b 10 mov (%eax),%edx 6bd: 8b 45 f8 mov -0x8(%ebp),%eax 6c0: 89 10 mov %edx,(%eax) if(p + p->s.size == bp){ 6c2: 8b 45 fc mov -0x4(%ebp),%eax 6c5: 8b 40 04 mov 0x4(%eax),%eax 6c8: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx 6cf: 8b 45 fc mov -0x4(%ebp),%eax 6d2: 01 d0 add %edx,%eax 6d4: 3b 45 f8 cmp -0x8(%ebp),%eax 6d7: 75 20 jne 6f9 <free+0xcf> p->s.size += bp->s.size; 6d9: 8b 45 fc mov -0x4(%ebp),%eax 6dc: 8b 50 04 mov 0x4(%eax),%edx 6df: 8b 45 f8 mov -0x8(%ebp),%eax 6e2: 8b 40 04 mov 0x4(%eax),%eax 6e5: 01 c2 add %eax,%edx 6e7: 8b 45 fc mov -0x4(%ebp),%eax 6ea: 89 50 04 mov %edx,0x4(%eax) p->s.ptr = bp->s.ptr; 6ed: 8b 45 f8 mov -0x8(%ebp),%eax 6f0: 8b 10 mov (%eax),%edx 6f2: 8b 45 fc mov -0x4(%ebp),%eax 6f5: 89 10 mov %edx,(%eax) 6f7: eb 08 jmp 701 <free+0xd7> } else p->s.ptr = bp; 6f9: 8b 45 fc mov -0x4(%ebp),%eax 6fc: 8b 55 f8 mov -0x8(%ebp),%edx 6ff: 89 10 mov %edx,(%eax) freep = p; 701: 8b 45 fc mov -0x4(%ebp),%eax 704: a3 d8 0a 00 00 mov %eax,0xad8 } 709: c9 leave 70a: c3 ret 0000070b <morecore>: static Header* morecore(uint nu) { 70b: 55 push %ebp 70c: 89 e5 mov %esp,%ebp 70e: 83 ec 28 sub $0x28,%esp char *p; Header *hp; if(nu < 4096) 711: 81 7d 08 ff 0f 00 00 cmpl $0xfff,0x8(%ebp) 718: 77 07 ja 721 <morecore+0x16> nu = 4096; 71a: c7 45 08 00 10 00 00 movl $0x1000,0x8(%ebp) p = sbrk(nu * sizeof(Header)); 721: 8b 45 08 mov 0x8(%ebp),%eax 724: c1 e0 03 shl $0x3,%eax 727: 89 04 24 mov %eax,(%esp) 72a: e8 50 fc ff ff call 37f <sbrk> 72f: 89 45 f4 mov %eax,-0xc(%ebp) if(p == (char*)-1) 732: 83 7d f4 ff cmpl $0xffffffff,-0xc(%ebp) 736: 75 07 jne 73f <morecore+0x34> return 0; 738: b8 00 00 00 00 mov $0x0,%eax 73d: eb 22 jmp 761 <morecore+0x56> hp = (Header*)p; 73f: 8b 45 f4 mov -0xc(%ebp),%eax 742: 89 45 f0 mov %eax,-0x10(%ebp) hp->s.size = nu; 745: 8b 45 f0 mov -0x10(%ebp),%eax 748: 8b 55 08 mov 0x8(%ebp),%edx 74b: 89 50 04 mov %edx,0x4(%eax) free((void*)(hp + 1)); 74e: 8b 45 f0 mov -0x10(%ebp),%eax 751: 83 c0 08 add $0x8,%eax 754: 89 04 24 mov %eax,(%esp) 757: e8 ce fe ff ff call 62a <free> return freep; 75c: a1 d8 0a 00 00 mov 0xad8,%eax } 761: c9 leave 762: c3 ret 00000763 <malloc>: void* malloc(uint nbytes) { 763: 55 push %ebp 764: 89 e5 mov %esp,%ebp 766: 83 ec 28 sub $0x28,%esp Header *p, *prevp; uint nunits; nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; 769: 8b 45 08 mov 0x8(%ebp),%eax 76c: 83 c0 07 add $0x7,%eax 76f: c1 e8 03 shr $0x3,%eax 772: 83 c0 01 add $0x1,%eax 775: 89 45 ec mov %eax,-0x14(%ebp) if((prevp = freep) == 0){ 778: a1 d8 0a 00 00 mov 0xad8,%eax 77d: 89 45 f0 mov %eax,-0x10(%ebp) 780: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 784: 75 23 jne 7a9 <malloc+0x46> base.s.ptr = freep = prevp = &base; 786: c7 45 f0 d0 0a 00 00 movl $0xad0,-0x10(%ebp) 78d: 8b 45 f0 mov -0x10(%ebp),%eax 790: a3 d8 0a 00 00 mov %eax,0xad8 795: a1 d8 0a 00 00 mov 0xad8,%eax 79a: a3 d0 0a 00 00 mov %eax,0xad0 base.s.size = 0; 79f: c7 05 d4 0a 00 00 00 movl $0x0,0xad4 7a6: 00 00 00 } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 7a9: 8b 45 f0 mov -0x10(%ebp),%eax 7ac: 8b 00 mov (%eax),%eax 7ae: 89 45 f4 mov %eax,-0xc(%ebp) if(p->s.size >= nunits){ 7b1: 8b 45 f4 mov -0xc(%ebp),%eax 7b4: 8b 40 04 mov 0x4(%eax),%eax 7b7: 3b 45 ec cmp -0x14(%ebp),%eax 7ba: 72 4d jb 809 <malloc+0xa6> if(p->s.size == nunits) 7bc: 8b 45 f4 mov -0xc(%ebp),%eax 7bf: 8b 40 04 mov 0x4(%eax),%eax 7c2: 3b 45 ec cmp -0x14(%ebp),%eax 7c5: 75 0c jne 7d3 <malloc+0x70> prevp->s.ptr = p->s.ptr; 7c7: 8b 45 f4 mov -0xc(%ebp),%eax 7ca: 8b 10 mov (%eax),%edx 7cc: 8b 45 f0 mov -0x10(%ebp),%eax 7cf: 89 10 mov %edx,(%eax) 7d1: eb 26 jmp 7f9 <malloc+0x96> else { p->s.size -= nunits; 7d3: 8b 45 f4 mov -0xc(%ebp),%eax 7d6: 8b 40 04 mov 0x4(%eax),%eax 7d9: 2b 45 ec sub -0x14(%ebp),%eax 7dc: 89 c2 mov %eax,%edx 7de: 8b 45 f4 mov -0xc(%ebp),%eax 7e1: 89 50 04 mov %edx,0x4(%eax) p += p->s.size; 7e4: 8b 45 f4 mov -0xc(%ebp),%eax 7e7: 8b 40 04 mov 0x4(%eax),%eax 7ea: c1 e0 03 shl $0x3,%eax 7ed: 01 45 f4 add %eax,-0xc(%ebp) p->s.size = nunits; 7f0: 8b 45 f4 mov -0xc(%ebp),%eax 7f3: 8b 55 ec mov -0x14(%ebp),%edx 7f6: 89 50 04 mov %edx,0x4(%eax) } freep = prevp; 7f9: 8b 45 f0 mov -0x10(%ebp),%eax 7fc: a3 d8 0a 00 00 mov %eax,0xad8 return (void*)(p + 1); 801: 8b 45 f4 mov -0xc(%ebp),%eax 804: 83 c0 08 add $0x8,%eax 807: eb 38 jmp 841 <malloc+0xde> } if(p == freep) 809: a1 d8 0a 00 00 mov 0xad8,%eax 80e: 39 45 f4 cmp %eax,-0xc(%ebp) 811: 75 1b jne 82e <malloc+0xcb> if((p = morecore(nunits)) == 0) 813: 8b 45 ec mov -0x14(%ebp),%eax 816: 89 04 24 mov %eax,(%esp) 819: e8 ed fe ff ff call 70b <morecore> 81e: 89 45 f4 mov %eax,-0xc(%ebp) 821: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 825: 75 07 jne 82e <malloc+0xcb> return 0; 827: b8 00 00 00 00 mov $0x0,%eax 82c: eb 13 jmp 841 <malloc+0xde> nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; if((prevp = freep) == 0){ base.s.ptr = freep = prevp = &base; base.s.size = 0; } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 82e: 8b 45 f4 mov -0xc(%ebp),%eax 831: 89 45 f0 mov %eax,-0x10(%ebp) 834: 8b 45 f4 mov -0xc(%ebp),%eax 837: 8b 00 mov (%eax),%eax 839: 89 45 f4 mov %eax,-0xc(%ebp) return (void*)(p + 1); } if(p == freep) if((p = morecore(nunits)) == 0) return 0; } 83c: e9 70 ff ff ff jmp 7b1 <malloc+0x4e> } 841: c9 leave 842: c3 ret
tzulang/xv6_4
rm.asm
Assembly
mit
40,983
--- layout: page title: About Us permalink: /about/ --- Just started in 2015, we bring passion and energy to the industry backed by years of real-world experience. We strive to make our software both useful and usable, which can often be a fun challenge in today's fast-paced world. We are woman-owned small business based out of Lacey, Washington. ### What clients say > I really enjoyed working with Eve and would work with her again in a heartbeat. <!-- --> > After working with [Eve] for over a year, I can happily say it has been my pleasure and I look forward to working with her in the future. ### Contact [info@eve-corp.com](mailto:info@eve-corp.com) (360) 216-1738
eve-corp/eve-corp.github.io
about.md
Markdown
mit
688
# Editing a document with Vim Today was the first time I used Vim to edit a text file. I'd previously install Vim and attempted to play around with it, but I had no clue what I was doing and abandoned it until now. My issue was that I couldn't figure out how to actually add or edit the contents of a text file. Silly, I know, but it wasn't cut and dry and I didn't have the patience to figure it out at the time. So, here's what you do: ``` vim [existing file name, or create a new file] ``` This command will launch Vim in the terminal in 'Command mode' with either your existing file or a blank one. If there is already text in the file, you'll be able to see it, but NOT edit it. To do this, you'll need to type `i` to enter insert mode, where you'll have full control of your file. From here, you can type to your heart's content. When you're through, hit `esc` to re-enter command mode. From command mode, you can quit AND save your work using `:wq` or just quit by typing `:q`. This is pretty much the bare minimum needed to use Vim. I'm going to try and add it to my workflow for these TIL posts. It'd be neat to do everything straight form Terminal. I'll of course be back to update my progress learning Vim. I know it's extremely powerful and that's why I'm excited to learn more!
kingbryan/til
vim/editing-doc-with-vim-021116.md
Markdown
mit
1,299
/* * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * * Copyright (c) 2013, 2014 Damien P. George * Copyright (c) 2015 Daniel Campora * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #ifndef MICROPY_INCLUDED_LIB_TIMEUTILS_TIMEUTILS_H #define MICROPY_INCLUDED_LIB_TIMEUTILS_TIMEUTILS_H typedef int64_t mp_time_t; typedef struct _timeutils_struct_time_t { uint16_t tm_year; // i.e. 2014 uint8_t tm_mon; // 1..12 uint8_t tm_mday; // 1..31 uint8_t tm_hour; // 0..23 uint8_t tm_min; // 0..59 uint8_t tm_sec; // 0..59 uint8_t tm_wday; // 0..6 0 = Monday uint16_t tm_yday; // 1..366 } timeutils_struct_time_t; bool timeutils_is_leap_year(mp_uint_t year); mp_uint_t timeutils_days_in_month(mp_uint_t year, mp_uint_t month); mp_uint_t timeutils_year_day(mp_uint_t year, mp_uint_t month, mp_uint_t date); void timeutils_seconds_since_2000_to_struct_time(mp_uint_t t, timeutils_struct_time_t *tm); mp_uint_t timeutils_seconds_since_2000(mp_uint_t year, mp_uint_t month, mp_uint_t date, mp_uint_t hour, mp_uint_t minute, mp_uint_t second); mp_uint_t timeutils_mktime(mp_uint_t year, mp_int_t month, mp_int_t mday, mp_int_t hours, mp_int_t minutes, mp_int_t seconds); void timeutils_seconds_since_epoch_to_struct_time(mp_time_t t, timeutils_struct_time_t *tm); mp_time_t timeutils_seconds_since_epoch(mp_uint_t year, mp_uint_t month, mp_uint_t date, mp_uint_t hour, mp_uint_t minute, mp_uint_t second); mp_time_t timeutils_mktime_epoch(mp_uint_t year, mp_int_t month, mp_int_t mday, mp_int_t hours, mp_int_t minutes, mp_int_t seconds); #endif // MICROPY_INCLUDED_LIB_TIMEUTILS_TIMEUTILS_H
SHA2017-badge/micropython-esp32
lib/timeutils/timeutils.h
C
mit
2,785
package com.github.kolandroid.kol.model.elements.basic; import com.github.kolandroid.kol.model.elements.interfaces.ModelGroup; import java.util.ArrayList; import java.util.Iterator; public class BasicGroup<E> implements ModelGroup<E> { /** * Autogenerated by eclipse. */ private static final long serialVersionUID = 356357357356695L; private final ArrayList<E> items; private final String name; public BasicGroup(String name) { this(name, new ArrayList<E>()); } public BasicGroup(String name, ArrayList<E> items) { this.name = name; this.items = items; } @Override public int size() { return items.size(); } @Override public E get(int index) { return items.get(index); } @Override public void set(int index, E value) { items.set(index, value); } @Override public void remove(int index) { items.remove(index); } public void add(E item) { items.add(item); } @Override public String getName() { return name; } @Override public Iterator<E> iterator() { return items.iterator(); } }
Kasekopf/kolandroid
kol_base/src/main/java/com/github/kolandroid/kol/model/elements/basic/BasicGroup.java
Java
mit
1,193
import Ember from 'ember'; import { module, test } from 'qunit'; import startApp from 'superhero/tests/helpers/start-app'; import characterData from '../fixtures/character'; var application, server; module('Acceptance: Character', { beforeEach: function() { application = startApp(); var character = characterData(); server = new Pretender(function() { this.get('/v1/public/characters/1009609', function(request) { var responseData = JSON.stringify(character); return [ 200, {"Content-Type": "application/json"}, responseData ]; }); }); }, afterEach: function() { Ember.run(application, 'destroy'); server.shutdown(); } }); test('visiting /characters/1009609 shows character detail', function(assert) { assert.expect(3); visit('/characters/1009609'); andThen(function() { assert.equal(currentURL(), '/characters/1009609'); assert.equal(find('.heading').text(), 'Spider-Girl (May Parker)', 'Should show character heading'); assert.equal( find('.description').text(), "May \"Mayday\" Parker is the daughter of Spider-Man and Mary Jane Watson-Parker. Born with all her father's powers-and the same silly sense of humor-she's grown up to become one of Earth's most trusted heroes and a fitting tribute to her proud papa.", 'Should show character descripton' ); }); }); test('visiting /characters/1009609 shows key events for the character', function(assert) { assert.expect(2); visit('/characters/1009609'); andThen(function() { assert.equal(find('.events .event').length, 1, 'Should show one event'); assert.equal( find('.events .event:first').text(), 'Fear Itself', 'Should show event name' ); }); });
dtt101/superhero
tests/acceptance/character-test.js
JavaScript
mit
1,790
#ifndef CAVALIERI_RULE_TESTER_UTIL_H #define CAVALIERI_RULE_TESTER_UTIL_H #include <vector> #include <common/event.h> #include <external/mock_external.h> typedef std::pair<time_t, Event> mock_index_events_t; std::vector<Event> json_to_events(const std::string json, bool & ok); std::string results(std::vector<mock_index_events_t> index_events, std::vector<external_event_t> external_events); #endif
juruen/cavalieri
include/rule_tester_util.h
C
mit
425
#!/usr/bin/perl -w use strict; use Getopt::Long; use FindBin qw($Bin $Script); use File::Basename qw(basename dirname); use Data::Dumper; use lib "/home/zhoujj/my_lib/pm"; use bioinfo; &usage if @ARGV<1; #open IN,"" ||die "Can't open the file:$\n"; #open OUT,"" ||die "Can't open the file:$\n"; sub usage { my $usage = << "USAGE"; Description of this script. Author: zhoujj2013\@gmail.com Usage: $0 <para1> <para2> Example:perl $0 para1 para2 USAGE print "$usage"; exit(1); }; my ($all_int_f, $directed_int_f, $inferred_int_f, $ra_scored_inferred_int_f) = @ARGV; my %directed; open IN,"$directed_int_f" || die $!; while(<IN>){ chomp; my @t = split /\t/; unless(exists $directed{$t[0]}{$t[1]} || exists $directed{$t[1]}{$t[0]}){ my $score = 1; if($t[3] =~ /\d+$/){ $score = $t[3]; }else{ $score = 1; } $directed{$t[0]}{$t[1]} = $score; } } close IN; my %inferred; open IN,"$inferred_int_f" || die $!; while(<IN>){ chomp; my @t = split /\t/; unless(exists $inferred{$t[0]}{$t[1]} || exists $inferred{$t[1]}{$t[0]}){ my $score = 0; if($t[3] =~ /\d+$/){ $score = $t[3]; }else{ $score = 1; } $inferred{$t[0]}{$t[1]} = $score; } } close IN; my %ra; open IN,"$ra_scored_inferred_int_f" || die $!; while(<IN>){ chomp; my @t = split /\t/; unless(exists $ra{$t[0]}{$t[1]} || exists $ra{$t[1]}{$t[0]}){ $ra{$t[0]}{$t[1]} = $t[3]; } } close IN; my %int; open IN,"$all_int_f" || die $!; while(<IN>){ chomp; my @t = split /\t/; if(exists $directed{$t[0]}{$t[1]} || exists $directed{$t[1]}{$t[0]}){ my $score = abs($directed{$t[0]}{$t[1]}); $t[3] = $score; }elsif(exists $inferred{$t[0]}{$t[1]} || exists $inferred{$t[1]}{$t[0]}){ my $score1 = 0; if(exists $inferred{$t[0]}{$t[1]}){ $score1 = $inferred{$t[0]}{$t[1]}; }elsif(exists $inferred{$t[1]}{$t[0]}){ $score1 = $inferred{$t[1]}{$t[0]}; } my $score2 = 0; if(exists $ra{$t[0]}{$t[1]}){ $score2 = abs($ra{$t[0]}{$t[1]}); }elsif(exists $ra{$t[1]}{$t[0]}){ $score2 = abs($ra{$t[1]}{$t[0]}); } my $score = ($score1 + $score2)/2; $t[3] = $score; } print join "\t",@t; print "\n"; } close IN;
zhoujj2013/lncfuntk
bin/NetworkConstruction/bk/CalcConfidentScore.pl
Perl
mit
2,170
<table> <thead> <tr> <th>Nombre</th> <th>RUT</th> <th>Sexo</th> <th>Dirección</th> <th>Ciudad/Comuna</th> </tr> </thead> <tbody> </tbody> </table>
lgaticaq/info-rut
test/replies/person-fail.html
HTML
mit
196
\begin{tikzpicture} \begin{axis}[ width=9cm,height=6cm, ymin=0, ytick align=outside, axis x line*=bottom,axis y line*=left, tick label style={ /pgf/number format/assume math mode=true, /pgf/number format/1000 sep={} }, ylabel={\# citations}, % enlargelimits=0.15, ybar, bar width=12pt, ] \addplot[ fill=lightgray, nodes near coords, every node near coord/.append style={ /pgf/number format/assume math mode=true, font=\small } ] coordinates{ (2010,2) (2011,7) (2012,22) (2013,51) (2014,73) (2015,92) (2016,123) (2017,141) }; \end{axis} \end{tikzpicture}
jdferreira/vitae
images/histogram-citations.tex
TeX
mit
715
#!/usr/bin/env node (function () { var DirectoryLayout = require('../lib/index.js'), program = require('commander'), options; program .version('1.0.2') .usage('[options] <path, ...>') .option('-g, --generate <path> <output-directory-layout-file-path>', 'Generate directory layout') .option('-v, --verify <input-directory-layout-file-path> <path>', 'Verify directory layout') .parse(process.argv); if(program.generate) { options = { output: program.args[0] || 'layout.md', ignore: [] }; console.log('Generating layout for ' + program.generate + '... \n') DirectoryLayout .generate(program.generate, options) .then(function() { console.log('Layout generated at: ' + options.output); }); } else if(program.verify) { options = { root: program.args[0] }; console.log('Verifying layout for ' + options.root + ' ...\n'); DirectoryLayout .verify(program.verify, options) .then(function() { console.log('Successfully verified layout available in ' + program.verify + '.'); }); } }());
ApoorvSaxena/directory-layout
bin/index.js
JavaScript
mit
1,267
--- layout: post title: "Seek for Sole External Sponsor" date: 2017-08-08 18:00:00 isStaticPost: false --- We are seeking for one more sponsor except ShanghaiTech University to cover the expenses of awarding excellent presenters. Note that you cannot title the event, you can only show here at the website and in the final awarding ceremony.
xiongzhp/FoGG2017
_posts/2017-08-08-seek-for-sole-sponsor.markdown
Markdown
mit
345
var class_snowflake_1_1_game_1_1_game_database = [ [ "GameDatabase", "class_snowflake_1_1_game_1_1_game_database.html#a2f09c1f7fe18beaf8be1447e541f4d68", null ], [ "AddGame", "class_snowflake_1_1_game_1_1_game_database.html#a859513bbac24328df5d3fe2e47dbc183", null ], [ "GetAllGames", "class_snowflake_1_1_game_1_1_game_database.html#a7c43f2ccabe44f0491ae25e9b88bb07a", null ], [ "GetGameByUUID", "class_snowflake_1_1_game_1_1_game_database.html#ada7d853b053f0bbfbc6dea8eb89e85c4", null ], [ "GetGamesByName", "class_snowflake_1_1_game_1_1_game_database.html#ac1bbd90e79957e360dd5542f6052616e", null ], [ "GetGamesByPlatform", "class_snowflake_1_1_game_1_1_game_database.html#a2e93a35ea18a9caac9a6165cb33b5494", null ] ];
SnowflakePowered/snowflakepowered.github.io
doc/html/class_snowflake_1_1_game_1_1_game_database.js
JavaScript
mit
745
--- layout: api_index title: api breadcrumbs: true --- {% include api_listing.html %}
tempusjs/tempus-js.com
api/index.html
HTML
mit
85
package org.winterblade.minecraft.harmony.api.questing; import org.winterblade.minecraft.scripting.api.IScriptObjectDeserializer; import org.winterblade.minecraft.scripting.api.ScriptObjectDeserializer; /** * Created by Matt on 5/29/2016. */ public enum QuestStatus { INVALID, ACTIVE, LOCKED, COMPLETE, CLOSED; @ScriptObjectDeserializer(deserializes = QuestStatus.class) public static class Deserializer implements IScriptObjectDeserializer { @Override public Object Deserialize(Object input) { if(!String.class.isAssignableFrom(input.getClass())) return null; return QuestStatus.valueOf(input.toString().toUpperCase()); } } }
legendblade/CraftingHarmonics
api/src/main/java/org/winterblade/minecraft/harmony/api/questing/QuestStatus.java
Java
mit
697