text
stringlengths
2
1.04M
meta
dict
package com.rho.sensor; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import android.hardware.SensorEvent; import android.hardware.SensorEventListener; import android.hardware.SensorManager; import com.rho.sensor.ISensor; import com.rho.sensor.ISensorSingleton; import com.rho.sensor.SensorBase; import com.rhomobile.rhodes.Logger; import com.rhomobile.rhodes.RhodesActivity; import com.rhomobile.rhodes.api.IMethodResult; public class Sensor extends SensorBase implements ISensor { private String TAG = "Rho::" + Sensor.class.getSimpleName(); /** * Sensor Manager variable for enabling/disabling all the sensors */ private SensorManager mSensorManager; /** * Sensor Navigation URLs for all the sensors */ private IMethodResult sensorUrl; /** * Minimum Interval between any two sensor event updates */ private int minimumInterval; /** * Type of the Sensor */ private String mType; /** * Status of the sensor */ private String mStatus = ISensorSingleton.SENSOR_STATUS_NOT_READY; /** * Variable that records the event sending data to avoid sending another event before minimum interval */ private long dwQuietStart; /** * The default minimem gap specified in the sensor.xml * Cannot be set to any value lower than 200. */ static private final int DEFAULT_MINIMUM_GAP = 200; @Override public void getMinimumGap(IMethodResult result) { result.set(minimumInterval); } @Override public void setMinimumGap(int duration, IMethodResult result) { minimumInterval = duration >= DEFAULT_MINIMUM_GAP ? duration : DEFAULT_MINIMUM_GAP; } @Override public void getType(IMethodResult result) { result.set(mType); } @Override public void getStatus(IMethodResult result) { result.set(mStatus); } @Override public void getAllProperties(IMethodResult result) { Logger.D(TAG, "getProperty API [" + minimumInterval + ", " + mType + ", " + mStatus + "]"); Map<String, Object> props = new HashMap<String, Object>(); props.put("minimumGap", Integer.toString(minimumInterval)); props.put("type", mType); props.put("status", mStatus); result.set(props); } @Override public void getProperty(String name, IMethodResult result) { Logger.D(TAG, "getProperty API"); if (name.equalsIgnoreCase("minimumGap")) result.set(Integer.toString(minimumInterval)); else if (name.equalsIgnoreCase("type")) result.set(mType); else if (name.equalsIgnoreCase("status")) result.set(mStatus); else result.setError("Invalid attribute"); } @Override public void getProperties(List<String> names, IMethodResult result) { Logger.D(TAG, "getProperties API"); Map<String, Object> props = new HashMap<String, Object>(); for (String name: names) { if (name.equalsIgnoreCase("minimumGap")) props.put("minimumGap", Integer.toString(minimumInterval)); else if (name.equalsIgnoreCase("type")) props.put("type", mType); else if (name.equalsIgnoreCase("status")) props.put("status", mStatus); else result.setError("Invalid attribute"); } result.set(props); } @Override public void setProperty(String name, String val, IMethodResult result) { Logger.D(TAG, "setProperty API"); if (name.equalsIgnoreCase("minimumGap")) { int minGap = DEFAULT_MINIMUM_GAP; try { minGap = Integer.parseInt(val); minimumInterval = (minGap >= DEFAULT_MINIMUM_GAP) ? minGap : DEFAULT_MINIMUM_GAP; } catch(NumberFormatException nfex) { Logger.E(TAG, "setProperties API, Invalid minimumGap " + val); result.setError("Invalid minimumGap " + val + " , must be greater than " + DEFAULT_MINIMUM_GAP); } } else result.setError("Invalid attribute"); } @Override public void setProperties(Map<String, String> props, IMethodResult result) { Logger.D(TAG, "setProperties API"); for (Map.Entry<String, String> entry: props.entrySet()) { if (entry.getKey().equalsIgnoreCase("minimumGap")) { int minGap = DEFAULT_MINIMUM_GAP; try { minGap = Integer.parseInt(entry.getValue()); minimumInterval = (minGap >= DEFAULT_MINIMUM_GAP) ? minGap : DEFAULT_MINIMUM_GAP; } catch(NumberFormatException nfex) { Logger.E(TAG, "setProperties API, Invalid minimumGap " + entry.getValue()); result.setError("Invalid minimumGap " + entry.getValue() + " , must be greater than " + DEFAULT_MINIMUM_GAP); } } else result.setError("Invalid attribute"); } } // @Override // public void clearAllProperties(IMethodResult result) // { // Logger.D(TAG, "clearAllProperties API"); // // resetProperties(); // } public void resetProperties() { sensorUrl = null; dwQuietStart = System.currentTimeMillis(); minimumInterval = DEFAULT_MINIMUM_GAP; //Default - 200 milli seconds mStatus = ISensorSingleton.SENSOR_STATUS_NOT_READY; } private final SensorEventListener sensorListener = new SensorEventListener() { @Override public void onSensorChanged(SensorEvent arg0) { sensorChanged(arg0); } @Override public void onAccuracyChanged(android.hardware.Sensor sensor, int accuracy) { // TODO Auto-generated method stub } }; /** * Handle the data from Accelerometer sensor * @param event */ private void sensorChanged(SensorEvent event) { Map<String, Object> props = new HashMap<String, Object>(); double accel_x = event.values[0]; double accel_y = event.values[1]; double accel_z = event.values[2]; int sensorType = event.sensor.getType(); long currentTimeMillis = System.currentTimeMillis(); //Logger.D(TAG, "Sensor event fired for type:" + sensorType); switch (sensorType) { case android.hardware.Sensor.TYPE_ACCELEROMETER: //Logger.D(TAG, ISensorSingleton.SENSOR_TYPE_ACCELEROMETER + ">>>" + mType + " [" + accel_x + ", " + accel_y + ", " + accel_z + "]"); //Logger.D(TAG, "Accelerometer Sensor change detected"); if (mType.equalsIgnoreCase(ISensorSingleton.SENSOR_TYPE_ACCELEROMETER) && (sensorUrl != null)) { //Logger.D(TAG, "Acceleromert fire the event"); //get time from the last event long elapsed = currentTimeMillis - dwQuietStart; Logger.D(TAG, "Accelerometer>>> elapsed " + elapsed + ", " + currentTimeMillis); if (elapsed >= minimumInterval) { //Logger.D(TAG, "Accelerometer minimum interval surpassed"); props.put("accelerometer_x", accel_x); props.put("accelerometer_y", accel_y); props.put("accelerometer_z", accel_z); props.put("status", "ok"); if (isCallback(sensorUrl)) sensorUrl.set(props); //Logger.T(TAG, "Accelerometer event fired: "+ sensorUrl +":" + props); dwQuietStart = currentTimeMillis; } } if (mType.equalsIgnoreCase(ISensorSingleton.SENSOR_TYPE_TILT_ANGLE) && (sensorUrl != null)) { //get time from the last event long elapsed = currentTimeMillis - dwQuietStart; if (elapsed >= minimumInterval) { double PI = 3.14159265; // This algorithm is taken from the Windows Sensor API double tilt_y = (Math.atan( accel_x/Math.sqrt( accel_y*accel_y + accel_z*accel_z ) ) * 180 / PI); double tilt_x = (Math.atan( accel_y/Math.sqrt( accel_x*accel_x + accel_z*accel_z ) ) * 180 / PI); double tilt_z = (Math.atan( accel_z/Math.sqrt( accel_x*accel_x + accel_y*accel_y ) ) * 180 / PI); props.put("tiltangle_x", String.valueOf(tilt_x)); props.put("tiltangle_y", String.valueOf(tilt_y)); props.put("tiltangle_z", String.valueOf(tilt_z)); props.put("status", "ok"); if (isCallback(sensorUrl)) sensorUrl.set(props); dwQuietStart = currentTimeMillis; } } break; case android.hardware.Sensor.TYPE_MAGNETIC_FIELD: if (mType.equalsIgnoreCase(ISensorSingleton.SENSOR_TYPE_MAGNETOMETER) && (sensorUrl != null)) { //get time from the last event long elapsed = currentTimeMillis - dwQuietStart; if (elapsed >= minimumInterval) { props.put("magnetometer_x", event.values[0]); props.put("magnetometer_y", event.values[1]); props.put("magnetometer_z", event.values[2]); props.put("status", "ok"); if (isCallback(sensorUrl)) sensorUrl.set(props); dwQuietStart = currentTimeMillis; } } break; case android.hardware.Sensor.TYPE_GYROSCOPE: if (mType.equalsIgnoreCase(ISensorSingleton.SENSOR_TYPE_GYROSCOPE) && (sensorUrl != null)) { //get time from the last event long elapsed = currentTimeMillis - dwQuietStart; if (elapsed >= minimumInterval) { props.put("gyroscope_x", event.values[0]); props.put("gyroscope_y", event.values[1]); props.put("gyroscope_z", event.values[2]); props.put("status", "ok"); if (isCallback(sensorUrl)) sensorUrl.set(props); dwQuietStart = currentTimeMillis; } } break; case android.hardware.Sensor.TYPE_LIGHT: if (mType.equalsIgnoreCase(ISensorSingleton.SENSOR_TYPE_AMBIENT_LIGHT) && (sensorUrl != null)) { //get time from the last event long elapsed = currentTimeMillis - dwQuietStart; if (elapsed >= minimumInterval) { props.put("ambientlight_value", event.values[0]); props.put("status", "ok"); if (isCallback(sensorUrl)) sensorUrl.set(props); dwQuietStart = currentTimeMillis; } } break; case android.hardware.Sensor.TYPE_PROXIMITY: if (mType.equalsIgnoreCase(ISensorSingleton.SENSOR_TYPE_PROXIMITY) && (sensorUrl != null)) { //get time from the last event long elapsed = currentTimeMillis - dwQuietStart; if (elapsed >= minimumInterval) { props.put("proximity_value", event.values[0]); props.put("status", "ok"); if (isCallback(sensorUrl)) sensorUrl.set(props); dwQuietStart = currentTimeMillis; } } break; case android.hardware.Sensor.TYPE_PRESSURE: if (mType.equalsIgnoreCase(ISensorSingleton.SENSOR_TYPE_PRESSURE) && (sensorUrl != null)) { //get time from the last event long elapsed = currentTimeMillis - dwQuietStart; if (elapsed >= minimumInterval) { props.put("pressure_value", event.values[0]); props.put("status", "ok"); if (isCallback(sensorUrl)) sensorUrl.set(props); dwQuietStart = currentTimeMillis; } } break; case android.hardware.Sensor.TYPE_TEMPERATURE: if (mType.equalsIgnoreCase(ISensorSingleton.SENSOR_TYPE_TEMPERATURE) && (sensorUrl != null)) { //get time from the last event long elapsed = currentTimeMillis - dwQuietStart; if (elapsed >= minimumInterval) { props.put("temperature_value", event.values[0]); props.put("status", "ok"); if (isCallback(sensorUrl)) sensorUrl.set(props); dwQuietStart = currentTimeMillis; } } break; case android.hardware.Sensor.TYPE_GRAVITY: if (mType.equalsIgnoreCase(ISensorSingleton.SENSOR_TYPE_GRAVITY) && (sensorUrl != null)) { //get time from the last event long elapsed = currentTimeMillis - dwQuietStart; if (elapsed >= minimumInterval) { props.put("gravity_x", event.values[0]); props.put("gravity_y", event.values[1]); props.put("gravity_z", event.values[2]); props.put("status", "ok"); if (isCallback(sensorUrl)) sensorUrl.set(props); dwQuietStart = currentTimeMillis; } } break; case android.hardware.Sensor.TYPE_LINEAR_ACCELERATION: if (mType.equalsIgnoreCase(ISensorSingleton.SENSOR_TYPE_LINEAR_ACCELERATION) && (sensorUrl != null)) { //get time from the last event long elapsed = currentTimeMillis - dwQuietStart; if (elapsed >= minimumInterval) { props.put("linearacceleration_x", event.values[0]); props.put("linearacceleration_y", event.values[1]); props.put("linearacceleration_z", event.values[2]); props.put("status", "ok"); if (isCallback(sensorUrl)) sensorUrl.set(props); dwQuietStart = currentTimeMillis; } } break; case android.hardware.Sensor.TYPE_ROTATION_VECTOR: if (mType.equalsIgnoreCase(ISensorSingleton.SENSOR_TYPE_ROTATION) && (sensorUrl != null)) { //get time from the last event long elapsed = currentTimeMillis - dwQuietStart; if (elapsed >= minimumInterval) { props.put("rotation_x", event.values[0]); props.put("rotation_y", event.values[1]); props.put("rotation_z", event.values[2]); props.put("status", "ok"); if (isCallback(sensorUrl)) sensorUrl.set(props); dwQuietStart = currentTimeMillis; } } break; case android.hardware.Sensor.TYPE_ORIENTATION: if (mType.equalsIgnoreCase(ISensorSingleton.SENSOR_TYPE_ORIENTATION) && (sensorUrl != null)) { //get time from the last event long elapsed = currentTimeMillis - dwQuietStart; if (elapsed >= minimumInterval) { props.put("orientation_x", event.values[0]); props.put("orientation_y", event.values[1]); props.put("orientation_z", event.values[2]); props.put("status", "ok"); if (isCallback(sensorUrl)) sensorUrl.set(props); dwQuietStart = currentTimeMillis; } } break; default: break; } } public Sensor(String id) { super(id); mSensorManager = (SensorManager) RhodesActivity.safeGetInstance().getSystemService("sensor"); sensorUrl = null; mType = id; //ISensorSingleton.SENSOR_TYPE_ACCELEROMETER; // initial the start time to zero as the first event will get propgated to the JS/Ruby layer dwQuietStart = 0;//System.currentTimeMillis(); minimumInterval = DEFAULT_MINIMUM_GAP; //Default - 200 milli seconds // List the available sensors List<android.hardware.Sensor> sensors = mSensorManager.getSensorList(android.hardware.Sensor.TYPE_ALL); for (android.hardware.Sensor sensor : sensors) { Logger.I(TAG, "Available Sensor: " + sensor.getName()); } mStatus = ISensorSingleton.SENSOR_STATUS_READY; Logger.I(TAG, "Creating object for Sensor type: " + mType); } @Override public void start(IMethodResult result) { sensorUrl = result; if (mStatus == ISensorSingleton.SENSOR_STATUS_STARTED) { Logger.I(TAG, "Sensor type " + mType + " is already started"); return; } // reset the start time to zero as the first event will get propgated to the JS/Ruby layer dwQuietStart = 0; if (mType.equalsIgnoreCase(ISensorSingleton.SENSOR_TYPE_ACCELEROMETER)) { mSensorManager.registerListener(sensorListener, mSensorManager.getDefaultSensor(android.hardware.Sensor.TYPE_ACCELEROMETER), SensorManager.SENSOR_DELAY_NORMAL); } else if (mType.equalsIgnoreCase(ISensorSingleton.SENSOR_TYPE_TILT_ANGLE)) { mSensorManager.registerListener(sensorListener, mSensorManager.getDefaultSensor(android.hardware.Sensor.TYPE_ACCELEROMETER), SensorManager.SENSOR_DELAY_NORMAL); } else if (mType.equalsIgnoreCase(ISensorSingleton.SENSOR_TYPE_MAGNETOMETER)) { mSensorManager.registerListener(sensorListener, mSensorManager.getDefaultSensor(android.hardware.Sensor.TYPE_MAGNETIC_FIELD), SensorManager.SENSOR_DELAY_NORMAL); } else if (mType.equalsIgnoreCase(ISensorSingleton.SENSOR_TYPE_GYROSCOPE)) { mSensorManager.registerListener(sensorListener, mSensorManager.getDefaultSensor(android.hardware.Sensor.TYPE_GYROSCOPE), SensorManager.SENSOR_DELAY_NORMAL); } else if (mType.equalsIgnoreCase(ISensorSingleton.SENSOR_TYPE_AMBIENT_LIGHT)) { mSensorManager.registerListener(sensorListener, mSensorManager.getDefaultSensor(android.hardware.Sensor.TYPE_LIGHT), SensorManager.SENSOR_DELAY_NORMAL); } else if (mType.equalsIgnoreCase(ISensorSingleton.SENSOR_TYPE_PROXIMITY)) { mSensorManager.registerListener(sensorListener, mSensorManager.getDefaultSensor(android.hardware.Sensor.TYPE_PROXIMITY), SensorManager.SENSOR_DELAY_NORMAL); } else if (mType.equalsIgnoreCase(ISensorSingleton.SENSOR_TYPE_PRESSURE)) { mSensorManager.registerListener(sensorListener, mSensorManager.getDefaultSensor(android.hardware.Sensor.TYPE_PRESSURE), SensorManager.SENSOR_DELAY_NORMAL); } else if (mType.equalsIgnoreCase(ISensorSingleton.SENSOR_TYPE_TEMPERATURE)) { mSensorManager.registerListener(sensorListener, mSensorManager.getDefaultSensor(android.hardware.Sensor.TYPE_TEMPERATURE), SensorManager.SENSOR_DELAY_NORMAL); } else if (mType.equalsIgnoreCase(ISensorSingleton.SENSOR_TYPE_GRAVITY)) { mSensorManager.registerListener(sensorListener, mSensorManager.getDefaultSensor(android.hardware.Sensor.TYPE_GRAVITY), SensorManager.SENSOR_DELAY_NORMAL); } else if (mType.equalsIgnoreCase(ISensorSingleton.SENSOR_TYPE_LINEAR_ACCELERATION)) { mSensorManager.registerListener(sensorListener, mSensorManager.getDefaultSensor(android.hardware.Sensor.TYPE_LINEAR_ACCELERATION), SensorManager.SENSOR_DELAY_NORMAL); } else if (mType.equalsIgnoreCase(ISensorSingleton.SENSOR_TYPE_ROTATION)) { mSensorManager.registerListener(sensorListener, mSensorManager.getDefaultSensor(android.hardware.Sensor.TYPE_ROTATION_VECTOR), SensorManager.SENSOR_DELAY_NORMAL); } else if (mType.equalsIgnoreCase(ISensorSingleton.SENSOR_TYPE_ORIENTATION)) { mSensorManager.registerListener(sensorListener, mSensorManager.getDefaultSensor(android.hardware.Sensor.TYPE_ORIENTATION), SensorManager.SENSOR_DELAY_NORMAL); } else { Logger.E(TAG, "Sensor type " + mType + " not yet set or not supported on this platform"); } mStatus = ISensorSingleton.SENSOR_STATUS_STARTED; Logger.D(TAG, "Sensor registered successfully for type: " + mType); } @Override public void readData(IMethodResult result) { Map<String, Object> props = new HashMap<String, Object>(); props.put("status", "error"); props.put("message", "readData method not supported on Android platform"); result.set(props); //result.setError("readData method not supported on Android platform"); } @Override public void stop(IMethodResult result) { if (mStatus == ISensorSingleton.SENSOR_STATUS_STARTED) { mSensorManager.unregisterListener(sensorListener); Logger.D(TAG, "Sensor unregistered successfully"); mStatus = ISensorSingleton.SENSOR_STATUS_READY; } } private boolean isCallback(IMethodResult result) { return (result != null && result.hasCallback()); } }
{ "content_hash": "d543ec536cf13d407990e9c9f09b499f", "timestamp": "", "source": "github", "line_count": 624, "max_line_length": 138, "avg_line_length": 30.959935897435898, "alnum_prop": 0.6639577617889124, "repo_name": "tauplatform/tau", "id": "caf2a1453d5a7cb90c1d7fc0a8e6d986e30158f4", "size": "19319", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "lib/commonAPI/sensor/ext/platform/android/src/com/rho/sensor/Sensor.java", "mode": "33188", "license": "mit", "language": [ { "name": "Assembly", "bytes": "6291" }, { "name": "Batchfile", "bytes": "117803" }, { "name": "C", "bytes": "58276168" }, { "name": "C#", "bytes": "695670" }, { "name": "C++", "bytes": "17458941" }, { "name": "COBOL", "bytes": "187" }, { "name": "CSS", "bytes": "641054" }, { "name": "GAP", "bytes": "76344" }, { "name": "HTML", "bytes": "1756465" }, { "name": "Java", "bytes": "6450324" }, { "name": "JavaScript", "bytes": "1670149" }, { "name": "Makefile", "bytes": "330343" }, { "name": "Matlab", "bytes": "123" }, { "name": "NSIS", "bytes": "85403" }, { "name": "Objective-C", "bytes": "4133620" }, { "name": "Objective-C++", "bytes": "417934" }, { "name": "Perl", "bytes": "1710" }, { "name": "QMake", "bytes": "79603" }, { "name": "Rebol", "bytes": "130" }, { "name": "Roff", "bytes": "328967" }, { "name": "Ruby", "bytes": "17284489" }, { "name": "Shell", "bytes": "33635" }, { "name": "XSLT", "bytes": "4315" }, { "name": "Yacc", "bytes": "257479" } ], "symlink_target": "" }
module.exports = { /** * prepareListInfoJsonResponse * @param backendResp * @param resp * @param attribute * @param integral */ prepareListInfoJsonResponse: function(backendResp, resp, attribute, integral){ try{ var data ='', blob = ''; // Fetch data resp.on('data', function(chunk){ data += chunk; }); // Parse and fix data resp.on('end', function(){ try { // // Get only the docs var json = JSON.parse(data).response; var docs = json.docs; var numFound = json.numFound; blob = docs; // console.log(blob); for (var i=0; i<blob.length; i++){ blob[i].timestamp = blob[i]['date_dt']; delete blob[i]['date_dt']; delete blob[i]['timestamp_dt']; if (attribute == 'slowqueries'){ blob[i].qtime = blob[i]['qtime_i']; delete blob[i]['qtime_i']; } if (attribute == 'exception'){ blob[i].exception = blob[i]['stackTrace_s']; delete blob[i]['stackTrace_s']; } blob[i].query = blob[i]['params_s']; delete blob[i]['params_s']; } // Avoid CORS http://en.wikipedia.org/wiki/Cross-origin_resource_sharing backendResp.header('Access-Control-Allow-Origin', '*'); // backendResp.header('Access-Control-Allow-Headers', 'X-Requested-With'); // TODO: change to application/json ? backendResp.type('application/text'); backendResp.json( {'numFound' : numFound, 'values' : blob } ); } catch(err){ backendResp.status(404).send('Data not found. Most probably wrong query was sent to the thoth index' + err); } }); } catch(err){ backendResp.status(503).send('Thoth index not available' + err); } } };
{ "content_hash": "2bcabdda176632fbce47e7e8dd108452", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 118, "avg_line_length": 31.81967213114754, "alnum_prop": 0.5188047398248326, "repo_name": "trulia/thoth-demo", "id": "22eff671b5fd2692c1438445db0ce2e597590736", "size": "1941", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "thoth-api/endpoints/servers/list_response.js", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C#", "bytes": "27524" }, { "name": "C++", "bytes": "17400" }, { "name": "CSS", "bytes": "506902" }, { "name": "Java", "bytes": "316638" }, { "name": "JavaScript", "bytes": "4533716" }, { "name": "PHP", "bytes": "3663" }, { "name": "Python", "bytes": "14465" }, { "name": "Ruby", "bytes": "6590" }, { "name": "Shell", "bytes": "87674" }, { "name": "XSLT", "bytes": "76785" } ], "symlink_target": "" }
import Integer from '../lang/types/Integer' import String from '../lang/types/String' import defn from '../lang/defn' import stringSize from '../lang/util/stringSize' const charCount = defn( 'charCount', 'counts the number of whild characters in a string', [String, () => Integer], (string) => stringSize(string) ) export default charCount
{ "content_hash": "2bd53579d281cf861ad8c67658545299", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 54, "avg_line_length": 25.071428571428573, "alnum_prop": 0.7094017094017094, "repo_name": "brianneisler/stutter", "id": "8380e796885b732597411b4cf2ae3f6f87b87434", "size": "351", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/string/charCount.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "JavaScript", "bytes": "1408768" }, { "name": "Shell", "bytes": "1315" } ], "symlink_target": "" }
package com.amazonaws.services.ecr.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.AmazonWebServiceRequest; /** * * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/CompleteLayerUpload" target="_top">AWS API * Documentation</a> */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class CompleteLayerUploadRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** * <p> * The AWS account ID associated with the registry to which to upload layers. If you do not specify a registry, the * default registry is assumed. * </p> */ private String registryId; /** * <p> * The name of the repository to associate with the image layer. * </p> */ private String repositoryName; /** * <p> * The upload ID from a previous <a>InitiateLayerUpload</a> operation to associate with the image layer. * </p> */ private String uploadId; /** * <p> * The <code>sha256</code> digest of the image layer. * </p> */ private java.util.List<String> layerDigests; /** * <p> * The AWS account ID associated with the registry to which to upload layers. If you do not specify a registry, the * default registry is assumed. * </p> * * @param registryId * The AWS account ID associated with the registry to which to upload layers. If you do not specify a * registry, the default registry is assumed. */ public void setRegistryId(String registryId) { this.registryId = registryId; } /** * <p> * The AWS account ID associated with the registry to which to upload layers. If you do not specify a registry, the * default registry is assumed. * </p> * * @return The AWS account ID associated with the registry to which to upload layers. If you do not specify a * registry, the default registry is assumed. */ public String getRegistryId() { return this.registryId; } /** * <p> * The AWS account ID associated with the registry to which to upload layers. If you do not specify a registry, the * default registry is assumed. * </p> * * @param registryId * The AWS account ID associated with the registry to which to upload layers. If you do not specify a * registry, the default registry is assumed. * @return Returns a reference to this object so that method calls can be chained together. */ public CompleteLayerUploadRequest withRegistryId(String registryId) { setRegistryId(registryId); return this; } /** * <p> * The name of the repository to associate with the image layer. * </p> * * @param repositoryName * The name of the repository to associate with the image layer. */ public void setRepositoryName(String repositoryName) { this.repositoryName = repositoryName; } /** * <p> * The name of the repository to associate with the image layer. * </p> * * @return The name of the repository to associate with the image layer. */ public String getRepositoryName() { return this.repositoryName; } /** * <p> * The name of the repository to associate with the image layer. * </p> * * @param repositoryName * The name of the repository to associate with the image layer. * @return Returns a reference to this object so that method calls can be chained together. */ public CompleteLayerUploadRequest withRepositoryName(String repositoryName) { setRepositoryName(repositoryName); return this; } /** * <p> * The upload ID from a previous <a>InitiateLayerUpload</a> operation to associate with the image layer. * </p> * * @param uploadId * The upload ID from a previous <a>InitiateLayerUpload</a> operation to associate with the image layer. */ public void setUploadId(String uploadId) { this.uploadId = uploadId; } /** * <p> * The upload ID from a previous <a>InitiateLayerUpload</a> operation to associate with the image layer. * </p> * * @return The upload ID from a previous <a>InitiateLayerUpload</a> operation to associate with the image layer. */ public String getUploadId() { return this.uploadId; } /** * <p> * The upload ID from a previous <a>InitiateLayerUpload</a> operation to associate with the image layer. * </p> * * @param uploadId * The upload ID from a previous <a>InitiateLayerUpload</a> operation to associate with the image layer. * @return Returns a reference to this object so that method calls can be chained together. */ public CompleteLayerUploadRequest withUploadId(String uploadId) { setUploadId(uploadId); return this; } /** * <p> * The <code>sha256</code> digest of the image layer. * </p> * * @return The <code>sha256</code> digest of the image layer. */ public java.util.List<String> getLayerDigests() { return layerDigests; } /** * <p> * The <code>sha256</code> digest of the image layer. * </p> * * @param layerDigests * The <code>sha256</code> digest of the image layer. */ public void setLayerDigests(java.util.Collection<String> layerDigests) { if (layerDigests == null) { this.layerDigests = null; return; } this.layerDigests = new java.util.ArrayList<String>(layerDigests); } /** * <p> * The <code>sha256</code> digest of the image layer. * </p> * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setLayerDigests(java.util.Collection)} or {@link #withLayerDigests(java.util.Collection)} if you want to * override the existing values. * </p> * * @param layerDigests * The <code>sha256</code> digest of the image layer. * @return Returns a reference to this object so that method calls can be chained together. */ public CompleteLayerUploadRequest withLayerDigests(String... layerDigests) { if (this.layerDigests == null) { setLayerDigests(new java.util.ArrayList<String>(layerDigests.length)); } for (String ele : layerDigests) { this.layerDigests.add(ele); } return this; } /** * <p> * The <code>sha256</code> digest of the image layer. * </p> * * @param layerDigests * The <code>sha256</code> digest of the image layer. * @return Returns a reference to this object so that method calls can be chained together. */ public CompleteLayerUploadRequest withLayerDigests(java.util.Collection<String> layerDigests) { setLayerDigests(layerDigests); return this; } /** * Returns a string representation of this object; useful for testing and debugging. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getRegistryId() != null) sb.append("RegistryId: ").append(getRegistryId()).append(","); if (getRepositoryName() != null) sb.append("RepositoryName: ").append(getRepositoryName()).append(","); if (getUploadId() != null) sb.append("UploadId: ").append(getUploadId()).append(","); if (getLayerDigests() != null) sb.append("LayerDigests: ").append(getLayerDigests()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof CompleteLayerUploadRequest == false) return false; CompleteLayerUploadRequest other = (CompleteLayerUploadRequest) obj; if (other.getRegistryId() == null ^ this.getRegistryId() == null) return false; if (other.getRegistryId() != null && other.getRegistryId().equals(this.getRegistryId()) == false) return false; if (other.getRepositoryName() == null ^ this.getRepositoryName() == null) return false; if (other.getRepositoryName() != null && other.getRepositoryName().equals(this.getRepositoryName()) == false) return false; if (other.getUploadId() == null ^ this.getUploadId() == null) return false; if (other.getUploadId() != null && other.getUploadId().equals(this.getUploadId()) == false) return false; if (other.getLayerDigests() == null ^ this.getLayerDigests() == null) return false; if (other.getLayerDigests() != null && other.getLayerDigests().equals(this.getLayerDigests()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getRegistryId() == null) ? 0 : getRegistryId().hashCode()); hashCode = prime * hashCode + ((getRepositoryName() == null) ? 0 : getRepositoryName().hashCode()); hashCode = prime * hashCode + ((getUploadId() == null) ? 0 : getUploadId().hashCode()); hashCode = prime * hashCode + ((getLayerDigests() == null) ? 0 : getLayerDigests().hashCode()); return hashCode; } @Override public CompleteLayerUploadRequest clone() { return (CompleteLayerUploadRequest) super.clone(); } }
{ "content_hash": "8fe8ec20570a5a7c4d97831642c9cb96", "timestamp": "", "source": "github", "line_count": 308, "max_line_length": 122, "avg_line_length": 32.39935064935065, "alnum_prop": 0.6117847479707386, "repo_name": "dagnir/aws-sdk-java", "id": "41090d690dd978c70268b7100336ef292c0e293f", "size": "10559", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "aws-java-sdk-ecr/src/main/java/com/amazonaws/services/ecr/model/CompleteLayerUploadRequest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "FreeMarker", "bytes": "157317" }, { "name": "Gherkin", "bytes": "25556" }, { "name": "Java", "bytes": "165755153" }, { "name": "Scilab", "bytes": "3561" } ], "symlink_target": "" }
#ifndef ZEPHIR_KERNEL_FCALL_H #define ZEPHIR_KERNEL_FCALL_H #include "php_ext.h" #include "kernel/main.h" #include "kernel/memory.h" #include <Zend/zend_hash.h> #include <Zend/zend.h> typedef enum _zephir_call_type { zephir_fcall_parent, zephir_fcall_self, zephir_fcall_static, zephir_fcall_ce, zephir_fcall_method, zephir_fcall_function } zephir_call_type; #ifndef ZEPHIR_RELEASE typedef struct _zephir_fcall_cache_entry { zend_function *f; zend_uint times; } zephir_fcall_cache_entry; #else typedef zend_function zephir_fcall_cache_entry; #endif /** * @addtogroup callfuncs Calling Functions * @{ */ /** * @brief Invokes a function @a func_name and returns if the function fails due to an error or exception. * @param[out] return_value_ptr function return value (<tt>zval**</tt>); can be @c NULL (in this case it is assumed that the caller is not interested in the return value) * @param[in] func_name name of the function to call (<tt>const char*</tt>) * @param arguments function arguments (<tt>zval*</tt>) * @note If the call fails or an exception occurs, the memory frame is @em not restored. * In this case if @c return_value_ptr is not @c NULL, <tt>*return_value_ptr</tt> is set to @c NULL */ #define ZEPHIR_CALL_FUNCTIONW(return_value_ptr, func_name, ...) \ do { \ zval *params_[] = {__VA_ARGS__}; \ if (__builtin_constant_p(func_name)) { \ ZEPHIR_LAST_CALL_STATUS = zephir_call_func_aparams(return_value_ptr, func_name, sizeof(func_name)-1, sizeof(params_)/sizeof(zval*), params_ TSRMLS_CC); \ } \ else { \ ZEPHIR_LAST_CALL_STATUS = zephir_call_func_aparams(return_value_ptr, func_name, strlen(func_name), sizeof(params_)/sizeof(zval*), params_ TSRMLS_CC); \ } \ } while (0) /** * @brief Invokes a function @a func_name and returns if the function fails due to an error or exception. * @param[out] return_value_ptr function return value (<tt>zval**</tt>); can be @c NULL (in this case it is assumed that the caller is not interested in the return value) * @param[in] func_name name of the function to call (<tt>const char*</tt>) * @param arguments function arguments (<tt>zval*</tt>) * @note If the call fails or an exception occurs, the memory frame is restored. * In this case if @c return_value_ptr is not @c NULL, <tt>*return_value_ptr</tt> is set to @c NULL */ #define ZEPHIR_CALL_FUNCTION(return_value_ptr, func_name, cache, ...) \ do { \ zval *params_[] = {__VA_ARGS__}; \ ZEPHIR_OBSERVE_OR_NULLIFY_PPZV(return_value_ptr); \ if (__builtin_constant_p(func_name)) { \ ZEPHIR_LAST_CALL_STATUS = zephir_call_func_aparams(return_value_ptr, func_name, sizeof(func_name)-1, cache, sizeof(params_)/sizeof(zval*), params_ TSRMLS_CC); \ } \ else { \ ZEPHIR_LAST_CALL_STATUS = zephir_call_func_aparams(return_value_ptr, func_name, strlen(func_name), cache, sizeof(params_)/sizeof(zval*), params_ TSRMLS_CC); \ } \ } while (0) /** * @brief Invokes a function @a func_name passing @c return_value and @c return_value_ptr * as return value address; returns if the function fails due to an error or exception. * @param[in] func_name name of the function to call (<tt>const char*</tt>) * @param arguments function arguments (<tt>zval*</tt>) * @note If the call fails or an exception occurs, the memory frame is @em not restored. * @li if @c return_value_ptr is not @c NULL, @c *return_value_ptr is initialized with @c ALLOC_INIT_ZVAL * @li otherwise, if @c return_value is not @c NULL, @c return_value and @c *return_value are not changed */ #define ZEPHIR_RETURN_CALL_FUNCTIONW(func_name, cache, ...) \ do { \ zval *params_[] = {__VA_ARGS__}; \ if (__builtin_constant_p(func_name)) { \ ZEPHIR_LAST_CALL_STATUS = zephir_return_call_function(return_value, return_value_ptr, func_name, sizeof(func_name)-1, cache, sizeof(params_)/sizeof(zval*), params_ TSRMLS_CC); \ } \ else { \ ZEPHIR_LAST_CALL_STATUS = zephir_return_call_function(return_value, return_value_ptr, func_name, strlen(func_name), cache, sizeof(params_)/sizeof(zval*), params_ TSRMLS_CC); \ } \ } while (0) /** * @brief Invokes a function @a func_name passing @c return_value and @c return_value_ptr * as return value address; returns if the function fails due to an error or exception. * @param[in] func_name name of the function to call (<tt>const char*</tt>) * @param arguments function arguments (<tt>zval*</tt>) * @note If the call fails or an exception occurs, the memory frame is restored. * @li if @c return_value_ptr is not @c NULL, @c *return_value_ptr is initialized with @c ALLOC_INIT_ZVAL * @li otherwise, if @c return_value is not @c NULL, @c return_value and @c *return_value are not changed */ #define ZEPHIR_RETURN_CALL_FUNCTION(func_name, cache, ...) \ do { \ zval *params_[] = {__VA_ARGS__}; \ if (__builtin_constant_p(func_name)) { \ ZEPHIR_LAST_CALL_STATUS = zephir_return_call_function(return_value, return_value_ptr, func_name, sizeof(func_name)-1, cache, sizeof(params_)/sizeof(zval*), params_ TSRMLS_CC); \ } \ else { \ ZEPHIR_LAST_CALL_STATUS = zephir_return_call_function(return_value, return_value_ptr, func_name, strlen(func_name), cache, sizeof(params_)/sizeof(zval*), params_ TSRMLS_CC); \ } \ } while (0) /** * @brief Invokes a function @a func_name and returns if the function fails due to an error or exception. * @param[out] return_value_ptr function return value (<tt>zval**</tt>); can be @c NULL (in this case it is assumed that the caller is not interested in the return value) * @param[in] func_name name of the function to call (<tt>const char*</tt>) * @param arguments function arguments (<tt>zval*</tt>) * @note If the call fails or an exception occurs, the memory frame is restored. * In this case if @c return_value_ptr is not @c NULL, <tt>*return_value_ptr</tt> is set to @c NULL */ #define ZEPHIR_CALL_ZVAL_FUNCTION(return_value_ptr, func_name, cache, ...) \ do { \ zval *params_[] = {__VA_ARGS__}; \ ZEPHIR_OBSERVE_OR_NULLIFY_PPZV(return_value_ptr); \ if (__builtin_constant_p(func_name)) { \ ZEPHIR_LAST_CALL_STATUS = zephir_call_zval_func_aparams(return_value_ptr, func_name, cache, sizeof(params_)/sizeof(zval*), params_ TSRMLS_CC); \ } \ else { \ ZEPHIR_LAST_CALL_STATUS = zephir_call_zval_func_aparams(return_value_ptr, func_name, cache, sizeof(params_)/sizeof(zval*), params_ TSRMLS_CC); \ } \ } while (0) /** * @brief Invokes a function @a func_name passing @c return_value and @c return_value_ptr * as return value address; returns if the function fails due to an error or exception. * @param[in] func_name name of the function to call (<tt>const char*</tt>) * @param arguments function arguments (<tt>zval*</tt>) * @note If the call fails or an exception occurs, the memory frame is restored. * @li if @c return_value_ptr is not @c NULL, @c *return_value_ptr is initialized with @c ALLOC_INIT_ZVAL * @li otherwise, if @c return_value is not @c NULL, @c return_value and @c *return_value are not changed */ #define ZEPHIR_RETURN_CALL_ZVAL_FUNCTION(func_name, cache, ...) \ do { \ zval *params_[] = {__VA_ARGS__}; \ if (__builtin_constant_p(func_name)) { \ ZEPHIR_LAST_CALL_STATUS = zephir_return_call_zval_function(return_value, return_value_ptr, func_name, cache, sizeof(params_)/sizeof(zval*), params_ TSRMLS_CC); \ } \ else { \ ZEPHIR_LAST_CALL_STATUS = zephir_return_call_zval_function(return_value, return_value_ptr, func_name, cache, sizeof(params_)/sizeof(zval*), params_ TSRMLS_CC); \ } \ } while (0) /** * @} */ #define ZEPHIR_CALL_METHODW(return_value_ptr, object, method, cache, ...) \ do { \ zval *params_[] = {__VA_ARGS__}; \ if (__builtin_constant_p(method)) { \ ZEPHIR_LAST_CALL_STATUS = zephir_call_class_method_aparams(return_value_ptr, Z_OBJCE_P(object), zephir_fcall_method, object, method, sizeof(method)-1, cache, sizeof(params_)/sizeof(zval*), params_ TSRMLS_CC); \ } \ else { \ ZEPHIR_LAST_CALL_STATUS = zephir_call_class_method_aparams(return_value_ptr, Z_OBJCE_P(object), zephir_fcall_method, object, method, strlen(method), cache, sizeof(params_)/sizeof(zval*), params_ TSRMLS_CC); \ } \ } while (0) #define ZEPHIR_CALL_METHOD(return_value_ptr, object, method, cache, ...) \ do { \ zval *params_[] = {__VA_ARGS__}; \ ZEPHIR_OBSERVE_OR_NULLIFY_PPZV(return_value_ptr); \ if (__builtin_constant_p(method)) { \ ZEPHIR_LAST_CALL_STATUS = zephir_call_class_method_aparams(return_value_ptr, Z_OBJCE_P(object), zephir_fcall_method, object, method, sizeof(method)-1, cache, sizeof(params_)/sizeof(zval*), params_ TSRMLS_CC); \ } \ else { \ ZEPHIR_LAST_CALL_STATUS = zephir_call_class_method_aparams(return_value_ptr, Z_OBJCE_P(object), zephir_fcall_method, object, method, strlen(method), cache, sizeof(params_)/sizeof(zval*), params_ TSRMLS_CC); \ } \ } while (0) #define ZEPHIR_RETURN_CALL_METHODW(object, method, cache, ...) \ do { \ zval *params_[] = {__VA_ARGS__}; \ if (__builtin_constant_p(method)) { \ ZEPHIR_LAST_CALL_STATUS = zephir_return_call_class_method(return_value, return_value_ptr, Z_OBJCE_P(object), zephir_fcall_method, object, method, sizeof(method)-1, cache, sizeof(params_)/sizeof(zval*), params_ TSRMLS_CC); \ } \ else { \ ZEPHIR_LAST_CALL_STATUS = zephir_return_call_class_method(return_value, return_value_ptr, Z_OBJCE_P(object), zephir_fcall_method, object, method, strlen(method), cache, sizeof(params_)/sizeof(zval*), params_ TSRMLS_CC); \ } \ } while (0) #define ZEPHIR_RETURN_CALL_METHOD(object, method, cache, ...) \ do { \ zval *params_[] = {__VA_ARGS__}; \ if (__builtin_constant_p(method)) { \ ZEPHIR_LAST_CALL_STATUS = zephir_return_call_class_method(return_value, return_value_ptr, Z_OBJCE_P(object), zephir_fcall_method, object, method, sizeof(method)-1, cache, sizeof(params_)/sizeof(zval*), params_ TSRMLS_CC); \ } \ else { \ ZEPHIR_LAST_CALL_STATUS = zephir_return_call_class_method(return_value, return_value_ptr, Z_OBJCE_P(object), zephir_fcall_method, object, method, strlen(method), cache, sizeof(params_)/sizeof(zval*), params_ TSRMLS_CC); \ } \ } while (0) #define ZEPHIR_CALL_METHOD_THIS(return_value_ptr, method, cache, ...) \ do { \ zval *params_[] = {__VA_ARGS__}; \ ZEPHIR_OBSERVE_OR_NULLIFY_PPZV(return_value_ptr); \ if (__builtin_constant_p(method)) { \ ZEPHIR_LAST_CALL_STATUS = zephir_call_class_method_aparams(return_value_ptr, THIS_CE, zephir_fcall_method, this_ptr, method, sizeof(method)-1, cache, sizeof(params_)/sizeof(zval*), params_ TSRMLS_CC); \ } \ else { \ ZEPHIR_LAST_CALL_STATUS = zephir_call_class_method_aparams(return_value_ptr, THIS_CE, zephir_fcall_method, this_ptr, method, strlen(method), cache, sizeof(params_)/sizeof(zval*), params_ TSRMLS_CC); \ } \ } while (0) #define ZEPHIR_CALL_PARENTW(return_value_ptr, class_entry, this_ptr, method, cache, ...) \ do { \ zval *params_[] = {__VA_ARGS__}; \ if (__builtin_constant_p(method)) { \ ZEPHIR_LAST_CALL_STATUS = zephir_call_class_method_aparams(return_value_ptr, class_entry, zephir_fcall_parent, this_ptr, method, sizeof(method)-1, cache, sizeof(params_)/sizeof(zval*), params_ TSRMLS_CC); \ } \ else { \ ZEPHIR_LAST_CALL_STATUS = zephir_call_class_method_aparams(return_value_ptr, class_entry, zephir_fcall_parent, this_ptr, method, strlen(method), cache, sizeof(params_)/sizeof(zval*), params_ TSRMLS_CC); \ } \ } while (0) #define ZEPHIR_CALL_PARENT(return_value_ptr, class_entry, this_ptr, method, cache, ...) \ do { \ zval *params_[] = {__VA_ARGS__}; \ ZEPHIR_OBSERVE_OR_NULLIFY_PPZV(return_value_ptr); \ if (__builtin_constant_p(method)) { \ ZEPHIR_LAST_CALL_STATUS = zephir_call_class_method_aparams(return_value_ptr, class_entry, zephir_fcall_parent, this_ptr, method, sizeof(method)-1, cache, sizeof(params_)/sizeof(zval*), params_ TSRMLS_CC); \ } \ else { \ ZEPHIR_LAST_CALL_STATUS = zephir_call_class_method_aparams(return_value_ptr, class_entry, zephir_fcall_parent, this_ptr, method, strlen(method), cache, sizeof(params_)/sizeof(zval*), params_ TSRMLS_CC); \ } \ } while (0) #define ZEPHIR_RETURN_CALL_PARENTW(class_entry, this_ptr, method, ...) \ do { \ zval *params_[] = {__VA_ARGS__}; \ if (__builtin_constant_p(method)) { \ ZEPHIR_LAST_CALL_STATUS = zephir_return_call_class_method(return_value, return_value_ptr, class_entry, zephir_fcall_parent, this_ptr, method, sizeof(method)-1, cache, sizeof(params_)/sizeof(zval*), params_ TSRMLS_CC); \ } \ else { \ ZEPHIR_LAST_CALL_STATUS = zephir_return_call_class_method(return_value, return_value_ptr, class_entry, zephir_fcall_parent, this_ptr, method, strlen(method), cache, sizeof(params_)/sizeof(zval*), params_ TSRMLS_CC); \ } \ } while (0) #define ZEPHIR_RETURN_CALL_PARENT(class_entry, this_ptr, method, cache, ...) \ do { \ zval *params_[] = {__VA_ARGS__}; \ if (__builtin_constant_p(method)) { \ ZEPHIR_LAST_CALL_STATUS = zephir_return_call_class_method(return_value, return_value_ptr, class_entry, zephir_fcall_parent, this_ptr, method, sizeof(method)-1, cache, sizeof(params_)/sizeof(zval*), params_ TSRMLS_CC); \ } \ else { \ ZEPHIR_LAST_CALL_STATUS = zephir_return_call_class_method(return_value, return_value_ptr, class_entry, zephir_fcall_parent, this_ptr, method, strlen(method), cache, sizeof(params_)/sizeof(zval*), params_ TSRMLS_CC); \ } \ } while (0) #define ZEPHIR_CALL_SELFW(return_value_ptr, method, cache, ...) \ do { \ zval *params_[] = {__VA_ARGS__}; \ if (__builtin_constant_p(method)) { \ ZEPHIR_LAST_CALL_STATUS = zephir_call_class_method_aparams(return_value_ptr, NULL, zephir_fcall_self, NULL, method, cache, sizeof(method)-1, sizeof(params_)/sizeof(zval*), params_ TSRMLS_CC); \ } \ else { \ ZEPHIR_LAST_CALL_STATUS = zephir_call_class_method_aparams(return_value_ptr, NULL, zephir_fcall_self, NULL, method, cache, strlen(method), sizeof(params_)/sizeof(zval*), params_ TSRMLS_CC); \ } \ } while (0) #define ZEPHIR_CALL_SELF(return_value_ptr, method, cache, ...) \ do { \ zval *params_[] = {__VA_ARGS__}; \ ZEPHIR_OBSERVE_OR_NULLIFY_PPZV(return_value_ptr); \ if (__builtin_constant_p(method)) { \ ZEPHIR_LAST_CALL_STATUS = zephir_call_class_method_aparams(return_value_ptr, NULL, zephir_fcall_self, NULL, method, sizeof(method)-1, cache, sizeof(params_)/sizeof(zval*), params_ TSRMLS_CC); \ } \ else { \ ZEPHIR_LAST_CALL_STATUS = zephir_call_class_method_aparams(return_value_ptr, NULL, zephir_fcall_self, NULL, method, strlen(method), cache, sizeof(params_)/sizeof(zval*), params_ TSRMLS_CC); \ } \ } while (0) #define ZEPHIR_RETURN_CALL_SELFW(method, ...) \ do { \ zval *params_[] = {__VA_ARGS__}; \ if (__builtin_constant_p(method)) { \ ZEPHIR_LAST_CALL_STATUS = zephir_return_call_class_method(return_value, return_value_ptr, NULL, zephir_fcall_self, NULL, method, sizeof(method)-1, cache, sizeof(params_)/sizeof(zval*), params_ TSRMLS_CC); \ } \ else { \ ZEPHIR_LAST_CALL_STATUS = zephir_return_call_class_method(return_value, return_value_ptr, NULL, zephir_fcall_self, NULL, method, strlen(method), cache, sizeof(params_)/sizeof(zval*), params_ TSRMLS_CC); \ } \ } while (0) #define ZEPHIR_RETURN_CALL_SELF(method, cache, ...) \ do { \ zval *params_[] = {__VA_ARGS__}; \ if (__builtin_constant_p(method)) { \ ZEPHIR_LAST_CALL_STATUS = zephir_return_call_class_method(return_value, return_value_ptr, NULL, zephir_fcall_self, NULL, method, sizeof(method)-1, cache, sizeof(params_)/sizeof(zval*), params_ TSRMLS_CC); \ } \ else { \ ZEPHIR_LAST_CALL_STATUS = zephir_return_call_class_method(return_value, return_value_ptr, NULL, zephir_fcall_self, NULL, method, strlen(method), cache, sizeof(params_)/sizeof(zval*), params_ TSRMLS_CC); \ } \ } while (0) #define ZEPHIR_CALL_STATICW(return_value_ptr, method, ...) \ do { \ zval *params_[] = {__VA_ARGS__}; \ if (__builtin_constant_p(method)) { \ ZEPHIR_LAST_CALL_STATUS = zephir_call_class_method_aparams(return_value_ptr, NULL, zephir_fcall_static, NULL, method, sizeof(method)-1, sizeof(params_)/sizeof(zval*), params_ TSRMLS_CC); \ } \ else { \ ZEPHIR_LAST_CALL_STATUS = zephir_call_class_method_aparams(return_value_ptr, NULL, zephir_fcall_static, NULL, method, strlen(method), sizeof(params_)/sizeof(zval*), params_ TSRMLS_CC); \ } \ } while (0) #define ZEPHIR_CALL_STATIC(return_value_ptr, method, cache, ...) \ do { \ zval *params_[] = {__VA_ARGS__}; \ ZEPHIR_OBSERVE_OR_NULLIFY_PPZV(return_value_ptr); \ if (__builtin_constant_p(method)) { \ ZEPHIR_LAST_CALL_STATUS = zephir_call_class_method_aparams(return_value_ptr, NULL, zephir_fcall_static, NULL, method, sizeof(method)-1, cache, sizeof(params_)/sizeof(zval*), params_ TSRMLS_CC); \ } \ else { \ ZEPHIR_LAST_CALL_STATUS = zephir_call_class_method_aparams(return_value_ptr, NULL, zephir_fcall_static, NULL, method, strlen(method), cache, sizeof(params_)/sizeof(zval*), params_ TSRMLS_CC); \ } \ } while (0) #define ZEPHIR_RETURN_CALL_STATICW(method, cache, ...) \ do { \ zval *params_[] = {__VA_ARGS__}; \ if (__builtin_constant_p(method)) { \ RETURN_ON_FAILURE(zephir_return_call_class_method(return_value, return_value_ptr, NULL, zephir_fcall_static, NULL, method, sizeof(method)-1, cache, sizeof(params_)/sizeof(zval*), params_ TSRMLS_CC)); \ } \ else { \ RETURN_ON_FAILURE(zephir_return_call_class_method(return_value, return_value_ptr, NULL, zephir_fcall_static, NULL, method, strlen(method), cache, sizeof(params_)/sizeof(zval*), params_ TSRMLS_CC)); \ } \ } while (0) #define ZEPHIR_RETURN_CALL_STATIC(method, cache, ...) \ do { \ zval *params_[] = {__VA_ARGS__}; \ if (__builtin_constant_p(method)) { \ ZEPHIR_LAST_CALL_STATUS = zephir_return_call_class_method(return_value, return_value_ptr, NULL, zephir_fcall_static, NULL, method, sizeof(method)-1, cache, sizeof(params_)/sizeof(zval*), params_ TSRMLS_CC); \ } \ else { \ ZEPHIR_LAST_CALL_STATUS = zephir_return_call_class_method(return_value, return_value_ptr, NULL, zephir_fcall_static, NULL, method, strlen(method), cache, sizeof(params_)/sizeof(zval*), params_ TSRMLS_CC); \ } \ } while (0) #define ZEPHIR_CALL_CE_STATICW(return_value_ptr, class_entry, method, cache, ...) \ do { \ zval *params[] = {__VA_ARGS__}; \ if (__builtin_constant_p(method)) { \ ZEPHIR_LAST_CALL_STATUS = zephir_call_class_method_aparams(return_value_ptr, class_entry, zephir_fcall_ce, NULL, method, sizeof(method)-1, cache, sizeof(params)/sizeof(zval*), params TSRMLS_CC); \ } \ else { \ ZEPHIR_LAST_CALL_STATUS = zephir_call_class_method_aparams(return_value_ptr, class_entry, zephir_fcall_ce, NULL, method, strlen(method), cache, sizeof(params)/sizeof(zval*), params TSRMLS_CC); \ } \ } while (0) #define ZEPHIR_CALL_CE_STATIC(return_value_ptr, class_entry, method, cache, ...) \ do { \ zval *params_[] = {__VA_ARGS__}; \ ZEPHIR_OBSERVE_OR_NULLIFY_PPZV(return_value_ptr); \ if (__builtin_constant_p(method)) { \ ZEPHIR_LAST_CALL_STATUS = zephir_call_class_method_aparams(return_value_ptr, class_entry, zephir_fcall_ce, NULL, method, sizeof(method)-1, cache, sizeof(params_)/sizeof(zval*), params_ TSRMLS_CC); \ } \ else { \ ZEPHIR_LAST_CALL_STATUS = zephir_call_class_method_aparams(return_value_ptr, class_entry, zephir_fcall_ce, NULL, method, strlen(method), cache, sizeof(params_)/sizeof(zval*), params_ TSRMLS_CC); \ } \ } while (0) #define ZEPHIR_RETURN_CALL_CE_STATICW(class_entry, method, cache, ...) \ do { \ zval *params_[] = {__VA_ARGS__}; \ if (__builtin_constant_p(method)) { \ ZEPHIR_LAST_CALL_STATUS = zephir_return_call_class_method(return_value, return_value_ptr, class_entry, zephir_fcall_ce, NULL, method, sizeof(method)-1, sizeof(params_)/sizeof(zval*), params_ TSRMLS_CC); \ } \ else { \ ZEPHIR_LAST_CALL_STATUS = zephir_return_call_class_method(return_value, return_value_ptr, class_entry, zephir_fcall_ce, NULL, method, strlen(method), sizeof(params_)/sizeof(zval*), params_ TSRMLS_CC); \ } \ } while (0) #define ZEPHIR_RETURN_CALL_CE_STATIC(class_entry, method, cache, ...) \ do { \ zval *params_[] = {__VA_ARGS__}; \ if (__builtin_constant_p(method)) { \ ZEPHIR_LAST_CALL_STATUS = zephir_return_call_class_method(return_value, return_value_ptr, class_entry, zephir_fcall_ce, NULL, method, sizeof(method)-1, cache, sizeof(params_)/sizeof(zval*), params_ TSRMLS_CC); \ } \ else { \ ZEPHIR_LAST_CALL_STATUS = zephir_return_call_class_method(return_value, return_value_ptr, class_entry, zephir_fcall_ce, NULL, method, strlen(method), cache, sizeof(params_)/sizeof(zval*), params_ TSRMLS_CC); \ } \ } while (0) /** Use these functions to call functions in the PHP userland using an arbitrary zval as callable */ #define ZEPHIR_CALL_USER_FUNC(return_value, handler) ZEPHIR_CALL_USER_FUNC_ARRAY(return_value, handler, NULL) #define ZEPHIR_CALL_USER_FUNC_ARRAY(return_value, handler, params) \ do { \ ZEPHIR_LAST_CALL_STATUS = zephir_call_user_func_array(return_value, handler, params TSRMLS_CC); \ } while (0) #define ZEPHIR_CALL_USER_FUNC_ARRAY_NOEX(return_value, handler, params) \ do { \ ZEPHIR_LAST_CALL_STATUS = zephir_call_user_func_array_noex(return_value, handler, params TSRMLS_CC); \ } while (0) int zephir_call_func_aparams(zval **return_value_ptr, const char *func_name, uint func_length, zephir_fcall_cache_entry **cache_entry, uint param_count, zval **params TSRMLS_DC) ZEPHIR_ATTR_WARN_UNUSED_RESULT; int zephir_call_zval_func_aparams(zval **return_value_ptr, zval *func_name, zephir_fcall_cache_entry **cache_entry, uint param_count, zval **params TSRMLS_DC) ZEPHIR_ATTR_WARN_UNUSED_RESULT; /** * @ingroup callfuncs * @brief Calls a function @a func * @param return_value Calling function's @c return_value * @param return_value_ptr Calling function's @c return_value_ptr * @param func Function name * @param func_len Length of @a func (<tt>strlen(func)</tt>) * @param param_count Number of parameters */ ZEPHIR_ATTR_WARN_UNUSED_RESULT static inline int zephir_return_call_function(zval *return_value, zval **return_value_ptr, const char *func, uint func_len, zephir_fcall_cache_entry **cache_entry, uint param_count, zval **params TSRMLS_DC) { zval *rv = NULL, **rvp = return_value_ptr ? return_value_ptr : &rv; int status; if (return_value_ptr) { zval_ptr_dtor(return_value_ptr); *return_value_ptr = NULL; } status = zephir_call_func_aparams(rvp, func, func_len, cache_entry, param_count, params TSRMLS_CC); if (status == FAILURE) { if (return_value_ptr && EG(exception)) { ALLOC_INIT_ZVAL(*return_value_ptr); } return FAILURE; } if (!return_value_ptr) { COPY_PZVAL_TO_ZVAL(*return_value, rv); } return SUCCESS; } /** * @ingroup callfuncs * @brief Calls a function @a func * @param return_value Calling function's @c return_value * @param return_value_ptr Calling function's @c return_value_ptr * @param func Function name * @param func_len Length of @a func (<tt>strlen(func)</tt>) * @param param_count Number of parameters */ ZEPHIR_ATTR_WARN_UNUSED_RESULT static inline int zephir_return_call_zval_function(zval *return_value, zval **return_value_ptr, zval *func, zephir_fcall_cache_entry **cache_entry, uint param_count, zval **params TSRMLS_DC) { zval *rv = NULL, **rvp = return_value_ptr ? return_value_ptr : &rv; int status; if (return_value_ptr) { zval_ptr_dtor(return_value_ptr); *return_value_ptr = NULL; } status = zephir_call_zval_func_aparams(rvp, func, cache_entry, param_count, params TSRMLS_CC); if (status == FAILURE) { if (return_value_ptr && EG(exception)) { ALLOC_INIT_ZVAL(*return_value_ptr); } return FAILURE; } if (!return_value_ptr) { COPY_PZVAL_TO_ZVAL(*return_value, rv); } return SUCCESS; } int zephir_call_class_method_aparams(zval **return_value_ptr, zend_class_entry *ce, zephir_call_type type, zval *object, const char *method_name, uint method_len, zephir_fcall_cache_entry **cache_entry, uint param_count, zval **params TSRMLS_DC) ZEPHIR_ATTR_WARN_UNUSED_RESULT; ZEPHIR_ATTR_WARN_UNUSED_RESULT static inline int zephir_return_call_class_method(zval *return_value, zval **return_value_ptr, zend_class_entry *ce, zephir_call_type type, zval *object, const char *method_name, uint method_len, zephir_fcall_cache_entry **cache_entry, uint param_count, zval **params TSRMLS_DC) { zval *rv = NULL, **rvp = return_value_ptr ? return_value_ptr : &rv; int status; if (return_value_ptr) { zval_ptr_dtor(return_value_ptr); *return_value_ptr = NULL; } status = zephir_call_class_method_aparams(rvp, ce, type, object, method_name, method_len, cache_entry, param_count, params TSRMLS_CC); if (status == FAILURE) { if (return_value_ptr && EG(exception)) { ALLOC_INIT_ZVAL(*return_value_ptr); } return FAILURE; } if (!return_value_ptr) { COPY_PZVAL_TO_ZVAL(*return_value, rv); } return SUCCESS; } /** * @brief $object->$method() */ //ZEPHIR_ATTR_WARN_UNUSED_RESULT ZEPHIR_ATTR_NONNULL2(2, 3) //static inline int zephir_call_method(zval **return_value_ptr, zval *object, const char *method, // zephir_fcall_cache_entry **cache_entry, uint nparams, zval **params TSRMLS_DC) //{ //return zephir_call_class_method_aparams(return_value_ptr, Z_OBJCE_P(object), zephir_fcall_method, // object, method, strlen(method), cache_entry, nparams, params TSRMLS_CC); //} //ZEPHIR_ATTR_WARN_UNUSED_RESULT ZEPHIR_ATTR_NONNULL3(1, 3, 4) //static inline int zephir_return_call_method(zval *return_value, zval **return_value_ptr, zval *object, const char *method, // zephir_fcall_cache_entry **cache_entry, uint nparams, zval **params TSRMLS_DC) //{ //return zephir_return_call_class_method(return_value, return_value_ptr, Z_OBJCE_P(object), zephir_fcall_method, object, method, strlen(method), nparams, params TSRMLS_CC); //} /** * @brief static::$method() */ //ZEPHIR_ATTR_WARN_UNUSED_RESULT ZEPHIR_ATTR_NONNULL1(2) //static inline int zephir_call_static(zval **return_value_ptr, const char *method, zephir_fcall_cache_entry **cache_entry, uint nparams, zval **params TSRMLS_DC) //{ //return zephir_call_class_method_aparams(return_value_ptr, NULL, zephir_fcall_static, NULL, method, strlen(method), nparams, params TSRMLS_CC); //} //ZEPHIR_ATTR_WARN_UNUSED_RESULT ZEPHIR_ATTR_NONNULL2(1, 3) //static inline int zephir_return_call_static(zval *return_value, zval **return_value_ptr, const char *method, zephir_fcall_cache_entry **cache_entry, uint nparams, zval **params TSRMLS_DC) //{ //return zephir_return_call_class_method(return_value, return_value_ptr, NULL, zephir_fcall_static, NULL, method, strlen(method), cache_entry, nparams, params TSRMLS_CC); //} /** * @brief self::$method() */ //ZEPHIR_ATTR_WARN_UNUSED_RESULT ZEPHIR_ATTR_NONNULL1(2) //static inline int zephir_call_self(zval **return_value_ptr, const char *method, zephir_fcall_cache_entry **cache_entry, uint nparams, zval **params TSRMLS_DC) //{ //return zephir_call_class_method_aparams(return_value_ptr, NULL, zephir_fcall_self, NULL, method, strlen(method), cache_entry, nparams, params TSRMLS_CC); //} //ZEPHIR_ATTR_WARN_UNUSED_RESULT ZEPHIR_ATTR_NONNULL2(1, 3) //static inline int zephir_return_call_self(zval *return_value, zval **return_value_ptr, const char *method, uint nparams, zval **params TSRMLS_DC) //{ //return zephir_return_call_class_method(return_value, return_value_ptr, NULL, zephir_fcall_self, NULL, method, strlen(method), nparams, params TSRMLS_CC); //} /** * @brief parent::$method() */ //ZEPHIR_ATTR_WARN_UNUSED_RESULT ZEPHIR_ATTR_NONNULL1(3) //static inline int zephir_call_parent(zval **return_value_ptr, zval *object, const char *method, uint nparams, zval **params TSRMLS_DC) //{ //return zephir_call_class_method_aparams(return_value_ptr, (object ? Z_OBJCE_P(object) : NULL), zephir_fcall_parent, object, method, strlen(method), nparams, params TSRMLS_CC); //} //ZEPHIR_ATTR_WARN_UNUSED_RESULT ZEPHIR_ATTR_NONNULL2(1, 4) //static inline int zephir_return_call_parent(zval *return_value, zval **return_value_ptr, zval *object, const char *method, zephir_fcall_cache_entry **cache_entry, uint nparams, zval **params TSRMLS_DC) //{ //return zephir_return_call_class_method(return_value, return_value_ptr, (object ? Z_OBJCE_P(object) : NULL), zephir_fcall_parent, object, method, strlen(method), cache_entry, nparams, params TSRMLS_CC); //} /** * @brief $ce::$method() */ //ZEPHIR_ATTR_WARN_UNUSED_RESULT ZEPHIR_ATTR_NONNULL2(2, 3) //static inline int zephir_call_ce(zval **return_value_ptr, zend_class_entry *ce, const char *method, zephir_fcall_cache_entry **cache_entry, uint nparams, zval **params TSRMLS_DC) //{ //return zephir_call_class_method_aparams(return_value_ptr, ce, zephir_fcall_ce, NULL, method, strlen(method), cache_entry, nparams, params TSRMLS_CC); //} //ZEPHIR_ATTR_WARN_UNUSED_RESULT ZEPHIR_ATTR_NONNULL3(1, 3, 4) //static inline int zephir_return_call_ce(zval *return_value, zval **return_value_ptr, zend_class_entry *ce, const char *method, zephir_fcall_cache_entry **cache_entry, uint nparams, zval **params TSRMLS_DC) //{ //return zephir_return_call_class_method(return_value, return_value_ptr, ce, zephir_fcall_ce, NULL, method, strlen(method), nparams, params TSRMLS_CC); //} /** Fast call_user_func_array/call_user_func */ int zephir_call_user_func_array_noex(zval *return_value, zval *handler, zval *params TSRMLS_DC) ZEPHIR_ATTR_WARN_UNUSED_RESULT; /** * Replaces call_user_func_array avoiding function lookup */ ZEPHIR_ATTR_WARN_UNUSED_RESULT static inline int zephir_call_user_func_array(zval *return_value, zval *handler, zval *params TSRMLS_DC) { int status = zephir_call_user_func_array_noex(return_value, handler, params TSRMLS_CC); return (EG(exception)) ? FAILURE : status; } /** * @brief Checks if the class defines a constructor * @param ce Class entry * @return Whether the class defines a constructor */ int zephir_has_constructor_ce(const zend_class_entry *ce) ZEPHIR_ATTR_PURE ZEPHIR_ATTR_NONNULL; /** * @brief Checks if an object has a constructor * @param object Object to check * @return Whether @a object has a constructor * @retval 0 @a object is not an object or does not have a constructor * @retval 1 @a object has a constructor */ ZEPHIR_ATTR_WARN_UNUSED_RESULT ZEPHIR_ATTR_NONNULL static inline int zephir_has_constructor(const zval *object TSRMLS_DC) { return Z_TYPE_P(object) == IS_OBJECT ? zephir_has_constructor_ce(Z_OBJCE_P(object)) : 0; } /** PHP < 5.3.9 has problems with closures */ #if PHP_VERSION_ID <= 50309 int zephir_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TSRMLS_DC); #define ZEPHIR_ZEND_CALL_FUNCTION_WRAPPER zephir_call_function #else #define ZEPHIR_ZEND_CALL_FUNCTION_WRAPPER zend_call_function #endif #ifndef zend_error_noreturn #define zend_error_noreturn zend_error #endif #define zephir_check_call_status() \ do \ if (ZEPHIR_LAST_CALL_STATUS == FAILURE) { \ ZEPHIR_MM_RESTORE(); \ return; \ } \ while(0) #define zephir_check_call_status_or_jump(label) \ if (ZEPHIR_LAST_CALL_STATUS == FAILURE) { \ if (EG(exception)) { \ goto label; \ } else { \ ZEPHIR_MM_RESTORE(); \ return; \ } \ } #define zephir_check_temp_parameter(param) do { if (Z_REFCOUNT_P(param) > 1) zval_copy_ctor(param); else ZVAL_NULL(param); } while(0) void zephir_eval_php(zval *str, zval *retval_ptr, char *context TSRMLS_DC); #endif /* ZEPHIR_KERNEL_FCALL_H */
{ "content_hash": "c24d3c17f54d6ded79ac9717791a4e11", "timestamp": "", "source": "github", "line_count": 673, "max_line_length": 226, "avg_line_length": 46.65973254086181, "alnum_prop": 0.6937137761925992, "repo_name": "Playsino/Ouchbase", "id": "501de99866c6bb7b239440a215343cf4c3de7461", "size": "32639", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "ext/kernel/fcall.h", "mode": "33188", "license": "mit", "language": [ { "name": "Awk", "bytes": "2635" }, { "name": "C", "bytes": "508304" }, { "name": "C++", "bytes": "10752" }, { "name": "PHP", "bytes": "116073" }, { "name": "Shell", "bytes": "477342" }, { "name": "Zephir", "bytes": "32795" } ], "symlink_target": "" }
using System.Runtime.CompilerServices; namespace Esprima.Ast; public sealed class Directive : ExpressionStatement { public Directive(Expression expression, string value) : base(expression) { Value = value; } public string Value { [MethodImpl(MethodImplOptions.AggressiveInlining)] get; } protected override ExpressionStatement Rewrite(Expression expression) { return new Directive(expression, Value); } }
{ "content_hash": "967c5e83077d36f681f3ba38f514d97e", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 83, "avg_line_length": 25.22222222222222, "alnum_prop": 0.724669603524229, "repo_name": "sebastienros/esprima-dotnet", "id": "901efc09d1cd146afd8825201e34b9c2f47d2374", "size": "456", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "src/Esprima/Ast/Directive.cs", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C#", "bytes": "1278716" }, { "name": "JavaScript", "bytes": "37888" } ], "symlink_target": "" }
ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
{ "content_hash": "16bc70fe06aa16f62f1a98f006bc374b", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 31, "avg_line_length": 9.692307692307692, "alnum_prop": 0.7063492063492064, "repo_name": "mdoering/backbone", "id": "fd89f77e43f6625325b5bb28a4ddedce6b1f3839", "size": "202", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Caryophyllales/Cactaceae/Cylindropuntia/Cylindropuntia alamonsensis/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Move div game</title> <meta name="description" content="Simple move div game"> <meta name="keywords" content="move div"> <meta name="author" content="pbazurin"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> <!--Begin Styles--> <style> #stone { position: absolute; top: 0; left: 0; width: 200px; height: 200px; background: green; } </style> <!--End Styles--> </head> <body> <div id="stone"> </div> <!--Begin Scripts--> <script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/1.4.8/socket.io.min.js"></script> <script src="http://code.jquery.com/jquery-1.11.1.js"></script> <script src="main.js"></script> <!--End Scripts--> </body> </html>
{ "content_hash": "9c4488eb5cfd8972e25911fe71da6952", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 107, "avg_line_length": 25.216216216216218, "alnum_prop": 0.5616291532690246, "repo_name": "pbazurin/mygames", "id": "fdf975bc6dbf74221c66c5db746a95da4cd3fd37", "size": "933", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "static/move-div/index.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "4155" }, { "name": "HTML", "bytes": "18089" }, { "name": "JavaScript", "bytes": "11807" } ], "symlink_target": "" }
using System; using System.Diagnostics; using System.Runtime.InteropServices; namespace Microsoft.NET.HostModel { /// <summary> /// Provides methods for modifying the embedded native resources /// in a PE image. It currently only works on Windows, because it /// requires various kernel32 APIs. /// </summary> public class ResourceUpdater : IDisposable { private sealed class Kernel32 { // // Native methods for updating resources // [DllImport(nameof(Kernel32), CharSet = CharSet.Unicode, SetLastError=true)] public static extern SafeUpdateHandle BeginUpdateResource(string pFileName, [MarshalAs(UnmanagedType.Bool)]bool bDeleteExistingResources); // Update a resource with data from an IntPtr [DllImport(nameof(Kernel32), SetLastError=true)] [return: MarshalAs(UnmanagedType.Bool)] public static extern bool UpdateResource(SafeUpdateHandle hUpdate, IntPtr lpType, IntPtr lpName, ushort wLanguage, IntPtr lpData, uint cbData); // Update a resource with data from a managed byte[] [DllImport(nameof(Kernel32), SetLastError=true)] [return: MarshalAs(UnmanagedType.Bool)] public static extern bool UpdateResource(SafeUpdateHandle hUpdate, IntPtr lpType, IntPtr lpName, ushort wLanguage, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex=5)] byte[] lpData, uint cbData); [DllImport(nameof(Kernel32), SetLastError=true)] [return: MarshalAs(UnmanagedType.Bool)] public static extern bool EndUpdateResource(SafeUpdateHandle hUpdate, bool fDiscard); // The IntPtr version of this dllimport is used in the // SafeHandle implementation [DllImport(nameof(Kernel32), SetLastError=true)] [return: MarshalAs(UnmanagedType.Bool)] public static extern bool EndUpdateResource(IntPtr hUpdate, bool fDiscard); public const ushort LangID_LangNeutral_SublangNeutral = 0; // // Native methods used to read resources from a PE file // // Loading and freeing PE files public enum LoadLibraryFlags : uint { LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE = 0x00000040, LOAD_LIBRARY_AS_IMAGE_RESOURCE = 0x00000020 } [DllImport(nameof(Kernel32), CharSet = CharSet.Unicode, SetLastError=true)] public static extern IntPtr LoadLibraryEx(string lpFileName, IntPtr hReservedNull, LoadLibraryFlags dwFlags); [DllImport(nameof(Kernel32), SetLastError=true)] [return: MarshalAs(UnmanagedType.Bool)] public static extern bool FreeLibrary(IntPtr hModule); // Enumerating resources public delegate bool EnumResTypeProc(IntPtr hModule, IntPtr lpType, IntPtr lParam); public delegate bool EnumResNameProc(IntPtr hModule, IntPtr lpType, IntPtr lpName, IntPtr lParam); public delegate bool EnumResLangProc(IntPtr hModule, IntPtr lpType, IntPtr lpName, ushort wLang, IntPtr lParam); [DllImport(nameof(Kernel32),SetLastError=true)] [return: MarshalAs(UnmanagedType.Bool)] public static extern bool EnumResourceTypes(IntPtr hModule, EnumResTypeProc lpEnumFunc, IntPtr lParam); [DllImport(nameof(Kernel32), SetLastError=true)] [return: MarshalAs(UnmanagedType.Bool)] public static extern bool EnumResourceNames(IntPtr hModule, IntPtr lpType, EnumResNameProc lpEnumFunc, IntPtr lParam); [DllImport(nameof(Kernel32), SetLastError=true)] [return: MarshalAs(UnmanagedType.Bool)] public static extern bool EnumResourceLanguages(IntPtr hModule, IntPtr lpType, IntPtr lpName, EnumResLangProc lpEnumFunc, IntPtr lParam); public const int UserStoppedResourceEnumerationHRESULT = unchecked((int)0x80073B02); public const int ResourceDataNotFoundHRESULT = unchecked((int)0x80070714); // Querying and loading resources [DllImport(nameof(Kernel32), SetLastError=true)] public static extern IntPtr FindResourceEx(IntPtr hModule, IntPtr lpType, IntPtr lpName, ushort wLanguage); [DllImport(nameof(Kernel32), SetLastError=true)] public static extern IntPtr LoadResource(IntPtr hModule, IntPtr hResInfo); [DllImport(nameof(Kernel32))] // does not call SetLastError public static extern IntPtr LockResource(IntPtr hResData); [DllImport(nameof(Kernel32), SetLastError=true)] public static extern uint SizeofResource(IntPtr hModule, IntPtr hResInfo); } /// <summary> /// Holds the update handle returned by BeginUpdateResource. /// Normally, native resources for the update handle are /// released by a call to ResourceUpdater.Update(). In case /// this doesn't happen, the SafeUpdateHandle will release the /// native resources for the update handle without updating /// the target file. /// </summary> private class SafeUpdateHandle : SafeHandle { private SafeUpdateHandle() : base(IntPtr.Zero, true) { } public override bool IsInvalid => handle == IntPtr.Zero; protected override bool ReleaseHandle() { // discard pending updates without writing them return Kernel32.EndUpdateResource(handle, true); } } /// <summary> /// Holds the native handle for the resource update. /// </summary> private readonly SafeUpdateHandle hUpdate; ///<summary> /// Determines if the ResourceUpdater is supported by the current operating system. /// Some versions of Windows, such as Nano Server, do not support the needed APIs. /// </summary> public static bool IsSupportedOS() { if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { return false; } try { // On Nano Server 1709+, `BeginUpdateResource` is exported but returns a null handle with a zero error // Try to call `BeginUpdateResource` with an invalid parameter; the error should be non-zero if supported using (var handle = Kernel32.BeginUpdateResource("", false)) { if (handle.IsInvalid && Marshal.GetLastWin32Error() == 0) { return false; } } } catch (EntryPointNotFoundException) { // BeginUpdateResource isn't exported from Kernel32 return false; } return true; } /// <summary> /// Create a resource updater for the given PE file. This will /// acquire a native resource update handle for the file, /// preparing it for updates. Resources can be added to this /// updater, which will queue them for update. The target PE /// file will not be modified until Update() is called, after /// which the ResourceUpdater can not be used for further /// updates. /// </summary> public ResourceUpdater(string peFile) { hUpdate = Kernel32.BeginUpdateResource(peFile, false); if (hUpdate.IsInvalid) { ThrowExceptionForLastWin32Error(); } } /// <summary> /// Add all resources from a source PE file. It is assumed /// that the input is a valid PE file. If it is not, an /// exception will be thrown. This will not modify the target /// until Update() is called. /// Throws an InvalidOperationException if Update() was already called. /// </summary> public ResourceUpdater AddResourcesFromPEImage(string peFile) { if (hUpdate.IsInvalid) { ThrowExceptionForInvalidUpdate(); } // Using both flags lets the OS loader decide how to load // it most efficiently. Either mode will prevent other // processes from modifying the module while it is loaded. IntPtr hModule = Kernel32.LoadLibraryEx(peFile, IntPtr.Zero, Kernel32.LoadLibraryFlags.LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE | Kernel32.LoadLibraryFlags.LOAD_LIBRARY_AS_IMAGE_RESOURCE); if (hModule == IntPtr.Zero) { ThrowExceptionForLastWin32Error(); } var enumTypesCallback = new Kernel32.EnumResTypeProc(EnumAndUpdateTypesCallback); var errorInfo = new EnumResourcesErrorInfo(); GCHandle errorInfoHandle = GCHandle.Alloc(errorInfo); var errorInfoPtr = GCHandle.ToIntPtr(errorInfoHandle); try { if (!Kernel32.EnumResourceTypes(hModule, enumTypesCallback, errorInfoPtr)) { if (Marshal.GetHRForLastWin32Error() != Kernel32.ResourceDataNotFoundHRESULT) { CaptureEnumResourcesErrorInfo(errorInfoPtr); errorInfo.ThrowException(); } } } finally { errorInfoHandle.Free(); if (!Kernel32.FreeLibrary(hModule)) { ThrowExceptionForLastWin32Error(); } } return this; } private static bool IsIntResource(IntPtr lpType) { return ((uint)lpType >> 16) == 0; } /// <summary> /// Add a language-neutral integer resource from a byte[] with /// a particular type and name. This will not modify the /// target until Update() is called. /// Throws an InvalidOperationException if Update() was already called. /// </summary> public ResourceUpdater AddResource(byte[] data, IntPtr lpType, IntPtr lpName) { if (hUpdate.IsInvalid) { ThrowExceptionForInvalidUpdate(); } if (!IsIntResource(lpType) || !IsIntResource(lpName)) { throw new ArgumentException("AddResource can only be used with integer resource types"); } if (!Kernel32.UpdateResource(hUpdate, lpType, lpName, Kernel32.LangID_LangNeutral_SublangNeutral, data, (uint)data.Length)) { ThrowExceptionForLastWin32Error(); } return this; } /// <summary> /// Write the pending resource updates to the target PE /// file. After this, the ResourceUpdater no longer maintains /// an update handle, and can not be used for further updates. /// Throws an InvalidOperationException if Update() was already called. /// </summary> public void Update() { if (hUpdate.IsInvalid) { ThrowExceptionForInvalidUpdate(); } try { if (!Kernel32.EndUpdateResource(hUpdate, false)) { ThrowExceptionForLastWin32Error(); } } finally { hUpdate.SetHandleAsInvalid(); } } private bool EnumAndUpdateTypesCallback(IntPtr hModule, IntPtr lpType, IntPtr lParam) { var enumNamesCallback = new Kernel32.EnumResNameProc(EnumAndUpdateNamesCallback); if (!Kernel32.EnumResourceNames(hModule, lpType, enumNamesCallback, lParam)) { CaptureEnumResourcesErrorInfo(lParam); return false; } return true; } private bool EnumAndUpdateNamesCallback(IntPtr hModule, IntPtr lpType, IntPtr lpName, IntPtr lParam) { var enumLanguagesCallback = new Kernel32.EnumResLangProc(EnumAndUpdateLanguagesCallback); if (!Kernel32.EnumResourceLanguages(hModule, lpType, lpName, enumLanguagesCallback, lParam)) { CaptureEnumResourcesErrorInfo(lParam); return false; } return true; } private bool EnumAndUpdateLanguagesCallback(IntPtr hModule, IntPtr lpType, IntPtr lpName, ushort wLang, IntPtr lParam) { IntPtr hResource = Kernel32.FindResourceEx(hModule, lpType, lpName, wLang); if (hResource == IntPtr.Zero) { CaptureEnumResourcesErrorInfo(lParam); return false; } // hResourceLoaded is just a handle to the resource, which // can be used to get the resource data IntPtr hResourceLoaded = Kernel32.LoadResource(hModule, hResource); if (hResourceLoaded == IntPtr.Zero) { CaptureEnumResourcesErrorInfo(lParam); return false; } // This doesn't actually lock memory. It just retrieves a // pointer to the resource data. The pointer is valid // until the module is unloaded. IntPtr lpResourceData = Kernel32.LockResource(hResourceLoaded); if (lpResourceData == IntPtr.Zero) { ((EnumResourcesErrorInfo)GCHandle.FromIntPtr(lParam).Target).failedToLockResource = true; } if (!Kernel32.UpdateResource(hUpdate, lpType, lpName, wLang, lpResourceData, Kernel32.SizeofResource(hModule, hResource))) { CaptureEnumResourcesErrorInfo(lParam); return false; } return true; } private class EnumResourcesErrorInfo { public int hResult; public bool failedToLockResource; public void ThrowException() { if (failedToLockResource) { Debug.Assert(hResult == 0); throw new ResourceNotAvailableException("Failed to lock resource"); } Debug.Assert(hResult != 0); throw new HResultException(hResult); } } private static void CaptureEnumResourcesErrorInfo(IntPtr errorInfoPtr) { int hResult = Marshal.GetHRForLastWin32Error(); if (hResult != Kernel32.UserStoppedResourceEnumerationHRESULT) { GCHandle errorInfoHandle = GCHandle.FromIntPtr(errorInfoPtr); var errorInfo = (EnumResourcesErrorInfo)errorInfoHandle.Target; errorInfo.hResult = hResult; } } private class ResourceNotAvailableException : Exception { public ResourceNotAvailableException(string message) : base(message) { } } private static void ThrowExceptionForLastWin32Error() { throw new HResultException(Marshal.GetHRForLastWin32Error()); } private static void ThrowExceptionForInvalidUpdate() { throw new InvalidOperationException("Update handle is invalid. This instance may not be used for further updates"); } public void Dispose() { Dispose(true); GC.SuppressFinalize(this); } public void Dispose(bool disposing) { if (disposing) { hUpdate.Dispose(); } } } }
{ "content_hash": "358967d3a9965aac0d59d56ad152374d", "timestamp": "", "source": "github", "line_count": 447, "max_line_length": 135, "avg_line_length": 40.328859060402685, "alnum_prop": 0.5208853386586787, "repo_name": "crummel/dotnet_core-setup", "id": "9428686d6a1b951a881c721a2bffc5c665f6f95a", "size": "18202", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/managed/Microsoft.NET.HostModel/ResourceUpdater.cs", "mode": "33188", "license": "mit", "language": [ { "name": "Assembly", "bytes": "10625" }, { "name": "Batchfile", "bytes": "9767" }, { "name": "C", "bytes": "45725" }, { "name": "C#", "bytes": "1512999" }, { "name": "C++", "bytes": "1378008" }, { "name": "CMake", "bytes": "65382" }, { "name": "Dockerfile", "bytes": "12774" }, { "name": "HTML", "bytes": "44274" }, { "name": "Makefile", "bytes": "248" }, { "name": "PowerShell", "bytes": "137753" }, { "name": "Python", "bytes": "19560" }, { "name": "Rich Text Format", "bytes": "47653" }, { "name": "Roff", "bytes": "6044" }, { "name": "Shell", "bytes": "191316" } ], "symlink_target": "" }
ACCEPTED #### According to The Catalogue of Life, 3rd January 2011 #### Published in Can. J. Bot. 47: 48 (1969) #### Original name null ### Remarks null
{ "content_hash": "8a120131d0d9d4f33913fdb309270278", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 39, "avg_line_length": 12, "alnum_prop": 0.6666666666666666, "repo_name": "mdoering/backbone", "id": "eda15bd0d1cf96759043921a550331bcfa3e48bf", "size": "230", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Fungi/Ascomycota/Leotiomycetes/Helotiales/Helotiaceae/Crumenulopsis/Crumenulopsis pinicola/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
import {globals as globals_} from './worker-globals.js'; import {parseMesh as parseMesh_} from './worker-mesh.js'; import MapGeodataImport3DTiles2_ from '../geodata-import/3dtiles2'; //get rid of compiler mess var globals = globals_; var parseMesh = parseMesh_; var MapGeodataImport3DTiles2 = MapGeodataImport3DTiles2_; var packedEvents = []; var packedTransferables = []; function postPackedMessage(message, transferables) { if (globals.config.mapPackLoaderEvents) { packedEvents.push(message); if (transferables) { packedTransferables = packedTransferables.concat(transferables); } } else { if (transferables) { postMessage(message, transferables); } else { postMessage(message); } } } function loadBinary(path, onLoaded, onError, withCredentials, xhrParams, responseType, kind, options) { var xhr = new XMLHttpRequest(); xhr.onreadystatechange = (function (){ switch (xhr.readyState) { case 0 : // UNINITIALIZED case 1 : // LOADING case 2 : // LOADED case 3 : // INTERACTIVE break; case 4 : // COMPLETED if (xhr.status >= 400 || xhr.status == 0) { if (onError) { postPackedMessage({'command' : 'on-error', 'path': path, 'status':xhr.status}); } break; } var abuffer = xhr.response; if (!abuffer) { if (onError) { postPackedMessage({'command' : 'on-error', 'path': path}); } break; } if (onLoaded) { if (kind == 'direct-texture') { createImageBitmap(abuffer).then((function(bitmap){ postPackedMessage({'command' : 'on-loaded', 'path': path, 'data': bitmap, 'filesize': abuffer.size}, [bitmap]); }).bind(this)); } else if (kind == 'direct-mesh') { var data = parseMesh({data:new DataView(abuffer), index:0}); postPackedMessage({'command' : 'on-loaded', 'path': path, 'data': data.mesh}, data.transferables); } else if (kind == 'direct-3dtiles') { //debugger var data = parse3DTile(JSON.parse(abuffer), options); //postPackedMessage({'command' : 'on-loaded', 'path': path, 'data': data.geodata}, data.transferables); postMessage({'command' : 'on-loaded', 'path': path, 'data': data.geodata}, data.transferables); } else { postPackedMessage({'command' : 'on-loaded', 'path': path, 'data': abuffer}, [abuffer]); } } break; default: if (onError) { postPackedMessage({'command' : 'on-error', 'path': path}); } break; } }).bind(this); /* xhr.onerror = (function() { if (onError) { onError(); } }).bind(this);*/ xhr.open('GET', path, true); xhr.responseType = responseType ? responseType : 'arraybuffer'; xhr.withCredentials = withCredentials; if (options && options.size) { xhr.setRequestHeader('Range', 'bytes=' + options.offset + '-' + (options.offset + options.size)); } if (xhrParams && xhrParams['token'] /*&& xhrParams["tokenHeader"]*/) { //xhr.setRequestHeader(xhrParams["tokenHeader"], xhrParams["token"]); //old way xhr.setRequestHeader('Accept', 'token/' + xhrParams['token'] + ', */*'); } xhr.send(''); }; function parse3DTile(json, options) { var geodata = new MapGeodataImport3DTiles2(); geodata.processJSON(json, options); return { geodata:{ 'bintree': geodata.bintree, 'pathTable': geodata.pathTable, 'totalNodes': geodata.totalNodes, 'rootSize': geodata.rootSize, 'points': geodata.rootPoints, 'center': geodata.rootCenter, 'radius': geodata.rootRadius, 'texelSize': geodata.rootTexelSize }, transferables:[geodata.bintree.buffer, geodata.pathTable.buffer] }; } self.onmessage = function (e) { var message = e.data; var command = message['command']; //var data = message['data']; //console.log("workeronmessage: " + command); switch(command) { case 'config': globals.config = message['data']; break; case 'tick': if (packedEvents.length > 0) { if (packedTransferables.length > 0) { postMessage({'command': 'packed-events', 'messages':packedEvents}, packedTransferables); } else { postMessage({'command': 'packed-events', 'messages':packedEvents}); } } packedEvents = []; packedTransferables = []; break; case 'load-binary': loadBinary(message['path'], true, true, message['withCredentials'], message['xhrParams'], message['responseType'], message['kind'], message['options']); break; } };
{ "content_hash": "89e90c08f1847b761770e487c9363ce3", "timestamp": "", "source": "github", "line_count": 173, "max_line_length": 164, "avg_line_length": 31.15028901734104, "alnum_prop": 0.5231026164408982, "repo_name": "Melown/vts-browser-js", "id": "8951a100f05db2edceb8e4c263fd8bb5153c1288", "size": "5389", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/core/map/loader/worker-main.js", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "CSS", "bytes": "25030" }, { "name": "HTML", "bytes": "4351" }, { "name": "JavaScript", "bytes": "1813509" }, { "name": "Makefile", "bytes": "1252" } ], "symlink_target": "" }
<?xml version="1.0" encoding="ISO-8859-1"?> <Manager xmlns:cdb="urn:schemas-cosylab-com:CDB:1.0" xmlns="urn:schemas-cosylab-com:Manager:1.0" xmlns:baci="urn:schemas-cosylab-com:BACI:1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Timeout="50.0" ClientPingInterval="2.0" ContainerPingInterval="2.0" AdministratorPingInterval="2.0"> <Startup> <cdb:_ string=""/> </Startup> <ServiceComponents> <cdb:_ string="Log"/> <cdb:_ string="LogFactory"/> <cdb:_ string="NotifyEventChannelFactory"/> <cdb:_ string="InterfaceRepository"/> <cdb:_ string="CDB"/> <cdb:_ string="ACSLogSvc"/> <cdb:_ string="PDB"/> </ServiceComponents> <LoggingConfig minLogLevel="2" immediateDispatchLevel="99" dispatchPacketSize="10" /> </Manager>
{ "content_hash": "34905aea83ed3eb8090d04d84fb0f103", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 65, "avg_line_length": 25.6875, "alnum_prop": 0.6399026763990268, "repo_name": "csrg-utfsm/acscb", "id": "7d21405241a9978a2e3d4c6529f8f91e20650c0b", "size": "822", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "LGPL/CommonSoftware/acscomponent/ws/test/CDB/MACI/Managers/Manager/Manager.xml", "mode": "33188", "license": "mit", "language": [ { "name": "Awk", "bytes": "633" }, { "name": "Batchfile", "bytes": "2346" }, { "name": "C", "bytes": "751150" }, { "name": "C++", "bytes": "7892598" }, { "name": "CSS", "bytes": "21364" }, { "name": "Elixir", "bytes": "906" }, { "name": "Emacs Lisp", "bytes": "1990066" }, { "name": "FreeMarker", "bytes": "7369" }, { "name": "GAP", "bytes": "14867" }, { "name": "Gnuplot", "bytes": "437" }, { "name": "HTML", "bytes": "1857062" }, { "name": "Haskell", "bytes": "764" }, { "name": "Java", "bytes": "13573740" }, { "name": "JavaScript", "bytes": "19058" }, { "name": "Lex", "bytes": "5101" }, { "name": "Makefile", "bytes": "1624406" }, { "name": "Module Management System", "bytes": "4925" }, { "name": "Objective-C", "bytes": "3223" }, { "name": "PLSQL", "bytes": "9496" }, { "name": "Perl", "bytes": "120411" }, { "name": "Python", "bytes": "4191000" }, { "name": "Roff", "bytes": "9920" }, { "name": "Shell", "bytes": "1198375" }, { "name": "Smarty", "bytes": "21615" }, { "name": "Tcl", "bytes": "227078" }, { "name": "XSLT", "bytes": "100454" }, { "name": "Yacc", "bytes": "5006" } ], "symlink_target": "" }
class EXPCL_DNA DNABattleCell : public TypedObject { PUBLISHED: DNABattleCell(float width, float height, LPoint3f pos); ~DNABattleCell(); INLINE void set_width_height(float width, float height) { set_width(width); set_height(height); } PROPERTY(float, width); PROPERTY(float, height); PROPERTY(LPoint3f, pos); TYPE_HANDLE(DNABattleCell, TypedObject); }; #endif
{ "content_hash": "847d03cdafd2f567d859fd19f8b4b1b4", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 63, "avg_line_length": 23.25, "alnum_prop": 0.5978494623655914, "repo_name": "sctigercat1/libpandadna", "id": "52515c1ea8234ef995cb5b3ec009dee2eade9a6e", "size": "608", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/components/DNABattleCell.h", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C++", "bytes": "124428" }, { "name": "CMake", "bytes": "4730" }, { "name": "Python", "bytes": "99009" } ], "symlink_target": "" }
class ContainerNode < ApplicationRecord acts_as_miq_taggable include SupportsFeatureMixin include ComplianceMixin include MiqPolicyMixin include NewWithTypeStiMixin include TenantIdentityMixin include SupportsFeatureMixin include ArchivedMixin include CustomActionsMixin include_concern 'Purging' EXTERNAL_LOGGING_PATH = "/#/discover?_g=()&_a=(columns:!(hostname,level,kubernetes.pod_name,message),filters:!((meta:(disabled:!f,index:'%{index}',key:hostname,negate:!f),%{query})),index:'%{index}',interval:auto,query:(query_string:(analyze_wildcard:!t,query:'*')),sort:!(time,desc))".freeze # :name, :uid, :creation_timestamp, :resource_version belongs_to :ext_management_system, :foreign_key => "ems_id" has_many :container_groups, -> { active } has_many :container_conditions, :class_name => "ContainerCondition", :as => :container_entity, :dependent => :destroy has_many :containers, :through => :container_groups has_many :container_images, -> { distinct }, :through => :container_groups has_many :container_services, -> { distinct }, :through => :container_groups has_many :container_routes, -> { distinct }, :through => :container_services has_many :container_replicators, -> { distinct }, :through => :container_groups has_many :labels, -> { where(:section => "labels") }, :class_name => "CustomAttribute", :as => :resource, :dependent => :destroy has_many :additional_attributes, -> { where(:section => "additional_attributes") }, :class_name => "CustomAttribute", :as => :resource, :dependent => :destroy has_one :computer_system, :as => :managed_entity, :dependent => :destroy belongs_to :lives_on, :polymorphic => true has_one :hardware, :through => :computer_system # Metrics destroy is handled by purger has_many :metrics, :as => :resource has_many :metric_rollups, :as => :resource has_many :vim_performance_states, :as => :resource has_many :miq_alert_statuses, :as => :resource delegate :my_zone, :to => :ext_management_system, :allow_nil => true virtual_column :ready_condition_status, :type => :string, :uses => :container_conditions virtual_column :system_distribution, :type => :string virtual_column :kernel_version, :type => :string def ready_condition container_conditions.find_by(:name => "Ready") end def ready_condition_status ready_condition.try(:status) || 'None' end def system_distribution computer_system.try(:operating_system).try(:distribution) end def kernel_version computer_system.try(:operating_system).try(:kernel_version) end include EventMixin include Metric::CiMixin include CustomAttributeMixin def event_where_clause(assoc = :ems_events) case assoc.to_sym when :ems_events, :event_streams # TODO: improve relationship using the id ["container_node_name = ? AND #{events_table_name(assoc)}.ems_id = ?", name, ems_id] when :policy_events # TODO: implement policy events and its relationship ["#{events_table_name(assoc)}.ems_id = ?", ems_id] end end # TODO: children will be container groups PERF_ROLLUP_CHILDREN = [] def perf_rollup_parents(interval_name = nil) [ext_management_system] unless interval_name == 'realtime' end def kubernetes_hostname labels.find_by(:name => "kubernetes.io/hostname").try(:value) end def evaluate_alert(_alert_id, _event) # This is a no-op on container node, and used to be implemented only for # Hawkular-generated EmsEvents. true end supports :external_logging do unless ext_management_system.respond_to?(:external_logging_route_name) unsupported_reason_add(:external_logging, _('This provider type does not support External Logging')) end end def external_logging_query nil # {}.to_query # TODO end def external_logging_path node_hostnames = [kubernetes_hostname || name] # node name cannot be empty, it's an ID node_hostnames.push(node_hostnames.first.split('.').first).compact! node_hostnames_query = node_hostnames.uniq.map { |x| "(term:(hostname:'#{x}'))" }.join(",") query = "bool:(filter:(or:!(#{node_hostnames_query})))" index = ".operations.*" EXTERNAL_LOGGING_PATH % {:index => index, :query => query} end def disconnect_inv return if archived? _log.info("Disconnecting Node [#{name}] id [#{id}] from EMS [#{ext_management_system.name}]" \ "id [#{ext_management_system.id}] ") self.deleted_on = Time.now.utc save end end
{ "content_hash": "d22ccce7a011ca63f335b1ab7b4af102", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 294, "avg_line_length": 38.56410256410256, "alnum_prop": 0.6868351063829787, "repo_name": "agrare/manageiq", "id": "590eb4f80374a37cea6fc8f06bb3b0ee04de6c41", "size": "4512", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/models/container_node.rb", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "3042" }, { "name": "Dockerfile", "bytes": "839" }, { "name": "HTML", "bytes": "2167" }, { "name": "JavaScript", "bytes": "183" }, { "name": "Ruby", "bytes": "7779866" }, { "name": "Shell", "bytes": "22235" } ], "symlink_target": "" }
package action import( "fmt" "github.com/erzha/http/server" ) type IndexAction struct { base } func (action *IndexAction) DoGet(ctx context.Context, sapi *server.Sapi) { name := sapi.Get.Get("name") //if $name is dir -> show $dir/README.md //if $name is path -> show $file.md }
{ "content_hash": "b8ad1476b07808933181549f11b72422", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 74, "avg_line_length": 16.055555555555557, "alnum_prop": 0.671280276816609, "repo_name": "walu/unknown", "id": "578e5aca67d3bf36e45c790e70133cd22a1bbc12", "size": "289", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "action/index.go", "mode": "33188", "license": "mit", "language": [ { "name": "Go", "bytes": "1129" } ], "symlink_target": "" }
<?php declare(strict_types=1); namespace Cake\Database\Type; use Cake\Database\DriverInterface; use InvalidArgumentException; use PDO; /** * Bool type converter. * * Use to convert bool data between PHP and the database types. */ class BoolType extends BaseType implements BatchCastingInterface { /** * Convert bool data into the database format. * * @param mixed $value The value to convert. * @param \Cake\Database\DriverInterface $driver The driver instance to convert with. * @return bool|null */ public function toDatabase($value, DriverInterface $driver): ?bool { if ($value === true || $value === false || $value === null) { return $value; } if (in_array($value, [1, 0, '1', '0'], true)) { return (bool)$value; } throw new InvalidArgumentException(sprintf( 'Cannot convert value of type `%s` to bool', getTypeName($value) )); } /** * Convert bool values to PHP booleans * * @param mixed $value The value to convert. * @param \Cake\Database\DriverInterface $driver The driver instance to convert with. * @return bool|null */ public function toPHP($value, DriverInterface $driver): ?bool { if ($value === null || $value === true || $value === false) { return $value; } if (!is_numeric($value)) { return strtolower($value) === 'true'; } return !empty($value); } /** * {@inheritDoc} * * @return array */ public function manyToPHP(array $values, array $fields, DriverInterface $driver): array { foreach ($fields as $field) { if (!isset($values[$field]) || $values[$field] === true || $values[$field] === false) { continue; } if ($values[$field] === '1') { $values[$field] = true; continue; } if ($values[$field] === '0') { $values[$field] = false; continue; } $value = $values[$field]; if (!is_numeric($value)) { $values[$field] = strtolower($value) === 'true'; continue; } $values[$field] = !empty($value); } return $values; } /** * Get the correct PDO binding type for bool data. * * @param mixed $value The value being bound. * @param \Cake\Database\DriverInterface $driver The driver. * @return int */ public function toStatement($value, DriverInterface $driver): int { if ($value === null) { return PDO::PARAM_NULL; } return PDO::PARAM_BOOL; } /** * Marshalls request data into PHP booleans. * * @param mixed $value The value to convert. * @return bool|null Converted value. */ public function marshal($value): ?bool { if ($value === null || $value === '') { return null; } return filter_var($value, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE); } }
{ "content_hash": "ccb858d9063458d46c7ecc25bb089a81", "timestamp": "", "source": "github", "line_count": 125, "max_line_length": 99, "avg_line_length": 25.496, "alnum_prop": 0.527141512394101, "repo_name": "dakota/cakephp", "id": "4be77022657d4a35667e79666a3842509148fa4b", "size": "3772", "binary": false, "copies": "1", "ref": "refs/heads/4.x", "path": "src/Database/Type/BoolType.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "15730" }, { "name": "HTML", "bytes": "405" }, { "name": "Hack", "bytes": "752" }, { "name": "JavaScript", "bytes": "171" }, { "name": "Makefile", "bytes": "6407" }, { "name": "PHP", "bytes": "10180619" }, { "name": "Shell", "bytes": "723" } ], "symlink_target": "" }
SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
{ "content_hash": "891de054ccbbeaa481c7acab576c7bb4", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 39, "avg_line_length": 10.23076923076923, "alnum_prop": 0.6917293233082706, "repo_name": "mdoering/backbone", "id": "706733400801e8562c42cddc841c134e069cc6c7", "size": "184", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Liliopsida/Alismatales/Araceae/Anthurium/Anthurium urbanii/ Syn. Anthurium propinquum/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
<?php namespace Symfony\Component\DependencyInjection\Tests; use Symfony\Component\DependencyInjection\Definition; use Symfony\Component\DependencyInjection\ContainerInterface; class DefinitionTest extends \PHPUnit_Framework_TestCase { /** * @covers Symfony\Component\DependencyInjection\Definition::__construct */ public function testConstructor() { $def = new Definition('stdClass'); $this->assertEquals('stdClass', $def->getClass(), '__construct() takes the class name as its first argument'); $def = new Definition('stdClass', array('foo')); $this->assertEquals(array('foo'), $def->getArguments(), '__construct() takes an optional array of arguments as its second argument'); } /** * @covers Symfony\Component\DependencyInjection\Definition::setFactory * @covers Symfony\Component\DependencyInjection\Definition::getFactory */ public function testSetGetFactory() { $def = new Definition('stdClass'); $this->assertSame($def, $def->setFactory('foo'), '->setFactory() implements a fluent interface'); $this->assertEquals('foo', $def->getFactory(), '->getFactory() returns the factory'); $def->setFactory('Foo::bar'); $this->assertEquals(array('Foo', 'bar'), $def->getFactory(), '->setFactory() converts string static method call to the array'); } /** * @covers Symfony\Component\DependencyInjection\Definition::setClass * @covers Symfony\Component\DependencyInjection\Definition::getClass */ public function testSetGetClass() { $def = new Definition('stdClass'); $this->assertSame($def, $def->setClass('foo'), '->setClass() implements a fluent interface'); $this->assertEquals('foo', $def->getClass(), '->getClass() returns the class name'); } public function testSetGetDecoratedService() { $def = new Definition('stdClass'); $this->assertNull($def->getDecoratedService()); $def->setDecoratedService('foo', 'foo.renamed'); $this->assertEquals(array('foo', 'foo.renamed'), $def->getDecoratedService()); $def->setDecoratedService(null); $this->assertNull($def->getDecoratedService()); $def = new Definition('stdClass'); $def->setDecoratedService('foo'); $this->assertEquals(array('foo', null), $def->getDecoratedService()); $def->setDecoratedService(null); $this->assertNull($def->getDecoratedService()); $def = new Definition('stdClass'); $this->setExpectedException('InvalidArgumentException', 'The decorated service inner name for "foo" must be different than the service name itself.'); $def->setDecoratedService('foo', 'foo'); } /** * @covers Symfony\Component\DependencyInjection\Definition::setArguments * @covers Symfony\Component\DependencyInjection\Definition::getArguments * @covers Symfony\Component\DependencyInjection\Definition::addArgument */ public function testArguments() { $def = new Definition('stdClass'); $this->assertSame($def, $def->setArguments(array('foo')), '->setArguments() implements a fluent interface'); $this->assertEquals(array('foo'), $def->getArguments(), '->getArguments() returns the arguments'); $this->assertSame($def, $def->addArgument('bar'), '->addArgument() implements a fluent interface'); $this->assertEquals(array('foo', 'bar'), $def->getArguments(), '->addArgument() adds an argument'); } /** * @covers Symfony\Component\DependencyInjection\Definition::setMethodCalls * @covers Symfony\Component\DependencyInjection\Definition::addMethodCall * @covers Symfony\Component\DependencyInjection\Definition::hasMethodCall * @covers Symfony\Component\DependencyInjection\Definition::removeMethodCall */ public function testMethodCalls() { $def = new Definition('stdClass'); $this->assertSame($def, $def->setMethodCalls(array(array('foo', array('foo')))), '->setMethodCalls() implements a fluent interface'); $this->assertEquals(array(array('foo', array('foo'))), $def->getMethodCalls(), '->getMethodCalls() returns the methods to call'); $this->assertSame($def, $def->addMethodCall('bar', array('bar')), '->addMethodCall() implements a fluent interface'); $this->assertEquals(array(array('foo', array('foo')), array('bar', array('bar'))), $def->getMethodCalls(), '->addMethodCall() adds a method to call'); $this->assertTrue($def->hasMethodCall('bar'), '->hasMethodCall() returns true if first argument is a method to call registered'); $this->assertFalse($def->hasMethodCall('no_registered'), '->hasMethodCall() returns false if first argument is not a method to call registered'); $this->assertSame($def, $def->removeMethodCall('bar'), '->removeMethodCall() implements a fluent interface'); $this->assertEquals(array(array('foo', array('foo'))), $def->getMethodCalls(), '->removeMethodCall() removes a method to call'); } /** * @expectedException \Symfony\Component\DependencyInjection\Exception\InvalidArgumentException * @expectedExceptionMessage Method name cannot be empty. */ public function testExceptionOnEmptyMethodCall() { $def = new Definition('stdClass'); $def->addMethodCall(''); } /** * @covers Symfony\Component\DependencyInjection\Definition::setFile * @covers Symfony\Component\DependencyInjection\Definition::getFile */ public function testSetGetFile() { $def = new Definition('stdClass'); $this->assertSame($def, $def->setFile('foo'), '->setFile() implements a fluent interface'); $this->assertEquals('foo', $def->getFile(), '->getFile() returns the file to include'); } /** * @covers Symfony\Component\DependencyInjection\Definition::setShared * @covers Symfony\Component\DependencyInjection\Definition::isShared */ public function testSetIsShared() { $def = new Definition('stdClass'); $this->assertTrue($def->isShared(), '->isShared() returns true by default'); $this->assertSame($def, $def->setShared(false), '->setShared() implements a fluent interface'); $this->assertFalse($def->isShared(), '->isShared() returns false if the instance must not be shared'); } /** * @group legacy */ public function testPrototypeScopedDefinitionAreNotShared() { $def = new Definition('stdClass'); $def->setScope(ContainerInterface::SCOPE_PROTOTYPE); $this->assertFalse($def->isShared()); $this->assertEquals(ContainerInterface::SCOPE_PROTOTYPE, $def->getScope()); } /** * @covers Symfony\Component\DependencyInjection\Definition::setScope * @covers Symfony\Component\DependencyInjection\Definition::getScope * @group legacy */ public function testSetGetScope() { $def = new Definition('stdClass'); $this->assertEquals('container', $def->getScope()); $this->assertSame($def, $def->setScope('foo')); $this->assertEquals('foo', $def->getScope()); } /** * @covers Symfony\Component\DependencyInjection\Definition::setPublic * @covers Symfony\Component\DependencyInjection\Definition::isPublic */ public function testSetIsPublic() { $def = new Definition('stdClass'); $this->assertTrue($def->isPublic(), '->isPublic() returns true by default'); $this->assertSame($def, $def->setPublic(false), '->setPublic() implements a fluent interface'); $this->assertFalse($def->isPublic(), '->isPublic() returns false if the instance must not be public.'); } /** * @covers Symfony\Component\DependencyInjection\Definition::setSynthetic * @covers Symfony\Component\DependencyInjection\Definition::isSynthetic */ public function testSetIsSynthetic() { $def = new Definition('stdClass'); $this->assertFalse($def->isSynthetic(), '->isSynthetic() returns false by default'); $this->assertSame($def, $def->setSynthetic(true), '->setSynthetic() implements a fluent interface'); $this->assertTrue($def->isSynthetic(), '->isSynthetic() returns true if the service is synthetic.'); } /** * @covers Symfony\Component\DependencyInjection\Definition::setLazy * @covers Symfony\Component\DependencyInjection\Definition::isLazy */ public function testSetIsLazy() { $def = new Definition('stdClass'); $this->assertFalse($def->isLazy(), '->isLazy() returns false by default'); $this->assertSame($def, $def->setLazy(true), '->setLazy() implements a fluent interface'); $this->assertTrue($def->isLazy(), '->isLazy() returns true if the service is lazy.'); } /** * @covers Symfony\Component\DependencyInjection\Definition::setAbstract * @covers Symfony\Component\DependencyInjection\Definition::isAbstract */ public function testSetIsAbstract() { $def = new Definition('stdClass'); $this->assertFalse($def->isAbstract(), '->isAbstract() returns false by default'); $this->assertSame($def, $def->setAbstract(true), '->setAbstract() implements a fluent interface'); $this->assertTrue($def->isAbstract(), '->isAbstract() returns true if the instance must not be public.'); } /** * @covers Symfony\Component\DependencyInjection\Definition::setConfigurator * @covers Symfony\Component\DependencyInjection\Definition::getConfigurator */ public function testSetGetConfigurator() { $def = new Definition('stdClass'); $this->assertSame($def, $def->setConfigurator('foo'), '->setConfigurator() implements a fluent interface'); $this->assertEquals('foo', $def->getConfigurator(), '->getConfigurator() returns the configurator'); } /** * @covers Symfony\Component\DependencyInjection\Definition::clearTags */ public function testClearTags() { $def = new Definition('stdClass'); $this->assertSame($def, $def->clearTags(), '->clearTags() implements a fluent interface'); $def->addTag('foo', array('foo' => 'bar')); $def->clearTags(); $this->assertEquals(array(), $def->getTags(), '->clearTags() removes all current tags'); } /** * @covers Symfony\Component\DependencyInjection\Definition::clearTags */ public function testClearTag() { $def = new Definition('stdClass'); $this->assertSame($def, $def->clearTags(), '->clearTags() implements a fluent interface'); $def->addTag('1foo1', array('foo1' => 'bar1')); $def->addTag('2foo2', array('foo2' => 'bar2')); $def->addTag('3foo3', array('foo3' => 'bar3')); $def->clearTag('2foo2'); $this->assertTrue($def->hasTag('1foo1')); $this->assertFalse($def->hasTag('2foo2')); $this->assertTrue($def->hasTag('3foo3')); $def->clearTag('1foo1'); $this->assertFalse($def->hasTag('1foo1')); $this->assertTrue($def->hasTag('3foo3')); } /** * @covers Symfony\Component\DependencyInjection\Definition::addTag * @covers Symfony\Component\DependencyInjection\Definition::getTag * @covers Symfony\Component\DependencyInjection\Definition::getTags * @covers Symfony\Component\DependencyInjection\Definition::hasTag */ public function testTags() { $def = new Definition('stdClass'); $this->assertEquals(array(), $def->getTag('foo'), '->getTag() returns an empty array if the tag is not defined'); $this->assertFalse($def->hasTag('foo')); $this->assertSame($def, $def->addTag('foo'), '->addTag() implements a fluent interface'); $this->assertTrue($def->hasTag('foo')); $this->assertEquals(array(array()), $def->getTag('foo'), '->getTag() returns attributes for a tag name'); $def->addTag('foo', array('foo' => 'bar')); $this->assertEquals(array(array(), array('foo' => 'bar')), $def->getTag('foo'), '->addTag() can adds the same tag several times'); $def->addTag('bar', array('bar' => 'bar')); $this->assertEquals($def->getTags(), array( 'foo' => array(array(), array('foo' => 'bar')), 'bar' => array(array('bar' => 'bar')), ), '->getTags() returns all tags'); } /** * @covers Symfony\Component\DependencyInjection\Definition::replaceArgument */ public function testSetArgument() { $def = new Definition('stdClass'); $def->addArgument('foo'); $this->assertSame(array('foo'), $def->getArguments()); $this->assertSame($def, $def->replaceArgument(0, 'moo')); $this->assertSame(array('moo'), $def->getArguments()); $def->addArgument('moo'); $def ->replaceArgument(0, 'foo') ->replaceArgument(1, 'bar') ; $this->assertSame(array('foo', 'bar'), $def->getArguments()); } /** * @expectedException \OutOfBoundsException */ public function testGetArgumentShouldCheckBounds() { $def = new Definition('stdClass'); $def->addArgument('foo'); $def->getArgument(1); } /** * @expectedException \OutOfBoundsException */ public function testReplaceArgumentShouldCheckBounds() { $def = new Definition('stdClass'); $def->addArgument('foo'); $def->replaceArgument(1, 'bar'); } public function testSetGetProperties() { $def = new Definition('stdClass'); $this->assertEquals(array(), $def->getProperties()); $this->assertSame($def, $def->setProperties(array('foo' => 'bar'))); $this->assertEquals(array('foo' => 'bar'), $def->getProperties()); } public function testSetProperty() { $def = new Definition('stdClass'); $this->assertEquals(array(), $def->getProperties()); $this->assertSame($def, $def->setProperty('foo', 'bar')); $this->assertEquals(array('foo' => 'bar'), $def->getProperties()); } }
{ "content_hash": "1bbbe40c70464de854961bcfdef11a3a", "timestamp": "", "source": "github", "line_count": 334, "max_line_length": 158, "avg_line_length": 42.47305389221557, "alnum_prop": 0.6384463555618215, "repo_name": "Nicofuma/symfony", "id": "90a6f1580ec1db047eee3a109b1437710ed9bbc2", "size": "14415", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "src/Symfony/Component/DependencyInjection/Tests/DefinitionTest.php", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "8656" }, { "name": "CSS", "bytes": "10309" }, { "name": "HTML", "bytes": "259495" }, { "name": "PHP", "bytes": "11274540" }, { "name": "PLSQL", "bytes": "7498" }, { "name": "Shell", "bytes": "1593" }, { "name": "TypeScript", "bytes": "195" } ], "symlink_target": "" }
namespace Google.Cloud.GkeBackup.V1.Snippets { // [START gkebackup_v1_generated_BackupForGKE_GetVolumeRestore_async_flattened] using Google.Cloud.GkeBackup.V1; using System.Threading.Tasks; public sealed partial class GeneratedBackupForGKEClientSnippets { /// <summary>Snippet for GetVolumeRestoreAsync</summary> /// <remarks> /// This snippet has been automatically generated and should be regarded as a code template only. /// It will require modifications to work: /// - It may require correct/in-range values for request initialization. /// - It may require specifying regional endpoints when creating the service client as shown in /// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint. /// </remarks> public async Task GetVolumeRestoreAsync() { // Create client BackupForGKEClient backupForGKEClient = await BackupForGKEClient.CreateAsync(); // Initialize request argument(s) string name = "projects/[PROJECT]/locations/[LOCATION]/restorePlans/[RESTORE_PLAN]/restores/[RESTORE]/volumeRestores/[VOLUME_RESTORE]"; // Make the request VolumeRestore response = await backupForGKEClient.GetVolumeRestoreAsync(name); } } // [END gkebackup_v1_generated_BackupForGKE_GetVolumeRestore_async_flattened] }
{ "content_hash": "d73fc89370baa85f9579519d1ee939c4", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 147, "avg_line_length": 50.857142857142854, "alnum_prop": 0.6924157303370787, "repo_name": "googleapis/google-cloud-dotnet", "id": "74ca552c96b2a5e59cb12b97d0572ec580f9bcbc", "size": "2046", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "apis/Google.Cloud.GkeBackup.V1/Google.Cloud.GkeBackup.V1.GeneratedSnippets/BackupForGKEClient.GetVolumeRestoreAsyncSnippet.g.cs", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "767" }, { "name": "C#", "bytes": "319820004" }, { "name": "Dockerfile", "bytes": "3415" }, { "name": "PowerShell", "bytes": "3303" }, { "name": "Python", "bytes": "2744" }, { "name": "Shell", "bytes": "65881" } ], "symlink_target": "" }
package com.doplgangr.secrecy.fragments; import android.app.Activity; import android.app.AlertDialog; import android.app.ProgressDialog; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.SharedPreferences; import android.content.pm.PackageManager; import android.content.res.Resources; import android.net.Uri; import android.os.Bundle; import android.preference.CheckBoxPreference; import android.preference.Preference; import android.preference.PreferenceFragment; import android.preference.PreferenceGroup; import android.preference.PreferenceManager; import android.support.v4.content.IntentCompat; import android.support.v7.app.ActionBarActivity; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.EditText; import android.widget.TextView; import android.widget.Toast; import com.doplgangr.secrecy.Config; import com.doplgangr.secrecy.CustomApp; import com.doplgangr.secrecy.R; import com.doplgangr.secrecy.utils.Util; import com.doplgangr.secrecy.filesystem.Storage; import com.doplgangr.secrecy.premium.PremiumStateHelper; import com.doplgangr.secrecy.premium.StealthMode; import com.doplgangr.secrecy.adapters.VaultsListFragment; import com.ipaulpro.afilechooser.FileChooserActivity; import com.ipaulpro.afilechooser.utils.FileUtils; import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.Map; public class SettingsFragment extends PreferenceFragment { private static final int REQUEST_CODE_SET_VAULT_ROOT = 6384; private static final int REQUEST_CODE_MOVE_VAULT = 2058; private Context context; private VaultsListFragment.OnFragmentFinishListener mFinishListener; private static final ArrayList<String> INCLUDE_EXTENSIONS_LIST = new ArrayList<>(); static { INCLUDE_EXTENSIONS_LIST.add("."); } private String stealth_mode_message; private String[] creditsNames; private String[] creditsDescription; private String[] creditsLinks; private String[] contributorNames; private String[] contributorDescription; private String[] contributorLinks; private String libraries; @Override public void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); addPreferencesFromResource(R.xml.preferences); this.context = getActivity(); Resources res = getResources(); stealth_mode_message = getString(R.string.Settings__stealth_mode_message); creditsNames = res.getStringArray(R.array.Credits__names); creditsDescription = res.getStringArray(R.array.Credits__description); creditsLinks = res.getStringArray(R.array.Credits__links); contributorNames = res.getStringArray(R.array.Contributor__names); contributorDescription = res.getStringArray(R.array.Contributor__description); contributorLinks = res.getStringArray(R.array.Contributor__links); libraries = getString(R.string.Settings__libraries_message); preparePreferenceStealthMode(); preparePreferenceStealthModePassword(); preparePreferenceMaxImageSize(); preparePreferenceVaultRoot(); preparePreferenceVaultMove(); preparePreferenceCreditList(); preparePreferenceTranslatorsList(); preparePreferenceVersion(); preparePreferenceLegal(); } private void preparePreferenceStealthMode(){ final CheckBoxPreference stealth_mode = (CheckBoxPreference) findPreference(Config.STEALTH_MODE); stealth_mode.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() { @Override public boolean onPreferenceChange(Preference preference, Object o) { SharedPreferences.Editor editor = PreferenceManager.getDefaultSharedPreferences(getActivity()).edit(); if (!(Boolean) o) { StealthMode.showApp(context); editor.putBoolean(Config.STEALTH_MODE, (Boolean) o); editor.putString(Config.STEALTH_MODE_PASSWORD, ""); editor.apply(); } else { editor.putBoolean(Config.STEALTH_MODE, (Boolean) o); editor.apply(); } return true; } }); } private void preparePreferenceStealthModePassword(){ final Preference stealth_mode_password = findPreference(Config.STEALTH_MODE_PASSWORD); String openPin = PreferenceManager.getDefaultSharedPreferences(context) .getString(Config.STEALTH_MODE_PASSWORD, ""); if (!openPin.equals("")) { stealth_mode_password.setSummary("*# " + openPin); } PremiumStateHelper.PremiumListener mPremiumListener = new PremiumStateHelper.PremiumListener() { @Override public void isPremium() { stealth_mode_password.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() { @Override public boolean onPreferenceClick(Preference preference) { if (!context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_TELEPHONY)) { Util.alert(context, getString(R.string.Stealth__no_telephony), getString(R.string.Stealth__no_telephony_message), Util.emptyClickListener, null); return true; } final View dialogView = View.inflate(context, R.layout.dialog_stealth, null); new AlertDialog.Builder(context) .setMessage(context.getString(R.string.Settings__stealth_explanation)) .setView(dialogView) .setInverseBackgroundForced(true) .setPositiveButton(getString(R.string.OK), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { String password = ((EditText) dialogView. findViewById(R.id.stealth_keycode)) .getText().toString(); SharedPreferences.Editor editor = PreferenceManager.getDefaultSharedPreferences(context).edit(); editor.putString(Config.STEALTH_MODE_PASSWORD, password); editor.apply(); confirm_stealth(password); } }) .setNegativeButton(getString(R.string.CANCEL), Util.emptyClickListener) .show(); return true; } }); } @Override public void notPremium() { stealth_mode_password.setSummary(stealth_mode_message + " " + context.getString(R.string.Settings__only_permium)); stealth_mode_password.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() { @Override public boolean onPreferenceClick(Preference preference) { mFinishListener.onNew(null, new PremiumFragment()); //Switch fragment to donation return true; } }); } }; new PremiumStateHelper(getActivity(), mPremiumListener); } private void preparePreferenceMaxImageSize(){ Preference image_size = findPreference(Config.IMAGE_SIZE); image_size.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() { @Override public boolean onPreferenceChange(Preference preference, Object o) { Util.loadSelectedImageSize((String) o); return true; } }); } private void preparePreferenceVaultRoot(){ Preference vault_root = findPreference("vault_root"); vault_root.setSummary(Storage.getRoot().getAbsolutePath()); vault_root.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() { @Override public boolean onPreferenceClick(Preference preference) { choosePath(new getFileListener() { @Override public void get(File file) { Intent intent = new Intent(context, FileChooserActivity.class); intent.putStringArrayListExtra( FileChooserActivity.EXTRA_FILTER_INCLUDE_EXTENSIONS, INCLUDE_EXTENSIONS_LIST); intent.putExtra(FileChooserActivity.PATH, file.getAbsolutePath()); intent.putExtra(FileChooserActivity.EXTRA_SELECT_FOLDER, true); startActivityForResult(intent, REQUEST_CODE_SET_VAULT_ROOT); } }); return true; } }); } private void preparePreferenceVaultMove(){ Preference vault_move = findPreference("vault_move"); vault_move.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() { @Override public boolean onPreferenceClick(Preference preference) { choosePath(new getFileListener() { @Override public void get(File file) { Intent intent = new Intent(context, FileChooserActivity.class); intent.putStringArrayListExtra( FileChooserActivity.EXTRA_FILTER_INCLUDE_EXTENSIONS, INCLUDE_EXTENSIONS_LIST); intent.putExtra(FileChooserActivity.PATH, file.getAbsolutePath()); intent.putExtra(FileChooserActivity.EXTRA_SELECT_FOLDER, true); startActivityForResult(intent, REQUEST_CODE_MOVE_VAULT); } }); return true; } }); } private void preparePreferenceCreditList(){ PreferenceGroup creditsList = (PreferenceGroup) findPreference("credits_list"); for (int i = 0; i < creditsNames.length; i++) { Preference newPreference = new Preference(context); newPreference.setTitle(creditsNames[i]); newPreference.setSummary(creditsDescription[i]); final int finali = i; newPreference.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() { @Override public boolean onPreferenceClick(Preference preference) { Uri uri = Uri.parse(creditsLinks[finali]); Intent intent = new Intent(Intent.ACTION_VIEW, uri); startActivity(intent); return true; } }); creditsList.addPreference(newPreference); } } private void preparePreferenceTranslatorsList(){ PreferenceGroup translatorList = (PreferenceGroup) findPreference("translators_list"); for (int i = 0; i < contributorNames.length; i++) { Preference newPreference = new Preference(context); newPreference.setTitle(contributorNames[i]); newPreference.setSummary(contributorDescription[i]); final int finali = i; newPreference.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() { @Override public boolean onPreferenceClick(Preference preference) { Uri uri = Uri.parse(contributorLinks[finali]); Intent intent = new Intent(Intent.ACTION_VIEW, uri); startActivity(intent); return true; } }); translatorList.addPreference(newPreference); } } private void preparePreferenceVersion(){ Preference version = findPreference("version"); version.setSummary(CustomApp.VERSIONNAME); } private void preparePreferenceLegal(){ Preference dialogPreference = getPreferenceScreen().findPreference("legal"); dialogPreference.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() { public boolean onPreferenceClick(Preference preference) { Util.alert(context, null, libraries, Util.emptyClickListener, null); return true; } }); } private void confirm_stealth(String password) { final View dialogView = View.inflate(context, R.layout.dialog_confirm_stealth, null); ((TextView) dialogView .findViewById(R.id.stealth_keycode)) .append(password); new AlertDialog.Builder(context) .setInverseBackgroundForced(true) .setView(dialogView) .setMessage(R.string.Settings__try_once_before_hide) .setPositiveButton(getString(R.string.OK), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { SharedPreferences.Editor editor = PreferenceManager.getDefaultSharedPreferences(context).edit(); editor.putBoolean(Config.SHOW_STEALTH_MODE_TUTORIAL, true); editor.apply(); Intent dial = new Intent(); dial.setAction("android.intent.action.DIAL"); dial.setData(Uri.parse("tel:")); dial.setFlags(IntentCompat.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(dial); getActivity().finish(); } }) .show(); } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ((ActionBarActivity) getActivity()).getSupportActionBar() .setTitle(R.string.Page_header__settings); return inflater.inflate(R.layout.activity_settings, container, false); } @Override public void onAttach(Activity activity) { super.onAttach(activity); try { mFinishListener = (VaultsListFragment.OnFragmentFinishListener) activity; } catch (ClassCastException e) { throw new ClassCastException(activity.toString() + " must implement Listener"); } } @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { switch (requestCode) { case REQUEST_CODE_SET_VAULT_ROOT: // If the file selection was successful if (resultCode == Activity.RESULT_OK) { if (data != null) { // Get the URI of the selected file final Uri uri = data.getData(); try { // Get the file path from the URI final String path = FileUtils.getPath(context, uri); Storage.setRoot(path); Preference vault_root = findPreference(Config.VAULT_ROOT); vault_root.setSummary(Storage.getRoot().getAbsolutePath()); } catch (Exception e) { Log.e("SettingsFragment", "File select error", e); } } } break; case REQUEST_CODE_MOVE_VAULT: if (resultCode == Activity.RESULT_OK) { if (data != null) { // Get the URI of the selected file final Uri uri = data.getData(); try { // Get the file path from the URI final String path = FileUtils.getPath(context, uri); if (path.contains(Storage.getRoot().getAbsolutePath())) { Util.alert(context, getString(R.string.Settings__cannot_move_vault), getString(R.string.Settings__cannot_move_vault_message), Util.emptyClickListener, null); break; } Util.alert(context,getString(R.string.Settings__move_vault), String.format(getString(R.string.move_message), Storage.getRoot().getAbsolutePath(), path), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { String[] children = new File(path).list(); if (children.length == 0) { final ProgressDialog progressDialog = ProgressDialog.show(context, null, context.getString(R.string.Settings__moving_vault), true); new Thread(new Runnable() { public void run() { moveStorageRoot(path, progressDialog); } }).start(); } else Util.alert(context, getString(R.string.Error__files_exist), getString(R.string.Error__files_exist_message), Util.emptyClickListener, null ); } }, Util.emptyClickListener ); } catch (Exception e) { Log.e("SettingsFragment", "File select error", e); } } } break; } super.onActivityResult(requestCode, resultCode, data); } void moveStorageRoot(String path, ProgressDialog progressDialog) { File oldRoot = Storage.getRoot(); try { org.apache.commons.io.FileUtils.copyDirectory(oldRoot, new File(path)); Storage.setRoot(path); Preference vault_root = findPreference(Config.VAULT_ROOT); vault_root.setSummary(Storage.getRoot().getAbsolutePath()); Util.toast(getActivity(), String.format(getString(R.string.Settings__moved_vault), path), Toast.LENGTH_LONG); } catch (Exception E) { Util.alert(context, context.getString(R.string.Error__moving_vault), context.getString(R.string.Error__moving_vault_message), Util.emptyClickListener, null); progressDialog.dismiss(); return; } try { org.apache.commons.io.FileUtils.deleteDirectory(oldRoot); } catch (IOException ignored) { //ignore } progressDialog.dismiss(); } void choosePath(final getFileListener listener) { AlertDialog.Builder builderSingle = new AlertDialog.Builder(context); builderSingle.setTitle(context.getString(R.string.Settings__select_storage_title)); final ArrayAdapter<String> arrayAdapter = new ArrayAdapter<String>( context, R.layout.select_dialog_singlechoice); final Map<String, File> storages = Util.getAllStorageLocations(); for (String key : storages.keySet()) { arrayAdapter.add(key); } builderSingle.setNegativeButton(R.string.CANCEL, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); } } ); builderSingle.setAdapter(arrayAdapter, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { String strName = arrayAdapter.getItem(which); File file = storages.get(strName); listener.get(file); } } ); builderSingle.show(); } public interface getFileListener { void get(File file); } }
{ "content_hash": "1fd5718897e12363c270381ef12a8f61", "timestamp": "", "source": "github", "line_count": 472, "max_line_length": 127, "avg_line_length": 46.61864406779661, "alnum_prop": 0.5486729685511725, "repo_name": "L-Henke/secrecy", "id": "bf9b5ff7d65bc3e6d4710ff6e098330887ce2487", "size": "22811", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/src/main/java/com/doplgangr/secrecy/fragments/SettingsFragment.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "477607" }, { "name": "Protocol Buffer", "bytes": "384" } ], "symlink_target": "" }
package eu.verdelhan.ta4j.analysis.criteria; import eu.verdelhan.ta4j.AnalysisCriterion; import eu.verdelhan.ta4j.Order; import eu.verdelhan.ta4j.TATestsUtils; import eu.verdelhan.ta4j.Trade; import eu.verdelhan.ta4j.TradingRecord; import eu.verdelhan.ta4j.mocks.MockTimeSeries; import static org.junit.Assert.*; import org.junit.Test; public class NumberOfTicksCriterionTest { @Test public void calculateWithNoTrades() { MockTimeSeries series = new MockTimeSeries(100, 105, 110, 100, 95, 105); AnalysisCriterion numberOfTicks = new NumberOfTicksCriterion(); assertEquals(0, (int) numberOfTicks.calculate(series, new TradingRecord())); } @Test public void calculateWithTwoTrades() { MockTimeSeries series = new MockTimeSeries(100, 105, 110, 100, 95, 105); TradingRecord tradingRecord = new TradingRecord( Order.buyAt(0), Order.sellAt(2), Order.buyAt(3), Order.sellAt(5)); AnalysisCriterion numberOfTicks = new NumberOfTicksCriterion(); assertEquals(6, numberOfTicks.calculate(series, tradingRecord), TATestsUtils.TA_OFFSET); } @Test public void calculateWithOneTrade() { MockTimeSeries series = new MockTimeSeries(100, 95, 100, 80, 85, 70); Trade t = new Trade(Order.buyAt(2), Order.sellAt(5)); AnalysisCriterion numberOfTicks = new NumberOfTicksCriterion(); assertEquals(4, numberOfTicks.calculate(series, t), TATestsUtils.TA_OFFSET); } @Test public void betterThan() { AnalysisCriterion criterion = new NumberOfTicksCriterion(); assertTrue(criterion.betterThan(3, 6)); assertFalse(criterion.betterThan(6, 2)); } }
{ "content_hash": "19458f5b8ced3bd629c3e5ebd5af717e", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 96, "avg_line_length": 35.770833333333336, "alnum_prop": 0.7018054746651136, "repo_name": "troestergmbh/ta4j", "id": "133ee5c6c683b10f66d0e2e8c859dcf31fa27ceb", "size": "2904", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "ta4j/src/test/java/eu/verdelhan/ta4j/analysis/criteria/NumberOfTicksCriterionTest.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "676167" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>cfml-stdlib: Not compatible 👼</title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.6.1 / cfml-stdlib - 20220112</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> cfml-stdlib <small> 20220112 <span class="label label-info">Not compatible 👼</span> </small> </h1> <p>📅 <em><script>document.write(moment("2022-10-26 02:16:09 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-10-26 02:16:09 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-num base Num library distributed with the OCaml compiler base-ocamlbuild base OCamlbuild binary and libraries distributed with the OCaml compiler base-threads base base-unix base camlp5 7.14 Preprocessor-pretty-printer of OCaml conf-findutils 1 Virtual package relying on findutils conf-perl 2 Virtual package relying on perl coq 8.6.1 Formal proof management system num 0 The Num library for arbitrary-precision integer and rational arithmetic ocaml 4.02.3 The OCaml compiler (virtual package) ocaml-base-compiler 4.02.3 Official 4.02.3 release ocaml-config 1 OCaml Switch Configuration ocamlfind 1.9.5 A library manager for OCaml # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;arthur.chargueraud@inria.fr&quot; homepage: &quot;https://gitlab.inria.fr/charguer/cfml2&quot; dev-repo: &quot;git+https://gitlab.inria.fr/charguer/cfml2.git&quot; bug-reports: &quot;https://gitlab.inria.fr/charguer/cfml2/-/issues&quot; license: &quot;CC-BY-4.0&quot; synopsis: &quot;The CFML standard library&quot; description: &quot;&quot;&quot; CFML is a program verification system for OCaml. &quot;&quot;&quot; build: [make &quot;-C&quot; &quot;lib/stdlib&quot; &quot;-j%{jobs}%&quot;] install: [make &quot;-C&quot; &quot;lib/stdlib&quot; &quot;install&quot;] depends: [ &quot;coq&quot; { &gt;= &quot;8.13&quot; } &quot;cfml&quot; { = version } &quot;coq-cfml-basis&quot; { = version } ] tags: [ &quot;date:&quot; &quot;logpath:CFML.Stdlib&quot; &quot;category:Computer Science/Programming Languages/Formal Definitions and Theory&quot; &quot;keyword:program verification&quot; &quot;keyword:separation logic&quot; &quot;keyword:weakest precondition&quot; ] authors: [ &quot;Arthur Charguéraud&quot; ] url { src: &quot;https://gitlab.inria.fr/charguer/cfml2/-/archive/20220112/archive.tar.gz&quot; checksum: [ &quot;md5=4bd2f2c9e59a5ba2894aed81c766ef09&quot; &quot;sha512=08778c62243ffe8646377d8e00a7bae3e5a4ee52e6e37410a1e86f39a869f9e07c486df18ae50ba334898e6946355dbb9064aebbfaa89f536ce2672cbe93ae25&quot; ] } </pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install 🏜️</h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-cfml-stdlib.20220112 coq.8.6.1</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.6.1). The following dependencies couldn&#39;t be met: - coq-cfml-stdlib -&gt; cfml &gt;= 20220112 -&gt; ocaml &gt;= 4.08.0 base of this switch (use `--unlock-base&#39; to force) No solution found, exiting </pre></dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-cfml-stdlib.20220112</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Install 🚀</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Installation size</h2> <p>No files were installed.</p> <h2>Uninstall 🧹</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣 </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
{ "content_hash": "f0c382846a16c80b823138a3d2c8835f", "timestamp": "", "source": "github", "line_count": 178, "max_line_length": 159, "avg_line_length": 40.848314606741575, "alnum_prop": 0.5528813093109614, "repo_name": "coq-bench/coq-bench.github.io", "id": "11e0d5ea6bb87a05167aea31f5804593e63ffded", "size": "7297", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "clean/Linux-x86_64-4.02.3-2.0.6/released/8.6.1/cfml-stdlib/20220112.html", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
from model import Tower from utils import model_property import tensorflow as tf import tensorflow.contrib.slim as slim import utils as digits class UserModel(Tower): @model_property def inference(self): _x = tf.reshape(self.x, shape=[-1, self.input_shape[0], self.input_shape[1], self.input_shape[2]]) # tf.image_summary(_x.op.name, _x, max_images=10, collections=[digits.GraphKeys.SUMMARIES_TRAIN]) # Split out the color channels _, model_g, model_b = tf.split(_x, 3, 3, name='split_channels') # tf.image_summary(model_g.op.name, model_g, max_images=10, collections=[digits.GraphKeys.SUMMARIES_TRAIN]) # tf.image_summary(model_b.op.name, model_b, max_images=10, collections=[digits.GraphKeys.SUMMARIES_TRAIN]) with slim.arg_scope([slim.conv2d, slim.fully_connected], weights_initializer=tf.contrib.layers.xavier_initializer(), weights_regularizer=slim.l2_regularizer(0.0005)): with tf.variable_scope("siamese") as scope: def make_tower(net): net = slim.conv2d(net, 20, [5, 5], padding='VALID', scope='conv1') net = slim.max_pool2d(net, [2, 2], padding='VALID', scope='pool1') net = slim.conv2d(net, 50, [5, 5], padding='VALID', scope='conv2') net = slim.max_pool2d(net, [2, 2], padding='VALID', scope='pool2') net = slim.flatten(net) net = slim.fully_connected(net, 500, scope='fc1') net = slim.fully_connected(net, 2, activation_fn=None, scope='fc2') return net model_g = make_tower(model_g) model_g = tf.reshape(model_g, shape=[-1, 2]) scope.reuse_variables() model_b = make_tower(model_b) model_b = tf.reshape(model_b, shape=[-1, 2]) return [model_g, model_b] @model_property def loss(self): _y = tf.reshape(self.y, shape=[-1]) _y = tf.to_float(_y) model = self.inference return digits.constrastive_loss(model[0], model[1], _y)
{ "content_hash": "113ce4f9edc5b137a84756ad47164f7f", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 115, "avg_line_length": 46.48936170212766, "alnum_prop": 0.5711670480549199, "repo_name": "ethantang95/DIGITS", "id": "fe98d7249e361dde6c45015fed0e40e31edf980a", "size": "2185", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "examples/siamese/siamese-TF.py", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "CSS", "bytes": "4386" }, { "name": "HTML", "bytes": "2638345" }, { "name": "JavaScript", "bytes": "53917" }, { "name": "Lua", "bytes": "110602" }, { "name": "Makefile", "bytes": "113" }, { "name": "Protocol Buffer", "bytes": "1750" }, { "name": "Python", "bytes": "1230584" }, { "name": "Shell", "bytes": "13547" } ], "symlink_target": "" }
<script> //if (viewportWidth > 768) { equalheight = function(container){ var currentTallest = 0, currentRowStart = 0, rowDivs = new Array(), $el, topPosition = 0; $(container).each(function() { $el = $(this); $($el).height('auto') topPostion = $el.position().top; if (currentRowStart != topPostion) { for (currentDiv = 0 ; currentDiv < rowDivs.length ; currentDiv++) { rowDivs[currentDiv].height(currentTallest); } rowDivs.length = 0; // empty the array currentRowStart = topPostion; currentTallest = $el.height(); rowDivs.push($el); } else { rowDivs.push($el); currentTallest = (currentTallest < $el.height()) ? ($el.height()) : (currentTallest); } for (currentDiv = 0 ; currentDiv < rowDivs.length ; currentDiv++) { rowDivs[currentDiv].height(currentTallest); } }); } $(window).load(function() { equalheight('.homepage-oneslot-carousel div'); }); $(window).resize(function(){ equalheight('.homepage-oneslot-carousel div'); }); //} </script> <style type="text/css"> #fullbleed-video{-moz-transform:none!important;-webkit-transform:none!important;transform:none!important;} #fullbleed-outer-wrap-hp-2 article.lp-text { bottom: 50px; left: 5%; position: absolute; width: 90%; z-index: 498; } @media only screen and (max-width: 1023px){.red-price-new{display: block;}} .fullbleed-video-outer .video-icons-play, .fullbleed-video-outer .play-button { display: none; } </style> <script> $('.bxslider').bxSlider({ mode: 'fade', captions: true, pagerCustom: '#bx-pager', adaptiveHeight: true, slideWidth: 150 }); </script> <div id="main" role="main" class="clearfix"> <? //$this->load->view('includes/hotjar');?> <div class="home-landing"> <div class="content-slot"> <div data-slotid="homepage-slot1" class="full-bleed-slot"> <section class="cover-fullbleed " data-stellar-background-ratio="0.5" data-stellar-vertical-offset="250" style="background: url('<?=base_url()?>images/home/midnight-rock/w27-hp-midnight-rockk.jpg') 0px -122px / cover no-repeat fixed #fff;z-index:1;"> <article class="lp-text"> <h1>NEW IN - Give me That Midnight Rock</h1> <p class=""> The New Essentials For Your Wardrobe Are Here </p> <span class="link-area"> <a class="button-links" href="<?=base_url()?>man/new-apparel">Shop for him</a> <a class="button-links" href="<?=base_url()?>woman/new-apparel">Shop for her</a> </span> </article> <span class="anchor-icon"></span> </section> </div> </div> <?php if(!empty($landing_products)):?> <div class="content-slot"> <div class="in-page-product clearfix "> <div class=" hp-product-slider"> <?php foreach($landing_products as $curr_product): /*echo "<pre>"; print_r($curr_product); echo "<pre>";*/ $cat = ''; if($curr_product['L2'] == 'man'): $cat = 'men'; elseif($curr_product['L2'] == 'woman'): $cat = 'women'; endif; // product url: if($curr_product['L4'] == 'denim'){ $prod_cat = $curr_product['L5']; }else{ $prod_cat = $curr_product['L4']; } $url = base_url().'shop/details/'.$prod_cat.'/'.clean_string($curr_product['disp_name']).'/'.$curr_product['style'].'/'.$curr_product['color']; /*if(!empty($curr_product['prod_images'])){ $image_path = get_image_path($curr_product['prod_images']['image_path'],$curr_product['style']); }else{ $image_path = base_url().'images/sublisting/prod_no_image.jpg'; }*/ $image_path = get_prod_img($curr_product['prod_images']['image_path'],'detail');; /*$img_name_old = $curr_product['prod_images']['image_path']; $img_name= substr($img_name_old, 0, -5); $image_path1 = get_prod_img($img_name,'detail'); if(is_url_exist($image_path1.'F.jpg')){ $image_path = get_prod_img($img_name.'F.jpg','detail'); }else if(is_url_exist($image_path1.'D.jpg')){ $image_path = get_prod_img($img_name.'D.jpg','detail'); }else if(is_url_exist($image_path1.'D.jpg')){ $image_path = get_prod_img($img_name.'D.jpg','detail'); }else if(is_url_exist($image_path1.'E.jpg')){ $image_path = get_prod_img($img_name.'E.jpg','detail'); }else if(is_url_exist($image_path1.'R.jpg')){ $image_path = get_prod_img($img_name.'R.jpg','detail'); }else if(is_url_exist($image_path1.'A.jpg')){ $image_path = get_prod_img($img_name.'A.jpg','detail'); }else if(is_url_exist($image_path1.'O.jpg')){ $image_path = get_prod_img($img_name.'O.jpg','detail'); }else if(is_url_exist($image_path1.'B.jpg')){ $image_path = get_prod_img($img_name.'B.jpg','detail'); }else{ $image_path = base_url().'images/sublisting/prod_no_image.jpg'; }*/ ?> <div class="panel col-lg-6 col-md-6"> <div class="homepage-oneslot-carousel"> <div class="image-sec col-lg-5 col-lg-push-1 col-md-5 col-md-push-1 col-sm-5"> <a href="<?=$url;?>"><img itemprop="image" class="primary-image" data-altimg="<?=$image_path;?>" src="<?=$image_path;?>" alt="<?=$curr_product['disp_name'];?>" /></a> </div> <div class="content-sec col-lg-5 col-lg-push-1 col-md-5 col-md-push-1 col-sm-5"> <div class="content-sec-inner"> <div class="middle"> <h5 class="gender-crousel"><?=$cat?> </h5> <h5><a href="<?=$url;?>"><?=$curr_product['disp_name'];?></a></h5> <div class="pricing"> <div class="product-price"> <span class='price-sales' style='color:#000;'><?php if($curr_product['max_price_sale'] != '' && $curr_product['max_price_sale'] != '0' && $curr_product['max_price_sale'] < $curr_product['max_price']) { echo "<span style='padding-right:3px; text-decoration: line-through; color:#000;'>$ ".$curr_product['max_price']."</span> <span style='color:#d0021b;' class='red-price-new'>$ ".$curr_product['max_price_sale']; } else { echo '$ '.$curr_product['max_price'].'</span>'; } ?> </span> </div> </div> <a class="button-theme" href="<?=$url;?>">shop</a> </div> </div> </div> <!-- Ecommerce tracking code --> <? $seo_category = strtolower($prod_cat); $seo_gender = strtolower($curr_product['L2']); //echo "Category : ".$seo_category." Gender: ".$seo_gender; if(ENVIRONMENT == 'production'){ ?> <script type="text/javascript"> ga('ec:addImpression', { 'id': '<?php echo $curr_product['sku_idx']; ?>', // Product details are provided in an impressionFieldObject. 'name': '<?php echo $curr_product['disp_name'];?>', 'category': '<?php echo check_product_brand($seo_category,$seo_gender);?>', 'brand': '<?php echo $curr_product['style'];?>', 'variant': '<?php echo $curr_product['color'];?>', 'list': 'Homepage', //'position': 1 // 'position' indicates the product position in the list. }); ga('dieselitaly.ec:addImpression', { 'id': '<?php echo $curr_product['sku_idx']; ?>', // Product details are provided in an impressionFieldObject. 'name': '<?php echo $curr_product['disp_name'];?>', 'category': '<?php echo check_product_brand($seo_category,$seo_gender);?>', 'brand': '<?php echo $curr_product['style'];?>', 'variant': '<?php echo $curr_product['color'];?>', 'list': 'Homepage', //'position': 1 // 'position' indicates the product position in the list. }); ga('syg.ec:addImpression', { 'id': '<?php echo $curr_product['sku_idx']; ?>', // Product details are provided in an impressionFieldObject. 'name': '<?php echo $curr_product['disp_name'];?>', 'category': '<?php echo check_product_brand($seo_category,$seo_gender);?>', 'brand': '<?php echo $curr_product['style'];?>', 'variant': '<?php echo $curr_product['color'];?>', 'list': 'Homepage', //'position': 1 // 'position' indicates the product position in the list. }); </script> <? }else{?> <script type="text/javascript"> ga('ec:addImpression', { 'id': '<?php echo $curr_product['sku_idx']; ?>', // Product details are provided in an impressionFieldObject. 'name': '<?php echo $curr_product['disp_name'];?>', 'category': '<?php echo check_product_brand($seo_category,$seo_gender);?>', 'brand': '<?php echo $curr_product['style'];?>', 'variant': '<?php echo $curr_product['color'];?>', 'list': 'Homepage', //'position': 1 // 'position' indicates the product position in the list. }); </script> <?}?> <!-- Ecommerce tracking code --> </div> </div> <?php endforeach;?> </div> </div> <!-- Ecommerce tracking code --> <? if(ENVIRONMENT == 'production'){ ?> <script type="text/javascript"> ga('send', 'pageview'); ga('dieselitaly.send', 'pageview'); ga('syg.send', 'pageview'); </script> <? }else{?> <script type="text/javascript"> ga('send', 'pageview'); </script> <? }?> <!-- Ecommerce tracking code--> </div> <?php endif; ?> <div class="content-slot"> <!-- ------------------------------ FOR VIDEO PARALLAX ------------------------ --> <!-- <section id="fullbleed-outer-wrap-hp-2" class="fullbleed-video-outer" data-widget="cover-full-widget"> <!-- <div id="fullbleed-vid-wrap" class="fullbleed-video-wrap"> <img class=custom-poster alt="null" title="null" src='<?=base_url()?>images/home/week-21-july/w23-hp-02-denim.jpg'/> </div> --> <!-- <div id="video-wrap" class="fullbleed-video-wrap video-wrap" style="position: relative; overflow: hidden; z-index: 10; width: 1349px; height: 799px;"> <video preload="metadata" autoplay="" loop="" id="my-video" style="position: absolute; z-index: 1; width: 1349px; height: 758.813px; transform: translate3d(0px, 320.667px, 0px);"> <source src="http://dharmesh-pc/diesel/images/home/week-27-june/JJ_LANDING.mp4" type="video/mp4"> <p class="vjs-no-js"> To view this video please enable JavaScript, and consider upgrading to a web browser that <a href="http://videojs.com/html5-video-support/" target="_blank">supports HTML5 video</a> </p> </video> </div> </section> --> <!-- ------------------------------ END FOR VIDEO PARALLAX ------------------------ --> <div data-slotid="homepage-slot3" class="one-slot cover-type"> <section class="cover-fullbleed" id="fullbleed-outer-wrap-hp-2" data-stellar-background-ratio="0.5" data-stellar-vertical-offset="130" style="background: url('<?=base_url()?>images/home/week-12-aug/w29-hp-indigocraft.jpg') 0px -100px / cover no-repeat fixed;"> <article class="lp-text"> <h1>INDIGO CRAFT</h1> <p class="cover-p"> Pump up the volume with wide-cut and patchwork denim </p> <span class="link-area"> <a class="button-links" href="<?=base_url()?>man/new-denim">Shop for him</a> <a class="button-links" href="<?=base_url()?>woman/new-denim">Shop for her</a> </span> </article> <span class="anchor-icon"></span> </section> </div> </div> <div class="content-slot"> <section data-slotid="homepage-slot6" class="secondary-inpage-three-slot container-fluid threeinslot parallax-window secondary-inpage-three-slot-image" data-stellar-background-ratio="0.2" > <div class="row"> <div class="dlp-slider-threeinslot dlp-slider-twoslot" data-widget="threefront-vid-widget"> <div class="col-sm-12 col-md-4 theme-one"> <div class="theme-img three-sl"> <div class="inthree-img-holder"> <img alt="Shoes and Bags" title="Shoes and Bags" src='<?=base_url()?>images/home/week-21-july/hp3-shoes&bags.jpg' /> <a class="full-img-link" href="<?=base_url().'product/womens/bags'?>" alt="Shop Women Bags">Explore</a> </div> <article class="three-text"> <h4>Shoes & Bags</h4> <p> Don’t just wear it, own it </p> <span class="link-area"> <a class="" href="<?=base_url().'product/mens/footwear'?>" alt="Shop For Men">SHOP FOR HIM</a> <a class="" href="<?=base_url().'product/womens/footwear'?>" alt="Shop For Women">SHOP FOR HER</a></span></span> </article> </div> </div> <div class="col-sm-12 col-md-4 theme-one"> <div class="theme-img three-sl"> <div class="inthree-img-holder"> <img alt="Watches" title="Watches" src='<?=base_url()?>images/home/HP_03_Watches.jpg' /> <a class="full-img-link" href="<?=base_url().'product/mens/watches'?>" alt="Shop Men's Watches">Explore</a> </div> <article class="three-text"> <h4>WATCHES</h4> <p> Sync it up and strap it on, because size matters. </p> <span class="link-area"><a href="<?=base_url().'product/mens/watches'?>">SHOP NOW</a></span> </article> </div> </div> <div class="col-sm-12 col-md-4 theme-one"> <div class="theme-img three-sl"> <div class="inthree-img-holder"> <img alt="Perfume" title="Perfume" src='<?=base_url()?>images/home/week-12-july/HP3boxers.jpeg' /> <a class="full-img-link" href="<?=base_url().'product/mens/underwear'?>" alt="">Explore</a> </div> <article class="three-text"> <h4>Underwear</h4> <p> Real underwear for real men is not the kind your mother buys you. </p> <span class="link-area"><a href="<?=base_url().'product/mens/underwear'?>">SHOP NOW</a></span> </article> </div> </div> </div> </div> <span class="anchor-icon"></span> </section> </div> </div> <div id="browser-check"> <noscript> <div class="browser-compatibility-alert"> <p class="browser-error"> Your browser's Javascript functionality is turned off. Please turn it on so that you can experience the full capabilities of this site. </p> </div> </noscript> </div> </div>
{ "content_hash": "072bc1450c249e36f6e237e262e9a3ea", "timestamp": "", "source": "github", "line_count": 342, "max_line_length": 284, "avg_line_length": 46.00877192982456, "alnum_prop": 0.5236733396885923, "repo_name": "sygcom/diesel_2016", "id": "40f96760116b9bfe723961d88542b890e5af742d", "size": "15737", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "application/views/homepage_view-19-09-2016-test.php", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "892" }, { "name": "CSS", "bytes": "60597027" }, { "name": "HTML", "bytes": "5675183" }, { "name": "JavaScript", "bytes": "13606395" }, { "name": "PHP", "bytes": "45473425" }, { "name": "Ruby", "bytes": "161" } ], "symlink_target": "" }
package com.vladmihalcea.flexypool; import org.junit.runner.RunWith; import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; /** * AtomikosIntegrationTest - Atomikos Integration Test * * @author Vlad Mihalcea */ @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = "classpath:spring/applicationContext-test.xml") @DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_CLASS) public class AtomikosIntegrationTest extends AbstractPoolAdapterIntegrationTest { }
{ "content_hash": "bd341f13ec2b9104ffffa7300c428227", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 81, "avg_line_length": 36.88235294117647, "alnum_prop": 0.8421052631578947, "repo_name": "wgpshashank/flexy-pool", "id": "0d426add3b12c2eec75e4b64bf21e37b71f26938", "size": "627", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "flexy-atomikos/src/test/java/com/vladmihalcea/flexypool/AtomikosIntegrationTest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "353" }, { "name": "Java", "bytes": "336163" } ], "symlink_target": "" }
<!-- id: 22660387526 link: http://tumblr.atmos.org/post/22660387526/ryan-woodwards-bottom-of-the-ninth-an-animated slug: ryan-woodwards-bottom-of-the-ninth-an-animated date: Tue May 08 2012 11:05:37 GMT-0700 (PDT) publish: 2012-05-08 tags: title: Ryan Woodward's Bottom of the Ninth, an animated graphic novel.Bottom of the Ninth | The first Animated Graphic Novel --> Ryan Woodward's Bottom of the Ninth, an animated graphic novel.Bottom of the Ninth | The first Animated Graphic Novel ===================================================================================================================== [http://www.bottom-of-the-ninth.com/](http://www.bottom-of-the-ninth.com/)
{ "content_hash": "37dd06be578c041446568d63305387ca", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 124, "avg_line_length": 42.8125, "alnum_prop": 0.6277372262773723, "repo_name": "atmos/tumblr.atmos.org", "id": "dc2a9f41f690122bf361326a2fc582ff6bf24d17", "size": "685", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "posts/2012/05/ryan-woodwards-bottom-of-the-ninth-an-animated.md", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
package rest import ( "encoding/json" "fmt" "net/http" "github.com/go-martini/martini" "github.com/ninjasphere/app-scheduler/model" "github.com/ninjasphere/app-scheduler/service" ) type TaskRouter struct { scheduler *service.SchedulerService } func NewTaskRouter() *TaskRouter { return &TaskRouter{} } func (tr *TaskRouter) Register(r martini.Router) { r.Get("", tr.GetAllTasks) r.Post("", tr.CreateTask) r.Get("/:id", tr.GetTask) r.Put("/:id", tr.CreateTask) r.Delete("/:id", tr.CancelTask) } func writeResponse(code int, w http.ResponseWriter, response interface{}, err error) { if err == nil { json.NewEncoder(w).Encode(response) } else { w.WriteHeader(code) w.Write([]byte(fmt.Sprintf("error: %v\n", err))) } } func (tr *TaskRouter) GetAllTasks(r *http.Request, w http.ResponseWriter) { schedule, err := tr.scheduler.FetchSchedule() writeResponse(500, w, schedule, err) } func (tr *TaskRouter) CreateTask(r *http.Request, w http.ResponseWriter) { task := &model.Task{} json.NewDecoder(r.Body).Decode(task) task = task.Migrate() if id, err := tr.scheduler.Schedule(task); err != nil { w.WriteHeader(400) w.Write([]byte(fmt.Sprintf("error: %v\n", err))) } else { h := w.Header() h.Add("Location", fmt.Sprintf("%s://%s%s/%s", "http", r.Host, r.URL.RequestURI(), *id)) w.WriteHeader(303) } } func (tr *TaskRouter) GetTask(params martini.Params, r *http.Request, w http.ResponseWriter) { task, err := tr.scheduler.Fetch(params["id"]) writeResponse(404, w, task, err) } func (tr *TaskRouter) CancelTask(params martini.Params, r *http.Request, w http.ResponseWriter) { m, err := tr.scheduler.Cancel(params["id"]) writeResponse(404, w, m, err) }
{ "content_hash": "6eff49e2c4cb9d5b66dc8e4c69f370da", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 97, "avg_line_length": 26.092307692307692, "alnum_prop": 0.6863207547169812, "repo_name": "ninjasphere/app-scheduler", "id": "2352a5b4ffdb8811fe193f8492722ae437f322ba", "size": "1696", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "rest/task.go", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "11356" }, { "name": "Go", "bytes": "85647" }, { "name": "HTML", "bytes": "3870" }, { "name": "JavaScript", "bytes": "37631" }, { "name": "Makefile", "bytes": "650" }, { "name": "Shell", "bytes": "1381" } ], "symlink_target": "" }
/// <reference path="../typings/index.d.ts" /> // external import { ElementRef, Injectable } from '@angular/core'; import { default as marked } from 'marked'; // internal import { CallbackType } from './ngx-markdown.type'; /** * @export * @class MarkedConfigClass */ export class MarkedConfigClass { public options: marked.MarkedOptions = { gfm: true, tables: true, breaks: true, pedantic: false, sanitize: false, smartLists: true, smartypants: false }; public loadingTemplate? = `<div>Loading ...</div>`; } /** * Service to transform markdown to html. * @export * @class MarkdownService */ @Injectable() export class MarkdownService { /** * Creates an instance of MarkdownService. * @param {MarkedConfigClass} config * @memberof MarkdownService */ constructor(public config: MarkedConfigClass) { } /** * @param {string} string * @param {marked.MarkedOptions} [options] * @param {CallbackType} [callback] * @returns {Promise<string>} * @memberof MarkdownService */ public marked(string: string, options?: marked.MarkedOptions, callback?: CallbackType): Promise<string> { return new Promise((resolve, reject) => { marked(string, (options) ? options : this.config[0].options, (error: any, result: string) => { if (error) { reject(error); } else { resolve(result); } if (callback) { callback(error, result); } }); }); } }
{ "content_hash": "637c3dae69d4038b2cda1a22a62fbf37", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 107, "avg_line_length": 24.112903225806452, "alnum_prop": 0.6240802675585284, "repo_name": "ngx-markdown/core", "id": "6f3b3cb1c1cc837e3055d556ccfaec369c4c8601", "size": "1495", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/ngx-markdown.service.ts", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "560" }, { "name": "JavaScript", "bytes": "8327" }, { "name": "TypeScript", "bytes": "22434" } ], "symlink_target": "" }
// -------------------------------------------------------------------------------------------------------------------- // <copyright file="[PROJECT_NAME_CLASSNAME_PREFIX]BsonSerializationConfiguration.cs" company="Naos Project"> // Copyright (c) Naos Project 2019. All rights reserved. // </copyright> // -------------------------------------------------------------------------------------------------------------------- namespace [PROJECT_NAME] { using System; using System.Collections.Generic; using System.Linq; using Naos.Database.Serialization.Bson; using Naos.Protocol.Serialization.Bson; using OBeautifulCode.Serialization.Bson; using OBeautifulCode.Type; using OBeautifulCode.Type.Recipes; /// <inheritdoc /> public class [PROJECT_NAME_CLASSNAME_PREFIX]BsonSerializationConfiguration : BsonSerializationConfigurationBase { /// <inheritdoc /> protected override IReadOnlyCollection<string> TypeToRegisterNamespacePrefixFilters => new[] { [SOLUTION_NAME].Domain.ProjectInfo.Namespace, }; /// <inheritdoc /> protected override IReadOnlyCollection<BsonSerializationConfigurationType> DependentBsonSerializationConfigurationTypes => new[] { typeof(ProtocolBsonSerializationConfiguration).ToBsonSerializationConfigurationType(), typeof(DatabaseBsonSerializationConfiguration).ToBsonSerializationConfigurationType(), }; /// <inheritdoc /> protected override IReadOnlyCollection<TypeToRegisterForBson> TypesToRegisterForBson => new Type[0] .Concat(new[] { typeof(IModel) }) .Concat([SOLUTION_NAME].Domain.ProjectInfo.Assembly.GetPublicEnumTypes()) .Select(_ => _.ToTypeToRegisterForBson()) .ToList(); } }
{ "content_hash": "ef810412d46dea0ed7325d419f07878a", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 130, "avg_line_length": 43.674418604651166, "alnum_prop": 0.5926517571884984, "repo_name": "NaosProject/Naos.Build", "id": "827fdb1c6b8da5a1521d2781b0eff54ddef17c01", "size": "1880", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Conventions/VisualStudioProjectTemplates/Serialization.Bson/[PROJECT_NAME_CLASSNAME_PREFIX]bsonserializationconfiguration.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "21793" }, { "name": "PowerShell", "bytes": "15851" } ], "symlink_target": "" }
// Copyright (c) 2011-2013 The VCoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef VCOIN_QT_WALLETMODELTRANSACTION_H #define VCOIN_QT_WALLETMODELTRANSACTION_H #include "walletmodel.h" #include <QObject> class SendCoinsRecipient; class CReserveKey; class CWallet; class CWalletTx; /** Data model for a walletmodel transaction. */ class WalletModelTransaction { public: explicit WalletModelTransaction(const QList<SendCoinsRecipient> &recipients); ~WalletModelTransaction(); QList<SendCoinsRecipient> getRecipients(); CWalletTx *getTransaction(); unsigned int getTransactionSize(); void setTransactionFee(const CAmount& newFee); CAmount getTransactionFee(); CAmount getTotalTransactionAmount(); void newPossibleKeyChange(CWallet *wallet); CReserveKey *getPossibleKeyChange(); void reassignAmounts(int nChangePosRet); // needed for the subtract-fee-from-amount feature private: QList<SendCoinsRecipient> recipients; CWalletTx *walletTransaction; CReserveKey *keyChange; CAmount fee; }; #endif // VCOIN_QT_WALLETMODELTRANSACTION_H
{ "content_hash": "4b6b9c05266c76f9151eb69fc022bbca", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 95, "avg_line_length": 25.914893617021278, "alnum_prop": 0.7668308702791461, "repo_name": "vcoin-project/v", "id": "b8102f545315ad226bde7bf3db37cbb592defb41", "size": "1218", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/qt/walletmodeltransaction.h", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "708021" }, { "name": "C++", "bytes": "4107591" }, { "name": "CSS", "bytes": "1127" }, { "name": "Groff", "bytes": "543539" }, { "name": "HTML", "bytes": "50621" }, { "name": "M4", "bytes": "146937" }, { "name": "Makefile", "bytes": "1093629" }, { "name": "NSIS", "bytes": "6503" }, { "name": "Objective-C", "bytes": "2156" }, { "name": "Objective-C++", "bytes": "7232" }, { "name": "Protocol Buffer", "bytes": "2300" }, { "name": "Python", "bytes": "613863" }, { "name": "Shell", "bytes": "1762241" } ], "symlink_target": "" }
ACCEPTED #### According to NUB Generator [autonym] #### Published in null #### Original name null ### Remarks null
{ "content_hash": "dedcd74c534ec3aed2362bf15879ee7b", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 23, "avg_line_length": 9.076923076923077, "alnum_prop": 0.6779661016949152, "repo_name": "mdoering/backbone", "id": "79f9812c2e3956b1cb2d705b94be0792eb86d43e", "size": "182", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Brassicales/Capparaceae/Capparis/Capparis ferruginea/Capparis ferruginea ferruginea/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
int AttackClient::LoadNames(NameReader *reader) { while (nameReader_HasNext(reader)) { Name *name = nameReader_Next(reader); names.push_back(name); } return names.size(); } void AttackClient::Run() { uint8_t sizeBuffer[2]; int index = 0; for (std::vector<Name *>::iterator itr = names.begin(); itr != names.end(); itr++) { Name *name = *itr; // Serialize and send the name PARCBuffer *nameWireFormat = name_GetWireFormat(name, name_GetSegmentCount(name)); uint8_t *nameBuffer = (uint8_t *) parcBuffer_Overlay(nameWireFormat, 0); size_t nameLength = parcBuffer_Remaining(nameWireFormat); sizeBuffer[0] = (nameLength >> 8) & 0xFF; sizeBuffer[1] = (nameLength >> 0) & 0xFF; // Record the time it was sent struct timespec start = timerStart(); times.push_back(start); // Send it if (send(sockfd, (void *) sizeBuffer, sizeof(sizeBuffer), 0) != sizeof(sizeBuffer)) { // std::cerr << "failed to send packet " << index << std::endl; } if (send(sockfd, (void *) nameBuffer, nameLength, 0) != nameLength) { // std::cerr << "failed to send packet " << index << std::endl; // perror("Error!"); } index++; } } void * runClient(void *arg) { AttackClient *client = (AttackClient *) arg; client->Run(); return NULL; }
{ "content_hash": "a73746ac62494b3d3ca42b8f6a66f363", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 93, "avg_line_length": 29.06122448979592, "alnum_prop": 0.5779494382022472, "repo_name": "chris-wood/fib-performance", "id": "a4093490114e496249083c47cb062a05d193dd51", "size": "1710", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/attack/attack_client.cpp", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "154331" }, { "name": "C++", "bytes": "10225" }, { "name": "CMake", "bytes": "2572" }, { "name": "Makefile", "bytes": "14090" }, { "name": "Python", "bytes": "13967" }, { "name": "Ruby", "bytes": "5942" }, { "name": "Shell", "bytes": "111" } ], "symlink_target": "" }
package org.cybergarage.util; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.util.Locale; public final class FileUtil { public final static byte[] load(String fileName) { try { FileInputStream fin=new FileInputStream(fileName); return load(fin); } catch (Exception e) { Debug.warning(e); return new byte[0]; } } public final static byte[] load(File file) { try { FileInputStream fin=new FileInputStream(file); return load(fin); } catch (Exception e) { Debug.warning(e); return new byte[0]; } } public final static byte[] load(FileInputStream fin) { byte readBuf[] = new byte[512*1024]; try { ByteArrayOutputStream bout = new ByteArrayOutputStream(); int readCnt = fin.read(readBuf); while (0 < readCnt) { bout.write(readBuf, 0, readCnt); readCnt = fin.read(readBuf); } fin.close(); return bout.toByteArray(); } catch (Exception e) { Debug.warning(e); return new byte[0]; } } public final static boolean isXMLFileName(String name) { if (StringUtil.hasData(name) == false) return false; String lowerName = name.toLowerCase(Locale.US); return lowerName.endsWith("xml"); } }
{ "content_hash": "27565df10cce3b27fea2818ea317cb00", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 60, "avg_line_length": 18.73134328358209, "alnum_prop": 0.6693227091633466, "repo_name": "NoYouShutup/CryptMeme", "id": "5b1cc5cdc449d220846dc865306f4e29f65e50bf", "size": "1529", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "CryptMeme/router/java/src/org/cybergarage/util/FileUtil.java", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "13331" }, { "name": "C", "bytes": "152438" }, { "name": "C#", "bytes": "15453" }, { "name": "C++", "bytes": "67831" }, { "name": "CSS", "bytes": "277692" }, { "name": "Groff", "bytes": "3189" }, { "name": "Groovy", "bytes": "33314" }, { "name": "HTML", "bytes": "363741" }, { "name": "Java", "bytes": "34160913" }, { "name": "JavaScript", "bytes": "12574" }, { "name": "Makefile", "bytes": "7266" }, { "name": "Perl", "bytes": "31012" }, { "name": "Python", "bytes": "135058" }, { "name": "Scala", "bytes": "16496" }, { "name": "Shell", "bytes": "190556" } ], "symlink_target": "" }
package com.github.szberes.spring.examples.beans.calculator; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import static org.junit.Assert.assertEquals; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes = TestContextConfiguration.class) public class CalculatorTest { @Autowired private Calculator numberCalculator; @Autowired private Calculator stringCalculator; @Autowired @Qualifier("numberAsStringCalculator") private Calculator numberAsStringCalculator; @Test public void testNumberCalculator() throws Exception { assertEquals(3, numberCalculator.add(1,2)); } @Test public void testStringCalculator() throws Exception { assertEquals(12, stringCalculator.add(1, 2)); } @Test public void testNumberAsStringCalculator() throws Exception { assertEquals(12, numberAsStringCalculator.add(1, 2)); } }
{ "content_hash": "a11c5f366fdb0273111f0acb838ef9fd", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 71, "avg_line_length": 27.29268292682927, "alnum_prop": 0.8168007149240393, "repo_name": "szberes/spring-examples", "id": "a518381c434209356f9f8b2a18cbcfa196641deb", "size": "1119", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "beans/src/test/java/com/github/szberes/spring/examples/beans/calculator/CalculatorTest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "87190" } ], "symlink_target": "" }
package com.iton.spring.mvc; import javax.servlet.http.HttpSession; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import com.iton.sprint.dto.User; import com.iton.sprint.dto.UserDAO; import com.iton.sprint.dto.UserDTO; import com.iton.sprint.dto.UserDetails; @Controller public class AuthenticationController { @RequestMapping(value="/") public String authenticateUser(ModelMap modelMap,HttpSession httpSession){ modelMap.addAttribute("user", new User()); System.out.println("first step"); return "login"; } @RequestMapping(value="login",method=RequestMethod.POST ) public String authenticationProcess(@ModelAttribute("user")User user,ModelMap modelMap,HttpSession httpSession){ System.out.println("LLLLLLLLL 2nd step"); System.out.println(user.getUserName()); System.out.println(user.getPassword()); UserDTO userDTO=new UserDTO(); userDTO.setUser(user); httpSession.setAttribute("dto",userDTO); modelMap.addAttribute("userDetails", new UserDetails()); return "result"; } @RequestMapping(value="userDetails",method=RequestMethod.POST) public String detailsgathering(@ModelAttribute("userData")UserDetails userDetails,ModelMap modelMap,HttpSession httpSession){ System.out.println("LLLLLLLL"); UserDTO dto=(UserDTO) httpSession.getAttribute("dto"); dto.setUserDetails(userDetails); httpSession.setAttribute("dto",dto); //dto.setUserDetails(userDetails); // UserDAO dao=dtoToDAOConvertion(dto); modelMap.addAttribute("dto", dto); System.out.println(userDetails); System.out.println(dto); return "result1"; } @RequestMapping(value="userDetails1",method=RequestMethod.POST ) public String detailsgathering1(@ModelAttribute("userData1")UserDetails userDetails,ModelMap modelMap,HttpSession httpSession){ System.out.println("LLLLLL0000000LL"); UserDTO dto=(UserDTO) httpSession.getAttribute("dto"); dto.setUserDetails(userDetails); httpSession.setAttribute("dto",dto); //UserDAO dao=dtoToDAOConvertion(dto); //modelMap.addAttribute("dao", dao); System.out.println(userDetails); return "result1"; } private UserDAO dtoToDAOConvertion(UserDTO dto) { UserDAO dao=new UserDAO(); dao.setAge(dto.getUserDetails().getUserAge()); dao.setFrom(dto.getUserDetails().getVilalge()); dao.setNameClass(dto.getUserDetails().getClassName()); dao.setUserName(dto.getUser().getUserName()); dao.setPassword(dto.getUser().getPassword()); return dao; } }
{ "content_hash": "fc73d8345a8dff1f4dcd68288a6696e1", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 128, "avg_line_length": 38.40845070422535, "alnum_prop": 0.7572423909057573, "repo_name": "vrkmurali/SpringExamples", "id": "3cfe905e8fcfe75713a15332ac3eaad098e93f9a", "size": "2727", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "example1/src/main/java/com/iton/spring/mvc/AuthenticationController.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "HTML", "bytes": "13203" }, { "name": "Java", "bytes": "10783" } ], "symlink_target": "" }
/////////////////////////////////////////////////////////////////////////////// // // File PulseWavePressureArea.cpp // // For more information, please see: http://www.nektar.info // // The MIT License // // Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA), // Department of Aeronautics, Imperial College London (UK), and Scientific // Computing and Imaging Institute, University of Utah (USA). // // License for the specific language governing rights and limitations under // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. // // Description: PulseWavePressureArea definition // /////////////////////////////////////////////////////////////////////////////// #include <PulseWaveSolver/EquationSystems/PulseWavePressureArea.h> #include <loki/Singleton.h> namespace Nektar { /** * @class PulseWavePressureArea * */ PulseWavePressureArea::PulseWavePressureArea( Array<OneD, MultiRegions::ExpListSharedPtr> &pVessel, const LibUtilities::SessionReaderSharedPtr &pSession) : m_vessels(pVessel), m_session(pSession) { } PulseWavePressureArea::~PulseWavePressureArea() { } /** * */ PressureAreaFactory& GetPressureAreaFactory() { typedef Loki::SingletonHolder<PressureAreaFactory, Loki::CreateUsingNew, Loki::NoDestroy > Type; return Type::Instance(); } }
{ "content_hash": "aba91a877e159b81d3c49e3fc0a580c7", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 79, "avg_line_length": 37.11594202898551, "alnum_prop": 0.643498633346349, "repo_name": "certik/nektar", "id": "625b624457c4b70e1faaa848e8be9b435a7de8f3", "size": "2561", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "solvers/PulseWaveSolver/EquationSystems/PulseWavePressureArea.cpp", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "97273" }, { "name": "C++", "bytes": "14353038" }, { "name": "CMake", "bytes": "249012" }, { "name": "GLSL", "bytes": "16406" }, { "name": "Objective-C", "bytes": "3161" }, { "name": "Scilab", "bytes": "375620" }, { "name": "Shell", "bytes": "16892" } ], "symlink_target": "" }
package com.turbomanage.gwt.client.ui.widget; import java.util.HashSet; import com.google.gwt.event.shared.EventHandler; public interface ItemSelectionHandler<T> extends EventHandler { void onItemsSelected(HashSet<T> selectedItems); }
{ "content_hash": "1e95b3de2942da19afc34e46f178c8fa", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 61, "avg_line_length": 23.9, "alnum_prop": 0.8158995815899581, "repo_name": "turbomanage/listmaker", "id": "8f66e483873c323c4df12f69763b98fc42d81467", "size": "239", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/com/turbomanage/gwt/client/ui/widget/ItemSelectionHandler.java", "mode": "33261", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "15940" }, { "name": "Java", "bytes": "202398" } ], "symlink_target": "" }
// NOTE - Eventually separate this out into common reporting functionality and UniProt specific // once we start supporting multiple report types/sources #ifndef UNIPROT_H_ #define UNIPROT_H_ #include "bwamem.h" #define UNIPROT_MAX_SUBMIT 5000 #define UNIPROT_MAX_ERROR 5 #define UNIPROT_BUFFER_GROW 50000000 #define UNIPROT_LIST_FULL 0 #define UNIPROT_LIST_GENES 1 #define UNIPROT_LIST_ORGANISM 2 #define UNIPROT_REFERENCE_SWISSPROT 1 #define UNIPROT_REFERENCE_UNIREF90 2 typedef struct { char * id; char * gene; char * organism; int numOccurrence; int totalQuality; int maxQuality; } UniprotEntry; typedef struct { UniprotEntry * entries; int entryCount; int unalignedCount; } UniprotList; typedef struct { char * buffer; int size; int capacity; } CURLBuffer; // Each pipeline run maintains its own list extern UniprotList * uniprotPriEntryLists; extern UniprotList * uniprotSecEntryLists; extern int uniprotPriListCount; extern int uniprotSecListCount; // Rendering void renderUniprotReport(int passType, int passPrimary, FILE * passStream, const char * passProxy); void renderUniprotEntries(UniprotList * passList, int passType, FILE * passStream); void renderNumberAligned(const mem_opt_t * passOptions); // Population int addUniprotList(worker_t * passWorker, int passSize, int passFull); void cleanUniprotLists(UniprotList * passLists, int passPrimary); // Support UniprotList * getGlobalLists(int passPrimary); int * getGlobalCount(int passPrimary); void prepareUniprotReport(int passType, int passPrimary, UniprotList * passLists, CURLBuffer * passBuffer, const char * passProxy); void prepareUniprotLists(UniprotList * retLists, int passPrimary); void aggregateUniprotList(UniprotList * retList, int passListType, int passPrimary); void joinOnlineLists(UniprotList * retList, char * passUniprotOutput); // QSort Functions int uniprotEntryCompareCommon (const void * passEntry1, const void * passEntry2); int uniprotEntryCompareID (const void * passEntry1, const void * passEntry2); int uniprotEntryCompareGene (const void * passEntry1, const void * passEntry2); int uniprotEntryCompareOrganism (const void * passEntry1, const void * passEntry2); int uniprotEntryCompareOnline (const void * passEntry1, const void * passEntry2); // UniProt Interoperability int cleanUniprotReference(int passReference, const char * passBase); void cleanUniprotReferenceUniref(const char * passName, int passANN); const char * downloadUniprotReference(int passReference, const char * passProxy); void retrieveUniprotOnline(UniprotList * passList, CURLBuffer * retBuffer, const char * passProxy); size_t receiveUniprotOutput(void * passString, size_t passSize, size_t passNum, void * retStream); void initCURLBuffer(CURLBuffer * passBuffer, int passCapacity); void resetCURLBuffer(CURLBuffer * passBuffer); void freeCURLBuffer(CURLBuffer * passBuffer); #endif /* UNIPROT_H_ */
{ "content_hash": "57c367a77afba728e0ec59de6913897e", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 131, "avg_line_length": 35.76543209876543, "alnum_prop": 0.7949603037625129, "repo_name": "twestbrookunh/paladin", "id": "5dd7ecdc5b513e884ede910d1d08318b6718c9b3", "size": "2897", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "uniprot.h", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "377867" }, { "name": "C++", "bytes": "9718" }, { "name": "Dockerfile", "bytes": "690" }, { "name": "Makefile", "bytes": "1896" }, { "name": "Python", "bytes": "32709" }, { "name": "Shell", "bytes": "533" } ], "symlink_target": "" }
<?xml version="1.0"?> <Prefs> <Misc> <RulesPath value="%solutionPath%\AtomineerSettings" /> <UserName value="(Use login name)" /> <MMAddDocComment value="true" /> <MMDocThisScope value="true" /> <MMDocThisFile value="true" /> <MMDocThisProject value="true" /> <MMDocThisSolution value="true" /> <MMDocAll value="true" /> <MMDeleteDocsFromFile value="true" /> <MMShowDocWindow value="true" /> <MMColumnise value="true" /> <MMOutlineDocComments value="true" /> <MMOutlineAttributes value="true" /> <MMOpenSourceOrHeader value="true" /> <MMImplementMethod value="true" /> <MMAddAccessMethods value="true" /> <MMAddProperty value="true" /> <MMCopyAsText value="true" /> <MMCheckForUpdates value="true" /> <CMAddDocComment value="true" /> <CMDocThisScope value="false" /> <CMDocThisFile value="false" /> <CMDocAll value="false" /> <CMShowDocWindow value="false" /> <CMColumnise value="false" /> <CMCopyAsText value="false" /> <CMAddProperty value="false" /> <CMAddAccessMethods value="false" /> <CMImplementMethod value="false" /> <CMOpenSourceOrHeader value="false" /> <EditXmlInNotepad /> </Misc> <Doxygen> <CommandPrefix value="@" /> <SuppressBriefTags value="true" /> <SuppressPrototypes value="true" /> <FullClassDecl value="false" /> </Doxygen> <DocComment> <CommentStyle value="DocXml" /> <Separator value="(No first line separator)" /> <LineHeader /> <LineHeader2 value="/// " /> <SeparatorB value="(No last line separator)" /> <SeparatorClipCol value="-1" /> <BlanksAbove value="1" /> <BlanksAfterRegion value="0" /> <BlanksAfterScope value="0" /> <BlanksBelow value="0" /> <BlanksBetweenEntries value="false" /> <WordWrapRelative value="true" /> <SimpleFormatForOneLiners value="true" /> <SingleLinePrefix value="///&lt; " /> <SingleLineSuffix value="(None)" /> <SingleLineMinColumn value="0" /> <LineCommentOnSameLine value="false" /> <ImmediateDelete value="false" /> <DateCulture value="" /> <WordWrapColumn value="100" /> <AutoDocReplacements value="true" /> <SuppressAuthor value="true" /> <SuppressDate value="true" /> <ThisObjectName value="object" /> <DuplicateBaseDocs value="true" /> <AddSeeForBases value="false" /> <SummaryOnlyForBases value="false" /> <AddSeeForOverrides value="false" /> <SummaryOnlyForOverrides value="false" /> <DocAllAddFileHeader value="true" /> <DateFormat value="d" /> <LiveCommentUpdate value="true" /> <LiveCommentCreation value="true" /> <LiveTabNav value="false" /> <ConvertEntities value="true" /> <TidyOnPaste value="true" /> <ConvertDoubleSlashComments value="true" /> <AddDocTableForEnums value="false" /> <LiveSLCommentUpdate value="true" /> </DocComment> <DocXml> <BlockFormatNew /> <BlockFormatOld /> <BlockFormatForGroup /> </DocXml> <Format> <EntrySuppressNewlines value="false" /> <GroupSuppressNewlines value="true" /> <AlignBlockStartColumns value="false" /> <AccessLevelsToComment value="all" /> <AccessLevelsApplyToAllCmds value="false" /> <DeleteIllegalBlock value="true" /> <EntryTag value="Newline" /> <EntryNewline value="Nothing" /> <EntryBody value="Newline" /> <GroupTag value="Nothing" /> <GroupNewline value="Align" /> <GroupBody value="Nothing" /> <SingleTag value="Nothing" /> <SingleBody value="Nothing" /> </Format> <Variables> <StyleCop value="true" /> </Variables> <OutlineDocComment> <OnOpenDoc value="false" /> <SkipFirstLine value="true" /> <EatTrailingBlank value="true" /> </OutlineDocComment> <OutlineAttr> <OnOpenDoc value="false" /> <EatBlanks value="true" /> </OutlineAttr> <CopyAsText> <StripIndent value="true" /> <TabSize value="4" /> </CopyAsText> <AddAccessMethods> <VarTemplate value="varName" /> <MemberPrefix /> <MultilineAutoProp value="false" /> <MethodTemplate value="GetVarName,SetVarName" /> <ParamTemplate value="varName" /> </AddAccessMethods> <ImplementMethod> <AddDocComment value="true" /> <ReturnToOrigDoc value="false" /> </ImplementMethod> <Columnise> <MinimiseWhitespace value="true" /> </Columnise> <PrefSet name="TypeScript" filetypes=".ts"> <DocComment> <CommentStyle value="Doxygen" /> <Separator value="/**" /> <LineHeader2 value=" * " /> <SeparatorB value=" */" /> <BlanksAbove value="1" /> <BlanksAfterRegion value="0" /> <BlanksAfterScope value="0" /> <BlanksBelow value="0" /> <BlanksBetweenEntries value="false" /> <SimpleFormatForOneLiners value="false" /> <LineCommentOnSameLine value="false" /> <SingleLinePrefix value="///&lt; " /> <SingleLineSuffix value="(None)" /> <SingleLineMinColumn value="0" /> <WordWrapColumn value="100" /> <WordWrapRelative value="true" /> <LineHeader /> </DocComment> <Format> <EntrySuppressNewlines value="false" /> <GroupSuppressNewlines value="true" /> <AlignBlockStartColumns value="true" /> <EntryTag value="Space" /> <EntryNewline value="Nothing" /> <EntryBody value="Nothing" /> <GroupTag value="Space" /> <GroupNewline value="Align" /> <GroupBody value="Nothing" /> <SingleTag value="Space" /> <SingleBody value="Space" /> </Format> </PrefSet> <PrefSet name="JavaScript" filetypes=".js.jsp.jscript.es.jse.wsf.wsc.as"> <DocComment> <CommentStyle value="Doxygen" /> <Separator value="/**" /> <LineHeader2 value=" * " /> <SeparatorB value=" */" /> <BlanksAbove value="1" /> <BlanksAfterRegion value="0" /> <BlanksAfterScope value="0" /> <BlanksBelow value="0" /> <BlanksBetweenEntries value="false" /> <SimpleFormatForOneLiners value="false" /> <LineCommentOnSameLine value="false" /> <SingleLinePrefix value="///&lt; " /> <SingleLineSuffix value="(None)" /> <SingleLineMinColumn value="0" /> <WordWrapColumn value="100" /> <WordWrapRelative value="true" /> <LineHeader /> </DocComment> <Format> <EntrySuppressNewlines value="false" /> <GroupSuppressNewlines value="true" /> <AlignBlockStartColumns value="true" /> <EntryTag value="Space" /> <EntryNewline value="Nothing" /> <EntryBody value="Nothing" /> <GroupTag value="Space" /> <GroupNewline value="Align" /> <GroupBody value="Nothing" /> <SingleTag value="Space" /> <SingleBody value="Space" /> </Format> </PrefSet> </Prefs>
{ "content_hash": "b5459c790d4c8fbffca1988314748327", "timestamp": "", "source": "github", "line_count": 202, "max_line_length": 75, "avg_line_length": 33.584158415841586, "alnum_prop": 0.6285377358490566, "repo_name": "raimu/kephas", "id": "f1ca67419769cb50c792fd0b79c1da8fa0f0113d", "size": "6784", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/AtomineerSettings/PrefSets.xml", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "4489" }, { "name": "C#", "bytes": "1537848" } ], "symlink_target": "" }
package se.l4.vibe.timers; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.greaterThan; import java.util.concurrent.TimeUnit; import org.junit.Test; public class TimerTest { @Test public void testNanoResolution() throws Exception { Timer timer = Timer.builder() .withResolution(TimeUnit.NANOSECONDS) .build(); try(Stopwatch w = timer.start()) { Thread.sleep(1); } assertThat(timer.getMaximumProbe().read(), is(greaterThan(100000l))); } @Test public void testMilliResolution() throws Exception { Timer timer = Timer.builder() .withResolution(TimeUnit.MILLISECONDS) .build(); try(Stopwatch w = timer.start()) { Thread.sleep(2); } assertThat(timer.getMaximumProbe().read(), is(greaterThan(1l))); } }
{ "content_hash": "9d245ada0c2875fea943362380a8d4a7", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 71, "avg_line_length": 19.113636363636363, "alnum_prop": 0.7193816884661117, "repo_name": "LevelFourAB/vibe", "id": "f044dbfb2b083a51493c20a43a2dfc6d57765042", "size": "841", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "vibe-api/src/test/java/se/l4/vibe/timers/TimerTest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "177076" } ], "symlink_target": "" }
import os from setuptools import setup, find_packages if os.name == 'nt': # windows import py2exe # manual dependencie :/ THISDIR = os.path.dirname(os.path.abspath(__file__)) os.chdir(THISDIR) VERSION = "1.1.0" # FIXME get from module DOWNLOAD_BASEURL = "https://pypi.python.org/packages/source/a/dataserv-client/" DOWNLOAD_URL = DOWNLOAD_BASEURL + "dataserv-client-%s.tar.gz" % VERSION setup( name='dataserv-client', version=VERSION, description='', long_description=open("README.rst").read(), keywords=(""), url='http://storj.io', author='Shawn Wilkinson', author_email='shawn+dataserv-client@storj.io', license='MIT', packages=find_packages(exclude=['dataserv_client.bin']), scripts=[os.path.join('dataserv_client', 'bin', 'dataserv-client')], download_url = DOWNLOAD_URL, test_suite="tests", install_requires=[ 'RandomIO == 0.2.1', 'future == 0.15.0', # for python 2.7 support 'dataserv == 1.0.2', # FIXME why do tests only work when its here? ], tests_require=[ 'coverage', 'coveralls' ], zip_safe=False, classifiers=[ # "Development Status :: 1 - Planning", # "Development Status :: 2 - Pre-Alpha", "Development Status :: 3 - Alpha", # "Development Status :: 4 - Beta", # "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", #"Programming Language :: Python :: 2", #"Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Topic :: Software Development :: Libraries :: Python Modules", ], # py2exe console=[os.path.join('dataserv_client', 'bin', 'dataserv-client')], options = {'py2exe': { "optimize": 2, "bundle_files": 2, # This tells py2exe to bundle everything }} )
{ "content_hash": "22f69c3b893fe281b3876220fccf8b28", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 79, "avg_line_length": 32.50769230769231, "alnum_prop": 0.6015144344533838, "repo_name": "sesam/dataserv-client", "id": "74ab9a58949633580ec7f2b1d71e99a0a504724c", "size": "2153", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "setup.py", "mode": "33188", "license": "mit", "language": [ { "name": "Makefile", "bytes": "1134" }, { "name": "Python", "bytes": "21446" } ], "symlink_target": "" }
Graphlab ========== License ------- GraphLab is free software licensed under the Apache 2.0 License. See license/LICENSE.txt for details. Introduction ------------ GraphLab is a graph-based, high performance, distributed computation framework written in C++. The GraphLab project started in 2009 to develop a new parallel computation abstraction tailored to machine learning. GraphLab 1.0 represents our first shared memory design, and in GraphLab 2.1, we completely redesigned the framework to target the distributed environment addressing the difficulties with real world power-law graphs, achieving unparalleled performance. In GraphLab 2.2, we introduce the Warp System which provides a new flexible, distributed architecture around fine-grained user-mode threading (fibers). The new Warp system will allow us to easily extend the abstraction to cover new ground while improving useability, and will also allow us to realize new system optimizations that are not available in the past. GraphLab Features: * **Unified multicore/distributed API:** write once run anywhere * **Tuned for performance:** optimized C++ execution engine leverages extensive multi-threading and asynchronous IO * **Scalable:** Run on large cluster deployments by intelligently placing data and computation * **HDFS Integration:** Access your data directly from HDFS * **Powerful Machine Learning Toolkits:** Tackle challenging machine learning problems with ease For more details on the GraphLab see http://graphlab.org, including documentation, tutorial, etc. Dependencies ------------ GraphLab now automatically satisfied most dependencies. There are however, a few dependencies which we cannot easily satisfy: * On OS X: g++ (>= 4.2) or clang (>= 3.0) [Required] + Required for compiling GraphLab. * On Linux: g++ (>= 4.3) or clang (>= 3.0) [Required] + Required for compiling GraphLab. * *nix build tools: patch, make [Required] + Should come with most Mac/Linux systems by default. Recent Ubuntu version will require to install the build-essential package. * zlib [Required] + Comes with most Mac/Linux systems by default. Recent Ubuntu version will require the zlib1g-dev package. * Open MPI or MPICH2 [Strongly Recommended] + Required for running GraphLab distributed. * JDK 6 or greater [Optional] + Required for HDFS support ### Satisfying Dependencies on Mac OS X Installing XCode with the command line tools (in XCode 4.3 you have to do this manually in the XCode Preferences -> Download pane), satisfies all of these dependencies. ### Satisfying Dependencies on Ubuntu All the dependencies can be satisfied from the repository: apt-get install gcc g++ build-essential libopenmpi-dev default-jdk cmake zlib1g-dev Compiling --------- ./configure In the graphlab directory, will create two sub-directories, release/ and debug/ . cd into either of these directories and running make will build the release or the debug versions respectively. Note that this will compile all of GraphLab, including all toolkits. Since some toolkits require additional dependencies (for instance, the Computer Vision toolkit needs OpenCV), this will also download and build all optional dependencies. We recommend using make’s parallel build feature to accelerate the compilation process. For instance: make -j 4 will perform up to 4 build tasks in parallel. When building in release/ mode, GraphLab does require a large amount of memory to compile with the heaviest toolkit requiring 1GB of RAM. Where K is the amount of memory you have on your machine in GB, we recommend not exceeding make -j K Alternatively, if you know exactly which toolkit you want to build, cd into the toolkit’s sub-directory and running make, will be significantly faster as it will only download the minimal set of dependencies for that toolkit. For instance: cd release/toolkits/graph_analytics make -j4 will build only the Graph Analytics toolkit and will not need to obtain OpenCV, Eigen, etc used by the other toolkits. Writing Your Own Apps --------------------- There are two ways to write your own apps. 1: To work in the GraphLab source tree, (recommended) 2: Install and link against Graphlab (not recommended) ### 1: Working in the GraphLab Source Tree This is the best option if you just want to try using GraphLab quickly. GraphLab uses the CMake build system which enables you to quickly create a c++ project without having to write complicated Makefiles. 1: Create your own sub-directory in the apps/ directory. for example apps/my_app 2: Create a CMakeLists.txt in apps/my_app containing the following lines: project(GraphLab) add_graphlab_executable(my_app [List of cpp files space seperated]) Substituting the right values into the square brackets. For instance: project(GraphLab) add_graphlab_executable(my_app my_app.cpp) 4: Running "make" in the apps/ directory of any of the build directories should compile your app. If your app does not show up, try running cd [the GraphLab API directory] touch apps/CMakeLists.txt and try again. ### 2: Installing and Linking Against GraphLab To install graphlab and use GraphLab this way will require your system to completely satisfy all remaining dependencies, which GraphLab normally builds automatically. This path is not extensively tested and is **not recommended** You will require the following additional dependencies - libevent (>=2.0.18) - libjson (>=7.6.0) - libboost (>=1.53) - libhdfs (required for HDFS support) - tcmalloc (optional) Follow the instructions in the [Compiling] section to build the release/ version of the library. Then cd into the release/ build directory and run make install . This will install the following: * include/graphlab.hpp + The primary GraphLab header * include/graphlab/... + The folder containing the headers for the rest of the GraphLab library * lib/libgraphlab.a + The GraphLab static library. Once you have installed GraphLab you can compile your program by running: g++ -O3 -pthread -lzookeeper_mt -lzookeeper_st -lboost_context -lz -ltcmalloc -levent -levent_pthreads -ljson -lboost_filesystem -lboost_program_options -lboost_system -lboost_iostreams -lboost_date_time -lhdfs -lgraphlab hello_world.cpp If you have compiled with MPI support, you will also need -lmpi -lmpi++
{ "content_hash": "4b669c2f08e6e98bfe31f08cf132a085", "timestamp": "", "source": "github", "line_count": 194, "max_line_length": 242, "avg_line_length": 33.41237113402062, "alnum_prop": 0.7554767047207652, "repo_name": "xcgoner/powerlore", "id": "24c37f6c67865214808308feb54b6bd1a941d4ab", "size": "6486", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "46026" }, { "name": "C++", "bytes": "5303181" }, { "name": "CMake", "bytes": "170200" }, { "name": "CSS", "bytes": "2312" }, { "name": "HTML", "bytes": "6916" }, { "name": "JavaScript", "bytes": "24976" }, { "name": "Makefile", "bytes": "496" }, { "name": "Matlab", "bytes": "23015" }, { "name": "Objective-C", "bytes": "9268" }, { "name": "Python", "bytes": "363880" }, { "name": "Scala", "bytes": "490" }, { "name": "Shell", "bytes": "43077" } ], "symlink_target": "" }
package br.ufu.cti.estagio.testes.carlos.extra1; public class Jogo { private String name; private int start; private int end; public Jogo(String name, int start, int end) { //Constructor this.name = name; this.start = start; this.end = end; } public void setName(String name) { this.name = name; } public void setStart(int start) { this.start = start; } public void setEnd(int end) { this.end = end; } public String getName() { return name; } public int getStart() { return start; } public int getEnd() { return end; } }
{ "content_hash": "a9ca8b9ad3543709c182ed310495bc4d", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 61, "avg_line_length": 12.934782608695652, "alnum_prop": 0.626890756302521, "repo_name": "diego91964/estagio-cti", "id": "2e5ee0e70a84c1a0eb54851b6d90619c31d33879", "size": "595", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "codigo/estagio/src/test/java/br/ufu/cti/estagio/testes/carlos/extra1/Jogo.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "329779" }, { "name": "HTML", "bytes": "129653" }, { "name": "Java", "bytes": "18270" }, { "name": "JavaScript", "bytes": "178764" } ], "symlink_target": "" }
<?php $letter = ' <html> <head> <meta name="viewport" content="width=device-width"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Just Forms - HTML Email Template</title> </head> <body bgcolor="#f6f6f6" style="width: 100% !important; height: 100%; font-family: Arial, sans-serif; font-size: 100%; line-height: 1.6; margin: 0; padding: 0;"> <table style="width: 100%; padding: 20px;"><tr> <td></td> <td bgcolor="#fff" style="display: block !important; max-width: 600px !important; clear: both !important; color: #8c949e; margin: 0 auto; padding: 20px; border: 1px solid #f0f0f0;"> <div style="max-width: 600px; display: block; margin: 0 auto;"> <table style="width: 100%;"><tr> <td style="border-bottom-width: 1px; border-bottom-color: #f0f0f0; border-bottom-style: solid;"> <h2 style="font-family: Arial, sans-serif; color: #63676d; line-height: 1.2; font-weight: 200; text-align: center; font-size: 28px; margin: 18px 0;" align="center">'.$your_subject.'</h2> </td> </tr></table> </div> <div style="max-width: 600px; display: block; margin: 0 auto;"> <table style="width: 100%;"><tr> <td> <p style="margin-bottom: 10px; font-weight: normal; font-size: 14px;"><span style="font-weight: bold; color: #767b82;">Name: </span>'.$name.'</p> <p style="margin-bottom: 10px; font-weight: normal; font-size: 14px;"><span style="font-weight: bold; color: #767b82;">Email: </span>'.$email.'</p> <p style="margin-bottom: 10px; font-weight: normal; font-size: 14px;"><span style="font-weight: bold; color: #767b82;">Subscription type: </span>'.$newsletter.'</p> </td> </tr></table> </div> </td> <td></td> </tr></table> <table style="width: 100%; clear: both !important;"><tr> <td></td> <td style="display: block !important; max-width: 600px !important; clear: both !important; margin: 0 auto;"> <div style="max-width: 600px; display: block; margin: 0 auto;"> <table style="width: 100%;"><tr> <td align="center"> <p style="font-size: 12px; color: #666; margin-bottom: 10px; font-weight: normal;">Developed by: <a target="_blank" href="http://lazy-coding.com/j-forms-full/" style="color: #999; font-size: 14px;">Just Forms</a> </p> </td> </tr></table> </div> </td> <td></td> </tr></table> </body> </html>'; ?>
{ "content_hash": "3b2976889909fbce84b72a72779f8d68", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 220, "avg_line_length": 50.145833333333336, "alnum_prop": 0.6148732862484421, "repo_name": "Serious-Rage/SOCIAL-RAGE", "id": "923c7a2a6ea45536ff304da888379bf197cf9cb3", "size": "2407", "binary": false, "copies": "2", "ref": "refs/heads/SR1", "path": "j-forms/source/forms/smtp_sendmail_csv/subscribe_modal/j-folder/php/message.php", "mode": "33261", "license": "mit", "language": [ { "name": "CSS", "bytes": "44824954" }, { "name": "HTML", "bytes": "756887" }, { "name": "JavaScript", "bytes": "5690160" }, { "name": "PHP", "bytes": "63716687" } ], "symlink_target": "" }
package com.microsoft.azure.management.compute; import java.util.List; import com.fasterxml.jackson.annotation.JsonProperty; /** * The instance view of a virtual machine. */ public class VirtualMachineInstanceView { /** * Specifies the update domain of the virtual machine. */ @JsonProperty(value = "platformUpdateDomain") private Integer platformUpdateDomain; /** * Specifies the fault domain of the virtual machine. */ @JsonProperty(value = "platformFaultDomain") private Integer platformFaultDomain; /** * The Remote desktop certificate thumbprint. */ @JsonProperty(value = "rdpThumbPrint") private String rdpThumbPrint; /** * The VM Agent running on the virtual machine. */ @JsonProperty(value = "vmAgent") private VirtualMachineAgentInstanceView vmAgent; /** * The Maintenance Operation status on the virtual machine. */ @JsonProperty(value = "maintenanceRedeployStatus") private MaintenanceRedeployStatus maintenanceRedeployStatus; /** * The virtual machine disk information. */ @JsonProperty(value = "disks") private List<DiskInstanceView> disks; /** * The extensions information. */ @JsonProperty(value = "extensions") private List<VirtualMachineExtensionInstanceView> extensions; /** * The boot diagnostics. */ @JsonProperty(value = "bootDiagnostics") private BootDiagnosticsInstanceView bootDiagnostics; /** * The resource status information. */ @JsonProperty(value = "statuses") private List<InstanceViewStatus> statuses; /** * Get the platformUpdateDomain value. * * @return the platformUpdateDomain value */ public Integer platformUpdateDomain() { return this.platformUpdateDomain; } /** * Set the platformUpdateDomain value. * * @param platformUpdateDomain the platformUpdateDomain value to set * @return the VirtualMachineInstanceView object itself. */ public VirtualMachineInstanceView withPlatformUpdateDomain(Integer platformUpdateDomain) { this.platformUpdateDomain = platformUpdateDomain; return this; } /** * Get the platformFaultDomain value. * * @return the platformFaultDomain value */ public Integer platformFaultDomain() { return this.platformFaultDomain; } /** * Set the platformFaultDomain value. * * @param platformFaultDomain the platformFaultDomain value to set * @return the VirtualMachineInstanceView object itself. */ public VirtualMachineInstanceView withPlatformFaultDomain(Integer platformFaultDomain) { this.platformFaultDomain = platformFaultDomain; return this; } /** * Get the rdpThumbPrint value. * * @return the rdpThumbPrint value */ public String rdpThumbPrint() { return this.rdpThumbPrint; } /** * Set the rdpThumbPrint value. * * @param rdpThumbPrint the rdpThumbPrint value to set * @return the VirtualMachineInstanceView object itself. */ public VirtualMachineInstanceView withRdpThumbPrint(String rdpThumbPrint) { this.rdpThumbPrint = rdpThumbPrint; return this; } /** * Get the vmAgent value. * * @return the vmAgent value */ public VirtualMachineAgentInstanceView vmAgent() { return this.vmAgent; } /** * Set the vmAgent value. * * @param vmAgent the vmAgent value to set * @return the VirtualMachineInstanceView object itself. */ public VirtualMachineInstanceView withVmAgent(VirtualMachineAgentInstanceView vmAgent) { this.vmAgent = vmAgent; return this; } /** * Get the maintenanceRedeployStatus value. * * @return the maintenanceRedeployStatus value */ public MaintenanceRedeployStatus maintenanceRedeployStatus() { return this.maintenanceRedeployStatus; } /** * Set the maintenanceRedeployStatus value. * * @param maintenanceRedeployStatus the maintenanceRedeployStatus value to set * @return the VirtualMachineInstanceView object itself. */ public VirtualMachineInstanceView withMaintenanceRedeployStatus(MaintenanceRedeployStatus maintenanceRedeployStatus) { this.maintenanceRedeployStatus = maintenanceRedeployStatus; return this; } /** * Get the disks value. * * @return the disks value */ public List<DiskInstanceView> disks() { return this.disks; } /** * Set the disks value. * * @param disks the disks value to set * @return the VirtualMachineInstanceView object itself. */ public VirtualMachineInstanceView withDisks(List<DiskInstanceView> disks) { this.disks = disks; return this; } /** * Get the extensions value. * * @return the extensions value */ public List<VirtualMachineExtensionInstanceView> extensions() { return this.extensions; } /** * Set the extensions value. * * @param extensions the extensions value to set * @return the VirtualMachineInstanceView object itself. */ public VirtualMachineInstanceView withExtensions(List<VirtualMachineExtensionInstanceView> extensions) { this.extensions = extensions; return this; } /** * Get the bootDiagnostics value. * * @return the bootDiagnostics value */ public BootDiagnosticsInstanceView bootDiagnostics() { return this.bootDiagnostics; } /** * Set the bootDiagnostics value. * * @param bootDiagnostics the bootDiagnostics value to set * @return the VirtualMachineInstanceView object itself. */ public VirtualMachineInstanceView withBootDiagnostics(BootDiagnosticsInstanceView bootDiagnostics) { this.bootDiagnostics = bootDiagnostics; return this; } /** * Get the statuses value. * * @return the statuses value */ public List<InstanceViewStatus> statuses() { return this.statuses; } /** * Set the statuses value. * * @param statuses the statuses value to set * @return the VirtualMachineInstanceView object itself. */ public VirtualMachineInstanceView withStatuses(List<InstanceViewStatus> statuses) { this.statuses = statuses; return this; } }
{ "content_hash": "cb75d29730860b076ead34f2f85b2af8", "timestamp": "", "source": "github", "line_count": 247, "max_line_length": 122, "avg_line_length": 26.473684210526315, "alnum_prop": 0.6637100474078605, "repo_name": "martinsawicki/azure-sdk-for-java", "id": "ed1858464d5b8ff4d63c71ada76612c3d326e4dc", "size": "6769", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineInstanceView.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "31090060" }, { "name": "JavaScript", "bytes": "7170" }, { "name": "PowerShell", "bytes": "160" }, { "name": "Shell", "bytes": "609" } ], "symlink_target": "" }
<?xml version="1.0" encoding="utf-8"?> <doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> <entity name="Ubicacion" table="ubicacion"> <id name="id" type="bigint" column="id"> <generator strategy="SEQUENCE"/> </id> <field name="direccion" type="string" column="direccion" length="150" nullable="false"/> <field name="latitud" type="float" column="latitud" nullable="false"/> <field name="longitud" type="float" column="longitud" nullable="false"/> <field name="referencia" type="text" column="referencia" nullable="true"/> <many-to-one field="idUbigeo" target-entity="Ubigeo"> <join-columns> <join-column name="id_ubigeo" referenced-column-name="id"/> </join-columns> </many-to-one> </entity> </doctrine-mapping>
{ "content_hash": "ed398bbaba919846b451f0ac6ce19caf", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 276, "avg_line_length": 58.8235294117647, "alnum_prop": 0.692, "repo_name": "marx8926/ae", "id": "cd7bca085690e6ecbabe58579e116f1669600519", "size": "1000", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/AE/DataBundle/Resources/config/doctrine/metadata/orm/Ubicacion.orm.xml", "mode": "33188", "license": "mit", "language": [ { "name": "ActionScript", "bytes": "15982" }, { "name": "CSS", "bytes": "567966" }, { "name": "JavaScript", "bytes": "2797613" }, { "name": "OpenEdge ABL", "bytes": "42" }, { "name": "PHP", "bytes": "4987391" } ], "symlink_target": "" }
class Domain < ActiveRecord::Base belongs_to :admin has_many :users end
{ "content_hash": "b465c43811265b6edd7c5b5e4069c0a9", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 33, "avg_line_length": 19, "alnum_prop": 0.7368421052631579, "repo_name": "datWav/MailAdmin", "id": "8aa67d9cf0bc07dbe7847e7fc42263a7a8a7efe4", "size": "76", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "app/models/domain.rb", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "1303" }, { "name": "CoffeeScript", "bytes": "633" }, { "name": "HTML", "bytes": "27246" }, { "name": "JavaScript", "bytes": "699" }, { "name": "Ruby", "bytes": "52209" } ], "symlink_target": "" }
$LOAD_PATH.unshift File.expand_path("../../lib", __FILE__) require "geetest3"
{ "content_hash": "6dd93eb43af846f7de93c4fb8bd678fe", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 58, "avg_line_length": 39, "alnum_prop": 0.6538461538461539, "repo_name": "jay16/gt-ruby-sdk3", "id": "41b239a4edfc98c2bf74f1264b468bd2107516b5", "size": "78", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "spec/spec_helper.rb", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "8736" }, { "name": "Ruby", "bytes": "8470" }, { "name": "Shell", "bytes": "131" } ], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <Configuration status="WARN"> <!-- logging level for log4j2 events --> <Properties> <Property name="defaultLayoutPattern">[%-5level] [%date{ISO8601}] [%15.15thread] [%40.40logger{3.}:%-5.5line] | %message%n</Property> <Property name="stdoutLayoutPattern">${sd:defaultLayoutPattern}</Property> <Property name="fileLayoutPattern">${sd:defaultLayoutPattern}</Property> <Property name="logFileName">${env:LOG_FILE_NAME:-all}</Property> </Properties> <Appenders> <Console name="stdout" target="SYSTEM_OUT"> <PatternLayout pattern="${sd:stdoutLayoutPattern}" charset="UTF-8" /> </Console> <RollingFile name="file-all" fileName="logs/${sd:logFileName}.log" filePattern="logs/${sd:logFileName}.%d{yyyy-MM-dd}.%i.log.gz" append="true" immediateFlush="false"> <PatternLayout pattern="${sd:fileLayoutPattern}" charset="UTF-8" /> <Policies><!-- events of triggering rolling --> <OnStartupTriggeringPolicy /> <SizeBasedTriggeringPolicy size="200MB" /> <TimeBasedTriggeringPolicy /> </Policies> <DefaultRolloverStrategy max="30" /> </RollingFile> </Appenders> <Loggers> <!-- 1. async all loggers with vm arguments (recommended for efficiency) -DLog4jContextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector 2. or use <AyncLogger>, <AsyncRoot> (recommended for certainty) <AsyncLogger name="com.at" level="trace" includeLocation="true" additivity="false"> <AppenderRef ref="file-all" /> </AsyncLogger> --> <!-- common loggers --> <AsyncLogger name="org.hibernate" level="WARN" includeLocation="true" /> <AsyncLogger name="org.springframework" level="WARN" includeLocation="true" /> <AsyncLogger name="org.apache" level="WARN" includeLocation="true" /> <AsyncLogger name="net.sf.ehcache" level="WARN" includeLocation="true" /> <AsyncLogger name="org.springframework.cache" level="WARN" includeLocation="true" /> <!-- special loggers --> <AsyncLogger name="com.at" level="DEBUG" includeLocation="true" /> <AsyncRoot level="INFO" includeLocation="true"> <AppenderRef ref="stdout" /> <AppenderRef ref="file-all" /> </AsyncRoot> </Loggers> </Configuration>
{ "content_hash": "a786576288a9fd10512982e54b0ecf5d", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 137, "avg_line_length": 42.81818181818182, "alnum_prop": 0.6598726114649681, "repo_name": "alphatan/workspace_java", "id": "dfd5b6673ddd3fa05eb1981ff2aecc88a9f13767", "size": "2355", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "spring-boot-web-fps-demo/src/main/resources/log4j2.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "2717" }, { "name": "HTML", "bytes": "47728" }, { "name": "Java", "bytes": "1784425" }, { "name": "JavaScript", "bytes": "5421" }, { "name": "TSQL", "bytes": "8062" }, { "name": "XSLT", "bytes": "1335" } ], "symlink_target": "" }
ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
{ "content_hash": "4a69a0390b954bfd22b75bf8a4e89e9f", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 31, "avg_line_length": 9.692307692307692, "alnum_prop": 0.7063492063492064, "repo_name": "mdoering/backbone", "id": "add0e070fa162fa379180f2ba70a2812d0a9f756", "size": "178", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Asterales/Asteraceae/Conyza/Conyza montevidensis/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
<?php /** * Created by PhpStorm. * User: morontt * Date: 11.10.17 * Time: 23:27 */ namespace Mtt\BlogBundle\Telegram; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Reference; class TelegramCompilerPass implements CompilerPassInterface { public function process(ContainerBuilder $container) { if (!$container->has('mtt_blog.telegram_bot')) { return; } $definition = $container->findDefinition('mtt_blog.telegram_bot'); foreach ($container->findTaggedServiceIds('telegram-command') as $id => $tags) { $definition->addMethodCall( 'addCommand', [new Reference($id)] ); } } }
{ "content_hash": "3996b55b5b0e7efc7830fdeb2b9ec98b", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 88, "avg_line_length": 25.96875, "alnum_prop": 0.6546329723225031, "repo_name": "morontt/zend-blog-3-backend", "id": "37a6448bcce46ec53675cc50399096d2b08009f6", "size": "831", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Mtt/BlogBundle/Telegram/TelegramCompilerPass.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "12050" }, { "name": "Dockerfile", "bytes": "3615" }, { "name": "Gherkin", "bytes": "2678" }, { "name": "HTML", "bytes": "1575" }, { "name": "Handlebars", "bytes": "36570" }, { "name": "JavaScript", "bytes": "56091" }, { "name": "PHP", "bytes": "430417" }, { "name": "Shell", "bytes": "3956" }, { "name": "Twig", "bytes": "7601" } ], "symlink_target": "" }
using System; using System.Html; using System.Runtime.CompilerServices; namespace jQueryApi.UI { [Imported] [IgnoreNamespace] [Serializable] public sealed class MouseOptions { /// <summary> /// Prevents interactions from starting on specified elements. /// </summary> public string Cancel { get; set; } /// <summary> /// Time in milliseconds after mousedown until the interaction should start. This option can be used to prevent unwanted interactions when clicking on an element. /// </summary> public int Delay { get; set; } /// <summary> /// Distance in pixels after mousedown the mouse must move before the interaction should start. This option can be used to prevent unwanted interactions when clicking on an element. /// </summary> public int Distance { get; set; } } }
{ "content_hash": "b0ba4478d6ea8a7530ef7115f21d02de", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 189, "avg_line_length": 28.96969696969697, "alnum_prop": 0.6119246861924686, "repo_name": "Saltarelle/SaltarelleJQueryUI", "id": "1497d016efd3be71bc74eab49836885e26a7825e", "size": "956", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "jQuery.UI/Generated/Utilities/Mouse/MouseOptions.cs", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C#", "bytes": "56948" }, { "name": "PowerShell", "bytes": "32264" } ], "symlink_target": "" }
module TokyoMetro::Modules::Fundamental::Static::Hash end
{ "content_hash": "704c0d10540f1770e0b32d4a4cb1dc0d", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 53, "avg_line_length": 29, "alnum_prop": 0.8103448275862069, "repo_name": "osorubeki-fujita/odpt_tokyo_metro", "id": "86ea0efd5ea369264b6775a90eec255bb2df7b9f", "size": "150", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/tokyo_metro/modules/fundamental/static/hash.rb", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "1712210" }, { "name": "Shell", "bytes": "115" } ], "symlink_target": "" }
<!-- This file is machine generated: DO NOT EDIT! --> # Metrics (contrib) [TOC] ##Ops for evaluation metrics and summary statistics. ### API This module provides functions for computing streaming metrics: metrics computed on dynamically valued `Tensors`. Each metric declaration returns a "value_tensor", an idempotent operation that returns the current value of the metric, and an "update_op", an operation that accumulates the information from the current value of the `Tensors` being measured as well as returns the value of the "value_tensor". To use any of these metrics, one need only declare the metric, call `update_op` repeatedly to accumulate data over the desired number of `Tensor` values (often each one is a single batch) and finally evaluate the value_tensor. For example, to use the `streaming_mean`: ```python value = ... mean_value, update_op = tf.contrib.metrics.streaming_mean(values) sess.run(tf.initialize_local_variables()) for i in range(number_of_batches): print('Mean after batch %d: %f' % (i, update_op.eval()) print('Final Mean: %f' % mean_value.eval()) ``` Each metric function adds nodes to the graph that hold the state necessary to compute the value of the metric as well as a set of operations that actually perform the computation. Every metric evaluation is composed of three steps * Initialization: initializing the metric state. * Aggregation: updating the values of the metric state. * Finalization: computing the final metric value. In the above example, calling streaming_mean creates a pair of state variables that will contain (1) the running sum and (2) the count of the number of samples in the sum. Because the streaming metrics use local variables, the Initialization stage is performed by running the op returned by `tf.initialize_local_variables()`. It sets the sum and count variables to zero. Next, Aggregation is performed by examining the current state of `values` and incrementing the state variables appropriately. This step is executed by running the `update_op` returned by the metric. Finally, finalization is performed by evaluating the "value_tensor" In practice, we commonly want to evaluate across many batches and multiple metrics. To do so, we need only run the metric computation operations multiple times: ```python labels = ... predictions = ... accuracy, update_op_acc = tf.contrib.metrics.streaming_accuracy( labels, predictions) error, update_op_error = tf.contrib.metrics.streaming_mean_absolute_error( labels, predictions) sess.run(tf.initialize_local_variables()) for batch in range(num_batches): sess.run([update_op_acc, update_op_error]) accuracy, mean_absolute_error = sess.run([accuracy, mean_absolute_error]) ``` Note that when evaluating the same metric multiple times on different inputs, one must specify the scope of each metric to avoid accumulating the results together: ```python labels = ... predictions0 = ... predictions1 = ... accuracy0 = tf.contrib.metrics.accuracy(labels, predictions0, name='preds0') accuracy1 = tf.contrib.metrics.accuracy(labels, predictions1, name='preds1') ``` Certain metrics, such as streaming_mean or streaming_accuracy, can be weighted via a `weights` argument. The `weights` tensor must be the same size as the labels and predictions tensors and results in a weighted average of the metric. Other metrics, such as streaming_recall, streaming_precision, and streaming_auc, are not well defined with regard to weighted samples. However, a binary `ignore_mask` argument can be used to ignore certain values at graph executation time. ## Metric `Ops` - - - ### `tf.contrib.metrics.streaming_accuracy(predictions, labels, weights=None, metrics_collections=None, updates_collections=None, name=None)` {#streaming_accuracy} Calculates how often `predictions` matches `labels`. The `streaming_accuracy` function creates two local variables, `total` and `count` that are used to compute the frequency with which `predictions` matches `labels`. This frequency is ultimately returned as `accuracy`: an idempotent operation that simply divides `total` by `count`. To facilitate the estimation of the accuracy over a stream of data, the function utilizes two operations. First, an `is_correct` operation that computes a tensor whose shape matches `predictions` and whose elements are set to 1.0 when the corresponding values of `predictions` and `labels match and 0.0 otherwise. Second, an `update_op` operation whose behavior is dependent on the value of `weights`. If `weights` is None, then `update_op` increments `total` with the number of elements of `predictions` that match `labels` and increments `count` with the number of elements in `values`. If `weights` is not `None`, then `update_op` increments `total` with the reduced sum of the product of `weights` and `is_correct` and increments `count` with the reduced sum of `weights`. In addition to performing the updates, `update_op` also returns the `accuracy` value. ##### Args: * <b>`predictions`</b>: The predicted values, a `Tensor` of any shape. * <b>`labels`</b>: The ground truth values, a `Tensor` whose shape matches `predictions`. * <b>`weights`</b>: An optional set of weights whose shape matches `predictions` which, when not `None`, produces a weighted mean accuracy. * <b>`metrics_collections`</b>: An optional list of collections that `accuracy` should be added to. * <b>`updates_collections`</b>: An optional list of collections that `update_op` should be added to. * <b>`name`</b>: An optional variable_op_scope name. ##### Returns: * <b>`accuracy`</b>: A tensor representing the accuracy, the value of `total` divided by `count`. * <b>`update_op`</b>: An operation that increments the `total` and `count` variables appropriately and whose value matches `accuracy`. ##### Raises: * <b>`ValueError`</b>: If the dimensions of `predictions` and `labels` don't match or if `weight` is not `None` and its shape doesn't match `predictions` or if either `metrics_collections` or `updates_collections` are not a list or tuple. - - - ### `tf.contrib.metrics.streaming_mean(values, weights=None, metrics_collections=None, updates_collections=None, name=None)` {#streaming_mean} Computes the (weighted) mean of the given values. The `streaming_mean` function creates two local variables, `total` and `count` that are used to compute the average of `values`. This average is ultimately returned as `mean` which is an idempotent operation that simply divides `total` by `count`. To facilitate the estimation of a mean over a stream of data, the function creates an `update_op` operation whose behavior is dependent on the value of `weights`. If `weights` is None, then `update_op` increments `total` with the reduced sum of `values` and increments `count` with the number of elements in `values`. If `weights` is not `None`, then `update_op` increments `total` with the reduced sum of the product of `values` and `weights` and increments `count` with the reduced sum of weights. In addition to performing the updates, `update_op` also returns the `mean`. ##### Args: * <b>`values`</b>: A `Tensor` of arbitrary dimensions. * <b>`weights`</b>: An optional set of weights of the same shape as `values`. If `weights` is not None, the function computes a weighted mean. * <b>`metrics_collections`</b>: An optional list of collections that `mean` should be added to. * <b>`updates_collections`</b>: An optional list of collections that `update_op` should be added to. * <b>`name`</b>: An optional variable_op_scope name. ##### Returns: * <b>`mean`</b>: A tensor representing the current mean, the value of `total` divided by `count`. * <b>`update_op`</b>: An operation that increments the `total` and `count` variables appropriately and whose value matches `mean_value`. ##### Raises: * <b>`ValueError`</b>: If `weights` is not `None` and its shape doesn't match `values` or if either `metrics_collections` or `updates_collections` are not a list or tuple. - - - ### `tf.contrib.metrics.streaming_recall(predictions, labels, ignore_mask=None, metrics_collections=None, updates_collections=None, name=None)` {#streaming_recall} Computes the recall of the predictions with respect to the labels. The `streaming_recall` function creates two local variables, `true_positives` and `false_negatives`, that are used to compute the recall. This value is ultimately returned as `recall`, an idempotent operation that simply divides `true_positives` by the sum of `true_positives` and `false_negatives`. To facilitate the calculation of the recall over a stream of data, the function creates an `update_op` operation whose behavior is dependent on the value of `ignore_mask`. If `ignore_mask` is None, then `update_op` increments `true_positives` with the number of elements of `predictions` and `labels` that are both `True` and increments `false_negatives` with the number of elements of `predictions` that are `False` whose corresponding `labels` element is `False`. If `ignore_mask` is not `None`, then the increments for `true_positives` and `false_negatives` are only computed using elements of `predictions` and `labels` whose corresponding values in `ignore_mask` are `False`. In addition to performing the updates, `update_op` also returns the value of `recall`. ##### Args: * <b>`predictions`</b>: The predicted values, a binary `Tensor` of arbitrary shape. * <b>`labels`</b>: The ground truth values, a binary `Tensor` whose dimensions must match `predictions`. * <b>`ignore_mask`</b>: An optional, binary tensor whose size matches `predictions`. * <b>`metrics_collections`</b>: An optional list of collections that `recall` should be added to. * <b>`updates_collections`</b>: An optional list of collections that `update_op` should be added to. * <b>`name`</b>: An optional variable_op_scope name. ##### Returns: * <b>`recall`</b>: Scalar float `Tensor` with the value of `true_positives` divided by the sum of `true_positives` and `false_negatives`. * <b>`update_op`</b>: `Operation` that increments `true_positives` and `false_negatives` variables appropriately and whose value matches `recall`. ##### Raises: * <b>`ValueError`</b>: If the dimensions of `predictions` and `labels` don't match or if `ignore_mask` is not `None` and its shape doesn't match `predictions` or if either `metrics_collections` or `updates_collections` are not a list or tuple. - - - ### `tf.contrib.metrics.streaming_precision(predictions, labels, ignore_mask=None, metrics_collections=None, updates_collections=None, name=None)` {#streaming_precision} Computes the precision of the predictions with respect to the labels. The `streaming_precision` function creates two local variables, `true_positives` and `false_positives`, that are used to compute the precision. This value is ultimately returned as `precision`, an idempotent operation that simply divides `true_positives` by the sum of `true_positives` and `false_positives`. To facilitate the calculation of the precision over a stream of data, the function creates an `update_op` operation whose behavior is dependent on the value of `ignore_mask`. If `ignore_mask` is None, then `update_op` increments `true_positives` with the number of elements of `predictions` and `labels` that are both `True` and increments `false_positives` with the number of elements of `predictions` that are `True` whose corresponding `labels` element is `False`. If `ignore_mask` is not `None`, then the increments for `true_positives` and `false_positives` are only computed using elements of `predictions` and `labels` whose corresponding values in `ignore_mask` are `False`. In addition to performing the updates, `update_op` also returns the value of `precision`. ##### Args: * <b>`predictions`</b>: The predicted values, a binary `Tensor` of arbitrary shape. * <b>`labels`</b>: The ground truth values, a binary `Tensor` whose dimensions must match `predictions`. * <b>`ignore_mask`</b>: An optional, binary tensor whose size matches `predictions`. * <b>`metrics_collections`</b>: An optional list of collections that `precision` should be added to. * <b>`updates_collections`</b>: An optional list of collections that `update_op` should be added to. * <b>`name`</b>: An optional variable_op_scope name. ##### Returns: * <b>`precision`</b>: Scalar float `Tensor` with the value of `true_positives` divided by the sum of `true_positives` and `false_positives`. * <b>`update_op`</b>: `Operation` that increments `true_positives` and `false_positives` variables appropriately and whose value matches `precision`. ##### Raises: * <b>`ValueError`</b>: If the dimensions of `predictions` and `labels` don't match or if `ignore_mask` is not `None` and its shape doesn't match `predictions` or if either `metrics_collections` or `updates_collections` are not a list or tuple. - - - ### `tf.contrib.metrics.streaming_auc(predictions, labels, ignore_mask=None, num_thresholds=200, metrics_collections=None, updates_collections=None, curve='ROC', name=None)` {#streaming_auc} Computes the approximate AUC via a Riemann sum. The `streaming_auc` function creates four local variables, `true_positives`, `true_negatives`, `false_positives` and `false_negatives` that are used to compute the AUC. To discretize the AUC curve, a linearly spaced set of thresholds is used to compute pairs of recall and precision values. The area under the ROC-curve is therefore computed using the height of the recall values by the false positive rate, while the area under the PR-curve is the computed using the height of the precision values by the recall. This value is ultimately returned as `auc`, an idempotent operation the computes the area under a discretized curve of precision versus recall values (computed using the afformentioned variables). The `num_thresholds` variable controls the degree of discretization with larger numbers of thresholds more closely approximating the true AUC. To faciliate the estimation of the AUC over a stream of data, the function creates an `update_op` operation whose behavior is dependent on the value of `ignore_mask`. If `ignore_mask` is None, then `update_op` increments the `true_positives`, `true_negatives`, `false_positives` and `false_negatives` counts with the number of each found in the current `predictions` and `labels` `Tensors`. If `ignore_mask` is not `None`, then the increment is performed using only the elements of `predictions` and `labels` whose corresponding value in `ignore_mask` is `False`. In addition to performing the updates, `update_op` also returns the `auc`. ##### Args: * <b>`predictions`</b>: A floating point `Tensor` of arbitrary shape and whose values are in the range `[0, 1]`. * <b>`labels`</b>: A binary `Tensor` whose shape matches `predictions`. * <b>`ignore_mask`</b>: An optional, binary tensor whose size matches `predictions`. * <b>`num_thresholds`</b>: The number of thresholds to use when discretizing the roc curve. * <b>`metrics_collections`</b>: An optional list of collections that `auc` should be added to. * <b>`updates_collections`</b>: An optional list of collections that `update_op` should be added to. * <b>`curve`</b>: Specifies the name of the curve to be computed, 'ROC' [default] or 'PR' for the Precision-Recall-curve. * <b>`name`</b>: An optional variable_op_scope name. ##### Returns: * <b>`auc`</b>: A scalar tensor representing the current area-under-curve. * <b>`update_op`</b>: An operation that increments the `true_positives`, `true_negatives`, `false_positives` and `false_negatives` variables appropriately and whose value matches `auc`. ##### Raises: * <b>`ValueError`</b>: If the shape of `predictions` and `labels` do not match or if `ignore_mask` is not `None` and its shape doesn't match `predictions` or if either `metrics_collections` or `updates_collections` are not a list or tuple. - - - ### `tf.contrib.metrics.streaming_recall_at_k(predictions, labels, k, ignore_mask=None, metrics_collections=None, updates_collections=None, name=None)` {#streaming_recall_at_k} Computes the recall@k of the predictions with respect to dense labels. The `streaming_recall_at_k` function creates two local variables, `total` and `count`, that are used to compute the recall@k frequency. This frequency is ultimately returned as `recall_at_<k>`: an idempotent operation that simply divides `total` by `count`. To facilitate the estimation of recall@k over a stream of data, the function utilizes two operations. First, an `in_top_k` operation computes a tensor with shape [batch_size] whose elements indicate whether or not the corresponding label is in the top `k` predictions of the `predictions` `Tensor`. Second, an `update_op` operation whose behavior is dependent on the value of `ignore_mask`. If `ignore_mask` is None, then `update_op` increments `total` with the number of elements of `in_top_k` that are set to `True` and increments `count` with the batch size. If `ignore_mask` is not `None`, then `update_op` increments `total` with the number of elements in `in_top_k` that are `True` whose corresponding element in `ignore_mask` is `False`. In addition to performing the updates, `update_op` also returns the recall value. ##### Args: * <b>`predictions`</b>: A floating point tensor of dimension [batch_size, num_classes] * <b>`labels`</b>: A tensor of dimension [batch_size] whose type is in `int32`, `int64`. * <b>`k`</b>: The number of top elements to look at for computing recall. * <b>`ignore_mask`</b>: An optional, binary tensor whose size matches `labels`. If an element of `ignore_mask` is True, the corresponding prediction and label pair is used to compute the metrics. Otherwise, the pair is ignored. * <b>`metrics_collections`</b>: An optional list of collections that `recall_at_k` should be added to. * <b>`updates_collections`</b>: An optional list of collections `update_op` should be added to. * <b>`name`</b>: An optional variable_op_scope name. ##### Returns: * <b>`recall_at_k`</b>: A tensor representing the recall@k, the fraction of labels which fall into the top `k` predictions. * <b>`update_op`</b>: An operation that increments the `total` and `count` variables appropriately and whose value matches `recall_at_k`. ##### Raises: * <b>`ValueError`</b>: If the dimensions of `predictions` and `labels` don't match or if `ignore_mask` is not `None` and its shape doesn't match `predictions` or if either `metrics_collections` or `updates_collections` are not a list or tuple. - - - ### `tf.contrib.metrics.streaming_mean_absolute_error(predictions, labels, weights=None, metrics_collections=None, updates_collections=None, name=None)` {#streaming_mean_absolute_error} Computes the mean absolute error between the labels and predictions. The `streaming_mean_absolute_error` function creates two local variables, `total` and `count` that are used to compute the mean absolute error. This average is ultimately returned as `mean_absolute_error`: an idempotent operation that simply divides `total` by `count`. To facilitate the estimation of the mean absolute error over a stream of data, the function utilizes two operations. First, an `absolute_errors` operation computes the absolute value of the differences between `predictions` and `labels`. Second, an `update_op` operation whose behavior is dependent on the value of `weights`. If `weights` is None, then `update_op` increments `total` with the reduced sum of `absolute_errors` and increments `count` with the number of elements in `absolute_errors`. If `weights` is not `None`, then `update_op` increments `total` with the reduced sum of the product of `weights` and `absolute_errors` and increments `count` with the reduced sum of `weights`. In addition to performing the updates, `update_op` also returns the `mean_absolute_error` value. ##### Args: * <b>`predictions`</b>: A `Tensor` of arbitrary shape. * <b>`labels`</b>: A `Tensor` of the same shape as `predictions`. * <b>`weights`</b>: An optional set of weights of the same shape as `predictions`. If `weights` is not None, the function computes a weighted mean. * <b>`metrics_collections`</b>: An optional list of collections that `mean_absolute_error` should be added to. * <b>`updates_collections`</b>: An optional list of collections that `update_op` should be added to. * <b>`name`</b>: An optional variable_op_scope name. ##### Returns: * <b>`mean_absolute_error`</b>: A tensor representing the current mean, the value of `total` divided by `count`. * <b>`update_op`</b>: An operation that increments the `total` and `count` variables appropriately and whose value matches `mean_absolute_error`. ##### Raises: * <b>`ValueError`</b>: If `weights` is not `None` and its shape doesn't match `predictions` or if either `metrics_collections` or `updates_collections` are not a list or tuple. - - - ### `tf.contrib.metrics.streaming_mean_iou(predictions, labels, num_classes, ignore_mask=None, metrics_collections=None, updates_collections=None, name=None)` {#streaming_mean_iou} Calculate per-step mean Intersection-Over-Union (mIOU). Mean Intersection-Over-Union is a common evaluation metric for semantic image segmentation, which first computes the IOU for each semantic class and then computes the average over classes. ##### IOU is defined as follows: IOU = true_positive / (true_positive + false_positive + false_negative). The predictions are accumulated in a confusion matrix, and mIOU is then calculated from it. ##### Args: * <b>`predictions`</b>: A tensor of prediction results for semantic labels, whose shape is [batch size] and type `int32` or `int64`. The tensor will be flattened, if its rank > 1. * <b>`labels`</b>: A tensor of ground truth labels with shape [batch size] and of type `int32` or `int64`. The tensor will be flattened, if its rank > 1. * <b>`num_classes`</b>: The possible number of labels the prediction task can have. This value must be provided, since a confusion matrix of dimension = [num_classes, num_classes] will be allocated. * <b>`ignore_mask`</b>: An optional, boolean tensor whose size matches `labels`. If an element of `ignore_mask` is True, the corresponding prediction and label pair is NOT used to compute the metrics. Otherwise, the pair is included. * <b>`metrics_collections`</b>: An optional list of collections that `mean_iou` should be added to. * <b>`updates_collections`</b>: An optional list of collections `update_op` should be added to. * <b>`name`</b>: An optional variable_op_scope name. ##### Returns: * <b>`mean_iou`</b>: A tensor representing the mean intersection-over-union. * <b>`update_op`</b>: An operation that increments the confusion matrix. ##### Raises: * <b>`ValueError`</b>: If the dimensions of `predictions` and `labels` don't match or if `ignore_mask` is not `None` and its shape doesn't match `labels` or if either `metrics_collections` or `updates_collections` are not a list or tuple. - - - ### `tf.contrib.metrics.streaming_mean_relative_error(predictions, labels, normalizer, weights=None, metrics_collections=None, updates_collections=None, name=None)` {#streaming_mean_relative_error} Computes the mean relative error by normalizing with the given values. The `streaming_mean_relative_error` function creates two local variables, `total` and `count` that are used to compute the mean relative absolute error. This average is ultimately returned as `mean_relative_error`: an idempotent operation that simply divides `total` by `count`. To facilitate the estimation of the mean relative error over a stream of data, the function utilizes two operations. First, a `relative_errors` operation divides the absolute value of the differences between `predictions` and `labels` by the `normalizer`. Second, an `update_op` operation whose behavior is dependent on the value of `weights`. If `weights` is None, then `update_op` increments `total` with the reduced sum of `relative_errors` and increments `count` with the number of elements in `relative_errors`. If `weights` is not `None`, then `update_op` increments `total` with the reduced sum of the product of `weights` and `relative_errors` and increments `count` with the reduced sum of `weights`. In addition to performing the updates, `update_op` also returns the `mean_relative_error` value. ##### Args: * <b>`predictions`</b>: A `Tensor` of arbitrary shape. * <b>`labels`</b>: A `Tensor` of the same shape as `predictions`. * <b>`normalizer`</b>: A `Tensor` of the same shape as `predictions`. * <b>`weights`</b>: An optional set of weights of the same shape as `predictions`. If `weights` is not None, the function computes a weighted mean. * <b>`metrics_collections`</b>: An optional list of collections that `mean_relative_error` should be added to. * <b>`updates_collections`</b>: An optional list of collections that `update_op` should be added to. * <b>`name`</b>: An optional variable_op_scope name. ##### Returns: * <b>`mean_relative_error`</b>: A tensor representing the current mean, the value of `total` divided by `count`. * <b>`update_op`</b>: An operation that increments the `total` and `count` variables appropriately and whose value matches `mean_relative_error`. ##### Raises: * <b>`ValueError`</b>: If `weights` is not `None` and its shape doesn't match `predictions` or if either `metrics_collections` or `updates_collections` are not a list or tuple. - - - ### `tf.contrib.metrics.streaming_mean_squared_error(predictions, labels, weights=None, metrics_collections=None, updates_collections=None, name=None)` {#streaming_mean_squared_error} Computes the mean squared error between the labels and predictions. The `streaming_mean_squared_error` function creates two local variables, `total` and `count` that are used to compute the mean squared error. This average is ultimately returned as `mean_squared_error`: an idempotent operation that simply divides `total` by `count`. To facilitate the estimation of the mean squared error over a stream of data, the function utilizes two operations. First, a `squared_error` operation computes the element-wise square of the difference between `predictions` and `labels`. Second, an `update_op` operation whose behavior is dependent on the value of `weights`. If `weights` is None, then `update_op` increments `total` with the reduced sum of `squared_error` and increments `count` with the number of elements in `squared_error`. If `weights` is not `None`, then `update_op` increments `total` with the reduced sum of the product of `weights` and `squared_error` and increments `count` with the reduced sum of `weights`. In addition to performing the updates, `update_op` also returns the `mean_squared_error` value. ##### Args: * <b>`predictions`</b>: A `Tensor` of arbitrary shape. * <b>`labels`</b>: A `Tensor` of the same shape as `predictions`. * <b>`weights`</b>: An optional set of weights of the same shape as `predictions`. If `weights` is not None, the function computes a weighted mean. * <b>`metrics_collections`</b>: An optional list of collections that `mean_squared_error` should be added to. * <b>`updates_collections`</b>: An optional list of collections that `update_op` should be added to. * <b>`name`</b>: An optional variable_op_scope name. ##### Returns: * <b>`mean_squared_error`</b>: A tensor representing the current mean, the value of `total` divided by `count`. * <b>`update_op`</b>: An operation that increments the `total` and `count` variables appropriately and whose value matches `mean_squared_error`. ##### Raises: * <b>`ValueError`</b>: If `weights` is not `None` and its shape doesn't match `predictions` or if either `metrics_collections` or `updates_collections` are not a list or tuple. - - - ### `tf.contrib.metrics.streaming_root_mean_squared_error(predictions, labels, weights=None, metrics_collections=None, updates_collections=None, name=None)` {#streaming_root_mean_squared_error} Computes the root mean squared error between the labels and predictions. The `streaming_root_mean_squared_error` function creates two local variables, `total` and `count` that are used to compute the root mean squared error. This average is ultimately returned as `root_mean_squared_error`: an idempotent operation that takes the square root of the division of `total` by `count`. To facilitate the estimation of the root mean squared error over a stream of data, the function utilizes two operations. First, a `squared_error` operation computes the element-wise square of the difference between `predictions` and `labels`. Second, an `update_op` operation whose behavior is dependent on the value of `weights`. If `weights` is None, then `update_op` increments `total` with the reduced sum of `squared_error` and increments `count` with the number of elements in `squared_error`. If `weights` is not `None`, then `update_op` increments `total` with the reduced sum of the product of `weights` and `squared_error` and increments `count` with the reduced sum of `weights`. In addition to performing the updates, `update_op` also returns the `root_mean_squared_error` value. ##### Args: * <b>`predictions`</b>: A `Tensor` of arbitrary shape. * <b>`labels`</b>: A `Tensor` of the same shape as `predictions`. * <b>`weights`</b>: An optional set of weights of the same shape as `predictions`. If `weights` is not None, the function computes a weighted mean. * <b>`metrics_collections`</b>: An optional list of collections that `root_mean_squared_error` should be added to. * <b>`updates_collections`</b>: An optional list of collections that `update_op` should be added to. * <b>`name`</b>: An optional variable_op_scope name. ##### Returns: * <b>`root_mean_squared_error`</b>: A tensor representing the current mean, the value of `total` divided by `count`. * <b>`update_op`</b>: An operation that increments the `total` and `count` variables appropriately and whose value matches `root_mean_squared_error`. ##### Raises: * <b>`ValueError`</b>: If `weights` is not `None` and its shape doesn't match `predictions` or if either `metrics_collections` or `updates_collections` are not a list or tuple. - - - ### `tf.contrib.metrics.streaming_mean_cosine_distance(predictions, labels, dim, weights=None, metrics_collections=None, updates_collections=None, name=None)` {#streaming_mean_cosine_distance} Computes the cosine distance between the labels and predictions. The `streaming_mean_cosine_distance` function creates two local variables, `total` and `count` that are used to compute the average cosine distance between `predictions` and `labels`. This average is ultimately returned as `mean_distance` which is an idempotent operation that simply divides `total` by `count. To facilitate the estimation of a mean over multiple batches of data, the function creates an `update_op` operation whose behavior is dependent on the value of `weights`. If `weights` is None, then `update_op` increments `total` with the reduced sum of `values and increments `count` with the number of elements in `values`. If `weights` is not `None`, then `update_op` increments `total` with the reduced sum of the product of `values` and `weights` and increments `count` with the reduced sum of weights. ##### Args: * <b>`predictions`</b>: A tensor of the same size as labels. * <b>`labels`</b>: A tensor of arbitrary size. * <b>`dim`</b>: The dimension along which the cosine distance is computed. * <b>`weights`</b>: An optional set of weights which indicates which predictions to ignore during metric computation. Its size matches that of labels except for the value of 'dim' which should be 1. For example if labels has dimensions [32, 100, 200, 3], then `weights` should have dimensions [32, 100, 200, 1]. * <b>`metrics_collections`</b>: An optional list of collections that the metric value variable should be added to. * <b>`updates_collections`</b>: An optional list of collections that the metric update ops should be added to. * <b>`name`</b>: An optional variable_op_scope name. ##### Returns: * <b>`mean_distance`</b>: A tensor representing the current mean, the value of `total` divided by `count`. * <b>`update_op`</b>: An operation that increments the `total` and `count` variables appropriately. ##### Raises: * <b>`ValueError`</b>: If labels and predictions are of different sizes or if the ignore_mask is of the wrong size or if either `metrics_collections` or `updates_collections` are not a list or tuple. - - - ### `tf.contrib.metrics.streaming_percentage_less(values, threshold, ignore_mask=None, metrics_collections=None, updates_collections=None, name=None)` {#streaming_percentage_less} Computes the percentage of values less than the given threshold. The `streaming_percentage_less` function creates two local variables, `total` and `count` that are used to compute the percentage of `values` that fall below `threshold`. This rate is ultimately returned as `percentage` which is an idempotent operation that simply divides `total` by `count. To facilitate the estimation of the percentage of values that fall under `threshold` over multiple batches of data, the function creates an `update_op` operation whose behavior is dependent on the value of `ignore_mask`. If `ignore_mask` is None, then `update_op` increments `total` with the number of elements of `values` that are less than `threshold` and `count` with the number of elements in `values`. If `ignore_mask` is not `None`, then `update_op` increments `total` with the number of elements of `values` that are less than `threshold` and whose corresponding entries in `ignore_mask` are False, and `count` is incremented with the number of elements of `ignore_mask` that are False. ##### Args: * <b>`values`</b>: A numeric `Tensor` of arbitrary size. * <b>`threshold`</b>: A scalar threshold. * <b>`ignore_mask`</b>: An optional mask of the same shape as 'values' which indicates which elements to ignore during metric computation. * <b>`metrics_collections`</b>: An optional list of collections that the metric value variable should be added to. * <b>`updates_collections`</b>: An optional list of collections that the metric update ops should be added to. * <b>`name`</b>: An optional variable_op_scope name. ##### Returns: * <b>`percentage`</b>: A tensor representing the current mean, the value of `total` divided by `count`. * <b>`update_op`</b>: An operation that increments the `total` and `count` variables appropriately. ##### Raises: * <b>`ValueError`</b>: If `ignore_mask` is not None and its shape doesn't match `values or if either `metrics_collections` or `updates_collections` are supplied but are not a list or tuple. - - - ### `tf.contrib.metrics.streaming_sparse_precision_at_k(predictions, labels, k, class_id=None, ignore_mask=None, metrics_collections=None, updates_collections=None, name=None)` {#streaming_sparse_precision_at_k} Computes precision@k of the predictions with respect to sparse labels. If `class_id` is specified, we calculate precision by considering only the entries in the batch for which `class_id` is in the top-k highest `predictions`, and computing the fraction of them for which `class_id` is indeed a correct label. If `class_id` is not specified, we'll calculate precision as how often on average a class among the top-k classes with the highest predicted values of a batch entry is correct and can be found in the label for that entry. `streaming_sparse_precision_at_k` creates two local variables, `true_positive_at_<k>` and `false_positive_at_<k>`, that are used to compute the precision@k frequency. This frequency is ultimately returned as `precision_at_<k>`: an idempotent operation that simply divides `true_positive_at_<k>` by total (`true_positive_at_<k>` + `false_positive_at_<k>`). To facilitate the estimation of precision@k over a stream of data, the function utilizes three steps. * A `top_k` operation computes a tensor whose elements indicate the top `k` predictions of the `predictions` `Tensor`. * Set operations are applied to `top_k` and `labels` to calculate true positives and false positives. * An `update_op` operation increments `true_positive_at_<k>` and `false_positive_at_<k>`. It also returns the precision value. ##### Args: * <b>`predictions`</b>: Float `Tensor` with shape [D1, ... DN, num_classes] where N >= 1. Commonly, N=1 and predictions has shape [batch size, num_classes]. The final dimension contains the logit values for each class. [D1, ... DN] must match `labels`. * <b>`labels`</b>: `int64` `Tensor` or `SparseTensor` with shape [D1, ... DN, num_labels], where N >= 1 and num_labels is the number of target classes for the associated prediction. Commonly, N=1 and `labels` has shape [batch_size, num_labels]. [D1, ... DN] must match `predictions_idx`. Values should be in range [0, num_classes], where num_classes is the last dimension of `predictions`. * <b>`k`</b>: Integer, k for @k metric. * <b>`class_id`</b>: Integer class ID for which we want binary metrics. This should be in range [0, num_classes], where num_classes is the last dimension of `predictions`. * <b>`ignore_mask`</b>: An optional, binary tensor whose shape is broadcastable to the the first [D1, ... DN] dimensions of `predictions_idx` and `labels`. * <b>`metrics_collections`</b>: An optional list of collections that values should be added to. * <b>`updates_collections`</b>: An optional list of collections that updates should be added to. * <b>`name`</b>: Name of new update operation, and namespace for other dependant ops. ##### Returns: * <b>`precision`</b>: Scalar `float64` `Tensor` with the value of `true_positives` divided by the sum of `true_positives` and `false_positives`. * <b>`update_op`</b>: `Operation` that increments `true_positives` and `false_positives` variables appropriately, and whose value matches `precision`. - - - ### `tf.contrib.metrics.streaming_sparse_recall_at_k(predictions, labels, k, class_id=None, ignore_mask=None, metrics_collections=None, updates_collections=None, name=None)` {#streaming_sparse_recall_at_k} Computes recall@k of the predictions with respect to sparse labels. If `class_id` is specified, we calculate recall by considering only the entries in the batch for which `class_id` is in the label, and computing the fraction of them for which `class_id` is in the top-k `predictions`. If `class_id` is not specified, we'll calculate recall as how often on average a class among the labels of a batch entry is in the top-k `predictions`. `streaming_sparse_recall_at_k` creates two local variables, `true_positive_at_<k>` and `false_negative_at_<k>`, that are used to compute the recall_at_k frequency. This frequency is ultimately returned as `recall_at_<k>`: an idempotent operation that simply divides `true_positive_at_<k>` by total (`true_positive_at_<k>` + `recall_at_<k>`). To facilitate the estimation of recall@k over a stream of data, the function utilizes three steps. * A `top_k` operation computes a tensor whose elements indicate the top `k` predictions of the `predictions` `Tensor`. * Set operations are applied to `top_k` and `labels` to calculate true positives and false negatives. * An `update_op` operation increments `true_positive_at_<k>` and `false_negative_at_<k>`. It also returns the recall value. ##### Args: * <b>`predictions`</b>: Float `Tensor` with shape [D1, ... DN, num_classes] where N >= 1. Commonly, N=1 and predictions has shape [batch size, num_classes]. The final dimension contains the logit values for each class. [D1, ... DN] must match `labels`. * <b>`labels`</b>: `int64` `Tensor` or `SparseTensor` with shape [D1, ... DN, num_labels], where N >= 1 and num_labels is the number of target classes for the associated prediction. Commonly, N=1 and `labels` has shape [batch_size, num_labels]. [D1, ... DN] must match `labels`. Values should be in range [0, num_classes], where num_classes is the last dimension of `predictions`. * <b>`k`</b>: Integer, k for @k metric. * <b>`class_id`</b>: Integer class ID for which we want binary metrics. This should be in range [0, num_classes], where num_classes is the last dimension of `predictions`. * <b>`ignore_mask`</b>: An optional, binary tensor whose shape is broadcastable to the the first [D1, ... DN] dimensions of `predictions_idx` and `labels`. * <b>`metrics_collections`</b>: An optional list of collections that values should be added to. * <b>`updates_collections`</b>: An optional list of collections that updates should be added to. * <b>`name`</b>: Name of new update operation, and namespace for other dependant ops. ##### Returns: * <b>`recall`</b>: Scalar `float64` `Tensor` with the value of `true_positives` divided by the sum of `true_positives` and `false_negatives`. * <b>`update_op`</b>: `Operation` that increments `true_positives` and `false_negatives` variables appropriately, and whose value matches `recall`. - - - ### `tf.contrib.metrics.auc_using_histogram(boolean_labels, scores, score_range, nbins=100, collections=None, check_shape=True, name=None)` {#auc_using_histogram} AUC computed by maintaining histograms. Rather than computing AUC directly, this Op maintains Variables containing histograms of the scores associated with `True` and `False` labels. By comparing these the AUC is generated, with some discretization error. See: "Efficient AUC Learning Curve Calculation" by Bouckaert. This AUC Op updates in `O(batch_size + nbins)` time and works well even with large class imbalance. The accuracy is limited by discretization error due to finite number of bins. If scores are concentrated in a fewer bins, accuracy is lower. If this is a concern, we recommend trying different numbers of bins and comparing results. ##### Args: * <b>`boolean_labels`</b>: 1-D boolean `Tensor`. Entry is `True` if the corresponding record is in class. * <b>`scores`</b>: 1-D numeric `Tensor`, same shape as boolean_labels. * <b>`score_range`</b>: `Tensor` of shape `[2]`, same dtype as `scores`. The min/max values of score that we expect. Scores outside range will be clipped. * <b>`nbins`</b>: Integer number of bins to use. Accuracy strictly increases as the number of bins increases. * <b>`collections`</b>: List of graph collections keys. Internal histogram Variables are added to these collections. Defaults to `[GraphKeys.LOCAL_VARIABLES]`. * <b>`check_shape`</b>: Boolean. If `True`, do a runtime shape check on the scores and labels. * <b>`name`</b>: A name for this Op. Defaults to "auc_using_histogram". ##### Returns: * <b>`auc`</b>: `float32` scalar `Tensor`. Fetching this converts internal histograms to auc value. * <b>`update_op`</b>: `Op`, when run, updates internal histograms. - - - ### `tf.contrib.metrics.accuracy(predictions, labels, weights=None)` {#accuracy} Computes the percentage of times that predictions matches labels. ##### Args: * <b>`predictions`</b>: the predicted values, a `Tensor` whose dtype and shape matches 'labels'. * <b>`labels`</b>: the ground truth values, a `Tensor` of any shape and integer or string dtype. * <b>`weights`</b>: None or `Tensor` of float values to reweight the accuracy. ##### Returns: Accuracy `Tensor`. ##### Raises: * <b>`ValueError`</b>: if dtypes don't match or if dtype is not integer or string. - - - ### `tf.contrib.metrics.confusion_matrix(predictions, labels, num_classes=None, dtype=tf.int32, name=None)` {#confusion_matrix} Computes the confusion matrix from predictions and labels. Calculate the Confusion Matrix for a pair of prediction and label 1-D int arrays. Considering a prediction array such as: `[1, 2, 3]` And a label array such as: `[2, 2, 3]` ##### The confusion matrix returned would be the following one: [[0, 0, 0] [0, 1, 0] [0, 1, 0] [0, 0, 1]] Where the matrix rows represent the prediction labels and the columns represents the real labels. The confusion matrix is always a 2-D array of shape [n, n], where n is the number of valid labels for a given classification task. Both prediction and labels must be 1-D arrays of the same shape in order for this function to work. ##### Args: * <b>`predictions`</b>: A 1-D array represeting the predictions for a given classification. * <b>`labels`</b>: A 1-D represeting the real labels for the classification task. * <b>`num_classes`</b>: The possible number of labels the classification task can have. If this value is not provided, it will be calculated using both predictions and labels array. * <b>`dtype`</b>: Data type of the confusion matrix. * <b>`name`</b>: Scope name. ##### Returns: A l X l matrix represeting the confusion matrix, where l in the number of possible labels in the classification task. ##### Raises: * <b>`ValueError`</b>: If both predictions and labels are not 1-D vectors and do not have the same size. - - - ### `tf.contrib.metrics.aggregate_metrics(*value_update_tuples)` {#aggregate_metrics} Aggregates the metric value tensors and update ops into two lists. ##### Args: * <b>`*value_update_tuples`</b>: a variable number of tuples, each of which contain the pair of (value_tensor, update_op) from a streaming metric. ##### Returns: a list of value tensors and a list of update ops. ##### Raises: * <b>`ValueError`</b>: if `value_update_tuples` is empty. - - - ### `tf.contrib.metrics.aggregate_metric_map(names_to_tuples)` {#aggregate_metric_map} Aggregates the metric names to tuple dictionary. This function is useful for pairing metric names with their associated value and update ops when the list of metrics is long. For example: metrics_to_values, metrics_to_updates = slim.metrics.aggregate_metric_map({ 'Mean Absolute Error': new_slim.metrics.streaming_mean_absolute_error( predictions, labels, weights), 'Mean Relative Error': new_slim.metrics.streaming_mean_relative_error( predictions, labels, labels, weights), 'RMSE Linear': new_slim.metrics.streaming_root_mean_squared_error( predictions, labels, weights), 'RMSE Log': new_slim.metrics.streaming_root_mean_squared_error( predictions, labels, weights), }) ##### Args: * <b>`names_to_tuples`</b>: a map of metric names to tuples, each of which contain the pair of (value_tensor, update_op) from a streaming metric. ##### Returns: A dictionary from metric names to value ops and a dictionary from metric names to update ops. ## Set `Ops` - - - ### `tf.contrib.metrics.set_difference(a, b, aminusb=True, validate_indices=True)` {#set_difference} Compute set difference of elements in last dimension of `a` and `b`. All but the last dimension of `a` and `b` must match. ##### Args: * <b>`a`</b>: `Tensor` or `SparseTensor` of the same type as `b`. If sparse, indices must be sorted in row-major order. * <b>`b`</b>: `Tensor` or `SparseTensor` of the same type as `a`. Must be `SparseTensor` if `a` is `SparseTensor`. If sparse, indices must be sorted in row-major order. * <b>`aminusb`</b>: Whether to subtract `b` from `a`, vs vice versa. * <b>`validate_indices`</b>: Whether to validate the order and range of sparse indices in `a` and `b`. ##### Returns: A `SparseTensor` with the same rank as `a` and `b`, and all but the last dimension the same. Elements along the last dimension contain the differences. - - - ### `tf.contrib.metrics.set_intersection(a, b, validate_indices=True)` {#set_intersection} Compute set intersection of elements in last dimension of `a` and `b`. All but the last dimension of `a` and `b` must match. ##### Args: * <b>`a`</b>: `Tensor` or `SparseTensor` of the same type as `b`. If sparse, indices must be sorted in row-major order. * <b>`b`</b>: `Tensor` or `SparseTensor` of the same type as `a`. Must be `SparseTensor` if `a` is `SparseTensor`. If sparse, indices must be sorted in row-major order. * <b>`validate_indices`</b>: Whether to validate the order and range of sparse indices in `a` and `b`. ##### Returns: A `SparseTensor` with the same rank as `a` and `b`, and all but the last dimension the same. Elements along the last dimension contain the intersections. - - - ### `tf.contrib.metrics.set_size(a, validate_indices=True)` {#set_size} Compute number of unique elements along last dimension of `a`. ##### Args: * <b>`a`</b>: `SparseTensor`, with indices sorted in row-major order. * <b>`validate_indices`</b>: Whether to validate the order and range of sparse indices in `a`. ##### Returns: For `a` ranked `n`, this is a `Tensor` with rank `n-1`, and the same 1st `n-1` dimensions as `a`. Each value is the number of unique elements in the corresponding `[0...n-1]` dimension of `a`. ##### Raises: * <b>`TypeError`</b>: If `a` is an invalid types. - - - ### `tf.contrib.metrics.set_union(a, b, validate_indices=True)` {#set_union} Compute set union of elements in last dimension of `a` and `b`. All but the last dimension of `a` and `b` must match. ##### Args: * <b>`a`</b>: `Tensor` or `SparseTensor` of the same type as `b`. If sparse, indices must be sorted in row-major order. * <b>`b`</b>: `Tensor` or `SparseTensor` of the same type as `a`. Must be `SparseTensor` if `a` is `SparseTensor`. If sparse, indices must be sorted in row-major order. * <b>`validate_indices`</b>: Whether to validate the order and range of sparse indices in `a` and `b`. ##### Returns: A `SparseTensor` with the same rank as `a` and `b`, and all but the last dimension the same. Elements along the last dimension contain the unions.
{ "content_hash": "bc5871d2906d049cccefe54cb310ef76", "timestamp": "", "source": "github", "line_count": 1184, "max_line_length": 211, "avg_line_length": 42.6570945945946, "alnum_prop": 0.7218548291292124, "repo_name": "HaebinShin/tensorflow", "id": "336acf311afa47047ccbe69a04d9ece7a1a7e074", "size": "50506", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tensorflow/g3doc/api_docs/python/contrib.metrics.md", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "176349" }, { "name": "C++", "bytes": "10558866" }, { "name": "CMake", "bytes": "34638" }, { "name": "CSS", "bytes": "107" }, { "name": "GCC Machine Description", "bytes": "2" }, { "name": "HTML", "bytes": "865714" }, { "name": "Java", "bytes": "41615" }, { "name": "JavaScript", "bytes": "10609" }, { "name": "Jupyter Notebook", "bytes": "1773504" }, { "name": "Makefile", "bytes": "20930" }, { "name": "Objective-C", "bytes": "5332" }, { "name": "Objective-C++", "bytes": "45677" }, { "name": "Protocol Buffer", "bytes": "118214" }, { "name": "Python", "bytes": "8858431" }, { "name": "Shell", "bytes": "234426" }, { "name": "TypeScript", "bytes": "428153" } ], "symlink_target": "" }
<HTML><HEAD> <TITLE>Review for Gone in Sixty Seconds (2000)</TITLE> <LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css"> </HEAD> <BODY BGCOLOR="#FFFFFF" TEXT="#000000"> <H1 ALIGN="CENTER" CLASS="title"><A HREF="/Title?0187078">Gone in Sixty Seconds (2000)</A></H1><H3 ALIGN=CENTER>reviewed by<BR><A HREF="/ReviewsBy?Frankie+Paiva">Frankie Paiva</A></H3><HR WIDTH="40%" SIZE="4"> <PRE>Gone in 60 Seconds</PRE> <PRE>rated PG-13 118 minutes Touchstone Pictures starring Nicolas Cage, Giovanni Ribisi, Angelina Jolie, Robert Duvall, and Delroy Lindo written by Scott Michael Rosenberg directed by Dominic Sena</PRE> <PRE>A Review by Frankie Paiva</PRE> <P>Gone in 60 Seconds is the ultimate guilty pleasure of the summer. It starts off as a promising action film, full of genuine suspense and excitement. As the movie progresses, it gets increasingly stupid to the point where it's so bad and inane that it's good. Throughout the film, the same phony human emotion becomes adopted by all the actors, but it's the emotions and relationships that keep the film interesting. No character goes beyond wading pool level in depth, and that's a very good thing. Director Dominic Sena realizes this is an action movie, and he doesn't disappoint. Instead of trying to reinvent the genre or use slow motion until it just becomes silly (Mission: Impossible 2 anyone?) he takes the best stuff from things we've seen before, and makes it into a fun, exciting, and pleasing film.</P> <P>Memphis Raines (Nicolas Cage) is a retired car thief whose younger brother Kip (Giovanni Ribisi) attempts to follow in his footsteps. Kip screws up his first car heist leading the police right to him and his boss. His boss, an evil guy with an English accent, wants Memphis to steal fifty specific cars from the Long Beach area in three days. If all the cars don't get delivered in time, he will kill Kip. So Memphis and a bunch of his old (now mostly clean) car thief buddies work together planning the operation. Some of his friends include former girlfriend Sway (Angelina Jolie), and an auto mechanic named Otto (Robert Duvall). Kip and his younger friends also join the crew. Detective Roland Castlebeck (Delroy Lindo) is about the same age as Memphis, and is eager to put him behind bars. Not putting him in jail already is something he regrets. Castlebeck and his younger partner Detective Drycoff (Timothy Olyphant) pursue Memphis and the gang for most of the film.</P> <P>One constant element of humor in this movie is the clash between the older and younger generations. Memphis and Otto are more cautious about their actions and easily spot undercover cops. Unlike some of Kip's pals (including Tumbler played by Scott Caan) they are always aware of their surroundings. The older guys certainly don’t discuss the latest masturbation techniques, or steal cars full of heroin. Memphis comes up with inventive ways to evade police and gangs, while the youths prefer confrontation. However, one hilarious scene does involves one of the older men attacking a bad car hijacker claiming he needs to get a role model. If this doesn't sound like your type of humor, this movie isn't for you. This movie will please action fans, but I think lots of other less action-oriented people may get surprised. I certainly was, and apparently the crowd was too. They were hooting and hollering and clapped loudly several times. I admire that Angelina Jolie doesn't get used as just a sex object in the film. Sway just likes hanging with the guys, and not once does she sleep with anyone. While the sexual aspect of her character is definitely there, she doesn't appear in much of the movie anyway. Nicolas Cage's nasal tone has never been more appealing, and I like the range shown by Giovanni Ribisi in this movie.</P> <P>The action scenes are at the heart of this movie. The mood gets well set; everything is dark and grainy. The only constant source of light for the characters comes from fiery explosions, car headlights, or police lights. There is one skill everyone in the movie possesses; these people can drive. During one amazing car chase, Memphis does a spectacular job of navigating himself through the streets. The fast pace never stops, and I thought this scene to be the highlight of the film. The cast assembled includes some great actors who throw almost all their skills away for good old-fashioned movie fun. There really don't need to be as many characters as there were. Frances Fisher shows up for some reason in the beginning and end, and there were some scenes (like giving a dog laxatives so he would "release" the keys he swallowed) that don't need to be there. Regardless, this is still an entertaining time. Some Mission: Impossible and James Bond music pops up, and similar Bond-esque stunts occur. Gone in 60 Seconds could also promote awareness about how easy it is for car thieves to steal your car. It may encourage people to be safer about where they park, and security measures they use. Coming out of the screening, I got handed a helpful guide with ten ways to protect your car from car thieves. </P> <P>There are more than eighty people listed under the stunts section of the credits. If this doesn't give you an idea about what type of movie this is, I don't know what will.</P> <PRE>B+</PRE> <PRE>Frankie Paiva <A HREF="mailto:SwpStke@aol.com">SwpStke@aol.com</A> <A HREF="http://www.homestead.com/cinemaparadise/mainpage.html">http://www.homestead.com/cinemaparadise/mainpage.html</A></PRE> <HR><P CLASS=flush><SMALL>The review above was posted to the <A HREF="news:rec.arts.movies.reviews">rec.arts.movies.reviews</A> newsgroup (<A HREF="news:de.rec.film.kritiken">de.rec.film.kritiken</A> for German reviews).<BR> The Internet Movie Database accepts no responsibility for the contents of the review and has no editorial control. Unless stated otherwise, the copyright belongs to the author.<BR> Please direct comments/criticisms of the review to relevant newsgroups.<BR> Broken URLs inthe reviews are the responsibility of the author.<BR> The formatting of the review is likely to differ from the original due to ASCII to HTML conversion. </SMALL></P> <P ALIGN=CENTER>Related links: <A HREF="/Reviews/">index of all rec.arts.movies.reviews reviews</A></P> </P></BODY></HTML>
{ "content_hash": "b31dc28e4f8a8181ebd39f47d2e3b654", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 209, "avg_line_length": 66.42268041237114, "alnum_prop": 0.7637746391432563, "repo_name": "xianjunzhengbackup/code", "id": "d9bc45e3988b16bf85620c4119853ddf1bf6f79e", "size": "6445", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "data science/machine_learning_for_the_web/chapter_4/movie/24917.html", "mode": "33261", "license": "mit", "language": [ { "name": "BitBake", "bytes": "113" }, { "name": "BlitzBasic", "bytes": "256" }, { "name": "CSS", "bytes": "49827" }, { "name": "HTML", "bytes": "157006325" }, { "name": "JavaScript", "bytes": "14029" }, { "name": "Jupyter Notebook", "bytes": "4875399" }, { "name": "Mako", "bytes": "2060" }, { "name": "Perl", "bytes": "716" }, { "name": "Python", "bytes": "874414" }, { "name": "R", "bytes": "454" }, { "name": "Shell", "bytes": "3984" } ], "symlink_target": "" }
namespace content { class WebContents; } // namespace content // This class is the intermediate for accessibility between Chrome and Fuchsia. // It handles registration to the Fuchsia Semantics Manager, translating events // and data structures between the two services, and forwarding actions and // events. // The lifetime of an instance of AccessibilityBridge is the same as that of a // View created by FrameImpl. This class refers to the View via the // caller-supplied ViewRef. class WEB_ENGINE_EXPORT AccessibilityBridge : public content::WebContentsObserver, public fuchsia::accessibility::semantics::SemanticListener, public ui::AXTreeObserver { public: // |web_contents| is required to exist for the duration of |this|. AccessibilityBridge( fuchsia::accessibility::semantics::SemanticsManagerPtr semantics_manager, fuchsia::ui::views::ViewRef view_ref, content::WebContents* web_contents); ~AccessibilityBridge() final; void set_handle_actions_for_test(bool handle) { handle_actions_for_test_ = handle; } private: FRIEND_TEST_ALL_PREFIXES(AccessibilityBridgeTest, OnSemanticsModeChanged); // A struct used for caching semantic information. This allows for updates and // deletes to be stored in the same vector to preserve all ordering // information. struct SemanticUpdateOrDelete { enum Type { UPDATE, DELETE }; SemanticUpdateOrDelete(SemanticUpdateOrDelete&& m); SemanticUpdateOrDelete(Type type, fuchsia::accessibility::semantics::Node node, uint32_t id_to_delete); ~SemanticUpdateOrDelete() = default; Type type; fuchsia::accessibility::semantics::Node update_node; uint32_t id_to_delete; }; // Processes pending data and commits it to the Semantic Tree. void TryCommit(); // Helper function for TryCommit() that sends the contents of |to_send_| to // the Semantic Tree, starting at |start|. void DispatchSemanticsMessages(size_t start, size_t size); // Callback for SemanticTree::CommitUpdates. void OnCommitComplete(); // Converts AXNode ids to Semantic Node ids, and handles special casing of the // root. uint32_t ConvertToFuchsiaNodeId(int32_t ax_node_id); // Deletes all nodes in subtree rooted at and including |node|, unless |node| // is the root of the tree. // |tree| and |node| are owned by the accessibility bridge. void DeleteSubtree(ui::AXTree* tree, ui::AXNode* node); // content::WebContentsObserver implementation. void AccessibilityEventReceived( const content::AXEventNotificationDetails& details) override; // fuchsia::accessibility::semantics::SemanticListener implementation. void OnAccessibilityActionRequested( uint32_t node_id, fuchsia::accessibility::semantics::Action action, OnAccessibilityActionRequestedCallback callback) final; void HitTest(fuchsia::math::PointF local_point, HitTestCallback callback) final; void OnSemanticsModeChanged(bool updates_enabled, OnSemanticsModeChangedCallback callback) final; // ui::AXTreeObserver implementation. void OnNodeWillBeDeleted(ui::AXTree* tree, ui::AXNode* node) override; void OnSubtreeWillBeDeleted(ui::AXTree* tree, ui::AXNode* node) override; void OnAtomicUpdateFinished( ui::AXTree* tree, bool root_changed, const std::vector<ui::AXTreeObserver::Change>& changes) override; fuchsia::accessibility::semantics::SemanticTreePtr tree_ptr_; fidl::Binding<fuchsia::accessibility::semantics::SemanticListener> binding_; content::WebContents* web_contents_; ui::AXSerializableTree tree_; // Cache for pending data to be sent to the Semantic Tree between commits. std::vector<SemanticUpdateOrDelete> to_send_; bool commit_inflight_ = false; // Maintain a map of callbacks as multiple hit test events can happen at once. // These are keyed by the request_id field of ui::AXActionData. base::flat_map<int, HitTestCallback> pending_hit_test_callbacks_; // Maintain a map of callbacks for accessibility actions. Entries are keyed by // node id the action is performed on. base::flat_map<int, OnAccessibilityActionRequestedCallback> pending_accessibility_action_callbacks_; // The root id of |tree_|. int32_t root_id_ = 0; bool handle_actions_for_test_ = true; DISALLOW_COPY_AND_ASSIGN(AccessibilityBridge); }; #endif // FUCHSIA_ENGINE_BROWSER_ACCESSIBILITY_BRIDGE_H_
{ "content_hash": "c17bfa4fafd700987647e3135b8cab61", "timestamp": "", "source": "github", "line_count": 115, "max_line_length": 80, "avg_line_length": 39.052173913043475, "alnum_prop": 0.7319082609663772, "repo_name": "endlessm/chromium-browser", "id": "b57afbb478c330a157f551443cae5348f22a1def", "size": "5351", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "fuchsia/engine/browser/accessibility_bridge.h", "mode": "33188", "license": "bsd-3-clause", "language": [], "symlink_target": "" }
package com.castlemock.service.mock.rest.event.input; import com.castlemock.model.core.Input; import com.castlemock.model.core.validation.NotNull; /** * @author Karl Dahlgren * @since 1.0 */ public final class ReadRestEventInput implements Input { @NotNull private final String restEventId; private ReadRestEventInput(String restEventId) { this.restEventId = restEventId; } public String getRestEventId() { return restEventId; } public static Builder builder(){ return new Builder(); } public static final class Builder { private String restEventId; public Builder restEventId(final String restEventId){ this.restEventId = restEventId; return this; } public ReadRestEventInput build(){ return new ReadRestEventInput(restEventId); } } }
{ "content_hash": "635fec74ff2614e53a865c76100e9c65", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 61, "avg_line_length": 20.295454545454547, "alnum_prop": 0.658454647256439, "repo_name": "castlemock/castlemock", "id": "e3e6fe5a3d19b3246d38b316c065bf1cad96ade5", "size": "1487", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "service/service-mock/service-mock-rest/src/main/java/com/castlemock/service/mock/rest/event/input/ReadRestEventInput.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ANTLR", "bytes": "1004" }, { "name": "CSS", "bytes": "8750" }, { "name": "HTML", "bytes": "798" }, { "name": "Java", "bytes": "2612368" }, { "name": "JavaScript", "bytes": "527130" }, { "name": "Procfile", "bytes": "84" } ], "symlink_target": "" }
+++ date = "2015-03-17T15:36:56Z" title = "MongoDB Core" [menu.main] weight = 20 Identifier = "MongoDB Driver" pre = "<i class='fa fa-arrows-h'></i>" +++ ## MongoDB Driver Core Documentation Welcome to the MongoDB Core Driver documentation hub. ### What's New in 2.0 The [What's New]({{< relref "whats-new/index.md" >}}) guide explains the major new features of the driver. ### Getting Started The [Getting Started]({{< relref "driver/getting-started/index.md" >}}) guide contains installation instructions and a simple tutorial to get up and running quickly. ### Reference For more detailed documentation, see the [Reference]({{< relref "driver/reference/index.md" >}}) guide.
{ "content_hash": "ad1f35d8074e39ed97484e96f6548023", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 112, "avg_line_length": 26.692307692307693, "alnum_prop": 0.7002881844380403, "repo_name": "christkv/mongodb-core", "id": "901fed5eabd4a1a2dc2abb2bee51ea55368d314d", "size": "694", "binary": false, "copies": "4", "ref": "refs/heads/2.0", "path": "docs/reference/content/driver/index.md", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "JavaScript", "bytes": "968602" }, { "name": "Makefile", "bytes": "455" }, { "name": "Shell", "bytes": "110" } ], "symlink_target": "" }
package org.broadinstitute.sting.queue.util import org.testng.annotations.Test import java.io.File import org.testng.Assert import StringFileConversions._ class StringFileConversionsUnitTest { @Test def testStringToFile() { var string: String = new File("foo") Assert.assertEquals(string, "foo") string = null.asInstanceOf[File] Assert.assertNull(string) } @Test def testFileToString() { var file: File = "foo" Assert.assertEquals(file, new File("foo")) file = null.asInstanceOf[String] Assert.assertNull(file) } @Test def testStringToFileList() { var files = Seq(new File("foo")) files :+= "bar" Assert.assertEquals(files, Seq(new File("foo"), new File("bar"))) files = Seq(new File("foo")) files :+= null.asInstanceOf[String] Assert.assertEquals(files, Seq(new File("foo"), null)) files = Seq[File](null) files :+= "foo" Assert.assertEquals(files, Seq(null, new File("foo"))) files = Seq[File](null) files :+= null.asInstanceOf[String] Assert.assertEquals(files, Seq(null, null)) } @Test def testFileToStringList() { var strings = Seq("foo") strings :+= new File("bar") Assert.assertEquals(strings, Seq("foo", "bar")) strings = Seq("foo") strings :+= null.asInstanceOf[File] Assert.assertEquals(strings, Seq("foo", null)) strings = Seq[String](null) strings :+= new File("foo") Assert.assertEquals(strings, Seq(null, "foo")) strings = Seq[String](null) strings :+= null.asInstanceOf[File] Assert.assertEquals(strings, Seq(null, null)) } @Test def testStringToFileSet() { var files = Set(new File("foo")) files += "bar" Assert.assertEquals(files, Set(new File("foo"), new File("bar"))) files = Set(new File("foo")) files += null.asInstanceOf[String] Assert.assertEquals(files, Set(new File("foo"), null)) files = Set[File](null) files += "foo" Assert.assertEquals(files, Set(new File("foo"), null)) files = Set[File](null) files += null.asInstanceOf[String] Assert.assertEquals(files, Set(null)) } @Test def testFileToStringSet() { var strings = Set("foo") strings += new File("bar") Assert.assertEquals(strings, Set("foo", "bar")) strings = Set("foo") strings += null.asInstanceOf[File] Assert.assertEquals(strings, Set("foo", null)) strings = Set[String](null) strings += new File("foo") Assert.assertEquals(strings, Set("foo", null)) strings = Set[String](null) strings += null.asInstanceOf[File] Assert.assertEquals(strings, Set(null)) } @Test def testStringListToFileList() { var files = Seq(new File("foo")) files ++= Seq("bar") Assert.assertEquals(files, Seq(new File("foo"), new File("bar"))) files = Seq(new File("foo")) files ++= Seq[String](null) Assert.assertEquals(files, Seq(new File("foo"), null)) files = Seq[File](null) files ++= Seq("foo") Assert.assertEquals(files, Seq(null, new File("foo"))) files = Seq[File](null) files ++= Seq[String](null) Assert.assertEquals(files, Seq(null, null)) } @Test def testFileListToStringList() { var strings = Seq("foo") strings ++= Seq(new File("bar")) Assert.assertEquals(strings, Seq("foo", "bar")) strings = Seq("foo") strings ++= Seq[File](null) Assert.assertEquals(strings, Seq("foo", null)) strings = Seq[String](null) strings ++= Seq(new File("foo")) Assert.assertEquals(strings, Seq(null, "foo")) strings = Seq[String](null) strings ++= Seq[File](null) Assert.assertEquals(strings, Seq(null, null)) } @Test def testStringSetToFileSet() { var files = Set(new File("foo")) files ++= Set("bar") Assert.assertEquals(files, Set(new File("foo"), new File("bar"))) files = Set(new File("foo")) files ++= Set[String](null) Assert.assertEquals(files, Set(new File("foo"), null)) files = Set[File](null) files ++= Set("foo") Assert.assertEquals(files, Set(new File("foo"), null)) files = Set[File](null) files ++= Set[String](null) Assert.assertEquals(files, Set(null)) } @Test def testFileSetToStringSet() { var strings = Set("foo") strings ++= Set(new File("bar")) Assert.assertEquals(strings, Set("foo", "bar")) strings = Set("foo") strings ++= Set[File](null) Assert.assertEquals(strings, Set("foo", null)) strings = Set[String](null) strings ++= Set(new File("foo")) Assert.assertEquals(strings, Set("foo", null)) strings = Set[String](null) strings ++= Set[File](null) Assert.assertEquals(strings, Set(null)) } }
{ "content_hash": "7bb0a09f0174afb2ae67132e5aaf7580", "timestamp": "", "source": "github", "line_count": 180, "max_line_length": 69, "avg_line_length": 26.044444444444444, "alnum_prop": 0.6309726962457338, "repo_name": "iontorrent/Torrent-Variant-Caller-stable", "id": "4d364040a824f5630f9a2b28c95f293232e7c002", "size": "5818", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "public/scala/test/org/broadinstitute/sting/queue/util/StringFileConversionsUnitTest.scala", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "13702" }, { "name": "C++", "bytes": "93650" }, { "name": "Java", "bytes": "7434523" }, { "name": "JavaScript", "bytes": "25002" }, { "name": "Perl", "bytes": "6761" }, { "name": "Python", "bytes": "1510" }, { "name": "R", "bytes": "37286" }, { "name": "Scala", "bytes": "480437" }, { "name": "Shell", "bytes": "901" }, { "name": "XML", "bytes": "8989" } ], "symlink_target": "" }
(function () { 'use strict'; module.exports = function () { // You can use normal require here, cucumber is NOT run in a Meteor context (by design) var url = require('url'); this.Given(/^I have authored the site title as "([^"]*)"$/, function (title) { return this.mirror.call('updateTitle', title); // this.ddp is a connection to the mirror }); this.When(/^I navigate to "([^"]*)"$/, function (relativePath, callback) { this.browser. // this.browser is a pre-configured WebdriverIO + PhantomJS instance url(url.resolve(process.env.ROOT_URL, relativePath)). // process.env.ROOT_URL always points to the mirror call(callback); }); this.Then(/^I should see the heading "([^"]*)"$/, function (expectedTitle, callback) { // you can use chai-as-promised in step definitions also this.browser. waitForVisible('h1'). // WebdriverIO chain-able promise magic getText('h1').should.become(expectedTitle).and.notify(callback); }); }; })();
{ "content_hash": "87ce2ef8664afe31cc7ed254b2115ea2", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 113, "avg_line_length": 35.48275862068966, "alnum_prop": 0.6355685131195336, "repo_name": "modcoms/meteor-cucumber", "id": "70553bd9ad49f885e4e6a684446d5bb3a03c09ae", "size": "1029", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "test-app/tests/cucumber/features/step_definitions/my_steps.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "268" }, { "name": "Cucumber", "bytes": "2149" }, { "name": "HTML", "bytes": "112" }, { "name": "JavaScript", "bytes": "20401" } ], "symlink_target": "" }
<?php namespace PragmaRX\Sdk\Services\Telegram\Events; use App\Events\Event; use Illuminate\Queue\SerializesModels; class TelegramDocumentWasCreated extends Event { use SerializesModels; /** * @var */ public $document; /** * @var */ public $bot; public function __construct($document, $bot) { $this->document = $document; $this->bot = $bot; } }
{ "content_hash": "ec9b17f7ad6bb2f9193592262ae8b0ce", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 48, "avg_line_length": 14.892857142857142, "alnum_prop": 0.6019184652278178, "repo_name": "antonioribeiro/sdk", "id": "efc40b79f66cbb1572be3e5f2f4e690e7601b614", "size": "417", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Services/Telegram/Events/TelegramDocumentWasCreated.php", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "1611" }, { "name": "JavaScript", "bytes": "1296" }, { "name": "PHP", "bytes": "1706773" } ], "symlink_target": "" }
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:textAppearance="?android:attr/textAppearanceLarge" android:text="请先登录" android:layout_marginTop="350dp" android:id="@+id/textView" android:layout_gravity="center_horizontal"/> </LinearLayout>
{ "content_hash": "6750ce4a478443e948cf4cd76b229d8d", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 83, "avg_line_length": 41.333333333333336, "alnum_prop": 0.635483870967742, "repo_name": "AU3904/iTrack", "id": "68ad1e439ad4b9f8c0f5d50a959cdff9d1db7c05", "size": "628", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "iTrack/src/main/res/layout/me_layout.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "120251" } ], "symlink_target": "" }
package de.fu_berlin.imp.apiua.diff.preferences; import org.apache.commons.lang.SerializationUtils; import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; import org.eclipse.jface.preference.IPreferenceStore; import de.fu_berlin.imp.apiua.diff.Activator; public class SUADiffPreferenceInitializer extends AbstractPreferenceInitializer { public static final String[] defaultFileFilterPatterns = new String[] { "^/?bin(/.*|$)", "^/?core(/.*|$)", "^(.*)?/?CMakeFiles(/.*|$)", "^.*\\.cmake$", "^.*CMakeLists.txt$", "^.*Makefile$" }; public void initializeDefaultPreferences() { IPreferenceStore store = Activator.getDefault().getPreferenceStore(); store.setDefault( SUADiffPreferenceConstants.FILE_FILTER_PATTERNS, new String(SerializationUtils .serialize(defaultFileFilterPatterns))); } }
{ "content_hash": "3312a30fd3d32d7f4a0cad2040a6491b", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 81, "avg_line_length": 36.47826086956522, "alnum_prop": 0.7461263408820024, "repo_name": "bkahlert/api-usability-analyzer", "id": "0af5a671848f2caa5115c589d560f0d9dbf61a5f", "size": "839", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "de.fu_berlin.imp.apiua.diff/src/de/fu_berlin/imp/apiua/diff/preferences/SUADiffPreferenceInitializer.java", "mode": "33188", "license": "mit", "language": [ { "name": "C++", "bytes": "28265" }, { "name": "CMake", "bytes": "207" }, { "name": "CSS", "bytes": "6922" }, { "name": "HTML", "bytes": "560" }, { "name": "Java", "bytes": "1871750" } ], "symlink_target": "" }
<div class="sub-view-columns"> <div class="sub-view-column-left"> <h5>Captions</h5> <small>Add title and change captions for Submit, Next and Previus buttons</small> </div> <div class="sub-view-column-right"> <div class="control-group umb-control-group"> <div class="control-row -margin-bottom"> <label class="control-label -block">'Submit' button label</label> <input class="-full-width-input" type="text" ng-model="model.submitLabel" /> </div> <div class="control-row -margin-bottom"> <label class="control-label -block">'Next' button label</label> <input class="-full-width-input" type="text" ng-model="model.nextLabel" /> </div> <div class="control-row -margin-bottom"> <label class="control-label -block">'Previous' button label</label> <input class="-full-width-input" type="text" ng-model="model.prevLabel" /> </div> </div> </div> </div> <div class="sub-view-columns"> <div class="sub-view-column-left"> <h5>Styling</h5> <small>Add a class/Multiple classes to wrap you form to enable custom styling, disable default styling and load assets with client dependencies</small> </div> <div class="sub-view-column-right"> <div class="control-group umb-control-group"> <div class="control-row -margin-bottom"> <label class="control-label -block">Form css class</label> <input class="-full-width-input" type="text" ng-model="model.cssClass" /> </div> <div class="control-row"> <label class="checkbox no-indent" > <input type="checkbox" ng-model="model.disableDefaultStylesheet" /> Disable default stylesheet </label> </div> <div class="control-row"> <label class="checkbox no-indent" > <input type="checkbox" ng-model="model.useClientDependency" /> Load assets with client dependency </label> </div> </div> </div> </div> <div class="sub-view-columns"> <div class="sub-view-column-left"> <h5>Validation</h5> <small>Provide better validation messages, hide validation labels and change or disable the required/mandatory marker</small> </div> <div class="sub-view-column-right"> <div class="control-group umb-control-group"> <div class="control-row -margin-bottom"> <label class="control-label -block">Mandatory Error Message</label> <small>Message to display when a mandatory field was left empty</small> <input class="-full-width-input" type="text" ng-model="model.requiredErrorMessage" /> </div> <div class="control-row -margin-bottom"> <label class="control-label -block">Invalid Error Message</label> <small>Message to display when a field is invalid</small> <input class="-full-width-input" type="text" ng-model="model.invalidErrorMessage" /> </div> <div class="control-row"> <label class="checkbox no-indent" > <input type="checkbox" ng-model="model.showValidationSummary" /> Show validation summary </label> </div> <div class="control-row"> <label class="checkbox no-indent" > <input type="checkbox" ng-model="model.hideFieldValidation" /> Hide field validation labels </label> </div> </div> <div class="control-group umb-control-group"> <div class="control-row -margin-bottom"> <label class="control-label -block">Mark fields</label> <label class="radio -block -no-indent"> <input type="radio" ng-model="model.fieldIndicationType" value="NoIndicator"> No Indicator </label> <label class="radio -block -no-indent"> <input type="radio" ng-model="model.fieldIndicationType" value="MarkMandatoryFields"> Mark Mandatory Fields </label> <label class="radio -block -no-indent"> <input type="radio" ng-model="model.fieldIndicationType" value="MarkOptionalFields"> Mark Optional Fields </label> </div> <div class="control-row"> <label class="control-label -block">Indicator</label> <small>Change the mandatory indicator symbol</small> <input class="-full-width-input" type="text" ng-model="model.indicator" /> </div> </div> </div> </div> <div class="sub-view-columns"> <div class="sub-view-column-left"> <h5>Moderation</h5> <small>Allow form submissions to be post moderated. Most use cases are for publically shown entries such as blog post comments or submisisons for a social campaign</small> </div> <div class="sub-view-column-right"> <div class="control-group umb-control-group"> <div class="control-row"> <label class="checkbox no-indent" > <input type="checkbox" ng-model="model.manualApproval" /> Enable Post Moderation </label> </div> </div> </div> </div>
{ "content_hash": "32dfdfb7e66dd52424ce51b4f1961efd", "timestamp": "", "source": "github", "line_count": 165, "max_line_length": 179, "avg_line_length": 34.5030303030303, "alnum_prop": 0.5512032320393465, "repo_name": "hfea/Website-Public", "id": "57c3f0a0c83177f30efc36dfab930aea2ef8ae3f", "size": "5693", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "Source/HFEA.Website/App_plugins/UmbracoForms/Backoffice/Form/views/settings/settings.html", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C#", "bytes": "1279661" } ], "symlink_target": "" }
'use strict'; /** * Module dependencies. */ var errorHandler = errorHandler = require('./errors.server.controller'), mongoose = require('mongoose'), ServerCS = mongoose.model('Servercs'), Rcon = require('../tools/rcon'); /** * Send a command */ exports.sendCmd = function(req, res) { var ip = req.body.ip; var port = req.body.port; var pwd = req.body.pwd; var cmd = req.body.cmd; // TODO : Authentication /*var rcon = new Rcon({ address: ip + ':' + port, password: pwd, initCvars: false }); // TODO : Send cmd rcon.connect(function() { rcon.runCommand(cmd, function(err, res) { console.log(cmd); if (err) { return res.status(400).send({ message: errorHandler.getErrorMessage(err) }); } else { res.json({success: true}); } }); });*/ res.json({success: true}); }; /** * ServerCS middleware */ /*exports.servercsByID = function(req, res, next, id) { ServerCS.findById(id).exec(function(err, servercs) { if (err) return next(err); if (!servercs) return next(new Error('Failed to load servercs ' + id)); req.servercs = servercs; next(); }); };*/
{ "content_hash": "6c4e0b1b58dc5826991fe7e5bb9c4524", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 73, "avg_line_length": 20.796296296296298, "alnum_prop": 0.6197684772929652, "repo_name": "titiyo/CSGOManager", "id": "eff47053987b952795fa221b8cde6b997cbb7d35", "size": "1123", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/controllers/rcon.server.controller.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "500" }, { "name": "HTML", "bytes": "26371" }, { "name": "JavaScript", "bytes": "124625" }, { "name": "Shell", "bytes": "414" } ], "symlink_target": "" }
#include <stdlib.h> #include <stdio.h> #include <math.h> #include "iup.h" //#define TIMER #ifdef TIMER static int time_cb(Ihandle* timer) { Ihandle* ih = (Ihandle*)IupGetAttribute(timer, "DIALOG"); IupSetAttribute(ih, "INC", NULL); if (IupGetInt(ih, "COUNT")==IupGetInt(ih, "TOTALCOUNT")) { IupSetAttribute(timer, "RUN", "NO"); IupExitLoop(); return IUP_DEFAULT; } return IUP_DEFAULT; } #else static int show_cb(Ihandle* dlg, int state) { if (state == IUP_SHOW) { int i, j; printf("Begin\n"); for (i = 0; i < 10000; i++) { for (j = 0; j < 10000; j++) { double x = fabs(sin(j * 100.) + cos(j * 100.)); x = sqrt(x * x); } IupSetAttribute(dlg, "INC", NULL); IupLoopStep(); printf("Step(%d)\n", i); } printf("End\n"); } return IUP_DEFAULT; } #endif static int cancel_cb(Ihandle* ih) { int ret; Ihandle* timer = (Ihandle*)IupGetAttribute(ih, "TIMER"); IupSetAttribute(timer, "RUN", "NO"); ret = IupAlarm("Warning!", "Interrupt Processing?", "Yes", "No", NULL); if (ret == 1) /* Yes Interrupt */ { if (IupGetInt(ih, "COUNT")<IupGetInt(ih, "TOTALCOUNT")/2) { // IupSetAttribute(ih, "STATE", "UNDEFINED"); // return IUP_CONTINUE; IupExitLoop(); return IUP_DEFAULT; } else { IupExitLoop(); return IUP_DEFAULT; } } IupSetAttribute(ih, "STATE", "PROCESSING"); IupSetAttribute(timer, "RUN", "Yes"); return IUP_CONTINUE; } void ProgressDlgTest(void) { #ifdef TIMER Ihandle* timer; #endif Ihandle* dlg = IupProgressDlg(); IupSetAttribute(dlg, "TITLE", "IupProgressDlg Test"); IupSetAttribute(dlg, "DESCRIPTION", "Description first line\nSecond Line"); IupSetCallback(dlg, "CANCEL_CB", cancel_cb); IupSetAttribute(dlg, "TOTALCOUNT", "10000"); #ifdef TIMER timer = IupTimer(); IupSetCallback(timer, "ACTION_CB", (Icallback)time_cb); IupSetAttribute(timer, "TIME", "100"); IupSetAttribute(timer, "RUN", "YES"); IupSetAttribute(timer, "DIALOG", (char*)dlg); IupSetAttribute(dlg, "TIMER", (char*)timer); #else IupSetCallback(dlg, "SHOW_CB", show_cb); #endif IupPopup(dlg, IUP_CENTER, IUP_CENTER); #ifdef TIMER IupDestroy(timer); #endif } #ifndef BIG_TEST int main(int argc, char* argv[]) { IupOpen(&argc, &argv); IupControlsOpen(); ProgressDlgTest(); IupMainLoop(); IupClose(); return EXIT_SUCCESS; } #endif
{ "content_hash": "5be8f7f7432d7aef3e5623560f1c82a2", "timestamp": "", "source": "github", "line_count": 119, "max_line_length": 77, "avg_line_length": 20.470588235294116, "alnum_prop": 0.6157635467980296, "repo_name": "ivanceras/iup-mirror", "id": "6177a342914d7ba7522f8a59ff893af96efa877a", "size": "2436", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "html/examples/tests/progressdlg.c", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "51" }, { "name": "Batchfile", "bytes": "10657" }, { "name": "C", "bytes": "10805242" }, { "name": "C++", "bytes": "7443129" }, { "name": "CSS", "bytes": "14478" }, { "name": "HTML", "bytes": "2313042" }, { "name": "Lua", "bytes": "729555" }, { "name": "Makefile", "bytes": "139501" }, { "name": "Shell", "bytes": "11775" } ], "symlink_target": "" }
package com.redis.exception; public enum MyExceptionType implements ExceptionType { NO_DATA(-1,"未查询到您需要的数据"), PAID(0,"支付已成功") ; private int code; private String describe; private MyExceptionType(int code, String describe) { this.code = code; this.describe = describe; } @Override public int getCode() { return code; } @Override public String getDescribe() { return describe; } }
{ "content_hash": "82c9f00132f88ccb96b8acad1bb4f3aa", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 54, "avg_line_length": 14.75, "alnum_prop": 0.6973365617433414, "repo_name": "499504777/spring-redis", "id": "79ac28690f73ab7cf51be2bf1d5bb815385a22fe", "size": "443", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "redis-service/src/main/java/com/redis/exception/MyExceptionType.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "46251" } ], "symlink_target": "" }
<!DOCTYPE html> <html> <head> <link rel="stylesheet" media="all" href="/smartanswers/application.css" /> <link rel="stylesheet" media="print" href="/smartanswers/print.css" /> <title>Maternity and paternity calculator for employers - GOV.UK</title> <script src="/smartanswers/smart-answers.js" defer="defer"></script> <meta name="robots" content="noindex"> </head> <body class="mainstream"> <div id="wrapper" class="answer smart_answer"> <main id="content" role="main"> <div id="js-replaceable" class="smart-answer-questions group"> <header class="page-header group"> <div> <h1> Maternity and paternity calculator for employers </h1> </div> </header> <div class="step current"> <form action="/maternity-paternity-calculator/y/paternity/no" accept-charset="UTF-8" method="get"><input name="utf8" type="hidden" value="&#x2713;" /> <div class="current-question" id="current-question"> <div class="question"> <h2> What is the baby’s due date? </h2> <div class="question-body"> <div class=""> <fieldset> <label for="response_day">Day <select id="response_day" name="response[day]"> <option value=""></option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> <option value="10">10</option> <option value="11">11</option> <option value="12">12</option> <option value="13">13</option> <option value="14">14</option> <option value="15">15</option> <option value="16">16</option> <option value="17">17</option> <option value="18">18</option> <option value="19">19</option> <option value="20">20</option> <option value="21">21</option> <option value="22">22</option> <option value="23">23</option> <option value="24">24</option> <option value="25">25</option> <option value="26">26</option> <option value="27">27</option> <option value="28">28</option> <option value="29">29</option> <option value="30">30</option> <option value="31">31</option> </select> </label> <label for="response_month">Month <select id="response_month" name="response[month]"> <option value=""></option> <option value="1">January</option> <option value="2">February</option> <option value="3">March</option> <option value="4">April</option> <option value="5">May</option> <option value="6">June</option> <option value="7">July</option> <option value="8">August</option> <option value="9">September</option> <option value="10">October</option> <option value="11">November</option> <option value="12">December</option> </select> </label> <label for="response_year">Year <select id="response_year" name="response[year]"> <option value=""></option> <option value="2014">2014</option> <option value="2015">2015</option> <option value="2016">2016</option> <option value="2017">2017</option> <option value="2018">2018</option> </select> </label> </fieldset> </div> </div> </div> <div class="next-question"> <input type="hidden" name="next" value="1" /> <button type="submit" class="medium button">Next step</button> </div> </div> </form> </div> <div class="previous-answers"> <div class="done-questions"> <article> <h3 class="previous-answers-title"> Previous answers </h3> <a class="start-right" href="/maternity-paternity-calculator">Start again</a> <table> <tbody> <tr class="section"> <td class="previous-question-title">What do you want to check?</td> <td class="previous-question-body"> Paternity</td> <td class="link-right"> <a href="/maternity-paternity-calculator/y?previous_response=paternity"> Change<span class="visuallyhidden"> answer to "What do you want to check?"</span> </a> </td> </tr> <tr class="section"> <td class="previous-question-title">Is the paternity leave or pay for an adoption?</td> <td class="previous-question-body"> No</td> <td class="link-right"> <a href="/maternity-paternity-calculator/y/paternity?previous_response=no"> Change<span class="visuallyhidden"> answer to "Is the paternity leave or pay for an adoption?"</span> </a> </td> </tr> </tbody> </table> </article> </div> </div> </div> <div class="meta-wrapper"> <div id="report-a-problem"></div> <div class="meta-data group"> <div class="inner"> <div class="print-and-modified-date group"> <p class="modified-date">Last updated: 1 January 2015</p> </div> </div> </div> </div> </main> </div> </body> </html>
{ "content_hash": "8f3f73e06586107261154df16321e728", "timestamp": "", "source": "github", "line_count": 180, "max_line_length": 156, "avg_line_length": 26.916666666666668, "alnum_prop": 0.62765737874097, "repo_name": "stwalsh/smart-answers", "id": "ec50c5462a7b00d1974b81d853ca2bdf9620d906", "size": "4847", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/artefacts/maternity-paternity-calculator/paternity/no.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "8386" }, { "name": "HTML", "bytes": "2948544" }, { "name": "JavaScript", "bytes": "8814" }, { "name": "Ruby", "bytes": "1939196" }, { "name": "Shell", "bytes": "3673" } ], "symlink_target": "" }
using System; using System.Diagnostics; using System.Reflection; using System.Threading; namespace OpenRiaServices.DomainServices { internal static class ExceptionHandlingUtility { /// <summary> /// Determines if an <see cref="Exception"/> is fatal and therefore should not be handled. /// </summary> /// <example> /// try /// { /// // Code that may throw /// } /// catch (Exception ex) /// { /// if (ex.IsFatal()) /// { /// throw; /// } /// /// // Handle exception /// } /// </example> /// <param name="exception">The exception to check</param> /// <returns><c>true</c> if the exception is fatal, otherwise <c>false</c>.</returns> public static bool IsFatal(this Exception exception) { Exception outerException = null; while (exception != null) { if (IsFatalExceptionType(exception)) { Debug.Assert(outerException == null || ((outerException is TypeInitializationException) || (outerException is TargetInvocationException)), "Fatal nested exception found"); return true; } outerException = exception; exception = exception.InnerException; } return false; } private static bool IsFatalExceptionType(Exception exception) { if #if SILVERLIGHT (exception is OutOfMemoryException) #else ((exception is OutOfMemoryException) && !(exception is InsufficientMemoryException)) #endif { return true; } return false; } } }
{ "content_hash": "987c6acc1a324b0b8e20a0c66500d914", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 159, "avg_line_length": 30.704918032786885, "alnum_prop": 0.5072076882007475, "repo_name": "STAH/OpenRiaServices", "id": "6bc9a600c07136f514a98fbc3fede8ca90cd999c", "size": "1875", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "OpenRiaServices.DomainServices.Client/Framework/Portable/ExceptionHandlingUtility.cs", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ASP", "bytes": "814" }, { "name": "C#", "bytes": "19336143" }, { "name": "CSS", "bytes": "5674" }, { "name": "HTML", "bytes": "12455" }, { "name": "PowerShell", "bytes": "1793" }, { "name": "Visual Basic", "bytes": "4874395" } ], "symlink_target": "" }
module Language.Haskell.Interpreter( -- * The interpreter monad transformer MonadInterpreter(..), InterpreterT, Interpreter, -- ** Running the interpreter runInterpreter, -- ** Interpreter options Option, OptionVal((:=)), get, set, languageExtensions, availableExtensions, Extension(..), installedModulesInScope, searchPath, -- ** Context handling ModuleName, isModuleInterpreted, loadModules, getLoadedModules, setTopLevelModules, setImports, setImportsQ, reset, -- ** Module querying ModuleElem(..), Id, name, children, getModuleExports, -- ** Annotations -- In the snippets below we use \'LBRACE\' and \'RBRACE\' -- to mean \'{\' and \'}\' respectively. We cannot put the -- pragmas inline in the code since GHC scarfs them up. getModuleAnnotations, getValAnnotations, -- ** Type inference typeOf, typeChecks, kindOf, -- ** Evaluation interpret, as, infer, eval, -- * Error handling InterpreterError(..), GhcError(..), MultipleInstancesNotAllowed(..), -- * Miscellaneous ghcVersion, parens, module Control.Monad.Trans ) where import Hint.Base import Hint.Annotations import Hint.InterpreterT import Hint.Configuration import Hint.Context import Hint.Reflection import Hint.Typecheck import Hint.Eval import Control.Monad.Trans
{ "content_hash": "69c43e90e8d08804c02725069fd62ee3", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 73, "avg_line_length": 30.533333333333335, "alnum_prop": 0.6877729257641921, "repo_name": "meditans/hint", "id": "30c19ed212c66e508270f2f3e12ef7e38b903627", "size": "1774", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Language/Haskell/Interpreter.hs", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Haskell", "bytes": "93422" } ], "symlink_target": "" }
@interface AppDelegate : NSObject <NSApplicationDelegate, DragImageViewDelegate> @property (weak) IBOutlet DragImageView *sourceImageView; @property (weak) IBOutlet DragImageView *destinationImageView; @property (strong) NSArray * imageSets; @property (assign) NSInteger selectedImageSet; @property (assign) BOOL converting; @end
{ "content_hash": "47137db56b95bb59130feeb88871f490", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 80, "avg_line_length": 41.375, "alnum_prop": 0.8187311178247734, "repo_name": "krzyspmac/XCAssetFill", "id": "05cffbd7cbf4eac592be5f8d314b0741863b44a9", "size": "520", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "XCAssetsFill/AppDelegate.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Objective-C", "bytes": "13843" } ], "symlink_target": "" }
@import 'basscss-basic'; /* Add-on Modules */ @import 'basscss-addons/modules/btn'; @import 'basscss-addons/modules/btn-primary'; @import 'basscss-addons/modules/background-colors'; @import 'basscss-addons/modules/colors'; @import 'basscss-addons/modules/forms'; @import 'basscss-addons/modules/input-range'; @import 'basscss-addons/modules/responsive-margin'; @import 'basscss-addons/modules/responsive-padding'; @import 'basscss-addons/modules/media-object'; @import 'basscss-addons/modules/all'; @import 'basscss-addons/modules/progress'; @import 'basscss-addons/modules/lighten'; @import 'basscss-addons/modules/background-images'; @import 'basscss-addons/modules/darken'; /* Base Modules */ @import 'basscss-type-scale'; @import 'basscss-typography'; @import 'basscss-layout'; @import 'basscss-align'; @import 'basscss-margin'; @import 'basscss-padding'; @import 'basscss-grid'; @import 'basscss-flexbox'; @import 'basscss-position'; @import 'basscss-border'; @import 'basscss-hide'; html * { font-family: Helvetica Neue, Helvetica, Arial, sans-serif !important; color: #333; } body { background-color: #F5F5F5; } a { color: #0B3D88; text-decoration: none; } .navbar-link { color: #0B3D88; font-weight: bold; } autoinput { color: #0B3D88; cursor: pointer; font-weight: bold; text-decoration: underline; } table { border-collapse: collapse; } table, th, td { border: 1px solid #E1E1E1; padding-top: 4px; border-radius: 3px 3px 3px 3px; font-family: Helvetica Regular; background-color: #FFF; } th, td { padding: 10px; /*Comps: 10px padding of cells*/ } th { color: #FFF; font-size: 12px; background-color: #0B3D88; text-transform: capitalize; } td { font-size: 11px; /* TODO: Negative Numbers: #CC0000*/ } /*tr:nth-child(even) { background-color: #FFF; }*/ td:not(:first-child) { text-align: right; } visual-map, visual-bar, visual-list, visual-column, visual-pie { position: relative; display: inline-block; min-height: 500px; min-width: 600px; width: 100%; height: 100%; padding-left: 40px; padding-right: 40px; } .chart-div { background-color: #F5F5F5; } .visualization-container { max-width: 1150px; } nav { padding-left: 40px; padding-right: 40px; background-color: #FFF; height: 70px; } .tab { display: inline; padding: 0 10px; border: 1px solid #E1E1E1; border-radius: 4px 4px 0 0; margin-right: 6px; background-color: #F5F5F5; /*padding: 10px;*/ } .tab-selected { display: inline; border-top: 1px solid #E1E1E1; border-left: 1px solid #E1E1E1; border-right: 1px solid #E1E1E1; border-radius: 4px 4px 0 0; margin-right: 6px; background-color: #F5F5F5; padding: 10px; } .tab-container { margin-top: 6px; background-color: #FFF; } .visual-title { font-size: 24px; font-family: Helvetica Light; border-top: 1px solid #E1E1E1; color: #333; background-color: #F5F5F5; padding-top: 35px; } .legend { background-color: #E8E8E8; flex: 1 1 auto; width: 100%; min-width: 900px; display: block; padding: 20px; border: 1px solid #E1E1E1; flex-wrap: wrap; }
{ "content_hash": "4fe73b4b08d634fba25478913105582b", "timestamp": "", "source": "github", "line_count": 167, "max_line_length": 72, "avg_line_length": 18.7125748502994, "alnum_prop": 0.68832, "repo_name": "codycoggins/angular2-starter-cody", "id": "b89a9e1ba7ea4db28240707522cd3f93a3eb5626", "size": "3125", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/styles/index.css", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "93" }, { "name": "CSS", "bytes": "1051" }, { "name": "HTML", "bytes": "2038" }, { "name": "JavaScript", "bytes": "15261" }, { "name": "TypeScript", "bytes": "29954" } ], "symlink_target": "" }
import { HttpRequest, HttpResponse } from "@pollyjs/adapter-fetch"; import { ResourceBuilder } from "./types"; import { Activity } from "components/Activity/api/types"; const ACTIVITY: Activity = { id: "1", userId: "testuser", details: { properties: [ { id: "prop1", name: "name1", value: "value1", showInSelection: true, showInList: true, }, { id: "prop2", name: "name2", value: "value2", showInSelection: true, showInList: true, }, ], }, }; const ACTIVITY2: Activity = JSON.parse(JSON.stringify(ACTIVITY)); ACTIVITY2.id = "2"; const ACTIVITIES: Activity[] = [ACTIVITY, ACTIVITY2]; const resourceBuilder: ResourceBuilder = (server: any, apiUrl: any) => { const resource = apiUrl("/activity/v1"); server .get(`${resource}/current`) .intercept((req: HttpRequest, res: HttpResponse) => { res.json(ACTIVITY); }); server.get(resource).intercept((req: HttpRequest, res: HttpResponse) => { res.json(ACTIVITIES); }); }; export default resourceBuilder;
{ "content_hash": "cca37bed90ea37daad2b30c6b4aa0c17", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 75, "avg_line_length": 23.4468085106383, "alnum_prop": 0.6025408348457351, "repo_name": "gchq/stroom", "id": "d054449c32e3531be2e7bce7233b6a15b5cba27a", "size": "1102", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "stroom-ui/src/testing/storybook/resources/activityResource.ts", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "272243" }, { "name": "Dockerfile", "bytes": "21009" }, { "name": "HTML", "bytes": "14114" }, { "name": "Java", "bytes": "22782925" }, { "name": "JavaScript", "bytes": "14516557" }, { "name": "Makefile", "bytes": "661" }, { "name": "Python", "bytes": "3176" }, { "name": "SCSS", "bytes": "158667" }, { "name": "Shell", "bytes": "166531" }, { "name": "TypeScript", "bytes": "2009517" }, { "name": "XSLT", "bytes": "174226" } ], "symlink_target": "" }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.VisualStudio.TextManager.Interop; using EnvDTE80; using Microsoft.VisualStudio.Shell; using Microsoft.VisualStudio.Shell.Interop; using System.Runtime.InteropServices; using Microsoft.VisualStudio; using Microsoft.VisualStudio.OLE.Interop; namespace VisualLocalizer.Library.Components { /// <summary> /// Provides methods for handling files in VS. /// </summary> public class DocumentViewsManager { private static ServiceProvider serviceProvider; /// <summary> /// Initializes the services from hosting VS environment /// </summary> static DocumentViewsManager() { DTE2 dte2 = (DTE2)Microsoft.VisualStudio.Shell.Package.GetGlobalService(typeof(SDTE)); if (dte2 == null) throw new InvalidOperationException("Cannot consume DTE."); Microsoft.VisualStudio.OLE.Interop.IServiceProvider sp = (Microsoft.VisualStudio.OLE.Interop.IServiceProvider)dte2; serviceProvider = new ServiceProvider(sp); if (serviceProvider == null) throw new InvalidOperationException("Cannot create ServiceProvider."); } /// <summary> /// Gets IVsTextView for a file /// </summary> /// <param name="file">File path</param> /// <param name="forceOpen">Whether the file should be opened, if it's closed</param> /// <param name="activate">Whether the window frame should be activated (focused)</param> public static IVsTextView GetTextViewForFile(string file, bool forceOpen, bool activate) { if (string.IsNullOrEmpty(file)) throw new ArgumentNullException("file"); IVsWindowFrame frame = GetWindowFrameForFile(file, forceOpen); if (frame != null) { if (forceOpen || activate) frame.Show(); if (activate) { VsShellUtilities.GetWindowObject(frame).Activate(); } return VsShellUtilities.GetTextView(frame); } else throw new Exception("Cannot get window frame for " + file); } /// <summary> /// Gets IVsWindowFrame for a file /// </summary> /// <param name="file">File path</param> /// <param name="forceOpen">Whether the file should be opened, if it's closed</param> public static IVsWindowFrame GetWindowFrameForFile(string file, bool forceOpen) { if (string.IsNullOrEmpty(file)) throw new ArgumentNullException("file"); IVsUIHierarchy uiHierarchy; uint itemID; IVsWindowFrame windowFrame; if (VsShellUtilities.IsDocumentOpen(serviceProvider, file, Guid.Empty, out uiHierarchy, out itemID, out windowFrame)) { return windowFrame; } else if (forceOpen) { VsShellUtilities.OpenDocument(serviceProvider, file); if (VsShellUtilities.IsDocumentOpen(serviceProvider, file, Guid.Empty, out uiHierarchy, out itemID, out windowFrame)) { return windowFrame; } else throw new InvalidOperationException("Cannot force open file " + file); } else return null; } /// <summary> /// Gets IVsTextLines for a file /// </summary> /// <param name="file">File path</param> /// <param name="forceOpen">Whether the file should be opened, if it's closed</param> public static IVsTextLines GetTextLinesForFile(string file, bool forceOpen) { if (string.IsNullOrEmpty(file)) throw new ArgumentNullException("file"); IVsWindowFrame frame = GetWindowFrameForFile(file, forceOpen); if (frame != null) { IVsTextLines lines = null; object docData; int hr = frame.GetProperty((int)__VSFPROPID.VSFPROPID_DocData, out docData); Marshal.ThrowExceptionForHR(hr); lines = docData as IVsTextLines; if (lines == null) { var bufferProvider = docData as IVsTextBufferProvider; if (bufferProvider != null) { hr = bufferProvider.GetTextBuffer(out lines); Marshal.ThrowExceptionForHR(hr); } } if (lines == null) { IVsTextView view = VsShellUtilities.GetTextView(frame); if (view != null) { hr = view.GetBuffer(out lines); Marshal.ThrowExceptionForHR(hr); } } if (lines == null) throw new Exception("Cannot get IVsTextLines for " + file); return lines; } else throw new Exception("Cannot get IVsWindowFrame for " + file); } /// <summary> /// Closes the window of edited file /// </summary> public static void CloseFile(string path) { if (path == null) throw new ArgumentNullException("path"); var window = VsShellUtilities.GetWindowObject(GetWindowFrameForFile(path, false)); try { window.Detach(); } catch { } window.Close(EnvDTE.vsSaveChanges.vsSaveChangesNo); } } }
{ "content_hash": "0cd3d44b9acfb0dccd2c9412d46a878f", "timestamp": "", "source": "github", "line_count": 128, "max_line_length": 135, "avg_line_length": 43.3515625, "alnum_prop": 0.5802847359884664, "repo_name": "ostumpf/visuallocalizer", "id": "009db0c66fdcdf2e2a91b416f7a78b8156f69e8c", "size": "5551", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "VisualLocalizer/VLlib/Components/DocumentViewsManager.cs", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "ASP", "bytes": "8375" }, { "name": "C#", "bytes": "1682006" }, { "name": "Visual Basic", "bytes": "46162" } ], "symlink_target": "" }
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package keyline.type; /** * * @author KMY */ public class IDType { }
{ "content_hash": "1c6d39eefe672129425fcd9e0aa7f5ba", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 79, "avg_line_length": 18.5, "alnum_prop": 0.6988416988416989, "repo_name": "kmycode/Keyline", "id": "8fa51cb0bcd552d5b5550b900d9118d2c6b9a97a", "size": "259", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/keyline/type/IDType.java", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "32978" }, { "name": "Java", "bytes": "195365" } ], "symlink_target": "" }
.class public final enum Landroid/net/wifi/SupplicantState; .super Ljava/lang/Enum; .source "SupplicantState.java" # interfaces .implements Landroid/os/Parcelable; # annotations .annotation system Ldalvik/annotation/MemberClasses; value = { Landroid/net/wifi/SupplicantState$1; } .end annotation .annotation system Ldalvik/annotation/Signature; value = { "Ljava/lang/Enum", "<", "Landroid/net/wifi/SupplicantState;", ">;", "Landroid/os/Parcelable;" } .end annotation # static fields .field private static final synthetic $VALUES:[Landroid/net/wifi/SupplicantState; .field private static synthetic -android_net_wifi_SupplicantStateSwitchesValues:[I .field public static final enum ASSOCIATED:Landroid/net/wifi/SupplicantState; .field public static final enum ASSOCIATING:Landroid/net/wifi/SupplicantState; .field public static final enum AUTHENTICATING:Landroid/net/wifi/SupplicantState; .field public static final enum COMPLETED:Landroid/net/wifi/SupplicantState; .field public static final CREATOR:Landroid/os/Parcelable$Creator; .annotation system Ldalvik/annotation/Signature; value = { "Landroid/os/Parcelable$Creator", "<", "Landroid/net/wifi/SupplicantState;", ">;" } .end annotation .end field .field public static final enum DISCONNECTED:Landroid/net/wifi/SupplicantState; .field public static final enum DORMANT:Landroid/net/wifi/SupplicantState; .field public static final enum FOUR_WAY_HANDSHAKE:Landroid/net/wifi/SupplicantState; .field public static final enum GROUP_HANDSHAKE:Landroid/net/wifi/SupplicantState; .field public static final enum INACTIVE:Landroid/net/wifi/SupplicantState; .field public static final enum INTERFACE_DISABLED:Landroid/net/wifi/SupplicantState; .field public static final enum INVALID:Landroid/net/wifi/SupplicantState; .field public static final enum SCANNING:Landroid/net/wifi/SupplicantState; .field public static final enum UNINITIALIZED:Landroid/net/wifi/SupplicantState; # direct methods .method private static synthetic -getandroid_net_wifi_SupplicantStateSwitchesValues()[I .locals 3 sget-object v0, Landroid/net/wifi/SupplicantState;->-android_net_wifi_SupplicantStateSwitchesValues:[I if-eqz v0, :cond_0 sget-object v0, Landroid/net/wifi/SupplicantState;->-android_net_wifi_SupplicantStateSwitchesValues:[I return-object v0 :cond_0 invoke-static {}, Landroid/net/wifi/SupplicantState;->values()[Landroid/net/wifi/SupplicantState; move-result-object v0 array-length v0, v0 new-array v0, v0, [I :try_start_0 sget-object v1, Landroid/net/wifi/SupplicantState;->ASSOCIATED:Landroid/net/wifi/SupplicantState; invoke-virtual {v1}, Landroid/net/wifi/SupplicantState;->ordinal()I move-result v1 const/4 v2, 0x1 aput v2, v0, v1 :try_end_0 .catch Ljava/lang/NoSuchFieldError; {:try_start_0 .. :try_end_0} :catch_c :goto_0 :try_start_1 sget-object v1, Landroid/net/wifi/SupplicantState;->ASSOCIATING:Landroid/net/wifi/SupplicantState; invoke-virtual {v1}, Landroid/net/wifi/SupplicantState;->ordinal()I move-result v1 const/4 v2, 0x2 aput v2, v0, v1 :try_end_1 .catch Ljava/lang/NoSuchFieldError; {:try_start_1 .. :try_end_1} :catch_b :goto_1 :try_start_2 sget-object v1, Landroid/net/wifi/SupplicantState;->AUTHENTICATING:Landroid/net/wifi/SupplicantState; invoke-virtual {v1}, Landroid/net/wifi/SupplicantState;->ordinal()I move-result v1 const/4 v2, 0x3 aput v2, v0, v1 :try_end_2 .catch Ljava/lang/NoSuchFieldError; {:try_start_2 .. :try_end_2} :catch_a :goto_2 :try_start_3 sget-object v1, Landroid/net/wifi/SupplicantState;->COMPLETED:Landroid/net/wifi/SupplicantState; invoke-virtual {v1}, Landroid/net/wifi/SupplicantState;->ordinal()I move-result v1 const/4 v2, 0x4 aput v2, v0, v1 :try_end_3 .catch Ljava/lang/NoSuchFieldError; {:try_start_3 .. :try_end_3} :catch_9 :goto_3 :try_start_4 sget-object v1, Landroid/net/wifi/SupplicantState;->DISCONNECTED:Landroid/net/wifi/SupplicantState; invoke-virtual {v1}, Landroid/net/wifi/SupplicantState;->ordinal()I move-result v1 const/4 v2, 0x5 aput v2, v0, v1 :try_end_4 .catch Ljava/lang/NoSuchFieldError; {:try_start_4 .. :try_end_4} :catch_8 :goto_4 :try_start_5 sget-object v1, Landroid/net/wifi/SupplicantState;->DORMANT:Landroid/net/wifi/SupplicantState; invoke-virtual {v1}, Landroid/net/wifi/SupplicantState;->ordinal()I move-result v1 const/4 v2, 0x6 aput v2, v0, v1 :try_end_5 .catch Ljava/lang/NoSuchFieldError; {:try_start_5 .. :try_end_5} :catch_7 :goto_5 :try_start_6 sget-object v1, Landroid/net/wifi/SupplicantState;->FOUR_WAY_HANDSHAKE:Landroid/net/wifi/SupplicantState; invoke-virtual {v1}, Landroid/net/wifi/SupplicantState;->ordinal()I move-result v1 const/4 v2, 0x7 aput v2, v0, v1 :try_end_6 .catch Ljava/lang/NoSuchFieldError; {:try_start_6 .. :try_end_6} :catch_6 :goto_6 :try_start_7 sget-object v1, Landroid/net/wifi/SupplicantState;->GROUP_HANDSHAKE:Landroid/net/wifi/SupplicantState; invoke-virtual {v1}, Landroid/net/wifi/SupplicantState;->ordinal()I move-result v1 const/16 v2, 0x8 aput v2, v0, v1 :try_end_7 .catch Ljava/lang/NoSuchFieldError; {:try_start_7 .. :try_end_7} :catch_5 :goto_7 :try_start_8 sget-object v1, Landroid/net/wifi/SupplicantState;->INACTIVE:Landroid/net/wifi/SupplicantState; invoke-virtual {v1}, Landroid/net/wifi/SupplicantState;->ordinal()I move-result v1 const/16 v2, 0x9 aput v2, v0, v1 :try_end_8 .catch Ljava/lang/NoSuchFieldError; {:try_start_8 .. :try_end_8} :catch_4 :goto_8 :try_start_9 sget-object v1, Landroid/net/wifi/SupplicantState;->INTERFACE_DISABLED:Landroid/net/wifi/SupplicantState; invoke-virtual {v1}, Landroid/net/wifi/SupplicantState;->ordinal()I move-result v1 const/16 v2, 0xa aput v2, v0, v1 :try_end_9 .catch Ljava/lang/NoSuchFieldError; {:try_start_9 .. :try_end_9} :catch_3 :goto_9 :try_start_a sget-object v1, Landroid/net/wifi/SupplicantState;->INVALID:Landroid/net/wifi/SupplicantState; invoke-virtual {v1}, Landroid/net/wifi/SupplicantState;->ordinal()I move-result v1 const/16 v2, 0xb aput v2, v0, v1 :try_end_a .catch Ljava/lang/NoSuchFieldError; {:try_start_a .. :try_end_a} :catch_2 :goto_a :try_start_b sget-object v1, Landroid/net/wifi/SupplicantState;->SCANNING:Landroid/net/wifi/SupplicantState; invoke-virtual {v1}, Landroid/net/wifi/SupplicantState;->ordinal()I move-result v1 const/16 v2, 0xc aput v2, v0, v1 :try_end_b .catch Ljava/lang/NoSuchFieldError; {:try_start_b .. :try_end_b} :catch_1 :goto_b :try_start_c sget-object v1, Landroid/net/wifi/SupplicantState;->UNINITIALIZED:Landroid/net/wifi/SupplicantState; invoke-virtual {v1}, Landroid/net/wifi/SupplicantState;->ordinal()I move-result v1 const/16 v2, 0xd aput v2, v0, v1 :try_end_c .catch Ljava/lang/NoSuchFieldError; {:try_start_c .. :try_end_c} :catch_0 :goto_c sput-object v0, Landroid/net/wifi/SupplicantState;->-android_net_wifi_SupplicantStateSwitchesValues:[I return-object v0 :catch_0 move-exception v1 goto :goto_c :catch_1 move-exception v1 goto :goto_b :catch_2 move-exception v1 goto :goto_a :catch_3 move-exception v1 goto :goto_9 :catch_4 move-exception v1 goto :goto_8 :catch_5 move-exception v1 goto :goto_7 :catch_6 move-exception v1 goto :goto_6 :catch_7 move-exception v1 goto :goto_5 :catch_8 move-exception v1 goto :goto_4 :catch_9 move-exception v1 goto :goto_3 :catch_a move-exception v1 goto :goto_2 :catch_b move-exception v1 goto/16 :goto_1 :catch_c move-exception v1 goto/16 :goto_0 .end method .method static constructor <clinit>()V .locals 8 .prologue const/4 v7, 0x4 const/4 v6, 0x3 const/4 v5, 0x2 const/4 v4, 0x1 const/4 v3, 0x0 .line 34 new-instance v0, Landroid/net/wifi/SupplicantState; const-string/jumbo v1, "DISCONNECTED" invoke-direct {v0, v1, v3}, Landroid/net/wifi/SupplicantState;-><init>(Ljava/lang/String;I)V .line 39 sput-object v0, Landroid/net/wifi/SupplicantState;->DISCONNECTED:Landroid/net/wifi/SupplicantState; .line 41 new-instance v0, Landroid/net/wifi/SupplicantState; const-string/jumbo v1, "INTERFACE_DISABLED" invoke-direct {v0, v1, v4}, Landroid/net/wifi/SupplicantState;-><init>(Ljava/lang/String;I)V .line 48 sput-object v0, Landroid/net/wifi/SupplicantState;->INTERFACE_DISABLED:Landroid/net/wifi/SupplicantState; .line 50 new-instance v0, Landroid/net/wifi/SupplicantState; const-string/jumbo v1, "INACTIVE" invoke-direct {v0, v1, v5}, Landroid/net/wifi/SupplicantState;-><init>(Ljava/lang/String;I)V .line 58 sput-object v0, Landroid/net/wifi/SupplicantState;->INACTIVE:Landroid/net/wifi/SupplicantState; .line 60 new-instance v0, Landroid/net/wifi/SupplicantState; const-string/jumbo v1, "SCANNING" invoke-direct {v0, v1, v6}, Landroid/net/wifi/SupplicantState;-><init>(Ljava/lang/String;I)V .line 66 sput-object v0, Landroid/net/wifi/SupplicantState;->SCANNING:Landroid/net/wifi/SupplicantState; .line 68 new-instance v0, Landroid/net/wifi/SupplicantState; const-string/jumbo v1, "AUTHENTICATING" invoke-direct {v0, v1, v7}, Landroid/net/wifi/SupplicantState;-><init>(Ljava/lang/String;I)V .line 75 sput-object v0, Landroid/net/wifi/SupplicantState;->AUTHENTICATING:Landroid/net/wifi/SupplicantState; .line 77 new-instance v0, Landroid/net/wifi/SupplicantState; const-string/jumbo v1, "ASSOCIATING" const/4 v2, 0x5 invoke-direct {v0, v1, v2}, Landroid/net/wifi/SupplicantState;-><init>(Ljava/lang/String;I)V .line 86 sput-object v0, Landroid/net/wifi/SupplicantState;->ASSOCIATING:Landroid/net/wifi/SupplicantState; .line 88 new-instance v0, Landroid/net/wifi/SupplicantState; const-string/jumbo v1, "ASSOCIATED" const/4 v2, 0x6 invoke-direct {v0, v1, v2}, Landroid/net/wifi/SupplicantState;-><init>(Ljava/lang/String;I)V .line 96 sput-object v0, Landroid/net/wifi/SupplicantState;->ASSOCIATED:Landroid/net/wifi/SupplicantState; .line 98 new-instance v0, Landroid/net/wifi/SupplicantState; const-string/jumbo v1, "FOUR_WAY_HANDSHAKE" const/4 v2, 0x7 invoke-direct {v0, v1, v2}, Landroid/net/wifi/SupplicantState;-><init>(Ljava/lang/String;I)V .line 106 sput-object v0, Landroid/net/wifi/SupplicantState;->FOUR_WAY_HANDSHAKE:Landroid/net/wifi/SupplicantState; .line 108 new-instance v0, Landroid/net/wifi/SupplicantState; const-string/jumbo v1, "GROUP_HANDSHAKE" const/16 v2, 0x8 invoke-direct {v0, v1, v2}, Landroid/net/wifi/SupplicantState;-><init>(Ljava/lang/String;I)V .line 116 sput-object v0, Landroid/net/wifi/SupplicantState;->GROUP_HANDSHAKE:Landroid/net/wifi/SupplicantState; .line 118 new-instance v0, Landroid/net/wifi/SupplicantState; const-string/jumbo v1, "COMPLETED" const/16 v2, 0x9 invoke-direct {v0, v1, v2}, Landroid/net/wifi/SupplicantState;-><init>(Ljava/lang/String;I)V .line 136 sput-object v0, Landroid/net/wifi/SupplicantState;->COMPLETED:Landroid/net/wifi/SupplicantState; .line 138 new-instance v0, Landroid/net/wifi/SupplicantState; const-string/jumbo v1, "DORMANT" const/16 v2, 0xa invoke-direct {v0, v1, v2}, Landroid/net/wifi/SupplicantState;-><init>(Ljava/lang/String;I)V .line 146 sput-object v0, Landroid/net/wifi/SupplicantState;->DORMANT:Landroid/net/wifi/SupplicantState; .line 148 new-instance v0, Landroid/net/wifi/SupplicantState; const-string/jumbo v1, "UNINITIALIZED" const/16 v2, 0xb invoke-direct {v0, v1, v2}, Landroid/net/wifi/SupplicantState;-><init>(Ljava/lang/String;I)V .line 155 sput-object v0, Landroid/net/wifi/SupplicantState;->UNINITIALIZED:Landroid/net/wifi/SupplicantState; .line 157 new-instance v0, Landroid/net/wifi/SupplicantState; const-string/jumbo v1, "INVALID" const/16 v2, 0xc invoke-direct {v0, v1, v2}, Landroid/net/wifi/SupplicantState;-><init>(Ljava/lang/String;I)V .line 160 sput-object v0, Landroid/net/wifi/SupplicantState;->INVALID:Landroid/net/wifi/SupplicantState; .line 33 const/16 v0, 0xd new-array v0, v0, [Landroid/net/wifi/SupplicantState; sget-object v1, Landroid/net/wifi/SupplicantState;->DISCONNECTED:Landroid/net/wifi/SupplicantState; aput-object v1, v0, v3 sget-object v1, Landroid/net/wifi/SupplicantState;->INTERFACE_DISABLED:Landroid/net/wifi/SupplicantState; aput-object v1, v0, v4 sget-object v1, Landroid/net/wifi/SupplicantState;->INACTIVE:Landroid/net/wifi/SupplicantState; aput-object v1, v0, v5 sget-object v1, Landroid/net/wifi/SupplicantState;->SCANNING:Landroid/net/wifi/SupplicantState; aput-object v1, v0, v6 sget-object v1, Landroid/net/wifi/SupplicantState;->AUTHENTICATING:Landroid/net/wifi/SupplicantState; aput-object v1, v0, v7 sget-object v1, Landroid/net/wifi/SupplicantState;->ASSOCIATING:Landroid/net/wifi/SupplicantState; const/4 v2, 0x5 aput-object v1, v0, v2 sget-object v1, Landroid/net/wifi/SupplicantState;->ASSOCIATED:Landroid/net/wifi/SupplicantState; const/4 v2, 0x6 aput-object v1, v0, v2 sget-object v1, Landroid/net/wifi/SupplicantState;->FOUR_WAY_HANDSHAKE:Landroid/net/wifi/SupplicantState; const/4 v2, 0x7 aput-object v1, v0, v2 sget-object v1, Landroid/net/wifi/SupplicantState;->GROUP_HANDSHAKE:Landroid/net/wifi/SupplicantState; const/16 v2, 0x8 aput-object v1, v0, v2 sget-object v1, Landroid/net/wifi/SupplicantState;->COMPLETED:Landroid/net/wifi/SupplicantState; const/16 v2, 0x9 aput-object v1, v0, v2 sget-object v1, Landroid/net/wifi/SupplicantState;->DORMANT:Landroid/net/wifi/SupplicantState; const/16 v2, 0xa aput-object v1, v0, v2 sget-object v1, Landroid/net/wifi/SupplicantState;->UNINITIALIZED:Landroid/net/wifi/SupplicantState; const/16 v2, 0xb aput-object v1, v0, v2 sget-object v1, Landroid/net/wifi/SupplicantState;->INVALID:Landroid/net/wifi/SupplicantState; const/16 v2, 0xc aput-object v1, v0, v2 sput-object v0, Landroid/net/wifi/SupplicantState;->$VALUES:[Landroid/net/wifi/SupplicantState; .line 255 new-instance v0, Landroid/net/wifi/SupplicantState$1; invoke-direct {v0}, Landroid/net/wifi/SupplicantState$1;-><init>()V .line 254 sput-object v0, Landroid/net/wifi/SupplicantState;->CREATOR:Landroid/os/Parcelable$Creator; .line 33 return-void .end method .method private constructor <init>(Ljava/lang/String;I)V .locals 0 .prologue .line 33 invoke-direct {p0, p1, p2}, Ljava/lang/Enum;-><init>(Ljava/lang/String;I)V return-void .end method .method public static isConnecting(Landroid/net/wifi/SupplicantState;)Z .locals 2 .param p0, "state" # Landroid/net/wifi/SupplicantState; .prologue .line 199 invoke-static {}, Landroid/net/wifi/SupplicantState;->-getandroid_net_wifi_SupplicantStateSwitchesValues()[I move-result-object v0 invoke-virtual {p0}, Landroid/net/wifi/SupplicantState;->ordinal()I move-result v1 aget v0, v0, v1 packed-switch v0, :pswitch_data_0 .line 216 new-instance v0, Ljava/lang/IllegalArgumentException; const-string/jumbo v1, "Unknown supplicant state" invoke-direct {v0, v1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V throw v0 .line 206 :pswitch_0 const/4 v0, 0x1 return v0 .line 214 :pswitch_1 const/4 v0, 0x0 return v0 .line 199 :pswitch_data_0 .packed-switch 0x1 :pswitch_0 :pswitch_0 :pswitch_0 :pswitch_0 :pswitch_1 :pswitch_1 :pswitch_0 :pswitch_0 :pswitch_1 :pswitch_1 :pswitch_1 :pswitch_1 :pswitch_1 .end packed-switch .end method .method public static isDriverActive(Landroid/net/wifi/SupplicantState;)Z .locals 2 .param p0, "state" # Landroid/net/wifi/SupplicantState; .prologue .line 222 invoke-static {}, Landroid/net/wifi/SupplicantState;->-getandroid_net_wifi_SupplicantStateSwitchesValues()[I move-result-object v0 invoke-virtual {p0}, Landroid/net/wifi/SupplicantState;->ordinal()I move-result v1 aget v0, v0, v1 packed-switch v0, :pswitch_data_0 .line 239 new-instance v0, Ljava/lang/IllegalArgumentException; const-string/jumbo v1, "Unknown supplicant state" invoke-direct {v0, v1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V throw v0 .line 233 :pswitch_0 const/4 v0, 0x1 return v0 .line 237 :pswitch_1 const/4 v0, 0x0 return v0 .line 222 :pswitch_data_0 .packed-switch 0x1 :pswitch_0 :pswitch_0 :pswitch_0 :pswitch_0 :pswitch_0 :pswitch_0 :pswitch_0 :pswitch_0 :pswitch_0 :pswitch_1 :pswitch_1 :pswitch_0 :pswitch_1 .end packed-switch .end method .method public static isHandshakeState(Landroid/net/wifi/SupplicantState;)Z .locals 2 .param p0, "state" # Landroid/net/wifi/SupplicantState; .prologue .line 176 invoke-static {}, Landroid/net/wifi/SupplicantState;->-getandroid_net_wifi_SupplicantStateSwitchesValues()[I move-result-object v0 invoke-virtual {p0}, Landroid/net/wifi/SupplicantState;->ordinal()I move-result v1 aget v0, v0, v1 packed-switch v0, :pswitch_data_0 .line 193 new-instance v0, Ljava/lang/IllegalArgumentException; const-string/jumbo v1, "Unknown supplicant state" invoke-direct {v0, v1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V throw v0 .line 182 :pswitch_0 const/4 v0, 0x1 return v0 .line 191 :pswitch_1 const/4 v0, 0x0 return v0 .line 176 :pswitch_data_0 .packed-switch 0x1 :pswitch_0 :pswitch_0 :pswitch_0 :pswitch_1 :pswitch_1 :pswitch_1 :pswitch_0 :pswitch_0 :pswitch_1 :pswitch_1 :pswitch_1 :pswitch_1 :pswitch_1 .end packed-switch .end method .method public static isValidState(Landroid/net/wifi/SupplicantState;)Z .locals 2 .param p0, "state" # Landroid/net/wifi/SupplicantState; .prologue const/4 v0, 0x0 .line 170 sget-object v1, Landroid/net/wifi/SupplicantState;->UNINITIALIZED:Landroid/net/wifi/SupplicantState; if-eq p0, v1, :cond_0 sget-object v1, Landroid/net/wifi/SupplicantState;->INVALID:Landroid/net/wifi/SupplicantState; if-eq p0, v1, :cond_0 const/4 v0, 0x1 :cond_0 return v0 .end method .method public static valueOf(Ljava/lang/String;)Landroid/net/wifi/SupplicantState; .locals 1 .param p0, "name" # Ljava/lang/String; .prologue .line 33 const-class v0, Landroid/net/wifi/SupplicantState; invoke-static {v0, p0}, Ljava/lang/Enum;->valueOf(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Enum; move-result-object v0 check-cast v0, Landroid/net/wifi/SupplicantState; return-object v0 .end method .method public static values()[Landroid/net/wifi/SupplicantState; .locals 1 .prologue .line 33 sget-object v0, Landroid/net/wifi/SupplicantState;->$VALUES:[Landroid/net/wifi/SupplicantState; return-object v0 .end method # virtual methods .method public describeContents()I .locals 1 .prologue .line 245 const/4 v0, 0x0 return v0 .end method .method public writeToParcel(Landroid/os/Parcel;I)V .locals 1 .param p1, "dest" # Landroid/os/Parcel; .param p2, "flags" # I .prologue .line 250 invoke-virtual {p0}, Landroid/net/wifi/SupplicantState;->name()Ljava/lang/String; move-result-object v0 invoke-virtual {p1, v0}, Landroid/os/Parcel;->writeString(Ljava/lang/String;)V .line 249 return-void .end method
{ "content_hash": "abe8275786ebef62b662d9c395154ac8", "timestamp": "", "source": "github", "line_count": 850, "max_line_length": 112, "avg_line_length": 24.403529411764705, "alnum_prop": 0.6852914236127851, "repo_name": "libnijunior/patchrom_bullhead", "id": "758e5fef44c15e2db248de030123b806310c061e", "size": "20743", "binary": false, "copies": "2", "ref": "refs/heads/mtc20k", "path": "framework.jar.out/smali/android/net/wifi/SupplicantState.smali", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "3334" }, { "name": "Groff", "bytes": "8687" }, { "name": "Makefile", "bytes": "2098" }, { "name": "Shell", "bytes": "26769" }, { "name": "Smali", "bytes": "172301453" } ], "symlink_target": "" }
<?php declare(strict_types=1); namespace DrdPlus\Person\ProfessionLevels\Exceptions; class InvalidPropertyValue extends \LogicException implements Logic { }
{ "content_hash": "21924835aaffb2a36336ec9659e9924e", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 67, "avg_line_length": 19.875, "alnum_prop": 0.8238993710691824, "repo_name": "jaroslavtyc/drd-plus-profession-levels", "id": "f6b754e2d3f3e2fbfd9a19624d83abfe3fe88bbd", "size": "159", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "DrdPlus/Person/ProfessionLevels/Exceptions/InvalidPropertyValue.php", "mode": "33188", "license": "mit", "language": [ { "name": "PHP", "bytes": "134016" } ], "symlink_target": "" }
<!-- TEH HTML CODEZ--> <!-- Built in Canada...MAPLE SYRUP...POLAR BEARS...IGLOOS :P --> <!-- Copyright 2014 Suraj "TheInterframe" G. 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. IMAGE USED ON MAIN PAGE BY: Frederic BISSON under https://creativecommons.org/licenses/by/2.0/ Some Changes made to image (Bluring)! --> <html> <head><title>The Playlog</title> <link rel="stylesheet" type="text/css" href="css/style.css"> <link href='http://fonts.googleapis.com/css?family=Raleway|Hammersmith+One' rel='stylesheet' type='text/css'> <!-- Get Scripts --> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"> </script> <script src="/backend/api/main.js"> </script> <!-- Get Scripts --> <!--Mirror for doing the "insert into" function--> <script type="text/javascript"> function insertintoMirror () { insertInto(); } </script> </head> <body style="background: black;" onload="infoDisplay()"> <h1 class="title">lePlaylog</h1> <center> <input id="foo" class="ii" type="text" placeholder="What's playing?"> <input id="foo2" class="ii" type="text" placeholder="By who?"> </input> </input> <br> <br> <a href = "#" onclick="insertintoMirror();" class = "mainpage" style = "text-align: left;">Post</a> </center> <br> <br> <br> <ol></ol> <br> </body> </html>
{ "content_hash": "83d561397cf785a96fc133fd9a2fa92e", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 109, "avg_line_length": 28.063492063492063, "alnum_prop": 0.7024886877828054, "repo_name": "TheInterframe/lePlaylog", "id": "c67477e17e4bb758c6106cce1758d2c07027c09f", "size": "1768", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "dashboard.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "1491" }, { "name": "JavaScript", "bytes": "2490" } ], "symlink_target": "" }
#include "aes_def.h" #include <openssl/aes.h> #include <openssl/evp.h> static const EVP_CIPHER* GCM_get_cipher(int keySize) { switch (keySize) { case 16: return EVP_aes_128_gcm(); case 24: return EVP_aes_192_gcm(); case 32: return EVP_aes_256_gcm(); default: THROW_ERROR("Unknown AES GCM key size"); } } static Handle<std::string> AES_GCM_encrypt( Handle<std::string> hKey, Handle<std::string> hMsg, Handle<std::string> hIv, Handle<std::string> hAad, int tagSize ) { LOG_FUNC(); const EVP_CIPHER* cipher = GCM_get_cipher((int)hKey->length()); const byte* iv = (byte*)hIv->c_str(); const byte* key = (byte*)hKey->c_str(); const byte* aad = (byte*)hAad->c_str(); const byte* msg = (byte*)hMsg->c_str(); byte* output; int output_len, final_output_len; Handle<std::string> hOutput(new std::string()); // Get encrypted block size int gcm_block_size = EVP_CIPHER_block_size(cipher); int max_output_len = gcm_block_size + (int)hMsg->length() + 256; if (max_output_len < (int)hMsg->length()) THROW_ERROR("Input data too large"); hOutput->resize(max_output_len); output = (byte*)hOutput->c_str(); ScopedEVP_CIPHER_CTX ctx(EVP_CIPHER_CTX_new()); /* Create and initialise the context */ if (ctx.isEmpty()) THROW_OPENSSL("EVP_CIPHER_CTX_new"); /* Initialise the encryption operation. */ if (1 != EVP_EncryptInit_ex(ctx.Get(), cipher, nullptr, nullptr, nullptr)) THROW_OPENSSL("Initialise the encryption operation"); /* Set IV length if default 12 bytes (96 bits) is not appropriate */ if (1 != EVP_CIPHER_CTX_ctrl(ctx.Get(), EVP_CTRL_GCM_SET_IVLEN, (int)hIv->length(), nullptr)) THROW_OPENSSL("EVP_CIPHER_CTX_ctrl"); /* Initialise key and IV */ if (1 != EVP_EncryptInit_ex(ctx.Get(), nullptr, nullptr, key, iv)) THROW_OPENSSL("Initialise key and IV"); /* Provide any AAD data. This can be called zero or more times as * required */ if (1 != EVP_EncryptUpdate(ctx.Get(), nullptr, &output_len, aad, (int)hAad->length())) THROW_OPENSSL("Provide any AAD data"); /* Provide the message to be encrypted, and obtain the encrypted output. * EVP_EncryptUpdate can be called multiple times if necessary */ if (1 != EVP_EncryptUpdate(ctx.Get(), output, &output_len, msg, (int)hMsg->length())) THROW_OPENSSL("EVP_EncryptUpdate"); final_output_len = output_len; /* Finalise the encryption. Normally ciphertext bytes may be written at * this stage, but this does not occur in GCM mode */ if (1 != EVP_EncryptFinal_ex(ctx.Get(), output + final_output_len, &output_len)) THROW_OPENSSL("EVP_EncryptFinal_ex"); final_output_len += output_len; hOutput->resize(final_output_len + tagSize); output = (byte*)hOutput->c_str(); /* Get the tag */ if (1 != EVP_CIPHER_CTX_ctrl(ctx.Get(), EVP_CTRL_GCM_GET_TAG, tagSize, output + final_output_len)) THROW_OPENSSL("Get the tag"); hOutput->resize(final_output_len + tagSize); return hOutput; } static Handle<std::string> AES_GCM_decrypt( Handle<std::string> hKey, Handle<std::string> hMsg, Handle<std::string> hIv, Handle<std::string> hAad, int tagSize ) { LOG_FUNC(); const EVP_CIPHER* cipher = GCM_get_cipher((int)hKey->length()); const byte* iv = (byte*)hIv->c_str(); const byte* key = (byte*)hKey->c_str(); const byte* aad = (byte*)hAad->c_str(); byte* output; int output_len, final_output_len; Handle<std::string> hOutput(new std::string()); int msg_len = (int)hMsg->length() - tagSize; std::string sTag = hMsg->substr(hMsg->length() - tagSize); hMsg->resize(msg_len); const byte* msg = (byte*)hMsg->c_str(); // Get decrypted block size int max_output_len = (int)hMsg->length(); hOutput->resize(max_output_len); output = (byte*)hOutput->c_str(); ScopedEVP_CIPHER_CTX ctx(EVP_CIPHER_CTX_new()); /* Create and initialise the context */ if (ctx.isEmpty()) THROW_OPENSSL("EVP_CIPHER_CTX_new"); /* Initialise the encryption operation. */ if (1 != EVP_DecryptInit_ex(ctx.Get(), cipher, nullptr, nullptr, nullptr)) THROW_OPENSSL("Initialise the encryption operation"); /* Set IV length if default 12 bytes (96 bits) is not appropriate */ if (1 != EVP_CIPHER_CTX_ctrl(ctx.Get(), EVP_CTRL_GCM_SET_IVLEN, (int)hIv->length(), nullptr)) THROW_OPENSSL("EVP_CIPHER_CTX_ctrl"); /* Initialise key and IV */ if (1 != EVP_DecryptInit_ex(ctx.Get(), nullptr, nullptr, key, iv)) THROW_OPENSSL("Initialise key and IV"); /* Provide any AAD data. This can be called zero or more times as * required */ if (1 != EVP_DecryptUpdate(ctx.Get(), nullptr, &output_len, aad, (int)hAad->length())) THROW_OPENSSL("Provide any AAD data"); /* Provide the message to be encrypted, and obtain the encrypted output. * EVP_EncryptUpdate can be called multiple times if necessary */ if (1 != EVP_DecryptUpdate(ctx.Get(), output, &output_len, msg, (int)hMsg->length())) THROW_OPENSSL("EVP_EncryptUpdate"); final_output_len = output_len; /* Set expected tag value. Works in OpenSSL 1.0.1d and later */ if (1 != EVP_CIPHER_CTX_ctrl(ctx.Get(), EVP_CTRL_GCM_SET_TAG, tagSize, (byte*)sTag.c_str())) THROW_OPENSSL("Set the tag"); /* Finalise the encryption. Normally ciphertext bytes may be written at * this stage, but this does not occur in GCM mode */ if (1 != EVP_DecryptFinal_ex(ctx.Get(), output + final_output_len, &output_len)) THROW_OPENSSL("EVP_EncryptFinal_ex"); final_output_len += output_len; hOutput->resize(final_output_len); return hOutput; } Handle<std::string> ScopedAES::encryptGcm(Handle<std::string> hMsg, Handle<std::string> hIv, Handle<std::string> hAad, int tagSize) { LOG_FUNC(); return AES_GCM_encrypt(this->value, hMsg, hIv, hAad, tagSize); } Handle<std::string> ScopedAES::decryptGcm(Handle<std::string> hMsg, Handle<std::string> hIv, Handle<std::string> hAad, int tagSize) { LOG_FUNC(); return AES_GCM_decrypt(this->value, hMsg, hIv, hAad, tagSize); }
{ "content_hash": "ec8d4f3432dc0fdf579dca0b6c27a943", "timestamp": "", "source": "github", "line_count": 180, "max_line_length": 133, "avg_line_length": 33.37777777777778, "alnum_prop": 0.6632822902796272, "repo_name": "PeculiarVentures/node-webcrypto-ossl", "id": "370cd006cdbcce1c422f6dc78ea5c4764d52e514", "size": "6008", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "src/aes/aes_gcm.cpp", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "1883" }, { "name": "C++", "bytes": "137138" }, { "name": "HTML", "bytes": "422" }, { "name": "JavaScript", "bytes": "104425" }, { "name": "Python", "bytes": "4044" }, { "name": "TypeScript", "bytes": "88428" } ], "symlink_target": "" }
using System; using System.Diagnostics; using System.Drawing; using System.Windows.Forms; using ClipUp.Sdk.Providers; namespace ClipUp.Windows.Forms.Provider { public partial class About : Form { private readonly UploadProviderSettings provider; public About(UploadProviderSettings provider) { this.provider = provider; this.InitializeComponent(); } private void About_Load(object sender, EventArgs e) { this.Text = $"About {this.provider.Provider.Name}"; this.labelTitle.Text = $"{this.provider.Provider.Name} version {this.provider.Provider.Version}"; if (this.provider.Type == UploadProviderTypes.Image) this.labelAbout.Text = this.labelAbout.Text.Replace("text", "image"); this.linkLink.Location = new Point(this.labelAbout.Location.X + this.labelAbout.Width - 6, this.linkLink.Location.Y); this.linkLink.Text = this.provider.Provider.Website; this.labelAuthor.Text = $"Author: {this.provider.Provider.AuthorName}"; this.linkAuthor.Text = this.provider.Provider.AuthorWebsite; this.labelDescription.Text = this.provider.Provider.Description; } private void linkLink_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { Process.Start(this.provider.Provider.Website); } private void linkAuthor_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { Process.Start(this.provider.Provider.AuthorWebsite); } private void buttonClose_Click(object sender, EventArgs e) { this.Close(); } } }
{ "content_hash": "896cd2259f238440404850e97f40b37f", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 134, "avg_line_length": 32.320754716981135, "alnum_prop": 0.6544074722708698, "repo_name": "JoeBiellik/clipup", "id": "3036e98caf313af964520486f1ad4a7e1750d550", "size": "1715", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Windows/Forms/Provider/About.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "119348" } ], "symlink_target": "" }
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("13. SrabskoUnleashed")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("13. SrabskoUnleashed")] [assembly: AssemblyCopyright("Copyright © 2017")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("ee221798-a177-4027-803a-db71db44cda8")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
{ "content_hash": "d49c293bcf3698747a10ee69e9c2b729", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 84, "avg_line_length": 39.111111111111114, "alnum_prop": 0.7478693181818182, "repo_name": "krasiymihajlov/Soft-Uni-practices", "id": "e76cf13ab66c469273c968ae39af55c57d1f02b6", "size": "1411", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "C# Advanced/02.Sets and Dictionaries/Sets and Dictionaries - Excer/13. SrabskoUnleashed/Properties/AssemblyInfo.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "1012199" }, { "name": "HTML", "bytes": "568" } ], "symlink_target": "" }
function nuke(selector1, selector2) { if (selector1 === selector2) return; $(selector1).filter(selector2).remove(); } module.exports = { nuke };
{ "content_hash": "d42a418f877292479a3e0ba07e10acfa", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 44, "avg_line_length": 25.5, "alnum_prop": 0.673202614379085, "repo_name": "Michaela07313/JavaScript-Core", "id": "f5e78946ba612cacbc8bac7372ca4123cc0a70f1", "size": "153", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Unit testing - labs and exercises/ArmageDOM.js", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "5458" }, { "name": "JavaScript", "bytes": "71138" } ], "symlink_target": "" }
using System; using Android.App; using Android.OS; using Android.Widget; using Esri.ArcGISRuntime.Data; using Esri.ArcGISRuntime.Mapping; using Esri.ArcGISRuntime.UI.Controls; using ArcGISRuntime.Samples.Managers; namespace ArcGISRuntime.Samples.FeatureLayerGeodatabase { [Activity (ConfigurationChanges=Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)] [ArcGISRuntime.Samples.Shared.Attributes.OfflineData("2b0f9e17105847809dfeb04e3cad69e0")] [ArcGISRuntime.Samples.Shared.Attributes.Sample( name: "Feature layer (geodatabase)", category: "Data", description: "Display features from a local geodatabase.", instructions: "", tags: new[] { "geodatabase", "mobile", "offline" })] public class FeatureLayerGeodatabase : Activity { // Create a reference to MapView. private MapView _myMapView; protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); Title = "Feature layer (geodatabase)"; CreateLayout(); // Open a mobile geodatabase (.geodatabase file) stored locally and add it to the map as a feature layer. Initialize(); } private async void Initialize() { // Create a new map to display in the map view with a streets basemap. _myMapView.Map = new Map(BasemapStyle.ArcGISStreets); // Get the path to the downloaded mobile geodatabase (.geodatabase file). string mobileGeodatabaseFilePath = GetMobileGeodatabasePath(); try { // Open the mobile geodatabase. Geodatabase mobileGeodatabase = await Geodatabase.OpenAsync(mobileGeodatabaseFilePath); // Get the 'Trailheads' geodatabase feature table from the mobile geodatabase. GeodatabaseFeatureTable trailheadsGeodatabaseFeatureTable = mobileGeodatabase.GetGeodatabaseFeatureTable("Trailheads"); // Asynchronously load the 'Trailheads' geodatabase feature table. await trailheadsGeodatabaseFeatureTable.LoadAsync(); // Create a feature layer based on the geodatabase feature table. FeatureLayer trailheadsFeatureLayer = new FeatureLayer(trailheadsGeodatabaseFeatureTable); // Add the feature layer to the operations layers collection of the map. _myMapView.Map.OperationalLayers.Add(trailheadsFeatureLayer); // Zoom the map to the extent of the feature layer. await _myMapView.SetViewpointGeometryAsync(trailheadsFeatureLayer.FullExtent, 50); } catch (Exception e) { new AlertDialog.Builder(this).SetMessage(e.ToString()).SetTitle("Error").Show(); } } private static string GetMobileGeodatabasePath() { // Use samples viewer's DataManager helper class to get the path of the downloaded dataset on disk. // NOTE: The url for the actual data is: https://www.arcgis.com/home/item.html?id=2b0f9e17105847809dfeb04e3cad69e0. return DataManager.GetDataFolder("2b0f9e17105847809dfeb04e3cad69e0", "LA_Trails.geodatabase"); } private void CreateLayout() { // Create a new vertical layout for the app. LinearLayout layout = new LinearLayout(this) { Orientation = Orientation.Vertical }; // Add a map view to the layout. _myMapView = new MapView(this); layout.AddView(_myMapView); // Show the layout in the app. SetContentView(layout); } } }
{ "content_hash": "f46b0aecc5f2474ed82c94c1c2aca6a4", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 135, "avg_line_length": 41.043956043956044, "alnum_prop": 0.6522088353413654, "repo_name": "Esri/arcgis-runtime-samples-dotnet", "id": "5d4506b135597663c0df6bd34456eef9b2fde680", "size": "4300", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "src/Android/Xamarin.Android/Samples/Data/FeatureLayerGeodatabase/FeatureLayerGeodatabase.cs", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C#", "bytes": "10343309" }, { "name": "CSS", "bytes": "154816" }, { "name": "Dockerfile", "bytes": "1021" }, { "name": "Python", "bytes": "93169" }, { "name": "Ruby", "bytes": "597" } ], "symlink_target": "" }
var domutil = require('../../tools/domutil'); module.exports = { selector: '.liftStatus tr', parse: { name: function(node) { var child = domutil.child(node, 0); return domutil.allText(child).split('-')[0]; }, status: 1 } };
{ "content_hash": "0098043284bbc05f1186adb2d2e305d0", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 50, "avg_line_length": 21.25, "alnum_prop": 0.5725490196078431, "repo_name": "pirxpilot/liftie", "id": "240bebf265c3a9f00a2d1a7faec791a21758b333", "size": "255", "binary": false, "copies": "2", "ref": "refs/heads/main", "path": "lib/resorts/snow-valley/index.js", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "HTML", "bytes": "24401978" }, { "name": "JavaScript", "bytes": "214317" }, { "name": "Makefile", "bytes": "2585" }, { "name": "Pug", "bytes": "12571" }, { "name": "Shell", "bytes": "231" }, { "name": "Stylus", "bytes": "15892" } ], "symlink_target": "" }
layout: post title: Spring Update 2020 published: true post_author: display_name: Vladimir Kostyukov twitter: vkostyukov tags: Finagle, Finatra, Util, Scrooge, TwitterServer --- Salute, Finaglers 🙇‍♂️! Four times a year we send out a comprehensive overview of all these exciting changes we’ve been working behind the curtains 🎭. As you probably guessed already, this is one of those times ✨! It’s a Q1 2020 quarterly review episode! #### ThriftMux Compression (aka t7x) ThriftMux’s support for negotiating payload compression is out of beta and is generally available for service owners. The way this is structured is services on both ends of the wire would need to [opt-in for compression ](https://github.com/twitter/finagle/blob/develop/doc/src/sphinx/Compression.rst) in their Finagle clients & servers. Enabling compression can be beneficial for network-bound services that have a few CPU cycles to spare. We highly encourage you, though, to run your own tests before enabling that feature. As always, we’re curious to hear about your performance adventures so do not hesitate to reach out! #### Finatra Java API Improvements We discovered a few shortcomings in our Java APIs. Specifically, the lifecycle management ergonomics in the Java version of Finatra APIs [weren’t on par with the original (Scala)](https://github.com/twitter/finatra/commit/f04772df4da0d53fa27714396a6a591f80de4e53). #### Finatra’s New Jackson Support We also reworked Finatra’s Jackson integration such that it’s no longer coupled with the HTTP package. As a result of this restructuring, we’re able to provide better JSON parsing/printing APIs. #### SameSite Cookie is ON With Chrome shifting into being more considerate of the [lack of the SameSite cookie attribute](https://blog.chromium.org/2019/10/developers-get-ready-for-new.html), we’ve switched Finagle to propagate that attribute with its server-set cookies by default. #### Scala 2.13 Support CSL’s libraries have always been in the front lines when it comes to supporting modern Scala versions, such as 2.13. All packages within Finagle, Util, and TwitterServer are now cross-compiled (and cross-published in the OSS) for Scala 2.13. Finatra is next. #### Reference Counted SSL Engines The vast majority of Finagle’s and Netty’s SSL bits are backed by native structures that require careful off-heap memory considerations for every secure connection. Netty already had support for reference-counted SSL engines but we hadn’t been utilizing them within Finagle due to a bug in Netty. That approach, while being perfectly workable, had one noticeable downside - the native memory management machinery had been bundled into regular GC cycles, occasionally slowing them down. We [fixed](https://github.com/netty/netty/commit/031c2e2e8899d037228a492a458ccd194eb8df9c#diff-cfd417915faad637e4278b54adafd9ba) the Netty bug and partnered with the VM team to experiment with a new implementation where the created SSL engines are explicitly released after use so they don’t end up polluting the finalizer queue (CSL-8292). The results were very promising on some of our high throughput services (25% shorter CMS remark phase - part of full GC) so we enabled that by default for everyone. #### New Finatra CaseClass Validation API We reworked Finatra’s validation API for case classes from the ground up to fix its shortcomings and suboptimal structure. It’s now less coupled with the rest of the framework (doesn’t have to be used as part of JSON deserialization), has more features, provides better extension points, and comes with [a refined documentation](https://twitter.github.io/finatra/user-guide/validation/index.html). #### Scrooge-generated Code Improvements Twitter's Michael Braun ([@mbraun88](https://twitter.com/mbraun88)) spent his Q1 hackweek improving compile times for Scrooge-generated code by simplifying output constructs. Not only is the new code about 20% faster to compile, it also potentially unlocks more JIT optimizations (i.e., inlining) at runtime. #### Metrics Metadata About a year ago we started partnering with Matt Dannenberg (Twitter) to work on the metrics metadata project that aims to provide both humans and computers with the additional (on top of just a pair name, value) information about exported metrics. Things like the kind of a metric (counter, gauge, histogram), unit of measure, whether it’s latched and many others can now be exported from every TwitterServer’s admin interface - hit your /admin/metrics_metadata.json endpoint to see it in action! Right now it doesn’t have that much information, but we plan to instrument our metrics over the next couple of quarters. #### Bumped Dependencies - Logback 1.2.3 - Guice 4.2.0 - Joda 2.10.2
{ "content_hash": "e61a99ea1c464db367d32ba2e4047425", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 619, "avg_line_length": 98.8125, "alnum_prop": 0.7952772506852204, "repo_name": "finagle/finagle.github.io", "id": "c67a1329e7c5bdcbcc99a59a3aae36890c699fb5", "size": "4803", "binary": false, "copies": "1", "ref": "refs/heads/source", "path": "source/blog/2020-06-04-winter-spring.md", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "1009" }, { "name": "Dockerfile", "bytes": "389" }, { "name": "HTML", "bytes": "9200" }, { "name": "Ruby", "bytes": "3650" }, { "name": "Shell", "bytes": "359" } ], "symlink_target": "" }
FROM vinta/python:2.7 MAINTAINER Vinta Chen <vinta.chen@gmail.com> RUN apt-get update && \ apt-get install -y \ -o APT::Install-Recommends=false -o APT::Install-Suggests=false \ build-essential \ libyaml-dev && \ rm -rf /var/cache/apt/archives/* /var/lib/apt/lists/* RUN mkdir -p /app/ WORKDIR /app/ COPY . /app/ RUN pip install -r requirements_test.txt CMD ["coverage", "run", "setup.py", "test"]
{ "content_hash": "97c425c465c10ecb5826e2778cc6328b", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 69, "avg_line_length": 23.5, "alnum_prop": 0.6619385342789598, "repo_name": "ademuk/django-email-confirm-la", "id": "a800411d3b7f012d045b72556bf4ee8bde2f013c", "size": "423", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Dockerfile", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "336" }, { "name": "Python", "bytes": "39360" } ], "symlink_target": "" }
<?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2014 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. --> <inset xmlns:android="http://schemas.android.com/apk/res/android" android:insetLeft="16dp" android:insetTop="16dp" android:insetRight="16dp" android:insetBottom="16dp"> <shape android:shape="rectangle"> <corners android:radius="2dp" /> <solid android:color="@color/background_floating_material_dark" /> </shape> </inset><!-- From: file:/usr/local/google/buildbot/repo_clients/https___googleplex-android.googlesource.com_a_platform_manifest.git/mnc-sdk-release/frameworks/support/v7/appcompat/res/drawable/abc_dialog_material_background_dark.xml --><!-- From: file:/Users/gmdearaujo/AndroidStudioProjects/PlannerAI/ParseStarterProject/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.0.1/res/drawable/abc_dialog_material_background_dark.xml -->
{ "content_hash": "9a05746d030df4a9c99f50792e977965", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 451, "avg_line_length": 57.15384615384615, "alnum_prop": 0.7314939434724091, "repo_name": "psychocowtipper/PlannerAI", "id": "0ae73990114ee4c4cac7aaf72a8cdabf6277690d", "size": "1486", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "ParseStarterProject/build/intermediates/res/merged/debug/drawable/abc_dialog_material_background_dark.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "657541" } ], "symlink_target": "" }
<div class="commune_descr limited"> <p> Han-sur-Meuse est un village situé dans le département de Meuse en Lorraine. On dénombrait 260 habitants en 2008.</p> <p>Si vous pensez demenager à Han-sur-Meuse, vous pourrez facilement trouver une maison à vendre. </p> <p>À coté de Han-sur-Meuse sont positionnées géographiquement les villes de <a href="{{VLROOT}}/immobilier/saint-mihiel_55463/">Saint-Mihiel</a> à 2&nbsp;km, 4&nbsp;872 habitants, <a href="{{VLROOT}}/immobilier/koeur-la-grande_55263/">Koeur-la-Grande</a> localisée à 4&nbsp;km, 165 habitants, <a href="{{VLROOT}}/immobilier/chauvoncourt_55111/">Chauvoncourt</a> localisée à 3&nbsp;km, 486 habitants, <a href="{{VLROOT}}/immobilier/mecrin_55329/">Mécrin</a> localisée à 4&nbsp;km, 246 habitants, <a href="{{VLROOT}}/immobilier/paroches_55401/">Les&nbsp;Paroches</a> à 4&nbsp;km, 351 habitants, <a href="{{VLROOT}}/immobilier/koeur-la-petite_55264/">Koeur-la-Petite</a> localisée à 3&nbsp;km, 245 habitants, entre autres. De plus, Han-sur-Meuse est située à seulement 29&nbsp;km de <a href="{{VLROOT}}/immobilier/bar-le-duc_55029/">Bar-le-Duc</a>.</p> <p>Le parc de logements, à Han-sur-Meuse, était réparti en 2011 en quatre appartements et 138 maisons soit un marché plutôt équilibré.</p> </div>
{ "content_hash": "cfde4f93e7292d8fb639c8ca7e3b11ef", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 144, "avg_line_length": 75, "alnum_prop": 0.7294117647058823, "repo_name": "donaldinou/frontend", "id": "1f90b361394fdc509596ab8c0d00bbd72fee5a09", "size": "1304", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Viteloge/CoreBundle/Resources/descriptions/55229.html", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "3073" }, { "name": "CSS", "bytes": "111338" }, { "name": "HTML", "bytes": "58634405" }, { "name": "JavaScript", "bytes": "88564" }, { "name": "PHP", "bytes": "841919" } ], "symlink_target": "" }
FROM amd64/buildpack-deps:bionic-scm ENV \ # Do not generate certificate DOTNET_GENERATE_ASPNET_CERTIFICATE=false \ # Enable detection of running in a container DOTNET_RUNNING_IN_CONTAINER=true \ # Enable correct mode for dotnet watch (only mode supported in a container) DOTNET_USE_POLLING_FILE_WATCHER=true \ # Skip extraction of XML docs - generally not useful within an image/container - helps performance NUGET_XMLDOC_MODE=skip \ # PowerShell telemetry for docker image usage POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-DotnetCoreSDK-Ubuntu-18.04 # Install .NET CLI dependencies RUN apt-get update \ && apt-get install -y --no-install-recommends \ libc6 \ libgcc1 \ libgssapi-krb5-2 \ libicu60 \ libssl1.1 \ libstdc++6 \ zlib1g \ && rm -rf /var/lib/apt/lists/* # Install .NET Core SDK RUN sdk_version=3.1.425 \ && curl -fSL --output dotnet.tar.gz https://dotnetcli.azureedge.net/dotnet/Sdk/$sdk_version/dotnet-sdk-$sdk_version-linux-x64.tar.gz \ && dotnet_sha512='3d31c6bb578f668111d0f124db6a1222b5d186450380bfd4f42bc8030f156055b025697eabc8c2672791c96e247f6fc499ff0281388e452fcc16fbd1f8a36de1' \ && echo "$dotnet_sha512 dotnet.tar.gz" | sha512sum -c - \ && mkdir -p /usr/share/dotnet \ && tar -oxzf dotnet.tar.gz -C /usr/share/dotnet \ && rm dotnet.tar.gz \ && ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet \ # Trigger first run experience by running arbitrary cmd && dotnet help # Install PowerShell global tool RUN powershell_version=7.0.13 \ && curl -fSL --output PowerShell.Linux.x64.$powershell_version.nupkg https://pwshtool.blob.core.windows.net/tool/$powershell_version/PowerShell.Linux.x64.$powershell_version.nupkg \ && powershell_sha512='c667ff1765950b089349f60260ee8eb8b8e500236f4570d09c33dde02792b7599fc8b12b20e636c8788c3d15ed371cbf20a04ad5e3cb397351404e14ab471f2f' \ && echo "$powershell_sha512 PowerShell.Linux.x64.$powershell_version.nupkg" | sha512sum -c - \ && mkdir -p /usr/share/powershell \ && dotnet tool install --add-source / --tool-path /usr/share/powershell --version $powershell_version PowerShell.Linux.x64 \ && dotnet nuget locals all --clear \ && rm PowerShell.Linux.x64.$powershell_version.nupkg \ && ln -s /usr/share/powershell/pwsh /usr/bin/pwsh \ && chmod 755 /usr/share/powershell/pwsh \ # To reduce image size, remove the copy nupkg that nuget keeps. && find /usr/share/powershell -print | grep -i '.*[.]nupkg$' | xargs rm
{ "content_hash": "86b10d78584ae0fa1bd69c38545985db", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 185, "avg_line_length": 50.03921568627451, "alnum_prop": 0.7112068965517241, "repo_name": "dotnet/dotnet-docker", "id": "60b3d56e6284f6dd63dc23400f8ea118b430e00d", "size": "2552", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "src/sdk/3.1/bionic/amd64/Dockerfile", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "240862" }, { "name": "Dockerfile", "bytes": "346141" }, { "name": "PowerShell", "bytes": "33604" }, { "name": "Shell", "bytes": "803" } ], "symlink_target": "" }
<HTML><HEAD> <TITLE>Review for Long Kiss Goodnight, The (1996)</TITLE> <LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css"> </HEAD> <BODY BGCOLOR="#FFFFFF" TEXT="#000000"> <H1 ALIGN="CENTER" CLASS="title"><A HREF="/Title?0116908">Long Kiss Goodnight, The (1996)</A></H1><H3 ALIGN=CENTER>reviewed by<BR><A HREF="/ReviewsBy?Scott+Renshaw">Scott Renshaw</A></H3><HR WIDTH="40%" SIZE="4"> <PRE> THE LONG KISS GOODNIGHT A film review by Scott Renshaw Copyright 1996 Scott Renshaw</PRE> <P>(New Line) Starring: Geena Davis, Samuel L. Jackson, Patrick Malahide, Craig Bierko, Brian Cox, David Morse. Screenplay: Shane Black. Producers: Renny Harlin, Stephanie Austin, Shane Black. Director: Renny Harlin. MPAA Rating: R (violence, profanity, adult themes) Running Time: 119 minutes. Reviewed by Scott Renshaw.</P> <P> It is easy for me to understand the reasoning which pegged Shane Black's script for THE LONG KISS GOODNIGHT as worth $4 million, because it includes all the elements which tend to make studio executives soil themselves in anticipation. A high concept premise, plenty of gratuitous violence, a little T&A, buddies exchanging profane one-liners, really big explosions...these are the stuff of blockbusters, my friends. They are also the stuff of inane, incoherent garbage, unlikely to gain any style points with inane, incoherent garbagemeister Renny Harlin (CUTTHROAT ISLAND) at the helm. The thing is that THE LONG KISS GOODNIGHT is a difficult film to dismiss, because it is just as often entertaining as it is actively infuriating. As inane, incoherent garbage goes, it's really not that bad.</P> <P> Geena Davis stars as Samantha Caine, a small town Pennsylvania schoolteacher with a large hole in her life. Eight years earlier she woke up on a beach pregnant and with no recollection of her previous life, and has since become a simple working mother while detectives failed to provide any clues to her identity. But Mitch Henessey (Samuel L. Jackson) manages to succeed where others did not, and finds names which may help fill in the blanks. It turns out that Samantha might not like what she finds, as she learns that she was a government-trained assassin named Charley Baltimore, and that she has plenty of enemies who are not at all pleased to find her alive. She also has friends, but the trick is figuring out who they are before someone erases her memory for good.</P> <P> Harlin tried to turn wife Geena Davis into an action heroine in CUTTHROAT ISLAND, and the result was the biggest financial disaster in the history of the cinema. Apparently that was not enough to shake his conviction that Davis had the right stuff, and THE LONG KISS GOODNIGHT sort of proves him right. There is something strangely satisfying about watching Davis turn into a killing machine, while partner Jackson (as the down-on-his-luck gumshoe who usually does the ass-kicking in such films) generally looks on ineffectually. It's primitive role-reversal stuff, but it works; it's a great bit of business when hausfrau Samantha takes a pie she has just baked in a Pyrex dish and uses it to beat in the head of an assailant. Jackson also gets a handful of simplistic but very funny gag lines, and even a line in which he makes fun of making up gag lines. It would be over-estimating the subtlety of THE LONG KISS GOODNIGHT to refer to it as a satire, but its bending of conventions often works quite well.</P> <P> At other times, it is about as conventional as action film-making gets, and distressingly brutal. There is a sequence early in the film involving a deer hit by a car which will raise plenty of hackles, and it provides an appropriate prelude to numerous scenes of torture, disturbing fantasy/dream sequences and plenty of good old-fashioned shootings and stabbings. Harlin and Black also play unfair with the tired device of a child in distress, and manage to play plenty of bodily functions for gags along the way. Into the middle of this rather crude mess they then drop half-hearted attempts at character development, with Davis' discovery resulting in a split personality and Jackson trying to redeem himself for something or other. For four million bucks, I suppose Shane Black figured he might as well throw in the kitchen sink.</P> <P> Yet I can't deny that THE LONG KISS GOODNIGHT made me laugh, and that there was never a time when I was bored. Yes, villains appear and disappear with scarcely a thought to explaining who they are or why they matter. Yes, it is overloaded and overblown in a way which can make anyone who cares about good movies cringe. Yes, it is sometimes becomes so violent as to be off-putting. THE LONG KISS GOODNIGHT is an exploitation film, but it is an exploitation film with a sense of its own absurdity. You may not care at all about Mitch Henessey as a person, but you will probably find yourself enjoying his exasperated delivery of Black's crude humor; you may not really believe Charley Baltimore _is_ a person, but you might still find her exploits a guilty pleasure. THE LONG KISS GOODNIGHT is an easy film to like, and equally easy to hate. What else can you say when you walk away from an inane, incoherent piece of garbage with a smile on your face?</P> <PRE> On the Renshaw scale of 0 to 10 femme fatalities: 6.</PRE> <PRE>-- Receive Scott Renshaw's reviews directly via email from Marquee! Visit <A HREF="http://www.marquee.com/marquee-mailinglists.html">http://www.marquee.com/marquee-mailinglists.html</A> for details. Visit Scott Renshaw's MoviePage <A HREF="http://www-leland.stanford.edu/~srenshaw">http://www-leland.stanford.edu/~srenshaw</A></PRE> <HR><P CLASS=flush><SMALL>The review above was posted to the <A HREF="news:rec.arts.movies.reviews">rec.arts.movies.reviews</A> newsgroup (<A HREF="news:de.rec.film.kritiken">de.rec.film.kritiken</A> for German reviews).<BR> The Internet Movie Database accepts no responsibility for the contents of the review and has no editorial control. Unless stated otherwise, the copyright belongs to the author.<BR> Please direct comments/criticisms of the review to relevant newsgroups.<BR> Broken URLs inthe reviews are the responsibility of the author.<BR> The formatting of the review is likely to differ from the original due to ASCII to HTML conversion. </SMALL></P> <P ALIGN=CENTER>Related links: <A HREF="/Reviews/">index of all rec.arts.movies.reviews reviews</A></P> </P></BODY></HTML>
{ "content_hash": "012e624ed9949f51b03ecaf5d0568f38", "timestamp": "", "source": "github", "line_count": 102, "max_line_length": 212, "avg_line_length": 65.55882352941177, "alnum_prop": 0.7508598773740093, "repo_name": "xianjunzhengbackup/code", "id": "8d56a72ec225d5e21bb7d3ec95fae8a17acd3153", "size": "6687", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "data science/machine_learning_for_the_web/chapter_4/movie/6253.html", "mode": "33261", "license": "mit", "language": [ { "name": "BitBake", "bytes": "113" }, { "name": "BlitzBasic", "bytes": "256" }, { "name": "CSS", "bytes": "49827" }, { "name": "HTML", "bytes": "157006325" }, { "name": "JavaScript", "bytes": "14029" }, { "name": "Jupyter Notebook", "bytes": "4875399" }, { "name": "Mako", "bytes": "2060" }, { "name": "Perl", "bytes": "716" }, { "name": "Python", "bytes": "874414" }, { "name": "R", "bytes": "454" }, { "name": "Shell", "bytes": "3984" } ], "symlink_target": "" }
var libPath = './../../../lib', addBundleResults = require(libPath + '/results/add-bundle-results-to-file'), BundleType = require(libPath + '/model/bundle-type'), should = require('should'), File = require('vinyl'); describe('add-bundle-results-to-file', function () { it('should append bundle info to file', function (done) { var fakeFile = new File({ contents: new Buffer('') }); var abrs = addBundleResults('main', BundleType.SCRIPTS, null, 'production', true); abrs.write(fakeFile); abrs.once('data', function(file) { file.isBuffer().should.be.true; file.contents.toString('utf8').should.eql(''); file.bundle.should.be.ok; file.bundle.name.should.eql('main'); file.bundle.type.should.eql(BundleType.SCRIPTS); file.bundle.result.type.should.eql('html'); file.bundle.env.should.eql('production'); file.bundle.bundleAllEnvironments.should.eql(true); done(); }); }); it('should append bundle info to file with custom result type', function (done) { var fakeFile = new File({ contents: new Buffer('') }); var abrs = addBundleResults('base', BundleType.SCRIPTS, { type: 'jsx' }, '', false); abrs.write(fakeFile); abrs.once('data', function(file) { file.isBuffer().should.be.true; file.contents.toString('utf8').should.eql(''); file.bundle.should.be.ok; file.bundle.name.should.eql('base'); file.bundle.type.should.eql(BundleType.SCRIPTS); file.bundle.result.type.should.eql('jsx'); file.bundle.env.should.eql(''); file.bundle.bundleAllEnvironments.should.eql(false); done(); }); }); });
{ "content_hash": "346725710054d9ab14bd03c928128ad7", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 88, "avg_line_length": 28.559322033898304, "alnum_prop": 0.6302670623145401, "repo_name": "narthollis/gulp-bundle-assets", "id": "eee59a55644bf06eaf97ed95b34ea4b91a7bc9dd", "size": "1685", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/unit/results/add-bundle-results-to-file.js", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "162593" }, { "name": "Shell", "bytes": "1028" } ], "symlink_target": "" }
/* This test file is part of the xdr package rather than than the xdr_test package so it can bridge access to the internals to properly test cases which are either not possible or can't reliably be tested via the public interface. The functions are only exported while the tests are being run. */ package xdr import ( "io" "reflect" ) // TstEncode creates a new Encoder to the passed writer and returns the internal // encode function on the Encoder. func TstEncode(w io.Writer) func(v reflect.Value) (int, error) { enc := NewEncoder(w) return enc.encode } // TstDecode creates a new Decoder for the passed reader and returns the // internal decode function on the Decoder. func TstDecode(r io.Reader) func(v reflect.Value) (int, error) { dec := NewDecoder(r) return dec.decode }
{ "content_hash": "dbf7ff5ad7dae93efb978b5985b749a9", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 80, "avg_line_length": 27.310344827586206, "alnum_prop": 0.7512626262626263, "repo_name": "masonforest/horizon", "id": "bd180d4ee68759653d2e303eb8e77b613c5f1982", "size": "1585", "binary": false, "copies": "12", "ref": "refs/heads/master", "path": "vendor/src/github.com/nullstyle/go-xdr/xdr3/internal_test.go", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Go", "bytes": "378361" }, { "name": "Ruby", "bytes": "1672" }, { "name": "Shell", "bytes": "758" } ], "symlink_target": "" }
import re class TypeEngine: """ Base class for database type conversions. """ def __init__(self, db_to_ansi_mapper, ansi_to_db_mapper): self.db_to_ansi_mapper = db_to_ansi_mapper self.ansi_to_db_mapper = ansi_to_db_mapper def to_ansi(self, data_type): """ Translates the provided data type string into an ANSI data type instance. :param data_type: The data type string to be translated. :return: An instance of an ANSI data type. """ raw_data_type, raw_arguments = self.split_data_type(data_type.lower()) if raw_data_type not in self.db_to_ansi_mapper: raise ValueError('Could not find matching ANSI type for {}.'.format(raw_data_type)) ansi_data_type = self.db_to_ansi_mapper[raw_data_type] return ansi_data_type(*raw_arguments) def from_ansi(self, data_type): """ Translates an ANSI data type instance to a database specific representation. :param data_type: The data type to be translated. :return: A string representation of the database specific data type. """ if data_type not in self.ansi_to_db_mapper: raise ValueError('Could not find matching database type for {}.'.format(str(data_type))) return self.ansi_to_db_mapper[data_type] + data_type.params @staticmethod def split_data_type(data_type): """ Splits up a data type string into type name and type arguments. :param data_type: The data type string to be split up. :return: The raw data type and raw arguments. """ split_data_type = re.findall('\w+', data_type) raw_data_type = split_data_type[0] if split_data_type else '' raw_arguments = split_data_type[1:] if len(split_data_type) > 1 else [] return raw_data_type, raw_arguments
{ "content_hash": "ff13702cb9cfacf0eb0bac713988a0c6", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 100, "avg_line_length": 34.851851851851855, "alnum_prop": 0.6301806588735388, "repo_name": "kayak/fireant", "id": "e02e6ee1849566fed4ad1ed5a67d557c535e6da0", "size": "1882", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "fireant/database/type_engine.py", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Python", "bytes": "762032" }, { "name": "TSQL", "bytes": "1783" } ], "symlink_target": "" }
<?xml version="1.0"?> <package> <name>spatiotemporal_exploration</name> <version>0.0.0</version> <description>The spatiotemporal_exploration package</description> <maintainer email="jsantos@lincoln.ac.uk">Joao Santos</maintainer> <license>MIT</license> <url type="github">http://github.com/strands-project/strands_exploration</url> <buildtool_depend>catkin</buildtool_depend> <build_depend>roscpp</build_depend> <build_depend>genmsg</build_depend> <build_depend>mongodb_store</build_depend> <build_depend>std_msgs</build_depend> <build_depend>std_srvs</build_depend> <build_depend>geometry_msgs</build_depend> <build_depend>strands_navigation_msgs</build_depend> <build_depend>strands_executive_msgs</build_depend> <build_depend>mongodb_store_msgs</build_depend> <build_depend>scitos_msgs</build_depend> <build_depend>scitos_ptu</build_depend> <build_depend>strands_exploration_msgs</build_depend> <build_depend>image_transport</build_depend> <build_depend>dynamic_reconfigure</build_depend> <build_depend>frongo</build_depend> <run_depend>roscpp</run_depend> <run_depend>genmsg</run_depend> <run_depend>strands_executive_msgs</run_depend> <run_depend>std_msgs</run_depend> <run_depend>std_srvs</run_depend> <run_depend>strands_exploration_msgs</run_depend> <run_depend>strands_navigation_msgs</run_depend> <run_depend>strands_executive_msgs</run_depend> <run_depend>mongodb_store</run_depend> <run_depend>mongodb_store_msgs</run_depend> <run_depend>geometry_msgs</run_depend> <run_depend>scitos_msgs</run_depend> <run_depend>scitos_ptu</run_depend> <run_depend>image_transport</run_depend> <run_depend>dynamic_reconfigure</run_depend> <run_depend>frongo</run_depend> <export> </export> </package>
{ "content_hash": "cc19e04a928b5d14055d08fcd411b69e", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 80, "avg_line_length": 32.78181818181818, "alnum_prop": 0.733222407099279, "repo_name": "strands-project/strands_exploration", "id": "a6115deae8ba12863e06e8c5b9d29f08c51a2ceb", "size": "1803", "binary": false, "copies": "3", "ref": "refs/heads/indigo-devel", "path": "spatiotemporal_exploration/package.xml", "mode": "33188", "license": "mit", "language": [ { "name": "C++", "bytes": "78572" }, { "name": "CMake", "bytes": "17018" }, { "name": "Python", "bytes": "80519" }, { "name": "Shell", "bytes": "3989" } ], "symlink_target": "" }
package ua.com.fielden.platform.expression.lexer.function.sum; import ua.com.fielden.platform.expression.automata.AbstractState; import ua.com.fielden.platform.expression.automata.NoTransitionAvailable; /** * Handles white space after the word 'AVG'. * * @author TG Team * */ public class State3 extends AbstractState { public State3() { super("S3", false); } @Override protected AbstractState transition(final char symbol) throws NoTransitionAvailable { if (isWhiteSpace(symbol)) { return this; } else if (symbol == '(') { return getAutomata().getState("S4"); } throw new NoTransitionAvailable("Invalid symbol '" + symbol + "'", this, symbol); } }
{ "content_hash": "01f9ffbe5d3ea50bde51854407c96c20", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 89, "avg_line_length": 26.607142857142858, "alnum_prop": 0.6563758389261745, "repo_name": "fieldenms/tg", "id": "02b8173e5bf12f2c19d40a069e3b5e8730d9c708", "size": "745", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "platform-pojo-bl/src/main/java/ua/com/fielden/platform/expression/lexer/function/sum/State3.java", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "4729" }, { "name": "CSS", "bytes": "177044" }, { "name": "CoffeeScript", "bytes": "2455" }, { "name": "HTML", "bytes": "2236957" }, { "name": "Java", "bytes": "12685270" }, { "name": "JavaScript", "bytes": "34404107" }, { "name": "Makefile", "bytes": "28094" }, { "name": "Python", "bytes": "3798" }, { "name": "Roff", "bytes": "3102" }, { "name": "Shell", "bytes": "13899" }, { "name": "TSQL", "bytes": "1058" }, { "name": "TeX", "bytes": "1296798" }, { "name": "XSLT", "bytes": "6158" } ], "symlink_target": "" }
package com.gentics.mesh.parameter.value; import java.util.Arrays; import java.util.HashSet; /** * @see FieldsSet */ public class FieldsSetImpl extends HashSet<String> implements FieldsSet { private static final long serialVersionUID = 6436259595505383777L; public FieldsSetImpl(String value) { super(Arrays.asList(value.split(","))); } public FieldsSetImpl() { } }
{ "content_hash": "4eda1e3f4108db4fd0042c8be4b0a21b", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 73, "avg_line_length": 19.05, "alnum_prop": 0.7480314960629921, "repo_name": "gentics/mesh", "id": "6783781c7020e204099b14e03fc9239953e212d9", "size": "381", "binary": false, "copies": "1", "ref": "refs/heads/dev", "path": "rest-model/src/main/java/com/gentics/mesh/parameter/value/FieldsSetImpl.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "40221" }, { "name": "Dockerfile", "bytes": "5309" }, { "name": "Erlang", "bytes": "4651" }, { "name": "HTML", "bytes": "3848" }, { "name": "Handlebars", "bytes": "6515" }, { "name": "Java", "bytes": "9074233" }, { "name": "JavaScript", "bytes": "1130" }, { "name": "Shell", "bytes": "3757" } ], "symlink_target": "" }
from construct import * class InterfaceCounters(object): def __init__(self, u): self.if_index = u.unpack_uint() self.if_type = u.unpack_uint() self.if_speed = u.unpack_uhyper() self.if_mode = u.unpack_uint() self.if_status = u.unpack_uint() self.if_inOctets = u.unpack_uhyper() self.if_inPackets = u.unpack_uint() self.if_inMcast = u.unpack_uint() self.if_inBcast = u.unpack_uint() self.if_inDiscard = u.unpack_uint() self.if_inError = u.unpack_uint() self.if_unknown = u.unpack_uint() self.if_outOctets = u.unpack_uhyper() self.if_outPackets = u.unpack_uint() self.if_outMcast = u.unpack_uint() self.if_outBcast = u.unpack_uint() self.if_outDiscard = u.unpack_uint() self.if_outError = u.unpack_uint() self.if_promisc = u.unpack_uint() class EthernetCounters(object): def __init__(self, u): self.dot3StatsAlignmentErrors = u.unpack_uint() self.dot3StatsFCSErrors = u.unpack_uint() self.dot3StatsSingleCollisionFrames = u.unpack_uint() self.dot3StatsMultipleCollisionFrames = u.unpack_uint() self.dot3StatsSQETestErrors = u.unpack_uint() self.dot3StatsDeferredTransmissions = u.unpack_uint() self.dot3StatsLateCollisions = u.unpack_uint() self.dot3StatsExcessiveCollisions = u.unpack_uint() self.dot3StatsInternalMacTransmitErrors = u.unpack_uint() self.dot3StatsCarrierSenseErrors = u.unpack_uint() self.dot3StatsFrameTooLongs = u.unpack_uint() self.dot3StatsInternalMacReceiveErrors = u.unpack_uint() self.dot3StatsSymbolErrors = u.unpack_uint() class VLANCounters(object): def __init__(self, u): self.vlan_id = u.unpack_uint() self.octets = u.unpack_uhyper() self.ucastPkts = u.unpack_uint() self.multicastPkts = u.unpack_uint() self.broadcastPkts = u.unpack_uint() self.discards = u.unpack_uint() class TokenringCounters(object): def __init__(self, u): self.dot5StatsLineErrors = u.unpack_uint() self.dot5StatsBurstErrors = u.unpack_uint() self.dot5StatsACErrors = u.unpack_uint() self.dot5StatsAbortTransErrors = u.unpack_uint() self.dot5StatsInternalErrors = u.unpack_uint() self.dot5StatsLostFrameErrors = u.unpack_uint() self.dot5StatsReceiveCongestions = u.unpack_uint() self.dot5StatsFrameCopiedErrors = u.unpack_uint() self.dot5StatsTokenErrors = u.unpack_uint() self.dot5StatsSoftErrors = u.unpack_uint() self.dot5StatsHardErrors = u.unpack_uint() self.dot5StatsSignalLoss = u.unpack_uint() self.dot5StatsTransmitBeacons = u.unpack_uint() self.dot5StatsRecoverys = u.unpack_uint() self.dot5StatsLobeWires = u.unpack_uint() self.dot5StatsRemoves = u.unpack_uint() self.dot5StatsSingles = u.unpack_uint() self.dot5StatsFreqErrors = u.unpack_uint() class VGCounters(object): def __init__(self, u): self.dot5StatsLineErrors = u.unpack_uint() self.dot5StatsBurstErrors = u.unpack_uint() self.dot5StatsACErrors = u.unpack_uint() self.dot5StatsAbortTransErrors = u.unpack_uint() self.dot5StatsInternalErrors = u.unpack_uint() self.dot5StatsLostFrameErrors = u.unpack_uint() self.dot5StatsReceiveCongestions = u.unpack_uint() self.dot5StatsFrameCopiedErrors = u.unpack_uint() self.dot5StatsTokenErrors = u.unpack_uint() self.dot5StatsSoftErrors = u.unpack_uint() self.dot5StatsHardErrors = u.unpack_uint() self.dot5StatsSignalLoss = u.unpack_uint() self.dot5StatsTransmitBeacons = u.unpack_uint() self.dot5StatsRecoverys = u.unpack_uint() self.dot5StatsLobeWires = u.unpack_uint() self.dot5StatsRemoves = u.unpack_uint() self.dot5StatsSingles = u.unpack_uint() self.dot5StatsFreqErrors = u.unpack_uint() class HostCounters(object): format = 2000 def __init__(self, u): self.hostname = u.unpack_string() self.uuid = u.unpack_fopaque(16) self.machine_type = u.unpack_uint() self.os_name = u.unpack_uint() self.os_release = u.unpack_string() class HostAdapters(object): format = 2001 def __init__(self, u): self.adapters = Struct("adapters", UBInt32("count"), Array(lambda c: c.count, Struct("adapter", UBInt32("index"), Bytes("MAC", 6) ) ) ).parse(u.get_buffer()) class HostParent(object): format = 2002 def __init__(self, u): self.container_type = u.unpack_uint() self.container_index = u.unpack_uint() class HostCPUCounters(object): format = 2003 def __init__(self, u): self.load_one = u.unpack_float() self.load_five = u.unpack_float() self.load_fifteen = u.unpack_float() self.proc_run = u.unpack_uint() self.proc_total = u.unpack_uint() self.cpu_num = u.unpack_uint() self.cpu_speed = u.unpack_uint() self.uptime = u.unpack_uint() self.cpu_user = u.unpack_uint() self.cpu_nice = u.unpack_uint() self.cpu_system = u.unpack_uint() self.cpu_idle = u.unpack_uint() self.cpu_wio = u.unpack_uint() self.cpu_intr = u.unpack_uint() self.cpu_sintr = u.unpack_uint() self.interrupts = u.unpack_uint() self.contexts = u.unpack_uint() class HostMemoryCounters(object): format = 2004 def __init__(self, u): self.mem_total = u.unpack_uhyper() self.mem_free = u.unpack_uhyper() self.mem_shared = u.unpack_uhyper() self.mem_buffers = u.unpack_uhyper() self.mem_cached = u.unpack_uhyper() self.swap_total = u.unpack_uhyper() self.swap_free = u.unpack_uhyper() self.page_in = u.unpack_uint() self.page_out = u.unpack_uint() self.swap_in = u.unpack_uint() self.swap_out = u.unpack_uint() class DiskIOCounters(object): format = 2005 def __init__(self, u): self.disk_total = u.unpack_uhyper() self.disk_free = u.unpack_uhyper() self.part_max_used = u.unpack_uint() self.reads = u.unpack_uint() self.bytes_read = u.unpack_uhyper() self.read_time = u.unpack_uint() self.writes = u.unpack_uint() self.bytes_written = u.unpack_uhyper() self.write_time = u.unpack_uint() class NetIOCounters(object): format = 2006 def __init__(self, u): self.bytes_in = u.unpack_uhyper() self.pkts_in = u.unpack_uint() self.errs_in = u.unpack_uint() self.drops_in = u.unpack_uint() self.bytes_out = u.unpack_uhyper() self.packets_out = u.unpack_uint() self.errs_out = u.unpack_uint() self.drops_out = u.unpack_uint() class SocketIPv4Counters(object): format = 2100 def __init__(self, u): self.protocol = u.unpack_uint() self.local_ip = u.unpack_fstring(4) self.remote_ip = u.unpack_fstring(4) self.local_port = u.unpack_uint() self.remote_port = u.unpack_uint() class SocketIPv6Counters(object): format = 2101 def __init__(self, u): self.protocol = u.unpack_uint() self.local_ip = u.unpack_fstring(16) self.remote_ip = u.unpack_fstring(16) self.local_port = u.unpack_uint() self.remote_port = u.unpack_uint() class VirtMemoryCounters(object): format = 2102 def __init__(self, u): self.memory = u.unpack_uhyper() self.maxMemory = u.unpack_uhyper() class VirtDiskIOCounters(object): format = 2103 def __init__(self, u): self.capacity = u.unpack_uhyper() self.allocation = u.unpack_uhyper() self.available = u.unpack_uhyper() self.rd_req = u.unpack_uint() self.hyper = u.unpack_unsigend() self.wr_req = u.unpack_uint() self.wr_bytes = u.unpack_uhyper() self.errs = u.unpack_uint() class VirtNetIOCounters(object): format = 2104 def __init__(self, u): self.rx_bytes = u.unpack_uhyper() self.rx_packets = u.unpack_uint() self.rx_errs = u.unpack_uint() self.rx_drop = u.unpack_uint() self.tx_bytes = u.unpack_uhyper() self.tx_packets = u.unpack_uint() self.tx_errs = u.unpack_uint() self.tx_drop = u.unpack_uint() def getDecoder(format): decoders = { 1: InterfaceCounters, 2: EthernetCounters, 3: TokenringCounters, 4: VGCounters, 5: VLANCounters, 2000: HostCounters, 2001: HostAdapters, 2002: HostParent, 2003: HostCPUCounters, 2004: HostMemoryCounters, 2005: DiskIOCounters, 2006: NetIOCounters, 2101: SocketIPv6Counters, 2102: VirtMemoryCounters, 2103: VirtDiskIOCounters, 2104: VirtNetIOCounters } return decoders.get(format, None)
{ "content_hash": "27e02763d6d19de97e692cda8f7f08c8", "timestamp": "", "source": "github", "line_count": 255, "max_line_length": 65, "avg_line_length": 35.811764705882354, "alnum_prop": 0.6091765221200175, "repo_name": "calston/tensor", "id": "e9f69a1b6fdfaaf3ecb3d09dbafd606118b047ef", "size": "9132", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tensor/protocol/sflow/protocol/counters.py", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "1433" }, { "name": "Protocol Buffer", "bytes": "979" }, { "name": "Puppet", "bytes": "2810" }, { "name": "Python", "bytes": "213785" }, { "name": "Ruby", "bytes": "1760" }, { "name": "Shell", "bytes": "4036" } ], "symlink_target": "" }
package com.google.android.exoplayer2.extractor.ogg; import static com.google.common.truth.Truth.assertThat; import static com.google.common.truth.Truth.assertWithMessage; import static org.junit.Assert.fail; import androidx.test.ext.junit.runners.AndroidJUnit4; import com.google.android.exoplayer2.C; import com.google.android.exoplayer2.testutil.FakeExtractorInput; import com.google.android.exoplayer2.util.ParsableByteArray; import java.io.IOException; import java.util.Random; import org.junit.Test; import org.junit.runner.RunWith; /** Unit test for {@link DefaultOggSeeker}. */ @RunWith(AndroidJUnit4.class) public final class DefaultOggSeekerTest { @Test public void testSetupWithUnsetEndPositionFails() { try { new DefaultOggSeeker( /* startPosition= */ 0, /* endPosition= */ C.LENGTH_UNSET, /* streamReader= */ new TestStreamReader(), /* firstPayloadPageSize= */ 1, /* firstPayloadPageGranulePosition= */ 1, /* firstPayloadPageIsLastPage= */ false); fail(); } catch (IllegalArgumentException e) { // ignored } } @Test public void testSeeking() throws IOException, InterruptedException { Random random = new Random(0); for (int i = 0; i < 100; i++) { testSeeking(random); } } private void testSeeking(Random random) throws IOException, InterruptedException { OggTestFile testFile = OggTestFile.generate(random, 1000); FakeExtractorInput input = new FakeExtractorInput.Builder().setData(testFile.data).build(); TestStreamReader streamReader = new TestStreamReader(); DefaultOggSeeker oggSeeker = new DefaultOggSeeker( /* startPosition= */ 0, /* endPosition= */ testFile.data.length, /* streamReader= */ streamReader, /* firstPayloadPageSize= */ testFile.firstPayloadPageSize, /* firstPayloadPageGranulePosition= */ testFile.firstPayloadPageGranulePosition, /* firstPayloadPageIsLastPage= */ false); OggPageHeader pageHeader = new OggPageHeader(); while (true) { long nextSeekPosition = oggSeeker.read(input); if (nextSeekPosition == -1) { break; } input.setPosition((int) nextSeekPosition); } // Test granule 0 from file start assertThat(seekTo(input, oggSeeker, 0, 0)).isEqualTo(0); assertThat(input.getPosition()).isEqualTo(0); // Test granule 0 from file end assertThat(seekTo(input, oggSeeker, 0, testFile.data.length - 1)).isEqualTo(0); assertThat(input.getPosition()).isEqualTo(0); { // Test last granule long currentGranule = seekTo(input, oggSeeker, testFile.lastGranule, 0); long position = testFile.data.length; assertThat( (testFile.lastGranule > currentGranule && position > input.getPosition()) || (testFile.lastGranule == currentGranule && position == input.getPosition())) .isTrue(); } { // Test exact granule input.setPosition(testFile.data.length / 2); oggSeeker.skipToNextPage(input); assertThat(pageHeader.populate(input, true)).isTrue(); long position = input.getPosition() + pageHeader.headerSize + pageHeader.bodySize; long currentGranule = seekTo(input, oggSeeker, pageHeader.granulePosition, 0); assertThat( (pageHeader.granulePosition > currentGranule && position > input.getPosition()) || (pageHeader.granulePosition == currentGranule && position == input.getPosition())) .isTrue(); } for (int i = 0; i < 100; i += 1) { long targetGranule = (long) (random.nextDouble() * testFile.lastGranule); int initialPosition = random.nextInt(testFile.data.length); long currentGranule = seekTo(input, oggSeeker, targetGranule, initialPosition); long currentPosition = input.getPosition(); assertWithMessage("getNextSeekPosition() didn't leave input on a page start.") .that(pageHeader.populate(input, true)) .isTrue(); if (currentGranule == 0) { assertThat(currentPosition).isEqualTo(0); } else { int previousPageStart = testFile.findPreviousPageStart(currentPosition); input.setPosition(previousPageStart); assertThat(pageHeader.populate(input, true)).isTrue(); assertThat(currentGranule).isEqualTo(pageHeader.granulePosition); } input.setPosition((int) currentPosition); oggSeeker.skipToPageOfGranule(input, targetGranule, -1); long positionDiff = Math.abs(input.getPosition() - currentPosition); long granuleDiff = currentGranule - targetGranule; if ((granuleDiff > DefaultOggSeeker.MATCH_RANGE || granuleDiff < 0) && positionDiff > DefaultOggSeeker.MATCH_BYTE_RANGE) { fail( "granuleDiff (" + granuleDiff + ") or positionDiff (" + positionDiff + ") is more than allowed."); } } } private long seekTo( FakeExtractorInput input, DefaultOggSeeker oggSeeker, long targetGranule, int initialPosition) throws IOException, InterruptedException { long nextSeekPosition = initialPosition; int count = 0; oggSeeker.resetSeeking(); do { input.setPosition((int) nextSeekPosition); nextSeekPosition = oggSeeker.getNextSeekPosition(targetGranule, input); if (count++ > 100) { fail("infinite loop?"); } } while (nextSeekPosition >= 0); return -(nextSeekPosition + 2); } private static class TestStreamReader extends StreamReader { @Override protected long preparePayload(ParsableByteArray packet) { return 0; } @Override protected boolean readHeaders(ParsableByteArray packet, long position, SetupData setupData) throws IOException, InterruptedException { return false; } } }
{ "content_hash": "9672a602467ae92abae41ef7f7727f1d", "timestamp": "", "source": "github", "line_count": 165, "max_line_length": 100, "avg_line_length": 36.018181818181816, "alnum_prop": 0.6658253407370015, "repo_name": "saki4510t/ExoPlayer", "id": "8d1818845dd42ac614ab96584288ee2d6cf5e326", "size": "6562", "binary": false, "copies": "1", "ref": "refs/heads/release-v2", "path": "library/core/src/test/java/com/google/android/exoplayer2/extractor/ogg/DefaultOggSeekerTest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C++", "bytes": "52882" }, { "name": "Java", "bytes": "3818414" }, { "name": "Makefile", "bytes": "13719" }, { "name": "Shell", "bytes": "5691" } ], "symlink_target": "" }
FROM balenalib/revpi-core-3-alpine:edge-run # remove several traces of python RUN apk del python* # http://bugs.python.org/issue19846 # > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK. ENV LANG C.UTF-8 # install python dependencies RUN apk add --no-cache ca-certificates libffi \ && apk add --no-cache libssl1.0 || apk add --no-cache libssl1.1 # key 63C7CC90: public key "Simon McVittie <smcv@pseudorandom.co.uk>" imported # key 3372DCFA: public key "Donald Stufft (dstufft) <donald@stufft.io>" imported RUN gpg --keyserver keyring.debian.org --recv-keys 4DE8FF2A63C7CC90 \ && gpg --keyserver keyserver.ubuntu.com --recv-key 6E3CBCE93372DCFA \ && gpg --keyserver keyserver.ubuntu.com --recv-keys 0x52a43a1e4b77b059 # point Python at a system-provided certificate database. Otherwise, we might hit CERTIFICATE_VERIFY_FAILED. # https://www.python.org/dev/peps/pep-0476/#trust-database ENV SSL_CERT_FILE /etc/ssl/certs/ca-certificates.crt ENV PYTHON_VERSION 3.10.2 # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'" ENV PYTHON_PIP_VERSION 21.3.1 ENV SETUPTOOLS_VERSION 60.5.4 RUN set -x \ && buildDeps=' \ curl \ gnupg \ ' \ && apk add --no-cache --virtual .build-deps $buildDeps \ && curl -SLO "http://resin-packages.s3.amazonaws.com/python/v$PYTHON_VERSION/Python-$PYTHON_VERSION.linux-alpine-armv7hf-libffi3.3.tar.gz" \ && echo "fdb8a836951c1630dd63d2297032cea763297c47e4813447563ceab746c975a2 Python-$PYTHON_VERSION.linux-alpine-armv7hf-libffi3.3.tar.gz" | sha256sum -c - \ && tar -xzf "Python-$PYTHON_VERSION.linux-alpine-armv7hf-libffi3.3.tar.gz" --strip-components=1 \ && rm -rf "Python-$PYTHON_VERSION.linux-alpine-armv7hf-libffi3.3.tar.gz" \ && if [ ! -e /usr/local/bin/pip3 ]; then : \ && curl -SLO "https://raw.githubusercontent.com/pypa/get-pip/430ba37776ae2ad89f794c7a43b90dc23bac334c/get-pip.py" \ && echo "19dae841a150c86e2a09d475b5eb0602861f2a5b7761ec268049a662dbd2bd0c get-pip.py" | sha256sum -c - \ && python3 get-pip.py \ && rm get-pip.py \ ; fi \ && pip3 install --no-cache-dir --upgrade --force-reinstall pip=="$PYTHON_PIP_VERSION" setuptools=="$SETUPTOOLS_VERSION" \ && find /usr/local \ \( -type d -a -name test -o -name tests \) \ -o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ -exec rm -rf '{}' + \ && cd / \ && rm -rf /usr/src/python ~/.cache # make some useful symlinks that are expected to exist RUN cd /usr/local/bin \ && ln -sf pip3 pip \ && { [ -e easy_install ] || ln -s easy_install-* easy_install; } \ && ln -sf idle3 idle \ && ln -sf pydoc3 pydoc \ && ln -sf python3 python \ && ln -sf python3-config python-config CMD ["echo","'No CMD command was set in Dockerfile! Details about CMD command could be found in Dockerfile Guide section in our Docs. Here's the link: https://balena.io/docs"] RUN curl -SLO "https://raw.githubusercontent.com/balena-io-library/base-images/8accad6af708fca7271c5c65f18a86782e19f877/scripts/assets/tests/test-stack@python.sh" \ && echo "Running test-stack@python" \ && chmod +x test-stack@python.sh \ && bash test-stack@python.sh \ && rm -rf test-stack@python.sh RUN [ ! -d /.balena/messages ] && mkdir -p /.balena/messages; echo $'Here are a few details about this Docker image (For more information please visit https://www.balena.io/docs/reference/base-images/base-images/): \nArchitecture: ARM v7 \nOS: Alpine Linux edge \nVariant: run variant \nDefault variable(s): UDEV=off \nThe following software stack is preinstalled: \nPython v3.10.2, Pip v21.3.1, Setuptools v60.5.4 \nExtra features: \n- Easy way to install packages with `install_packages <package-name>` command \n- Run anywhere with cross-build feature (for ARM only) \n- Keep the container idling with `balena-idle` command \n- Show base image details with `balena-info` command' > /.balena/messages/image-info RUN echo $'#!/bin/bash\nbalena-info\nbusybox ln -sf /bin/busybox /bin/sh\n/bin/sh "$@"' > /bin/sh-shim \ && chmod +x /bin/sh-shim \ && ln -f /bin/sh /bin/sh.real \ && ln -f /bin/sh-shim /bin/sh
{ "content_hash": "d6e489d0cc68fce7ad15465dcd8526e6", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 714, "avg_line_length": 53.36363636363637, "alnum_prop": 0.7120954003407155, "repo_name": "resin-io-library/base-images", "id": "16ee708c04ed96c6204870ee27f0f13e61f058d6", "size": "4130", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "balena-base-images/python/revpi-core-3/alpine/edge/3.10.2/run/Dockerfile", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Dockerfile", "bytes": "71234697" }, { "name": "JavaScript", "bytes": "13096" }, { "name": "Shell", "bytes": "12051936" }, { "name": "Smarty", "bytes": "59789" } ], "symlink_target": "" }
<project> <build> <plugins> <plugin attr2="b" attr1="a" > <artifactId>maven-wsdlmerge-plugin</artifactId> <!-- comment --> <configuration> &gt; <wsdlDirectory>${basedir}/target/test-classes/test1</wsdlDirectory> <targetDirectory>${basedir}/target/test-classes/test1</targetDirectory> <verbose>true</verbose> </configuration> </plugin> </plugins> </build> </project>
{ "content_hash": "6223fd2a96900c690cd876a79dbef12f", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 76, "avg_line_length": 20.857142857142858, "alnum_prop": 0.6141552511415526, "repo_name": "rustyx/xsdutils", "id": "f537a4083fa2786a8895c227600331d29a0c36a2", "size": "438", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "xsdutils/src/test/resources/net/sf/xsdutils/xml/doc2.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "81329" } ], "symlink_target": "" }