This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| A base class for managing rest requests asynchronously in python. | |
| Usage: | |
| class MyRequestManager(AioRequestManager, metaclass=ABCMeta): | |
| def __init__(self, **kwargs): | |
| super(MyRequestManager, self).__init__(**kwargs) | |
| def some_specific_request(self): | |
| endpoint = f"{self._base_url_address}/some/url/endpoint" | |
| return await self.__request_json(endpoint) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Threading.Tasks; | |
| namespace Util | |
| { | |
| public static class RetryHelpers | |
| { | |
| public static async Task RetryOnExceptionWithBackoffAsync(int maxRetries, TimeSpan initialDelay, Func<Task> action) | |
| { | |
| await RetryOnExceptionWithBackoffAsync<Exception>(maxRetries, initialDelay, action); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // electron modules | |
| const { dialog } = require('electron').remote; | |
| ... | |
| // Instruct the main process to open a file dialog where the user can select a file | |
| function openFileDialog() { | |
| const options = { | |
| title: 'Select a json file!', | |
| filters: [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| %%%%%%%%%%%%%%% CLIENT %%%%%%%%%%% | |
| clear all; close all; clc; | |
| tcpipClient = tcpip('172.16.1.71',55000,'NetworkRole','Client') %for | |
| % server running on kinect computer | |
| set(tcpipClient,'InputBufferSize',8); | |
| set(tcpipClient,'Timeout',1000); | |
| fopen(tcpipClient); | |
| while(1) | |
| rawData = fread(tcpipClient,1,'double'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using UnityEngine; | |
| using System.Collections; | |
| public class GenerateStimuli : MonoBehaviour | |
| { | |
| public GameObject[] stimulusObjs; //specify the objects in the inspector for use in the stimulus loop | |
| public GameObject targetEye; //the reference point that will be used to determine how stimuli should be rearranged | |
| private bool bSeqInProgress = false; //true for the duration of the displayed stimulus sequence | |
| public float desiredAngularDiameterInDeg; //will determine the apparent size of all the stimuli |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using UnityEngine; | |
| using System.Collections; | |
| public class ToggleTracking : MonoBehaviour | |
| { | |
| private Transform eyeCenter; | |
| private Transform trackingSpace; | |
| private bool bUseRotationalTracking = true; | |
| private bool bUsePositionalTracking = true; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using UnityEngine; | |
| using System.Collections; | |
| public class VRMirror : MonoBehaviour | |
| { | |
| public CameraFlipper cameraFlipper; | |
| public GameObject copyCat; | |
| private Vector3 copyCatStartingPosition; | |
| private Transform eyeCenter; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $num = 30; //number of bear duplicates to generate; | |
| //define the reference bear to duplicate | |
| string $ref_bear = "bear0"; | |
| //for each bear to be duplicated | |
| for ($i = 1; $i < $num; $i++) | |
| { | |
| select($ref_bear); | |
| duplicate - rr; | |
| select - d; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| int $numTreads = 36; | |
| string $pathNames[]; | |
| for ($i = 1; $i < ($numTreads + 1); ++$i) | |
| { | |
| $pathNames[$i - 1] = "motionPath" + $i; | |
| } | |
| float $Zdist = TrackLeft_Control.translateZ; | |
| float $circumference = curveInfo1.arcLength; | |
| int $direction; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // This just uses the ratio of the SSD distance of the two best matches as the score | |
| // and matches a feature in the first image with the closest feature in the second image. | |
| // It can match multiple features in the first image to the same feature in | |
| // the second image. | |
| void ratioMatchFeatures(const FeatureSet &f1, const FeatureSet &f2, vector &matches, double &totalScore) | |
| { | |
| int m = f1.size(); | |
| int n = f2.size(); | |
| matches.resize(m); |
NewerOlder