Posts

xcode - Swift convert code to component for use multiple times -

i'm swift newbie , i'm trying achieve feels should easy lack of knowledge of storyboard + swift + terminology holding me back! i'd create horizontal scroller component achieves following design goals: i can add view in app few lines of code i can pass in array of values configure each of elements in scroller the scroller elements (cells?) designed in .xib file i can have multiple instances of scroller in view i've created simple example scroller has following structure: viewcontroller (horizontalscrollervc.swift) storyboard (used creating outlets, constraints , config) a uicollectionviewcell subclass (mycell.swift) a custom xib file class property set mycell.swift (mycell.xib) i imagine component might used in viewcontroller's viewdidload() method this: //**pseudo code** let data1 = ["a","b","c"] let data2 = ["1","2","3"] let scroller1:myscroller = scrollerfromdata(data:data1) sc...

app.config in asp.net core 1.0 rc2 class library -

is possible read custom sections defined in app.config in .net core 1.0 class library project? in asp.net core web project custom sections read correctly config not accessible when called class library project. prior upgrade , in rc1 class library proj app.config sections being read not case after upgrade. is there setting in project.json missing or need create custom configuration provider? thanks insight.

html - Jsoup return tag with empty body -

i trying scrap data - http://www.giantbomb.com/bioshock-infinite/3030-32317/ . can required tag , content inside tag missing . element element = document.body().getelementbyid("site-main").getelementbyid("mantle_skin") .getelementbyid("wrapper").select("div.js-toc-generate").select("form.wikigroup").first().getelementbyid("site") .getelementbyid("default-content").select("aside.secondary-content.span4 ").first(); log.e("hi",element.tostring()); code works fine till second last call "select" . when add last "select" function empty tag body . output <aside class="secondary-content span4 "> </aside> as can see element found there no body though have 1 when looking @ html code . there solution ? this worked fine on java not in android . adding useragent() fix iss...

vba - Fastest way to determine what value of a list appears first in a string -

i have list of strings in column on sheet (let "a"), this: bjs-lax-gru can-ord-mia-bog nrt-lax-jfk-lim and have different list on different sheet (let "b"), this: lax mex mia jfk so want know value of second list appears first in each string of first list, , need write value next string. in example, get: b bjs-lax-gru lax can-ord-mia-bog mia nrt-lax-jfk-lim lax i wrote following code, works perfectly: dim aux integer dim cur string j = 1 sheets("a").cells(rows.count, "a").end(xlup).row aux = 100 cur = "" k = 1 sheets("b").cells(rows.count, "a").end(xlup).row if instr(sheets("a").cells(j, 1).value, sheets("b").cells(k, 1).value) < aux , instr(sheets("a").cells(j, 1).value, sheets("b").cells(k, 1).value) <> 0 cur = sheets("b").cells(k, 1).value aux = instr(sheets...

Rotate a buffered image in Java -

Image
i trying rotate buffered image in java. here code using: public static bufferedimage rotate(bufferedimage bimg, double angle){ int w = bimg.getwidth(); int h = bimg.getheight(); graphics2d graphic = bimg.creategraphics(); graphic.rotate(math.toradians(angle), w/2, h/2); graphic.drawimage(bimg, null, 0, 0); graphic.dispose(); return bimg; } i have looked numerous stack overflow questions , answers on topic , not been able figure out why image chopped way when try rotate it. here example showing loaded image: loaded image after click rotate button calls above function buffered image , 90.0 angle: chopped image can me understand happening , how fix it? thanks! as always, internet rescue. so, code hobbled other resources/post/blogs return new image sized contain rotated image public bufferedimage rotateimagebydegrees(bufferedimage img, double angle) { double rads = math.toradians(angle); double sin = math.ab...

php - How do I pass all elements of an array (of unknown length) to a function as separate parameters? -

this question has answer here: how bind mysqli bind_param arguments dynamically in php? 4 answers i have array in php may contain data such this: $data = array("apples", "oranges", "grapes", "pears"); i want pass these values mysqli bind_param function. example this: $stmt->bind_param("ssss", $data[0], $data[1], $data[2], $data[3]); my question how can produce same results above if length of array unknown? example may five, ten or 15 elements long. with php 5.6 or higher : $stmt->bind_param(str_repeat("s", count($data)), ...$data); with php 5.5 or lower might (and i did) expect following work: call_user_func_array( array($stmt, "bind_param"), array_merge(array(str_repeat("s", count($data))), $data)); ...but mysqli_stmt::bind_param expects parame...

ios - Scroll Down SFSafarViewController -

i highly doubt it, there way scroll specific location in sfsafariviewcontroller? in regular wkwebview, doing easy. need call [self.webview.scrollview setcontentoffset:cgpointmake(0, 100)]; . i've considered trying sfsafariviewcontroller evaluate javascript , way wkwebviews can. if not possible please let me know. according the documentation , not use case sfsafariviewcontroller . the user's activity , interaction sfsafariviewcontroller not visible app, cannot access autofill data, browsing history, or website data if need interact web view, use web view( uiwebview or wkwebview ). sfsafariviewcontroller meant provide browser features within app. not have control on going on within view.