Posts

Showing posts from February, 2013

ios - Clear modal views from memory -

i'm having problem storyboard has beside navigation controller modal views separate them main "route" in app. when press button modal segue opens other view. the problem is: when go navigation controller , press button open modal view again, creates new instance of view controller without deleting old one. is possible clean memory when leaving modal view or something? i found solution: when finished separated modal view part, use [[self presentingviewcontroller] dismissviewcontrolleranimated:yes completion:nil]; , app goes last view controller, in case uinavigationcontroller. , this, deallocates old views.

java - Can you list interface methods in the service registry OSGI -

i have osgi bundles provide services , require services . if have service implements interface , interface provides variety of methods can have reference these methods in service registry or somewhere other bundles can aware of these methods. if service implements interface method on interface implemented service, definition in java. other bundle knows service (and interface) aware of these methods. if want advertise bundles not know interface, register properties. however, definition accessing methods require reflection. in general not way go in java, nicer stay type safe , use interface anchor.

authentication - Security model: log in to third-party site with user's credentials -

Image
i develop service (service) automates actions users can on third-party site (3rd party site). my service provides following functionality users: the user registers @ service the user provides his/her 3rd party site username/password service the service uses credentials log in 3rd party site on user's behalf the service stores cookie issued 3rd party site in database from on, service starts log in 3rd party site regularly (cron) on user's behalf using stored cookie (the username/password 3rd party site not saved anywhere) , performs actions on users behalf on 3rd party site notes: before registering on service, user presented full information describing interaction between service , 3rd party site there value in automating user's login 3rd party site , users interested in automating logins , actions on 3rd party site, i.e. interested in service doing work them @ 3rd party site there no oauth functionality on 3rd party site there no user authenticat

objective c - Segue causes breakpoint when clicking the cell to Detail view -

the cell in collection view causes breakpoint when clicked show larger image in detail view. cells display images should detail view isn't displaying image. if need more info form part, let me know. clues provided are. (lldb) { @autoreleasepool { return uiapplicationmain(argc, argv, nil, nsstringfromclass([appdelegate class])); [breakpoint] } } code generates cell information , passes through segue. - (uicollectionviewcell *)collectionview:(uicollectionview *)cv cellforitematindexpath:(nsindexpath *)indexpath; { // code custom cell created: cell *cell = [cv dequeuereusablecellwithreuseidentifier:kcellid_biffy forindexpath:indexpath]; // load im

php - How to pass an array of string using ajax? -

i'm using ajax pass array of strings page. this array on nomes.php [ 'home','a empresa','funcionarios','quem somos?','historia','inicio',] this code, alert doesn't work - can help? $.ajax({ type: 'post', url: 'nomes.php', beforesend: function(x) { if(x && x.overridemimetype) { x.overridemimetype("application/j-son;charset=utf-8"); } }, datatype: "json", success: function(data){ v=data; alert(v); } }); you need encode php-array json-array. <?php echo (json_encode($myphparray)); ?>

vba - Putting all elements of an array variable onto their own line in a message box -

Image
the code below fragment of macro i'm writing alert users may not have sufficient number of compatible installation equipment on order. n shortfalls (i.e., each instance of equipment item not having compatible installation equipment saved in yankees() array in elements 1 n. want prompt users message box stating "please review order ensure have sufficient compatible installation equipment- detected following shortfalls" and below that include each element of yankees(1 n) on separate lines in message box 2 options below "this okay, i'll submit order now" , "let me go back,i want modify order". how can create such message box? i have: msgbox "please review order ensure have sufficient compatible installation equipment- detected following concerns" & yankee(1), vbokcancel currently includes first shortfall. how can include elements of yankee() , put them on own line? this question boils down to: "how put non-bl

database - Slick lifted update on an Object -

