This file contains 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
//[RENDER] | |
<TextInput | |
autoFocus={true} | |
onChangeText={value => this.changeKeyword(value)} | |
onSubmitEditing={event => { | |
this.changeKeyword(event.nativeEvent.text); | |
}} | |
style={{ | |
padding: 0, | |
margin: 0, |
This file contains 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
# number of messages in partitions of a topic | |
kafka-run-class.sh kafka.tools.GetOffsetShell --broker-list localhost:9092 --topic mytopic | |
# describe a topic | |
kafka-topics.sh --describe --zookeeper localhost:2181 --topic sales | |
## List and Describe groups | |
kafka-consumer-groups.sh --list --bootstrap-server localhost:9092 | |
kafka-consumer-groups.sh --describe --group mygroup --bootstrap-server localhost:9092 |
This file contains 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
const parent = this.props.navigation.dangerouslyGetParent(); | |
const isDrawerOpen = parent && parent.state && parent.state.isDrawerOpen; | |
if (isDrawerOpen) { | |
this.props.navigation.dispatch(DrawerActions.closeDrawer()); | |
} |
This file contains 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
import React, {Component} from 'react'; | |
import { | |
View, | |
Text, | |
StyleSheet, | |
Dimensions, | |
Image, | |
ImageBackground, | |
ScrollView, |
This file contains 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
import React, {Component} from 'react'; | |
import { | |
View, | |
Text, | |
StyleSheet, | |
Image, | |
Dimensions, | |
TouchableOpacity, | |
} from 'react-native'; |
This file contains 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
#include <msp430.h> | |
int main(void) | |
{ | |
WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer | |
// If clock sig from mstr stays low, it is not yet in SPI mode | |
while (!(P1IN & BIT4)); | |
P1SEL = BIT1 + BIT2 + BIT4; | |
P1SEL2 = BIT1 + BIT2 + BIT4; | |
UCA0CTL1 = UCSWRST; // **Put state machine in reset** | |
UCA0CTL0 |= UCCKPL + UCMSB + UCSYNC; // 3-pin, 8-bit SPI master |
This file contains 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
//Master device SPI code | |
#include <msp430.h> | |
unsigned char MST_Data, SLV_Data; | |
int main(void) | |
{ | |
volatile unsigned int i; | |
WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer | |
P1OUT = 0x00; // P1 setup for LED & reset output | |
P1DIR |= BIT0 + BIT5; // | |
P1SEL = BIT1 + BIT2 + BIT4; |
This file contains 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
<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:tem=\"http://tempuri.org/\" xmlns:iot=\"http://schemas.datacontract.org/2004/07/IOTMobileWcfService\">\n" + | |
" <soapenv:Header/>\n" + | |
" <soapenv:Body>\n" + | |
" <tem:DevicePostData>\n" + | |
" <tem:data>\n" + | |
" <iot:deviceList>\n" + | |
" <!--Zero or more repetitions:-->\n" + | |
<iot:DeviceLists>\n" + | |
" <iot:accuracy>0</iot:accuracy>\n" + | |
" <iot:beaconId>%s:%s:%s</iot:beaconId>\n" + |
This file contains 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
* https://www.programiz.com/python-programming/datetime/strptime | |
* https://www.programiz.com/python-programming/datetime/strftime |
This file contains 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
const verifyColor = (a, alpha) => { | |
return /^((([A-Fa-f\d]){3}){1,2})$/.test(a) && Number(alpha)>= 0 && Number(alpha)<=1 | |
} | |
const parseColor = (a) => { | |
if (a.length === 3){ | |
const groups = /^([a-f\d]{1})([a-f\d]{1})([a-f\d]{1})$/i.exec(a) | |
return [parseInt(groups[1], 16)*17, parseInt(groups[2], 16)*17,parseInt(groups[3], 16)*17] | |
} else if (a.length === 6) { | |
const groups = /^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(a) | |
return [parseInt(groups[1], 16), parseInt(groups[2], 16),parseInt(groups[3], 16)] |