Posts

c# - XElement is automatically adding xmlns="" to itself -

i creating new xdocument table. have validate document xsd document , keeps failing because add xmlns="" 1 of elements when shouldn't. here's parts of code pertinent. xnamespace xsi = "http://www.w3.org/2001/xmlschema-instance"; xnamespace xmlns = "https://uidataexchange.org/schemas"; xelement employertpaseparationresponse = null; xelement employertpaseparationresponsecollection = new xelement(xmlns + "employertpaseparationresponsecollection", new xattribute(xnamespace.xmlns + "xsi", xsi), new xattribute(xsi + "schemalocation", "https://uidataexchange.org/schemas separationresponse.xsd")); xdocument doc = new xdocument( new xdeclaration("1.0", null, "yes"), employertpaseparationresponsecollection); //sample xelement populate element database staterequestrecordguid = new xelement("stater...

css - How do I apply a style to a <span> if a condition exists, and take it away if it doesn't in Rails 3? -

the span tag looks this: <span class='best_in_place<%= ' list-downvoted' if upload.downvoted? %><%= ' list-upvoted ' if upload.upvoted? %>' however, if span both downvoted & upvoted, applies both styles. how modify apply one, , rid of other if other exist? i.e. if item has been downvoted before, remove list-downvoted class, , vice versa. edit: added recommended code in uploadshelper module uploadshelper def best_span_class_for_upload(upload) # start base style css_class = 'best_in_place' # add on conditional styles using string#<< concatenation css_class << ' list-downvoted' if (upload.downvoted?) css_class << ' list-upvoted' if (upload.upvoted?) # return result css_class end end with span looking now: <span class='<%= best_span_class_for_upload(upload) %>' id='best_in_place_upload_name' data-url='<...

iphone - Does UIImageView have a property to indicate setImage has completed and animations are ready? -

just getting started obj-c , ios programming. have code loads , imageview (hidden: yes) uiview - [bgimageview setimage:[uiimage imagenamed:@"filename.jpg"]; the code sets , commits animations on fgimageview , bgimageview. because of images can large, animation new bgimage not render new background image in , instead 'stalls , displays'. note stall not happen during setimage. happens during second animationcommit later in code. because animationcommit forces application wait until animation of imageview done. what i'm looking sort of 'setimage commit' on uiimageview, i'd rather display spinner until image loaded, proceed animation, there doesn't appear isloaded property uiimageview class. is there simple way determine uiimageview done setimage call? there method in uiimageview - (bool)isanimating , potentially use: if (![bgimageview isanimating]) { // continue next image; } would suffice or there other animation in...

deployment - deployable wiki-based documentation -

i looking wiki project editable developers , can have comments , history, else, has following features: a way tag or version wiki in intuitive interface competent developer can use a way deploy tagged or versioned snapshot of wiki option of stripping of editorial history. the use case have team of developers able fluidly update documentation in lifecycle of project , have necessary internal dialogs, have way package documentation in polished way can included commercial product. the ideal solution, if software exists somewhere, have type of facility can say, pdf output send commercial printer or have way custom templates depending on parameters of deployment. does sage developer out there know of such software? i take @ github's gollum seems fit requirements quite well. support a bunch of different markup alternatives , , both markdown , textile have converters pdf (and bunch of other markup choices well).

connection - Unable to connect to a SQL Server database remotely -

i have sql server 2008 r2 developer edition set on windows server 2008 r2 edition , although able database locally via sql server management studio (using server name\mssqlserver ), unable in there remotely (using ip\mssqlserver ). i have turned off firewall windows (no other firewall installed) , turned on 4 protocols sql server (shared memory, named pipes, tcp/ip , via) , has turned on every single service in sql server management studio no luck. could please me? many in advance! enable tcp/ip, shared memory , named pipes prorams> sql 2012 > configuration tools > sql server configuration manager > expand sql server network configuration > protocols sql2012r2de

java - JRuby, large arrays, and performance issues in a real-time application -

i'm working on real-time game application. of written in java, decided experiment moving of initialization procedures jruby scripts in order maximize ease player modify how world generated. as start, decided move map generation jruby script. @ present, boils down following java code: scriptingcontainer container = new scriptingcontainer(); container.put("$data", datapackage); container.runscriptlet(pathtype.relative, scriptname); datapackage = (blockmapgenerationdatapackage)container.get("$data"); the data package contains information necessary java program produce final terrain , render it, , contains necessary data in order ruby script able craft manner of maps. in particular, contains rather large array (currently 1000 x 1000 x 15). test whether ruby script working, i've stripped out entire map generation algorithm , put in following extremely simple test: require 'java' dir["../../dist/\*.jar"].each { |jar| require jar } in...

java - JAR classpath and external jars -

i actualy have 2 problems i use eclipse -> export project generate jar file simple desktop (gui) program generates jar file , ant script. first problem: generated jar works fine when double-clicked. when use generated ant script generate jar myself, doesn't work. can wrong target (assuming dependencies met) <target name="create_run_jar"> <jar destfile="g:/dev/myproj/myproj.jar"> <manifest> <attribute name="main-class" value="view.myproj"/> <attribute name="class-path" value=". myproj_lib/grouplayout.jar"/> </manifest> <fileset dir="g:/dev/myproj/bin"/> </jar> <delete dir="g:/dev/myproj/myproj_lib"/> <mkdir dir="g:/dev/myproj/myproj_lib"/> <copy file="g:/dev/.metadata/.plugins/org.dyno.visual.swing/layou...