i updates on lifted entities using slick. code updates firstname of contact object: def updatecontact(id: int, firstname: option[string]): unit = { val q1 = { c <- contacts if c.id id } yield c.firstname // update value same or new value q1.update(firstname.getorelse(q1.list().head)) } the option here useful updating value in case (although nicer if update happened if there new value). what looking way query object id, updates in memory using getorelse , update on whole object. else have run above each field of object works know, feels dirty hack. instead of q1.update(firstname.getorelse(q1.list().head)) can write firstname.foreach{ fn => q1.update(fn) } shorter, simpler, 1 instead of 2 queries :). using foreach on option stops looking weird when think of collection 1 or 0 elements. regarding idea fetch whole object, modify , save back, can this: def updatecontact(id: int, firstname: option[string], lastname:option[string], ...): unit

charts - Add a vertical line marker to Google Visualization's LineChart that moves when mouse move? -

is possible display vertical line marker showing current x-axis value on linechart, , moving when mouse moves ? thanks in advance. while difficult before, recent update api makes easier! need use mouseover event handler mouse coordinates , new chartlayoutinterface translate coordinates chart values. here's example code: [edit - fixed cross-browser compatibility issue] * [edit - updated value of points near annotation line] * function drawchart() { // create , populate data table. var data = new google.visualization.datatable(); data.addcolumn('number', 'x'); // add "annotation" role column domain column data.addcolumn({type: 'string', role: 'annotation'}); data.addcolumn('number', 'y'); // add 100 rows of pseudorandom data var y = 50; (var = 0; < 100; i++) { y += math.floor(math.random() * 5) * math.pow(-1, math.floor(math.random() * 2)); data.addr

Twitter Bootstrap Horizontal Form to Vertical Form on different viewports -

Image
form above looks great on desktop version on tablet , mobile, marketing needs these labels (name, sku & id) on top , text boxes (name, sku & id) on bottom. bootstrap provides classes or tweaking that? appreciated guys. thx. following bootstrap css, <div class="text-left"> <div class="span12"> <div> <h3 id="header">list of active products</h3> </div> <div class="row-fluid control-group form-inline"> <div class="span3"> <label for="productname">name:</label> <div class="input-append"> <input type="text" class="input-small search-query" placeholder="name..." id="productname" /><a href="#"><span class="add-on"><i class="icon-search icon- white"></i></span></a> </div> </div> <div class="span3"

c# - onCreateDrawableState Never Called -

all, i've got viewgroup subclass overrides oncreatedrawablestate() (xamarin.android in c# forgive pascal casing). my override of oncreatedrawablestate() never gets called, however. i've tried calling refreshdrawablestate() , drawablestatechanged() . requestlayout() , , invalidate() . nothing seems work. method: /// <summary> /// handles create drawable state event adding in additional states needed. /// </summary> /// <param name="extraspace">extra space.</param> protected override int[] oncreatedrawablestate (int extraspace) { int[] drawablestate = base.oncreatedrawablestate(extraspace + 3); if (completed) { int[] completedstate = new int[] { resource.attribute.completed }; mergedrawablestates(drawablestate, completedstate); } if (required) { int[] requiredstate = new int[] { resource.attribute.required }; mergedrawablestates(drawablestate, requiredstate); } if

validation - Rails validate multiple attributes lambda only if all of them present -

i need validate few attributes in model when present in params while updating or creating object. validates :attribute_a,format: {with: /some_regex/}, :if => lambda{ |object| object.attribute_a.present? } like attribute_a there multiple attributes may not present while being created or updated .instead of writing validates statement each of them,is there way in can check presence of multiple attributes , validate every 1 common validation such inclusion_in or format:{with:/some_regex/ } . i wanted following code wrong. validates :attribute_a,attribute_b,attribute_c,attribute_d,:format => {:with => /some_regex/}, :if => lambda{ |object| object.attribute_name.present? } you can use validates_format_of : validates_format_of :attr_a, :attr_b, with: /someregexp/, allow_blank: true the allow blank option means regexp doesn't have match if attribute not present.

lambda - linq query with dynamic predicates in where clause joined by OR -

you can create dynamic queries in c# if add more restrictions current query. var list = new list<item>(); var q = list.asqueryable(); q = q.where(x => x.size == 3); q = q.where(x => x.color == "blue"); in case, every new predicate added performing , operation previous. previous result equivalent to: q = list.where(x => x.size == 3 && x.color == "blue"); is possible achieve same result or instead of and? q = list.where(x => x.size == 3 || x.color == "blue"); the idea have variable number of expressions joined or operator. expected result need written in how similar following pseudo code: var conditions = new list<func<item, bool>>(); and later iterate conditions build like: foreach(var condition in conditions) finalexpression += finalexpression || condition; thanks raphaël althaus gave following link: http://www.albahari.com/nutshell/predicatebuilder.aspx predicate builder soluti

Updating asp.net application with jquery ajax, having difficulty with storing session variables -

i have asp.net application updating use jquery ajax calls web service return json rather having gridview perform rendering. the contents of grid controlled various radio buttons. presently application set perform postback when radio button changed, store selected value in session , rebind data grid. the values held in session page 'remember' criteria used , reapply them if user navigates separate page in application , navigates grid. i have amended use knockout js handle data binding , presentation. viewmodel calls asmx web service returns json needs displayed. far good. i stuck set session variables - when jquery ajax call made web service web service has no current session can't store variables here. i don't think jquery / javascript can save session variables i'm bit stuck. anyone have ideas? many thanks chris

cmd - Open a .Bat Using Java Apllication -

i'm trying open cmd using java + applying code open .jar applications output shown in .bat file. can tell me how it? this code got,it run excecute file cmd doesnt show. btntest.addactionlistener(new actionlistener() { public void actionperformed(actionevent arg0) { string bat = "c:"+file.separatorchar+"users"+file.separatorchar+"gebruiker"+file.separatorchar+"appdata"+file.separatorchar+"local"+file.separatorchar+"temp"+file.separatorchar+"hext"+file.separatorchar+"run.bat"; runtime rt = runtime.getruntime(); try { rt.exec(bat); } catch (ioexception e) { // todo auto-generated catch block e.printstacktrace(); } } }); edited: works me: string bat = "c:\\app.bat"; //try use \\ path seperator try { runtime.getruntime().exec("cmd /c start &qu

ria - offline web application using JavaFX -

html5 support offline web application.i want create offline web application using javafx. has example related same? the documentation of javafx mentions how can this: http://docs.oracle.com/javafx/2/overview/jfxpub-overview.htm#cjacgdde first learn bit how packaging , deployment works. know how work examples. you can find tutorials include examples code here: http://docs.oracle.com/javafx/index.html (take @ packaging , deployment in deployment , more section.)

How to import a UML pattern in Enterprise Architect -

i'm new using ea, , wondering how can import gof pattern. have found seemingly outdated procedure import uml pattern. http://www.sparxsystems.com/resources/developers/import_uml_patterns.html and uml patterns seem here well: http://www.sparxsystems.com/resources/developers/uml_patterns.htm can give me better instructions on how this. when try follow instructions tells me "switch project resource tab." don't see, don't "import uml pattern" option. these instructions using seemingly non-existent options (in latest enterprise architect). the project resources tab accessed in project menu (alt-6). i can't remember if gof patterns bundled editions of ea if they're not, should able download them sparx' site. applying pattern matter of dragging onto diagram resources tab; diagram toolboxes include relevant patterns.

Create a Correlation Matrix From a Correlation Vector in R -

Image
i want create correlation matrix given correlation vector, upper (or lower) triangular matrix of correlation matrix. the goal transform vector to correlation matrix 1s on diagonal. do know if there method creating matrix given triangular above diagonal , set diagonal 1? i don't know if there automatic way this, expanding on comment: myvec <- c(-.55, -.48, .66, .47, -.38, -.46) mempty <- matrix(0, nrow = 4, ncol = 4) mindex <- matrix(1:16, nrow = 4, ncol = 4) mempty[mindex[upper.tri(mindex)]] <- myvec mempty[lower.tri(mempty)] <- t(mempty)[lower.tri(t(mempty))] diag(mempty) <- 1 mempty # [,1] [,2] [,3] [,4] # [1,] 1.00 -0.55 -0.48 0.47 # [2,] -0.55 1.00 0.66 -0.38 # [3,] -0.48 0.66 1.00 -0.46 # [4,] 0.47 -0.38 -0.46 1.00 here's hacked function. hope mathematics steps correct! vec2symmat <- function(invec, diag = 1, byrow = true) { nrow <- ceiling(sqrt(2*length(invec))) if (!sqrt(length(invec)*2 + nrow)

xml - An item of type 'Attribute' cannot be constructed within a node of type 'Root -

i'm trying figure how add attribute root node. have following xslt transform 2 different types of xml files. 1st xml file transformed fine have problem when second xml file xslt throws error "an item of type 'attribute' cannot constructed within node of type 'root" how fix in xslt xslt file <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"> <xsl:output method="xml" indent="yes"/> <!--check whether lossformsversion exists if not write--> <xsl:template match="inspection[not(@lossformsversion)]"> <xsl:attribute name="lossformsversion">07-25-2013-1-54</xsl:attribute> </xsl:template> <!--replace lossformsversion templates version--> <xsl

go - Output all language strings in Revel? -

i'm developing api server in go , server (at moment) handles translations clients. when api client fetches particular data asks translations available given section. ideally want have following folder structure: /messages /home.en /home.fr /home.sv /news.en /news.fr /news.sv where news , home distinct modules. now question have revel is possible fetch language strings given module , given locale? example pull home strings en-us. edit: i output (something can return client) key:value string of translations. any guidance appreciated. it seems me revel uses messaged based translation (just gettext does), need original string translation. these strings stored in config objects, stored in messages of i18n.go , sorted language. as can see, mapping not exported, can't access it. best way fix write function want (getting config supplying language) or exporting 1 of existing functions , create pull request revel. you may workaround copying

android - view.invalidate not working on phone -

i have custom view, made of several view , label components. when user touches view, draw frame around view indicate selected status, , background changes on double tap. frame drawn using overridden draw function of view passing view frame color different background , calling view.invalidate(). same background change. this used work long developing api 7. on phone runs api 16. migrated code api 11+ , selected frame not showing anymore , background not change on phone though still working in emulator (api 14). a afternoon of trying trace error is, figured out on phone, calling view.invalidate() not triggering redraw of view. tried view.requestlayout() , view.postinvalidate() (just make sure) same result. putting invalidate command in separate thread did not work either. to summarize: code api 7 - phone api 16 - emulator api 7 14 view.invalidate works code api 11 - phone api 16 - emulator api 11 14 view.invalidate not work on phone on emulator. i have motorola razr m verizo

dynamic - python load module from built-in -

i'm using python 3, , have module named "http" (mypackage.http) , , have module called foo, want load built-in http module (not mypackage.http module) i can use imp.find_module('http', sys.path[1:]) for built-in __ init__.py importlib path example: /usr/local/cellar/python3/3.3.2/frameworks/python.framework/versions/3.3/lib/python3.3/importlib/__ init__.py but use of imp.find_module()/load_module() deprecated. how can import built-in http module way importlib ? project example: mypackage _ init _ .py http.py (has related http classes, etc) foo.py (needs use built-in http , not mypackage.http) thanks! just use import http in python 2, wouldn't have worked if foo in mypackage , relative imports need explicit in python 3. if you're running module script, you'll need fix path somehow. if mypackage findable using normal import mechanisms, can run module -m switch: python -m mypackage.foo otherwise, ma

excel - Pasting a control-c selection as links with VBA -

i'm trying paste user-copied selection (marching ants, not black-bordered) links, won't give me values. i've tried number of ways, example: this_ws.activate this_ws.range("a1").select activesheet.pastespecial link:=true it paste, , without error, invariably gives me values instead of links. my ultimate goal convert user-provided selection regular range. research , experiments far imply way sanely (for values of "sane") paste links in temporary tab , harvest information necessary create equivalent range links. (other, more headache-inducing ways involve dataobject or monitoring sheet selection changes .) update: according microsoft, "if source data isn't suitable linking or source application doesn't support linking, parameter ignored." why source data not "suitable"? it's macro-enabled workbook, left open , strings , ints in copied selection. update2: clarify, looking duplicate (in vba) functi

dojo - How to correct icon alignment for an xe:toolBarButton in the actionFacet of the Page Heading? -

Image
the following image shows proper alignment mbldombuttonwhiteplus icon xe:toolbarbutton on left, not on right in xe:djxmheading. here source page heading control: <xe:djxmheading id="djxmheading1" label="apppage1"> <xe:toolbarbutton id="toolbarbutton3" moveto="apppage2"> <xe:this.dojoattributes> <xp:dojoattribute name="icon" value="mbldombuttonwhiteplus"> </xp:dojoattribute> </xe:this.dojoattributes> </xe:toolbarbutton> <xp:this.facets> <xe:toolbarbutton id="toolbarbutton4" moveto="apppage3" xp:key="actionfacet"> <xe:this.dojoattributes> <xp:dojoattribute name="icon" value="mbldombuttonwhiteplus">

blackberry - bb 10 cascades sqlite relationship table -

i need create 2 tables like, table name-1 id : primary kay(integer) name : string status : boolean datetime : data time table name-2 id : feign-key (id of table name-1 primary key) symbol_id : string there should feign-key relationship between table-1 , table-2 how create tables , insert data , delete , read data them !!!

linux - Using git to just monitor changes on a webserver -

i tasked monitoring changes made source files of website. not developing website, watching it. firm believer in using version control, , fan of git, developer maintaining site not, , have decided better let him continue work wants (don't ask). not want have give him instructions whatsoever (except possibly telling him adding files or directories can ignore). i consider myself intermediate-level user of git, want run expert or two. i thinking can install git on (linux) server, , ask status, , commits, via ssh. work without jeopardizing normal operation of web server? yes, using git on server should not interfere normal operation of server (as mentioned in comments, doing on production server dodgy i'll leave 1 side.) note using git create .git directory @ root of whatever you're tracking. if web server root directory, might want consider whether risk far external access contents of .git directory (depending on server setup, may or may not concern).

Is SOAP Proxy available in Sencha Touch? -

i'm aware sencha complete package includes enterprise data connectors, in particular soap data connector. soap data connector seems available in extjs , not in sencha touch. correct? important me because i'm evaluating purchasing package, if soap connector available sencha touch. thank you! you can include external javascript libraries, add them app.json file described here. what proper way load external javascript in sencha touch 2 . can access library. soap libary i've had best luck http://javascriptsoapclient.codeplex.com/

c++ - Multithread ifstream/ofstream -

i have single "resource module" class manages resources application, , reads single file " resources.dat " is. all objects request new data file go through resourcemodule can manage memory , avoid duplicate resources. void somefunction() { image* newimage = new image(); newimage->load("imagename"); } void image::load(string imagename) { //pointer image data _myimage = resourcemodule::getresource(imagename); } there's 1 resourcemodule. want make multithread safe, when getresource(string resourcename) called, doesn't bug out. if this: image* resourcemodule::getresource(string imagename) { ifstream filereader; filereader.open("resources.dat", ios::binary); if(filereader.is_open()) { //do reading, return pointer } } is multithread safe? multiple ifstreams/ofstreams conflict each other when declare them , read same file? no it work read only , every instance of ifstre

mysql - UPDATE field with CASE statement match or do nothing to that field while still updating other fields in SQL -

i need update query change "offer_period" field (datetime) value now() if offer_period field's value greater now(). problem is, regardless of field, need update "status" field no matter what. because status field must updated, cannot change clause include offer_period condition or status field won't update if condition not met. with below query, else statement causing me problems. if ommit it, offer_period field value changed null if case condition not met, bad because want nothing in these instances. tried including else condition updates existing offer_period value, results 0 rows affected. i'm stuck. thanks taking time. josh update listings set `status`= 'pending' , offer_period = case when offer_period > now() now() else offer_period end listing_id=1 , agent_id=1

SPARQL Calculating the difference between two date -

what function calculate difference between 2 sparql xsd:datetime ? i have found reference datediff, not working. such built in function exist in sparql other query languages? some sparql engines may support date arithmetic directly. instance, mention in this answers.semanticweb.com question , answer , jena supports date arithmetic, , can subtract 1 date , xsd:duration. other implementations may support datediff function. instance, this virtuoso example includes use of bif:datediff. however, these extensions , not guaranteed present in particular sparql implementation. for more portable, though possibly less efficient solution, can use year extract year parts datetime. lets do, instance, select ?age { bind( "1799-12-14"^^<http://www.w3.org/2001/xmlschema#date> ?death ) bind( "1732-02-22"^^<http://www.w3.org/2001/xmlschema#date> ?birth ) bind( year(?death)-year(?birth) ?age ) } and results ------- | age | ======= | 67 |

javascript - Mootools code for success, failure and submit -

does mootools validation have similar process success , failure , ajaxsubmitfile ? $("#rems").validationengine({ ajaxsubmit: true, ajaxsubmitfile: "database/agentpanel/reminder/makerem.php", success : function() { $.get("database/agentpanel/reminder/loadrem.php", function(html) { $("#rem-scroll").html(html); alert("reminder set"); $('#rems').find("input[type=text], textarea").val(""); $('#rem_confirm').attr('checked', false); }); }, failure : function() { alert("fill in fields red marks"); } }); i able send form without going next page, , run script on success , on failure . you can add event functions m

html - QTextBlockFormat.setLeftMargin(1em): How To? -

in html-list bullets, on change of fontsize via format.setfontpointsize() bullets drive out of editor. figured out bullets stay on same position on fontsize-change if set padding-left 1em (tried in html-editor). how can achieve list entry in qt? can set pixel value , not element value? fmt=cur.charformat() charsize=fmt.fontpointsize() if charsize==0.0: charsize=14 if direction=="up": fmt.setfontpointsize(charsize+1) if textlist: blockformat=cur.blockformat() #blockformat.setleftmargin(blockformat.leftmargin()+0.4) blockformat.setleftmargin(1em) cur.mergeblockformat(blockformat) else: fmt.setfontpointsize(charsize-1) if textlist: blockformat=cur.blockformat() #blockformat.setleftmargin(blockformat.leftmargin()-0.4) blockformat.setleftm

javascript - jQuery 1.10 causing css3 animation to fail in chrome -

this work in firefox not in chrome although work in chrome if remove jquery. demo: http://jsbin.com/efufili/3/ if scenario if faced, write browser sniffer first, , dynamically load right version of jquery based on properties of browser sniffer returned running conditionals against array of data create specifiyng browser (and not webkit way) compatible version of jquery. i'm not going code here, that's bit of work if want work well... compiling data use in comparison array! need have understanding of how browser sniffing works first. can find more on at browser detection in javascript? . i have used approach on years... in days when ie unfreindly coders. approach if need both cross-platform , backwards compatible. you have problem inherit within own jquery code well, there have been many, many, functions have been either deprecated or replaced in short time. example, long used '.attr()' has been deprecated , replaced '.prop()'.

soa - Stubbing ActiveResource in development with Rails -

we in process of splitting our monolithic rails app multiple rails apps , using activeresource pull data 1 app another. in development massive pain have run 2 rails apps locally in order develop on 1 on them. worse split out more apps. does have solution on how stub or create dummy version of external apps don't have run every app develop on one? thinking of dummy rack app or that. try fakeweb gem. helper faking web requests in ruby. works @ global level, without modifying code or writing extensive stubs. you like fakeweb.register_uri(:get, %r|products.xml|, :body => file.read("<xml_file>"))

java - Disable update to many to one entity in hibernate -

i have parent , child entity. child has manytoone annotation reference parent. use case when load child findbyid , parent out using getter . if update parent, able save parent. not want parent updatable pulled out child. i want update parent if i directly find id , change attribute , save. i know hibernate has no info when getparent() child got child , not find id , makes update parent. i tried immutable annotation on manytoone on parent not prevent update fired. is there way can make parent pulled out child non-updatable? feel free ask clarifications. the problem experiencing, in fact belongs hibernate session . has nothing cascading . because session designed unit-of-work us. whenever access object 1) id or 2) reference, object (from moment) "cached" in session . 1 instance shared accross handling during session life-time. so, once, parent loaded session, , amending anyhow, , later session flushed - changes parent persisted. you can cal

html - My gallery won't move to the right -

so i'm new html, using else's gallery , code, , having little trouble figuring out how works. able add top margin gallery (both using margin , margin-top commands), neither margin nor margin-left makes difference in trying move gallery right. i've pasted css , relevant code below. css ul.bjqs{position:absolute; list-style:none;padding:0;margin:100;overflow:hidden; display:none;} li.bjqs-slide{position:absolute; display:none;} ul.bjqs-controls{list-style:none;margin:0;padding:0;z-index:9999;} ul.bjqs-controls.v-centered li a{position:absolute;} ul.bjqs-controls.v-centered li.bjqs-next a{right:0;} ul.bjqs-controls.v-centered li.bjqs-prev a{left:0;} ol.bjqs-markers{list-style: none; padding: 0; margin: 0; width:100%;} ol.bjqs-markers.h-centered{text-align: center;} ol.bjqs-markers li{display:inline;} ol.bjqs-markers li a{display:inline-block;} p.bjqs-caption{display:block;width:96%;margin:0;padding:2%;position:absolute;bot

jquery - Flickering issue on mouse over -

i found many other members same problem except none of them close enough script fix problem or don't have technical knowledge in jquery solve myself. i have simple slide menu opposite of drop down , noticed flickers when mouse on child li i placed here http://jsfiddle.net/noeg/f9qyb/2/ demonstrate issue (function ($) { $("#menu > ul > li:has(ul)").mouseenter(function () { $(this).find("ul").stop(true, true).slidedown(); }).mouseleave(function () { $(this).find("ul").stop(true, true).slideup(); }); })(this.jquery); thanks. simply add short delay: $("#menu > ul > li:has(ul)").mouseenter(function () { $(this).find("ul").stop(true, true).delay(300).slidedown(); }).mouseleave(function () { $(this).find("ul").stop(true, true).delay(300).slideup(); }); http://jsfiddle.net/samliew/f9qyb/3/

java - 3rd Person Camera View -

i have been trying make 3rd person camera in libgdx past couple of days , can't seem figure out how it. have tried rotatearound function in perspectivecamera, when move camera behind model suppose follow, rotation gets messed up. @ loss @ try now. want camera set , above model , follow it. if point me in correct direction, appreciate it. in render method of game want update camera follow player @ distance , want make sure camera looking @ right position either @ character or ahead if want on shoulder view. depending on scale of models may have play around these values. in render loop want this: note in example player vector3 , cam perspective camera this make camera @ character. may want modify values make ahead (change x , z that). cam.lookat(player.x, 0, player.z); here set location of camera can see floating behind , above character cam.position.set(player.x, 10f, player.y-20f) this updates camera apply of transformations cam.update(); about rota

android - Re-run HTTP request as part of AsyncTask -

(updated clarity) might need re-run http request in android asynctask based on result back. i've pasted simple example of asynchronous task below. instead of getting error code, getting temporary working-id tells me server processing request. need check every few seconds , send server working-id until finishes , gives me data. that's it! sounds pretty simple can't seem figure out: private class httpgetter extends asynctask<url, void, void> { @override protected void doinbackground(url... urls) { // todo auto-generated method stub stringbuilder builder = new stringbuilder(); httpclient client = new defaulthttpclient(); httpget httpget = new httpget(urls[0]); try { httpresponse response = client.execute(httpget); statusline statusline = response.getstatusline(); int statuscode = statusline.getstatuscode(); if (statuscode == 200) { httpentity entity =

How to design database that handle Order, OrderItem, Return, Refund, Exchange? -

most questions on internet focus on order, orderitem. there're few question designing database comprehensively handle aspects of online retail (order, orderitem, return, refund, exchange). i know data model. product (productid, name, etc) order (orderid, date, totalcost, etc) orderitem (orderid, productid, quantity, unitprice, etc) based on above structure, how can manage return, refund, exchange? i noticed when return/exchange item on super market, staff there regenerates new invoice. way handle return, refund, exchange? (f table.column) means foreign key pointing table.column (p) means primary key (u) means unique key here tables , example data... addresses id unsigned int(p) line1 varchar(50) line2 varchar(50) // allow null city_id unsigned int(f cities.id) zip varchar(6) // 5 digits , mx, 6 characters (x9x9x9) ca zip4 char(4) // allow null +----+-----------------+-------+---------+---

c# - Dictionary using is custom key but key is always unequal -

i using rtbtextpointer custom key in dictionary... init.spintaxeditorpropertymain.spintaxlistdict = new dictionary<rtbtextpointer, spintaxeditorproperties.spintaxmappedvalue>(new rtbtextpointercomparer()); i worte rtbtextpointer, , rtbtextpointercomparer classes in class library , using in different wpf projects, if (init.spintaxeditorpropertymain.spintaxlistdict.containskey(_index) == false) { init.spintaxeditorpropertymain.spintaxlistdict.add(_index,_spintaxmappedval); } everytime containskey returns false, contains, duplication entry occurs in dictionary.. wrong in "gethashcode()" public class rtbtextpointer { static int _row; static int _column; public int row { { return _row; } set { _row = value; } } public int column { { return _column; } set { _co

c# - WPF Button with multiple text elements for 10 foot gui -

i trying create buttons 10-foot gui using wpf. each button requires little more data single text string , image, maybe 2-3 strings located in different positions , imagery. i have tried <button height="52" horizontalalignment="stretch" name="button1" width="407"> <button.content> <dockpanel lastchildfill="true" horizontalalignment="stretch"> <textblock name="textbloczk2" text="abc" textalignment="left" dockpanel.dock="left"/> <textblock name="textblxock1" text="cde" textalignment="right" dockpanel.dock="right"/> </dockpanel> </button.content> </button> but no matter inner container use, button seems disregard layout dockpanel , combined text ends in middle of button. doing wrong or should using different outer container ?

regex - How do I extract two center columns from a tab-delimited line of text? -

i need 2 regex regular expressions. 1 find second block of numbers , 1 find third block of numbers. data this: 8782910291827182 04 1988 081 one code find 04 , other find 1988 . have expression find first 16 numbers , last 3 numbers, stuck in finding 2 numbers of second , third section. use field-splitting instead based on corpus, seems 1 should able rely on existence of 4 fields separated tabs or other whitespace. splitting fields easier building , testing regex, i'd recommend skipping regex unless there edge cases not included in examples. consider following ruby examples: # split string fields. string = '8782910291827182 04 1988 081' fields = string.split /\s+/ #=> ["8782910291827182", "04", "1988", "081"] # access members of field array. fields.first #=> "8782910291827182" fields[1] #=> "04" fields[2] #=> "1988" # unpack array elements variables. fi

javascript - jquery multiple files upload using single file element -

i want upload maximum 2 files using single file input. referred site http://hungred.com/how-to/multiple-upload-single-upload-file-jquery/ . there problem delete button. me delete 'click' event triggered twice. is, if delete file, both 2 files getting removed. also need unique ids 2 file inputs. can 1 me ? here code: jquery(document).ready(function($){ var max = 2; var replaceme = function(){ var obj = $(this); $('#previewrow').css('display',''); if($("input[type='file']").length > max) { obj.val(""); return false; } $(obj).css({'position':'absolute','left':'-9999px','display':'none'}).parent().prepend('<input type="file" class="fileinput hidden" name="'+obj.attr('name')+'"/>'); $('#preview').append('<div>'+obj.val()+'<a class="clearitem" href=&quo

python - PyList_GetItem not idempotent -

i'm trying out swig , have following c code , interface respectively: // example.c #include <python/python.h> pyobject *test ( pyobject *self, int i) { pyobject **x; x = malloc(sizeof(pyobject *)); *x = pylist_getitem(self, i); return *x; } // example.i %module example %{ /* put header files here or function declarations below */ extern pyobject* test(pyobject *self, int i); %} extern pyobject* test(pyobject *self, int i); it compiles , can import extension module fine. in fact, when define variable [{1:1},{2:2}] , example.test(a, 0) first time, returns {1,1}. when enter python shell, [{1:1},{2:2}] expected. when try example.test(a,0) again, segmentation fault. ideas why happening? pyobject* pylist_getitem(pyobject *list, py_ssize_t index) return value: borrowed reference . incref object before returning it.

php mail form submit - 500 error -

one of first php forms, , i'm having trouble. form not submit. i'm sure combination of problems. feel i've used appropriate id tags , such. not sure if problem redirect, or mail function, or validator. html: <div id="emailform"> <h2>confirm purchase information</h2> <hr> <form method="post" name="contactform" action="mail_form.php"> <p> <label for='name'>your name:</label> <br> <input type="text" name="name"> </p> <p> <label for='email'>email address:</label> <br> <input type="text" name="email"> </p> <p> <label for='purchasecode'>purchase code:</label> <br> <input type=&q

c# - How to read .lbl file -

i want read .lbl file , store data database column. so, whenever user wants modify it, may create new .lbl file database. i have converted .lbl data binary using snippet shown below: byte[] filebytes = file.readallbytes("d:\\work\\pns\\test.lbl"); stringbuilder sb = new stringbuilder(); foreach (byte b in filebytes) { sb.append(convert.tostring(b, 2).padleft(8, '0')); string bindata = sb.tostring(); // store variable value in database column } file.writealltext("d:\\work\\pns\\testnew.lbl", sb.tostring()); but, when open new file error this unable open label, file or folder not accessible, not exist, or opened user. try opening label 'read-only' flag set! kindly me figure out problem

java - Issue when both apache2 server and apache tomcat server installed in my linux machine -

i work in both php , java projects, ubuntu machine has both apache2 server , apache tomcat server installed. problem is, when run java application eclipse, url is, localhost:8080/myjavaapp and when enter credentials , log in url should be localhost:8080/myjavaapp/homepage.jsp but browser how taking localhost/myjavaapp/homepage.jsp hence error. when edit url adding 8080 port number, works fine. annoying edit url adding 8080 every time. appreciated. thanks. change default port tomcat else, example 8181 current versions of web browsers recognize port 8080 80, that's why it's forward 80 or cut port option url. to change tomcat port open server config file server.xml search "8080", current port in use, , replace else (make sure new port not in use) , save , restart tomcat.

asp.net mvc 4 - Data is not retrieved in infragistics iggrid when data binding is called from another page -

here scenario bulding asp.net mvc web application i have webpage page.aspx contains infragistics iggrid. initialized as $.ig.loader(function () { $("#listinggrid").iggrid({ primarykey:"code", autogeneratecolumns: false, responsedatakey: "data.d", columns: _data, features: [ { name: "groupby", }, { name: 'paging', pagesize: 10, type: "remote", recordcountkey: "data.totalrowcount", pagesizeurlkey: "pagesize", pageindexurlkey: "curpage" }, { name: "sorting", type: "local" }, { name: "summaries",