Posts

ios - How to pass content of UITextField to another UITableViewController linked by UITabbarController -

Image
i new ios development in swift 3 , encountering trouble. in picture below have 2 uitableviewcontrollers textfield in first 1 . 2 tableviews linked tabbarcontroller , recover content of textfield use in secondtableviewcontroller. dont know how it, common tutorials data passing explain button action recover data in changing tableview if possible. i hope clear in question. here in first uitableviewcontroller: class investmenttableviewcontroller: uitableviewcontroller, uitabbarcontrollerdelegate var somevariable: float? override func viewdidload() { super.viewdidload() self.tabbarcontroller?.delegate = self } func tabbarcontroller(_ tabbarcontroller: uitabbarcontroller, shouldselect viewcontroller: uitableviewcontroller) -> bool { let selectedvc:extrachargestableviewcontroller = viewcontroller as! extrachargestableviewcontroller selectedvc.totalinvest = self.somevariable return true } in other tabview class extrachargestableviewcontro...

postgresql - SQL Retrieve rows that have all rows from other table -

i facing issues retrieving data using sql in 1 specific scenario: suppose have following tables: a (id, attr_a, attr_b); b (id, attr_d, attr_e); c (id_a, id_b); as can see, table c have fk referencing id table a , , referencing id table c . i need retrieve table a rows each a row relates every b row. in real life scenario, assuming a means users, b means privileges, , c many many entity relates users privileges, want users have privileges select a.* join c on id_a = id group id having count(id) = (select count(*) b) there no need use subquery because a.id primary key (or unique @ least) column referenced c.id_a .

ruby on rails - Why is my view file moving all my head content into the body section? -

i'm confused how application.html.erb file , view files combine. have in application.html.erb file following (minimized content brevity): <!doctype html> <html> <head> <!-- bootstrap css --> <link href="/bootstrap-assets/css/bootstrap.css" rel="stylesheet"> <%= yield :head %> </head> <body> <nav> <!--long navbar section --> </nav> <%= yield %> </body> </html> in view file: <html> <head> <!-- view specific stylesheet --> <link href="/css/viewspecific.css" rel="stylesheet" /> </head> <body> <!-- view specific body --> </body> what expect when these 2 files combine, view specific stylesheet load in <head> section, , view specific body load in <body> section. final result sends view specific stylesheet <body> section, after navbar applica...

for loop - How can I create subplots in plotly using R where each subplot is two traces -

Image
here toy example have got stuck on library(plotly) library(dplyr) # construct data.frame df <- tibble(x=c(3,2,3,5,5,5,2),y=c("a","a","a","b","b","b","b")) # construct data.frame of last y values latest <- df %>% group_by(y) %>% slice(n()) # plot 1 value of y (nb not sure why value 3 appears?) p <- plot_ly() %>% add_histogram(data=subset(df,y=="b"),x= ~x) %>% add_histogram(data=subset(latest,y=="b"),x= ~x,marker=list(color="red")) %>% layout(barmode="overlay",showlegend=false,title= ~y) p how can set these subplots, 1 each unique value of y? in real world example, have 20 different y's ideally loop or apply code. in addition, set standard x scales of c(1:10) , have, example, 2 rows tia build list containing each of plots set bin sizes manually histograms, otherwise automatic selection choose different...

xcode - Can I submit iOS 10 app for review before iOS 10 comes out? -

i have app released on app store day ios 10 comes out. possible have reviewed submission before ios 10 released? thanks yes can. however, must wait gm (golden master) version of xcode 8 in order that. you can't submit app via xcode betas (try upload archive: won't let you). this gm version released bit before new public/official xcode release. it available @ usual xcode download page . source: xcode support

php ensure file_get_contents images not corrput -

i have php script use file_get_contents download remote images server, sometime corrupted $contents = file_get_contents($url); list($width,$height) = getimagesizefromstring( $contents ); if($width <= 300 ){ $contents = base64_decode('isdfafasfgoaaaansuheugaaaaeaaaabaqmaaaal21bkaaaaa1bmveuaaacnej3aaaaaaxrstlmaqobyzgaaaapjrefucndjyaaaaaiaaeihvdmaaaaasuvork5cyii='); $downloadlog->log( "ignore file width below 300 : " . $url ); } $aws->writetoaws( $target_path , $contents ); $contents = null; are there ways ensure images downloaded correctly without corruption or way validate images against remote url? you can validate using getimagesize note: formats may contain no image or may contain multiple images. in these cases, getimagesize() might not able determine image size. getimagesize() return 0 width , height in these cases. on failure, false returned. edited: for example <?php $array = getimagesize('https:...

php - How to interpret CURL headers sent by user -

i creating api using laravel , apache backend. predicament this, when type curl command in terminal like, curl -h "api key: nikapikey" --data "param1=value1&param2=value2" http://localhost:8888/awesome-calendar/public/config how read header api key in php backend? can read post parameters $_request. answered @nogad the function apache_request_headers acts var_dump http headers http://php.net/manual/en/function.apache-request-headers.php