Posts

Showing posts from May, 2010

c# - How to filter "Include" entities in entity framework? -

entities: public class room { public room() { this.reservations = new hashset<reservation>(); } public int id { get; set; } public decimal rate { get; set; } public int hotelid { get; set; } public virtual hotel hotel { get; set; } public virtual icollection<reservation> reservations { get; set; } } public class hotel { public hotel() { this.rooms = new hashset<room>(); } public int id { get; set; } public string name { get; set; } public virtual icollection<room> rooms { get; set; } } public class reservation { public int id { get; set; } public datetime startdate { get; set; } public datetime enddate { get; set; } public string contactname { get; set; } public int roomid { get; set; } public virtual room room { get; set; }

javascript - Angular JS ng-cloak is not working properly expression symbol showing when page loaded -

i new angular js , trying fix issue of html code displays before gets evaluated. first showing expression , value. have added ng-cloak in body, not working. i, then, tried add html top section, no luck. checked below link: ng-cloak not working when page load but not able find correct solution this. html: <body ng-app="rootapp" ng-cloak> <div class="pname" ng-init="getdetails()"> <strong> {{desc}} <br> {{shortdesc}} {{name}}</strong> </div> </body> controller code: $scope.getdetails = function () { // service call service.getname({ id: 3 }).$promise.then(function (data) { if (data.length > 0) { $scope.desc = data[0].desc; $scope.shortdesc = data[0].shortdesc; $scope.name = data[0].name; } }); } when use ng-cloak put ng-cloak in

python - I keep getting this error and I dont know hove to fix it -

i open file saying file not open. stuck on . new python. here error: traceback (most recent call last): file "\\users2\121721$\computer science\progamming\task3.py", line 43, in <module> file.write(barcode + ":" + item + ":" + price + ":" +str(int((stocklevel- float(howmany))))) valueerror: i/o operation on closed file. here code: #open file in read mode file = open("data.txt","r") #read each line of data vairble filedata = file.readlines() #close file file.close() total = 0 #create vairble total anotheritem = "y" # create while anotheritem == "y" or anotheritem == "y" or anotheritem == "yes" or anotheritem == "yes" or anotheritem == "yes": print("please enter barcode") usersitem=input() line in filedata: #split line in first , second section barcode = line.split(&quo

javascript - remove hidden field on submit 2nd button via js -

it's possible remove part of code: <input type="hidden" id="alt_date" name="selarrivaldate" value='<?php $datetime = new datetime('tomorrow'); echo $datetime->format('ymd'); ?>' /> on submit button #bookingsubmitbtn2 ? the form here: $(document).ready(function() { $("#bookingsubmitbtn").click(function() { if ($("#children").val() == "") { $("#children").remove(); } $("#bookingform").submit(); }); }); <form name="buchenform" id="bookingform" method="get" action="searchresult1.php"> <div> <input type="text" id="datepicker" value='<?php $datetime = new datetime('tomorrow'); echo $datetime->format('d/m/y'); ?>' class="form-control" /> <input type="hidden"

c# - Error (403) Forbidden after successfull authentication on Google Calendar API with Xamarin.Auth -

i developing xamarin app (ios, android, osx , windows) , have implement calendar synchronization between app , 1 user calendar. this have tried: account useraccount; var auth = new oauth2authenticator( "xxxxxxxxxx.apps.googleusercontent.com", //cliendid "xxxxxxx", //clientsecret calendarservice.scope.calendar, //scope new uri("https://accounts.google.com/o/oauth2/auth"), //authorizationuri new uri("https://www.googleapis.com/plus/v1/people/me"), //redirecturi new uri("https://accounts.google.com/o/oauth2/token")); //tokeuri auth.completed += (sender, e) => { if(e.isauthenticated) { useraccount = e.account; var request = new oauth2request( "get", new uri("https://www.googleapis.com/calendar/v3/users/me/calendarlist"), null,

python - Beautiful soup to count frequency of particular word in page -

i using beautiful soup 1 task. i have retrieved page , made soup object. soup = beautifulsoup(html, 'html.parser') now want count number of times 1 keyword appears in this. example. "pants". should give me count of pants word in page. appreciated.

ios - Possible to check if AVPlayerLayer is visible? -

is possible check if avplayerlayer added sublayer viewcontroller's subview's layer visible or not? if @ point of time, view laid on said subview, require pause avplayer , if obscured partially. note set zposition of avplayerlayer -1 when adding sublayer. implementation in framework i'm working on have no control if end developer puts subview on subview or inside subview contains avplayerlayer . some things consider someone(end developer using framework) could: add multiple subviews on the subview or inside subview player add sublayer subview player, obscuring player any appreciated.

javascript - Most efficient way to change class of the anchor element based on query string -

criteria - prefer not use additional library, want perform pure javascript, happy use 1 if needed. i want add additional class anchor elements have query string of 'xyz=negate'. page typically has more 200 anchor elements. looking efficient way achieve this. the user base website still has decent number of ie 8 (intranet site) , hence looking efficient code. page has anchor elements following <a href="http://www.w3schools.com?id=43&xyz=negate">visit w3schools.com!</a> <a href="http://www.w3schools.com?id=47&xyz=nonnegate">visit w3schools.com!</a> <a href="http://www.w3schools.com?id=3&xy=negate">visit w3schools.com!</a> <a href="http://www.w3schools.com?id=42&xyz=negate&yz=external">visit w3schools.com!</a> <a href="http://www.w3schools.com?id=43&xyz=negate">visit w3schools.com!</a> i want add class first, fourth , fifth anchor elemen

r - If statement with nested subset function -

i trying if statement subset function in it. have dataframe dat1, example this: unit cost date 1 40 sep 1 50 dec 2 55 sep 2 30 oct and based on row nrow(dat1) want subset other dataframe (dat2) unit model sales 1 aaa 100 1 bbb 110 1 ccc 130 4 zzz 120 5 yyy 128 i wrote ifstatement this: sales <- ifelse(nrow(dat1)>=30, dat2[which(dat2$unit==1 & dat2$model=="aaa"),], dat2[which(dat2$unit==1),]) so if nrow>30 want apply subset on 2 dimensions of dat2, else on 1 of them. gives me list first column, not dataframe 3 columns of dat2. right command this? in advance help. this works: sales <- dat2[which(dat2$unit==1),] # default if (nrow(dat1)>=30) { sales <-dat2[which(dat2$unit==1 & dat2$model=="aaa"),] }

javascript - How to store value of var in Spring message tag in java script function? -

i have 1 function returning kind of string string not static dynamic <code of script function> var error_msg = sendpinajaxresponse("some url"); and using spring message tag change language $("#error_div").html('<spring:message javascriptescape="true" code="static string" />') when pass static string works fine but want store dynamic value of var, using var 'error_msg' $("#error_div").html('<spring:message javascriptescape="true" code= error_msg />') its giving exception on jsp page quote symbol expected try it: $("#error_div").html('<spring:message javascriptescape="true" code="' + error_msg + '"/>')

When is it suitable to use PrimeFaces DialogFramework over declarative <p:dialog/>? -

i looking concrete use cases (except displaying facesmessage s) suitable or better use primefaces dialogframework instead of declarative <p:dialog/> in general , in terms of general coding standards (such kiss ), maintainability, responsiveness etc.? so far, <p:dialog/> served needs , cannot think of concrete example prefer use dialogframework api on declarative approach. personally, find way more simpler (shorter code, can directly see in xhtml dialog opened pf('somedialog').show(); ) , lot more maintainable (no mix-up of xhtml or html , java code, keeping responsibilities clean) use declarative approach. feel free correct me if findings turn out nonsense.

asp.net - Unable to build sln because of v11.0.0.0 Microsoft.TeamFoundation reference error -

Image
i unable build .sln in vs2010. have vs2013 installed aswell have referenced dlls "c:\program files (x86)\microsoft visual studio 12.0 "references use nuget package instead: https://www.nuget.org/packages/microsoft.teamfoundationserver.client/

python - finding string in a list and return it index or -1 -

defining procedure return index of item or -1 if item not in list def ser(a,b): j in a: if j == b: return (a.index(b)) else: return -1 print (ser([1,2,3],3)) it's return me -1. if cut 'else' part, works. why ? that because first time not match condition in loop return , leave method. need re-think logic here determine want when don't match. ultimately, want continue looping until have exhausted checks. so, set return -1 outside of loop. if go through entire loop, have not found match, can return -1 def ser(a,b): j in a: if j == b: return (a.index(b)) return -1 print (ser([1,2,3],3)) alternatively, loop can avoided using in . so, can re-write method this: def ser(a, b): if b in a: return a.index(b) return -1 you checking see if item b in list a , if is, return index, otherwise return -1 to take simplification further, can set in single line in return :

Can I add named computed columns in access sql query? -

i need make stored procedure sql server work in access, , having serious issue. when try run query in access, asks me parameter named lna, when value column provided in query. if remove name column, query works fine, need column have name can access .net program. can name computed column in sql query in access? select [idcatalogo], [idarticulo], [ncm], lna=iif(isnull(l.posicion),'*','') [catarticulos] c left join lnaposicionesres5 l on l.posicion = c.ncm ([idcatalogo] = @idcatalogo) i'm not sure if ms access supports = syntax. normal way of doing uses as : select [idcatalogo], [idarticulo], [ncm], iif(isnull(l.posicion), '*', '') lna . . .

iOS background task using NSURLSessionDataTask -

i have flight search feature in application taking long data (more 25 seconds). if application goes background or went sleep mode, internet connection disconnected. i have written below logic using apple example make api request keep going though if app goes background it's not working. self.session = [self backgroundsession]; self.mutabledata = [nsmutabledata data]; nsurl *downloadurl = [nsurl urlwithstring:@"http://jsonplaceholder.typicode.com/photos"]; nsurlrequest *request = [nsurlrequest requestwithurl:downloadurl]; self.datatask = [self.session datataskwithrequest:request]; [self.datatask resume]; - (nsurlsession *)backgroundsession { static nsurlsession *session = nil; static dispatch_once_t oncetoken; dispatch_once(&oncetoken, ^{ nsurlsessionconfiguration *configuration = [nsurlsessionconfiguration backgroundsessionconfigurationwithidentifier:@"com.example.apple-samplecode.simplebackgroundtransfer.backgroundsession"];

xml - how to use "current() [name()='merge:change']" type of statement in XSL -

hi, xml working on, need access specific data please desired output is: hello_world <catalog xmlns:merge="http://www.merge.org/change" > <cd> <title> <a>empire burlesque</a> <b>manik</b> </title> <artist> <a>bob dylan</a> <b>aayush</b> </artist> <country> <note> <para>a small quantity of hydraulic fluid on inner cylinder satisfactory <merge:change>hello_world </merge:change> </para> </note> </country> <company>columbia</company> <price>10.90</price> <year>1985</year> </cd> <cd> <title>hide heart</title> <art

sql - Turning JSON into a Table -

{ "id":1, "key1":"", "arraykey1":[ { "arraykey":"" "objectkey":{ "obj":"" } } ] } above json object have stored in database , want use openjson create tabular format. know can whole openjson ( ) , manually create columns. wanted know if has idea of how recursively or programatically create table without having identity each key table. end having couple dozen fields. i'm not worried excluding of items. if wanted pull records back, begin new 2016 sql server? here official documentation. set @json = n'[ { "id" : 2,"info": { "name": "john", "surname": "smith" }, "age": 25 }, { "id" : 5,"info": { "name": "jane", "surname": "smith" }, "dob&q

python - Scrapy API - Spider class init argument turned to None -

after fresh install of miniconda 64-bit exe installer windows , python 2.7 on windows 7, through scrapy, here installed: python 2.7.12 scrapy 1.1.1 twisted 16.4.1 this minimal code, run "python scrapy_test.py" (using scrapy api): #!/usr/bin/env python2.7 # -*- coding: utf-8 -*- import scrapy.spiders.crawl import scrapy.crawler import scrapy.utils.project class myspider(scrapy.spiders.crawl.crawlspider) : name = "stackoverflow.com" allowed_domains = ["stackoverflow.com"] start_urls = ["http://stackoverflow.com/"] download_delay = 1.5 def __init__(self, my_arg = none) : print "def __init__" self.my_arg = my_arg print "self.my_arg" print self.my_arg def parse(self, response) : pass def main() : my_arg = "value" process = scrapy.crawler.crawlerprocess(scrapy.utils.project.get_project_settings()) process.crawl(myspider(my_arg)

machine learning - Class_weight for SVM classifier in Python -

i have set of parameters choose best ones svm.svc classifier using gridsearchcv: x=dataset.ix[:, dataset.columns != 'class'] y=dataset['class'] x_train, x_test, y_train, y_test = cross_validation.train_test_split(x, y, test_size=0.5) clf=svm.svc() params= {'kernel':['linear', 'rbf', 'poly', 'sigmoid'], 'c':[1, 5, 10], 'degree':[2,3], 'gamma':[0.025, 1.0, 1.25, 1.5, 1.75, 2.0], 'coef0':[2, 5, 9], 'class_weight': [{1:10}, 'balanced']} searcher = gridsearchcv(clf, params, cv=9, n_jobs=-1, scoring=f1) searcher.fit(x_train, y_train) and error: valueerror: class_weight must dict, 'auto', or none, got: 'balanced' why have it, if in instructions of svm parameters there 'balanced' , not 'auto' ? 'balanced' should working can see in line 51 or 74 https://github.com/scikit-learn/sc

php - Right way to build a link in laravel 5.3 -

im trying build dynamic link view page (blade) laravel 5.3. my approach is: <a href=" {{ url::to('articles') }}/{{ $article->id}}/edit">edit></a> that output right url base url , other slug: http://mydomain/articles/23/edit "23" article's id. this works wonder if there cleaner way that? many thanks you can use named routes this // route file url::get('articles/{articleid}/edit', 'articlescontroller@edit')->name('articles.edit'); //your view <a href="{{ url::route('articles.edit', $article->id) }}">edit</a> much more cleaner imo

How the unbounded following works in SQL server 2012? -

the table "cric_team" looks this when execute below query in sql server 2012, 'unbounded following' not calculating sum upto last row of partition. but, per definition, should calculate upto last row current row. select cric_id,cric_first_name,cric_last_name,cric_role ,runs,centuries ,fifty fifties,ducks,sum(ducks) on ( partition cric_role order ducks range between current row , unbounded following ) total_ducks cric_team the screenshot of table after executing query how using descending sort instead? want? select cric_id, cric_first_name, cric_last_name, cric_role, runs, centuries, fifty fifties, ducks, sum(ducks) on ( partition cric_role order ducks desc) total_ducks cric_team;

dita - Ant xmlproperty task fails due to validation error -

i want extract application version dita map file. ditamap file valid , looks this: <?xml version="1.0" encoding="utf-8"?> <!doctype map public "-//oasis//dtd dita map//en" "map.dtd"> <map id="user-manual"> <title><ph keyref="product"/> user manual</title> <topicmeta> <prodinfo> <prodname><keyword keyref="product"/></prodname> <vrmlist> <vrm version="4" release="3" modification="0"/> </vrmlist> </prodinfo> </topicmeta> <!-- [...] --> </map> the information want in <vrm> element. "easy peasy," think myself. use ant's <xmlproperty> task load xml file. <project default="test"> <!-- notice @validate --> <xmlproperty file

.htaccess - Gzip/Deflate for CSS from PHP script -

php file generate css content, like: <php echo 'body {color:white}'; ?> i call header like: <link rel='stylesheet' href='/style.php' type='text/css' /> how can enable gzip/deflate compression file? (the main goal pass google pagespeed insights test). i try code in .htaccess, it's not working file. <ifmodule mod_deflate.c> <ifmodule mod_headers.c> header append vary user-agent env=!dont-vary </ifmodule> addoutputfilterbytype deflate text/css text/x-component application/x-javascript application/javascript text/javascript text/x-js text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon application/json <ifmodule mod_mime.c> # deflate extension addoutputfilter deflate js css htm html xml </ifmodule> also try add header("content-type: text/css;"); php file, it's not working too. adding code header of style.php helped me

Can't access Orders using WooCommerce API -

i using woocommerce rest api library php , getting error now: error: invalid signature - provided signature not match [woocommerce_api_authentication_error] 401 stdclass object ( [headers] => array ( [0] => accept: application/json [1] => content-type: application/json [2] => user-agent: woocommerce api client-php/2.0.1 ) [method] => [url] => http://localhost/wordpress/wc-api/v2/orders?status=completed&oauth_consumer_key=ck_b77e9a03a12d01c72b82417d2db0af68e93211d1&oauth_timestamp=1474550513&oauth_nonce=b3ca34ff55d888acaf2584812aa8ae2a0902eec3&oauth_signature_method=hmac-sha256&oauth_signature=iujvazz8v5nykfjnxj6x%2bqfwbywfycxihyj5zooy2ce%3d [params] => array ( [status] => completed [oauth_consumer_key] => ck_b77e9a03a12d01c72b82417d2db0af68e93211d1 [oauth_timestamp] => 1474550513 [oauth_nonce] => b3ca34ff55d888acaf2584812aa8ae2a0902eec3 [oauth_signature_method] => hmac-sha256 [oauth_signature] => iujvazz8v5nykfjnxj6x+qfw

javascript - How to prevent Firebase anonymous user token from expiring -

i'm using anonymous authentication firebase app. noticed have on 100 anonymous users registered though i've been doing testing app. looks expiration time user token quite short, , expires next login causes new user created. what best way avoid this? presumably refresh user's token i'm not sure how since in onauthstatechange user parameter null if user has expired. or should changed expiration time? if so, how do this? found instructions doing in old firebase docs can't see how in latest version. update: initializing app , authenticating (anonymous) user so: firebase.initializeapp(firebase_config); firebase.auth().onauthstatechanged(user => { if (!user) { firebase.auth().signinanonymously().catch(error => { console.error('failed authenticate firebase', error); }); } });

plot - Issues with ggplot in ggplotly package in R: missing legend and no spaces between axis and labels -

Image
when run following code, produces graph: plot <- ggplot(dat, aes(x = heightunderdebris, y = grassheight)) + geom_point() + stat_smooth(method = 'lm', se = false,color = 'darkgreen') + stat_smooth(aes(x = heightunderdebris, y = 5, linetype = "linear fit"), method = "lm", formula = y ~ x, se = f, size = 1, color = 'lightgreen') + labs(x = "height under cwd (cm)", y = "grass height (cm)")+ scale_fill_manual(name = 'my lines', values = c("darkgreen", "lightgreen")) + theme(axis.title.x = element_text(color = "black", vjust = -1), axis.title.y = element_text(vjust = 0.5)) ggplotly(plot) for reason, cannot increase spaces between axis labels , graph, though have tried many different ways using vjust . , can see semblance of legend in right hand corner. cant see entire thing nor can zoom out. there issue above code? this subse

java - Spring Message Source is using deleted keys -

we using messagesource pull error messages properties file via method: messagesource.getmessage("error", options, locale) now, when change or delete key "error" in hotswap, message not changed. i don't understand why deleting or changing key has no effect on server. saved database on server startup?

ruby on rails - Authentication failed Error when deploying to AWS EC2 AMI with Capistrano -

i following tutorial: https://www.sitepoint.com/deploy-your-rails-app-to-aws/ the app created , running in development (including database). keys have been added git , ssh, although tutorial sure of them goes where. and error getting. $ gem list net *** local gems *** net-http-digest_auth (1.4) net-http-persistent (2.9.4) net-scp (1.2.1) net-ssh (3.2.0, 3.1.1) net-telnet (0.1.1) contactbook liviu-mac $ cap production deploy --trace ** invoke production (first_time) ** execute production ** invoke load:defaults (first_time) ** execute load:defaults ** invoke rvm:hook (first_time) ** execute rvm:hook ** invoke rvm:check (first_time) ** execute rvm:check cap aborted! net::ssh::authenticationfailed: authentication failed user deploy@52.87.233.215 /users/liviu-mac/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/net-ssh-3.2.0/lib/net/ssh.rb:249:in `start' /users/liviu-mac/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sshkit-1.11.3/lib/sshkit/backends/connection_pool.rb:59:i

regex - Search multiple strings in Xcode -

Image
is there way can search string1 || string2 in xcode project , or in single file? when doing such want xcode highlight wherever finds string1 or string2 . yes, can use regular expression, e.g. string|string2 . for multiple file search across whole project: for single file search use normal find , change find options textual regular expression:

html - Display inline-block and float left issues -

i trying align 3 elements, 1 div , 2 div. need inlined, issue using float left , inline-block 2 of them inline. can't modification html side fiddle -> https://jsfiddle.net/75gg6cwp/2/ live site: http://newskillsacademy.co.uk/ expected output: https://form.jotform.com/62644280988973 html <div id="ssp-1786600221-487496969" class="simplesignuppro ssp_embed" style="width: 100%; position: static; opacity: 1; margin: 0px auto; transition: 0s ease-in 0s; animation-duration: 0s; animation-timing-function: linear; animation-delay: 0s;"> <div class="mc_embed_signup"> <div class="mc_embed_signup_inner" style="box-shadow: none; background: rgb(244, 247, 249); border-radius: 4px;"> <form onsubmit="return false;" method="post" class="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" target="_blank" novalidate="">

dojo - OnDemandGrid (Dgrid) won't fire a request -

when scrolling grid, not fire new request more items when reach end of 20 items i using dojo version 1.10.4. created trackablerest store var trackablerest = declare([rest, trackable]); var interceptstore = new trackablerest({ target: 'rest/intercepts/', accepts: "application/json", sortparam: 'sort', rangestartparam: 'offset', rangecountparam: 'limit', headers:{ 'accept': "application/json", 'content-type':"application/json", 'charset':"utf-8" }, idproperty: 'id' }); then created grid: var grid = window.grid = new customgrid({ id: 'grid', //sort: [{property:'elnot'},{property:'rf_avg'}], // initialize sort on last name, ascending collection: interceptsstore, sort: "id", getbeforeput: f

php - how to define directory to install -

i have following problem , can me. , there solution. not find in documentation. i have private git repository want include via composer. works fine far. but: want composer "install" subdirectory instead of root node. for example: structure looks / /tests /src /help now want composer "install" /src directory /vendor/name/project is possible? thanks in advance.

How do I write into the html using JavaScript? -

<script> for(var numcols = 1; numcols <= 12; numcols++){ document.write( "<div class='row'>" + "<div class='well text-center col-lg-" + [numcols] + "'>" + ".col-lg-" + [numcols] + "</div>" + "</div>"; ); } </script> i know there's document.write / document.writeln have script , don't know what's wrong. i'm trying visualize bootstrap's col-md-* thing remove semicolon after last </div> <script> for(var numcols = 1; numcols <= 12; numcols++){ document.write( "<div class='row'>" + "<div class='well text-center col-lg-" + [numcols] + "'>" + ".col-lg-" + [numcols] + "</div>" +

php - Solving fopen() - permission denied on remote server without 777 -

i find hard believe question doesn't have answer here, i've searched , searched, , can't find one. i'm using fopen() on remote server, , have ftp access - nothing else. when try create or open file write access, i'm hit following error: warning: fopen(entries/newsletter.csv): failed open stream: permission denied in /var/www/sites/xxx/public_html/index.php on line 24 error: can't open file. entry not saved. i've tried changing file permissions 777 , opening existing file, , it works! cannot recommended solution, 777 insecure. is there way can resolve on ftp without resorting 777? can not change parameters on open try open in read mode? php manual fopen() options. fopen("csv/newsletter.csv", "r"); this uses least permissions, need have read access. of course, cannot write file. also, 777 includes executable bit, might want 666. you try connecting via ftp user, , ensure users permission file rw (

keep filename while uploading an url with python response library -

i using python upload file api with url = 'http://domain.tld/api/upload' files = {'file': open('image.jpg', 'rb')} r = requests.post(url, files=files) this works , file uploaded server image.jpg . don't have local files uri instead, changed code to: url = 'http://domain.tld/api/upload' files = {'file': urlopen('http://domain.tld/path/to/image.jpg')} r = requests.post(url, files=files) the image uploaded sucessfully not preserve it's name , stored 'file' (without extension). question is, how can upload url while keeping it's filename (of course without downloading first) you can pass name: files = {'name': ('image.jpg', urlopen('http://domain.tld/path/to/image.jpg'))} if @ post body see variation: content-disposition: form-data; name="file"; filename="file" and using code above: content-disposition: form-data; name="name"; fi

interface builder - Is there a way to have a storyboard default to landscape in Xcode 8? -

Image
storyboards in xcode8 show device preview instead of 'abstract' preview showed before. this preview defaults 'portrait'. can switch landscape, switch doesn't persist— even going file , given storyboard reset view portrait. is there way "my app supports landscape, can please stay in landscape"? one way fix seems changing "simulated size" parameter "fixed". not sure if there's better way. looks xcode bug…(?)

post - How to parse html forms in the Go Iris framework? -

sorry if question bit basic, how can parse form inputs in go iris framework? here form using <form action="/" method="post"> username:<input type="text" name="username"> password:<input type="password" name="password"> <input type="submit" value="login"> </form> here route , controller respectively iris.post("/", testcontroller) func testcontroller(c *iris.context){ username := c.form.get("username")//doesn't work password := c.form.get("password")//doesn't work } how retrieve values in post request after form has been submitted, thanks based off example on iris github page try c.postvalue("username") . code have may work think need capitalize variable names. in html template can see name value lowercased, context more going off variable names left of actual html username .

c# - I need to send mail for multiple textbox values -

i need send mail more 400 textbox values. customer enters 10 textbox values; how can check , send entered values email? using code below, need send enter information email. blank text box not needed send. how can check? protected void submit_click(object sender, eventargs e) { mail.to = "mail@rediffmail.com"; mail.cc = "test@gmail.com"; mail.from = email.value; mail.body += "<table><tr><td>name : " + name.value + " </td></tr>"; mail.body += " <tr><td>mobile no</td><td>:</td><td> " + mobile.value + "</td></tr>"; mail.body += " <tr><td>state : " + states.value + "</td></tr>"; mail.body += " <tr><td>country : " + country.value + "</td></tr>"; mail.body += " <tr><td>requirements : " + requirements.value