Posts

c# - Ajax TabContainer tabs not working after issues with visibility -

at first having problems forcing tabcontainer show. apparantly caused render 'style="visibility: hidden"' on runtime. fixed adding style="visibility:visible" tabcontainer. looks now: <asp:tabcontainer id="tabcontainer1" runat="server" style="visibility:visible"> <asp:tabpanel id="tabpanel1" headertext="tab 1" runat="server"> <contenttemplate> contents of tab 1 <br /> contents of tab 1 <br /> contents of tab 1 <br /> </contenttemplate> </asp:tabpanel> <asp:tabpanel id="tabpanel2" headertext="tab 2" runat="server"> <contenttemplate> contents of tab 2 <br /> contents of tab 2 <br /> ...

python - how to sort the items in QListWidget by drop and drag -

i newer pyqt, using write gui, please tell me how sort items in qlistwidget drop , drag? thanks in advance qlistwidget inherits qabstractitemview . can use qabstractitemview.setdragdropmode() , set qabstractitemview.internalmove if you'd able change order of items drag & drop. here's relevent section of documentation . here's quick example showing in action: import sys pyqt4.qtgui import qapplication, qwidget, \ qvboxlayout, qlistwidget, qabstractitemview class widget(qwidget): def __init__(self, parent=none): qwidget.__init__(self, parent) self.widget_layout = qvboxlayout() # create listwidget , add 10 items move around. self.list_widget = qlistwidget() x in range(1, 11): self.list_widget.additem('item {:02d}'.format(x)) # enable drag & drop ordering of items. self.list_widget.setdragdropmode(qabstractitemview.internalmove) self.widget_layout.add...

python - urllib.urlopen returns an old page? -

so have simple html page (a dir listing) , try read urllib, way: page = urllib.urlopen(corerepositoryurl).read() the problem is, html read way older newest. info() returns me this: date: fri, 19 apr 2013 18:48:09 gmt server: apache/2.0.52 (fedora) content-type: text/html; charset=utf-8 connection: close age: 481084 and page last updated today (2013-04-25). component might 1 caches? add header "cache-control" value "max-age=0" in request import urllib2 req = urllib2.request(url) req.add_header('cache-control', 'max-age=0') resp = urllib2.urlopen(req) content = resp.read() using header each cache along way revalidate cache entry

css - Make centered DIV inside wide DIV expand with content width -

i'm using 2 divs, parent , child. parent has width of 100% , contents text-align'ed center. the child div should have width of 0 (or close it) , expand width automatically contents, while still being centered in parent div. example: +------------ parent div ------------+ | | | ..some content.. | | | | +--child div--+ | | |inside child | | | +-------------+ | | | +------------------------------------+ +------------ parent div ------------+ | | | ..some content.. | | | | +------ child div ------+ | | |inside child more | | | +-----------------------+ | | | +------------------------------------+ if put fixed width child div, can center correctly:...

javascript - onhashchange event casuing invalid markup validation -

hope don't sound idiot posting using: <body onhashchange="hashchangehandler();"> is causing invalid markup validation. is there somewhere else can put other body tag? i know there's window.onhashchange = funcref; or window.addeventlistener("hashchange", funcref, false); have no idea put it, if makes sense. the site still works invalid markup flag bugging me! i know there's … have no idea put it, if makes sense. in <script> element. that's all. <script> function thingy(e) { alert('changed'); } window.addeventlistener("hashchange", thingy, false); </script>

mysql - Data Synchronisation among clients -

i have database server (mysql). this holds table of products. 1 of field of products table remaining quantity. i have few clients (around 10) querying remaining quantity while placing order. once order placed remaining quantity decreased based on order. i face problem when quantity low: example if remaining quantity "10" , client1 creating order 8quantity(order not yet placed, in process ) , client2 places order 5 quantity, client places order latter fail. i want improve system such when 1 client in process of ordering, other clients should shown (remaining quantity - client1 order quantity). thought of altering remaining quantity entered in order table, creates problem when order cancelled or computer placing order powered off / crashed. please suggest me suitable algorithm handle case effectively.. whenever order in progress, other clients should see (remaining quantity - order in progress quantity). one answer might in question: other clients sho...

google app engine - Store java.util.List into GAE Datastore -

