_id stringlengths 2 7 | text stringlengths 6 2.61k | title stringclasses 1
value |
|---|---|---|
c14100 | // Uses the Client Credentials Grant oauth2 flow to authenticate to Bitbucket | |
c14101 | // Implement the Go color.Color interface. | |
c14102 | // Constructs a colorful.Color from something implementing color.Color | |
c14103 | // Might come in handy sometimes to reduce boilerplate code. | |
c14104 | // DistanceRgb computes the distance between two colors in RGB space.
// This is not a good measure! Rather do it in Lab space. | |
c14105 | // A much faster and still quite precise linearization using a 6th-order Taylor approximation.
// See the accompanying Jupyter notebook for derivation of the constants. | |
c14106 | // XyzToLinearRgb converts from CIE XYZ-space to Linear RGB space. | |
c14107 | // DistanceLab is a good measure of visual similarity between two colors!
// A result of 0 would mean identical colors, while a result of 1 or higher
// means the colors differ a lot. | |
c14108 | // Uses the CIE94 formula to calculate color distance. More accurate than
// DistanceLab, but also more work. | |
c14109 | // For this part, we do as R's graphics.hcl does, not as wikipedia does.
// Or is it the same? | |
c14110 | // DistanceLuv is a good measure of visual similarity between two colors!
// A result of 0 would mean identical colors, while a result of 1 or higher
// means the colors differ a lot. | |
c14111 | // This is a very nice thing Golang forces you to do!
// It is necessary so that we can write out the literal of the colortable below. | |
c14112 | // A wrapper which uses common parameters. | |
c14113 | // That's faster than using colorful's DistanceLab since we would have to
// convert back and forth for that. Here is no conversion. | |
c14114 | // NewHook returns new LFS hook.
// Output can be a string, io.Writer, WriterMap or PathMap.
// If using io.Writer or WriterMap, user is responsible for closing the used io.Writer. | |
c14115 | // SetFormatter sets the format that will be used by hook.
// If using text formatter, this method will disable color output to make the log file more readable. | |
c14116 | // SetDefaultPath sets default path for levels that don't have any defined output path. | |
c14117 | // SetDefaultWriter sets default writer for levels that don't have any defined writer. | |
c14118 | // Fire writes the log file to defined path or using the defined writer.
// User who run this function needs write permissions to the file or directory if the file does not yet exist. | |
c14119 | // Write a log line to an io.Writer. | |
c14120 | // Write a log line directly to a file. | |
c14121 | // New creates a new Servo interface. | |
c14122 | // SetAngle sets the servo angle. | |
c14123 | // SetMicroseconds sends a command to the PWM driver to generate a us wide pulse. | |
c14124 | // Close closes the open driver handle. | |
c14125 | // New creates a new interface for matrix4x3. | |
c14126 | // Pressed key returns the current key pressed on the keypad. | |
c14127 | // Run starts the continuous key scan loop. | |
c14128 | // NewGPIODriver returns a GPIODriver interface which allows control
// over the GPIO subsystem. | |
c14129 | // InitI2C initializes the I2C driver. | |
c14130 | // NewI2CBus returns a I2CBus. | |
c14131 | // NewSPIDriver returns a SPIDriver interface which allows control
// over the SPI bus. | |
c14132 | // Bus returns a SPIBus interface which allows us to use spi functionalities | |
c14133 | // Close cleans up all the initialized SPIbus | |
c14134 | // Register makes a host describer available by the provided host key.
// If Register is called twice with the same host or if describer is nil,
// it panics. | |
c14135 | // SetHost overrides the host and revision no. | |
c14136 | // DescribeHost returns the detected host descriptor.
// Can be overriden by calling SetHost though. | |
c14137 | // New creates a new LSM303 interface. The bus variable controls
// the I2C bus used to communicate with the device. | |
c14138 | // Initialize the device | |
c14139 | // Heading returns the current heading [0, 360). | |
c14140 | // Close the sensor data acquisition loop and put the LSM303 into sleep mode. | |
c14141 | // IsWet determines if there is water present on the sensor | |
c14142 | // New returns a handle to a BMP085 sensor. | |
c14143 | // Pressure returns the current pressure reading. | |
c14144 | // Altitude returns the current altitude reading. | |
c14145 | // NewGPIO creates a new HD44780 connected by a 4-bit GPIO bus. | |
c14146 | // New creates a new HD44780 connected by a Connection bus. | |
c14147 | // SetModes modifies the entry mode, display mode, and function mode with the
// given mode setter functions. | |
c14148 | // Home moves the cursor and all characters to the home position. | |
c14149 | // Clear clears the display and mode settings sets the cursor to the home position. | |
c14150 | // SetDDRamAddr sets the input cursor to the given address. | |
c14151 | // WriteInstruction writes a byte to the bus with register select in data mode. | |
c14152 | // WriteInstruction writes a byte to the bus with register select in command mode. | |
c14153 | // NewGPIOConnection returns a new Connection based on a 4-bit GPIO bus. | |
c14154 | // Write writes a register select flag and byte to the 4-bit GPIO connection. | |
c14155 | // Close closes all open DigitalPins. | |
c14156 | // New creates a new US020 interface. The bus variable controls
// the I2C bus used to communicate with the device. | |
c14157 | // Distance computes the distance of the bot from the closest obstruction. | |
c14158 | // InitGPIO initializes the GPIO driver. | |
c14159 | // NewDigitalPin returns a DigitalPin interface which allows control over
// the digital GPIO pin. | |
c14160 | // DigitalWrite writes val to the pin. | |
c14161 | // DigitalRead reads a value from the pin. | |
c14162 | // ActiveLow makes the pin active low. A low logical state is represented by
// a high state on the physical pin, and vice-versa. | |
c14163 | // PullUp pulls the pin up. | |
c14164 | // PullDown pulls the pin down. | |
c14165 | // NewAnalogPin returns a AnalogPin interface which allows control over
// the analog GPIO pin. | |
c14166 | // AnalogWrite reads a value from the pin. | |
c14167 | // NewPWMPin returns a PWMPin interface which allows PWM signal
// generation over a the PWM pin. | |
c14168 | // DetectHost returns the detected host and its revision number. | |
c14169 | // New creates a new L3GD20 interface. The bus variable controls
// the I2C bus used to communicate with the device. | |
c14170 | // Orientations returns a channel which will have the current temperature reading. | |
c14171 | // Stop the data acquisition loop. | |
c14172 | // SetVoltage sets the output voltage. | |
c14173 | // SetPersistedVoltage sets the voltage and programs the EEPROM so
// that the voltage is restored on reboot. | |
c14174 | // Close puts the DAC into power down mode. | |
c14175 | // InitSPI initializes the SPI driver. | |
c14176 | // NewSPIBus returns a SPIBus. | |
c14177 | // New returns a handle to a BMP180 sensor. | |
c14178 | // This cannot be currently used to disable things like the
// analog and pwm modules. Removing them from slots file can
// potentially cause a kernel panic and unsettle things. So the
// recommended thing to do is to simply reboot. | |
c14179 | // New creates a new PCA9685 interface. | |
c14180 | // SetMicroseconds is a convinience method which allows easy servo control. | |
c14181 | // Close stops the controller and resets mode and pwm controller registers. | |
c14182 | // Sleep puts the controller in sleep mode. Does not change the pwm control registers. | |
c14183 | // Wake allows the controller to exit sleep mode and resume with PWM generation. | |
c14184 | // New creates a new Display | |
c14185 | // Message prints the given string on the display, including interpreting newline
// characters and wrapping at the end of lines. | |
c14186 | // Close puts the device into low power mode. | |
c14187 | // Present checks if the device is present at the given address. | |
c14188 | // RawDieTemp returns the current raw die temp reading. | |
c14189 | // ObjTemp returns the current obj temp reading. | |
c14190 | // InitLED initializes the LED driver. | |
c14191 | // NewLED returns a LED interface which allows control over the LED. | |
c14192 | // LEDOn switches the LED on. | |
c14193 | // LEDOff switches the LED off. | |
c14194 | // LEDToggle toggles the LED. | |
c14195 | // New returns a BH1750FVI sensor at the specific resolution mode. | |
c14196 | // Lighting returns the ambient lighting in lx. | |
c14197 | // Run starts continuous sensor data acquisition loop. | |
c14198 | // New creates a representation of the mcp3008 convertor | |
c14199 | // AnalogValueAt returns the analog value at the given channel of the convertor. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.