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
public double calcPerimeter() { | |
double peri = 0; | |
if (head.getNext() == null) { | |
return peri; | |
} else if (head.getNext().getNext() == null) { | |
return head.getPoint().distance(head.getNext().getPoint()); | |
} | |
PointNode iterable = head; |
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
public static int numPaths (int[][] mat, int x1, int y1, int x2, int y2) { | |
return numPaths(mat, x1, y1, x2, y2, 0); | |
} | |
private static int numPaths(int[][] mat, int x1, int y1, int x2, int y2, int counter) { | |
int tmp; | |
if (x1 < 0 || x2 < 0 || y1 < 0 || y2 < 0) { | |
return 0; | |
} else if (x1 >= mat.length || x2 >= mat.length || y1 >= mat.length || y2 >= mat.length) { |
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
# Paste it in your .zshrc / .bashrc | |
alias rnand="react-native run-android" | |
alias rnios="react-native run-ios" | |
alias rnloga="react-native log-android" | |
alias rnlogi="react-native log-ios" | |
alias rns="react-native start" |
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
$ npm install -g create-react-native-app |
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 React from 'react'; | |
import { StyleSheet, Text, View } from 'react-native'; | |
import { Video } from 'react-native'; |
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 React from 'react'; | |
import { StyleSheet, Text, View, Dimensions } from 'react-native'; | |
import { Video } from 'expo'; |
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
export default class App extends React.Component { | |
render() { | |
const { width } = Dimensions.get('window'); | |
return ( | |
<View style={styles.container}> | |
<Text style={{ textAlign: 'center' }}> React Native Video </Text> | |
<Video | |
source={{ uri: 'http://d23dyxeqlo5psv.cloudfront.net/big_buck_bunny.mp4' }} | |
shouldPlay |
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 { MaterialIcons, Octicons } from '@expo/vector-icons'; | |
export default class App extends React.Component { | |
state = { | |
mute: false, | |
fullScreen: false, | |
shouldPlay: false, | |
} | |
render() { |
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
render() { | |
const { width } = Dimensions.get('window'); | |
return ( | |
<View style={styles.container}> | |
<View> | |
<Text style={{ textAlign: 'center' }}> React Native Video </Text> | |
<Video | |
source={{ uri: 'http://d23dyxeqlo5psv.cloudfront.net/big_buck_bunny.mp4' }} | |
shouldPlay |
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
const styles = StyleSheet.create({ | |
container: { | |
flex: 1, | |
backgroundColor: '#fff', | |
alignItems: 'center', | |
justifyContent: 'center', | |
}, | |
controlBar: { | |
position: 'absolute', | |
bottom: 0, |