Posts

Showing posts from March, 2015

sqlite - Laravel: PHP Artisan Tinker 'SQLSTATE[23000]' error -

Image
so going through series of intro videos laravel , @ database migration part , struggling few things... here error... i have a) no idea means or referring first foray real command prompt usage , b) how fix it. any appreciated. regards. edit-1: here migration file... <?php use illuminate\database\schema\blueprint; use illuminate\database\migrations\migration; class createcardstable extends migration { /** * run migrations. * * @return void */ public function up() { schema::create('cards', function (blueprint $table) { $table->increments('id'); $table->string('title'); $table->timestamps(); }); } /** * reverse migrations. * * @return void */ public function down() { schema::drop('cards'); } } edit 2: here command prompt, working answer below, original laracast tutorial. it means have s...

javascript - How to set performance and appearance settings in Autodesk Viewer? -

i have been having trouble using javascript preset performance , appearance settings viewer. wanted pre-define of settings anti-aliasing, , shadows off on load. new api , couldn't figure out how instantiate viewer3d object. finally figured out answer , posted below. i have figured out how in extension if else wondering function myextension(viewer, options) { autodesk.viewing.extension.call(this, viewer, options); // preset performance settings viewer.setlightpreset(1); viewer.setqualitylevel(false, false); viewer.setghosting(true); viewer.setgroundshadow(false); viewer.setgroundreflection(false); viewer.setenvmapbackground(false); viewer.setprogressiverendering(true); }

How to disable certain component from Bootstrap on Laravel -

one imagine i'm not 1 trying achieve this, surprised couldn't find answer in google. i'm googling wrong keywords perhaps.. i'm looking way disable glyphicons component bootstrap on laravel application. i'm using sass version of bootstrap. only way can imagine comment out line @import "bootstrap/glyphicons"; inside node_modules/bootsrap-sass/assets/stylesheets/_bootstrap.scss if understood correct, bad idea since content of directory overwritten updates on bootstrap module. right? how else prevent sass processor importing glyphicons? would lasting solution take copy of _bootstrap.scss file resources/assets/sass/ , , there comment out glyphicon-line , reference file app.scss ? as long-term project, want careful architecture... ended solving way suggested in post: copy _bootstrap.scss node_modules/bootstrap-sass/assets/stylesheet resources/assets/sass/ @import copied file app.scss instead of 1 in node_modules directory. co...

java - How do I convert dateformat from Date to April 19th or April 22nd -

this question has answer here: how format day of month “11th”, “21st” or “23rd” in java? (ordinal indicator) 13 answers is there way convert date object string. example, date date = ......... ; date.tostring shows wed april 17 00:00:00.0 cest 2016" and want display april 17th, removing informations. use simpledateformat : string strdate = new simpledatformat("mmm dd").format(date); as st/rd/th need add manually, e.g. doing if , appending strdate .

Static Tomcat Cluster become unresponsive on a JDBC procedure call -

stackoverflow has been way of life me time question rather looking answer have exhausted options. apologies long description of issue ! we have spring mvc application + tomcat 7 running on windows 2012 server on aws .being analytics application invoking heavy duty procedure calls doing statistical calculations in backed . with a high availability requirement need setup cluster .now no multicasting on aws resorted 2 other options .(i must first foray aws , tomcat in production environment ) 1.static tomcat cluster deltamanager session replication 2.redis based session replication (will long shot windows server , sticky session ) starting static tomcat cluster ,which did set out fuss , went on configure apache httpd mod_proxy load balancer . <cluster classname="org.apache.catalina.ha.tcp.simpletcpcluster" channelsendoptions="8" channelstartoptions="3"><!--startoption 3 added disable multicast ,channel send option 8 async replica...

Couldn't extract the data from large partition in cassandra -

i realized after sometime partition size in cassandra data model incorrect. , had designed primary key created 1 partition. so, getting read timeout in queries. have fixed issue creating new column family problem how recover data partition appreciated. have around 40gb of partition given below : 38g ./eventdata-7b5004e02bdc11e69ebb19dbbcf6d4b0 55m ./eventdata-8f8317a01e5711e69ebb19dbbcf6d4b0 2.4m ./eventdata-3c20dd401cf911e69ebb19dbbcf6d4b0 88k ./eventdata-1866015012a911e69ebb19dbbcf6d4b0 so, read data using sstable2json convert in json gave error : exception in thread "main" java.lang.outofmemoryerror: gc overhead limit exceeded @ java.nio.heapbytebuffer.duplicate(heapbytebuffer.java:107) @ org.apache.cassandra.db.composites.abstractctype.slicebytes(abstractctype.java:369) @ org.apache.cassandra.db.composites.abstractcompoundcellnametype.frombytebuffer(abstractcompoundcellnametype.java:101) @ org.apache.cassandra.db.c...

