text
stringlengths
2
14k
meta
dict
// Copyright 2011 the V8 project authors. 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 Google Inc. 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 // OWNER 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. // Flags: --allow-natives-syntax var a = new Array(10); function test_load_set_smi(a) { return a[0] = a[0] = 1; } test_load_set_smi(a); test_load_set_smi(a); test_load_set_smi(123); function test_load_set_smi_2(a) { return a[0] = a[0] = 1; } test_load_set_smi_2(a); %OptimizeFunctionOnNextCall(test_load_set_smi_2); test_load_set_smi_2(a); test_load_set_smi_2(0); %DeoptimizeFunction(test_load_set_smi_2); %ClearFunctionFeedback(test_load_set_smi_2); var b = new Object(); function test_load_set_smi_3(b) { return b[0] = b[0] = 1; } test_load_set_smi_3(b); test_load_set_smi_3(b); test_load_set_smi_3(123); function test_load_set_smi_4(b) { return b[0] = b[0] = 1; } test_load_set_smi_4(b); %OptimizeFunctionOnNextCall(test_load_set_smi_4); test_load_set_smi_4(b); test_load_set_smi_4(0); %DeoptimizeFunction(test_load_set_smi_4); %ClearFunctionFeedback(test_load_set_smi_4);
{ "pile_set_name": "Github" }
msgid "" msgstr "" "Project-Id-Version: plugin-update-checker\n" "POT-Creation-Date: 2017-11-24 17:02+0200\n" "PO-Revision-Date: 2020-03-21 15:14-0400\n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Poedit 2.3\n" "X-Poedit-Basepath: ..\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Poedit-SourceCharset: UTF-8\n" "X-Poedit-KeywordsList: __;_e;_x:1,2c;_x\n" "Last-Translator: \n" "Language: es_ES\n" "X-Poedit-SearchPath-0: .\n" #: Puc/v4p3/Plugin/UpdateChecker.php:395 msgid "Check for updates" msgstr "Comprobar si hay actualizaciones" #: Puc/v4p3/Plugin/UpdateChecker.php:548 #, php-format msgctxt "the plugin title" msgid "The %s plugin is up to date." msgstr "El plugin %s está actualizado." #: Puc/v4p3/Plugin/UpdateChecker.php:550 #, php-format msgctxt "the plugin title" msgid "A new version of the %s plugin is available." msgstr "Una nueva versión del %s plugin está disponible." #: Puc/v4p3/Plugin/UpdateChecker.php:552 #, php-format msgctxt "the plugin title" msgid "Could not determine if updates are available for %s." msgstr "No se pudo determinar si hay actualizaciones disponibles para %s." #: Puc/v4p3/Plugin/UpdateChecker.php:558 #, php-format msgid "Unknown update checker status \"%s\"" msgstr "Estado del comprobador de actualización desconocido «%s»" #: Puc/v4p3/Vcs/PluginUpdateChecker.php:95 msgid "There is no changelog available." msgstr "No hay un registro de cambios disponible."
{ "pile_set_name": "Github" }
// go run mksysnum.go https://gitweb.dragonflybsd.org/dragonfly.git/blob_plain/HEAD:/sys/kern/syscalls.master // Code generated by the command above; see README.md. DO NOT EDIT. // +build amd64,dragonfly package unix const ( // SYS_NOSYS = 0; // { int nosys(void); } syscall nosys_args int SYS_EXIT = 1 // { void exit(int rval); } SYS_FORK = 2 // { int fork(void); } SYS_READ = 3 // { ssize_t read(int fd, void *buf, size_t nbyte); } SYS_WRITE = 4 // { ssize_t write(int fd, const void *buf, size_t nbyte); } SYS_OPEN = 5 // { int open(char *path, int flags, int mode); } SYS_CLOSE = 6 // { int close(int fd); } SYS_WAIT4 = 7 // { int wait4(int pid, int *status, int options, struct rusage *rusage); } wait4 wait_args int SYS_LINK = 9 // { int link(char *path, char *link); } SYS_UNLINK = 10 // { int unlink(char *path); } SYS_CHDIR = 12 // { int chdir(char *path); } SYS_FCHDIR = 13 // { int fchdir(int fd); } SYS_MKNOD = 14 // { int mknod(char *path, int mode, int dev); } SYS_CHMOD = 15 // { int chmod(char *path, int mode); } SYS_CHOWN = 16 // { int chown(char *path, int uid, int gid); } SYS_OBREAK = 17 // { int obreak(char *nsize); } break obreak_args int SYS_GETFSSTAT = 18 // { int getfsstat(struct statfs *buf, long bufsize, int flags); } SYS_GETPID = 20 // { pid_t getpid(void); } SYS_MOUNT = 21 // { int mount(char *type, char *path, int flags, caddr_t data); } SYS_UNMOUNT = 22 // { int unmount(char *path, int flags); } SYS_SETUID = 23 // { int setuid(uid_t uid); } SYS_GETUID = 24 // { uid_t getuid(void); } SYS_GETEUID = 25 // { uid_t geteuid(void); } SYS_PTRACE = 26 // { int ptrace(int req, pid_t pid, caddr_t addr, int data); } SYS_RECVMSG = 27 // { int recvmsg(int s, struct msghdr *msg, int flags); } SYS_SENDMSG = 28 // { int sendmsg(int s, caddr_t msg, int flags); } SYS_RECVFROM = 29 // { int recvfrom(int s, caddr_t buf, size_t len, int flags, caddr_t from, int *fromlenaddr); } SYS_ACCEPT = 30 // { int accept(int s, caddr_t name, int *anamelen); } SYS_GETPEERNAME = 31 // { int getpeername(int fdes, caddr_t asa, int *alen); } SYS_GETSOCKNAME = 32 // { int getsockname(int fdes, caddr_t asa, int *alen); } SYS_ACCESS = 33 // { int access(char *path, int flags); } SYS_CHFLAGS = 34 // { int chflags(char *path, int flags); } SYS_FCHFLAGS = 35 // { int fchflags(int fd, int flags); } SYS_SYNC = 36 // { int sync(void); } SYS_KILL = 37 // { int kill(int pid, int signum); } SYS_GETPPID = 39 // { pid_t getppid(void); } SYS_DUP = 41 // { int dup(int fd); } SYS_PIPE = 42 // { int pipe(void); } SYS_GETEGID = 43 // { gid_t getegid(void); } SYS_PROFIL = 44 // { int profil(caddr_t samples, size_t size, size_t offset, u_int scale); } SYS_KTRACE = 45 // { int ktrace(const char *fname, int ops, int facs, int pid); } SYS_GETGID = 47 // { gid_t getgid(void); } SYS_GETLOGIN = 49 // { int getlogin(char *namebuf, u_int namelen); } SYS_SETLOGIN = 50 // { int setlogin(char *namebuf); } SYS_ACCT = 51 // { int acct(char *path); } SYS_SIGALTSTACK = 53 // { int sigaltstack(stack_t *ss, stack_t *oss); } SYS_IOCTL = 54 // { int ioctl(int fd, u_long com, caddr_t data); } SYS_REBOOT = 55 // { int reboot(int opt); } SYS_REVOKE = 56 // { int revoke(char *path); } SYS_SYMLINK = 57 // { int symlink(char *path, char *link); } SYS_READLINK = 58 // { int readlink(char *path, char *buf, int count); } SYS_EXECVE = 59 // { int execve(char *fname, char **argv, char **envv); } SYS_UMASK = 60 // { int umask(int newmask); } umask umask_args int SYS_CHROOT = 61 // { int chroot(char *path); } SYS_MSYNC = 65 // { int msync(void *addr, size_t len, int flags); } SYS_VFORK = 66 // { pid_t vfork(void); } SYS_SBRK = 69 // { int sbrk(int incr); } SYS_SSTK = 70 // { int sstk(int incr); } SYS_MUNMAP = 73 // { int munmap(void *addr, size_t len); } SYS_MPROTECT = 74 // { int mprotect(void *addr, size_t len, int prot); } SYS_MADVISE = 75 // { int madvise(void *addr, size_t len, int behav); } SYS_MINCORE = 78 // { int mincore(const void *addr, size_t len, char *vec); } SYS_GETGROUPS = 79 // { int getgroups(u_int gidsetsize, gid_t *gidset); } SYS_SETGROUPS = 80 // { int setgroups(u_int gidsetsize, gid_t *gidset); } SYS_GETPGRP = 81 // { int getpgrp(void); } SYS_SETPGID = 82 // { int setpgid(int pid, int pgid); } SYS_SETITIMER = 83 // { int setitimer(u_int which, struct itimerval *itv, struct itimerval *oitv); } SYS_SWAPON = 85 // { int swapon(char *name); } SYS_GETITIMER = 86 // { int getitimer(u_int which, struct itimerval *itv); } SYS_GETDTABLESIZE = 89 // { int getdtablesize(void); } SYS_DUP2 = 90 // { int dup2(int from, int to); } SYS_FCNTL = 92 // { int fcntl(int fd, int cmd, long arg); } SYS_SELECT = 93 // { int select(int nd, fd_set *in
{ "pile_set_name": "Github" }
<?php /** * SimplePie * * A PHP-Based RSS and Atom Feed Framework. * Takes the hard work out of managing a complete RSS/Atom solution. * * Copyright (c) 2004-2016, Ryan Parman, Geoffrey Sneddon, Ryan McCue, and contributors * 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 the SimplePie Team 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 HOLDERS * AND 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. * * @package SimplePie * @copyright 2004-2016 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon * @author Ryan McCue * @link http://simplepie.org/ SimplePie * @license http://www.opensource.org/licenses/bsd-license.php BSD License */ /** * Date Parser * * @package SimplePie * @subpackage Parsing */ class SimplePie_Parse_Date { /** * Input data * * @access protected * @var string */ var $date; /** * List of days, calendar day name => ordinal day number in the week * * @access protected * @var array */ var $day = array( // English 'mon' => 1, 'monday' => 1, 'tue' => 2, 'tuesday' => 2, 'wed' => 3, 'wednesday' => 3, 'thu' => 4, 'thursday' => 4, 'fri' => 5, 'friday' => 5, 'sat' => 6, 'saturday' => 6, 'sun' => 7, 'sunday' => 7, // Dutch 'maandag' => 1, 'dinsdag' => 2, 'woensdag' => 3, 'donderdag' => 4, 'vrijdag' => 5, 'zaterdag' => 6, 'zondag' => 7, // French 'lundi' => 1, 'mardi' => 2, 'mercredi' => 3, 'jeudi' => 4, 'vendredi' => 5, 'samedi' => 6, 'dimanche' => 7, // German 'montag' => 1, 'dienstag' => 2, 'mittwoch' => 3, 'donnerstag' => 4, 'freitag' => 5, 'samstag' => 6, 'sonnabend' => 6, 'sonntag' => 7, // Italian 'lunedì' => 1, 'martedì' => 2, 'mercoledì' => 3, 'giovedì' => 4, 'venerdì' => 5, 'sabato' => 6, 'domenica' => 7, // Spanish 'lunes' => 1, 'martes' => 2, 'miércoles' => 3, 'jueves' => 4, 'viernes' => 5, 'sábado' => 6, 'domingo' => 7, // Finnish 'maanantai' => 1, 'tiistai' => 2, 'keskiviikko' => 3, 'torstai' => 4, 'perjantai' => 5, 'lauantai' => 6, 'sunnuntai' => 7, // Hungarian 'hétfő' => 1, 'kedd' => 2, 'szerda' => 3, 'csütörtok' => 4, 'péntek' => 5, 'szombat' => 6, 'vasárnap' => 7, // Greek 'Δευ' => 1, 'Τρι' => 2, 'Τετ' => 3, 'Πεμ' => 4, 'Παρ' => 5, 'Σαβ' => 6, 'Κυρ' => 7, ); /** * List of months, calendar month name => calendar month number * * @access protected * @var array */ var $month = array( // English 'jan' => 1, 'january' => 1, 'feb' => 2, 'february' => 2, 'mar' => 3, 'march' => 3, 'apr' => 4, 'april' => 4, 'may' => 5, // No long form of May 'jun' => 6, 'june' => 6, 'jul' => 7, 'july' => 7, 'aug' => 8, 'august' => 8, 'sep' => 9, 'september' => 9, 'oct' => 10, 'october' => 10, 'nov' => 11, 'november' => 11, 'dec' => 12, 'december' => 12, // Dutch 'januari' => 1, 'februari' => 2, 'maart' => 3, 'april' => 4, 'mei' => 5, 'juni' => 6, 'juli' => 7, 'augustus' => 8, 'september' => 9, 'oktober' => 10, 'november' => 11, 'december' => 12, // French 'janvier' => 1, 'février' => 2, 'mars' => 3, 'avril' => 4, 'mai' => 5, 'juin' => 6, 'juillet' => 7, 'août' => 8, 'septembre' => 9, 'octobre' => 10, 'novembre' => 11, 'décembre' => 12, // German 'januar' => 1, 'februar' => 2, 'märz' => 3, 'april' => 4, 'mai' => 5, 'juni' => 6, 'juli' => 7, 'august' => 8, 'september' => 9, 'oktober' => 10, 'november' => 11, 'dezember' => 12, // Italian 'gennaio' => 1, 'febbraio' => 2, 'marzo' => 3, 'aprile' => 4, 'maggio' => 5, 'giugno' => 6, 'luglio' => 7, 'agosto' => 8, 'settembre' => 9, 'ottobre' => 10, 'novembre' => 11, 'dicembre' => 12, // Spanish 'enero'
{ "pile_set_name": "Github" }
// Created by cgo -godefs - DO NOT EDIT // cgo -godefs defs_linux.go package ipv4 const ( sysIP_TOS = 0x1 sysIP_TTL = 0x2 sysIP_HDRINCL = 0x3 sysIP_OPTIONS = 0x4 sysIP_ROUTER_ALERT = 0x5 sysIP_RECVOPTS = 0x6 sysIP_RETOPTS = 0x7 sysIP_PKTINFO = 0x8 sysIP_PKTOPTIONS = 0x9 sysIP_MTU_DISCOVER = 0xa sysIP_RECVERR = 0xb sysIP_RECVTTL = 0xc sysIP_RECVTOS = 0xd sysIP_MTU = 0xe sysIP_FREEBIND = 0xf sysIP_TRANSPARENT = 0x13 sysIP_RECVRETOPTS = 0x7 sysIP_ORIGDSTADDR = 0x14 sysIP_RECVORIGDSTADDR = 0x14 sysIP_MINTTL = 0x15 sysIP_NODEFRAG = 0x16 sysIP_UNICAST_IF = 0x32 sysIP_MULTICAST_IF = 0x20 sysIP_MULTICAST_TTL = 0x21 sysIP_MULTICAST_LOOP = 0x22 sysIP_ADD_MEMBERSHIP = 0x23 sysIP_DROP_MEMBERSHIP = 0x24 sysIP_UNBLOCK_SOURCE = 0x25 sysIP_BLOCK_SOURCE = 0x26 sysIP_ADD_SOURCE_MEMBERSHIP = 0x27 sysIP_DROP_SOURCE_MEMBERSHIP = 0x28 sysIP_MSFILTER = 0x29 sysMCAST_JOIN_GROUP = 0x2a sysMCAST_LEAVE_GROUP = 0x2d sysMCAST_JOIN_SOURCE_GROUP = 0x2e sysMCAST_LEAVE_SOURCE_GROUP = 0x2f sysMCAST_BLOCK_SOURCE = 0x2b sysMCAST_UNBLOCK_SOURCE = 0x2c sysMCAST_MSFILTER = 0x30 sysIP_MULTICAST_ALL = 0x31 sysICMP_FILTER = 0x1 sysSO_EE_ORIGIN_NONE = 0x0 sysSO_EE_ORIGIN_LOCAL = 0x1 sysSO_EE_ORIGIN_ICMP = 0x2 sysSO_EE_ORIGIN_ICMP6 = 0x3 sysSO_EE_ORIGIN_TXSTATUS = 0x4 sysSO_EE_ORIGIN_TIMESTAMPING = 0x4 sysSOL_SOCKET = 0x1 sysSO_ATTACH_FILTER = 0x1a sizeofKernelSockaddrStorage = 0x80 sizeofSockaddrInet = 0x10 sizeofInetPktinfo = 0xc sizeofSockExtendedErr = 0x10 sizeofIPMreq = 0x8 sizeofIPMreqn = 0xc sizeofIPMreqSource = 0xc sizeofGroupReq = 0x88 sizeofGroupSourceReq = 0x108 sizeofICMPFilter = 0x4 sizeofSockFprog = 0x10 ) type kernelSockaddrStorage struct { Family uint16 X__data [126]int8 } type sockaddrInet struct { Family uint16 Port uint16 Addr [4]byte /* in_addr */ X__pad [8]uint8 } type inetPktinfo struct { Ifindex int32 Spec_dst [4]byte /* in_addr */ Addr [4]byte /* in_addr */ } type sockExtendedErr struct { Errno uint32 Origin uint8 Type uint8 Code uint8 Pad uint8 Info uint32 Data uint32 } type ipMreq struct { Multiaddr [4]byte /* in_addr */ Interface [4]byte /* in_addr */ } type ipMreqn struct { Multiaddr [4]byte /* in_addr */ Address [4]byte /* in_addr */ Ifindex int32 } type ipMreqSource struct { Multiaddr uint32 Interface uint32 Sourceaddr uint32 } type groupReq struct { Interface uint32 Pad_cgo_0 [4]byte Group kernelSockaddrStorage } type groupSourceReq struct { Interface uint32 Pad_cgo_0 [4]byte Group kernelSockaddrStorage Source kernelSockaddrStorage } type icmpFilter struct { Data uint32 } type sockFProg struct { Len uint16 Pad_cgo_0 [6]byte Filter *sockFilter } type sockFilter struct { Code uint16 Jt uint8 Jf uint8 K uint32 }
{ "pile_set_name": "Github" }
using Engine.Exceptions; using Engine.Model.Client; using Engine.Model.Common.Entities; using OpenAL; using System; using System.Collections.Generic; using System.Security; using System.Threading; namespace Engine.Audio.OpenAL { public sealed class OpenALPlayer : MarshalByRefObject, IPlayer { #region fields private readonly object _syncObject = new object(); private bool _disposed; private AudioContext _context; private Dictionary<UserId, SourceDescription> _sources; #endregion #region nested types private class SourceDescription { public int Id { get; private set; } public long LastPlayedNumber { get; set; } [SecurityCritical] public SourceDescription(int soueceId) { Id = soueceId; } [SecurityCritical] public ALFormat GetFormat(SoundPack pack) { if (pack.Channels != 2 && pack.Channels != 1) throw new ArgumentException("channels"); if (pack.BitPerChannel != 8 && pack.BitPerChannel != 16) throw new ArgumentException("bitPerChannel"); if (pack.Channels == 1) return pack.BitPerChannel == 8 ? ALFormat.Mono8 : ALFormat.Mono16; else return pack.BitPerChannel == 8 ? ALFormat.Stereo8 : ALFormat.Stereo16; } } #endregion #region constructor [SecurityCritical] public OpenALPlayer(string deviceName = null) { if (string.IsNullOrEmpty(deviceName) || IsInited) return; Initialize(deviceName); } #endregion #region properties public bool IsInited { [SecuritySafeCritical] get { return Interlocked.CompareExchange(ref _context, null, null) != null; } } public IList<string> Devices { [SecuritySafeCritical] get { try { return AudioContext.AvailableDevices; } catch (Exception) { return new List<string>(); } } } #endregion #region methods [SecurityCritical] private void Initialize(string deviceName) { try { lock (_syncObject) { _sources = new Dictionary<UserId, SourceDescription>(); if (string.IsNullOrEmpty(deviceName)) deviceName = AudioContext.DefaultDevice; if (!AudioContext.AvailableDevices.Contains(deviceName)) deviceName = AudioContext.DefaultDevice; _context = new AudioContext(deviceName); } } catch (Exception e) { if (_context != null) _context.Dispose(); _context = null; ClientModel.Logger.Write(e); throw new ModelException(ErrorCode.AudioNotEnabled, "Audio player do not initialized.", e, deviceName); } } [SecuritySafeCritical] public void SetOptions(string deviceName) { if (IsInited) { Stop(); _context.Dispose(); } Initialize(deviceName); } [SecuritySafeCritical] public void Enqueue(UserId id, long packNumber, SoundPack pack) { if (!IsInited) return; lock (_syncObject) { SourceDescription source; if (!_sources.TryGetValue(id, out source)) { int sourceId = AL.GenSource(); source = new SourceDescription(sourceId); _sources.Add(id, source); } if (source.LastPlayedNumber > packNumber) return; source.LastPlayedNumber = packNumber; int bufferId = AL.GenBuffer(); AL.BufferData(bufferId, source.GetFormat(pack), pack.Data, pack.Data.Length, pack.Frequency); AL.SourceQueueBuffer(source.Id, bufferId); if (AL.GetSourceState(source.Id) != ALSourceState.Playing) AL.SourcePlay(source.Id); ClearBuffers(source, 0); } } [SecuritySafeCritical] public void Stop(UserId id) { if (!IsInited) return; lock (_syncObject) { SourceDescription source; if (!_sources.TryGetValue(id, out source)) return; Stop(source); _sources.Remove(id); } } [SecuritySafeCritical] public void Stop() { if (!IsInited) return; lock (_syncObject) { foreach (SourceDescription source in _sources.Values) Stop(source); _sources.Clear(); } } [SecurityCritical] private void Stop(SourceDescription source) { int count; AL.GetSource(source.Id, ALGetSourcei.BuffersQueued, out count); ClearBuffers(source, count); AL.DeleteSource(source.Id); } [SecurityCritical] private void ClearBuffers(UserId id, int input) { SourceDescription source; if (!_sources.TryGetValue(id, out source)) return; ClearBuffers(source, input); } [SecurityCritical] private void ClearBuffers(SourceDescription source, int count) { if (_context == null) return; int[] freedbuffers; if (count == 0) { int buffersProcessed; AL.GetSource(source.Id, ALGetSourcei.BuffersProcessed, out buffersProcessed); if (buffersProcessed == 0) return; freedbuffers = AL.SourceUnqueueBuffers(source.Id, buffersProcessed); } else freedbuffers = AL.SourceUnqueueBuffers(source.Id, count); AL.DeleteBuffers(freedbuffers); } #endregion #region IDisposable [SecuritySafeCritical] public void Dispose() { if (_disposed) return; _disposed = true; if (_context != null) { Stop(); _context.Dispose(); } } #endregion } }
{ "pile_set_name": "Github" }
#ifndef __CONCRETE_PRODUCT_1_H__ #define __CONCRETE_PRODUCT_1_H__ #include "product.h" struct concrete_product_1 { struct product product; }; void concrete_product_1_init(struct concrete_product_1 *); #endif /* __CONCRETE_PRODUCT_1_H__ */
{ "pile_set_name": "Github" }
p edge 30 30 e 0 8 e 1 6 e 2 7 e 3 26 e 4 27 e 5 23 e 6 20 e 7 16 e 8 12 e 9 10 e 10 3 e 11 5 e 12 22 e 13 18 e 14 2 e 15 29 e 16 15 e 17 11 e 18 17 e 19 28 e 20 21 e 21 24 e 22 9 e 23 14 e 24 0 e 25 19 e 26 25 e 27 13 e 28 4 e 29 1
{ "pile_set_name": "Github" }
/* Copyright 2016 The Kubernetes Authors. 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. */ // +k8s:deepcopy-gen=package // +k8s:protobuf-gen=package // +k8s:openapi-gen=true // +k8s:prerelease-lifecycle-gen=true // +groupName=certificates.k8s.io package v1beta1 // import "k8s.io/api/certificates/v1beta1"
{ "pile_set_name": "Github" }
#import <Foundation/Foundation.h> /** * MurmurHash2 was written by Austin Appleby, and is placed in the public domain. * http://code.google.com/p/smhasher **/ #ifndef YapDatabase_YapMurmurHash_h #define YapDatabase_YapMurmurHash_h NSUInteger YapMurmurHash2(NSUInteger hash1, NSUInteger hash2); NSUInteger YapMurmurHash3(NSUInteger hash1, NSUInteger hash2, NSUInteger hash3); NSUInteger YapMurmurHashData(NSData *data); int32_t YapMurmurHashData_32(NSData *data); int64_t YapMurmurHashData_64(NSData *data); #endif
{ "pile_set_name": "Github" }
/** * Thai translation for bootstrap-datetimepicker * Suchau Jiraprapot <seroz24@gmail.com> */ ;(function($){ $.fn.datetimepicker.dates['th'] = { days: ["อาทิตย์", "จันทร์", "อังคาร", "พุธ", "พฤหัส", "ศุกร์", "เสาร์", "อาทิตย์"], daysShort: ["อา", "จ", "อ", "พ", "พฤ", "ศ", "ส", "อา"], daysMin: ["อา", "จ", "อ", "พ", "พฤ", "ศ", "ส", "อา"], months: ["มกราคม", "กุมภาพันธ์", "มีนาคม", "เมษายน", "พฤษภาคม", "มิถุนายน", "กรกฎาคม", "สิงหาคม", "กันยายน", "ตุลาคม", "พฤศจิกายน", "ธันวาคม"], monthsShort: ["ม.ค.", "ก.พ.", "มี.ค.", "เม.ย.", "พ.ค.", "มิ.ย.", "ก.ค.", "ส.ค.", "ก.ย.", "ต.ค.", "พ.ย.", "ธ.ค."], today: "วันนี้", suffix: [], meridiem: [] }; }(jQuery));
{ "pile_set_name": "Github" }
classes=80 train=./data/coco_1000img.txt valid=./data/coco_1000val.txt names=data/coco.names backup=backup/ eval=coco
{ "pile_set_name": "Github" }
/**************************************************************************** * net/socket/socket.c * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The * ASF licenses this file to you 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. * ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ #include <nuttx/config.h> #include <sys/socket.h> #include <errno.h> #include <assert.h> #include <debug.h> #include "usrsock/usrsock.h" #include "socket/socket.h" #ifdef CONFIG_NET /**************************************************************************** * Public Functions ****************************************************************************/ /**************************************************************************** * Name: psock_socket * * Description: * socket() creates an endpoint for communication and returns a socket * structure. * * Input Parameters: * domain (see sys/socket.h) * type (see sys/socket.h) * protocol (see sys/socket.h) * psock A pointer to a user allocated socket structure to be * initialized. * * Returned Value: * Returns zero (OK) on success. On failure, it returns a negated errno * value to indicate the nature of the error: * * EACCES * Permission to create a socket of the specified type and/or protocol * is denied. * EAFNOSUPPORT * The implementation does not support the specified address family. * EINVAL * Unknown protocol, or protocol family not available. * EMFILE * Process file table overflow. * ENFILE * The system limit on the total number of open files has been reached. * ENOBUFS or ENOMEM * Insufficient memory is available. The socket cannot be created until * sufficient resources are freed. * EPROTONOSUPPORT * The protocol type or the specified protocol is not supported within * this domain. * ****************************************************************************/ int psock_socket(int domain, int type, int protocol, FAR struct socket *psock) { FAR const struct sock_intf_s *sockif = NULL; int ret; /* Initialize the socket structure */ psock->s_crefs = 1; psock->s_domain = domain; psock->s_conn = NULL; #if defined(CONFIG_NET_TCP_WRITE_BUFFERS) || defined(CONFIG_NET_UDP_WRITE_BUFFERS) psock->s_sndcb = NULL; #endif if (type & SOCK_CLOEXEC) { psock->s_flags |= _SF_CLOEXEC; } if (type & SOCK_NONBLOCK) { psock->s_flags |= _SF_NONBLOCK; } type &= SOCK_TYPE_MASK; psock->s_type = type; #ifdef CONFIG_NET_USRSOCK if (domain != PF_LOCAL && domain != PF_UNSPEC) { /* Handle special setup for USRSOCK sockets (user-space networking * stack). */ ret = g_usrsock_sockif.si_setup(psock, protocol); psock->s_sockif = &g_usrsock_sockif; return ret; } #endif /* CONFIG_NET_USRSOCK */ /* Get the socket interface */ sockif = net_sockif(domain, type, protocol); if (sockif == NULL) { nerr("ERROR: socket address family unsupported: %d\n", domain); return -EAFNOSUPPORT; } /* The remaining of the socket initialization depends on the address * family. */ DEBUGASSERT(sockif->si_setup != NULL); psock->s_sockif = sockif; ret = sockif->si_setup(psock, protocol); if (ret < 0) { nerr("ERROR: socket si_setup() failed: %d\n", ret); return ret; } return OK; } /**************************************************************************** * Name: socket * * Description: * socket() creates an endpoint for communication and returns a descriptor. * * Input Parameters: * domain (see sys/socket.h) * type (see sys/socket.h) * protocol (see sys/socket.h) * * Returned Value: * A non-negative socket descriptor on success; -1 on error with errno set * appropriately. * * EACCES * Permission to create a socket of the specified type and/or protocol * is denied. * EAFNOSUPPORT * The implementation does not support the specified address family. * EINVAL * Unknown protocol, or protocol family not available. * EMFILE * Process file table overflow. * ENFILE * The system limit on the total number of open files has been reached. * ENOBUFS or ENOMEM * Insufficient memory is available. The socket cannot be created until * sufficient resources are freed. * EPROTONOSUPPORT * The protocol type or the specified protocol is not supported within * this domain. * * Assumptions: * ****************************************************************************/ int socket(int domain, int type, int protocol) { FAR struct socket *psock; int errcode; int sockfd; int ret; /* Allocate a socket descriptor */ sockfd = sockfd_allocate(0); if (sockfd < 0) { nerr("ERROR: Failed to allocate a socket descriptor\n"); errcode = ENFILE; goto errout; } /* Get the underlying socket structure */ psock = sockfd_socket(sockfd); if (!psock) { errcode = ENOSYS; /* should not happen */ goto errout_with_sockfd; } /* Initialize the socket structure */ ret = psock_socket(domain, type, protocol, psock); if (ret < 0) { nerr("ERROR: psock_socket() failed: %d\n", ret); errcode = -ret; goto errout_with_sockfd; } /* The socket has been successfully initialized */ psock->s_flags |= _SF_INITD; return sockfd; errout_with_sockfd: sockfd_release(sockfd); errout: set_errno(errcode); return ERROR; } #endif /* CONFIG_NET */
{ "pile_set_name": "Github" }
fileFormatVersion: 2 guid: 326628f9cad8d714e999eaf89d7f9041 folderAsset: yes DefaultImporter: externalObjects: {} userData: assetBundleName: assetBundleVariant:
{ "pile_set_name": "Github" }
/* * Copyright (C) 2016 - 2018 ExoMedia Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.devbrackets.android.exomedia.core.video.mp; import android.content.Context; import android.media.AudioManager; import android.media.MediaPlayer; import android.media.PlaybackParams; import android.net.Uri; import android.os.Build; import android.support.annotation.FloatRange; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.util.Log; import android.view.Surface; import com.devbrackets.android.exomedia.core.ListenerMux; import com.devbrackets.android.exomedia.core.exoplayer.WindowInfo; import com.devbrackets.android.exomedia.core.video.ClearableSurface; import java.io.IOException; import java.util.Map; import static android.content.ContentValues.TAG; /** * A delegated object used to handle the majority of the * functionality for the "Native" video view implementation * to simplify support for both the {@link android.view.TextureView} * and {@link android.view.SurfaceView} implementations */ @SuppressWarnings("WeakerAccess") public class NativeVideoDelegate { public interface Callback { void videoSizeChanged(int width, int height); } public enum State { ERROR, IDLE, PREPARING, PREPARED, PLAYING, PAUSED, COMPLETED } protected Map<String, String> headers; protected State currentState = State.IDLE; protected Context context; protected Callback callback; protected ClearableSurface clearableSurface; protected MediaPlayer mediaPlayer; protected boolean playRequested = false; protected long requestedSeek; protected int currentBufferPercent; @FloatRange(from = 0.0, to = 1.0) protected float requestedVolume = 1.0f; protected ListenerMux listenerMux; @NonNull protected InternalListeners internalListeners = new InternalListeners(); @Nullable protected MediaPlayer.OnCompletionListener onCompletionListener; @Nullable protected MediaPlayer.OnPreparedListener onPreparedListener; @Nullable protected MediaPlayer.OnBufferingUpdateListener onBufferingUpdateListener; @Nullable protected MediaPlayer.OnSeekCompleteListener onSeekCompleteListener; @Nullable protected MediaPlayer.OnErrorListener onErrorListener; @Nullable protected MediaPlayer.OnInfoListener onInfoListener; public NativeVideoDelegate(@NonNull Context context, @NonNull Callback callback, @NonNull ClearableSurface clearableSurface) { this.context = context; this.callback = callback; this.clearableSurface = clearableSurface; initMediaPlayer(); currentState = State.IDLE; } public void start() { if (isReady()) { mediaPlayer.start(); currentState = State.PLAYING; } playRequested = true; listenerMux.setNotifiedCompleted(false); } public void pause() { if (isReady() && mediaPlayer.isPlaying()) { mediaPlayer.pause(); currentState = State.PAUSED; } playRequested = false; } public long getDuration() { if (!listenerMux.isPrepared() || !isReady()) { return 0; } return mediaPlayer.getDuration(); } public long getCurrentPosition() { if (!listenerMux.isPrepared() || !isReady()) { return 0; } return mediaPlayer.getCurrentPosition(); } @FloatRange(from = 0.0, to = 1.0) public float getVolume() { return requestedVolume; } public boolean setVolume(@FloatRange(from = 0.0, to = 1.0) float volume) { requestedVolume = volume; mediaPlayer.setVolume(volume, volume); return true; } public void seekTo(long milliseconds) { if (isReady()) { mediaPlayer.seekTo((int) milliseconds); requestedSeek = 0; } else { requestedSeek = milliseconds; } } public boolean isPlaying() { return isReady() && mediaPlayer.isPlaying(); } public int getBufferPercentage() { if (mediaPlayer != null) { return currentBufferPercent; } return 0; } @Nullable public WindowInfo getWindowInfo() { return null; } public boolean setPlaybackSpeed(float speed) { // Marshmallow+ support setting the playback speed natively if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { PlaybackParams params = new PlaybackParams(); params.setSpeed(speed); mediaPlayer.setPlaybackParams(params); return true; } return false; } public float getPlaybackSpeed() { // Marshmallow+ support setting the playback speed natively if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { return mediaPlayer.getPlaybackParams().getSpeed(); } return 1F; } /** * Performs the functionality to stop the video in playback * * @param clearSurface <code>true</code> if the surface should be cleared */ public void stopPlayback(boolean clearSurface) { currentState = State.IDLE; if (isReady()) { try { mediaPlayer.stop(); } catch (Exception e) { Log.d(TAG, "stopPlayback: error calling mediaPlayer.stop()", e); } } playRequested = false; if (clearSurface) { listenerMux.clearSurfaceWhenReady(clearableSurface); } } /** * Cleans up the resources being held. This should only be called when * destroying the video view */ public void suspend() { currentState = State.IDLE; try { mediaPlayer.reset(); mediaPlayer.release(); } catch (Exception e) { Log.d(TAG, "stopPlayback: error calling mediaPlayer.reset() or mediaPlayer.release()", e); } playRequested = false; } public boolean restart() { if (currentState != State.COMPLETED) { return false; } seekTo(0); start(); //Makes sure the listeners get the onPrepared callback listenerMux.setNotifiedPrepared(false); listenerMux.setNotifiedCompleted(false); return true; } /** * Sets video URI using specific headers. * * @param uri The Uri for the video to play * @param headers The headers for the URI request. * Note that the cross domain redirection is allowed by default, but that can be * changed with key/value pairs through the headers parameter with * "android-allow-cross-domain-redirect" as the key and "0" or "1" as the value * to disallow or allow cross domain redirection. */ public void setVideoURI(Uri uri, @Nullable Map<String, String> headers) { this.headers = headers; requestedSeek = 0; playRequested = false; openVideo(uri); } public void setListenerMux(ListenerMux listenerMux) { this.listenerMux = listenerMux; setOnCompletionListener(listenerMux); setOnPreparedListener(listenerMux);
{ "pile_set_name": "Github" }
using System; using UIKit; namespace Xamarin.Forms.Platform.iOS.UnitTests { internal static class ColorComparison { public static bool ARGBEquivalent(UIColor color1, UIColor color2) { color1.GetRGBA(out nfloat red1, out nfloat green1, out nfloat blue1, out nfloat alpha1); color2.GetRGBA(out nfloat red2, out nfloat green2, out nfloat blue2, out nfloat alpha2); const double tolerance = 0.000001; return Equal(red1, red2, tolerance) && Equal(green1, green2, tolerance) && Equal(blue1, blue2, tolerance) && Equal(alpha1, alpha2, tolerance); } static bool Equal(nfloat v1, nfloat v2, double tolerance) { return Math.Abs(v1 - v2) <= tolerance; } } }
{ "pile_set_name": "Github" }
/******************************************************************************/ #ifdef JEMALLOC_H_TYPES #endif /* JEMALLOC_H_TYPES */ /******************************************************************************/ #ifdef JEMALLOC_H_STRUCTS #endif /* JEMALLOC_H_STRUCTS */ /******************************************************************************/ #ifdef JEMALLOC_H_EXTERNS void *pages_map(void *addr, size_t size); void pages_unmap(void *addr, size_t size); void *pages_trim(void *addr, size_t alloc_size, size_t leadsize, size_t size); bool pages_commit(void *addr, size_t size); bool pages_decommit(void *addr, size_t size); bool pages_purge(void *addr, size_t size); #endif /* JEMALLOC_H_EXTERNS */ /******************************************************************************/ #ifdef JEMALLOC_H_INLINES #endif /* JEMALLOC_H_INLINES */ /******************************************************************************/
{ "pile_set_name": "Github" }
#ifndef VP8_RTCD_H_ #define VP8_RTCD_H_ #ifdef RTCD_C #define RTCD_EXTERN #else #define RTCD_EXTERN extern #endif /* * VP8 */ struct blockd; struct macroblockd; struct loop_filter_info; /* Encoder forward decls */ struct block; struct macroblock; struct variance_vtable; union int_mv; struct yv12_buffer_config; #ifdef __cplusplus extern "C" { #endif void vp8_bilinear_predict16x16_c(unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch); void vp8_bilinear_predict16x16_sse2(unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch); void vp8_bilinear_predict16x16_ssse3(unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch); RTCD_EXTERN void (*vp8_bilinear_predict16x16)(unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch); void vp8_bilinear_predict4x4_c(unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch); void vp8_bilinear_predict4x4_mmx(unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch); #define vp8_bilinear_predict4x4 vp8_bilinear_predict4x4_mmx void vp8_bilinear_predict8x4_c(unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch); void vp8_bilinear_predict8x4_mmx(unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch); #define vp8_bilinear_predict8x4 vp8_bilinear_predict8x4_mmx void vp8_bilinear_predict8x8_c(unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch); void vp8_bilinear_predict8x8_sse2(unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch); void vp8_bilinear_predict8x8_ssse3(unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch); RTCD_EXTERN void (*vp8_bilinear_predict8x8)(unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch); void vp8_blend_b_c(unsigned char *y, unsigned char *u, unsigned char *v, int y1, int u1, int v1, int alpha, int stride); #define vp8_blend_b vp8_blend_b_c void vp8_blend_mb_inner_c(unsigned char *y, unsigned char *u, unsigned char *v, int y1, int u1, int v1, int alpha, int stride); #define vp8_blend_mb_inner vp8_blend_mb_inner_c void vp8_blend_mb_outer_c(unsigned char *y, unsigned char *u, unsigned char *v, int y1, int u1, int v1, int alpha, int stride); #define vp8_blend_mb_outer vp8_blend_mb_outer_c int vp8_block_error_c(short *coeff, short *dqcoeff); int vp8_block_error_sse2(short *coeff, short *dqcoeff); #define vp8_block_error vp8_block_error_sse2 void vp8_copy32xn_c(const unsigned char *src_ptr, int source_stride, unsigned char *dst_ptr, int dst_stride, int n); void vp8_copy32xn_sse2(const unsigned char *src_ptr, int source_stride, unsigned char *dst_ptr, int dst_stride, int n); void vp8_copy32xn_sse3(const unsigned char *src_ptr, int source_stride, unsigned char *dst_ptr, int dst_stride, int n); RTCD_EXTERN void (*vp8_copy32xn)(const unsigned char *src_ptr, int source_stride, unsigned char *dst_ptr, int dst_stride, int n); void vp8_copy_mem16x16_c(unsigned char *src, int src_pitch, unsigned char *dst, int dst_pitch); void vp8_copy_mem16x16_sse2(unsigned char *src, int src_pitch, unsigned char *dst, int dst_pitch); #define vp8_copy_mem16x16 vp8_copy_mem16x16_sse2 void vp8_copy_mem8x4_c(unsigned char *src, int src_pitch, unsigned char *dst, int dst_pitch); void vp8_copy_mem8x4_mmx(unsigned char *src, int src_pitch, unsigned char *dst, int dst_pitch); #define vp8_copy_mem8x4 vp8_copy_mem8x4_mmx void vp8_copy_mem8x8_c(unsigned char *src, int src_pitch, unsigned char *dst, int dst_pitch); void vp8_copy_mem8x8_mmx(unsigned char *src, int src_pitch, unsigned char *dst, int dst_pitch); #define vp8_copy_mem8x8 vp8_copy_mem8x8_mmx void vp8_dc_only_idct_add_c(short input, unsigned char *pred, int pred_stride, unsigned char *dst, int dst_stride); void vp8_dc_only_idct_add_mmx(short input, unsigned char *pred, int pred_stride, unsigned char *dst, int dst_stride); #define vp8_dc_only_idct_add vp8_dc_only_idct_add_mmx int vp8_denoiser_filter_c(unsigned char *mc_running_avg_y, int mc_avg_y_stride, unsigned char *running_avg_y, int avg_y_stride, unsigned char *sig, int sig_stride, unsigned int motion_magnitude, int increase_denoising); int vp8_denoiser_filter_sse2(unsigned char *mc_running_avg_y, int mc_avg_y_stride, unsigned char *running_avg_y, int avg_y_stride, unsigned char *sig, int sig_stride, unsigned int motion_magnitude, int increase_denoising); #define vp8_denoiser_filter vp8_denoiser_filter_sse2 int vp8_denoiser_filter_uv_c(unsigned char *mc_running_avg, int mc_avg_stride, unsigned char *running_avg, int avg_stride, unsigned char *sig, int sig_stride, unsigned int motion_magnitude, int increase_denoising); int vp8_denoiser_filter_uv_sse2(unsigned char *mc_running_avg, int mc_avg_stride, unsigned char *running_avg, int avg_stride, unsigned char *sig, int sig_stride, unsigned int motion_magnitude, int increase_denoising); #define vp8_denoiser_filter_uv vp8_denoiser_filter_uv_sse2 void vp8_dequant_idct_add_c(short *input, short *dq, unsigned char *output, int stride); void vp8_dequant_idct_add_mmx(short *input, short *dq, unsigned char *output,
{ "pile_set_name": "Github" }
<template> <div> <base-title title="Classes" /> <base-table :columns="columns" :rows="rows" /> </div> </template> <script> import BaseTable from '../base/Table' import BaseTitle from '../BaseTitle' export default { components: { BaseTable, BaseTitle }, data () { return { columns: [ { attr: 'name', name: 'Name' }, { attr: 'description', name: 'Description' } ], rows: [ { name: 'vsm-mob-hide', description: 'Hide HTML elements in mobile design' }, { name: 'vsm-mob-full', description: 'Add flex-grow: 1, see Demo example' } ] } } } </script>
{ "pile_set_name": "Github" }
.page-body-wrapper { flex-grow: 1; } .animation-element-wrapper { display: block; margin-bottom: 100rpx; } .animation-element { width: 200rpx; height: 200rpx; background-color: #1AAD19; } .animation-buttons { padding: 50rpx 50rpx 10rpx; border-top: 1px solid #ccc; display: flex; flex-grow: 1; overflow-y: scroll; flex-direction: row; flex-wrap: wrap; width: 100%; height: 400rpx; box-sizing: border-box; } .animation-button { width: 290rpx; margin: 20rpx auto; } .animation-button-reset { width: 610rpx; margin: 20rpx auto; } page { background-color: #fbf9fe; height: 100%; } .container { display: flex; flex-direction: column; min-height: 100%; justify-content: space-between; } .page-header { display: flex; font-size: 32rpx; color: #aaa; margin-top: 50rpx; flex-direction: column; align-items: center; } .page-header-text { padding: 20rpx 40rpx; } .page-header-line { width: 150rpx; height: 1px; border-bottom: 1px solid #ccc; } .page-body { width: 100%; display: flex; flex-direction: column; align-items: center; flex-grow: 1; overflow-x: hidden; } .page-body-wrapper { margin-top: 100rpx; display: flex; flex-direction: column; align-items: center; width: 100%; } .page-body-wrapper form { width: 100%; } .page-body-wording { text-align: center; padding: 200rpx 100rpx; } .page-body-info { display: flex; flex-direction: column; align-items: center; background-color: #fff; margin-bottom: 50rpx; width: 100%; padding: 50rpx 0 150rpx 0; } .page-body-title { margin-bottom: 100rpx; font-size: 32rpx; } .page-body-text { font-size: 30rpx; line-height: 26px; color: #ccc; } .page-body-text-small { font-size: 24rpx; color: #000; margin-bottom: 100rpx; } .page-body-form { width: 100%; background-color: #fff; display: flex; flex-direction: column; width: 100%; border: 1px solid #eee; } .page-body-form-item { display: flex; align-items: center; margin-left: 30rpx; border-bottom: 1px solid #eee; height: 88rpx; font-size: 34rpx; } .page-body-form-key { width: 180rpx; color: #000; } .page-body-form-value { flex-grow: 1; } .page-body-form-value .input-placeholder { color: #b2b2b2; } .page-body-form-picker { display: flex; justify-content: space-between; height: 100rpx; align-items: center; font-size: 36rpx; margin-left: 20rpx; padding-right: 20rpx; border-bottom: 1px solid #eee; } .page-body-form-picker-value { color: #ccc; } .page-body-buttons { width: 100%; } .page-body-button { margin: 25rpx; } .page-body-button image { width: 150rpx; height: 150rpx; } .page-footer { text-align: center; color: #1aad19; font-size: 24rpx; margin: 20rpx 0; } .green{ color: #09BB07; } .red{ color: #F76260; } .blue{ color: #10AEFF; } .yellow{ color: #FFBE00; } .gray{ color: #C9C9C9; } .strong{ font-weight: bold; } .bc_green{ background-color: #09BB07; } .bc_red{ background-color: #F76260; } .bc_blue{ background-color: #10AEFF; } .bc_yellow{ background-color: #FFBE00; } .bc_gray{ background-color: #C9C9C9; } .tc{ text-align: center; } .page input{ padding: 20rpx 30rpx; background-color: #fff; } checkbox, radio{ margin-right: 10rpx; } .btn-area{ padding: 0 30px; } .btn-area button{ margin-top: 20rpx; margin-bottom: 20rpx; } .page { min-height: 100%; flex: 1; background-color: #FBF9FE; font-size: 32rpx; font-family: -apple-system-font,Helvetica Neue,Helvetica,sans-serif; overflow: hidden; } .page__hd{ padding: 50rpx 50rpx 100rpx 50rpx; text-align: center; } .page__title{ display: inline-block; padding: 20rpx 40rpx; font-size: 32rpx; color: #AAAAAA; border-bottom: 1px solid #CCCCCC; } .page__desc{ display: none; margin-top: 20rpx; font-size: 26rpx; color: #BBBBBB; } .section{ margin-bottom: 80rpx; } .section_gap{ padding: 0 30rpx; } .section__title{ margin-bottom: 16rpx; padding-left: 30rpx; padding-right: 30rpx; } .section_gap .section__title{ padding-left: 0; padding-right: 0; } .section__ctn{ }
{ "pile_set_name": "Github" }
/* * Copyright (C) 2009-2020 Lightbend Inc. <https://www.lightbend.com> */ package akka.io import java.lang.{ Iterable => JIterable } import java.net.InetSocketAddress import scala.collection.immutable import com.github.ghik.silencer.silent import akka.actor._ import akka.io.Inet.SocketOption import akka.io.Udp.UdpSettings import akka.util.ByteString import akka.util.ccompat._ /** * UDP Extension for Akka’s IO layer. * * This extension implements the connectionless UDP protocol with * calling `connect` on the underlying sockets, i.e. with restricting * from whom data can be received. For “unconnected” UDP mode see [[Udp]]. * * For a full description of the design and philosophy behind this IO * implementation please refer to <a href="http://doc.akka.io/">the Akka online documentation</a>. * * The Java API for generating UDP commands is available at [[UdpConnectedMessage]]. */ @ccompatUsedUntil213 object UdpConnected extends ExtensionId[UdpConnectedExt] with ExtensionIdProvider { override def lookup = UdpConnected override def createExtension(system: ExtendedActorSystem): UdpConnectedExt = new UdpConnectedExt(system) /** * Java API: retrieve the UdpConnected extension for the given system. */ override def get(system: ActorSystem): UdpConnectedExt = super.get(system) override def get(system: ClassicActorSystemProvider): UdpConnectedExt = super.get(system) /** * The common interface for [[Command]] and [[Event]]. */ sealed trait Message /** * The common type of all commands supported by the UDP implementation. */ trait Command extends SelectionHandler.HasFailureMessage with Message { def failureMessage = CommandFailed(this) } /** * Each [[Send]] can optionally request a positive acknowledgment to be sent * to the commanding actor. If such notification is not desired the [[Send#ack]] * must be set to an instance of this class. The token contained within can be used * to recognize which write failed when receiving a [[CommandFailed]] message. */ case class NoAck(token: Any) extends Event /** * Default [[NoAck]] instance which is used when no acknowledgment information is * explicitly provided. Its “token” is `null`. */ object NoAck extends NoAck(null) /** * This message is understood by the connection actors to send data to their * designated destination. The connection actor will respond with * [[CommandFailed]] if the send could not be enqueued to the O/S kernel * because the send buffer was full. If the given `ack` is not of type [[NoAck]] * the connection actor will reply with the given object as soon as the datagram * has been successfully enqueued to the O/S kernel. */ final case class Send(payload: ByteString, ack: Any) extends Command { require( ack != null, "ack must be non-null. Use NoAck if you don't want acks.") def wantsAck: Boolean = !ack.isInstanceOf[NoAck] } object Send { def apply(data: ByteString): Send = Send(data, NoAck) } /** * Send this message to the [[UdpExt#manager]] in order to bind to a local * port (optionally with the chosen `localAddress`) and create a UDP socket * which is restricted to sending to and receiving from the given `remoteAddress`. * All received datagrams will be sent to the designated `handler` actor. */ @silent("deprecated") final case class Connect( handler: ActorRef, remoteAddress: InetSocketAddress, localAddress: Option[InetSocketAddress] = None, options: immutable.Traversable[SocketOption] = Nil) extends Command /** * Send this message to a connection actor (which had previously sent the * [[Connected]] message) in order to close the socket. The connection actor * will reply with a [[Disconnected]] message. */ case object Disconnect extends Command /** * Send this message to a listener actor (which sent a [[Udp.Bound]] message) to * have it stop reading datagrams from the network. If the O/S kernel’s receive * buffer runs full then subsequent datagrams will be silently discarded. * Re-enable reading from the socket using the `ResumeReading` command. */ case object SuspendReading extends Command /** * This message must be sent to the listener actor to re-enable reading from * the socket after a `SuspendReading` command. */ case object ResumeReading extends Command /** * The common type of all events emitted by the UDP implementation. */ trait Event extends Message /** * When a connection actor receives a datagram from its socket it will send * it to the handler designated in the [[Udp.Bind]] message using this message type. */ final case class Received(data: ByteString) extends Event /** * When a command fails it will be replied to with this message type, * wrapping the failing command object. */ final case class CommandFailed(cmd: Command) extends Event /** * This message is sent by the connection actor to the actor which sent the * [[Connect]] message when the UDP socket has been bound to the local and * remote addresses given. */ sealed trait Connected extends Event case object Connected extends Connected /** * This message is sent by the connection actor to the actor which sent the * `Disconnect` message when the UDP socket has been closed. */ sealed trait Disconnected extends Event case object Disconnected extends Disconnected } class UdpConnectedExt(system: ExtendedActorSystem) extends IO.Extension { val settings: UdpSettings = new UdpSettings(system.settings.config.getConfig("akka.io.udp-connected")) val manager: ActorRef = { system.systemActorOf( props = Props(classOf[UdpConnectedManager], this) .withDispatcher(settings.ManagementDispatcher) .withDeploy(Deploy.local), name = "IO-UDP-CONN") } /** * Java API: retrieve the UDP manager actor’s reference. */ def getManager: ActorRef = manager val bufferPool: BufferPool = new DirectByteBufferPool(settings.DirectBufferSize, settings.MaxDirectBufferPoolSize) } /** * Java API: factory methods for the message types used when communicating with the UdpConnected service. */ object UdpConnectedMessage { import UdpConnected._ import language.implicitConversions /** * Send this message to the [[UdpExt#manager]] in order to bind to a local * port (optionally with the chosen `localAddress`) and create a UDP socket * which is restricted to sending to and receiving from the given `remoteAddress`. * All received datagrams will be sent to the designated `handler` actor. */ def connect( handler: ActorRef, remoteAddress: InetSocketAddress, localAddress: InetSocketAddress, options: JIterable[SocketOption]): Command = Connect(handler, remoteAddress, Some(localAddress), options) /** * Connect without specifying the `localAddress`. */ def connect(handler: ActorRef, remoteAddress: InetSocketAddress, options: JIterable[SocketOption]): Command = Connect(handler, remoteAddress, None, options) /** * Connect without specifying the `localAddress` or `options`. */ def connect(handler: ActorRef, remoteAddress: InetSocketAddress): Command = Connect(handler, remoteAddress, None, Nil) /** * This message is understood by the connection actors to send data to their * designated destination. The connection actor will respond with * [[UdpConnected.CommandFailed]] if the send could not be enqueued to the O/S kernel * because the send buffer was full. If the given `ack` is not of type [[
{ "pile_set_name": "Github" }
var falafel = require('falafel'); var test = require('../'); test('array', function (t) { t.plan(8); var src = '(' + function () { var xs = [ 1, 2, [ 3, 4 ] ]; var ys = [ 5, 6 ]; g([ xs, ys ]); } + ')()'; var output = falafel(src, function (node) { if (node.type === 'ArrayExpression') { node.update('fn(' + node.source() + ')'); } }); var arrays = [ [ 3, 4 ], [ 1, 2, [ 3, 4 ] ], [ 5, 6 ], [ [ 1, 2, [ 3, 4 ] ], [ 5, 6 ] ], ]; Function(['fn','g'], output)( function (xs) { t.same(arrays.shift(), xs); return xs; }, function (xs) { t.same(xs, [ [ 1, 2, [ 3, 4 ] ], [ 5, 6 ] ]); } ); });
{ "pile_set_name": "Github" }
<?php /** * Hoa * * * @license * * New BSD License * * Copyright © 2007-2017, Hoa community. 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 the Hoa 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 HOLDERS AND 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. */ namespace Hoa\Realdom\IRealdom; /** * Interface \Hoa\Realdom\IRealdom\Interval. * * Represent domain with bounds. * * @copyright Copyright © 2007-2017 Hoa community * @license New BSD License */ interface Interval { /** * Get lower bound of the domain. * * @return \Hoa\Realdom */ public function getLowerBound(); /** * Get upper bound of the domain. * * @return \Hoa\Realdom */ public function getUpperBound(); /** * Reduce the lower bound. * * @param mixed $value Value. * @return bool */ public function reduceRightTo($value); /** * Reduce the upper bound. * * @param mixed $value Value. * @return bool */ public function reduceLeftTo($value); }
{ "pile_set_name": "Github" }
/* This Software is provided under the Zope Public License (ZPL) Version 2.1. Copyright (c) 2009, 2010 by the mingw-w64 project See the AUTHORS file for the list of contributors to the mingw-w64 project. This license has been certified as open source. It has also been designated as GPL compatible by the Free Software Foundation (FSF). Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions in source code must retain the accompanying copyright notice, this list of conditions, and the following disclaimer. 2. Redistributions in binary form must reproduce the accompanying copyright notice, this list of conditions, and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Names of the copyright holders must not be used to endorse or promote products derived from this software without prior written permission from the copyright holders. 4. The right to distribute this software or to use it for any purpose does not give you the right to use Servicemarks (sm) or Trademarks (tm) of the copyright holders. Use of them is covered by separate agreement with the copyright holders. 5. If any files are modified, you must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. Disclaimer THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED 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 HOLDERS 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. */ /* double version of the functions. */ #define _NEW_COMPLEX_DOUBLE 1 #include "complex_internal.h" #include "csinh.def.h" #include "csin.def.h"
{ "pile_set_name": "Github" }
<?php // Page créé par Shepard [Fabian Pijcke] <Shepard8@laposte.net> // Arno Esterhuizen <arno.esterhuizen@gmail.com> // et Romain Bourdon <rromain@romainbourdon.com> // et Hervé Leclerc <herve.leclerc@alterway.fr> // // Mise à jour par Herve Leclerc herve.leclerc@alterway.fr // Icônes par Mark James <http://www.famfamfam.com/lab/icons/silk/> //------ //[modif oto] Modifications Dominique Ottello (Otomatic) //Suppression des vhosts, le dossier n'étant plus créé à l'installation //Affichage des Outils, Projets et Alias sur trois colonnes // - Recodage en utf-8 // - Modification des styles : ajout .third .left et .right // - Ajouts d'index dans $langues['en'] et ['fr'] : // 'locale' pour set_locale // 'docp' url des documentations PHP // 'docm' url des documentations MySQL // 'doca2.2' url de la documentation Apache 2.2 // 'doca2.4' url de la documentation Apache 2.4 // 'server' Server Software // - Classement alphabétique des extensions PHP en fonction de la localisation // - Liens sur les documentations Apache, PHP et MySQL // - Ajout variable $suppress_localhost = true; // - Conformité W3C par ajout de <li>...</li> sur les variables // $aliasContents et $projectContents si vides //[modif oto] - Pour supprimer niveau localhost dans les url $suppress_localhost = true; // avec modification de la ligne //$projectContents .= '<li><a href="'.$file.'">'.$file.'</a></li>'; //Par : //$projectContents .= '<li><a href="'.($suppress_localhost ? 'http://' : '').$file.'">'.$file.'</a></li>'; //----- //[modif oto] Ajout $server_dir pour un seul remplacement // si déplacement www hors de Wamp et pas d'utilisation des jonctions //Par défaut la valeur est "../" //$server_dir = "WAMPROOT/"; $server_dir = "../"; //Fonctionne à condition d'avoir ServerSignature On et ServerTokens Full dans httpd.conf $server_software = $_SERVER['SERVER_SOFTWARE']; $wampConfFile = $server_dir.'wampmanager.conf'; //chemin jusqu'aux fichiers alias $aliasDir = $server_dir.'alias/'; // on charge le fichier de conf locale if (!is_file($wampConfFile)) die ('Unable to open WampServer\'s config file, please change path in index.php file'); $fp = fopen($wampConfFile,'r'); $wampConfFileContents = fread ($fp, filesize ($wampConfFile)); fclose ($fp); // on récupère les versions des applis preg_match('|phpVersion = (.*)\n|',$wampConfFileContents,$result); $phpVersion = str_replace('"','',$result[1]); preg_match('|apacheVersion = (.*)\n|',$wampConfFileContents,$result); $apacheVersion = str_replace('"','',$result[1]); $doca_version = 'doca'.substr($apacheVersion,0,3); preg_match('|mysqlVersion = (.*)\n|',$wampConfFileContents,$result); $mysqlVersion = str_replace('"','',$result[1]); preg_match('|wampserverVersion = (.*)\n|',$wampConfFileContents,$result); $wampserverVersion = str_replace('"','',$result[1]); // répertoires à ignorer dans les projets $projectsListIgnore = array ('.','..'); // textes $langues = array( 'en' => array( 'langue' => 'English', 'locale' => 'english', 'autreLangue' => 'Version Française', 'autreLangueLien' => 'fr', 'titreHtml' => 'WAMPSERVER Homepage', 'titreConf' => 'Server Configuration', 'versa' => 'Apache Version :', 'doca2.2' => 'httpd.apache.org/docs/2.2/en/', 'doca2.4' => 'httpd.apache.org/docs/2.4/en/', 'versp' => 'PHP Version :', 'server' => 'Server Software:', 'docp' => 'www.php.net/manual/en/', 'versm' => 'MySQL Version :', 'docm' => 'dev.mysql.com/doc/index.html', 'phpExt' => 'Loaded Extensions : ', 'titrePage' => 'Tools', 'txtProjet' => 'Your Projects', 'txtNoProjet' => 'No projects yet.<br />To create a new one, just create a directory in \'www\'.', 'txtAlias' => 'Your Aliases', 'txtNoAlias' => 'No Alias yet.<br />To create a new one, use the WAMPSERVER menu.', 'faq' => 'http://www.en.wampserver.com/faq.php' ), 'fr' => array( 'langue' => 'Français', 'locale' => 'french', 'autreLangue' => 'English Version', 'autreLangueLien' => 'en', 'titreHtml' => 'Accueil WAMPSERVER', 'titreConf' => 'Configuration Serveur', 'versa' => 'Version Apache:', 'doca2.2' => 'httpd.apache.org/docs/2.2/fr/', 'doca2.4' => 'httpd.apache.org/docs/2.4/fr/', 'versp' => 'Version de PHP:', 'server' => 'Server Software:', 'docp' => 'www.php.net/manual/fr/', 'versm' => 'Version de MySQL:', 'docm' => 'dev.mysql.com/doc/index.html', 'phpExt' => 'Extensions Chargées: ', 'titrePage' => 'Outils', 'txtProjet' => 'Vos Projets', 'txtNoProjet' => 'Aucun projet.<br /> Pour en ajouter un nouveau, créez simplement un répertoire dans \'www\'.', 'txtAlias' => 'Vos Alias', 'txtNoAlias' => 'Aucun alias.<br /> Pour en ajouter un nouveau, utilisez le menu de WAMPSERVER.', 'faq' => 'http://www.wampserver.com/faq.php' ) ); // images $pngFolder = <<< EOFILE iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAA3NCSVQICAjb4U/gAAABhlBMVEX//v7//v3///7//fr//fj+/v3//fb+/fT+/Pf//PX+/Pb+/PP+/PL+/PH+/PD+++/+++7++u/9+vL9+vH79+r79+n79uj89tj89Nf889D88sj78sz78sr58N3u7u7u7ev777j67bL67Kv46sHt6uP26cns6d356aP56aD56Jv45pT45pP45ZD45I324av344r344T14J734oT34YD13pD24Hv03af13pP233X025303JL23nX23nHz2pX23Gvn2a7122fz2I3122T12mLz14Xv1JPy1YD12Vz02Fvy1H7v04T011Py03j011b01k7v0n/x0nHz1Ejv0Hnuz
{ "pile_set_name": "Github" }
<?php require_once("provider.php"); class StockProvider implements ServiceProvider { // Widget properties static $widgetName = "Stock Price"; static $widgetIcon = "stock.svg"; public $cpair; public $width; public $height; function StockProvider() { $this->stock = "GOOG"; $this->width = 800; $this->height = 100; $this->font_size = 1; $this->font_family = "Verdana"; } public function getTunables() { return array( "stock" => array("type" => "text", "display" => "Stock Name", "value" => $this->stock), "font_family" => array("type" => "text", "display" => "Font Family", "value" => $this->font_family), "font_size" => array("type" => "fnum", "display" => "Font Size", "value" => $this->font_size) ); } public function setTunables($v) { $this->stock = strtoupper($v["stock"]["value"]); $this->font_family = $v["font_family"]["value"]; $this->font_size = $v["font_size"]["value"]; } public function shape() { // Return default width/height return array( "width" => $this->width, "height" => $this->height, "resizable" => true, "keep_aspect" => false, ); } public function render() { // Gather information from yahoo $raw = file_get_contents("http://finance.google.com/finance/info?client=ig&q=".$this->stock); $raw = str_replace("//", "", $raw); $info = json_decode($raw, true); $name = $info[0]["t"]; $price = $info[0]["l"]; // Generate an SVG image out of this return sprintf( '<svg width="%d" height="%d" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <text text-anchor="middle" x="50%%" y="80%%" fill="black" style="font-size: %dpx; font-family: %s;"> %s %0.3f </text> </svg>', $this->width, $this->height, $this->font_size * $this->height, $this->font_family, $name, $price ); } }; ?>
{ "pile_set_name": "Github" }
#!/bin/sh mkdir colors cp SublimeMonokai.xml colors touch IntelliJ\ IDEA\ Global\ Settings jar cfM SublimeMonoKai.jar IntelliJ\ IDEA\ Global\ Settings colors rm -r colors rm IntelliJ\ IDEA\ Global\ Settings
{ "pile_set_name": "Github" }
;;;; -*- Mode: Lisp; Syntax: Common-Lisp; -*- ;;;; Code from Paradigms of AI Programming ;;;; Copyright (c) 1991 Peter Norvig ;;;; File unifgram.lisp: The DCG parser from Chapter 20. (requires "prologcp") (defmacro rule (head &optional (arrow ':-) &body body) "Expand one of several types of logic rules into pure Prolog." ;; This is data-driven, dispatching on the arrow (funcall (get arrow 'rule-function) head body)) (setf (get ':- 'rule-function) #'(lambda (head body) `(<- ,head .,body))) (defun dcg-normal-goal-p (x) (or (starts-with x :test) (eq x '!))) (defun dcg-word-list-p (x) (starts-with x ':word)) (setf (get '--> 'rule-function) 'make-dcg) (defun make-dcg (head body) (let ((n (count-if (complement #'dcg-normal-goal-p) body))) `(<- (,@head ?s0 ,(symbol '?s n)) .,(make-dcg-body body 0)))) (defun make-dcg-body (body n) "Make the body of a Definite Clause Grammar (DCG) clause. Add ?string-in and -out variables to each constituent. Goals like (:test goal) are ordinary Prolog goals, and goals like (:word hello) are literal words to be parsed." (if (null body) nil (let ((goal (first body))) (cond ((eq goal '!) (cons '! (make-dcg-body (rest body) n))) ((dcg-normal-goal-p goal) (append (rest goal) (make-dcg-body (rest body) n))) ((dcg-word-list-p goal) (cons `(= ,(symbol '?s n) (,@(rest goal) .,(symbol '?s (+ n 1)))) (make-dcg-body (rest body) (+ n 1)))) (t (cons (append goal (list (symbol '?s n) (symbol '?s (+ n 1)))) (make-dcg-body (rest body) (+ n 1)))))))) (setf (get '==> 'rule-function) 'make-augmented-dcg) (defun make-augmented-dcg (head body) "Build an augmented DCG rule that handles :sem, :ex, and automatic conjunctiontive constituents." (if (eq (last1 head) :sem) ;; Handle :sem (let* ((?sem (gensym "?SEM"))) (make-augmented-dcg `(,@(butlast head) ,?sem) `(,@(remove :sem body :key #'first-or-nil) (:test ,(collect-sems body ?sem))))) ;; Separate out examples from body (multiple-value-bind (exs new-body) (partition-if #'(lambda (x) (starts-with x :ex)) body) ;; Handle conjunctions (let ((rule `(rule ,(handle-conj head) --> ,@new-body))) (if (null exs) rule `(progn (:ex ,head .,(mappend #'rest exs)) ,rule)))))) (defun collect-sems (body ?sem) "Get the semantics out of each constituent in body, and combine them together into ?sem." (let ((sems (loop for goal in body unless (or (dcg-normal-goal-p goal) (dcg-word-list-p goal) (starts-with goal :ex) (atom goal)) collect (last1 goal)))) (case (length sems) (0 `(= ,?sem t)) (1 `(= ,?sem ,(first sems))) (t `(and* ,sems ,?sem))))) (defun and*/2 (in out cont) "IN is a list of conjuncts that are conjoined into OUT." ;; E.g.: (and* (t (and a b) t (and c d) t) ?x) ==> ;; ?x = (and a b c d) (if (unify! out (maybe-add 'and (conjuncts (cons 'and in)) t)) (funcall cont))) (defun conjuncts (exp) "Get all the conjuncts from an expression." (deref exp) (cond ((eq exp t) nil) ((atom exp) (list exp)) ((eq (deref (first exp)) 'nil) nil) ((eq (first exp) 'and) (mappend #'conjuncts (rest exp))) (t (list exp)))) (defmacro :ex ((category . args) &body examples) "Add some example phrases, indexed under the category." `(add-examples ',category ',args ',examples)) (defvar *examples* (make-hash-table :test #'eq)) (defun get-examples (category) (gethash category *examples*)) (defun clear-examples () (clrhash *examples*)) (defun add-examples (category args examples) "Add these example strings to this category, and when it comes time to run them, use the args." (dolist (example examples) (when (stringp example) (let ((ex `(,example (,category ,@args ,(string->list (remove-punctuation example)) ())))) (unless (member ex (get-examples category) :test #'equal) (setf (gethash category *examples*) (nconc (get-examples category) (list ex)))))))) (defun run-examples (&optional category) "Run all the example phrases stored under a category. With no category, run ALL the examples." (prolog-compile-symbols) (if (null category) (maphash #'(lambda (cat val) (declare (ignore val)) (format t "~2&Examples of ~a:~&" cat) (run-examples cat)) *examples*) (dolist (example (get-examples category)) (format t "~2&EXAMPLE: ~{~a~&~9T~a~}" example) (top-level-prove (cdr example))))) (defun remove-punctuation (string) "Replace punctuation with spaces in string." (substitute-if #\space #'punctuation-p string)) (defun string->list (string) "Convert a string to a list of words." (read-from-string (concatenate 'string "(" string ")"))) (defun punctuation-p (char) (find char "*_.,;:`!?#-()\\\"")) (defmacro conj-rule ((conj-cat sem1 combined-sem) ==> conj (cat . args)) "Define this category as an automatic conjunction." (assert (eq ==> '==>)) `(progn (setf (get ',cat 'conj-cat) ',(symbol cat '_)) (rule (,cat ,@(butlast args) ?combined-sem) ==> (,(symbol cat '_) ,@(butlast args) ,sem1) (,conj-cat ,sem1 ?combined-sem)) (rule (,conj-cat ,sem1 ,combined-sem) ==> ,conj (,cat ,@args)) (rule (,conj-cat ?sem1 ?sem1) ==>))) (defun handle-conj (head) "Replace (Cat ...) with (Cat_ ...) if Cat is declared as a conjunctive category." (if (and (listp head) (conj-category (predicate head))) (cons (conj-category (predicate head)) (args head)) head)) (defun conj-category (predicate)
{ "pile_set_name": "Github" }
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. # This script is used to capture the content of config.status-generated # files and subsequently restore their timestamp if they haven't changed. import argparse import errno import itertools import os import re import subprocess import sys import pickle import mozpack.path as mozpath class Pool(object): def __new__(cls, size): try: import multiprocessing size = min(size, multiprocessing.cpu_count()) return multiprocessing.Pool(size) except: return super(Pool, cls).__new__(cls) def imap_unordered(self, fn, iterable): return itertools.imap(fn, iterable) def close(self): pass def join(self): pass class File(object): def __init__(self, path): self._path = path self._content = open(path, 'rb').read() stat = os.stat(path) self._times = (stat.st_atime, stat.st_mtime) @property def path(self): return self._path @property def mtime(self): return self._times[1] @property def modified(self): '''Returns whether the file was modified since the instance was created. Result is memoized.''' if hasattr(self, '_modified'): return self._modified modified = True if os.path.exists(self._path): if open(self._path, 'rb').read() == self._content: modified = False self._modified = modified return modified def update_time(self): '''If the file hasn't changed since the instance was created, restore its old modification time.''' if not self.modified: os.utime(self._path, self._times) # As defined in the various sub-configures in the tree PRECIOUS_VARS = set([ 'build_alias', 'host_alias', 'target_alias', 'CC', 'CFLAGS', 'LDFLAGS', 'LIBS', 'CPPFLAGS', 'CPP', 'CCC', 'CXXFLAGS', 'CXX', 'CCASFLAGS', 'CCAS', ]) CONFIGURE_DATA = 'configure.pkl' # Autoconf, in some of the sub-configures used in the tree, likes to error # out when "precious" variables change in value. The solution it gives to # straighten things is to either run make distclean or remove config.cache. # There's no reason not to do the latter automatically instead of failing, # doing the cleanup (which, on buildbots means a full clobber), and # restarting from scratch. def maybe_clear_cache(data): env = dict(data['env']) for kind in ('target', 'host', 'build'): arg = data[kind] if arg is not None: env['%s_alias' % kind] = arg # configure can take variables assignments in its arguments, and that # overrides whatever is in the environment. for arg in data['args']: if arg[:1] != '-' and '=' in arg: key, value = arg.split('=', 1) env[key] = value comment = re.compile(r'^\s+#') cache = {} with open(data['cache-file']) as f: for line in f: if not comment.match(line) and '=' in line: key, value = line.rstrip(os.linesep).split('=', 1) # If the value is quoted, unquote it if value[:1] == "'": value = value[1:-1].replace("'\\''", "'") cache[key] = value for precious in PRECIOUS_VARS: # If there is no entry at all for that precious variable, then # its value is not precious for that particular configure. if 'ac_cv_env_%s_set' % precious not in cache: continue is_set = cache.get('ac_cv_env_%s_set' % precious) == 'set' value = cache.get('ac_cv_env_%s_value' % precious) if is_set else None if value != env.get(precious): print 'Removing %s because of %s value change from:' \ % (data['cache-file'], precious) print ' %s' % (value if value is not None else 'undefined') print 'to:' print ' %s' % env.get(precious, 'undefined') os.remove(data['cache-file']) return True return False def split_template(s): """Given a "file:template" string, returns "file", "template". If the string is of the form "file" (without a template), returns "file", "file.in".""" if ':' in s: return s.split(':', 1) return s, '%s.in' % s def get_config_files(data): config_status = mozpath.join(data['objdir'], 'config.status') if not os.path.exists(config_status): return [], [] configure = mozpath.join(data['srcdir'], 'configure') config_files = [] command_files = [] # Scan the config.status output for information about configuration files # it generates. config_status_output = subprocess.check_output( [data['shell'], '-c', '%s --help' % config_status], stderr=subprocess.STDOUT).splitlines() state = None for line in config_status_output: if line.startswith('Configuration') and line.endswith(':'): if line.endswith('commands:'): state = 'commands' else: state = 'config' elif not line.strip(): state = None elif state: for f, t in (split_template(couple) for couple in line.split()): f = mozpath.join(data['objdir'], f) t = mozpath.join(data['srcdir'], t) if state == 'commands': command_files.append(f) else: config_files.append((f, t)) return config_files, command_files def prepare(srcdir, objdir, shell, args): parser = argparse.ArgumentParser() parser.add_argument('--target', type=str) parser.add_argument('--host', type=str) parser.add_argument('--build', type=str) parser.add_argument('--cache-file', type=str) # The --srcdir argument is simply ignored. It's a useless autoconf feature # that we don't support well anyways. This makes it stripped from `others` # and allows to skip setting it when calling the subconfigure (configure # will take it from the configure path anyways). parser.add_argument('--srcdir', type=str) data_file = os.path.join(objdir, CONFIGURE_DATA) previous_args = None if os.path.exists(data_file): with open(data_file, 'rb') as f: data = pickle.load(f) previous_args = data['args'] # Msys likes to break environment variables and command line arguments, # so read those from stdin, as they are passed from the configure script # when necessary (on windows). # However, for some reason, $PATH is not handled like other environment # variables, and msys remangles it even when giving it is already a msys # $PATH. Fortunately, the mangling/demangling is just find for $PATH, so # we can just take the value from the environment. Msys will convert it # back properly when calling subconfigure. input
{ "pile_set_name": "Github" }
(defpackage :roswell.delete.git (:use :cl :roswell.util)) (in-package :roswell.delete.git) (defun git (&rest argv) (if (rest argv) (dolist (x (rest argv) (roswell:quit 0)) (let* ((* (loop for v being the hash-values in (roswell.util::local-project-build-hash) for .git/ = (merge-pathnames ".git/" (make-pathname :defaults v :name nil :type nil)) when (and (equal (pathname-name v) (first (last (pathname-directory v)))) (uiop:directory-exists-p .git/)) collect v)) (* (sort * #'string< :key #'pathname-name)) (* (mapcar (lambda (x) (truename (make-pathname :defaults x :type nil :name nil))) *))) (loop for x in * with a = (namestring (truename (homedir))) for b = (namestring x) do (and (string= a b :end2 (min (length a) (length b))) (probe-file b) (progn (format t "delete ~S~%" x) (uiop/filesystem:delete-directory-tree x :validate t)))))) `(,(roswell:opt "wargv0") "help" ,(format nil "delete-git"))))
{ "pile_set_name": "Github" }
.CodeMirror-hints { position: absolute; z-index: 10; overflow: hidden; list-style: none; margin: 0; padding: 2px; -webkit-box-shadow: 2px 3px 5px rgba(0,0,0,.2); -moz-box-shadow: 2px 3px 5px rgba(0,0,0,.2); box-shadow: 2px 3px 5px rgba(0,0,0,.2); border-radius: 3px; border: 1px solid silver; background: white; font-size: 90%; font-family: monospace; max-height: 20em; overflow-y: auto; } .CodeMirror-hint { margin: 0; padding: 0 4px; border-radius: 2px; max-width: 19em; overflow: hidden; white-space: pre; color: black; cursor: pointer; } li.CodeMirror-hint-active { background: #08f; color: white; }
{ "pile_set_name": "Github" }
-----BEGIN RSA PRIVATE KEY----- MIICXAIBAAKBgQDBV1Z/Q5gPF7lojc8pKUdyz5+Jf2B3vs4he6egekugWnoJduki 9Lnae/JchB/soIX0co3nLc11NuFFlnAWJNMDJr08l5AHAJLYNHevF5l/f9oDQwvZ speKh1xpIAJNqCTzVeQ/ZLx6/GccIXV/xDuKIiovqJTPgR5WPkYKaw++lQIDAQAB AoGALXnUj5SflJU4+B2652ydMKUjWl0KnL/VjkyejgGV/j6py8Ybaixz9q8Gv7oY JDlRqMC1HfZJCFQDQrHy5VJ+CywA/H9WrqKo/Ch9U4tJAZtkig1Cmay/BAYixVu0 xBeim10aKF6hxHH4Chg9We+OCuzWBWJhqveNjuDedL/i7JUCQQDlejovcwBUCbhJ U12qKOwlaboolWbl7yF3XdckTJZg7+1UqQHZH5jYZlLZyZxiaC92SNV0SyTLJZnS Jh5CO+VDAkEA16/pPcuVtMMz/R6SSPpRSIAa1stLs0mFSs3NpR4pdm0n42mu05pO 1tJEt3a1g7zkreQBf53+Dwb+lA841EkjRwJBAIFmt0DifKDnCkBu/jZh9SfzwsH3 3Zpzik+hXxxdA7+ODCrdUul449vDd5zQD5t+XKU61QNLDGhxv5e9XvrCg7kCQH/a 3ldsVF0oDaxxL+QkxoREtCQ5tLEd1u7F2q6Tl56FDE0pe6Ih6bQ8RtG+g9EI60IN U7oTrOO5kLWx5E0q4ccCQAZVgoenn9MhRU1agKOCuM6LT2DxReTu4XztJzynej+8 0J93n3ebanB1MlRpn1XJwhQ7gAC8ImaQKLJK5jdJzFc= -----END RSA PRIVATE KEY----- -----BEGIN CERTIFICATE----- MIICaTCCAdKgAwIBAgIJAP6VN47boiXRMA0GCSqGSIb3DQEBBQUAMEQxCzAJBgNV BAYTAlVLMRYwFAYDVQQKEw1PcGVuU1NMIEdyb3VwMR0wGwYDVQQDExRUZXN0IFMv TUlNRSBSU0EgUm9vdDAeFw0wODAyMjIxMzUzMDdaFw0xNjA1MTExMzUzMDdaMEQx CzAJBgNVBAYTAlVLMRYwFAYDVQQKEw1PcGVuU1NMIEdyb3VwMR0wGwYDVQQDExRU ZXN0IFMvTUlNRSBSU0EgUm9vdDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA wVdWf0OYDxe5aI3PKSlHcs+fiX9gd77OIXunoHpLoFp6CXbpIvS52nvyXIQf7KCF 9HKN5y3NdTbhRZZwFiTTAya9PJeQBwCS2DR3rxeZf3/aA0ML2bKXiodcaSACTagk 81XkP2S8evxnHCF1f8Q7iiIqL6iUz4EeVj5GCmsPvpUCAwEAAaNjMGEwHQYDVR0O BBYEFBPPS6e7iS6zOFcXdsabrWhb5e0XMB8GA1UdIwQYMBaAFBPPS6e7iS6zOFcX dsabrWhb5e0XMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMA0GCSqG SIb3DQEBBQUAA4GBAIECprq5viDvnDbkyOaiSr9ubMUmWqvycfAJMdPZRKcOZczS l+L9R9lF3JSqbt3knOe9u6bGDBOTY2285PdCCuHRVMk2Af1f6El1fqAlRUwNqipp r68sWFuRqrcRNtk6QQvXfkOhrqQBuDa7te/OVQLa2lGN9Dr2mQsD8ijctatG -----END CERTIFICATE-----
{ "pile_set_name": "Github" }
// File: platform.cpp // See Copyright Notice and license at the end of include/lzham.h #include "lzham_core.h" #include "lzham_timer.h" #include <assert.h> #if LZHAM_PLATFORM_X360 #include <xbdm.h> #endif #define LZHAM_FORCE_DEBUGGER_PRESENT 1 #ifndef _MSC_VER int sprintf_s(char *buffer, size_t sizeOfBuffer, const char *format, ...) { if (!sizeOfBuffer) return 0; va_list args; va_start(args, format); int c = vsnprintf(buffer, sizeOfBuffer, format, args); va_end(args); buffer[sizeOfBuffer - 1] = '\0'; if (c < 0) return static_cast<int>(sizeOfBuffer - 1); return LZHAM_MIN(c, (int)sizeOfBuffer - 1); } int vsprintf_s(char *buffer, size_t sizeOfBuffer, const char *format, va_list args) { if (!sizeOfBuffer) return 0; int c = vsnprintf(buffer, sizeOfBuffer, format, args); buffer[sizeOfBuffer - 1] = '\0'; if (c < 0) return static_cast<int>(sizeOfBuffer - 1); return LZHAM_MIN(c, (int)sizeOfBuffer - 1); } #endif // __GNUC__ bool lzham_is_debugger_present(void) { #if LZHAM_PLATFORM_X360 return DmIsDebuggerPresent() != 0; #elif LZHAM_USE_WIN32_API return IsDebuggerPresent() != 0; #elif LZHAM_FORCE_DEBUGGER_PRESENT return true; #else return false; #endif } void lzham_debug_break(void) { #if LZHAM_USE_WIN32_API __debugbreak(); // ESENTHEL CHANGED #elif (TARGET_OS_MAC == 1) && (TARGET_IPHONE_SIMULATOR == 0) && (TARGET_OS_IPHONE == 0) __asm {int 3} #else assert(0); #endif } void lzham_output_debug_string(const char* p) { LZHAM_NOTE_UNUSED(p); #if LZHAM_USE_WIN32_API OutputDebugStringA(p); #else fputs(p, stderr); #endif } #if LZHAM_BUFFERED_PRINTF // This stuff was a quick hack only intended for debugging/development. namespace lzham { struct buffered_str { enum { cBufSize = 256 }; char m_buf[cBufSize]; }; static lzham::vector<buffered_str> g_buffered_strings; static volatile long g_buffered_string_locked; static void lock_buffered_strings() { while (atomic_exchange32(&g_buffered_string_locked, 1) == 1) { lzham_yield_processor(); lzham_yield_processor(); lzham_yield_processor(); lzham_yield_processor(); } LZHAM_MEMORY_IMPORT_BARRIER } static void unlock_buffered_strings() { LZHAM_MEMORY_EXPORT_BARRIER atomic_exchange32(&g_buffered_string_locked, 0); } } // namespace lzham void lzham_buffered_printf(const char *format, ...) { format; char buf[lzham::buffered_str::cBufSize]; va_list args; va_start(args, format); vsnprintf_s(buf, sizeof(buf), sizeof(buf), format, args); va_end(args); buf[sizeof(buf) - 1] = '\0'; lzham::lock_buffered_strings(); if (!lzham::g_buffered_strings.capacity()) { lzham::g_buffered_strings.try_reserve(2048); } if (lzham::g_buffered_strings.try_resize(lzham::g_buffered_strings.size() + 1)) { memcpy(lzham::g_buffered_strings.back().m_buf, buf, sizeof(buf)); } lzham::unlock_buffered_strings(); } void lzham_flush_buffered_printf() { lzham::lock_buffered_strings(); for (lzham::uint i = 0; i < lzham::g_buffered_strings.size(); i++) { printf("%s", lzham::g_buffered_strings[i].m_buf); } lzham::g_buffered_strings.try_resize(0); lzham::unlock_buffered_strings(); } #endif
{ "pile_set_name": "Github" }
/* alphagrad.c This frei0r plugin fills alpha channel with a gradient Version 0.1 aug 2010 Copyright (C) 2010 Marko Cebokli http://lea.hamradio.si/~s57uuu This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ //compile: gcc -c -fPIC -Wall alphagrad.c -o alphagrad.o //link: gcc -shared -o alphagrad.so alphagrad.o #include <stdio.h> #include <frei0r.h> #include <stdlib.h> #include <math.h> #include <assert.h> //---------------------------------------- //struktura za instanco efekta typedef struct { int h; int w; float poz,wdt,tilt,min,max; uint32_t *gr8; int op; } inst; //----------------------------------------------------- //RGBA8888 little endian void fill_grad(inst *in) { int i,j; float st,ct,po,wd,d,a; st=sinf(in->tilt); ct=cosf(in->tilt); po=(-in->w/2.0+in->poz*in->w)*1.5; wd=in->wdt*in->w; if (in->min==in->max) { for (i=0;i<in->h*in->w;i++) in->gr8[i]=(((uint32_t)(in->min*255.0))<<24)&0xFF000000; return; } for (i=0;i<in->h;i++) for (j=0;j<in->w;j++) { d=(i-in->h/2)*ct+(j-in->w/2)*st-po; if (fabsf(d)>wd/2.0) { if (d>0.0) a=in->min; else a=in->max; } else { if (d>wd/2.0) d=wd/2.0; a = in->min+(wd/2.0-d) / wd*(in->max-in->min); } a=255.0*a; in->gr8[i*in->w+j] = (((uint32_t)a)<<24)&0xFF000000; } } //----------------------------------------------------- //stretch [0...1] to parameter range [min...max] linear float map_value_forward(double v, float min, float max) { return min+(max-min)*v; } //----------------------------------------------------- //collapse from parameter range [min...max] to [0...1] linear double map_value_backward(float v, float min, float max) { return (v-min)/(max-min); } //*********************************************** // OBVEZNE FREI0R FUNKCIJE //----------------------------------------------- int f0r_init() { return 1; } //------------------------------------------------ void f0r_deinit() { } //----------------------------------------------- void f0r_get_plugin_info(f0r_plugin_info_t* info) { info->name="alphagrad"; info->author="Marko Cebokli"; info->plugin_type=F0R_PLUGIN_TYPE_FILTER; info->color_model=F0R_COLOR_MODEL_RGBA8888; info->frei0r_version=FREI0R_MAJOR_VERSION; info->major_version=0; info->minor_version=2; info->num_params=6; info->explanation="Fills alpha channel with a gradient"; } //-------------------------------------------------- void f0r_get_param_info(f0r_param_info_t* info, int param_index) { switch(param_index) { case 0: info->name = "Position"; info->type = F0R_PARAM_DOUBLE; info->explanation = ""; break; case 1: info->name = "Transition width"; info->type = F0R_PARAM_DOUBLE; info->explanation = ""; break; case 2: info->name = "Tilt"; info->type = F0R_PARAM_DOUBLE; info->explanation = ""; break; case 3: info->name = "Min"; info->type = F0R_PARAM_DOUBLE; info->explanation = ""; break; case 4: info->name = "Max"; info->type = F0R_PARAM_DOUBLE; info->explanation = ""; break; case 5: info->name = "Operation"; info->type = F0R_PARAM_DOUBLE; info->explanation = ""; break; } } //---------------------------------------------- f0r_instance_t f0r_construct(unsigned int width, unsigned int height) { inst *in; in=calloc(1,sizeof(inst)); in->w=width; in->h=height; in->poz=0.5; in->wdt=0.5; in->tilt=0.0; in->min=0.0; in->max=1.0; in->op=0; in->gr8 = (uint32_t*)calloc(in->w*in->h, sizeof(uint32_t)); fill_grad(in); return (f0r_instance_t)in; } //--------------------------------------------------- void f0r_destruct(f0r_instance_t instance) { inst *in; in=(inst*)instance; free(in->gr8); free(instance); } //----------------------------------------------------- void f0r_set_param_value(f0r_instance_t instance, f0r_param_t parm, int param_index) { inst *p; double tmpf; int tmpi,chg; p=(inst*)instance; chg=0; switch(param_index) { case 0: tmpf=*((double*)parm); if (tmpf!=p->poz) chg=1; p->poz=tmpf; break; case 1: tmpf=*((double*)parm); if (tmpf!=p->wdt) chg=1; p->wdt=tmpf; break; case 2: tmpf=map_value_forward(*((double*)parm), -3.15, 3.15); if (tmpf!=p->tilt) chg=1; p->tilt=tmpf; break; case 3: tmpf=*((double*)parm); if (tmpf!=p->min) chg=1; p->min=tmpf; break; case 4: tmpf=*((double*)parm); if (tmpf!=p->max) chg=1; p->max=tmpf; break; case 5: tmpi=map_value_forward(*((double*)parm), 0.0, 4.9999); if (p->op != tmpi) chg=1; p->op=tmpi; break; } if (chg==0) return; fill_grad(p); } //-------------------------------------------------- void f0r_get_param_value(f0r_instance_t instance, f0r_param_t
{ "pile_set_name": "Github" }
Filter 1: ON PK Fc 31 Hz Gain -9.4 dB Q 1.41 Filter 2: ON PK Fc 62 Hz Gain -7.4 dB Q 1.41 Filter 3: ON PK Fc 125 Hz Gain -6.5 dB Q 1.41 Filter 4: ON PK Fc 250 Hz Gain -6.8 dB Q 1.41 Filter 5: ON PK Fc 500 Hz Gain -5.5 dB Q 1.41 Filter 6: ON PK Fc 1000 Hz Gain -2.1 dB Q 1.41 Filter 7: ON PK Fc 2000 Hz Gain 4.7 dB Q 1.41 Filter 8: ON PK Fc 4000 Hz Gain 5.0 dB Q 1.41 Filter 9: ON PK Fc 8000 Hz Gain 5.9 dB Q 1.41 Filter 10: ON PK Fc 16000 Hz Gain 8.7 dB Q 1.41
{ "pile_set_name": "Github" }
/* * Copyright (C) 2010 Michael Brown <mbrown@fensystems.co.uk>. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. * * You can also choose to distribute this program under the terms of * the Unmodified Binary Distribution Licence (as given in the file * COPYING.UBDL), provided that you have satisfied its requirements. */ #include <string.h> #include <stdio.h> #include <ipxe/command.h> #include <ipxe/parseopt.h> #include <ipxe/login_ui.h> FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); /** @file * * Login commands * */ /** "login" options */ struct login_options {}; /** "login" option list */ static struct option_descriptor login_opts[] = {}; /** "login" command descriptor */ static struct command_descriptor login_cmd = COMMAND_DESC ( struct login_options, login_opts, 0, 0, NULL ); /** * "login" command * * @v argc Argument count * @v argv Argument list * @ret rc Return status code */ static int login_exec ( int argc, char **argv ) { struct login_options opts; int rc; /* Parse options */ if ( ( rc = parse_options ( argc, argv, &login_cmd, &opts ) ) != 0 ) return rc; /* Show login UI */ if ( ( rc = login_ui() ) != 0 ) { printf ( "Could not set credentials: %s\n", strerror ( rc ) ); return rc; } return 0; } /** Login commands */ struct command login_command __command = { .name = "login", .exec = login_exec, };
{ "pile_set_name": "Github" }
//===------------------------ __refstring ---------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #ifndef _LIBCPP_REFSTRING_H #define _LIBCPP_REFSTRING_H #include <__config> #include <stdexcept> #include <cstddef> #include <cstring> #ifdef __APPLE__ #include <dlfcn.h> #include <mach-o/dyld.h> #endif #include "atomic_support.h" _LIBCPP_BEGIN_NAMESPACE_STD namespace __refstring_imp { namespace { typedef int count_t; struct _Rep_base { std::size_t len; std::size_t cap; count_t count; }; inline _Rep_base* rep_from_data(const char *data_) noexcept { char *data = const_cast<char *>(data_); return reinterpret_cast<_Rep_base *>(data - sizeof(_Rep_base)); } inline char * data_from_rep(_Rep_base *rep) noexcept { char *data = reinterpret_cast<char *>(rep); return data + sizeof(*rep); } #if defined(__APPLE__) inline const char* compute_gcc_empty_string_storage() _NOEXCEPT { void* handle = dlopen("/usr/lib/libstdc++.6.dylib", RTLD_NOLOAD); if (handle == nullptr) return nullptr; void* sym = dlsym(handle, "_ZNSs4_Rep20_S_empty_rep_storageE"); if (sym == nullptr) return nullptr; return data_from_rep(reinterpret_cast<_Rep_base *>(sym)); } inline const char* get_gcc_empty_string_storage() _NOEXCEPT { static const char* p = compute_gcc_empty_string_storage(); return p; } #endif }} // namespace __refstring_imp using namespace __refstring_imp; inline __libcpp_refstring::__libcpp_refstring(const char* msg) { std::size_t len = strlen(msg); _Rep_base* rep = static_cast<_Rep_base *>(::operator new(sizeof(*rep) + len + 1)); rep->len = len; rep->cap = len; rep->count = 0; char *data = data_from_rep(rep); std::memcpy(data, msg, len + 1); __imp_ = data; } inline __libcpp_refstring::__libcpp_refstring(const __libcpp_refstring &s) _NOEXCEPT : __imp_(s.__imp_) { if (__uses_refcount()) __libcpp_atomic_add(&rep_from_data(__imp_)->count, 1); } inline __libcpp_refstring& __libcpp_refstring::operator=(__libcpp_refstring const& s) _NOEXCEPT { bool adjust_old_count = __uses_refcount(); struct _Rep_base *old_rep = rep_from_data(__imp_); __imp_ = s.__imp_; if (__uses_refcount()) __libcpp_atomic_add(&rep_from_data(__imp_)->count, 1); if (adjust_old_count) { if (__libcpp_atomic_add(&old_rep->count, count_t(-1)) < 0) { ::operator delete(old_rep); } } return *this; } inline __libcpp_refstring::~__libcpp_refstring() { if (__uses_refcount()) { _Rep_base* rep = rep_from_data(__imp_); if (__libcpp_atomic_add(&rep->count, count_t(-1)) < 0) { ::operator delete(rep); } } } inline bool __libcpp_refstring::__uses_refcount() const { #ifdef __APPLE__ return __imp_ != get_gcc_empty_string_storage(); #else return true; #endif } _LIBCPP_END_NAMESPACE_STD #endif //_LIBCPP_REFSTRING_H
{ "pile_set_name": "Github" }
find_package(Git REQUIRED) set(neko_debian_dir ${bin_dir}/neko-debian) # format SNAPSHOT_VERSION execute_process( COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD OUTPUT_VARIABLE COMMIT_SHA OUTPUT_STRIP_TRAILING_WHITESPACE ) execute_process( COMMAND ${GIT_EXECUTABLE} show -s --format=%ct HEAD OUTPUT_VARIABLE COMMIT_TIME OUTPUT_STRIP_TRAILING_WHITESPACE ) execute_process( COMMAND date -u -d @${COMMIT_TIME} +%Y%m%d%H%M%S OUTPUT_VARIABLE COMMIT_TIME OUTPUT_STRIP_TRAILING_WHITESPACE ) set(SNAPSHOT_VERSION ${NEKO_VERSION}+1SNAPSHOT${COMMIT_TIME}+${COMMIT_SHA}) message(STATUS "building source package version ${SNAPSHOT_VERSION}") message(STATUS "setting up neko-debian repo") if (EXISTS ${neko_debian_dir}) execute_process( COMMAND ${GIT_EXECUTABLE} fetch --all WORKING_DIRECTORY ${neko_debian_dir} ) execute_process( COMMAND ${GIT_EXECUTABLE} clean -fx WORKING_DIRECTORY ${neko_debian_dir} ) execute_process( COMMAND ${GIT_EXECUTABLE} reset --hard HEAD WORKING_DIRECTORY ${neko_debian_dir} ) execute_process( COMMAND ${GIT_EXECUTABLE} tag -d upstream/${SNAPSHOT_VERSION} WORKING_DIRECTORY ${neko_debian_dir} ) else() execute_process( COMMAND ${GIT_EXECUTABLE} clone https://github.com/HaxeFoundation/neko-debian.git ${neko_debian_dir} ) endif() foreach(branch upstream next) execute_process( COMMAND ${GIT_EXECUTABLE} checkout ${branch} WORKING_DIRECTORY ${neko_debian_dir} ) execute_process( COMMAND ${GIT_EXECUTABLE} reset --hard origin/${branch} WORKING_DIRECTORY ${neko_debian_dir} ) endforeach() message(STATUS "import changes from source archive to neko-debian") get_filename_component(source_archive_name ${source_archive} NAME) file(COPY ${source_archive} DESTINATION ${bin_dir}) file(RENAME ${bin_dir}/${source_archive_name} ${bin_dir}/neko_${SNAPSHOT_VERSION}.orig.tar.gz) execute_process( COMMAND gbp import-orig ${bin_dir}/neko_${SNAPSHOT_VERSION}.orig.tar.gz -u ${SNAPSHOT_VERSION} --debian-branch=next WORKING_DIRECTORY ${neko_debian_dir} ) set(distros trusty xenial zesty artful bionic ) if (DEFINED ENV{PPA}) set(PPA $ENV{PPA}) else() set(PPA "ppa:haxe/snapshots") endif() foreach(distro ${distros}) message(STATUS "backporting to ${distro} and will upload to ${PPA}") execute_process( COMMAND ${GIT_EXECUTABLE} checkout . WORKING_DIRECTORY ${neko_debian_dir} ) execute_process( COMMAND ${GIT_EXECUTABLE} checkout next-${distro} WORKING_DIRECTORY ${neko_debian_dir} ) execute_process( COMMAND ${GIT_EXECUTABLE} clean -fx WORKING_DIRECTORY ${neko_debian_dir} ) execute_process( COMMAND ${GIT_EXECUTABLE} reset --hard origin/next-${distro} WORKING_DIRECTORY ${neko_debian_dir} ) execute_process( COMMAND ${GIT_EXECUTABLE} merge next -m "merge" WORKING_DIRECTORY ${neko_debian_dir} ) execute_process( COMMAND dch -v "${SNAPSHOT_VERSION}-1" --urgency low "snapshot build" WORKING_DIRECTORY ${neko_debian_dir} ) execute_process( COMMAND debuild -S -sa WORKING_DIRECTORY ${neko_debian_dir} ) execute_process( COMMAND backportpackage -d ${distro} --upload ${PPA} --yes neko_${SNAPSHOT_VERSION}-1.dsc WORKING_DIRECTORY ${bin_dir} ) endforeach()
{ "pile_set_name": "Github" }
package freenet.clients.http.updateableelements; import java.util.Timer; import java.util.TimerTask; import freenet.clients.http.SimpleToadletServer; import freenet.clients.http.ToadletContext; import freenet.support.Base64; import freenet.support.HTMLNode; /** A pushed element that counts up every second. Only for testing purposes. */ public class TesterElement extends BaseUpdateableElement { private int status = 0; private int maxStatus; ToadletContext ctx; Timer t; final String id; public TesterElement(ToadletContext ctx, String id, int max) { super("div","style","float:left;", ctx); this.id = id; this.ctx = ctx; this.maxStatus = max; init(true); t = new Timer(true); t.scheduleAtFixedRate(new TimerTask() { @Override public void run() { update(); } }, 0, 1000); } public void update() { status++; if (status >= maxStatus) { t.cancel(); } ((SimpleToadletServer) ctx.getContainer()).pushDataManager.updateElement(getUpdaterId(ctx.getUniqueId())); } @Override public void dispose() { t.cancel(); } @Override public String getUpdaterId(String requestId) { return getId(requestId,id); } public static String getId(String requestId,String id){ return Base64.encodeStandardUTF8(("test:" + requestId + "id:" + id+"gndfjkghghdfukggherugbdfkutg54ibngjkdfgyisdhiterbyjhuyfghdightw7i4tfgsdgo;dfnghsdbfuiyfgfoinfsdbufvwte4785tu4kgjdfnzukfbyfhe48e54gjfdjgbdruserigbfdnvbxdio;fherigtuseofjuodsvbyfhsd8ofghfio;")); } @Override public String getUpdaterType() { return UpdaterConstants.REPLACER_UPDATER; } @Override public void updateState(boolean initial) { children.clear(); addChild(new HTMLNode("img", "src","/imagecreator/?text="+status+"&width="+Math.min(status+30,300)+"&height="+Math.min(status+30,300))); } }
{ "pile_set_name": "Github" }
/* //@HEADER // ************************************************************************ // // Kokkos v. 3.0 // Copyright (2020) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // the U.S. Government retains certain rights in this software. // // 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 name of the Corporation nor the names of the // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY NTESS "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 NTESS OR THE // 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. // // Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER */ #if defined(KOKKOS_ENABLE_RFO_PREFETCH) #include <xmmintrin.h> #endif #include <Kokkos_Macros.hpp> #if defined(KOKKOS_ATOMIC_HPP) && !defined(KOKKOS_ATOMIC_FETCH_SUB_HPP) #define KOKKOS_ATOMIC_FETCH_SUB_HPP #if defined(KOKKOS_ENABLE_CUDA) #include <Cuda/Kokkos_Cuda_Version_9_8_Compatibility.hpp> #endif namespace Kokkos { //---------------------------------------------------------------------------- #if defined(KOKKOS_ENABLE_CUDA) #if defined(__CUDA_ARCH__) || defined(KOKKOS_IMPL_CUDA_CLANG_WORKAROUND) // Support for int, unsigned int, unsigned long long int, and float __inline__ __device__ int atomic_fetch_sub(volatile int* const dest, const int val) { return atomicSub((int*)dest, val); } __inline__ __device__ unsigned int atomic_fetch_sub( volatile unsigned int* const dest, const unsigned int val) { return atomicSub((unsigned int*)dest, val); } __inline__ __device__ unsigned int atomic_fetch_sub( volatile int64_t* const dest, const int64_t val) { return atomic_fetch_add(dest, -val); } __inline__ __device__ unsigned int atomic_fetch_sub(volatile float* const dest, const float val) { return atomicAdd((float*)dest, -val); } #if (600 <= __CUDA_ARCH__) __inline__ __device__ unsigned int atomic_fetch_sub(volatile double* const dest, const double val) { return atomicAdd((double*)dest, -val); } #endif template <typename T> __inline__ __device__ T atomic_fetch_sub( volatile T* const dest, typename std::enable_if<sizeof(T) == sizeof(int), const T>::type val) { union U { int i; T t; KOKKOS_INLINE_FUNCTION U() {} } oldval, assume, newval; oldval.t = *dest; do { assume.i = oldval.i; newval.t = assume.t - val; oldval.i = atomicCAS((int*)dest, assume.i, newval.i); } while (assume.i != oldval.i); return oldval.t; } template <typename T> __inline__ __device__ T atomic_fetch_sub( volatile T* const dest, typename std::enable_if<sizeof(T) != sizeof(int) && sizeof(T) == sizeof(unsigned long long int), const T>::type val) { union U { unsigned long long int i; T t; KOKKOS_INLINE_FUNCTION U() {} } oldval, assume, newval; oldval.t = *dest; do { assume.i = oldval.i; newval.t = assume.t - val; oldval.i = atomicCAS((unsigned long long int*)dest, assume.i, newval.i); } while (assume.i != oldval.i); return oldval.t; } //---------------------------------------------------------------------------- template <typename T> __inline__ __device__ T atomic_fetch_sub(volatile T* const dest, typename std::enable_if<(sizeof(T) != 4) && (sizeof(T) != 8), const T>::type& val) { T return_val; // This is a way to (hopefully) avoid dead lock in a warp int done = 0; #ifdef KOKKOS_IMPL_CUDA_SYNCWARP_NEEDS_MASK unsigned int mask = KOKKOS_IMPL_CUDA_ACTIVEMASK; unsigned int active = KOKKOS_IMPL_CUDA_BALLOT_MASK(mask, 1); #else unsigned int active = KOKKOS_IMPL_CUDA_BALLOT(1); #endif unsigned int done_active = 0; while (active != done_active) { if (!done) { if (Impl::lock_address_cuda_space((void*)dest)) { Kokkos::memory_fence(); return_val = *dest; *dest = return_val - val; Kokkos::memory_fence(); Impl::unlock_address_cuda_space((void*)dest); done = 1; } } #ifdef KOKKOS_IMPL_CUDA_SYNCWARP_NEEDS_MASK done_active = KOKKOS_IMPL_CUDA_BALLOT_MASK(mask, done); #else done_active = KOKKOS_IMPL_CUDA_BALLOT(done); #endif } return return_val; } #endif #endif //---------------------------------------------------------------------------- #if !defined(KOKKOS_ENABLE_ROCM_ATOMICS) || !defined(KOKKOS_ENABLE_HIP_ATOMICS) #if !defined(__CUDA_ARCH__) || defined(KOKKOS_IMPL_CUDA_CLANG_WORKAROUND) #if defined(KOKKOS_ENABLE_GNU_ATOMICS) || defined(KOKKOS_ENABLE_INTEL_ATOMICS) inline int atomic_fetch_sub(volatile int* const dest, const int val) { #if defined(KOKKOS_ENABLE_RFO_PREFETCH) _mm_prefetch((const char*)dest, _MM_HINT_ET0); #endif return __sync_fetch_and_sub(dest, val); } inline long int atomic_fetch_sub(volatile long int* const dest, const long int val) { #if defined(KOKKOS_ENABLE_RFO_PREFETCH) _mm_prefetch((const char*)dest, _MM_HINT_ET0); #endif return __sync_fetch_and_sub(dest, val); } #if defined(KOKKOS_ENABLE_GNU_ATOMICS) inline unsigned int atomic_fetch_sub(volatile unsigned int* const dest, const unsigned int val) { #if defined(KOKK
{ "pile_set_name": "Github" }
{ "name": "helloxz/imgurl", "description": "ImgURL is a simple, pure graph bed program, simple installation, powerful.", "type": "project", "license": "GPL-3.0", "authors": [ { "name": "xiaoz", "email": "xiaoz93@outlook.com" } ], "minimum-stability": "stable", "require": {} }
{ "pile_set_name": "Github" }
package com.blogcode.after; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; /** * Created by jojoldu@gmail.com on 2017. 2. 6. * Blog : http://jojoldu.tistory.com * Github : http://github.com/jojoldu */ @Configuration public class AppConfig { @Bean public EnumMapper enumMapper() { EnumMapper enumMapper = new EnumMapper(); enumMapper.put("commissionType", EnumContract.CommissionType.class); enumMapper.put("commissionCutting", EnumContract.CommissionCutting.class); return enumMapper; } }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <parent> <artifactId>microcks</artifactId> <groupId>io.github.microcks</groupId> <version>1.0.1-SNAPSHOT</version> <relativePath>../../pom.xml</relativePath> </parent> <modelVersion>4.0.0</modelVersion> <name>Microcks Async Minion</name> <artifactId>microcks-async-minion</artifactId> <properties> <compiler-plugin.version>3.8.1</compiler-plugin.version> <maven.compiler.parameters>true</maven.compiler.parameters> <maven.compiler.source>8</maven.compiler.source> <maven.compiler.target>8</maven.compiler.target> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <quarkus-plugin.version>1.5.2.Final</quarkus-plugin.version> <quarkus.platform.artifact-id>quarkus-universe-bom</quarkus.platform.artifact-id> <quarkus.platform.group-id>io.quarkus</quarkus.platform.group-id> <quarkus.platform.version>1.5.2.Final</quarkus.platform.version> <surefire-plugin.version>2.22.1</surefire-plugin.version> </properties> <dependencyManagement> <dependencies> <dependency> <groupId>${quarkus.platform.group-id}</groupId> <artifactId>${quarkus.platform.artifact-id}</artifactId> <version>${quarkus.platform.version}</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> <dependencies> <dependency> <groupId>io.quarkus</groupId> <artifactId>quarkus-rest-client</artifactId> </dependency> <dependency> <groupId>io.quarkus</groupId> <artifactId>quarkus-resteasy-jackson</artifactId> </dependency> <dependency> <groupId>io.quarkus</groupId> <artifactId>quarkus-smallrye-reactive-messaging-kafka</artifactId> </dependency> <dependency> <groupId>io.quarkus</groupId> <artifactId>quarkus-smallrye-health</artifactId> </dependency> <dependency> <groupId>io.quarkus</groupId> <artifactId>quarkus-quartz</artifactId> </dependency> <dependency> <groupId>io.github.microcks</groupId> <artifactId>microcks-model</artifactId> <version>${project.version}</version> <exclusions> <exclusion> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-mongodb</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>io.github.microcks</groupId> <artifactId>microcks-util</artifactId> <version>${project.version}</version> </dependency> <dependency> <groupId>io.github.microcks</groupId> <artifactId>microcks-el</artifactId> <version>${project.version}</version> </dependency> <!-- Test related dependencies --> <dependency> <groupId>io.quarkus</groupId> <artifactId>quarkus-junit5</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>io.rest-assured</groupId> <artifactId>rest-assured</artifactId> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>io.quarkus</groupId> <artifactId>quarkus-maven-plugin</artifactId> <version>${quarkus-plugin.version}</version> <executions> <execution> <goals> <goal>build</goal> </goals> </execution> </executions> </plugin> <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>${compiler-plugin.version}</version> </plugin> <plugin> <artifactId>maven-surefire-plugin</artifactId> <version>${surefire-plugin.version}</version> <configuration> <systemProperties> <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager> </systemProperties> </configuration> </plugin> </plugins> </build> <profiles> <profile> <id>native</id> <activation> <property> <name>native</name> </property> </activation> <build> <plugins> <plugin> <artifactId>maven-failsafe-plugin</artifactId> <version>${surefire-plugin.version}</version> <executions> <execution> <goals> <goal>integration-test</goal> <goal>verify</goal> </goals> <configuration> <systemProperties> <native.image.path>${project.build.directory}/${project.build.finalName}-runner</native.image.path> </systemProperties> </configuration> </execution> </executions> </plugin> </plugins> </build> <properties> <quarkus.package.type>native</quarkus.package.type> </properties> </profile> </profiles> </project>
{ "pile_set_name": "Github" }
/* Copyright 2019 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package version // Base version information. // // This is the fallback data used when version information from git is not // provided via go ldflags. It provides an approximation of the Kubernetes // version for ad-hoc builds (e.g. `go build`) that cannot get the version // information from git. // // If you are looking at these fields in the git tree, they look // strange. They are modified on the fly by the build process. The // in-tree values are dummy values used for "git archive", which also // works for GitHub tar downloads. // // When releasing a new Kubernetes version, this file is updated by // build/mark_new_version.sh to reflect the new version, and then a // git annotated tag (using format vX.Y where X == Major version and Y // == Minor version) is created to point to the commit that updates // component-base/version/base.go var ( // TODO: Deprecate gitMajor and gitMinor, use only gitVersion // instead. First step in deprecation, keep the fields but make // them irrelevant. (Next we'll take it out, which may muck with // scripts consuming the kubectl version output - but most of // these should be looking at gitVersion already anyways.) gitMajor string // major version, always numeric gitMinor string // minor version, numeric possibly followed by "+" // semantic version, derived by build scripts (see // https://github.com/kubernetes/community/blob/master/contributors/design-proposals/release/versioning.md // for a detailed discussion of this field) // // TODO: This field is still called "gitVersion" for legacy // reasons. For prerelease versions, the build metadata on the // semantic version is a git hash, but the version itself is no // longer the direct output of "git describe", but a slight // translation to be semver compliant. // NOTE: The $Format strings are replaced during 'git archive' thanks to the // companion .gitattributes file containing 'export-subst' in this same // directory. See also https://git-scm.com/docs/gitattributes gitVersion = "v0.0.0-master+$Format:%h$" gitCommit = "$Format:%H$" // sha1 from git, output of $(git rev-parse HEAD) gitTreeState = "" // state of git tree, either "clean" or "dirty" buildDate = "1970-01-01T00:00:00Z" // build date in ISO8601 format, output of $(date -u +'%Y-%m-%dT%H:%M:%SZ') )
{ "pile_set_name": "Github" }
package com.ifmvo.togetherad.core.helper import android.app.Activity import org.jetbrains.annotations.NotNull import android.view.ViewGroup import com.ifmvo.togetherad.core.R import com.ifmvo.togetherad.core.TogetherAd import com.ifmvo.togetherad.core.config.AdProviderLoader import com.ifmvo.togetherad.core.custom.flow.BaseNativeTemplate import com.ifmvo.togetherad.core.listener.NativeListener import com.ifmvo.togetherad.core.listener.NativeViewListener import com.ifmvo.togetherad.core.utils.AdRandomUtil import com.ifmvo.togetherad.core.utils.loge import org.jetbrains.annotations.Nullable /** * 原生自渲染广告 * * Created by Matthew Chen on 2020-04-20. */ @Deprecated(message = "设计上考虑不周全,使用单例导致无法同时请求多次", replaceWith = ReplaceWith(expression = "AdHelperNativePro", imports = ["com.ifmvo.togetherad.core.helper"])) object AdHelperNative : BaseHelper() { private const val defaultMaxCount = 4 //为了照顾 Java 调用的同学 fun getList(@NotNull activity: Activity, @NotNull alias: String, maxCount: Int = defaultMaxCount, listener: NativeListener? = null) { getList(activity, alias, null, maxCount, listener) } fun getList(@NotNull activity: Activity, @NotNull alias: String, radioMap: Map<String, Int>? = null, maxCount: Int = defaultMaxCount, listener: NativeListener? = null) { val currentMaxCount = if (maxCount <= 0) defaultMaxCount else maxCount val currentRadioMap = if (radioMap?.isEmpty() != false) TogetherAd.getPublicProviderRadio() else radioMap val adProviderType = AdRandomUtil.getRandomAdProvider(currentRadioMap) if (adProviderType?.isEmpty() != false) { listener?.onAdFailedAll() return } val adProvider = AdProviderLoader.loadAdProvider(adProviderType) if (adProvider == null) { "$adProviderType ${activity.getString(R.string.no_init)}".loge() val newRadioMap = filterType(radioMap = currentRadioMap, adProviderType = adProviderType) getList(activity = activity, alias = alias, radioMap = newRadioMap, maxCount = maxCount, listener = listener) return } adProvider.getNativeAdList(activity = activity, adProviderType = adProviderType, alias = alias, maxCount = currentMaxCount, listener = object : NativeListener { override fun onAdStartRequest(providerType: String) { listener?.onAdStartRequest(providerType) } override fun onAdLoaded(providerType: String, adList: List<Any>) { listener?.onAdLoaded(providerType, adList) } override fun onAdFailed(providerType: String, failedMsg: String?) { listener?.onAdFailed(providerType, failedMsg) val newRadioMap = filterType(radioMap = currentRadioMap, adProviderType = adProviderType) getList(activity = activity, alias = alias, radioMap = newRadioMap, maxCount = maxCount, listener = listener) } }) } fun show(@NotNull adObject: Any, @NotNull container: ViewGroup, @NotNull nativeTemplate: BaseNativeTemplate, @Nullable listener: NativeViewListener? = null) { TogetherAd.mProviders.entries.forEach { entry -> val adProvider = AdProviderLoader.loadAdProvider(entry.key) if (adProvider?.nativeAdIsBelongTheProvider(adObject) == true) { val nativeView = nativeTemplate.getNativeView(entry.key) nativeView?.showNative(entry.key, adObject, container, listener) return@forEach } } } }
{ "pile_set_name": "Github" }
/*$ Copyright (C) 2013-2020 Azel. This file is part of AzPainter. AzPainter is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. AzPainter is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. $*/ /***************************************** * 中間色グラデーションバー *****************************************/ /* * [notify] * type : 0-色選択 1-左の色変更 2-右の色変更 * param1 : 色 */ #include "mDef.h" #include "mWidgetDef.h" #include "mWidget.h" #include "mSysCol.h" #include "mPixbuf.h" #include "mEvent.h" #include "defDraw.h" //--------------------- typedef struct { mWidget wg; uint32_t col[2]; int rgb[2][3], //左右の RGB 値 rgb_diff[3], //左右の RGB 色差 rgb_diff_step[3], //左右の RGB 色差 (段階有効時) step, //段階数 fdrag, curx, //ドラッグ時のカーソル位置 last_gradx; //ドラッグ時、前回のグラデーション部分X位置 (-1 で最初) }GradBar; //--------------------- #define _BAR_H 13 #define _BETWEEN 4 //端の色とグラデーションの間 //--------------------- //======================== // sub //======================== /** 色から RGB 値取得してセット */ static void _set_rgb(GradBar *p) { int i,j,sf; uint32_t c; //R,G,B for(i = 0; i < 2; i++) { c = p->col[i]; for(j = 0, sf = 16; j < 3; j++, sf -= 8) p->rgb[i][j] = (c >> sf) & 255; } //色差 for(i = 0; i < 3; i++) { j = p->rgb[1][i] - p->rgb[0][i]; p->rgb_diff[i] = j; if((j & 1) && j > 0) j++; p->rgb_diff_step[i] = j; } } /** ドラッグ移動時、色を取得して通知 */ static void _on_motion(GradBar *p,int curx) { int i,x,w,c[3],step,stepno; double d; x = curx - (_BAR_H + _BETWEEN + 1); //グラデーション部分を先頭とした位置 w = p->wg.w - (_BAR_H + _BETWEEN) * 2 - 2; if(x < 0) x = 0; else if(x >= w) x = w - 1; //前回位置と比較 if(p->last_gradx == x) return; p->last_gradx = x; p->curx = x + _BAR_H + _BETWEEN + 1; //色取得 step = p->step; if(step < 3) { //通常 d = (double)x / (w - 1); for(i = 0; i < 3; i++) c[i] = (int)(p->rgb_diff[i] * d + p->rgb[0][i] + 0.5); } else { //段階あり stepno = x * step / w; if(stepno == step - 1) { //終端の色 for(i = 0; i < 3; i++) c[i] = p->rgb[1][i]; } else { for(i = 0; i < 3; i++) c[i] = stepno * p->rgb_diff_step[i] / (step - 1) + p->rgb[0][i]; } } //通知 mWidgetAppendEvent_notify(NULL, M_WIDGET(p), 0, M_RGB(c[0], c[1], c[2]), 0); mWidgetUpdate(M_WIDGET(p)); } //======================== // ハンドラ //======================== /** 押し時 */ static void _event_press(GradBar *p,int x) { int w = p->wg.w,no; if(x < _BAR_H || x >= w - _BAR_H) { //左右の色 : 描画色セット no = (x >= w - _BAR_H); p->col[no] = APP_DRAW->col.drawcol; _set_rgb(p); mWidgetUpdate(M_WIDGET(p)); mWidgetAppendEvent_notify(NULL, M_WIDGET(p), 1 + no, APP_DRAW->col.drawcol, 0); } else if(x >= _BAR_H + _BETWEEN + 1 && x < w - _BAR_H - _BETWEEN) { //グラデーション部分 (枠は含まない) p->fdrag = 1; p->last_gradx = -1; _on_motion(p, x); mWidgetGrabPointer(M_WIDGET(p)); } } /** グラブ解除 */ static void _grab_release(GradBar *p) { if(p->fdrag) { p->fdrag = 0; mWidgetUngrabPointer(M_WIDGET(p)); mWidgetUpdate(M_WIDGET(p)); } } /** イベント */ static int _event_handle(mWidget *wg,mEvent *ev) { GradBar *p = (GradBar *)wg; switch(ev->type) { case MEVENT_POINTER: if(ev->pt.type == MEVENT_POINTER_TYPE_MOTION) { //移動 if(p->fdrag) _on_motion(p, ev->pt.x); } else if(ev->pt.type == MEVENT_POINTER_TYPE_PRESS) { //押し if(ev->pt.btt == M_BTT_LEFT && !p->fdrag) _event_press(p, ev->pt.x); } else if(ev->pt.type == MEVENT_POINTER_TYPE_RELEASE) { //離し if(ev->pt.btt == M_BTT_LEFT) _grab_release(p); } break; case MEVENT_FOCUS: if(ev->focus.bOut) _grab_release(p); break; } return 1; } /** 描画 */ static void _draw_handle(mWidget *wg,mPixbuf *pixbuf) { GradBar *p = (GradBar *)wg; int i,j,x,w,c[3],step,stepno; uint32_t col; uint8_t *pd,*pd_y;
{ "pile_set_name": "Github" }
<accessControl> <resource uri="/axis2/*"> <clients> <ip>192.168.2.*</ip> </clients> </resource> </accessControl>
{ "pile_set_name": "Github" }
// Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build linux // +build arm64 // +build !gccgo #include "textflag.h" // Just jump to package syscall's implementation for all these functions. // The runtime may know about them. TEXT ·Syscall(SB),NOSPLIT,$0-56 B syscall·Syscall(SB) TEXT ·Syscall6(SB),NOSPLIT,$0-80 B syscall·Syscall6(SB) TEXT ·RawSyscall(SB),NOSPLIT,$0-56 B syscall·RawSyscall(SB) TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 B syscall·RawSyscall6(SB)
{ "pile_set_name": "Github" }
{ "title":"matchMedia", "description":"API for finding out whether or not a media query applies to the document.", "spec":"https://www.w3.org/TR/cssom-view/#dom-window-matchmedia", "status":"wd", "links":[ { "url":"https://github.com/paulirish/matchMedia.js/", "title":"matchMedia.js polyfill" }, { "url":"https://developer.mozilla.org/en/DOM/window.matchMedia", "title":"MDN Web Docs - matchMedia" }, { "url":"https://developer.mozilla.org/en/CSS/Using_media_queries_from_code", "title":"MDN Web Docs - Using matchMedia" }, { "url":"https://www.webplatform.org/docs/css/media_queries/apis/matchMedia", "title":"WebPlatform Docs" } ], "bugs":[ { "description":"MediaQueryList.addEventListener [doesn't work in Safari and IE](https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryList#Browser_compatibility)" } ], "categories":[ "DOM", "JS API" ], "stats":{ "ie":{ "5.5":"n", "6":"n", "7":"n", "8":"n", "9":"n", "10":"y", "11":"y" }, "edge":{ "12":"y", "13":"y", "14":"y", "15":"y", "16":"y", "17":"y", "18":"y", "79":"y", "80":"y", "81":"y", "83":"y", "84":"y", "85":"y" }, "firefox":{ "2":"n", "3":"n", "3.5":"n", "3.6":"n", "4":"n", "5":"n", "6":"y", "7":"y", "8":"y", "9":"y", "10":"y", "11":"y", "12":"y", "13":"y", "14":"y", "15":"y", "16":"y", "17":"y", "18":"y", "19":"y", "20":"y", "21":"y", "22":"y", "23":"y", "24":"y", "25":"y", "26":"y", "27":"y", "28":"y", "29":"y", "30":"y", "31":"y", "32":"y", "33":"y", "34":"y", "35":"y", "36":"y", "37":"y", "38":"y", "39":"y", "40":"y", "41":"y", "42":"y", "43":"y", "44":"y", "45":"y", "46":"y", "47":"y", "48":"y", "49":"y", "50":"y", "51":"y", "52":"y", "53":"y", "54":"y", "55":"y", "56":"y", "57":"y", "58":"y", "59":"y", "60":"y", "61":"y", "62":"y", "63":"y", "64":"y", "65":"y", "66":"y", "67":"y", "68":"y", "69":"y", "70":"y", "71":"y", "72":"y", "73":"y", "74":"y", "75":"y", "76":"y", "77":"y", "78":"y", "79":"y", "80":"y", "81":"y", "82":"y" }, "chrome":{ "4":"n", "5":"n", "6":"n", "7":"n", "8":"n", "9":"y", "10":"y", "11":"y", "12":"y", "13":"y", "14":"y", "15":"y", "16":"y", "17":"y", "18":"y", "19":"y", "20":"y", "21":"y", "22":"y", "23":"y", "24":"y", "25":"y", "26":"y", "27":"y", "28":"y", "29":"y", "30":"y", "31":"y", "32":"y", "33":"y", "34":"y", "35":"y", "36":"y", "37":"y", "38":"y", "39":"y", "40":"y", "41":"y", "42":"y", "43":"y", "44":"y", "45":"y", "46":"y", "47":"y", "48":"y", "49":"y", "50":"y", "51":"y", "52":"y", "53":"y", "54":"y", "55":"y", "56":"y", "57":"y", "58":"y", "59":"y", "60":"y", "61":"y", "62":"y", "63":"y", "64":"y", "65":"y", "66":"y", "67":"y", "68":"y", "69":"y", "70":"y", "71":"y", "72":"y", "73":"y", "74":"y", "75":"y", "76":"y", "77":"y", "78":"y", "79":"y", "80":"y", "81":"y", "83":"y", "84":"y", "85":"y", "86":"y", "87":"y", "88":"y" }, "safari":{ "3.1":"n", "3.2":"n", "4":"n", "5":"n", "5.1":"y", "6":"y", "6.1":"y", "7":"y", "7.1":"y", "8":"y", "9":"y", "9.1":"y", "10":"y", "10.1":"y", "11":"y", "11.1":"y", "12":"y", "12.1":"y", "13":"y", "13.1":"y", "14":"y", "TP":"y" }, "opera":{ "9":"n", "9.5-9.6":"n", "10.0-10.1":"n", "10.5":"n", "10.6":"n", "11":"n", "11.1":"n", "11.5":"n", "11.6":"n", "12":"n", "12.1":"y", "15":"y", "16":"y", "17":"y", "18":"y", "19":"y", "20":"y", "21":"y", "22":"y", "23":"y", "24":"y", "25":"y",
{ "pile_set_name": "Github" }
// +build go1.3 package stack import ( "sync" ) var pcStackPool = sync.Pool{ New: func() interface{} { return make([]uintptr, 1000) }, } func poolBuf() []uintptr { return pcStackPool.Get().([]uintptr) } func putPoolBuf(p []uintptr) { pcStackPool.Put(p) }
{ "pile_set_name": "Github" }
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package packet import ( "bytes" "encoding/hex" "io" "testing" ) // Test packet.Read error handling in OpaquePacket.Parse, // which attempts to re-read an OpaquePacket as a supported // Packet type. func TestOpaqueParseReason(t *testing.T) { buf, err := hex.DecodeString(UnsupportedKeyHex) if err != nil { t.Fatal(err) } or := NewOpaqueReader(bytes.NewBuffer(buf)) count := 0 badPackets := 0 var uid *UserId for { op, err := or.Next() if err == io.EOF { break } else if err != nil { t.Errorf("#%d: opaque read error: %v", count, err) break } // try to parse opaque packet p, err := op.Parse() switch pkt := p.(type) { case *UserId: uid = pkt case *OpaquePacket: // If an OpaquePacket can't re-parse, packet.Read // certainly had its reasons. if pkt.Reason == nil { t.Errorf("#%d: opaque packet, no reason", count) } else { badPackets++ } } count++ } const expectedBad = 3 // Test post-conditions, make sure we actually parsed packets as expected. if badPackets != expectedBad { t.Errorf("unexpected # unparseable packets: %d (want %d)", badPackets, expectedBad) } if uid == nil { t.Errorf("failed to find expected UID in unsupported keyring") } else if uid.Id != "Armin M. Warda <warda@nephilim.ruhr.de>" { t.Errorf("unexpected UID: %v", uid.Id) } } // This key material has public key and signature packet versions modified to // an unsupported value (1), so that trying to parse the OpaquePacket to // a typed packet will get an error. It also contains a GnuPG trust packet. // (Created with: od -An -t x1 pubring.gpg | xargs | sed 's/ //g') const UnsupportedKeyHex = `988d012e7a18a20000010400d6ac00d92b89c1f4396c243abb9b76d2e9673ad63483291fed88e22b82e255e441c078c6abbbf7d2d195e50b62eeaa915b85b0ec20c225ce2c64c167cacb6e711daf2e45da4a8356a059b8160e3b3628ac0dd8437b31f06d53d6e8ea4214d4a26406a6b63e1001406ef23e0bb3069fac9a99a91f77dfafd5de0f188a5da5e3c9000511b42741726d696e204d2e205761726461203c7761726461406e657068696c696d2e727568722e64653e8900950105102e8936c705d1eb399e58489901013f0e03ff5a0c4f421e34fcfa388129166420c08cd76987bcdec6f01bd0271459a85cc22048820dd4e44ac2c7d23908d540f54facf1b36b0d9c20488781ce9dca856531e76e2e846826e9951338020a03a09b57aa5faa82e9267458bd76105399885ac35af7dc1cbb6aaed7c39e1039f3b5beda2c0e916bd38560509bab81235d1a0ead83b0020000`
{ "pile_set_name": "Github" }
/* * MACE decoder * Copyright (c) 2002 Laszlo Torok <torokl@alpha.dfmk.hu> * * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /** * @file * MACE decoder. */ #include "avcodec.h" #include "internal.h" #include "libavutil/common.h" /* * Adapted to libavcodec by Francois Revol <revol@free.fr> * (removed 68k REG stuff, changed types, added some statics and consts, * libavcodec api, context stuff, interlaced stereo out). */ static const int16_t MACEtab1[] = {-13, 8, 76, 222, 222, 76, 8, -13}; static const int16_t MACEtab3[] = {-18, 140, 140, -18}; static const int16_t MACEtab2[][4] = { { 37, 116, 206, 330}, { 39, 121, 216, 346}, { 41, 127, 225, 361}, { 42, 132, 235, 377}, { 44, 137, 245, 392}, { 46, 144, 256, 410}, { 48, 150, 267, 428}, { 51, 157, 280, 449}, { 53, 165, 293, 470}, { 55, 172, 306, 490}, { 58, 179, 319, 511}, { 60, 187, 333, 534}, { 63, 195, 348, 557}, { 66, 205, 364, 583}, { 69, 214, 380, 609}, { 72, 223, 396, 635}, { 75, 233, 414, 663}, { 79, 244, 433, 694}, { 82, 254, 453, 725}, { 86, 265, 472, 756}, { 90, 278, 495, 792}, { 94, 290, 516, 826}, { 98, 303, 538, 862}, { 102, 316, 562, 901}, { 107, 331, 588, 942}, { 112, 345, 614, 983}, { 117, 361, 641, 1027}, { 122, 377, 670, 1074}, { 127, 394, 701, 1123}, { 133, 411, 732, 1172}, { 139, 430, 764, 1224}, { 145, 449, 799, 1280}, { 152, 469, 835, 1337}, { 159, 490, 872, 1397}, { 166, 512, 911, 1459}, { 173, 535, 951, 1523}, { 181, 558, 993, 1590}, { 189, 584, 1038, 1663}, { 197, 610, 1085, 1738}, { 206, 637, 1133, 1815}, { 215, 665, 1183, 1895}, { 225, 695, 1237, 1980}, { 235, 726, 1291, 2068}, { 246, 759, 1349, 2161}, { 257, 792, 1409, 2257}, { 268, 828, 1472, 2357}, { 280, 865, 1538, 2463}, { 293, 903, 1606, 2572}, { 306, 944, 1678, 2688}, { 319, 986, 1753, 2807}, { 334, 1030, 1832, 2933}, { 349, 1076, 1914, 3065}, { 364, 1124, 1999, 3202}, { 380, 1174, 2088, 3344}, { 398, 1227, 2182, 3494}, { 415, 1281, 2278, 3649}, { 434, 1339, 2380, 3811}, { 453, 1398, 2486, 3982}, { 473, 1461, 2598, 4160}, { 495, 1526, 2714, 4346}, { 517, 1594, 2835, 4540}, { 540, 1665, 2961, 4741}, { 564, 1740, 3093, 4953}, { 589, 1818, 3232, 5175}, { 615, 1898, 3375, 5405}, { 643, 1984, 3527, 5647}, { 671, 2072, 3683, 5898}, { 701, 2164, 3848, 6161}, { 733, 2261, 4020, 6438}, { 766, 2362, 4199, 6724}, { 800, 2467, 4386, 7024}, { 836, 2578, 4583, 7339}, { 873, 2692, 4786, 7664}, { 912, 2813, 5001, 8008}, { 952, 2938, 5223, 8364}, { 995, 3070, 5457, 8739}, { 1039, 3207, 5701, 9129}, { 1086, 3350, 5956, 9537}, { 1134, 3499, 6220, 9960}, { 1185, 3655, 6497, 10404}, { 1238, 3818, 6788, 10869}, { 1293, 3989, 7091, 11355}, { 1351, 4166, 7407, 11861}, { 1411, 4352, 7738, 12390}, { 1474, 4547, 8084, 12946}, { 1540, 4750, 8444, 13522}, { 1609, 4962, 8821, 14126}, { 1680, 5183, 9215, 14756}, { 1756, 5415, 9626, 15415}, { 1834, 5657, 10057, 16104}, { 1916, 5909, 10505, 16822}, { 2001, 6173, 10975, 17574}, { 2091, 6448, 11463, 18356}, { 2184, 6736, 11974, 19175}, { 2282, 7037, 12510, 20032}, { 2383, 7351, 13068, 20926}, { 2490, 7679, 13652, 21861}, { 2601, 8021, 14260, 22834}, { 2717, 8380, 14897, 23854}, { 2838, 8753, 15561, 24918}, { 2965, 9144, 16256, 26031}, { 3097, 9553,
{ "pile_set_name": "Github" }
/* * isph3a.h * * TI OMAP3 ISP - H3A AF module * * Copyright (C) 2010 Nokia Corporation * Copyright (C) 2009 Texas Instruments, Inc. * * Contacts: David Cohen <dacohen@gmail.com> * Laurent Pinchart <laurent.pinchart@ideasonboard.com> * Sakari Ailus <sakari.ailus@iki.fi> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ #ifndef OMAP3_ISP_H3A_H #define OMAP3_ISP_H3A_H #include <linux/omap3isp.h> /* * ---------- * -H3A AEWB- * ---------- */ #define AEWB_PACKET_SIZE 16 #define AEWB_SATURATION_LIMIT 0x3ff /* Flags for changed registers */ #define PCR_CHNG (1 << 0) #define AEWWIN1_CHNG (1 << 1) #define AEWINSTART_CHNG (1 << 2) #define AEWINBLK_CHNG (1 << 3) #define AEWSUBWIN_CHNG (1 << 4) #define PRV_WBDGAIN_CHNG (1 << 5) #define PRV_WBGAIN_CHNG (1 << 6) /* ISPH3A REGISTERS bits */ #define ISPH3A_PCR_AF_EN (1 << 0) #define ISPH3A_PCR_AF_ALAW_EN (1 << 1) #define ISPH3A_PCR_AF_MED_EN (1 << 2) #define ISPH3A_PCR_AF_BUSY (1 << 15) #define ISPH3A_PCR_AEW_EN (1 << 16) #define ISPH3A_PCR_AEW_ALAW_EN (1 << 17) #define ISPH3A_PCR_AEW_BUSY (1 << 18) #define ISPH3A_PCR_AEW_MASK (ISPH3A_PCR_AEW_ALAW_EN | \ ISPH3A_PCR_AEW_AVE2LMT_MASK) /* * -------- * -H3A AF- * -------- */ /* Peripheral Revision */ #define AFPID 0x0 #define AFCOEF_OFFSET 0x00000004 /* COEF base address */ /* PCR fields */ #define AF_BUSYAF (1 << 15) #define AF_FVMODE (1 << 14) #define AF_RGBPOS (0x7 << 11) #define AF_MED_TH (0xFF << 3) #define AF_MED_EN (1 << 2) #define AF_ALAW_EN (1 << 1) #define AF_EN (1 << 0) #define AF_PCR_MASK (AF_FVMODE | AF_RGBPOS | AF_MED_TH | \ AF_MED_EN | AF_ALAW_EN) /* AFPAX1 fields */ #define AF_PAXW (0x7F << 16) #define AF_PAXH 0x7F /* AFPAX2 fields */ #define AF_AFINCV (0xF << 13) #define AF_PAXVC (0x7F << 6) #define AF_PAXHC 0x3F /* AFPAXSTART fields */ #define AF_PAXSH (0xFFF<<16) #define AF_PAXSV 0xFFF /* COEFFICIENT MASK */ #define AF_COEF_MASK0 0xFFF #define AF_COEF_MASK1 (0xFFF<<16) /* BIT SHIFTS */ #define AF_RGBPOS_SHIFT 11 #define AF_MED_TH_SHIFT 3 #define AF_PAXW_SHIFT 16 #define AF_LINE_INCR_SHIFT 13 #define AF_VT_COUNT_SHIFT 6 #define AF_HZ_START_SHIFT 16 #define AF_COEF_SHIFT 16 /* Init and cleanup functions */ int omap3isp_h3a_aewb_init(struct isp_device *isp); int omap3isp_h3a_af_init(struct isp_device *isp); void omap3isp_h3a_aewb_cleanup(struct isp_device *isp); void omap3isp_h3a_af_cleanup(struct isp_device *isp); #endif /* OMAP3_ISP_H3A_H */
{ "pile_set_name": "Github" }
/* Kikoo */ /** * Kikoo */
{ "pile_set_name": "Github" }
<?php // $Header: /cvsroot/tikiwiki/tiki/parse_tiki.php,v 1.5 2004/06/16 01:24:10 teedog Exp $ // heaviled modified get_strings.php // dedicated as a tool for use in an eventual test suite // mose@tikiwiki.org require_once('tiki-setup.php'); if($tiki_p_admin != 'y') die("You need to be admin to run this script"); $logfile = 'temp/tiki_parsed.txt'; $logfilehtml = 'temp/tiki_parsed.html'; function collect($dir) { global $dirs; if (is_dir($dir) and is_dir("$dir/CVS")) { $list = file("$dir/CVS/Entries"); foreach ($list as $l) { // if (count($dirs) > 20) return true; if (strstr($l,'/')) { $s = split('/',rtrim($l)); $filepath = $dir.'/'.$s[1]; if ($s[0] == 'D') { collect($filepath); $dirs["$dir"][] = $s[1]; $dirs["$dir"]['FILES'] = array(); } else { if (is_file($filepath)) { $stat = stat($filepath); $files["$filepath"]["mtime"] = $stat['mtime']; $files["$filepath"]["ctime"] = $stat['ctime']; $files["$filepath"]["atime"] = $stat['atime']; $files["$filepath"]["size"] = $stat['size']; $files["$filepath"]["rev"] = $s[2]; $files["$filepath"]["date"] = $s[3]; $files["$filepath"]["flags"] = $s[4]; $files["$filepath"]["tag"] = $s[5]; clearstatcache(); $dirs["$dir"]['FILES'] = $files; } } } } } } function echoline($fd, $fx, $outstring, $style='', $mod='', $br=true) { if ($br) { $br = "\n"; } else { $br = ''; } fwrite ($fd, $outstring.$br); if ($mod == 'd') { $outstring = date('D M d H:m:s Y',trim($outstring)); } if ($style == 'eob') { $htmlstring = "</div>"; } elseif ($style) { if ($style == 'dir') { $htmlstring = "<span class='$style' onclick=\"javascript:toggle('".$outstring."');\">". sprintf(" %-16s : ",$style). htmlspecialchars($outstring)."</span>"; $htmlstring.= "<div class='box' id='".$outstring."'>"; $br = ''; } else { $htmlstring = "<span class='$style'>". sprintf(" %-16s : ",$style). htmlspecialchars($outstring)."</span>"; } } else { $htmlstring = htmlspecialchars($outstring); } fwrite ($fx, $htmlstring.$br); } $display = 'none'; if (isset($_REQUEST['all'])) $display = 'block'; ?> <html><head><style> pre { padding : 10px; border: 1px solid #666666; background-color: #efefef; } .dir { font-weight : bold; background-color: #ffffff; cursor : pointer; } .box { padding : 10px; border : 1px solid #999999; background-color: #f6f6f6; display : <?php echo $display ?>; } .file { font-weight : bold; } .php { background-color: #AACCFF; } .smarty { background-color: #FFccAA; } .other { background-color: #cccccc; } .image { background-color: #aaffcc; } .sub { padding-left : 20px; font-size : 80%; } .var { background-color: #FFFFAA; } .url { background-color: #FFAAAA; } .action { background-color: #AACCFF; } .form { background-color: #AABBFF; } .atime, .ctime, .mtime, .date { background-color: #dedede; } .size, .rev, .tag { background-color: #ededed; } </style><script type="text/javascript" src="lib/tiki-js.js"></script></head> <body><form action="parse_tiki.php" method="post"><input type="submit" name="action" value="process" /></form> <a href="<?php echo $logfile; ?>">raw report</a> <pre> <?php if (isset($_POST['action'])) { $files = $dirs = array(); collect('.'); @unlink ($logfile); $fw = fopen($logfile,'w'); $fx = fopen($logfilehtml,'w'); foreach ($dirs as $dir=>$params) { $dirname = basename($dir); $path = dirname($dir); echoline($fw,$fx,$dir,'dir'); echoline($fw,$fx,''); if (isset($dirs["$dir"]['FILES'])) { foreach ($dirs["$dir"]['FILES'] as $file=>$params) { $fp = fopen ($file, "r"); $data = fread ($fp, filesize ($file)); fclose ($fp); $requests = array(); $urls = array(); if (preg_match("/\.(tpl|ph(p|tml))$/", $file)) { if (preg_match("/\.ph(p|tml)$/", $file)) { echoline($fw,$fx, $file,"file php"); $data = preg_replace ("/(?s)\/\*.*?\*\//", "", $data); // C comments $data = preg_replace ("/(?m)^\s*\/\/.*\$/", "", $data); // C++ comments $data = preg_replace ("/(?m)^\s*\#.*\$/", "", $data); // shell comments $data = preg_replace('/(\r|\n)/', '', $data); // all one line preg_match_all('/\$_(REQUEST|POST|GET|COOKIE|SESSION)\[([^\]]*)\]/', $data, $requests); // requests uses $max = count($requests[0]); for ($i=0;$i<$max;$i++) { echoline($fw,$fx,$requests[1][$i]." = ".$requests[2][$i],'sub var'); } } elseif (preg_match ("/\.tpl$/", $file)) { echoline($fw,$fx,$file,'file smarty'); $data = preg_replace('/(?s)\{\*.*?\*\}/', '', $data); // Smarty comment $data = preg_replace('/(\r|\n)/', '', $data); // all one line } preg_match_all('/<(a[^>]*)>[^<]*<\/a>/im', $data, $urls); // href links foreach ($urls[1] as $u) { echoline($fw,$fx,$u,'sub url'); } preg_match_all('/<(form[^>]*)>/', $data, $forms); // form uses foreach ($forms[1] as $f) { echoline($fw,$fx,$f,'sub action'); } preg_match_all('/<((input|textarea|select)[^>]*)>/', $data, $elements); // form elements uses $max = count($elements[0]); for ($i=0;$i<$max;$i++) { echoline($fw,$fx,$elements[1][$i],'sub form'); } echoline($fw,$fx
{ "pile_set_name": "Github" }
/******************************************************************************* * Copyright 2012-2019 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. * This file 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. * ***************************************************************************** * * AWS Tools for Windows (TM) PowerShell (TM) * */ using System; using System.Collections.Generic; using System.Linq; using System.Management.Automation; using System.Text; using Amazon.PowerShell.Common; using Amazon.Runtime; using Amazon.CloudFormation; using Amazon.CloudFormation.Model; namespace Amazon.PowerShell.Cmdlets.CFN { /// <summary> /// Updates a stack as specified in the template. After the call completes successfully, /// the stack update starts. You can check the status of the stack via the <a>DescribeStacks</a> /// action. /// /// /// <para> /// To get a copy of the template for an existing stack, you can use the <a>GetTemplate</a> /// action. /// </para><para> /// For more information about creating an update template, updating a stack, and monitoring /// the progress of the update, see <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks.html">Updating /// a Stack</a>. /// </para> /// </summary> [Cmdlet("Update", "CFNStack", SupportsShouldProcess = true, ConfirmImpact = ConfirmImpact.Medium)] [OutputType("System.String")] [AWSCmdlet("Calls the AWS CloudFormation UpdateStack API operation.", Operation = new[] {"UpdateStack"}, SelectReturnType = typeof(Amazon.CloudFormation.Model.UpdateStackResponse))] [AWSCmdletOutput("System.String or Amazon.CloudFormation.Model.UpdateStackResponse", "This cmdlet returns a System.String object.", "The service call response (type Amazon.CloudFormation.Model.UpdateStackResponse) can also be referenced from properties attached to the cmdlet entry in the $AWSHistory stack." )] public partial class UpdateCFNStackCmdlet : AmazonCloudFormationClientCmdlet, IExecutor { #region Parameter Capability /// <summary> /// <para> /// <para>In some cases, you must explicitly acknowledge that your stack template contains certain /// capabilities in order for AWS CloudFormation to update the stack.</para><ul><li><para><code>CAPABILITY_IAM</code> and <code>CAPABILITY_NAMED_IAM</code></para><para>Some stack templates might include resources that can affect permissions in your AWS /// account; for example, by creating new AWS Identity and Access Management (IAM) users. /// For those stacks, you must explicitly acknowledge this by specifying one of these /// capabilities.</para><para>The following IAM resources require you to specify either the <code>CAPABILITY_IAM</code> /// or <code>CAPABILITY_NAMED_IAM</code> capability.</para><ul><li><para>If you have IAM resources, you can specify either capability. </para></li><li><para>If you have IAM resources with custom names, you <i>must</i> specify <code>CAPABILITY_NAMED_IAM</code>. /// </para></li><li><para>If you don't specify either of these capabilities, AWS CloudFormation returns an <code>InsufficientCapabilities</code> /// error.</para></li></ul><para>If your stack template contains these resources, we recommend that you review all /// permissions associated with them and edit their permissions if necessary.</para><ul><li><para><a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-accesskey.html"> /// AWS::IAM::AccessKey</a></para></li><li><para><a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-group.html"> /// AWS::IAM::Group</a></para></li><li><para><a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-instanceprofile.html"> /// AWS::IAM::InstanceProfile</a></para></li><li><para><a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-policy.html"> /// AWS::IAM::Policy</a></para></li><li><para><a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-role.html"> /// AWS::IAM::Role</a></para></li><li><para><a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-user.html"> /// AWS::IAM::User</a></para></li><li><para><a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-addusertogroup.html"> /// AWS::IAM::UserToGroupAddition</a></para></li></ul><para>For more information, see <a href="http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html#capabilities">Acknowledging /// IAM Resources in AWS CloudFormation Templates</a>.</para></li><li><para><code>CAPABILITY_AUTO_EXPAND</code></para><para>Some template contain macros. Macros perform custom processing on templates; this /// can include simple actions like find-and-replace operations, all the way to extensive /// transformations of entire templates. Because of this, users typically create a change /// set from the processed template, so that they can review the changes resulting from /// the macros before actually updating the stack. If your stack template contains one /// or more macros, and you choose to update a stack directly from the processed template, /// without first reviewing the resulting changes in a change set, you must acknowledge /// this capability. This includes the <a href="http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/create-reusable-transform-function-snippets-and-add-to-your-template-with-aws-include-transform.html">AWS::Include</a> /// and <a href="http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/transform-aws-serverless.html">AWS::Serverless</a> /// transforms, which are macros hosted by AWS CloudFormation.</para><para>Change sets do not currently support nested stacks. If you want to update a stack /// from a stack template that contains macros <i>and</i> nested stacks, you must update /// the stack directly from the template using this capability.</para><important><para>You should only update stacks directly from a stack template that contains macros /// if you know what processing the macro performs.</para><para>Each macro relies on an underlying Lambda service function for processing stack templates. /// Be aware that the Lambda function owner can update the function operation without /// AWS CloudFormation being notified.</para></important><para>For more information, see <a href="http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-macros.html">Using /// AWS CloudFormation Macros to Perform Custom Processing on Templates</a>.</para></li></ul> /// </para> /// </summary> [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("Capabilities")] public System.String[] Capability { get; set; } #endregion #region Parameter ClientRequestToken /// <summary> /// <para> /// <para>A unique identifier for this <code>UpdateStack</code> request. Specify this token /// if you plan to retry requests so that AWS CloudFormation
{ "pile_set_name": "Github" }
// // YLController.h // MacBlueTelnet // // Created by Yung-Luen Lan on 9/11/07. // Copyright 2007 yllan.org. All rights reserved. // #import <Cocoa/Cocoa.h> #import "WLSitesPanelController.h" #define scrollTimerInterval 0.12 @class WLTabView; @class WLFeedGenerator; @class WLTabBarControl; @class WLPresentationController; @class RemoteControl; @class MultiClickRemoteBehavior; #if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_5 @protocol NSTabViewDelegate @end #endif @interface WLMainFrameController : NSObject <NSTabViewDelegate, WLSitesObserver> { /* composeWindow */ IBOutlet NSTextView *_composeText; IBOutlet NSPanel *_composeWindow; IBOutlet NSWindow *_mainWindow; IBOutlet NSPanel *_messageWindow; IBOutlet id _addressBar; IBOutlet id _detectDoubleByteButton; IBOutlet id _autoReplyButton; IBOutlet id _mouseButton; IBOutlet WLTabView *_tabView; IBOutlet WLTabBarControl *_tabBarControl; /* Menus */ IBOutlet NSMenuItem *_detectDoubleByteMenuItem; IBOutlet NSMenuItem *_closeWindowMenuItem; IBOutlet NSMenuItem *_closeTabMenuItem; IBOutlet NSMenuItem *_autoReplyMenuItem; IBOutlet NSMenuItem *_showHiddenTextMenuItem; IBOutlet NSMenuItem *_encodingMenuItem; IBOutlet NSMenuItem *_presentationModeMenuItem; IBOutlet NSMenuItem *_sitesMenu; /* Message */ IBOutlet NSTextView *_unreadMessageTextView; // Remote Control RemoteControl *_remoteControl; MultiClickRemoteBehavior *_remoteControlBehavior; NSTimer* _scrollTimer; // Full Screen WLPresentationController *_presentationModeController; // RSS feed NSThread *_rssThread; // 10.7 Full Screen @private NSRect _originalFrame; NSRect _originalMainFrame; CGFloat _screenRatio; NSColor *_originalWindowBackgroundColor; NSDictionary *_originalSizeParameters; } @property (readonly) WLTabView *tabView; + (WLMainFrameController *)sharedInstance; - (IBAction)toggleAutoReply:(id)sender; - (IBAction)toggleMouseAction:(id)sender; - (IBAction)connectLocation:(id)sender; - (IBAction)openLocation:(id)sender; - (IBAction)reconnect:(id)sender; - (IBAction)openPreferencesWindow:(id)sender; - (void)newConnectionWithSite:(WLSite *)site; - (IBAction)openSitePanel:(id)sender; - (IBAction)addCurrentSite:(id)sender; - (IBAction)openEmoticonsPanel:(id)sender; - (IBAction)openComposePanel:(id)sender; - (IBAction)downloadPost:(id)sender; // Message - (IBAction)closeMessageWindow:(id)sender; #pragma mark - #pragma mark Menu:View - (IBAction)toggleShowsHiddenText:(id)sender; - (IBAction)toggleDetectDoubleByte:(id)sender; - (IBAction)increaseFontSize:(id)sender; - (IBAction)decreaseFontSize:(id)sender; - (IBAction)togglePresentationMode:(id)sender; - (IBAction)setEncoding:(id)sender; /* // for portal - (IBAction)browseImage:(id)sender; - (IBAction)removeSiteImage:(id)sender; - (void)openPanelDidEnd:(NSOpenPanel *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo; */ // for resotre - (IBAction)restoreSettings:(id)sender; // for RSS feed - (IBAction)openRSS:(id)sender; @end
{ "pile_set_name": "Github" }
/* * Copyright 2011-2019 Amazon.com, Inc. or its affiliates. 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://aws.amazon.com/apache2.0 * * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES * OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and * limitations under the License. */ package com.amazonaws.services.s3.model.analytics; import java.io.Serializable; /** * The StorageClassAnalysisDataExport class. */ public class StorageClassAnalysisDataExport implements Serializable { private String outputSchemaVersion; private AnalyticsExportDestination destination; /** * Sets the version of the output schema to use when exporting data. * @param outputSchemaVersion the output schema version. */ public void setOutputSchemaVersion(StorageClassAnalysisSchemaVersion outputSchemaVersion) { if (outputSchemaVersion == null) { setOutputSchemaVersion((String) null); } else { setOutputSchemaVersion(outputSchemaVersion.toString()); } } /** * Sets the version of the output schema to use when exporting data. * @param outputSchemaVersion the output schema version. * @return this object for method chaining. */ @SuppressWarnings("checkstyle:hiddenfield") public StorageClassAnalysisDataExport withOutputSchemaVersion(StorageClassAnalysisSchemaVersion outputSchemaVersion) { setOutputSchemaVersion(outputSchemaVersion); return this; } /** * @return the version of the output schema to use when exporting data. */ public String getOutputSchemaVersion() { return outputSchemaVersion; } /** * Sets the version of the output schema to use when exporting data. * @param outputSchemaVersion the output schema version. */ public void setOutputSchemaVersion(String outputSchemaVersion) { this.outputSchemaVersion = outputSchemaVersion; } /** * Sets the version of the output schema to use when exporting data * @param outputSchemaVersion the output schema version. * @return this object for method chaining. */ @SuppressWarnings("checkstyle:hiddenfield") public StorageClassAnalysisDataExport withOutputSchemaVersion(String outputSchemaVersion) { setOutputSchemaVersion(outputSchemaVersion); return this; } /** * @return the place to store the data for an analysis. */ public AnalyticsExportDestination getDestination() { return destination; } /** * Sets the place to store the data for an analysis. * @param destination the destination to store the data. */ public void setDestination(AnalyticsExportDestination destination) { this.destination = destination; } /** * Sets the place to store the data for an analysis * @param destination the destination to store the data. * @return this object for method chaining. */ @SuppressWarnings("checkstyle:hiddenfield") public StorageClassAnalysisDataExport withDestination(AnalyticsExportDestination destination) { setDestination(destination); return this; } }
{ "pile_set_name": "Github" }
/* * This library is part of OpenCms - * the Open Source Content Management System * * Copyright (c) Alkacon Software GmbH & Co. KG (http://www.alkacon.com) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * For further information about Alkacon Software GmbH & Co. KG, please see the * company website: http://www.alkacon.com * * For further information about OpenCms, please see the * project website: http://www.opencms.org * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package org.opencms.workplace.tools.searchindex; import org.opencms.configuration.CmsSearchConfiguration; import org.opencms.i18n.CmsMessageContainer; import org.opencms.jsp.CmsJspActionElement; import org.opencms.main.CmsLog; import org.opencms.main.OpenCms; import org.opencms.search.CmsSearchManager; import org.opencms.search.fields.CmsLuceneField; import org.opencms.search.fields.CmsSearchField; import org.opencms.search.fields.CmsSearchFieldMapping; import org.opencms.search.fields.I_CmsSearchFieldConfiguration; import org.opencms.search.fields.I_CmsSearchFieldMapping; import org.opencms.util.CmsStringUtil; import org.opencms.workplace.list.CmsListColumnAlignEnum; import org.opencms.workplace.list.CmsListColumnDefinition; import org.opencms.workplace.list.CmsListDefaultAction; import org.opencms.workplace.list.CmsListDirectAction; import org.opencms.workplace.list.CmsListItem; import org.opencms.workplace.list.CmsListItemDetails; import org.opencms.workplace.list.CmsListItemDetailsFormatter; import org.opencms.workplace.list.CmsListMetadata; import org.opencms.workplace.list.CmsListMultiAction; import org.opencms.workplace.list.CmsListOrderEnum; import org.opencms.workplace.tools.CmsToolDialog; import java.io.IOException; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import javax.servlet.ServletException; import org.apache.commons.logging.Log; /** * A list that displays the fields of a request parameter given * <code>{@link org.opencms.search.fields.CmsLuceneFieldConfiguration}</code> ("fieldconfiguration"). * * This list is no stand-alone page but has to be embedded in another dialog * (see <code> {@link org.opencms.workplace.tools.searchindex.A_CmsEmbeddedListDialog}</code>. <p> * * @since 6.5.5 */ public class CmsFieldsList extends A_CmsEmbeddedListDialog { /** Standard list button location. */ public static final String ICON_FALSE = "list/multi_deactivate.png"; /** Standard list button location. */ public static final String ICON_TRUE = "list/multi_activate.png"; /** list action id constant. */ public static final String LIST_ACTION_EDIT = "ae"; /** list action id constant. */ public static final String LIST_ACTION_EXCERPT_FALSE = "aef"; /** list action id constant. */ public static final String LIST_ACTION_EXCERPT_TRUE = "aet"; /** list action id constant. */ public static final String LIST_ACTION_INDEX_FALSE = "aif"; /** list action id constant. */ public static final String LIST_ACTION_INDEX_TRUE = "ait"; /** list action id constant. */ public static final String LIST_ACTION_MAPPING = "am"; /** list action id constant. */ public static final String LIST_ACTION_OVERVIEW_FIELD = "aof"; /** list action id constant. */ public static final String LIST_ACTION_STORE_FALSE = "asf"; /** list action id constant. */ public static final String LIST_ACTION_STORE_TRUE = "ast"; /** list column id constant. */ public static final String LIST_COLUMN_BOOST = "cb"; /** list column id constant. */ public static final String LIST_COLUMN_DEFAULT = "cd"; /** list column id constant. */ public static final String LIST_COLUMN_DISPLAY = "cdi"; /** list column id constant. */ public static final String LIST_COLUMN_EDIT = "ced"; /** list column id constant. */ public static final String LIST_COLUMN_EXCERPT = "ce"; /** list column id constant. */ public static final String LIST_COLUMN_EXCERPT_HIDE = "ceh"; /** list column id constant. */ public static final String LIST_COLUMN_ICON = "ci"; /** list column id constant. */ public static final String LIST_COLUMN_INDEX = "cx"; /** list column id constant. */ public static final String LIST_COLUMN_MAPPING = "cm"; /** list column id constant. */ public static final String LIST_COLUMN_NAME = "cn"; /** list column id constant. */ public static final String LIST_COLUMN_STORE = "cs"; /** list column id constant. */ public static final String LIST_COLUMN_STORE_HIDE = "csh"; /** list item detail id constant. */ public static final String LIST_DETAIL_FIELD = "df"; /** list id constant. */ public static final String LIST_ID = "lsfcf"; /** list action id constant. */ public static final String LIST_MACTION_DELETEFIELD = "mad"; /** The path to the fieldconfiguration list icon. */ protected static final String LIST_ICON_FIELD_EDIT = "tools/searchindex/icons/small/fieldconfiguration-editfield.png"; /** The log object for this class. */ private static final Log LOG = CmsLog.getLog(CmsFieldsList.class); /** Stores the value of the request parameter for the search index source name. */ private String m_paramFieldconfiguration; /** * Public constructor.<p> * * @param jsp an initialized JSP action element */ public CmsFieldsList(CmsJspActionElement jsp) { this(jsp, LIST_ID, Messages.get().container(Messages.GUI_LIST_FIELDS_NAME_0)); } /** * Public constructor.<p> * * @param jsp an initialized JSP action element * @param listId the id of the list * @param listName the list name */ public CmsFieldsList(CmsJspActionElement jsp, String listId, CmsMessageContainer listName) { this(jsp, listId, listName, LIST_COLUMN_NAME, CmsListOrderEnum.ORDER_ASCENDING, null); } /** * Public constructor.<p> * * @param jsp an initialized JSP action element * @param listId the id of the displayed list * @param listName the name of the list * @param sortedColId the a priory sorted column * @param sortOrder the order of the
{ "pile_set_name": "Github" }
/** * Copyright (c) 2013-present, Facebook, Inc. All rights reserved. * * This file provided by Facebook is for non-commercial testing and evaluation * purposes only. Facebook reserves all rights not expressly granted. * * 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 * FACEBOOK 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. */ 'use strict'; import {EditorState, Modifier, SelectionState} from 'draft-js'; export default function removeMediaBlock(editorState, blockKey) { var content = editorState.getCurrentContent(); var block = content.getBlockForKey(blockKey); var targetRange = new SelectionState({ anchorKey: blockKey, anchorOffset: 0, focusKey: blockKey, focusOffset: block.getLength(), }); var withoutTeX = Modifier.removeRange(content, targetRange, 'backward'); var resetBlock = Modifier.setBlockType( withoutTeX, withoutTeX.getSelectionAfter(), 'unstyled' ); var newState = EditorState.push(editorState, resetBlock, 'remove-range'); return EditorState.forceSelection(newState, resetBlock.getSelectionAfter()); }
{ "pile_set_name": "Github" }
<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <TargetFramework>netstandard2.0</TargetFramework> <LangVersion>8.0</LangVersion> <OutputPath>..\..\bin\</OutputPath> <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath> </PropertyGroup> <ItemGroup> <Compile Remove="Properties\AssemblyInfo.cs" /> </ItemGroup> <ItemGroup> <ProjectReference Include="..\Mosa.Compiler.Common\Mosa.Compiler.Common.csproj" /> </ItemGroup> <ItemGroup> <PackageReference Include="dnlib" Version="3.3.2" /> </ItemGroup> </Project>
{ "pile_set_name": "Github" }
"""Utilities for writing code that runs on Python 2 and 3""" # Copyright (c) 2010-2015 Benjamin Peterson # # 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. from __future__ import absolute_import import functools import itertools import operator import sys import types __author__ = "Benjamin Peterson <benjamin@python.org>" __version__ = "1.10.0" # Useful for very coarse version differentiation. PY2 = sys.version_info[0] == 2 PY3 = sys.version_info[0] == 3 PY34 = sys.version_info[0:2] >= (3, 4) if PY3: string_types = str, integer_types = int, class_types = type, text_type = str binary_type = bytes MAXSIZE = sys.maxsize else: string_types = basestring, integer_types = (int, long) class_types = (type, types.ClassType) text_type = unicode binary_type = str if sys.platform.startswith("java"): # Jython always uses 32 bits. MAXSIZE = int((1 << 31) - 1) else: # It's possible to have sizeof(long) != sizeof(Py_ssize_t). class X(object): def __len__(self): return 1 << 31 try: len(X()) except OverflowError: # 32-bit MAXSIZE = int((1 << 31) - 1) else: # 64-bit MAXSIZE = int((1 << 63) - 1) del X def _add_doc(func, doc): """Add documentation to a function.""" func.__doc__ = doc def _import_module(name): """Import module, returning the module after the last dot.""" __import__(name) return sys.modules[name] class _LazyDescr(object): def __init__(self, name): self.name = name def __get__(self, obj, tp): result = self._resolve() setattr(obj, self.name, result) # Invokes __set__. try: # This is a bit ugly, but it avoids running this again by # removing this descriptor. delattr(obj.__class__, self.name) except AttributeError: pass return result class MovedModule(_LazyDescr): def __init__(self, name, old, new=None): super(MovedModule, self).__init__(name) if PY3: if new is None: new = name self.mod = new else: self.mod = old def _resolve(self): return _import_module(self.mod) def __getattr__(self, attr): _module = self._resolve() value = getattr(_module, attr) setattr(self, attr, value) return value class _LazyModule(types.ModuleType): def __init__(self, name): super(_LazyModule, self).__init__(name) self.__doc__ = self.__class__.__doc__ def __dir__(self): attrs = ["__doc__", "__name__"] attrs += [attr.name for attr in self._moved_attributes] return attrs # Subclasses should override this _moved_attributes = [] class MovedAttribute(_LazyDescr): def __init__(self, name, old_mod, new_mod, old_attr=None, new_attr=None): super(MovedAttribute, self).__init__(name) if PY3: if new_mod is None: new_mod = name self.mod = new_mod if new_attr is None: if old_attr is None: new_attr = name else: new_attr = old_attr self.attr = new_attr else: self.mod = old_mod if old_attr is None: old_attr = name self.attr = old_attr def _resolve(self): module = _import_module(self.mod) return getattr(module, self.attr) class _SixMetaPathImporter(object): """ A meta path importer to import six.moves and its submodules. This class implements a PEP302 finder and loader. It should be compatible with Python 2.5 and all existing versions of Python3 """ def __init__(self, six_module_name): self.name = six_module_name self.known_modules = {} def _add_module(self, mod, *fullnames): for fullname in fullnames: self.known_modules[self.name + "." + fullname] = mod def _get_module(self, fullname): return self.known_modules[self.name + "." + fullname] def find_module(self, fullname, path=None): if fullname in self.known_modules: return self return None def __get_module(self, fullname): try: return self.known_modules[fullname] except KeyError: raise ImportError("This loader does not know module " + fullname) def load_module(self, fullname): try: # in case of a reload return sys.modules[fullname] except KeyError: pass mod = self.__get_module(fullname) if isinstance(mod, MovedModule): mod = mod._resolve() else: mod.__loader__ = self sys.modules[fullname] = mod return mod def is_package(self, fullname): """ Return true, if the named module is a package. We need this method to get correct spec objects with Python 3.4 (see PEP451) """ return hasattr(self.__get_module(fullname), "__path__") def get_code(self, fullname): """Return None Required, if is_package is implemented""" self.__get_module(fullname) # eventually raises ImportError return None get_source = get_code # same as get_code _importer = _SixMetaPathImporter(__name__) class _MovedItems(_LazyModule): """Lazy loading of moved objects""" __path__ = [] # mark as package _moved_attributes = [ MovedAttribute("cStringIO", "cStringIO", "io", "StringIO"), MovedAttribute("filter", "itertools", "builtins", "ifilter", "filter"), MovedAttribute("filterfalse", "itertools", "itertools", "ifilterfalse", "filterfalse"), MovedAttribute("input", "__builtin__", "builtins", "raw_input", "input"), MovedAttribute("intern", "__builtin__", "sys"), MovedAttribute("map", "itertools", "builtins", "imap", "map"), MovedAttribute("getcwd", "os", "os", "getcwdu", "getcwd"), MovedAttribute("getcwdb", "os", "os",
{ "pile_set_name": "Github" }
#include <assert.h> /* Test of reduction on both parallel and loop directives (workers and vectors in gang-partitioned mode, int type with XOR). */ int main (int argc, char *argv[]) { int i, j, arr[32768], res = 0, hres = 0; for (i = 0; i < 32768; i++) arr[i] = i; #pragma acc parallel num_gangs(32) num_workers(32) vector_length(32) \ reduction(^:res) { #pragma acc loop gang /* { dg-warning "nested loop in reduction needs reduction clause for 'res'" "TODO" } */ for (j = 0; j < 32; j++) { #pragma acc loop worker vector reduction(^:res) for (i = 0; i < 1024; i++) res ^= 3 * arr[j * 1024 + i]; #pragma acc loop worker vector reduction(^:res) for (i = 0; i < 1024; i++) res ^= arr[j * 1024 + (1023 - i)]; } } for (j = 0; j < 32; j++) for (i = 0; i < 1024; i++) { hres ^= 3 * arr[j * 1024 + i]; hres ^= arr[j * 1024 + (1023 - i)]; } assert (res == hres); return 0; }
{ "pile_set_name": "Github" }
<div class="gf-form-group"> <div class="grafana-info-box"> <h4>BigQuery Authentication</h4> <p>There are two ways to authenticate the BigQuery plugin - either by uploading a Service Account key file, or by automatically retrieving credentials from the Google metadata server. The latter option is only available when running Grafana on a GCE virtual machine.</p> <h5>Uploading a Service Account Key File</h5> <p> First you need to create a Google Cloud Platform (GCP) Service Account for the Project you want to show data for. A Grafana datasource integrates with one GCP Project. If you want to visualize data from multiple GCP Projects then you need to create one datasource per GCP Project. </p> <p> The <strong>BigQuery Data Viewer</strong> role provides all the permissions that Grafana needs. The following API needs to be enabled on GCP for the datasource to work: <a class="external-link" target="_blank" href="https://console.cloud.google.com/apis/library/bigquery.googleapis.com">BigQuery API</a> </p> <h5>GCE Default Service Account</h5> <p> If Grafana is running on a Google Compute Engine (GCE) virtual machine, it is possible for Grafana to automatically retrieve the default project id and authentication token from the metadata server. In order for this to work, you need to make sure that you have a service account that is setup as the default account for the virtual machine and that the service account has been given read access to the BigQuery API. </p> <!-- TDOD docs --> <p>Detailed instructions on how to create a Service Account can be found <a class="external-link" target="_blank" href="https://doitintl.github.io/bigquery-grafana/">in the documentation.</a> </p> </div> </div> <div class="gf-form-group"> <div class="gf-form"> <h3>Authentication</h3> <info-popover mode="header">Upload your Service Account key file or paste in the contents of the file. The file contents will be encrypted and saved in the Grafana database.</info-popover> </div> <div class="gf-form-inline"> <div class="gf-form max-width-30"> <span class="gf-form-label width-13">Authentication Type</span> <div class="gf-form-select-wrapper max-width-24"> <select class="gf-form-input" ng-model="ctrl.current.jsonData.authenticationType" ng-options="f.key as f.value for f in ctrl.authenticationTypes"></select> </div> </div> </div> <div ng-if="ctrl.current.jsonData.authenticationType === ctrl.defaultAuthenticationType && !ctrl.current.jsonData.clientEmail && !ctrl.inputDataValid"> <div class="gf-form-group" ng-if="!ctrl.inputDataValid"> <div class="gf-form"> <form> <dash-upload on-upload="ctrl.onUpload(dash)" btn-text="Upload Service Account key file"></dash-upload> </form> </div> </div> <div class="gf-form-group"> <h5 class="section-heading" ng-if="!ctrl.inputDataValid">Or paste Service Account key JSON</h5> <div class="gf-form" ng-if="!ctrl.inputDataValid"> <textarea rows="10" data-share-panel-url="" class="gf-form-input" ng-model="ctrl.jsonText" ng-paste="ctrl.onPasteJwt($event)"></textarea> </div> <div ng-repeat="valError in ctrl.validationErrors" class="text-error p-l-1"> <i class="fa fa-warning"></i> {{valError}} </div> </div> </div> </div> <div class="gf-form-group" ng-if="ctrl.current.jsonData.authenticationType === ctrl.defaultAuthenticationType && (ctrl.inputDataValid || ctrl.current.jsonData.clientEmail)"> <h6>Uploaded Key Details</h6> <div class="gf-form"> <span class="gf-form-label width-13">Project</span> <input class="gf-form-input width-40" disabled type="text" ng-model="ctrl.current.jsonData.defaultProject" /> </div> <div class="gf-form"> <span class="gf-form-label width-13">Client Email</span> <input class="gf-form-input width-40" disabled type="text" ng-model="ctrl.current.jsonData.clientEmail" /> </div> <div class="gf-form"> <span class="gf-form-label width-13">Token URI</span> <input class="gf-form-input width-40" disabled type="text" ng-model='ctrl.current.jsonData.tokenUri' /> </div> <div class="gf-form" ng-if="ctrl.current.secureJsonFields.privateKey"> <span class="gf-form-label width-13">Private Key</span> <input type="text" class="gf-form-input max-width-12" disabled="disabled" value="configured"> </div> <div class="gf-form width-18"> <a class="btn btn-secondary gf-form-btn" href="#" ng-click="ctrl.resetValidationMessages()">Reset Service Account Key </a> <info-popover mode="right-normal"> Reset to clear the uploaded key and upload a new file. </info-popover> </div> </div> <p class="gf-form-label" ng-hide="ctrl.current.secureJsonFields.privateKey || ctrl.current.jsonData.authenticationType !== ctrl.defaultAuthenticationType"><i class="fa fa-save"></i> Do not forget to save your changes after uploading a file.</p> <div class="gf-form max-width-30"> <span class="gf-form-label width-13">Flat Rate Project</span> <input type="text" class="gf-form-input" ng-model='ctrl.current.jsonData.flatRateProject'></input> <info-popover mode="right-absolute"> The project that the Queries will be run in if you are using a flat-rate pricing model. </info-popover> </div> <div class="gf-form"> <label class="gf-form-label width-13">Processing Location</label> <div class="gf-form-select-wrapper"> <select class="gf-form-input gf-size-auto" ng-model="ctrl.current.jsonData.processingLocation" ng-options="f.value as f.text for f in ctrl.locations" ng-change="ctrl.refresh()"></select> </div> </div> <div class="gf-form"> <span class="gf-form-label width-13">Query Priority</span> <div class="gf-form-select-wrapper"> <select class="gf-form-select-wrapper gf-form-input gf-size-auto" ng-model="ctrl.current.jsonData.queryPriority" ng-options="f.value as f.text for f in ctrl.queryPriority" ng-change="ctrl.refresh()"></select> </div> </div> <gf-form-switch class="gf-form" label="Send anonymous usage data" label-class="width-13" checked="ctrl.current.jsonData.sendUsageData" switch-class="max-width-6"></gf-form-switch> <!-- <label class="gf-form-label query-keyword pointer"> </label> --> <p class="gf-form-label" ng-show="ctrl.current.jsonData.authenticationType !== ctrl.defaultAuthenticationType"><i class="fa fa-save"></i> Verify GCE default service account by clicking Save & Test</p>
{ "pile_set_name": "Github" }
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.flink.statefun.flink.io.kinesis.polyglot; import com.google.protobuf.Any; import com.google.protobuf.InvalidProtocolBufferException; import org.apache.flink.statefun.flink.io.generated.KinesisEgressRecord; import org.apache.flink.statefun.sdk.kinesis.egress.EgressRecord; import org.apache.flink.statefun.sdk.kinesis.egress.KinesisEgressSerializer; public final class GenericKinesisEgressSerializer implements KinesisEgressSerializer<Any> { private static final long serialVersionUID = 1L; @Override public EgressRecord serialize(Any value) { final KinesisEgressRecord kinesisEgressRecord = asKinesisEgressRecord(value); final EgressRecord.Builder builder = EgressRecord.newBuilder() .withData(kinesisEgressRecord.getValueBytes().toByteArray()) .withStream(kinesisEgressRecord.getStream()) .withPartitionKey(kinesisEgressRecord.getPartitionKey()); final String explicitHashKey = kinesisEgressRecord.getExplicitHashKey(); if (explicitHashKey != null && !explicitHashKey.isEmpty()) { builder.withExplicitHashKey(explicitHashKey); } return builder.build(); } private static KinesisEgressRecord asKinesisEgressRecord(Any message) { if (!message.is(KinesisEgressRecord.class)) { throw new IllegalStateException( "The generic Kinesis egress expects only messages of type " + KinesisEgressRecord.class.getName()); } try { return message.unpack(KinesisEgressRecord.class); } catch (InvalidProtocolBufferException e) { throw new RuntimeException( "Unable to unpack message as a " + KinesisEgressRecord.class.getName(), e); } } }
{ "pile_set_name": "Github" }
input_driver = "xinput" input_device = "Controller (Xbox One For Windows)" input_device_display_name = "XBOX One Controller" input_vendor_id = "1118" input_product_id = "767" input_b_btn = "0" input_y_btn = "2" input_select_btn = "7" input_start_btn = "6" input_up_btn = "h0up" input_down_btn = "h0down" input_left_btn = "h0left" input_right_btn = "h0right" input_a_btn = "1" input_x_btn = "3" input_l_btn = "4" input_r_btn = "5" input_l2_axis = "+4" input_r2_axis = "+5" input_l3_btn = "8" input_r3_btn = "9" input_l_x_plus_axis = "+0" input_l_x_minus_axis = "-0" input_l_y_plus_axis = "-1" input_l_y_minus_axis = "+1" input_r_x_plus_axis = "+2" input_r_x_minus_axis = "-2" input_r_y_plus_axis = "-3" input_r_y_minus_axis = "+3" input_menu_toggle_btn = "10" input_b_btn_label = "A" input_y_btn_label = "X" input_select_btn_label = "View" input_start_btn_label = "Menu" input_up_btn_label = "D-Pad Up" input_down_btn_label = "D-Pad Down" input_left_btn_label = "D-Pad Left" input_right_btn_label = "D-Pad Right" input_a_btn_label = "B" input_x_btn_label = "Y" input_l_btn_label = "Left Bumper" input_r_btn_label = "Right Bumper" input_l2_axis_label = "Left Trigger" input_r2_axis_label = "Right Trigger" input_l3_btn_label = "Left Thumb" input_r3_btn_label = "Right Thumb" input_l_x_plus_axis_label = "Left Analog X+" input_l_x_minus_axis_label = "Left Analog X-" input_l_y_plus_axis_label = "Left Analog Y+" input_l_y_minus_axis_label = "Left Analog Y-" input_r_x_plus_axis_label = "Right Analog X+" input_r_x_minus_axis_label = "Right Analog X-" input_r_y_plus_axis_label = "Right Analog Y+" input_r_y_minus_axis_label = "Right Analog Y-" input_menu_toggle_btn_label = "Guide"
{ "pile_set_name": "Github" }
<!doctype html> <title>CodeMirror: HTML mixed mode</title> <meta charset="utf-8"/> <link rel=stylesheet href="../../doc/docs.css"> <link rel="stylesheet" href="../../lib/codemirror.css"> <script src="../../lib/codemirror.js"></script> <script src="../../addon/selection/selection-pointer.js"></script> <script src="../xml/xml.js"></script> <script src="../javascript/javascript.js"></script> <script src="../css/css.js"></script> <script src="../vbscript/vbscript.js"></script> <script src="htmlmixed.js"></script> <style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style> <div id=nav> <a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png" alt=""></a> <ul> <li><a href="../../index.html">Home</a> <li><a href="../../doc/manual.html">Manual</a> <li><a href="https://github.com/codemirror/codemirror">Code</a> </ul> <ul> <li><a href="../index.html">Language modes</a> <li><a class=active href="#">HTML mixed</a> </ul> </div> <article> <h2>HTML mixed mode</h2> <form><textarea id="code" name="code"> <html style="color: green"> <!-- this is a comment --> <head> <title>Mixed HTML Example</title> <style> h1 {font-family: comic sans; color: #f0f;} div {background: yellow !important;} body { max-width: 50em; margin: 1em 2em 1em 5em; } </style> </head> <body> <h1>Mixed HTML Example</h1> <script> function jsFunc(arg1, arg2) { if (arg1 && arg2) document.body.innerHTML = "achoo"; } </script> </body> </html> </textarea></form> <script> // Define an extended mixed-mode that understands vbscript and // leaves mustache/handlebars embedded templates in html mode var mixedMode = { name: "htmlmixed", scriptTypes: [{matches: /\/x-handlebars-template|\/x-mustache/i, mode: null}, {matches: /(text|application)\/(x-)?vb(a|script)/i, mode: "vbscript"}] }; var editor = CodeMirror.fromTextArea(document.getElementById("code"), { mode: mixedMode, selectionPointer: true }); </script> <p>The HTML mixed mode depends on the XML, JavaScript, and CSS modes.</p> <p>It takes an optional mode configuration option, <code>tags</code>, which can be used to add custom behavior for specific tags. When given, it should be an object mapping tag names (for example <code>script</code>) to arrays or three-element arrays. Those inner arrays indicate [attributeName, valueRegexp, <a href="../../doc/manual.html#option_mode">modeSpec</a>] specifications. For example, you could use <code>["type", /^foo$/, "foo"]</code> to map the attribute <code>type="foo"</code> to the <code>foo</code> mode. When the first two fields are null (<code>[null, null, "mode"]</code>), the given mode is used for any such tag that doesn't match any of the previously given attributes. For example:</p> <pre>var myModeSpec = { name: "htmlmixed", tags: { style: [["type", /^text\/(x-)?scss$/, "text/x-scss"], [null, null, "css"]], custom: [[null, null, "customMode"]] } }</pre> <p><strong>MIME types defined:</strong> <code>text/html</code> (redefined, only takes effect if you load this parser after the XML parser).</p> </article>
{ "pile_set_name": "Github" }
//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // <utility> // template <class T1, class T2> struct pair // struct piecewise_construct_t { }; // constexpr piecewise_construct_t piecewise_construct = piecewise_construct_t(); #include <utility> #include <tuple> #include <cassert> class A { int i_; char c_; public: A(int i, char c) : i_(i), c_(c) {} int get_i() const {return i_;} char get_c() const {return c_;} }; class B { double d_; unsigned u1_; unsigned u2_; public: B(double d, unsigned u1, unsigned u2) : d_(d), u1_(u1), u2_(u2) {} double get_d() const {return d_;} unsigned get_u1() const {return u1_;} unsigned get_u2() const {return u2_;} }; int main() { #ifndef _LIBCPP_HAS_NO_VARIADICS std::pair<A, B> p(std::piecewise_construct, std::make_tuple(4, 'a'), std::make_tuple(3.5, 6u, 2u)); assert(p.first.get_i() == 4); assert(p.first.get_c() == 'a'); assert(p.second.get_d() == 3.5); assert(p.second.get_u1() == 6u); assert(p.second.get_u2() == 2u); #endif }
{ "pile_set_name": "Github" }
// Copyright 2012-present Oliver Eilhard. All rights reserved. // Use of this source code is governed by a MIT-license. // See http://olivere.mit-license.org/license.txt for details. package elastic import "testing" func TestIngestPutPipelineURL(t *testing.T) { client := setupTestClientAndCreateIndex(t) tests := []struct { Id string Expected string }{ { "my-pipeline-id", "/_ingest/pipeline/my-pipeline-id", }, } for _, test := range tests { path, _, err := client.IngestPutPipeline(test.Id).buildURL() if err != nil { t.Fatal(err) } if path != test.Expected { t.Errorf("expected %q; got: %q", test.Expected, path) } } }
{ "pile_set_name": "Github" }
@XmlSchema(namespace="${datawave.webservice.namespace}", elementFormDefault=XmlNsForm.QUALIFIED, xmlns={@XmlNs(prefix = "", namespaceURI = "${datawave.webservice.namespace}")}) package datawave.webservice.common.result; import javax.xml.bind.annotation.XmlNs; import javax.xml.bind.annotation.XmlNsForm; import javax.xml.bind.annotation.XmlSchema;
{ "pile_set_name": "Github" }
<?xml version="1.0" ?> <!DOCTYPE translationbundle> <translationbundle lang="es-419"> <translation id="1185134272377778587">Acerca de Chromium</translation> <translation id="1472013873724362412">Tu cuenta no funciona en Chromium. Comunícate con tu administrador de dominio o utiliza una cuenta común de Google para acceder.</translation> <translation id="2195025571279539885">¿Quieres que Google Chrome te ofrezca traducir las páginas de este sitio que estén en <ph name="LANGUAGE_NAME" /> la próxima vez?</translation> <translation id="3805899903892079518">Chromium no tiene acceso a tus fotos o videos. Habilita el acceso en Configuración de iOS &gt; Privacidad &gt; Fotos.</translation> <translation id="6068866989048414399">Condiciones del servicio de Chromium</translation> <translation id="6268381023930128611">¿Salir de Chromium?</translation> <translation id="6424492062988593837">¡Chromium mejoró! Hay una nueva versión disponible.</translation> <translation id="6600954340915313787">Se copió en Chrome.</translation> <translation id="7337881442233988129">Chromium</translation> <translation id="8252885722420466166">Obtén una mejor experiencia de Google en Chromium según tu ubicación.</translation> <translation id="8353224596138547809">¿Quieres que Chromium guarde tu contraseña para este sitio?</translation> <translation id="8586442755830160949">Copyright <ph name="YEAR" /> Los autores de Chromium. Todos los derechos reservados.</translation> <translation id="985602178874221306">Los creadores de Chromium</translation> </translationbundle>
{ "pile_set_name": "Github" }
# frozen_string_literal: true require "spec_helper" require "decidim/api/test/type_context" require "decidim/core/test/shared_examples/traceable_interface_examples" require "decidim/core/test/shared_examples/scopable_interface_examples" module Decidim module Budgets describe BudgetType, type: :graphql do include_context "with a graphql type" let(:model) { create(:budget) } include_examples "scopable interface" it_behaves_like "traceable interface" do let(:author) { create(:user, :admin, organization: model.component.organization) } end describe "id" do let(:query) { "{ id }" } it "returns all the required fields" do expect(response).to include("id" => model.id.to_s) end end describe "title" do let(:query) { '{ title { translation(locale: "en")}}' } it "returns all the required fields" do expect(response["title"]["translation"]).to eq(model.title["en"]) end end describe "description" do let(:query) { '{ description { translation(locale: "en")}}' } it "returns all the required fields" do expect(response["description"]["translation"]).to eq(model.description["en"]) end end describe "total_budget" do let(:query) { "{ total_budget }" } it "returns the total budget" do expect(response["total_budget"]).to eq(model.total_budget) end end describe "projects" do let!(:budget2) { create(:budget) } let(:query) { "{ projects { id } }" } it "returns the budget projects" do ids = response["projects"].map { |project| project["id"] } expect(ids).to include(*model.projects.map(&:id).map(&:to_s)) expect(ids).not_to include(*budget2.projects.map(&:id).map(&:to_s)) end end end end end
{ "pile_set_name": "Github" }
fileFormatVersion: 2 guid: be3c3a084f7b29b4880b42b4cfbf4d8f MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName:
{ "pile_set_name": "Github" }
wlxt.jxie.edu.cn jw.jxie.edu.cn xxfw.jxie.edu.cn xlzx.jxie.edu.cn portal.jxie.edu.cn www.jxie.edu.cn jpkc.jxie.edu.cn
{ "pile_set_name": "Github" }
# AVAILABLE NOW: [Front-End Developer Handbook 2017](https://frontendmasters.com/books/front-end-handbook/2017/) *** ## Learn Internet/Web > The Internet is a global system of interconnected computer networks that use the Internet protocol suite (TCP/IP) to link several billion devices worldwide. It is a network of networks that consists of millions of private, public, academic, business, and government networks of local to global scope, linked by a broad array of electronic, wireless, and optical networking technologies. The Internet carries an extensive range of information resources and services, such as the inter-linked hypertext documents and applications of the World Wide Web (WWW), electronic mail, telephony, and peer-to-peer networks for file sharing. ><cite>&#8212; [Wikipedia](https://en.wikipedia.org/wiki/Internet)</cite> * [How Does the Internet work](http://www.w3.org/wiki/How_does_the_Internet_work) - W3C [read] * [How Does the Internet Work?](http://web.stanford.edu/class/msande91si/www-spr04/readings/week1/InternetWhitepaper.htm) - Stanford Paper [read] * [How the Internet Works](https://www.khanacademy.org/partner-content/code-org/internet-works) [watch] * [How the Internet Works in 5 Minutes](https://www.youtube.com/watch?v=7_LPdttKXPc) [watch] * [How the Web Works](https://www.eventedmind.com/classes/how-the-web-works-7f40254c) [watch][$] * [What Is the Internet? Or, "You Say Tomato, I Say TCP/IP"](http://www.20thingsilearned.com/en-US/what-is-the-internet/1) [read]
{ "pile_set_name": "Github" }
/* * Copyright (C) 2015 Karumi. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.byl.qrobot.menu; import android.view.View; /** * Interface used to notify click events performed in ExpandableItems inside an ExpandableSelector * widget. */ public interface OnExpandableItemClickListener { void onExpandableItemClickListener(int index, View view); }
{ "pile_set_name": "Github" }
// Copyright (c) Microsoft Corporation. // Licensed under the MIT license. #include "pch.h" #include "XamlUiaTextRange.h" #include "../types/TermControlUiaTextRange.hpp" #include <UIAutomationClient.h> // the same as COR_E_NOTSUPPORTED // we don't want to import the CLR headers to get it #define XAML_E_NOT_SUPPORTED 0x80131515L namespace UIA { using ::ITextRangeProvider; using ::SupportedTextSelection; using ::TextPatternRangeEndpoint; using ::TextUnit; } namespace XamlAutomation { using winrt::Windows::UI::Xaml::Automation::SupportedTextSelection; using winrt::Windows::UI::Xaml::Automation::Provider::IRawElementProviderSimple; using winrt::Windows::UI::Xaml::Automation::Provider::ITextRangeProvider; using winrt::Windows::UI::Xaml::Automation::Text::TextPatternRangeEndpoint; using winrt::Windows::UI::Xaml::Automation::Text::TextUnit; } namespace winrt::Microsoft::Terminal::TerminalControl::implementation { XamlAutomation::ITextRangeProvider XamlUiaTextRange::Clone() const { UIA::ITextRangeProvider* pReturn; THROW_IF_FAILED(_uiaProvider->Clone(&pReturn)); auto xutr = winrt::make_self<XamlUiaTextRange>(pReturn, _parentProvider); return xutr.as<XamlAutomation::ITextRangeProvider>(); } bool XamlUiaTextRange::Compare(XamlAutomation::ITextRangeProvider pRange) const { auto self = winrt::get_self<XamlUiaTextRange>(pRange); BOOL returnVal; THROW_IF_FAILED(_uiaProvider->Compare(self->_uiaProvider.get(), &returnVal)); return returnVal; } int32_t XamlUiaTextRange::CompareEndpoints(XamlAutomation::TextPatternRangeEndpoint endpoint, XamlAutomation::ITextRangeProvider pTargetRange, XamlAutomation::TextPatternRangeEndpoint targetEndpoint) { auto self = winrt::get_self<XamlUiaTextRange>(pTargetRange); int32_t returnVal; THROW_IF_FAILED(_uiaProvider->CompareEndpoints(static_cast<UIA::TextPatternRangeEndpoint>(endpoint), self->_uiaProvider.get(), static_cast<UIA::TextPatternRangeEndpoint>(targetEndpoint), &returnVal)); return returnVal; } void XamlUiaTextRange::ExpandToEnclosingUnit(XamlAutomation::TextUnit unit) const { THROW_IF_FAILED(_uiaProvider->ExpandToEnclosingUnit(static_cast<UIA::TextUnit>(unit))); } XamlAutomation::ITextRangeProvider XamlUiaTextRange::FindAttribute(int32_t /*textAttributeId*/, winrt::Windows::Foundation::IInspectable /*val*/, bool /*searchBackward*/) { // TODO GitHub #2161: potential accessibility improvement // we don't support this currently throw winrt::hresult_not_implemented(); } XamlAutomation::ITextRangeProvider XamlUiaTextRange::FindText(winrt::hstring text, bool searchBackward, bool ignoreCase) { UIA::ITextRangeProvider* pReturn; const auto queryText = wil::make_bstr(text.c_str()); THROW_IF_FAILED(_uiaProvider->FindText(queryText.get(), searchBackward, ignoreCase, &pReturn)); auto xutr = winrt::make_self<XamlUiaTextRange>(pReturn, _parentProvider); return *xutr; } winrt::Windows::Foundation::IInspectable XamlUiaTextRange::GetAttributeValue(int32_t textAttributeId) const { // Copied functionality from Types::UiaTextRange.cpp if (textAttributeId == UIA_IsReadOnlyAttributeId) { return winrt::box_value(false); } else { // We _need_ to return XAML_E_NOT_SUPPORTED here. // Returning nullptr is an improper implementation of it being unsupported. // UIA Clients rely on this HRESULT to signify that the requested attribute is undefined. // Anything else will result in the UIA Client refusing to read when navigating by word // Magically, this doesn't affect other forms of navigation... winrt::throw_hresult(XAML_E_NOT_SUPPORTED); } } void XamlUiaTextRange::GetBoundingRectangles(com_array<double>& returnValue) const { returnValue = {}; try { SAFEARRAY* pReturnVal; THROW_IF_FAILED(_uiaProvider->GetBoundingRectangles(&pReturnVal)); double* pVals; THROW_IF_FAILED(SafeArrayAccessData(pReturnVal, (void**)&pVals)); long lBound, uBound; THROW_IF_FAILED(SafeArrayGetLBound(pReturnVal, 1, &lBound)); THROW_IF_FAILED(SafeArrayGetUBound(pReturnVal, 1, &uBound)); long count = uBound - lBound + 1; std::vector<double> vec; vec.reserve(count); for (int i = 0; i < count; i++) { double element = pVals[i]; vec.push_back(element); } winrt::com_array<double> result{ vec }; returnValue = std::move(result); } catch (...) { } } XamlAutomation::IRawElementProviderSimple XamlUiaTextRange::GetEnclosingElement() { return _parentProvider; } winrt::hstring XamlUiaTextRange::GetText(int32_t maxLength) const { BSTR returnVal; THROW_IF_FAILED(_uiaProvider->GetText(maxLength, &returnVal)); return winrt::to_hstring(returnVal); } int32_t XamlUiaTextRange::Move(XamlAutomation::TextUnit unit, int32_t count) { int returnVal; THROW_IF_FAILED(_uiaProvider->Move(static_cast<UIA::TextUnit>(unit), count, &returnVal)); return returnVal; } int32_t XamlUiaTextRange::MoveEndpointByUnit(XamlAutomation::TextPatternRangeEndpoint endpoint, XamlAutomation::TextUnit unit, int32_t count) const { int returnVal; THROW_IF_FAILED(_uiaProvider->MoveEndpointByUnit(static_cast<UIA::TextPatternRangeEndpoint>(endpoint), static_cast<UIA::TextUnit>(unit), count, &returnVal)); return returnVal; } void XamlUiaTextRange::MoveEndpointByRange(XamlAutomation::TextPatternRangeEndpoint endpoint, XamlAutomation::ITextRangeProvider pTargetRange, XamlAutomation::TextPatternRangeEndpoint targetEndpoint) const { auto self = winrt::get_self<XamlUiaTextRange>(pTargetRange); THROW_IF_FAILED(_uiaProvider->MoveEndpointByRange(static_cast<UIA::TextPatternRangeEndpoint>(endpoint), /*pTargetRange*/ self->_uiaProvider.get(), static_cast<UIA::TextPatternRangeEndpoint>(targetEndpoint))); } void XamlUiaTextRange::Select() const { THROW_IF_FAILED(_uiaProvider->Select()); } void XamlUiaTextRange::AddToSelection() const { // we don
{ "pile_set_name": "Github" }
`CameraRoll`模块提供了访问本地相册的功能。 ### 截图 ![cameraroll](img/api/cameraroll.png) ### 方法 <div class="props"> <div class="prop"> <h4 class="propTitle"><a class="anchor" name="saveimagewithtag"></a><span class="propType">static </span>saveImageWithTag<span class="propType">(tag)</span> <a class="hash-link" href="#saveimagewithtag">#</a></h4> <div> <p>保存一个图片到相册。</p> <p>@param {string} tag 在安卓上,本参数是一个本地URI,例如<code>"file:///sdcard/img.png"</code>.</p> <p>在iOS设备上可能是以下之一:</p> <ul> <li>本地URI</li> <li>资源库的标签</li> <li>非以上两种类型,表示图片数据将会存储在内存中(并且在本进程持续的时候一直会占用内存)。</li> </ul> <p>返回一个Promise,操作成功时返回新的URI。</p> </div> </div> <div class="prop"> <h4 class="propTitle"><a class="anchor" name="getphotos"></a><span class="propType">static </span>getPhotos<span class="propType">(params: object)</span> <a class="hash-link" href="#getphotos">#</a></h4> <div> <p>返回一个带有图片标识符对象的Promise。返回的对象的结构参见<a href="https://github.com/facebook/react-native/blob/0.23-stable/Libraries/CameraRoll/CameraRoll.js#L83" target="_blank"><code>getPhotosReturnChecker</code></a>。</p> <p> @param {object} 要求的参数结构参见<a href="https://github.com/facebook/react-native/blob/0.23-stable/Libraries/CameraRoll/CameraRoll.js#L45" target="_blank"><code>getPhotosParamChecker</code></a>. </p> <p> 返回一个Promise,操作成功时返回符合<a href="https://github.com/facebook/react-native/blob/0.23-stable/Libraries/CameraRoll/CameraRoll.js#L83" target="_blank"><code>getPhotosReturnChecker</code></a>结构的对象。</p> </div> </div> </div> ### 例子 ```javascript 'use strict'; const React = require('react-native'); const { CameraRoll, Image, SliderIOS, StyleSheet, Switch, Text, View, TouchableOpacity } = React; const CameraRollView = require('./CameraRollView'); const AssetScaledImageExampleView = require('./AssetScaledImageExample'); const CAMERA_ROLL_VIEW = 'camera_roll_view'; const CameraRollExample = React.createClass({ getInitialState() { return { groupTypes: 'SavedPhotos', sliderValue: 1, bigImages: true, }; }, render() { return ( <View> <Switch onValueChange={this._onSwitchChange} value={this.state.bigImages} /> <Text>{(this.state.bigImages ? 'Big' : 'Small') + ' Images'}</Text> <SliderIOS value={this.state.sliderValue} onValueChange={this._onSliderChange} /> <Text>{'Group Type: ' + this.state.groupTypes}</Text> <CameraRollView ref={CAMERA_ROLL_VIEW} batchSize={20} groupTypes={this.state.groupTypes} renderImage={this._renderImage} /> </View> ); }, loadAsset(asset){ if (this.props.navigator) { this.props.navigator.push({ title: 'Camera Roll Image', component: AssetScaledImageExampleView, backButtonTitle: 'Back', passProps: { asset: asset }, }); } }, _renderImage(asset) { const imageSize = this.state.bigImages ? 150 : 75; const imageStyle = [styles.image, {width: imageSize, height: imageSize}]; const location = asset.node.location.longitude ? JSON.stringify(asset.node.location) : 'Unknown location'; return ( <TouchableOpacity key={asset} onPress={ this.loadAsset.bind( this, asset ) }> <View style={styles.row}> <Image source={asset.node.image} style={imageStyle} /> <View style={styles.info}> <Text style={styles.url}>{asset.node.image.uri}</Text> <Text>{location}</Text> <Text>{asset.node.group_name}</Text> <Text>{new Date(asset.node.timestamp).toString()}</Text> </View> </View> </TouchableOpacity> ); }, _onSliderChange(value) { const options = CameraRoll.GroupTypesOptions; const index = Math.floor(value * options.length * 0.99); const groupTypes = options[index]; if (groupTypes !== this.state.groupTypes) { this.setState({groupTypes: groupTypes}); } }, _onSwitchChange(value) { this.refs[CAMERA_ROLL_VIEW].rendererChanged(); this.setState({ bigImages: value }); } }); const styles = StyleSheet.create({ row: { flexDirection: 'row', flex: 1, }, url: { fontSize: 9, marginBottom: 14, }, image: { margin: 4, }, info: { flex: 1, }, }); exports.title = 'Camera Roll'; exports.description = 'Example component that uses CameraRoll to list user\'s photos'; exports.examples = [ { title: 'Photos', render(): ReactElement { return <CameraRollExample />; } } ]; ```
{ "pile_set_name": "Github" }
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # This is a Pester test suite to validate the Format-Hex cmdlet in the Microsoft.PowerShell.Utility module. <# Purpose: Verify Format-Hex displays the Hexadecimal value for the input data. Action: Run Format-Hex. Expected Result: Hexadecimal equivalent of the input data is displayed. #> Describe "FormatHex" -tags "CI" { BeforeAll { $newline = [Environment]::Newline Setup -d FormatHexDataDir $inputFile1 = New-Item -Path "$TestDrive/SourceFile-1.txt" $inputText1 = 'Hello World' Set-Content -LiteralPath $inputFile1.FullName -Value $inputText1 -NoNewline $inputFile2 = New-Item -Path "$TestDrive/SourceFile-2.txt" $inputText2 = 'More text' Set-Content -LiteralPath $inputFile2.FullName -Value $inputText2 -NoNewline $inputFile3 = New-Item -Path "$TestDrive/SourceFile literal [3].txt" $inputText3 = 'Literal path' Set-Content -LiteralPath $inputFile3.FullName -Value $inputText3 -NoNewline $inputFile4 = New-Item -Path "$TestDrive/SourceFile-4.txt" $inputText4 = 'Now is the winter of our discontent' Set-Content -LiteralPath $inputFile4.FullName -Value $inputText4 -NoNewline $certificateProvider = Get-ChildItem Cert:\CurrentUser\My\ -ErrorAction SilentlyContinue $thumbprint = $null $certProviderAvailable = $false if ($certificateProvider.Count -gt 0) { $thumbprint = $certificateProvider[0].Thumbprint $certProviderAvailable = $true } $skipTest = ([System.Management.Automation.Platform]::IsLinux -or [System.Management.Automation.Platform]::IsMacOS -or (-not $certProviderAvailable)) } Context "InputObject Paramater" { BeforeAll { enum TestEnum { TestOne = 1; TestTwo = 2; TestThree = 3; TestFour = 4 } Add-Type -TypeDefinition @' public enum TestSByteEnum : sbyte { One = -1, Two = -2, Three = -3, Four = -4 } '@ } $testCases = @( @{ Name = "Can process bool type 'fhx -InputObject `$true'" InputObject = $true Count = 1 ExpectedResult = "00000000 01 00 00 00" } @{ Name = "Can process byte type 'fhx -InputObject [byte]5'" InputObject = [byte]5 Count = 1 ExpectedResult = "00000000 05" } @{ Name = "Can process byte[] type 'fhx -InputObject [byte[]](1,2,3,4,5)'" InputObject = [byte[]](1, 2, 3, 4, 5) Count = 1 ExpectedResult = "00000000 01 02 03 04 05 ....." } @{ Name = "Can process int type 'fhx -InputObject 7'" InputObject = 7 Count = 1 ExpectedResult = "00000000 07 00 00 00 ...." } @{ Name = "Can process int[] type 'fhx -InputObject [int[]](5,6,7,8)'" InputObject = [int[]](5, 6, 7, 8) Count = 1 ExpectedResult = "00000000 05 00 00 00 06 00 00 00 07 00 00 00 08 00 00 00 ................" } @{ Name = "Can process int32 type 'fhx -InputObject [int32]2032'" InputObject = [int32]2032 Count = 1 ExpectedResult = "00000000 F0 07 00 00 ð..." } @{ Name = "Can process int32[] type 'fhx -InputObject [int32[]](2032, 2033, 2034)'" InputObject = [int32[]](2032, 2033, 2034) Count = 1 ExpectedResult = "0000000000000000 F0 07 00 00 F1 07 00 00 F2 07 00 00 ð...ñ...ò..." } @{ Name = "Can process Int64 type 'fhx -InputObject [Int64]9223372036854775807'" InputObject = [Int64]9223372036854775807 Count = 1 ExpectedResult = "0000000000000000 FF FF FF FF FF FF FF 7F ÿÿÿÿÿÿÿ�" } @{ Name = "Can process Int64[] type 'fhx -InputObject [Int64[]](9223372036852,9223372036853)'" InputObject = [Int64[]](9223372036852, 9223372036853) Count = 1 ExpectedResult = "0000000000000000 F4 5A D0 7B 63 08 00 00 F5 5A D0 7B 63 08 00 00 ôZÐ{c...õZÐ{c..." } @{ Name = "Can process string type 'fhx -InputObject hello world'" InputObject = "hello world" Count = 1 ExpectedResult = "0000000000000000 68 65 6C 6C 6F 20 77 6F 72 6C 64 hello world" } @{ Name = "Can process PS-native enum array '[TestEnum[]]('TestOne', 'TestTwo', 'TestThree', 'TestFour') | fhx'" InputObject = [TestEnum[]]('TestOne', 'TestTwo', 'TestThree', 'TestFour') Count = 1 ExpectedResult = "0000000000000000 01 00 00 00 02 00 00 00 03 00 00 00 04 00 00 00 ................" } @{ Name = "Can process C#-native sbyte enum array '[TestSByteEnum[]]('One', 'Two', 'Three', 'Four') | fhx'" InputObject = [TestSByteEnum[]]('One', 'Two', 'Three', 'Four') Count = 1 ExpectedResult = "0000000000000000 FF FE FD FC .þýü" } ) It "<Name>" -TestCase $testCases { param ($Name, $InputObject, $Count, $ExpectedResult) $result = Format-Hex -InputObject $InputObject $result.count | Should -Be $Count $result | Should -BeOfType Microsoft.PowerShell.Commands.ByteCollection $result.ToString() | Should -MatchExactly $ExpectedResult } } Context "InputObject From Pipeline" { BeforeAll { enum TestEnum { TestOne = 1; TestTwo = 2; TestThree = 3; TestFour = 4 } Add-Type -TypeDefinition @' public enum TestSByteEnum : sbyte { One = -1, Two = -2, Three = -3, Four = -4 } '@ } $testCases = @( @{ Name = "Can process bool type '`$true | fhx'" InputObject = $true Count = 1 ExpectedResult = "0000000000000000 01" } @{ Name = "Can process byte type '[byte]5 | fhx'" InputObject = [byte]5 Count = 1 ExpectedResult = "0000000000000000 05" } @{ Name = "Can process byte[] type '[byte[]](1,2) | fhx'" InputObject = [byte[]](1, 2) Count = 1 ExpectedResult = "0000000000000000 01 02 ��" } @{ Name = "Can process int type '7 | fhx'" InputObject = 7 Count = 1 ExpectedResult = "0000000000000000 07 00 00 00 � " } @{ Name = "
{ "pile_set_name": "Github" }
/* * Copyright (C) 2018 - present Instructure, Inc. * * This file is part of Canvas. * * Canvas is free software: you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License as published by the Free * Software Foundation, version 3 of the License. * * Canvas is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR * A PARTICULAR PURPOSE. See the GNU Affero General Public License for more * details. * * You should have received a copy of the GNU Affero General Public License along * with this program. If not, see <http://www.gnu.org/licenses/>. */ import React, {Component} from 'react' import {string, func} from 'prop-types' import {Badge} from '@instructure/ui-elements' import {ScreenReaderContent} from '@instructure/ui-a11y' export default class Indicator extends Component { static propTypes = { title: string.isRequired, variant: string.isRequired, indicatorRef: func } static defaultProps = { indicatorRef: () => {} } render() { return ( <div ref={this.props.indicatorRef}> <Badge standalone type="notification" variant={this.props.variant} /> <ScreenReaderContent>{this.props.title}</ScreenReaderContent> </div> ) } }
{ "pile_set_name": "Github" }
// Carousels .carousel { .carousel-control-prev-icon, .carousel-control-next-icon { width: $carousel-control-icon-width; height: $carousel-control-icon-height; } .carousel-control-prev-icon { background-image: $carousel-control-prev-icon; } .carousel-control-next-icon { background-image: $carousel-control-next-icon; } .carousel-indicators { li { width: $carousel-indicators-width; height: $carousel-indicators-height; cursor: pointer; border-radius: $carousel-indicators-border-radius; } } } .carousel-fade { .carousel-item { opacity: 0; transition-duration: $carousel-transition-duration; transition-property: opacity; } .carousel-item.active, .carousel-item-next.carousel-item-left, .carousel-item-prev.carousel-item-right { opacity: 1; } .carousel-item-left, .carousel-item-right { &.active { opacity: 0; } } .carousel-item-next, .carousel-item-prev, .carousel-item.active, .carousel-item-left.active, .carousel-item-prev.active { transform: $carousel-item-transform; @supports (transform-style: preserve-3d) { transform: $carousel-item-transform-2; } } }
{ "pile_set_name": "Github" }
const merge = require('webpack-merge') const common = require('./webpack.common.js') const WebpackCopyPlugin = require('copy-webpack-plugin') module.exports = merge(common, { plugins: [ new WebpackCopyPlugin([{ from: 'README.md', to: 'README.md' }, { from: 'LICENSE', to: 'LICENSE' }, { from: 'CHANGELOG.md', to: 'CHANGELOG.md' }, { from: 'manifest.json', to: 'manifest.json' }, { from: 'oidc-callback.html', to: 'oidc-callback.html' }, { from: 'oidc-silent-redirect.html', to: 'oidc-silent-redirect.html' }]) ], mode: 'production', devtool: 'none', resolve: { alias: { vue: 'vue/dist/vue.min.js' } } })
{ "pile_set_name": "Github" }
"steam/cached/InstallSubChooseApps_SingleApp.res" { "InstallSubChooseApps" { "ControlName" "CInstallSubChooseApps" "fieldName" "InstallSubChooseApps" "xpos" "8" "ypos" "48" "wide" "388" "tall" "300" "AutoResize" "0" "PinCorner" "0" "visible" "1" "enabled" "1" "tabPosition" "1" "paintbackground" "1" "WizardWide" "0" "WizardTall" "0" } "Label1" { "ControlName" "Label" "fieldName" "Label1" "xpos" "10" "ypos" "24" "wide" "340" "tall" "24" "AutoResize" "0" "PinCorner" "0" "visible" "1" "enabled" "1" "tabPosition" "0" "paintbackground" "1" "labelText" "#Steam_InstallGameInfo" "textAlignment" "north-west" "wrap" "1" } "CreateShortcutCheck" { "ControlName" "CheckButton" "fieldName" "CreateShortcutCheck" "xpos" "16" "ypos" "60" "wide" "390" "tall" "24" "AutoResize" "0" "PinCorner" "0" "visible" "1" "enabled" "1" "tabPosition" "0" "paintbackground" "1" "labelText" "#Steam_Install_CreateDesktopShortcut" "textAlignment" "west" "wrap" "0" "Default" "0" } "CreateStartMenuShortcutCheck" { "ControlName" "CheckButton" "fieldName" "CreateStartMenuShortcutCheck" "xpos" "16" "ypos" "84" "wide" "390" "tall" "24" "AutoResize" "0" "PinCorner" "0" "visible" "1" "enabled" "1" "tabPosition" "0" "paintbackground" "1" "labelText" "#Steam_Install_CreateStartMenuShortcut" "textAlignment" "west" "wrap" "0" "Default" "0" } "InstallSize" { "ControlName" "Label" "fieldName" "InstallSize" "xpos" "10" "ypos" "128" "wide" "186" "tall" "24" "AutoResize" "0" "PinCorner" "0" "visible" "1" "enabled" "1" "tabPosition" "0" "paintbackground" "1" "labelText" "#Steam_ScanCDKey_SpaceRequired" "textAlignment" "west" "wrap" "0" } "InstallSizeLabel" { "ControlName" "Label" "fieldName" "InstallSizeLabel" "xpos" "200" "ypos" "128" "wide" "80" "tall" "24" "AutoResize" "0" "PinCorner" "0" "visible" "1" "enabled" "1" "tabPosition" "0" "paintbackground" "1" "labelText" "42 MB" "textAlignment" "west" "wrap" "0" } "DriveSpace" { "ControlName" "Label" "fieldName" "DriveSpace" "xpos" "10" "ypos" "152" "wide" "186" "tall" "24" "AutoResize" "0" "PinCorner" "0" "visible" "1" "enabled" "1" "tabPosition" "0" "paintbackground" "1" "labelText" "#Steam_ScanCDKey_SpaceAvailable" "textAlignment" "west" "wrap" "0" } "DriveSpaceLabel" { "ControlName" "Label" "fieldName" "DriveSpaceLabel" "xpos" "200" "ypos" "152" "wide" "80" "tall" "24" "AutoResize" "0" "PinCorner" "0" "visible" "1" "enabled" "1" "tabPosition" "0" "paintbackground" "1" "labelText" "148805 MB" "textAlignment" "west" "wrap" "0" } "DownloadTimeLabel" { "ControlName" "Label" "fieldName" "DownloadTimeLabel" "xpos" "10" "ypos" "176" "wide" "189" "tall" "24" "AutoResize" "0" "PinCorner" "0" "visible" "1" "enabled" "1" "tabPosition" "0" "paintbackground" "1" "labelText" "#Steam_InstallDownloadTime" "textAlignment" "west" "wrap" "0" } "DownloadTimeInfo" { "ControlName" "Label" "fieldName" "DownloadTimeInfo" "xpos" "200" "ypos" "176" "wide" "200" "tall" "24" "AutoResize" "0" "PinCorner" "0" "visible" "1" "enabled" "1" "tabPosition" "0" "paintbackground" "1" "labelText" "#Steam_InstallDownloadTime_Info" "textAlignment" "west" "wrap" "0" } "InstallFolderLabel" { "ControlName" "Label" "fieldName" "InstallFolderLabel" "xpos" "10" "ypos" "200" "wide" "200" "tall" "24" "AutoResize" "0" "PinCorner" "0" "visible" "1" "enabled" "1" "tabPosition" "0" "paintbackground"
{ "pile_set_name": "Github" }
#if !defined(CYGWIN) /** * @file ir_linux.cpp * */ /* Copyright (C) 2017 by Arjan van Vught mailto:info@orangepi-dmx.nl * * 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 <stdio.h> #include <string.h> #include <errno.h> #include <sys/socket.h> #include <sys/types.h> #include <sys/un.h> #include <unistd.h> #include <fcntl.h> #include "ir_linux.h" #include "input.h" IrLinux::IrLinux(void) : m_nFd(-1) { } IrLinux::~IrLinux(void) { if (m_nFd != -1) { close(m_nFd); } m_nFd = -1; } bool IrLinux::Start(void) { memset(&m_Addr, '\0', sizeof(m_Addr)); strcpy(m_Addr.sun_path, "/var/run/lirc/lircd"); m_nFd = socket(AF_UNIX, SOCK_STREAM, 0); if (m_nFd == -1) { perror("socket"); return false; } int flags = fcntl(m_nFd, F_GETFL, 0); if (flags < 0) { perror("fcntl"); return false; } flags |= O_NONBLOCK; if (fcntl(m_nFd, F_SETFL, flags) != 0) { perror("fcntl"); return false; } m_Addr.sun_family=AF_UNIX; if (connect(m_nFd, reinterpret_cast<struct sockaddr*>(&m_Addr), sizeof(m_Addr)) == -1) { perror("connect"); return false; } return true; } bool IrLinux::IsAvailable(void) { const bool b = read(m_nFd, m_Buffer, sizeof(m_Buffer)) > 0 ? true : false; if (b) { int sequence; char prefix[32]; if (sscanf(m_Buffer, "%s %x %s", prefix, reinterpret_cast<unsigned int*>(&sequence), m_Code) != 3) { return false; } // demping if (sequence % 2 != 0) { return false; } } return b; } int IrLinux::GetChar(void) { int ch; char *p = strchr(m_Code, '_'); if (p == NULL) { return INPUT_KEY_NOT_DEFINED; } if (strcmp(p, "_OK") == 0) { ch = INPUT_KEY_ENTER; } else if (strcmp(p, "_NUMERIC_POUND") == 0) { ch = INPUT_KEY_ESC; } else if (strcmp(p, "_DOWN") == 0) { ch = INPUT_KEY_DOWN; } else if (strcmp(p, "_UP") == 0) { ch = INPUT_KEY_UP; } else if (strcmp(p, "_LEFT") == 0) { ch = INPUT_KEY_LEFT; } else if (strcmp(p, "_RIGHT") == 0) { ch = INPUT_KEY_RIGHT; } else { ch = INPUT_KEY_NOT_DEFINED; } return ch; } #endif
{ "pile_set_name": "Github" }
""" print_autoconf_hint(state::WizardState) Print a hint for projects that use autoconf to have a good `./configure` line. """ function print_autoconf_hint(state::WizardState) println(state.outs, " The recommended options for GNU Autoconf are:") println(state.outs) printstyled(state.outs, " ./configure --prefix=\${prefix} --build=\${MACHTYPE} --host=\${target}", bold=true) println(state.outs) println(state.outs) println(state.outs, " followed by `make` and `make install`. Since the prefix environment") println(state.outs, " variable is set already, this will automatically perform the installation") println(state.outs, " into the correct directory.") end """ provide_hints(state::WizardState, path::AbstractString) Given an unpacked source directory, provide hints on how a user might go about building the binary bounty they so richly desire. """ function provide_hints(state::WizardState, path::AbstractString) files = readdir(path) println(state.outs, "You have the following contents in your working directory:") println(state.outs, join(map(x->string(" - ", x),files),'\n')) printed = false function start_hints() printed || printstyled(state.outs, "Hints:\n", color=:yellow) printed = true end # Avoid providing duplicate hints (even for files in separate directories) # As long as the hint is the same, people will get the idea hints_provided = Set{Symbol}() function already_hinted(sym) start_hints() (sym in hints_provided) && return true push!(hints_provided, sym) return false end for (root, dirs, files) in walkdir(path) for file in files file_path = joinpath(root, file) # Helper function to try to read the given path's contents, but # returning an empty string on error (for e.g. broken symlinks) read_contents(path) = try String(read(path)) catch "" end if file == "configure" && occursin("Generated by GNU Autoconf", read_contents(file_path)) already_hinted(:autoconf) && continue println(state.outs, " - ", replace(file_path, "$path/" => ""), "\n") println(state.outs, " This file is a configure file generated by GNU Autoconf. ") print_autoconf_hint(state) elseif file == "configure.in" || file == "configure.ac" already_hinted(:autoconf) && continue println(state.outs, " - ", replace(file_path, "$path/" => ""), "\n") println(state.outs, " This file is likely input to GNU Autoconf. ") print_autoconf_hint(state) elseif file == "CMakeLists.txt" already_hinted(:CMake) && continue println(state.outs, " - ", replace(file_path, "$path/" => ""), "\n") print(state.outs, " This file is likely input to CMake. ") println(state.outs, "The recommended options for CMake are") println(state.outs) printstyled(state.outs, " cmake -DCMAKE_INSTALL_PREFIX=\$prefix -DCMAKE_TOOLCHAIN_FILE=\${CMAKE_TARGET_TOOLCHAIN} -DCMAKE_BUILD_TYPE=Release", bold=true) println(state.outs) println(state.outs) println(state.outs, " followed by `make` and `make install`. Since the prefix environment") println(state.outs, " variable is set already, this will automatically perform the installation") println(state.outs, " into the correct directory.\n") elseif file == "meson.build" already_hinted(:Meson) && continue println(state.outs, " - ", replace(file_path, "$path/" => ""), "\n") print(state.outs, " This file is likely input to Meson. ") println(state.outs, "The recommended option for Meson is") println(state.outs) printstyled(state.outs, " meson --cross-file=\${MESON_TARGET_TOOLCHAIN}", bold=true) println(state.outs) println(state.outs) println(state.outs, " followed by `ninja` and `ninja install`. Since the prefix variable") println(state.outs, " is set already, this will automatically perform the installation") println(state.outs, " into the correct directory.\n") end end end println(state.outs) end
{ "pile_set_name": "Github" }
import { TransactionStateT, TransationKindT } from 'entities/Transaction'; const { Transfer } = TransationKindT; export interface AccountMutationT { accountId: string; currency: string; amount: number; } /** * Get all necessary accounts balance mutations for given transaction change. */ export default function getAccountsMutations( prev?: TransactionStateT, next?: TransactionStateT ): AccountMutationT[] { if (!prev && next) { return createTransaction(next); } else if (prev && !next) { return removeTransaction(prev); } else if (prev && next) { return [...removeTransaction(prev), ...createTransaction(next)]; } else { return []; } } function createTransaction(transaction: TransactionStateT): AccountMutationT[] { const mutations: AccountMutationT[] = []; if ( transaction.kind === Transfer && transaction.accountId === transaction.linkedAccountId && transaction.currency === transaction.linkedCurrency ) { return mutations; } mutations.push({ accountId: transaction.accountId, currency: transaction.currency, amount: transaction.amount * (transaction.kind === Transfer ? -1 : 1) }); if ( transaction.kind === Transfer && transaction.linkedAccountId && transaction.linkedCurrency && transaction.linkedAmount ) { mutations.push({ accountId: transaction.linkedAccountId, currency: transaction.linkedCurrency, amount: transaction.linkedAmount }); } return mutations; } function removeTransaction(transaction: TransactionStateT): AccountMutationT[] { const mutations = []; mutations.push({ accountId: transaction.accountId, currency: transaction.currency, amount: transaction.amount * (transaction.kind === Transfer ? 1 : -1) }); if ( transaction.kind === Transfer && transaction.linkedAccountId && transaction.linkedCurrency && transaction.linkedAmount ) { mutations.push({ accountId: transaction.linkedAccountId, currency: transaction.linkedCurrency, amount: transaction.linkedAmount * -1 }); } return mutations; }
{ "pile_set_name": "Github" }
<?php /* * Copyright 2014 Google Inc. * * 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. */ class Google_Service_Compute_UsableSubnetworksAggregatedListWarningData extends Google_Model { public $key; public $value; public function setKey($key) { $this->key = $key; } public function getKey() { return $this->key; } public function setValue($value) { $this->value = $value; } public function getValue() { return $this->value; } }
{ "pile_set_name": "Github" }
var baseKeys = require('./_baseKeys'), getTag = require('./_getTag'), isArrayLike = require('./isArrayLike'), isString = require('./isString'), stringSize = require('./_stringSize'); /** `Object#toString` result references. */ var mapTag = '[object Map]', setTag = '[object Set]'; /** * Gets the size of `collection` by returning its length for array-like * values or the number of own enumerable string keyed properties for objects. * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object|string} collection The collection to inspect. * @returns {number} Returns the collection size. * @example * * _.size([1, 2, 3]); * // => 3 * * _.size({ 'a': 1, 'b': 2 }); * // => 2 * * _.size('pebbles'); * // => 7 */ function size(collection) { if (collection == null) { return 0; } if (isArrayLike(collection)) { return isString(collection) ? stringSize(collection) : collection.length; } var tag = getTag(collection); if (tag == mapTag || tag == setTag) { return collection.size; } return baseKeys(collection).length; } module.exports = size;
{ "pile_set_name": "Github" }
<?php namespace Symfony\Component\HttpKernel\Tests\Exception; use Symfony\Component\HttpKernel\Exception\PreconditionFailedHttpException; class PreconditionFailedHttpExceptionTest extends HttpExceptionTest { protected function createException() { return new PreconditionFailedHttpException(); } }
{ "pile_set_name": "Github" }
/* * Copyright (C) 2003-2006 Gabest * http://www.gabest.org * * This Program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This Program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with GNU Make; see the file COPYING. If not, write to * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. * http://www.gnu.org/copyleft/gpl.html * */ #pragma once #include <atlbase.h> #include <atlcoll.h> #include "OggFile.h" #include "..\BaseSplitter\BaseSplitter.h" class OggPacket : public Packet { public: OggPacket() {fSkip = false;} bool fSkip; }; class COggSplitterOutputPin : public CBaseSplitterOutputPin { class CComment { public: CStringW m_key, m_value; CComment(CStringW key, CStringW value) : m_key(key), m_value(value) {m_key.MakeUpper();} }; CAutoPtrList<CComment> m_pComments; protected: CCritSec m_csPackets; CAutoPtrList<OggPacket> m_packets; CAutoPtr<OggPacket> m_lastpacket; int m_lastseqnum; REFERENCE_TIME m_rtLast; bool m_fSkip; void ResetState(DWORD seqnum = -1); public: COggSplitterOutputPin(LPCWSTR pName, CBaseFilter* pFilter, CCritSec* pLock, HRESULT* phr); void AddComment(BYTE* p, int len); CStringW GetComment(CStringW key); HRESULT UnpackPage(OggPage& page); virtual HRESULT UnpackPacket(CAutoPtr<OggPacket>& p, BYTE* pData, int len) = 0; virtual REFERENCE_TIME GetRefTime(__int64 granule_position) = 0; CAutoPtr<OggPacket> GetPacket(); HRESULT DeliverEndFlush(); HRESULT DeliverNewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate); }; class COggVorbisOutputPin : public COggSplitterOutputPin { CAutoPtrList<OggPacket> m_initpackets; DWORD m_audio_sample_rate; DWORD m_blocksize[2], m_lastblocksize; CAtlArray<bool> m_blockflags; virtual HRESULT UnpackPacket(CAutoPtr<OggPacket>& p, BYTE* pData, int len); virtual REFERENCE_TIME GetRefTime(__int64 granule_position); HRESULT DeliverPacket(CAutoPtr<OggPacket> p); HRESULT DeliverNewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate); public: COggVorbisOutputPin(OggVorbisIdHeader* h, LPCWSTR pName, CBaseFilter* pFilter, CCritSec* pLock, HRESULT* phr); HRESULT UnpackInitPage(OggPage& page); bool IsInitialized() {return m_initpackets.GetCount() >= 3;} }; class COggDirectShowOutputPin : public COggSplitterOutputPin { virtual HRESULT UnpackPacket(CAutoPtr<OggPacket>& p, BYTE* pData, int len); virtual REFERENCE_TIME GetRefTime(__int64 granule_position); public: COggDirectShowOutputPin(AM_MEDIA_TYPE* pmt, LPCWSTR pName, CBaseFilter* pFilter, CCritSec* pLock, HRESULT* phr); }; class COggStreamOutputPin : public COggSplitterOutputPin { __int64 m_time_unit, m_samples_per_unit; DWORD m_default_len; virtual HRESULT UnpackPacket(CAutoPtr<OggPacket>& p, BYTE* pData, int len); virtual REFERENCE_TIME GetRefTime(__int64 granule_position); public: COggStreamOutputPin(OggStreamHeader* h, LPCWSTR pName, CBaseFilter* pFilter, CCritSec* pLock, HRESULT* phr); }; class COggVideoOutputPin : public COggStreamOutputPin { public: COggVideoOutputPin(OggStreamHeader* h, LPCWSTR pName, CBaseFilter* pFilter, CCritSec* pLock, HRESULT* phr); }; class COggAudioOutputPin : public COggStreamOutputPin { public: COggAudioOutputPin(OggStreamHeader* h, LPCWSTR pName, CBaseFilter* pFilter, CCritSec* pLock, HRESULT* phr); }; class COggTextOutputPin : public COggStreamOutputPin { public: COggTextOutputPin(OggStreamHeader* h, LPCWSTR pName, CBaseFilter* pFilter, CCritSec* pLock, HRESULT* phr); }; class __declspec(uuid("9FF48807-E133-40AA-826F-9B2959E5232D")) COggSplitterFilter : public CBaseSplitterFilter { protected: CAutoPtr<COggFile> m_pFile; HRESULT CreateOutputs(IAsyncReader* pAsyncReader); bool DemuxInit(); void DemuxSeek(REFERENCE_TIME rt); bool DemuxLoop(); public: COggSplitterFilter(LPUNKNOWN pUnk, HRESULT* phr); virtual ~COggSplitterFilter(); }; class __declspec(uuid("6D3688CE-3E9D-42F4-92CA-8A11119D25CD")) COggSourceFilter : public COggSplitterFilter { public: COggSourceFilter(LPUNKNOWN pUnk, HRESULT* phr); };
{ "pile_set_name": "Github" }
""" Multi-part parsing for file uploads. Exposes one class, ``MultiPartParser``, which feeds chunks of uploaded data to file upload handlers for processing. """ from __future__ import unicode_literals import base64 import cgi from django.conf import settings from django.core.exceptions import SuspiciousOperation from django.utils.datastructures import MultiValueDict from django.utils.encoding import force_text from django.utils import six from django.utils.text import unescape_entities from django.core.files.uploadhandler import StopUpload, SkipFile, StopFutureHandlers __all__ = ('MultiPartParser', 'MultiPartParserError', 'InputStreamExhausted') class MultiPartParserError(Exception): pass class InputStreamExhausted(Exception): """ No more reads are allowed from this device. """ pass RAW = "raw" FILE = "file" FIELD = "field" class MultiPartParser(object): """ A rfc2388 multipart/form-data parser. ``MultiValueDict.parse()`` reads the input stream in ``chunk_size`` chunks and returns a tuple of ``(MultiValueDict(POST), MultiValueDict(FILES))``. """ def __init__(self, META, input_data, upload_handlers, encoding=None): """ Initialize the MultiPartParser object. :META: The standard ``META`` dictionary in Django request objects. :input_data: The raw post data, as a file-like object. :upload_handler: An UploadHandler instance that performs operations on the uploaded data. :encoding: The encoding with which to treat the incoming data. """ # # Content-Type should containt multipart and the boundary information. # content_type = META.get('HTTP_CONTENT_TYPE', META.get('CONTENT_TYPE', '')) if not content_type.startswith('multipart/'): raise MultiPartParserError('Invalid Content-Type: %s' % content_type) # Parse the header to get the boundary to split the parts. ctypes, opts = parse_header(content_type.encode('ascii')) boundary = opts.get('boundary') if not boundary or not cgi.valid_boundary(boundary): raise MultiPartParserError('Invalid boundary in multipart: %s' % boundary) # Content-Length should contain the length of the body we are about # to receive. try: content_length = int(META.get('HTTP_CONTENT_LENGTH', META.get('CONTENT_LENGTH', 0))) except (ValueError, TypeError): content_length = 0 if content_length < 0: # This means we shouldn't continue...raise an error. raise MultiPartParserError("Invalid content length: %r" % content_length) if isinstance(boundary, six.text_type): boundary = boundary.encode('ascii') self._boundary = boundary self._input_data = input_data # For compatibility with low-level network APIs (with 32-bit integers), # the chunk size should be < 2^31, but still divisible by 4. possible_sizes = [x.chunk_size for x in upload_handlers if x.chunk_size] self._chunk_size = min([2**31-4] + possible_sizes) self._meta = META self._encoding = encoding or settings.DEFAULT_CHARSET self._content_length = content_length self._upload_handlers = upload_handlers def parse(self): """ Parse the POST data and break it into a FILES MultiValueDict and a POST MultiValueDict. Returns a tuple containing the POST and FILES dictionary, respectively. """ # We have to import QueryDict down here to avoid a circular import. from django.http import QueryDict encoding = self._encoding handlers = self._upload_handlers # HTTP spec says that Content-Length >= 0 is valid # handling content-length == 0 before continuing if self._content_length == 0: return QueryDict('', encoding=self._encoding), MultiValueDict() # See if the handler will want to take care of the parsing. # This allows overriding everything if somebody wants it. for handler in handlers: result = handler.handle_raw_input(self._input_data, self._meta, self._content_length, self._boundary, encoding) if result is not None: return result[0], result[1] # Create the data structures to be used later. self._post = QueryDict('', mutable=True) self._files = MultiValueDict() # Instantiate the parser and stream: stream = LazyStream(ChunkIter(self._input_data, self._chunk_size)) # Whether or not to signal a file-completion at the beginning of the loop. old_field_name = None counters = [0] * len(handlers) try: for item_type, meta_data, field_stream in Parser(stream, self._boundary): if old_field_name: # We run this at the beginning of the next loop # since we cannot be sure a file is complete until # we hit the next boundary/part of the multipart content. self.handle_file_complete(old_field_name, counters) old_field_name = None try: disposition = meta_data['content-disposition'][1] field_name = disposition['name'].strip() except (KeyError, IndexError, AttributeError): continue transfer_encoding = meta_data.get('content-transfer-encoding') if transfer_encoding is not None: transfer_encoding = transfer_encoding[0].strip() field_name = force_text(field_name, encoding, errors='replace') if item_type == FIELD: # This is a post field, we can just set it in the post if transfer_encoding == 'base64': raw_data = field_stream.read() try: data = str(raw_data).decode('base64') except: data = raw_data else: data = field_stream.read() self._post.appendlist(field_name, force_text(data, encoding, errors='replace')) elif item_type == FILE: # This is a file, use the handler... file_name = disposition.get('filename') if not file_name: continue file_name = force_text(file_name, encoding, errors='replace') file_name = self.IE_sanitize(unescape_entities(file_name)) content_type = meta_data.get('content-type', ('',))[0].strip() try: charset = meta_data.get('content-type', (0, {}))[1].get('charset', None) except: charset = None try: content_length = int(meta_data.get('content-length')[0]) except (IndexError, TypeError, ValueError): content_length = None counters = [0] * len(handlers) try: for handler in handlers: try: handler.new_file(field_name, file_name, content_type, content_length, charset) except StopFutureHandlers: break for chunk in field_stream: if transfer_encoding == 'base64': # We only special-case base64 transfer encoding # We should always read base64 streams by multiple of 4 over_bytes = len(chunk) % 4 if over_bytes: over_chunk = field_stream.read(4 - over_bytes) chunk += over_chunk try: chunk = base64.b64decode(chunk) except Exception as e: # Since this is only a chunk, any error is an unfixable error. raise MultiPartParserError("Could not decode base64 data: %r" % e) for i, handler in enumerate(handlers): chunk
{ "pile_set_name": "Github" }
require(["gitbook", "jQuery"], function(gitbook, $) { gitbook.events.bind('start', function (e, config) { var conf = config['edit-link']; var label = conf.label; var base = conf.base; var lang = gitbook.state.innerLanguage; if (lang) { // label can be a unique string for multi-languages site if (typeof label === 'object') label = label[lang]; lang = lang + '/'; } // Add slash at the end if not present if (base.slice(-1) != "/") { base = base + "/"; } gitbook.toolbar.createButton({ icon: 'fa fa-edit', text: label, onClick: function() { var filepath = gitbook.state.filepath; window.open(base + lang + filepath); } }); }); });
{ "pile_set_name": "Github" }
#!/bin/bash # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, USA. # Author/Copyright(c): 2009, Thomas Renninger <trenn@suse.de>, Novell Inc. # Ondemand up_threshold and sampling rate test script for cpufreq-bench # mircobenchmark. # Modify the general variables at the top or extend or copy out parts # if you want to test other things # # Default with latest kernels is 95, before micro account patches # it was 80, cmp. with git commit 808009131046b62ac434dbc796 UP_THRESHOLD="60 80 95" # Depending on the kernel and the HW sampling rate could be restricted # and cannot be set that low... # E.g. before git commit cef9615a853ebc4972084f7 one could only set # min sampling rate of 80000 if CONFIG_HZ=250 SAMPLING_RATE="20000 80000" function measure() { local -i up_threshold_set local -i sampling_rate_set for up_threshold in $UP_THRESHOLD;do for sampling_rate in $SAMPLING_RATE;do # Set values in sysfs echo $up_threshold >/sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold echo $sampling_rate >/sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate up_threshold_set=$(cat /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold) sampling_rate_set=$(cat /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate) # Verify set values in sysfs if [ ${up_threshold_set} -eq ${up_threshold} ];then echo "up_threshold: $up_threshold, set in sysfs: ${up_threshold_set}" else echo "WARNING: Tried to set up_threshold: $up_threshold, set in sysfs: ${up_threshold_set}" fi if [ ${sampling_rate_set} -eq ${sampling_rate} ];then echo "sampling_rate: $sampling_rate, set in sysfs: ${sampling_rate_set}" else echo "WARNING: Tried to set sampling_rate: $sampling_rate, set in sysfs: ${sampling_rate_set}" fi # Benchmark cpufreq-bench -o /var/log/cpufreq-bench/up_threshold_${up_threshold}_sampling_rate_${sampling_rate} done done } function create_plots() { local command for up_threshold in $UP_THRESHOLD;do command="cpufreq-bench_plot.sh -o \"sampling_rate_${SAMPLING_RATE}_up_threshold_${up_threshold}\" -t \"Ondemand sampling_rate: ${SAMPLING_RATE} comparison - Up_threshold: $up_threshold %\"" for sampling_rate in $SAMPLING_RATE;do command="${command} /var/log/cpufreq-bench/up_threshold_${up_threshold}_sampling_rate_${sampling_rate}/* \"sampling_rate = $sampling_rate\"" done echo $command eval "$command" echo done for sampling_rate in $SAMPLING_RATE;do command="cpufreq-bench_plot.sh -o \"up_threshold_${UP_THRESHOLD}_sampling_rate_${sampling_rate}\" -t \"Ondemand up_threshold: ${UP_THRESHOLD} % comparison - sampling_rate: $sampling_rate\"" for up_threshold in $UP_THRESHOLD;do command="${command} /var/log/cpufreq-bench/up_threshold_${up_threshold}_sampling_rate_${sampling_rate}/* \"up_threshold = $up_threshold\"" done echo $command eval "$command" echo done command="cpufreq-bench_plot.sh -o \"up_threshold_${UP_THRESHOLD}_sampling_rate_${SAMPLING_RATE}\" -t \"Ondemand up_threshold: ${UP_THRESHOLD} and sampling_rate ${SAMPLING_RATE} comparison\"" for sampling_rate in $SAMPLING_RATE;do for up_threshold in $UP_THRESHOLD;do command="${command} /var/log/cpufreq-bench/up_threshold_${up_threshold}_sampling_rate_${sampling_rate}/* \"up_threshold = $up_threshold - sampling_rate = $sampling_rate\"" done done echo "$command" eval "$command" } measure create_plots
{ "pile_set_name": "Github" }
#include "gpio.h" #include "mem_map.h" #include "portmux.h" #include "ports.h" #define CONFIG_BF52x 1 /* Linux glue */
{ "pile_set_name": "Github" }
/* * The MIT License (MIT) * * Copyright (c) 2017-2020 Yegor Bugayenko * * 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 NON-INFRINGEMENT. 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. */ package org.cactoos.scalar; import java.util.stream.Collectors; import org.cactoos.Scalar; import org.cactoos.iterable.IterableOf; import org.cactoos.list.ListOf; /** * Make a scalar which is sum of scalar's values. * * <p>This class implements {@link Scalar}, which throws a checked * {@link Exception}. Despite that this class does NOT throw a checked * exception.</p> * * <p>There is no thread-safety guarantee. * <p>Note this class is for internal usage only * * @since 0.30 */ final class SumOfScalar implements Scalar<SumOf> { /** * Varargs of Scalar to sum up values from. */ private final Scalar<? extends Number>[] scalars; /** * Ctor. * @param src Varargs of Scalar to sum up values from * @since 0.30 */ @SafeVarargs SumOfScalar(final Scalar<? extends Number>... src) { this.scalars = src; } @Override public SumOf value() { return new SumOf( new IterableOf<>( new ListOf<>(this.scalars) .stream() .map( scalar -> new Unchecked<>(scalar).value() ).collect(Collectors.toList()) ) ); } }
{ "pile_set_name": "Github" }
// <copyright file="AssemblyInfo.cs" company="ConfigR contributors"> // Copyright (c) ConfigR contributors. (configr.net@gmail.com) // </copyright> using Xunit; [assembly: CollectionBehavior(DisableTestParallelization = true)]
{ "pile_set_name": "Github" }
var sanitize = require('mongo-sanitize'); module.exports = function (app) { var Contato = app.models.contato; var controller = {} controller.listaContatos = function(req, res) { Contato.find().populate('emergencia').exec() .then( function(contatos) { res.json(contatos); }, function(erro) { console.error(erro) res.status(500).json(erro); } ); }; controller.obtemContato = function(req, res) { var _id = req.params.id; Contato.findById(_id).exec() .then( function(contato) { if (!contato) throw new Error("Contato não encontrado"); res.json(contato) }, function(erro) { console.log(erro); res.status(404).json(erro) } ); }; controller.removeContato = function(req, res) { var _id = sanitize(req.params.id); Contato.remove({"_id" : _id}).exec() .then( function() { res.end(); }, function(erro) { return console.error(erro); } ); }; controller.salvaContato = function(req, res) { var _id = req.body._id; var dados = { "nome" : req.body.nome, "email" : req.body.email, "emergencia" : req.body.emergencia || null }; if(_id) { Contato.findByIdAndUpdate(_id, dados).exec() .then( function(contato) { res.json(contato); }, function(erro) { console.error(erro) res.status(500).json(erro); } ); } else { Contato.create(dados) .then( function(contato) { res.status(201).json(contato); }, function(erro) { console.log(erro); res.status(500).json(erro); } ); } }; return controller; };
{ "pile_set_name": "Github" }
/* * serchan.cxx * * Asynchronous serial I/O channel class implementation. * * Portable Windows Library * * Copyright (c) 1993-1998 Equivalence Pty. Ltd. * * The contents of this file are subject to the Mozilla Public License * Version 1.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.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See * the License for the specific language governing rights and limitations * under the License. * * The Original Code is Portable Windows Library. * * The Initial Developer of the Original Code is Equivalence Pty. Ltd. * * Portions are Copyright (C) 1993 Free Software Foundation, Inc. * All Rights Reserved. * * Contributor(s): ______________________________________. * * $Log: serchan.cxx,v $ * Revision 1.32 2005/11/30 12:47:42 csoutheren * Removed tabs, reformatted some code, and changed tags for Doxygen * * Revision 1.31 2005/03/10 03:27:30 dereksmithies * Fix an address typo. * * Revision 1.30 2005/01/03 02:52:52 csoutheren * Fixed problem with default speed of serial ports * Fixed problem with using obsolete lock directory for serial ports * * Revision 1.29 2004/07/11 07:56:36 csoutheren * Applied jumbo VxWorks patch, thanks to Eize Slange * * Revision 1.28 2004/02/22 04:06:47 ykiryanov * ifdef'd all functions because BeOS don't support it * * Revision 1.27 2002/11/02 00:32:21 robertj * Further fixes to VxWorks (Tornado) port, thanks Andreas Sikkema. * * Revision 1.26 2002/10/17 13:44:27 robertj * Port to RTEMS, thanks Vladimir Nesic. * * Revision 1.25 2002/10/10 04:43:44 robertj * VxWorks port, thanks Martijn Roest * * Revision 1.24 2002/03/27 06:42:16 robertj * Implemented the DTR etc functions and ttya/ttyb strings for sunos, * thanks tommi.korhonen@insta.fi & Raimo Ruokonen <rruokonen@koti.soon.fi> * * Revision 1.23 2001/09/10 03:03:36 robertj * Major change to fix problem with error codes being corrupted in a * PChannel when have simultaneous reads and writes in threads. * * Revision 1.22 2001/08/11 15:38:43 rogerh * Add Mac OS Carbon changes from John Woods <jfw@jfwhome.funhouse.com> * * Revision 1.21 2001/01/04 17:57:41 rogerh * Fix a cut and past error in my previous commit * * Revision 1.20 2001/01/04 10:28:07 rogerh * FreeBSD does not set the Baud Rate with c_cflags. Add the 'BSD' way * * Revision 1.19 2001/01/03 10:56:01 rogerh * CBAUD is not defined on FreeBSD. * * Revision 1.18 2000/12/29 07:36:18 craigs * Finally got working correctly! * * Revision 1.17 2000/11/14 14:56:24 rogerh * Fix #define parameters (fd should be just f) * * Revision 1.16 2000/11/14 14:52:32 rogerh * Fix SET/GET typo error * * Revision 1.15 2000/11/12 23:30:41 craigs * Fixed problems with serial port configuration * * Revision 1.14 2000/06/21 01:01:22 robertj * AIX port, thanks Wolfgang Platzer (wolfgang.platzer@infonova.at). * * Revision 1.13 2000/04/09 18:19:23 rogerh * Add my changes for NetBSD support. * * Revision 1.12 2000/04/06 12:11:32 rogerh * MacOS X support submitted by Kevin Packard * * Revision 1.11 2000/03/08 12:17:09 rogerh * Add OpenBSD support * * Revision 1.10 1998/12/21 06:08:08 robertj * Fixed warning on solaris x86 GNU system. * * Revision 1.9 1998/11/30 21:51:54 robertj * New directory structure. * * Revision 1.8 1998/11/24 09:39:14 robertj * FreeBSD port. * * Revision 1.7 1998/09/24 04:12:17 robertj * Added open software license. * */ #pragma implementation "serchan.h" #pragma implementation "modem.h" #include <ptlib.h> #include <fcntl.h> #include <signal.h> #include <sys/ioctl.h> #if defined(P_LINUX) #define TCSETATTR(f,t) tcsetattr(f,TCSANOW,t) #define TCGETATTR(f,t) tcgetattr(f,t) #elif defined(P_FREEBSD) || defined(P_OPENBSD) || defined (P_NETBSD) || defined(P_MACOSX) || defined(P_MACOS) || defined(P_RTEMS) #include <sys/ttycom.h> #define TCGETA TIOCGETA #define TCSETAW TIOCSETAW #elif defined(P_SUN4) #include <sys/termio.h> extern "C" int ioctl(int, int, void *); #elif defined (P_AIX) #include <sys/termio.h> #endif #ifndef TCSETATTR #define TCSETATTR(f,t) ::ioctl(f,TCSETAW,t) #endif #ifndef TCGETATTR #define TCGETATTR(f,t) ::ioctl(f,TCGETA,t) #endif //#define BINARY_LOCK 1 //#define LOCK_PREFIX "/var/spool/uucp/LCK.." #define LOCK_PREFIX "/var/lock/LCK.." #define DEV_PREFIX "/dev/" #define PORTLISTENV "PWLIB_SERIALPORTS" #define DEV_PREFIX "/dev/" #include "../common/serial.cxx" //////////////////////////////////////////////////////////////// // // PSerialChannel // void PSerialChannel::Construct() { // set control modes: 9600, N, 8, 1, local line baudRate = 9600; dataBits = 8; parityBits = NoParity; stopBits = 1; #if defined(P_VXWORKS) || defined (__BEOS__) PAssertAlways(PUnimplementedFunction); #else // set input mode: ignore breaks, ignore parity errors, do not strip chars, // no CR/NL conversion, no case conversion, no XON/XOFF control, // no start/stop Termio.c_iflag = IGNBRK | IGNPAR; Termio.c_cflag = CS8 | CSTOPB | CREAD | CLOCAL; #if defined(P_FREEBSD) || defined(P_OPENBSD) || defined (P_NETBSD) || defined(P_MACOSX) || defined(P_MACOS) Termio.c_ispeed = Termio.c_ospeed = B9600; #else Termio.c_cflag |= B9600; #endif // set output mode: no post process output, Termio.c_oflag = 0; // set line discipline Termio.c_
{ "pile_set_name": "Github" }
import * as React from 'react'; import {StyletronComponent} from 'styletron-react'; import {Override} from '../overrides'; export interface KEY_STRINGS { ArrowUp: 'ArrowUp'; ArrowDown: 'ArrowDown'; ArrowLeft: 'ArrowLeft'; ArrowRight: 'ArrowRight'; Enter: 'Enter'; Space: ' '; Escape: 'Escape'; Backspace: 'Backspace'; } export interface STATE_CHANGE_TYPES { click: 'click'; moveUp: 'moveUp'; moveDown: 'moveDown'; mouseEnter: 'mouseEnter'; focus: 'focus'; reset: 'reset'; character: 'character'; enter: 'enter'; } export interface OPTION_LIST_SIZE { default: 'default'; compact: 'compact'; } export type BaseMenuPropsT = { renderAll?: boolean; }; export interface MenuOverrides { EmptyState?: Override<any>; List?: Override<any>; Option?: Override<any>; ListItem?: Override<any>; OptgroupHeader?: Override<any>; } export interface MenuProps extends BaseMenuPropsT { size?: keyof OPTION_LIST_SIZE; overrides?: MenuOverrides; } export type ItemT = any; export type ArrayItemsT = ItemT[]; export type GroupedItemsT = { __ungrouped: ArrayItemsT; [key: string]: ArrayItemsT; }; export type ItemsT = ArrayItemsT | GroupedItemsT; export type StatefulMenuProps = StatefulContainerProps & MenuProps; export class StatefulMenu extends React.PureComponent<StatefulMenuProps> {} export interface RenderItemProps { disabled?: boolean; ref?: React.Ref<any>; id?: string; isFocused?: boolean; isHighlighted?: boolean; resetMenu?: () => any; } export type OnItemSelect = (args: { item: any; event?: React.SyntheticEvent<HTMLElement> | KeyboardEvent; }) => any; export type StateReducer = ( changeType: STATE_CHANGE_TYPES[keyof STATE_CHANGE_TYPES], changes: StatefulContainerState, currentState: StatefulContainerState, ) => StatefulContainerState; export type GetRequiredItemProps = ( item: any, index: number, ) => RenderItemProps; export type RenderProps = StatefulContainerState & { items: ItemsT; getRequiredItemProps: GetRequiredItemProps; }; export interface StatefulContainerProps { items: ItemsT; initialState?: StatefulContainerState; stateReducer?: StateReducer; getRequiredItemProps?: GetRequiredItemProps; onActiveDescendantChange?: (id?: string) => void; onItemSelect?: OnItemSelect; rootRef?: React.Ref<any>; keyboardControlNode?: React.Ref<any>; typeAhead?: boolean; children?: (args: RenderProps) => React.ReactNode; addMenuToNesting?: (ref: React.Ref<HTMLElement>) => void; removeMenuFromNesting?: (ref: React.Ref<HTMLElement>) => void; getParentMenu?: (ref: React.Ref<HTMLElement>) => void; getChildMenu?: (ref: React.Ref<HTMLElement>) => void; } export interface StatefulContainerState { activedescendantId?: string; highlightedIndex: number; isFocused: boolean; } export class StatefulContainer extends React.Component< StatefulContainerProps, StatefulContainerState > {} export interface OptionListProps extends BaseMenuPropsT { item: any; getItemLabel: (item: any) => React.ReactNode; getChildMenu?: (item: any) => React.ReactNode; onMouseEnter?: (event: MouseEvent) => any; size?: OPTION_LIST_SIZE[keyof OPTION_LIST_SIZE]; overrides?: { ListItem?: Override<any>; ChildMenuPopover?: Override<any>; }; renderHrefAsAnchor?: boolean; resetMenu?: () => void; $isHighlighted?: boolean; $isFocused?: boolean; } export const OptionList: React.FC<OptionListProps>; export interface OptionProfileProps extends BaseMenuPropsT { item: any; getChildMenu?: (item: any) => React.ReactNode; getProfileItemLabels: ( item: any, ) => {title?: string; subtitle?: string; body?: string}; getProfileItemImg: (item: any) => string | React.ComponentType<any>; getProfileItemImgText: (item: any) => string; overrides?: { ListItemProfile?: Override<any>; ProfileImgContainer?: Override<any>; ProfileImg?: Override<any>; ProfileLabelsContainer?: Override<any>; ProfileTitle?: Override<any>; ProfileSubtitle?: Override<any>; ProfileBody?: Override<any>; ChildMenuPopover?: Override<any>; }; resetMenu?: () => void; $isHighlighted?: boolean; } export const OptionProfile: React.FC<OptionProfileProps>; export interface SharedStatelessProps { activedescendantId?: string; getRequiredItemProps?: (item: any, index: number) => RenderItemProps; highlightedIndex?: number; items: ItemsT; isFocused?: boolean; noResultsMsg?: React.ReactNode; onBlur?: (event: React.FocusEvent<HTMLElement>) => any; onFocus?: (event: React.FocusEvent<HTMLElement>) => any; rootRef?: React.Ref<any>; focusMenu?: (event: FocusEvent | MouseEvent | KeyboardEvent) => any; unfocusMenu?: () => any; handleKeyDown?: (event: KeyboardEvent) => any; } export type StatelessMenuProps = SharedStatelessProps & MenuProps; export const Menu: React.FC<StatelessMenuProps>; export interface NestedMenuProps { children: React.ReactNode; } export interface NestedMenuState { menus: Array<React.Ref<HTMLElement>>; } export class NestedMenus extends React.Component< NestedMenuProps, NestedMenuState > { addMenuToNesting(ref: React.Ref<HTMLElement>): void; removeMenuFromNesting(ref: React.Ref<HTMLElement>): void; findMenuIndexByRef(ref: React.Ref<HTMLElement>): number; getParentMenu(ref: React.Ref<HTMLElement>): React.Ref<HTMLElement>; getChildMenu(ref: React.Ref<HTMLElement>): React.Ref<HTMLElement>; } export const StyledEmptyState: StyletronComponent<any>; export const StyledList: StyletronComponent<any>; export const StyledListItem: StyletronComponent<any>; export const StyledListItemProfile: StyletronComponent<any>; export const StyledProfileImgContainer: StyletronComponent<any>; export const StyledProfileImg: StyletronComponent<any>; export const StyledProfileLabelsContainer: StyletronComponent<any>; export const StyledProfileTitle: StyletronComponent<any>; export const StyledProfileSubtitle: StyletronComponent<any>; export const StyledProfileBody: StyletronComponent<any>; export const KEY_STRINGS: KEY_STRINGS; export const STATE_CHANGE_TYPES: STATE_CHANGE_TYPES; export const OPTION_LIST_SIZE: OPTION_LIST_SIZE;
{ "pile_set_name": "Github" }
#!/usr/bin/env bash if [[ "$1" == "" ]]; then echo ./`basename "$0"` file.apk exit 1 fi APKPATH=$1 APKFILE=$(basename -- "$APKPATH") APPNAME="${APKFILE%.*}" # apktool apktool -f d $APKPATH -o 10_apktool-output/$APPNAME.out # jadx #jadx $APKPATH -d 11_jadx-output/$APPNAME.out # extract certinfo keytool -printcert -file 10_apktool-output/$APPNAME.out/original/META-INF/*.RSA > $APPNAME.certinfo.txt
{ "pile_set_name": "Github" }