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 numpy import * | |
| import operator | |
| def createDataSet(): | |
| group = array([[1.0, 1.1], [1.0, 1.0], [0, 0], [0, 0.1]]) | |
| labels = ['A', 'A', 'B', 'B'] | |
| return group, labels | |
| def classify(inX, dataSet, labels, k): | |
| dataSetSize = dataSet.shape[0] |
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
| def search2(root_path): | |
| for (path, dirname, files) in os.walk(root_path): | |
| for f in files: | |
| print path + '/' + f |
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
| def search(path): | |
| file_list = os.listdir(path) | |
| for f in file_list: | |
| nextfile = os.path.join(path, f) | |
| if os.path.isdir(nextfile): | |
| search(nextfile) | |
| else: | |
| print nextfile |
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
| def insert_data(v): | |
| item = db_session.query(Table).filter_by(code = v['code']).first() | |
| if item == None: | |
| data = Table(v['code'], v['data']) | |
| db_session.add(data) | |
| db_session.commit() | |
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 pandas as pd | |
| parser.add_argument( | |
| ... | |
| ) | |
| parser.add_argument( | |
| "--print_results", | |
| action='store_true', | |
| help="Write output text to stdout rather than serializing to a file." | |
| ) |
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
| #include <gst/gst.h> | |
| typedef struct _CustomData{ | |
| GstElement *playbin; | |
| gboolean playing; | |
| gboolean terminate; | |
| gboolean seek_enabled; | |
| gboolean seek_done; | |
| gint64 duration; | |
| }CustomData; |
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
| #include <gst/gst.h> | |
| typedef struct _CustomData{ | |
| GstElement *pipeline; | |
| GstElement *source; | |
| GstElement *convert; | |
| GstElement *sink; | |
| }CustomData; | |
| static void pad_added_handler(GstElement *src, GstPad *pad, CustomData *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
| #include <gst/gst.h> | |
| int main(int argc, char *argv[]){ | |
| GstElement *pipeline, *source, *sink; | |
| GstBus *bus; | |
| GstMessage *msg; | |
| GstStateChangeReturn ret; | |
| gst_init(&argc, &argv); | |
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
| #include <gst/gst.h> | |
| int main(int argc, char* argv[]){ | |
| GstElement *pipeline; | |
| GstBus *bus; | |
| GstMessage *msg; | |
| gst_init(&argc, &argv); | |
| pipeline = gst_parse_launch("playbin uri=http://docs.gstreamer.com/media/sintel_trailer-480p.webm", NULL); |
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" |