Azure BizTalk Transform Service API ARM Template Creation -

Image
i have created below arm template creating "biztalk transform service "(api app) using in logic apps. { "type": "microsoft.web/sites", "apiversion": "2015-08-01", "name": "[parameters('apiapps_customertransformation_name')]", "location": "[resourcegroup().location]", "kind": "apiapp", "tags": { "packageid": "transformservice" }, "properties": { "name": "[parameters('apiapps_customertransformation_name')]", "gatewaysitename": "[parameters('gatewayname')]", "serverfarmid": "[resourceid('microsoft.web/serverfarms', parameters('svcplanname'))]", "siteconfig": { "appsettings": [ ...

html - Make flexbox grid have a horizontal scroll bar on mobile -

i'm trying figure out how make table have bottom horizontal scroll bar. html: <div class="grid-block table"> <div class="grid-block header"> <div class="grid-block small-2 column"> times 6 </div> </div> <div class="grid-block row"> <div class="grid-block small-2 column"> times 6 </div> </div> </div> i have used css thinking fix problem. .table { overflow: auto !important; width: 1400px !important; } i've added importants @ moment make sure these stylings applied. i should point out every element here flex item. cheers this code might started. .wrapper { width: 100%; overflow: auto; white-space: nowrap; font-size: 0; } .wrapper .child { font-size: 1rem; height: 50px; width: 60px; display: inline-block; background-color: cornflowerblue; text-align: center; b...

javascript - How can I get the color from a pixel on the screen in React Native? -

i render photograph, , allow user select color touching on it. cannot find anyway retrieve painted pixels under touch event. any help? see example.. using ontouchlistener detect touch on imageview.. @override public boolean ontouch(view view, motionevent event) { float eventx = event.getx(); float eventy = event.gety(); float[] eventxy = new float[]{eventx, eventy}; int x = integer.valueof((int) eventxy[0]); int y = integer.valueof((int) eventxy[1]); drawable imgdrawable = ((imageview) view).getdrawable(); bitmap bitmap = ((bitmapdrawable) imgdrawable).getbitmap(); //limit x, y range within bitmap if (x < 0) { x = 0; } else if (x > bitmap.getwidth() - 1) { x = bitmap.getwidth() - 1; } if (y < 0) { y = 0; } else if (y > bitmap.getheight() - 1) { y = bitmap.getheight() - 1; } in...

json - Here Maps Routing -

we experiencing problem while using service https://route.st.nlp.nokia.com/routing/6.2/calculateroute.json since july 21, 2016, attempts use service end-up following response: failed load resource: server responded status of 503 (service unavailable: back-end server @ capacity) we using test plan (90-day trial of entire platform) while searching information on issue, have found problem exists on demo-page example of route calculation: https://developer.here.com/apiexplorer-v2-sample-data/template-rest-default/examples/enterprise-truck-route-from-a-to-b/index.html what reason problem? solution can apply overcome problem? thank in advance. it seems nokia.com not supported anymore, https://developer.here.com/news/20160310 . i suggest try https://developer.here.com/rest-apis/documentation/routing/topics/request-a-truck-route.html

java - Why I obtain a black background when I create a new Bitmap in this way? How can I obtain a transparent backround? -

i pretty new in android development , have following problem. i have implement code draw bitmap using canvas (it draw 5 icons 1 beside each other), code: @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); // retrieve imageview having id="star_container" (where put star.png image): imageview myimageview = (imageview) findviewbyid(r.id.star_container); // create bitmap image startin star.png "/res/drawable/" directory: bitmap mybitmap = bitmapfactory.decoderesource(getresources(), r.drawable.star); // create new image bitmap having width hold 5 star.png image: bitmap tempbitmap = bitmap.createbitmap(mybitmap.getwidth() * 5, mybitmap.getheight(), bitmap.config.rgb_565); /* attach brand new canvas new bitmap. canvas class holds "draw" calls. draw something, need 4 basic components: 1) bitmap hold pixels. ...

c++ - Rotate points openGL -

Image
i've trying generate figures revolution reading profile of figure ply. follow steps here , other similar questioons, problem persist. when try rotate ply 2 points 36 stesps if puth camara on top cilinder: my code after revision of method rotate is: void figura::rotatey(int ngiros){ //variables de rotacion. //double alfa = 2*m_pi/ngiros; int long_perfil = vertices.size(); vector<_vertex3f> new_vertices; cout << long_perfil << " vertices" << endl; _vertex3f aux1, aux2; for(int i=0; < ngiros; i++){ double alfa = (2*m_pi/ngiros)*i; for(int j=0; j < long_perfil; j++){ aux1 = vertices.at(j); aux1._0 = (cos(alfa) * aux1._0) + (sin(alfa) * aux1._2); aux1._2 = (cos(alfa) * aux1._2) - (sin(alfa) * aux1._0); vertices.push_back(aux1); } } //vertices.clear(); //vertices = new_vertices; //caras for(int i=0; < vertices.size(); i++){ _vertex3i aux(i, i+1, i+long_pe...

ios - Issue with setting image UILabel swift - found nil while unwrapping optional -

code looks this: lazy var placelabel: uilabel = { let label = uilabel() label.backgroundcolor = uicolor(patternimage: uiimage(named: "placelabel")!) label.translatesautoresizingmaskintoconstraints = false return label }() i'm not sure why when input label.backgroundcolor() program can't run , breaks on line. "fatal error: unexpectedly found nil while unwrapping optional value" when remove , continue setup seems run fine. i've seen other comments on issues saying view isn't setup when command called i'm pretty doing exact same thing buttons , whatnot , it's working fine. any idea why happening? thanks in line, uicolor(patternimage: uiimage(named: "placelabel")!) , forcing unwrapping of uiimage object using ! . if no image named "placelabel" exists in project, app crash, trying unwrap nil.

Keypress event not working on Android device -

i have directive controls input value desired formatted or not. directive('validnumber', function(sharedataservice) { return { require: 'ngmodel', link: function(scope, element, attrs, ngmodelctrl) { if(!ngmodelctrl) { return; } ngmodelctrl.$parsers.push(function(val) { if (angular.isundefined(val)) { var val = ''; } var clean = val.replace(/[^-0-9\.]/g, ''); var decimalcheck = clean.split('.'); if(!angular.isundefined(decimalcheck[1])) { decimalcheck[1] = decimalcheck[1].slice(0,2); clean = decimalcheck[0] + '.' + decimalcheck[1]; } if (val !== clean) { ngmodelctrl.$setviewvalue(clean); ngmodelctrl.$render(); } return scope.hesapla(clean); }); element.bind('keypress', function(event) { if(event.keycode === 32) { // space event.preventde...

datetime - Unexpected behavior from python's relativedelta -

i'm getting confusing result when using python's timestamps , my_timestamp timestamp('2015-06-01 00:00:00') my_timestamp + relativedelta(month = +4) timestamp('2015-04-01 00:00:00') naturally expected output timestamp('2015-10-01 00:00:00') what correct way add "months" dates? [edit]: i've since solved using following (in case in pandas has same problem): print my_timestamp print my_timestamp + dateoffset(months=4) 2015-06-01 00:00:00 2015-10-01 00:00:00 the issue using wrong keyword argument. want months instead of month . per the documentation , month denotes absolute information (not relative) , replaces given information, noting. using months denotes relative information, , performs calculation you'd expect: timestamp('2015-06-01 00:00:00') + relativedelta(months=4) 2015-10-01 00:00:00

python - Iterating through a dictionary and subtracting values based on keys -

so have dictionary 1 below, however, trying subtract art[0][0] - art[1][0] , has iteration. this have, doesn't seem work. keep getting error: 'keyerror: 2' any appreciated. in range(1, 5): #from k = j in range (1, 5): #to if == j: pass else: t = art[j][0] - art[i][0] g = art[j][1] - art[i][1] sample input: art = {'u': (5, 6), 'e': (7, 3), 'a': (3, 3), 'o': (3, 2), 'i': (1, 4)} dictionaries accessed key name. see here examples. for example, art['u'] return (5, 6) . in code, you're trying access key 2 , because that's j equal to. however, there no key named 2 in dictionary.

Embedding Native Android Activity in React Native -

i making tab bar in android in react native using library https://github.com/aksonov/react-native-tabs i have open native android activity in 1 of page. can please let me know how embed android activity in react native tabs visible time.

html - CSS conflict issues -

i have 2 separate files of css each styles part of page. specific 1 made master content ( header, footer, etc)and other main content might dynamic. linked 2 css files page, appears style of " main content " riding on style of " master content". how solve problem ? or how restrict second css files target styling of html part can define ? tried !important css property. i linked 2 css files page, appears style of " main content " riding on style of " master content". that's because established styles when loaded master content stylesheet , , loaded main content stylesheet ... overwrote of styles you'd declared. this cascade. what supposed happen . e.g. if have in master content stylesheet : header h1 { color: blue; } and then, afterwards, in main content stylesheet have: h1 { color: red; } your <h1> (in <header> ) red . added: you massive favour acquainting dom inspector (s) browser(s...

linear algebra - Eigenvalues of large symmetric matrices -

when try compute eigenvalues of adjacency matrix of a large graph get, can charitably described as, garbage. in particular, since graph four-regular, eigenvalues should in $[-4, 4]$ visibly not. used matlab (via matlink), , got same problems, issue transcends mathematica. question is: best way deal it? sure matlab , mathematica use venerable eispak code, there may newer/better

scikit learn - Build splitter.pyx (and splitter.pxd, from tree folder) using Cython on Sklearn -

its simple question, i'm having trouble on building _splitter.pyx _splitter.so (so can try changes made). right i'm trying build original file command: cython -a _splitter.pyx and generates following error: error compiling cython file: ... self.index_to_samples, self.feature_values, end_negative, start_positive) cdef int compare_size_t(const void* a, const void* b) nogil: ^ _splitter.pyx:1008:34: expected ')', found '*' i tried changes like: cython -3 _splitter.pyx or cython -a _splitter.pyx _splitter.pxd but generated more errors. doing wrong? when fixed, plan use command: gcc -shared -pthread -fpic -fwrapv -o2 -wall -fno-strict-aliasing -i/usr/include/python2.7 -o _splitter.so _splitter.c is correct approach? thanks lot help edi...

html - Add total from rows using javascript -

i want add total of values in table below conditions dont know how implement <table id="tableid" width="200" border="1"> <tr> <td class="compulsory">5</td> <td class="compulsory">8</td> <td class="compulsory">8</td> <td class="one">8</td> <td class="one">7</td> <td class="one">6</td> <td class="two">9</td> <td class="two">4</td> <td class="total"></td> </tr> </table> the conditions are; table data class compulsory must added table data class one pick highest 2 values table data class two pick highest 1 value then display total in table data class total how below solution, can refactor further if needed. <html> <body> <table border=...

jquery - Javascript code's dfferent behaviour -

i have piece of code widgetid = "a.b"; func= function(widgetid, tableid, primarycolsearchkey) { widgetid = test(widgetid); } test= function(id) { id = id.replace(/\./g, "\\.").replace(/ /g, "\\ ").replace(/\(/g, "\\(").replace(/\)/g, "\\)"); return id.replace(/\ /g, "\\ "); } if call in program returns a\\.b , if run w3schools website returns a\.b in ie browser. can explain why, want return a\.b in code.

javascript - Protractor - properly handling the errors... -

i've tried put descriptive error message , exit test run via fail() function partial success - appears doing wrong... here code: it('set internal budget', function(done) { var acceptbudgetbutton = element(by.buttontext('accept budget')); page.setinternalbudget(); //setting budget values browser.wait(function() { return browser.iselementpresent(acceptbudgetbutton); }, 30000, 'error - accept budget button not visible.'); acceptbudgetbutton.click(); done(); done.fail('unable setup internal budget. terminating test run'); }); when "accept budget" button not available expected 3 things script: 1) see "accept budget button not visible" error, followed wait time out 2) see "unable setup internal budget. terminating test run" error 3) expect protractor exist test run, got failure. in reality, first expectation met. script keeps on running , don't "unable setup intern...

memory - How to modify .exe file in c#? -

i want change 4 bytes @ specific address of .exe. tried this: string path = @"c:\test\mod.exe"; if (file.exists(path)) { using (binarywriter stream = new binarywriter(file.open(path, filemode.open))) { stream.basestream.position = 0x0032d837; stream.write(stringtobytearray("00050000"), 0, 4); } } stringtobytearray() made this: public static byte[] stringtobytearray(string hex) { return enumerable.range(0, hex.length) .where(x => x % 2 == 0) .select(x => convert.tobyte(hex.substring(x, 2), 16)) .toarray(); } it finds exe nothing gets changed, whats correct way? want add can change manually in hxd hex editor, wanted program it. fixed! turns out windows defender causing mess :(

c++ - Using Media Foundation to encode Direct X surfaces -

i'm trying use mediafoundation api encode video i'm having problems pushing samples sinkwriter. i'm getting frames encode through desktop duplication api. end id3d11texture2d desktop image in it. i'm trying create imfvideosample containing surface , push video sample sinkwriter. i've tried going in different ways: i called mfcreatevideosamplefromsurface(texture, &psample) texture id3d11texture2d, filled in sampletime , sampleduration , passed created sample sinkwriter. sinkwriter returned e_invalidarg. i tried creating sample passing nullptr first argument , creating buffer myself using mfcreatedxgisurfacebuffer, , passing resulting buffer sample. didn't work either. i read through mediafoundation documentation , couldn't find detailed information on how create sample out of directx texture. i ran out of things try. has out there used api before , can think of things should check, or of way on how can go debugging this? fir...

node.js - ES2015 not working with gulp-browserify and vueify -

i'm working on website in node.js , use vueify compile using gulp, it's not working. i've tried using babelify handle es2015, gulp still gives me errors when want use import app './app.vue' example this code var gulp = require('gulp'); var plumber = require('gulp-plumber'); var path = require('path'); var browserify = require('browserify'); var vueify = require('vueify'); gulp.task('build', function() { return gulp.src(path.join(resdir, 'vue/main.js')) .pipe(browserify({ transform: ['vueify', 'babelify'], debug: true })) .pipe(gulp.dest(path.join(destdir, 'javascript'))) }); and main.js import vueresource 'vue-resource' import vue 'vue' import app './app.vue' vue.config.devtools = true vue.use(vueresource) /* eslint-disable no-new */ new vue({ el: 'body', components: { app } })

python - Develop GUI window -

it needs display picture on left , first , last name along birthdate on right side. have far, keeps giving me tcl error saying "no such file or directory" when have file saved onto computer. from tkinter import tk,label,photoimage,left,right root=tk() text=label(root, text="first name: justin\n" "last name: joseph\n" "date of birth:02/17/1995") text.pack(side=right) justin=photoimage(file="justin.gif") justinlabel=label(root, image=justin) justinlabel.pack(side=left) the problem has line: justin=photoimage(file="justin.gif") make sure justin.gif located in right place in file hierarchy (same directory script itself) , called 'justin.gif' (capitalization sensitive).

Run existing Wordpress site using Docker -

i want run existing wordpress site on docker local development. this docker-compose file: version: '2' services: mysql: image: mysql:5.7 volumes: - "./.data/db:/var/lib/mysql" ports: - "9306:3306" restart: environment: mysql_root_password: example_password mysql_database: example_database_name wordpress: image: wordpress volumes: - "./:/var/www/html" links: - mysql ports: - "80:80" restart: environment: wordpress_db_password: example_password wordpress_db_name: example_database_name however, problem have offical wordpress docker image insists on installing wordpress. fine if don't have wordpress installed, causes lot of problems if have installed. frustrating because organised folders internal wordpress files in separate folder called "wp", "wp-content" on separate directory. so question how can run ex...

javascript - angularJS - Accessing JSON keys that have spaces in them -

Image
above picture of json data being returned api. can see of json keys have 2 words space in between them. how can access in angular app. coming in array btw. i have tried: <li ng-repeat="task in maintask.tasks"> {{ task.['car id'] }} </li> with no luck. help. how task['car id'] no period needed between task , opening bracket.

cookies - PHP setcookie won't work -

i baffled problem. setting cookie should easiest thing in world, whatever reason it's not working. i'm trying test-script work. looks this: $cookie_name = "user"; $cookie_value = "john doe"; setcookie($cookie_name, $cookie_value, time() + 86400 * 30, "/"); setcookie("act", "sj", time() + 86400 * 365); setcookie("bbba", "hello", time() + 86400); echo $_cookie['act']; echo $_cookie['bbba']; echo $_cookie['user']; none of these cookies set. nothing echo, , can not find cookies when using inspector. i've tried following: - placing echo $_cookie in file in same directory. - , without ob_start() , ob_flush() - using "/", "/direcotry" , nothing @ path - moving file root directory see if works there. nothing seems work, , cannot see possibly wrong. other scripts using cookies working on same domain - located on web hotel. ca...

Android / Java : Parse Array of JSON coming from Rails -

my server written in rails 4.x , to_json method i'm using return records through api delivering array of json android looks this: [{"id":503240,"name":"bob"},{"id":503241,"name":"tom"}] it comes down android fine , have no problems using string , logging it. now want loop through each item of array grab id (ultimately show on listview). the first thing need "see" each individual object. parsing above using following line of code: jsonarray jsonresponse = new jsonarray(jsonstring); it "parses" no errors, ... when try jsonresponse[1], or jsonresponse.getobject(1) hands on 1 of elements of array (just log example), can't past ide telling me i'm doing wrong. if can address , manipulate individual json objects, i'm sure i'll have no problems addressing individual data elements. it's arrayness of causing problems. i'm little new java , i'm spoiled ruby , swif...

javascript - Showing N list items in React component without JQuery -

after lots of reading on so, i've come conclusion using jquery inside react component part, bad practice. how accomplish following, being react-friendly possible... lets have list in component: let mylist = [ {title: 'list item 1'}, {title: 'list item 2'}, {title: 'list item 3'}, {title: 'list item 4'}, {title: 'list item 5'}, {title: 'list item 6'} ] i want show first 3 items, unless show all clicked. and render() looks like: render () { return ( <div> mylist.map(function(item, i) { <a>{item.title}</a> } <a>show all</a> </div> ) } i know how how in jquery, i'm wondering solution using react best practices. i write function encapsulates logic of show. then, you'll need use state capture whether show clicked or not, can differentiate when want show first 3 , when want show all. key return array ...

vba - Capture the event while moving the mail from subfolder to inbox -

i have requirement capture event when mail moved subfolder inbox the folder structure below myarchive-mailbox name inbox main folder requests sub folder myarchive inbox requests when email moved requests subfolder inbox, of myarchive mailbox name ,this mailbox item should captured , event handler should invoked. i have implemented code capturing event when file moved myarchive inbox requests.the code have written below private withevents items outlook.events private sub application_startup() dim olapp outlook.application dim objfolder outlook.mapifolder dim objns outlook.namespace set olapp =outlook.application set objns =olapp.getnamespace("mapi") set objfolder = objns.folders("myarchive") set objfolder=objfolder.folders("inbox") set items=objfolder. folders("requests").items end sub private sub items_itemsadd(byval item object) msgbox "you moved mail requests folder" en...

"mode" doesn't run in python 3.5 subprocess -

i have encountered bit of conundrum while working on automation project. when try run: program = subprocess.run("mode") i get: filenotfounderror: [winerror 2] system cannot find file specified however, when replace mode ipconfig: program = subprocess.run("ipconfig") it runs fine. anyone got explanation? using batch file run mode command, change arguments without editing batch file. edit 1: i tried using os.system: os.system("mode") and worked. edit 2: now answer original problem understand going on. in actual meaning of 'shell=true' in subprocess pretty says shell=true should shy away from. filenotfounderror: [winerror 2] system cannot find file specified is tipped me off might want shell=true in subprocess call. if file can't found means 1 of 2 things: it's not on path. it's not actually file. for instance, in linux: $ echo echo: shell built-in command that makes pretty obviou...

r - plotly multiple plot facet -

Image
i'd multi plots 2 axis on each plot this library(plotly) ay <- list( tickfont = list(color = "green"), overlaying = "y", side = "right", title = "y2 axis title" ) par(mfrow=c(2,1)) ax <-list(title = "x axis title") ay1 <-list(title = "y1 axds title") plot_ly(x = 1:3, y = 10*(1:3), name = "slope of 10") %>% add_trace(x = 2:4, y = 1:3, name = "slope of 1", yaxis = "y2") %>% layout(title = "double y axis", yaxis2 = ay, xaxis = ax, yaxis = ay1) ax <-list(title = "x axis title") ay1 <-list(title = "y1 axds title") plot_ly(x = 1:3, y = 10*(1:3), name = "slope of 10") %>% add_trace(x = 2:4, y = 1:3, name = "slope of 1", yaxis = "y2") %>% layout(title = "double y axis", yaxis2 = ay, xaxis = ax, yaxis = ay1) but when run code still see 1 plot. can plotly multiplots? can fac...

camera - QR code-like alternative with extremely low error rate and ability to read bent codes -

i'm trying find alternative qr codes (i'd willing accept entirely novel solution , implement myself) meets specifications. first, codes end on thin pipes, , need readable around cylinder. advantage effect on image wrapping around cylinder easy express geometrically, , codes never placed on irregular shape. second, read accuracy must high, read mistake extremely costly. if means larger codes more redundancy better error correction, it. third, ability read average smartphone camera few inches out. fourth, storage space of around half kilobyte per code. do know of such code? the data matrix rectangular extension (dmre) improves upon standard set of rectangular data matrix symbol sizes in algorithmically compatible manner, increasing range of suitable applications no real downsides. reliable cylindrical marking primary use case. regardless of symbology unable approach sufficient data density achieve 0.5kb of binary data in single compact, narrow symbol sca...

php - foreach loop create a duplicated of last iteration -

so have php foreach loop inserts many images upload in directory , creates row in db it. works great except duplicating last iteration. i have tried doing array_splice didn't work. i know query subject sql injections , fix once iteration duplication sorted. $errors= array(); foreach($_files['userfile']['tmp_name'] $key => $tmp_name ){ $file_name = time().$_files['userfile']['name'][$key]; $file_size =$_files['userfile']['size'][$key]; $file_tmp =$_files['userfile']['tmp_name'][$key]; $file_type=$_files['userfile']['type'][$key]; if($file_size > 2097152){ $errors[]='file size must less 2 mb'; } $query="insert table (user_id, filename) values ('$user_id', '$file_name')"; $desired_dir="/items/"; if(empty($errors)==true){ if(is_dir($desired_dir)==false){ mkdir("$desired...

c# - Unable to load "lpsolve55.dll" in VS2015 on 64-bits OS -

for project working on, need solve mathematical model. chose using microsoft.solver.foundation , solverfoundation.plugin.lpsolve plugin. both associated .dll files these extension seem work fine, vs2015 recognizes , references them without problem , compiles , runs program without errors. this untill try solve optimization, needs "lpsolve55.dll" work. have downloaded dll , put in project's bin/debug folder, kind of reason vs2015 doesn't recognize it. i.e. i can't reference browsing "add reference" tab. it's impossible (un-)register via regsvr32 cmd-prompt application, doesn't have dll (un-)registry entry points. the tlbimp.exe cmd-prompt application can't handle it. so basically, after discovering above (after trying most-common internet solutions), still feel quite dissatisfied error message while try solve optimization - unable load dll 'lpsolve55.dll': specified module not found. (exception hresult: 0x8007007e) ...

vba - Editing code to only copy values and not formulas -

i have code searches text need copied realized carrying on formulas. need paste values of cells. not sure how edit following make happen. thoughts? initiatives.range("b3:b500") rcount = 0 = lbound(myarr) ubound(myarr) set rng = .find(what:=myarr(i), _ after:=.cells(.cells.count), _ lookin:=xlformulas, _ lookat:=xlpart, _ searchorder:=xlbyrows, _ searchdirection:=xlnext, _ matchcase:=false) if not rng nothing firstaddress = rng.address rcount = rcount + 1 rng.entirerow.copy newsh.rows(rcount) set rng = .findnext(rng) loop while not rng nothing , rng.address <> firstaddress end if next end try modifying copy code to: rng.entirerow.copy newsh.cells(rcount,1).pastespecial paste:=xlpasteval...

python - MultiValueDictKeyError - Passing GET parameter -

i'm using django allauth. all users should have access url generated dynamically. ex: www.example.com/uuid/ from page should able login soundcloud , should redirected page after connecting. i using following previous link receiving url in html empty on django. #html <a href="/accounts/soundcloud/login?process=login?next={{request.path}}" name="next" value="next" class="waves-effect waves-light btn-large" style="margin-bottom: 10px;">download</a> #adapter.py class accountadapter(defaultaccountadapter): def get_login_redirect_url(self, request): #assert request.user.is_authenticated() #pass return request.get['next'] you have typo in url - should be: href="/accounts/soundcloud/login?process=login&next={{request.path}}" notice & instead of second ? .

r - RSelenium not working with Firefox -

i know question similar this one , he's trying use chrome while i'm trying use firefox (47.0.1). so basically, i'm trying use rselenium. here code : > library(rselenium) > checkforserver() > startserver() > mybrowser <- remotedriver() > mybrowser$open() and last line, following error. [1] "connecting remote server" error: summary: unknownerror detail: unknown server-side error occurred while processing command. class: org.openqa.selenium.webdriverexception i tried removing-reinstalling rselenium package. tried this answer recommends, no result. thanks in advance. edit 1 : > sessioninfo() r version 3.2.3 (2015-12-10) platform: x86_64-w64-mingw32/x64 (64-bit) running under: windows >= 8 x64 (build 9200) locale: [1] lc_collate=french_france.1252 lc_ctype=french_france.1252 lc_monetary=french_france.1252 lc_numeric=c [5] lc_time=french_france.1252 attached base packages: [...

objective c - Multiple Xcode projects will no longer successfully compile on a real iOS device -

i might have accidentally edited nsattributedstring.h class and/or related class, , seems xcode projects including projects create not compile on iphone (iphone 4s ios version: 9.3.2) (my deployment target ios 9.0.). the xcode projects build , deploy simulated iphone. here edited list of errors when try , compile app iphone: system/library/frameworks/foundation.framework/headers/nsattributedstring.h:13:2: prefix attribute must followed interface or protocol system/library/frameworks/foundation.framework/headers/nsattributedstring.h:16:1: expected method body system/library/frameworks/foundation.framework/headers/nsattributedstring.h:23:1: expected method body system/library/frameworks/foundation.framework/headers/nsattributedstring.h:26:1: expected method body system/library/frameworks/foundation.framework/headers/nsattributedstring.h:30:1: expected method body system/library/frameworks/foundation.framework/headers/nsattributedstring.h:32:1: expected method body system/librar...

swift - after updating to iOS version 9.3.3, redirect url to launch app not working -

in app, have web view load login screen(html page) authenticate (oauth). after authentication succeeds redirect flow native app screen using custom uri scheme receive in response. setup working in iphone device version 9.2.1 until updated ios version 9.3.3. not getting proper redirect url, , instead getting error pop-up message "error: url can;t shown" i know lot of changes happened in latest update released apple, on webkit. has else faced similar issue? bug in new update ? would appreciate if me reason why redirect failed after update ? thanks in advance welcome security upgrade 9.3.3! deep links! 1st should embrace universal links , forget url schemes ... check transition tutorial: https://blog.branch.io/ios-9.2-deep-linking-guide-transitioning-to-universal-links in case don't want use universal links... which delegate method using scheme call? guess using: -(bool) application:(uiapplication *)application openurl:(nsurl *)url sourceapplica...

c# - Azure WebSite remote debug with asp.net core: Symbol not loading -

i trying debug asp.net core apps running in azure website. it's net452 app (because uses of nuget packages have not yet built .net core). using vs2015 (dev14) update 3 latest azure sdk (2.9.1). i use cloud explorer attach vs2015 debugger azure web api. attached page of breakpoints not hit because no symbol loaded. far here have tried: stop , start web app multiple times publish website in debug profile (debug - x86 profile) double check if vs attached right process (in case, webapplication1.exe) also attach wp3 process manually attach vs debugger azure website look @ module window, , see no module listed (this may interesting) any ideas on how work? thanks, nam so figure out. apparently, when vs hooks debugger, chooses binary type .net core. however, binary have managed 4.5. fix change binary type in attach process window managed 4.5.

css - Make a div scroll when content exceeds available height -

i'm trying middle div #content scroll when height of content exceeds available height (as defined innerwidth - header height - footer height). instead, div has scrollbar doesn't scroll, , whole page has scrollbar instead. body { margin: 0; } #header { background-color: silver; height: 100px; width: 100%; } #content { overflow: scroll; } #footer { background-color: silver; bottom: 0px; height: 100px; position: fixed; width: 100%; } <div id="header">header</div> <div id="content"> a<br>b<br>c<br>d<br>e<br>f<br>g<br>h<br>i<br>i<br>j<br>k<br>l<br>m<br>n<br>o<br>p<br>q<br>r<br>s<br>t<br>u<br>v<br>q<br>x<br>y<br>z<br> a<br>b<br>c<br>d<br>e<br>f<br>g<br>h<br>i<br>i<br>j<br>k...

c# - asp.net 2 Properties refer same class -

i have 1 model class called client. namespace logistic.models { public class client { public int clientid { get; set; } public string name { get; set; } public string lastname { get; set; } public icollection<dispatch> dispatches { get; set; } } } i have class has 2 properties relationship client: namespace logistic.models { public class dispatch { public int dispatchid { get; set; } public int customerid { get; set; } public int recipientid { get; set; } public client customer { get; set; } public client recipient { get; set; } } } in order have relationship in dispatch class have have clientid. right? in case have 2 clientid. started asp.net mvc, , can't understand it. because in controller have: public actionresult dispatch() { db.dispatches.include("customer").tolist(); db.dispatches.include("recipient...

nexus 7 - Android Studio recognizes physical device, but won't run app on it -

i have app developed under android studio used run fine on nexus 7 when connected pc via usb. android studio still recognizes nexus 7; see in android device manager; it's labelled online , can push , pull files, know there's bona fide connection. when click run button, emulator opens up...the app never runs on physical device. there lots of similar looking questions here, they're cases in android studio doesn't recognize device or fails show online. why app not running on recognized, online physical device? , can android studio use nexus 7 rather emulator? running emulator straight away preset option, must have agreed earlier , forgot it. don't have studio open in front of me, if recall correctly should able open avd manager , change there. if not move build settings , take preset off. hope helps!

amazon web services - AWS Lambda and MongoDB -

i'm new aws lambda , interested in trying it. have mongodb instance want connect through aws lambda function. how connect mongo instance? can't load pymongo onto aws lambda how work in lambda function? client = mongoclient() client = mongoclient("mongodb://xxxxxx:27017 username user --password") mongoclient can used connect mongodatabase lambda. mongoclienturi mongoclienturi = new mongoclienturi(mongourl); mongoclient mongoclient = new mongoclient(mongoclienturi); mongodatabase db = mongoclient.getdatabase(mongodb);

php - How PDO rollbacks the queries before executing rollBack() function? -

here script: try { $dbh_con->begintransaction(); $stmt1 = $dbh_conn->prepare("update activate_account_num set num = num + 1"); $stmt1->execute(); $stmt2 = $dbh_con->prepare("select user_id activate_account token = ?"); $stmt2->execute(array($token)); $num_rows = $stmt2->fetch(pdo::fetch_assoc); if ( $num_rows['user_id'] ){ $_session['error'] = 'all fine'; } else { $_session['error'] = 'token invalid'; header('location: /b.php'); exit(); } $dbh_con->commit(); header('location: /b.php'); exit(); } catch(pdoexception $e) { $dbh_con->rollback(); $_session['error'] = 'something wrong'; header('location: /b.php'); exit(); } as see, else block contains exit() function. when else block executes, surely rollbac...

javascript - remain the value of input after hide -

Image
i have edit function function has hide/show if click edit. problem how can remain value of row if im going hide it? for example have dialog and decided edit sample 1(first row) and decided realize dont want edit sample 1 close (by clicking edit again) want edit sample 5 got error here script //show , hide update button checker function update_contain(){ var row = jquery(".beneficiaries_rows input[type='text']:visible").length; if(row > 0){ jquery('.ui-dialog-buttonpane button:contains("update")').button().show(); }else{ jquery('.ui-dialog-buttonpane button:contains("update")').button().hide(); } } //beneficiaries edit jquery(".edit_beneficiaries").click(function(){ var row = jquery(this).closest(".beneficiaries_rows"); var show = row.find(".hide"); var hide = row.find(".show"); if(jquery(show).is(":visible")){ ...