text
stringlengths
2
100k
meta
dict
// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using Microsoft.VisualStudio.Services.Agent.Util; using System; using System.Diagnostics; using System.Globalization; using System.IO; using System.Text; namespace Microsoft.VisualStudio.Services.Agent { public sealed class HostTraceListener : TextWriterTraceListener { public bool DisableConsoleReporting { get; set; } private const string _logFileNamingPattern = "{0}_{1:yyyyMMdd-HHmmss}-utc.log"; private string _logFileDirectory; private string _logFilePrefix; private bool _enablePageLog = false; private bool _enableLogRetention = false; private int _currentPageSize; private int _pageSizeLimit; private int _retentionDays; private bool _diagErrorDetected = false; private string _logFilePath; public HostTraceListener(string logFileDirectory, string logFilePrefix, int pageSizeLimit, int retentionDays) : base() { ArgUtil.NotNullOrEmpty(logFileDirectory, nameof(logFileDirectory)); ArgUtil.NotNullOrEmpty(logFilePrefix, nameof(logFilePrefix)); _logFileDirectory = logFileDirectory; _logFilePrefix = logFilePrefix; Directory.CreateDirectory(_logFileDirectory); if (pageSizeLimit > 0) { _enablePageLog = true; _pageSizeLimit = pageSizeLimit * 1024 * 1024; _currentPageSize = 0; } if (retentionDays > 0) { _enableLogRetention = true; _retentionDays = retentionDays; } Writer = CreatePageLogWriter(); } public HostTraceListener(string logFile) : base() { ArgUtil.NotNullOrEmpty(logFile, nameof(logFile)); _logFilePath = logFile; Directory.CreateDirectory(Path.GetDirectoryName(_logFilePath)); Stream logStream = new FileStream(_logFilePath, FileMode.Create, FileAccess.ReadWrite, FileShare.Read, bufferSize: 4096); Writer = new StreamWriter(logStream); } // Copied and modified slightly from .Net Core source code. Modification was required to make it compile. // There must be some TraceFilter extension class that is missing in this source code. public override void TraceEvent(TraceEventCache eventCache, string source, TraceEventType eventType, int id, string message) { if (Filter != null && !Filter.ShouldTrace(eventCache, source, eventType, id, message, null, null, null)) { return; } WriteHeader(source, eventType, id); WriteLine(message); WriteFooter(eventCache); if (!_diagErrorDetected && !DisableConsoleReporting && eventType < TraceEventType.Warning) { Console.WriteLine(StringUtil.Loc("FoundErrorInTrace", eventType.ToString(), _logFilePath)); _diagErrorDetected = true; } } public override void WriteLine(string message) { base.WriteLine(message); if (_enablePageLog) { int messageSize = UTF8Encoding.UTF8.GetByteCount(message); _currentPageSize += messageSize; if (_currentPageSize > _pageSizeLimit) { Flush(); if (Writer != null) { Writer.Dispose(); Writer = null; } Writer = CreatePageLogWriter(); _currentPageSize = 0; } } Flush(); } public override void Write(string message) { base.Write(message); if (_enablePageLog) { int messageSize = UTF8Encoding.UTF8.GetByteCount(message); _currentPageSize += messageSize; } Flush(); } internal bool IsEnabled(TraceOptions opts) { return (opts & TraceOutputOptions) != 0; } // Altered from the original .Net Core implementation. private void WriteHeader(string source, TraceEventType eventType, int id) { string type = null; switch (eventType) { case TraceEventType.Critical: type = "CRIT"; break; case TraceEventType.Error: type = "ERR "; break; case TraceEventType.Warning: type = "WARN"; break; case TraceEventType.Information: type = "INFO"; break; case TraceEventType.Verbose: type = "VERB"; break; default: type = eventType.ToString(); break; } Write(StringUtil.Format("[{0:u} {1} {2}] ", DateTime.UtcNow, type, source)); } // Copied and modified slightly from .Net Core source code to make it compile. The original code // accesses a private indentLevel field. In this code it has been modified to use the getter/setter. private void WriteFooter(TraceEventCache eventCache) { if (eventCache == null) return; IndentLevel++; if (IsEnabled(TraceOptions.ProcessId)) WriteLine("ProcessId=" + eventCache.ProcessId); if (IsEnabled(TraceOptions.ThreadId)) WriteLine("ThreadId=" + eventCache.ThreadId); if (IsEnabled(TraceOptions.DateTime)) WriteLine("DateTime=" + eventCache.DateTime.ToString("o", CultureInfo.InvariantCulture)); if (IsEnabled(TraceOptions.Timestamp)) WriteLine("Timestamp=" + eventCache.Timestamp); IndentLevel--; } private StreamWriter CreatePageLogWriter() { if (_enableLogRetention) { DirectoryInfo diags = new DirectoryInfo(_logFileDirectory); var logs = diags.GetFiles($"{_logFilePrefix}*.log"); foreach (var log in logs) { if (log.LastWriteTimeUtc.AddDays(_retentionDays) < DateTime.UtcNow) { try { log.Delete(); } catch (Exception) { // catch Exception and continue // we shouldn't block logging and fail the agent if the agent can't delete an older log file. } } } } string fileName = StringUtil.Format(_logFileNamingPattern, _logFilePrefix, DateTime.UtcNow); _logFilePath = Path.Combine(_logFileDirectory, fileName); Stream logStream; if (File.Exists(_logFilePath)) { logStream = new FileStream(_logFilePath, FileMode.Append, FileAccess.Write, FileShare.Read, bufferSize: 4096); } else { logStream = new FileStream(_logFilePath, FileMode.Create, FileAccess.ReadWrite, FileShare.Read, bufferSize: 4096); } return new StreamWriter(logStream); } } }
{ "pile_set_name": "Github" }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.7"/> <title>VSTGUI: Class Members - Functions</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript"> $(document).ready(initResizable); $(window).load(resizeHeight); </script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { searchBox.OnSelectItem(0); }); </script> <link href="doxydocu.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">VSTGUI &#160;<span id="projectnumber">4.4</span> </div> <div id="projectbrief">Graphical User Interface Framework not only for VST plugins</div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.7 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li><a href="pages.html"><span>Related&#160;Pages</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Class&#160;List</span></a></li> <li><a href="classes.html"><span>Class&#160;Index</span></a></li> <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li> <li class="current"><a href="functions.html"><span>Class&#160;Members</span></a></li> </ul> </div> <div id="navrow3" class="tabs2"> <ul class="tablist"> <li><a href="functions.html"><span>All</span></a></li> <li class="current"><a href="functions_func.html"><span>Functions</span></a></li> <li><a href="functions_vars.html"><span>Variables</span></a></li> <li><a href="functions_type.html"><span>Typedefs</span></a></li> <li><a href="functions_enum.html"><span>Enumerations</span></a></li> <li><a href="functions_eval.html"><span>Enumerator</span></a></li> </ul> </div> <div id="navrow4" class="tabs3"> <ul class="tablist"> <li><a href="functions_func.html#index_a"><span>a</span></a></li> <li><a href="functions_func_b.html#index_b"><span>b</span></a></li> <li><a href="functions_func_c.html#index_c"><span>c</span></a></li> <li><a href="functions_func_d.html#index_d"><span>d</span></a></li> <li><a href="functions_func_e.html#index_e"><span>e</span></a></li> <li><a href="functions_func_f.html#index_f"><span>f</span></a></li> <li><a href="functions_func_g.html#index_g"><span>g</span></a></li> <li><a href="functions_func_h.html#index_h"><span>h</span></a></li> <li><a href="functions_func_i.html#index_i"><span>i</span></a></li> <li class="current"><a href="functions_func_k.html#index_k"><span>k</span></a></li> <li><a href="functions_func_l.html#index_l"><span>l</span></a></li> <li><a href="functions_func_m.html#index_m"><span>m</span></a></li> <li><a href="functions_func_n.html#index_n"><span>n</span></a></li> <li><a href="functions_func_o.html#index_o"><span>o</span></a></li> <li><a href="functions_func_p.html#index_p"><span>p</span></a></li> <li><a href="functions_func_q.html#index_q"><span>q</span></a></li> <li><a href="functions_func_r.html#index_r"><span>r</span></a></li> <li><a href="functions_func_s.html#index_s"><span>s</span></a></li> <li><a href="functions_func_t.html#index_t"><span>t</span></a></li> <li><a href="functions_func_u.html#index_u"><span>u</span></a></li> <li><a href="functions_func_v.html#index_v"><span>v</span></a></li> <li><a href="functions_func_w.html#index_w"><span>w</span></a></li> <li><a href="functions_func_x.html#index_x"><span>x</span></a></li> <li><a href="functions_func_~.html#index_~"><span>~</span></a></li> </ul> </div> </div><!-- top --> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> <div id="nav-sync" class="sync"></div> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> $(document).ready(function(){initNavTree('functions_func_k.html','');}); </script> <div id="doc-content"> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Pages</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div class="contents"> &#160; <h3><a class="anchor" id="index_k"></a>- k -</h3><ul> <li>keyboardHooksOnKeyDown() : <a class="el" href="class_v_s_t_g_u_i_1_1_c_frame.html#abdb9c2d64f6cd9225515800b0be612fa">CFrame</a> </li> <li>keyboardHooksOnKeyUp() : <a class="el" href="class_v_s_t_g_u_i_1_1_c_frame.html#ac4217e0dec7c33e7d6e3fe5b7c9ff5b7">CFrame</a> </li> </ul> </div><!-- contents --> </div><!-- doc-content --> <!-- start footer part --> <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> <ul> <li class="footer">Generated on Fri Mar 3 2017 10:55:29 for VSTGUI by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.7 </li> </ul> </div> </body> </html>
{ "pile_set_name": "Github" }
/* Copyright (c) Colorado School of Mines, 2011.*/ /* All rights reserved. */ /* SUMIGGBZO: $Revision: 1.15 $ ; $Date: 2011/11/16 22:14:43 $ */ #include "su.h" #include "segy.h" /*********************** self documentation **********************/ char *sdoc[] = { " ", " SUMIGGBZO - MIGration via Gaussian Beams of Zero-Offset SU data ", " ", " sumiggbzo <infile >outfile vfile= nz= [optional parameters] ", " ", " Required Parameters: ", " vfile= name of file containing v(z,x) ", " nz= number of depth samples ", " ", " Optional Parameters: ", " dt=from header time sampling interval ", " dx=from header(d2) or 1.0 spatial sampling interval ", " dz=1.0 depth sampling interval ", " fmin=0.025/dt minimum frequency ", " fmax=10*fmin maximum frequency ", " amin=-amax minimum emergence angle; must be > -90 degrees ", " amax=60 maximum emergence angle; must be < 90 degrees ", " bwh=0.5*vavg/fmin beam half-width; vavg denotes average velocity ", " verbose=0 =0 silent; =1 chatty ", " ", " Note: spatial units of v(z,x) must be the same as those of dx. ", " v(z,x) is represented numerically in C-style binary floats v[x][z], ", " where the depth direction is the fast direction in the data. Such ", " models can be created with unif2 or makevel. ", " ", "(In C v[iz][ix] denotes a v(x,z) array, whereas v[ix][iz] ", " denotes a v(z,x) array, the opposite of what Matlab and Fortran ", " programmers may expect.) ", " ", " Caveat: ", " In the event of a \"Segmentation Violation\" try reducing the value of", " the \"bwh\" parameter. Run program with verbose=1 do see the default ", " value. ", NULL}; /* Credits: * * CWP: Dave Hale (algorithm), Jack K. Cohen, and John Stockwell * (reformatting for SU) */ /**************** end self doc ***********************************/ /* Ray types */ /* one step along ray */ typedef struct RayStepStruct { float t; /* time */ float a; /* angle */ float x,z; /* x,z coordinates */ float q1,p1,q2,p2; /* Cerveny's dynamic ray tracing solution */ int kmah; /* KMAH index */ float c,s; /* cos(angle) and sin(angle) */ float v,dvdx,dvdz; /* velocity and its derivatives */ } RayStep; /* one ray */ typedef struct RayStruct { int nrs; /* number of ray steps */ RayStep *rs; /* array[nrs] of ray steps */ int nc; /* number of circles */ int ic; /* index of circle containing nearest step */ void *c; /* array[nc] of circles */ } Ray; /* Ray functions */ Ray *makeRay (float x0, float z0, float a0, int nt, float dt, float ft, int nx, float dx, float fx, int nz, float dz, float fz, float **v); void freeRay (Ray *ray); int nearestRayStep (Ray *ray, float x, float z); /* Velocity functions */ void* vel2Alloc (int nx, float dx, float fx, int nz, float dz, float fz, float **v); void vel2Free (void *vel2); void vel2Interp (void *vel2, float x, float z, float *v, float *vx, float *vz, float *vxx, float *vxz, float *vzz); /* Beam functions */ void formBeams (float bwh, float dxb, float fmin, int nt, float dt, float ft, int nx, float dx, float fx, float **f, int ntau, float dtau, float ftau, int npx, float dpx, float fpx, float **g); void accBeam (Ray *ray, float fmin, float lmin, int nt, float dt, float ft, float *f, int nx, float dx, float fx, int nz, float dz, float fz, float **g); /* functions defined and used internally */ static void miggbzo (float bwh, float fmin, float fmax, float amin, float amax, int nt, float dt, int nx, float dx, int nz, float dz, float **f, float **v, float **g, int verbose); segy tr; int main(int argc, char **argv) { int nx; /* number of horizontal samples (traces) in input */ int nz; /* number of vertical samples in output */ int nt; /* number of time samples in input */ int ix; /* counter in x */ int iz; /* counter in z */ float dx; /* trace spacing in input */ float dz; /* vertical sampling interval in output */ float dt; /* time sampling interval in input */ float fmin; /* minimum frequency in migration */ float fmax; /* maximum frequency in migration */ float amin; /* minimum ray angle */ float amax; /* maximum ray angle */ float vavg; /* average velocity in input vfile */ float bwh; /* gaussian beam half-width */ float **v=NULL; /* pointer to background velocities */ float **f=NULL; /* pointer to input data */ float **g=NULL; /* pointer to migrated data */ char *vfile=""; /* velocity filename */ FILE *vfp; /* velocity file pointer */ FILE *tracefp; /* temp file to hold traces */ int verbose; /* verbose flag */ /* hook up getpar */ initargs(argc,argv); requestdoc(0); /* get info from first trace */ if (!gettr(&tr)) err("can't get first trace"); nt = tr.ns; /* get required parameters */ MUSTGETPARSTRING("vfile", &vfile); MUSTGETPARINT("nz", &nz); MUSTGETPARFLOAT("dz", &dz); if (!getparint("verbose",&verbose)) verbose = 0; /* let user give dt and/or dx from command line */ if (!getparfloat("dt", &dt)) { if (tr.dt) { /* is dt field set? */ dt = (float) tr.dt / 1000000.0; } else { /* dt not set, assume 4 ms */ dt = 0.004; if (verbose) warn("tr.dt not set, assuming dt=0.004"); } } if (!getparfloat("dx",&dx)) { if (tr.d2) { /* is d2 field set? */ dx = tr.d2; } else { dx = 1.0; if (verbose) warn("tr.d2 not set, assuming d2=1.0"); } } /* get optional parameters */ if (!getparfloat("dz",&dz)) dz = 1.0; if (!getparfloat("fmin",&fmin)) fmin = 0.025/dt; if (!getparfloat("fmax",&fmax)) fmax = 10.0*fmin; if (!getparfloat("amax",&amax)) amax = 60.0; if (!getparfloat("amin",&amin)) amin = -amax; /* store traces in tmpfile while getting a count */ tracefp = etmpfile(); nx = 0; do { ++nx; efwrite(tr.data, FSIZE, nt, tracefp); } while (gettr(&tr)); /* allocate workspace */ f = ealloc2float(nt,nx); v = ealloc2float(nz,nx); g = ealloc2float(nz,nx); /* load traces into the zero-offset array and close tmpfile */ rewind(tracefp); efread(*f, FSIZE, nt*nx, tracefp); efclose(tracefp); /* read and halve velocities; determine average */ vfp = efopen(vfile,"r"); if (efread(*v, FSIZE, nz*nx, vfp)!=nz*nx) err("error reading vfile=%s!\n",vfile); for (ix=0,vavg=0.0; ix<nx; ++ix) { for (iz=0; iz<nz; ++iz) { v[ix][iz] *= 0.5; vavg += v[ix][iz]; } } vavg /= nx*nz; /* get beam half-width */ if (!getparfloat("bwh",&bwh)) bwh = vavg/fmin; checkpars(); if (verbose) warn("bhw=%f",bwh); /* migrate */ miggbzo(bwh,fmin,fmax,amin,amax,nt,dt,nx,dx,nz,dz,f,v,g,verbose); /* set header fields and write output */ tr.ns = nz; tr.trid = TRID_DEPTH; tr.d1 = dz; tr.d2 = dx; for (ix=0; ix<nx; ++ix) { tr.tracl = ix + 1; tr.tracr = ix + 1; for (iz=0; iz<nz; ++iz) { tr.data[iz] = g[ix][iz]; } puttr(&tr); } /* free workspace */ free2float(f); free2float(v); free2float(g); return(CWP_Exit()); } static void miggbzo (float bwh, float fmin, float fmax, float amin, float amax, int nt, float dt, int nx, float dx, int nz, float dz, float **f, float **v, float **g, int verbose) /***************************************************************************** Migrate zero-offset data via accumulation of Gaussian beams. ****************************************************************************** Input: bwh horizontal beam half-width at surface z=0 fmin minimum frequency (cycles per unit time) fmax maximum frequency (cycles per unit time) amin minimum emergence angle at surface z=0 (degrees) amax maximum emergence angle at surface z=0 (degrees) nt number of time samples dt time sampling interval (first time assumed to be zero) nx number of x samples dx x sampling interval nz number of z samples dz z sampling interval f array[nx][nt] containing zero-offset data f(t,x) v array[nx][nz] containing half-velocities v(x,z) Output: g array[nx][nz] containing migrated image g(x,z) *****************************************************************************/ { int nxb=0,npx=0,ntau=0,ipx,ix,ixb,ixlo,ixhi,nxw,iz; float ft,fx,fz,xwh,dxb=0,fxb,xb,vmin,dpx,fpx,px, taupad,dtau,ftau,fxw,pxmin,pxmax, a0,x0,z0,bwhc,**b; Ray *ray; /* first t, x, and z assumed to be zero */ ft = fx = fz = 0.0; /* convert minimum and maximum angles to radians */ amin *= PI/180.0; amax *= PI/180.0; if (amin>amax) { float atemp=amin; amin = amax; amax = atemp; } /* window half-width */ xwh = 3.0*bwh; /* beam center sampling */ dxb = (float) (NINT((bwh*sqrt(2.0*fmin/fmax))/dx)*dx); nxb = (int) (1 + (nx-1)*dx/dxb); fxb = fx+0.5*((nx-1)*dx-(nxb-1)*dxb); if (verbose) warn("nxb=%d dxb=%f fxb=%f ",nxb,dxb,fxb); /* minimum velocity at surface z=0 */ for (ix=1,vmin=v[0][0]; ix<nx; ++ix) if (v[ix][0]<vmin) vmin = v[ix][0]; if (verbose) warn("vmin=%f fmin=%f fmax=%f",vmin,fmin,fmax); /* beam sampling */ pxmin = sin(amin)/vmin; pxmax = sin(amax)/vmin; dpx = 1.0/(2.0*xwh*sqrt(fmin*fmax)); npx = 1+(pxmax-pxmin)/dpx; fpx = pxmin+0.5*(pxmax-pxmin-(npx-1)*dpx); taupad = MAX(ABS(pxmin),ABS(pxmax))*xwh; taupad = NINT(taupad/dt)*dt; ftau = ft-taupad; dtau = dt; ntau = nt+2.0*taupad/dtau; if (verbose) warn("npx=%d dpx=%g fpx=%g",npx,dpx,fpx); if (verbose) warn("pxmin=%f pxmax=%f",pxmin,pxmax); if (verbose) warn("amin=%f amax=%f",amin,amax); /* zero migrated image */ for (ix=0; ix<nx; ++ix) for (iz=0; iz<nz; ++iz) g[ix][iz] = 0.0; /* loop over beam centers */ for (ixb=0,xb=fxb; ixb<nxb; ++ixb,xb+=dxb) { /* horizontal window */ ix = NINT((xb-fx)/dx); ixlo = MAX(ix-NINT(xwh/dx),0); ixhi = MIN(ix+NINT(xwh/dx),nx-1); nxw = 1+ixhi-ixlo; fxw = fx+(ixlo-ix)*dx; if (verbose) warn("ixb/nxb = %d/%d ix = %d",ixb,nxb,ix); /* allocate space for beams */ b = alloc2float(ntau,npx); /* form beams at surface */ formBeams(bwh,dxb,fmin, nt,dt,ft,nxw,dx,fxw,&f[ixlo], ntau,dtau,ftau,npx,dpx,fpx,b); /* loop over beams */ for (ipx=0,px=fpx; ipx<npx; ++ipx,px+=dpx) { /* sine of emergence angle; skip if out of bounds */ if (px*v[ix][0]>sin(amax)+0.01) continue; if (px*v[ix][0]<sin(amin)-0.01) continue; /* emergence angle and location */ a0 = -asin(px*v[ix][0]); x0 = fx+ix*dx; z0 = fz; /* beam half-width adjusted for cosine of angle */ bwhc = bwh*cos(a0); /* trace ray */ ray = makeRay(x0,z0,a0,nt,dt,ft,nx,dx,fx,nz,dz,fz,v); /* accumulate contribution of beam in migrated image */ accBeam(ray,fmin,bwhc, ntau,dtau,ftau,b[ipx], nx,dx,fx,nz,dz,fz,g); /* fwrite(g[0],sizeof(float),nx*nz,stdout); */ /* free ray */ freeRay(ray); } /* fwrite(g[0],sizeof(float),nx*nz,stdout); */ /* free space for beams */ free2float(b); } } /* circle for efficiently finding nearest ray step */ typedef struct CircleStruct { int irsf; /* index of first raystep in circle */ int irsl; /* index of last raystep in circle */ float x; /* x coordinate of center of circle */ float z; /* z coordinate of center of circle */ float r; /* radius of circle */ } Circle; /* functions defined and used internally */ Circle *makeCircles (int nc, int nrs, RayStep *rs); Ray *makeRay (float x0, float z0, float a0, int nt, float dt, float ft, int nx, float dx, float fx, int nz, float dz, float fz, float **vxz) /***************************************************************************** Trace a ray for uniformly sampled v(x,z). ****************************************************************************** Input: x0 x coordinate of takeoff point z0 z coordinate of takeoff point a0 takeoff angle (radians) nt number of time samples dt time sampling interval ft first time sample nx number of x samples dx x sampling interval fx first x sample nz number of z samples dz z sampling interval fz first z sample vxz array[nx][nz] of uniformly sampled velocities v(x,z) Returned: pointer to ray parameters sampled at discrete ray steps ****************************************************************************** Notes: The ray ends when it runs out of time (after nt steps) or with the first step that is out of the (x,z) bounds of the velocity function v(x,z). *****************************************************************************/ { int it,kmah; float t,x,z,a,c,s,p1,q1,p2,q2, lx,lz,cc,ss, v,dvdx,dvdz,ddvdxdx,ddvdxdz,ddvdzdz, vv,ddvdndn; Ray *ray; RayStep *rs; void *vel2; /* allocate and initialize velocity interpolator */ vel2 = vel2Alloc(nx,dx,fx,nz,dz,fz,vxz); /* last x and z in velocity model */ lx = fx+(nx-1)*dx; lz = fz+(nz-1)*dz; /* ensure takeoff point is within model */ if (x0<fx || x0>lx || z0<fz || z0>lz) return NULL; /* allocate space for ray and raysteps */ ray = (Ray*)alloc1(1,sizeof(Ray)); rs = (RayStep*)alloc1(nt,sizeof(RayStep)); /* cosine and sine of takeoff angle */ c = cos(a0); s = sin(a0); cc = c*c; ss = s*s; /* velocity and derivatives at takeoff point */ vel2Interp(vel2,x0,z0,&v,&dvdx,&dvdz,&ddvdxdx,&ddvdxdz,&ddvdzdz); ddvdndn = ddvdxdx*cc-2.0*ddvdxdz*s*c+ddvdzdz*ss; vv = v*v; /* first ray step */ rs[0].t = t = ft; rs[0].a = a = a0; rs[0].x = x = x0; rs[0].z = z = z0; rs[0].q1 = q1 = 1.0; rs[0].p1 = p1 = 0.0; rs[0].q2 = q2 = 0.0; rs[0].p2 = p2 = 1.0; rs[0].kmah = kmah = 0; rs[0].c = c; rs[0].s = s; rs[0].v = v; rs[0].dvdx = dvdx; rs[0].dvdz = dvdz; /* loop over time steps */ for (it=1; it<nt; ++it) { /* variables used for Runge-Kutta integration */ float h=dt,hhalf=dt/2.0,hsixth=dt/6.0, q2old,xt,zt,at,p1t,q1t,p2t,q2t, dx,dz,da,dp1,dq1,dp2,dq2, dxt,dzt,dat,dp1t,dq1t,dp2t,dq2t, dxm,dzm,dam,dp1m,dq1m,dp2m,dq2m; /* if ray is out of bounds, break */ if (x<fx || x>lx || z<fz || z>lz) break; /* remember old q2 */ q2old = q2; /* step 1 of 4th-order Runge-Kutta */ dx = v*s; dz = v*c; da = dvdz*s-dvdx*c; dp1 = -ddvdndn*q1/v; dq1 = vv*p1; dp2 = -ddvdndn*q2/v; dq2 = vv*p2; xt = x+hhalf*dx; zt = z+hhalf*dz; at = a+hhalf*da; p1t = p1+hhalf*dp1; q1t = q1+hhalf*dq1; p2t = p2+hhalf*dp2; q2t = q2+hhalf*dq2; c = cos(at); s = sin(at); cc = c*c; ss = s*s; vel2Interp(vel2,xt,zt, &v,&dvdx,&dvdz,&ddvdxdx,&ddvdxdz,&ddvdzdz); ddvdndn = ddvdxdx*cc-2.0*ddvdxdz*s*c+ddvdzdz*ss; vv = v*v; /* step 2 of 4th-order Runge-Kutta */ dxt = v*s; dzt = v*c; dat = dvdz*s-dvdx*c; dp1t = -ddvdndn*q1t/v; dq1t = vv*p1t; dp2t = -ddvdndn*q2t/v; dq2t = vv*p2t; xt = x+hhalf*dxt; zt = z+hhalf*dzt; at = a+hhalf*dat; p1t = p1+hhalf*dp1t; q1t = q1+hhalf*dq1t; p2t = p2+hhalf*dp2t; q2t = q2+hhalf*dq2t; c = cos(at); s = sin(at); cc = c*c; ss = s*s; vel2Interp(vel2,xt,zt, &v,&dvdx,&dvdz,&ddvdxdx,&ddvdxdz,&ddvdzdz); ddvdndn = ddvdxdx*cc-2.0*ddvdxdz*s*c+ddvdzdz*ss; vv = v*v; /* step 3 of 4th-order Runge-Kutta */ dxm = v*s; dzm = v*c; dam = dvdz*s-dvdx*c; dp1m = -ddvdndn*q1t/v; dq1m = vv*p1t; dp2m = -ddvdndn*q2t/v; dq2m = vv*p2t; xt = x+h*dxm; zt = z+h*dzm; at = a+h*dam; p1t = p1+h*dp1m; q1t = q1+h*dq1m; p2t = p2+h*dp2m; q2t = q2+h*dq2m; dxm += dxt; dzm += dzt; dam += dat; dp1m += dp1t; dq1m += dq1t; dp2m += dp2t; dq2m += dq2t; c = cos(at); s = sin(at); cc = c*c; ss = s*s; vel2Interp(vel2,xt,zt, &v,&dvdx,&dvdz,&ddvdxdx,&ddvdxdz,&ddvdzdz); ddvdndn = ddvdxdx*cc-2.0*ddvdxdz*s*c+ddvdzdz*ss; vv = v*v; /* step 4 of 4th-order Runge-Kutta */ dxt = v*s; dzt = v*c; dat = dvdz*s-dvdx*c; dp1t = -ddvdndn*q1t/v; dq1t = vv*p1t; dp2t = -ddvdndn*q2t/v; dq2t = vv*p2t; x += hsixth*(dx+dxt+2.0*dxm); z += hsixth*(dz+dzt+2.0*dzm); a += hsixth*(da+dat+2.0*dam); p1 += hsixth*(dp1+dp1t+2.0*dp1m); q1 += hsixth*(dq1+dq1t+2.0*dq1m); p2 += hsixth*(dp2+dp2t+2.0*dp2m); q2 += hsixth*(dq2+dq2t+2.0*dq2m); c = cos(a); s = sin(a); cc = c*c; ss = s*s; vel2Interp(vel2,x,z, &v,&dvdx,&dvdz,&ddvdxdx,&ddvdxdz,&ddvdzdz); ddvdndn = ddvdxdx*cc-2.0*ddvdxdz*s*c+ddvdzdz*ss; vv = v*v; /* update kmah index */ if ((q2<=0.0 && q2old>0.0) || (q2>=0.0 && q2old<0.0)) kmah++; /* update time */ t += dt; /* save ray parameters */ rs[it].t = t; rs[it].a = a; rs[it].x = x; rs[it].z = z; rs[it].c = c; rs[it].s = s; rs[it].q1 = q1; rs[it].p1 = p1; rs[it].q2 = q2; rs[it].p2 = p2; rs[it].kmah = kmah; rs[it].v = v; rs[it].dvdx = dvdx; rs[it].dvdz = dvdz; } /* free velocity interpolator */ vel2Free(vel2); /* return ray */ ray->nrs = it; ray->rs = rs; ray->nc = 0; ray->c = NULL; return ray; } void freeRay (Ray *ray) /***************************************************************************** Free a ray. ****************************************************************************** Input: ray ray to be freed *****************************************************************************/ { if (ray->c!=NULL) free1((void*)ray->c); free1((void*)ray->rs); free1((void*)ray); } int nearestRayStep (Ray *ray, float x, float z) /***************************************************************************** Determine index of ray step nearest to point (x,z). ****************************************************************************** Input: ray ray x x coordinate z z coordinate Returned: index of nearest ray step *****************************************************************************/ { int nrs=ray->nrs,ic=ray->ic,nc=ray->nc; RayStep *rs=ray->rs; Circle *c=ray->c; int irs,irsf,irsl,irsmin=0,update,jc,js,kc; float dsmin,ds,dx,dz,dmin,rdmin,xrs,zrs; /* if necessary, make circles localizing ray steps */ if (c==NULL) { ray->ic = ic = 0; ray->nc = nc = sqrt((float)nrs); ray->c = c = makeCircles(nc,nrs,rs); } /* initialize minimum distance and minimum distance-squared */ dx = x-c[ic].x; dz = z-c[ic].z; dmin = 2.0*(sqrt(dx*dx+dz*dz)+c[ic].r); dsmin = dmin*dmin; /* loop over all circles */ for (kc=0,jc=ic,js=0; kc<nc; ++kc) { /* distance-squared to center of circle */ dx = x-c[jc].x; dz = z-c[jc].z; ds = dx*dx+dz*dz; /* radius of circle plus minimum distance (so far) */ rdmin = c[jc].r+dmin; /* if circle could possible contain a nearer ray step */ if (ds<=rdmin*rdmin) { /* search circle for nearest ray step */ irsf = c[jc].irsf; irsl = c[jc].irsl; update = 0; for (irs=irsf; irs<=irsl; ++irs) { xrs = rs[irs].x; zrs = rs[irs].z; dx = x-xrs; dz = z-zrs; ds = dx*dx+dz*dz; if (ds<dsmin) { dsmin = ds; irsmin = irs; update = 1; } } /* if a nearer ray step was found inside circle */ if (update) { /* update minimum distance */ dmin = sqrt(dsmin); /* remember the circle */ ic = jc; } } /* search circles in alternating directions */ js = (js>0)?-js-1:-js+1; jc += js; if (jc<0 || jc>=nc) { js = (js>0)?-js-1:-js+1; jc += js; } } /* remember the circle containing the nearest ray step */ ray->ic = ic; if (irsmin<0 || irsmin>=nrs) warn("irsmin=%d",irsmin); /* return index of nearest ray step */ return irsmin; } int xxx_nearestRayStep (Ray *ray, float x, float z) /***************************************************************************** Determine index of ray step nearest to point (x,z). Simple (slow) version. ****************************************************************************** Input: ray ray x x coordinate z z coordinate Returned: index of nearest ray step *****************************************************************************/ { int nrs=ray->nrs; RayStep *rs=ray->rs; int irs,irsmin=0; float dsmin,ds,dx,dz,xrs,zrs; for (irs=0,dsmin=FLT_MAX; irs<nrs; ++irs) { xrs = rs[irs].x; zrs = rs[irs].z; dx = x-xrs; dz = z-zrs; ds = dx*dx+dz*dz; if (ds<dsmin) { dsmin = ds; irsmin = irs; } } return irsmin; } Circle *makeCircles (int nc, int nrs, RayStep *rs) /***************************************************************************** Make circles used to speed up determination of nearest ray step. ****************************************************************************** Input: nc number of circles to make nrs number of ray steps rs array[nrs] of ray steps Returned: array[nc] of circles *****************************************************************************/ { int nrsc,ic,irsf,irsl,irs; float xmin,xmax,zmin,zmax,x,z,r; Circle *c; /* allocate space for circles */ c = (Circle*)alloc1(nc,sizeof(Circle)); /* determine typical number of ray steps per circle */ nrsc = 1+(nrs-1)/nc; /* loop over circles */ for (ic=0; ic<nc; ++ic) { /* index of first and last raystep */ irsf = ic*nrsc; irsl = irsf+nrsc-1; if (irsf>=nrs) irsf = nrs-1; if (irsl>=nrs) irsl = nrs-1; /* coordinate bounds of ray steps */ xmin = xmax = rs[irsf].x; zmin = zmax = rs[irsf].z; for (irs=irsf+1; irs<=irsl; ++irs) { if (rs[irs].x<xmin) xmin = rs[irs].x; if (rs[irs].x>xmax) xmax = rs[irs].x; if (rs[irs].z<zmin) zmin = rs[irs].z; if (rs[irs].z>zmax) zmax = rs[irs].z; } /* center and radius of circle */ x = 0.5*(xmin+xmax); z = 0.5*(zmin+zmax); r = sqrt((x-xmin)*(x-xmin)+(z-zmin)*(z-zmin)); /* set circle */ c[ic].irsf = irsf; c[ic].irsl = irsl; c[ic].x = x; c[ic].z = z; c[ic].r = r; } return c; } /***************************************************************************** Functions to support interpolation of velocity and its derivatives. ****************************************************************************** Functions: vel2Alloc allocate and initialize an interpolator for v(x,z) vel2Interp interpolate v(x,z) and its derivatives ****************************************************************************** Notes: Interpolation is performed by piecewise cubic Hermite polynomials, so that velocity and first derivatives are continuous. Therefore, velocity v, first derivatives dv/dx and dv/dz, and the mixed derivative ddv/dxdz are continuous. However, second derivatives ddv/dxdx and ddv/dzdz are discontinuous. *****************************************************************************/ /* number of pre-computed, tabulated interpolators */ #define NTABLE 101 /* length of each interpolator in table (4 for piecewise cubic) */ #define LTABLE 4 /* table of pre-computed interpolators, for 0th, 1st, and 2nd derivatives */ static float tbl[3][NTABLE][LTABLE]; /* constants */ static int ix=1-LTABLE/2-LTABLE,iz=1-LTABLE/2-LTABLE; static float ltable=LTABLE,ntblm1=NTABLE-1; /* indices for 0th, 1st, and 2nd derivatives */ static int kx[6]={0,1,0,2,1,0}; static int kz[6]={0,0,1,0,1,2}; /* function to build interpolator tables; sets tabled=1 when built */ static void buildTables (void); static int tabled=0; /* interpolator for velocity function v(x,z) of two variables */ typedef struct Vel2Struct { int nx; /* number of x samples */ int nz; /* number of z samples */ int nxm; /* number of x samples minus LTABLE */ int nzm; /* number of x samples minus LTABLE */ float xs,xb,zs,zb,sx[3],sz[3],**vu; } Vel2; void* vel2Alloc (int nx, float dx, float fx, int nz, float dz, float fz, float **v) /***************************************************************************** Allocate and initialize an interpolator for v(x,z) and its derivatives. ****************************************************************************** Input: nx number of x samples dx x sampling interval fx first x sample nz number of z samples dz z sampling interval fz first z sample v array[nx][nz] of uniformly sampled v(x,z) Returned: pointer to interpolator *****************************************************************************/ { Vel2 *vel2; /* allocate space */ vel2 = (Vel2*)alloc1(1,sizeof(Vel2)); /* set state variables used for interpolation */ vel2->nx = nx; vel2->nxm = nx-LTABLE; vel2->xs = 1.0/dx; vel2->xb = ltable-fx*vel2->xs; vel2->sx[0] = 1.0; vel2->sx[1] = vel2->xs; vel2->sx[2] = vel2->xs*vel2->xs; vel2->nz = nz; vel2->nzm = nz-LTABLE; vel2->zs = 1.0/dz; vel2->zb = ltable-fz*vel2->zs; vel2->sz[0] = 1.0; vel2->sz[1] = vel2->zs; vel2->sz[2] = vel2->zs*vel2->zs; vel2->vu = v; /* if necessary, build interpolator coefficient tables */ if (!tabled) buildTables(); return vel2; } void vel2Free (void *vel2) /***************************************************************************** Free an interpolator for v(x,z) and its derivatives. ****************************************************************************** Input: vel2 pointer to interpolator as returned by vel2Alloc() *****************************************************************************/ { free1(vel2); } void vel2Interp (void *vel2, float x, float z, float *v, float *vx, float *vz, float *vxx, float *vxz, float *vzz) /***************************************************************************** Interpolation of a velocity function v(x,z) and its derivatives. ****************************************************************************** Input: vel2 pointer to interpolator as returned by vel2Alloc() x x coordinate at which to interpolate v(x,z) and derivatives z z coordinate at which to interpolate v(x,z) and derivatives Output: v v(x,z) vx dv/dx vz dv/dz vxx ddv/dxdx vxz ddv/dxdz vzz ddv/dzdz *****************************************************************************/ { Vel2 *v2=vel2; int nx=v2->nx,nz=v2->nz,nxm=v2->nxm,nzm=v2->nzm; float xs=v2->xs,xb=v2->xb,zs=v2->zs,zb=v2->zb, *sx=v2->sx,*sz=v2->sz,**vu=v2->vu; int i,jx,lx,mx,jz,lz,mz,jmx,jmz,mmx,mmz; float ax,bx,*px,az,bz,*pz,sum,vd[6]; /* determine offsets into vu and interpolation coefficients */ ax = xb+x*xs; jx = (int)ax; bx = ax-jx; lx = (bx>=0.0)?bx*ntblm1+0.5:(bx+1.0)*ntblm1-0.5; lx *= LTABLE; mx = ix+jx; az = zb+z*zs; jz = (int)az; bz = az-jz; lz = (bz>=0.0)?bz*ntblm1+0.5:(bz+1.0)*ntblm1-0.5; lz *= LTABLE; mz = iz+jz; /* if totally within input array, use fast method */ if (mx>=0 && mx<=nxm && mz>=0 && mz<=nzm) { for (i=0; i<6; ++i) { px = &(tbl[kx[i]][0][0])+lx; pz = &(tbl[kz[i]][0][0])+lz; vd[i] = sx[kx[i]]*sz[kz[i]]*( vu[mx][mz]*px[0]*pz[0]+ vu[mx][mz+1]*px[0]*pz[1]+ vu[mx][mz+2]*px[0]*pz[2]+ vu[mx][mz+3]*px[0]*pz[3]+ vu[mx+1][mz]*px[1]*pz[0]+ vu[mx+1][mz+1]*px[1]*pz[1]+ vu[mx+1][mz+2]*px[1]*pz[2]+ vu[mx+1][mz+3]*px[1]*pz[3]+ vu[mx+2][mz]*px[2]*pz[0]+ vu[mx+2][mz+1]*px[2]*pz[1]+ vu[mx+2][mz+2]*px[2]*pz[2]+ vu[mx+2][mz+3]*px[2]*pz[3]+ vu[mx+3][mz]*px[3]*pz[0]+ vu[mx+3][mz+1]*px[3]*pz[1]+ vu[mx+3][mz+2]*px[3]*pz[2]+ vu[mx+3][mz+3]*px[3]*pz[3]); } /* else handle end effects with constant extrapolation */ } else { for (i=0; i<6; ++i) { px = &(tbl[kx[i]][0][0])+lx; pz = &(tbl[kz[i]][0][0])+lz; for (jx=0,jmx=mx,sum=0.0; jx<4; ++jx,++jmx) { mmx = jmx; if (mmx<0) mmx = 0; else if (mmx>=nx) mmx = nx-1; for (jz=0,jmz=mz; jz<4; ++jz,++jmz) { mmz = jmz; if (mmz<0) mmz = 0; else if (mmz>=nz) mmz = nz-1; sum += vu[mmx][mmz]*px[jx]*pz[jz]; } } vd[i] = sx[kx[i]]*sz[kz[i]]*sum; } } /* set output variables */ *v = vd[0]; *vx = vd[1]; *vz = vd[2]; *vxx = vd[3]; *vxz = vd[4]; *vzz = vd[5]; } /* hermite polynomials */ static float h00 (float x) {return 2.0*x*x*x-3.0*x*x+1.0;} static float h01 (float x) {return 6.0*x*x-6.0*x;} static float h02 (float x) {return 12.0*x-6.0;} static float h10 (float x) {return -2.0*x*x*x+3.0*x*x;} static float h11 (float x) {return -6.0*x*x+6.0*x;} static float h12 (float x) {return -12.0*x+6.0;} static float k00 (float x) {return x*x*x-2.0*x*x+x;} static float k01 (float x) {return 3.0*x*x-4.0*x+1.0;} static float k02 (float x) {return 6.0*x-4.0;} static float k10 (float x) {return x*x*x-x*x;} static float k11 (float x) {return 3.0*x*x-2.0*x;} static float k12 (float x) {return 6.0*x-2.0;} /* function to build interpolation tables */ static void buildTables(void) { int i; float x; /* tabulate interpolator for 0th derivative */ for (i=0; i<NTABLE; ++i) { x = (float)i/(NTABLE-1.0); tbl[0][i][0] = -0.5*k00(x); tbl[0][i][1] = h00(x)-0.5*k10(x); tbl[0][i][2] = h10(x)+0.5*k00(x); tbl[0][i][3] = 0.5*k10(x); tbl[1][i][0] = -0.5*k01(x); tbl[1][i][1] = h01(x)-0.5*k11(x); tbl[1][i][2] = h11(x)+0.5*k01(x); tbl[1][i][3] = 0.5*k11(x); tbl[2][i][0] = -0.5*k02(x); tbl[2][i][1] = h02(x)-0.5*k12(x); tbl[2][i][2] = h12(x)+0.5*k02(x); tbl[2][i][3] = 0.5*k12(x); } /* remember that tables have been built */ tabled = 1; } #ifdef TEST2 #include "cwp.h" #define NZ 2 #define NX 2 #define NXOUT 21 #define NZOUT 21 main() { int nx=NX,nz=NZ,nxout=NXOUT,nzout=NZOUT,i,j; float dx=2.0,fx=-1.0,dxout=0.2,fxout=-2.0; float dz=4.0,fz=-2.0,dzout=0.4,fzout=-4.0; float x,z,v,vx,vz,vxx,vxz,vzz,**vu,**vo; void *vel2; vu = alloc2float(nz,nx); vo = alloc2float(nzout,nxout); vu[0][0] = 1.0; vu[1][0] = 2.0; vu[0][1] = 1.0; vu[1][1] = 2.0; vel2 = vel2Alloc(nx,dx,fx,nz,dz,fz,vu); for (i=0; i<nxout; ++i) { x = fxout+i*dxout; for (j=0; j<nzout; ++j) { z = fzout+j*dzout; vel2Interp(vel2,x,z,&v,&vx,&vz,&vxx,&vxz,&vzz); vo[i][j] = vz; } } vel2Free(vel2); fwrite(vo[0],sizeof(float),nxout*nzout,stdout); } #endif /* Beam subroutines */ /* size of cells in which to linearly interpolate complex time and amplitude */ #define CELLSIZE 8 /* factor by which to oversample time for linear interpolation of traces */ #define NOVERSAMPLE 4 /* number of exponential decay filters */ #define NFILTER 6 /* exp(EXPMIN) is assumed to be negligible */ #define EXPMIN (-5.0) /* filtered complex beam data as a function of real and imaginary time */ typedef struct BeamDataStruct { int ntr; /* number of real time samples */ float dtr; /* real time sampling interval */ float ftr; /* first real time sample */ int nti; /* number of imaginary time samples */ float dti; /* imaginary time sampling interval */ float fti; /* first imaginary time sample */ complex **cf; /* array[nti][ntr] of complex data */ } BeamData; /* one cell in which to linearly interpolate complex time and amplitude */ typedef struct CellStruct { int live; /* random number used to denote a live cell */ int dead; /* random number used to denote a dead cell */ float tr; /* real part of traveltime */ float ti; /* imaginary part of traveltime */ float ar; /* real part of amplitude */ float ai; /* imaginary part of amplitude */ } Cell; /* structure containing information used to set and fill cells */ typedef struct CellsStruct { int nt; /* number of time samples */ float dt; /* time sampling interval */ float ft; /* first time sample */ int lx; /* number of x samples per cell */ int mx; /* number of x cells */ int nx; /* number of x samples */ float dx; /* x sampling interval */ float fx; /* first x sample */ int lz; /* number of z samples per cell */ int mz; /* number of z cells */ int nz; /* number of z samples */ float dz; /* z sampling interval */ float fz; /* first z sample */ int live; /* random number used to denote a live cell */ int dead; /* random number used to denote a dead cell */ float wmin; /* minimum (reference) frequency */ float lmin; /* minimum beamwidth for frequency wmin */ Cell **cell; /* cell array[mx][mz] */ Ray *ray; /* ray */ BeamData *bd; /* complex beam data as a function of complex time */ float **g; /* array[nx][nz] containing g(x,z) */ } Cells; /* functions defined and used internally */ static void xtop (float w, int nx, float dx, float fx, complex *g, int np, float dp, float fp, complex *h); static BeamData* beamData (float wmin, int nt, float dt, float ft, float *f); static void setCell (Cells *cells, int jx, int jz); static void accCell (Cells *cells, int jx, int jz); static int cellTimeAmp (Cells *cells, int jx, int jz); static void cellBeam (Cells *cells, int jx, int jz); /* functions for external use */ void formBeams (float bwh, float dxb, float fmin, int nt, float dt, float ft, int nx, float dx, float fx, float **f, int ntau, float dtau, float ftau, int npx, float dpx, float fpx, float **g) /***************************************************************************** Form beams (filtered slant stacks) for later superposition of Gaussian beams. ****************************************************************************** Input: bwh horizontal beam half-width dxb horizontal distance between beam centers fmin minimum frequency (cycles per unit time) nt number of input time samples dt input time sampling interval ft first input time sample nx number of horizontal samples dx horizontal sampling interval fx first horizontal sample f array[nx][nt] of data to be slant stacked into beams ntau number of output time samples dtau output time sampling interval (currently must equal dt) ftau first output time sample npx number of horizontal slownesses dpx horizontal slowness sampling interval fpx first horizontal slowness Output: g array[npx][ntau] containing beams *****************************************************************************/ { int ntpad,ntfft,nw,ix,iw,ipx,it,itau; float wmin,pxmax,xmax,x,dw,fw,w,fftscl, amp,phase,scale,a,b,as,bs,es,cfr,cfi, *fpad=NULL,*gpad=NULL; complex **cf=NULL,**cg=NULL,*cfx=NULL,*cgpx=NULL; /* minimum frequency in radians */ wmin = 2.0*PI*fmin; /* pad time axis to avoid wraparound */ pxmax = (dpx<0.0)?fpx:fpx+(npx-1)*dpx; xmax = (dx<0.0)?fx:fx+(nx-1)*dx; ntpad = ABS(pxmax*xmax)/dt; /* fft sampling */ ntfft = npfar(MAX(nt+ntpad,ntau)); nw = ntfft/2+1; dw = 2.0*PI/(ntfft*dt); fw = 0.0; fftscl = 1.0/ntfft; /* allocate workspace */ fpad = alloc1float(ntfft); gpad = alloc1float(ntfft); cf = alloc2complex(nw,nx); cg = alloc2complex(nw,npx); cfx = alloc1complex(nx); cgpx = alloc1complex(npx); /* loop over x */ for (ix=0; ix<nx; ++ix) { /* pad time with zeros */ for (it=0; it<nt; ++it) fpad[it] = f[ix][it]; for (it=nt; it<ntfft; ++it) fpad[it] = 0.0; /* Fourier transform time to frequency */ pfarc(1,ntfft,fpad,cf[ix]); } /* loop over w */ for (iw=0,w=fw; iw<nw; ++iw,w+=dw) { /* frequency-dependent amplitude scale factors */ scale = -0.5*w/(wmin*bwh*bwh); amp = fftscl*dpx*w/(2.0*PI)*sqrt(w/(PI*wmin))*dxb/bwh; /* phase shift to account for ft not equal to ftau */ phase = w*(ft-ftau); /* apply complex filter */ a = amp*cos(phase); b = amp*sin(phase); for (ix=0,x=fx; ix<nx; ++ix,x+=dx) { es = exp(scale*x*x); as = a*es; bs = b*es; cfr = cf[ix][iw].r; cfi = cf[ix][iw].i; cfx[ix].r = as*cfr-bs*cfi; cfx[ix].i = bs*cfr+as*cfi; } /* transform x to p */ xtop(w,nx,dx,fx,cfx,npx,dpx,fpx,cgpx); for (ipx=0; ipx<npx; ++ipx) { cg[ipx][iw].r = cgpx[ipx].r; cg[ipx][iw].i = cgpx[ipx].i; } } /* loop over px */ for (ipx=0; ipx<npx; ++ipx) { /* Fourier transform frequency to time */ pfacr(-1,ntfft,cg[ipx],gpad); /* copy to output array */ for (itau=0; itau<ntau; ++itau) g[ipx][itau] = gpad[itau]; } free1float(fpad); free1float(gpad); free2complex(cf); free2complex(cg); free1complex(cfx); free1complex(cgpx); } void accBeam (Ray *ray, float fmin, float lmin, int nt, float dt, float ft, float *f, int nx, float dx, float fx, int nz, float dz, float fz, float **g) /***************************************************************************** Accumulate contribution of one Gaussian beam. ****************************************************************************** Input: ray ray parameters sampled at discrete ray steps fmin minimum frequency (cycles per unit time) lmin initial beam width for frequency wmin nt number of time samples dt time sampling interval ft first time sample f array[nt] containing data for one ray f(t) nx number of x samples dx x sampling interval fx first x sample nz number of z samples dz z sampling interval fz first z sample g array[nx][nz] in which to accumulate beam Output: g array[nx][nz] after accumulating beam *****************************************************************************/ { int lx,lz,mx,mz,jx,jz,live,dead; float wmin; RayStep *rs=ray->rs; Cells *cells; Cell **cell; BeamData *bd; /* frequency in radians per unit time */ wmin = 2.0*PI*fmin; /* random numbers used to denote live and dead cells */ live = 1+(int)(1.0e7*franuni()); dead = 1+(int)(1.0e7*franuni()); /* number of samples per cell */ lx = CELLSIZE; lz = CELLSIZE; /* number of cells */ mx = 2+(nx-1)/lx; mz = 2+(nz-1)/lz; /* compute complex beam data */ bd = beamData(wmin,nt,dt,ft,f); /* allocate cells */ cells = (Cells*)alloc1(1,sizeof(Cells)); cell = (Cell**)alloc2(mz,mx,sizeof(Cell)); /* set information needed to set and fill cells */ cells->nt = nt; cells->dt = dt; cells->ft = ft; cells->lx = lx; cells->mx = mx; cells->nx = nx; cells->dx = dx; cells->fx = fx; cells->lz = lz; cells->mz = mz; cells->nz = nz; cells->dz = dz; cells->fz = fz; cells->live = live; cells->dead = dead; cells->wmin = wmin; cells->lmin = lmin; cells->cell = cell; cells->ray = ray; cells->bd = bd; cells->g = g; /* cell closest to initial point on ray will be first live cell */ jx = NINT((rs[0].x-fx)/dx/lx); jz = NINT((rs[0].z-fz)/dz/lz); /* set first live cell and its neighbors recursively */ setCell(cells,jx,jz); /* accumulate beam in first live cell and its neighbors recursively */ accCell(cells,jx,jz); /* free complex beam data */ free2complex(bd->cf); free1((void*)bd); /* free cells */ free2((void**)cells->cell); free1((void*)cells); } /* functions for internal use only */ static void xtop (float w, int nx, float dx, float fx, complex *g, int np, float dp, float fp, complex *h) /***************************************************************************** Slant stack for one frequency w, where slant stack is defined by fx+(nx-1)*dx h(p) = integral exp(-sqrt(-1)*w*p*x) * g(x) * dx fx ****************************************************************************** Input: w frequency (radians per unit time) nx number of x samples dx x sampling interval fx first x sample g array[nx] containing g(x) np number of p samples dp p sampling interval fp first p sample Output: h array[np] containing h(p) ****************************************************************************** Notes: The units of w, x, and p must be consistent. Slant stack is performed via FFT and 8-point (tapered-sinc) interpolation. The Fourier transform over time (t) is assumed to have been performed with positive sqrt(-1)*w*t in the exponent; if negative sqrt(-1)*w*t was used instead, call this function with negative w. *****************************************************************************/ { int nxfft,nk,nka,ix,ik,ip,lwrap; float dk,fk,ek,fka,k,p,phase,c,s,x,xshift,temp,*kp; complex czero=cmplx(0.0,0.0),*gx,*gk,*gka,*hp; /* number of samples required to make wavenumber k periodic */ lwrap = 8; /* wavenumber k sampling */ nxfft = npfa((nx+lwrap)*2); nk = nxfft; dk = 2.0*PI/(nxfft*dx); fk = -PI/dx; ek = PI/dx; fka = fk-lwrap*dk; nka = lwrap+nk+lwrap; /* allocate workspace */ gka = alloc1complex(nka); gx = gk = gka+lwrap; hp = alloc1complex(np); kp = alloc1float(np); /* scale g(x) by x sampling interval dx */ for (ix=0; ix<nx; ++ix,x+=dx) { gx[ix].r = dx*g[ix].r; gx[ix].i = dx*g[ix].i; } /* pad g(x) with zeros */ for (ix=nx; ix<nxfft; ++ix) gx[ix].r = gx[ix].i = 0.0; /* negate every other sample so k-axis will be centered */ for (ix=1; ix<nx; ix+=2) { gx[ix].r = -gx[ix].r; gx[ix].i = -gx[ix].i; } /* Fourier transform g(x) to g(k) */ pfacc(-1,nxfft,gx); /* wrap-around g(k) to avoid interpolation end effects */ for (ik=0; ik<lwrap; ++ik) gka[ik] = gk[ik+nk-lwrap]; for (ik=lwrap+nk; ik<lwrap+nk+lwrap; ++ik) gka[ik] = gk[ik-lwrap-nk]; /* phase shift to account for non-centered x-axis */ xshift = 0.5*(nx-1)*dx; for (ik=0,k=fka; ik<nka; ++ik,k+=dk) { phase = k*xshift; c = cos(phase); s = sin(phase); temp = gka[ik].r*c-gka[ik].i*s; gka[ik].i = gka[ik].r*s+gka[ik].i*c; gka[ik].r = temp; } /* compute k values at which to interpolate g(k) */ for (ip=0,p=fp; ip<np; ++ip,p+=dp) { kp[ip] = w*p; /* if outside Nyquist bounds, do not interpolate */ if (kp[ip]<fk && kp[ip]<ek) kp[ip] = fk-1000.0*dk; else if (kp[ip]>fk && kp[ip]>ek) kp[ip] = ek+1000.0*dk; } /* interpolate g(k) to obtain h(p) */ ints8c(nka,dk,fka,gka,czero,czero,np,kp,hp); /* phase shift to account for non-centered x-axis and non-zero fx */ xshift = -fx-0.5*(nx-1)*dx; for (ip=0; ip<np; ++ip) { phase = kp[ip]*xshift; c = cos(phase); s = sin(phase); h[ip].r = hp[ip].r*c-hp[ip].i*s; h[ip].i = hp[ip].r*s+hp[ip].i*c; } /* free workspace */ free1complex(gka); free1complex(hp); free1float(kp); } static BeamData* beamData (float wmin, int nt, float dt, float ft, float *f) /***************************************************************************** Compute filtered complex beam data as a function of real and imaginary time. ****************************************************************************** Input: wmin minimum frequency (in radians per unit time) nt number of time samples dt time sampling interval ft first time sample f array[nt] containing data to be filtered Returned: pointer to beam data *****************************************************************************/ { int ntpad,ntfft,nw,iwnyq,ntrfft,ntr,nti,nwr,it,itr,iti,iw; float dw,fw,dtr,ftr,dti,fti,w,ti,scale,*fa; complex *ca,*cb,*cfi,**cf; BeamData *bd; /* pad to avoid wraparound in Hilbert transform */ ntpad = 25; /* fft sampling */ ntfft = npfaro(nt+ntpad,2*(nt+ntpad)); nw = ntfft/2+1; dw = 2.0*PI/(ntfft*dt); fw = 0.0; iwnyq = nw-1; /* real time sampling (oversample for future linear interpolation) */ ntrfft = nwr = npfao(NOVERSAMPLE*ntfft,NOVERSAMPLE*ntfft+ntfft); dtr = dt*ntfft/ntrfft; ftr = ft; ntr = 1+(nt+ntpad-1)*dt/dtr; /* imaginary time sampling (exponential decay filters) */ nti = NFILTER; dti = EXPMIN/(wmin*(nti-1)); fti = 0.0; /* allocate space for filtered data */ cf = alloc2complex(ntr,nti); /* allocate workspace */ fa = alloc1float(ntfft); ca = alloc1complex(nw); cb = alloc1complex(ntrfft); /* pad data with zeros */ for (it=0; it<nt; ++it) fa[it] = f[it]; for (it=nt; it<ntfft; ++it) fa[it] = 0.0; /* Fourier transform and scale to make complex analytic signal */ pfarc(1,ntfft,fa,ca); for (iw=1; iw<iwnyq; ++iw) { ca[iw].r *= 2.0; ca[iw].i *= 2.0; } /* loop over imaginary time */ for (iti=0,ti=fti; iti<nti; ++iti,ti+=dti) { /* apply exponential decay filter */ for (iw=0,w=fw; iw<nw; ++iw,w+=dw) { scale = exp(w*ti); cb[iw].r = ca[iw].r*scale; cb[iw].i = ca[iw].i*scale; } /* pad with zeros */ for (iw=nw; iw<nwr; ++iw) cb[iw].r = cb[iw].i = 0.0; /* inverse Fourier transform and scale */ pfacc(-1,ntrfft,cb); cfi = cf[iti]; scale = 1.0/ntfft; for (itr=0; itr<ntr; ++itr) { cfi[itr].r = scale*cb[itr].r; cfi[itr].i = scale*cb[itr].i; } } /* free workspace */ free1float(fa); free1complex(ca); free1complex(cb); /* return beam data */ bd = (BeamData*)alloc1(1,sizeof(BeamData)); bd->ntr = ntr; bd->dtr = dtr; bd->ftr = ftr; bd->nti = nti; bd->dti = dti; bd->fti = fti; bd->cf = cf; return bd; } static void setCell (Cells *cells, int jx, int jz) /***************************************************************************** Set a cell by computing its Gaussian beam complex time and amplitude. If the amplitude is non-zero, set neighboring cells recursively. ****************************************************************************** Input: cells pointer to cells jx x index of the cell to set jz z index of the cell to set ****************************************************************************** Notes: To reduce the amount of memory required for recursion, the actual computation of complex time and amplitude is performed by the cellTimeAmp() function, so that no local variables are required in this function, except for the input arguments themselves. *****************************************************************************/ { /* if cell is out of bounds, return */ if (jx<0 || jx>=cells->mx || jz<0 || jz>=cells->mz) return; /* if cell is live, return */ if (cells->cell[jx][jz].live==cells->live) return; /* make cell live */ cells->cell[jx][jz].live = cells->live; /* compute complex time and amplitude. If amplitude is * big enough, recursively set neighboring cells. */ if (cellTimeAmp(cells,jx,jz)) { setCell(cells,jx+1,jz); setCell(cells,jx-1,jz); setCell(cells,jx,jz+1); setCell(cells,jx,jz-1); } } static int cellTimeAmp (Cells *cells, int jx, int jz) /***************************************************************************** Compute complex and time and amplitude for a cell. ****************************************************************************** Input: cells pointer to cells jx x index of the cell to set jz z index of the cell to set Returned: 1 if Gaussian amplitude is significant, 0 otherwise *****************************************************************************/ { int lx=cells->lx,lz=cells->lz; float dx=cells->dx,fx=cells->fx,dz=cells->dz,fz=cells->fz, wmin=cells->wmin,lmin=cells->lmin; Ray *ray=cells->ray; Cell **cell=cells->cell; int irs,kmah; float tmax,xc,zc,t0,x0,z0,x,z,tr,ti,ar,ai, v,q1,p1,q2,p2,e,es,scale,phase,vvmr,vvmi,c,s,ov, px,pz,pzpz,pxpx,pxpz,dvdx,dvdz,dvds,dvdn, wxxr,wxzr,wzzr,wxxi,wxzi,wzzi; RayStep *rs; /* maximum time */ tmax = ray->rs[ray->nrs-1].t; /* cell coordinates */ xc = fx+jx*lx*dx; zc = fz+jz*lz*dz; /* ray step nearest to cell */ irs = nearestRayStep(ray,xc,zc); rs = &(ray->rs[irs]); /* ray time and coordinates */ t0 = rs->t; x0 = rs->x; z0 = rs->z; /* real and imaginary parts of v*v*m = v*v*p/q */ v = rs->v; q1 = rs->q1; p1 = rs->p1; q2 = rs->q2; p2 = rs->p2; e = wmin*lmin*lmin; es = e*e; scale = v*v/(q2*q2+es*q1*q1); vvmr = (p2*q2+es*p1*q1)*scale; vvmi = -e*scale; /* components of slowness vector, px and pz */ c = rs->c; s = rs->s; ov = 1.0/v; px = s*ov; pz = c*ov; pzpz = pz*pz; pxpx = px*px; pxpz = px*pz; /* velocity derivatives along tangent and normal */ dvdx = rs->dvdx; dvdz = rs->dvdz; dvds = s*dvdx+c*dvdz; dvdn = c*dvdx-s*dvdz; /* real part of W matrix */ wxxr = pzpz*vvmr-2.0*pxpz*dvdn-pxpx*dvds; wxzr = (pxpx-pzpz)*dvdn-pxpz*(vvmr+dvds); wzzr = pxpx*vvmr+2.0*pxpz*dvdn-pzpz*dvds; /* imaginary part of W matrix */ wxxi = pzpz*vvmi; wxzi = -pxpz*vvmi; wzzi = pxpx*vvmi; /* vector from ray to cell */ x = xc-x0; z = zc-z0; /* real and imaginary parts of complex time */ tr = t0+(px+0.5*wxxr*x)*x+(pz+wxzr*x+0.5*wzzr*z)*z; ti = 0.5*wxxi*x*x+(wxzi*x+0.5*wzzi*z)*z; /* real and imaginary parts of complex amplitude */ kmah = rs->kmah; scale = pow(es/(q2*q2+es*q1*q1),0.25); phase = 0.5*(atan2(q2,q1*e)+2.0*PI*((kmah+1)/2)); ar = scale*cos(phase); ai = scale*sin(phase); /* set cell parameters */ cell[jx][jz].tr = tr; cell[jx][jz].ti = ti; cell[jx][jz].ar = ar; cell[jx][jz].ai = ai; /* return 1 if Gaussian amplitude is significant, 0 otherwise */ return (wmin*ti>EXPMIN && tr<=tmax)?1:0; } static void accCell (Cells *cells, int jx, int jz) /***************************************************************************** Accumulate the contribution of a Gaussian beam in a cell and its neighbors, recursively. ****************************************************************************** Input: cells pointer to cells jx x index of the cell to fill jz z index of the cell to fill ****************************************************************************** Notes: To reduce the amount of memory required for recursion, the actual accumulation is performed by function cellBeam(), so that no local variables are required in this function, except for the input arguments themselves. *****************************************************************************/ { /* if cell is out of bounds, return */ if (jx<0 || jx>=cells->mx-1 || jz<0 || jz>=cells->mz-1) return; /* if cell is dead, return */ if (cells->cell[jx][jz].dead==cells->dead) return; /* make cell dead */ cells->cell[jx][jz].dead = cells->dead; /* if upper-left corner of cell is not live, return */ if (cells->cell[jx][jz].live!=cells->live) return; /* if remaining three corners of cell are live */ if (cells->cell[jx+1][jz].live==cells->live && cells->cell[jx][jz+1].live==cells->live && cells->cell[jx+1][jz+1].live==cells->live) { /* accumulate beam in cell */ cellBeam(cells,jx,jz); } /* recursively accumulate in neighboring cells */ accCell(cells,jx+1,jz); accCell(cells,jx-1,jz); accCell(cells,jx,jz+1); accCell(cells,jx,jz-1); } static void cellBeam (Cells *cells, int jx, int jz) /***************************************************************************** Accumulate Gaussian beam for one cell. ****************************************************************************** Input: cells pointer to cells jx x index of the cell in which to accumulate beam jz z index of the cell in which to accumulate beam *****************************************************************************/ { int lx=cells->lx,lz=cells->lz,nx=cells->nx,nz=cells->nz; float **g=cells->g; Cell **cell=cells->cell; BeamData *bd=cells->bd; int ntr=bd->ntr,nti=bd->nti; float dtr=bd->dtr,ftr=bd->ftr,dti=bd->dti,fti=bd->fti; complex **cf=bd->cf; int kxlo,kxhi,kzlo,kzhi,kx,kz,itr,iti; float odtr,odti,t00r,t01r,t10r,t11r,t00i,t01i,t10i,t11i, a00r,a01r,a10r,a11r,a00i,a01i,a10i,a11i, tx0r,tx1r,tx0i,tx1i,ax0r,ax1r,ax0i,ax1i, txzr,txzi,axzr,axzi, dtx0r,dtx0i,dtx1r,dtx1i,dax0r,dax0i,dax1r,dax1i, dtxzr,dtxzi,daxzr,daxzi,xdelta,zdelta, trn,tin,trfrac,mtrfrac,tifrac,mtifrac, cf0r,cf0i,cf1r,cf1i,cfr,cfi; complex *cf0,*cf1; /* inverse of time sampling intervals */ odtr = 1.0/dtr; odti = 1.0/dti; /* complex time and amplitude for each corner */ t00r = cell[jx][jz].tr; t01r = cell[jx][jz+1].tr; t10r = cell[jx+1][jz].tr; t11r = cell[jx+1][jz+1].tr; t00i = cell[jx][jz].ti; t01i = cell[jx][jz+1].ti; t10i = cell[jx+1][jz].ti; t11i = cell[jx+1][jz+1].ti; a00r = cell[jx][jz].ar; a01r = cell[jx][jz+1].ar; a10r = cell[jx+1][jz].ar; a11r = cell[jx+1][jz+1].ar; a00i = cell[jx][jz].ai; a01i = cell[jx][jz+1].ai; a10i = cell[jx+1][jz].ai; a11i = cell[jx+1][jz+1].ai; /* x and z samples for cell */ kxlo = jx*lx; kxhi = kxlo+lx; if (kxhi>nx) kxhi = nx; kzlo = jz*lz; kzhi = kzlo+lz; if (kzhi>nz) kzhi = nz; /* fractional increments for linear interpolation */ xdelta = 1.0/lx; zdelta = 1.0/lz; /* increments for times and amplitudes at top and bottom of cell */ dtx0r = (t10r-t00r)*xdelta; dtx1r = (t11r-t01r)*xdelta; dtx0i = (t10i-t00i)*xdelta; dtx1i = (t11i-t01i)*xdelta; dax0r = (a10r-a00r)*xdelta; dax1r = (a11r-a01r)*xdelta; dax0i = (a10i-a00i)*xdelta; dax1i = (a11i-a01i)*xdelta; /* times and amplitudes at top-left and bottom-left of cell */ tx0r = t00r; tx1r = t01r; tx0i = t00i; tx1i = t01i; ax0r = a00r; ax1r = a01r; ax0i = a00i; ax1i = a01i; /* loop over x samples */ for (kx=kxlo; kx<kxhi; ++kx) { /* increments for time and amplitude */ dtxzr = (tx1r-tx0r)*zdelta; dtxzi = (tx1i-tx0i)*zdelta; daxzr = (ax1r-ax0r)*zdelta; daxzi = (ax1i-ax0i)*zdelta; /* time and amplitude at top of cell */ txzr = tx0r; txzi = tx0i; axzr = ax0r; axzi = ax0i; /* loop over z samples */ for (kz=kzlo; kz<kzhi; ++kz) { /* index of imaginary time */ iti = tin = (txzi-fti)*odti; if (iti<0 || iti>=nti-1) continue; /* pointers to left and right imaginary time samples */ cf0 = cf[iti]; cf1 = cf[iti+1]; /* imaginary time linear interpolation coefficients */ tifrac = tin-iti; mtifrac = 1.0-tifrac; /* index of real time */ itr = trn = (txzr-ftr)*odtr; if (itr<0 || itr>=ntr-1) continue; /* real time linear interpolation coefficients */ trfrac = trn-itr; mtrfrac = 1.0-trfrac; /* real and imaginary parts of complex beam data */ cf0r = mtrfrac*cf0[itr].r+trfrac*cf0[itr+1].r; cf1r = mtrfrac*cf1[itr].r+trfrac*cf1[itr+1].r; cfr = mtifrac*cf0r+tifrac*cf1r; cf0i = mtrfrac*cf0[itr].i+trfrac*cf0[itr+1].i; cf1i = mtrfrac*cf1[itr].i+trfrac*cf1[itr+1].i; cfi = mtifrac*cf0i+tifrac*cf1i; /* accumulate beam */ g[kx][kz] += axzr*cfr-axzi*cfi; /* increment time and amplitude */ txzr += dtxzr; txzi += dtxzi; axzr += daxzr; axzi += daxzi; } /* increment times and amplitudes at top and bottom of cell */ tx0r += dtx0r; tx1r += dtx1r; tx0i += dtx0i; tx1i += dtx1i; ax0r += dax0r; ax1r += dax1r; ax0i += dax0i; ax1i += dax1i; } }
{ "pile_set_name": "Github" }
package com.paradigmadigital.karchitect import junit.framework.Assert.assertEquals import okhttp3.OkHttpClient import okhttp3.mockwebserver.MockResponse import okhttp3.mockwebserver.MockWebServer import org.apache.commons.io.FileUtils import org.junit.After import org.junit.Before import java.io.File import java.io.IOException open class MockWebServerTestBase { companion object { private val FILE_ENCODING = "UTF-8" } private lateinit var server: MockWebServer protected val endpoint: String get() { return server.url("/").toString() } protected val httpClient: OkHttpClient get() = OkHttpClient.Builder().build() @Before @Throws(Exception::class) open fun setUp() { this.server = MockWebServer() this.server.start() } @After @Throws(Exception::class) fun tearDown() { server.shutdown() } @Throws(IOException::class) @JvmOverloads protected fun enqueueMockResponse(code: Int = 200, fileName: String? = null) { val mockResponse = MockResponse() val fileContent = getContentFromFile(fileName) mockResponse.setResponseCode(code) mockResponse.setBody(fileContent) server.enqueue(mockResponse) } @Throws(InterruptedException::class) protected fun assertGetRequestSentTo(url: String) { val request = server.takeRequest() assertEquals(url, request.path) assertEquals("GET", request.method) } @Throws(IOException::class) protected fun getContentFromFile(name: String?): String { var fileName: String? = name ?: return "" fileName = javaClass.getResource("/" + fileName).file val file = File(fileName!!) val lines = FileUtils.readLines(file, FILE_ENCODING) val stringBuilder = StringBuilder() for (line in lines) { stringBuilder.append(line) } return stringBuilder.toString() } }
{ "pile_set_name": "Github" }
<?xml version="1.0" ?> <annotation> <folder>widerface</folder> <filename>31--Waiter_Waitress_31_Waiter_Waitress_Waiter_Waitress_31_283.jpg</filename> <source> <database>wider face Database</database> <annotation>PASCAL VOC2007</annotation> <image>flickr</image> <flickrid>-1</flickrid> </source> <owner> <flickrid>yanyu</flickrid> <name>yanyu</name> </owner> <size> <width>1024</width> <height>1024</height> <depth>3</depth> </size> <segmented>0</segmented> <object> <name>face</name> <pose>Unspecified</pose> <truncated>1</truncated> <difficult>0</difficult> <bndbox> <xmin>215</xmin> <ymin>45</ymin> <xmax>301</xmax> <ymax>157</ymax> </bndbox> <lm> <x1>237.875</x1> <y1>85.781</y1> <x2>282.031</x2> <y2>83.679</y2> <x3>265.21</x3> <y3>109.612</y3> <x4>242.08</x4> <y4>125.031</y4> <x5>279.929</x5> <y5>122.929</y5> <visible>0</visible> <blur>0.79</blur> </lm> <has_lm>1</has_lm> </object> <object> <name>face</name> <pose>Unspecified</pose> <truncated>1</truncated> <difficult>0</difficult> <bndbox> <xmin>800</xmin> <ymin>58</ymin> <xmax>838</xmax> <ymax>164</ymax> </bndbox> <lm> <x1>835.129</x1> <y1>95.866</y1> <x2>829.808</x2> <y2>93.205</y2> <x3>837.79</x3> <y3>127.795</y3> <x4>822.491</x4> <y4>137.107</y4> <x5>818.5</x5> <y5>135.112</y5> <visible>1</visible> <blur>0.68</blur> </lm> <has_lm>1</has_lm> </object> </annotation>
{ "pile_set_name": "Github" }
/* Copyright (C) 2014 Fredrik Johansson This file is part of Arb. Arb is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. See <http://www.gnu.org/licenses/>. */ #include "acb_hypgeom.h" int _mag_gt_norm_ui(const mag_t a, const mag_t b, const mag_t c, ulong n); static void _accuracy_regression_test(const acb_t s, const acb_t z, int regularized, slong prec, slong issue, slong accuracy) { acb_t g; acb_init(g); acb_hypgeom_gamma_upper(g, s, z, regularized, prec); if (acb_rel_accuracy_bits(g) < accuracy) { flint_printf("FAIL: accuracy regression in issue #%ld\n\n", issue); flint_printf("prec = %d\n\n", prec); flint_printf("regularized = %d\n\n", regularized); flint_printf("s = "); acb_printd(s, 30); flint_printf("\n\n"); flint_printf("z = "); acb_printd(z, 30); flint_printf("\n\n"); flint_printf("g = "); acb_printd(g, 30); flint_printf("\n\n"); flint_abort(); } acb_clear(g); } int main() { slong iter; flint_rand_t state; flint_printf("gamma_upper...."); fflush(stdout); flint_randinit(state); /* special accuracy test -- see nemo #38 */ for (iter = 0; iter < 1000 * arb_test_multiplier(); iter++) { acb_t a, z, res; slong prec, goal; int regularized; acb_init(a); acb_init(z); acb_init(res); acb_set_si(a, n_randint(state, 100) - 50); do { acb_set_si(z, n_randint(state, 100) - 50); } while (acb_is_zero(z)); regularized = n_randint(state, 3); goal = 2 + n_randint(state, 4000); for (prec = 2 + n_randint(state, 1000); ; prec *= 2) { acb_hypgeom_gamma_upper(res, a, z, regularized, prec); if (acb_rel_accuracy_bits(res) > goal) break; if (prec > 10000) { printf("FAIL (convergence)\n"); flint_printf("regularized = %d\n\n", regularized); flint_printf("a = "); acb_printd(a, 30); flint_printf("\n\n"); flint_printf("z = "); acb_printd(z, 30); flint_printf("\n\n"); flint_printf("res = "); acb_printd(res, 30); flint_printf("\n\n"); flint_abort(); } } acb_clear(a); acb_clear(z); acb_clear(res); } for (iter = 0; iter < 2000 * arb_test_multiplier(); iter++) { acb_t a0, a1, b, z, w0, w1, t, u; slong prec0, prec1; int regularized; acb_init(a0); acb_init(a1); acb_init(b); acb_init(z); acb_init(w0); acb_init(w1); acb_init(t); acb_init(u); regularized = n_randint(state, 3); prec0 = 2 + n_randint(state, 1000); prec1 = 2 + n_randint(state, 1000); acb_randtest_param(a0, state, 1 + n_randint(state, 1000), 1 + n_randint(state, 100)); acb_randtest(z, state, 1 + n_randint(state, 1000), 1 + n_randint(state, 100)); acb_randtest(w0, state, 1 + n_randint(state, 1000), 1 + n_randint(state, 100)); acb_randtest(w1, state, 1 + n_randint(state, 1000), 1 + n_randint(state, 100)); acb_add_ui(a1, a0, 1, prec0); switch (n_randint(state, 4)) { case 0: acb_hypgeom_gamma_upper_asymp(w0, a0, z, regularized, prec0); break; case 1: acb_hypgeom_gamma_upper_1f1a(w0, a0, z, regularized, prec0); break; case 2: acb_hypgeom_gamma_upper_1f1b(w0, a0, z, regularized, prec0); break; default: acb_hypgeom_gamma_upper(w0, a0, z, regularized, prec0); } switch (n_randint(state, 4)) { case 0: acb_hypgeom_gamma_upper_asymp(w1, a0, z, regularized, prec1); break; case 1: acb_hypgeom_gamma_upper_1f1a(w1, a0, z, regularized, prec1); break; case 2: acb_hypgeom_gamma_upper_1f1b(w1, a0, z, regularized, prec1); break; default: acb_hypgeom_gamma_upper(w1, a0, z, regularized, prec1); } if (!acb_overlaps(w0, w1)) { flint_printf("FAIL: consistency\n\n"); flint_printf("a0 = "); acb_printd(a0, 30); flint_printf("\n\n"); flint_printf("z = "); acb_printd(z, 30); flint_printf("\n\n"); flint_printf("w0 = "); acb_printd(w0, 30); flint_printf("\n\n"); flint_printf("w1 = "); acb_printd(w1, 30); flint_printf("\n\n"); flint_abort(); } switch (n_randint(state, 4)) { case 0: acb_hypgeom_gamma_upper_asymp(w1, a1, z, regularized, prec1); break; case 1: acb_hypgeom_gamma_upper_1f1a(w1, a1, z, regularized, prec1); break; case 2: acb_hypgeom_gamma_upper_1f1b(w1, a1, z, regularized, prec1); break; default: acb_hypgeom_gamma_upper(w1, a1, z, regularized, prec1); } if (regularized == 2) { /* a R(a,z) + exp(-z) - z R(a+1,z) = 0 */ acb_one(t); acb_neg(u, z); acb_exp(u, u, prec0); acb_mul(t, t, u, prec0); acb_mul(b, w1, z, prec0); acb_addmul(t, a0, w0, prec0); acb_sub(t, t, b, prec0); } else if (regularized == 1) { /* Q(a,z) + exp(-z) z^a / Gamma(a+1) - Q(a+1,z) = 0 */ /* http://dlmf.nist.gov/8.8.E6 */ acb_pow(t, z, a0, prec0); acb_rgamma(u, a1, prec0); acb_mul(t, t, u, prec0); acb_neg(u, z); acb_exp(u, u, prec0); acb_mul(t, t, u, prec0); acb_add(t, t, w0, prec0); acb_sub(t, t, w1, prec0); } else { /* a Gamma(a,z) + exp(-z) z^a - Gamma(a+1,z) = 0 */ /* http://dlmf.nist.gov/8.8.E2 */ acb_pow(t, z, a0, prec0); acb_neg(u, z); acb_exp(u, u, prec0); acb_mul(t, t, u, prec0); acb_addmul(t, a0, w0, prec0); acb_sub(t, t, w1, prec0); } if (!acb_contains_zero(t)) { flint_printf("FAIL: contiguous relation\n\n"); flint_printf("regularized = %d\n\n", regularized); flint_printf("a0 = "); acb_printd(a0, 30); flint_printf("\n\n"); flint_printf("z = "); acb_printd(z, 30); flint_printf("\n\n"); flint_printf("w0 = "); acb_printd(w0, 30); flint_printf("\n\n"); flint_printf("w1 = "); acb_printd(w1, 30); flint_printf("\n\n"); flint_printf("t = "); acb_printd(t, 30); flint_printf("\n\n"); flint_abort(); } acb_clear(a0); acb_clear(a1); acb_clear(b); acb_clear(z); acb_clear(w0); acb_clear(w1); acb_clear(t); acb_clear(u); } /* Accuracy regression tests. */ { acb_t s, z; slong prec, issue, accuracy; acb_init(s); acb_init(z); issue = 166; prec = 165; accuracy = 100; acb_zero(s); acb_set_si(z, 110); _accuracy_regression_test(s, z, 2, prec, issue, accuracy); issue = 276; prec = 300; accuracy = 100; acb_set_ui(s, 357); acb_set_ui(z, 356); _accuracy_regression_test(s, z, 0, prec, issue, accuracy); arb_set_str(acb_realref(s), "356.123", prec); arb_set_str(acb_realref(z), "356.456", prec); _accuracy_regression_test(s, z, 0, prec, issue, accuracy); arb_set_str(acb_realref(s), "357.123", prec); arb_set_str(acb_realref(z), "356.456", prec); _accuracy_regression_test(s, z, 0, prec, issue, accuracy); arb_set_str(acb_realref(s), "357.456", prec); arb_set_str(acb_realref(z), "356.123", prec); _accuracy_regression_test(s, z, 0, prec, issue, accuracy); acb_clear(s); acb_clear(z); } /* Norm comparison tests (compare a^n to b^n + c^n). */ for (iter = 0; iter < 1000 * arb_test_multiplier(); iter++) { slong prec; ulong n; arb_t a, b, c, u, v, w, rhs; arb_init(a); arb_init(b); arb_init(c); arb_init(u); arb_init(v); arb_init(w); arb_init(rhs); prec = n_randint(state, 1000) + 1; while (!arb_is_positive(a)) { arb_randtest(a, state, n_randint(state, 1000)+1, n_randint(state, 100)+1); } while (!arb_is_positive(b)) { arb_randtest(b, state, n_randint(state, 1000)+1, n_randint(state, 100)+1); } while (!arb_is_positive(c)) { arb_randtest(c, state, n_randint(state, 1000)+1, n_randint(state, 100)+1); } if (n_randint(state, 20)) arb_zero(a); if (n_randint(state, 20)) arb_zero(b); if (n_randint(state, 20)) arb_zero(c); if (n_randint(state, 20)) arb_set(b, a); if (n_randint(state, 20)) arb_set(c, b); if (n_randint(state, 20)) arb_set(c, a); n = n_randint(state, 10); if (!n) n = WORD_MAX; if (n == WORD_MAX) { arb_set(u, a); arb_max(rhs, b, c, prec); } else { arb_pow_ui(u, a, n, prec); arb_pow_ui(v, b, n, prec); arb_pow_ui(w, c, n, prec); arb_add(rhs, v, w, prec); } if (arb_lt(u, rhs) || (arb_is_exact(u) && arb_equal(u, rhs))) { mag_t ma, mb, mc; mag_init(ma); mag_init(mb); mag_init(mc); arb_get_mag_lower(ma, a); arb_get_mag(mb, b); arb_get_mag(mc, c); if (_mag_gt_norm_ui(ma, mb, mc, n)) { flint_printf("FAIL: _mag_gt_norm_ui\n\n"); flint_printf("a = "); arb_printd(a, 30); flint_printf("\n\n"); flint_printf("b = "); arb_printd(b, 30); flint_printf("\n\n"); flint_printf("c = "); arb_printd(c, 30); flint_printf("\n\n"); flint_printf("n = %ld\n\n", n); flint_abort(); } mag_clear(ma); mag_clear(mb); mag_clear(mc); } arb_clear(a); arb_clear(b); arb_clear(c); arb_clear(u); arb_clear(v); arb_clear(w); arb_clear(rhs); } flint_randclear(state); flint_cleanup(); flint_printf("PASS\n"); return EXIT_SUCCESS; }
{ "pile_set_name": "Github" }
set(src tcp.c tcp_conn.c tcp_config.c) FLB_PLUGIN(in_tcp "${src}" "")
{ "pile_set_name": "Github" }
data = ( '[?]', # 0x00 '[?]', # 0x01 '[?]', # 0x02 '[?]', # 0x03 '[?]', # 0x04 '[?]', # 0x05 '[?]', # 0x06 '[?]', # 0x07 '[?]', # 0x08 '[?]', # 0x09 '[?]', # 0x0a '[?]', # 0x0b '[?]', # 0x0c '[?]', # 0x0d '[?]', # 0x0e '[?]', # 0x0f '[?]', # 0x10 '[?]', # 0x11 '[?]', # 0x12 '[?]', # 0x13 '[?]', # 0x14 '[?]', # 0x15 '[?]', # 0x16 '[?]', # 0x17 '[?]', # 0x18 '[?]', # 0x19 '[?]', # 0x1a '[?]', # 0x1b '[?]', # 0x1c '[?]', # 0x1d '[?]', # 0x1e '[?]', # 0x1f '[?]', # 0x20 '[?]', # 0x21 '[?]', # 0x22 '[?]', # 0x23 '[?]', # 0x24 '[?]', # 0x25 '[?]', # 0x26 '[?]', # 0x27 '[?]', # 0x28 '[?]', # 0x29 '[?]', # 0x2a '[?]', # 0x2b '[?]', # 0x2c '[?]', # 0x2d '[?]', # 0x2e '[?]', # 0x2f '[?]', # 0x30 'A', # 0x31 'B', # 0x32 'G', # 0x33 'D', # 0x34 'E', # 0x35 'Z', # 0x36 'E', # 0x37 'E', # 0x38 'T`', # 0x39 'Zh', # 0x3a 'I', # 0x3b 'L', # 0x3c 'Kh', # 0x3d 'Ts', # 0x3e 'K', # 0x3f 'H', # 0x40 'Dz', # 0x41 'Gh', # 0x42 'Ch', # 0x43 'M', # 0x44 'Y', # 0x45 'N', # 0x46 'Sh', # 0x47 'O', # 0x48 'Ch`', # 0x49 'P', # 0x4a 'J', # 0x4b 'Rh', # 0x4c 'S', # 0x4d 'V', # 0x4e 'T', # 0x4f 'R', # 0x50 'Ts`', # 0x51 'W', # 0x52 'P`', # 0x53 'K`', # 0x54 'O', # 0x55 'F', # 0x56 '[?]', # 0x57 '[?]', # 0x58 '<', # 0x59 '\'', # 0x5a '/', # 0x5b '!', # 0x5c ',', # 0x5d '?', # 0x5e '.', # 0x5f '[?]', # 0x60 'a', # 0x61 'b', # 0x62 'g', # 0x63 'd', # 0x64 'e', # 0x65 'z', # 0x66 'e', # 0x67 'e', # 0x68 't`', # 0x69 'zh', # 0x6a 'i', # 0x6b 'l', # 0x6c 'kh', # 0x6d 'ts', # 0x6e 'k', # 0x6f 'h', # 0x70 'dz', # 0x71 'gh', # 0x72 'ch', # 0x73 'm', # 0x74 'y', # 0x75 'n', # 0x76 'sh', # 0x77 'o', # 0x78 'ch`', # 0x79 'p', # 0x7a 'j', # 0x7b 'rh', # 0x7c 's', # 0x7d 'v', # 0x7e 't', # 0x7f 'r', # 0x80 'ts`', # 0x81 'w', # 0x82 'p`', # 0x83 'k`', # 0x84 'o', # 0x85 'f', # 0x86 'ew', # 0x87 '[?]', # 0x88 ':', # 0x89 '-', # 0x8a '[?]', # 0x8b '[?]', # 0x8c '[?]', # 0x8d '[?]', # 0x8e '[?]', # 0x8f '[?]', # 0x90 '', # 0x91 '', # 0x92 '', # 0x93 '', # 0x94 '', # 0x95 '', # 0x96 '', # 0x97 '', # 0x98 '', # 0x99 '', # 0x9a '', # 0x9b '', # 0x9c '', # 0x9d '', # 0x9e '', # 0x9f '', # 0xa0 '', # 0xa1 '[?]', # 0xa2 '', # 0xa3 '', # 0xa4 '', # 0xa5 '', # 0xa6 '', # 0xa7 '', # 0xa8 '', # 0xa9 '', # 0xaa '', # 0xab '', # 0xac '', # 0xad '', # 0xae '', # 0xaf '@', # 0xb0 'e', # 0xb1 'a', # 0xb2 'o', # 0xb3 'i', # 0xb4 'e', # 0xb5 'e', # 0xb6 'a', # 0xb7 'a', # 0xb8 'o', # 0xb9 '[?]', # 0xba 'u', # 0xbb '\'', # 0xbc '', # 0xbd '', # 0xbe '', # 0xbf '|', # 0xc0 '', # 0xc1 '', # 0xc2 ':', # 0xc3 '', # 0xc4 '[?]', # 0xc5 '[?]', # 0xc6 '[?]', # 0xc7 '[?]', # 0xc8 '[?]', # 0xc9 '[?]', # 0xca '[?]', # 0xcb '[?]', # 0xcc '[?]', # 0xcd '[?]', # 0xce '[?]', # 0xcf '', # 0xd0 'b', # 0xd1 'g', # 0xd2 'd', # 0xd3 'h', # 0xd4 'v', # 0xd5 'z', # 0xd6 'kh', # 0xd7 't', # 0xd8 'y', # 0xd9 'k', # 0xda 'k', # 0xdb 'l', # 0xdc 'm', # 0xdd 'm', # 0xde 'n', # 0xdf 'n', # 0xe0 's', # 0xe1 '`', # 0xe2 'p', # 0xe3 'p', # 0xe4 'ts', # 0xe5 'ts', # 0xe6 'q', # 0xe7 'r', # 0xe8 'sh', # 0xe9 't', # 0xea '[?]', # 0xeb '[?]', # 0xec '[?]', # 0xed '[?]', # 0xee '[?]', # 0xef 'V', # 0xf0 'oy', # 0xf1 'i', # 0xf2 '\'', # 0xf3 '"', # 0xf4 '[?]', # 0xf5 '[?]', # 0xf6 '[?]', # 0xf7 '[?]', # 0xf8 '[?]', # 0xf9 '[?]', # 0xfa '[?]', # 0xfb '[?]', # 0xfc '[?]', # 0xfd '[?]', # 0xfe )
{ "pile_set_name": "Github" }
package com.prisma.api.filters.nonEmbedded import com.prisma.api.ApiSpecBase import com.prisma.shared.models.ConnectorCapability import com.prisma.shared.models.ConnectorCapability.{JoinRelationLinksCapability, Prisma2Capability} import com.prisma.shared.schema_dsl.SchemaDsl import org.scalatest._ class RelationIsNullSpec extends FlatSpec with Matchers with ApiSpecBase { override def runOnlyForCapabilities = Set(JoinRelationLinksCapability) override def doNotRunForCapabilities = Set(Prisma2Capability) val project = SchemaDsl.fromStringV11() { """ |type Message { | id: ID! @id | image: Image @relation(link: INLINE, name: "MessageImageRelation") | messageName: String |} | |type Image { | id: ID! @id | message: Message @relation(name: "MessageImageRelation") | imageName: String |} """ } override protected def beforeAll(): Unit = { super.beforeAll() database.setup(project) } override def beforeEach() = { super.beforeEach() database.truncateProjectTables(project) // add data server.query( """mutation {createMessage( | data: { | messageName: "message 1", | } |){messageName}}""", project = project ) server.query( """mutation {createMessage( | data: { | messageName: "message 2", | image:{create:{imageName:"image 1"}} | } |){messageName}}""", project = project ) server.query( """mutation {createImage( | data: { | imageName: "image 2" | } |){imageName}}""", project = project ) } "Filtering on whether a relation is null" should "work" in { server .query( query = """query { | images(where: { message: null }) { | imageName | } |}""", project = project ) .toString should be("""{"data":{"images":[{"imageName":"image 2"}]}}""") } "Filtering on whether a relation is null" should "work 2" in { server .query( query = """query { | messages(where: { image: null }) { | messageName | } |}""", project = project ) .toString should be("""{"data":{"messages":[{"messageName":"message 1"}]}}""") } }
{ "pile_set_name": "Github" }
#pragma once #include "ofxPDSP.h" class SineBleep : public pdsp::Patchable{ public: SineBleep() { patch(); } SineBleep(const SineBleep & other) { patch(); } void patch() { //add inputs / outputs with these methods addModuleInput("trig", env.in_trig()); // arguments are tag and the Unit in/out to link to that tag addModuleInput("pitch", osc.in_pitch()); addModuleOutput("signal", amp ); // if in/out is not selected default in/out is used //patching env.set(0.0f, 100.0f, 350.0f) * 0.25f >> amp.in_mod(); env * 0.10f >> osc.in_fb() >> amp; } private: pdsp::Amp amp; pdsp::FMOperator osc; pdsp::AHR env; };
{ "pile_set_name": "Github" }
import PropTypes from 'prop-types' import React from 'react' import ReactDOM from 'react-dom' import config from './config' import { timeoutsShape } from './utils/PropTypes' import TransitionGroupContext from './TransitionGroupContext' export const UNMOUNTED = 'unmounted' export const EXITED = 'exited' export const ENTERING = 'entering' export const ENTERED = 'entered' export const EXITING = 'exiting' /** * The Transition component lets you describe a transition from one component * state to another _over time_ with a simple declarative API. Most commonly * it's used to animate the mounting and unmounting of a component, but can also * be used to describe in-place transition states as well. * * --- * * **Note**: `Transition` is a platform-agnostic base component. If you're using * transitions in CSS, you'll probably want to use * [`CSSTransition`](https://reactcommunity.org/react-transition-group/css-transition) * instead. It inherits all the features of `Transition`, but contains * additional features necessary to play nice with CSS transitions (hence the * name of the component). * * --- * * By default the `Transition` component does not alter the behavior of the * component it renders, it only tracks "enter" and "exit" states for the * components. It's up to you to give meaning and effect to those states. For * example we can add styles to a component when it enters or exits: * * ```jsx * import { Transition } from 'react-transition-group'; * * const duration = 300; * * const defaultStyle = { * transition: `opacity ${duration}ms ease-in-out`, * opacity: 0, * } * * const transitionStyles = { * entering: { opacity: 1 }, * entered: { opacity: 1 }, * exiting: { opacity: 0 }, * exited: { opacity: 0 }, * }; * * const Fade = ({ in: inProp }) => ( * <Transition in={inProp} timeout={duration}> * {state => ( * <div style={{ * ...defaultStyle, * ...transitionStyles[state] * }}> * I'm a fade Transition! * </div> * )} * </Transition> * ); * ``` * * There are 4 main states a Transition can be in: * - `'entering'` * - `'entered'` * - `'exiting'` * - `'exited'` * * Transition state is toggled via the `in` prop. When `true` the component * begins the "Enter" stage. During this stage, the component will shift from * its current transition state, to `'entering'` for the duration of the * transition and then to the `'entered'` stage once it's complete. Let's take * the following example (we'll use the * [useState](https://reactjs.org/docs/hooks-reference.html#usestate) hook): * * ```jsx * function App() { * const [inProp, setInProp] = useState(false); * return ( * <div> * <Transition in={inProp} timeout={500}> * {state => ( * // ... * )} * </Transition> * <button onClick={() => setInProp(true)}> * Click to Enter * </button> * </div> * ); * } * ``` * * When the button is clicked the component will shift to the `'entering'` state * and stay there for 500ms (the value of `timeout`) before it finally switches * to `'entered'`. * * When `in` is `false` the same thing happens except the state moves from * `'exiting'` to `'exited'`. */ class Transition extends React.Component { static contextType = TransitionGroupContext constructor(props, context) { super(props, context) let parentGroup = context // In the context of a TransitionGroup all enters are really appears let appear = parentGroup && !parentGroup.isMounting ? props.enter : props.appear let initialStatus this.appearStatus = null if (props.in) { if (appear) { initialStatus = EXITED this.appearStatus = ENTERING } else { initialStatus = ENTERED } } else { if (props.unmountOnExit || props.mountOnEnter) { initialStatus = UNMOUNTED } else { initialStatus = EXITED } } this.state = { status: initialStatus } this.nextCallback = null } static getDerivedStateFromProps({ in: nextIn }, prevState) { if (nextIn && prevState.status === UNMOUNTED) { return { status: EXITED } } return null } // getSnapshotBeforeUpdate(prevProps) { // let nextStatus = null // if (prevProps !== this.props) { // const { status } = this.state // if (this.props.in) { // if (status !== ENTERING && status !== ENTERED) { // nextStatus = ENTERING // } // } else { // if (status === ENTERING || status === ENTERED) { // nextStatus = EXITING // } // } // } // return { nextStatus } // } componentDidMount() { this.updateStatus(true, this.appearStatus) } componentDidUpdate(prevProps) { let nextStatus = null if (prevProps !== this.props) { const { status } = this.state if (this.props.in) { if (status !== ENTERING && status !== ENTERED) { nextStatus = ENTERING } } else { if (status === ENTERING || status === ENTERED) { nextStatus = EXITING } } } this.updateStatus(false, nextStatus) } componentWillUnmount() { this.cancelNextCallback() } getTimeouts() { const { timeout } = this.props let exit, enter, appear exit = enter = appear = timeout if (timeout != null && typeof timeout !== 'number') { exit = timeout.exit enter = timeout.enter // TODO: remove fallback for next major appear = timeout.appear !== undefined ? timeout.appear : enter } return { exit, enter, appear } } updateStatus(mounting = false, nextStatus) { if (nextStatus !== null) { // nextStatus will always be ENTERING or EXITING. this.cancelNextCallback() if (nextStatus === ENTERING) { this.performEnter(mounting) } else { this.performExit() } } else if (this.props.unmountOnExit && this.state.status === EXITED) { this.setState({ status: UNMOUNTED }) } } performEnter(mounting) { const { enter } = this.props const appearing = this.context ? this.context.isMounting : mounting const [maybeNode, maybeAppearing] = this.props.nodeRef ? [appearing] : [ReactDOM.findDOMNode(this), appearing] const timeouts = this.getTimeouts() const enterTimeout = appearing ? timeouts.appear : timeouts.enter // no enter animation skip right to ENTERED // if we are mounting and running this it means appear _must_ be set if ((!mounting && !enter) || config.disabled) { this.safeSetState({ status: ENTERED }, () => { this.props.onEntered(maybeNode) }) return } this.props.onEnter(maybeNode, maybeAppearing) this.safeSetState({ status: ENTERING }, () => { this.props.onEntering(maybeNode, maybeAppearing) this.onTransitionEnd(enterTimeout, () => { this.safeSetState({ status: ENTERED }, () => { this.props.onEntered(maybeNode, maybeAppearing) }) }) }) } performExit() { const { exit } = this.props const timeouts = this.getTimeouts() const maybeNode = this.props.nodeRef ? undefined : ReactDOM.findDOMNode(this) // no exit animation skip right to EXITED if (!exit || config.disabled) { this.safeSetState({ status: EXITED }, () => { this.props.onExited(maybeNode) }) return } this.props.onExit(maybeNode) this.safeSetState({ status: EXITING }, () => { this.props.onExiting(maybeNode) this.onTransitionEnd(timeouts.exit, () => { this.safeSetState({ status: EXITED }, () => { this.props.onExited(maybeNode) }) }) }) } cancelNextCallback() { if (this.nextCallback !== null) { this.nextCallback.cancel() this.nextCallback = null } } safeSetState(nextState, callback) { // This shouldn't be necessary, but there are weird race conditions with // setState callbacks and unmounting in testing, so always make sure that // we can cancel any pending setState callbacks after we unmount. callback = this.setNextCallback(callback) this.setState(nextState, callback) } setNextCallback(callback) { let active = true this.nextCallback = event => { if (active) { active = false this.nextCallback = null callback(event) } } this.nextCallback.cancel = () => { active = false } return this.nextCallback } onTransitionEnd(timeout, handler) { this.setNextCallback(handler) const node = this.props.nodeRef ? this.props.nodeRef.current : ReactDOM.findDOMNode(this) const doesNotHaveTimeoutOrListener = timeout == null && !this.props.addEndListener if (!node || doesNotHaveTimeoutOrListener) { setTimeout(this.nextCallback, 0) return } if (this.props.addEndListener) { const [maybeNode, maybeNextCallback] = this.props.nodeRef ? [this.nextCallback] : [node, this.nextCallback] this.props.addEndListener(maybeNode, maybeNextCallback) } if (timeout != null) { setTimeout(this.nextCallback, timeout) } } render() { const status = this.state.status if (status === UNMOUNTED) { return null } const { children, // filter props for `Transition` in: _in, mountOnEnter: _mountOnEnter, unmountOnExit: _unmountOnExit, appear: _appear, enter: _enter, exit: _exit, timeout: _timeout, addEndListener: _addEndListener, onEnter: _onEnter, onEntering: _onEntering, onEntered: _onEntered, onExit: _onExit, onExiting: _onExiting, onExited: _onExited, nodeRef: _nodeRef, ...childProps } = this.props return ( // allows for nested Transitions <TransitionGroupContext.Provider value={null}> {typeof children === 'function' ? children(status, childProps) : React.cloneElement(React.Children.only(children), childProps)} </TransitionGroupContext.Provider> ) } } Transition.propTypes = { /** * A React reference to DOM element that need to transition: * https://stackoverflow.com/a/51127130/4671932 * * - When `nodeRef` prop is used, `node` is not passed to callback functions * (e.g. `onEnter`) because user already has direct access to the node. * - When changing `key` prop of `Transition` in a `TransitionGroup` a new * `nodeRef` need to be provided to `Transition` with changed `key` prop * (see * [test/CSSTransition-test.js](https://github.com/reactjs/react-transition-group/blob/13435f897b3ab71f6e19d724f145596f5910581c/test/CSSTransition-test.js#L362-L437)). */ nodeRef: PropTypes.shape({ current: typeof Element === 'undefined' ? PropTypes.any : PropTypes.instanceOf(Element) }), /** * A `function` child can be used instead of a React element. This function is * called with the current transition status (`'entering'`, `'entered'`, * `'exiting'`, `'exited'`), which can be used to apply context * specific props to a component. * * ```jsx * <Transition in={this.state.in} timeout={150}> * {state => ( * <MyComponent className={`fade fade-${state}`} /> * )} * </Transition> * ``` */ children: PropTypes.oneOfType([ PropTypes.func.isRequired, PropTypes.element.isRequired, ]).isRequired, /** * Show the component; triggers the enter or exit states */ in: PropTypes.bool, /** * By default the child component is mounted immediately along with * the parent `Transition` component. If you want to "lazy mount" the component on the * first `in={true}` you can set `mountOnEnter`. After the first enter transition the component will stay * mounted, even on "exited", unless you also specify `unmountOnExit`. */ mountOnEnter: PropTypes.bool, /** * By default the child component stays mounted after it reaches the `'exited'` state. * Set `unmountOnExit` if you'd prefer to unmount the component after it finishes exiting. */ unmountOnExit: PropTypes.bool, /** * By default the child component does not perform the enter transition when * it first mounts, regardless of the value of `in`. If you want this * behavior, set both `appear` and `in` to `true`. * * > **Note**: there are no special appear states like `appearing`/`appeared`, this prop * > only adds an additional enter transition. However, in the * > `<CSSTransition>` component that first enter transition does result in * > additional `.appear-*` classes, that way you can choose to style it * > differently. */ appear: PropTypes.bool, /** * Enable or disable enter transitions. */ enter: PropTypes.bool, /** * Enable or disable exit transitions. */ exit: PropTypes.bool, /** * The duration of the transition, in milliseconds. * Required unless `addEndListener` is provided. * * You may specify a single timeout for all transitions: * * ```jsx * timeout={500} * ``` * * or individually: * * ```jsx * timeout={{ * appear: 500, * enter: 300, * exit: 500, * }} * ``` * * - `appear` defaults to the value of `enter` * - `enter` defaults to `0` * - `exit` defaults to `0` * * @type {number | { enter?: number, exit?: number, appear?: number }} */ timeout: (props, ...args) => { let pt = timeoutsShape if (!props.addEndListener) pt = pt.isRequired return pt(props, ...args) }, /** * Add a custom transition end trigger. Called with the transitioning * DOM node and a `done` callback. Allows for more fine grained transition end * logic. Timeouts are still used as a fallback if provided. * * **Note**: when `nodeRef` prop is passed, `node` is not passed. * * ```jsx * addEndListener={(node, done) => { * // use the css transitionend event to mark the finish of a transition * node.addEventListener('transitionend', done, false); * }} * ``` */ addEndListener: PropTypes.func, /** * Callback fired before the "entering" status is applied. An extra parameter * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount * * **Note**: when `nodeRef` prop is passed, `node` is not passed. * * @type Function(node: HtmlElement, isAppearing: bool) -> void */ onEnter: PropTypes.func, /** * Callback fired after the "entering" status is applied. An extra parameter * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount * * **Note**: when `nodeRef` prop is passed, `node` is not passed. * * @type Function(node: HtmlElement, isAppearing: bool) */ onEntering: PropTypes.func, /** * Callback fired after the "entered" status is applied. An extra parameter * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount * * **Note**: when `nodeRef` prop is passed, `node` is not passed. * * @type Function(node: HtmlElement, isAppearing: bool) -> void */ onEntered: PropTypes.func, /** * Callback fired before the "exiting" status is applied. * * **Note**: when `nodeRef` prop is passed, `node` is not passed. * * @type Function(node: HtmlElement) -> void */ onExit: PropTypes.func, /** * Callback fired after the "exiting" status is applied. * * **Note**: when `nodeRef` prop is passed, `node` is not passed. * * @type Function(node: HtmlElement) -> void */ onExiting: PropTypes.func, /** * Callback fired after the "exited" status is applied. * * **Note**: when `nodeRef` prop is passed, `node` is not passed * * @type Function(node: HtmlElement) -> void */ onExited: PropTypes.func, } // Name the function so it is clearer in the documentation function noop() {} Transition.defaultProps = { in: false, mountOnEnter: false, unmountOnExit: false, appear: false, enter: true, exit: true, onEnter: noop, onEntering: noop, onEntered: noop, onExit: noop, onExiting: noop, onExited: noop, } Transition.UNMOUNTED = UNMOUNTED Transition.EXITED = EXITED Transition.ENTERING = ENTERING Transition.ENTERED = ENTERED Transition.EXITING = EXITING export default Transition
{ "pile_set_name": "Github" }
{ "name" : "albino", "category" : "petpetricub", "type" : "body", "frames" : { "body" : "albino.png" } }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8" standalone="no" ?> <ruleset name="PMD.rul" xmlns="http://pmd.sourceforge.net/ruleset/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 http://pmd.sourceforge.net/ruleset_2_0_0.xsd"> <description>This ruleset was created from PMD.rul</description> <rule ref="rulesets/java/basic.xml"> <exclude name="AvoidBranchingStatementAsLastInLoop"/> <exclude name="CollapsibleIfStatements"/> <exclude name="AvoidThreadGroup"/> </rule> <rule ref="rulesets/java/braces.xml"/> <rule ref="rulesets/java/strings.xml"> <!-- TODO: This warns about annotations, apparently fixed in a later version. --> <exclude name="AvoidDuplicateLiterals"/> </rule> <rule ref="rulesets/java/unusedcode.xml"> <exclude name="UnusedPrivateField"/> <exclude name="UnusedPrivateMethod"/> </rule> <rule ref="rulesets/java/design.xml"> <exclude name="ConfusingTernary"/> <exclude name="EmptyMethodInAbstractClassShouldBeAbstract"/> <exclude name="AvoidSynchronizedAtMethodLevel"/> <exclude name="SingularField"/> <!-- This check breaks on double checked locking which is safe in Java 6/7 --> <exclude name="NonThreadSafeSingleton"/> <!-- This check breaks the builder pattern, I didn't find the solution--> <exclude name="AccessorClassGeneration"/> <!-- This check breaks enum singleton pattern. --> <exclude name="FieldDeclarationsShouldBeAtStartOfClass"/> <!-- TODO: Fix these --> <exclude name="AvoidReassigningParameters"/> <exclude name="GodClass"/> <exclude name="UncommentedEmptyMethodBody"/> <exclude name="UncommentedEmptyConstructor"/> <exclude name="UseVarargs"/> <exclude name="UseUtilityClass"/> <exclude name="TooFewBranchesForASwitchStatement"/> </rule> <rule ref="rulesets/java/design.xml/AvoidDeeplyNestedIfStmts"> <properties> <property name="problemDepth" value="5"/> </properties> </rule> <rule message="Commented blocks are ok" ref="rulesets/java/empty.xml/EmptyCatchBlock"> <properties> <property name="allowCommentedBlocks" value="true"/> </properties> </rule> </ruleset>
{ "pile_set_name": "Github" }
/** * A specialized version of `_.some` for arrays without support for iteratee * shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} predicate The function invoked per iteration. * @returns {boolean} Returns `true` if any element passes the predicate check, * else `false`. */ function arraySome(array, predicate) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { if (predicate(array[index], index, array)) { return true; } } return false; } module.exports = arraySome;
{ "pile_set_name": "Github" }
{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Input attribution and Variant effect prediction" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "In this tutorial we illustrate input feature importance attribution and variant effect prediction." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/home/wkopp/anaconda3/envs/jdev/lib/python3.6/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.\n", " from ._conv import register_converters as _register_converters\n", "Using TensorFlow backend.\n" ] } ], "source": [ "import os\n", "\n", "import numpy as np\n", "import h5py\n", "from keras import backend as K\n", "from keras.layers import Conv2D\n", "from keras.layers import GlobalAveragePooling2D\n", "from pkg_resources import resource_filename\n", "\n", "from janggu import Janggu\n", "from janggu import Scorer\n", "from janggu import inputlayer\n", "from janggu import outputdense\n", "from janggu.data import Bioseq\n", "from janggu.data import Cover\n", "from janggu.data import GenomicIndexer\n", "from janggu.data import ReduceDim\n", "from janggu.data import plotGenomeTrack\n", "from janggu.data import LineTrack\n", "from janggu.data import SeqTrack\n", "from janggu.layers import DnaConv2D\n", "from janggu import input_attribution\n", "\n", "np.random.seed(1234)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "First, we need to specify the output directory in which the results are stored and load the datasets. We also specify the number of epochs to train the model and the sequence feature order." ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "order = 3\n", "epochs = 100" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "os.environ['JANGGU_OUTPUT'] = '/home/wkopp/janggu_examples'\n", "\n", "# load the dataset\n", "# The pseudo genome represents just a concatenation of all sequences\n", "# in sample.fa and sample2.fa. Therefore, the results should be almost\n", "# identically to the models obtained from classify_fasta.py.\n", "REFGENOME = resource_filename('janggu', 'resources/pseudo_genome.fa')\n", "VCFFILE = resource_filename('janggu', 'resources/pseudo_snps.vcf')\n", "# ROI contains regions spanning positive and negative examples\n", "ROI_TRAIN_FILE = resource_filename('janggu', 'resources/roi_train.bed')\n", "ROI_TEST_FILE = resource_filename('janggu', 'resources/roi_test.bed')\n", "\n", "# PEAK_FILE only contains positive examples\n", "PEAK_FILE = resource_filename('janggu', 'resources/scores.bed')" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "# Training input and labels are purely defined genomic coordinates\n", "DNA = Bioseq.create_from_refgenome('dna', refgenome=REFGENOME,\n", " roi=ROI_TRAIN_FILE,\n", " binsize=200,\n", " store_whole_genome=True,\n", " order=order)\n", "\n", "LABELS = Cover.create_from_bed('peaks', roi=ROI_TRAIN_FILE,\n", " bedfiles=PEAK_FILE,\n", " binsize=200,\n", " resolution=200)\n", "\n", "\n", "DNA_TEST = Bioseq.create_from_refgenome('dna', refgenome=REFGENOME,\n", " roi=ROI_TEST_FILE,\n", " binsize=200,\n", " store_whole_genome=True,\n", " order=order)\n", "\n", "LABELS_TEST = Cover.create_from_bed('peaks',\n", " roi=ROI_TEST_FILE,\n", " bedfiles=PEAK_FILE,\n", " binsize=200,\n", " resolution=200)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Define and fit a new model" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Generated model-id: '6acf30da11d48d4d96ed0669bf3a52f4'\n", "Epoch 1/100\n", "244/244 [==============================] - 4s 14ms/step - loss: 0.6253 - acc: 0.6480\n", "Epoch 2/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.5209 - acc: 0.7661\n", "Epoch 3/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.4645 - acc: 0.7958\n", "Epoch 4/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.4248 - acc: 0.8201\n", "Epoch 5/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.3963 - acc: 0.8330\n", "Epoch 6/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.3720 - acc: 0.8441\n", "Epoch 7/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.3488 - acc: 0.8535\n", "Epoch 8/100\n", "244/244 [==============================] - 2s 9ms/step - loss: 0.3287 - acc: 0.8642\n", "Epoch 9/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.3064 - acc: 0.8775\n", "Epoch 10/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.2868 - acc: 0.8881\n", "Epoch 11/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.2666 - acc: 0.8989\n", "Epoch 12/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.2482 - acc: 0.9084\n", "Epoch 13/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.2305 - acc: 0.9148\n", "Epoch 14/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.2159 - acc: 0.9233\n", "Epoch 15/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.2011 - acc: 0.9297\n", "Epoch 16/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.1889 - acc: 0.9346\n", "Epoch 17/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.1777 - acc: 0.9396\n", "Epoch 18/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.1668 - acc: 0.9434\n", "Epoch 19/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.1571 - acc: 0.9465\n", "Epoch 20/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.1495 - acc: 0.9500\n", "Epoch 21/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.1412 - acc: 0.9549\n", "Epoch 22/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.1343 - acc: 0.9576\n", "Epoch 23/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.1277 - acc: 0.9589\n", "Epoch 24/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.1208 - acc: 0.9616\n", "Epoch 25/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.1161 - acc: 0.9632\n", "Epoch 26/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.1106 - acc: 0.9668\n", "Epoch 27/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.1066 - acc: 0.9661\n", "Epoch 28/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.1021 - acc: 0.9689\n", "Epoch 29/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0989 - acc: 0.9694\n", "Epoch 30/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0948 - acc: 0.9721\n", "Epoch 31/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0911 - acc: 0.9709\n", "Epoch 32/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0873 - acc: 0.9752\n", "Epoch 33/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0841 - acc: 0.9750\n", "Epoch 34/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0811 - acc: 0.9766\n", "Epoch 35/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0783 - acc: 0.9781\n", "Epoch 36/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0759 - acc: 0.9789\n", "Epoch 37/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0732 - acc: 0.9804\n", "Epoch 38/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0704 - acc: 0.9809\n", "Epoch 39/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0682 - acc: 0.9834\n", "Epoch 40/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0655 - acc: 0.9839\n", "Epoch 41/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0637 - acc: 0.9842\n", "Epoch 42/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0622 - acc: 0.9841\n", "Epoch 43/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0600 - acc: 0.9851\n", "Epoch 44/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0579 - acc: 0.9869\n", "Epoch 45/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0567 - acc: 0.9858\n", "Epoch 46/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0547 - acc: 0.9862\n", "Epoch 47/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0535 - acc: 0.9866\n", "Epoch 48/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0520 - acc: 0.9874\n", "Epoch 49/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0502 - acc: 0.9889\n", "Epoch 50/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0490 - acc: 0.9883\n", "Epoch 51/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0472 - acc: 0.9889\n", "Epoch 52/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0462 - acc: 0.9892\n", "Epoch 53/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0449 - acc: 0.9895\n", "Epoch 54/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0436 - acc: 0.9914\n", "Epoch 55/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0423 - acc: 0.9900\n", "Epoch 56/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0407 - acc: 0.9908\n", "Epoch 57/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0400 - acc: 0.9913\n", "Epoch 58/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0388 - acc: 0.9912\n", "Epoch 59/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0372 - acc: 0.9922\n", "Epoch 60/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0368 - acc: 0.9926\n", "Epoch 61/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0355 - acc: 0.9930\n", "Epoch 62/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0347 - acc: 0.9937\n", "Epoch 63/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0341 - acc: 0.9932\n", "Epoch 64/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0329 - acc: 0.9940\n", "Epoch 65/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0319 - acc: 0.9939\n", "Epoch 66/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0311 - acc: 0.9950\n", "Epoch 67/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0310 - acc: 0.9946\n", "Epoch 68/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0293 - acc: 0.9951\n", "Epoch 69/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0289 - acc: 0.9946\n", "Epoch 70/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0281 - acc: 0.9954\n", "Epoch 71/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0272 - acc: 0.9956\n", "Epoch 72/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0267 - acc: 0.9959\n", "Epoch 73/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0259 - acc: 0.9963\n", "Epoch 74/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0250 - acc: 0.9965\n", "Epoch 75/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0244 - acc: 0.9965\n", "Epoch 76/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0245 - acc: 0.9967\n", "Epoch 77/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0235 - acc: 0.9967\n", "Epoch 78/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0226 - acc: 0.9974\n", "Epoch 79/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0221 - acc: 0.9976\n", "Epoch 80/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0214 - acc: 0.9980\n", "Epoch 81/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0212 - acc: 0.9978\n", "Epoch 82/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0203 - acc: 0.9974\n", "Epoch 83/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0201 - acc: 0.9976\n", "Epoch 84/100\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "244/244 [==============================] - 2s 10ms/step - loss: 0.0194 - acc: 0.9981\n", "Epoch 85/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0190 - acc: 0.9982\n", "Epoch 86/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0184 - acc: 0.9986\n", "Epoch 87/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0180 - acc: 0.9987\n", "Epoch 88/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0177 - acc: 0.9983\n", "Epoch 89/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0171 - acc: 0.9990\n", "Epoch 90/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0165 - acc: 0.9990\n", "Epoch 91/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0161 - acc: 0.9991\n", "Epoch 92/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0161 - acc: 0.9987\n", "Epoch 93/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0156 - acc: 0.9991\n", "Epoch 94/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0151 - acc: 0.9995\n", "Epoch 95/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0145 - acc: 0.9991\n", "Epoch 96/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0140 - acc: 0.9991\n", "Epoch 97/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0140 - acc: 0.9996\n", "Epoch 98/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0136 - acc: 0.9995\n", "Epoch 99/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0132 - acc: 0.9992\n", "Epoch 100/100\n", "244/244 [==============================] - 2s 10ms/step - loss: 0.0129 - acc: 0.9995\n", "########################################\n", "loss: 0.012950192026199592, acc: 0.9994869821726305\n", "########################################\n" ] } ], "source": [ "@inputlayer\n", "@outputdense('sigmoid')\n", "def double_stranded_model_dnaconv(inputs, inp, oup, params):\n", " \"\"\" keras model for scanning both DNA strands.\n", "\n", " A more elegant way of scanning both strands for motif occurrences\n", " is achieved by the DnaConv2D layer wrapper, which internally\n", " performs the convolution operation with the normal kernel weights\n", " and the reverse complemented weights.\n", " \"\"\"\n", " with inputs.use('dna') as layer:\n", " # the name in inputs.use() should be the same as the dataset name.\n", " layer = DnaConv2D(Conv2D(params[0], (params[1], 1),\n", " activation=params[2]))(layer)\n", " output = GlobalAveragePooling2D(name='motif')(layer)\n", " return inputs, output\n", "\n", "\n", "# create a new model object\n", "model = Janggu.create(template=double_stranded_model_dnaconv,\n", " modelparams=(30, 21, 'relu'),\n", " inputs=DNA,\n", " outputs=ReduceDim(LABELS))\n", "\n", "model.compile(optimizer='adadelta', loss='binary_crossentropy',\n", " metrics=['acc'])\n", "\n", "hist = model.fit(DNA, ReduceDim(LABELS), epochs=epochs)\n", "\n", "print('#' * 40)\n", "print('loss: {}, acc: {}'.format(hist.history['loss'][-1],\n", " hist.history['acc'][-1]))\n", "print('#' * 40)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The toy example illustrates a binary classification example composed of Oct4 and Mafk binding sites. \n", "The true Oct4 binding sites have been labeled with ones while the Mafk binding sites are labeled zeros." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "For a sanity check we inspect the predicted values for a few data points." ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Oct4 predictions scores should be greater than Mafk scores:\n", "Prediction score examples for Oct4\n", "0.: [[[[0.99882954]]]]\n", "1.: [[[[0.9025411]]]]\n", "2.: [[[[0.99821955]]]]\n", "3.: [[[[0.98289168]]]]\n", "Prediction score examples for Mafk\n", "1.: [[[[0.59950411]]]]\n", "2.: [[[[0.00201734]]]]\n", "3.: [[[[0.00082711]]]]\n", "4.: [[[[2.10625944e-06]]]]\n" ] } ], "source": [ "pred = model.predict(DNA_TEST)\n", "cov_pred = Cover.create_from_array('BindingProba', pred, LABELS_TEST.gindexer)\n", "\n", "print('Oct4 predictions scores should be greater than Mafk scores:')\n", "print('Prediction score examples for Oct4')\n", "for i in range(4):\n", " print('{}.: {}'.format(i, cov_pred[i]))\n", "print('Prediction score examples for Mafk')\n", "for i in range(1, 5):\n", " print('{}.: {}'.format(i, cov_pred[-i]))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "In order to perform input feature attribution, we utilize the 'input_attribution' method for a genomic region of interest.\n", "\n", "Underneath, the result is illustrated visually. It highlights an Oct4 binding sites occuring at the left peak." ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAnYAAAExCAYAAADx4e+wAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAFTVJREFUeJzt3X2QpVWdH/Dvb5kZGtGIjLOuOMKMDsQKVBwVLbXUEDC1rJUtBTfZTjaLGDcWFeMU1FIuuqZCsmqUTdW6lC5VvmQVK8xgUIjJVqjd5cWoCYozS8wgqdp2hGVUcBhfVmUHkZz80beHBpuZpvt239vnfj5VU31fn/Prnnvv833OOc+51VoLAABr3y+MugAAAIZDsAMA6IRgBwDQCcEOAKATgh0AQCcEOwCATgh2AB2oqk9U1XtGXQcwWoIdwISpqt+rqv9TVT+rqstHXQ8wPIIdwOSZSfKOJH8y6kKA4RLsAIagqu6uqndW1der6vtV9cdVNVVVz6yq/1ZVP6iq71XVF6rqFwbPOamqPlNVB6rqm1W1Y972HjO0WlVnVdX+eddfVFV7qupHVXVtkqnH1fMvqmpm0Obnquqkuftaa59srf33JD9ayb8JsPoEO4Dh+Y0kv5zk+UlOS/LuJL+dZH+STUmeleRdSdog3P3XJP87yXOSnJPk4qr65aM1UlUbktyQ5FNJTkzyn5O8cd79Zyf590n+cZJnJ7knya6h/Ib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t9zChdLU82aDI0qzmEOta4r3KE5l7bXjPPDlzf7fXDfLf0c4IXijEr2YQrNbaijcySlV1Y2vt3FHXsdKq6kCSe0ZdBwCwLKe01jYt9cndBzsAgEnhu2IBADoh2AEAdEKwAwDohGAHANAJwQ4AoBOCHQBAJwQ7AIBOCHYAAJ0Q7AAAOvH/AW7gn/jbjS1ZAAAAAElFTkSuQmCC\n", "text/plain": [ "<Figure size 720x360 with 3 Axes>" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAnYAAAExCAYAAADx4e+wAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAFTVJREFUeJzt3X2QpVWdH/Dvb5kZGtGIjLOuOMKMDsQKVBwVLbXUEDC1rJUtBTfZTjaLGDcWFeMU1FIuuqZCsmqUTdW6lC5VvmQVK8xgUIjJVqjd5cWoCYozS8wgqdp2hGVUcBhfVmUHkZz80beHBpuZpvt239vnfj5VU31fn/Prnnvv833OOc+51VoLAABr3y+MugAAAIZDsAMA6IRgBwDQCcEOAKATgh0AQCcEOwCATgh2AB2oqk9U1XtGXQcwWoIdwISpqt+rqv9TVT+rqstHXQ8wPIIdwOSZSfKOJH8y6kKA4RLsAIagqu6uqndW1der6vtV9cdVNVVVz6yq/1ZVP6iq71XVF6rqFwbPOamqPlNVB6rqm1W1Y972HjO0WlVnVdX+eddfVFV7qupHVXVtkqnH1fMvqmpm0Obnquqkuftaa59srf33JD9ayb8JsPoEO4Dh+Y0kv5zk+UlOS/LuJL+dZH+STUmeleRdSdog3P3XJP87yXOSnJPk4qr65aM1UlUbktyQ5FNJTkzyn5O8cd79Zyf590n+cZJnJ7knya6h/IbAWBPsAIbnQ621e1tr30vy3iT/JMnDmQ1Xp7TWHm6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Lf0c4IXijEr2YQrNbaijcySlV1Y2vt3FHXsdKq6kCSe0ZdBwCwLKe01jYt9cndBzsAgEnhu2IBADoh2AEAdEKwAwDohGAHANAJwQ4AoBOCHQBAJwQ7AIBOCHYAAJ0Q7AAAOvH/AW7gn/jbjS1ZAAAAAElFTkSuQmCC\n", "text/plain": [ "<Figure size 720x360 with 3 Axes>" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# Extract the 4th interval to perform input feature importance attribution\n", "# which represents an Oct4 bound region\n", "gi = DNA.gindexer[3]\n", "chrom = gi.chrom\n", "start = gi.start\n", "end = gi.end\n", "attr_oct = input_attribution(model, DNA, chrom=chrom, start=start, end=end)\n", "\n", "# visualize the important sequence features\n", "plotGenomeTrack(SeqTrack(attr_oct[0]), chrom, start, end)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "By comparison, the input attribution for a Mafk binding sites highlights a Mafk motif in the center." ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAoMAAAExCAYAAAAHhKhtAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAFjxJREFUeJzt3X+U5WV9H/D3R9h1rJIIy9aIK+wqcDzCiaui0Ry1FGwknsaK9jSTpkHbtJZE5UD0GH/1yPFXFdsTw4nSSrQWT9nVaKAmaUwUxKgNgkuoWfAkDghlFRAWbTRkEcnTP+bOMuDs7MzOnbl37vN6nTNnv/e5d77fz52de7/veZ7n+9xqrQUAgD49YtQFAAAwOsIgAEDHhEEAgI4JgwAAHRMGAQA6JgwCAHRMGASYAFX10ap656jrANYfYRCgM1X1jqr6y6r6UVWdP+p6gNESBgH6M5PkDUn+aNSFAKMnDAIMQVXdUlVvqqobq+q7VfXfqmqqqo6uqj+squ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oa/uobxV/rBwtv+IV0dZWNvHHptYBTmem1fPOI61po5gzBhzC08OPMNAR6kZxDGiIDCapjrWV/N3o7lDuubBrC+6C2ebMIgXZk7KT52DcYqJ/lkN8nPbSGmKbBSa31hVG+vUVZGGIQxN3cSGdepdq6ahdUl2M3SO7l6hEGYYE4iMDxr/Xpa6A8tr2lWgzAIACM2Tgsr7w+hHX5SSa+EwQ6N61+W+4dD/9PsO1AvQwGGPpZuVPOujIA/1FJ/Z4cRKuYfS0iB1SEMcsjW4sS83Df/UQXd+RcYLDa087NTww26gmQ/VisIreR1PKzX2zj1ijEe1mPwX8/vx8IgK3awk8mahsZ11IWzkgtDrCM4HJPy0Xcs3aEEWEs+PWg9B55D1cOyScLghFrJSW7uxf7WwUeELWcfi71RDOtNZKn1rdYQn2VGxlePJ6px4/9gbfg5M0zC4AQ5lDeHpQablQTEhfQ6P3AcrOVai6MyDkOfk2Zcw4deu8lxKL9jy/34uIVe3yt5zS/1YzjH/f1EGCTJ8N/ox/XEsZj18qJdTQtO1j+E0LiWH2C/Hn/XerYep3SMu8UC0VL/MBrWiMfc8VaT1/zwVWtt1DWsqqr6TGvtjFHXsdqq6q4kt466DgBgRY5rrW1eywNOfBgEAODAHjHqAgAAGB1hEACgY8IgAEDHhEEAgI4JgwAAHRMGAQA6JgwCAHRMGAQA6JgwCADQsf8P5hZ9yHaPZ3AAAAAASUVORK5CYII=\n", "text/plain": [ "<Figure size 720x360 with 3 Axes>" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAoMAAAExCAYAAAAHhKhtAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAFjxJREFUeJzt3X+U5WV9H/D3R9h1rJIIy9aIK+wqcDzCiaui0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es>" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# For the comparison, extract an interval\n", "# representing a Mafk bound region and visualize the\n", "# important features.\n", "gi = DNA.gindexer[7796]\n", "chrom = gi.chrom\n", "start = gi.start\n", "end = gi.end\n", "attr_mafk = input_attribution(model, DNA, chrom=chrom, start=start, end=end)\n", "\n", "plotGenomeTrack(SeqTrack(attr_mafk[0]), chrom, start, end)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "In order to perform variant effect prediction, we need the DNA sequence loaded for the whole genome into a Bioseq object and a VCF file containing single nucleotide variant.\n", "\n", "The result of this analysis is stored in two files: scores.hdf5 and snps.bed.gz." ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [], "source": [ "# output directory for the variant effect prediction\n", "vcfoutput = os.path.join(os.environ['JANGGU_OUTPUT'], 'vcfoutput')\n", "os.makedirs(vcfoutput, exist_ok=True)\n", "\n", "# perform variant effect prediction using Bioseq object and\n", "# a VCF file\n", "scoresfile, variantsfile = model.predict_variant_effect(DNA,\n", " VCFFILE,\n", " conditions=['feature'],\n", " output_folder=vcfoutput)\n", "\n", "scoresfile = os.path.join(vcfoutput, 'scores.hdf5')\n", "variantsfile = os.path.join(vcfoutput, 'snps.bed.gz')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "scores.hdf5 contains a variety of scores for each variant. The most important ones are refscore and altscore which are used to derive the score difference and the logoddsscore." ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "altscore\n", "diffscore\n", "labels\n", "logoddsscore\n", "refscore\n" ] } ], "source": [ "# parse the variant effect predictions (difference between\n", "# reference and alternative variant) into a Cover object\n", "# for the purpose of visualization\n", "f = h5py.File(scoresfile, 'r')\n", "\n", "for name in f:\n", " print(name)\n", " " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Finally, we can convert the variant predictions (the score differences in this case) along with the genomic context with other genomic tracks." ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [], "source": [ "gindexer = GenomicIndexer.create_from_file(variantsfile, None, None)\n", "\n", "snpcov = Cover.create_from_array('snps', f['diffscore'],\n", " gindexer,\n", " store_whole_genome=True,\n", " padding_value=np.nan)\n", "#snpcov = Cover.create_from_array('snps', f['diffscore'],\n", "# gindexer,\n", "# store_whole_genome=False,\n", "# padding_value=np.nan)" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAnYAAAExCAYAAADx4e+wAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAF/9JREFUeJzt3X2wnFd9H/Dvz7aEsKGAhUIwxpbBuExNgjEKAxmgrk0mCm2Gt6TcRq2BknjcUjz2xCW8NXWamICTmRAG4qmAhpcaCWqwQ8vEJMHmtQVkGQcEtEEYCwuwscRLAGFjnNM/diVfy1e617p7d+89+/nM3NndZ599zm/v3bvPd895nrPVWgsAACvfUZMuAACA0RDsAAA6IdgBAHRCsAMA6IRgBwDQCcEOAKATgh1AB6rqHVX1B5OuA5gswQ5gylTV71fVF6rqp1V1yaTrAUZHsAOYPjuTvCLJhyZdCDBagh3ACFTVzVX1qqr6UlV9t6r+vKrWVNXDq+p/VdX3quo7VfWJqjpq+JgTqur9VXV7VX2tqi6Ytb17Da1W1VlVtXvW7SdV1Q1V9YOqem+SNQfV81tVtXPY5ger6oT997XW3tla+8skP1jK3wkwfoIdwOhsSvLLSR6b5LQkr03y20l2J1mX5BFJXp2kDcPd/0zyt0keleScJBdW1S/P10hVrU5ydZJ3Jzk+yf9I8oJZ95+d5A+T/Mskj0yyK8nWkTxDYFkT7ABG582ttVtaa99JcmmSf5XkrgzC1cmttbtaa59ogy/p/oUk61pr/6W19pPW2k1J3ppkZgHtPD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PTYAQCMwJVXXplzzz03u3btys0335xbbrklp5xySj75yU+OrQY9dgBAlxY6PcmobNmyJa985SvvtewFL3hB3vOe9+QZz3jGWGoQ7AAARuCjH/3ofZZdcMEFY63BUCwAQCcEOwCATgh2AACdEOwAADoh2AEHzOzYmZkdOyddBsxp54tnRv6l7tAbwQ4AoBOmOwEAuvSmnaPt4b3g1IXNi3frrbfmwgsvzLZt2/KABzwg69evzxvf+MacdtppI61nLnrsAABGpLWW5z3veTnrrLPy1a9+NV/60pfyute9LrfddttY2tdjBwAwItddd11WrVqV888//8CyM844Y2zt67EDABiRHTt25MlPfvLE2hfsAAA6IdgBAIzI6aefnu3bt0+sfcEOgBXlXTM7864Z8y2yPJ199tm5884789a3vvXAsm3btuVjH/vYWNp38gRMgf2Tup76joWdqg/Qg4VOTzJKVZWrrroqF154YV7/+tdnzZo1B6Y7GQfBDgBghE444YS8733vm0jbhmIBADoh2AEAdEKwAwDohGAHjNzOF88cOGEDgPER7AAAOiHYAQB0wnQnAECXZnaMdiLrrU84dUHr3Xbbbbnooovy6U9/Og972MOyevXqvOIVr8jznve8kdYzlyPusauqV8+6/tCq+veLKaSqLqmqixezDQCASWqt5bnPfW6e+cxn5qabbsr27duzdevW7N69eyztL2Yo9tWzrj80yZzBrqqOXkQbAAArxrXXXpvVq1fn/PPPP7Ds5JNPzstf/vKxtL+godiqujrJo5OsSfKnSR6T5IFVdWOSLyY5Osljh7f/OsmHkvznJN9KckaSf3KI7b4myblJbklye5Ltw+UfTfKZJP8sg9D40tbaJ6pqfZJ3JzluuIn/0Fr733Ns97wk5yXJSSedtJCnCACwaF/84hdz5plnTqz9hR5j929ba9+pqgcm2Zbkn2YQqs5IkmHgesKs22clecpw2dfm2mBVPTnJTJInDeu4IcNgt7+21tpTqurZGYTEZyX5dpJfaq3dUVWPS7IlyYaDt91a25xkc5Js2LChLfA5AgCM1Mte9rJ88pOfzOrVq7Nt27Ylb2+hwe6Cqtp/xN+jkzxuAY/57KFC3dAzklzVWt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DCt9r/HGmhfXgQ7ltxKnjh31FNROO7q3g70gl3c767BdCZzm/2/cKAXrN+XwYJ5vcxvvt/RtH+oF+w4pGn/5+DQ5gqoXi/Ly+y/x2ICdM8fRpZTiOptqH+hZg+9O9FiNAQ77mMxx22M40woZ1tNr+UQMg73dW4rPfwYWlv+RnFc3XJ9Dx1H0F5OYX6pCHZM1HLaIU7DPzz3tpxef/M5MHXIawexa9w1zzV0uhJ+bwsxzb3Nvf0tEey4n+Z6AxzVp79xvMH09ga+kt6U9wfn1w6HAw/1NzgwJPXasZR1wKTnXJvr/2i+v29vr+e5TOo5TsPvtgej+Dv19rcW7Dhik9oBH9z+qe/YqrftEAytLZ3FfKBZrkNhPVvoe8SBEzmW8H1t0h8iejTqD7krOewJdlNuGnYwyyH03XNg9JG/ka/kNxoGFvphyI6f5WoxAWr2/mbcZ0JP04dcwY6uCD8cynII+NC7SY/kzHYk+4MeJn0W7KbIwafTL+UObqX3BC506gHzby3/uejGOY/ipF73iwmti6l5uX+Qmuv3stxr5t5mvz6X+5Qwy+XDo2DXiZt+fOe9bi/0QPXlaHZX/1J9vdDsf8D9bTz7CB7LeBiaZKUbR6CcL6Tvr2ElTha/FBbzoXQ57weqtTbpGpZUVV3TWts46TqWWlXdnmTXpOsAABbl5NbauiN9cPfBDgBgWhw16QIAABgNwQ4AoBOCHQBAJwQ7AIBOCHYAAJ0Q7AAAOiHYAQB0QrADAOiEYAcA0In/DxsmzW9pChKJAAAAAElFTkSuQmCC\n", "text/plain": [ "<Figure size 720x360 with 5 Axes>" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "gi = DNA.gindexer[3]\n", "chrom = gi.chrom\n", "start = gi.start\n", "end = gi.end\n", "\n", "plotGenomeTrack([LineTrack(snpcov,\n", " linestyle=\"None\"), SeqTrack(attr_oct[0])],\n", " chrom, start, end)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The score difference shows a dip around the site that is indicated as most important from the input attribution as well." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "It is also possible to export the variant effect predictions as bigwig for further explorations in e.g. IGV.\n", "To this end, use the `export_to_bigwig` method" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [], "source": [ "os.makedirs('./snps', exist_ok=True)\n", "snpcov.export_to_bigwig('./snps')" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.8" } }, "nbformat": 4, "nbformat_minor": 2 }
{ "pile_set_name": "Github" }
/* * Copyright 2008-2014, David Karnok * The file is part of the Open Imperium Galactica project. * * The code should be distributed under the LGPL license. * See http://www.gnu.org/licenses/lgpl.html for details. */ package hu.openig.model; import java.awt.Rectangle; /** The view limit records. */ public class ViewLimit { /** The inner limit if non-null. */ public Rectangle inner; /** The outer limit if non-null. */ public Rectangle outer; }
{ "pile_set_name": "Github" }
// license:BSD-3-Clause // copyright-holders:R. Belmont /***************************************************************************** * * sh4comn.h * * SH-4 non-specific components * *****************************************************************************/ #pragma once #ifndef __SH4COMN_H__ #define __SH4COMN_H__ #include "sh.h" #define VERBOSE 0 #define LOG(x) do { if (VERBOSE) logerror x; } while (0) #define EXPPRI(pl,po,p,n) (((4-(pl)) << 24) | ((15-(po)) << 16) | ((p) << 8) | (255-(n))) #define NMIPRI() EXPPRI(3,0,16,SH4_INTC_NMI) #define INTPRI(p,n) EXPPRI(4,2,p,n) #define FP_RS(r) m_sh2_state->m_fr[(r)] // binary representation of single precision floating point register r #define FP_RFS(r) *( (float *)(m_sh2_state->m_fr+(r)) ) // single precision floating point register r #define FP_RFD(r) *( (double *)(m_sh2_state->m_fr+(r)) ) // double precision floating point register r #define FP_XS(r) m_sh2_state->m_xf[(r)] // binary representation of extended single precision floating point register r #define FP_XFS(r) *( (float *)(m_sh2_state->m_xf+(r)) ) // single precision extended floating point register r #define FP_XFD(r) *( (double *)(m_sh2_state->m_xf+(r)) ) // double precision extended floating point register r #ifdef LSB_FIRST #define FP_RS2(r) m_sh2_state->m_fr[(r) ^ m_sh2_state->m_fpu_pr] #define FP_RFS2(r) *( (float *)(m_sh2_state->m_fr+((r) ^ m_sh2_state->m_fpu_pr)) ) #define FP_XS2(r) m_sh2_state->m_xf[(r) ^ m_sh2_state->m_fpu_pr] #define FP_XFS2(r) *( (float *)(m_sh2_state->m_xf+((r) ^ m_sh2_state->m_fpu_pr)) ) #endif #define FPSCR mem(&m_sh2_state->m_fpscr) #define FPS32(reg) m_fs_regmap[reg] #define FPD32(reg) m_fd_regmap[reg & 14] enum { ICF = 0x00800000, OCFA = 0x00080000, OCFB = 0x00040000, OVF = 0x00020000 }; #define FD 0x00008000 #define BL 0x10000000 #define sRB 0x20000000 #define MD 0x40000000 /* 29 bits */ #define SH34_AM 0x1fffffff #define SH34_FLAGS (MD|sRB|BL|FD|SH_M|SH_Q|SH_I|SH_S|SH_T) /* Bits in FPSCR */ #define RM 0x00000003 #define DN 0x00040000 #define PR 0x00080000 #define SZ 0x00100000 #define FR 0x00200000 #define REGFLAG_R(n) (1 << (n)) /* additional register flags 1 */ #define REGFLAG_SGR (1 << 6) #define REGFLAG_FPUL (1 << 7) #define REGFLAG_FPSCR (1 << 8) #define REGFLAG_DBR (1 << 9) #define REGFLAG_SSR (1 << 10) #define REGFLAG_SPC (1 << 11) #endif /* __SH4COMN_H__ */
{ "pile_set_name": "Github" }
package timing import ( "time" ) const ( nanoPerSecond = 1000000000 ) // FPS returns the number of frames being processed per second, // supposing a time interval from lastTime to now. func FPS(lastTime, now time.Time) float64 { fps := 1 / now.Sub(lastTime).Seconds() // This indicates that time.Now recorded two times within // the innacuracy of the OS's system clock, so the values // were the same. if int(fps) < 0 { return 1200 } return fps } // FPSToNano converts a framesPerSecond value to the number of // nanoseconds that should take place for each frame. func FPSToNano(fps float64) int64 { return int64(nanoPerSecond / fps) } // FPSToDuration converts a frameRate like 60fps into a duration func FPSToDuration(frameRate int) time.Duration { return time.Second / time.Duration(int64(frameRate)) }
{ "pile_set_name": "Github" }
// // JBBarChartView.h // JBChartView // // Created by Terry Worona on 9/3/13. // Copyright (c) 2013 Jawbone. All rights reserved. // // Views #import "JBChartView.h" @class JBBarChartView; @protocol JBBarChartViewDataSource <JBChartViewDataSource> @required /** * The number of bars in a given bar chart is the number of vertical views shown along the x-axis. * * @param barChartView The bar chart object requesting this information. * * @return Number of bars in the given chart, displayed horizontally along the chart's x-axis. */ - (NSUInteger)numberOfBarsInBarChartView:(JBBarChartView *)barChartView; @optional /** * A UIView subclass representing the bar at a particular index. * * Default: solid black UIView. * * @param barChartView The bar chart object requesting this information. * @param index The 0-based index of a given bar (left to right, x-axis). * * @return A UIView subclass. The view will automatically be resized by the chart during creation (ie. no need to set the frame). */ - (UIView *)barChartView:(JBBarChartView *)barChartView barViewAtIndex:(NSUInteger)index; @end @protocol JBBarChartViewDelegate <JBChartViewDelegate> @required /** * Height for a bar at a given index (left to right). There is no ceiling on the the height; * the chart will automatically normalize all values between the overal min and max heights. * * @param barChartView The bar chart object requesting this information. * @param index The 0-based index of a given bar (left to right, x-axis). * * @return The y-axis height of the supplied bar index (x-axis) */ - (CGFloat)barChartView:(JBBarChartView *)barChartView heightForBarViewAtIndex:(NSUInteger)index; @optional /** * Occurs when a touch gesture event occurs on a given bar (chart must be expanded). * and the selection must occur within the bounds of the chart. * * @param barChartView A bar chart object informing the delegate about the new selection. * @param index The 0-based index of a given bar (left to right, x-axis). * @param touchPoint The touch point in relation to the chart's bounds (excludes footer and header). */ - (void)barChartView:(JBBarChartView *)barChartView didSelectBarAtIndex:(NSUInteger)index touchPoint:(CGPoint)touchPoint; - (void)barChartView:(JBBarChartView *)barChartView didSelectBarAtIndex:(NSUInteger)index; /** * Occurs when selection ends by either ending a touch event or selecting an area that is outside the view's bounds. * For selection start events, see: didSelectBarAtIndex... * * @param barChartView A bar chart object informing the delegate about the deselection. */ - (void)didDeselectBarChartView:(JBBarChartView *)barChartView; /** * If you already implement barChartView:barViewAtIndex: delegate - this method has no effect. * If a custom UIView isn't supplied, a flat bar will be made automatically (default color black). * * Default: if none specified - calls barChartView:barViewAtIndex:. * * @param barChartView The bar chart object requesting this information. * @param index The 0-based index of a given bar (left to right, x-axis). * * @return The color to be used to color a bar in the chart. */ - (UIColor *)barChartView:(JBBarChartView *)barChartView colorForBarViewAtIndex:(NSUInteger)index; /** * The selection color to be overlayed on a bar during touch events. * The color is automatically faded to transparent (vertically). The property showsVerticalSelection * must be YES for the color to apply. * * Default: white color (faded to transparent). * * @param barChartView The bar chart object requesting this information. * * @return The color to be used on each bar selection. */ - (UIColor *)barSelectionColorForBarChartView:(JBBarChartView *)barChartView; /** * Horizontal padding between bars. * * Default: 'best-guess' algorithm based on the the total number of bars and width of the chart. * * @param barChartView The bar chart object requesting this information. * * @return Horizontal width (in pixels) between each bar. */ - (CGFloat)barPaddingForBarChartView:(JBBarChartView *)barChartView; @end @interface JBBarChartView : JBChartView @property (nonatomic, weak) id<JBBarChartViewDataSource> dataSource; @property (nonatomic, weak) id<JBBarChartViewDelegate> delegate; /** * Vertical highlight overlayed on bar during touch events. * * Default: YES. */ @property (nonatomic, assign) BOOL showsVerticalSelection; /* * Bars can be (vertically) positoned top to bottom instead of bottom up. * If this property is set to YES, both the bar and the selection view will be inverted. * For the inverted orientation to take effect, reloadData must be called. * * Default: NO. */ @property (nonatomic, assign, getter=isInverted) BOOL inverted; @end
{ "pile_set_name": "Github" }
/**************************************************************************** * * Copyright 2017 Samsung Electronics All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, * either express or implied. See the License for the specific * language governing permissions and limitations under the License. * ****************************************************************************/ /**************************************************************************** * drivers/bch/bchlib_read.c * * Copyright (C) 2008-2009, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <[email protected]> * * 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 NuttX 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. * ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ #include <tinyara/config.h> #include <sys/types.h> #include <stdint.h> #include <string.h> #include <errno.h> #include <assert.h> #include <debug.h> #include "bch.h" /**************************************************************************** * Private Types ****************************************************************************/ /**************************************************************************** * Private Function Prototypes ****************************************************************************/ /**************************************************************************** * Private Data ****************************************************************************/ /**************************************************************************** * Private Functions ****************************************************************************/ /**************************************************************************** * Public Functions ****************************************************************************/ /**************************************************************************** * Name: bchlib_read * * Description: * Read from the block device set-up by bchlib_setup as if it were a * character device. * ****************************************************************************/ ssize_t bchlib_read(FAR void *handle, FAR char *buffer, size_t offset, size_t len) { FAR struct bchlib_s *bch = (FAR struct bchlib_s *)handle; size_t nsectors; size_t sector; uint16_t sectoffset; size_t nbytes; size_t bytesread; int ret; /* Get rid of this special case right away */ if (len < 1) { return 0; } /* Convert the file position into a sector number an offset. */ sector = offset / bch->sectsize; sectoffset = offset - sector * bch->sectsize; if (sector >= bch->nsectors) { /* Return end-of-file */ return 0; } /* Read the initial partial sector */ bytesread = 0; if (sectoffset > 0) { /* Read the sector into the sector buffer */ bchlib_readsector(bch, sector); /* Copy the tail end of the sector to the user buffer */ if (sectoffset + len > bch->sectsize) { nbytes = bch->sectsize - sectoffset; } else { nbytes = len; } memcpy(buffer, &bch->buffer[sectoffset], nbytes); /* Adjust pointers and counts */ sector++; if (sector >= bch->nsectors) { return nbytes; } bytesread = nbytes; buffer += nbytes; len -= nbytes; } /* * Then read all of the full sectors following the partial sector directly * into the user buffer. */ if (len >= bch->sectsize) { nsectors = len / bch->sectsize; if (sector + nsectors > bch->nsectors) { nsectors = bch->nsectors - sector; } ret = bch->inode->u.i_bops->read(bch->inode, (FAR uint8_t *)buffer, sector, nsectors); if (ret < 0) { fdbg("ERROR: Read failed: %d\n"); return ret; } /* Adjust pointers and counts */ sector += nsectors; nbytes = nsectors * bch->sectsize; bytesread += nbytes; if (sector >= bch->nsectors) { return bytesread; } buffer += nbytes; len -= nbytes; } /* Then read any partial final sector */ if (len > 0) { /* Read the sector into the sector buffer */ bchlib_readsector(bch, sector); /* Copy the head end of the sector to the user buffer */ memcpy(buffer, bch->buffer, len); /* Adjust counts */ bytesread += len; } return bytesread; }
{ "pile_set_name": "Github" }
package datawave.query.language.functions.lucene; import datawave.query.jexl.functions.QueryFunctions; import datawave.query.language.functions.QueryFunction; import datawave.webservice.query.exception.BadRequestQueryException; import datawave.webservice.query.exception.DatawaveErrorCode; import org.apache.lucene.queryparser.flexible.core.nodes.AndQueryNode; import org.apache.lucene.queryparser.flexible.core.nodes.BooleanQueryNode; import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; import java.text.MessageFormat; import java.util.ArrayList; import java.util.List; public class Unique extends LuceneQueryFunction { public Unique() { super(QueryFunctions.UNIQUE_FUNCTION, new ArrayList<>()); } @Override public void initialize(List<String> parameterList, int depth, QueryNode parent) throws IllegalArgumentException { super.initialize(parameterList, depth, parent); } @Override public void validate() throws IllegalArgumentException { if (this.parameterList.isEmpty()) { BadRequestQueryException qe = new BadRequestQueryException(DatawaveErrorCode.INVALID_FUNCTION_ARGUMENTS, MessageFormat.format("{0}", this.name)); throw new IllegalArgumentException(qe); } if (this.depth != 1) { throw new IllegalArgumentException("function: " + this.name + " must be at the top level of the query"); } if (!(this.parent instanceof AndQueryNode || this.parent instanceof BooleanQueryNode)) { throw new IllegalArgumentException("function: " + this.name + " must be part of an AND expression"); } } @Override public QueryFunction duplicate() { return new Unique(); } }
{ "pile_set_name": "Github" }
# Live2D Animator Motion Data $fps=30 $fadein=0 $fadeout=0 PARAM_ANGLE_Y=0,0,0,0,0,0,0,0,0,0,0,0,0.96,3.38,6.66,10.49,14.47,18.4,22.12,25.25,27.77,29.4,30,30,30,30,30,30,30,30,30,30,30,30,30,29.04,26.62,23.34,19.51,15.53,11.6,7.88,4.75,2.23,0.6 PARAM_ANGLE_Z=0 PARAM_EYE_L_OPEN=1 PARAM_EYE_L_SMILE=0 PARAM_EYE_R_OPEN=1 PARAM_EYE_R_SMILE=0 PARAM_EYE_SIZE=0 PARAM_EYE_BALL_Y=0 PARAM_EYELOOP1=0 PARAM_EYELOOP2=0 PARAM_MOUTH_FORM=0,0,0,0,0,0,0,0,0,0,0,0,0.03,0.11,0.22,0.35,0.48,0.61,0.74,0.84,0.93,0.98,1,1,1,1,1,1,1,1,1,1,1,1,1,0.97,0.89,0.78,0.65,0.52,0.39,0.26,0.16,0.07,0.02 PARAM_MOUTH_OPEN_Y=0,0,0,0,0,0,0,0,0,0,0,0,0.03,0.11,0.22,0.35,0.48,0.61,0.74,0.84,0.93,0.98,1,1,1,1,1,1,1,1,1,1,1,1,1,0.97,0.89,0.78,0.65,0.52,0.39,0.26,0.16,0.07,0.02 PARAM_INMOUTH=1 PARAM_FACE_RED=0 PARAM_CHEEK=0 PARAM_TEAR=0 PARAM_EAR_FORM=1 PARAM_EAR=1,0.64,0.07,-0.46,-0.85,-1,-0.85,-0.48,0,0.49,0.85,1,0.85,0.48,0,-0.48,-0.85,-1,-0.64,-0.07,0.46,0.85,1,0.64,0.07,-0.46,-0.85,-1,-0.85,-0.48,0,0.48,0.85,1,0.85,0.48,0,-0.48,-0.85,-1,-0.85,-0.48,0,0.48,0.85 PARAM_GLASS=0 PARAM_BODY_UD=5,3.9,1.21,-2.06,-5.25,-7.82,-9.45,-10,-9.02,-6.89,-4.24,-1.49,1.02,3.1,4.48,5,3.9,1.21,-2.06,-5.25,-7.82,-9.45,-10,-9.02,-6.89,-4.24,-1.49,1.02,3.1,4.48,5,3.9,1.21,-2.06,-5.25,-7.82,-9.45,-10,-9.02,-6.89,-4.24,-1.49,1.02,3.1,4.48 PARAM_BREATH=0 PARAM_BODY_ANGLE_Y=-10,-8.53,-4.95,-0.59,3.67,7.09,9.26,10,8.69,5.86,2.32,-1.34,-4.69,-7.47,-9.31,-10,-8.53,-4.95,-0.59,3.67,7.09,9.26,10,8.69,5.86,2.32,-1.34,-4.69,-7.47,-9.31,-10,-8.53,-4.95,-0.59,3.67,7.09,9.26,10,8.69,5.86,2.32,-1.34,-4.69,-7.47,-9.31 PARAM_BODY_ANGLE_Z=-8,-7.89,-7.6,-7.12,-6.48,-5.72,-4.86,-3.88,-2.87,-1.79,-0.69,0.42,1.49,2.56,3.56,4.51,5.36,6.12,6.77,7.29,7.68,7.92,8,7.9,7.6,7.14,6.55,5.83,5.02,4.13,3.18,2.18,1.17,0.13,-0.9,-1.91,-2.89,-3.82,-4.68,-5.48,-6.2,-6.81,-7.31,-7.69,-7.92 PARAM_HAIR_FRONT=0 PARAM_HAIR_SIDE=0 PARAM_ACC=0 PARAM_TAIL_FORM=1,0.99,0.96,0.92,0.86,0.79,0.71,0.61,0.52,0.42,0.31,0.21,0.11,0.01,-0.08,-0.17,-0.25,-0.32,-0.38,-0.43,-0.47,-0.49,-0.5,-0.49,-0.46,-0.42,-0.36,-0.3,-0.22,-0.14,-0.05,0.05,0.14,0.24,0.33,0.43,0.52,0.61,0.69,0.76,0.83,0.89,0.94,0.97,0.99 PARAM_TAIL=1,0.987,0.95,0.89,0.81,0.72,0.61,0.48,0.36,0.22,0.09,-0.05,-0.19,-0.32,-0.45,-0.56,-0.67,-0.76,-0.85,-0.91,-0.96,-0.99,-1,-0.987,-0.95,-0.89,-0.82,-0.73,-0.63,-0.52,-0.4,-0.27,-0.15,-0.02,0.11,0.24,0.36,0.48,0.59,0.69,0.77,0.85,0.91,0.96,0.99 PARAM_ACC1L=0 PARAM_ACC1R=0 PARAM_ACC2L=0 PARAM_ACC2R=0 PARAM_HAIR_ROLL=0 PARAM_ROLL_FUWA=0 PARAM_ACC_2=0 PARAM_LEG_L_Z=0 PARAM_LEG_L=5,4.26,2.48,0.29,-1.84,-3.55,-4.63,-5,-4.34,-2.93,-1.16,0.67,2.35,3.73,4.66,5,4.26,2.48,0.29,-1.84,-3.55,-4.63,-5,-4.34,-2.93,-1.16,0.67,2.35,3.73,4.66,5,4.26,2.48,0.29,-1.84,-3.55,-4.63,-5,-4.34,-2.93,-1.16,0.67,2.35,3.73,4.66 PARAM_LEG_R_Z=0 PARAM_LEG_R=5,4.26,2.48,0.29,-1.84,-3.55,-4.63,-5,-4.34,-2.93,-1.16,0.67,2.35,3.73,4.66,5,4.26,2.48,0.29,-1.84,-3.55,-4.63,-5,-4.34,-2.93,-1.16,0.67,2.35,3.73,4.66,5,4.26,2.48,0.29,-1.84,-3.55,-4.63,-5,-4.34,-2.93,-1.16,0.67,2.35,3.73,4.66 PARAM_SHOULDER=0 PARAM_ARM_L=-3,-2.96,-2.85,-2.67,-2.43,-2.15,-1.82,-1.45,-1.08,-0.67,-0.26,0.16,0.56,0.96,1.34,1.69,2.01,2.29,2.54,2.73,2.88,2.97,3,2.96,2.85,2.68,2.46,2.18,1.88,1.55,1.19,0.82,0.44,0.05,-0.34,-0.71,-1.08,-1.43,-1.76,-2.05,-2.32,-2.55,-2.74,-2.88,-2.97 PARAM_ARM_L_FORM1=1,1,1,1,1.25,1.5,1.75,2,2,2,2,2,1.75,1.5,1.25,1,1,1,1,1,1.33,1.67,2,2,2,2,2,1.75,1.5,1.25,1,1,1,1,1,1.33,1.67,2,2,2,2,2,1.75,1.5,1.25 PARAM_ARM_L_FORM2=1,1.33,1.67,2,2,2,2,2,1.75,1.5,1.25,1,1,1,1,1,1.25,1.5,1.75,2,2,2,2,1.75,1.5,1.25,1,1,1,1,1,1.25,1.5,1.75,2,2,2,2,1.75,1.5,1.25,1,1,1,1 PARAM_ARM_R=3,2.96,2.85,2.67,2.43,2.15,1.82,1.45,1.08,0.67,0.26,-0.16,-0.56,-0.96,-1.34,-1.69,-2.01,-2.29,-2.54,-2.73,-2.88,-2.97,-3,-2.96,-2.85,-2.68,-2.46,-2.18,-1.88,-1.55,-1.19,-0.82,-0.44,-0.05,0.34,0.71,1.08,1.43,1.76,2.05,2.32,2.55,2.74,2.88,2.97 PARAM_ARM_R_FORM1=1,1,1,1,1.25,1.5,1.75,2,2,2,2,2,1.75,1.5,1.25,1,1,1,1,1,1.33,1.67,2,2,2,2,2,1.75,1.5,1.25,1,1,1,1,1,1.33,1.67,2,2,2,2,2,1.75,1.5,1.25 PARAM_ARM_R_ROFM2=1,1.33,1.67,2,2,2,2,2,1.75,1.5,1.25,1,1,1,1,1,1.25,1.5,1.75,2,2,2,2,1.75,1.5,1.25,1,1,1,1,1,1.25,1.5,1.75,2,2,2,2,1.75,1.5,1.25,1,1,1,1 PARAM_ARCH_L=0.5,0.493,0.475,0.44,0.41,0.36,0.3,0.24,0.18,0.11,0.04,-0.03,-0.09,-0.16,-0.22,-0.28,-0.33,-0.38,-0.42,-0.46,-0.48,-0.495,-0.5,-0.494,-0.475,-0.45,-0.41,-0.36,-0.31,-0.26,-0.2,-0.14,-0.07,-0.01,0.06,0.12,0.18,0.24,0.29,0.34,0.39,0.43,0.46,0.48,0.495 PARAM_ARCH_R=-0.5,-0.493,-0.475,-0.44,-0.41,-0.36,-0.3,-0.24,-0.18,-0.11,-0.04,0.03,0.09,0.16,0.22,0.28,0.33,0.38,0.42,0.46,0.48,0.495,0.5,0.494,0.475,0.45,0.41,0.36,0.31,0.26,0.2,0.14,0.07,0.01,-0.06,-0.12,-0.18,-0.24,-0.29,-0.34,-0.39,-0.43,-0.46,-0.48,-0.495 PARAM_JOY_ON=0 PARAM_JOY1=0 PARAM_JOY2=0 PARAM_ANGER_ON=0 PARAM_ANGER1=0 PARAM_ANGER2=0 PARAM_FEAR_ON=0 PARAM_FEAR1=0 PARAM_FEAR2=0 PARAM_SURP_ON=0 PARAM_SURP1=0 PARAM_SURP2=0 PARAM_CRY_ON=0 PARAM_CRY1=0 PARAM_CRY2=0 PARAM_HANA_ON=0 PARAM_HANA=0 PARAM_HANA_2=0 VISIBLE:PARTS_01_EYE_002=0 VISIBLE:PARTS_01_EYE_003=0 VISIBLE:PARTS_01_EYE_004=0 VISIBLE:PARTS_01_EYE_001=1 VISIBLE:PARTS_01_ARMS_001=0 VISIBLE:PARTS_01_ARMS_002=1 VISIBLE:PARTS_02_EYE_001=1 VISIBLE:PARTS_02_ARMS_001=0 VISIBLE:PARTS_02_ARMS_002=1 VISIBLE:PARTS_03_EYE_001=1 VISIBLE:PARTS_03_ARMS_001=0 VISIBLE:PARTS_03_ARMS_002=1 VISIBLE:PARTS_04_EYE_001=1 VISIBLE:PARTS_04_ARMS_001=0 VISIBLE:PARTS_04_ARMS_002=1 VISIBLE:PARTS_05_EYE_001=1 VISIBLE:PARTS_05_ARMS_001=0 VISIBLE:PARTS_05_ARMS_002=1
{ "pile_set_name": "Github" }
AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions TYPE: lookup VERSION: 4.0.0 DEFAULT: array('td' => true, 'th' => true) --DESCRIPTION-- <p> When %AutoFormat.RemoveEmpty and %AutoFormat.RemoveEmpty.RemoveNbsp are enabled, this directive defines what HTML elements should not be removede if they have only a non-breaking space in them. </p> --# vim: et sw=4 sts=4
{ "pile_set_name": "Github" }
// Copyright 2009 the Sputnik authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /** * @name: S7.9_A10_T3; * @section: 7.9; * @assertion: Check {} for automatic semicolon insertion; * @description: Checking if execution of "({}) * 1" passes; */ //CHECK#1 ({}) * 1
{ "pile_set_name": "Github" }
############################################################################### # Copyright (c) 2016 IBM Corporation and others. # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # which accompanies this distribution, and is available at # http://www.eclipse.org/legal/epl-v10.html # # Contributors: # IBM Corporation - initial API and implementation ############################################################################### # #ISMESSAGEFILE FALSE #NLS_ENCODING=UNICODE #NLS_MESSAGEFORMAT_NONE # description=Dieses Feature ist eine Kombination der Liberty-Features, die Eclipse MicroProfile 2.0 f\u00fcr Cloud Native Java unterst\u00fctzen.
{ "pile_set_name": "Github" }
/* * Copyright 2016 LINE Corporation * * LINE Corporation 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 com.linecorp.bot.spring.boot; import static com.linecorp.bot.spring.boot.LineBotProperties.ChannelTokenSupplyMode.SUPPLIER; import static org.assertj.core.api.Assertions.assertThat; import static org.hibernate.validator.internal.engine.path.PathImpl.createPathFromString; import java.util.Set; import javax.validation.ConstraintViolation; import javax.validation.Validation; import javax.validation.Validator; import javax.validation.ValidatorFactory; import org.junit.BeforeClass; import org.junit.Test; public class BotPropertiesValidatorTest { private static Validator VALIDATOR; @BeforeClass public static void setUpClass() { ValidatorFactory factory = Validation.buildDefaultValidatorFactory(); VALIDATOR = factory.getValidator(); } @Test public void okForFixedTest() { // Do Set<ConstraintViolation<LineBotProperties>> constraintViolations = VALIDATOR.validate(new LineBotProperties() {{ setChannelSecret("SECRET"); setChannelToken("TOKEN"); }}); //Verify assertThat(constraintViolations).isEmpty(); } @Test public void ngForFixedTest() { // Do Set<ConstraintViolation<LineBotProperties>> constraintViolations = VALIDATOR.validate(new LineBotProperties() {{ setChannelSecret("SECRET"); }}); //Verify assertThat(constraintViolations) .isNotEmpty() .filteredOn("propertyPath", createPathFromString("channelToken")) .hasOnlyOneElementSatisfying(violation -> { assertThat(violation.getMessage()).isEqualTo("channelToken is null"); }); } @Test public void okForSupplierTest() { // Do Set<ConstraintViolation<LineBotProperties>> constraintViolations = VALIDATOR.validate(new LineBotProperties() {{ setChannelTokenSupplyMode(SUPPLIER); setChannelSecret("SECRET"); }}); //Verify assertThat(constraintViolations).isEmpty(); } @Test public void ngForSupplierTest() { // Do Set<ConstraintViolation<LineBotProperties>> constraintViolations = VALIDATOR.validate(new LineBotProperties() {{ setChannelTokenSupplyMode(SUPPLIER); setChannelSecret("SECRET"); setChannelToken("TOKEN"); }}); //Verify assertThat(constraintViolations) .isNotEmpty() .filteredOn("propertyPath", createPathFromString("channelToken")) .hasOnlyOneElementSatisfying(violation -> { assertThat(violation.getMessage()) .isEqualTo("channelToken should be null if channelTokenSupplyMode = SUPPLIER"); }); } }
{ "pile_set_name": "Github" }
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Runs Chromium's IndexedDB performance test. These test: Databases: create/delete Keys: create/delete Indexes: create/delete Data access: Random read/write Read cache Cursors: Read & random writes Walking multiple Seeking. """ import json import os from core import path_util from core import perf_benchmark from telemetry import page as page_module from telemetry import story from telemetry.page import legacy_page_test from telemetry.value import scalar from metrics import memory from metrics import power import page_sets from telemetry.timeline import chrome_trace_category_filter from telemetry.web_perf import timeline_based_measurement IDB_CATEGORY = 'IndexedDB' TIMELINE_REQUIRED_CATEGORY = 'blink.console' class _IndexedDbMeasurement(legacy_page_test.LegacyPageTest): def __init__(self): super(_IndexedDbMeasurement, self).__init__() self._memory_metric = None self._power_metric = None def WillStartBrowser(self, platform): """Initialize metrics once right before the browser has been launched.""" self._power_metric = power.PowerMetric(platform) def DidStartBrowser(self, browser): """Initialize metrics once right after the browser has been launched.""" self._memory_metric = memory.MemoryMetric(browser) def DidNavigateToPage(self, page, tab): self._memory_metric.Start(page, tab) self._power_metric.Start(page, tab) def ValidateAndMeasurePage(self, page, tab, results): tab.WaitForDocumentReadyStateToBeComplete() tab.WaitForJavaScriptExpression('window.done', 600) self._power_metric.Stop(page, tab) self._memory_metric.Stop(page, tab) self._memory_metric.AddResults(tab, results) self._power_metric.AddResults(tab, results) js_get_results = 'JSON.stringify(automation.getResults());' result_dict = json.loads(tab.EvaluateJavaScript(js_get_results)) total = 0.0 for key in result_dict: if key == 'OverallTestDuration': continue msec = float(result_dict[key]) results.AddValue(scalar.ScalarValue( results.current_page, key, 'ms', msec, important=False)) total += msec results.AddValue(scalar.ScalarValue( results.current_page, 'Total Perf', 'ms', total)) def CustomizeBrowserOptions(self, options): memory.MemoryMetric.CustomizeBrowserOptions(options) power.PowerMetric.CustomizeBrowserOptions(options) class IndexedDbOriginal(perf_benchmark.PerfBenchmark): """Chromium's IndexedDB Performance tests.""" test = _IndexedDbMeasurement @classmethod def Name(cls): return 'indexeddb_perf' def CreateStorySet(self, options): indexeddb_dir = os.path.join(path_util.GetChromiumSrcDir(), 'chrome', 'test', 'data', 'indexeddb') ps = story.StorySet(base_dir=indexeddb_dir) ps.AddStory(page_module.Page('file://perf_test.html', ps, ps.base_dir)) return ps class IndexedDbOriginalSectioned(perf_benchmark.PerfBenchmark): """Chromium's IndexedDB Performance tests.""" test = _IndexedDbMeasurement page_set = page_sets.IndexedDBEndurePageSet @classmethod def Name(cls): return 'storage.indexeddb_endure' class IndexedDbTracing(perf_benchmark.PerfBenchmark): """IndexedDB Performance tests that use tracing.""" page_set = page_sets.IndexedDBEndurePageSet def CreateTimelineBasedMeasurementOptions(self): cat_filter = chrome_trace_category_filter.ChromeTraceCategoryFilter() cat_filter.AddIncludedCategory(IDB_CATEGORY) cat_filter.AddIncludedCategory(TIMELINE_REQUIRED_CATEGORY) return timeline_based_measurement.Options( overhead_level=cat_filter) @classmethod def Name(cls): return 'storage.indexeddb_endure_tracing' @classmethod def ValueCanBeAddedPredicate(cls, value, is_first_result): return 'idb' in value.name
{ "pile_set_name": "Github" }
/* Copyright 2015 The Kubernetes Authors All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package unversioned import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/apis/policy" "k8s.io/kubernetes/pkg/watch" ) // PodDisruptionBudgetNamespacer has methods to work with PodDisruptionBudget resources in a namespace type PodDisruptionBudgetNamespacer interface { PodDisruptionBudgets(namespace string) PodDisruptionBudgetInterface } // PodDisruptionBudgetInterface exposes methods to work on PodDisruptionBudget resources. type PodDisruptionBudgetInterface interface { List(opts api.ListOptions) (*policy.PodDisruptionBudgetList, error) Get(name string) (*policy.PodDisruptionBudget, error) Create(podDisruptionBudget *policy.PodDisruptionBudget) (*policy.PodDisruptionBudget, error) Update(podDisruptionBudget *policy.PodDisruptionBudget) (*policy.PodDisruptionBudget, error) Delete(name string, options *api.DeleteOptions) error Watch(opts api.ListOptions) (watch.Interface, error) UpdateStatus(podDisruptionBudget *policy.PodDisruptionBudget) (*policy.PodDisruptionBudget, error) } // podDisruptionBudget implements PodDisruptionBudgetNamespacer interface type podDisruptionBudget struct { r *PolicyClient ns string } // newPodDisruptionBudget returns a podDisruptionBudget func newPodDisruptionBudget(c *PolicyClient, namespace string) *podDisruptionBudget { return &podDisruptionBudget{c, namespace} } // List returns a list of podDisruptionBudget that match the label and field selectors. func (c *podDisruptionBudget) List(opts api.ListOptions) (result *policy.PodDisruptionBudgetList, err error) { result = &policy.PodDisruptionBudgetList{} err = c.r.Get().Namespace(c.ns).Resource("poddisruptionbudgets").VersionedParams(&opts, api.ParameterCodec).Do().Into(result) return } // Get returns information about a particular podDisruptionBudget. func (c *podDisruptionBudget) Get(name string) (result *policy.PodDisruptionBudget, err error) { result = &policy.PodDisruptionBudget{} err = c.r.Get().Namespace(c.ns).Resource("poddisruptionbudgets").Name(name).Do().Into(result) return } // Create creates a new podDisruptionBudget. func (c *podDisruptionBudget) Create(podDisruptionBudget *policy.PodDisruptionBudget) (result *policy.PodDisruptionBudget, err error) { result = &policy.PodDisruptionBudget{} err = c.r.Post().Namespace(c.ns).Resource("poddisruptionbudgets").Body(podDisruptionBudget).Do().Into(result) return } // Update updates an existing podDisruptionBudget. func (c *podDisruptionBudget) Update(podDisruptionBudget *policy.PodDisruptionBudget) (result *policy.PodDisruptionBudget, err error) { result = &policy.PodDisruptionBudget{} err = c.r.Put().Namespace(c.ns).Resource("poddisruptionbudgets").Name(podDisruptionBudget.Name).Body(podDisruptionBudget).Do().Into(result) return } // Delete deletes a podDisruptionBudget, returns error if one occurs. func (c *podDisruptionBudget) Delete(name string, options *api.DeleteOptions) (err error) { return c.r.Delete().Namespace(c.ns).Resource("poddisruptionbudgets").Name(name).Body(options).Do().Error() } // Watch returns a watch.Interface that watches the requested podDisruptionBudget. func (c *podDisruptionBudget) Watch(opts api.ListOptions) (watch.Interface, error) { return c.r.Get(). Prefix("watch"). Namespace(c.ns). Resource("poddisruptionbudgets"). VersionedParams(&opts, api.ParameterCodec). Watch() } // UpdateStatus takes the name of the podDisruptionBudget and the new status. Returns the server's representation of the podDisruptionBudget, and an error, if it occurs. func (c *podDisruptionBudget) UpdateStatus(podDisruptionBudget *policy.PodDisruptionBudget) (result *policy.PodDisruptionBudget, err error) { result = &policy.PodDisruptionBudget{} err = c.r.Put().Namespace(c.ns).Resource("poddisruptionbudgets").Name(podDisruptionBudget.Name).SubResource("status").Body(podDisruptionBudget).Do().Into(result) return }
{ "pile_set_name": "Github" }
/* crypto/asn1/a_print.c */ /* Copyright (C) 1995-1998 Eric Young ([email protected]) * All rights reserved. * * This package is an SSL implementation written * by Eric Young ([email protected]). * The implementation was written so as to conform with Netscapes SSL. * * This library is free for commercial and non-commercial use as long as * the following conditions are aheared to. The following conditions * apply to all code found in this distribution, be it the RC4, RSA, * lhash, DES, etc., code; not just the SSL code. The SSL documentation * included with this distribution is covered by the same copyright terms * except that the holder is Tim Hudson ([email protected]). * * Copyright remains Eric Young's, and as such any Copyright notices in * the code are not to be removed. * If this package is used in a product, Eric Young should be given attribution * as the author of the parts of the library used. * This can be in the form of a textual message at program startup or * in documentation (online or textual) provided with the package. * * 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 copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * "This product includes cryptographic software written by * Eric Young ([email protected])" * The word 'cryptographic' can be left out if the rouines from the library * being used are not cryptographic related :-). * 4. If you include any Windows specific code (or a derivative thereof) from * the apps directory (application code) you must include an acknowledgement: * "This product includes software written by Tim Hudson ([email protected])" * * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``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 AUTHOR 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. * * The licence and distribution terms for any publically available version or * derivative of this code cannot be changed. i.e. this code cannot simply be * copied and put under another distribution licence * [including the GNU Public Licence.] */ #include <stdio.h> #include "cryptlib.h" #include <openssl/asn1.h> int ASN1_PRINTABLE_type(const unsigned char *s, int len) { int c; int ia5=0; int t61=0; if (len <= 0) len= -1; if (s == NULL) return(V_ASN1_PRINTABLESTRING); while ((*s) && (len-- != 0)) { c= *(s++); #ifndef CHARSET_EBCDIC if (!( ((c >= 'a') && (c <= 'z')) || ((c >= 'A') && (c <= 'Z')) || (c == ' ') || ((c >= '0') && (c <= '9')) || (c == ' ') || (c == '\'') || (c == '(') || (c == ')') || (c == '+') || (c == ',') || (c == '-') || (c == '.') || (c == '/') || (c == ':') || (c == '=') || (c == '?'))) ia5=1; if (c&0x80) t61=1; #else if (!isalnum(c) && (c != ' ') && strchr("'()+,-./:=?", c) == NULL) ia5=1; if (os_toascii[c] & 0x80) t61=1; #endif } if (t61) return(V_ASN1_T61STRING); if (ia5) return(V_ASN1_IA5STRING); return(V_ASN1_PRINTABLESTRING); } int ASN1_UNIVERSALSTRING_to_string(ASN1_UNIVERSALSTRING *s) { int i; unsigned char *p; if (s->type != V_ASN1_UNIVERSALSTRING) return(0); if ((s->length%4) != 0) return(0); p=s->data; for (i=0; i<s->length; i+=4) { if ((p[0] != '\0') || (p[1] != '\0') || (p[2] != '\0')) break; else p+=4; } if (i < s->length) return(0); p=s->data; for (i=3; i<s->length; i+=4) { *(p++)=s->data[i]; } *(p)='\0'; s->length/=4; s->type=ASN1_PRINTABLE_type(s->data,s->length); return(1); }
{ "pile_set_name": "Github" }
// // UIView+IBExtension.h // Weibo11 // // Created by JYJ on 15/12/6. // Copyright © 2015年 itheima. All rights reserved. // #import <UIKit/UIKit.h> IB_DESIGNABLE @interface UIView (IBExtension) /// 边线颜色 @property (nonatomic, strong) IBInspectable UIColor *borderColor; /// 边线宽度 @property (nonatomic, assign) IBInspectable CGFloat borderWidth; /// 脚半径 @property (nonatomic, assign) IBInspectable CGFloat cornerRadius; @end
{ "pile_set_name": "Github" }
# -*- coding: utf-8 -*- # Copyright 2018 The Blueoil Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================= import tensorflow as tf class TensorflowGraphRunner: """This class Loads Tensorflow Graph with Protocol Buffer File""" def __init__(self, model_path): """Initialize by setting the model path first. Args: model_path(string): The protocol buffer file location. """ self.sess = None self.output_op = None self.images_placeholder = None self.model_path = model_path def init(self): """Load the tensor graph using protobuf file as model_path""" graph = tf.Graph() with graph.as_default(): with open(self.model_path, 'rb') as f: graph_def = tf.compat.v1.GraphDef() graph_def.ParseFromString(f.read()) tf.import_graph_def(graph_def, name="") init_op = tf.compat.v1.global_variables_initializer() self.images_placeholder = graph.get_tensor_by_name('images_placeholder:0') self.output_op = graph.get_tensor_by_name('output:0') session_config = tf.compat.v1.ConfigProto() session_config.gpu_options.allow_growth = True self.sess = tf.compat.v1.Session(graph=graph, config=session_config) self.sess.run(init_op) def run(self, data): """Run the data on the tf graph Args: data: returned result of the graph Returns: array: The result array of the graph """ return self.sess.run(self.output_op, feed_dict={self.images_placeholder: data})
{ "pile_set_name": "Github" }
using Bridge.Test.NUnit; using System; using System.Globalization; #if false namespace Bridge.ClientTest.Format { [Category(Constants.MODULE_NUMBERFORMATINFO)] [TestFixture(TestNameFormat = "NumberFormatInfoTests - {0}")] public class NumberFormatInfoTests { [Test] public void TypePropertiesAreCorrect() { var format = NumberFormatInfo.InvariantInfo; Assert.AreEqual("System.Globalization.NumberFormatInfo", typeof(NumberFormatInfo).FullName); Assert.True(typeof(NumberFormatInfo).IsClass); Assert.True(format is NumberFormatInfo); Assert.AreEqual(new[] { typeof(IFormatProvider), typeof(ICloneable) }, typeof(NumberFormatInfo).GetInterfaces()); } [Test] public void GetFormatWorks() { var format = NumberFormatInfo.InvariantInfo; Assert.AreEqual(null, format.GetFormat(typeof(int))); Assert.AreEqual(format, format.GetFormat(typeof(NumberFormatInfo))); } [Test] public void InvariantWorks() { var format = NumberFormatInfo.InvariantInfo; Assert.AreEqual("NaN", format.NaNSymbol); Assert.AreEqual("-", format.NegativeSign); Assert.AreEqual("+", format.PositiveSign); Assert.AreEqual("-Infinity", format.NegativeInfinitySymbol); Assert.AreEqual("Infinity", format.PositiveInfinitySymbol); Assert.AreEqual("%", format.PercentSymbol); Assert.AreEqual(new[] { 3 }, format.PercentGroupSizes); Assert.AreEqual(2, format.PercentDecimalDigits); Assert.AreEqual(".", format.PercentDecimalSeparator); Assert.AreEqual(",", format.PercentGroupSeparator); Assert.AreEqual(0, format.PercentPositivePattern); Assert.AreEqual(0, format.PercentNegativePattern); Assert.AreEqual("¤", format.CurrencySymbol); Assert.AreEqual(new[] { 3 }, format.CurrencyGroupSizes); Assert.AreEqual(2, format.CurrencyDecimalDigits); Assert.AreEqual(".", format.CurrencyDecimalSeparator); Assert.AreEqual(",", format.CurrencyGroupSeparator); Assert.AreEqual(0, format.CurrencyNegativePattern); Assert.AreEqual(0, format.CurrencyPositivePattern); Assert.AreEqual(new[] { 3 }, format.NumberGroupSizes); Assert.AreEqual(2, format.NumberDecimalDigits); Assert.AreEqual(".", format.NumberDecimalSeparator); Assert.AreEqual(",", format.NumberGroupSeparator); } } } #endif
{ "pile_set_name": "Github" }
'use strict'; angular.module("ngLocale", [], ["$provide", function($provide) { var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"}; function getDecimals(n) { n = n + ''; var i = n.indexOf('.'); return (i == -1) ? 0 : n.length - i - 1; } function getVF(n, opt_precision) { var v = opt_precision; if (undefined === v) { v = Math.min(getDecimals(n), 3); } var base = Math.pow(10, v); var f = ((n * base) | 0) % base; return {v: v, f: f}; } $provide.value("$locale", { "DATETIME_FORMATS": { "AMPMS": [ "um fyrrapartur", "um seinnapartur" ], "DAY": [ "sunnudagur", "m\u00e1nadagur", "t\u00fdsdagur", "mikudagur", "h\u00f3sdagur", "fr\u00edggjadagur", "leygardagur" ], "MONTH": [ "januar", "februar", "mars", "apr\u00edl", "mai", "juni", "juli", "august", "september", "oktober", "november", "desember" ], "SHORTDAY": [ "sun", "m\u00e1n", "t\u00fds", "mik", "h\u00f3s", "fr\u00ed", "ley" ], "SHORTMONTH": [ "jan", "feb", "mar", "apr", "mai", "jun", "jul", "aug", "sep", "okt", "nov", "des" ], "fullDate": "EEEE dd MMMM y", "longDate": "d. MMM y", "medium": "dd-MM-y HH:mm:ss", "mediumDate": "dd-MM-y", "mediumTime": "HH:mm:ss", "short": "dd-MM-yy HH:mm", "shortDate": "dd-MM-yy", "shortTime": "HH:mm" }, "NUMBER_FORMATS": { "CURRENCY_SYM": "kr", "DECIMAL_SEP": ",", "GROUP_SEP": ".", "PATTERNS": [ { "gSize": 3, "lgSize": 3, "maxFrac": 3, "minFrac": 0, "minInt": 1, "negPre": "-", "negSuf": "", "posPre": "", "posSuf": "" }, { "gSize": 3, "lgSize": 3, "maxFrac": 2, "minFrac": 2, "minInt": 1, "negPre": "\u00a4-", "negSuf": "", "posPre": "\u00a4", "posSuf": "" } ] }, "id": "fo", "pluralCat": function (n, opt_precision) { var i = n | 0; var vf = getVF(n, opt_precision); if (i == 1 && vf.v == 0) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;} }); }]);
{ "pile_set_name": "Github" }
*> \brief <b> DGEESX computes the eigenvalues, the Schur form, and, optionally, the matrix of Schur vectors for GE matrices</b> * * =========== DOCUMENTATION =========== * * Online html documentation available at * http://www.netlib.org/lapack/explore-html/ * *> \htmlonly *> Download DGEESX + dependencies *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dgeesx.f"> *> [TGZ]</a> *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dgeesx.f"> *> [ZIP]</a> *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dgeesx.f"> *> [TXT]</a> *> \endhtmlonly * * Definition: * =========== * * SUBROUTINE DGEESX( JOBVS, SORT, SELECT, SENSE, N, A, LDA, SDIM, * WR, WI, VS, LDVS, RCONDE, RCONDV, WORK, LWORK, * IWORK, LIWORK, BWORK, INFO ) * * .. Scalar Arguments .. * CHARACTER JOBVS, SENSE, SORT * INTEGER INFO, LDA, LDVS, LIWORK, LWORK, N, SDIM * DOUBLE PRECISION RCONDE, RCONDV * .. * .. Array Arguments .. * LOGICAL BWORK( * ) * INTEGER IWORK( * ) * DOUBLE PRECISION A( LDA, * ), VS( LDVS, * ), WI( * ), WORK( * ), * $ WR( * ) * .. * .. Function Arguments .. * LOGICAL SELECT * EXTERNAL SELECT * .. * * *> \par Purpose: * ============= *> *> \verbatim *> *> DGEESX computes for an N-by-N real nonsymmetric matrix A, the *> eigenvalues, the real Schur form T, and, optionally, the matrix of *> Schur vectors Z. This gives the Schur factorization A = Z*T*(Z**T). *> *> Optionally, it also orders the eigenvalues on the diagonal of the *> real Schur form so that selected eigenvalues are at the top left; *> computes a reciprocal condition number for the average of the *> selected eigenvalues (RCONDE); and computes a reciprocal condition *> number for the right invariant subspace corresponding to the *> selected eigenvalues (RCONDV). The leading columns of Z form an *> orthonormal basis for this invariant subspace. *> *> For further explanation of the reciprocal condition numbers RCONDE *> and RCONDV, see Section 4.10 of the LAPACK Users' Guide (where *> these quantities are called s and sep respectively). *> *> A real matrix is in real Schur form if it is upper quasi-triangular *> with 1-by-1 and 2-by-2 blocks. 2-by-2 blocks will be standardized in *> the form *> [ a b ] *> [ c a ] *> *> where b*c < 0. The eigenvalues of such a block are a +- sqrt(bc). *> \endverbatim * * Arguments: * ========== * *> \param[in] JOBVS *> \verbatim *> JOBVS is CHARACTER*1 *> = 'N': Schur vectors are not computed; *> = 'V': Schur vectors are computed. *> \endverbatim *> *> \param[in] SORT *> \verbatim *> SORT is CHARACTER*1 *> Specifies whether or not to order the eigenvalues on the *> diagonal of the Schur form. *> = 'N': Eigenvalues are not ordered; *> = 'S': Eigenvalues are ordered (see SELECT). *> \endverbatim *> *> \param[in] SELECT *> \verbatim *> SELECT is a LOGICAL FUNCTION of two DOUBLE PRECISION arguments *> SELECT must be declared EXTERNAL in the calling subroutine. *> If SORT = 'S', SELECT is used to select eigenvalues to sort *> to the top left of the Schur form. *> If SORT = 'N', SELECT is not referenced. *> An eigenvalue WR(j)+sqrt(-1)*WI(j) is selected if *> SELECT(WR(j),WI(j)) is true; i.e., if either one of a *> complex conjugate pair of eigenvalues is selected, then both *> are. Note that a selected complex eigenvalue may no longer *> satisfy SELECT(WR(j),WI(j)) = .TRUE. after ordering, since *> ordering may change the value of complex eigenvalues *> (especially if the eigenvalue is ill-conditioned); in this *> case INFO may be set to N+3 (see INFO below). *> \endverbatim *> *> \param[in] SENSE *> \verbatim *> SENSE is CHARACTER*1 *> Determines which reciprocal condition numbers are computed. *> = 'N': None are computed; *> = 'E': Computed for average of selected eigenvalues only; *> = 'V': Computed for selected right invariant subspace only; *> = 'B': Computed for both. *> If SENSE = 'E', 'V' or 'B', SORT must equal 'S'. *> \endverbatim *> *> \param[in] N *> \verbatim *> N is INTEGER *> The order of the matrix A. N >= 0. *> \endverbatim *> *> \param[in,out] A *> \verbatim *> A is DOUBLE PRECISION array, dimension (LDA, N) *> On entry, the N-by-N matrix A. *> On exit, A is overwritten by its real Schur form T. *> \endverbatim *> *> \param[in] LDA *> \verbatim *> LDA is INTEGER *> The leading dimension of the array A. LDA >= max(1,N). *> \endverbatim *> *> \param[out] SDIM *> \verbatim *> SDIM is INTEGER *> If SORT = 'N', SDIM = 0. *> If SORT = 'S', SDIM = number of eigenvalues (after sorting) *> for which SELECT is true. (Complex conjugate *> pairs for which SELECT is true for either *> eigenvalue count as 2.) *> \endverbatim *> *> \param[out] WR *> \verbatim *> WR is DOUBLE PRECISION array, dimension (N) *> \endverbatim *> *> \param[out] WI *> \verbatim *> WI is DOUBLE PRECISION array, dimension (N) *> WR and WI contain the real and imaginary parts, respectively, *> of the computed eigenvalues, in the same order that they *> appear on the diagonal of the output Schur form T. Complex *> conjugate pairs of eigenvalues appear consecutively with the *> eigenvalue having the positive imaginary part first. *> \endverbatim *> *> \param[out] VS *> \verbatim *> VS is DOUBLE PRECISION array, dimension (LDVS,N) *> If JOBVS = 'V', VS contains the orthogonal matrix Z of Schur *> vectors. *> If JOBVS = 'N', VS is not referenced. *> \endverbatim *> *> \param[in] LDVS *> \verbatim *> LDVS is INTEGER *> The leading dimension of the array VS. LDVS >= 1, and if *> JOBVS = 'V', LDVS >= N. *> \endverbatim *> *> \param[out] RCONDE *> \verbatim *> RCONDE is DOUBLE PRECISION *> If SENSE = 'E' or 'B', RCONDE contains the reciprocal *> condition number for the average of the selected eigenvalues. *> Not referenced if SENSE = 'N' or 'V'. *> \endverbatim *> *> \param[out] RCONDV *> \verbatim *> RCONDV is DOUBLE PRECISION *> If SENSE = 'V' or 'B', RCONDV contains the reciprocal *> condition number for the selected right invariant subspace. *> Not referenced if SENSE = 'N' or 'E'. *> \endverbatim *> *> \param[out] WORK *> \verbatim *> WORK is DOUBLE PRECISION array, dimension (MAX(1,LWORK)) *> On exit, if INFO = 0, WORK(1) returns the optimal LWORK. *> \endverbatim *> *> \param[in] LWORK *> \verbatim *> LWORK is INTEGER *> The dimension of the array WORK. LWORK >= max(1,3*N). *> Also, if SENSE = 'E' or 'V' or 'B', *> LWORK >= N+2*SDIM*(N-SDIM), where SDIM is the number of *> selected eigenvalues computed by this routine. Note that *> N+2*SDIM*(N-SDIM) <= N+N*N/2. Note also that an error is only *> returned if LWORK < max(1,3*N), but if SENSE = 'E' or 'V' or *> 'B' this may not be large enough. *> For good performance, LWORK must generally be larger. *> *> If LWORK = -1, then a workspace query is assumed; the routine *> only calculates upper bounds on the optimal sizes of the *> arrays WORK and IWORK, returns these values as the first *> entries of the WORK and IWORK arrays, and no error messages *> related to LWORK or LIWORK are issued by XERBLA. *> \endverbatim *> *> \param[out] IWORK *> \verbatim *> IWORK is INTEGER array, dimension (MAX(1,LIWORK)) *> On exit, if INFO = 0, IWORK(1) returns the optimal LIWORK. *> \endverbatim *> *> \param[in] LIWORK *> \verbatim *> LIWORK is INTEGER *> The dimension of the array IWORK. *> LIWORK >= 1; if SENSE = 'V' or 'B', LIWORK >= SDIM*(N-SDIM). *> Note that SDIM*(N-SDIM) <= N*N/4. Note also that an error is *> only returned if LIWORK < 1, but if SENSE = 'V' or 'B' this *> may not be large enough. *> *> If LIWORK = -1, then a workspace query is assumed; the *> routine only calculates upper bounds on the optimal sizes of *> the arrays WORK and IWORK, returns these values as the first *> entries of the WORK and IWORK arrays, and no error messages *> related to LWORK or LIWORK are issued by XERBLA. *> \endverbatim *> *> \param[out] BWORK *> \verbatim *> BWORK is LOGICAL array, dimension (N) *> Not referenced if SORT = 'N'. *> \endverbatim *> *> \param[out] INFO *> \verbatim *> INFO is INTEGER *> = 0: successful exit *> < 0: if INFO = -i, the i-th argument had an illegal value. *> > 0: if INFO = i, and i is *> <= N: the QR algorithm failed to compute all the *> eigenvalues; elements 1:ILO-1 and i+1:N of WR and WI *> contain those eigenvalues which have converged; if *> JOBVS = 'V', VS contains the transformation which *> reduces A to its partially converged Schur form. *> = N+1: the eigenvalues could not be reordered because some *> eigenvalues were too close to separate (the problem *> is very ill-conditioned); *> = N+2: after reordering, roundoff changed values of some *> complex eigenvalues so that leading eigenvalues in *> the Schur form no longer satisfy SELECT=.TRUE. This *> could also be caused by underflow due to scaling. *> \endverbatim * * Authors: * ======== * *> \author Univ. of Tennessee *> \author Univ. of California Berkeley *> \author Univ. of Colorado Denver *> \author NAG Ltd. * *> \date June 2016 * *> \ingroup doubleGEeigen * * ===================================================================== SUBROUTINE DGEESX( JOBVS, SORT, SELECT, SENSE, N, A, LDA, SDIM, $ WR, WI, VS, LDVS, RCONDE, RCONDV, WORK, LWORK, $ IWORK, LIWORK, BWORK, INFO ) * * -- LAPACK driver routine (version 3.7.0) -- * -- LAPACK is a software package provided by Univ. of Tennessee, -- * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- * June 2016 * * .. Scalar Arguments .. CHARACTER JOBVS, SENSE, SORT INTEGER INFO, LDA, LDVS, LIWORK, LWORK, N, SDIM DOUBLE PRECISION RCONDE, RCONDV * .. * .. Array Arguments .. LOGICAL BWORK( * ) INTEGER IWORK( * ) DOUBLE PRECISION A( LDA, * ), VS( LDVS, * ), WI( * ), WORK( * ), $ WR( * ) * .. * .. Function Arguments .. LOGICAL SELECT EXTERNAL SELECT * .. * * ===================================================================== * * .. Parameters .. DOUBLE PRECISION ZERO, ONE PARAMETER ( ZERO = 0.0D0, ONE = 1.0D0 ) * .. * .. Local Scalars .. LOGICAL CURSL, LASTSL, LQUERY, LST2SL, SCALEA, WANTSB, $ WANTSE, WANTSN, WANTST, WANTSV, WANTVS INTEGER HSWORK, I, I1, I2, IBAL, ICOND, IERR, IEVAL, $ IHI, ILO, INXT, IP, ITAU, IWRK, LIWRK, LWRK, $ MAXWRK, MINWRK DOUBLE PRECISION ANRM, BIGNUM, CSCALE, EPS, SMLNUM * .. * .. Local Arrays .. DOUBLE PRECISION DUM( 1 ) * .. * .. External Subroutines .. EXTERNAL DCOPY, DGEBAK, DGEBAL, DGEHRD, DHSEQR, DLACPY, $ DLASCL, DORGHR, DSWAP, DTRSEN, XERBLA * .. * .. External Functions .. LOGICAL LSAME INTEGER ILAENV DOUBLE PRECISION DLAMCH, DLANGE EXTERNAL LSAME, ILAENV, DLABAD, DLAMCH, DLANGE * .. * .. Intrinsic Functions .. INTRINSIC MAX, SQRT * .. * .. Executable Statements .. * * Test the input arguments * INFO = 0 WANTVS = LSAME( JOBVS, 'V' ) WANTST = LSAME( SORT, 'S' ) WANTSN = LSAME( SENSE, 'N' ) WANTSE = LSAME( SENSE, 'E' ) WANTSV = LSAME( SENSE, 'V' ) WANTSB = LSAME( SENSE, 'B' ) LQUERY = ( LWORK.EQ.-1 .OR. LIWORK.EQ.-1 ) * IF( ( .NOT.WANTVS ) .AND. ( .NOT.LSAME( JOBVS, 'N' ) ) ) THEN INFO = -1 ELSE IF( ( .NOT.WANTST ) .AND. ( .NOT.LSAME( SORT, 'N' ) ) ) THEN INFO = -2 ELSE IF( .NOT.( WANTSN .OR. WANTSE .OR. WANTSV .OR. WANTSB ) .OR. $ ( .NOT.WANTST .AND. .NOT.WANTSN ) ) THEN INFO = -4 ELSE IF( N.LT.0 ) THEN INFO = -5 ELSE IF( LDA.LT.MAX( 1, N ) ) THEN INFO = -7 ELSE IF( LDVS.LT.1 .OR. ( WANTVS .AND. LDVS.LT.N ) ) THEN INFO = -12 END IF * * Compute workspace * (Note: Comments in the code beginning "RWorkspace:" describe the * minimal amount of real workspace needed at that point in the * code, as well as the preferred amount for good performance. * IWorkspace refers to integer workspace. * NB refers to the optimal block size for the immediately * following subroutine, as returned by ILAENV. * HSWORK refers to the workspace preferred by DHSEQR, as * calculated below. HSWORK is computed assuming ILO=1 and IHI=N, * the worst case. * If SENSE = 'E', 'V' or 'B', then the amount of workspace needed * depends on SDIM, which is computed by the routine DTRSEN later * in the code.) * IF( INFO.EQ.0 ) THEN LIWRK = 1 IF( N.EQ.0 ) THEN MINWRK = 1 LWRK = 1 ELSE MAXWRK = 2*N + N*ILAENV( 1, 'DGEHRD', ' ', N, 1, N, 0 ) MINWRK = 3*N * CALL DHSEQR( 'S', JOBVS, N, 1, N, A, LDA, WR, WI, VS, LDVS, $ WORK, -1, IEVAL ) HSWORK = WORK( 1 ) * IF( .NOT.WANTVS ) THEN MAXWRK = MAX( MAXWRK, N + HSWORK ) ELSE MAXWRK = MAX( MAXWRK, 2*N + ( N - 1 )*ILAENV( 1, $ 'DORGHR', ' ', N, 1, N, -1 ) ) MAXWRK = MAX( MAXWRK, N + HSWORK ) END IF LWRK = MAXWRK IF( .NOT.WANTSN ) $ LWRK = MAX( LWRK, N + ( N*N )/2 ) IF( WANTSV .OR. WANTSB ) $ LIWRK = ( N*N )/4 END IF IWORK( 1 ) = LIWRK WORK( 1 ) = LWRK * IF( LWORK.LT.MINWRK .AND. .NOT.LQUERY ) THEN INFO = -16 ELSE IF( LIWORK.LT.1 .AND. .NOT.LQUERY ) THEN INFO = -18 END IF END IF * IF( INFO.NE.0 ) THEN CALL XERBLA( 'DGEESX', -INFO ) RETURN ELSE IF( LQUERY ) THEN RETURN END IF * * Quick return if possible * IF( N.EQ.0 ) THEN SDIM = 0 RETURN END IF * * Get machine constants * EPS = DLAMCH( 'P' ) SMLNUM = DLAMCH( 'S' ) BIGNUM = ONE / SMLNUM CALL DLABAD( SMLNUM, BIGNUM ) SMLNUM = SQRT( SMLNUM ) / EPS BIGNUM = ONE / SMLNUM * * Scale A if max element outside range [SMLNUM,BIGNUM] * ANRM = DLANGE( 'M', N, N, A, LDA, DUM ) SCALEA = .FALSE. IF( ANRM.GT.ZERO .AND. ANRM.LT.SMLNUM ) THEN SCALEA = .TRUE. CSCALE = SMLNUM ELSE IF( ANRM.GT.BIGNUM ) THEN SCALEA = .TRUE. CSCALE = BIGNUM END IF IF( SCALEA ) $ CALL DLASCL( 'G', 0, 0, ANRM, CSCALE, N, N, A, LDA, IERR ) * * Permute the matrix to make it more nearly triangular * (RWorkspace: need N) * IBAL = 1 CALL DGEBAL( 'P', N, A, LDA, ILO, IHI, WORK( IBAL ), IERR ) * * Reduce to upper Hessenberg form * (RWorkspace: need 3*N, prefer 2*N+N*NB) * ITAU = N + IBAL IWRK = N + ITAU CALL DGEHRD( N, ILO, IHI, A, LDA, WORK( ITAU ), WORK( IWRK ), $ LWORK-IWRK+1, IERR ) * IF( WANTVS ) THEN * * Copy Householder vectors to VS * CALL DLACPY( 'L', N, N, A, LDA, VS, LDVS ) * * Generate orthogonal matrix in VS * (RWorkspace: need 3*N-1, prefer 2*N+(N-1)*NB) * CALL DORGHR( N, ILO, IHI, VS, LDVS, WORK( ITAU ), WORK( IWRK ), $ LWORK-IWRK+1, IERR ) END IF * SDIM = 0 * * Perform QR iteration, accumulating Schur vectors in VS if desired * (RWorkspace: need N+1, prefer N+HSWORK (see comments) ) * IWRK = ITAU CALL DHSEQR( 'S', JOBVS, N, ILO, IHI, A, LDA, WR, WI, VS, LDVS, $ WORK( IWRK ), LWORK-IWRK+1, IEVAL ) IF( IEVAL.GT.0 ) $ INFO = IEVAL * * Sort eigenvalues if desired * IF( WANTST .AND. INFO.EQ.0 ) THEN IF( SCALEA ) THEN CALL DLASCL( 'G', 0, 0, CSCALE, ANRM, N, 1, WR, N, IERR ) CALL DLASCL( 'G', 0, 0, CSCALE, ANRM, N, 1, WI, N, IERR ) END IF DO 10 I = 1, N BWORK( I ) = SELECT( WR( I ), WI( I ) ) 10 CONTINUE * * Reorder eigenvalues, transform Schur vectors, and compute * reciprocal condition numbers * (RWorkspace: if SENSE is not 'N', need N+2*SDIM*(N-SDIM) * otherwise, need N ) * (IWorkspace: if SENSE is 'V' or 'B', need SDIM*(N-SDIM) * otherwise, need 0 ) * CALL DTRSEN( SENSE, JOBVS, BWORK, N, A, LDA, VS, LDVS, WR, WI, $ SDIM, RCONDE, RCONDV, WORK( IWRK ), LWORK-IWRK+1, $ IWORK, LIWORK, ICOND ) IF( .NOT.WANTSN ) $ MAXWRK = MAX( MAXWRK, N+2*SDIM*( N-SDIM ) ) IF( ICOND.EQ.-15 ) THEN * * Not enough real workspace * INFO = -16 ELSE IF( ICOND.EQ.-17 ) THEN * * Not enough integer workspace * INFO = -18 ELSE IF( ICOND.GT.0 ) THEN * * DTRSEN failed to reorder or to restore standard Schur form * INFO = ICOND + N END IF END IF * IF( WANTVS ) THEN * * Undo balancing * (RWorkspace: need N) * CALL DGEBAK( 'P', 'R', N, ILO, IHI, WORK( IBAL ), N, VS, LDVS, $ IERR ) END IF * IF( SCALEA ) THEN * * Undo scaling for the Schur form of A * CALL DLASCL( 'H', 0, 0, CSCALE, ANRM, N, N, A, LDA, IERR ) CALL DCOPY( N, A, LDA+1, WR, 1 ) IF( ( WANTSV .OR. WANTSB ) .AND. INFO.EQ.0 ) THEN DUM( 1 ) = RCONDV CALL DLASCL( 'G', 0, 0, CSCALE, ANRM, 1, 1, DUM, 1, IERR ) RCONDV = DUM( 1 ) END IF IF( CSCALE.EQ.SMLNUM ) THEN * * If scaling back towards underflow, adjust WI if an * offdiagonal element of a 2-by-2 block in the Schur form * underflows. * IF( IEVAL.GT.0 ) THEN I1 = IEVAL + 1 I2 = IHI - 1 CALL DLASCL( 'G', 0, 0, CSCALE, ANRM, ILO-1, 1, WI, N, $ IERR ) ELSE IF( WANTST ) THEN I1 = 1 I2 = N - 1 ELSE I1 = ILO I2 = IHI - 1 END IF INXT = I1 - 1 DO 20 I = I1, I2 IF( I.LT.INXT ) $ GO TO 20 IF( WI( I ).EQ.ZERO ) THEN INXT = I + 1 ELSE IF( A( I+1, I ).EQ.ZERO ) THEN WI( I ) = ZERO WI( I+1 ) = ZERO ELSE IF( A( I+1, I ).NE.ZERO .AND. A( I, I+1 ).EQ. $ ZERO ) THEN WI( I ) = ZERO WI( I+1 ) = ZERO IF( I.GT.1 ) $ CALL DSWAP( I-1, A( 1, I ), 1, A( 1, I+1 ), 1 ) IF( N.GT.I+1 ) $ CALL DSWAP( N-I-1, A( I, I+2 ), LDA, $ A( I+1, I+2 ), LDA ) IF( WANTVS ) THEN CALL DSWAP( N, VS( 1, I ), 1, VS( 1, I+1 ), 1 ) END IF A( I, I+1 ) = A( I+1, I ) A( I+1, I ) = ZERO END IF INXT = I + 2 END IF 20 CONTINUE END IF CALL DLASCL( 'G', 0, 0, CSCALE, ANRM, N-IEVAL, 1, $ WI( IEVAL+1 ), MAX( N-IEVAL, 1 ), IERR ) END IF * IF( WANTST .AND. INFO.EQ.0 ) THEN * * Check if reordering successful * LASTSL = .TRUE. LST2SL = .TRUE. SDIM = 0 IP = 0 DO 30 I = 1, N CURSL = SELECT( WR( I ), WI( I ) ) IF( WI( I ).EQ.ZERO ) THEN IF( CURSL ) $ SDIM = SDIM + 1 IP = 0 IF( CURSL .AND. .NOT.LASTSL ) $ INFO = N + 2 ELSE IF( IP.EQ.1 ) THEN * * Last eigenvalue of conjugate pair * CURSL = CURSL .OR. LASTSL LASTSL = CURSL IF( CURSL ) $ SDIM = SDIM + 2 IP = -1 IF( CURSL .AND. .NOT.LST2SL ) $ INFO = N + 2 ELSE * * First eigenvalue of conjugate pair * IP = 1 END IF END IF LST2SL = LASTSL LASTSL = CURSL 30 CONTINUE END IF * WORK( 1 ) = MAXWRK IF( WANTSV .OR. WANTSB ) THEN IWORK( 1 ) = MAX( 1, SDIM*( N-SDIM ) ) ELSE IWORK( 1 ) = 1 END IF * RETURN * * End of DGEESX * END
{ "pile_set_name": "Github" }
/* * Copyright 2013 Goldman Sachs. * * 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.gs.collections.impl.map.mutable.primitive; import com.gs.collections.impl.test.Verify; import org.junit.Test; public class SynchronizedLongShortMapSerializationTest { @Test public void serializedForm() { Verify.assertSerializedForm( 1L, "rO0ABXNyAEZjb20uZ3MuY29sbGVjdGlvbnMuaW1wbC5tYXAubXV0YWJsZS5wcmltaXRpdmUuU3lu\n" + "Y2hyb25pemVkTG9uZ1Nob3J0TWFwAAAAAAAAAAECAAJMAARsb2NrdAASTGphdmEvbGFuZy9PYmpl\n" + "Y3Q7TAADbWFwdAA6TGNvbS9ncy9jb2xsZWN0aW9ucy9hcGkvbWFwL3ByaW1pdGl2ZS9NdXRhYmxl\n" + "TG9uZ1Nob3J0TWFwO3hwcQB+AANzcgA+Y29tLmdzLmNvbGxlY3Rpb25zLmltcGwubWFwLm11dGFi\n" + "bGUucHJpbWl0aXZlLkxvbmdTaG9ydEhhc2hNYXAAAAAAAAAAAQwAAHhwdwQAAAAAeA==", new SynchronizedLongShortMap(new LongShortHashMap())); } }
{ "pile_set_name": "Github" }
base height.settings 1 height 325 editor_tags level;stuff name Power_Jump_heightstick
{ "pile_set_name": "Github" }
package sync import upickle.default.{ReadWriter, macroRW, readwriter} sealed trait Rpc object Rpc{ implicit val subPathRw = readwriter[String].bimap[os.SubPath](_.toString, os.SubPath(_)) case class StatPath(path: os.SubPath) extends Rpc implicit val statPathRw: ReadWriter[StatPath] = macroRW case class WriteOver(src: Array[Byte], path: os.SubPath) extends Rpc implicit val writeOverRw: ReadWriter[WriteOver] = macroRW case class StatInfo(p: os.SubPath, fileHash: Option[Int]) implicit val statInfoRw: ReadWriter[StatInfo] = macroRW implicit val msgRw: ReadWriter[Rpc] = macroRW }
{ "pile_set_name": "Github" }
### Login Tencent Kubernetes Engine Console - Follow the instructions to create a [Tencent Cloud Account](https://cloud.tencent.com/register) - Go to [Console of Tencent Kubernetes Engine ](https://console.cloud.tencent.com/tke2/cluster) ### Create TKE Cluster - Create a TKE Cluster - The cluster region need choose out of China( e.g. Hong Kong) - The cluster Kubernetes version need choose 1.16.3 ![](CreateTkeCluster.png) ### Deploy sonobuoy Conformance test - After the creation completed, ssh to any node of cluster - Run command as below Download a binary release of the CLI, Refer to the following command to run: ```shell sonobuoy run --mode=certified-conformance --kube-conformance-image-version=v1.16.3 ``` See more in conformance suite [instructions](https://github.com/cncf/k8s-conformance/blob/master/instructions.md#running) to test it.
{ "pile_set_name": "Github" }
package profile import ( "sort" "time" "github.com/aerogo/aero" "github.com/animenotifier/notify.moe/arn" "github.com/animenotifier/notify.moe/assets" "github.com/animenotifier/notify.moe/components" "github.com/animenotifier/notify.moe/server/middleware" "github.com/animenotifier/notify.moe/utils" ) const ( maxCharacters = 6 maxFriends = 7 maxStudios = 4 maxGroups = 6 ) // Get user profile page. func Get(ctx aero.Context) error { nick := ctx.Get("nick") viewUser, err := arn.GetUserByNick(nick) if err != nil { return ctx.Error(404, "User not found", err) } return Profile(ctx, viewUser) } // Profile renders the user profile page of the given viewUser. func Profile(ctx aero.Context, viewUser *arn.User) error { user := arn.GetUserFromContext(ctx) sortBy := arn.SortByRating if user != nil { sortBy = user.Settings().SortBy } // Anime list animeList := viewUser.AnimeList() if user == nil || user.ID != viewUser.ID { animeList = animeList.WithoutPrivateItems() } completedList := animeList.FilterStatus(arn.AnimeListStatusCompleted) completedList.Sort(sortBy) // Genres topGenres := animeList.TopGenres(5) // Studios animeWatchingTime := time.Duration(0) studios := map[string]float64{} var topStudios []*arn.Company for _, item := range animeList.Items { anime := item.Anime() currentWatch := item.Episodes * anime.EpisodeLength reWatch := item.RewatchCount * anime.EpisodeCount * anime.EpisodeLength duration := time.Duration(currentWatch + reWatch) animeWatchingTime += duration * time.Minute if item.Status != arn.AnimeListStatusCompleted { continue } rating := 0.0 if item.Rating.Overall != 0 { rating = item.Rating.Overall - arn.AverageRating } else { // Add 0.1 to avoid all affinities being 0 when a user doesn't have any rated anime. rating = 0.1 } for _, studio := range anime.Studios() { affinity, exists := studios[studio.ID] if !exists { topStudios = append(topStudios, studio) } studios[studio.ID] = affinity + rating } } sort.Slice(topStudios, func(i, j int) bool { affinityA := studios[topStudios[i].ID] affinityB := studios[topStudios[j].ID] if affinityA == affinityB { return topStudios[i].Name.English < topStudios[j].Name.English } return affinityA > affinityB }) if len(topStudios) > maxStudios { topStudios = topStudios[:maxStudios] } // Open graph openGraph := &arn.OpenGraph{ Tags: map[string]string{ "og:title": viewUser.Nick, "og:image": viewUser.AvatarLink("large"), "og:url": "https://" + assets.Domain + viewUser.Link(), "og:site_name": "notify.moe", "og:description": utils.CutLongDescription(viewUser.Introduction), "og:type": "profile", "profile:username": viewUser.Nick, }, Meta: map[string]string{ "description": utils.CutLongDescription(viewUser.Introduction), "keywords": viewUser.Nick + ",profile", }, } // Friends friends := viewUser.Friends() arn.SortUsersFollowers(friends) if len(friends) > maxFriends { friends = friends[:maxFriends] } // Activities activities := arn.FilterActivities(func(activity arn.Activity) bool { return activity.GetCreatedBy() == viewUser.ID }) // Time zone offset var timeZoneOffset time.Duration analytics := viewUser.Analytics() if analytics != nil { timeZoneOffset = time.Duration(-analytics.General.TimezoneOffset) * time.Minute } now := time.Now().UTC().Add(timeZoneOffset) weekDay := int(now.Weekday()) currentYearDay := now.YearDay() // Day offset is the number of days we need to reach Sunday dayOffset := 0 if weekDay > 0 { dayOffset = 7 - weekDay } dayToActivityCount := map[int]int{} for _, activity := range activities { activityTime := activity.GetCreatedTime().Add(timeZoneOffset) activityYearDay := activityTime.YearDay() days := currentYearDay - activityYearDay dayToActivityCount[days+dayOffset]++ } // Groups groups := []*arn.Group{} for group := range arn.StreamGroups() { if !group.IsDraft && group.HasMember(viewUser.ID) { groups = append(groups, group) } } sort.Slice(groups, func(i, j int) bool { aMembers := len(groups[i].Members) bMembers := len(groups[j].Members) if aMembers == bMembers { return groups[i].Name < groups[j].Name } return aMembers > bMembers }) if len(groups) > maxGroups { groups = groups[:maxGroups] } // Characters characters := []*arn.Character{} for character := range arn.StreamCharacters() { if arn.Contains(character.Likes, viewUser.ID) { characters = append(characters, character) } } sort.Slice(characters, func(i, j int) bool { aLikes := len(characters[i].Likes) bLikes := len(characters[j].Likes) if aLikes == bLikes { return characters[i].Name.Canonical < characters[j].Name.Canonical } return aLikes > bLikes }) if len(characters) > maxCharacters { characters = characters[:maxCharacters] } customCtx := ctx.(*middleware.OpenGraphContext) customCtx.OpenGraph = openGraph return ctx.HTML(components.Profile( viewUser, user, animeList, completedList, characters, groups, friends, topGenres, topStudios, animeWatchingTime, dayToActivityCount, ctx.Path(), )) }
{ "pile_set_name": "Github" }
module.exports = { siteMetadata: { title: `Gatsby MDX raw strings` }, plugins: [ `gatsby-plugin-mdx`, { resolve: "gatsby-source-filesystem", options: { name: "content", path: `${__dirname}/content/` } } ] };
{ "pile_set_name": "Github" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (version 1.7.0_10-ea) on Sun Jul 14 20:03:35 PDT 2013 --> <title>Uses of Class org.codehaus.jackson.map.deser.std.EnumDeserializer.FactoryBasedDeserializer (Jackson JSON Processor)</title> <meta name="date" content="2013-07-14"> <link rel="stylesheet" type="text/css" href="../../../../../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class org.codehaus.jackson.map.deser.std.EnumDeserializer.FactoryBasedDeserializer (Jackson JSON Processor)"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../../org/codehaus/jackson/map/deser/std/EnumDeserializer.FactoryBasedDeserializer.html" title="class in org.codehaus.jackson.map.deser.std">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../../index.html?org/codehaus/jackson/map/deser/std/class-use/EnumDeserializer.FactoryBasedDeserializer.html" target="_top">Frames</a></li> <li><a href="EnumDeserializer.FactoryBasedDeserializer.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="Uses of Class org.codehaus.jackson.map.deser.std.EnumDeserializer.FactoryBasedDeserializer" class="title">Uses of Class<br>org.codehaus.jackson.map.deser.std.EnumDeserializer.FactoryBasedDeserializer</h2> </div> <div class="classUseContainer">No usage of org.codehaus.jackson.map.deser.std.EnumDeserializer.FactoryBasedDeserializer</div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../../org/codehaus/jackson/map/deser/std/EnumDeserializer.FactoryBasedDeserializer.html" title="class in org.codehaus.jackson.map.deser.std">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../../index.html?org/codehaus/jackson/map/deser/std/class-use/EnumDeserializer.FactoryBasedDeserializer.html" target="_top">Frames</a></li> <li><a href="EnumDeserializer.FactoryBasedDeserializer.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>
{ "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. # haproxy extension loadbalancer cartridge node node /haproxy/ inherits base { class {'haproxy':} }
{ "pile_set_name": "Github" }
/******************************************************************************* * Copyright (C) 2016 Sam Silverberg [email protected] * * This file is part of OpenDedupe SDFS. * * OpenDedupe SDFS 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. * * OpenDedupe SDFS 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 Foobar. If not, see <http://www.gnu.org/licenses/>. *******************************************************************************/ package org.opendedup.sdfs.network; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.net.InetSocketAddress; import java.net.ServerSocket; import java.net.Socket; import java.security.KeyStore; import java.security.SecureRandom; import javax.net.ssl.KeyManager; import javax.net.ssl.KeyManagerFactory; import javax.net.ssl.SSLContext; import javax.net.ssl.SSLServerSocketFactory; import org.opendedup.logging.SDFSLogger; import org.opendedup.sdfs.Main; import org.opendedup.util.FindOpenPort; import org.opendedup.util.KeyGenerator; public class NetworkDSEServer implements Runnable { Socket clientSocket = null; ServerSocket serverSocket = null; public boolean closed = false; @Override public void run() { try { Main.serverPort = FindOpenPort.pickFreePort(Main.serverPort); InetSocketAddress addr = new InetSocketAddress(Main.serverHostName, Main.serverPort); if (Main.serverUseSSL) { String keydir = Main.hashDBStore + File.separator + "keys"; String key = keydir + File.separator + "dse_server.keystore"; if (!new File(key).exists()) { KeyGenerator.generateKey(new File(key)); SDFSLogger.getLog().info( "generated certificate for ssl communication at " + key); } FileInputStream keyFile = new FileInputStream(key); KeyStore keyStore = KeyStore.getInstance(KeyStore .getDefaultType()); keyStore.load(keyFile, "sdfs".toCharArray()); // init KeyManagerFactory KeyManagerFactory keyManagerFactory = KeyManagerFactory .getInstance(KeyManagerFactory.getDefaultAlgorithm()); keyManagerFactory.init(keyStore, "sdfs".toCharArray()); // init KeyManager KeyManager keyManagers[] = keyManagerFactory.getKeyManagers(); // init the SSL context SSLContext sslContext = SSLContext.getInstance("TLSv1.2"); sslContext.init(keyManagers, null, new SecureRandom()); // get the socket factory SSLServerSocketFactory socketFactory = sslContext .getServerSocketFactory(); // and finally, get the socket serverSocket = socketFactory.createServerSocket(); serverSocket.bind(addr); SDFSLogger.getLog().info( "listening on encryted channel " + addr.toString()); } else { serverSocket = new ServerSocket(); // serverSocket.setReceiveBufferSize(128 * 1024); serverSocket.bind(addr); SDFSLogger.getLog().info( "listening on unencryted channel " + addr.toString()); } } catch (Exception e) { System.err.println("unable to open network ports : " + e.getMessage()); System.err.println("check logs for more details"); SDFSLogger.getLog().fatal("unable to open network ports", e); System.exit(-1); } // Create a socket object from the ServerSocket to listen and accept // connections. // Open input and output streams for this socket will be created in // client's thread since every client is served by the server in // an individual thread while (!closed) { try { clientSocket = serverSocket.accept(); clientSocket.setKeepAlive(true); clientSocket.setTcpNoDelay(false); // clientSocket.setSendBufferSize(128 * 1024); new ClientThread(clientSocket).start(); } catch (IOException e) { if (!serverSocket.isClosed()) SDFSLogger.getLog().fatal( "Unable to open port " + e.toString(), e); } } } public synchronized void close() { this.closed = true; try { System.out.println("#### Shutting Down Network Service ####"); serverSocket.close(); } catch (Exception e) { } System.out.println("#### Network Service Shut down completed ####"); } }
{ "pile_set_name": "Github" }
#ifndef OCTREE_DEVICE_ALTERNATE_H_ #define OCTREE_DEVICE_ALTERNATE_H_ #include "logs.h" #ifdef USE_CUDA #include <cuda.h> #include <cuda_runtime.h> // CUDA: various checks for different function calls. #define CUDA_CHECK(condition) \ do { \ cudaError_t error = condition; \ CHECK(error == cudaSuccess) << " " << cudaGetErrorString(error); \ } while (0) // CUDA: grid stride looping #define CUDA_KERNEL_LOOP(i, n) \ for (int i = blockIdx.x * blockDim.x + threadIdx.x; \ i < (n); \ i += blockDim.x * gridDim.x) // CUDA: check for error after kernel execution and exit loudly if there is one. #define CUDA_POST_KERNEL_CHECK CUDA_CHECK(cudaPeekAtLastError()) // CUDA: use 512 threads per block const int kCudaThreadsNum = 512; // CUDA: number of blocks for threads. inline int CudaGetBlocks(const int N) { return (N + kCudaThreadsNum - 1) / kCudaThreadsNum; } #else #define NO_GPU CHECK(false) << "Cannot use GPU in CPU mode." #endif // USE_CUDA #endif // OCTREE_DEVICE_ALTERNATE_H_
{ "pile_set_name": "Github" }
from django.contrib import admin from pycon.pycon_api.models import APIAuth, ProposalData, IRCLogLine class APIAuthAdmin(admin.ModelAdmin): list_display = ('name', 'enabled') class ProposalDataAdmin(admin.ModelAdmin): list_display = ('proposal',) class IRCLogLineAdmin(admin.ModelAdmin): list_display = ('proposal', 'timestamp', 'user', 'line') admin.site.register(APIAuth, APIAuthAdmin) admin.site.register(ProposalData, ProposalDataAdmin) admin.site.register(IRCLogLine, IRCLogLineAdmin)
{ "pile_set_name": "Github" }
import { _getGroupParticipants } from './get-group-participants'; /** * Fetches IDs of group participants * @param {string} groupId Group id * @param {Function} done Optional callback * @returns {Promise.<Array|*>} Yields list of IDs */ export async function getGroupParticipantIDs(groupId, done) { const output = (await _getGroupParticipants(groupId)).map( (participant) => participant.id ); if (done !== undefined) done(output); return output; }
{ "pile_set_name": "Github" }
- cache([conference_id, call, '#splash#callfortracks'], expires_in: 1.hour) do .col-md-4.col-sm-4.text-center %h2 Call for Tracks %p.lead We are now accepting custom track requests! %p Would you like to host a mini-summit, sub-conference, or hack space? The submission period for track requests is open %em = date_string(call.start_date, call.end_date) + '.' %b You have = pluralize(call.remaining_days, 'day') left! %p.cta-button = link_to("Submit your request for track", new_conference_program_track_path(conference_id), class: 'btn btn-success btn-lg text-center')
{ "pile_set_name": "Github" }
$(document).ready(function(){ module("testProcessingInstructions"); test("testProcessingInstructions", function() { expect(1); var input = 'data(<?target content?>) instance of xs:string'; var expected = '<span class="cm-variable cm-def">data</span>(<span class="cm-comment cm-meta">&lt;?target content?&gt;</span>) <span class="cm-keyword">instance</span> <span class="cm-keyword">of</span> <span class="cm-atom">xs:string</span>'; $("#sandbox").html('<textarea id="editor">' + input + '</textarea>'); var editor = CodeMirror.fromTextArea($("#editor")[0]); var result = $(".CodeMirror-lines div div pre")[0].innerHTML; equal(result, expected); $("#editor").html(""); }); });
{ "pile_set_name": "Github" }
/* * Copyright 2014-2020 the original author or 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 * * https://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.springframework.data.elasticsearch.repositories.complex.custommethod.manualwiring; import org.springframework.data.elasticsearch.core.ElasticsearchOperations; import org.springframework.data.elasticsearch.repositories.complex.custommethod.autowiring.ComplexElasticsearchRepositoryCustom; /** * @author Artur Konczak * @author Mohsin Husen * @author Peter-Josef Meisch */ public class ComplexElasticsearchRepositoryManualWiringImpl implements ComplexElasticsearchRepositoryCustom { private ElasticsearchOperations operations; public ComplexElasticsearchRepositoryManualWiringImpl(ElasticsearchOperations operations) { this.operations = operations; } @Override public String doSomethingSpecial() { assert (operations.getElasticsearchConverter() != null); return "3+3=6"; } }
{ "pile_set_name": "Github" }
package factory import ( "github.com/ElrondNetwork/elrond-go/core" "github.com/ElrondNetwork/elrond-go/core/check" "github.com/ElrondNetwork/elrond-go/core/random" "github.com/ElrondNetwork/elrond-go/core/throttler" "github.com/ElrondNetwork/elrond-go/data/state" "github.com/ElrondNetwork/elrond-go/dataRetriever" factoryDataRetriever "github.com/ElrondNetwork/elrond-go/dataRetriever/factory/resolverscontainer" "github.com/ElrondNetwork/elrond-go/dataRetriever/resolvers" "github.com/ElrondNetwork/elrond-go/dataRetriever/resolvers/topicResolverSender" "github.com/ElrondNetwork/elrond-go/marshal" "github.com/ElrondNetwork/elrond-go/process/factory" "github.com/ElrondNetwork/elrond-go/sharding" "github.com/ElrondNetwork/elrond-go/update" "github.com/ElrondNetwork/elrond-go/update/genesis" ) const defaultTargetShardID = uint32(0) const numCrossShardPeers = 2 const numIntraShardPeers = 2 type resolversContainerFactory struct { shardCoordinator sharding.Coordinator messenger dataRetriever.TopicMessageHandler marshalizer marshal.Marshalizer intRandomizer dataRetriever.IntRandomizer dataTrieContainer state.TriesHolder container dataRetriever.ResolversContainer intraShardTopic string inputAntifloodHandler dataRetriever.P2PAntifloodHandler outputAntifloodHandler dataRetriever.P2PAntifloodHandler throttler dataRetriever.ResolverThrottler } // ArgsNewResolversContainerFactory defines the arguments for the resolversContainerFactory constructor type ArgsNewResolversContainerFactory struct { ShardCoordinator sharding.Coordinator Messenger dataRetriever.TopicMessageHandler Marshalizer marshal.Marshalizer DataTrieContainer state.TriesHolder ExistingResolvers dataRetriever.ResolversContainer InputAntifloodHandler dataRetriever.P2PAntifloodHandler OutputAntifloodHandler dataRetriever.P2PAntifloodHandler NumConcurrentResolvingJobs int32 } // NewResolversContainerFactory creates a new container filled with topic resolvers func NewResolversContainerFactory(args ArgsNewResolversContainerFactory) (*resolversContainerFactory, error) { if check.IfNil(args.ShardCoordinator) { return nil, update.ErrNilShardCoordinator } if check.IfNil(args.Messenger) { return nil, update.ErrNilMessenger } if check.IfNil(args.Marshalizer) { return nil, update.ErrNilMarshalizer } if check.IfNil(args.DataTrieContainer) { return nil, update.ErrNilTrieDataGetter } if check.IfNil(args.ExistingResolvers) { return nil, update.ErrNilResolverContainer } thr, err := throttler.NewNumGoRoutinesThrottler(args.NumConcurrentResolvingJobs) if err != nil { return nil, err } intraShardTopic := core.ConsensusTopic + args.ShardCoordinator.CommunicationIdentifier(args.ShardCoordinator.SelfId()) return &resolversContainerFactory{ shardCoordinator: args.ShardCoordinator, messenger: args.Messenger, marshalizer: args.Marshalizer, intRandomizer: &random.ConcurrentSafeIntRandomizer{}, dataTrieContainer: args.DataTrieContainer, container: args.ExistingResolvers, intraShardTopic: intraShardTopic, inputAntifloodHandler: args.InputAntifloodHandler, outputAntifloodHandler: args.OutputAntifloodHandler, throttler: thr, }, nil } // Create returns a resolver container that will hold all resolvers in the system func (rcf *resolversContainerFactory) Create() (dataRetriever.ResolversContainer, error) { err := rcf.generateTrieNodesResolvers() if err != nil { return nil, err } return rcf.container, nil } func (rcf *resolversContainerFactory) generateTrieNodesResolvers() error { shardC := rcf.shardCoordinator keys := make([]string, 0) resolversSlice := make([]dataRetriever.Resolver, 0) for i := uint32(0); i < shardC.NumberOfShards(); i++ { identifierTrieNodes := factory.AccountTrieNodesTopic + core.CommunicationIdentifierBetweenShards(i, core.MetachainShardId) if rcf.checkIfResolverExists(identifierTrieNodes) { continue } trieId := genesis.CreateTrieIdentifier(i, genesis.UserAccount) resolver, err := rcf.createTrieNodesResolver(identifierTrieNodes, trieId) if err != nil { return err } resolversSlice = append(resolversSlice, resolver) keys = append(keys, identifierTrieNodes) } identifierTrieNodes := factory.AccountTrieNodesTopic + core.CommunicationIdentifierBetweenShards(core.MetachainShardId, core.MetachainShardId) if !rcf.checkIfResolverExists(identifierTrieNodes) { trieId := genesis.CreateTrieIdentifier(core.MetachainShardId, genesis.UserAccount) resolver, err := rcf.createTrieNodesResolver(identifierTrieNodes, trieId) if err != nil { return err } resolversSlice = append(resolversSlice, resolver) keys = append(keys, identifierTrieNodes) } identifierTrieNodes = factory.ValidatorTrieNodesTopic + core.CommunicationIdentifierBetweenShards(core.MetachainShardId, core.MetachainShardId) if !rcf.checkIfResolverExists(identifierTrieNodes) { trieID := genesis.CreateTrieIdentifier(core.MetachainShardId, genesis.ValidatorAccount) resolver, err := rcf.createTrieNodesResolver(identifierTrieNodes, trieID) if err != nil { return err } resolversSlice = append(resolversSlice, resolver) keys = append(keys, identifierTrieNodes) } return rcf.container.AddMultiple(keys, resolversSlice) } func (rcf *resolversContainerFactory) checkIfResolverExists(topic string) bool { _, err := rcf.container.Get(topic) return err == nil } func (rcf *resolversContainerFactory) createTrieNodesResolver(baseTopic string, trieId string) (dataRetriever.Resolver, error) { peerListCreator, err := topicResolverSender.NewDiffPeerListCreator( rcf.messenger, baseTopic, rcf.intraShardTopic, factoryDataRetriever.EmptyExcludePeersOnTopic, ) if err != nil { return nil, err } arg := topicResolverSender.ArgTopicResolverSender{ Messenger: rcf.messenger, TopicName: baseTopic, PeerListCreator: peerListCreator, Marshalizer: rcf.marshalizer, Randomizer: rcf.intRandomizer, TargetShardId: defaultTargetShardID, OutputAntiflooder: rcf.outputAntifloodHandler, NumCrossShardPeers: numCrossShardPeers, NumIntraShardPeers: numIntraShardPeers, } resolverSender, err := topicResolverSender.NewTopicResolverSender(arg) if err != nil { return nil, err } trie := rcf.dataTrieContainer.Get([]byte(trieId)) argTrieResolver := resolvers.ArgTrieNodeResolver{ SenderResolver: resolverSender, TrieDataGetter: trie, Marshalizer: rcf.marshalizer, AntifloodHandler: rcf.inputAntifloodHandler, Throttler: rcf.throttler, } resolver, err := resolvers.NewTrieNodeResolver(argTrieResolver) if err != nil { return nil, err } err = rcf.messenger.RegisterMessageProcessor(resolver.RequestTopic(), resolver) if err != nil { return nil, err } return resolver, nil } // IsInterfaceNil returns true if there is no value under the interface func (rcf *resolversContainerFactory) IsInterfaceNil() bool { return rcf == nil }
{ "pile_set_name": "Github" }
// // UIView+MASShorthandAdditions.h // Masonry // // Created by Jonas Budelmann on 22/07/13. // Copyright (c) 2013 Jonas Budelmann. All rights reserved. // #import "View+MASAdditions.h" #ifdef MAS_SHORTHAND /** * Shorthand view additions without the 'mas_' prefixes, * only enabled if MAS_SHORTHAND is defined */ @interface MAS_VIEW (MASShorthandAdditions) @property (nonatomic, strong, readonly) MASViewAttribute *left; @property (nonatomic, strong, readonly) MASViewAttribute *top; @property (nonatomic, strong, readonly) MASViewAttribute *right; @property (nonatomic, strong, readonly) MASViewAttribute *bottom; @property (nonatomic, strong, readonly) MASViewAttribute *leading; @property (nonatomic, strong, readonly) MASViewAttribute *trailing; @property (nonatomic, strong, readonly) MASViewAttribute *width; @property (nonatomic, strong, readonly) MASViewAttribute *height; @property (nonatomic, strong, readonly) MASViewAttribute *centerX; @property (nonatomic, strong, readonly) MASViewAttribute *centerY; @property (nonatomic, strong, readonly) MASViewAttribute *baseline; @property (nonatomic, strong, readonly) MASViewAttribute *(^attribute)(NSLayoutAttribute attr); #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) @property (nonatomic, strong, readonly) MASViewAttribute *firstBaseline; @property (nonatomic, strong, readonly) MASViewAttribute *lastBaseline; #endif #if TARGET_OS_IPHONE || TARGET_OS_TV @property (nonatomic, strong, readonly) MASViewAttribute *leftMargin; @property (nonatomic, strong, readonly) MASViewAttribute *rightMargin; @property (nonatomic, strong, readonly) MASViewAttribute *topMargin; @property (nonatomic, strong, readonly) MASViewAttribute *bottomMargin; @property (nonatomic, strong, readonly) MASViewAttribute *leadingMargin; @property (nonatomic, strong, readonly) MASViewAttribute *trailingMargin; @property (nonatomic, strong, readonly) MASViewAttribute *centerXWithinMargins; @property (nonatomic, strong, readonly) MASViewAttribute *centerYWithinMargins; #endif - (NSArray *)makeConstraints:(void(^)(MASConstraintMaker *make))block; - (NSArray *)updateConstraints:(void(^)(MASConstraintMaker *make))block; - (NSArray *)remakeConstraints:(void(^)(MASConstraintMaker *make))block; @end #define MAS_ATTR_FORWARD(attr) \ - (MASViewAttribute *)attr { \ return [self mas_##attr]; \ } @implementation MAS_VIEW (MASShorthandAdditions) MAS_ATTR_FORWARD(top); MAS_ATTR_FORWARD(left); MAS_ATTR_FORWARD(bottom); MAS_ATTR_FORWARD(right); MAS_ATTR_FORWARD(leading); MAS_ATTR_FORWARD(trailing); MAS_ATTR_FORWARD(width); MAS_ATTR_FORWARD(height); MAS_ATTR_FORWARD(centerX); MAS_ATTR_FORWARD(centerY); MAS_ATTR_FORWARD(baseline); #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) MAS_ATTR_FORWARD(firstBaseline); MAS_ATTR_FORWARD(lastBaseline); #endif #if TARGET_OS_IPHONE || TARGET_OS_TV MAS_ATTR_FORWARD(leftMargin); MAS_ATTR_FORWARD(rightMargin); MAS_ATTR_FORWARD(topMargin); MAS_ATTR_FORWARD(bottomMargin); MAS_ATTR_FORWARD(leadingMargin); MAS_ATTR_FORWARD(trailingMargin); MAS_ATTR_FORWARD(centerXWithinMargins); MAS_ATTR_FORWARD(centerYWithinMargins); #endif - (MASViewAttribute *(^)(NSLayoutAttribute))attribute { return [self mas_attribute]; } - (NSArray *)makeConstraints:(void(^)(MASConstraintMaker *))block { return [self mas_makeConstraints:block]; } - (NSArray *)updateConstraints:(void(^)(MASConstraintMaker *))block { return [self mas_updateConstraints:block]; } - (NSArray *)remakeConstraints:(void(^)(MASConstraintMaker *))block { return [self mas_remakeConstraints:block]; } @end #endif
{ "pile_set_name": "Github" }
<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="utf-8" %> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <c:set var="cp" value="${pageContext.request.contextPath}"/> <!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>购物+</title> <link href="${cp}/css/bootstrap.min.css" rel="stylesheet"> <link href="${cp}/css/style.css" rel="stylesheet"> <script src="${cp}/js/jquery.min.js" type="text/javascript"></script> <script src="${cp}/js/bootstrap.min.js" type="text/javascript"></script> <script src="${cp}/js/layer.js" type="text/javascript"></script> <!--[if lt IE 9]> <script src="${cp}/js/html5shiv.min.js"></script> <script src="${cp}/js/respond.min.js"></script> <![endif]--> </head> <body> <!--导航栏部分--> <jsp:include page="include/header.jsp"/> <!-- 中间内容 --> <div class="container-fluid bigHead"> <div class="row"> <div class="col-sm-10 col-md-10 col-sm-offset-1 col-md-offset-1"> <div class="jumbotron"> <h1>欢迎来到订单页</h1> <p>您的购买清单为</p> </div> </div> <div class="col-sm-10 col-md-10 col-sm-offset-1 col-md-offset-1"> <div class="row"> <ul class="nav nav-tabs list-group-diy" role="tablist"> <li role="presentation" class="active list-group-item-diy"><a href="#unHandle" aria-controls="unHandle" role="tab" data-toggle="tab">待发货订单&nbsp;<span class="badge" id="unHandleCount">0</span></a></li> <li role="presentation" class="list-group-item-diy"><a href="#transport" aria-controls="transport" role="tab" data-toggle="tab">运输中订单&nbsp;<span class="badge" id="transportCount">0</span></a></li> <li role="presentation" class="list-group-item-diy"><a href="#receive" aria-controls="receive" role="tab" data-toggle="tab">已收货订单&nbsp;<span class="badge" id="receiveCount">0</span></a></li> <li role="presentation" class="list-group-item-diy"><a href="#all" aria-controls="all" role="tab" data-toggle="tab">全部订单&nbsp;<span class="badge" id="allCount">0</span></a></li> </ul> <div class="tab-content"> <div role="tabpanel" class="tab-pane active" id="unHandle"> <table class="table table-hover center" id="unHandleTable"> </table> </div> <div role="tabpanel" class="tab-pane" id="transport"> <table class="table table-hover center" id="transportTable"> </table> </div> <div role="tabpanel" class="tab-pane" id="receive"> <table class="table table-hover center" id="receiveTable"> </table> </div> <div role="tabpanel" class="tab-pane" id="all"> <table class="table table-hover center" id="allTable"> </table> </div> </div> </div> </div> </div> </div> <!-- 尾部 --> <jsp:include page="include/foot.jsp"/> <script type="text/javascript"> var loading = layer.load(0); updateShoppingRecords(); function updateShoppingRecords() { var orderArray = new Array; orderArray[0] = "未发货"; orderArray[1] = "配送中"; orderArray[2] = "已收货"; var unHandleTable = document.getElementById("unHandleTable"); var transportTable = document.getElementById("transportTable"); var receiveTable = document.getElementById("receiveTable"); var allTable = document.getElementById("allTable"); var unHandleCount = document.getElementById("unHandleCount"); var transportCount = document.getElementById("transportCount"); var receiveCount = document.getElementById("receiveCount"); var allCount = document.getElementById("allCount"); var unHandleCounts = parseInt(unHandleCount.innerHTML); var transportCounts = parseInt(transportCount.innerHTML); var receiveCounts = parseInt(receiveCount.innerHTML); var allCounts = parseInt(allCount.innerHTML); var allShoppingRecords = getShoppingRecords(); unHandleTable.innerHTML = ""; transportTable.innerHTML = ""; receiveTable.innerHTML = ""; allTable.innerHTML = ""; var unHandleHTML = '<tr>'+ '<th>商品名称</th>'+ '<th>购买数量</th>'+ '<th>付款金额</th>'+ '<th>订单状态</th>'+ '</tr>'; var transportHTML = '<tr>'+ '<th>商品名称</th>'+ '<th>购买数量</th>'+ '<th>付款金额</th>'+ '<th>送货地址</th>'+ '<th>联系电话</th>'+ '<th>订单状态</th>'+ '<th>确认收货</th>'+ '</tr>'; var receiveHTML = '<tr>'+ '<th>商品名称</th>'+ '<th>购买数量</th>'+ '<th>付款金额</th>'+ '<th>订单状态</th>'+ '<th>评价</th>'+ '</tr>'; var allHTML = '<tr>'+ '<th>商品名称</th>'+ '<th>购买数量</th>'+ '<th>付款金额</th>'+ '<th>订单状态</th>'+ '</tr>'; var unHandleHTMLTemp = ""; var transportHTMLTemp = ""; var receiveHTMLTemp = ""; var allHTMLTemp = ""; for(var i=0;i<allShoppingRecords.length;i++){ var product = getProductById(allShoppingRecords[i].productId); allHTMLTemp += '<tr>'+ '<td>'+product.name+'</td>'+ '<td>'+allShoppingRecords[i].counts+'</td>'+ '<td>'+allShoppingRecords[i].productPrice+'</td>'+ '<td>'+orderArray[allShoppingRecords[i].orderStatus]+'</td>'+ '</tr>'; allCounts++; if(allShoppingRecords[i].orderStatus == 0){ unHandleHTMLTemp+= '<tr>'+ '<td>'+product.name+'</td>'+ '<td>'+allShoppingRecords[i].counts+'</td>'+ '<td>'+allShoppingRecords[i].productPrice+'</td>'+ '<td>'+orderArray[allShoppingRecords[i].orderStatus]+'</td>'+ '</tr>'; unHandleCounts++; } else if(allShoppingRecords[i].orderStatus ==1){ var address = getUserAddress(allShoppingRecords[i].userId); var phoneNumber = getUserPhoneNumber(allShoppingRecords[i].userId) transportHTMLTemp+= '<tr>'+ '<td>'+product.name+'</td>'+ '<td>'+allShoppingRecords[i].counts+'</td>'+ '<td>'+allShoppingRecords[i].productPrice+'</td>'+ '<td>'+address+'</td>'+ '<td>'+phoneNumber+'</td>'+ '<td>'+orderArray[allShoppingRecords[i].orderStatus]+'</td>'+ '<td>'+ '<button class="btn btn-primary btn-sm" onclick="receiveProducts('+allShoppingRecords[i].userId+','+allShoppingRecords[i].productId+',\''+allShoppingRecords[i].time+'\')">确认收货</button>'+ '</td>'+ '</tr>'; transportCounts++; } else if(allShoppingRecords[i].orderStatus ==2){ receiveHTMLTemp += '<tr>'+ '<td>'+product.name+'</td>'+ '<td>'+allShoppingRecords[i].counts+'</td>'+ '<td>'+allShoppingRecords[i].productPrice+'</td>'+ '<td>'+orderArray[allShoppingRecords[i].orderStatus]+'</td>'+ '<td>'+ '<button class="btn btn-primary btn-sm" onclick="productDetail('+allShoppingRecords[i].productId+')">评价</button>'+ '</td>'+ '</tr>'; receiveCounts++; } } if(unHandleHTMLTemp == ""){ unHandleHTML='<div class="row">'+ '<div class="col-sm-3 col-md-3 col-lg-3"></div> '+ '<div class="col-sm-6 col-md-6 col-lg-6">'+ '<h2>没有相关订单</h2>'+ '</div>'+ '</div>'; } else unHandleHTML+=unHandleHTMLTemp; if(transportHTMLTemp == ""){ transportHTML = '<div class="row">'+ '<div class="col-sm-3 col-md-3 col-lg-3"></div> '+ '<div class="col-sm-6 col-md-6 col-lg-6">'+ '<h2>没有相关订单</h2>'+ '</div>'+ '</div>'; } else transportHTML+=transportHTMLTemp; if(receiveHTMLTemp == ""){ receiveHTML = '<div class="row">'+ '<div class="col-sm-3 col-md-3 col-lg-3"></div> '+ '<div class="col-sm-6 col-md-6 col-lg-6">'+ '<h2>没有相关订单</h2>'+ '</div>'+ '</div>'; } else receiveHTML+=receiveHTMLTemp; if(allHTMLTemp == ""){ allHTML = '<div class="row">'+ '<div class="col-sm-3 col-md-3 col-lg-3"></div> '+ '<div class="col-sm-6 col-md-6 col-lg-6">'+ '<h2>没有相关订单</h2>'+ '</div>'+ '</div>'; } else allHTML+=allHTMLTemp; unHandleCount.innerHTML = unHandleCounts; transportCount.innerHTML = transportCounts; receiveCount.innerHTML = receiveCounts; allCount.innerHTML = allCounts; unHandleTable.innerHTML += unHandleHTML; transportTable.innerHTML += transportHTML; receiveTable.innerHTML += receiveHTML; allTable.innerHTML += allHTML; layer.close(loading); } function getShoppingRecords() { judgeIsLogin(); var shoppingRecordProducts = ""; var user = {}; user.userId = ${currentUser.id}; $.ajax({ async : false, //设置同步 type : 'POST', url : '${cp}/getShoppingRecords', data : user, dataType : 'json', success : function(result) { shoppingRecordProducts = result.result; }, error : function(result) { layer.alert('查询错误'); } }); shoppingRecordProducts = eval("("+shoppingRecordProducts+")"); return shoppingRecordProducts; } function getProductById(id) { var productResult = ""; var product = {}; product.id = id; $.ajax({ async : false, //设置同步 type : 'POST', url : '${cp}/getProductById', data : product, dataType : 'json', success : function(result) { productResult = result.result; }, error : function(result) { layer.alert('查询错误'); } }); productResult = JSON.parse(productResult); return productResult; } function getUserAddress(id) { var address = ""; var user = {}; user.id = id; $.ajax({ async : false, //设置同步 type : 'POST', url : '${cp}/getUserAddressAndPhoneNumber', data : user, dataType : 'json', success : function(result) { address = result.address; }, error : function(result) { layer.alert('查询错误'); } }); return address; } function getUserPhoneNumber(id) { var phoneNumber = ""; var user = {}; user.id = id; $.ajax({ async : false, //设置同步 type : 'POST', url : '${cp}/getUserAddressAndPhoneNumber', data : user, dataType : 'json', success : function(result) { phoneNumber = result.phoneNumber; }, error : function(result) { layer.alert('查询错误'); } }); return phoneNumber; } function judgeIsLogin() { if("${currentUser.id}" == null || "${currentUser.id}" == undefined || "${currentUser.id}" ==""){ window.location.href = "${cp}/login"; } } function receiveProducts(userId,productId,time) { var receiveResult = ""; var shoppingRecord = {}; shoppingRecord.userId = userId; shoppingRecord.productId = productId; shoppingRecord.time = time; shoppingRecord.orderStatus = 2; $.ajax({ async : false, //设置同步 type : 'POST', url : '${cp}/changeShoppingRecord', data : shoppingRecord, dataType : 'json', success : function(result) { receiveResult = result.result; }, error : function(result) { layer.alert('查询错误'); } }); if(receiveResult = "success") window.location.href = "${cp}/shopping_record"; } function productDetail(id) { var product = {}; var jumpResult = ''; product.id = id; $.ajax({ async : false, //设置同步 type : 'POST', url : '${cp}/productDetail', data : product, dataType : 'json', success : function(result) { jumpResult = result.result; }, error : function(resoult) { layer.alert('查询错误'); } }); if(jumpResult == "success"){ window.location.href = "${cp}/product_detail"; } } </script> </body> </html>
{ "pile_set_name": "Github" }
module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), concat: { css: { src: [ 'src/*.css' ], dest: 'dist/theme.css' }, js : { src : [ 'src/login.js', 'src/toggle.js', 'src/logo.js', 'src/jobconfig.js' ], dest : 'dist/theme.js' } }, cssmin : { css:{ src: 'dist/theme.css', dest: 'dist/theme.css' } }, uglify : { js: { files: { 'dist/theme.js' : [ 'dist/theme.js' ] } } }, 'gh-pages': { options: { base: 'dist' , message: 'Generated by grunt gh-pages' } , src: ['**/*'] }, copy: { main: { src: 'src/jenkins_logo.png', dest: 'dist/jenkins_logo.png' }, }, }); grunt.loadNpmTasks('grunt-contrib-concat'); grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadNpmTasks('grunt-contrib-cssmin'); grunt.loadNpmTasks('grunt-gh-pages'); grunt.loadNpmTasks('grunt-contrib-copy'); grunt.registerTask('default', [ 'copy', 'concat:css', 'cssmin:css', 'concat:js', 'uglify:js' ]); grunt.registerTask ('deploy', ['default', 'gh-pages']); };
{ "pile_set_name": "Github" }
using System; using System.Collections.Generic; namespace Xms.WebResource { public interface IWebResourceImporter { bool Import(Guid solutionId, List<Domain.WebResource> webResources); } }
{ "pile_set_name": "Github" }
package pflag import "strconv" // -- int8 Value type int8Value int8 func newInt8Value(val int8, p *int8) *int8Value { *p = val return (*int8Value)(p) } func (i *int8Value) Set(s string) error { v, err := strconv.ParseInt(s, 0, 8) *i = int8Value(v) return err } func (i *int8Value) Type() string { return "int8" } func (i *int8Value) String() string { return strconv.FormatInt(int64(*i), 10) } func int8Conv(sval string) (interface{}, error) { v, err := strconv.ParseInt(sval, 0, 8) if err != nil { return 0, err } return int8(v), nil } // GetInt8 return the int8 value of a flag with the given name func (f *FlagSet) GetInt8(name string) (int8, error) { val, err := f.getFlagType(name, "int8", int8Conv) if err != nil { return 0, err } return val.(int8), nil } // Int8Var defines an int8 flag with specified name, default value, and usage string. // The argument p points to an int8 variable in which to store the value of the flag. func (f *FlagSet) Int8Var(p *int8, name string, value int8, usage string) { f.VarP(newInt8Value(value, p), name, "", usage) } // Int8VarP is like Int8Var, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) Int8VarP(p *int8, name, shorthand string, value int8, usage string) { f.VarP(newInt8Value(value, p), name, shorthand, usage) } // Int8Var defines an int8 flag with specified name, default value, and usage string. // The argument p points to an int8 variable in which to store the value of the flag. func Int8Var(p *int8, name string, value int8, usage string) { CommandLine.VarP(newInt8Value(value, p), name, "", usage) } // Int8VarP is like Int8Var, but accepts a shorthand letter that can be used after a single dash. func Int8VarP(p *int8, name, shorthand string, value int8, usage string) { CommandLine.VarP(newInt8Value(value, p), name, shorthand, usage) } // Int8 defines an int8 flag with specified name, default value, and usage string. // The return value is the address of an int8 variable that stores the value of the flag. func (f *FlagSet) Int8(name string, value int8, usage string) *int8 { p := new(int8) f.Int8VarP(p, name, "", value, usage) return p } // Int8P is like Int8, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) Int8P(name, shorthand string, value int8, usage string) *int8 { p := new(int8) f.Int8VarP(p, name, shorthand, value, usage) return p } // Int8 defines an int8 flag with specified name, default value, and usage string. // The return value is the address of an int8 variable that stores the value of the flag. func Int8(name string, value int8, usage string) *int8 { return CommandLine.Int8P(name, "", value, usage) } // Int8P is like Int8, but accepts a shorthand letter that can be used after a single dash. func Int8P(name, shorthand string, value int8, usage string) *int8 { return CommandLine.Int8P(name, shorthand, value, usage) }
{ "pile_set_name": "Github" }
# https://stackoverflow.com/questions/8683588/understanding-nltk-collocation-scoring-for-bigrams-and-trigrams from operator import itemgetter from collections import defaultdict from nltk.collocations import QuadgramCollocationFinder from nltk.metrics.association import QuadgramAssocMeasures def rank_quadgrams(corpus, metric, path=None): """ Find and rank quadgrams from the supplied corpus using the given association metric. Write the quadgrams out to the given path if supplied otherwise return the list in memory. """ # Create a collocation ranking utility from corpus words. ngrams = QuadgramCollocationFinder.from_words(corpus.words()) # Rank collocations by an association metric scored = ngrams.score_ngrams(metric) if path: with open(path, 'w') as f: f.write("Collocation\tScore ({})\n".format(metric.__name__)) for ngram, score in scored: f.write("{}\t{}\n".format(repr(ngram), score)) else: return scored if __name__ == '__main__': from reader import PickledCorpusReader corpus = PickledCorpusReader('../corpus') rank_quadgrams( corpus, QuadgramAssocMeasures.likelihood_ratio, "quadgrams.txt" ) # # Group quadgrams by first word # prefixed = defaultdict(list) # for key, score in scored: # prefixed[key[0]].append((key[1:], scores)) # # # Sort keyed quadgrams by strongest association # for key in prefixed: # prefixed[key].sort(key=itemgetter(1), reverse=True)
{ "pile_set_name": "Github" }
# This file is distributed under the same license as the Django package. # # Translators: # Andrew Boltachev <[email protected]>, 2012-2013. msgid "" msgstr "" "Project-Id-Version: Django\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-01-01 16:10+0100\n" "PO-Revision-Date: 2013-01-13 18:45+0000\n" "Last-Translator: Andrew Boltachev <[email protected]>\n" "Language-Team: Udmurt (http://www.transifex.com/projects/p/django/language/" "udm/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: udm\n" "Plural-Forms: nplurals=1; plural=0;\n" #: conf/global_settings.py:48 msgid "Afrikaans" msgstr "Африкаанс" #: conf/global_settings.py:49 msgid "Arabic" msgstr "Араб" #: conf/global_settings.py:50 msgid "Azerbaijani" msgstr "Азербайджан" #: conf/global_settings.py:51 msgid "Bulgarian" msgstr "Болгар" #: conf/global_settings.py:52 msgid "Belarusian" msgstr "Беларус" #: conf/global_settings.py:53 msgid "Bengali" msgstr "Бенгал" #: conf/global_settings.py:54 msgid "Breton" msgstr "Бретон" #: conf/global_settings.py:55 msgid "Bosnian" msgstr "Босниец" #: conf/global_settings.py:56 msgid "Catalan" msgstr "Каталан" #: conf/global_settings.py:57 msgid "Czech" msgstr "Чех" #: conf/global_settings.py:58 msgid "Welsh" msgstr "Уэльс" #: conf/global_settings.py:59 msgid "Danish" msgstr "Датчан" #: conf/global_settings.py:60 msgid "German" msgstr "Немец" #: conf/global_settings.py:61 msgid "Greek" msgstr "Грек" #: conf/global_settings.py:62 msgid "English" msgstr "Англи" #: conf/global_settings.py:63 msgid "British English" msgstr "Британиысь англи" #: conf/global_settings.py:64 msgid "Esperanto" msgstr "Эсперанто" #: conf/global_settings.py:65 msgid "Spanish" msgstr "Испан" #: conf/global_settings.py:66 msgid "Argentinian Spanish" msgstr "Аргентинаысь испан" #: conf/global_settings.py:67 msgid "Mexican Spanish" msgstr "Мексикаысь испан" #: conf/global_settings.py:68 msgid "Nicaraguan Spanish" msgstr "Никарагуаысь испан" #: conf/global_settings.py:69 msgid "Venezuelan Spanish" msgstr "Венесуэлаысь испан" #: conf/global_settings.py:70 msgid "Estonian" msgstr "Эстон" #: conf/global_settings.py:71 msgid "Basque" msgstr "Баск" #: conf/global_settings.py:72 msgid "Persian" msgstr "Перс" #: conf/global_settings.py:73 msgid "Finnish" msgstr "Финн" #: conf/global_settings.py:74 msgid "French" msgstr "Француз" #: conf/global_settings.py:75 msgid "Frisian" msgstr "Фриз" #: conf/global_settings.py:76 msgid "Irish" msgstr "Ирланд" #: conf/global_settings.py:77 msgid "Galician" msgstr "Галисий" #: conf/global_settings.py:78 msgid "Hebrew" msgstr "Иврит" #: conf/global_settings.py:79 msgid "Hindi" msgstr "Хинди" #: conf/global_settings.py:80 msgid "Croatian" msgstr "Хорват" #: conf/global_settings.py:81 msgid "Hungarian" msgstr "Венгер" #: conf/global_settings.py:82 msgid "Interlingua" msgstr "Интерлингва" #: conf/global_settings.py:83 msgid "Indonesian" msgstr "Индонези" #: conf/global_settings.py:84 msgid "Icelandic" msgstr "Исланд" #: conf/global_settings.py:85 msgid "Italian" msgstr "Итальян" #: conf/global_settings.py:86 msgid "Japanese" msgstr "Япон" #: conf/global_settings.py:87 msgid "Georgian" msgstr "Грузин" #: conf/global_settings.py:88 msgid "Kazakh" msgstr "Казах" #: conf/global_settings.py:89 msgid "Khmer" msgstr "Кхмер" #: conf/global_settings.py:90 msgid "Kannada" msgstr "Каннада" #: conf/global_settings.py:91 msgid "Korean" msgstr "Корей" #: conf/global_settings.py:92 msgid "Luxembourgish" msgstr "Люксембург" #: conf/global_settings.py:93 msgid "Lithuanian" msgstr "Литва" #: conf/global_settings.py:94 msgid "Latvian" msgstr "Латвий" #: conf/global_settings.py:95 msgid "Macedonian" msgstr "Македон" #: conf/global_settings.py:96 msgid "Malayalam" msgstr "Малаялам" #: conf/global_settings.py:97 msgid "Mongolian" msgstr "Монгол" #: conf/global_settings.py:98 msgid "Norwegian Bokmal" msgstr "Норвег (букмол)" #: conf/global_settings.py:99 msgid "Nepali" msgstr "Непал" #: conf/global_settings.py:100 msgid "Dutch" msgstr "Голланд" #: conf/global_settings.py:101 msgid "Norwegian Nynorsk" msgstr "Норвег (нюнорск)" #: conf/global_settings.py:102 msgid "Punjabi" msgstr "Панджаби" #: conf/global_settings.py:103 msgid "Polish" msgstr "Поляк" #: conf/global_settings.py:104 msgid "Portuguese" msgstr "Португал" #: conf/global_settings.py:105 msgid "Brazilian Portuguese" msgstr "Бразилиысь португал" #: conf/global_settings.py:106 msgid "Romanian" msgstr "Румын" #: conf/global_settings.py:107 msgid "Russian" msgstr "Ӟуч" #: conf/global_settings.py:108 msgid "Slovak" msgstr "Словак" #: conf/global_settings.py:109 msgid "Slovenian" msgstr "Словен" #: conf/global_settings.py:110 msgid "Albanian" msgstr "Албан" #: conf/global_settings.py:111 msgid "Serbian" msgstr "Серб" #: conf/global_settings.py:112 msgid "Serbian Latin" msgstr "Серб (латиницаен)" #: conf/global_settings.py:113 msgid "Swedish" msgstr "Швед" #: conf/global_settings.py:114 msgid "Swahili" msgstr "Суахили" #: conf/global_settings.py:115 msgid "Tamil" msgstr "Тамиль" #: conf/global_settings.py:116 msgid "Telugu" msgstr "Телугу" #: conf/global_settings.py:117 msgid "Thai" msgstr "Тай" #: conf/global_settings.py:118 msgid "Turkish" msgstr "Турок" #: conf/global_settings.py:119 msgid "Tatar" msgstr "Бигер" #: conf/global_settings.py:120 msgid "Udmurt" msgstr "Удмурт" #: conf/global_settings.py:121 msgid "Ukrainian" msgstr "Украин" #: conf/global_settings.py:122 msgid "Urdu" msgstr "Урду" #: conf/global_settings.py:123 msgid "Vietnamese" msgstr "Вьетнам" #: conf/global_settings.py:124 msgid "Simplified Chinese" msgstr "Китай (капчиятэм)" #: conf/global_settings.py:125 msgid "Traditional Chinese" msgstr "Китай (традици)" #: core/validators.py:21 forms/fields.py:52 msgid "Enter a valid value." msgstr "Тазэ шонер гожтэ." #: core/validators.py:104 forms/fields.py:464 msgid "Enter a valid email address." msgstr "Электорн почта адресэз шонер гожтэ" #: core/validators.py:107 forms/fields.py:1013 msgid "" "Enter a valid 'slug' consisting of letters, numbers, underscores or hyphens." msgstr "" "Татчын букваос, лыдпусъёс, улӥ гож пусъёс но дефисъёс гинэ гожтыны яра." #: core/validators.py:110 core/validators.py:129 forms/fields.py:987 msgid "Enter a valid IPv4 address." msgstr "Шонер IPv4-адрес гожтэ." #: core/validators.py:115 core/validators.py:130 msgid "Enter a valid IPv6 address." msgstr "Шонер IPv6-адрес гожтэ." #: core/validators.py:125 core/validators.py:128 msgid "Enter a valid IPv4 or IPv6 address." msgstr "Шонер IPv4 яке IPv6 адрес гожтэ." #: core/validators.py:151 db/models/fields/__init__.py:655 msgid "Enter only digits separated by commas." msgstr "Запятойёсын висъям лыдпусъёсты гожтэ" #: core/validators.py:157 #, python-format msgid "Ensure this value is %(limit_value)s (it is %(show_value)s)." msgstr "Эскере, та %(limit_value)s шуыса. Али татын %(show_value)s." #: core/validators.py:176 forms/fields.py:210 forms/fields.py:263 #, python-format msgid "Ensure this value is less than or equal to %(limit_value)s." msgstr "Талы %(limit_value)s-лэсь бадӟымгес луыны уг яра." #: core/validators.py:182 forms/fields.py:211 forms/fields.py:264 #, python-format msgid "Ensure this value is greater than or equal to %(limit_value)s." msgstr "Талы %(limit_value)s-лэсь ӧжытгес луыны уг яра." #: core/validators.py:189 #, python-format msgid "" "Ensure this value has at least %(limit_value)d characters (it has " "%(show_value)d)." msgstr "" "Татын %(limit_value)d яке бадӟымгес пус луыны кулэ. Али татын %(show_value)d " "пус." #: core/validators.py:196 #, python-format msgid "" "Ensure this value has at most %(limit_value)d characters (it has " "%(show_value)d)." msgstr "" "Татын %(limit_value)d яке ӧжытгес пус луыны кулэ. Али татын %(show_value)d " "пус." #: db/models/base.py:857 #, python-format msgid "%(field_name)s must be unique for %(date_field)s %(lookup)s." msgstr "%(field_name)s must be unique for %(date_field)s %(lookup)s." #: db/models/base.py:880 forms/models.py:573 msgid "and" msgstr "но" #: db/models/base.py:881 db/models/fields/__init__.py:70 #, python-format msgid "%(model_name)s with this %(field_label)s already exists." msgstr "Таӵе %(field_label)s-ен %(model_name)s вань ини." #: db/models/fields/__init__.py:67 #, python-format msgid "Value %r is not a valid choice." msgstr "%r шонер вариант ӧвӧл." #: db/models/fields/__init__.py:68 msgid "This field cannot be null." msgstr "Та NULL луыны уг яра." #: db/models/fields/__init__.py:69 msgid "This field cannot be blank." msgstr "Та буш луыны уг яра." #: db/models/fields/__init__.py:76 #, python-format msgid "Field of type: %(field_type)s" msgstr "%(field_type)s типъем бусы" #: db/models/fields/__init__.py:517 db/models/fields/__init__.py:985 msgid "Integer" msgstr "целой" #: db/models/fields/__init__.py:521 db/models/fields/__init__.py:983 #, python-format msgid "'%s' value must be an integer." msgstr "'%s' целой лыд луыны кулэ." #: db/models/fields/__init__.py:569 #, python-format msgid "'%s' value must be either True or False." msgstr "'%s' True яке False луыны кулэ." #: db/models/fields/__init__.py:571 msgid "Boolean (Either True or False)" msgstr "True яке False" #: db/models/fields/__init__.py:622 #, python-format msgid "String (up to %(max_length)s)" msgstr "Чур (%(max_length)s пусозь кузьда)" #: db/models/fields/__init__.py:650 msgid "Comma-separated integers" msgstr "Запятоен висъям быдэс лыдъёс" #: db/models/fields/__init__.py:664 #, python-format msgid "'%s' value has an invalid date format. It must be in YYYY-MM-DD format." msgstr "'%s' шонертэм гожтэмын. Дата АААА-ТТ-НН форматъя луыны кулэ." #: db/models/fields/__init__.py:666 db/models/fields/__init__.py:754 #, python-format msgid "" "'%s' value has the correct format (YYYY-MM-DD) but it is an invalid date." msgstr "'%s' форматезъя (АААА-ТТ-НН) шонер, но сыӵе дата луыны уг быгаты." #: db/models/fields/__init__.py:669 msgid "Date (without time)" msgstr "Дата (час-минут пусйытэк)" #: db/models/fields/__init__.py:752 #, python-format msgid "" "'%s' value has an invalid format. It must be in YYYY-MM-DD HH:MM[:ss[." "uuuuuu]][TZ] format." msgstr "" "'%s' шонертэм гожтэмын. Дата но час-минут АААА-ТТ-НН ЧЧ:ММ[:сс[.мммммм]][ЧП] " "форматъя луыны кулэ." #: db/models/fields/__init__.py:756 #, python-format msgid "" "'%s' value has the correct format (YYYY-MM-DD HH:MM[:ss[.uuuuuu]][TZ]) but " "it is an invalid date/time." msgstr "" "'%s' форматезъя (АААА-ТТ-НН ЧЧ:ММ[:сс[.мммммм]][ЧП]) шонер, но сыӵе дата но " "час-минут луыны уг быгаты." #: db/models/fields/__init__.py:760 msgid "Date (with time)" msgstr "Дата но час-минут" #: db/models/fields/__init__.py:849 #, python-format msgid "'%s' value must be a decimal number." msgstr "'%s' десятичной лыд луыны кулэ." #: db/models/fields/__init__.py:851 msgid "Decimal number" msgstr "Десятичной лыд." #: db/models/fields/__init__.py:908 msgid "Email address" msgstr "Электрон почта адрес" #: db/models/fields/__init__.py:927 msgid "File path" msgstr "Файллэн нимыз" #: db/models/fields/__init__.py:954 #, python-format msgid "'%s' value must be a float." msgstr "'%s' вещественной лыд луыны кулэ." #: db/models/fields/__init__.py:956 msgid "Floating point number" msgstr "Вещественной лыд" #: db/models/fields/__init__.py:1017 msgid "Big (8 byte) integer" msgstr "Бадӟым (8 байтъем) целой лыд" #: db/models/fields/__init__.py:1031 msgid "IPv4 address" msgstr "IPv4 адрес" #: db/models/fields/__init__.py:1047 msgid "IP address" msgstr "IP адрес" #: db/models/fields/__init__.py:1090 #, python-format msgid "'%s' value must be either None, True or False." msgstr "'%s' None, True яке False луыны кулэ." #: db/models/fields/__init__.py:1092 msgid "Boolean (Either True, False or None)" msgstr "True, False яке None" #: db/models/fields/__init__.py:1141 msgid "Positive integer" msgstr "Целой, нольлэсь бадӟым лыд" #: db/models/fields/__init__.py:1152 msgid "Positive small integer" msgstr "Нольлэсь бадӟым пичи целой лыд" #: db/models/fields/__init__.py:1163 #, python-format msgid "Slug (up to %(max_length)s)" msgstr "Компьютерной ним (%(max_length)s пусозь кузьда)" #: db/models/fields/__init__.py:1181 msgid "Small integer" msgstr "Пичи целой лыд" #: db/models/fields/__init__.py:1187 msgid "Text" msgstr "Текст" #: db/models/fields/__init__.py:1205 #, python-format msgid "" "'%s' value has an invalid format. It must be in HH:MM[:ss[.uuuuuu]] format." msgstr "'%s' шонертэм гожтэмын. Со ЧЧ:ММ[:сс[.мммммм]] форматъя луыны кулэ." #: db/models/fields/__init__.py:1207 #, python-format msgid "" "'%s' value has the correct format (HH:MM[:ss[.uuuuuu]]) but it is an invalid " "time." msgstr "" "'%s' форматэзъя (ЧЧ:ММ[:сс[.мммммм]]) шонер, но таӵе час-минут луыны уг " "быгаты." #: db/models/fields/__init__.py:1210 msgid "Time" msgstr "Час-минут" #: db/models/fields/__init__.py:1272 msgid "URL" msgstr "URL" #: db/models/fields/files.py:216 msgid "File" msgstr "Файл" #: db/models/fields/files.py:323 msgid "Image" msgstr "Суред" #: db/models/fields/related.py:979 #, python-format msgid "Model %(model)s with pk %(pk)r does not exist." msgstr "Таӵе идентификаторен %(pk)r %(model)s ӧвӧл." #: db/models/fields/related.py:981 msgid "Foreign Key (type determined by related field)" msgstr "Мукет моделен герӟет (тип герӟано бусыя валамын)." #: db/models/fields/related.py:1111 msgid "One-to-one relationship" msgstr "Одӥг-одӥг герӟет" #: db/models/fields/related.py:1178 msgid "Many-to-many relationship" msgstr "Трос-трос герӟет" #: db/models/fields/related.py:1203 msgid "" "Hold down \"Control\", or \"Command\" on a Mac, to select more than one." msgstr "Тросэз быръён понна \"Control\", (яке, Mac-ын, \"Command\") кутэлэ." #: forms/fields.py:51 msgid "This field is required." msgstr "Та клуэ." #: forms/fields.py:209 msgid "Enter a whole number." msgstr "Целой лыд гожтэ." #: forms/fields.py:241 forms/fields.py:262 msgid "Enter a number." msgstr "Лыд гожтэ." #: forms/fields.py:265 #, python-format msgid "Ensure that there are no more than %s digits in total." msgstr "Эскере та %s лыдпуслэсь кузьгес ӧвӧл шуыса." #: forms/fields.py:266 #, python-format msgid "Ensure that there are no more than %s decimal places." msgstr "Эскере, татын %s яке ӧжытгес десятичной лыдъёс луыны кулэ." #: forms/fields.py:267 #, python-format msgid "Ensure that there are no more than %s digits before the decimal point." msgstr "Эскере, запятой азьын %s-лэсь тросгес лыдпус ӧвӧл шуыса." #: forms/fields.py:355 forms/fields.py:953 msgid "Enter a valid date." msgstr "Шонер дата гожтэ." #: forms/fields.py:378 forms/fields.py:954 msgid "Enter a valid time." msgstr "Шонер час-минут гожтэ." #: forms/fields.py:399 msgid "Enter a valid date/time." msgstr "Шонер дата но час-минут гожтэ." #: forms/fields.py:475 msgid "No file was submitted. Check the encoding type on the form." msgstr "Одӥг файл но лэзьымтэ. Формалэсь код." #: forms/fields.py:476 msgid "No file was submitted." msgstr "Файл лэземын ӧвӧл." #: forms/fields.py:477 msgid "The submitted file is empty." msgstr "Лэзем файл буш." #: forms/fields.py:478 #, python-format msgid "" "Ensure this filename has at most %(max)d characters (it has %(length)d)." msgstr "" "Эскере, файллэн нимыз %(max)d пуслэсь кузьгес ӧвӧл шуыса (солэн кузьдалаез " "%(length)d пус)." #: forms/fields.py:479 msgid "Please either submit a file or check the clear checkbox, not both." msgstr "" "Файл лэзе яке файл ӵушоно шуыса пусъе, огдыръя соиз но, таиз но уг яра." #: forms/fields.py:534 msgid "" "Upload a valid image. The file you uploaded was either not an image or a " "corrupted image." msgstr "Суред лэзе. Тӥляд файлды лэзьымтэ яке со суред ӧвӧл." #: forms/fields.py:580 msgid "Enter a valid URL." msgstr "Шонер URL гожтэ." #: forms/fields.py:666 forms/fields.py:746 #, python-format msgid "Select a valid choice. %(value)s is not one of the available choices." msgstr "Шонер вариант быръе. %(value)s вариантъёс пӧлын ӧвӧл." #: forms/fields.py:747 forms/fields.py:835 forms/models.py:1002 msgid "Enter a list of values." msgstr "Список лэзе." #: forms/formsets.py:324 forms/formsets.py:326 msgid "Order" msgstr "Рад" #: forms/formsets.py:328 msgid "Delete" msgstr "Ӵушоно" #: forms/models.py:567 #, python-format msgid "Please correct the duplicate data for %(field)s." msgstr "" #: forms/models.py:571 #, python-format msgid "Please correct the duplicate data for %(field)s, which must be unique." msgstr "" #: forms/models.py:577 #, python-format msgid "" "Please correct the duplicate data for %(field_name)s which must be unique " "for the %(lookup)s in %(date_field)s." msgstr "" #: forms/models.py:585 msgid "Please correct the duplicate values below." msgstr "" #: forms/models.py:852 msgid "The inline foreign key did not match the parent instance primary key." msgstr "" #: forms/models.py:913 msgid "Select a valid choice. That choice is not one of the available choices." msgstr "" #: forms/models.py:1003 #, python-format msgid "Select a valid choice. %s is not one of the available choices." msgstr "" #: forms/models.py:1005 #, python-format msgid "\"%s\" is not a valid value for a primary key." msgstr "" #: forms/util.py:81 #, python-format msgid "" "%(datetime)s couldn't be interpreted in time zone %(current_timezone)s; it " "may be ambiguous or it may not exist." msgstr "" "%(datetime)s couldn't be interpreted in time zone %(current_timezone)s; it " "may be ambiguous or it may not exist." #: forms/widgets.py:336 msgid "Currently" msgstr "Али" #: forms/widgets.py:337 msgid "Change" msgstr "Тупатъяно" #: forms/widgets.py:338 msgid "Clear" msgstr "Буш кароно" #: forms/widgets.py:594 msgid "Unknown" msgstr "Тодымтэ" #: forms/widgets.py:595 msgid "Yes" msgstr "Бен" #: forms/widgets.py:596 msgid "No" msgstr "Ӧвӧл" #: template/defaultfilters.py:794 msgid "yes,no,maybe" msgstr "бен,ӧвӧл,уг тодӥськы" #: template/defaultfilters.py:822 template/defaultfilters.py:833 #, python-format msgid "%(size)d byte" msgid_plural "%(size)d bytes" msgstr[0] "%(size)d байт" #: template/defaultfilters.py:835 #, python-format msgid "%s KB" msgstr "%s КБ" #: template/defaultfilters.py:837 #, python-format msgid "%s MB" msgstr "%s МБ" #: template/defaultfilters.py:839 #, python-format msgid "%s GB" msgstr "%s МБ" #: template/defaultfilters.py:841 #, python-format msgid "%s TB" msgstr "%s ТБ" #: template/defaultfilters.py:842 #, python-format msgid "%s PB" msgstr "%s ПБ" #: utils/dateformat.py:47 msgid "p.m." msgstr "лымшор бере" #: utils/dateformat.py:48 msgid "a.m." msgstr "лымшор азе" #: utils/dateformat.py:53 msgid "PM" msgstr "лымшор бере" #: utils/dateformat.py:54 msgid "AM" msgstr "лымшор азе" #: utils/dateformat.py:103 msgid "midnight" msgstr "уйшор" #: utils/dateformat.py:105 msgid "noon" msgstr "лымшор" #: utils/dates.py:6 msgid "Monday" msgstr "Вордӥськон" #: utils/dates.py:6 msgid "Tuesday" msgstr "Пуксён" #: utils/dates.py:6 msgid "Wednesday" msgstr "Вирнунал" #: utils/dates.py:6 msgid "Thursday" msgstr "Покчиарня" #: utils/dates.py:6 msgid "Friday" msgstr "Удмуртарня" #: utils/dates.py:7 msgid "Saturday" msgstr "Кӧснунал" #: utils/dates.py:7 msgid "Sunday" msgstr "Арнянунал" #: utils/dates.py:10 msgid "Mon" msgstr "врд" #: utils/dates.py:10 msgid "Tue" msgstr "пкс" #: utils/dates.py:10 msgid "Wed" msgstr "врн" #: utils/dates.py:10 msgid "Thu" msgstr "пкч" #: utils/dates.py:10 msgid "Fri" msgstr "удм" #: utils/dates.py:11 msgid "Sat" msgstr "ксн" #: utils/dates.py:11 msgid "Sun" msgstr "арн" #: utils/dates.py:18 msgid "January" msgstr "толшор" #: utils/dates.py:18 msgid "February" msgstr "тулыспал" #: utils/dates.py:18 msgid "March" msgstr "южтолэзь" #: utils/dates.py:18 msgid "April" msgstr "оштолэзь" #: utils/dates.py:18 msgid "May" msgstr "куартолэзь" #: utils/dates.py:18 msgid "June" msgstr "инвожо" #: utils/dates.py:19 msgid "July" msgstr "пӧсьтолэзь" #: utils/dates.py:19 msgid "August" msgstr "гудырикошкон" #: utils/dates.py:19 msgid "September" msgstr "куарусён" #: utils/dates.py:19 msgid "October" msgstr "коньывуон" #: utils/dates.py:19 msgid "November" msgstr "шуркынмон" #: utils/dates.py:20 msgid "December" msgstr "толсур" #: utils/dates.py:23 msgid "jan" msgstr "тшт" #: utils/dates.py:23 msgid "feb" msgstr "тпт" #: utils/dates.py:23 msgid "mar" msgstr "южт" #: utils/dates.py:23 msgid "apr" msgstr "ошт" #: utils/dates.py:23 msgid "may" msgstr "крт" #: utils/dates.py:23 msgid "jun" msgstr "ивт" #: utils/dates.py:24 msgid "jul" msgstr "пст" #: utils/dates.py:24 msgid "aug" msgstr "гкт" #: utils/dates.py:24 msgid "sep" msgstr "кут" #: utils/dates.py:24 msgid "oct" msgstr "квт" #: utils/dates.py:24 msgid "nov" msgstr "шкт" #: utils/dates.py:24 msgid "dec" msgstr "тст" #: utils/dates.py:31 msgctxt "abbrev. month" msgid "Jan." msgstr "тшт" #: utils/dates.py:32 msgctxt "abbrev. month" msgid "Feb." msgstr "тпт" #: utils/dates.py:33 msgctxt "abbrev. month" msgid "March" msgstr "южт" #: utils/dates.py:34 msgctxt "abbrev. month" msgid "April" msgstr "ошт" #: utils/dates.py:35 msgctxt "abbrev. month" msgid "May" msgstr "крт" #: utils/dates.py:36 msgctxt "abbrev. month" msgid "June" msgstr "ивт" #: utils/dates.py:37 msgctxt "abbrev. month" msgid "July" msgstr "пст" #: utils/dates.py:38 msgctxt "abbrev. month" msgid "Aug." msgstr "гкт" #: utils/dates.py:39 msgctxt "abbrev. month" msgid "Sept." msgstr "кут" #: utils/dates.py:40 msgctxt "abbrev. month" msgid "Oct." msgstr "квт" #: utils/dates.py:41 msgctxt "abbrev. month" msgid "Nov." msgstr "шкт" #: utils/dates.py:42 msgctxt "abbrev. month" msgid "Dec." msgstr "тст" #: utils/dates.py:45 msgctxt "alt. month" msgid "January" msgstr "толшоре" #: utils/dates.py:46 msgctxt "alt. month" msgid "February" msgstr "тулыспалэ" #: utils/dates.py:47 msgctxt "alt. month" msgid "March" msgstr "южтолэзе" #: utils/dates.py:48 msgctxt "alt. month" msgid "April" msgstr "оштолэзе" #: utils/dates.py:49 msgctxt "alt. month" msgid "May" msgstr "куартолэзе" #: utils/dates.py:50 msgctxt "alt. month" msgid "June" msgstr "инвожое" #: utils/dates.py:51 msgctxt "alt. month" msgid "July" msgstr "пӧсьтолэзе" #: utils/dates.py:52 msgctxt "alt. month" msgid "August" msgstr "гудырикошконэ" #: utils/dates.py:53 msgctxt "alt. month" msgid "September" msgstr "куарусёнэ" #: utils/dates.py:54 msgctxt "alt. month" msgid "October" msgstr "коньывуонэ" #: utils/dates.py:55 msgctxt "alt. month" msgid "November" msgstr "шуркынмонэ" #: utils/dates.py:56 msgctxt "alt. month" msgid "December" msgstr "толсуре" #: utils/text.py:70 #, python-format msgctxt "String to return when truncating text" msgid "%(truncated_text)s..." msgstr "%(truncated_text)s..." #: utils/text.py:239 msgid "or" msgstr "яке" #. Translators: This string is used as a separator between list elements #: utils/text.py:256 msgid ", " msgstr "," #: utils/timesince.py:22 msgid "year" msgid_plural "years" msgstr[0] "ар" #: utils/timesince.py:23 msgid "month" msgid_plural "months" msgstr[0] "толэзь" #: utils/timesince.py:24 msgid "week" msgid_plural "weeks" msgstr[0] "арня" #: utils/timesince.py:25 msgid "day" msgid_plural "days" msgstr[0] "нунал" #: utils/timesince.py:26 msgid "hour" msgid_plural "hours" msgstr[0] "час" #: utils/timesince.py:27 msgid "minute" msgid_plural "minutes" msgstr[0] "минут" #: utils/timesince.py:43 msgid "minutes" msgstr "минут" #: utils/timesince.py:48 #, python-format msgid "%(number)d %(type)s" msgstr "%(number)d %(type)s" #: utils/timesince.py:54 #, python-format msgid ", %(number)d %(type)s" msgstr ", %(number)d %(type)s" #: views/static.py:56 msgid "Directory indexes are not allowed here." msgstr "Папкаослэсь пуштроссэс татын учкыны уг яра." #: views/static.py:58 #, python-format msgid "\"%(path)s\" does not exist" msgstr "\"%(path)s\" ӧвӧл" #: views/static.py:98 #, python-format msgid "Index of %(directory)s" msgstr "%(directory)s папкалэн пушторсэз" #: views/generic/dates.py:42 msgid "No year specified" msgstr "" #: views/generic/dates.py:98 msgid "No month specified" msgstr "" #: views/generic/dates.py:157 msgid "No day specified" msgstr "" #: views/generic/dates.py:213 msgid "No week specified" msgstr "" #: views/generic/dates.py:368 views/generic/dates.py:393 #, python-format msgid "No %(verbose_name_plural)s available" msgstr "" #: views/generic/dates.py:646 #, python-format msgid "" "Future %(verbose_name_plural)s not available because %(class_name)s." "allow_future is False." msgstr "" #: views/generic/dates.py:678 #, python-format msgid "Invalid date string '%(datestr)s' given format '%(format)s'" msgstr "" #: views/generic/detail.py:54 #, python-format msgid "No %(verbose_name)s found matching the query" msgstr "" #: views/generic/list.py:51 msgid "Page is not 'last', nor can it be converted to an int." msgstr "" #: views/generic/list.py:56 #, python-format msgid "Invalid page (%(page_number)s): %(message)s" msgstr "" #: views/generic/list.py:137 #, python-format msgid "Empty list and '%(class_name)s.allow_empty' is False." msgstr ""
{ "pile_set_name": "Github" }
'use strict'; var GetIntrinsic = require('../GetIntrinsic'); var $TypeError = GetIntrinsic('%TypeError%'); var $Number = GetIntrinsic('%Number%'); var $RegExp = GetIntrinsic('%RegExp%'); var $parseInteger = GetIntrinsic('%parseInt%'); var callBound = require('../helpers/callBound'); var regexTester = require('../helpers/regexTester'); var isPrimitive = require('../helpers/isPrimitive'); var $strSlice = callBound('String.prototype.slice'); var isBinary = regexTester(/^0b[01]+$/i); var isOctal = regexTester(/^0o[0-7]+$/i); var isInvalidHexLiteral = regexTester(/^[-+]0x[0-9a-f]+$/i); var nonWS = ['\u0085', '\u200b', '\ufffe'].join(''); var nonWSregex = new $RegExp('[' + nonWS + ']', 'g'); var hasNonWS = regexTester(nonWSregex); // whitespace from: https://es5.github.io/#x15.5.4.20 // implementation from https://github.com/es-shims/es5-shim/blob/v3.4.0/es5-shim.js#L1304-L1324 var ws = [ '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003', '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028', '\u2029\uFEFF' ].join(''); var trimRegex = new RegExp('(^[' + ws + ']+)|([' + ws + ']+$)', 'g'); var $replace = callBound('String.prototype.replace'); var $trim = function (value) { return $replace(value, trimRegex, ''); }; var ToPrimitive = require('./ToPrimitive'); // https://www.ecma-international.org/ecma-262/6.0/#sec-tonumber module.exports = function ToNumber(argument) { var value = isPrimitive(argument) ? argument : ToPrimitive(argument, $Number); if (typeof value === 'symbol') { throw new $TypeError('Cannot convert a Symbol value to a number'); } if (typeof value === 'string') { if (isBinary(value)) { return ToNumber($parseInteger($strSlice(value, 2), 2)); } else if (isOctal(value)) { return ToNumber($parseInteger($strSlice(value, 2), 8)); } else if (hasNonWS(value) || isInvalidHexLiteral(value)) { return NaN; } else { var trimmed = $trim(value); if (trimmed !== value) { return ToNumber(trimmed); } } } return $Number(value); };
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <solid android:color="@color/lib_pub_color_bg_sub" /> <corners android:radius="@dimen/lib_pub_dimen_btn_corner" /> <stroke android:width="1dp" android:color="@color/lib_pub_color_text_disable" /> </shape>
{ "pile_set_name": "Github" }
<!DOCTYPE html> <html lang="en"> <head> <title>Classes Reference</title> <link rel="stylesheet" type="text/css" href="css/jazzy.css" /> <link rel="stylesheet" type="text/css" href="css/highlight.css" /> <meta charset="utf-8"> <script src="js/jquery.min.js" defer></script> <script src="js/jazzy.js" defer></script> <script src="js/lunr.min.js" defer></script> <script src="js/typeahead.jquery.js" defer></script> <script src="js/jazzy.search.js" defer></script> </head> <body> <a name="//apple_ref/swift/Section/Classes" class="dashAnchor"></a> <a title="Classes Reference"></a> <header class="header"> <p class="header-col header-col--primary"> <a class="header-link" href="index.html"> Alamofire Docs </a> (85% documented) </p> <p class="header-col--secondary"> <form role="search" action="search.json"> <input type="text" placeholder="Search documentation" data-typeahead> </form> </p> <p class="header-col header-col--secondary"> <a class="header-link" href="https://github.com/Alamofire/Alamofire"> <img class="header-icon" src="img/gh.png"/> View on GitHub </a> </p> <p class="header-col header-col--secondary"> <a class="header-link" href="dash-feed://https%3A%2F%2Falamofire%2Egithub%2Eio%2FAlamofire%2Fdocsets%2FAlamofire%2Exml"> <img class="header-icon" src="img/dash.png"/> Install in Dash </a> </p> </header> <p class="breadcrumbs"> <a class="breadcrumb" href="index.html">Alamofire Reference</a> <img class="carat" src="img/carat.png" /> Classes Reference </p> <div class="content-wrapper"> <nav class="navigation"> <ul class="nav-groups"> <li class="nav-group-name"> <a class="nav-group-name-link" href="Classes.html">Classes</a> <ul class="nav-group-tasks"> <li class="nav-group-task"> <a class="nav-group-task-link" href="Classes/DataRequest.html">DataRequest</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Classes/DownloadRequest.html">DownloadRequest</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Classes/DownloadRequest/DownloadOptions.html">– DownloadOptions</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Classes/MultipartFormData.html">MultipartFormData</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Classes/NetworkReachabilityManager.html">NetworkReachabilityManager</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Classes/NetworkReachabilityManager/NetworkReachabilityStatus.html">– NetworkReachabilityStatus</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Classes/NetworkReachabilityManager/ConnectionType.html">– ConnectionType</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Classes/Request.html">Request</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Classes/Request/ValidationResult.html">– ValidationResult</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Classes/ServerTrustPolicyManager.html">ServerTrustPolicyManager</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Classes/SessionDelegate.html">SessionDelegate</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Classes/SessionManager.html">SessionManager</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Classes/SessionManager/MultipartFormDataEncodingResult.html">– MultipartFormDataEncodingResult</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Classes.html#/s:9Alamofire13StreamRequestC">StreamRequest</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Classes/TaskDelegate.html">TaskDelegate</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Classes/UploadRequest.html">UploadRequest</a> </li> </ul> </li> <li class="nav-group-name"> <a class="nav-group-name-link" href="Enums.html">Enumerations</a> <ul class="nav-group-tasks"> <li class="nav-group-task"> <a class="nav-group-task-link" href="Enums/AFError.html">AFError</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Enums/AFError/ParameterEncodingFailureReason.html">– ParameterEncodingFailureReason</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Enums/AFError/MultipartEncodingFailureReason.html">– MultipartEncodingFailureReason</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Enums/AFError/ResponseValidationFailureReason.html">– ResponseValidationFailureReason</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Enums/AFError/ResponseSerializationFailureReason.html">– ResponseSerializationFailureReason</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Enums/HTTPMethod.html">HTTPMethod</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Enums/Result.html">Result</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Enums/ServerTrustPolicy.html">ServerTrustPolicy</a> </li> </ul> </li> <li class="nav-group-name"> <a class="nav-group-name-link" href="Extensions.html">Extensions</a> <ul class="nav-group-tasks"> <li class="nav-group-task"> <a class="nav-group-task-link" href="Extensions/Notification.html">Notification</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Extensions/Notification/Name.html">– Name</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Extensions/Notification/Key.html">– Key</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Extensions/String.html">String</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Extensions/URL.html">URL</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Extensions/URLComponents.html">URLComponents</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Extensions/URLRequest.html">URLRequest</a> </li> </ul> </li> <li class="nav-group-name"> <a class="nav-group-name-link" href="Functions.html">Functions</a> <ul class="nav-group-tasks"> <li class="nav-group-task"> <a class="nav-group-task-link" href="Functions.html#/s:9Alamofire2eeoiySbAA26NetworkReachabilityManagerC0cD6StatusO_AFtF">==(_:_:)</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Functions.html#/s:9Alamofire8download_6method10parameters8encoding7headers2toAA15DownloadRequestCAA14URLConvertible_p_AA10HTTPMethodOSDySSypGSgAA17ParameterEncoding_pSDyS2SGSg10Foundation3URLV011destinationO0_AI0H7OptionsV7optionstAT_So17NSHTTPURLResponseCtcSgtF">download(_:method:parameters:encoding:headers:to:)</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Functions.html#/s:9Alamofire8download_2toAA15DownloadRequestCAA21URLRequestConvertible_p_10Foundation3URLV011destinationI0_AE0D7OptionsV7optionstAI_So17NSHTTPURLResponseCtcSgtF">download(_:to:)</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Functions.html#/s:9Alamofire8download12resumingWith2toAA15DownloadRequestC10Foundation4DataV_AG3URLV011destinationJ0_AF0F7OptionsV7optionstAK_So17NSHTTPURLResponseCtcSgtF">download(resumingWith:to:)</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Functions.html#/s:9Alamofire7requestyAA11DataRequestCAA21URLRequestConvertible_pF">request(_:)</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Functions.html#/s:9Alamofire7request_6method10parameters8encoding7headersAA11DataRequestCAA14URLConvertible_p_AA10HTTPMethodOSDySSypGSgAA17ParameterEncoding_pSDyS2SGSgtF">request(_:method:parameters:encoding:headers:)</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Functions.html#/s:9Alamofire6stream4withAA13StreamRequestCSo12NSNetServiceC_tF">stream(with:)</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Functions.html#/s:9Alamofire6stream12withHostName4portAA13StreamRequestCSS_SitF">stream(withHostName:port:)</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Functions.html#/s:9Alamofire6upload_2to6method7headersAA13UploadRequestC10Foundation3URLV_AA14URLConvertible_pAA10HTTPMethodOSDyS2SGSgtF">upload(_:to:method:headers:)</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Functions.html#/s:9Alamofire6upload_2to6method7headersAA13UploadRequestC10Foundation4DataV_AA14URLConvertible_pAA10HTTPMethodOSDyS2SGSgtF">upload(_:to:method:headers:)</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Functions.html#/s:9Alamofire6upload_2to6method7headersAA13UploadRequestCSo13NSInputStreamC_AA14URLConvertible_pAA10HTTPMethodOSDyS2SGSgtF">upload(_:to:method:headers:)</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Functions.html#/s:9Alamofire6upload_4withAA13UploadRequestC10Foundation3URLV_AA21URLRequestConvertible_ptF">upload(_:with:)</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Functions.html#/s:9Alamofire6upload_4withAA13UploadRequestC10Foundation4DataV_AA21URLRequestConvertible_ptF">upload(_:with:)</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Functions.html#/s:9Alamofire6upload_4withAA13UploadRequestCSo13NSInputStreamC_AA21URLRequestConvertible_ptF">upload(_:with:)</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Functions.html#/s:9Alamofire6upload17multipartFormData14usingThreshold2to6method7headers18encodingCompletionyyAA09MultipartdE0Cc_s6UInt64VAA14URLConvertible_pAA10HTTPMethodOSDyS2SGSgyAA14SessionManagerC0mdE14EncodingResultOcSgtF">upload(multipartFormData:usingThreshold:to:method:headers:encodingCompletion:)</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Functions.html#/s:9Alamofire6upload17multipartFormData14usingThreshold4with18encodingCompletionyyAA09MultipartdE0Cc_s6UInt64VAA21URLRequestConvertible_pyAA14SessionManagerC0kdE14EncodingResultOcSgtF">upload(multipartFormData:usingThreshold:with:encodingCompletion:)</a> </li> </ul> </li> <li class="nav-group-name"> <a class="nav-group-name-link" href="Protocols.html">Protocols</a> <ul class="nav-group-tasks"> <li class="nav-group-task"> <a class="nav-group-task-link" href="Protocols/DataResponseSerializerProtocol.html">DataResponseSerializerProtocol</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Protocols/DownloadResponseSerializerProtocol.html">DownloadResponseSerializerProtocol</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Protocols/ParameterEncoding.html">ParameterEncoding</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Protocols/RequestAdapter.html">RequestAdapter</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Protocols/RequestRetrier.html">RequestRetrier</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Protocols/URLConvertible.html">URLConvertible</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Protocols/URLRequestConvertible.html">URLRequestConvertible</a> </li> </ul> </li> <li class="nav-group-name"> <a class="nav-group-name-link" href="Structs.html">Structures</a> <ul class="nav-group-tasks"> <li class="nav-group-task"> <a class="nav-group-task-link" href="Structs/DataResponse.html">DataResponse</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Structs/DataResponseSerializer.html">DataResponseSerializer</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Structs/DefaultDataResponse.html">DefaultDataResponse</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Structs/DefaultDownloadResponse.html">DefaultDownloadResponse</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Structs/DownloadResponse.html">DownloadResponse</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Structs/DownloadResponseSerializer.html">DownloadResponseSerializer</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Structs/JSONEncoding.html">JSONEncoding</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Structs/PropertyListEncoding.html">PropertyListEncoding</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Structs/Timeline.html">Timeline</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Structs/URLEncoding.html">URLEncoding</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Structs/URLEncoding/Destination.html">– Destination</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Structs/URLEncoding/ArrayEncoding.html">– ArrayEncoding</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Structs/URLEncoding/BoolEncoding.html">– BoolEncoding</a> </li> </ul> </li> <li class="nav-group-name"> <a class="nav-group-name-link" href="Typealiases.html">Type Aliases</a> <ul class="nav-group-tasks"> <li class="nav-group-task"> <a class="nav-group-task-link" href="Typealiases.html#/s:9Alamofire11HTTPHeadersa">HTTPHeaders</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Typealiases.html#/s:9Alamofire10Parametersa">Parameters</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Typealiases.html#/s:9Alamofire22RequestRetryCompletiona">RequestRetryCompletion</a> </li> </ul> </li> </ul> </nav> <article class="main-content"> <section class="section"> <div class="section-content"> <h1>Classes</h1> <p>The following classes are available globally.</p> </div> </section> <section class="section"> <div class="section-content"> <div class="task-group"> <ul class="item-container"> <li class="item"> <div> <code> <a name="/s:9Alamofire17MultipartFormDataC"></a> <a name="//apple_ref/swift/Class/MultipartFormData" class="dashAnchor"></a> <a class="token" href="#/s:9Alamofire17MultipartFormDataC">MultipartFormData</a> </code> </div> <div class="height-container"> <div class="pointer-container"></div> <section class="section"> <div class="pointer"></div> <div class="abstract"> <p>Constructs <code>multipart/form-data</code> for uploads within an HTTP or HTTPS body. There are currently two ways to encode multipart form data. The first way is to encode the data directly in memory. This is very efficient, but can lead to memory issues if the dataset is too large. The second way is designed for larger datasets and will write all the data to a single file on disk with all the proper boundary segmentation. The second approach MUST be used for larger datasets such as video content, otherwise your app may run out of memory when trying to encode the dataset.</p> <p>For more information on <code>multipart/form-data</code> in general, please refer to the RFC-2388 and RFC-2045 specs as well and the w3 form documentation.</p> <ul> <li><a href="https://www.ietf.org/rfc/rfc2388.txt">https://www.ietf.org/rfc/rfc2388.txt</a></li> <li><a href="https://www.ietf.org/rfc/rfc2045.txt">https://www.ietf.org/rfc/rfc2045.txt</a></li> <li><a href="https://www.w3.org/TR/html401/interact/forms.html#h-17.13">https://www.w3.org/TR/html401/interact/forms.html#h-17.13</a></li> </ul> <a href="Classes/MultipartFormData.html" class="slightly-smaller">See more</a> </div> <div class="declaration"> <h4>Declaration</h4> <div class="language"> <p class="aside-title">Swift</p> <pre class="highlight swift"><code><span class="kd">open</span> <span class="kd">class</span> <span class="kt">MultipartFormData</span></code></pre> </div> </div> </section> </div> </li> </ul> </div> <div class="task-group"> <ul class="item-container"> <li class="item"> <div> <code> <a name="/s:9Alamofire26NetworkReachabilityManagerC"></a> <a name="//apple_ref/swift/Class/NetworkReachabilityManager" class="dashAnchor"></a> <a class="token" href="#/s:9Alamofire26NetworkReachabilityManagerC">NetworkReachabilityManager</a> </code> </div> <div class="height-container"> <div class="pointer-container"></div> <section class="section"> <div class="pointer"></div> <div class="abstract"> <p>The <code>NetworkReachabilityManager</code> class listens for reachability changes of hosts and addresses for both WWAN and WiFi network interfaces.</p> <p>Reachability can be used to determine background information about why a network operation failed, or to retry network requests when a connection is established. It should not be used to prevent a user from initiating a network request, as it&rsquo;s possible that an initial request may be required to establish reachability.</p> <a href="Classes/NetworkReachabilityManager.html" class="slightly-smaller">See more</a> </div> <div class="declaration"> <h4>Declaration</h4> <div class="language"> <p class="aside-title">Swift</p> <pre class="highlight swift"><code><span class="kd">open</span> <span class="kd">class</span> <span class="kt">NetworkReachabilityManager</span></code></pre> </div> </div> </section> </div> </li> </ul> </div> <div class="task-group"> <ul class="item-container"> <li class="item"> <div> <code> <a name="/s:9Alamofire7RequestC"></a> <a name="//apple_ref/swift/Class/Request" class="dashAnchor"></a> <a class="token" href="#/s:9Alamofire7RequestC">Request</a> </code> </div> <div class="height-container"> <div class="pointer-container"></div> <section class="section"> <div class="pointer"></div> <div class="abstract"> <p>Responsible for sending a request and receiving the response and associated data from the server, as well as managing its underlying <code>URLSessionTask</code>.</p> <a href="Classes/Request.html" class="slightly-smaller">See more</a> </div> <div class="declaration"> <h4>Declaration</h4> <div class="language"> <p class="aside-title">Swift</p> <pre class="highlight swift"><code><span class="kd">open</span> <span class="kd">class</span> <span class="kt">Request</span></code></pre> </div> </div> </section> </div> </li> </ul> </div> <div class="task-group"> <ul class="item-container"> <li class="item"> <div> <code> <a name="/s:9Alamofire11DataRequestC"></a> <a name="//apple_ref/swift/Class/DataRequest" class="dashAnchor"></a> <a class="token" href="#/s:9Alamofire11DataRequestC">DataRequest</a> </code> </div> <div class="height-container"> <div class="pointer-container"></div> <section class="section"> <div class="pointer"></div> <div class="abstract"> <p>Specific type of <code><a href="Classes/Request.html">Request</a></code> that manages an underlying <code>URLSessionDataTask</code>.</p> <a href="Classes/DataRequest.html" class="slightly-smaller">See more</a> </div> <div class="declaration"> <h4>Declaration</h4> <div class="language"> <p class="aside-title">Swift</p> <pre class="highlight swift"><code><span class="kd">open</span> <span class="kd">class</span> <span class="kt">DataRequest</span> <span class="p">:</span> <span class="kt"><a href="Classes/Request.html">Request</a></span></code></pre> </div> </div> </section> </div> </li> </ul> </div> <div class="task-group"> <ul class="item-container"> <li class="item"> <div> <code> <a name="/s:9Alamofire15DownloadRequestC"></a> <a name="//apple_ref/swift/Class/DownloadRequest" class="dashAnchor"></a> <a class="token" href="#/s:9Alamofire15DownloadRequestC">DownloadRequest</a> </code> </div> <div class="height-container"> <div class="pointer-container"></div> <section class="section"> <div class="pointer"></div> <div class="abstract"> <p>Specific type of <code><a href="Classes/Request.html">Request</a></code> that manages an underlying <code>URLSessionDownloadTask</code>.</p> <a href="Classes/DownloadRequest.html" class="slightly-smaller">See more</a> </div> <div class="declaration"> <h4>Declaration</h4> <div class="language"> <p class="aside-title">Swift</p> <pre class="highlight swift"><code><span class="kd">open</span> <span class="kd">class</span> <span class="kt">DownloadRequest</span> <span class="p">:</span> <span class="kt"><a href="Classes/Request.html">Request</a></span></code></pre> </div> </div> </section> </div> </li> </ul> </div> <div class="task-group"> <ul class="item-container"> <li class="item"> <div> <code> <a name="/s:9Alamofire13UploadRequestC"></a> <a name="//apple_ref/swift/Class/UploadRequest" class="dashAnchor"></a> <a class="token" href="#/s:9Alamofire13UploadRequestC">UploadRequest</a> </code> </div> <div class="height-container"> <div class="pointer-container"></div> <section class="section"> <div class="pointer"></div> <div class="abstract"> <p>Specific type of <code><a href="Classes/Request.html">Request</a></code> that manages an underlying <code>URLSessionUploadTask</code>.</p> <a href="Classes/UploadRequest.html" class="slightly-smaller">See more</a> </div> <div class="declaration"> <h4>Declaration</h4> <div class="language"> <p class="aside-title">Swift</p> <pre class="highlight swift"><code><span class="kd">open</span> <span class="kd">class</span> <span class="kt">UploadRequest</span> <span class="p">:</span> <span class="kt"><a href="Classes/DataRequest.html">DataRequest</a></span></code></pre> </div> </div> </section> </div> </li> </ul> </div> <div class="task-group"> <ul class="item-container"> <li class="item"> <div> <code> <a name="/s:9Alamofire13StreamRequestC"></a> <a name="//apple_ref/swift/Class/StreamRequest" class="dashAnchor"></a> <a class="token" href="#/s:9Alamofire13StreamRequestC">StreamRequest</a> </code> </div> <div class="height-container"> <div class="pointer-container"></div> <section class="section"> <div class="pointer"></div> <div class="abstract"> <p>Specific type of <code><a href="Classes/Request.html">Request</a></code> that manages an underlying <code>URLSessionStreamTask</code>.</p> </div> <div class="declaration"> <h4>Declaration</h4> <div class="language"> <p class="aside-title">Swift</p> <pre class="highlight swift"><code><span class="kd">@available(iOS 9.0, OSX 10.11, tvOS 9.0, *)</span> <span class="kd">open</span> <span class="kd">class</span> <span class="kt">StreamRequest</span> <span class="p">:</span> <span class="kt"><a href="Classes/Request.html">Request</a></span></code></pre> </div> </div> </section> </div> </li> </ul> </div> <div class="task-group"> <ul class="item-container"> <li class="item"> <div> <code> <a name="/s:9Alamofire24ServerTrustPolicyManagerC"></a> <a name="//apple_ref/swift/Class/ServerTrustPolicyManager" class="dashAnchor"></a> <a class="token" href="#/s:9Alamofire24ServerTrustPolicyManagerC">ServerTrustPolicyManager</a> </code> </div> <div class="height-container"> <div class="pointer-container"></div> <section class="section"> <div class="pointer"></div> <div class="abstract"> <p>Responsible for managing the mapping of <code><a href="Enums/ServerTrustPolicy.html">ServerTrustPolicy</a></code> objects to a given host.</p> <a href="Classes/ServerTrustPolicyManager.html" class="slightly-smaller">See more</a> </div> <div class="declaration"> <h4>Declaration</h4> <div class="language"> <p class="aside-title">Swift</p> <pre class="highlight swift"><code><span class="kd">open</span> <span class="kd">class</span> <span class="kt">ServerTrustPolicyManager</span></code></pre> </div> </div> </section> </div> </li> </ul> </div> <div class="task-group"> <ul class="item-container"> <li class="item"> <div> <code> <a name="/c:@M@Alamofire@objc(cs)SessionDelegate"></a> <a name="//apple_ref/swift/Class/SessionDelegate" class="dashAnchor"></a> <a class="token" href="#/c:@M@Alamofire@objc(cs)SessionDelegate">SessionDelegate</a> </code> </div> <div class="height-container"> <div class="pointer-container"></div> <section class="section"> <div class="pointer"></div> <div class="abstract"> <p>Responsible for handling all delegate callbacks for the underlying session.</p> <a href="Classes/SessionDelegate.html" class="slightly-smaller">See more</a> </div> <div class="declaration"> <h4>Declaration</h4> <div class="language"> <p class="aside-title">Swift</p> <pre class="highlight swift"><code><span class="kd">open</span> <span class="kd">class</span> <span class="kt">SessionDelegate</span> <span class="p">:</span> <span class="kt">NSObject</span></code></pre> </div> </div> </section> </div> </li> </ul> </div> <div class="task-group"> <ul class="item-container"> <li class="item"> <div> <code> <a name="/s:9Alamofire14SessionManagerC"></a> <a name="//apple_ref/swift/Class/SessionManager" class="dashAnchor"></a> <a class="token" href="#/s:9Alamofire14SessionManagerC">SessionManager</a> </code> </div> <div class="height-container"> <div class="pointer-container"></div> <section class="section"> <div class="pointer"></div> <div class="abstract"> <p>Responsible for creating and managing <code><a href="Classes/Request.html">Request</a></code> objects, as well as their underlying <code>NSURLSession</code>.</p> <a href="Classes/SessionManager.html" class="slightly-smaller">See more</a> </div> <div class="declaration"> <h4>Declaration</h4> <div class="language"> <p class="aside-title">Swift</p> <pre class="highlight swift"><code><span class="kd">open</span> <span class="kd">class</span> <span class="kt">SessionManager</span></code></pre> </div> </div> </section> </div> </li> </ul> </div> <div class="task-group"> <ul class="item-container"> <li class="item"> <div> <code> <a name="/c:@M@Alamofire@objc(cs)TaskDelegate"></a> <a name="//apple_ref/swift/Class/TaskDelegate" class="dashAnchor"></a> <a class="token" href="#/c:@M@Alamofire@objc(cs)TaskDelegate">TaskDelegate</a> </code> </div> <div class="height-container"> <div class="pointer-container"></div> <section class="section"> <div class="pointer"></div> <div class="abstract"> <p>The task delegate is responsible for handling all delegate callbacks for the underlying task as well as executing all operations attached to the serial operation queue upon task completion.</p> <a href="Classes/TaskDelegate.html" class="slightly-smaller">See more</a> </div> <div class="declaration"> <h4>Declaration</h4> <div class="language"> <p class="aside-title">Swift</p> <pre class="highlight swift"><code><span class="kd">open</span> <span class="kd">class</span> <span class="kt">TaskDelegate</span> <span class="p">:</span> <span class="kt">NSObject</span></code></pre> </div> </div> </section> </div> </li> </ul> </div> </div> </section> </article> </div> <section class="footer"> <p>&copy; 2019 <a class="link" href="http://alamofire.org/" target="_blank" rel="external">Alamofire Software Foundation</a>. All rights reserved. (Last updated: 2019-03-27)</p> <p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.4</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p> </section> </body> </div> </html>
{ "pile_set_name": "Github" }
// // Generated by class-dump 3.5 (64 bit) (Debug version compiled Oct 15 2018 10:31:50). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard. // @class NSString, NSURL, NSView, NSWindow; @protocol FormCompletionPresentationContext @property(readonly, nonatomic) BOOL shouldSavePasswordsToCloudKeychain; @property(readonly, nonatomic) BOOL shouldSaveUsernamesAndPasswords; @property(readonly, nonatomic) struct Frame frame; @property(readonly, nonatomic) NSView *browserView; @property(readonly, nonatomic) __weak NSWindow *window; @property(readonly, nonatomic) NSURL *url; - (void)getCredentialMatches:(id *)arg1 andPotentialMatches:(id *)arg2 matchingPartialUsername:(NSString *)arg3 omittingCredentialsUserHasDeniedAccessTo:(BOOL)arg4; @end
{ "pile_set_name": "Github" }
<?php namespace MailThief; use Exception; use Illuminate\Contracts\Mail\MailQueue; use Illuminate\Contracts\Mail\Mailer; class MailThiefFiveFiveCompatible extends MailThief implements Mailer, MailQueue { public function onQueue($queue, $view, array $data, $callback) { throw new Exception('MailThief doesn\'t support queueing in Laravel 5.5'); } public function queueOn($queue, $view, array $data, $callback) { throw new Exception('MailThief doesn\'t support queueing in Laravel 5.5'); } public function laterOn($queue, $delay, $view, array $data, $callback) { throw new Exception('MailThief doesn\'t support queueing in Laravel 5.5'); } public function queue($view, $queue = null) { throw new Exception('MailThief doesn\'t support queueing in Laravel 5.5'); } public function later($delay, $view, $queue = null) { throw new Exception('MailThief doesn\'t support queueing in Laravel 5.5'); } public function to($users) { throw new Exception('MailThief doesn\'t support mailables'); } public function bcc($users) { throw new Exception('MailThief doesn\'t support mailables'); } }
{ "pile_set_name": "Github" }
// This icon file is generated automatically. // tslint:disable var PicCenterOutlined = { "name": "pic-center", "theme": "outlined", "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M952 792H72c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h880c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0-632H72c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h880c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM848 660c8.8 0 16-7.2 16-16V380c0-8.8-7.2-16-16-16H176c-8.8 0-16 7.2-16 16v264c0 8.8 7.2 16 16 16h672zM232 436h560v152H232V436z" } }] } }; export default PicCenterOutlined;
{ "pile_set_name": "Github" }
-- Should all be true select cast('abc' as char(10)) = cast('abc' as char(10)), cast('abc' as char(10)) <= cast('abc' as char(10)), cast('abc' as char(10)) >= cast('abc' as char(10)), cast('abc' as char(10)) < cast('abd' as char(10)), cast('abc' as char(10)) > cast('abb' as char(10)), cast('abc' as char(10)) <> cast('abb' as char(10)) from src limit 1; -- Different char lengths should still compare the same select cast('abc' as char(10)) = cast('abc' as char(3)), cast('abc' as char(10)) <= cast('abc' as char(3)), cast('abc' as char(10)) >= cast('abc' as char(3)), cast('abc' as char(10)) < cast('abd' as char(3)), cast('abc' as char(10)) > cast('abb' as char(3)), cast('abc' as char(10)) <> cast('abb' as char(3)) from src limit 1; -- Should work with string types as well select cast('abc' as char(10)) = 'abc', cast('abc' as char(10)) <= 'abc', cast('abc' as char(10)) >= 'abc', cast('abc' as char(10)) < 'abd', cast('abc' as char(10)) > 'abb', cast('abc' as char(10)) <> 'abb' from src limit 1; -- leading space is significant for char select cast(' abc' as char(10)) <> cast('abc' as char(10)) from src limit 1; -- trailing space is not significant for char select cast('abc ' as char(10)) = cast('abc' as char(10)) from src limit 1;
{ "pile_set_name": "Github" }
fileFormatVersion: 2 guid: 6cdf782d955034d0bb9ef0463854b30f timeCreated: 1482443296 licenseType: Pro NativeFormatImporter: userData: assetBundleName: assetBundleVariant:
{ "pile_set_name": "Github" }
// { dg-do link { target c++11 } } // { dg-require-cstdint "" } // // 2009-09-29 Paolo Carlini <[email protected]> // // Copyright (C) 2009-2019 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library 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, 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 General Public License for more details. // // You should have received a copy of the GNU General Public License along // with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. #include <random> void test01() { std::mt19937 mt; const void* p = &mt.word_size; p = &mt.state_size; p = &mt.shift_size; p = &mt.mask_bits; p = &mt.xor_mask; p = &mt.tempering_u; p = &mt.tempering_d; p = &mt.tempering_s; p = &mt.tempering_b; p = &mt.tempering_t; p = &mt.tempering_c; p = &mt.tempering_l; p = &mt.initialization_multiplier; p = &mt.default_seed; p = p; // Suppress unused warning. } int main() { test01(); return 0; }
{ "pile_set_name": "Github" }
/* * Copyright (c) 2002-2020 Gargoyle Software 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. */ package com.gargoylesoftware.htmlunit.activex.javascript.msxml; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxFunction; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxGetter; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxSetter; /** * A JavaScript object for MSXML's (ActiveX) XSLTemplate.<br> * Used for caching compiled XSL Transformations (XSLT) templates. * @see <a href="http://msdn.microsoft.com/en-us/library/ms767644.aspx">MSDN documentation</a> * * @author Ahmed Ashour * @author Frank Danek */ @JsxClass(IE) public class XSLTemplate extends MSXMLScriptable { private XMLDOMNode stylesheet_; /** * Sets the Extensible Stylesheet Language (XSL) style sheet to compile into an XSL template. * @param node the Extensible Stylesheet Language (XSL) style sheet to compile into an XSL template */ @JsxSetter public void setStylesheet(final XMLDOMNode node) { stylesheet_ = node; } /** * Returns the Extensible Stylesheet Language (XSL) style sheet to compile into an XSL template. * @return the Extensible Stylesheet Language (XSL) style sheet to compile into an XSL template */ @JsxGetter public XMLDOMNode getStylesheet() { return stylesheet_; } /** * Creates a rental-model XSLProcessor object that will use this template. * @return the XSLTProcessor */ @JsxFunction public XSLProcessor createProcessor() { final XSLProcessor processor = new XSLProcessor(); processor.setPrototype(getPrototype(processor.getClass())); processor.setParentScope(this); processor.importStylesheet(stylesheet_); return processor; } }
{ "pile_set_name": "Github" }
<h1>Register</h1> <ul class="tabs"> <li ui-sref-active="active"><a ui-sref="register.step1">Step 1</a></li> <li ui-sref-active="active"><a ui-sref="register.step2">Step 2</a></li> <li ui-sref-active="active"><a ui-sref="register.step3">Step 3</a></li> </ul> <ui-view></ui-view>
{ "pile_set_name": "Github" }
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Tests of coverage/python.py""" import os import sys import pytest from coverage import env from coverage.python import get_zip_bytes, source_for_file from tests.coveragetest import CoverageTest class GetZipBytesTest(CoverageTest): """Tests of `get_zip_bytes`.""" run_in_temp_dir = False def test_get_encoded_zip_files(self): # See igor.py, do_zipmods, for the text of these files. zip_file = "tests/zipmods.zip" sys.path.append(zip_file) # So we can import the files. for encoding in ["utf8", "gb2312", "hebrew", "shift_jis", "cp1252"]: filename = zip_file + "/encoded_" + encoding + ".py" filename = filename.replace("/", os.sep) zip_data = get_zip_bytes(filename) zip_text = zip_data.decode(encoding) self.assertIn('All OK', zip_text) # Run the code to see that we really got it encoded properly. __import__("encoded_"+encoding) def test_source_for_file(tmpdir): path = tmpdir.join("a.py") src = str(path) assert source_for_file(src) == src assert source_for_file(src + 'c') == src assert source_for_file(src + 'o') == src unknown = src + 'FOO' assert source_for_file(unknown) == unknown @pytest.mark.skipif(not env.WINDOWS, reason="not windows") def test_source_for_file_windows(tmpdir): path = tmpdir.join("a.py") src = str(path) # On windows if a pyw exists, it is an acceptable source path_windows = tmpdir.ensure("a.pyw") assert str(path_windows) == source_for_file(src + 'c') # If both pyw and py exist, py is preferred path.ensure(file=True) assert source_for_file(src + 'c') == src def test_source_for_file_jython(): assert source_for_file("a$py.class") == "a.py"
{ "pile_set_name": "Github" }
-----BEGIN RSA PRIVATE KEY----- MIIEpgIBAAKCAQEA5awwJQ2cJj+mcXOLEmjnUkUVyQZm0Lm8ZlqalPG160ygpL4N Zf9lOsHiSEuds1uk3maJO1LrOY8sMnjUifzAR2+1+crQD0LLy7v91hcGlXxyc4pk COL7Zsffgg4Gc4qWKXrbeyBdfB3vAz4hbq9cQp/KadKjjlfJly//E6VICX5mjiaL KoBaqK4+Z4qhediMCb7bq/4MKatsaQrWGglAf3Rc83ny1d+5LefEuo05mZ2H+JCH RSoYck3hpg0X/8Ds/pCvx/2irabGIMyP/26Pm7LljRXHiHVq3Qga+t3FbOKpe1Te 6dsX5/XJBH8B+sBbrUC6rgP+n0ZIFBRfH8VIhwIDAQABAoIBAQC59hllZwev0Ims AqnwVhA2hMmG4zAMgNcS6PmQ78Ukp/7KZTfkBk6orKPTdaZSuzla+hrTdegPyuU2 WK9+qq/lJ4ZootakBKmOZMC6wBoMn57r/nnQ2DhGmD9YxpJiqyu6mkdsAmCvRm1o ar4XKNXC/C6gUHUto9cOG0alWYZiZ/VMe/nhPTChr2Dhd+bavO1yx7/CxB+VQMfQ l6ihbv//3KgPJAElbaI7jfOGzX6KlwXSGf70REmZQnPGN4/n46/dLFFuA1HzcA5Z 37NU1zgN2nIrXld8rsR1mSy6EwU46sW3AkEwv6SUajCjz7PCmmWxRaQErGJjZrUq sujNj5RBAoGBAPgdiY+6B7WvmLlCBCwI4PXjgRQ/6A1Ycgvi1LdSQzccSHddogNI tWKa0pIrYyH7y7jB/UzstFSnsOXAf4H6Xt70VUrFPq1/dRRw1CtSLA1sFspBAD8v aGl9R0XqWOk1t60mfgES9b4LJu46cTm7UMfyC7EbWkqHYWqf15umRgwrAoGBAOz4 nZGqBVBW/ERDs+Imf9NcwDeuwllQ0S9ZBPHF///SQ4Rscz2Bl8GhjhTHldLNJg9k HjP8W2BOPas66K3WM+WC3AiGrdJfs6Ju3r27X4wA0hnNc6bcoRaoSNRaqThSkgCH l34l7yrB1gwpa5HlIfYXjHfJ7coX7WRMQK7wmVsVAoGBAJ/Y97z/DuSAgpYn7+Qm vDfuIETZfzjJ2H/L3VtVxjQFJrKwQiZ3e1RRhoPhK/bC79bSM8yRWwSHHLKIOB2X HfPp2eFX/i9sxBMtNaPLRtJG5s/a3LvYYR5FNdvXRPzKPNFy0Q8EFgofyS8Fu9iD 02FdkSbDBoKpgZtd61w93TcNAoGBAKtM4SKeRC8aYku6oTtW10pkHvNhmk5UVJMk h6V6mx9D0NjWSMvqdVhcv8eXq19yOxQfLJIp16gbhwrTj8WyNVuwp/xl1xtfYQyH lu6Sl3QuV7KdSQATN0OYrOUNEIyNa8uEOOfQ5j4DVwb9niwd9dnelgU17HYNq+a4 FH4hoMotAoGBAJk/9+RPAdxqJsr/oVp9E4wU9ffpZ2Lr0faN7/WqBFPPhhFOMWu2 zj8fcRaP/9Wv9g2xK/GfCKhrX8FMfq/NMkZsNx6V3W0M8Zbarp9ZvA4Sj0OvsZAO J1NQjkvFjMCE0A29jtjY1zRmLzoC+Ds7Ola8IOKvAN8SM1X/CC6bOgGz -----END RSA PRIVATE KEY-----
{ "pile_set_name": "Github" }
# Please edit the object below. Lines beginning with a '#' will be ignored, # and an empty file will abort the edit. If an error occurs while saving this file will be # reopened with the relevant failures. # # services "svc1" was not valid: # * spec.clusterIP: Invalid value: "10.0.0.10": field is immutable # * spec.ports[0].protocol: Unsupported value: "VHF": supported values: TCP, UDP, SCTP # apiVersion: v1 items: - apiVersion: v1 kind: Service metadata: creationTimestamp: "2017-02-03T06:11:32Z" labels: app: svc1 name: svc1 namespace: edit-test resourceVersion: "1904" selfLink: /api/v1/namespaces/edit-test/services/svc1 uid: 9bec82be-e9d7-11e6-8c3b-acbc32c1ca87 spec: clusterIP: 10.0.0.10 ports: - name: "80" port: 82 protocol: VHF targetPort: 81 sessionAffinity: None type: ClusterIP status: loadBalancer: {} - apiVersion: v1 data: baz: qux foo: changed-value2 kind: ConfigMap metadata: creationTimestamp: "2017-02-03T06:12:07Z" name: cm1 namespace: edit-test resourceVersion: "1903" selfLink: /api/v1/namespaces/edit-test/configmaps/cm1 uid: b09bffab-e9d7-11e6-8c3b-acbc32c1ca87 kind: List metadata: {}
{ "pile_set_name": "Github" }
OPTION DOTNAME .text$ SEGMENT ALIGN(256) 'CODE' EXTERN OPENSSL_ia32cap_P:NEAR PUBLIC RC4 ALIGN 16 RC4 PROC PUBLIC mov QWORD PTR[8+rsp],rdi ;WIN64 prologue mov QWORD PTR[16+rsp],rsi mov rax,rsp $L$SEH_begin_RC4:: mov rdi,rcx mov rsi,rdx mov rdx,r8 mov rcx,r9 or rsi,rsi jne $L$entry mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue mov rsi,QWORD PTR[16+rsp] DB 0F3h,0C3h ;repret $L$entry:: push rbx push r12 push r13 $L$prologue:: mov r11,rsi mov r12,rdx mov r13,rcx xor r10,r10 xor rcx,rcx lea rdi,QWORD PTR[8+rdi] mov r10b,BYTE PTR[((-8))+rdi] mov cl,BYTE PTR[((-4))+rdi] cmp DWORD PTR[256+rdi],-1 je $L$RC4_CHAR mov r8d,DWORD PTR[OPENSSL_ia32cap_P] xor rbx,rbx inc r10b sub rbx,r10 sub r13,r12 mov eax,DWORD PTR[r10*4+rdi] test r11,-16 jz $L$loop1 bt r8d,30 jc $L$intel and rbx,7 lea rsi,QWORD PTR[1+r10] jz $L$oop8 sub r11,rbx $L$oop8_warmup:: add cl,al mov edx,DWORD PTR[rcx*4+rdi] mov DWORD PTR[rcx*4+rdi],eax mov DWORD PTR[r10*4+rdi],edx add al,dl inc r10b mov edx,DWORD PTR[rax*4+rdi] mov eax,DWORD PTR[r10*4+rdi] xor dl,BYTE PTR[r12] mov BYTE PTR[r13*1+r12],dl lea r12,QWORD PTR[1+r12] dec rbx jnz $L$oop8_warmup lea rsi,QWORD PTR[1+r10] jmp $L$oop8 ALIGN 16 $L$oop8:: add cl,al mov edx,DWORD PTR[rcx*4+rdi] mov DWORD PTR[rcx*4+rdi],eax mov ebx,DWORD PTR[rsi*4+rdi] ror r8,8 mov DWORD PTR[r10*4+rdi],edx add dl,al mov r8b,BYTE PTR[rdx*4+rdi] add cl,bl mov edx,DWORD PTR[rcx*4+rdi] mov DWORD PTR[rcx*4+rdi],ebx mov eax,DWORD PTR[4+rsi*4+rdi] ror r8,8 mov DWORD PTR[4+r10*4+rdi],edx add dl,bl mov r8b,BYTE PTR[rdx*4+rdi] add cl,al mov edx,DWORD PTR[rcx*4+rdi] mov DWORD PTR[rcx*4+rdi],eax mov ebx,DWORD PTR[8+rsi*4+rdi] ror r8,8 mov DWORD PTR[8+r10*4+rdi],edx add dl,al mov r8b,BYTE PTR[rdx*4+rdi] add cl,bl mov edx,DWORD PTR[rcx*4+rdi] mov DWORD PTR[rcx*4+rdi],ebx mov eax,DWORD PTR[12+rsi*4+rdi] ror r8,8 mov DWORD PTR[12+r10*4+rdi],edx add dl,bl mov r8b,BYTE PTR[rdx*4+rdi] add cl,al mov edx,DWORD PTR[rcx*4+rdi] mov DWORD PTR[rcx*4+rdi],eax mov ebx,DWORD PTR[16+rsi*4+rdi] ror r8,8 mov DWORD PTR[16+r10*4+rdi],edx add dl,al mov r8b,BYTE PTR[rdx*4+rdi] add cl,bl mov edx,DWORD PTR[rcx*4+rdi] mov DWORD PTR[rcx*4+rdi],ebx mov eax,DWORD PTR[20+rsi*4+rdi] ror r8,8 mov DWORD PTR[20+r10*4+rdi],edx add dl,bl mov r8b,BYTE PTR[rdx*4+rdi] add cl,al mov edx,DWORD PTR[rcx*4+rdi] mov DWORD PTR[rcx*4+rdi],eax mov ebx,DWORD PTR[24+rsi*4+rdi] ror r8,8 mov DWORD PTR[24+r10*4+rdi],edx add dl,al mov r8b,BYTE PTR[rdx*4+rdi] add sil,8 add cl,bl mov edx,DWORD PTR[rcx*4+rdi] mov DWORD PTR[rcx*4+rdi],ebx mov eax,DWORD PTR[((-4))+rsi*4+rdi] ror r8,8 mov DWORD PTR[28+r10*4+rdi],edx add dl,bl mov r8b,BYTE PTR[rdx*4+rdi] add r10b,8 ror r8,8 sub r11,8 xor r8,QWORD PTR[r12] mov QWORD PTR[r13*1+r12],r8 lea r12,QWORD PTR[8+r12] test r11,-8 jnz $L$oop8 cmp r11,0 jne $L$loop1 jmp $L$exit ALIGN 16 $L$intel:: test r11,-32 jz $L$loop1 and rbx,15 jz $L$oop16_is_hot sub r11,rbx $L$oop16_warmup:: add cl,al mov edx,DWORD PTR[rcx*4+rdi] mov DWORD PTR[rcx*4+rdi],eax mov DWORD PTR[r10*4+rdi],edx add al,dl inc r10b mov edx,DWORD PTR[rax*4+rdi] mov eax,DWORD PTR[r10*4+rdi] xor dl,BYTE PTR[r12] mov BYTE PTR[r13*1+r12],dl lea r12,QWORD PTR[1+r12] dec rbx jnz $L$oop16_warmup mov rbx,rcx xor rcx,rcx mov cl,bl $L$oop16_is_hot:: lea rsi,QWORD PTR[r10*4+rdi] add cl,al mov edx,DWORD PTR[rcx*4+rdi] pxor xmm0,xmm0 mov DWORD PTR[rcx*4+rdi],eax add al,dl mov ebx,DWORD PTR[4+rsi] movzx eax,al mov DWORD PTR[rsi],edx add cl,bl pinsrw xmm0,WORD PTR[rax*4+rdi],0 jmp $L$oop16_enter ALIGN 16 $L$oop16:: add cl,al mov edx,DWORD PTR[rcx*4+rdi] pxor xmm2,xmm0 psllq xmm1,8 pxor xmm0,xmm0 mov DWORD PTR[rcx*4+rdi],eax add al,dl mov ebx,DWORD PTR[4+rsi] movzx eax,al mov DWORD PTR[rsi],edx pxor xmm2,xmm1 add cl,bl pinsrw xmm0,WORD PTR[rax*4+rdi],0 movdqu XMMWORD PTR[r13*1+r12],xmm2 lea r12,QWORD PTR[16+r12] $L$oop16_enter:: mov edx,DWORD PTR[rcx*4+rdi] pxor xmm1,xmm1 mov DWORD PTR[rcx*4+rdi],ebx add bl,dl mov eax,DWORD PTR[8+rsi] movzx ebx,bl mov DWORD PTR[4+rsi],edx add cl,al pinsrw xmm1,WORD PTR[rbx*4+rdi],0 mov edx,DWORD PTR[rcx*4+rdi] mov DWORD PTR[rcx*4+rdi],eax add al,dl mov ebx,DWORD PTR[12+rsi] movzx eax,al mov DWORD PTR[8+rsi],edx add cl,bl pinsrw xmm0,WORD PTR[rax*4+rdi],1 mov edx,DWORD PTR[rcx*4+rdi] mov DWORD PTR[rcx*4+rdi],ebx add bl,dl mov eax,DWORD PTR[16+rsi] movzx ebx,bl mov DWORD PTR[12+rsi],edx add cl,al pinsrw xmm1,WORD PTR[rbx*4+rdi],1 mov edx,DWORD PTR[rcx*4+rdi] mov DWORD PTR[rcx*4+rdi],eax add al,dl mov ebx,DWORD PTR[20+rsi] movzx eax,al mov DWORD PTR[16+rsi],edx add cl,bl pinsrw xmm0,WORD PTR[rax*4+rdi],2 mov edx,DWORD PTR[rcx*4+rdi] mov DWORD PTR[rcx*4+rdi],ebx add bl,dl mov eax,DWORD PTR[24+rsi] movzx ebx,bl mov DWORD PTR[20+rsi],edx add cl,al pinsrw xmm1,WORD PTR[rbx*4+rdi],2 mov edx,DWORD PTR[rcx*4+rdi] mov DWORD PTR[rcx*4+rdi],eax add al,dl mov ebx,DWORD PTR[28+rsi] movzx eax,al mov DWORD PTR[24+rsi],edx add cl,bl pinsrw xmm0,WORD PTR[rax*4+rdi],3 mov edx,DWORD PTR[rcx*4+rdi] mov DWORD PTR[rcx*4+rdi],ebx add bl,dl mov eax,DWORD PTR[32+rsi] movzx ebx,bl mov DWORD PTR[28+rsi],edx add cl,al pinsrw xmm1,WORD PTR[rbx*4+rdi],3 mov edx,DWORD PTR[rcx*4+rdi] mov DWORD PTR[rcx*4+rdi],eax add al,dl mov ebx,DWORD PTR[36+rsi] movzx eax,al mov DWORD PTR[32+rsi],edx add cl,bl pinsrw xmm0,WORD PTR[rax*4+rdi],4 mov edx,DWORD PTR[rcx*4+rdi] mov DWORD PTR[rcx*4+rdi],ebx add bl,dl mov eax,DWORD PTR[40+rsi] movzx ebx,bl mov DWORD PTR[36+rsi],edx add cl,al pinsrw xmm1,WORD PTR[rbx*4+rdi],4 mov edx,DWORD PTR[rcx*4+rdi] mov DWORD PTR[rcx*4+rdi],eax add al,dl mov ebx,DWORD PTR[44+rsi] movzx eax,al mov DWORD PTR[40+rsi],edx add cl,bl pinsrw xmm0,WORD PTR[rax*4+rdi],5 mov edx,DWORD PTR[rcx*4+rdi] mov DWORD PTR[rcx*4+rdi],ebx add bl,dl mov eax,DWORD PTR[48+rsi] movzx ebx,bl mov DWORD PTR[44+rsi],edx add cl,al pinsrw xmm1,WORD PTR[rbx*4+rdi],5 mov edx,DWORD PTR[rcx*4+rdi] mov DWORD PTR[rcx*4+rdi],eax add al,dl mov ebx,DWORD PTR[52+rsi] movzx eax,al mov DWORD PTR[48+rsi],edx add cl,bl pinsrw xmm0,WORD PTR[rax*4+rdi],6 mov edx,DWORD PTR[rcx*4+rdi] mov DWORD PTR[rcx*4+rdi],ebx add bl,dl mov eax,DWORD PTR[56+rsi] movzx ebx,bl mov DWORD PTR[52+rsi],edx add cl,al pinsrw xmm1,WORD PTR[rbx*4+rdi],6 mov edx,DWORD PTR[rcx*4+rdi] mov DWORD PTR[rcx*4+rdi],eax add al,dl mov ebx,DWORD PTR[60+rsi] movzx eax,al mov DWORD PTR[56+rsi],edx add cl,bl pinsrw xmm0,WORD PTR[rax*4+rdi],7 add r10b,16 movdqu xmm2,XMMWORD PTR[r12] mov edx,DWORD PTR[rcx*4+rdi] mov DWORD PTR[rcx*4+rdi],ebx add bl,dl movzx ebx,bl mov DWORD PTR[60+rsi],edx lea rsi,QWORD PTR[r10*4+rdi] pinsrw xmm1,WORD PTR[rbx*4+rdi],7 mov eax,DWORD PTR[rsi] mov rbx,rcx xor rcx,rcx sub r11,16 mov cl,bl test r11,-16 jnz $L$oop16 psllq xmm1,8 pxor xmm2,xmm0 pxor xmm2,xmm1 movdqu XMMWORD PTR[r13*1+r12],xmm2 lea r12,QWORD PTR[16+r12] cmp r11,0 jne $L$loop1 jmp $L$exit ALIGN 16 $L$loop1:: add cl,al mov edx,DWORD PTR[rcx*4+rdi] mov DWORD PTR[rcx*4+rdi],eax mov DWORD PTR[r10*4+rdi],edx add al,dl inc r10b mov edx,DWORD PTR[rax*4+rdi] mov eax,DWORD PTR[r10*4+rdi] xor dl,BYTE PTR[r12] mov BYTE PTR[r13*1+r12],dl lea r12,QWORD PTR[1+r12] dec r11 jnz $L$loop1 jmp $L$exit ALIGN 16 $L$RC4_CHAR:: add r10b,1 movzx eax,BYTE PTR[r10*1+rdi] test r11,-8 jz $L$cloop1 jmp $L$cloop8 ALIGN 16 $L$cloop8:: mov r8d,DWORD PTR[r12] mov r9d,DWORD PTR[4+r12] add cl,al lea rsi,QWORD PTR[1+r10] movzx edx,BYTE PTR[rcx*1+rdi] movzx esi,sil movzx ebx,BYTE PTR[rsi*1+rdi] mov BYTE PTR[rcx*1+rdi],al cmp rcx,rsi mov BYTE PTR[r10*1+rdi],dl jne $L$cmov0 mov rbx,rax $L$cmov0:: add dl,al xor r8b,BYTE PTR[rdx*1+rdi] ror r8d,8 add cl,bl lea r10,QWORD PTR[1+rsi] movzx edx,BYTE PTR[rcx*1+rdi] movzx r10d,r10b movzx eax,BYTE PTR[r10*1+rdi] mov BYTE PTR[rcx*1+rdi],bl cmp rcx,r10 mov BYTE PTR[rsi*1+rdi],dl jne $L$cmov1 mov rax,rbx $L$cmov1:: add dl,bl xor r8b,BYTE PTR[rdx*1+rdi] ror r8d,8 add cl,al lea rsi,QWORD PTR[1+r10] movzx edx,BYTE PTR[rcx*1+rdi] movzx esi,sil movzx ebx,BYTE PTR[rsi*1+rdi] mov BYTE PTR[rcx*1+rdi],al cmp rcx,rsi mov BYTE PTR[r10*1+rdi],dl jne $L$cmov2 mov rbx,rax $L$cmov2:: add dl,al xor r8b,BYTE PTR[rdx*1+rdi] ror r8d,8 add cl,bl lea r10,QWORD PTR[1+rsi] movzx edx,BYTE PTR[rcx*1+rdi] movzx r10d,r10b movzx eax,BYTE PTR[r10*1+rdi] mov BYTE PTR[rcx*1+rdi],bl cmp rcx,r10 mov BYTE PTR[rsi*1+rdi],dl jne $L$cmov3 mov rax,rbx $L$cmov3:: add dl,bl xor r8b,BYTE PTR[rdx*1+rdi] ror r8d,8 add cl,al lea rsi,QWORD PTR[1+r10] movzx edx,BYTE PTR[rcx*1+rdi] movzx esi,sil movzx ebx,BYTE PTR[rsi*1+rdi] mov BYTE PTR[rcx*1+rdi],al cmp rcx,rsi mov BYTE PTR[r10*1+rdi],dl jne $L$cmov4 mov rbx,rax $L$cmov4:: add dl,al xor r9b,BYTE PTR[rdx*1+rdi] ror r9d,8 add cl,bl lea r10,QWORD PTR[1+rsi] movzx edx,BYTE PTR[rcx*1+rdi] movzx r10d,r10b movzx eax,BYTE PTR[r10*1+rdi] mov BYTE PTR[rcx*1+rdi],bl cmp rcx,r10 mov BYTE PTR[rsi*1+rdi],dl jne $L$cmov5 mov rax,rbx $L$cmov5:: add dl,bl xor r9b,BYTE PTR[rdx*1+rdi] ror r9d,8 add cl,al lea rsi,QWORD PTR[1+r10] movzx edx,BYTE PTR[rcx*1+rdi] movzx esi,sil movzx ebx,BYTE PTR[rsi*1+rdi] mov BYTE PTR[rcx*1+rdi],al cmp rcx,rsi mov BYTE PTR[r10*1+rdi],dl jne $L$cmov6 mov rbx,rax $L$cmov6:: add dl,al xor r9b,BYTE PTR[rdx*1+rdi] ror r9d,8 add cl,bl lea r10,QWORD PTR[1+rsi] movzx edx,BYTE PTR[rcx*1+rdi] movzx r10d,r10b movzx eax,BYTE PTR[r10*1+rdi] mov BYTE PTR[rcx*1+rdi],bl cmp rcx,r10 mov BYTE PTR[rsi*1+rdi],dl jne $L$cmov7 mov rax,rbx $L$cmov7:: add dl,bl xor r9b,BYTE PTR[rdx*1+rdi] ror r9d,8 lea r11,QWORD PTR[((-8))+r11] mov DWORD PTR[r13],r8d lea r12,QWORD PTR[8+r12] mov DWORD PTR[4+r13],r9d lea r13,QWORD PTR[8+r13] test r11,-8 jnz $L$cloop8 cmp r11,0 jne $L$cloop1 jmp $L$exit ALIGN 16 $L$cloop1:: add cl,al movzx ecx,cl movzx edx,BYTE PTR[rcx*1+rdi] mov BYTE PTR[rcx*1+rdi],al mov BYTE PTR[r10*1+rdi],dl add dl,al add r10b,1 movzx edx,dl movzx r10d,r10b movzx edx,BYTE PTR[rdx*1+rdi] movzx eax,BYTE PTR[r10*1+rdi] xor dl,BYTE PTR[r12] lea r12,QWORD PTR[1+r12] mov BYTE PTR[r13],dl lea r13,QWORD PTR[1+r13] sub r11,1 jnz $L$cloop1 jmp $L$exit ALIGN 16 $L$exit:: sub r10b,1 mov DWORD PTR[((-8))+rdi],r10d mov DWORD PTR[((-4))+rdi],ecx mov r13,QWORD PTR[rsp] mov r12,QWORD PTR[8+rsp] mov rbx,QWORD PTR[16+rsp] add rsp,24 $L$epilogue:: mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue mov rsi,QWORD PTR[16+rsp] DB 0F3h,0C3h ;repret $L$SEH_end_RC4:: RC4 ENDP PUBLIC private_RC4_set_key ALIGN 16 private_RC4_set_key PROC PUBLIC mov QWORD PTR[8+rsp],rdi ;WIN64 prologue mov QWORD PTR[16+rsp],rsi mov rax,rsp $L$SEH_begin_private_RC4_set_key:: mov rdi,rcx mov rsi,rdx mov rdx,r8 lea rdi,QWORD PTR[8+rdi] lea rdx,QWORD PTR[rsi*1+rdx] neg rsi mov rcx,rsi xor eax,eax xor r9,r9 xor r10,r10 xor r11,r11 mov r8d,DWORD PTR[OPENSSL_ia32cap_P] bt r8d,20 jc $L$c1stloop jmp $L$w1stloop ALIGN 16 $L$w1stloop:: mov DWORD PTR[rax*4+rdi],eax add al,1 jnc $L$w1stloop xor r9,r9 xor r8,r8 ALIGN 16 $L$w2ndloop:: mov r10d,DWORD PTR[r9*4+rdi] add r8b,BYTE PTR[rsi*1+rdx] add r8b,r10b add rsi,1 mov r11d,DWORD PTR[r8*4+rdi] cmovz rsi,rcx mov DWORD PTR[r8*4+rdi],r10d mov DWORD PTR[r9*4+rdi],r11d add r9b,1 jnc $L$w2ndloop jmp $L$exit_key ALIGN 16 $L$c1stloop:: mov BYTE PTR[rax*1+rdi],al add al,1 jnc $L$c1stloop xor r9,r9 xor r8,r8 ALIGN 16 $L$c2ndloop:: mov r10b,BYTE PTR[r9*1+rdi] add r8b,BYTE PTR[rsi*1+rdx] add r8b,r10b add rsi,1 mov r11b,BYTE PTR[r8*1+rdi] jnz $L$cnowrap mov rsi,rcx $L$cnowrap:: mov BYTE PTR[r8*1+rdi],r10b mov BYTE PTR[r9*1+rdi],r11b add r9b,1 jnc $L$c2ndloop mov DWORD PTR[256+rdi],-1 ALIGN 16 $L$exit_key:: xor eax,eax mov DWORD PTR[((-8))+rdi],eax mov DWORD PTR[((-4))+rdi],eax mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue mov rsi,QWORD PTR[16+rsp] DB 0F3h,0C3h ;repret $L$SEH_end_private_RC4_set_key:: private_RC4_set_key ENDP PUBLIC RC4_options ALIGN 16 RC4_options PROC PUBLIC lea rax,QWORD PTR[$L$opts] mov edx,DWORD PTR[OPENSSL_ia32cap_P] bt edx,20 jc $L$8xchar bt edx,30 jnc $L$done add rax,25 DB 0F3h,0C3h ;repret $L$8xchar:: add rax,12 $L$done:: DB 0F3h,0C3h ;repret ALIGN 64 $L$opts:: DB 114,99,52,40,56,120,44,105,110,116,41,0 DB 114,99,52,40,56,120,44,99,104,97,114,41,0 DB 114,99,52,40,49,54,120,44,105,110,116,41,0 DB 82,67,52,32,102,111,114,32,120,56,54,95,54,52,44,32 DB 67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97 DB 112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103 DB 62,0 ALIGN 64 RC4_options ENDP EXTERN __imp_RtlVirtualUnwind:NEAR ALIGN 16 stream_se_handler PROC PRIVATE push rsi push rdi push rbx push rbp push r12 push r13 push r14 push r15 pushfq sub rsp,64 mov rax,QWORD PTR[120+r8] mov rbx,QWORD PTR[248+r8] lea r10,QWORD PTR[$L$prologue] cmp rbx,r10 jb $L$in_prologue mov rax,QWORD PTR[152+r8] lea r10,QWORD PTR[$L$epilogue] cmp rbx,r10 jae $L$in_prologue lea rax,QWORD PTR[24+rax] mov rbx,QWORD PTR[((-8))+rax] mov r12,QWORD PTR[((-16))+rax] mov r13,QWORD PTR[((-24))+rax] mov QWORD PTR[144+r8],rbx mov QWORD PTR[216+r8],r12 mov QWORD PTR[224+r8],r13 $L$in_prologue:: mov rdi,QWORD PTR[8+rax] mov rsi,QWORD PTR[16+rax] mov QWORD PTR[152+r8],rax mov QWORD PTR[168+r8],rsi mov QWORD PTR[176+r8],rdi jmp $L$common_seh_exit stream_se_handler ENDP ALIGN 16 key_se_handler PROC PRIVATE push rsi push rdi push rbx push rbp push r12 push r13 push r14 push r15 pushfq sub rsp,64 mov rax,QWORD PTR[152+r8] mov rdi,QWORD PTR[8+rax] mov rsi,QWORD PTR[16+rax] mov QWORD PTR[168+r8],rsi mov QWORD PTR[176+r8],rdi $L$common_seh_exit:: mov rdi,QWORD PTR[40+r9] mov rsi,r8 mov ecx,154 DD 0a548f3fch mov rsi,r9 xor rcx,rcx mov rdx,QWORD PTR[8+rsi] mov r8,QWORD PTR[rsi] mov r9,QWORD PTR[16+rsi] mov r10,QWORD PTR[40+rsi] lea r11,QWORD PTR[56+rsi] lea r12,QWORD PTR[24+rsi] mov QWORD PTR[32+rsp],r10 mov QWORD PTR[40+rsp],r11 mov QWORD PTR[48+rsp],r12 mov QWORD PTR[56+rsp],rcx call QWORD PTR[__imp_RtlVirtualUnwind] mov eax,1 add rsp,64 popfq pop r15 pop r14 pop r13 pop r12 pop rbp pop rbx pop rdi pop rsi DB 0F3h,0C3h ;repret key_se_handler ENDP .text$ ENDS .pdata SEGMENT READONLY ALIGN(4) ALIGN 4 DD imagerel $L$SEH_begin_RC4 DD imagerel $L$SEH_end_RC4 DD imagerel $L$SEH_info_RC4 DD imagerel $L$SEH_begin_private_RC4_set_key DD imagerel $L$SEH_end_private_RC4_set_key DD imagerel $L$SEH_info_private_RC4_set_key .pdata ENDS .xdata SEGMENT READONLY ALIGN(8) ALIGN 8 $L$SEH_info_RC4:: DB 9,0,0,0 DD imagerel stream_se_handler $L$SEH_info_private_RC4_set_key:: DB 9,0,0,0 DD imagerel key_se_handler .xdata ENDS END
{ "pile_set_name": "Github" }
/** * Copyright 2019 The JoyQueue 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 org.joyqueue.client.samples.spring; import io.openmessaging.interceptor.ConsumerInterceptor; import io.openmessaging.interceptor.Context; import io.openmessaging.message.Message; /** * SimpleConsumerInterceptor * * author: gaohaoxiang * date: 2019/3/8 */ public class SimpleConsumerInterceptor implements ConsumerInterceptor { @Override public void preReceive(Message message, Context attributes) { System.out.println(String.format("preReceive, message: %s", message)); } @Override public void postReceive(Message message, Context attributes) { System.out.println(String.format("postReceive, message: %s", message)); } }
{ "pile_set_name": "Github" }
aeedb2d6ccdfadaeace48d04e1b24c7eafdffd1f
{ "pile_set_name": "Github" }
// // Author: B4rtik (@b4rtik) // Project: RedPeanut (https://github.com/b4rtik/RedPeanut) // License: BSD 3-Clause // using Microsoft.EntityFrameworkCore; using static RedPeanut.Models; namespace RedPeanut { public class RedPeanutDBContext : DbContext { public RedPeanutDBContext(DbContextOptions<RedPeanutDBContext> options) : base(options) { } public DbSet<WebResource> WebResources { get; set; } public DbSet<Listener> Listeners { get; set; } public DbSet<AgentInstance> Agents { get; set; } protected override void OnModelCreating(ModelBuilder modelBuilder) { modelBuilder.Entity<WebResource>().ToTable("WebResource"); modelBuilder.Entity<Listener>().ToTable("Listener"); modelBuilder.Entity<AgentInstance>().ToTable("AgentInstance"); } protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { optionsBuilder.UseSqlite("Data Source=Workspace/db/RedPeanut.db"); } } }
{ "pile_set_name": "Github" }
/// Copyright (c) 2012 Ecma International. All rights reserved. /// Ecma International makes this code available under the terms and conditions set /// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the /// "Use Terms"). Any redistribution of this code must retain the above /// copyright and this notice and otherwise comply with the Use Terms. /** * @path ch07/7.6/7.6.1/7.6.1-1-16.js * @description Allow reserved words as property names at object initialization, verified with hasOwnProperty: undeefined, NaN, Infinity */ function testcase(){ var tokenCodes = { undefined: 0, NaN: 1, Infinity: 2 }; var arr = [ 'undefined', 'NaN', 'Infinity' ]; for(var p in tokenCodes) { for(var p1 in arr) { if(arr[p1] === p) { if(!tokenCodes.hasOwnProperty(arr[p1])) { return false; }; } } } return true; } runTestCase(testcase);
{ "pile_set_name": "Github" }
--- Description: The SWbemEventSource object exposes the following methods. ms.assetid: 33AFAFEB-ABC8-4F30-95BA-436475A0565F ms.tgt_platform: multiple title: SWbemEventSource Methods ms.topic: reference ms.date: 05/31/2018 --- # SWbemEventSource Methods The [**SWbemEventSource**](swbemeventsource.md) object exposes the following methods. ## In this section - [**NextEvent method**](swbemeventsource-nextevent.md)    
{ "pile_set_name": "Github" }
/* $Id: hmac_sha1.h 3553 2011-05-05 06:14:19Z nanang $ */ /* * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <[email protected]> * * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __PJLIB_UTIL_HMAC_SHA1_H__ #define __PJLIB_UTIL_HMAC_SHA1_H__ /** * @file hmac_sha1.h * @brief HMAC SHA1 Message Authentication */ #include <pj/types.h> #include <pjlib-util/sha1.h> PJ_BEGIN_DECL /** * @defgroup PJLIB_UTIL_HMAC_SHA1 HMAC SHA1 Message Authentication * @ingroup PJLIB_UTIL_ENCRYPTION * @{ * * This module contains the implementation of HMAC: Keyed-Hashing * for Message Authentication, as described in RFC 2104. */ /** * The HMAC-SHA1 context used in the incremental HMAC calculation. */ typedef struct pj_hmac_sha1_context { pj_sha1_context context; /**< SHA1 context */ pj_uint8_t k_opad[64]; /**< opad xor-ed with key */ } pj_hmac_sha1_context; /** * Calculate HMAC-SHA1 digest for the specified input and key with this * single function call. * * @param input Pointer to the input stream. * @param input_len Length of input stream in bytes. * @param key Pointer to the authentication key. * @param key_len Length of the authentication key. * @param digest Buffer to be filled with HMAC SHA1 digest. */ PJ_DECL(void) pj_hmac_sha1(const pj_uint8_t *input, unsigned input_len, const pj_uint8_t *key, unsigned key_len, pj_uint8_t digest[20]); /** * Initiate HMAC-SHA1 context for incremental hashing. * * @param hctx HMAC-SHA1 context. * @param key Pointer to the authentication key. * @param key_len Length of the authentication key. */ PJ_DECL(void) pj_hmac_sha1_init(pj_hmac_sha1_context *hctx, const pj_uint8_t *key, unsigned key_len); /** * Append string to the message. * * @param hctx HMAC-SHA1 context. * @param input Pointer to the input stream. * @param input_len Length of input stream in bytes. */ PJ_DECL(void) pj_hmac_sha1_update(pj_hmac_sha1_context *hctx, const pj_uint8_t *input, unsigned input_len); /** * Finish the message and return the digest. * * @param hctx HMAC-SHA1 context. * @param digest Buffer to be filled with HMAC SHA1 digest. */ PJ_DECL(void) pj_hmac_sha1_final(pj_hmac_sha1_context *hctx, pj_uint8_t digest[20]); /** * @} */ PJ_END_DECL #endif /* __PJLIB_UTIL_HMAC_SHA1_H__ */
{ "pile_set_name": "Github" }
/*============================================================================= Copyright (c) 2014-2015 Kohei Takahashi Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ==============================================================================*/ #ifndef FUSION_VECTOR_FORWARD_11052014_1626 #define FUSION_VECTOR_FORWARD_11052014_1626 #include <boost/config.hpp> #include <boost/fusion/support/config.hpp> #include <boost/fusion/container/vector/detail/config.hpp> /////////////////////////////////////////////////////////////////////////////// // With no variadics, we will use the C++03 version /////////////////////////////////////////////////////////////////////////////// #if !defined(BOOST_FUSION_HAS_VARIADIC_VECTOR) # include <boost/fusion/container/vector/detail/cpp03/vector_fwd.hpp> #else /////////////////////////////////////////////////////////////////////////////// // C++11 interface /////////////////////////////////////////////////////////////////////////////// #include <boost/preprocessor/cat.hpp> #include <boost/preprocessor/repetition/repeat.hpp> namespace boost { namespace fusion { template <typename ...T> struct vector; #define FUSION_VECTOR_N_ALIASES(z, N, d) \ template <typename ...T> \ using BOOST_PP_CAT(vector, N) = vector<T...>; BOOST_PP_REPEAT(51, FUSION_VECTOR_N_ALIASES, ~) #undef FUSION_VECTOR_N_ALIASES }} #endif #endif
{ "pile_set_name": "Github" }
#ifndef ELEMENT_BASES_HPP #define ELEMENT_BASES_HPP #include <polyfem/Basis.hpp> #include <polyfem/Quadrature.hpp> #include <polyfem/Mesh.hpp> #include <polyfem/AssemblyValues.hpp> #include <vector> namespace polyfem { /// /// @brief Stores the basis functions for a given element in a mesh /// (facet in 2d, cell in 3d). /// class ElementBases { public: typedef std::function<Eigen::VectorXi(const int local_index, const Mesh &mesh)> LocalNodeFromPrimitiveFunc; typedef std::function<void(const Eigen::MatrixXd &uv, std::vector<AssemblyValues> &basis_values)> EvalBasesFunc; typedef std::function<void(Quadrature &quadrature)> QuadratureFunction; // one basis function per node in the element std::vector<Basis> bases; // quadrature points to evaluate the basis functions inside the element void compute_quadrature(Quadrature &quadrature) const { quadrature_builder_(quadrature); } Eigen::VectorXi local_nodes_for_primitive(const int local_index, const Mesh &mesh) const { return local_node_from_primitive_(local_index, mesh); } // whether the basis functions should be evaluated in the parametric domain (FE bases), // or directly in the object domain (harmonic bases) bool has_parameterization = true; /// /// @brief { Map the sample positions in the parametric domain to /// the object domain (if the element has no /// parameterization, e.g. harmonic bases, then the /// parametric domain = object domain, and the mapping is /// identity) } /// /// @param[in] samples { #S x dim matrix of sample positions to evaluate } /// @param[out] mapped { #S x dim matrix of mapped positions } /// void eval_geom_mapping(const Eigen::MatrixXd &samples, Eigen::MatrixXd &mapped) const; /// /// @brief { Evaluate the gradients of the geometric mapping /// defined above } /// /// @param[in] samples { #S x dim matrix of input sample positions } /// @param[out] grads { #S list of dim x dim matrices of gradients } /// void eval_geom_mapping_grads(const Eigen::MatrixXd &samples, std::vector<Eigen::MatrixXd> &grads) const; /// /// @brief { Checks if all the bases are complete } bool is_complete() const; friend std::ostream& operator<< (std::ostream& os, const ElementBases &obj) { for(std::size_t i = 0; i < obj.bases.size(); ++i) os << "local base "<<i <<":\n" << obj.bases[i] <<"\n"; return os; } void set_quadrature(const QuadratureFunction &fun) { quadrature_builder_ = fun; } void evaluate_bases(const Eigen::MatrixXd &uv, std::vector<AssemblyValues> &basis_values) const { if (eval_bases_func_) { eval_bases_func_(uv, basis_values); } else { evaluate_bases_default(uv, basis_values); } } void evaluate_grads(const Eigen::MatrixXd &uv, std::vector<AssemblyValues> &basis_values) const { if (eval_grads_func_) { eval_grads_func_(uv, basis_values); } else { evaluate_grads_default(uv, basis_values); } } void set_bases_func(EvalBasesFunc fun) { eval_bases_func_ = fun; } void set_grads_func(EvalBasesFunc fun) { eval_grads_func_ = fun; } void set_local_node_from_primitive_func(LocalNodeFromPrimitiveFunc fun) { local_node_from_primitive_ = fun; } private: void evaluate_bases_default(const Eigen::MatrixXd &uv, std::vector<AssemblyValues> &basis_values) const; void evaluate_grads_default(const Eigen::MatrixXd &uv, std::vector<AssemblyValues> &basis_values) const; private: EvalBasesFunc eval_bases_func_; EvalBasesFunc eval_grads_func_; QuadratureFunction quadrature_builder_; LocalNodeFromPrimitiveFunc local_node_from_primitive_; }; } #endif
{ "pile_set_name": "Github" }
/* * Copyright (C) 2011 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef ART_RUNTIME_BASE_STL_UTIL_H_ #define ART_RUNTIME_BASE_STL_UTIL_H_ #include <algorithm> #include <set> #include <sstream> #include "base/logging.h" namespace art { // Sort and remove duplicates of an STL vector or deque. template<class T> void STLSortAndRemoveDuplicates(T* v) { std::sort(v->begin(), v->end()); v->erase(std::unique(v->begin(), v->end()), v->end()); } // STLDeleteContainerPointers() // For a range within a container of pointers, calls delete // (non-array version) on these pointers. // NOTE: for these three functions, we could just implement a DeleteObject // functor and then call for_each() on the range and functor, but this // requires us to pull in all of algorithm.h, which seems expensive. // For hash_[multi]set, it is important that this deletes behind the iterator // because the hash_set may call the hash function on the iterator when it is // advanced, which could result in the hash function trying to deference a // stale pointer. template <class ForwardIterator> void STLDeleteContainerPointers(ForwardIterator begin, ForwardIterator end) { while (begin != end) { ForwardIterator temp = begin; ++begin; delete *temp; } } // STLDeleteElements() deletes all the elements in an STL container and clears // the container. This function is suitable for use with a vector, set, // hash_set, or any other STL container which defines sensible begin(), end(), // and clear() methods. // // If container is null, this function is a no-op. // // As an alternative to calling STLDeleteElements() directly, consider // using a container of std::unique_ptr, which ensures that your container's // elements are deleted when the container goes out of scope. template <class T> void STLDeleteElements(T *container) { if (container != nullptr) { STLDeleteContainerPointers(container->begin(), container->end()); container->clear(); } } // Given an STL container consisting of (key, value) pairs, STLDeleteValues // deletes all the "value" components and clears the container. Does nothing // in the case it's given a null pointer. template <class T> void STLDeleteValues(T *v) { if (v != nullptr) { for (typename T::iterator i = v->begin(); i != v->end(); ++i) { delete i->second; } v->clear(); } } template <class T> std::string ToString(const T& v) { std::ostringstream os; os << "["; for (size_t i = 0; i < v.size(); ++i) { os << v[i]; if (i < v.size() - 1) { os << ", "; } } os << "]"; return os.str(); } // Deleter using free() for use with std::unique_ptr<>. See also UniqueCPtr<> below. struct FreeDelete { // NOTE: Deleting a const object is valid but free() takes a non-const pointer. void operator()(const void* ptr) const { free(const_cast<void*>(ptr)); } }; // Alias for std::unique_ptr<> that uses the C function free() to delete objects. template <typename T> using UniqueCPtr = std::unique_ptr<T, FreeDelete>; // C++14 from-the-future import (std::make_unique) // Invoke the constructor of 'T' with the provided args, and wrap the result in a unique ptr. template <typename T, typename ... Args> std::unique_ptr<T> MakeUnique(Args&& ... args) { return std::unique_ptr<T>(new T(std::forward<Args>(args)...)); } // Find index of the first element with the specified value known to be in the container. template <typename Container, typename T> size_t IndexOfElement(const Container& container, const T& value) { auto it = std::find(container.begin(), container.end(), value); DCHECK(it != container.end()); // Must exist. return std::distance(container.begin(), it); } // Remove the first element with the specified value known to be in the container. template <typename Container, typename T> void RemoveElement(Container& container, const T& value) { auto it = std::find(container.begin(), container.end(), value); DCHECK(it != container.end()); // Must exist. container.erase(it); } // Replace the first element with the specified old_value known to be in the container. template <typename Container, typename T> void ReplaceElement(Container& container, const T& old_value, const T& new_value) { auto it = std::find(container.begin(), container.end(), old_value); DCHECK(it != container.end()); // Must exist. *it = new_value; } // Search for an element with the specified value and return true if it was found, false otherwise. template <typename Container, typename T> bool ContainsElement(const Container& container, const T& value, size_t start_pos = 0u) { DCHECK_LE(start_pos, container.size()); auto start = container.begin(); std::advance(start, start_pos); auto it = std::find(start, container.end(), value); return it != container.end(); } // const char* compare function suitable for std::map or std::set. struct CStringLess { bool operator()(const char* lhs, const char* rhs) const { return strcmp(lhs, rhs) < 0; } }; // 32-bit FNV-1a hash function suitable for std::unordered_map. // It can be used with any container which works with range-based for loop. // See http://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function template <typename Vector> struct FNVHash { size_t operator()(const Vector& vector) const { uint32_t hash = 2166136261u; for (const auto& value : vector) { hash = (hash ^ value) * 16777619u; } return hash; } }; // Use to suppress type deduction for a function argument. // See std::identity<> for more background: // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1856.html#20.2.2 - move/forward helpers // // e.g. "template <typename X> void bar(identity<X>::type foo); // bar(5); // compilation error // bar<int>(5); // ok // or "template <typename T> void foo(T* x, typename Identity<T*>::type y); // Base b; // Derived d; // foo(&b, &d); // Use implicit Derived* -> Base* conversion. // If T was deduced from both &b and &d, there would be a mismatch, i.e. deduction failure. template <typename T> struct Identity { using type = T; }; // Merge `other` entries into `to_update`. template <typename T> static inline void MergeSets(std::set<T>& to_update, const std::set<T>& other) { to_update.insert(other.begin(), other.end()); } // Returns a copy of the passed vector that doesn't memory-own its entries. template <typename T> static inline std::vector<T*> MakeNonOwningPointerVector(const std::vector<std::unique_ptr<T>>& src) { std::vector<T*> result; result.reserve(src.size()); for (const std::unique_ptr<T>& t : src) { result.push_back(t.get()); } return result; } } // namespace art #endif // ART_RUNTIME_BASE_STL_UTIL_H_
{ "pile_set_name": "Github" }
{ "version" : "6.0.0", "timestamp" : 1588893901741, "path" : "query-validation-tests/between.json", "schemas" : { "CSAS_OUTPUT_0.KsqlTopic.Source" : { "schema" : "`ID` STRING KEY, `SOURCE` STRING", "serdeOptions" : [ ] }, "CSAS_OUTPUT_0.OUTPUT" : { "schema" : "`ID` STRING KEY, `THING` STRING", "serdeOptions" : [ ] } }, "testCase" : { "name" : "test BETWEEN with string values with substring", "inputs" : [ { "topic" : "test_topic", "key" : "0", "value" : { "source" : null }, "timestamp" : 0 }, { "topic" : "test_topic", "key" : "1", "value" : { "source" : "a" }, "timestamp" : 0 }, { "topic" : "test_topic", "key" : "2", "value" : { "source" : "b" }, "timestamp" : 0 }, { "topic" : "test_topic", "key" : "3", "value" : { "source" : "ba" }, "timestamp" : 0 }, { "topic" : "test_topic", "key" : "4", "value" : { "source" : "c" }, "timestamp" : 0 }, { "topic" : "test_topic", "key" : "5", "value" : { "source" : "ca" }, "timestamp" : 0 } ], "outputs" : [ { "topic" : "OUTPUT", "key" : "2", "value" : { "THING" : "b" }, "timestamp" : 0 }, { "topic" : "OUTPUT", "key" : "3", "value" : { "THING" : "ba" }, "timestamp" : 0 }, { "topic" : "OUTPUT", "key" : "4", "value" : { "THING" : "c" }, "timestamp" : 0 } ], "topics" : [ { "name" : "OUTPUT", "replicas" : 1, "numPartitions" : 4 }, { "name" : "test_topic", "replicas" : 1, "numPartitions" : 4 } ], "statements" : [ "CREATE STREAM TEST (ID STRING KEY, source string) WITH (kafka_topic='test_topic', value_format='JSON');", "CREATE STREAM OUTPUT AS SELECT ID, source AS THING FROM TEST WHERE source BETWEEN SUBSTRING('zb',2) AND 'c';" ], "post" : { "sources" : [ { "name" : "OUTPUT", "type" : "STREAM", "schema" : "`ID` STRING KEY, `THING` STRING", "keyFormat" : { "format" : "KAFKA" }, "serdeOptions" : [ ] }, { "name" : "TEST", "type" : "STREAM", "schema" : "`ID` STRING KEY, `SOURCE` STRING", "keyFormat" : { "format" : "KAFKA" }, "serdeOptions" : [ ] } ], "topics" : { "topics" : [ { "name" : "test_topic", "keyFormat" : { "formatInfo" : { "format" : "KAFKA" } }, "valueFormat" : { "format" : "JSON" }, "partitions" : 4 }, { "name" : "OUTPUT", "keyFormat" : { "formatInfo" : { "format" : "KAFKA" } }, "valueFormat" : { "format" : "JSON" }, "partitions" : 4 } ] } } } }
{ "pile_set_name": "Github" }
# e2e tests ## Create new test case To create new test case you need to create new folder in [test-cases](./test-cases) (as a sample you may use [test-case-sample](./test-case-sample) folder). New folder's name will be used as name of test case. Each test case must have at least 3 files: 1. `input.ts` or `input.d.ts` - the entry point of test case (this file will used to generate typings). 1. `output.d.ts` - file with expected output - it will be used to compare with just generated (actual) typings. 1. `config.ts` - file with test case config (e.g. generator options). It must export test case config (see [test-case-config.ts](./test-cases/test-case-config.ts) for type) via `export =`. ## Run tests ```bash # the command should be run in project root npm run test ```
{ "pile_set_name": "Github" }
using System; using System.Collections.Generic; using NetTopologySuite.Geometries; using NetTopologySuite.Index.Strtree; namespace NetTopologySuite.Tests.NUnit.Index.Strtree { public class STRtreeDemo { private static double EXTENT = 100; private static double MAX_ITEM_EXTENT = 15; private static double MIN_ITEM_EXTENT = 3; private static int ITEM_COUNT = 20; private static int NODE_CAPACITY = 4; private static GeometryFactory factory = new GeometryFactory(); public STRtreeDemo() { var envelopes = SourceData(); var t = new TestTree(NODE_CAPACITY); InitTree(t, envelopes); PrintSourceData(envelopes); PrintLevels(t); } public class TestTree : STRtree<object> { public TestTree(int nodeCapacity) : base(nodeCapacity) { } public new IList<IBoundable<Envelope, object>> BoundablesAtLevel(int level) { return base.BoundablesAtLevel(level); } public new AbstractNode<Envelope, object> Root => base.Root; public new IList<IBoundable<Envelope, object>> CreateParentBoundables(IList<IBoundable<Envelope, object>> verticalSlice, int newLevel) { return base.CreateParentBoundables(verticalSlice, newLevel); } public new IList<IBoundable<Envelope, object>>[] VerticalSlices(IList<IBoundable<Envelope, object>> childBoundables, int size) { return base.VerticalSlices(childBoundables, size); } public new IList<IBoundable<Envelope, object>> CreateParentBoundablesFromVerticalSlice(IList<IBoundable<Envelope, object>> childBoundables, int newLevel) { return base.CreateParentBoundablesFromVerticalSlice(childBoundables, newLevel); } } private static void InitTree(TestTree t, IList<Envelope> sourceEnvelopes) { foreach (var sourceEnvelope in sourceEnvelopes) { t.Insert(sourceEnvelope, sourceEnvelope); } t.Build(); } public static void PrintSourceData(IList<Envelope> sourceEnvelopes) { Console.WriteLine("============ Source Data ============\n"); Console.Write("GEOMETRYCOLLECTION("); bool first = true; foreach (var e in sourceEnvelopes) { Geometry g = factory.CreatePolygon(factory.CreateLinearRing(new Coordinate[] { new Coordinate(e.MinX, e.MinY), new Coordinate(e.MinX, e.MaxY), new Coordinate(e.MaxX, e.MaxY), new Coordinate(e.MaxX, e.MinY), new Coordinate(e.MinX, e.MinY) }), null); if (first) { first = false; } else { Console.Write(","); } Console.Write(g); } Console.WriteLine(")\n"); } private static IList<Envelope> SourceData() { var envelopes = new List<Envelope>(); for (int i = 0; i < ITEM_COUNT; i++) { envelopes.Add(RandomRectangle().EnvelopeInternal); } return envelopes; } private static Polygon RandomRectangle() { var random = new Random(); double width = MIN_ITEM_EXTENT + ((MAX_ITEM_EXTENT - MIN_ITEM_EXTENT) * random.NextDouble()); double height = MIN_ITEM_EXTENT + ((MAX_ITEM_EXTENT - MIN_ITEM_EXTENT) * random.NextDouble()); double bottom = EXTENT * random.NextDouble(); double left = EXTENT * random.NextDouble(); double top = bottom + height; double right = left + width; return factory.CreatePolygon(factory.CreateLinearRing(new Coordinate[]{ new Coordinate(left, bottom), new Coordinate(right, bottom), new Coordinate(right, top), new Coordinate(left, top), new Coordinate(left, bottom) }), null); } public static void PrintLevels(TestTree t) { for (int i = 0; i <= t.Root.Level; i++) { PrintBoundables(t.BoundablesAtLevel(i), "Level " + i); } } public static void PrintBoundables(IList<IBoundable<Envelope, object>> boundables, string title) { Console.WriteLine("============ " + title + " ============\n"); Console.Write("GEOMETRYCOLLECTION("); bool first = true; foreach (var boundable in boundables) { if (first) { first = false; } else { Console.Write(","); } Console.Write(ToString(boundable)); } Console.WriteLine(")\n"); } private static string ToString(IBoundable<Envelope, object> b) { return "POLYGON((" + Envelope(b).MinX + " " + Envelope(b).MinY + ", " + Envelope(b).MinX + " " + Envelope(b).MaxY + ", " + Envelope(b).MaxX + " " + Envelope(b).MaxY + ", " + Envelope(b).MaxX + " " + Envelope(b).MinY + "," + Envelope(b).MinX + " " + Envelope(b).MinY + "))"; } private static Envelope Envelope(IBoundable<Envelope, object> b) { return (Envelope)b.Bounds; } } }
{ "pile_set_name": "Github" }
// // Generated by class-dump 3.5 (64 bit) (Debug version compiled Jun 9 2015 22:53:21). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2014 by Steve Nygard. // #import <Cocoa/NSActionCell.h> @class NSImage; @interface KeywordCell : NSActionCell { NSImage *mIcon; struct CGRect mFrame; } + (unsigned int)desiredHeight; + (void)initialize; - (void)endEditing; - (void)editWithFrame:(struct CGRect)arg1 inView:(id)arg2 editor:(id)arg3 delegate:(id)arg4 event:(id)arg5; - (void)drawWithFrame:(struct CGRect)arg1 inView:(id)arg2; - (struct CGRect)textFrameForCell:(struct CGRect)arg1 textSize:(struct CGSize)arg2; - (struct CGPoint)iconOriginForCell:(struct CGRect)arg1 iconSize:(struct CGSize)arg2; - (BOOL)drawIcon; - (void)dealloc; - (id)init; @end
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <merge xmlns:android="http://schemas.android.com/apk/res/android" > <TextView android:id="@+id/user_register_other_way_register_tv" style="@style/UserRegisterFirst" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:text="@string/user_register_other_way_register" android:gravity="end"/> <LinearLayout style="@style/MatchWrap.Horizontal" android:gravity="center_horizontal" android:layout_alignBottom="@id/user_register_other_way_register_tv"> <TextView style="@style/UserRegisterThird" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/user_register_agreee_text"/> <TextView style="@style/UserRegisterThird" android:id="@+id/user_register_service_clause_tv" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/user_register_service_clause_text" android:textColor="@color/user_register_service_clause_color"/> </LinearLayout> <include android:id="@+id/user_register_common_bottom" layout="@layout/include_common_bottom"></include> </merge>
{ "pile_set_name": "Github" }
<?php namespace Composer\Installers; class PhiftyInstaller extends BaseInstaller { protected $locations = array( 'bundle' => 'bundles/{$name}/', 'library' => 'libraries/{$name}/', 'framework' => 'frameworks/{$name}/', ); }
{ "pile_set_name": "Github" }
### 火锅表面的白色浮沫该不该捞掉?(组图) ------------------------ #### [首页](https://github.com/gfw-breaker/banned-news/blob/master/README.md) &nbsp;&nbsp;|&nbsp;&nbsp; [手把手翻墙教程](https://github.com/gfw-breaker/guides/wiki) &nbsp;&nbsp;|&nbsp;&nbsp; [禁闻聚合安卓版](https://github.com/gfw-breaker/bn-android) &nbsp;&nbsp;|&nbsp;&nbsp; [网门安卓版](https://github.com/oGate2/oGate) &nbsp;&nbsp;|&nbsp;&nbsp; [神州正道安卓版](https://github.com/SzzdOgate/update) <div class="article_right" style="fone-color:#000"> <p style="text-align: center;"> <strong> <img alt="火锅表面的白色浮沫该不该捞掉?" src="http://img2.secretchina.com/pic/2019/12-4/p2575544a25760488-ss.jpg"/> </strong> <br> 吃 <strong> 火锅 </strong> 时,表面的白色 <strong> 浮沫 </strong> 该不该捞掉呢?(图片来源:Adobe Stock) <span id="hideid" name="hideid" style="color:red;display:none;"> <span href="https://www.secretchina.com"> </span> </span> </br> </p> <div id="txt-mid1-t21-2017"> <ins class="adsbygoogle" data-ad-client="ca-pub-1276641434651360" data-ad-slot="2451032099" style="display:inline-block;width:336px;height:280px"> </ins> <div id="SC-22xxx"> </div> </div> <p> 天气一冷,许多人就喜欢吃 <span href="https://www.secretchina.com/news/gb/tag/火锅" target="_blank"> 火锅 </span> ,不但能温暖身心、驱走寒意,还能让人感到饱足。但是在煮火锅的时候,浮在表面的白色泡沫,您会不会捞掉呢? <span id="hideid" name="hideid" style="color:red;display:none;"> <span href="https://www.secretchina.com"> </span> </span> </p> <p> 一般人的印象中,因为冬天气温低,细菌孳生速度慢,加上大家都爱吃热食暖身,直觉会认为经过烹煮、加热后的食物也完成杀菌。然而,看似高温烹煮的火锅,还是潜藏着许多食安风险,如果疏忽大意,就有可能造成食物中毒。 </p> <p> <strong> 火锅 <span href="https://www.secretchina.com/news/gb/tag/浮沫" target="_blank"> 浮沫 </span> 该不该捞? </strong> </p> <p> 摆满各种食材精华的火锅汤,一直是许多火锅爱好者的心头好。只是这些放进大量食材的火锅汤,总是会浮出大量的浮沫。有的人看到这些浮沫,会把它捞掉,但也有人把它当作“精华”的汤底,一块下肚。 </p> <p> 虽然火锅的汤是持续煮沸的,但并不代表大家就可以安心喝汤。因为这些汤上的浮沫,大致上是属于血水、蛋白质遇热后变质的杂质,而这些杂质会有细菌污染的可能性,若吃下肚的话,可能会导致腹泻,甚至食物中毒。加上煮火锅的时候,人们都习惯把一堆食材往汤里丢,杂质难免就多了起来,因此如果想喝火锅汤,最好在加料前喝,或是把浮沫捞掉再喝,会比较健康。 </p> <p> 而火锅除了浮沫,也要注意一些小地方,否则可能也会影响到健康,得不偿失的哦。 </p> <p style="text-align: center;"> <img alt="火锅除了浮沫,也要注意一些小地方,否则可能也会影响到健康,得不偿失。" src="http://img2.secretchina.com/pic/2019/12-4/p2575542a573351420-ss.jpg"/> <br> 火锅除了浮沫,也要注意一些小地方,否则可能也会影响到健康,得不偿失。(图片来源:Adobe Stock) </br> </p> <p> <strong> 1、肉没有煮熟 </strong> </p> <p> 吃火锅时,很多人都习惯肉不要烫太久,就怕肉质变硬、变柴,但过分重视口感的同时,可能导致肉类加热不完全,使得细菌、寄生虫存活其中,造成感染。新闻也不乏许多人在吃热食时,因为肉没有烫熟,而遭到里面的寄生虫寄生,导致部分器官损伤。 </p> <p> <strong> 2、生鸡蛋+沙茶酱 </strong> </p> <p> 很多人吃火锅时,喜欢用生鸡蛋加沙茶酱,做为沾酱,看来美味,但也可能让人吃下致命的 <strong> <span href="https://www.secretchina.com/news/gb/tag/沙门杆菌" target="_blank"> 沙门杆菌 </span> </strong> 。因为沙门杆菌是导致食物中毒常见的病源体,而生吃鸡蛋或是没有全熟的鸡蛋,都有感染沙门杆菌的风险。 </p> <p> 而感染沙门杆菌的话,可能会产生腹泻、腹痛、寒颤、发烧、恶心、呕吐之类的症状。当然这些症状通常持续2~3天,就会慢慢缓解,不过这是对健康的成人而言,对婴幼儿或是年纪较大的长者,或是抵抗力比较差的人来说,严重的话,有可能致死,因此一定要谨慎。 </p> <p> <strong> 3、生菜沙拉要小心 </strong> </p> <p> 很多火锅店都有冰淇淋柜、沙拉吧等生食区,可以让顾客增加进食选择;而这些生冷食物,却也常常是火锅店里食物中毒的高风险因子,因为可能有农药、细菌的残留。 </p> <p> 而生菜没清洗干净的话,很容易残留 <strong> <span href="https://www.secretchina.com/news/gb/tag/大肠杆菌" target="_blank"> 大肠杆菌 </span> </strong> 等病源体,会引起腹泻、恶心、呕吐、腹痛等症状,若吃进的病源体数量高,或患者本身抵抗力就比较弱的话,甚至会导致严重的后果,像是肾衰竭。 </p> <p> 对许多人而言,冬天是享受火锅的好季节,但若没有轻忽一些该注意的地方,反而会祸从口入。因为下次吃火锅时,记得要把食物都煮熟,而且避免吃生冷食品,同时勤劳点,把表面的浮沫捞干净,这样才能吃的开心、健康。 <center> <div> <div id="txt-mid2-t22-2017" style="display: block; max-height: 351px; overflow: hidden;"> <div id="SC-21xxx"> </div> <ins class="adsbygoogle" data-ad-client="ca-pub-1276641434651360" data-ad-format="auto" data-ad-slot="4301710469" data-full-width-responsive="true" style="display:block"> </ins> </div> </div> </center> <div style="padding-top:5px;"> </div> </p> </div> <hr/> 手机上长按并复制下列链接或二维码分享本文章:<br/> https://github.com/gfw-breaker/banned-news/blob/master/pages/p8/915492.md <br/> <a href='https://github.com/gfw-breaker/banned-news/blob/master/pages/p8/915492.md'><img src='https://github.com/gfw-breaker/banned-news/blob/master/pages/p8/915492.md.png'/></a> <br/> 原文地址(需翻墙访问):https://www.secretchina.com/news/gb/2019/12/04/915492.html ------------------------ #### [首页](https://github.com/gfw-breaker/banned-news/blob/master/README.md) &nbsp;|&nbsp; [一键翻墙软件](https://github.com/gfw-breaker/nogfw/blob/master/README.md) &nbsp;| [《九评共产党》](https://github.com/gfw-breaker/9ping.md/blob/master/README.md#九评之一评共产党是什么) | [《解体党文化》](https://github.com/gfw-breaker/jtdwh.md/blob/master/README.md) | [《共产主义的终极目的》](https://github.com/gfw-breaker/gczydzjmd.md/blob/master/README.md) <img src='http://gfw-breaker.win/banned-news/pages/p8/915492.md' width='0px' height='0px'/>
{ "pile_set_name": "Github" }
WGL_ARB_pixel_format_float http://www.opengl.org/registry/specs/ARB/color_buffer_float.txt WGL_ARB_pixel_format_float WGL_TYPE_RGBA_FLOAT_ARB 0x21A0
{ "pile_set_name": "Github" }
Виробнича пісочниця у жанрі «баштовий захист» (англ. — Tower Defence, TD).
{ "pile_set_name": "Github" }
" Chained completion that works as I want! " Maintainer: Lifepillar <[email protected]> " License: This file is placed in the public domain let s:save_cpo = &cpo set cpo&vim let s:pathsep = exists('+shellslash') && !&shellslash \ ? (get(g:, 'mucomplete#use_only_windows_paths', 0) ? '[\\]' : '[/\\]') \ : '[/]' fun! mucomplete#compat#yes_you_can(t) return 1 endf fun! mucomplete#compat#default(t) return a:t =~# '\m\k\{'.get(g:, 'mucomplete#minimum_prefix_length', 2).'\}$' || \ (g:mucomplete_with_key && (get(b:, 'mucomplete_empty_text', get(g:, 'mucomplete#empty_text', 0)) || a:t =~# '\m\k$')) endf fun! mucomplete#compat#dict(t) return strlen(&dictionary) > 0 && (a:t =~# '\m\a\a$' || (g:mucomplete_with_key && a:t =~# '\m\a$')) endf fun! mucomplete#compat#file(t) return a:t =~# '\m\%(\%(\f\&[^/\\]\)'.s:pathsep.'\|\%(^\|\s\|\f\|["'']\)'.s:pathsep.'\%(\f\&[^/\\]\)\+\)$' \ || (g:mucomplete_with_key && a:t =~# '\m\%(\~\|\%(^\|\s\|\f\|["'']\)'.s:pathsep.'\)\f*$') endf fun! mucomplete#compat#omni(t) return strlen(&l:omnifunc) > 0 && mucomplete#compat#default(a:t) endf fun! mucomplete#compat#spel(t) return &l:spell && !empty(&l:spelllang) && a:t =~# '\m'.g:mucomplete#spel#regex.'\{3}$' endf fun! mucomplete#compat#tags(t) return !empty(tagfiles()) && mucomplete#compat#default(a:t) endf fun! mucomplete#compat#thes(t) return strlen(&thesaurus) > 0 && a:t =~# '\m\a\a\a$' endf fun! mucomplete#compat#user(t) return strlen(&l:completefunc) > 0 && mucomplete#compat#default(a:t) endf fun! mucomplete#compat#list(t) return a:t =~# '\m\S\{'.get(g:, 'mucomplete#minimum_prefix_length', 2).'\}$' || \ (g:mucomplete_with_key && (s:complete_empty_text || t =~# '\m\S$')) endf fun! mucomplete#compat#path(t) return a:t =~# '\m\%(\%(\f\&[^/\\]\)'.s:pathsep.'\|\%(^\|\s\|\f\|["'']\)'.s:pathsep.'\%(\f\&[^/\\]\|\s\)\+\)$' \ || (g:mucomplete_with_key && a:t =~# '\m\%(\~\|\%(^\|\s\|\f\|["'']\)'.s:pathsep.'\)\%(\f\|\s\)*$') endf fun! mucomplete#compat#nsnp(t) return get(g:, 'loaded_neosnippet', 0) && mucomplete#compat#default(a:t) endf fun! mucomplete#compat#snip(t) return get(g:, 'loaded_snips', 0) && mucomplete#compat#default(a:t) endf fun! mucomplete#compat#ulti(t) return get(g:, 'did_plugin_ultisnips', 0) && mucomplete#compat#default(a:t) endf fun! mucomplete#compat#omni_c(t) return strlen(&l:omnifunc) > 0 && a:t =~# '\m\%(\k\{'.get(g:, 'mucomplete#minimum_prefix_length', 2).'\}\|\S->\|\S\.\)$' \ || (g:mucomplete_with_key && (s:complete_empty_text || a:t =~# '\m\%(\k\|\S->\|\S\.\)$')) endf fun! mucomplete#compat#omni_python(t) return a:t =~# '\m\%(\k\{'.get(g:, 'mucomplete#minimum_prefix_length', 2).'\}\|\k\.\)$' \ || (g:mucomplete_with_key && (get(b:, 'mucomplete_empty_text', get(g:, 'mucomplete#empty_text', 0)) || a:t =~# '\m\%(\k\|\.\)$')) endf fun! mucomplete#compat#omni_xml(t) return strlen(&l:omnifunc) > 0 && a:t =~# '\m\%(\k\{'.get(g:, 'mucomplete#minimum_prefix_length', 2).'\}\|</\)$' \ || (g:mucomplete_with_key && (s:complete_empty_text || a:t =~# '\m\%(\k\|</\)$')) endf if get(g:, 'mucomplete#force_manual', 0) fun! s:fm(f) fun! s:foo(t) return g:mucomplete_with_key && a:f(a:t) endf return funcref('s:foo') endf else fun! s:fm(f) return a:f endf endif fun! mucomplete#compat#can_complete() let l:cc = get(g:, 'mucomplete#can_complete', {}) " Get user's settings, then merge them with defaults let l:can_complete = extend({ \ 'default' : extend({ \ 'c-n' : s:fm(function('mucomplete#compat#default')), \ 'c-p' : s:fm(function('mucomplete#compat#default')), \ 'cmd' : s:fm(function('mucomplete#compat#default')), \ 'defs': s:fm(function('mucomplete#compat#default')), \ 'dict': s:fm(function('mucomplete#compat#dict')), \ 'file': s:fm(function('mucomplete#compat#file')), \ 'incl': s:fm(function('mucomplete#compat#default')), \ 'keyn': s:fm(function('mucomplete#compat#default')), \ 'keyp': s:fm(function('mucomplete#compat#default')), \ 'line': s:fm(function('mucomplete#compat#default')), \ 'list': s:fm(function('mucomplete#compat#list')), \ 'omni': s:fm(function('mucomplete#compat#omni')), \ 'spel': s:fm(function('mucomplete#compat#spel')), \ 'tags': s:fm(function('mucomplete#compat#tags')), \ 'thes': s:fm(function('mucomplete#compat#thes')), \ 'user': s:fm(function('mucomplete#compat#user')), \ 'path': s:fm(function('mucomplete#compat#path')), \ 'uspl': s:fm(function('mucomplete#compat#spel')), \ 'nsnp': s:fm(function('mucomplete#compat#nsnp')), \ 'snip': s:fm(function('mucomplete#compat#snip')), \ 'ulti': s:fm(function('mucomplete#compat#ulti')) \ }, get(l:cc, 'default', {})), \ 'c' : extend({ 'omni': s:fm(function('mucomplete#compat#omni_c')) }, get(l:cc, 'c', {})), \ 'cpp' : extend({ 'omni': s:fm(function('mucomplete#compat#omni_c')) }, get(l:cc, 'cpp', {})), \ 'html' : extend({ 'omni': s:fm(function('mucomplete#compat#omni_xml')) }, get(l:cc, 'html', {})), \ 'xml' : extend({ 'omni': s:fm(function('mucomplete#compat#omni_xml')) }, get(l:cc, 'xml', {})), \ }, l:cc, 'keep') " Special cases if has('python') || has('python3') call extend(extend(l:can_complete, { 'python': {} }, 'keep')['python'], { 'omni': s:fm(function('mucomplete#compat#omni_python')) }, 'keep') endif return l:can_complete endf let &cpo = s:save_cpo unlet s:save_cpo
{ "pile_set_name": "Github" }
// *************************************************************************** // * // * Copyright (C) 2013 International Business Machines // * Corporation and others. All Rights Reserved. // * Tool: org.unicode.cldr.icu.NewLdml2IcuConverter // * Source File: <path>/common/main/bez.xml // * // *************************************************************************** /** * ICU <specials> source: <path>/xml/main/bez.xml */ bez{ Currencies{ AED{ "AED", "Lupila lwa Hufalme dza Huhihalabu", } AOA{ "AOA", "Lupila lwa Huangola", } AUD{ "A$", "Lupila lwa Huaustlalia", } BHD{ "BHD", "Lupila lwa Hubahareni", } BIF{ "BIF", "Lupila lwa Huburundi", } BWP{ "BWP", "Lupila lwa Hubotswana", } CAD{ "CA$", "Lupila lwa Hukanada", } CDF{ "CDF", "Lupila lwa Hukongo", } CHF{ "CHF", "Lupila lwa Huuswisi", } CNY{ "CN¥", "Lupila lwa Huchina", } CVE{ "CVE", "Lupila lwa Hukepuvede", } DJF{ "DJF", "Lupila lwa Hujibuti", } DZD{ "DZD", "Lupila lwa Hualjelia", } EGP{ "EGP", "Lupila lwa Humisri", } ERN{ "ERN", "Lupila lwa Hueritrea", } ETB{ "ETB", "Lupila lwa Huuhabeshi", } EUR{ "€", "Lupila lwa Yulo", } GBP{ "£", "Lupila lwa Huuingereza", } GHC{ "GHC", "Lupila lwa Hughana", } GMD{ "GMD", "Lupila lwa Hugambia", } GNS{ "GNS", "Lupila lwa Hujine", } INR{ "Rs.", "Lupila lwa Huindia", } JPY{ "JP¥", "Lupila lwa Hijapani", } KES{ "KES", "Shilingi ya Hukenya", } KMF{ "KMF", "Lupila lwa Hukomoro", } LRD{ "LRD", "Lupila lwa Hulibelia", } LSL{ "LSL", "Lupila lwa Hulesoto", } LYD{ "LYD", "Lupila lwa Hulibya", } MAD{ "MAD", "Lupila lwa Humoloko", } MGA{ "MGA", "Lupila lwa Hubukini", } MRO{ "MRO", "Lupila lwa Humolitania", } MUR{ "MUR", "Lupila lwa Humolisi", } MWK{ "MWK", "Lupila lwa Humalawi", } MZM{ "MZM", "Lupila lwa Humsumbiji", } NAD{ "NAD", "Lupila lwa Hunamibia", } NGN{ "NGN", "Lupila lwa Hunijelia", } RWF{ "RWF", "Lupila lwa Hurwanda", } SAR{ "SAR", "Lupila lwa Husaudi", } SCR{ "SCR", "Lupila lwa Hushelisheli", } SDG{ "SDG", "Lupila lwa Husudani", } SHP{ "SHP", "Lupila lwa Husantahelena", } SLL{ "SLL", "Lupila lwa Lioni", } SOS{ "SOS", "Lupila lwa Husomalia", } STD{ "STD", "Lupila lwa Husaotome na Huprinisipe", } SZL{ "SZL", "Lupila lwa Lilangeni", } TND{ "TND", "Lupila lwa Hutunisia", } TZS{ "TSh", "Shilingi ya Hutanzania", } UGX{ "UGX", "Shilingi ya Huuganda", } USD{ "US$", "Lupila lwa Humalekani", } XAF{ "FCFA", "Lupila lwa CFA BEAC", } XOF{ "CFA", "Lupila lwa CFA BCEAO", } ZAR{ "ZAR", "Lupila lwa Huafriaka ya Hukusini", } ZMK{ "ZMK", "Lupila lwa Huzambia (1968-2012)", } ZMW{ "ZMW", "Lupila lwa Huzambia", } ZWD{ "ZWD", "Lupila lwa Huzimbabwe", } } Version{"2.0.82.45"} }
{ "pile_set_name": "Github" }
// SPDX-License-Identifier: GPL-2.0 // Copyright (C) 2012 Sven Schnelle <[email protected]> #include <linux/platform_device.h> #include <linux/module.h> #include <linux/init.h> #include <linux/rtc.h> #include <linux/types.h> #include <linux/bcd.h> #include <linux/platform_data/rtc-ds2404.h> #include <linux/delay.h> #include <linux/gpio.h> #include <linux/slab.h> #include <linux/io.h> #define DS2404_STATUS_REG 0x200 #define DS2404_CONTROL_REG 0x201 #define DS2404_RTC_REG 0x202 #define DS2404_WRITE_SCRATCHPAD_CMD 0x0f #define DS2404_READ_SCRATCHPAD_CMD 0xaa #define DS2404_COPY_SCRATCHPAD_CMD 0x55 #define DS2404_READ_MEMORY_CMD 0xf0 #define DS2404_RST 0 #define DS2404_CLK 1 #define DS2404_DQ 2 struct ds2404_gpio { const char *name; unsigned int gpio; }; struct ds2404 { struct ds2404_gpio *gpio; struct rtc_device *rtc; }; static struct ds2404_gpio ds2404_gpio[] = { { "RTC RST", 0 }, { "RTC CLK", 0 }, { "RTC DQ", 0 }, }; static int ds2404_gpio_map(struct ds2404 *chip, struct platform_device *pdev, struct ds2404_platform_data *pdata) { int i, err; ds2404_gpio[DS2404_RST].gpio = pdata->gpio_rst; ds2404_gpio[DS2404_CLK].gpio = pdata->gpio_clk; ds2404_gpio[DS2404_DQ].gpio = pdata->gpio_dq; for (i = 0; i < ARRAY_SIZE(ds2404_gpio); i++) { err = gpio_request(ds2404_gpio[i].gpio, ds2404_gpio[i].name); if (err) { dev_err(&pdev->dev, "error mapping gpio %s: %d\n", ds2404_gpio[i].name, err); goto err_request; } if (i != DS2404_DQ) gpio_direction_output(ds2404_gpio[i].gpio, 1); } chip->gpio = ds2404_gpio; return 0; err_request: while (--i >= 0) gpio_free(ds2404_gpio[i].gpio); return err; } static void ds2404_gpio_unmap(void *data) { int i; for (i = 0; i < ARRAY_SIZE(ds2404_gpio); i++) gpio_free(ds2404_gpio[i].gpio); } static void ds2404_reset(struct device *dev) { gpio_set_value(ds2404_gpio[DS2404_RST].gpio, 0); udelay(1000); gpio_set_value(ds2404_gpio[DS2404_RST].gpio, 1); gpio_set_value(ds2404_gpio[DS2404_CLK].gpio, 0); gpio_direction_output(ds2404_gpio[DS2404_DQ].gpio, 0); udelay(10); } static void ds2404_write_byte(struct device *dev, u8 byte) { int i; gpio_direction_output(ds2404_gpio[DS2404_DQ].gpio, 1); for (i = 0; i < 8; i++) { gpio_set_value(ds2404_gpio[DS2404_DQ].gpio, byte & (1 << i)); udelay(10); gpio_set_value(ds2404_gpio[DS2404_CLK].gpio, 1); udelay(10); gpio_set_value(ds2404_gpio[DS2404_CLK].gpio, 0); udelay(10); } } static u8 ds2404_read_byte(struct device *dev) { int i; u8 ret = 0; gpio_direction_input(ds2404_gpio[DS2404_DQ].gpio); for (i = 0; i < 8; i++) { gpio_set_value(ds2404_gpio[DS2404_CLK].gpio, 0); udelay(10); if (gpio_get_value(ds2404_gpio[DS2404_DQ].gpio)) ret |= 1 << i; gpio_set_value(ds2404_gpio[DS2404_CLK].gpio, 1); udelay(10); } return ret; } static void ds2404_read_memory(struct device *dev, u16 offset, int length, u8 *out) { ds2404_reset(dev); ds2404_write_byte(dev, DS2404_READ_MEMORY_CMD); ds2404_write_byte(dev, offset & 0xff); ds2404_write_byte(dev, (offset >> 8) & 0xff); while (length--) *out++ = ds2404_read_byte(dev); } static void ds2404_write_memory(struct device *dev, u16 offset, int length, u8 *out) { int i; u8 ta01, ta02, es; ds2404_reset(dev); ds2404_write_byte(dev, DS2404_WRITE_SCRATCHPAD_CMD); ds2404_write_byte(dev, offset & 0xff); ds2404_write_byte(dev, (offset >> 8) & 0xff); for (i = 0; i < length; i++) ds2404_write_byte(dev, out[i]); ds2404_reset(dev); ds2404_write_byte(dev, DS2404_READ_SCRATCHPAD_CMD); ta01 = ds2404_read_byte(dev); ta02 = ds2404_read_byte(dev); es = ds2404_read_byte(dev); for (i = 0; i < length; i++) { if (out[i] != ds2404_read_byte(dev)) { dev_err(dev, "read invalid data\n"); return; } } ds2404_reset(dev); ds2404_write_byte(dev, DS2404_COPY_SCRATCHPAD_CMD); ds2404_write_byte(dev, ta01); ds2404_write_byte(dev, ta02); ds2404_write_byte(dev, es); gpio_direction_input(ds2404_gpio[DS2404_DQ].gpio); while (gpio_get_value(ds2404_gpio[DS2404_DQ].gpio)) ; } static void ds2404_enable_osc(struct device *dev) { u8 in[1] = { 0x10 }; /* enable oscillator */ ds2404_write_memory(dev, 0x201, 1, in); } static int ds2404_read_time(struct device *dev, struct rtc_time *dt) { unsigned long time = 0; __le32 hw_time = 0; ds2404_read_memory(dev, 0x203, 4, (u8 *)&hw_time); time = le32_to_cpu(hw_time); rtc_time64_to_tm(time, dt); return 0; } static int ds2404_set_time(struct device *dev, struct rtc_time *dt) { u32 time = cpu_to_le32(rtc_tm_to_time64(dt)); ds2404_write_memory(dev, 0x203, 4, (u8 *)&time); return 0; } static const struct rtc_class_ops ds2404_rtc_ops = { .read_time = ds2404_read_time, .set_time = ds2404_set_time, }; static int rtc_probe(struct platform_device *pdev) { struct ds2404_platform_data *pdata = dev_get_platdata(&pdev->dev); struct ds2404 *chip; int retval = -EBUSY; chip = devm_kzalloc(&pdev->dev, sizeof(struct ds2404), GFP_KERNEL); if (!chip) return -ENOMEM; chip->rtc = devm_rtc_allocate_device(&pdev->dev); if (IS_ERR(chip->rtc)) return PTR_ERR(chip->rtc); retval = ds2404_gpio_map(chip, pdev, pdata); if (retval) return retval; retval = devm_add_action_or_reset(&pdev->dev, ds2404_gpio_unmap, chip); if (retval) return retval; dev_info(&pdev->dev, "using GPIOs RST:%d, CLK:%d, DQ:%d\n", chip->gpio[DS2404_RST].gpio, chip->gpio[DS2404_CLK].gpio, chip->gpio[DS2404_DQ].gpio); platform_set_drvdata(pdev, chip); chip->rtc->ops = &ds2404_rtc_ops; chip->rtc->range_max = U32_MAX; retval = rtc_register_device(chip->rtc); if (retval) return retval; ds2404_enable_osc(&pdev->dev); return 0; } static struct platform_driver rtc_device_driver = { .probe = rtc_probe, .driver = { .name = "ds2404", }, }; module_platform_driver(rtc_device_driver); MODULE_DESCRIPTION("DS2404 RTC"); MODULE_AUTHOR("Sven Schnelle"); MODULE_LICENSE("GPL"); MODULE_ALIAS("platform:ds2404");
{ "pile_set_name": "Github" }
package org.openapitools.client.infrastructure import com.squareup.moshi.FromJson import com.squareup.moshi.ToJson import org.threeten.bp.OffsetDateTime import org.threeten.bp.format.DateTimeFormatter class OffsetDateTimeAdapter { @ToJson fun toJson(value: OffsetDateTime): String { return DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(value) } @FromJson fun fromJson(value: String): OffsetDateTime { return OffsetDateTime.parse(value, DateTimeFormatter.ISO_OFFSET_DATE_TIME) } }
{ "pile_set_name": "Github" }
# -*- coding: utf-8 -*- # Copyright (c) 2012 Giorgos Verigakis <[email protected]> # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. from __future__ import unicode_literals from . import Infinite class Spinner(Infinite): phases = ('-', '\\', '|', '/') hide_cursor = True def update(self): i = self.index % len(self.phases) self.write(self.phases[i]) class PieSpinner(Spinner): phases = ['◷', '◶', '◵', '◴'] class MoonSpinner(Spinner): phases = ['◑', '◒', '◐', '◓'] class LineSpinner(Spinner): phases = ['⎺', '⎻', '⎼', '⎽', '⎼', '⎻'] class PixelSpinner(Spinner): phases = ['⣾', '⣷', '⣯', '⣟', '⡿', '⢿', '⣻', '⣽']
{ "pile_set_name": "Github" }
/** * A specialized version of `_.forEach` for arrays without support for * iteratee shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns `array`. */ function arrayEach(array, iteratee) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { if (iteratee(array[index], index, array) === false) { break; } } return array; } module.exports = arrayEach;
{ "pile_set_name": "Github" }
// OpenArchive.cpp #include "StdAfx.h" #include "Common/Wildcard.h" #include "Windows/FileDir.h" #include "Windows/PropVariant.h" #include "../../Common/FileStreams.h" #include "../../Common/StreamUtils.h" #include "DefaultName.h" #include "OpenArchive.h" using namespace NWindows; // Static-SFX (for Linux) can be big. const UInt64 kMaxCheckStartPosition = 1 << 22; HRESULT GetArchiveItemBoolProp(IInArchive *archive, UInt32 index, PROPID propID, bool &result) { NCOM::CPropVariant prop; result = false; RINOK(archive->GetProperty(index, propID, &prop)); if (prop.vt == VT_BOOL) result = VARIANT_BOOLToBool(prop.boolVal); else if (prop.vt != VT_EMPTY) return E_FAIL; return S_OK; } HRESULT IsArchiveItemFolder(IInArchive *archive, UInt32 index, bool &result) { return GetArchiveItemBoolProp(archive, index, kpidIsDir, result); } HRESULT CArc::GetItemPath(UInt32 index, UString &result) const { { NCOM::CPropVariant prop; RINOK(Archive->GetProperty(index, kpidPath, &prop)); if (prop.vt == VT_BSTR) result = prop.bstrVal; else if (prop.vt == VT_EMPTY) result.Empty(); else return E_FAIL; } if (result.IsEmpty()) { result = DefaultName; NCOM::CPropVariant prop; RINOK(Archive->GetProperty(index, kpidExtension, &prop)); if (prop.vt == VT_BSTR) { result += L'.'; result += prop.bstrVal; } else if (prop.vt != VT_EMPTY) return E_FAIL; } return S_OK; } HRESULT CArc::GetItemMTime(UInt32 index, FILETIME &ft, bool &defined) const { NCOM::CPropVariant prop; defined = false; ft.dwHighDateTime = ft.dwLowDateTime = 0; RINOK(Archive->GetProperty(index, kpidMTime, &prop)); if (prop.vt == VT_FILETIME) { ft = prop.filetime; defined = true; } else if (prop.vt != VT_EMPTY) return E_FAIL; else if (MTimeDefined) { ft = MTime; defined = true; } return S_OK; } #ifndef _SFX static inline bool TestSignature(const Byte *p1, const Byte *p2, size_t size) { for (size_t i = 0; i < size; i++) if (p1[i] != p2[i]) return false; return true; } #endif #ifdef UNDER_CE static const int kNumHashBytes = 1; #define HASH_VAL(buf, pos) ((buf)[pos]) #else static const int kNumHashBytes = 2; #define HASH_VAL(buf, pos) ((buf)[pos] | ((UInt32)(buf)[pos + 1] << 8)) #endif HRESULT CArc::OpenStream( CCodecs *codecs, int formatIndex, IInStream *stream, ISequentialInStream *seqStream, IArchiveOpenCallback *callback) { Archive.Release(); ErrorMessage.Empty(); const UString fileName = ExtractFileNameFromPath(Path); UString extension; { int dotPos = fileName.ReverseFind(L'.'); if (dotPos >= 0) extension = fileName.Mid(dotPos + 1); } CIntVector orderIndices; if (formatIndex >= 0) orderIndices.Add(formatIndex); else { int i; int numFinded = 0; for (i = 0; i < codecs->Formats.Size(); i++) if (codecs->Formats[i].FindExtension(extension) >= 0) orderIndices.Insert(numFinded++, i); else orderIndices.Add(i); if (!stream) { if (numFinded != 1) return E_NOTIMPL; orderIndices.DeleteFrom(1); } #ifndef _SFX if (orderIndices.Size() >= 2 && (numFinded == 0 || extension.CompareNoCase(L"exe") == 0)) { CIntVector orderIndices2; CByteBuffer byteBuffer; const size_t kBufferSize = (1 << 21); byteBuffer.SetCapacity(kBufferSize); RINOK(stream->Seek(0, STREAM_SEEK_SET, NULL)); size_t processedSize = kBufferSize; RINOK(ReadStream(stream, byteBuffer, &processedSize)); if (processedSize == 0) return S_FALSE; const Byte *buf = byteBuffer; CByteBuffer hashBuffer; const UInt32 kNumVals = 1 << (kNumHashBytes * 8); hashBuffer.SetCapacity(kNumVals); Byte *hash = hashBuffer; memset(hash, 0xFF, kNumVals); Byte prevs[256]; if (orderIndices.Size() >= 256) return S_FALSE; int i; for (i = 0; i < orderIndices.Size(); i++) { const CArcInfoEx &ai = codecs->Formats[orderIndices[i]]; const CByteBuffer &sig = ai.StartSignature; if (sig.GetCapacity() < kNumHashBytes) continue; UInt32 v = HASH_VAL(sig, 0); prevs[i] = hash[v]; hash[v] = (Byte)i; } processedSize -= (kNumHashBytes - 1); for (UInt32 pos = 0; pos < processedSize; pos++) { for (; pos < processedSize && hash[HASH_VAL(buf, pos)] == 0xFF; pos++); if (pos == processedSize) break; UInt32 v = HASH_VAL(buf, pos); Byte *ptr = &hash[v]; int i = *ptr; do { int index = orderIndices[i]; const CArcInfoEx &ai = codecs->Formats[index]; const CByteBuffer &sig = ai.StartSignature; if (sig.GetCapacity() != 0 && pos + sig.GetCapacity() <= processedSize + (kNumHashBytes - 1) && TestSignature(buf + pos, sig, sig.GetCapacity())) { orderIndices2.Add(index); orderIndices[i] = 0xFF; *ptr = prevs[i]; } else ptr = &prevs[i]; i = *ptr; } while (i != 0xFF); } for (i = 0; i < orderIndices.Size(); i++) { int val = orderIndices[i]; if (val != 0xFF) orderIndices2.Add(val); } orderIndices = orderIndices2; } else if (extension == L"000" || extension == L"001") { CByteBuffer byteBuffer; const size_t kBufferSize = (1 << 10); byteBuffer.SetCapacity(kBufferSize); Byte *buffer = byteBuffer; RINOK(stream->Seek(0, STREAM_SEEK_SET, NULL)); size_t processedSize = kBufferSize; RINOK(ReadStream(stream, buffer, &processedSize)); if (processedSize >= 16) { Byte kRarHeader[] = {0x52 , 0x61, 0x72, 0x21, 0x1a, 0x07, 0x00}; if (TestSignature(buffer, kRarHeader, 7) && buffer[9] == 0x73 && (buffer[10] & 1) != 0) { for (int i = 0; i < orderIndices.Size(); i++) { int index = orderIndices[i]; const CArcInfoEx &ai = codecs->Formats[index]; if (ai.Name.CompareNoCase(L"rar") != 0) continue; orderIndices.Delete(i--); orderIndices.Insert(0, index); break; } } } } if (orderIndices.Size() >= 2) { int isoIndex = codecs->FindFormatForArchiveType(L"iso"); int udfIndex = codecs->FindFormatForArchiveType(L"udf"); int iIso = -1; int iUdf = -1; for (int i = 0; i < orderIndices.Size(); i++) { if (orderIndices[i] == isoIndex) iIso = i; if (orderIndices[i] == udfIndex) iUdf = i; } if (iUdf > iIso && iIso >= 0) { orderIndices[iUdf] = isoIndex; orderIndices[iIso] = udfIndex; } } #endif } for (int i = 0; i < orderIndices.Size(); i++) { if (stream) { RINOK(stream->Seek(0, STREAM_SEEK_SET, NULL)); } CMyComPtr<IInArchive> archive; FormatIndex = orderIndices[i]; RINOK(codecs->CreateInArchive(FormatIndex, archive)); if (!archive) continue; #ifdef EXTERNAL_CODECS { CMyComPtr<ISetCompressCodecsInfo> setCompressCodecsInfo; archive.QueryInterface(IID_ISetCompressCodecsInfo, (void **)&setCompressCodecsInfo); if (setCompressCodecsInfo) { RINOK(setCompressCodecsInfo->SetCompressCodecsInfo(codecs)); } } #endif // OutputDebugStringW(codecs->Formats[FormatIndex].Name); HRESULT result; if (stream) result = archive->Open(stream, &kMaxCheckStartPosition, callback); else { CMyComPtr<IArchiveOpenSeq> openSeq; archive.QueryInterface(IID_IArchiveOpenSeq, (void **)&openSeq); if (!openSeq) return E_NOTIMPL; result = openSeq->OpenSeq(seqStream); } if (result == S_FALSE) continue; RINOK(result); { NCOM::CPropVariant prop; archive->GetArchiveProperty(kpidError, &prop); if (prop.vt != VT_EMPTY) ErrorMessage = (prop.vt == VT_BSTR) ? prop.bstrVal : L"Unknown error"; } Archive = archive; const CArcInfoEx &format = codecs->Formats[FormatIndex]; if (format.Exts.Size() == 0) DefaultName = GetDefaultName2(fileName, L"", L""); else { int subExtIndex = format.FindExtension(extension); if (subExtIndex < 0) subExtIndex = 0; const CArcExtInfo &extInfo = format.Exts[subExtIndex]; DefaultName = GetDefaultName2(fileName, extInfo.Ext, extInfo.AddExt); } return S_OK; } return S_FALSE; } HRESULT CArc::OpenStreamOrFile( CCodecs *codecs, int formatIndex, bool stdInMode, IInStream *stream, IArchiveOpenCallback *callback) { CMyComPtr<IInStream> fileStream; CMyComPtr<ISequentialInStream> seqStream; if (stdInMode) seqStream = new CStdInFileStream; else if (!stream) { CInFileStream *fileStreamSpec = new CInFileStream(true); fileStream = fileStreamSpec; if (!fileStreamSpec->Open(Path)) return GetLastError(); stream = fileStream; } /* if (callback) { UInt64 fileSize; RINOK(stream->Seek(0, STREAM_SEEK_END, &fileSize)); RINOK(callback->SetTotal(NULL, &fileSize)) } */ return OpenStream(codecs, formatIndex, stream, seqStream, callback); } HRESULT CArchiveLink::Close() { for (int i = Arcs.Size() - 1; i >= 0; i--) { RINOK(Arcs[i].Archive->Close()); } IsOpen = false; return S_OK; } void CArchiveLink::Release() { while (!Arcs.IsEmpty()) Arcs.DeleteBack(); } HRESULT CArchiveLink::Open( CCodecs *codecs, const CIntVector &formatIndices, bool stdInMode, IInStream *stream, const UString &filePath, IArchiveOpenCallback *callback) { Release(); if (formatIndices.Size() >= 32) return E_NOTIMPL; HRESULT resSpec; for (;;) { resSpec = S_OK; int formatIndex = -1; if (formatIndices.Size() >= 1) { if (Arcs.Size() >= formatIndices.Size()) break; formatIndex = formatIndices[formatIndices.Size() - Arcs.Size() - 1]; } else if (Arcs.Size() >= 32) break; if (Arcs.IsEmpty()) { CArc arc; arc.Path = filePath; arc.SubfileIndex = (UInt32)(Int32)-1; RINOK(arc.OpenStreamOrFile(codecs, formatIndex, stdInMode, stream, callback)); Arcs.Add(arc); continue; } const CArc &arc = Arcs.Back(); resSpec = (formatIndices.Size() == 0 ? S_OK : E_NOTIMPL); UInt32 mainSubfile; { NCOM::CPropVariant prop; RINOK(arc.Archive->GetArchiveProperty(kpidMainSubfile, &prop)); if (prop.vt == VT_UI4) mainSubfile = prop.ulVal; else break; UInt32 numItems; RINOK(arc.Archive->GetNumberOfItems(&numItems)); if (mainSubfile >= numItems) break; } CMyComPtr<IInArchiveGetStream> getStream; if (arc.Archive->QueryInterface(IID_IInArchiveGetStream, (void **)&getStream) != S_OK || !getStream) break; CMyComPtr<ISequentialInStream> subSeqStream; if (getStream->GetStream(mainSubfile, &subSeqStream) != S_OK || !subSeqStream) break; CMyComPtr<IInStream> subStream; if (subSeqStream.QueryInterface(IID_IInStream, &subStream) != S_OK || !subStream) break; CArc arc2; RINOK(arc.GetItemPath(mainSubfile, arc2.Path)); CMyComPtr<IArchiveOpenSetSubArchiveName> setSubArchiveName; callback->QueryInterface(IID_IArchiveOpenSetSubArchiveName, (void **)&setSubArchiveName); if (setSubArchiveName) setSubArchiveName->SetSubArchiveName(arc2.Path); arc2.SubfileIndex = mainSubfile; HRESULT result = arc2.OpenStream(codecs, formatIndex, subStream, NULL, callback); resSpec = (formatIndices.Size() == 0 ? S_OK : S_FALSE); if (result == S_FALSE) break; RINOK(result); RINOK(arc.GetItemMTime(mainSubfile, arc2.MTime, arc2.MTimeDefined)); Arcs.Add(arc2); } IsOpen = !Arcs.IsEmpty(); return S_OK; } static void SetCallback(const UString &filePath, IOpenCallbackUI *callbackUI, IArchiveOpenCallback *reOpenCallback, CMyComPtr<IArchiveOpenCallback> &callback) { COpenCallbackImp *openCallbackSpec = new COpenCallbackImp; callback = openCallbackSpec; openCallbackSpec->Callback = callbackUI; openCallbackSpec->ReOpenCallback = reOpenCallback; UString fullName; int fileNamePartStartIndex; NFile::NDirectory::MyGetFullPathName(filePath, fullName, fileNamePartStartIndex); openCallbackSpec->Init( fullName.Left(fileNamePartStartIndex), fullName.Mid(fileNamePartStartIndex)); } HRESULT CArchiveLink::Open2(CCodecs *codecs, const CIntVector &formatIndices, bool stdInMode, IInStream *stream, const UString &filePath, IOpenCallbackUI *callbackUI) { VolumesSize = 0; COpenCallbackImp *openCallbackSpec = new COpenCallbackImp; CMyComPtr<IArchiveOpenCallback> callback = openCallbackSpec; openCallbackSpec->Callback = callbackUI; UString fullName, prefix, name; if (!stream && !stdInMode) { int fileNamePartStartIndex; if (!NFile::NDirectory::MyGetFullPathName(filePath, fullName, fileNamePartStartIndex)) return GetLastError(); prefix = fullName.Left(fileNamePartStartIndex); name = fullName.Mid(fileNamePartStartIndex); openCallbackSpec->Init(prefix, name); } else { openCallbackSpec->SetSubArchiveName(filePath); } RINOK(Open(codecs, formatIndices, stdInMode, stream, filePath, callback)); VolumePaths.Add(prefix + name); for (int i = 0; i < openCallbackSpec->FileNames.Size(); i++) VolumePaths.Add(prefix + openCallbackSpec->FileNames[i]); VolumesSize = openCallbackSpec->TotalSize; return S_OK; } HRESULT CArchiveLink::ReOpen(CCodecs *codecs, const UString &filePath, IArchiveOpenCallback *callback) { if (Arcs.Size() > 1) return E_NOTIMPL; if (Arcs.Size() == 0) return Open2(codecs, CIntVector(), false, NULL, filePath, 0); CMyComPtr<IArchiveOpenCallback> openCallbackNew; SetCallback(filePath, NULL, callback, openCallbackNew); CInFileStream *fileStreamSpec = new CInFileStream(true); CMyComPtr<IInStream> stream(fileStreamSpec); if (!fileStreamSpec->Open(filePath)) return GetLastError(); HRESULT res = GetArchive()->Open(stream, &kMaxCheckStartPosition, callback); IsOpen = (res == S_OK); return res; }
{ "pile_set_name": "Github" }
package com.marginallyclever.makelangelo.preferences; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.util.prefs.Preferences; import javax.swing.BorderFactory; import javax.swing.JCheckBox; import javax.swing.JPanel; import com.marginallyclever.makelangelo.Translator; import com.marginallyclever.util.PreferencesHelper; public class MetricsPreferences { static private JPanel panel; static private JCheckBox collectAnonymousMetricsCheckbox; static private String COLLECT_ANONYMOUS_METRICS_LABEL = "Collect Anonymous Metrics"; static public JPanel buildPanel() { panel = new JPanel(); panel.setLayout(new GridBagLayout()); panel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5)); collectAnonymousMetricsCheckbox = new JCheckBox(Translator.get("collectAnonymousMetrics")); Preferences prefs = PreferencesHelper.getPreferenceNode(PreferencesHelper.MakelangeloPreferenceKey.METRICS); collectAnonymousMetricsCheckbox.setSelected(prefs.getBoolean(COLLECT_ANONYMOUS_METRICS_LABEL, false)); GridBagConstraints c = new GridBagConstraints(); int y = 0; c.anchor = GridBagConstraints.WEST; c.gridwidth = 1; c.gridx = 1; c.gridy = y; panel.add(collectAnonymousMetricsCheckbox, c); y++; return panel; } static public void save() { Preferences prefs = PreferencesHelper.getPreferenceNode(PreferencesHelper.MakelangeloPreferenceKey.METRICS); prefs.putBoolean(COLLECT_ANONYMOUS_METRICS_LABEL, collectAnonymousMetricsCheckbox.isSelected()); } static public void cancel() { } static public boolean areAllowedToShare() { if(collectAnonymousMetricsCheckbox != null) return collectAnonymousMetricsCheckbox.isSelected(); Preferences prefs = PreferencesHelper.getPreferenceNode(PreferencesHelper.MakelangeloPreferenceKey.METRICS); return prefs.getBoolean(COLLECT_ANONYMOUS_METRICS_LABEL,false); } static public void setAllowedToShare(boolean newState) { Preferences prefs = PreferencesHelper.getPreferenceNode(PreferencesHelper.MakelangeloPreferenceKey.METRICS); prefs.putBoolean(COLLECT_ANONYMOUS_METRICS_LABEL, newState); } }
{ "pile_set_name": "Github" }
<p class="mb-1 is-size-5"> <b>Communities</b> </p> <!-- Sections & Pages - Communities --> {{ with .Site.GetPage "/communities" }} {{ range (.Sections | union .Pages).ByTitle }} <!-- Looping through communities--> <p> <a {{ if .Params.link }}href="{{ .Params.link }}" target="_blank" rel="noopener" {{ else }}href="{{ .RelPermalink }}" {{ end }}class="link--techqueria"> {{ if .Params.identifier }} {{ .Title }} <i class="footer-icons {{ .Params.identifier }}" alt="{{ .Params.Title }}" title="{{ .Params.Title }}"></i> {{ else }} {{ .Title }} {{ end }} </a> </p> {{ end }} {{ end }}
{ "pile_set_name": "Github" }
package isatty_test import ( "fmt" "os" "github.com/mattn/go-isatty" ) func Example() { if isatty.IsTerminal(os.Stdout.Fd()) { fmt.Println("Is Terminal") } else if isatty.IsCygwinTerminal(os.Stdout.Fd()) { fmt.Println("Is Cygwin/MSYS2 Terminal") } else { fmt.Println("Is Not Terminal") } }
{ "pile_set_name": "Github" }