Posts

jquery - trying to get an element's position, but it's always 'undefined' -

i'm trying # use in scrolltop function, 'undefined' have gone wrong? <html><head><meta http-equiv=content-type content="text/html; charset=utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.1/jquery.mobile-1.4.1.min.css"> <script src="http://code.jquery.com/jquery-2.1.0.min.js"></script> <script src="http://code.jquery.com/mobile/1.4.1/jquery.mobile-1.4.1.min.js"></script> </head><body> <div data-role="page" id="page5" data-theme="c"> <br><br><br><br> <p><span id="1.11.13">1.11.13</span> lots of text here... </p> <script> $(window).on('pageinit', function() { console.log($('#1.11.13').css('top')); //undefined conso...

linux - how to delete couchbase bucket data from node's file system? -

i using cluster of couchbase servers couchbase-server-enterprise_2.5.0_x86_64 comprised of there nods. result of writing many recorders bucket, i've exceeded cluster memory , nodes went down. i tried rebooting machine node , restarting won't start. reason has many data. clear bucket removing it's data disk, can't seem find location data stored on disk in couchbase. can point me right direction? data couchbase (assuming linux) stored at: /opt/couchbase/var/lib/couchbase/data when 'too many recorders bucket' mean? because have data larger ram amount doesn't mean node should go down, means not documents available in ram , node have fetch disk (slower). unless you've exceeded cluster capability huge margin don't think cause. i investigate before wiping data on node + backing data up. you can @ logs located at: /opt/couchbase/var/lib/couchbase/logs how ram each of servers have , how assigned couchbase?

php - How enable apache caching but allow changing the cache when file is changed (for that one file)? -

after enabling cache settings in httpd.conf, unable see changes make file (from index.php style.css in theme files). nothing causes apache/php/wordpress serve new version of file. thing works turning off caching (by removing httpd.conf , restarting apache). cacheenable disk / cacheroot /webapps/cache/app1 cachedefaultexpire 3600 cachedisable /wp-admin cachedirlevels 3 cachedirlength 5 cacheignorecachecontrol on cachemaxfilesize 1000000000 cacheignorenolastmod on cachemaxexpire 1209600 but that's not how want caching work. if file changed, should serve new version. how enable work , change cache version when alter file?

android - custom adapter with ArrayList<HashMap<String, List<String>>> -

its complicated question, hope can me. i want make custom adapter can handle array list mentioned in title currently doing this, not going getview(...) method. public class eventsadapter extends baseadapter{ arraylist<hashmap<string, list<string>>> eventlist; private context context; private int resource; private static final string tag_title = "e_title"; public eventsadapter(context context, int resid,arraylist<hashmap<string, list<string>>> eventlist) { this.context = context; this.resource = resid; this.eventlist = eventlist; log.v("chk", "1"); } @override public view getview(int position, view convertview, viewgroup parent) { view event = convertview; textview title, desc, date, time, venue; hashmap<string, list<string>> hm = eventlist.get(position); list<string> items = hm.get(tag_title); typeface font = typeface.createfromasset(con...

database - Non spatial indexes in Oracle -

i'm trying create non-spatial index on 2 columns, 1 of geometry column (sdo_geometry). appears documentation possible i'm unable create one. an excerpt oracle documentation: for each spatial column in non-spatial index except point columns, column prefix length must specified. (this same requirement indexed blob columns.) prefix length given in bytes. here's query i'm trying execute create index: create index multiple_column_index on testdb (id, shape) tablespace test; the shape column geometry column here. error i'm receiving is: sql error: ora-02327: cannot create index on expression datatype adt 02327. 00000 - "cannot create index on expression datatype %s" *cause: attempt made create index on non-indexable expression. *action: change column datatype or not create index on expression datatype 1 of varray, nested table, object, lob, or ref. i've not applied column prefix here couldn't find do...

c - Preorder Postorder Tree Traversal when RSON and LSON are given -

if input this 1111010000000 //lson gerlwidakonth //data 1101101000110 //rson it should output preorder , postorder of given tree. the problem is: program doesn't print correct postorder , can't figure out why. hope me. preorder correct okay me if want add improve codes. thank you!:d #include<stdio.h> #include<stdlib.h> #include<string.h> #define size 5 #define case 3 #define n 100 struct node{ char data; struct node* llink; struct node* rlink; int tag; }; typedef struct node node; typedef node* nodeptr; void twopreorder(int *counter, int *size, nodeptr *a, nodeptr *b, nodeptr *o); void threepreorder(int *counter, int *size, nodeptr *a, nodeptr *b, nodeptr *o); void twopostorder(int *counter, int *size, nodeptr *a, nodeptr *b, nodeptr *o); void threepostorder(int *counter, int *size, nodeptr *a, nodeptr *b, nodeptr *o); void printsequence(char *array[3], int size){ int i; printf("ltag: "); for(i = ...

python - Removing quotes from keys of dicts when rendering to template -

is possible remove quotes on keys during rendering dict render_to_string function key:value , not 'key':value in template? for example if dict: d = {'a':1, 'b':2} and render this, return render_to_string('somefile.json', {'d':d}) then in somefile.json {{d}} {'a':1, 'b':2} , want {{d}} {a:1, b:2} . (without quotes on a , b ) how achieve this? tia one approach use overriding __repr__ method of dict class or subclassing , changing method there. have latter solution below. class mydict(dict): def __repr__(self): s = "{" key in self: s += "{0}:{1}, ".format(key, self[key]) if len(s) > 1: s = s[0: -2] s += "}" return s mydict({'a': 1, 'b': 2}) {a:1, b:2}