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
override func viewDidLoad() { | |
super.viewDidLoad() | |
NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillShow(_:)), name: NSNotification.Name(rawValue: "keyboardWillShow") , object: NSNotification.Name.UIKeyboardWillShow) | |
NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillHide(_:)), name: NSNotification.Name(rawValue: "keyboardWillHide"), object: NSNotification.Name.UIKeyboardWillHide) | |
hideKeyboardWhenTappedAround() | |
if let username = defaults.string(forKey: "doc_username") { | |
if let password = defaults.string(forKey: "doc_password"){ | |
login_password.text = password | |
login_username.text = username | |
} |
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
package com.amir_p.myapplication; | |
import android.annotation.SuppressLint; | |
import android.content.Context; | |
import android.content.res.Configuration; | |
import android.os.Bundle; | |
import android.support.annotation.Nullable; | |
import android.support.v7.app.AppCompatActivity; | |
import java.util.Locale; |
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
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
navigatorObservers: [AppNavigatorObserver()], | |
home: HomePage(), | |
); | |
} | |
} |
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
class CategoriesPage extends StatelessWidget { | |
static MaterialPageRoute getRoute() => MaterialPageRoute( | |
settings: RouteSettings(name: 'Categories'), | |
builder: (context) => CategoriesPage()); | |
} |
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 pyproj | |
class ITMConverter(): | |
def __init__(self): | |
self.wgs84 = pyproj.Proj('epsg:4326') | |
self.itm = pyproj.Proj('epsg:2157') | |
def convert_to_wgs(self, easting, northing): | |
return pyproj.transform(self.itm, self.wgs84, easting, northing) | |
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 sys | |
import json | |
input_file = sys.argv[1] | |
output_file = sys.argv[2] | |
output_file = open(output_file, 'w') | |
def to_vcf_string(first_name, last_name, phone): | |
vcf_lines = [] |
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
// Original source code is by The Flutter Authors and I changed it slightly to meet my needs. | |
import 'dart:math' as math; | |
import 'package:flutter/gestures.dart' show DragStartBehavior; | |
import 'package:flutter/material.dart'; | |
import 'package:flutter/rendering.dart'; | |
import 'package:flutter/services.dart'; | |
import 'package:flutter/widgets.dart'; | |
import 'date_utils.dart' as utils; |
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 random | |
iterations = 10000 | |
change_selection = True | |
winning_result = [] | |
for i in range(iterations): | |
doors = [0, 0, 0] | |
doors[random.randint(0, 2)] = 1 |
OlderNewer