Posts

Showing posts from July, 2014

drupal 7 - okta performance for authentication -

Image
i’m experiencing poor performance on user authentication, , suggestions try improve it. i’m using drupal integrated third party system runs on salesforce.com (sfdc) platform. okta doing sso these. ad idp, , contains security groups assign user permissions sfdc (all users in ad have access drupal). here authentication flow : when user starts login process, username (email) , password sent drupal validation. login (username/password) → [drupal ui – browser] → login user → [drupal backend] the drupal backend calls okta api , validate credentials in okta. validate user credentials → [okta – authentication api] if validation okta passes, redirection , session token created; sent ui because using javascript perform redirection. when redirection called, session cookie generated in user’s browser. [drupal ui - browser] ← [drupal – backend] ← validated session token ← [okta – authentication api] [drupal ui - browser] → redirects user sfdc endpoint session cookie → [okta – s

How does npm know you're in dev/developing mode? -

can explain me means --save-dev , how impacts distribution , how npm aware of you're trying do? first , see answer question, what's difference between dependencies, devdependencies , peerdependencies . that explain ton. second , npm install devdependencies default unless 1 of 2 things true, in case devdependencies skipped. these things are: you explicitly tell npm it's production npm install --production you set environment variable npm checks, node_environment=production in general, if distributing heroku, have production flag set , devdependencies not installed. install things --save-dev or -d flag (both same thing) if module used development, such tests/mocks/scaffolding/etc.

selenium - Configure Capybara to use Marionette WebDriver for Firefox -

with marionette replacing firefoxdriver, need configure tests run it. i've downloaded binary can't seem capybara driver registration configured use marionette. capybara.register_driver :selenium_firefox |app| capabilities = selenium::webdriver::remote::capabilities.firefox capabilities["firefox_binary"] = 'path/to/marionette/renamed/to/wires' capybara::selenium::driver.new(app, browser: :firefox, desired_capabilities: capabilities) end when start test though, initial page of ff trying run without marionette. marionette passed option driver.new - not desired_capabilities capybara.register_driver :selenium_firefox |app| capybara::selenium::driver.new(app, browser: :firefox, marionette: true) end it requires have downloaded geckodriver, put in path , renamed wires a complete description of these configuration steps, including marionette latest executables download links can found here . note: capybara not yet support marionette,

php - Trouble Understanding the ReturnTo Redirect for SimpleSAMLphp -

trying set redirect in simplesamlphp take user page trying access before being sent authentication. i'm using returnto option: $as->requireauth(array("returnto" => $returnurl, 'keeppost' => false)); with metadata remote-idp set (stripped example): $metadata['sample'] = array( 'name' => 'sample', 'entityid' => 'https://sample.com/saml/module.php/saml/sp/metadata.php/sample', 'metadata-set' => 'saml20-idp-remote', 'singlesignonservice' => array ( 0 => array ( 'binding' => 'urn:oasis:names:tc:saml:2.0:bindings:http-redirect', 'location' => 'https://sample:port/idp/startsso.ping?partnerspid=https://sample.com/saml/module.php/saml/sp/metadata.php/sample' ) ), 'keys' => array(...) ); i need pass parameter "target" idp startsso in

masm - Assembly Language: Two-prompt user input (mix char and int) -

i new assembly programming , need understanding , fixing code have been struggling with: want provide user input: prompt 1: enter destination read value prompt 2: enter destination read value display distance , destination. i using vs2012 irvine32 libraries on x64 hardware. compiling x32. the problem code compiles , builds. output not proper. first prompt displayed no input. second prompt "distance" displayed entry allowed. if change first prompt have "readint" instead of "readstring", prompts in both, "invalid integer" error. why this? how fix , display input values. my code include irvine32.inc ;************************************************************************* .data querydest byte "destination", 0 querydist byte "distance", 0 destination dword ? distance dword ? .code main proc call clrscr mov edx, offset querydest call writestr

php - Detecting if javascript is enabled with hidden form field -

it may seem repeat question, have not found appropriate answer in hundreds of answers detecting whether or not javascript enabled. home page have form requires zip code entered. if entered zip code in more 1 county, visitor returned page select state, , county. if have js enabled can provide them nice dynamic dependent drop-down menu of counties once select state. without js have return page county options. home page doesn't need js. there way use hidden field in zip code entry form let next page know if js enabled? create hidden field in form contains zipcode , fill on homepage js. once form send can check if field empty indicate js not enabled , render result page accordingly.

ruby on rails - How To Authenticate With Keys In ActionCable -

i able authenticate cookies in actioncable using cookies.signed[:user_id] can't figure out how using keys. example, sending authorization header when establishing connection. the variable accessible in applicationcable::connection class cookies . other variables ( params , headers ) not available. any ideas? i able authenticate sending authentication keys when subscribing channel. if keys invalid, calls connection.send(:reject_unauthorized_connection) in channel.

swift - Rxswift map + concat in parallel -

this observable executing following given source observable we use map perform async work we use concat return result of async work in order the following returning desired result, start async work in parallel. what correct way of doing rx? import rxswift func delay(time: int, closure: () -> void) { dispatch_after( dispatch_time(dispatch_time_now, int64(time * int(nsec_per_sec))), dispatch_get_main_queue(), closure) } func doasyncwork(value: int, desc: string, time: int) -> observable<int> { return observable.create() { (observer) -> disposable in print(desc) delay(time) { observer.onnext(value) observer.oncompleted() } return nopdisposable.instance } } let seq = observable .of(1, 2, 3, 4, 5) .map { (n) -> observable<int> in return doasyncwork(n, desc: "start \(n) - wait \(5 - n)", time: 6 - n ) } .concat() let sharedseq = seq.sharereplay(0) sharedseq.subscribene

debugging - Visual Studio Code Cannot Configure Correctly -

Image
for reason, because not know how configure visual studio code. talking free light version. it showing error of type. new product, not vs version of it. how set ide correct work it? here current error. downloading , configuring .net core debugger... telemetry is: enabled log : restoring packages c:\users\erik little\.vscode\extensions\ms-vscode.csharp-0.3.7\coreclr-debug\project.json... info : committing restore... log : lock file has not changed. skipping lock file write. path: c:\users\erik little\.vscode\extensions\ms-vscode.csharp-0.3.7\coreclr-debug\project.lock.json log : c:\users\erik little\.vscode\extensions\ms-vscode.csharp-0.3.7\coreclr-debug\project.json log : restore completed in 585ms. nuget config files used: c:\users\erik little\.vscode\extensions\ms-vscode.csharp-0.3.7\coreclr-debug\nuget.config feeds used: https://www.myget.org/f/dotnet-core/api/v3/index.json https://api.nuget.org/v3/index.json https://www.myget.org/f/coreclr-debug

if statement - Showing an image and replacing it with another image if something happens -

Image
i use color tracking code processing. what want (example): if red detected show image 1 if green detected show image 2 if blue detected show image 3 the problem is, if last color detected , last image shown, , track first color first image not in front (i can't see it). the whole code: import processing.video.*; //import hypermedia.net.*; pimage img; pimage img2; pimage img3; capture video; final int tolerance = 20; float xrc = 0;// xy coordinate of center of first target float yrc = 0; float xrh = 0;// xy coordinate of center of second target float yrh = 0; float xrc2 = 0; // xy coordinate of center of third target float yrc2 = 0; float xrh2 = 0;// xy coordinate of center of fourth target float yrh2 = 0; int ii=0; //mouse click counter color trackcolor; //the first color center of robot color trackcolor2; //the second color head of robot color trackcolor3; //the first color center of robot 2 color trackcolor4; //the first color center of robot 2 void

Working with local filesystem and MySQL database in Docker, tensorflow, Windows 10 -

i switched new (windows 10) computer , need pick development doing in tensorflow. the way can find run tensorflow through docker , have working fine (a bit different linked article) docker run -d -p engineero/tensorflow:df_build (my image made modifying main repo's dockerfile pull in dependencies). have 2 remaining problems, however: i cannot figure out how use , modify existing jupyter notebooks in docker container run. i have no idea how connect mysql database have running on machine. for 1 have tried adding -v /c/users/path/to/my/files:/tensorflow/my_files docker run command, /c/users/path/to/my/files/*:/tensorflow/my_files . both of these, /tensorflow/my_files directory in vm, empty. need able use existing notebooks (and other files) file system , have changes make these files persist on file system. for 2 , have no idea. mysql database running on windows localhost , if reference localhost in scripts connect database, try connect daemon (i think), not same: d

Is that possible to get image ID from Docker Registry V2? -

when image has been pushed registry v2, image id pushed registry well? possible image id repository v2 registry? if image pushed docker client 1.10 or above, can obtain image id registry with get /v2/<image>/manifests/<tag> your request must include header accept: application/vnd.docker.distribution.manifest.v2+json in response, image id in content-docker-digest response header.

security - How can a server know the request is coming from client, not an eavesdropping hacker? -

i have simple question can not find simple answer to, missing or don t know how networking concept works. , want know don t know. simply, question while eavesdropping possible, how can server know request coming client, not eavesdropping hacker. scenario : whatever security policy having, should send client. might asymmetric encrypted token or sth. client has no private key, whatever client able do, send etc, hacker can do, send too. what might logic behind securing web application. there should secret client knows. btw learning jwt , first time learning auth. simple question still unable find answer to. how can server know request coming client, not eavesdropping hacker? it doesn't. it client verify server 1 expects talking to. it's called public key infrastructure . tls/ssl can used connection on https - note not have diffie hellman, there other key exchange mechanisms such rsa. imagine following scenario. client --> https --> exam

javascript - How can i use both onclick() function and POST method with form together? (php) -

i new php , need help. make practice decided work on project has similar points twitter .my problem when click submit button, button value didnt change. if put code out of form worked. need post control if value follow or followed. if followed code register id database. if turns follow delete id db.(i didnt write part yet , sorry, code little bit sketchy). there way solve problem? thank already. <div id="bilgi"> <h3> <?php $name=$row["name"]; echo $name; ?> </h3> <h5>hey there! can follow me if want see tweets.</h5> <?php if ( $_post['butt']=="followed") { $sqlr = "insert follow(member_email,person_email) values ('$email','$term')"; $rqu = mysqli_query($conn,$sqlr); } ?> <div id="bbbb"> <form action="" method="post"> <inpu

angularjs - creating externalregistration page in Identityserver3 -

i have identityserver3 service running great, service doing custom authentication , using angular pages redirect permissions, index, login , logoff pages in identityserver3 example - customuser. now, need add external providers (say google). not sure understand how redirect "someexternalregistration" after google authenticate page ask user userid of our system associated google login on future calls. so url identity service https://server/identity/login , https://server/identity/permissions etc..... how map https://server/identity/someexternalregistration html page? thank mark identityserver long user triggers link external idp displayed on login page. identityserver shows links querying registered authentication middleware in katana pipeline.

javascript - d3 - rescaling y axis after plot is already done? -

(how) can rescale whole plot? i using own fork of mbostock's "multi-line voronoi" , , encountering dataset in makes sense rescale y axis. showing less of "y.domain". interactively, perhaps +/- buttons. have +/- buttons ready lol - , have been able rescale y-axis itself. not yet plotted timeseries lines. do have delete lines, voronoi areas, etc. , redraw whole thing? or there cool d3 command rescale whole diagram? thanks!

Type casting error while parsing json response for int value in java -

i parsing below json , want fetch value of enterpriseflag "cardholderdetails": { "firstname": "manoj", "lastname": "pandy", "profileimageurl": "https://www.mark.com/imagelinkimages/mk0557/pandey,manoj_500617996.jpg", "buildingnumber": "mk0557", "cardholderinstid": 0, "enterpriseflag": 6 } below code int cardholderinstid = cardholderdetail.get("cardholderinstid"); system.out.println(cardholderinstid); it shows error type mismatch: cannot convert object int , shows option cast integer, int cardholderinstid = (integer) cardholderdetail.get("cardholderinstid"); system.out.println(cardholderinstid); if cast integer , prints value shows error. (exception in thread "main" java.lang.classcastexception: java.lang.long cannot cast java.lang.integer @ com.jason.ex

c++ : "no matching function for call to" error with function -

i have function "mod_kadane" defined in class "max_sub_mat" returns object. #define dx 101 class max_sub_mat { public: int curr_sum, max_sum, left, right, up, down; max_sub_mat mod_kadane(int mat[dx][dx], int row, int column) { max_sub_mat objx; curr_sum = objx.max_sum = int_min; int sub_mat[row]; for(int l = 0; l < row; l++) { memset(sub_mat, 0, sizeof sub_mat); for(int r = l; r < column; r++) { for(int = 0; < row; i++) { sub_mat[i] += i;//mat[i][r]; } max_sub_arr obj; obj = obj.kadane(sub_mat, row); curr_sum = obj.maxima; if(curr_sum > objx.max_sum) { objx.max_sum = curr_sum; objx.left = l; objx.right = r; objx.up = obj.left; objx.down = obj.right; } } } return objx; } }; but wh

How to duplicate operations & placeholders in Tensorflow -

suppose have 2 neural network model defined each 1 input placeholder , 1 output tensor. these 2 outputs need 3 separate values. inputs: i1, i2, outputs: o1, o2 = 1 b = 2 v1 = session.run(o1, feed_dict={i1: a}) v2 = session.run(o1, feed_dict={i1: b}) v3 = session.run(o2, feed_dict={i2: a}) the problem need feed these 3 values loss function can't above. need do loss = session.run(l, feed_dict={i1: a, i1: b, i2:a }) i don't think can if still have ambiguity in later operations since o1 input i1 used differently o1 input i2. i think solved having 2 input placeholders , 2 outputs in first neural network. given have model there way restructure inputs , outputs can accommodate this? visually want turn i1 ---- (model) ----- o1 into i1a o1a \ / \ / x ----- (model) ----- x / \ / \ i1b o1b your

java - Store the main class values in subclass as an Array -

please me add array in student class. input values in main class needs stored in student class , can displayed calling method showdata(). import java.util.scanner; public class library { public static void main(string[] args) { student record = new student(); int roll; string name; int mob; int i; scanner sc = new scanner(system.in); system.out.println("enter roll numer of student \n"); roll = sc.nextint(); system.out.println("enter name of student \n"); name = sc.next(); system.out.println("enter mobile number of student \n"); mob = sc.nextint(); record.getdata(roll, name, mob); record.showdata(); } } this subclass student public class student { int roll; string name; int mob; int = 0; void getdata(int roll, string name, int mob) { this.roll = roll; this.name = name; this.mob = mob; } void showdata() { //for(i=0; < 3; i++) system.out.println("roll num

Cannot use Android Crop image crop library in Android -

i developing android project. in project, want add crop image feature. used library, https://github.com/jdamcd/android-crop . when use it. giving me error. please see scenario below. this how installed. i put in grandle, compile 'com.soundcloud.android:android-crop:1.0.1@aar' i put in manifest file, this how using in code. i open image picker this crop.pickimage(currentactivity.this, image_chooser_request_coode); in onactivityresult, doing this @override protected void onactivityresult(int requestcode, int resultcode, intent data) { super.onactivityresult(requestcode, resultcode, data); if(requestcode==image_chooser_request_coode && resultcode == result_ok) { crop.of(data.getdata(),null).assquare().start(createitemactivity.this); } else if(requestcode == crop.request_crop && resultcode == result_ok) { uri filepath = data.getdata(); } } but after crop image , click "ok", result of activit

testing - How to fix "Failed to get UI hierarchy" issue while recording espresso test in android studio -

Image
i getting dialog when trying add assertion. thanks interest in test recorder feature in android studio. similar issue reported @ android studio issues tracker site , team investigating shortly. please stay tuned , track progress there directly.

Grails 3 spring.Security override Register form -

i new grails , trying use spring.security.ui plugin. used grails s2ui-override auth override login form , added link register form. can redirect standard plugin register from, customize register form. when run grails s2ui-override register register, error: copying register resources | rendered template registercontroller.groovy.template destination grails-app/controllers/register/registercontroller.groovy | error command [s2ui-override] error: class path resource [layouts/register.gsp] cannot opened because not exist (use --stacktrace see full trace) i solved coping code spring security ui plugin grails 3 github repo project.

python - How do I select and store columns greater than a number in pandas? -

i have pandas dataframe column of integers. want rows containing numbers greater 10. able evaluate true or false not actual value, doing: df['ints'] = df['ints'] > 10 i don't use python i'm going round in circles this. i've spent 20 minutes googling haven't been able find need.... edit: observationid recordkey gridreference sitekey sitename featurekey startdate enddate ptaxonversionkey taxonname authority commonname ints 0 463166539 1767 sm90 nan nan 150161 12/02/2006 12/02/2006 nbnsys0100004720 pipistrellus pygmaeus (leach, 1825) soprano pipistrelle 2006 1 463166623 4325 tl65 nan nan 168651 21/12/2008 21/12/2008 nhmsys0020001355 pipistrellus pipistrellus sensu stricto (schreber, 1774) common pipistrelle 2008 2 463166624 4326 tl65 nan nan 168651 18/01/2009 18/01/2009 nhmsys0020001355 pipistrellus pipistrellus sensu stricto (schreber, 1774) common pipistrel

html - Selenium IDE (only) need to locate input by text value -

here problem best can give it there system in people check off various entries when do, these entries generate tables of elements in location filled out way system works, order in fill out things order in these items appear. not able change code or coding standards. can work have, , have complicated ajax pages variable names change works. up until now, ide has been great!!! but want grab location of textbox want work use go dom , down other elements using xpath axes the first step in locate textbox value in it. can find box using css value this: //input[@value="test"] not work i using ide now... , employer not wish move (yet) driver (what boss wants boss gets, regardless of how hard me do) ie. have locate element contents, add data elements in block using xpath axes i have tried tons of things avoid complication , nothing seems work in finding element here code 1 block of 24 repeating blocks contents can different based on kind of item listed in textb

android - Lifecycle of fragments when user "quits" -

i have main activity showing/hiding bunch of fragments. there login activity @ start logs user in. when user presses home or multi-tasking button, app should start timer (after timer runs out) automatically logs user out. when user returns app (and timer has run out -> logout) or while in app , has done nothing. what gets called when user presses home/multi-tasking button in terms of fragment's lifestyle methods? in quick tests, seems first fragment in fragment manager's onpause called everytime no matter fragment on screen when user exits out. how can go this? please have @ tutorial fragment-lifecycle: http://developer.android.com/reference/android/app/fragment.html#lifecycle it explains lifecycle of fragment respect activity . when user presses home-button example: onpause() - fragment no longer interacting user either because activity being paused or fragment operation modifying in activity.

angularjs - phantomjs only serving index page when running a curl command -

i using ajax-seo index angularjs app crawlers. followed instruction setup same. after running curl mydomain.com/?_escaped_fragment_=/ phantomjs serving index page well, when try access other pages curl mydomain.com/?_escaped_fragment_=/id/1 , still serves same index page. when same page accessed on web url mydomain.comf/id/1 gives proper result. on this?

google app engine - Cross platform go code for appengine -

what go appropriate way create fetchurl/geturl function works command line , works google app engine custom way fetch url. i have basic code fetches , processes data on url. want able call code use on desktop, , code deployed app engine. hopefully thats clear, if not please let me know , ill clarify. if have code works both on local machine , on appengine environment, have nothing do. if need should or must done differently on appengine, need detect environment , write different code different environments. this detection , code selection easiest done using build constraints . can put special comment line in beginning of .go file, , may or may not compiled , run depending on environment. quoting the go blog: app engine sdk , workspaces (gopath) : the app engine sdk introduces new build constraint term: "appengine" . files specify // +build appengine will built app engine sdk , ignored go tool. conversely, files specify // +build !appengi

html - Media queries transition issues -

i have 3 different media queries in website , when pass 1 another, reducing browser window, transition not fluid. page changes layout few moments , continues next media query. can't figure problem out , using skeleton should smooth. this website, try no shrink page , see before passing tablet or mobile layout acts strange. http://www.andrearizzotto.com change media queries ranges 993px-801px , 800px-480px

Ruby on rails - Simple form not displaying errors for radio select. Other errors display fine -

i have user registration form (devise) 4 elements; username, email, password , 'user type'. user type boolean , displayed radio select on form. errors username, email , password show no problem, no errors showing if user doesn't select 1 of radio buttons. validation in place, , form won't send without 1 of radio buttons selected, no errors. the form: <%= simple_form_for(resource, as: resource_name, url: registration_path(resource_name)) |f| %> <%= f.error_notification %> <div class="role-selector"> <p class="type-sel-txt"><%= t('front.whattype') %></p> <label for="artistuser"> <%= f.radio_button :artist, "1", :id => "artistuser" %> <span class="artistuser-sel"><%= t('front.bandm') %></span> </label> <label for=

php - Echo price of product in virtuemart cart -

i use joomla 2.5 , virtuemart 2. tried echo script built php. inside cart file inside foreach function goes through each product need save variable product id, quantity , sales price. i can show product id , quantity this: $wantedproductid = $product->virtuemart_product_id; $wantedproductquantity = $product->quantity; but have problem price. echoed $this , this: virtuemartcart object ( [products] => array ( [812] => stdclass object ( [virtuemart_manufacturer_id] => 11 [slug] => hill-s-puppy-healthy-development-large-breed-koutavia-anaptyksi-kotopoulo-11kg [published] => 1 ... ... [pricesunformatted] => array ( [baseprice] => 70.6 [basepricewithtax] => 0 [discountedpricewithouttax] => 60.31 [salesprice] => 60.31 [taxamount] => 0 [salespricewithdiscount]

Org-Mode percentage value -

is there way assign percentage value headings when marked done? * heading 1 (100%) ** heading 1.1 (20% of total) ** heading 1.1 (50% of total) ** heading 1.1 (30% of total) default 33% each. you handle checkboxes : * cheese [50%] * [x] fancy [100%] * [x] red leicester * [x] tilsit * [x] caerphilly * [x] bel paese * [x] red windsor * [-] fancy [33%] * [x] stilton * [x] gruyère * [ ] emmental * [ ] norwegian jarlsberg * [ ] liptauer * [ ] lancashire

javascript - Access Data from Factory in angular -

defining module var app = angular.module("sachin", ["ng-fusioncharts"]); //making service app.service('team',function(){ var self = { 'runs_aus':0 }; return self; }); making factory app.factory('taskfactory',function($scope,team){ $scope.mydatasource = { chart: { caption: "runs opposition", subcaption: "runs against each team", numberprefix: "", theme: "ocean" }, data:[{ label: "australia", value: self.runs_aus }, { label: "pakistan", value: "7300" }, { label: "south africa", value: "5900" }, { label: "west indies", value: "5200" }, { label: "england", value: "3300" }] }; return mydatasource; }); injecting factory

c++ - HTTPS with Poco: Certificate verify failed -

i'm trying https running using poco library using little program: int main() { // debugging purposes inspect verification errors. sharedptr<invalidcerthandler> invalidcerthandler(new invalidcerthandler()); uri uri("https://google.com/"); context::ptr ctx = new context(context::client_use, "", context::verificationmode::verify_relaxed, 9, true); sslmanager::instance().initializeclient(nullptr, invalidcerthandler, ctx); httpsclientsession httpsession(uri.gethost(), uri.getport(), ctx); httprequest request(httprequest::http_get, uri.getpath(), httprequest::http_1_1); httpresponse response; try { httpsession.sendrequest(request); httpsession.receiveresponse(response); } catch (exception ex) { cout << ex.message() << endl; return -1; } cout << "success" << endl; return 0; } unfortunately following exception message when r

ios - Add button over subview which is again over a superview -

i have uiviewcontroller main view , have added subview called "supporteview". adding button programmatically on supportview. buttons not visible due reason , when load buttons on main view able see buttons. [self.view addsubview:self.supportview]; [self.view bringsubviewtofront:self.supportview]; [self.supportview addsubview:self.btn]; [self.supportview bringsubviewtofront:self.button]; i have added slider in supportview , loading buttons. try add button 1st supportview add supportview view. can use view inspector see button https://www.raywenderlich.com/98356/view-debugging-in-xcode-6 this check frame , constraint @ runtime

javascript - Splitting up React components into multiple files -

i have been learning react in week new , trying write simple todo app. originally wrote of components in 1 file , loaded file html file , worked great. refactoring , trying split components different files. my full code on github https://github.com/yasgreen93/todolist-react on extracting-files branch. i have split each component different files , have linked them in script tags html. html file looks like: <!doctype html> <html> <head> <meta charset="utf-8"> <title>todo list</title> <link rel="stylesheet" href="css/styles.css"> <script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.0.1/react.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.0.1/react-dom.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.6.16/browser.js"></script> <script src=&quo

qt4.8 - parsing xml inside a node with Qt and Xquery -

i'm trying parse following content qt4.8. qstring l_dynamicresult("<?xml version=\"1.0\"?>\ <u:browseresponse xmlns:u=\"urn:schemas-upnp-org:service:contentdirectory:1\">\ <result>&lt;didl-lite xmlns=&quot;urn:schemas-upnp-org:metadata-1-0/didl-lite/&quot; xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot; xmlns:upnp=&quot;urn:schemas-upnp-org:metadata-1-0/upnp/&quot; xmlns:sec=&quot;http://www.sec.co.kr/&quot; xmlns:dlna=&quot;urn:schemas-dlna-org:metadata-1-0/&quot;&gt;&lt;container id=&quot;0/1&quot; parentid=&quot;0&quot; restricted=&quot;1&quot;&gt;&lt;dc:title&gt;fichiers&lt;/dc:title&gt;&lt;upnp:class&gt;object.container.storagefolder&lt;/upnp:class&gt;&lt;/container&gt;&lt;container id=&quot;0/0&quot; parentid=&quot;0&quot; restricted=&quot;1&am

c# - Specified cast is not valid, getting all values from jagged array -

specified cast not valid, please tell me way max/min value values stored in array, not specific index. int max = jarray.cast<int>().max(); system.console.write("\n\n max marks:" + max ); declaration of jagged array: string totalstudents; system.console.write("enter total no. of students:"); totalstudents = console.readline(); int value; bool result = int.tryparse(totalstudents, out value); jaggedarray jag = new jaggedarray(value); int[][] jarray = new int[jag.noofstudents][]; (int = 0; < jag.noofstudents; i++) { system.console.write("enter total no. of subjects of student:" + + ":\t"); string totalsubjects = console.readline(); int subjectvalue; bool sresult = int.tryparse(totalsubjects, out subjectvalue); jarray[i] = new int[subjectvalue]; (int = 0; < subjectval

excel vba - Copy VBA code from a Sheet in one workbook to another? -

i've been using lines below compy vba modules 1 workbook , don't know if there easier way, have been working fine: set srcvba = srcwbk.vbproject set srcmodule = srcvba.vbcomponents(modulename) srcmodule.export (path) 'export source trgtvba.vbcomponents.remove vbcomponent:=trgtvba.vbcomponents.item(modulename) 'remove target trgtvba.vbcomponents.import (path) 'import target however need copy vba code in sheet, not in module. above method doesn't work scenario. what code can use copy vba code in sheet 1 workbook another? you can't remove , re-import vbcomponent , since logically delete whole worksheet. instead have use codemodule manipulate text within component: dim src codemodule, dest codemodule set src = thisworkbook.vbproject.vbcomponents("sheet1").codemodule set dest = workbooks("book3").vbproject.vbcomponents("thisworkbook") _ .codemodule dest.deletelines 1, dest.countoflines dest.addfromstring

c# - Selection Sort trouble with indexes -

actually i'm dealing codeabbey problem, don't want answer code, explenation that, doing wrong. http://www.codeabbey.com/index/task_view/selection-sort my selection sort works without problems, don't know why not proper indexes (when sorting works!). i.e. input data: 5 1 3 6 2 4 7 9 8 0 got sorted 0 1 2 3 4 5 6 7 8 9 , wished. here code: using system; using system.collections.generic; using system.linq; using system.text; using system.threading.tasks; namespace selectionsort { class program { static void main(string[] args) { int howmany = int.parse(console.readline()); //length of array list<int> base = new list<int>(array.convertall(console.readline().split(), int.parse)); //input array (i.e. 5 1 3 6 2 4 7 9 8 0 => { 5, 1, 3, 6, 2, 4, 7, 9, 8, 0 }) list<int> output = new list<int>(); // list store sorted array string[] ans = new string[howmany]; // array storing answers