Posts

Showing posts from May, 2014

sqlite3 - How to access ODB files in Python 2.7 -

i want access odb file (made libreoffice base) in python , extract table further use. odb contains several tables, 1 relation design , several forms. is possible achieve without using sql? edit: since seems overcomplicated parse format on own, i'll consider using proper hsqldb engine. what python module accesses via hsql (like sqlite3 sqlite does)? you can consider python uno api comes openoffice. there several python examples interact api, including 1 sample database there so question explained how use uno libreoffice.

python - Appengine Query Offset - Not For Paging - EDIT With Memcache? -

i have application there list of items users page through. have handled paging through index field (i needed other things eitherway figured why not). my issue want implement "goto" feature; user can skip directly item instead of paging through them using provided navigation buttons (next , previous). instance, can enter 1000 in "goto" box , have 1000th item displayed. there disconnect between nth item , index - index guaranteed in order not guaranteed sequential can't filter index. thought using offset parameter of fetch , remember when first started programming using appengine told not use due performance issues. would offset best way go here, or there better way? also, costs associated take longer results, or count towards datastore reads/small operations? edit: don't mean in bad way in order stave off people tell me use cursors... :-) handle paging in way more useful me if use cursors. thank in advance concern. additionally, thought i'd spell o...

java - Copy class + package-context between projects in Eclipse -

for number of uninteresting reasons: need copy many classes 1 project (while preserving package-structure of said classes). in other words, given: origin/src/com/foo/bar/a origin/src/com/baz/qux/b dest/ <empty> we want copy , b such end with: dest/src/com/foo/bar/a dest/src/com/baz/qux/b presently, forced manually create packages in dest , ctrl+c/ctrl+v individual .java files between projects. have eclipse automatically copy files on while automatically creating packages (hence, preserving package structure). you can copy files between project folders using shell script. eclipse pick copied java files including package structure. if select files in source project in navigator window panel (not package explorer) should able ctrl+c/v whole file structure preserving packages new project.

javascript - Embed animated SVG in HTML page, paused (without starting animation) -

you can embed svg file into (x)html 5 document: <object data="anim.svg" id="svganim"/> or <img src="anim.svg" alt="embedded svg"/> but if anim.svg animated, animation start playing page loads. how can embed animated svg file such animation starts out paused? user can play animation pressing button (using unpauseanimations() in javascript) an inelegant way window.onload = function() { var svg_anim = document.getelementbyid('svganim').contentdocument.rootelement; svg_anim.pauseanimations(); }; disadvantage: doesn't work if embedded svg in different security context parent document. there better way? one way solve make animations not start automatically changing svg file (to add begin="indefinite" animations start automatically). these animations can triggered call beginelement() animation elements want trigger. if have many such elements, it's easier use pauseanimations() . however, <img...

android - Tab activities getting destroyed when switching -

Image
i have 3 tabs have created in fasion intent = new intent(this, testlistactivity.class); view tabview = createtabview(mtabhost.getcontext(), tag); tabspec setcontent = mtabhost.newtabspec(tag).setindicator(tabview).setcontent(intent); mtabhost.addtab(setcontent); in 1 of them have images loading web. problem if switch tabs , come i'm loading images on again. before images stayed there once loaded every time switch tabs activity destroyed. idea might have changed cause this? android - tab activities getting destroyed when switching - stack overflow stack overflow questions developer jobs documentation beta tags users current community help chat stack overflow meta stack overflow communities sign up or log in customize list. more stack exchange communities company blog tour start here quick overview of site center detailed answers questions might have meta discuss workings , policies of s...

module - Magento - Mage::getModel not working on Linux server -

i'm struggling issue can't find explanation. have 2 development environments use projects. created simple module magento , tested on 1 environment. after overcoming magento's complications, module works expected. on xampp. i copied module development linux environment, on hosted server, , crashes miserably. did debugging, , found out call mage::getmodel() returns bool(false) instead of instance of model requested. i double checked files , directories, , match. database not involved (not side, @ least, don't need tables) , both environments have me user, admin permissions. any suggestion on should start looking welcome, thanks. added on 2012/07/09 model contains class named diego_clientcustommodule_model_externaluserdata , invoked $model = mage::getmodel('clientcustommodule/externaluserdata'); . model file resides in diego_clientcustommodule\code\local\diego\clientcustommodule\model\ . curious thing is: if model file named externaluserdata.php , works. ...

ms access - SQL query to print mirror labels -

i want print labels in words returned sql query such follow. 1 2 3 4 5 6 when want print reverse of labels, have print them follow 3 2 1 6 5 4 in real case, have 5 colums 2 rows, how can formulate query records ordered second one. normal ordering handled word, query select * products order products.id i'm using ms access =( edit : just make clear i'd records ordered such 3 2 1 6 5 4 9 8 7 12 11 10 edit2 : my table looks this id productname 1 product1 2 product2 3 product3 n product[n] i want ids returned mentioned above select * products order products.id desc alternately if query @ moment giving this: select col1, col2, col3 products order products.id; why not use select col3, col2, col1 products order products.id;