this idea of storing json , json-like documents "natively" gae datastore: protected void createentity(key parent, map obj){ try { entity e = new entity( parent == null ? createkey(_kind, (string) obj.get(object_id)) : parent); iterator = obj.keyset().iterator(); while (it.hasnext()){ string key = (string) it.next(); if (obj.get(key) == null){ e.setproperty(key, null); } else if (obj.get(key) instanceof string) { setproperty(e, key, obj.get(key)); } else if(obj.get(key) instanceof number) { setproperty(e, key, obj.get(key)); } else if(obj.get(key) instanceof boolean) { setproperty(e, key, obj.get(key)); } else if(obj.get(key) instanceof list) { // problem area, right way store list? // list may contain jsonobject too! } else if(obj.get(key) inst...

arrays - Does element.childNodes[] behave as a link list in javascript? -

i have element object , has children appended via appendchild(node) method,i know can access them element.childnodes[index] . now if remove element selecting them id element @ index i+1 @ index i if removed 1 @ index i ? secondly there way remove object array specifying indices via built in method achieve linked list behaviour(i mean without having copy elements index prior index when remove 1 prior them)? 1) yes 2) try array.splice : > = [0,1,2,3,4,5] [0, 1, 2, 3, 4, 5] > a.splice(3, 1) [3] > [0, 1, 2, 4, 5] don't know if arrays or nodelists implemented linked lists or else. depends on engine guess.

c# - iTextSharp DataMatrix barcode capacity -

i have specification implement datamatrix barcodes using 16x36 size. i'm using c# itextsharp library has barcodedatamatrix class. given these barcode dimensions, specified capacities are: numeric: 64 alphanumeric: 46 byte: 30 this taken site: http://www.barcodephp.com/en/2d/datamatrix/technical the requirement store 46 character string in 16x36 symbol. i'm having hard time understanding how can encode 46 byte string in such way fits 30 bytes.

How to migrate from old dojo require to the new dojo AMD loader? -

i want migrate old dojo.require loader new amd loader changed this: dojo.require("dojo._base.xhr"); dojo.require("dojox.mobile.parser"); dojo.require("dojox.mobile"); dojo.require("dojox.mobile.scrollableview"); dojo.require("dojox.mobile.tabbar"); dojo.require("dojox.mobile.textbox"); dojo.require("dojox.mobile.compat"); dojo.require("dojox.mobile.devicetheme"); dojo.require("dojox.mobile.tabbarbutton"); dojo.require("dojox.mobile.view"); dojo.require("dojox.mobile.button"); dojo.require("dojox.mobile.switch"); dojo.require("dojo.on"); dojo.require("dijit.registry"); dojo.require("dojo.aspect"); dojo.require("dojo.ready"); dojo.require("dojox.mobile.listitem"); dojo.requ...

osx - What do the different exception codes in OS X / iOS Crash reports mean? -

in apple crash reports, there 2 lines providing exception type , exception codes crash report. know these codes mean? there self-explaining ones ones, kern_invalid_address : for example, 1 null pointer dereference : exception type: exc_bad_access (sigsegv) exception codes: kern_invalid_address @ 0x0000000000000000 if made error pointer arithmetic, you'll end similar: exception type: exc_bad_access (sigsegv) exception codes: kern_invalid_address @ 0x00007fff50399000 but there lots of these exception codes! example, here's 1 encountered , have no clue means (the address points big memory-mapped file): exception type: exc_bad_access (sigbus) exception codes: 0x000000000000000a, 0x0000000137676004 all found crash reports this technote , no detailed reference how interpret exception codes. a list of exception codes can found in xnu source . 0x000000000000000a kern_mem0ry_error: #define kern_memory_error 10 /* during page fault, memory ob...

python - Eliminating Unwanted characters -

how eliminate characters like, e.g. “it , in word these characters causing python program fail. how handle these characters, input file has lots of them. please help. thanks that looks utf-8 being misinterpreted different encoding. try: fixed_input_string = input_string.decode('utf-8') and see if solves problem. btw, if have no idea said, read http://www.joelonsoftware.com/articles/unicode.html right now . if try write software accepts "english" text (which means ascii, there plenty of characters used in standard english text aren't in ascii), software going fail in kinds of "interesting" ways. unicode isn't going away, , you'll have learn sometime -- time start.

recursion - Java Square function -

would able explain these methods few comments line. squaring number. 1 using recursion, implementation , normal public static int sq(int n) { int = 0 ; int result = 0 ; while(i < n){ result = result + 2*i + 1 ; = + 1 ; } return result ; } public static int recsq(int n) { if(n == 0){ return 0 ; } else { return recsq(n - 1) + 2*(n - 1) + 1 ; } } public static int implementsq(int n) { int ; int result = 0 ; for(i = 0 ; < n ; i++){ result = result + 2*i + 1 ; } return result ; } the first 1 multiplying number 2 n times using loop increase local variable i. the second 1 doing same using recursion. each step decreasing n , returning 0 final case. calls calling again same function different parameters exept parameter value 0, function return 0. recursion not simple thing think off, understand better try imagine codeflow. example: recsq(2) 4 recsq(2) ...