Method to return the AP (average precision) value at a particular cutoff
level for a given user.

@param user the user
@param at cutoff level
@return the AP (average precision) corresponding to the requested user at
the cutoff level
435033
@Override
    public double getValueAt(final U user, final int at) {
        if (userMAPAtCutoff.containsKey(at) && userMAPAtCutoff.get(at).containsKey(user)) {
            double map = userMAPAtCutoff.get(at).get(user);
            return map;
        }
        return Double.NaN;
    }
1304409
public static double asin(double x) {
      if (x != x) {
          return Double.NaN;
      }

      if (x > 1.0 || x < -1.0) {
          return Double.NaN;
      }

      if (x == 1.0) {
          return Math.PI/2.0;
      }

      if (x == -1.0) {
          return -Math.PI/2.0;
      }

      if (x == 0.0) { // Matches +/- 0.0; return correct sign
          return x;
      }

      /* Compute asin(x) = atan(x/sqrt(1-x*x)) */

      /* Split x */
      double temp = x * HEX_40000000;
      final double xa = x + temp - temp;
      final double xb = x - xa;

      /* Square it */
      double ya = xa*xa;
      double yb = xa*xb*2.0 + xb*xb;

      /* Subtract from 1 */
      ya = -ya;
      yb = -yb;

      double za = 1.0 + ya;
      double zb = -(za - 1.0 - ya);

      temp = za + yb;
      zb += -(temp - za - yb);
      za = temp;

      /* Square root */
      double y;
      y = sqrt(za);
      temp = y * HEX_40000000;
      ya = y + temp - temp;
      yb = y - ya;

      /* Extend precision of sqrt */
      yb += (za - ya*ya - 2*ya*yb - yb*yb) / (2.0*y);

      /* Contribution of zb to sqrt */
      double dx = zb / (2.0*y);

      // Compute ratio r = x/y
      double r = x/y;
      temp = r * HEX_40000000;
      double ra = r + temp - temp;
      double rb = r - ra;

      rb += (x - ra*ya - ra*yb - rb*ya - rb*yb) / y;  // Correct for rounding in division
      rb += -x * dx / y / y;  // Add in effect additional bits of sqrt.

      temp = ra + rb;
      rb = -(temp - ra - rb);
      ra = temp;

      return atan(ra, rb, false);
    }
160805
@Override
    public double getValueAt(final int at) {
        if (userRecallAtCutoff.containsKey(at)) {
            int n = 0;
            double rec = 0.0;
            for (U u : userRecallAtCutoff.get(at).keySet()) {
                double urec = getValueAt(u, at);
                if (!Double.isNaN(urec)) {
                    rec += urec;
                    n++;
                }
            }
            if (n == 0) {
                rec = 0.0;
            } else {
                rec = rec / n;
            }
            return rec;
        }
        return Double.NaN;
    }
325786
public int retrieveAccessLevel(User user) {
		if (domain == null) {
			return user.getAccessLevel();
		}
		Criteria criteria = this.dao.newCriteria(CompanyUser.class).add(Restrictions.eq("user", user))
				.add(Restrictions.eq("company", domain.getCompany()));
		CompanyUser companyUser = (CompanyUser) criteria.uniqueResult();
		if (companyUser == null) {
			return user.getAccessLevel();
		}
		return Math.max(user.getAccessLevel(), companyUser.getAccessLevel());
	}
723766
@Programmatic
    public List<SessionLogEntry> findRecentByUser(final String user) {
        return repositoryService.allMatches(
                new QueryDefault<>(SessionLogEntry.class, "findRecentByUser", "user", user));

    }
836723
def ap(object, level = nil)
      level ||= AwesomePrint.defaults[:log_level] if AwesomePrint.defaults
      level ||= :debug
      send level, object.ai
    end
1095009
protected String getUserIpLimits(Authentication auth) {
        Object principal = auth.getPrincipal();

        if (principal instanceof DuracloudUserDetails) {
            DuracloudUserDetails userDetails = (DuracloudUserDetails) principal;
            return userDetails.getIpLimits();
        } else {
            return null;
        }
    }
1147991
public Point eval(double t, AbstractPoint p)
    {
        if (t < 0 || t > 1)
        {
            throw new IllegalArgumentException("t="+t+" not in [0,1]");
        }
        p.set(0, 0);
        double c0 = Math.pow(1-t, 3);
        double c1 = 3*Math.pow(1-t, 2)*t;
        double c2 = 3*(1-t)*t*t;
        double c3 = t*t*t;
        p.add(c0*P[start].getX(), c0*P[start].getY());
        p.add(c1*P[start+1].getX(), c1*P[start+1].getY());
        p.add(c2*P[start+2].getX(), c2*P[start+2].getY());
        p.add(c3*P[start+3].getX(), c3*P[start+3].getY());
        return p;
    }
