1: # two global variable2: myMin = 360.03: myMax = 0.04:5: def MyStatistics( fileName ) :6: myFile = open(fileName)7: strList = myFile.readlines()8:9: # Specify that these two are global variable10: global myMin11: global myMax12:13: for str in strList :14: myFloat = float(str)15: if( myFloat > myMax ):16: myMax = myFloat17:18: if( myFloat < myMin ):19: myMin = myFloat20:21: # a file with number seperate '\n'22: MyStatistics(FileWithFloat)23:24: print 'myMin = %s' % (myMin)25: print 'myMax = %s' % (myMax)
I wanted to setup MySQL to use utf-8 on the MAMP installation on my Mac. I tried the instructions from this article: http://cameronyule.com/2008/07/configuring-mysql-to-use-utf-8/ However, I kept getting error messages that are similar to this one [ERROR] /Applications/MAMP/Library/bin/mysqld: unknown variable 'default-collation=utf8_general_ci' I did some search and realized that several variables are deprecated. Reference: http://dev.mysql.com/doc/refman/5.1/en/server-options.html Therefore, I added the following lines into /Applications/MAMP/conf/my.cnf [mysql] character-set-server=utf8 [client] character-set-server=utf8 [mysqld] character-set-server=utf8 collation-server=utf8_general_ci init-connect='SET NAMES utf8' I restarted the server and mysql run successfully with relevant variables being set correctly. In the "Variables" tab under phpMyAdmin interface (ex. http://localhost:8888/MAMP/?language=English) character set c
Comments