type stringclasses 5
values | content stringlengths 9 163k |
|---|---|
functions | double JHKeyframeAnimationFunctionEaseOutExpo(double t, double b, double c, double d)
{
return (t==d) ? b+c : c * (-pow(2, -10 * t/d) + 1) + b;
} |
functions | double JHKeyframeAnimationFunctionEaseInOutExpo(double t, double b, double c, double d)
{
if (t==0) return b;
if (t==d) return b+c;
if ((t/=d/2) < 1) return c/2 * pow(2, 10 * (t - 1)) + b;
return c/2 * (-pow(2, -10 * --t) + 2) + b;
} |
functions | double JHKeyframeAnimationFunctionEaseInCirc(double t, double b, double c, double d)
{
return -c * (sqrt(1 - (t/=d)*t) - 1) + b;
} |
functions | double JHKeyframeAnimationFunctionEaseOutCirc(double t, double b, double c, double d)
{
return c * sqrt(1 - (t=t/d-1)*t) + b;
} |
functions | double JHKeyframeAnimationFunctionEaseInOutCirc(double t, double b, double c, double d)
{
if ((t/=d/2) < 1) return -c/2 * (sqrt(1 - t*t) - 1) + b;
return c/2 * (sqrt(1 - (t-=2)*t) + 1) + b;
} |
functions | double JHKeyframeAnimationFunctionEaseInElastic(double t, double b, double c, double d)
{
double s = 1.70158; double p=0; double a=c;
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
if (a < fabs(c)) { a=c; s=p/4; } |
functions | double JHKeyframeAnimationFunctionEaseOutElastic(double t, double b, double c, double d)
{
double s=1.70158, p=0, a=c;
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
if (a < fabs(c)) { a=c; s=p/4; } |
functions | double JHKeyframeAnimationFunctionEaseInOutElastic(double t, double b, double c, double d)
{
double s=1.70158, p=0, a=c;
if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5);
if (a < fabs(c)) { a=c; s=p/4; } |
functions | double JHKeyframeAnimationFunctionEaseInBack(double t, double b, double c, double d)
{
const double s = 1.70158;
return c*(t/=d)*t*((s+1)*t - s) + b;
} |
functions | double JHKeyframeAnimationFunctionEaseOutBack(double t, double b, double c, double d)
{
const double s = 1.70158;
return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
} |
functions | double JHKeyframeAnimationFunctionEaseInOutBack(double t, double b, double c, double d)
{
double s = 1.70158;
if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
} |
functions | double JHKeyframeAnimationFunctionEaseInBounce(double t, double b, double c, double d)
{
return c - JHKeyframeAnimationFunctionEaseOutBounce(d-t, 0, c, d) + b;
} |
functions | double JHKeyframeAnimationFunctionEaseOutBounce(double t, double b, double c, double d)
{
if ((t/=d) < (1/2.75)) {
return c*(7.5625*t*t) + b;
} |
functions | double JHKeyframeAnimationFunctionEaseInOutBounce(double t, double b, double c, double d)
{
if (t < d/2)
return JHKeyframeAnimationFunctionEaseInBounce (t*2, 0, c, d) * .5 + b;
else
return JHKeyframeAnimationFunctionEaseOutBounce(t*2-d, 0, c, d) * .5 + c*.5 + b;
} |
includes | #include <stdlib.h> |
includes | #include <stdio.h> |
includes | #include <stdint.h> |
includes | #include <inttypes.h> |
functions | void fibo(uint32_t x) {
if (x <= 1)
printf("1\n");
else if (x <= 2)
printf("1 1\n");
else {
uint32_t prev = 1;
uint32_t prev2 = 1;
printf("1 1 ");
for (uint32_t n = 3; n <= x; n++) {
... |
main | int main(int argc, char **argv) {
uint32_t limit = atoi(argv[1]);
fibo(limit);
} |
defines | #define check_selinux_update_passwd(username) ((void)0) |
functions | void check_selinux_update_passwd(const char *username)
{
security_context_t context;
char *seuser;
if (getuid() != (uid_t)0 || is_selinux_enabled() == 0)
return; /* No need to check */
if (getprevcon_raw(&context) < 0)
bb_perror_msg_and_die("getprevcon failed");
seuser = strtok(context, ":");
if (!seuser)
... |
functions | int update_passwd(const char *filename, const char *username,
const char *new_pw)
{
struct stat sb;
struct flock lock;
FILE *old_fp;
FILE *new_fp;
char *fnamesfx;
char *sfx_char;
unsigned user_len;
int old_fd;
int new_fd;
int i;
int cnt = 0;
int ret = -1; /* failure */
filename = xmalloc_follow_symlink... |
includes |
#include <common.h> |
includes | #include <module.h> |
includes | #include <getopt.h> |
functions | void getopt_context_store(struct getopt_context *gc)
{
gc->optind = optind;
gc->opterr = opterr;
gc->optopt = optopt;
gc->optarg = optarg;
gc->nonopts = nonopts;
gc->optindex = optindex;
optind = opterr = optindex = 1;
nonopts = 0;
} |
functions | void getopt_context_restore(struct getopt_context *gc)
{
optind = gc->optind;
opterr = gc->opterr;
optopt = gc->optopt;
optarg = gc->optarg;
nonopts = gc->nonopts;
optindex = gc->optindex;
} |
functions | int getopt(int argc, char *argv[], char *optstring)
{
char curopt; /* current option character */
char *curoptp; /* pointer to the current option in optstring */
while(1) {
debug("optindex: %d nonopts: %d optind: %d\n", optindex, nonopts, optind);
/* first put nonopts to the end */
while (optind + nonopts ... |
includes |
#include <stdlib.h> |
includes | #include <math.h> |
defines | #define _CRT_SECURE_NO_DEPRECATE
|
functions | totals
if ( n > 0 )
{
QualTotals = (TRoutingTotals *) calloc(n, sizeof(TRoutingTotals));
StepQualTotals = (TRoutingTotals *) calloc(n, sizeof(TRoutingTotals));
if ( QualTotals == NULL || StepQualTotals == NULL )
{
report_writeErrorMsg(ERR_MEMORY, "");
... |
functions | totals
for (j = 0; j < n; j++)
{
QualTotals[j].dwInflow = 0.0;
QualTotals[j].wwInflow = 0.0;
QualTotals[j].gwInflow = 0.0;
QualTotals[j].exInflow = 0.0;
QualTotals[j].flooding = 0.0;
QualTotals[j].outflow = 0.0;
QualTotals[j].reacted = 0.0;
... |
functions | continuity
if ( Nobjects[NODE] > 0 )
{
NodeInflow = (double *) calloc(Nobjects[NODE], sizeof(double));
if ( NodeInflow == NULL )
{
report_writeErrorMsg(ERR_MEMORY, "");
return ErrorCode;
} |
functions | else if ( totalInflow > 0.0 )
{
RunoffTotals.pctError = 100.0 * (1.0 - totalOutflow / totalInflow);
} |
functions | else if ( totalOutflow > 0.0 )
{
RunoffTotals.pctError = 100.0 * (totalInflow / totalOutflow - 1.0);
} |
functions | else if ( loadIn > 0.0 )
{
LoadingTotals[j].pctError = 100.0 * (1.0 - loadOut / loadIn);
} |
functions | else if ( loadOut > 0.0 )
{
LoadingTotals[j].pctError = 100.0 * (loadIn / loadOut - 1.0);
} |
functions | log10
if ( Pollut[j].units == COUNT )
{
LoadingTotals[j].finalLoad = LOG10(LoadingTotals[j].finalLoad);
LoadingTotals[j].initLoad = LOG10(LoadingTotals[j].initLoad);
LoadingTotals[j].buildup = LOG10(LoadingTotals[j].buildup);
LoadingTotals[j].d... |
functions | else if ( totalInflow > 0.0 )
{
GwaterTotals.pctError = 100.0 * (1.0 - totalOutflow / totalInflow);
} |
functions | else if ( totalOutflow > 0.0 )
{
GwaterTotals.pctError = 100.0 * (totalInflow / totalOutflow - 1.0);
} |
functions | else if ( totalInflow > 0.0 )
{
FlowTotals.pctError = 100.0 * (1.0 - totalOutflow / totalInflow);
} |
functions | else if ( totalOutflow > 0.0 )
{
FlowTotals.pctError = 100.0 * (totalInflow / totalOutflow - 1.0);
} |
functions | pollutant
for (p = 0; p < Nobjects[POLLUT]; p++)
{
// --- get final mass stored in nodes and links
QualTotals[p].finalStorage = massbal_getStoredMass(p); //(5.0.019 - LR)
// --- compute % difference between total inflow and outflow
totalInflow = QualTotal... |
functions | else if ( totalInflow > 0.0 )
{
QualTotals[p].pctError = 100.0 * (1.0 - totalOutflow / totalInflow);
} |
functions | else if ( totalOutflow > 0.0 )
{
QualTotals[p].pctError = 100.0 * (totalInflow / totalOutflow - 1.0);
} |
includes |
#include <stdlib.h> |
includes | #include <string.h> |
includes | #include <math.h> |
defines | #define _CRT_SECURE_NO_DEPRECATE
|
defines | #define STOPTOL 0.00328 //integration error tolerance in ft (= 1 mm)
|
defines | #define MINFLOW 2.3e-7 //flow cutoff for dry conditions (= 0.01 in/hr)
|
structs | struct LidList
{
TLidUnit* lidUnit; // ptr. to a LID unit
struct LidList* nextLidUnit;
}; |
structs | struct LidGroup
{
double pervArea; // amount of pervious area in group (ft2)
double flowToPerv; // total flow sent to pervious area (cfs)
double dryTime; // time since last wet period (sec)
double impervRunoff; // impervious area runoff volume (ft3)
... |
functions | objects
for (j = 0; j < LidCount; j++)
{
LidProcs[j].lidType = -1;
LidProcs[j].surface.thickness = 0.0;
LidProcs[j].surface.voidFrac = 1.0;
LidProcs[j].surface.roughness = 0.0;
LidProcs[j].surface.surfSlope = 0.0;
LidProcs[j].pavement.thickness = 0.0;
... |
functions | layer
switch (m)
{
case SURF: return readSurfaceData(j, toks, ntoks);
case SOIL: return readSoilData(j, toks, ntoks);
case STOR: return readStorageData(j, toks, ntoks);
case PAVE: return readPavementData(j, toks, ntoks);
case DRAIN: return readDrainData(j, toks, ntoks);
} |
functions | doubles
for (i = 3; i <= 7; i++)
{
if ( ! getDouble(toks[i], &x[i-3]) || x[i-3] < 0.0 )
return error_setInpError(ERR_NUMBER, toks[i]);
} |
functions | supplied
if ( fname != NULL )
{
if ( !createLidRptFile(lidUnit, fname) )
return error_setInpError(ERR_RPT_FILE, fname);
} |
functions | int createLidRptFile(TLidUnit* lidUnit, char* fname)
{
TLidRptFile* rptFile;
rptFile = (TLidRptFile *) malloc(sizeof(TLidRptFile));
if ( rptFile == NULL ) return 0;
lidUnit->rptFile = rptFile;
rptFile->file = fopen(fname, "wt");
if ( rptFile->file == NULL ) return 0;
return 1;
... |
functions | supplied
if ( LidProcs[j].lidType < 0 )
{
report_writeErrorMsg(ERR_LID_TYPE, LidProcs[j].ID);
return;
} |
functions | parameters
if ( LidProcs[j].lidType == POROUS_PAVEMENT )
{
if ( LidProcs[j].pavement.thickness <= 0.0
|| LidProcs[j].pavement.kSat <= 0.0
|| LidProcs[j].pavement.voidFrac <= 0.0
|| LidProcs[j].pavement.voidFrac > 1.0
|| LidProcs[j].pavement.im... |
functions | parameters
if ( LidProcs[j].soil.thickness > 0.0 )
{
if ( LidProcs[j].soil.porosity <= 0.0
|| LidProcs[j].soil.fieldCap >= LidProcs[j].soil.porosity
|| LidProcs[j].soil.wiltPoint >= LidProcs[j].soil.fieldCap
|| LidProcs[j].soil.kSat <= 0.0
... |
functions | parameters
if ( LidProcs[j].storage.thickness > 0.0 )
{
if ( LidProcs[j].storage.voidFrac <= 0.0 ||
LidProcs[j].storage.voidFrac > 1.0 )
report_writeErrorMsg(ERR_LID_PARAMS, LidProcs[j].ID);
} |
functions | basis
if ( LidProcs[j].pavement.thickness > 0.0 )
{
LidProcs[j].pavement.clogFactor *=
LidProcs[j].pavement.thickness * LidProcs[j].pavement.voidFrac *
(1.0 - LidProcs[j].pavement.impervFrac);
} |
functions | bottom
if ( LidProcs[j].lidType == RAIN_BARREL )
{
LidProcs[j].storage.voidFrac = 1.0;
LidProcs[j].storage.kSat = 0.0;
} |
functions | parameters
if ( LidProcs[k].lidType == VEG_SWALE )
{
if ( InfilModel == GREEN_AMPT )
{
p[0] = GAInfil[j].S * UCF(RAINDEPTH);
p[1] = GAInfil[j].Ks * UCF(RAINFALL);
p[2] = GAInfil[j].IMDmax;
if ( grnampt_setPar... |
functions | fractions
if ( totalLidArea > 1.001 * totalArea )
{
report_writeErrorMsg(ERR_LID_AREAS, Subcatch[j].ID);
} |
functions | unit
while ( lidList )
{
lidUnit = lidList->lidUnit;
k = lidUnit->lidIndex;
//... check for porous pavement LID
if ( LidProcs[k].lidType == POROUS_PAVEMENT )
{
//... add to total LID surface depth and area
pondedLidDepth += lidUnit->surf... |
functions | subcatchment
while ( lidList )
{
theLidUnit = lidList->lidUnit;
evalLidUnit(qImperv, &lidOutflow, &nonLidOutflow, &flowToPerv);
lidList = lidList->nextLidUnit;
} |
functions | storage
for (i = IMPERV0; i <= IMPERV1; i++)
{
q += theSubcatch->subArea[i].runoff * theSubcatch->subArea[i].fArea;
} |
functions | layer
if ( theLidUnit->soilInfil.Ks > 0.0 )
{
SurfaceInfil =
grnampt_getInfil(&theLidUnit->soilInfil, Tstep,
SurfaceInflow, theLidUnit->surfaceDepth);
} |
functions | layers
if ( theLidProc->soil.thickness > 0.0 )
{
xMin[SOIL] = theLidProc->soil.wiltPoint;
xMax[SOIL] = theLidProc->soil.porosity;
} |
functions | use
switch (theLidProc->lidType)
{
case BIO_CELL: fluxRates = &biocellFluxRates; break;
case INFIL_TRENCH: fluxRates = &trenchFluxRates; break;
case POROUS_PAVEMENT: fluxRates = &pavementFluxRates; break;
case RAIN_BARREL: fluxRates = &barrelFluxRates; break;
case V... |
functions | volume
if ( theLidProc->storage.thickness > 0.0 )
{
maxRate = depth * theLidProc->storage.voidFrac / Tstep;
infil = MIN(infil, maxRate);
} |
functions | present
if ( theLidProc->storage.thickness == 0.0 )
{
SoilPerc = MIN(SoilPerc, StorageInfil);
StorageInfil = SoilPerc;
} |
functions | layer
if ( theLidProc->storage.thickness == 0.0 )
{
SoilPerc = MIN(SoilPerc, StorageInfil);
StorageInfil = SoilPerc;
} |
functions | spillage
if ( depth == theLidProc->surface.thickness && dVdT > 0.0 )
{
SurfaceOutflow += dVdT;
dVdT = 0.0;
} |
functions | LIDs
for ( j = 0; j < GroupCount; j++ )
{
if ( LidGroups[j] ) k++;
} |
functions | subcatchment
for ( j = 0; j < GroupCount; j++ )
{
lidGroup = LidGroups[j];
if ( !lidGroup || Subcatch[j].lidArea == 0.0 ) continue;
lidList = lidGroup->lidList;
while ( lidList )
{
//... write water balance components to report file
lidUni... |
functions | file
if ( theLidUnit->rptFile )
{
//... check if next reporting time not reached yet
if ( NewRunoffTime < theLidUnit->rptFile->nextReportTime ) return;
//... convert project's reporting time step from sec to msec
rptStep = 1000 * ReportStep;
//... advance next ... |
functions | values
for (i=0; i<n; i++)
{
xOld[i] = x[i];
xPrev[i] = x[i];
} |
functions | achieved
while (steps < maxSteps)
{
//... compute flux rates for current state levels
canStop = 1;
derivs(x, q);
//... update state levels based on current flux rates
for (i=0; i<n; i++)
{
x[i] = xOld[i] + (OMEGA*qOld[i] + (1.0 - OMEGA)*q[i... |
includes |
#include <linux/atomic.h> |
includes | #include <linux/backlight.h> |
includes | #include <linux/clk.h> |
includes | #include <linux/console.h> |
includes | #include <linux/dma-mapping.h> |
includes | #include <linux/delay.h> |
includes | #include <linux/gpio.h> |
includes | #include <linux/init.h> |
includes | #include <linux/interrupt.h> |
includes | #include <linux/ioctl.h> |
includes | #include <linux/kernel.h> |
includes | #include <linux/mm.h> |
includes | #include <linux/module.h> |
includes | #include <linux/platform_device.h> |
includes | #include <linux/pm_runtime.h> |
includes | #include <linux/slab.h> |
includes | #include <linux/videodev2.h> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.