Posts

Compatibility issue with jquery ui.autocomplete -

i using jquery ui.autocomplete . working fine in ie 11. however, having compatibility issues when run project in mozilla(latest) or chrome(latest). have 2 problems this. how resolve compatibility issue and what best way handle these compatibility issues? different browsers have different compatibility issues , if make project compatible particular browser, still non-compatible in another. is not there way make project compatible in browser? now, code used try , achieve auto-complete feature provided below: $(function () { $.extend($.ui.autocomplete.prototype, { _rendermenu: function (ul, items) { $(ul).unbind("scroll"); var self = this; self._scrollmenu(ul, items); }, _scrollmenu: function (ul, items) { var self = this; var maxshow = 10; var results = []; var pages = math.ceil(items.length / maxshow); results = items.slice(0, maxshow); if (pages > 1) { $(ul).scro...

android - How to finish activity from other activity -

im looking way finish first activity other first activity it's splashscreen. want show him while second activity building../downloading datas , interface, , in asynctask second activity want finish first activity. dont need simple way delay. it's possible ? try android:nohistory="true" in splash screen, can set in manifest file. like this: <activity android:name=".package.splashscreen" android:nohistory="true" ... </activity> see more here .

python - How to test custom Django forms clean/save methods? -

most of time have change/extend default form save/clean methods. i'm not sure how test custom save/clean methods. most of time tests like: response = self.client.post(reverse('example:view_name'), kwargs={'example, self.example'}) self.assertequal(200, response.status_code) self.asserttemplateused('example.html', response) using self.client.post django's testcase class, capture response isn't enough , doesn't cover/test custom save , clean. what's practice of testing forms? in opinion did above wrong, since it's more of integration test goes through view form. create form directly in tests, , call is_valid method ( clean called is_valid ); check whether validate correctly. same save method. for example: from django.contrib.auth.forms import (usercreationform, ...) ... class usercreationformtest(testcase): def test_user_already_exists(self): data = { 'username': 'testclien...

mediawiki - How to add an invisible entry to a Wiki TOC? -

i add entry table of contents of wiki page links arbitrary point inside article. in use case, want link multiple 'header rows' inside long table. tried both <h4 style="display: none;">my invisible toc entry</h4> as as <div style="display: none;">my invisible toc entry</h4> however, seems element not rendered @ all. how add such invisible entry? i'll reply use case directly: «i want link multiple 'header rows' inside long table». i recommend use normal headers in such cases. able section editing of sub-table (or row) without breaking general table. example of sections reuse existing cells/headers feature map on mediawiki.org . alternatively, have invisible anchors, can add <span id=linkme></span> or similar, done via {{anchor}} template. middle ways, i.e. anchors sections , display in toc, hacked , made inservible viewing , section editing, don't "solutions" me.

java - the value of local variable is not used -

this question has answer here: java error “value of local variable not used” 7 answers i wrote small program check given movie name exist in folder. getting warning on eclipse "the value of local variable not used" here main method public static void main(string[] args) { // todo auto-generated method stub boolean movie_exist=false; system.out.println("hellow world!"); try{ filewriting newfolrder = new filewriting("h:\\breakinbad2\\breaking bad season 2 complete 720p.brrip.sujaidr"); //movie_exist=newfolrder.checkfilesname("movie name"); system.out.println(newfolrder.checkmovieexist("breaking bad")); movie_exist = newfolrder.checkmovieexist("breaking bad"); }catch(nullpointerexception e){ system.out.println("exce...

html - CSS Hover Caption Issue -

i have site background seperated 4 divs each take 25% of page the goal have overlay fade in when hovered on (which applied first image - #nw) the problem cannot text class .caption show up the code below: css .overlaytext {font-family: 'raleway', sans-serif;} body { height:100%; margin:0; padding:0; } div.bg { position:fixed; width:50%; height:50% } #nw { top:0; left:0; background-image: url('clevelandnight.jpg'); background-size:cover;} #ne { top:0; left:50%; background-image: url('news1.jpg'); background-size:cover;} #sw { top:50%; left:0; background-image: url('drinks1.jpg'); background-size:cover;} #se { top:50%; left:50%; background-image: url('clevelandday.jpg'); background-size:cover;} .overlay { background:rgba(0,0,0,.75); opacity:0; height:100%; -webkit-transition: .4s ease-out; -moz-transition: .4s ease-out; -o-transition: .4s ease-out; -ms-transition: .4s ease-out; transition: .4s ease-out...

multiprocessing - Fastest way to extract tar files using Python -

i have extract hundreds of tar.bz files each size of 5gb. tried following code: import tarfile multiprocessing import pool files = glob.glob('d:\\*.tar.bz') ##all files in d f in files: tar = tarfile.open (f, 'r:bz2') pool = pool(processes=5) pool.map(tar.extractall('e:\\') ###i want extract them in e tar.close() but code has type error: typeerror: map() takes @ least 3 arguments (2 given) how can solve it? further ideas accelerate extracting? you need change pool.map(tar.extractall('e:\\') pool.map(tar.extractall(),"list_of_all_files") note map() takes 2 argument first function , second iterable , , apply function every item of iterable , return list of results. edit : need pass tarinfo object other process : def test_multiproc(): files = glob.glob('d:\\*.tar.bz2') pool = pool(processes=5) result = pool.map(read_files, files) def read_files(name): t = tarfile.open (name, ...