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
| #------------------------------------- | |
| // monitor | |
| kubectl proxy -p 8080 -w . | |
| //http://127.0.0.1/ui | |
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
| package main | |
| import ( | |
| "fmt" | |
| "net/http" | |
| ) | |
| func HelloHandlers(w http.ResponseWriter, r *http.Request) { | |
| fmt.Fprintf(w, "Hello, world.") | |
| } |
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
| package main | |
| import ( | |
| "fmt" | |
| "net/http" | |
| ) | |
| func Handler(writer http.ResponseWriter, request *http.Request) { | |
| fmt.Fprintf(writer, "Hello, world ") | |
| } |
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
| /* | |
| // method checkList timezone | |
| private void checkListTimeZone(){ | |
| String[]TZ = TimeZone.getAvailableIDs(); | |
| for(int i = 0; i < TZ.length; i++) { | |
| Log.d("TIMEZONE", TimeZone.getTimeZone(TZ[i]).getID()); | |
| } | |
| } | |
| */ |
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 cv | |
| cv.NamedWindow("testcam", cv.CV_WINDOW_AUTOSIZE) | |
| camera_index = 0 | |
| capture = cv.CaptureFromCAM(camera_index) | |
| def repeat(): | |
| global capture #declare as globals since we are assigning to them now | |
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
| sudo port install python27 | |
| sudo port select --set python python27 | |
| sudo port install py27-numpy | |
| sudo port install opencv +python27 | |
| # add export file | |
| sudo /Applications/TextEdit.app/Contents/MacOS/TextEdit ~/.bash_profile | |
| #or | |
| open -t ~/.bash_profile |
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 Image | |
| import os | |
| listfile = os.listdir(os.getcwd()) | |
| scale = 2 | |
| for f in listfile: | |
| if f.split('.')[1] == 'png': | |
| print 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
| var f = Titanium.Filesystem.getFile( Titanium.Filesystem.resourcesDirectory, | |
| 'issues/0/data.xml' | |
| ); | |
| var fdata = f.read(); | |
| var xml = Titanium.XML.parseString(fdata.text); | |
| var imagesFile = []; | |
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
| var db = Titanium.Database.open('imagazine'); | |
| //db.execute('drop database imagzine'); // for clear old | |
| //db.execute('insert into books (book_id, issue_name, cover_image, book_name, download_completed) values(1,"101","issues/0/cover.jpg","car",1)'); | |
| var rows = db.execute('select * from books where download_completed = 1'); | |
| while (rows.isValidRow()){ | |
| /* | |
| alert(rows.fieldByName('book_id')); |
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
| //feed for database | |
| // ------- | |
| var db = Ti.Database.install('../book.sqlite','db_name'); | |
| var rows = db.execute('select * from books where download_complete = 1'); | |
| var arrBook = []; | |
| while (rows.isValidRow()){ | |
| //rows.fieldByName('issue_name'); | |
| rows.next(); | |
| } |