Posts

objective c - How to work with plist in several threads -

i have simple multithread application 2 tabs. each tab table view number of items, information them saved in plist file structure this: <key>items</key> <array> <dict> <key>name</key> <string>bosch kgn36x45</string> <key>price</key> <string>18890</string> <key>quantity</key> <real>33</real> </dict> i need work file in several threads, example in 1 thread can remove item code: - (void)removeitematrow:(int)row { [items removeobjectatindex:row]; nsmutabledictionary *plistdict = [nsdictionary dictionarywithobject:items forkey:@"items"]; [self saveappfile:plistdict]; } and can open item in other view controller edit: - (void) updateviews { nsdictionary *item = [[[datacontroller sharedinstance] getitems] objectatindex:itemrow]; nslog(@"%@", item); self.namelabel.text = [item obje...

html - How to centralize div crossbrowser -

i know way in css center div in without being dependent set margin-top , down, control height magic numbers. the forms have learned these disadvantages, better , worse, dependent on something, , permanent solution browser (at least ie8+). i want centralize horizontally , vertically div element without magical numbers. height of div grow dynamically , automatically calculated , centralized. to clarify, example of not want. use widht , height defined leaves no flexibility, , have manipulating height added each item using js. http://jsfiddle.net/qswfg/ <div id="container"></div> #container { position: absolute; width: 380px; height: 360px; left: 50%; top:50%; padding: 30px; margin-left: -220px; margin-top: -210px; background: #000; } like this? codepen example: http://cdpn.io/budlo html <div class='modal-overlay'> <div class='modal-box'></div> </div> css .modal-overlay { background: b...

android - Shall I ignore this exception from user -

just got crash report exception stack trace: java.lang.nullpointerexception @ com.google.ads.internal.c$a.run(sourcefile:128) @ android.os.handler.handlecallback(handler.java:587) @ android.os.handler.dispatchmessage(handler.java:92) @ android.os.looper.loop(looper.java:150) @ android.app.activitythread.main(activitythread.java:4385) @ java.lang.reflect.method.invokenative(native method) @ java.lang.reflect.method.invoke(method.java:507) @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:849) @ com.android.internal.os.zygoteinit.main(zygoteinit.java:607) @ dalvik.system.nativestart.main(native method) is ok ignore exception 1 off. in thread 1 eric l, developer @ admob, seems recognize crash bug in sw.

html - Internet Explorer Print Preview different results from same page -

i'm developing web site, 1 of pages it's collection of divs. each div must printed 1 per page. i'm setting width/height of each div this: body .htmltemplate{ height:1140px; padding:0px; margin:auto; width:840px; } it seems work. before 1140px, had 1098px, divs jumped pages, changed 1140px the problem every once in while (let 1 of 6), printpreview shows half (or so) of width, , portion of height goes next page, have double pages print. in example, if have 40 divs, 80 pages. i've noticed when problem occurs, cpu usage in task manager jumps 100% do have idea of causing problem??? missing css attribute (i've tried page-break no luck)??? thanks in advance

Target certain words with CSS? -

this kind of theory question wonder whether possible or not. so if have div content like... <div>£100.00 - buy</div> can target "£100.00" without targeting rest? so can increase font size of £100.00? you target wrapping in span element: jsfiddle example <div><span class="price">$100.00</span> - buy</div

pass javascript variables into grails params -

so need pass javascript variables grails parameters build , download file. did ajax learn ajax doesn't downloads. worked so: <script type="text/javascript" charset="utf-8"> function myfunction() { jquery.ajax({ url: "search/download", type: "post", data: {facets: visualsearch.searchquery.facets()} }); } </script> <input type="button" onclick="myfunction()" value="download"> while passed mapping correctly, didn't downloads. so want similar g:link <g:link controller="search" action="test" params="[facets: '\$(visualsearch.searchquery.facets())']" >test grails</g:link> but in params in controller are facets=$(visualsearch.searchquery.facets()) action=test controller=search how can fix pass facets (whether parsed or unparsed) controller. thanks! adding jav...

ruby on rails - Efficient way to Add/Update or Delete with RoR -

i need loop through series of updates either involve adding / updating record, or removing it. updates need carried out in order, couldn't bulk delete @ end. is there efficient / quick way achieve through rails. currently i'm envisaging looping through updates. if it's delete request, deleting it. if it's not, searching it. if exists, updating. if doesn't, adding. i don't think, when dealing thousands of updates, going pleasant wondering if there more efficient way go process? you can try destroy_all delete_all update_all conditions/scopes like: user.where(:active => false).destroy_all