954062
public int getMessageUserDataLengthOnClose(boolean prearrangedEnd) throws MAPException {

        if (prearrangedEnd)
            // we do not send any data in prearrangedEnd dialog termination
            return 0;

        try {
            switch (this.tcapDialog.getState()) {
                case InitialReceived:
                    ApplicationContextName acn = this.mapProviderImpl.getTCAPProvider().getDialogPrimitiveFactory()
                            .createApplicationContextName(this.appCntx.getOID());

                    TCEndRequest te = this.mapProviderImpl.encodeTCEnd(this.getTcapDialog(), true, prearrangedEnd, acn,
                            this.extContainer);
                    return tcapDialog.getDataLength(te);

                case Active:
                    te = this.mapProviderImpl.encodeTCEnd(this.getTcapDialog(), false, prearrangedEnd, null, null);
                    return tcapDialog.getDataLength(te);
            }
        } catch (TCAPSendException e) {
            throw new MAPException("TCAPSendException when getMessageUserDataLengthOnSend", e);
        }

        throw new MAPException("Bad TCAP Dialog state: " + this.tcapDialog.getState());
    }
763448
private static int calculateEtag(final Action action) {
        final int prime = 31;
        int result = action.hashCode();
        int offsetPrime = action.isHitAutoForceTime(System.currentTimeMillis()) ? 1231 : 1237;
        offsetPrime = action.hasMaintenanceSchedule() && action.isMaintenanceWindowAvailable() ? 1249 : offsetPrime;

        result = prime * result + offsetPrime;
        return result;
    }
1106860
public CmsUserEditParameters getUserEditParameters(CmsUser user) {

        CmsUserEditParameters params = new CmsUserEditParameters();
        params.setEditEnabled(true);
        params.setPasswordChangeEnabled(true);
        return params;
    }
592334
private double pVap( double T, double P ) {
        double A = 6.1121 * (1.0007 + 3.46E-6 * P);
        double b = 17.502;
        double c = 240.97;
        double e = A * exp(b * T / (c + T));
        return e;
    }
964839
Long getPrecisionAct() {

        Integer temp = getPrecision();

        if (temp == null) {
            return ValuePool.getLong(Long.MAX_VALUE);
        } else {
            return ValuePool.getLong(temp.longValue());
        }
    }
1341856
protected void setUser(String user) {
    for (INodeHardLinkFile linkedFile : linkedFiles) {
      linkedFile.setUser(user, false);
    }
  }
683591
public static @Nonnull ApiTokenStats load(@Nonnull User user) {
        // even if we are not using statistics, we load the existing one in case the configuration
        // is enabled afterwards to avoid erasing data
        
        ApiTokenStats apiTokenStats = null;
        
        File userFolder = user.getUserFolder();
        if (userFolder != null) {
            apiTokenStats = internalLoad(userFolder);
        }
        
        if (apiTokenStats == null) {
            apiTokenStats = new ApiTokenStats();
        }
        
        apiTokenStats.user = user;
        
        return apiTokenStats;
    }
71420
static double expint(int p, final double result[]) {
        //double x = M_E;
        final double xs[] = new double[2];
        final double as[] = new double[2];
        final double ys[] = new double[2];
        //split(x, xs);
        //xs[1] = (double)(2.7182818284590452353602874713526625L - xs[0]);
        //xs[0] = 2.71827697753906250000;
        //xs[1] = 4.85091998273542816811e-06;
        //xs[0] = Double.longBitsToDouble(0x4005bf0800000000L);
        //xs[1] = Double.longBitsToDouble(0x3ed458a2bb4a9b00L);

        /* E */
        xs[0] = 2.718281828459045;
        xs[1] = 1.4456468917292502E-16;

        split(1.0, ys);

        while (p > 0) {
            if ((p & 1) != 0) {
                quadMult(ys, xs, as);
                ys[0] = as[0]; ys[1] = as[1];
            }

            quadMult(xs, xs, as);
            xs[0] = as[0]; xs[1] = as[1];

            p >>= 1;
        }

        if (result != null) {
            result[0] = ys[0];
            result[1] = ys[1];

            resplit(result);
        }

        return ys[0] + ys[1];
    }
14366
@Override
    public Double getUserItemPreference(U u, I i) {
        if (userItemPreferences.containsKey(u) && userItemPreferences.get(u).containsKey(i)) {
            return userItemPreferences.get(u).get(i);
        }
        return Double.NaN;
    }