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
String html = "<html><head><title>First parse</title></head>" | |
+ "<body><p> | |
Parsed HTML into a doc.</p> | |
</body></html>"; | |
Document doc = Jsoup.parse(html); | |
Elements title = doc.select("title"); //First parse |
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
Whitelist wlist=new Whitelist(); | |
wlist.addTags("table","tbody","tr","td"); | |
wlist.addTags("img").addAttributes("img","src"); | |
Log.d(TAG, Jsoup.clean(rs, wlist)); |
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
Whitelist wlist = Whitelist.basic(); | |
Log.d(TAG, Jsoup.clean(rs, wlist)); |
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 | |
public void onCreate(Bundle saved){ | |
super.onCreate(saved); | |
// Init the swipe back | |
SwipeBack.attach(this, Position.LEFT) | |
.setContentView(R.layout.activity_simple) | |
.setSwipeBackView(R.layout.swipeback_default); | |
} |
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 SwipeRefreshLayout mSwipeLayout; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
...... | |
mSwipeLayout = (SwipeRefreshLayout) findViewById(R.id.swipe_container); | |
mSwipeLayout.setOnRefreshListener(this); | |
mSwipeLayout.setColorSchemeResources(android.R.color.holo_red_light, |
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
<framelayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:id="@+id/container" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
tools:ignore="MergeRootFrame" > | |
<android.support.v4.widget.SwipeRefreshLayout | |
android:id="@+id/swipe_container" | |
android:layout_width="match_parent" |
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
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import codecs, json,httplib | |
import urllib2 | |
import ast | |
root = 'http://data.taipei/opendata/datalist/apiAccess?scope=resourceAquire&rid=' | |
dict = {u'士林區':'97cc923a-e9ee-4adc-8c3d-335567dc15d3' |
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
#mount | |
sshfs root@nexus5:/sdcard/ sdcard -p2222 | |
#unmount | |
fusermount -u sdcard | |
# adb port forwarding | |
# This will redirect the local tcp port 22 to the port 2222 on the phone, on which the SSH server will be running now, served by QuickSSHd. | |
adb forward tcp:2222 tcp:22 |
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
git init | |
## git link to github repo | |
## git remote add origin [email protected]:ccjeng/tptrash-api.git | |
git add . | |
# commit program to local git repo | |
git commit –m "First commit" |
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 DatabaseName | |
GO | |
DBCC SHRINKFILE(<TransactionLogName>, 1) | |
BACKUP LOG <DatabaseName> WITH TRUNCATE_ONLY | |
DBCC SHRINKFILE(<TransactionLogName>, 1) | |
GO |