Posts

Showing posts from March, 2011

c++ - Replace all occurrences of one string with another in a stream of text -

as title says, how replace string string? example: user enter 3 inputs. first input string program replace; second string replace input1; , third string printed out. if: input1 = peanut input2 = coconut input3 = replace peanut replace output: replace coconut replace i have started program can replace words same length. tried searching problem, not understand given solutions since new @ c/c++. char replacing[100]; char replacement[100]; char original[1000]; int count; cin >> replacing; cin >> replacement; while(! cin.eof()) { cin >> original; char * pch; pch = strstr (original, replacing); count = strlen(replacement); strncpy (pch, replacement, count); cout << original << endl; } what about: you first find (if any) occurrence of string use replace substitute occurrence second string here should work: bool replacefirst(string& input, const std::string& tobereplaced, const std::str

r - Nested loop doesn't return expected values: Return model results from multiple recalculated independent variables -

i nested loop not returning values expect. new nested loops please bear me. want calculate new independent variable logistic regression model based upon different calculations of original variables. specifically, have 6 variables "x1...x6", , create 3 new variables (newvar1, newvar2, newvar3) extracting percentile pairs of original variables. these 3 new variables combine them via subtraction form final new variable forms independent variable logistic regression model. value of final variable evaluated aic of logistic regression model. i need determine optimal combination of percentile values form newvar2, newvar2, , newvar3 gives me best logistic regression model. have attempted create 3 level nested this: df <- data.frame(x1 <- rnorm(100), x2 <- rnorm(100), x3 <- rnorm(100), x4 <- rnorm(100), x5 <- rnorm(100), x6 <- rnorm(100), y <- as.factor(runif(100)<=.70))

spring mvc - springmvc freemarker Could not autowire field freeMarkerConfigurer -

springmvc4.2.4 + mybatis3.2.8 work well,it couldn't autowire after add freemarker2.2.23.the exception caused freemarker console caused by: org.springframework.beans.factory.beancreationexception: not autowire field: private org.springframework.web.servlet.view.freemarker.freemarkerconfigurer com.water.controller.htmlgencontroller.freemarkerconfigurer; nested exception org.springframework.beans.factory.nosuchbeandefinitionexception: no qualifying bean of type [org.springframework.web.servlet.view.freemarker.freemarkerconfigurer] found dependency: expected @ least 1 bean qualifies autowire candidate dependency. dependency annotations: {@org.springframework.beans.factory.annotation.autowired(required=true)} @ org.springframework.beans.factory.annotation.autowiredannotationbeanpostprocessor$autowiredfieldelement.inject(autowiredannotationbeanpostprocessor.java:573) @ org.springframework.beans.factory.annotation.injectionmetadata.inject(injectionmetadata.java:88) @ o

c# - Cancel all tasks if application runs longer than x -

i want stop running tasks if application exceeds runtime. tokensource.cancel() being set tasks still running till end normally. guess due starting process runs batch within cmd / executable file. need kill process, can accomplish tpl, or different route beneficial? read thread.abort() seemed rather unpopular. i starting background worker main window executes executedefault. background worker = new backgroundworker(); worker.dowork += (o, ea) => { executedefault(worker, tokensource);}; within execute default access execute function osobject. neccassary tasks started within function. want cancel tasks if application running longer 350000ms. private void executedefault(backgroundworker worker, cancellationtokensource tokensource) { ... random stuff osobject.runsystemcommands(outputpath, execpath, timeframe, tasks, worker, tokensource); ... random stuff task.waitall(tasks.toarray(), 350000); tokensource.cancel(); } within here start different processes. either batch exe

objective c blocks - Get warnning when using representationUsingType:NSPNGFileType properties:nil -

i trying convert image nsdata , got below warning. explain me warnning, , how fix it? cgimageref cgref = [imgview.imageview image]; nsbitmapimagerep *newrep = [[nsbitmapimagerep alloc]initwithcgimage:cgref]; [newrep setsize:imgview.imageview.imagesize]; nsdata *pngdata = [newrep representationusingtype:nspngfiletype properties:nil]; warnning properties of representation: null passed callee requires non-null argument

google chrome - Testopia : Add cases to this run not working -

Image
i want add new set of cases current test run in testopia. went current test run page , clicked blue plus mark says add cases run. when click "add selected cases run" in image above attached. nothing happens , don't message. i error under browser-->inspect element-->console vm1793:1 uncaught syntaxerror: unexpected token < @ dodecode (2952f27….js?1492516459:8721) @ object.decode (2952f27….js?1492516459:8829) @ ext.form.action.submit.handleresponse (2952f27….js?1492516459:34809) @ ext.form.action.submit.processresponse (2952f27….js?1492516459:34698) @ ext.form.action.submit.success (2952f27….js?1492516459:34780) @ ext.data.connection.handleresponse (2952f27….js?1492516459:7455) @ handletransactionresponse (2952f27….js?1492516459:1333) @ 2952f27….js?1492516459:1391

Redirect to another page Angular 2 -

i have login page form , 1 button login. when user click in button want evaluate password , email , if correct user must redirected page. my problem i've inside login html (<router-outlet></router-outlet>) information of new page showed in same place of login page , don't want mix both information. want have login separate of new information. i try use window.location.href doesn't work information continued show in same place of login. this route configuration. export const routes: routes = [ { path: 'show_alunos', component: listalunoscomponent } ]; the component listalunoscomponent new page want display after validate credentials of user. app.component.html <form class="form-signin"> <h2 class="form-signin-heading">please sign in</h2> <label for="inputemail" class="sr-only">email address</label> <input [(ngmodel)]="email" name="ema

r - Using `bbmle:mle2` with vector parameters (already works using `optim`) -

i having trouble using bbmle:mle2 function when trying regression. illustrate problem, have come toy example. we define minus log-likelihood poisson distribution (or custom distribution): ll <- function(beta, z, x){ -sum(stats::dpois(x, lambda = exp(z %*% beta), log = true)) } in code above, beta parameter vector estimate, z model/design matrix , x variable of interest. i generate random data work with: set.seed(2) age <- round(exp(rnorm(5000, mean = 2.37, sd = 0.78) - 1)) claim <- rpois(5000, lambda = 0.07 i can use optim regression. here intercept model: z1 <- model.matrix(claim ~ 1) optim(par = 0, fn = ll, z = z1, x = claim) here intercept + age model: z2 <- model.matrix(claim ~ age) optim(par = c(0, 0), fn = ll, z = z2, x = claim) the way large number of different models can assessed quite easy, 1 has specify model matrix. how can made work mle2 function bbmle package? i can it, if beta one-dimensional: mle2(minuslogl = functio

hadoop2 - Hadoop installation and configuration: multiple versions side-by-side on same host -

can install different versions of hadoop on same system in pseudo distributed mode? actually want explore features of different version of hadoop-1.x , hadoop-2.x , have configured hadoop-1.x , hadoop-2.x on 2 different systems running linux. there way configure on same machine? yes, possible install multiple versions of hadoop software side-by-side on same host. extract different versions of hadoop software separate sub-directories. create separate configuration files (core-site.xml, hdfs-site.xml, yarn-site.xml, etc.) different versions, , keep these sets of files in separate directories. make sure configure different directories things use local storage, such dfs.namenode.name.dir , dfs.datanode.data.dir in hdfs-site.xml. 2 versions should have data isolated 1 another. alternatively, if want attempt share data between 2 different versions, , run 1 version @ time, might able achieve that. depending on software versions involved, might run data incompatibilit

java - Missing artifact leadtools:ocr:jar:1.0 -

i have added jars of leadtools in maven project , have stored jars locally in .m2 folder. in pom.xml , getting following error - missing artifact leadtools:ocr:jar:1.0 here's customised dependency - <dependency> <groupid>leadtools</groupid> <artifactid>ocr</artifactid> <version>1.0</version> </dependency> path have stored jar - /home/admin13/.m2/repository/leadtools/ocr/1.0/ocr-1.0.jar you need match groupid , artifactid actuall leadtools namespace names: i.e. leadtools.forms.ocr also, need add system path (relative or absolute) dependency here example: <dependency> <groupid>leadtools.forms.ocr</groupid> <artifactid>leadtools.forms.ocr</artifactid> <version>1.0</version> <scope>system</scope> <systempath>c:\public\workspace\leadtools\leadtools.form.ocr.jar</systempath> </dependency>

android - How to add text in Calendar view date box -

i wondering if possible add text in date box of calendarview? if not, how achieve without creating own view scratch? thanks. to add text in date box of calendarview .you have customise calendar view. here 2 examples https://github.com/npanigrahy/custom-calendar-view https://inducesmile.com/android/how-to-create-android-custom-calendar-view-with-events/

python 3.x - How to get the laplacian matrix for a directed weighted network using networkX? -

Image
i facing problem when changing weights not reflected in laplacian matrix import numpy np import networkx nx #construction of directed graph g=nx.digraph() #adding weights links g.add_weighted_edges_from([(1,2,0.65), (3,1,0.35),(2,3,0.85)]) #extracting l = nx.directed_laplacian_matrix(g) l = nx.directed_laplacian_matrix(g) print(l) this behaviour arises because digraph triangle: if additional edge added: the laplacian reflects weights: import networkx nx g = nx.digraph() g.add_weighted_edges_from([(1,2,0.65), (3,1,0.35), (2,3,0.85), (3,4,0.2)]) nx.directed_laplacian_matrix(g) out[1]: matrix([[ 0.9875 , -0.45383656, -0.35847072, -0.10930101], [-0.45383656, 0.9875 , -0.45936416, -0.10267954], [-0.35847072, -0.45936416, 0.9875 , -0.34072508], [-0.10930101, -0.10267954, -0.34072508, 0.75 ]]) if edge weight updated, laplacian reflects this: g[3][1]['weight'] = 0.8 nx.directed_laplacian_matrix(g) out[2]: matrix(

cil - Use Cecil to insert begin/end block around functions -

this simple code works fine , allows add beginsample/endsample call around each update/lateupdate/fixedupdate function. doesn't take in consideration return instructions, example result of condition. know how write similar function take in considerations returns endsample call executed under every circumstance? note not cecil expert, learning now. appears me cecil automatically updates operations returns after calling insertbefore , similar functions. if br opcode jumping specific instruction address, address updated after insertions in order jump original instruction. ok in of cases, in case means if statement skip last inserted operation br operation still point directly final ret instruction. note update , lateupdate , fixedupdate void functions. foreach (var method in type.methods) { if ((method.name == "update" || method.name == "lateupdate" || method.name == "fixedupdate") && method.hasparameters == false)

ruby on rails - Create variants of products with null option_value label using BigCommerce v3 API -

i using bigcommerce v3 api create products on bigcommerce store. have product 2 variants having following options size self life dot info 1l glass amber 500ml glass amber 12 methanol sol. when trying create product { "name": "product name", "type": "physical", "sku": "cdid-12345", "description": "description", "weight": 0, "width": 0, "depth": 0, "height": 0, "price": 0, "cost_price": 0, "retail_price": 0, "sale_price": 0, "categories": [1], "variants": [ { "cost_price": 0, "price": 0, "weight": 0, "sku": "mp091236", "option_values": [ { "option_display_name": "size", "label": "

sql - Translate function not returning relevant string in amazon redshift -

i trying use simple translate function replace "-" in 23 digit string. example of 1 such string "1049477-1623095-2412303" expected outcome of query should 104947716230952412303 the list of "1049477-1623095-2412303" present in single column "table1". name of column "data" my query select translate(t.data, '-', '') table1 t however, returning 104947716230952000000 output. at first, thought overflow error since resulting integer 20 digit tried use following select cast(translate(t.data,'-','') varchar) table1 t but not working well. please suggest way have desirable output this long comment. this code: select translate('1049477-1623095-2412303', '-', '') is going return: '104947716230952412303' the return value string, not number. there no way can return '104947716230952000000'. imagine happening if somehow value being converte

html - Why bootstrap form validation doesn't work on one webpage? -

i have 3 web pages each page contains 1 bootstrap form. forms structured same, each has different number of input fields , order in appear in form. the html page files, local js files in same folder(no sub-folders). < head > on each page has same assests. non-functional form has text area , button other forms not. have tried commenting these out, didn't resolve problem. have tried removing link local css, made no difference in issue. when check html files w3 validator 1 error , 2 warnings. error: element legend not allowed child of element form in context. warning: date input type not supported in browsers. please sure test, , consider using polyfill. commenting out legend makes no difference. have date field in both working , non-working forms. when @ dev tools in chrome don't see errors. i have tested on both chrome , firefox, don't think browser specific issue. note done on local machine , coded using notepadd++. know tremendous amount of code post rev

menu - Android Navigation Drawer not showing SOME items -

Image
my problem pretty awkard: have menu used in navigationview . problem in preview , in running application, items in menu , items in drawer different. this menu activity_main_drawer <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android"> <group> <item android:visible="true" android:id="@+id/navitemhomepage" android:icon="@drawable/ic_home" android:title="home" /> </group> <item android:id="@+id/navmenuinterventions" android:visible="true" android:title="interventi"> <menu> <item android:id="@+id/navitemmyinterventions" android:icon="@drawable/ic_interventions" android:title="miei" /> &

c# - Consul - service detection Microservice/Domain architecture -

i'm having microservice (ms)/doamin (d) architecture each ms/d service has own rest api. have been looking using consul service detection cant figure out how use because. have followed documentation cant find how use consul in ms/d architecture ms/d has more 1 rest endpoint... in documentation feels registrating plain "service host" not registering service endpoint "mydomain.com:8080/api// registering "mydomain.com:8080/ i.e host running service. feels have missed cant figure out how register rest-api urls using consul. i'm using consul.net ( https://github.com/playfab/consuldotnet ) , setup registering microservice is: var client = getserviceclient(); var httpcheck = new agentservicecheck() { deregistercriticalserviceafter = timespan.fromminutes(1), interval = timespan.fromseconds(15), http = $"http://{host}:{microserviceport.tostring()}/healthcheck/" }; var agentreg = new agentserviceregistration() { checks = new[] { httpcheck },

android - Crop Bitmap 150dp from Bottom of Screen to Top of Screen -

i use screen capture, , want crop bitmap programatically 150dp bottom of screen . (erase bitmap 150dp bottom of screen) how that? this image explanation: http://imgur.com/tp2ouvp edited . full code take screen shot: public void takescreenshot() { date = new date(); android.text.format.dateformat.format("yyyy-mm-dd_hh:mm:ss", now); try { string folder_main = "app_folder"; file f = new file(environment.getexternalstoragedirectory(), folder_main); if (!f.exists()) { f.mkdirs(); } // image naming , path include sd card appending name choose file string mpath = environment.getexternalstoragedirectory().tostring() + "/app_folder/" + + ".jpg"; // create bitmap screen capture view v1 = getwindow().getdecorview().getrootview(); v1.setdrawingcacheenabled(true); bitmap source = v1.getdrawingcache(); int x = 0; int y = v1

javascript - Efficient way to delete key of object in nested arrays -

my data structured this: obj = { _id: "sjkd9skj", data: { dektop: [ { x: 2, y: 3, t: { key: 'aabbcc'} }, ... ], mobile: [ { x: 4, y: 3, t: { key: 'ffff'} }, ... ], print: [ { x: 7, y: 5, t: { key: 'ppp'} }, ... ] } } in data, need remove t keys array elements modes ( desktop , mobile , print ). what efficient way this? these mode arrays can quite large. i have tried this: obj.data.mobile.foreach((item)=>{ delete item.t; }); obj.data.desktop.foreach((item)=>{ delete item.t; }); obj.data.print.foreach((item)=>{ delete item.t; });

python - Matplotlib: Focus on specific lon/lat using spstere projection -

Image
i trying focus map on specific area of antarctica using 'spstere' projection matplotlib package in python. able plot whole of antarctica time want 'zoom' in , have closer @ specific area of continent. similar examples using other projections ( pyplot contour plot - clabel spacing ; http://matplotlib.org/basemap/api/basemap_api.html ; https://matplotlib.org/basemap/users/examples.html ) available online have not been able apply 'spstere' projection on antarctica. i want focus map on region of antarctic peninsula, spans llcrnrlon=-100,urcrnrlon=-30,llcrnrlat=-90,urcrnrlat=-55.0 i have tried use code 'spstere' proj python takes account boundinglat , lon_0. i've tried change values boundinglat , lon_0 not work either. any idea how go about? have tried using other projections such 'cyl' instead of getting nice square 'spstere' proj, horizontal rectangle. m = basemap(projection='cyl',lon_0=0,lat_0=0,\ llcrnrlon

ios - TableViewController doesn't show content -

i building app , having trouble table view static cells. used tableviewcontroller in mainstoryboard, , designed static cells, label , text field. when connect actions tableviewcontroller file, content not display. does know how fix this? a few things try: comment miknash stated check cellforrowatindexpath gets called check numberofsectionsintable , numberofrowsinsection called. check if you've set itemcount specific value in interface builder. also, 1 gets me make sure specified delegate , datasource tableview.

php - No response from volley -

this seems asked question, have tried every question on stackoverflow. i unable receive response server using volley. error inside onerrorrespose() is: com.android.volley.parseerror: org.json.jsonexception: value <br of type java.lang.string cannot converted jsonobject using post method the method php looks like: https://vidorvistrom.000webhostapp.com/client_access.php?username=loyal_customer&password=custumerxyz&info_req=merchant_names so params must like: @override protected map<string, string> getparams() throws authfailureerror { map<string, string> params = new hashmap<string, string>(); params.put(key_username, "loyal_customer"); params.put(key_password, "custumerxyz"); params.put(key_info, "merchant_names"); return params; } where keys in global defined as: public static final string key_username="username"; public static final string key_password

android - How to resolve NoSuchMethodError and appiumDriver error -

package demo; import java.net.malformedurlexception; import java.net.url; import org.openqa.selenium.by; import org.openqa.selenium.webelement; import org.openqa.selenium.remote.capabilitytype; import org.openqa.selenium.remote.desiredcapabilities; import org.openqa.selenium.remote.remotewebdriver; import io.appium.java_client.android.androiddriver; public class test { remotewebdriver driver; public static void main(string[] args)throws malformedurlexception, interruptedexception{ desiredcapabilities capabilities = new desiredcapabilities(); capabilities.setcapability("devicename", "samsung s4"); capabilities.setcapability("platformname", "android"); capabilities.setcapability(capabilitytype.browser_name, "chrome"); capabilities.setcapability("platformversion", "5.0.1"); remotewebdriver driver = new androiddriver(new url("http://127.0.0.1:4723/wd/hub"), capabilities)

javascript - How to bind and unbind an event listener once executed -

i'm trying bind , unbind event listener 1 has been clicked… user clicks div once div clicked… binded event listener code executed at end of code… div unbinded event listener $(document).on('click', '.clickable:not(.clicked)', function(event) { var $this = $(this); $this.addclass('clicked'); if ($this.hasclass($this.data('add-class'))) { $this.removeclass($this.data('add-class')); } else { $this.addclass($this.data('add-class')); } $this.removeclass('clicked'); }); .clickable { width: 100px; height: 100px; background: #edf0f6; margin: 10px; transition: .5s; float: left; border: 1px solid transparent;} .clickable:hover { border: 1px solid #10cffc; box-shadow: 0 0px 15px rgba(0, 0, 0, 0.25);} .click1 { transform: scale(1.1); } .click2 { -webkit-transform: rotatez(90deg); /* standard syntax */ transform: rotatez(90deg); /* standard syntax */ } .click3 {

c# - Redirect logs to logstash instance instead of ElasticSearch -

i have question : i`m using elasticsearch.net nugget nlogs in order send logs local elasticsearch instance. kibana visualize them well, far soo good. is possible using same nugget forwards logs logstash instance expose on production environment instead elasticsearch to add martijn's answer , use nlog write logs local directory, use filebeat ship logs logstash .

reactjs - Why do I have to put bundle.js script in html when running webpack-dev-server -

i'm running webpack-dev-server package.json script. when don't put tag in index.html, bundle not being loaded when webpack-dev-server should put there automatically. my code looks this: <body> <div id="my-app"></div> <script src="bundle.js"></script> <script type="text/javascript" src="app.bundle.aa2801db8d757c2f2d78.js"></script> </body> i put first bundle there when running webpack-dev-server , second bundle got generated htmlwebpackplugin when built project production. want rid of first bundle in production code. thanks suggestions. you need reference javascript bundle html, because not inserted there automatically. you can use htmlwebpackplugin have bundle reference added automatically. it's added plugins section of webpack.config.js file this: const webpack = require("webpack"); const htmlwebpackplugin = require("html-webpack-plugin&q

sql server - Need Sql query to get time difference based on status -

below sample data i need total time when ebstatus , dgstatus on , till next dgstatus off . for example if consider below data: ebstatus | dgstatus | readtime on | on | 16/07/2017 3:00:00 on | on | 16/07/2017 4:00:00 on | off | 16/07/2017 5:00:00 on | off | 16/07/2017 6:00:00 on | on | 16/07/2017 7:00:00 on | off | 16/07/2017 9:00:00 here total on time 2 hours (3 4 - > 1 hour , still on until 5, total on time 2 hours) , both status again on @ 7 , dgstatus off @ 9,so here total on time 2hours. finally total on time 4 hours can give query sql server 2012? if reduce 1 row per on , off , aggregation solve problem. can using difference of row numbers method: select ebstatus, dgstatus, min(readtime) min_rt, max(readtime) max_rt (select t.*, row_number() on (partition ebstatus order readtime) seqnum_d, row_number() on (partition ebstatus, dgstatus partition readtime) seqnum_sd t

php - Behat + Mink extension + Selenium foreach problems -

i followed instruction doc http://docs.behat.org/en/v2.5/cookbook/behat_and_mink.html , seem everytime try test scenario javascript weird error warning: invalid argument supplied foreach() in vendor/behat/mink-selenium2-driver/src/selenium2driver.php line 444 my behat.yml default: gherkin: cache: var/cache/test/behat/behat_gherkin_cache testers: rerun_cache: var/cache/test/behat/behat_rerun_cache extensions: behat\symfony2extension: ~ behat\webapiextension: base_url: 'http://nginx:8001' behat\minkextension: base_url: 'http://localhost:8000' selenium2: ~ sessions: default: symfony2: ~ suites: default: paths: [ '%paths.base%/features/app' ] contexts: - featureappcontext - knp\friendlycontexts\context\tablecontext and scenario is @javascript scen

javascript - Dynamically sort posts by tags into a Wordpress loop -

i got a custom loop wordpress custom blog page, , im displaying posts it, : <section class="container blog-article-actu"> <div class="row"> <?php $the_query = new wp_query('showposts=-1'); while ($the_query->have_posts()) : $the_query->the_post(); $catobj = get_the_category(); ?> <article class="blog-article-actu-article" style="background:url('<?php $url = wp_get_attachment_url( get_post_thumbnail_id($post->id), 'thumbnail' ); ?><?php echo $url ?>');"> <div class="blog-article-actu-article-top"> <h2><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2> <div class="details-blog-article-actu"> <div class="blog-article-actu-date"> &

Can Binary Search be / Is Binary Search a greedy algorithm? -

i'm reading different materials binary search , , it's not clear me greedy binary (which looks me it's not) or, can greedy algorithm specific implementation? and if can greedy, how make sense? if global optimum obtained selecting local optimum, without reconsidering previous choices, can't guarantee correct results binary search. consider looking element @ index 100 in 8 bit value range (1-256). binary search progress consider following indices: 128 ? big 64 ? small 64 + 32 ? small 64 + 32 + 16 ? big 64 + 32 + 8 ? big 64 + 32 + 4 ? found it easy to notice in every step testing significant bit not tested yet , if not overflow result added partial solution until final result found. so following characteristics of greedy choice can pointed: there candidate set composed of 8 bits of number find. greedy selection considering in every step significant bit not used yet. checking if bit can added final solution locally looking @ bit , result ass

c# - What is major importance/role of stack memory if most of the data go on heap? -

i reading dispose pattern , come across how memory allocated . following quote http://codebetter.com/karlseguin/2008/04/28/foundations-of-programming-pt-7-back-to-basics-memory/ . memory allocation .... .... exception rule value types belonging reference types – example id property of user class goes on heap along instance of user class itself. this mentioned on question on stack overflow here. memory allocation value type inside reference type in .net my understanding that, value types irrespective of declared go stack. looks wrong now. in code below, i go on heap; not on stack according links. because myclass reference type go heap , along it, value types. class myclass() { int = 5; } ok, value types not part of class go stack memory then. right? but, in dot net language c# inside class. go stack memory? this answer explains value types go heap. if case, there little or near nothing goes on stack memory. i suspect misunderstanding something.

c# - DLLnotfoundexception:Unable to load DLL 'Pine.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E) -

am trying load unmanaged dll(c++) through dllimport method getting below exception. unable load dll 'pine.dll': specified module not found. (exception hresult: 0x8007007e) i have placed dll in path bin\debug\ (am running in debug mode). getting dllnotfoundexception. before formatting pc , freshly installed vs2015 working fine. when reinstalled os , installed vs-2015 giving error. missing dll or support dllimport. any appreciated. from remember on windows search order dll is: current directory system folder, c:\windows\system32 or c:\windows\syswow64 (for 32-bit process on 64-bit box). reading path environment variable in addition i'd check dependencies of dll, dependency walker provided visual studio can out here, can downloaded free: http://www.dependencywalker.com

xcode8 - Single -swift.h shared by multiple targets -

how include single -swift.h in file shared multiple targets in xcode 8? i want include "projectname-swift.h" once rather have sea of #if something_specific_for_target_1 #import "target1-swift.h" #elsif something_specific_for_target_2 #import "target2-swift.h" ... this objective c swift header file multiple targets helped. once have added custom user defined setting swift_module_name foo each , every target can swiftly import foo-swift.h instead of gazillion of target specific targetx-swift.h

python 3.5 - Extracting part of a 2D image in OpenCV -

enter image description here my goal take image above , "open" along center 9 black doublets in straight line rather in circle. have tried using cv2.topolar() function in opencv image quite distorted, can seen below: enter image description here i attempting try different approach now. center, access each of doublet individually, pizza slice, , place them side side initially thinking of slicing each doublet using 2 lines center of image mid point between doublets on either side. my question is: how can draw contours center of image edge of image, passing through mid point between 2 doublet. if can draw one, know angle between 2 such consecutive contour 40 degrees. any appreciated! i noted few problems here: the topolar() conversion might have been around center of image file, not center of object. causes part of distortion. if share code, try playing code , improving it. 2.the object elliptical, not circular. means still have wave after correct

audiocontext - Twilio.Device.setup throws error -

i developing browserphone twilio.js, version 1.4.20. when token expired, handling twilio.device.offline(), , regenerate token , re-setup twilio.device. after 6 times re-setup, then, twilio.js throw error. *failed* construct 'audiocontext': number of hardware contexts provided (6) greater or equal maximum bound (6). how can prevent error? i'm using these code. twilio.device.offline((device) => { if (navigator.online) { twilio.device.destroy(); twilio.device.instance = null; gettoken(device._clientname); } const gettoken = (identity) => { $.ajax({ type: 'post', url: baseurl + '/token/get', data: {'identity': identity} }) .done((data) => { data = json.parse(data); twilio.device.setup(data.token, { closeprotection: true }); };

flash - Actionscript: input text on iOS working differently than in the simulator -

i have input box created in flash professional 500px x 500px, set classic text > input text > singleline. i import actionscript project , set wordwrap = true; in simulator works great. however on ios wordwrap not occur during input. appears on single line in center of textbox height, when focus returns app text correctly wrapped. how can make work in simulator. as fix tried using multiline text box. this not have issue above, introduces new issue, on selection of textbox cursor appears 1 line below top, have press backspace move top of textbox, interestingly text box has size 0 despite sort of new line existing. occurs in simulator on device.

ios - Remove devices from provisioning profile with Fastlane -

i'm using match , register_devices right devices in profiles. when remove devices via apple developer fastlane tells me can't find provisioning profile anymore. have nuke , create again via fastlane. is there better way? register_devices throws out missing devices provisioning profile, when deleted them call or something? any time delete device, provisioning profiles device become invalid. if want programmatically, can use disable! on device object disable device, e.g.: device = device.find_by_udid "abcde-12345" device.disable! but when via dev portal, invalidate provisioning profiles use device. i find easier keep list of devices in source control , use match , register_devices . set happens automatically instead of doing hand , won't big pain.

log in to a website using Python's Requests module doesn't work on this site but work on other site -

use following code on twitter , github work fine doesn't work on main site using for, can please tell me went wrong. did not error instead scrap login page instead of log me. import requests session = requests.session() params = {'j_username': '**********', 'j_password': '************'} r = requests.post("https://connect.data.com/loginprocess", params) print("cookie set to:") print(r.cookies.get_dict()) print("-----------") print("going profile page...") r = requests.get("https://connect.data.com/home") print(r.text) i new can't figure out went wrong, have try many answer out before asking question none seem workout site. login url /login file login been process /loginprocess why use /loginprocess loginprocess not print out cookie /login print out form site this: <form id="command" name="loginform" action="https://connect.data.com/loginprocess" method=&q