Posts

Can't restart mysql local server -

yesterday, local sql server crashed, , after trying restarting it, had typical error showing me permission problem. trying fix it, made kinda worse. still have permission problem, don't know how fix it. that's after mysql restart: mysqld: can't find file: './mysql/plugin.frm' (errno: 13 - permission denied) 2015-04-26 12:48:32 1663 [error] can't open mysql.plugin table. please run mysql_upgrade create it. 2015-04-26 12:48:32 1663 [note] innodb: using atomics ref count buffer pool pages 2015-04-26 12:48:32 1663 [note] innodb: innodb memory heap disabled 2015-04-26 12:48:32 1663 [note] innodb: mutexes , rw_locks use gcc atomic builtins 2015-04-26 12:48:32 1663 [note] innodb: memory barrier not used 2015-04-26 12:48:32 1663 [note] innodb: compressed tables use zlib 1.2.3 2015-04-26 12:48:32 1663 [note] innodb: using cpu crc32 instructions 2015-04-26 12:48:32 1663 [note] innodb: initializing buffer pool, size = 128.0m 2015-04-26 12:48:32 1663 [note] innodb: ...

java - How to get the id of a button in a listview -

i have customized widget textview , button. list view contains list of customized widget. want know on button there clicked. in facebook each post has react button , when click on go specific page. use below code create custom list. can create holder class hold button , textview object. helpful detect button click using holder class. class myadpter extends arrayadapter { int layout; arraylist<data> arr; context con; public myadpter(context context, int textviewresourceid, arraylist<data> objects) { super(context, textviewresourceid, objects); layout=textviewresourceid; arr= objects; con=context; // todo auto-generated constructor stub } @override public view getview(int position, view convertview, viewgroup parent) { // todo auto-generated method stub fi...

mysql - PHP- How to get URL on user click in iFrame showing another website -

i using iframe in application, in website shown (bbc news). on website users can login. after user logs in want track urls specific user visits in iframe , store these urls mysql database. since mentioned bbc, i'm assuming iframe loading cross domain therefore not possible ( http://en.wikipedia.org/wiki/same-origin_policy ). can detect mouse entering iframe, , unreliably, leaving it. a way around proxy content of iframe locally server. there can insert sort of tracking code or use function similar top.parentfunction(); returns reference parent of current window or subframe.

csv - Python Error; UnicodeEncodeError: 'ascii' codec can't encode character u'\u2026' -

i trying extract data json file contains tweets , write csv. file contains kinds of characters, i'm guessing why error message: unicodeencodeerror: 'ascii' codec can't encode character u'\u2026' i guess have convert output utf-8 before writing csv file, have not been able that. have found similar questions here on stackoverflow, not i've not been able adapt solutions problem (i should add not familiar python. i'm social scientist, not programmer) import csv import json fieldnames = ['id', 'text'] open('my_source_file', 'r') f, open('my_output', 'a') out: writer = csv.dictwriter( out, fieldnames=fieldnames, delimiter=',', quoting=csv.quote_all) line in f: tweet = json.loads(line) user = tweet['user'] output = { 'text': tweet['text'], 'id': tweet['id'], } wr...

xcode - Count from 100 to 1 with a different interval -

i'm trying make countdown in swift not rely on specific time, time interval choose. example want countdown 100-99 take approximately 4 hours. possible in way? you can use nstimer run specific task after given time , specify whether or not want repeat itself. method you're looking scheduledtimerwithtimeinterval . example, please @ this post . for more informations, please @ apple's nstimer class reference , section titled scheduling timers in run loops .

java - Activity with fragment who can take two differents fragments and rotation of device -

i'm new android, java, ... , new fragment. have activity (a) shows list using fragment (b). selecting item of list, same fragment changed show lis using fragment (c). works except when rotate device while shows second list (c). when shown first list (b), if rotate device, works perfectly. error logcat: 04-26 11:30:32.769: e/androidruntime(2882): fatal exception: main 04-26 11:30:32.769: e/androidruntime(2882): java.lang.runtimeexception: unable start activity componentinfo{com.example.traffic/com.example.traffic.listtriplines}: android.support.v4.app.fragment$instantiationexception: unable instantiate fragment com.example.traffic.listpoints: make sure class name exists, public, , has empty constructor public (...) 04-26 11:30:32.769: e/androidruntime(2882): caused by: android.support.v4.app.fragment$instantiationexception: unable instantiate fragment com.example.traffic.listpoints: make sure class name exists, public, , has empty constructor public (...) 04-...

Why won't my program work in python? -

hi 11 yrs old , teaching myself how code. set myself task make times table quiz asks 10 questions , inputs random numbers. however, code not working , not know why. using python 2.7.5. code: print("here quiz test knowledge") print("") print("question 1") import random print random.randint(1,10) print ("times") import random print random.randint(1,10) answer = raw_input ("make choice: ") if answer == ran1*ran2: print "that correct" correct=correct +1 else: print "that incorrect!" i can not spot why not working have not put loop in yet asks 1 question. when run else highlighted in red not know why. python works without brackets. replaced "spaces or tabs". , import once, beginning. this should work import random print("here quiz test knowledge") print("") print("question 1") print random.randint(1,10) print ("times") print random.randint(1,10) ans...