Posts

python - mysqldb not installing -

hi using python 2.7 working on windows 7. have changed registry_key = software\mysql ab\mysql server 5.1 in site.cfg, , apended ld_args.append(‘/manifest’) in msvc9compiler.py. still got error please have ... traceback (most recent call last): file "c:\mysql-python-1.2.3\setup.py", line 15, in metadata, options = get_config() file "c:\mysql-python-1.2.3\setup_windows.py", line 7, in get_config serverkey = _winreg.openkey(_winreg.hkey_local_machine, options['registry_ke y']) windowserror: [error 2] system cannot find file specified why not use precompiled binaries. can them example here : http://www.codegood.com/archives/129

ruby on rails - How resque removes job from the queue? -

i have implemented resque queuing system in rails app. want know flow of resque job starting enqueue removed out queue. the traditional work flow, along method used gem is, 1. resque enqueue job(resque::job.create) , 2. job calls 'perform' method of class(resque::job.perform), and 3. resque removes job queue. i debugged gem find out method used in step 3, couldn't find it. methods resque::job.destroy, resque::job.dequeue not responsible task, debugged. can tell me method using remove job queue . please note that, not want remove job explicitly, want typical resque method removes job queue. thanks in advance. resque uses 'dequeue' method remove job: def dequeue(klass, *args) job.destroy(queue_from_class(klass), klass, *args) end to pick job queue processing uses 'pop' method: def pop(queue) decode redis.lpop("queue:#{queue}") end

c# - Reflection get type of FieldInfo object? -

hi all, need access class someclass declared has private field in wrapper class, using reflection far have been able private field members . how cast original type access properties , other members. internal class program { private static void main(string[] args) { wrapper wrap = new wrapper { someproperty = new someclass { number = 007 } }; type type = wrap.gettype(); fieldinfo[] infos = type.getfields(bindingflags.nonpublic | bindingflags.instance); foreach (var item in infos) { } } } internal class someclass { public int number { get; set; } } internal class wrapper { private someclass _tempsomeobj; public someclass someproperty { { return _tempsomeobj; } set ...

php - Magento. Destination folder is not writable or does not exists -

hey i'm stuck following problem, plz help. i "destination folder not writable.." when trying add image product, permission needed folders 777 ! had deleted files on server, didn`t touch db, reinstalled magento scratch new db, , ok. when switched previous db (change settings in local.xml ) bug appeared again. how can db impact folder permissions? update: thanx lot, found out magento jump method: public function getbasemediaurl() { return mage::getbaseurl('media') . 'catalog/product'; } to following method: public function getbasetmpmediaurl() { return mage::getbaseurl('media') . 'tmp/catalog/product'; } does know why , how???? there's 1 spot in magento code base uses error language. file: lib/varien/file/uploader.php ... if( !is_writable($destinationfolder) ) { throw new exception('destination folder not writable or not exists.'); } ... add temporary debugging code right above ...

matlab - Construct matrix according to the arrangement in another matrix -

i have matrix 'eff_tot' dimension (m x n) want rearrange according matrix called 'matches' (e.g. [n2 n3; n4 n5] ) , put collumns not specified in 'matches' @ end. that is, want have [eff_tot(:,n2) eff_tot(:,n3) ; eff_tot(:,n4) eff_tot(:,n5) ; eff_tot(:,n1)] . that's folks! taking example in first answer, have is: eff_tot = 81 15 45 15 24 44 86 11 14 42 92 63 97 87 5 19 36 1 58 91 27 52 78 55 95 82 41 0 0 0 87 8 0 0 0 9 24 0 0 0 40 13 0 0 0 26 19 0 0 0 regards. create vector listing indices of columns in eff_tot , use setdiff determine columns not occur in [n2 n3 n4 n5] . these columns unmatched ones. concatenate matched , unmatched column indices create column-reordered eff_tot matrix. >> eff_tot = randi(100, 5, 7) eff_tot = 45 82 81 15 15 41 24 11 87 ...

Securing Oracle distributed transactions against network failures -

i synchronizing table in local database data table on database on opposite side of earth using distributed transactions. networks connected through vpn on internet. of time works fine, when connection disrupted during active transaction, lock preventing job running again. cannot kill locking session. trying returns "ora-00031: session marked kill" , not killed before cycle local database. the sync job basically cursor trans_cursor select col_a, col_b, col_c remote_mastertable@my_link updated null; begin trans in trans_cursor loop insert local_mastertable (col_a, col_b, col_c) values (trans.col_a, trans.col_b, trans.col_c); insert local_detailstable (col_a, col_d, col_e) select col_a, col_d, col_e remote_detailstable@my_link col_a = trans.col_a; update remote_mastertable@my_link set updated = 1 col_a = trans.col_a; end loop; end; any ideas make sync operation more ...

Perl Win32::API() call() function -

dear all, trying value of char pointer or string in return of call() function dll. dll having function randomdec(long , int*) , returns string. call using win32::api(). have tried , didn't succeed. plz help use win32::api; @lpbuffer = " " x 20; $pp= \@lpbuffer; $xy=0; $ff= \$xy; $fun2 = new win32::api('my.dll','randomdec','np','**p**')or die $^e; $pp = $fun2->call(4,$ff); how using $pp ? there multiple errors in code. my @lpbuffer = " " x 20; $pp= \@lpbuffer; => my $pp = " " x 20; you mixing arrays strings, , don't need perl ref c ptr. similar int*. n number not long. l unsigned, need signed, l. use win32::api; $pp = " " x 20; # alloc string $xy = 0; # alloc int $fun2 = new win32::api('my.dll','randomdec','lp','p') or die $^e; $pp = $fun2->call(4,$xy); i haven't check if win32::a...