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
try { | |
//Time formatter input | |
String dataTime = "2018-07-18 11:59:59"; | |
String dateTimePattern = "yyyy-MM-dd HH:mm:ss"; | |
ZoneId zoneUTC = ZoneId.of("Z"); | |
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern(dateTimePattern).withZone(zoneUTC); | |
ZonedDateTime zonedDateTime = ZonedDateTime.parse(dataTime, dateTimeFormatter); | |
//Convert UTC Time to Local time | |
zonedDateTime = zonedDateTime.toOffsetDateTime().atZoneSameInstant(ZoneId.systemDefault()); |
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
try { | |
ZonedDateTime localTime = ZonedDateTime.now(ZoneId.systemDefault()); | |
// Convert Local Time to UTC | |
OffsetDateTime utcTime = localTime.toOffsetDateTime().withOffsetSameInstant(ZoneOffset.UTC); | |
System.out.println("Local:" + localTime); | |
System.out.println("--> UTCTime:" + utcTime); | |
} catch (Exception e) { | |
e.printStackTrace(); | |
} |
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 { StyleSheet } from 'react-native' | |
export default StyleSheet.create({ | |
container: { | |
flexDirection: 'row', | |
flex: 1, | |
alignItems: 'center', | |
justifyContent: 'center', | |
}, | |
center: { |
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 'dart:math'; | |
import 'package:flutter/foundation.dart'; | |
import 'package:flutter/widgets.dart'; | |
import 'package:flutter/animation.dart'; | |
import 'package:flutter/material.dart'; | |
void main() => runApp(new MyApp()); | |
class MyApp extends StatelessWidget { | |
@override |
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 'dart:math'; | |
import 'package:flutter/foundation.dart'; | |
import 'package:flutter/widgets.dart'; | |
import 'package:flutter/animation.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:flutter/scheduler.dart' show timeDilation; | |
class DemoPage extends StatefulWidget { | |
@override | |
_DemoPageState createState() => new _DemoPageState(); |
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 'dart:async'; | |
import 'dart:ui' as ui; | |
import 'package:flutter/foundation.dart'; | |
import 'package:flutter/widgets.dart'; | |
import 'package:flutter/animation.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:flutter/scheduler.dart' show timeDilation; | |
class DemoPage extends StatefulWidget { | |
@override |
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
Offset getQuadraticBezier(List<Offset> offsetList, double t, | |
{Canvas canvas, Paint paint}) { | |
return getQuadraticBezier2( | |
offsetList, t, 0, offsetList.length - 1, canvas, paint); | |
} | |
Offset getQuadraticBezier2(List<Offset> offsetList, double t, int i, int j, | |
Canvas canvas, Paint paint) { | |
if (i == j) return offsetList[i]; |
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 'dart:async'; | |
class April { | |
// Public by default, private by prefixing “_” | |
int publicInt = 2; | |
int _privateInt = 2; | |
// Collection literals | |
void collectionLiterals() { | |
print([1, 2, 3, 4]); |
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
# Make sure you grab the latest version | |
curl -OL https://github.com/google/protobuf/releases/download/v3.2.0/protoc-3.2.0-linux-x86_64.zip | |
# Unzip | |
unzip protoc-3.2.0-linux-x86_64.zip -d protoc3 | |
# Move protoc to /usr/local/bin/ | |
sudo mv protoc3/bin/* /usr/local/bin/ | |
# Move protoc3/include to /usr/local/include/ |
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
#!/bin/sh | |
brew install python@2 | |
pip install --upgrade virtualenv | |
# clonde labelimg source | |
rm -rf /tmp/labelImgSetup | |
mkdir /tmp/labelImgSetup | |
cd /tmp/labelImgSetup | |
curl https://codeload.github.com/tzutalin/labelImg/zip/master --output labelImg.zip |