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
Set WshShell = CreateObject("WScript.Shell") | |
MsgBox ConvertToKey(WshShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DigitalProductId")) | |
Function ConvertToKey(Key) | |
Const KeyOffset = 52 | |
i = 28 | |
Chars = "BCDFGHJKMPQRTVWXY2346789" | |
Do | |
Cur = 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
'use strict'; | |
var gulp = require('gulp'); | |
var concat = require('gulp-concat'); | |
var uglify = require('gulp-uglify'); | |
var sass = require('gulp-sass'); | |
var cssminify = require('gulp-clean-css'); | |
var imagemin = require('gulp-imagemin'); | |
var connect = require('gulp-connect'); | |
var livereload = require('gulp-livereload'); |
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 UIKit | |
import AVFoundation | |
class ViewController: UIViewController { | |
@IBOutlet weak var txtFieldText: UITextField! | |
@IBOutlet weak var labelMessage: UILabel! | |
let synth = AVSpeechSynthesizer() | |
var myUtterance = AVSpeechUtterance(string: "") | |
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
final FirebaseRemoteConfig mRemoteConfig = FirebaseRemoteConfig.getInstance(); | |
// cache expiration in seconds | |
long cacheExpiration = 3600; //1 hour | |
//Settings | |
FirebaseRemoteConfigSettings remoteConfigSettings = new FirebaseRemoteConfigSettings.Builder() | |
.setDeveloperModeEnabled(true) | |
.build(); | |
mRemoteConfig.setConfigSettings(remoteConfigSettings); |
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
public Observable<List<Person>> getPersons() { | |
final Realm realm = Realm.getDefaultInstance(); | |
return realm.where(Person.class).findAll() //get Persons from DB | |
.asObservable() | |
.map(new Func1<RealmResults<Person>, List<Person>>() { | |
@Override | |
public List<Person> call(RealmResults<Person> person) { | |
return realm.copyToRealm(person); //Convert RealmResults to List | |
} |
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
public void addPerson() { | |
final Realm realm = Realm.getDefaultInstance(); | |
//It automatically handles begin/commit, and cancel if an error happens | |
realm.executeTransactionAsync(new Realm.Transaction() { | |
@Override | |
public void execute(Realm realm) { | |
Person p = realm.createObject(City.class); | |
p.setId("00002"); | |
c.setName("Steve Jobs"); |
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 android.app.Application; | |
import io.realm.RealmConfiguration; | |
public class MyApplication extends Application { | |
public static RealmConfiguration realmConfiguration; | |
@Override | |
public void onCreate() { | |
super.onCreate(); | |
realmConfiguration = new RealmConfiguration.Builder(this) |
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
private PlaceAutocompleteAdapter adapter; | |
private AutoCompleteTextView autocompleteView; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
buildGoogleApiClient(); |
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 requests | |
from bs4 import BeautifulSoup | |
urlRoot = 'http://book.tpml.edu.tw/webpac/' | |
dateRange = '2016-08-01%2C2016-08-31' | |
rows = '1000' | |
link = urlRoot + 'newbooknotftdList.do?sortfield=MarcInsertDate&sorttype=1&showtuple=' + rows + '&newbookdatebet='+ dateRange +'&pubyear=all&language=chi&classtype=all&classno=all&classno10=all&keepsiteid=all&type=&categoraycode=-1&bookstatus=all&collection=all&viewmode=0' | |
res = requests.get(link) | |
soup = BeautifulSoup(res.text.encode('utf-8'), 'html.parser') |
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":"1","district":"板橋區","village":"中山里","no":"01-001","name":"林爽","address":"板橋區大觀路2段37巷280號","tel":"02-82752345","recycle_address":"板橋區大觀路2段37巷280號","open_time":"每週六早上 06:00--10:00","state":"營運中","twd97X":"295382.67","twd97Y":"2765962.44","wgs84aX":"121.449601129258","wgs84aY":"25.0009896915842"},{"number":"2","district":"板橋區","village":"廣德里","no":"01-002","name":"周建和","address":"板橋區重慶路283號","tel":"02-29643797","recycle_address":"同里辦及新北市板橋區廣德里5鄰重慶路353巷7號對面","open_time":"每週一至日9~12點+15~18點","state":"營運中","twd97X":"296817.42","twd97Y":"2765792.68","wgs84aX":"121.463808943393","wgs84aY":"24.9994134533018"},{"number":"3","district":"板橋區","village":"景星里","no":"01-003","name":"林志成","address":"板橋區景福路11號","tel":"02-29531072","recycle_address":"新北市板橋區景星里3鄰景福路11號","open_time":"每週四 09:00~16:00","state":"營運中","twd97X":"296532.5","twd97Y":"2766464.62","wgs84aX":"121.461009012507","wgs84aY":"25.0054885651095"},{"number":"4","district":"板橋區","village":"滿翠里","no":"01-004","name":"林重光","address":"板橋區四維路266巷5弄16號","tel |
NewerOlder