https://serverfault.com/questions/912162/mysqldump-throws-unknown-table-column-statistics-in-information-schema-1109
mysql workbench > Advanced options > column-statistcs = 0
https://serverfault.com/questions/912162/mysqldump-throws-unknown-table-column-statistics-in-information-schema-1109
mysql workbench > Advanced options > column-statistcs = 0
https://tjosm.com/5219/install-remote-desktop-vnc-ubuntu-16-04-server/
install realVNC
Re: SSH to Debian Guest from Windows host via Putty Postby noteirak » 19. May 2013, 11:24
Run the following on the host : CODE: SELECT ALL EXPAND VIEW ipconfig /all route print arp -a netstat -an | find “LISTENING” netsh advfirewall show allprofiles
Run the following in the guest : CODE: SELECT ALL EXPAND VIEW sudo ifconfig -a sudo route sudo arp sudo netstat -lnp sudo iptables -L -n -v
and in virtualbox, if u opening port for flask, pls use 0.0.0.0
or ensure the port forwarding is go to 127.0.0.1 in your VM
How to update python api sudo su deploy
cd /home/deploy/your-python-project
git pull
source ../py3.4/bin/activate
python setup.py bdist_egg
easy_install dist/<python_proj.egg>
alembic upgrade head
uwsgi –reload ~/uwsgi.pid
git download the src code -> (env) -> pack it into egg -> using easy_install to install the python egg -> update db migration -> restart server
cartridge, saleor (satchless), oscar
roychung
for me. And other admin has own account too.deploy
or your service name for the main service of your written code. It should not be a sudoer. And suppose you cannot login via ssh.deploy
user? You may consider using sudo su deploy
http://www.dotblogs.com.tw/rickyteng/archive/2013/11/06/126852.aspx
class entryExit(object):
def __init__(self, f):
print 'entry init enter'
self.f = f
print 'entry init exit'
def __call__(self, *args):
print "Entering", self.f.__name__
r = self.f(*args)
print "Exited", self.f.__name__
return r
print 'decorator using'
@entryExit
def hello(a):
print 'inside hello'
return "hello world " + a
print 'test start'
print hello('friends')
>>> ================================ RESTART ================================
>>>
decorator using
entry init enter
entry init exit
test start
Entering hello
inside hello
Exited hello
hello world friends
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don’t touch unless you know what you’re doing!
VAGRANTFILE_API_VERSION = “2”
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.provider “virtualbox” do |v|
v.memory = 1024
v.cpus = 1
end
config.vm.define “prod” do |prod_config|
prod_config.vm.box = “jamnplayer”
prod_config.vm.network “forwarded_port”, guest: 8080, host: 8081
prod_config.vm.network “forwarded_port”, guest: 5000, host: 5001
prod_config.vm.network “forwarded_port”, guest: 22, host: 2200, auto_correct: false, id: “ssh”
prod_config.vm.host_name = “prod”
end
end
======
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don’t touch unless you know what you’re doing!
VAGRANTFILE_API_VERSION = “2”
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.provider “virtualbox” do |v|
v.memory = 2048
v.cpus = 1
end
config.vm.define “default” do |default_config|
default_config.vm.box = “ubuntu-14.04”
default_config.vm.network “forwarded_port”, guest: 6543, host: 6543
default_config.vm.network “forwarded_port”, guest: 8080, host: 8080
default_config.vm.network “forwarded_port”, guest: 5000, host: 5000
default_config.vm.network “forwarded_port”, guest: 22, host: 2222, auto_correct: false, id: “ssh”
default_config.vm.host_name = “default”
end
end
def __init__(self, *agrs, **kwargs):
super(Song, self).__init__(**kwargs)
self.artist_hash = self.artist + “_” + self.md5
default_config.vm.network “forwarded_port”, guest: 22, host: 2222, auto_correct: false, id: “ssh”
Try this: Python Property
The sample code is:
class C(object):
def __init__(self):
self._x = None
@property
def x(self):
“””I’m the ‘x’ property.”””
print “getter of x called”
return self._x
@x.setter
def x(self, value):
print “setter of x called”
self._x = value
@x.deleter
def x(self):
print “deleter of x called”
del self._x
virtualenv -p /usr/bin/python3.4 py3.4
(without source … )
py3.4/bin/python setup.py install
by using env python program,
it will not install in local, but in env
and views are templates
>>> add = wrapper(add)
This pattern can be used at any time, to wrap any function. But if we are defining a function we can “decorate” it with the @ symbol like:
>>> @wrapper
… def add(a, b):
… return Coordinate(a.x + b.x, a.y + b.y)
http://simeonfranklin.com/blog/2012/jul/1/python-decorators-in-12-steps/
http://tuzii.me/diary/52e9a4e49c20116d8ca80dd4/%E8%A7%A3%E5%86%B3fLask%E4%B8%ADsecure_filename%E8%8E%B7%E5%8F%96%E4%B8%AD%E6%96%87%E6%96%87%E4%BB%B6%E5%90%8D%E9%97%AE%E9%A2%98
install haskell-platform
update cabal
cabal install HarmTrace
it will warn u no gsl
install gsl then
sudo apt-get install libgsl0-dev liblapack-dev
then
cabal install HarmTrace
finish
~/.cabal/bin/harmtrace
harmtrace recognise –file=/Users/roychung/project/harmtrace/let_it_be.mp3 –mode=group –grammar=pop -o=/Users/roychung/project/harmtrace/output –log-dir=/Users/roychung/project/harmtrace/log –csv-dir=/Users/roychung/project/harmtrace/csv –sa-path=/Users/roychung/project/harmtrace/sonic-annotator –vamp-dir=/Users/roychung/project/harmtrace/vamp
in /Users/roychung/project/harmtrace/vamp need transform file
which is generate by sonic annotator
http://code.soundsoftware.ac.uk/projects/sonic-annotator/wiki
then it will say no sox
http://sox.sourceforge.net/
then sox want lame and mad (from readme)
install them
transform file is sth like :
$ sonic-annotator -s vamp:vamp-example-plugins:fixedtempo:tempo
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix vamp: <http://purl.org/ontology/vamp/> .
@prefix : <#> .
:transform a vamp:Transform ;
vamp:plugin <http://vamp-plugins.org/rdf/plugins/vamp-example-plugins#fixedtempo> ;
vamp:step_size “64”^^xsd:int ;
vamp:block_size “256”^^xsd:int ;
vamp:parameter_binding [
vamp:parameter [ vamp:identifier “maxbpm” ] ;
vamp:value “190”^^xsd:float ;
] ;
vamp:parameter_binding [
vamp:parameter [ vamp:identifier “maxdflen” ] ;
vamp:value “10”^^xsd:float ;
] ;
vamp:parameter_binding [
vamp:parameter [ vamp:identifier “minbpm” ] ;
vamp:value “50”^^xsd:float ;
] ;
vamp:output <http://vamp-plugins.org/rdf/plugins/vamp-example-plugins#fixedtempo_output_tempo> .
$
hint:
beat-tracker transform need change to 256 …
it has error about it, or u cannot generate the beat-tracker.txt
http://stackoverflow.com/questions/21499337/cannot-set-gopath-on-mac-osx
GOPATH in ~/.bash_profile and GoSublime
using 3rd party plugin (same concept as calculating the offset)
https://github.com/teamdf/jquery-visible
concept:
http://www.jquery4u.com/dom-modification/jquery-check-element-view/
magentoappdesignfrontendbasedefaulttemplatecatalogproductwidgetnewcontent
read the following file can know more about the route and flow
store/app/code/core/Mage/Core/Controller/Varien/Front.php <== front controller
store/app/code/core/Mage/Core/Model/App.php <== (Main) App Model (Object)
about REFERENCE : 即係跳 block 專用技
Diagram 3
In order to make the reference, you must target the reference to a block by using the ‘name’ attribute. This attribute targets the
need some tricks:
MAGENTO DEBUGGING – HOW TO DEBUG TEMPLATE PATHS, LOGGING AND DISPLAY ERRORS
Categories: Blog, Magento
Developing in Magento without these debugging tips can be challenging! Here is how you can debug magento:
Turn on Template Path Hints
Turn on error/system logging
Turn on SQL logging
Display PHP errors
Turn on Template Path Hints
Would you like to see the path of the file that is producing the HTML for each block on the page?
1. Log into the admin
2. Goto -> System ->Configuration, and on the bottom of the list select “Developer”
3. click on Debug – you will only see “Profiler”. Here is the trick – you have to switch the “Current Configuration Scope:” [in the upper left] to a website instead of default. Select “Main Website”.
4. Now you will see the selection for Template Path Hints – check yes. This will display the path of the template for each block of the page so you can find stuff! You can also choose to “Add Block Names to Hints” to see the corresponding model class for the block.
Turn on error/system logging
1. In the admin Goto -> System ->Configuration, and on the bottom of the list select “Developer”
2. Select the Log Settings tab and put Enabled = Yes
3. *to avoid any permissions issues, create folder/file
/var/log/system.log
Turn on SQL logging
To enable SQL Debugging find the file
/lib/Varien/Db/Adapter/Pdo/Mysql.php
change line 45
protected $_debug = false;
to
protected $_debug = true;
It will then generate the file var/debug/sql.txt.
*If you have any issues create this file manually first…
Display PHP errors
Frustrated you can’t see your PHP errors? This is how you turn them on – for development use only, don’t do this on a production site!
In Index.php change
Mage::setIsDeveloperMode(true);
ini_set(‘display_errors’, 1);
RewriteEngine On
RewriteBase /
# —————————————
# BEGIN Domain to folder mapping
# pointing so9sad.com to folder_1
ReWriteCond %{HTTP_HOST} so9sad.com
ReWriteCond %{REQUEST_URI} !so9sad/
ReWriteRule ^(.*)$ so9sad/$1 [L]
# pointing youtube9loop.com to folder_2
ReWriteCond %{HTTP_HOST} youtube9loop.com
ReWriteCond %{REQUEST_URI} !youtube9loop/
ReWriteRule ^(.*)$ youtube9loop/$1 [L]
# END Domain to folder mapping
# —————————————
# —————————————
# BEGIN htaccess pretection
order allow,deny
deny from all
# END htaccess pretection
# —————————————
With wordpress:
RewriteEngine On
RewriteBase /
# —————————————
# BEGIN Domain to folder mapping
# pointing domain_1.com to folder_1
ReWriteCond %{HTTP_HOST} domain_1.com
ReWriteCond %{REQUEST_URI} !folder_1/
ReWriteRule ^(.*)$ folder_1/$1 [L]
# pointing domain_2.com to folder_2
ReWriteCond %{HTTP_HOST} domain_2.com
ReWriteCond %{REQUEST_URI} !folder_2/
ReWriteRule ^(.*)$ folder_2/$1 [L]
# END Domain to folder mapping
# —————————————
# —————————————
# BEGIN WordPress
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
# —————————————
# —————————————
# BEGIN htaccess pretection
order allow,deny
deny from all
# END htaccess pretection
# —————————————
function enhance
http://documentcloud.github.com/underscore/#
layout framework
http://isotope.metafizzy.co/docs/introduction.html
You can use the log_message() function and put it in the constructor, so it will be executed when it initiated
Put this in your model’s constructor (parent::Model())
log_message (“debug”, “Yourmodel is loaded”);
don’t forget to set the log config to debug mode, see the config.php file
$config[‘log_threshold’] = 2;
And set the system/logs directory permission to writable (by default CI will create the log files here)
or set the logs directory in another dir
$config[‘log_path’] = ‘another/directory/logs/’;
CI will then create the log file in the directory. monitor the log files as you like. You can get the debug message to see if your model is already loaded or not in the log files.
http://jsfiddle.net/weissraum/yF3Zx/
http://stackoverflow.com/questions/1192665/adding-support-for-i18n-in-php-with-gettext
command “locale -a” to check the lang code set
rmb zh-HK , 細階細階-大階大階
$(“#uploadImg”).click(function(e) {
$(“#fileUpload”).trigger(“click”);
});
but it may fail for IE
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ’tilesConfigurer’ defined in ServletContext resource [/WEB-INF/spring/appServlet/servlet-context.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.web.servlet.view.tiles2.TilesConfigurer]: Constructor threw exception;
http://richardbarabe.wordpress.com/2009/02/23/apache-tiles-2-integration-with-spring-mvc/
Update:
add this dependencies to solve :
[xml]
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-el</artifactId>
<version>2.2.2</version>
</dependency>
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-template</artifactId>
<version>2.2.2</version>
</dependency>
[/xml]
var yung = { variable : xxx, add: function () { } }
they are all accessible by other
yung.Class = function(someSetting) {
var privateVar
this.publicVar
function privateFunction
function publicFunction
//public function
$.extend(this, {
publicFunction: publicFunction
});
yung.obj = new yung.Class(someSettings);
}
scope:
(function(object1, jquery, window, settings) {
code….
})(object1, jquery, window, settings);
the tutorial is a bit old, may not suit yr need , but can do ref
http://akrabat.com/zend-framework/simple-zend_form-example/
http://akrabat.com/zend-framework/simple-zend_layout-example/
look and feel, font
http://www.pixelbaecker.de/#anker-s6
http://segfaultlabs.com/devlogs/alchemy-asynchronous-jpeg-encoding-2
http://savagelook.com/blog/actionscript3/adobe-alchemy
http://forums.adobe.com/message/987186#987186
– find find wt is beginEncodeJpegFileToPixsense, Pixsense encode …. ummm
urlStream is always good, it trigger the browser request to server, but very raw and cannot detect the upload progress (no progress event fire during upload) ( cal the speed and use Timer to pretend the progress bar )
but fileRef.upload is really poor, it use its user agent, so it is independent to browser, so no session can be save, it make a new session i think
judge yourself use which class then 🙂
@ww_boy6 roy:
wwboy: http://skype.sourceforge.jp/index.php?Skype%20API%20For%20Java%20(English)
roy:
this can help ?
roy:
actually they think so 麻煩 becoz they want to do VOIP
roy:
but we only need msg
roy:
wwboy: https://imo.im/
roy:
u see this web app can do skype
roy:
http://developer.skype.com/skypekit/reference/java/html/com/skype/api/Message.html
roy:
for ww
.add is a function tht “add” the selector into jquery object list. This add is not mean append.
ms tech note
——————
http://technet.microsoft.com/en-us/library/ee198896.aspx
return is a object
——————
http://stackoverflow.com/questions/140002/vbscript-how-to-utiliize-a-dictionary-object-returned-from-a-function
http://www.ruhanirabin.com/how-to-add-facebook-like-button-to-wordpress-posts/
https://dev.twitter.com/docs/tweet-button
http://diythemes.com/thesis/rtfm/add-google-plus-1-share-button/
http://ottopress.com/2011/adding-googles-1-button-to-wordpress-sites/
ajax:
http://forum.developers.facebook.net/viewtopic.php?id=68635
language : http://codex.wordpress.org/I18n_for_WordPress_Developers
writing plugin:
o岩o岩開波d format : http://codex.wordpress.org/Plugin_API
action/filter default hook:
http://codex.wordpress.org/Plugin_API/Hooks_2.0.x
hook list with src:
http://adambrown.info/p/wp_hooks/version/3.2
Prototype
All objects have a prototype property. Whenever the interpreter looks for a property, it also checks the prototype. jQuery uses that extensively to add methods to jQuery instances.
var form = $(“#myform”);
form.clearForm; // undefined
form.fn.clearForm = function() {
return this.find(“:input”).each(function() {
this.value = “”;
}).end();
};
form.clearForm() // works for all instances of jQuery objects, because the new method was added to the prototype
(This example needs clarification: how does it modify the prototype when the word “prototype” doesn’t appear anywhere? The implication is that form.fn is simply an alias for form.prototype, but if that’s the case then it should be explained. :-?)
In javascript:the definitive guide 5 edition,dont add attibute to Object.prototype
use js pls
php setCookies cant trigger by user if he press “BACK” button
http://stackoverflow.com/questions/2559318/how-to-check-for-undefined-or-null-variable-in-javascript
example:
var option = para || {};
option.color = option.color || “#B0B0B0” ;
option.height = option.height || 1;
http://stackoverflow.com/questions/1000597/event-preventdefault-function-not-working-in-ie-any-help
event.preventDefault ? event.preventDefault() : event.returnValue = false;
event.preventDefault = many browser
event.returnValue = ie 🙂
batch edit image:
infraview
batch rename program:
CKrename
white-space: pre-wrap; /* CSS3 */
white-space: -moz-pre-wrap; /* Firefox */
white-space: -pre-wrap; /* Opera <7 */
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word; /* IE */
white-space: normal !important; /* IE 7*/
ref:
http://stackoverflow.com/questions/1638223/is-there-a-way-to-word-wrap-text-in-a-div
http://stackoverflow.com/questions/3553353/problem-with-word-wrap-in-ie7
quite good jquery plugin template
http://www.whatheaven.com/fileupload/upload/jquery_slideshow.js
when u r making some layout float:left ….
then u want next component dun want float anymore =.=
use CLEAR attribute!!!
main style:
http://bentrovatoblog.com/
comment style:
http://ddgoodi.es/
http://net.tutsplus.com/tutorials/javascript-ajax/build-ajax-data-grids-with-codeigniter-and-jquery-2/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+nettuts+%28Nettuts%2B%29
http://www.gen-x-design.com/
呢個 blog 都無咩 update ,不過d 舊文都 ok 有用
http://sixrevisions.com/contests/giveaway-premium-wordpress-themes-wpzoom/
idea: rewrite engine to make http => https
1. go to .htaccess in /usr/share/phpmyadmin
add
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
2. activate the rewrite engine by a2enmod rewrite , then restart apache2
3. make SSL cert, some command like the following
#openssl req $@ -new -x509 -days 365 -nodes -out /etc/apache2/apache.pem -keyout /etc/apache2/apache.pem
4. permission for the cerf : #chmod 600 /etc/apache2/apache.pem
5. Listen 443 in ports.conf
6. Set the phpmyadmin conf in sites-available:
# phpMyAdmin default Apache configuration
Alias /phpmyadmin /usr/share/phpmyadmin
DocumentRoot /usr/share/phpmyadmin
SSLEngine on
SSLCertificateFile “/etc/apache2/apache.pem”
Options Indexes FollowSymLinks
AllowOverride All
DirectoryIndex index.php
AddType application/x-httpd-php .php
php_flag magic_quotes_gpc Off
php_flag track_vars On
php_flag register_globals Off
php_value include_path .
# Authorize for setup
AuthType Basic
AuthName “phpMyAdmin Setup”
AuthUserFile /etc/phpmyadmin/htpasswd.setup
Require valid-user
# Disallow web access to directories that don’t need it
Order Deny,Allow
Deny from All
Order Deny,Allow
Deny from All
7. Finish.
http://slodive.com/freebies/web-design-templates/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+Slodive+%28SloDive+-+Design+Resources+and+Inspiration%29
http://learn.appendto.com/
http://net.tutsplus.com/tutorials/html-css-techniques/how-to-create-diagonal-lines-with-css/
http://blog.steveklabnik.com/2011/07/03/nobody-understands-rest-or-http.html
http://net.tutsplus.com/tutorials/html-css-techniques/build-your-first-game-with-html5/
http://www.kissmetrics.com/ (web analytic)
http://mixpanel.com/ (web analytic)
http://www.usabilla.com/ (micro usability tests)
restful + spring + freemaker
可以玩下 rest 野,try try try
原來……中文個d 係無腳字……Sans-serif
Modernizr is a small and simple JavaScript library that helps you take advantage of emerging web technologies (CSS3, HTML 5) while still maintaining a fine level of control over older browsers that may not yet support these new technologies.
ICON
http://lab.simurai.com/css/buttons/#material
http://greepit.com/open-source-icons-gcons/
http://www.fullcreative.com/2010/09/switch-a-set-of-54-minimalist-vector-icons-part-1/
http://www.webdesignerdepot.com/2010/07/200-exclusive-free-icons-reflection/
http://somerandomdude.com/projects/iconic/
http://www.wpzoom.com/wpzoom/new-freebie-wpzoom-developer-icon-set-154-free-icons/
TILE BKG
http://www.html5.jp/canvas/ref.html
http://www.catswhocode.com/blog/how-to-create-a-kick-ass-css3-progress-bar
作者 = jquery 作者