To watch PPS outside of China, add below lines to /private/etc/hosts 127.0.0.1 update.111222.cn 127.0.0.1 msg.ppstream.com Reference: http://www.weste.net/2006/10-24/09394857669.html Alternatively, can use Chrome with extension called “Unblock Youku“. This extension will allow to watch Youku, Tudou, PPS Web, Qiy, and so on from outside of China. https://chrome.google.com/webstore/detail/unblock-youku/pdnfnkhpgegpcingjbfihlkjeighnddk
Author: Chris Lee
Aptana Increase Memory Size & Excluding unnecessary files
Mac Application -> Aptana Studio 3 -> Click “AptanaStudio3.app” -> Right Click “Show Package Contents” -> Contents -> MacOS -> Open “AptanaStudio3.ini” with any text editor 1. –launcher.XXMaxPermSize 512m 2. -Xms512m 3. -Xmx1024m -startup ../../../plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar –launcher.library ../../../plugins/org.eclipse.equinox.launcher.cocoa.macosx_1.1.101.v20120109-1504 –launcher.XXMaxPermSize 512m –launcher.defaultAction openFile -vmargs -Xms512m -Xmx1024m -Declipse.p2.unsignedPolicy=allow -Declipse.log.size.max=10000 -Declipse.log.backup.max=5 -Xdock:icon=../Resources/aptana.icns -XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts Windows Go to C:\Users\Chris\AppData\Local\Aptana Studio…
Using KML file for iOS Simulator
(Before beginning, there may be other ways to use KML. I am just beginner in iOS programming and this is how I work around.) XCode allows to simulate the locations using GPX file type. One of location tracker, Google Latitude, allows to download recorded locations to KML file type. To use KML file for iOS…
XCode crash every second time.
I have XCode 4.6.2 (4H1003) and MBP retina. When I run my project in simulator, it crashes every second running without any error message in debug console. return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); The error is “Thread 1: signal SIGABRT“. Annoyingly, XCode does not give any error. According to the this guy, it is because of…
To use ‘messageComposeViewController’
To use ‘messageComposeViewController’ Add “MessageUI.framework” Library And should define on “AppDelegate.m” #import <MessageUI/MessageUI.h>
To re-size images with keeping aspect ratio and fitting to certain dimensions
To re-size images with keeping aspect ratio and fitting to certain dimensions function _create_thumbnail($actual_filepath, $folder_path, $target_filename, $width, $height) { // $this->load->library(‘image_lib’); // $image_lib_config = array( // ‘image_library’ => ‘gd2’ // , ‘source_image’ => $actual_filepath // , ‘new_image’ => $folder_path.$target_filename // , ‘maintain_ratio’ => true // , ‘width’ => $width // , ‘height’ => $height //…
New Expiry Date for CBA, ANZ, NAB Test Credit Card
New expiry date for test credit card number is 05/17. Card Number Expiry Date CVN Description 5123456789012346 05/17 123 MasterCard 4313581000123430 …
Where is “UIViewController subclass”?
In latest XCode (v4.6.2), I couldn’t find “UIViewController”, which tutorial book wants me to choose. According to this article, choose “Object-C Class” instead of.
구글 드라이브 사용법
구글 드라이브 사용법 이 문서는 구글 드라이브 사용법에 대해서 설명하기 위해 제작되었습니다. 구글 드라이브란? 구글 드라이브란 구글에서 제공하는 클라우드 문서 관리/공유 서비스입니다. 구글드라이브에서 제작할 수 있는 문서 형식은 워드, 엑셀등이 있으며, 동시에 접속하여 수정이 가능하며 자동으로 클라우드 서버에 저장이 됨과 동시에 히스토리를 남겨 작성 도중 유실된 염려가 없습니다. 또한 모바일 어플리케이션도 제공함으로 언제 어디서든지 실시간으로…
SQLite – could not prepare statement (1 too many SQL variables)
During development for SQLite, I have got this error could not prepare statement (1 too many SQL variables) Accroding to this article, this error is because of SQLite limitation, which cannot put variables more than 999 variables. After I reduce the amount of variables, it worked very well.
deprecated! ‘UILineBreakModeCharacterWrap’ & ‘UITextAlignmentCenter’
When I use UILineBreakModeCharacterWrap, I get this message ‘UILineBreakModeCharacterWrap’ is deprecated use NSLineBreakByCharWrapping instead of it. //[label setLineBreakMode:UILineBreakModeCharacterWrap]; [label setLineBreakMode:NSLineBreakByCharWrapping]; If I use UITextAlignmentCenter, then I get ‘UITextAlignmentCenter’ is deprecated: first deprecated in iOS 6.0 use NSTextAlignmentCenter instead of: //[textLabel setTextAlignment:UITextAlignmentCenter]; [textLabel setTextAlignment:NSTextAlignmentCenter];
Python – ImportError: No module named django.utils
When I follow the tutorial – App Engine Series #4 – I got this error for Ajax.py: ImportError: No module named django.utils According to this article, Python 2.7 uses native JSON library. Fixed source for Ajax.py is this: #!/usr/bin/env python # -*- coding: utf-8 -*- # Including the models: from models.models import * # from Phyton 2.7,…
Python – ImportError: No module named
When I follow the tutorial – App Engine Series #4 – I kept getting the error like below: ImportError: No module named controllers It is caused by below code: import webapp2 # Importing the controllers that will handle # the generation of the pages: from controllers import crons,ajax,generate,mainh To fix the error, it is very simple….
Google App Engine Tutorial – Datastore – 한글 입력시 Internal Server Error 나는 현상
Google App Engine의 Datastore 튜토리얼 소스를 실행시 한글을 방명록 이름(Guestbook name)필드에 입력하면 다음과 같은 에러가 발생한다. Traceback (most recent call last): File “/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2-2.5.2/webapp2.py”, line 1535, in __call__ rv = self.handle_exception(request, response, e) File “/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2-2.5.2/webapp2.py”, line 1529, in __call__ rv = self.router.dispatch(request, response) File “/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2-2.5.2/webapp2.py”, line 1278, in default_dispatcher return route.handler_adapter(request, response) File “/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2-2.5.2/webapp2.py”, line 1102,…
Python – 한글로 주석 남기면 실행 안되는 현상(cannot execute app if write Korean as comment)
한글로 코멘트를 남겼는데 다음과 같은 서버 에러가 발생했다. HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request. 검색해서 Using Python with Chinese, Japanese and Korean 라는 글을 찾았고, 코드를 다음과 같이 하니 문제없이 실행되었다. #!/usr/bin/env python # -*- coding: utf-8 -*-
Sample Code from Developing and deploying an application on Google App Engine
In the video, it provides the code as below #!/usr/bin/env python import os import wsgiref.handlers from google.appengine.ext import webapp from google.appengine.ext.webapp import template class MyHandler(webapp.RequestHandler): def get(self): self.response.out.write(template.render(‘main.html’, {})) def main(): app = webapp.WSGIApplication([ (r’.*’, MyHandler)], debug= True) wsgiref.handlers.CGIHandler().run(app); if __name__ == “__main__”: main() However, it gives the error as below: Traceback (most recent call…
Bootstrap Modal Remote Example
Reference: http://twitter.github.com/bootstrap/javascript.html#modals Reference: http://jsfiddle.net/mmfansler/cp67J/ <a data-target=”#myModal” role=”button” class=”btn” data-toggle=”modal”>Launch demo modal</a> <div class=”modal fade hide” id=”myModal” tabindex=”-1″ role=”dialog” aria-labelledby=”myModalLabel” aria-hidden=”true” data-remote=”/mmfansler/aQ3Ge/show/”> <div class=”modal-header”> <button type=”button” class=”close” data-dismiss=”modal” aria-hidden=”true”>×</button> <h3 id=”myModalLabel”>Modal header</h3> </div> <div class=”modal-body”> <p>One fine body…</p> </div> <div class=”modal-footer”> <button class=”btn” data-dismiss=”modal” aria-hidden=”true”>Close</button> <button class=”btn btn-primary”>Save changes</button> </div> </div>
Draw Polygons in Google Maps and Determine whether an Address is in Polygons
Draw Polygons in Google Maps and Determine whether an Address is in Polygons This sample source code uses Google Maps Javascript API V3 to draw polygons in Google Maps. (Refer https://google-developers.appspot.com/maps/documentation/javascript/examples/drawing-tools) The address auto-complete uses Google Places Javascript library. (Refer https://developers.google.com/maps/documentation/javascript/places#places_autocomplete) The server-side code will retrieve address’ latitude and longitude using Google Gecoding API. (Refer…
HTML5 Application Cache
A BEGINNER’S GUIDE TO USING THE APPLICATION CACHE – Reference: http://www.html5rocks.com/en/tutorials/appcache/beginner/ ……………………………………………… Using the cache interface gives your application three advantages: Offline browsing – users can navigate your full site when they’re offline Speed – cached resources are local, and therefore load faster. Reduced server load – the browser will only download resources from…
MongoDB Library for Codeigniter
Codeigniter MongoDB Library Reference & Download: https://github.com/alexbilbie/codeigniter-mongodb-library/tree/v2 Using with CodeIgniter: Add the file Mongo_db.php to your /application/libraries folder. Add the file mongodb.php to your /application/config folder. Update the config file.
MongoDB PHP extension for MAMP in Mac OS X
The command ‘pecl’ in MAMP dos not work; therefore, it requires to download pre-complied PHP extensions from https://github.com/mongodb/mongo-php-driver/downloads Open php.ini and add below code [code]extension=mongo.so[/code] Reference: http://www.php.net/manual/en/mongo.installation.php#mongo.installation.osx
Media Queries to handle all device’s screens
To cover all screen resolution including portrait and landscape screens. Found from stuff & nonsense (http://www.stuffandnonsense.co.uk/blog/about/hardboiled_css3_media_queries/) /* Smartphones (portrait and landscape) ———– */ @media only screen and (min-device-width : 320px) and (max-device-width : 480px) { /* Styles */ } /* Smartphones (landscape) ———– */ @media only screen and (min-width : 321px) { /* Styles…
Image related websites
Sencha Touch – Ajax JSON with multiple roots
I have JSON result that contains multiple roots. Most example JSONReader source codes are dealing with one root. According to cnelissen from Sencha Forum, using below code will make it working: var store1 = new Ext.data.Store({ url: ‘/path/to/json-data.php’, method: ‘POST’, autoLoad: true, reader: new Ext.data.JsonReader({ root: ‘root1’, fields: [‘field1’, ‘field2’, ‘field3’] }), listeners: { ‘load’:…
Sencha Touch Ext.Router.draw refresh issue
Sencha Touch 1.1.1 In my ‘route.js’ for Ext.Router.draw, I have custom route “map.connect” like: Ext.Router.draw(function(map) { map.connect(‘s/:specialName’, { controller: ‘Special’, action: ‘index’ }); map.connect(‘:controller/:action’); }); The URL I used is like this “http://localhost/m/#s/am-i-right-3023”, which contains dash(-) in the URL. If I refresh the browser with the URL, application is not reloading the page properly….