Posts

java - Jaxb: Generate constant value for fixed-value attribute -

i'm working on xsd uses following contruct: <xs:attribute name="listversionid" type="xs:normalizedstring" use="required" fixed="1.0"> while not problematic per se, rather annoying work with, since fixed-value of definition increases between releases of xsd spec, , need modify values in seperate constants-class keep them valid, although little if of interest in xsd has changed. xsd maintained elsewhere, changing no option. thus asking myself wether there jaxb-plugin or similar turn fixed-value attributes constants ala @xmlattribute(name = "listversionid") @xmljavatypeadapter(normalizedstringadapter.class) @xmlschematype(name = "normalizedstring") protected final string listversionid = "1.0"; instead of just @xmlattribute(name = "listversionid") @xmljavatypeadapter(normalizedstringadapter.class) @xmlschematype(name = "normalizedstring") protected string listversionid; whi...

ios - nil while unwrapping an optinal value SWIFT -

this question has answer here: what “fatal error: unexpectedly found nil while unwrapping optional value” mean? 5 answers i have downloaded project https://github.com/doberman/speaker-gender-detect--ios . followed instructions when run app, message says: fatal error: unexpectedly found nil while unwrapping optional value. how can fix crash app works. the app crashes here: let genderequalityratios = self.calcgenderequality (string (response.result.value!)) this code: import avfoundation import alamofire import swiftyjson protocol audiorecorderdelegate { func audiorecorder(audiorecorder: audiorecorder?, updatedlevel: float) func audiorecorder(audiorecorder: audiorecorder?, updatedgenderequalityratio: (male: float, female: float)) } class audiorecorder: nsobject { static let sharedinstance: audiorecorder = audiorecorder() private let...

javascript - Prevent window height change when mobile address bar appears / disapears -

i use jquery height of devices displaying website, make sure homepage has height of 100%, , when scrolled thru, header menu go fixed top. that, measure window innerheight functiun, called on document ready, , window resize events (to keep design clean when user changes portrait / landscpae mode on mobile, or resizes window on desktop). problem on mobile : adress bar on android displayed on page load, , hides on scroll down, reappears on scroll up. makes page elements change sizes on evey opportunity , moves contents in page. not pleasant user. function setheight() { windowheight = $(window).innerheight(); $('.home-intro').css('min-height', windowheight); } $( window ).resize(function() { setheight(); }); is there way window size, not affected adress bar being displayed or not ? i know answer year late, i've struggled issue well. i've found using "window.document.documentelement.clientheight" instead of "$(window).innerheight();...

php - Asserting a drop down menu in selenium IDE -

so using selenium ide , must assert field drop down menu, commands can use? this have tried till no success: command: assertselectedvalue select: *name of drop down* value: ? use assertvalue() . page: <select name="select_example"> <option value="my_1">text1</option> <option value="my_2">text2</option> </select> command: command: assertvalue target: name=select_example value: my_1

java - Use of numofreducers in map reduce -

i have simple doubt in map reduce. why have set numofreducers in map reduce driver class.if not set,the default value 1.if set 100,100 reduce tasks run.what advantage of that.is reduce effort of single node.(if reduce task 1,the task running in 1 node).is there other advantages? thanks help the right number of reduces seems be: 0.95 or 1.75 multiplied (<no. of nodes> * <no. of maximum containers per node>). with 0.95, of reduces can launch , start transferring map outputs maps finish. 1.75 faster nodes finish first round of reduces , launch second wave of reduces doing better job of load balancing. increasing number of reduces increases framework overhead, increases load balancing , lowers cost of failures. the scaling factors above less whole numbers reserve few reduce slots in framework speculative-tasks , failed tasks. so main advantage load balancing , running tasks in parallel on cluster.

r - How to use .ico images in plots programmatically with/without conversion -

how use .ico image files in plots programmatically with/without conversion? my question follow-up of how convert .ico .png? , targeted r , , following specific details: i not asking methods involving transcluding icons within html , e.g. inside shiny app (author: rstudio). of course possible. can icons .ico files used directly in base-r plot, ggplot object (author: hadley wickham) , lattice plot (author: deepayan sarkar)? , approach robust printing output pdf ? how convert ico icons png or without dedicated r library. method careful handle icon's image size, depth, transparency, , other potentially important properties. the motivation there many open-source libraries of icons 1 use inside plot objects, e.g. inserting image ggplot2 , display custom image geom_point , inserting image ggplot outside chart area . in question cite @ top, how convert .ico .png? , there examples of code in c# , in python , none in r . install imagemagick on system ( your s...

ios - Custom font being clipped in UITabBarItem title -

when using custom fonts in uitabbaritem i'm seeing of characters being clipped @ bottom. saw occuring on uibutton's found fix subclass uibutton , override following method: custom font on uibutton title clipped on top of word -(void)layoutsubviews { [super layoutsubviews]; cgrect frame = self.titlelabel.frame; frame.size.height = self.bounds.size.height; frame.origin.y = self.titleedgeinsets.top; self.titlelabel.frame = frame; } unfortunately layoutsubviews isn't available override on uitabbaritem. has experienced problem , found fix it? you can customize title (including color) attributes dictionary ( settitletextattributes:forstate: , inherited uibaritem), , can adjust title’s position settitlepositionadjustment(_:forbarmetrics:) property.