cryptography - captive portal authentication theory -

i'm little confused on how captive portal authentication works. in implementations, after user authenticated login page, ip , mac address whitelisted , allowed connect through gateway. has problem of people spoofing mac addresses gain access. if portal sets session between , client, mean every piece of traffic client requests internet must go through portal's server? generally, security in captive portal not considered particularly important. however, there solutions lock mac first port use , disallow use of mac on additional port. similar techniques can used wirelessly, ap refuse pair additional client using same mac address existing client. requires enterprise authentication unique key negotiated each attached device. it's not clear me mean "the portal's server". generally, once mac address authorized , wired port configured or wireless connection established, nothing further needs done portal. traffic authenticated connections routed/natted normally. ...

eclipse - How to use cgo in Goclipse with Mingw? -

when try use cgo error exec gcc: exec: "gcc": executable file not found in %path% i have mingw installed. how tell goclipse gcc is? not find way in preferences or properties set this. add path mingw gcc windows path environment variable. setting environment variables under windows

Python Tkinter: Delete the Last Character of a String -

i making entry allows numbers entered. stuck on deleting character entered if character not integer. if replace the "blank" needs go in there lot of help. import tkinter tk class test(tk.tk): def __init__(self): tk.tk.__init__(self) self.e = tk.entry(self) self.e.pack() self.e.bind("<keyrelease>", self.on_keyrelease) tk.mainloop() def on_keyrelease(self, event): #check see if string consists of integers if self.e.get().isdigit() == false: self.e.delete("blank", 'end')#i need replace 0 last character of string else: #print string of integers print self.e.get() test = test() you change line above well, this: if not self.e.get().isdigit(): #take string in widget, way last character txt = self.e.get()[:-1] #clear widget of text self.e.delete(0, tk.end) #insert new string, sans last character self.e.insert(0, txt) or: if not self.e.get().isdigit(): #get length of string in widget, , subtract one, , delete end self.e.delete(len(self.e.get...

java - Making sure JAVA_HOME is correctly set -

pretty new java , mac ... want make sure java_home set in other programs can use path. did googling , here got: if enter /usr/libexec/java_home in terminal this: /system/library/java/javavirtualmachines/1.6.0.jdk/contents/home if enter echo $java_home in terminal, don't back. can please tell me going on in here? thanks. java_home isn't set default on osx. can resolve opening terminal , executing following: echo "export java_home=`/usr/libexec/java_home`" >> ~/.profile . ~/.profile this cause java_home set on startup (rather current session), , add it.

android - There's no main.xml in /res/layout -

i've started reading "building first app" in developer.android.com. when start creating different ui, refer /res/layout/main.xml file. can't find - under /res/layout there's activity_first.xml file ( activity' s name firstactivity ). i've read might because of api16, same problem api15. any ideas? thanks! :) i use eclipse 3.7.2 ( indigo ) on linux debian, if matters in new adt 20 ,there activity_main if activity name mainactivity i think activity_first.xml main.xml. .see in activity have setcontentview(r.layout.activity_first);

python - Casting a c_char_p to a c_char array -

i need access contents of char* casting array here's demo: from ctypes import * foo = (c_char * 4)() foo.value = "foo" print foo.raw # => 'foo\x00' foo_ptr = cast(foo, c_char_p) print foo_ptr.value # => 'foo' now want convert foo_ptr (c_char * 4). neither of these work foo_ = (c_char * 4)(foo_ptr) foo_ = cast(foo_ptr, c_char * 4) found it foo_ = (c_char * 4).from_address(foo_ptr._get_buffer_value()) print foo_.raw # => 'foo\x00'

analytics - android runtime analysis tool -

what android runtime analysis tools available free? i looking tool me analyze algorithm have running in android application. have not been able find 1 free works android. have found few java, did not see tutorials or how-to's on how them work android. here of things wanting tool. execution time time spent in methods number of times method called loop iterations thanks! take @ profiling traceview , dmtracedump

jquery call function on click -

i facing problem calling function on click. following code: javascript: $(document).ready(function(){ function showmessage(msg) { alert(msg); }; }) html: <input type="button" value="ahaha" onclick="$(this).showmessage('msg');" /> for reasons cant use click() function. please me. a few things: showmessage() isn't property of jquery object. it's regular function. if you're using jquery, don't use onclick . bind events javascript. there few ways of fixing code. here's one: javascript : $.fn.showmessage = function(message) { alert(message); }; $(document).ready(function() { $('#button').on('click', function() { $(this).showmessage('i message'); }); }); html : <input type="button" value="ahaha" id="button" />