Posts

html - Why is the option text sent when form submitted instead of "value" if value is not set? -

i seeing occur in older version of ie. don't see behavior in chrome or firefox. have form code: <div class="small-12 medium-3 column hide" id="special-set-div"> <label>special set? <select id="special-set" name="special_set"> <option value>select</option> <option value="yes">yes</option> <option value="no">no</option> </select> </label> </div> when form submitted, server reading "select" parameter. need manually assign value empty string? there documentation of behaviour? can't seem find mention of this. thanks in advance help. this w3c specification states value attribute: value = string provides value element. if there isn't, value of option element textcontent of element. so yes, expected behaviour.

java - Add external data to Orika MappingContext while mapping -

i want add external properties (something not in object i'm mapping) mappingcontext. here want accomplish: mapperfactory mapperfactory = new defaultmapperfactory.builder().build(); mapperfactory.classmap(obja.class, objb.class).customize(new custommapper<obja, objb>() { @override public void mapatob(obja obja, objb objb, mappingcontext context) { objb.setname((string) context.getproperty("name")); } }).bydefault().register(); mapperfacade mapper = mapperfactory.getmapperfacade(); obja obja = new obja(); objb objb = new objb(); mappingcontext context = new mappingcontext(); //probleme here: mappingcontext abstract class context.setproperty("name", "some information not in obja nor in objb"); mapper.map(obja, objb, context); how can that? can dynamically add data context? or other way pass additional data mapper? the solution simple: mappingcontext contex...

ruby on rails - Trying to display fields from hash but getting undefined method `[]' for nil:NilClass -

i receiving error " undefined method `[]' nil:nilclass " when trying display field json parsed hash. how coll_title data display? the data alinks : [{ "role"=>"source", "relator"=>"dnr", "terms"=>[], "_resolved"=>{ "lock_version"=>0, "publish"=>true, "display_name"=>{ "coll_num"=>"024", "coll_title"=>"collection title" } } }] the code: def display_agents(hash, opts = {}) html = "<div><small>" html << "<ul style='list-style-type:none'>" alinks = json.parse( hash["json"] )["linked_agents"] alinks.each |_resolved| html << "<li>#{_resolved["display_name"]["coll_title"]}</li>" end html << "</ul>" html <...

html - Creating a stroked frame effect with css -

Image
i have design effect i dont care font styles or details, focused right on creating frame , if possible button well. know how kind of effect in css? here basic html/css code, wont of help. , can modify if suits better. btw using bootstrap 3. /******** html *********/ <div class="col-md-12 bg-img"> <div>italy has never been close</div> </div> /******** css *********/ .bg-img { display: table; width: 100%; height: 100px; text-align: center; background: #999 url("http://p1.pichost.me/i/15/1380265.jpg") no-repeat fixed center; } .bg-img div { display: table-cell; vertical-align: middle; width:10px; font-weight:700; } i using generic image, shouldn't make difference. here fiddle. https://jsfiddle.net/3al4xnr8/ you can :after , :before pseudo-elements. div { display: table; margin: 0 auto; width: 30%; padding: 20px; ...

Tracking Youtube Video Google Tag Manager Youtube API -

at end of video added ?rel=0 allows video not show related videos @ end of timeline. want track video embedjsapi=1 @ end of iframe url this. https://www.youtube.com/embed/egnk8zmkwls?rel=0embedjsapi=1 do need put (&) sybmol between 2 rel=0 & embedjsapi=1 or link above ok? yes, speaking, need separate query parameters ampersand (&): https://www.youtube.com/embed/egnk8zmkwls?rel=0&embedjsapi=1

amazon web services - Cannot delete item from DynamoDB table (java) -

i've been attempting delete item table in dynamodb through java code, every attempt i've made results in same error: com.amazonaws.amazonserviceexception: provided key element not match schema (service: amazondynamodbv2; status code: 400; error code: validationexception; my current attempt simple , looks this: final dynamodb dynamodb = new dynamodb(new amazondynamodbclient(credentials)); table table =dynamodb.gettable(tablename); deleteitemspec itemspec = new deleteitemspec().withprimarykey("cognitoid", cognitoid); table.deleteitem(itemspec); tablename table name, credentials have been verified correct, , cognitoid actual id of item i'm trying delete. table in question has cognitoid primary key , don't understand why deletion isn't matching schema. table has sort key, or range key (i'm not sure because documentation quite vague). i've been referring documentation here: http://docs.aws.amazon.com/amazondynamodb/la...

r - Error when building regression model using lm ( Error in `contrasts<-`(`*tmp*`... contrasts can be applied only to factors with 2 or more levels) -

i error depending on variables include , sequence in specify them in formula: error in `contrasts<-`(`*tmp*`, value = contr.funs[1 + isof[nn]]) : contrasts can applied factors 2 or more levels i've done little research on , looks caused variable in question not being factor variable. in case (is_women_owned), factor variable 2 levels ("yes", "no"). > levels(customer_accounts$is_women_owned) [1] "no" "yes" no error: f1 <- lm(combined_sales ~ is_women_owned, data=customer_accounts) no error: f2 <- lm(combined_sales ~ total_assets + market_value + total_empl + empl_growth + sic + city + revenue_growth + revenue + net_income + income_growth, data=customer_accounts) regressing on above formula plus factor variable "is_women_owned": f3 <- lm(combined_sales ~ total_assets + market_value + total_empl + empl_growth + sic + city + revenue_growth + revenue + net_income + income_growth + is_women_owned, ...