By default, Python produces buffered output (when you use print).
This could be a problem when you would like to see in "real time" your print(...) for example in a log file.
You can disable the buffer for output, by adding the option "-u" like that :
python -u my_script.py
I had this problem with Tornado + supervisor. I did not understand why my print(..) was not written immediately in my log file => -u option solves my problem !
mercredi 29 juillet 2015
lundi 20 juillet 2015
[Nginx] Redirect http to https
server {
listen 80;
server_name my.domain.com;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl;
server_name my.domain.com;
[....]
lundi 13 juillet 2015
[Ionic] Submit Ionic app to App Store
Source : http://stackoverflow.com/questions/30379538/how-would-you-deploy-an-ionic-frameworks-app-on-the-itunes-store
Build Your First Mobile App With The Ionic Framework - Part 6
Source : http://gonehybrid.com/build-your-first-mobile-app-with-the-ionic-framework-part-6/
How to Submit Your App to Apple: From No Account to App Store, Part 1
Source : http://www.raywenderlich.com/8003/how-to-submit-your-app-to-apple-from-no-account-to-app-store-part-1
http://forum.ionicframework.com/t/how-to-submit-ios-app-to-app-store-using-xcode/1795/6
Build Your First Mobile App With The Ionic Framework - Part 6
Source : http://gonehybrid.com/build-your-first-mobile-app-with-the-ionic-framework-part-6/
How to Submit Your App to Apple: From No Account to App Store, Part 1
Source : http://www.raywenderlich.com/8003/how-to-submit-your-app-to-apple-from-no-account-to-app-store-part-1
http://forum.ionicframework.com/t/how-to-submit-ios-app-to-app-store-using-xcode/1795/6
dimanche 3 mai 2015
[AngularJS] [Ionic] ng-click called twice
When I click on a <A> tag having a ng-click, the ng-click is called twice.
For solving this problem, I use the new ng-click provided in the module ngTouch.
The original ng-click provided inside the ng core :
https://docs.angularjs.org/api/ng/directive/ngClick
The new ng-click inside the ngTouch module :
https://docs.angularjs.org/api/ngTouch
For calling the ng-click in ngTouch :
For solving this problem, I use the new ng-click provided in the module ngTouch.
The original ng-click provided inside the ng core :
https://docs.angularjs.org/api/ng/directive/ngClick
The new ng-click inside the ngTouch module :
https://docs.angularjs.org/api/ngTouch
For calling the ng-click in ngTouch :
<script src="angular.js">
<script src="angular-touch.js">
angular.module('app', ['ngTouch']);
samedi 25 avril 2015
[AngularJS] No 'Access-Control-Allow-Origin' header is present on the requested resource
If your Ionic application use $http.post (for calling a restful service for example) and if you try test your application (executed with the command ionic serve) on your PC with a browser like Chrome, you will obtain this kind of message in your JavaScript console :
Solution :
During your test, you can do that :
Source : http://forum.ionicframework.com/t/angularjs-post-request-cors-issue/10334
Other interesting sources :
http://juhap.iki.fi/webdev/cross-domain-http-with-python/
http://www.nczonline.net/blog/2010/05/25/cross-domain-ajax-with-cross-origin-resource-sharing/
http://stackoverflow.com/questions/12630231/how-do-cors-and-access-control-allow-headers-work
No 'Access-Control-Allow-Origin' header is present on the requested resource[...]
Solution :
During your test, you can do that :
- replace :
$http.post(url,params);
- by :
var config = {
method: 'POST',
data:params,
headers: {
'Content-Type': undefined
},
url=url
};$http(config);
- and define in your restful application :
"Access-Control-Allow-Origin": "*"
Source : http://forum.ionicframework.com/t/angularjs-post-request-cors-issue/10334
Other interesting sources :
http://juhap.iki.fi/webdev/cross-domain-http-with-python/
http://www.nczonline.net/blog/2010/05/25/cross-domain-ajax-with-cross-origin-resource-sharing/
http://stackoverflow.com/questions/12630231/how-do-cors-and-access-control-allow-headers-work
mercredi 22 avril 2015
[XDK] rename a project
Let's suppose you would like to rename your XDK project my_old_project to my_new_project
In two steps. But be careful, execute these steps at your own risk !!!!!
First of all, close XDK :)
1- rename your project :
2- delete the caches of XDK:
In two steps. But be careful, execute these steps at your own risk !!!!!
First of all, close XDK :)
1- rename your project :
- rename the folder containing your .xdk file : my_old_project -> my_new_project
- rename your file my_old_project.xdk to my_new_project.xdk (same manipulation for the .xdke file)
- edit the files :
- intelxdk.config.android.xml
- intelxdk.config.crosswalk.xml
- intelxdk.config.ios.xml
- intelxdk.config.windows8.xml
- and replace <name>my_old_project</name> by <name>my_new_project</name>
- edit my_new_project.xdk and replace "appName_": "my_old_project" by "appName_": "my_new_project"
2- delete the caches of XDK:
- delete the content of the folders :
- C:\Users\XXXX\AppData\Local\XDK\Cache
- C:\Users\XXXX\AppData\Local\XDK\File System\Origins
- C:\Users\XXXX\AppData\Local\XDK\GPUCache
- C:\Users\XXXX\AppData\Local\XDK\Local Storage
- delete files C:\Users\XXXX\AppData\Local\XDK\cookies and cookies-journal and global-settings.xdk and state.json
vendredi 17 avril 2015
[XDK] Intel App Preview - intel.xdk.device.barcode.scan not executed on mobile
If you use the intel.xdk.device.barcode.scan (XDK Javascript Bridge API) in your app and would like to test on a real mobile with the App Preview, you could see the QRCode reader does not display in your mobile.
Below a few steps to solve (I create a new project):
- create a new project (type : HTML5 + Cordova)
- on the project page, verify that field UI Framework is not "unkown"
- on the project page, uncheck all plugins
- in app.js file write :
document.addEventListener("intel.xdk.device.barcode.scan",function(evt){
intel.xdk.notification.beep(1);
if (evt.success === true) {
//successful scan
console.log(evt.codedata);
if (evt.codedata == "http://www.sampleurl.com/fake.html")
{
//in the XDK
}
else
{
alert(evt.codedata);
}
}else {
//failed scan
console.log("failed scan");
}
},false);
- where you want (for exemple in your index.html), write : <script>intel.xdk.device.scanBarcode(); </script>
jeudi 16 avril 2015
[Cordova] [NetBeans] npm http 404 http://registry.cordova.io/cordova-plugin-file
If you try to run for the first time an android application with Netbeans 8.0.2 and have this kind of message :
Then you shoud install this plugin separately. For that, go to your project folder and type :
Now you can re-run your application under NetBeans.
Source : http://stackoverflow.com/questions/29488069/build-error-cordova-application-error-404-not-found-cordova-plugin-file
npm http 404 http://registry.cordova.io/cordova-plugin-file Failed to install 'cordova-plugin-media-capture':Error: 404 Not Found: cordova-plugin-file
Then you shoud install this plugin separately. For that, go to your project folder and type :
https://github.com/apache/cordova-plugin-file.
Now you can re-run your application under NetBeans.
Source : http://stackoverflow.com/questions/29488069/build-error-cordova-application-error-404-not-found-cordova-plugin-file
samedi 11 avril 2015
mercredi 1 avril 2015
[Linux] Find and move files of a particular size
list them:
move them:
b – for 512-byte blocks (this is the default if no suffix is used)
c – for bytes
w – for two-byte words
k – for Kilobytes
M – for Megabytes
G – for Gigabytes
You can use -123c for <123c
You can use +123c for >123c
find /home/ -type f -size 123c -exec ls {} \;
move them:
find /home/ -type f -size 123c -exec mv {} <your_destination_directory> \;
b – for 512-byte blocks (this is the default if no suffix is used)
c – for bytes
w – for two-byte words
k – for Kilobytes
M – for Megabytes
G – for Gigabytes
You can use -123c for <123c
You can use +123c for >123c
Inscription à :
Articles (Atom)
Categories
- /etc/hosts (1)
- 443 (1)
- 80 (1)
- a2dp (1)
- addsubview (1)
- affix (1)
- amazon (1)
- android (6)
- angularjs (1)
- angularjs cross domain json post (1)
- angularjs ionic ng-click twice (1)
- animate (1)
- ansible (2)
- antlr (1)
- apache2 processes (1)
- app (1)
- app store (1)
- apple (1)
- appstore (1)
- avis (2)
- baignoire (1)
- basics (1)
- bitbucket (1)
- blackberry (1)
- bluetooth (1)
- booster (1)
- bootstrap (3)
- bottle (4)
- browsers (1)
- buffer (1)
- cherrypy (3)
- chromebook real life (1)
- coder (2)
- communicator (1)
- config.txt (1)
- creme chocolat (1)
- crepes bretonnes (1)
- crlf (1)
- css (2)
- cuisine (1)
- database (4)
- datatables (1)
- datetime (1)
- delete (1)
- disconnect (1)
- distributing (1)
- english (2)
- flask (1)
- fontawesome (1)
- francais (51)
- futuristic (1)
- game (1)
- gil (1)
- git (9)
- github (1)
- gratuit (2)
- hadopi (1)
- header (1)
- height zero (1)
- hibernate (1)
- hotel (2)
- http (1)
- https (2)
- ionic (2)
- ios (2)
- ios7 (1)
- iOS8 (1)
- iphone (1)
- jaune (1)
- java (7)
- javamelody (1)
- javascript (1)
- json (3)
- kindle (1)
- knockout (3)
- leaflet (1)
- legere (1)
- lf (1)
- life cycle (1)
- linkedin resume builder profile (1)
- linux (9)
- log (1)
- luxembourg (1)
- machine (1)
- maizena (1)
- minecraft (1)
- mobile (1)
- mongo (1)
- mongodb (3)
- mongodb mongo linux (1)
- multiple (1)
- myspace (1)
- mysql (1)
- netbeans cordova android cordova-plugin-file (1)
- nginx (2)
- nintendo (1)
- number (1)
- opensolaris (1)
- openstreetmap (1)
- oracle (15)
- order by (1)
- output (1)
- overclocking (1)
- packaging (1)
- parameters (1)
- personnaliser bootstrap (1)
- photos (1)
- pip (2)
- pipewire (1)
- prime (1)
- problem (2)
- project (1)
- publish (1)
- python (26)
- raspberry pi (2)
- raspi-config (1)
- recette (1)
- redirect (1)
- restful (2)
- schema (1)
- screen (1)
- screencast (1)
- script (1)
- scrollspy (1)
- serialization (1)
- sessions (2)
- shell (1)
- shutdown reboot linux reinstall apt-get (1)
- smartgwt (1)
- sncf (1)
- software (1)
- spring (1)
- sql (1)
- sticky footer (1)
- supervisor (1)
- systeme (1)
- tile (1)
- timestamp (1)
- title (1)
- tornado (3)
- turbo (1)
- ubuntu (2)
- uialertview (1)
- video capture (1)
- viewdidappear (1)
- viewdidload (1)
- viewwillappear (1)
- weasyprint (1)
- web (1)
- web2py (1)
- windows (5)
- worker (1)
- xbox wireless headset (1)
- xdk barcode scanner intel.xdk.device.barcode.scan (1)
- XDK rename project (1)
- xeno galaxies (1)