Resolves a dimension resource that uses scaled pixels

@param context the current context
@param sizeRes the dimension resource holding an SP value
@return the text size in pixels
963671
public static float pixelsFromSpResource(Context context, @DimenRes int sizeRes) {
        final Resources res = context.getResources();
        return res.getDimension(sizeRes) / res.getDisplayMetrics().density;
    }
664759
public ResolvedFeatures getResolvedFeatures(JvmTypeReference contextType) {
		ITypeReferenceOwner owner = new StandardTypeReferenceOwner(services, contextType.eResource().getResourceSet());
		return getResolvedFeatures(owner.toLightweightTypeReference(contextType));
	}
365340
private void convertFromARtoVRSpace(float scale) {
        mPose.update(mARPlane.getCenterPose(), scale);
        getTransform().setModelMatrix(mPose.getPoseMatrix());
    }
59581
public static int getStatusBarHeight(Context context, boolean force) {
        int result = 0;
        int resourceId = context.getResources().getIdentifier("status_bar_height", "dimen", "android");
        if (resourceId > 0) {
            result = context.getResources().getDimensionPixelSize(resourceId);
        }

        int dimenResult = context.getResources().getDimensionPixelSize(R.dimen.tool_bar_top_padding);
        //if our dimension is 0 return 0 because on those devices we don't need the height
        if (dimenResult == 0 && !force) {
            return 0;
        } else {
            //if our dimens is > 0 && the result == 0 use the dimenResult else the result;
            return result == 0 ? dimenResult : result;
        }
    }
426766
public static float pixelToSip(Context context, float pixels) {
        DisplayMetrics metrics = new DisplayMetrics();
        float scaledDensity = metrics.scaledDensity;
        if (pixels == 0 || scaledDensity == 0) {
            return 1;
        }
        return pixels/scaledDensity;
    }
630096
public static Drawable getCompatDrawable(Context c, int drawableRes) {
		Drawable d = null;
		try {
			d = ContextCompat.getDrawable(c, drawableRes);
		} catch (Exception ex) {
			logException(ex);
		}
		return d;
	}
966476
@NonNull
    public IconicsDrawable iconOffsetXRes(@DimenRes int sizeResId) {
        return iconOffsetXPx(mContext.getResources().getDimensionPixelSize(sizeResId));
    }
997719
@SuppressWarnings("deprecation")
    @SuppressLint("NewApi")
    public static int getScreenHeight(Activity context) {

        Display display = context.getWindowManager().getDefaultDisplay();
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {
            Point size = new Point();
            display.getSize(size);
            return size.y;
        }
        return display.getHeight();
    }
978106
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
    public static NsdManager getNsdManager(Context context) {
        return (NsdManager) context.getSystemService(Context.NSD_SERVICE);
    }
600113
public ScaleLevel getLevelFor(Font font, FontRenderContext frc, boolean horizontal)
    {
        return getLevelFor(font, frc, horizontal, 0);
    }
193349
private static Point getScreenSize(Context context, Point p) {
        if (p == null) {
            p = new Point();
        }
        WindowManager windowManager = (WindowManager) context
                .getSystemService(Context.WINDOW_SERVICE);
        Display display = windowManager.getDefaultDisplay();
        display.getSize(p);
        return p;
    }
1133073
public static int getPixelFromDp(Context context, int dp) {
		// Get the screen's density scale		
		float scale = context.getResources().getDisplayMetrics().density;

		// Convert the dps to pixels, based on density scale
		// because dp*scale is cast as an integer value, this will cause the result to be truncated.
		// Therefore, Adding ROUND_FACTOR helps the result to have properly rounded integer value.
		return (int)(dp * scale + ROUND_FACTOR);
	}
860554
@Override
    public long size(Resource... contexts) throws RepositoryException {
        if (contexts == null) {
            contexts = new Resource[] { null };
        }
        try {
            StringBuilder sb = new StringBuilder();
            sb.append("SELECT (count(?s) as ?ct) where { GRAPH ?g { ?s ?p ?o }");
            boolean first = true;
            // with no args, measure the whole triple store.
            if (contexts != null && contexts.length > 0) {
                sb.append("filter (?g = (");
                for (Resource context : contexts) {
                    if (first) {
                        first = !first;
                    }
                    else {
                        sb.append(",");
                    }
                    if (context == null) {
                        sb.append("IRI(\""+DEFAULT_GRAPH_URI+"\")");
                    } else {
                        sb.append("IRI(\"" + context.toString() + "\")");
                    }
                }
                sb.append(") )");
            }else{
                sb.append("filter (?g = (IRI(\""+DEFAULT_GRAPH_URI+"\")))");
            }
            sb.append("}");
            logger.debug(sb.toString());
            MarkLogicTupleQuery tupleQuery = prepareTupleQuery(sb.toString());
            tupleQuery.setIncludeInferred(false);
            tupleQuery.setRulesets((SPARQLRuleset) null);
            tupleQuery.setConstrainingQueryDefinition((QueryDefinition)null);
            TupleQueryResult qRes = tupleQuery.evaluate();
            // just one answer
            BindingSet result = qRes.next();
            qRes.close();
            // if 'null' was one or more of the arguments, then totalSize will be non-zero.
            return ((Literal) result.getBinding("ct").getValue()).longValue();
        } catch (QueryEvaluationException | MalformedQueryException e) {
            throw new RepositoryException(e);
        }
    }
683840
synchronized Dimension getPreferredSize() {
        return new Dimension(getFontWidth() * virtualTerminal.getTerminalSize().getColumns(),
                getFontHeight() * virtualTerminal.getTerminalSize().getRows());
    }
263066
function(context) {
        var contextObj = {};
        for(var i=0; i<context.length; i++) {
            if(context[i] !== '0') {
                contextObj[this.dimensionsList[i]] = this.numberToValue[context[i]];
            }
        }
        return contextObj;
    }
21516
private void obtainWidth(@StyleRes final int themeResourceId) {
        TypedArray typedArray = getContext().getTheme()
                .obtainStyledAttributes(themeResourceId, new int[]{R.attr.materialDialogWidth});
        int defaultValue = getContext().getResources().getDimensionPixelSize(R.dimen.dialog_width);

        try {
            setWidth(typedArray.getDimensionPixelSize(0, defaultValue));
        } catch (Resources.NotFoundException | UnsupportedOperationException e) {
            setWidth(typedArray.getInteger(0, defaultValue));
        }
    }
167663
private String getSingleSize(CmsObject cms, CmsResource res) {

        try {
            BufferedImage img = Simapi.read(cms.readFile(res).getContents());
            return "" + img.getWidth() + " x " + img.getHeight() + "px";
        } catch (CmsException | IOException e) {
            return "";
        }
    }