Posts

Showing posts from July, 2013

java - Comparing two Integer Wrapper classes -

why program printing false in first print statement , true in print statement.? , i1 2 different objects first statement must print "true", expected, second print statement prints "false" creates confusion. public static void main(string[] args) { integer = new integer(10); integer i1 = new integer(10); system.out.println(i == i1); //printing false i++; i1++; system.out.println(i == i1);//printing true } using new keyword always creates 2 different instances. following true: new integer(10) != new integer(10) hence first line printing "false". then: i++; hides unboxing , boxing. equivalent to: i = integer.valueof(i.intvalue() + 1); as described in the javadoc of integer.valueof , values -128 127 (at least) cached: getting cached instance of integer.valueof(11) both i++ , i1++ , hence second line printing "true".

sql like - orientdb select does not return all vertices -

Image
i'm using orientdb studio creating vertices type (nodetype1). created 29 vertices using orientdb studio , when run: select count(*) nodetype1 i 29 records. however, when run: select * nodetype1 i list of 20 records. has encountered before? you see 20 records because orientdb shows 20 default. if want see more, can write: select * nodetype1 limit -1 this way, can see records. here can set number of visible records query:

c# - ArgumentException not working -

is there reason why argumentexception might not work? when moved our solutions .net 4.0, cannot use argumentexception. string nodata = '--no data--' try { instanceid = microsoft.xlangs.core.service.rootservice.instanceid.tostring(); } catch (argumentexception) { instanceid = nodata; } when use exception class instead of argumentexception, can pass variable nodata instanceid. catch (exception e) { instanceid = nodata; } the error encountering when object reference not set instance object. the problem doing in code catching argumentexception s whereas before caught exceptions - exceptions derive exception fit old catch criteria. if want catch specific exception ( nullreference ) need catch correct 1 (not argumentexception ). change following: catch (nullreferenceexception) { instanceid = nodata; } but if don't have specific behavior nullreferenceexception i'd keep it: catch (exception) { instanceid = nodata; ...

Multilayer CSV to filtered excel -

[enter image description here][1]i have following format csv hierarchy data (up 12 layers) , trying fill in excel can @ end create pivot of data. each file (over 1000) different, have been trying code macros unable remove bugs. first aproach create table , use above cell on blanks, because of layers not correct end of table any idea on how approach using macros? level 1,level 2,level 3,level 4,level 5,level 6,level 7,level 8,level 9,level 10,level 11,level 12 test ,,,,,components ,,,,,,default logic ,,,,,,,z04 - z05 ,,,,,,,,z04 () ,,,,,,,,,%pwr_pg_u_backlight% () components ,c ,,c802 - c842 ,,,c802 ,,,,1 (1) ,,,,2 (2) [this got| http://i.stack.imgur.com/bj2qg.png] [this need pivot| http://i.stack.imgur.com/7q6jq.png] to 'text columns' in vba row_count = 13 = 1 row_count strarray = split(cells(i, 1).value, ",") count = lbound(strarray) ubound(strarray) cells(i, count + 1).value = strarray(count) next next

Removing delivery step from checkout skips shipping address also in spree + rails -

Image
when write remove_checkout_step :delivery in order_decorator.rb removes shipping address info checkout/address page in spree3-1 stable branch. requirement skip checkout step 3 page i.e given in image please guide me how overcome issue. add following code rails/spree app: in app/models/spree/order_decorator.rb spree::order.class_eval remove_checkout_step :delivery end

android - Want to know the history of item purchased -

initially had implemented code 1 time purchase only. iabhelper.oniabpurchasefinishedlistener mpurchasefinishedlistener = new iabhelper.oniabpurchasefinishedlistener() { public void oniabpurchasefinished(iabresult result, purchase purchase) { log.d(tag, "purchase finished: " + result + ", purchase: " + purchase); // if disposed of in meantime, quit. if (mhelper == null) return; if (result.isfailure()) { log.e(tag,"error purchasing: " + result); return; } if (!verifydeveloperpayload(purchase)) { log.e(tag,"error purchasing. authenticity verification failed."); return; } log.d(tag, "purchase successful."); if (purchase.getsku().equals(item_sku)) { // bought 1/4 tank of gas. consume it. log.d(tag, "purchase ga...

dojo - Vertical Text in dijit TabContainer Tabs -

dijit/layout/tabcontainer may have tab buttons/texts displayed on top, right, bottom , left. i'd tabs on right (using tabposition: "right-h"), if tabs on right, texts still displayed horizontally. "right-h" sounds if there plans "right-v", have texts displayed vertically, too, seems not implemented yet. how can achieve vertical display of tab texts in 1 of tabcontainers in use in page (others shall have tabs on top horizontally rendered texts). thanks! one way can imagine split title of tabs accros multiple lines. like this: require([ "dojo/dom-attr", "dojo/query", "dijit/layout/tabcontainer", "dijit/layout/contentpane", "dojo/domready!" ], function(attr, query, tabcontainer, contentpane){ query(".tc1cp").foreach(function(n){ new contentpane({ // pass title: attribute, this, we're stealing node title: attr.g...

Spark Streaming With Kafka Direct approach: horizontal scalability issue -

i facing problem in using spark streaming apache kafka spark deployed on yarn. using direct approach (no receivers) read data kafka 1 topic , 48 partitions. setup on 5 node (4 worker) spark cluster (24 gb memory available on each machine) , spark configurations (spark.executor.memory=2gb, spark.executor.cores=1), there should 48 executors on spark cluster (12 executor on each machine). spark streaming documentation confirms there one-to-one mapping between kafka , rdd partitions. 48 kafka partitions, there should 48 rdd partitions , each partition being executed 1 executor.but while running this, 12 executors created , spark cluster capacity remains unused & not able desired throughput. it seems direct approach read data kafka in spark streaming not behaving according spark streaming documentation. can suggest, wrong doing here not able scale horizontally increase throughput.

glsl - Vertex and Fragment shaders for lighting effect in OpenGL ES20 -

i want add lighting effect in models via shaders. found out there vertex , fragment shaders make work on opengl: static const char* vertsource = { "uniform vec3 lightposition;\n" "varying vec3 normal, eyevec, lightdir;\n" "void main()\n" "{\n" " vec4 vertexineye = gl_modelviewmatrix * gl_vertex;\n" " eyevec = -vertexineye.xyz;\n" " lightdir = vec3(lightposition - vertexineye.xyz);\n" " normal = gl_normalmatrix * gl_normal;\n" " gl_position = ftransform();\n" "}\n" }; static const char* fragsource = { "uniform vec4 lightdiffuse;\n" "uniform vec4 lightspecular;\n" "uniform float shininess;\n" "varying vec3 normal, eyevec, lightdir;\n" "void main (void)\n" "{\n" " vec4 finalcolor = gl_frontlightmodelproduct.scenecolor;\n" "...

html - How to get class name through JavaScript? -

how class name through javascript using element name classic html. like: <input name="xxx" class="checkbox" onchange="checkonchange()" type="checkbox" checked="" value="y"> i want check fields has class name "checkbox" . how can solve this? please me. there lot of solutions. first access element classname use code : element.classname next if want test if classname exist inside element list, can test indexof have false positive. class "foo" not present in following element.classname : "foobar foobuzz" best way use regexp : checkifelementhasclassname(element, classname) { return (new regexp('^|\\s' + classname + '\\s|$')).test(element.classname); }

vba - Creating DTPicker Control dynamically -

can please guide me on how create date picker control dynamically in vba? here trying do. have macro adds textbox , combobox controls dynamically vba userform, based on whether end user visible or not. visibility(and other control properties-width,height, etc) controlled end user, updating yes/no, values against control names provided in ‘master’ sheet in excel. this did textbox , combobox controls `sub test() ---- code dim txttextbox msforms.textbox dim cmbcombobox msforms.combobox if 'some cell in excel ‘master’ worksheet' = "combobox" set cmbcombobox = userform.controls.add("forms.combobox.1", 'some cell in excel ‘master’ worksheet') cmbcombobox.top = 'some cell in excel ‘master’ worksheet' cmbcombobox.left = 'some cell in excel ‘master’ worksheet' cmbcombobox.width = 'some cell in excel ‘master’ worksheet' cmbcombobox.height = 'cell in excel ‘master’ worksheet' ----rest of code end sub` my...

swift - How to call this in another view -

i have func post request in library.swift. calling register.swift. sending data server, not data library.swift view. how solve this? library().sendregisterinfo("http://tsprphones.com/php4credit/addnewuser.php", postdata: "emailaddressok=" + emailadd + "&passwordok=" + password + "&registeredtimeok=" + localtimestring + "&firstnameok=" + firstname + "&middlenameok=" + middlename + "&lastnameok=" + lastname){ result in print(result)//this should result server not working. } this func in library.swift func sendregisterinfo(url:string, postdata: string, completion: string -> void) { let request = nsmutableurlrequest(url: nsurl(string: url)!) request.httpmethod = "post" let poststring = postdata request.httpbody = poststring.datausingencoding(nsutf8stringencoding) let task = nsurlsession.share...

java - How can I convert a json string to a bean list? -

i jsonstring: { "student[0].firstname":"asdf", "student[0].lastname":"sfd", "student[0].gender":"1", "student[0].foods":[ "steak", "pizza" ], "student[0].quote":"enter favorite quote!", "student[0].education":"jr.high", "student[0].tofd":"day", "student[1].firstname":"sf", "student[1].lastname":"sdf", "student[1].gender":"1", "student[1].foods":[ "pizza", "chicken" ], "student[1].quote":"enter favorite quote!", "student[1].education":"jr.high", "student[1].tofd":"night" } the student bean: public class student { private string firstname; private string lastname; private integer gender; private l...

javascript - Using $watch on an AngularJS service function defined as an ES6 class -

i'm using es6 angularjs , following this guide . recommends defining services classes. in service definition i'm injecting $cookiestore service , attaching class this: export default class authentication { constructor($cookiestore) { this.$cookiestore = $cookiestore; } setauthenticatedaccount(account) { this.$cookiestore.put(json.stringify(account), 'authenticatedaccount'); } isauthenticated() { return !!this.$cookiestore.get('authenticatedaccount'); } } i want update navbar reflect whether or not user logged in, i'm doing $watch : var navbarcontroller = function($location, $scope, authentication) { $scope.$watch(authentication.isauthenticated, () => { $scope.isauthenticated = authentication.isauthenticated(); $scope.currentuser = authentication.getauthenticatedaccount(); }); } this gives following error: cannot read property '$cookiestore' of undefined . this error occurs ...

c# - Terminate all dialogs and exit conversation in MS Bot Framework when the user types "exit", "quit" etc -

i can't figure out how simple thing in ms bot framework: allow user break out of conversation, leave current dialogs , return main menu typing "quit", "exit" or "start over". here's way main conversation set up: public async task<httpresponsemessage> post([frombody]activity activity) { try { if (activity.type == activitytypes.message) { useractivitylogger.loguserbehaviour(activity); if (activity.text.tolower() == "start over") { //do here, don't have idialogcontext here! } botutils.sendtyping(activity); //send "typing" indicator upon each message received await conversation.sendasync(activity, () => new rootdialog()); } else { handlesystemmessage(activity); } } i know how t...

python - How to patch method io.RawIOBase.read with unittest? -

i've learned unittest.monkey.patch , variants, , i'd use unit test atomicity of file read function. however, patch doesn't seem have effect. here's set-up. method under scrutiny (abriged): #local_storage.py def read(uri): open(path, "rb") file_handle: result = file_handle.read() return result and module performs unit tests (also abriged): #test/test_local_storage.py import unittest.mock import local_storage def _read_while_writing(io_handle, size=-1): """ patch function, replace io.rawiobase.read. """ _write_something_to(testlocalstorage._unsafe_target_file) #appends "12". result = io_handle.read(size) #should call actual read. _write_something_to(testlocalstorage._unsafe_target_file) #appends "34". class testlocalstorage(unittest.testcase): _unsafe_target_file = "test.txt" def test_read_atomicity(self): open(self._unsafe_target_file, ...

How to change the type of operands in the Callinst in llvm? -

i trying implement transformation of callinst , perform following: change type of arguments of function calls change type of return value for example, want change following ir: %call = call double @add(double %0, double %1) define double @add(double %x, double %y) #0 { entry: %x.addr = alloca double, align 8 %y.addr = alloca double, align 8 store double %x, double* %x.addr, align 8 store double %y, double* %y.addr, align 8 %0 = load double, double* %x.addr, align 8 %1 = load double, double* %x.addr, align 8 %add = fadd double %0, %1 ret double %add } to ir_new: %call = call x86_fp80 @new_add(x86_fp80 %0, x86_fp80 %1) define x86_fp80 @new_add(x86_fp80 %x, x86_fp80 %y) #0 { entry: %x.addr = alloca x86_fp80, align 16 %y.addr = alloca x86_fp80, align 16 store x86_fp80 %x, x86_fp80* %x.addr, align 16 store x86_fp80 %y, x86_fp80* %y.addr, align 16 %0 = load x86_fp80, x...

javascript - How to alter a regex to be non-greedy (JS) -

i'm trying replace var tags attribute wrapped in square brackets data.replace(/<var .*?="">(\d+)<\/var>/ig, '[[[$1]]]'); but not work if there multiple var tags. example, <var id-0=""></var> responds <span id-1="">in <var num="">1</var> days</span> will result in [[[1]]] days</span> but result need <var id-0=""></var> responds <span id-1="">in [[[1]]] days</span></strong> using <var [^=]*="">(\d+)<\/var> regex101 - 1 in case there more 1 attribute or attribute has value num="something" above wouldn't work, instead, use <var( [^=]*="[^"]*")*>(\d+)<\/var> [[[$2]]] substitution. regex101 - 2

typo3 - PDF thumbnail not appearing -

Image
pdf file in text & media element won't show. i added 2 pdf , 1 image. can see generated markup, pdf come out empty, while image shows: have tried tests in install tool. every test succeeded except render text truetype font using 'nicetext' option ( screenshot ) the cause non-working pdf thumbnails ghostscript not installed. can check in typo3 install tool. another possibility misconfiguration of imagemagick in typo3, version ( im_version_5 setting , friends). as problem occurs in frontend, should check if path correct and/or if have permission problems writing typo3temp/. if correct, try flushing processed files cache (in install tool) , check if thumbnails in backend appear correctly again.

regex - How do you match character OR end of string in a golang regexp? -

i having trouble working out (in golang), within regular expression, how match character, separator, or end of string. following want: url := "test20160101" if i, _ := regexp.matchstring("[-a-za-z/]20[012]\\d[01]\\d[0123]\\d[-a-za-z/]", url); == true { t := regexp.mustcompile("[-a-za-z/](20[012]\\d[01]\\d[0123]\\d)[-a-za-z/]").findstringsubmatch(url)[1] fmt.println("match: ", t) } https://play.golang.org/p/ewz_diovbl but want match following: url := "test-20160101-" url := "/20160101/page.html" i notice there \z in the golang documentation doesn't work, @ least when put inside [-a-za-z/] i.e. [-a-za-z\\z/] i interested , played around fun. maybe this: https://play.golang.org/p/grvnhtww0g package main import ( "fmt" "regexp" ) func main() { // want match "test-20160101", "/20160101/" , "test-20160101" re := regexp.mustc...

anaconda - Python 3.4 64-bit download -

how can download anaconda previous python versions python 3.4 64-bit. the reason bloomberg api available 3.4 , 3.5 not out yet. i recommend installing newest anaconda version , using virtual-environments . way, set python 3.4 environment. this documented here . there these docs , describing same approach, targeting more python2/3 problem. (link mentioned in comments) so after installing anaconda (let's assume, condas binaries in path: conda create --name py34 python=3.4 then can used with source activate py34 # linux activate py34 # windows during activation (or: while activated), binaries (python, pip, conda) in path). means using conda install matplotlib install 3.4 version! after doing: source activate root # linux activate root # windows something conda install matplotlib install base-version.

date - VB.NET Returning sum hours of datetimepicker -

i have select returns column in datagridview called date , time of datetimepicker , column flag "input" or "output". want return result sum of hours of datetimepicker flag "input" , sum flag " ouput ". me guys? cheers.... but anyway try sum of time in hours or minutes. dim firstin string = cdate(dtp1.value.date).tostring("hh:mm") 'try or without cdate. dim firstout string = cdate(dtp2.value.date).tostring("hh:mm") 'try or without cdate. dim elapsedtime timespan = datetime.parse(firstout).subtract(datetime.parse(firstin)) dim elapsedminutestext string = elapsedtime.minutes.tostring() dim elapsedhrstext string = elapsedtime.hours.tostring * 60 dim totalminute string = cint(elapsedminutestext) + cint(elapsedhrstext) 'then try isert txtbox or message box see result. 'but can minutes , total hours of it. hope want.

ios - Using AVPlayer and AVPlayerViewController, but audio and video not present -

my code looks this: _player = [avplayer playerwithurl:destination]; _playervc = [avplayerviewcontroller new]; _playervc.player = _player; dispatch_async(dispatch_get_main_queue(), ^{ [self presentviewcontroller:_playervc animated:yes completion:^{ [_player play]; }]; }); _player represents avplayer , _playervc represents avplayerviewcontroller. have strong global references these objects. using terminal, played file located @ destination (open -a quicktime\ player destinationurlabsolutestring) , saw file loaded since playing. it m4v file. have played m4a file , gave me audio. have substituted url have destination remote url , worked video. leads me believe has video. what's weird avplayerviewcontroller show black screen normal controls, , shows video 2 minutes , 23 seconds. upon opening video file manually, can see 2 minutes , 23 seconds. i can forward through video dragging white dot indicative of video's position, never hear anything, nor see bla...

memcached - nginx not caching response from reverse proxy -

http://nginx.org/en/docs/http/ngx_http_memcached_module.html basic config here: worker_processes 2; events { worker_connections 1024; } error_log /var/log/nginx/nginx_error.log warn; error_log /var/log/nginx/nginx_error.log info; http { upstream backend { server localhost:3000; } server { listen 80; location / { set $memcached_key $uri; memcached_pass 127.0.0.1:11211; error_page 404 = @fallback; } location @fallback { proxy_pass http://backend; } } } it reverse proxy's request when hitting port 80, logs say: 2016/08/23 15:25:19 [info] 68964#0: *4 key: "/users/12" not found memcached while reading response header upstream, client: 127.0.0.1, server: , request: "get /users/12 http/1.1", upstream: "memcached://127.0.0.1:11211", host: "localhost" nginx memcached module not write memcached server. shoul...

angular - Component dependencies & Using life cycle hooks as logic -

the problem : <div class="appcontainer"> <my-cube-container></my-cube-container> <my-toolbox></my-toolbox> </div> my-toolbox calls service inside constructor. service a calls service b , set values service. my-cube-container calls service b in constructor. when my-cube-container calls service b values aren't initialized. possible resolution ?: using life cycle hooks: if 1 service called in onnginit() called after other service used in component constructor. feels bit wrong , not explicit. tell angular component dependent of one. think more explicit, , that. you have several options, keep things way are, move calls services nginit() logic should inside method , not on constructor. make life harder when comes testing. after create observable values on service b , make <my-cube-container></my-cube-container> subscribe observable, gets notified when values available. another optio...

c# - Set focus on the selected item when tabbing in a WPF ListBox -

i have listbox in xaml file looks this: <listbox name="collateralpledgedlistbox" style="{staticresource usb_listbox}" margin="0,0,5,39" width="auto" itemspanel="{staticresource usb_listbox_itemplacement}" tabnavigation="local" itemcontainerstyle="{staticresource usb_listboxcontainer}" itemssource="{binding model.collateralpledgedbymarriedindividuals, mode=twoway}" itemtemplate="{staticresource usbcollateralcolsumcolinfodatatemplate}" scrollviewer.horizontalscrollbarvisibility="hidden"> </listbox> this listbox shows vertical scroll bar when there number of rows exceed provided space. not able show selected row user while tabbing through controls within listbox. i using c# language. on appreciated. sounds have set focus , refresh view. have tried doing this answer suggest...

In the same column in excel, how do I exclude every cell that starts with a specific letter, -

Image
i cant more 1 letter @ time. filters come excel not give option ex. exclude words starting d , z in same column with data in column a , in b2 enter: =if(or(left(a2,1)="a", left(a2,1)="d", left(a2,1)="z"),1,0) and filter out ones in column b :

How to reference XSD in XML for W3C Markup Validation Service? -

i create xml follows xml schema http://www.oid-info.com/oid.xsd . xsd should somehow referenced in xml file, tool https://validator.w3.org/ can check find errors in semantics of data, e.g. when email address invalid. first, tried way: <?xml version="1.0" encoding="iso-8859-1" ?> <oid-database xmlns="http://www.oid-info.com/" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://www.oid-info.com/oid.xsd"> <submitter> .... </submitter> <oid> .... </oid> </oid-database> the w3c markup validation service says: no doctype found! checking xml syntax only. doctype declaration not recognized or missing. means formal public identifier contains spelling error, or declaration not using correct syntax, or xml document not using doctype declaration. validation of document has been skipped, , simple check of well-formedness of xml syntax has been perfor...

Call a C++ function from Python and convert a OpenCV Mat to a Numpy array -

background situation i'm trying use opencv stitching module via python bindings, i'm getting error: import cv2 stitcher = cv2.createstitcher(false) imagel = cv2.imread("imagel.jpg") imagec = cv2.imread("imagec.jpg") imager = cv2.imread("imager.jpg") stitcher.stitch((imagel, imagec)) error: /home/user/opencv3.1.0/opencv/modules/python/src2/cv2.cpp:163: error: (-215) data should null! in function allocate similar people suffering this: https://stackoverflow.com/a/36646256/1253729 how stitch images uav using opencv python stitcher class https://github.com/opencv/opencv/issues/6969 the problem @ hand so decided use official c++ opencv stitching example , use python call using boost.python. however, i'm still unable figure out how use boost.python + numpy-opencv-converter handle c++ mat vs numpy array conversion. ¿how call numpy-opencv-converter? i've got boost.python in place, , when running python function call...

android - App of image detection in xamarin -

i want make app of image recognition , need of start. need explain me these few things wich offline libraries best use xamarin image processing in case more performance needed, best libraries image processing ios , android work them separately. it not matter if library in c or c++ want documentation follow my idea of best is. documented. easy implement on platforms xamarin or individually the main functions looking object recognition in image not @ runtime camera also want add if there document of fundamentals of image procesing , edge detection. thanks depends on want - image detection big topic. a couple of places start are: microsoft cognitive services https://blog.xamarin.com/performing-ocr-for-ios-android-and-windows-with-microsoft-cognitive-services/ this on-line service , can ocr, facial recognition, describing in image. opencv this featured computer vision library available in c++ ios , android wrappers can bind use form xamarin. http://...

Word 2016 vba add-in for Mac -

i have created add-in word communicates third party cmd-program via api have written in c# using visual studio. communication takes place using stdin , stdout. program works word 2007, 2010, 2013, 2016 windows. i have ported word 2011 mac. api here written in c using xcode, still using stdin , stdout. api on mac dylib, can reference in visual basic editor. i'm having trouble replicating on 2016 version of office mac. i'm suspecting might not possible, due new security restrictions. when try reference file can choose .tlb files (type libraries). have created tlb files using visual studio on windows , have no idea how might on mac. can answer if i'm trying possible on 2016 version of office mac, , might find documentation on how create files can referenced? fyi: add-in called wordmat: www.eduap.com additional info following information @erik below i'm having trouble declaring functions in lib. here declare statement: declare ptrsafe function vbstrlen lib ...

fopen - PHP adding $ signs into strings without it being a variable? -

this question has answer here: dollar ($) sign in password string treated variable 8 answers i'm making setup page people can write database login etc , create config.php file on webserver info can't write $file = fopen("config.php", "w"); fwrite($file, "$dbname = $dbname"); i tried $file = fopen("config.php", "w"); fwrite($file, "$" . "dbname = $dbname"); but doesn't work either. any way store php variable in file write using php? as php document says if string enclosed in double-quotes ("), php interpret following escape sequences special characters: \$ dollar sign http://php.net/manual/en/language.types.string.php so if want use $ in double-quotes strings use \$ instead of $ . or use single quotes

java - send data from raspberry to spring web application remotely -

i want have architecture.... http://i.stack.imgur.com/hhbpb.png can me? can't understand how should send data respberry web server. have spring mvc webapplication...user should able measure something(for example temperature) , senf through web application interface(jsp page). can write webservice post data form webserver. how should send data raspberry form? or there better solution? between pi , spring app use rest (like post, methods json/xml representation). can either make raspberry pi spam spring application data per x time or make raspberry pi server spring send requests raspberry pi , raspberry pi return data. second way requires building restful api on raspberry. first way. pi: here temperature (post /temperature) pi: here temperature (post /temperature) pi: here temperature (post /temperature) pi: here temperature (post /temperature) pi: here temperature (post /temperature) second way. spring: give me temperature (get /temperature) pi: here temperat...

VBA rename multiple worksheets based on cells in one excel sheet and reciprocally, rename the excel cells based on excel worksheets -

thank reading post , taking time answer me. search on prior questions , answers reveal answer renaming single worksheet (or multiples) based each time on over each worksheet (i.e. rename worksheet based on name inscribed in "b1"). looking bit different please. my sole experience vba consists of "copy paste commands" appreciate if gave out little snippets of information each bout of programming in answer :). am looking use specific excel sheet, let's call "summary" modifying name on excel sheet modifies directly name of each excel worksheets (they're created), , vice versa, modifying excel name of each worksheet modify content of excel sheet "summary". ex: in excel sheet "summary" cell a5 a35 each contain information, "1", "2" "3" , on until "30". running macro enable sheets after summary ("sheet 1" sheet 2" "sheet3" until "sheet 30") automa...

python - How to 'and' data without ignoring digits? -

say have number, 18573628 , each digit represents kind of flag, , want check if value of fourth flag set 7 or not (which is). i not want use indexing. want in way and flag mask, such this: 00070000 i use np.logical_and() or that, consider any positive value true . how can and while considering value of digit? example, preforming operation flags = 18573628 and mask = 00070000 would yield 00010000 though trying different mask, such mask = 00040000 would yield 00000000 what can is if (x // 10**n % 10) == y: ... to check if n -th digit of x (counting right ) equal y

javascript - In node.js ES6, is it possible to pass in a type and then instantiate it? -

in project have several classes this: "use strict"; var exports = module.exports = {}; var systemsdao = require('./dao/systems/systemsdao.js'); var aop = require('./dbaoputils.js'); var proxy = require('harmony-proxy'); var sqlite3 = require('sqlite3').verbose(); /* wraps systemserviceobject , passes in constructed * dao object argument specified functions. */ exports.systemsdaointercepter = function(obj) { let handler = { get(target, propkey, receiver) { const origmethod = target[propkey]; return function(...args) { console.log('systemdaointercepter: begin'); // create reportsdao object , proxy through dbsqliteconnectionintercepter // (so don't have create every single method) var systemdao = new systemsdao('blah'); var proxsystemdao = aop.dbsqliteconnectionintercepter(systemdao, sqlite3.open_readonly); args...

ios - UIWebview White Page -

Image
why happening? can not understand. doing wrong? when run simulator i'm having problem. code : import uikit class viewcontroller: uiviewcontroller { @iboutlet weak var websayfasi: uiwebview! var urlpath = "http://google.com.tr " func loadadressurl(){ let requesturl = nsurl (string:urlpath) let request = nsurlrequest(url: requesturl!) websayfasi.loadrequest(request) self.view.addsubview(websayfasi) } override func viewdidload() { super.viewdidload() } override func didreceivememorywarning() { super.didreceivememorywarning() } } enter image description here this has app transport security settings of application. apple added security measures arbitrary http loads. try following method: step 1: go info.plist file step 2: add new key: "app transport security settings" step 3: add boolean subkey, "allow arbitrary loads", set yes step 4: add di...

javascript - gulp-sass: how to disable adding of prefixes path of background-image -

hello everyone! i'm developing web app, , using gulp-sass compile files css. schematic project structure: build/ -image.png -build.css src/ -app/ -component_1/ -component.scss inside component.scss: div.component { background: url("/image.png") no-repeat center center; } here gulp script, responsible compiling sass css: gulp.task('sass', function () { return gulp.src("src/app/**/*.scss") .pipe(sass().on("error", sass.logerror)) .pipe(gulp.dest("./sass.compiled/")) .pipe(concatcss("build.css")) .pipe(gulp.dest("build")); }); as result: gulp-scss prepends background's url property path: 'component_1'. instead of expected: background: url("/image.png") no-repeat center center; i get: background: url("component_1/image.png") no-repeat center center; is there way, make gulp-sass prevent such behavior? it's...

Using .data to add data attribute using jQuery -

i have 2 spans on site: <span class="view-toggle"></span> and i'd firstly set data-status="inactive" (to clear of settings), , add data-status="active" 1 element. i have following: $('.view-toggle').find().data("status","inactive"); $(button).data( "status", "active"); i can confirm $(button) correctly identifies 1 span want add active to. i'm not getting console errors, i'm not getting addition of data attributes. am using data() incorrectly? to value of attribute : <strong id="the_id" data-original-title="i need this"> $('#the_id').data('original-title'); to set value of attribute $('#div').attr(attname,attvalue);

Docker build inside kubernetes pod fails with "could not find bridge docker0" -

i moved our build agents kubernetes / container engine. used run on container vm (version container-vm-v20160321) , mount docker.sock docker container can run docker build inside container. this used following manifest: apiversion: v1 kind: pod metadata: name: gocd-agent spec: containers: - name: gocd-agent image: travix/gocd-agent:16.8.0 imagepullpolicy: volumemounts: - name: ssh-keys mountpath: /var/go/.ssh readonly: true - name: gcloud-keys mountpath: /var/go/.gcloud readonly: true - name: docker-sock mountpath: /var/run/docker.sock - name: docker-bin mountpath: /usr/bin/docker env: - name: "go_server_url" value: "https://server:8154/go" - name: "agent_key" value: "***" - name: "agent_resources" value: "docker" - name: "docker_gid_on_host" value: "107" restartpolicy: dnspolicy: d...

laravel 5 - What can be the reasons why jquery cannot select element by id but can select element by attribut "id" -

i starting project full calendar (with laravel backend). agenda displayed , themed via jquery-ui theme. when user clicks on agenda, event caught , form made blade shown. date inputs form can retrieved , set jquery. how ( selection id ) $("#startdate").val(formattedstartdate) . for time inputs ( $("#starttime").val(formattedstarttime) ) not work longer , have use select via attribute method ( see jquery own words ) $("input[id='starttime']").val(starttime); for information input form declared in js file {{ form::time('starttime', null, [ 'id' => 'starttime', 'title' => 'heure de début (obligatoire)']) }} and blade macro defines time input declared in view {{ form::macro('time', function() { return '<input type="time">'; }) }} i tried change id in blade did not change anything, , tried use input façade laravel form:input('time', 'starttime, ...) ...