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
import { useState, useEffect } from 'react'; | |
function useDebounce<T>( | |
initialValue: T, | |
time: number | |
): [T, T, React.Dispatch<T>] { | |
const [value, setValue] = useState<T>(initialValue); | |
const [debouncedValue, setDebouncedValue] = useState<T>(initialValue); | |
useEffect(() => { |
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
{ | |
"response_code": 0, | |
"results": [ | |
{ | |
"category": "RiskQuestions", | |
"type": "multiple", | |
"question": "I have previously put money in a risky investment", | |
"options": [ | |
"Strongly Agree", | |
"Agree", |
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
<!-- Begin Mailchimp Signup Form --> | |
<link href="//cdn-images.mailchimp.com/embedcode/classic-10_7.css" rel="stylesheet" type="text/css"> | |
<style type="text/css"> | |
#mc_embed_signup{background:#fff; clear:left; font:14px Helvetica,Arial,sans-serif; } | |
/* Add your own Mailchimp form style overrides in your site stylesheet or in this style block. | |
We recommend moving this block and the preceding CSS link to the HEAD of your HTML file. */ | |
</style> | |
<style type="text/css"> | |
#mc-embedded-subscribe-form input[type=checkbox]{display: inline; width: auto;margin-right: 10px;} | |
#mergeRow-gdpr {margin-top: 20px;} |
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
import serial, time | |
ser = serial.Serial() | |
ser.port = '/dev/ttyACM1' | |
#ser.port = 'COM10' | |
ser.baudrate = 115200 | |
ser.bytesize = serial.EIGHTBITS | |
ser.parity =serial.PARITY_NONE | |
ser.stopbits = serial.STOPBITS_ONE | |
ser.timeout = 1 | |
ser.open() |
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
# importing pubnub libraries | |
from pubnub.pubnub import PubNub, SubscribeListener, SubscribeCallback, PNStatusCategory | |
from pubnub.pnconfiguration import PNConfiguration | |
from pubnub.exceptions import PubNubException | |
import pubnub | |
import serial | |
import json | |
import csv | |
import simplejson | |
import time |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
***Tweaking the animation timing**** | |
From Lollipop, we can use onEnterAnimationComplete to check animation.So, in onCreate, if the SDK version is older than Lollipop, the RecyclerView can be populated.In Lollipop and newer, onEnterAnimationComplete will be called. Time to populate the RecyclerView and request a new layout animation is done like this | |
@Override public void onEnterAnimationComplete() { | |
super.onEnterAnimationComplete(); | |
setRecyclerAdapter(recyclerView); | |
recyclerView.scheduleLayoutAnimation(); | |
} |
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
Tweaking the animation timing |
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
Tweaking the animation timing |
NewerOlder