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
| HtmlAgilityPack.HtmlDocument doc = new HtmlAgilityPack.HtmlDocument(); | |
| doc.LoadHtml("test.html"); | |
| HtmlAgilityPack.HtmlNode parentNode = doc.DocumentNode.SelectSingleNode("//body"); | |
| foreach(HtmlAgilityPack.HtmlNode n in parentNode.ChildNodes) | |
| { | |
| ... | |
| } |
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
| HttpWebRequest request = (HttpWebRequest)WebRequest.Create("웹 상 이미지 주소"); | |
| HttpWebResponse response = (HttpWebResponse)request.GetResponse(); | |
| if((response.StatusCode == HttpStatusCode.OK || | |
| response.StatusCode == HttpStatusCode.Moved || | |
| response.StatusCode == HttpStatusCode.Redirect)){ | |
| using(Stream inputStream = response.GetResponseStream()) | |
| using(Stream outputStream = File.OpenWrite("다운로드 될 파일 이름")){ | |
| byte[] buffer = new byte[4096]; | |
| int bytesRead; |
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 subprocess | |
| def main(): | |
| cmd = ['curl', '-s', '-F', 'cc=test', 'http://test.com'] | |
| fd_popen = subprocess.Popen(cmd, stdout=subprocess.PIPE).stdout | |
| data = fd_popen.read().strip() | |
| fd_popen.close() | |
| print data | |
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 class ApplicationController extends Application { | |
| private static final String PROPERTY_ID = "추적 ID"; | |
| public enum TrackerName { | |
| APP_TRACKER, // 앱 별로 트래킹 | |
| GLOBAL_TRACKER, // 모든 앱을 통틀어 트래킹 | |
| ECOMMERCE_TRACKER, // 아마 유료 결재 트래킹 개념 같음 | |
| } | |
| HashMap<TrackerName, Tracker> mTrackers = new HashMap<TrackerName, Tracker>(); |
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 class TestActivity{ | |
| private KakaoLink mKakaoLink; | |
| private KakaoTalkLinkMessageBuilder mKakaoTalkLinkMessageBuilder; | |
| @Override | |
| public void onCreate(Bundle savedInstanceState){ | |
| super.onCreate(savedInstanceState); | |
| setContentView(R.layout.test); | |
| InitKakaoLink(); |
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
| # database.py | |
| #!/usr/bin/python | |
| ######################################### | |
| # python 2.7.3 | |
| ######################################### | |
| from sqlalchemy import create_engine | |
| from sqlalchemy.orm import scoped_session, sessionmaker | |
| from sqlalchemy.ext.declarative import declarative_base |
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
| from sqlalchemy import Column, Integer, String, DateTime | |
| from database import Base | |
| class TbTest(Base): | |
| _tablename_ = 'tbTable' | |
| id = Column(Integer, primary_key=True) | |
| datetime = Column(DateTime) | |
| string = Column(String(250)) | |
| def __init__(self, datetime, string): |
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
| from database import init_db | |
| from database import db_session | |
| from models import TbTest | |
| def show_tables(): | |
| queries = db_session.query(TbTest) | |
| entries = [dict(id=q.id, datetime=q.datetime, string=q.string) for q in queries] | |
| print entires | |
| def add_entry(datetime, string): |
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 com.mocoplex.adlib.AdlibManager; | |
| public class TestActivity extends ActionBarActivity{ | |
| private AdlibManager mManager; | |
| @Override | |
| public void onCreate(Bundle savedInstanceState){ | |
| super.onCreate(savedInstanceState); | |
| setContentView(R.layout.activity_test); | |
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
| <?xml version="1.0" encoding="utf-8"?> | |
| <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
| xmlns:app="http://schemas.android.com/apk/res-auto" | |
| android:orientation="vertical" android:layout_height="match_parent" | |
| android:layout_width="match_parent"> | |
| <com.mocoplex.adlib.adlibAdViewContainer | |
| android:layout_width="match_parent" | |
| android:layout_height="wrap_content" | |
| android:id="@+id/ads" | |
| android:background="@android:color/white" |