Posts

Showing posts from August, 2014

mongodb - Mongo Get all the documents within 10 miles of location specified -

i have 2 collection serviceprovider , parents. serviceprovider(_id, serviceproviderid, ...) parents( _id, id, location:[ lat, long ], ... ) serviceproviderid of serviceprovider collections linked id of parents collections. i want service providers within 10 miles of locations. so want join serviceprovider , parents collection , list serviceprovider within 10 miles of location. i have tried following query: db.serviceprovider.aggregate([ { $lookup: { from: "parents", localfield: "serviceproviderid", foreignfield: "id", as: "serviceproviderarr" } }, { $match: { "serviceproviderarr": { $ne: [] } } } ]) it gives me following result: { "_id" : objectid("577cc2ce588aec59178b4567"), ... "serviceproviderarr" : [ { "_id" : objectid("577cbe33588aecf6168b45c6&qu

python - No module named tensorflow in jupyter -

i have imports in jupyter notebook , among them tensorflow: importerror traceback (most recent call last) <ipython-input-2-482704985f85> in <module>() 4 import numpy np 5 import six.moves.copyreg copyreg ----> 6 import tensorflow tf 7 six.moves import cpickle pickle 8 six.moves import range importerror: no module named tensorflow i have on computer, in special enviroment , connected stuff also: requirement satisfied (use --upgrade upgrade): tensorflow in /users/mac/anaconda/envs/tensorflow/lib/python2.7/site-packages requirement satisfied (use --upgrade upgrade): six>=1.10.0 in /users/mac/anaconda/envs/tensorflow/lib/python2.7/site-packages (from tensorflow) requirement satisfied (use --upgrade upgrade): protobuf==3.0.0b2 in /users/mac/anaconda/envs/tensorflow/lib/python2.7/site-packages (from tensorflow) requirement satisfied (use --upgrade upgrade): numpy>=1.10.1 in /users/mac/anaconda/envs/tensorfl

regex expression with accurately string -

i want find tag in middle text. want jquery.js script. .... <script src="jquery.js" type="text/javascript"></script> <script src="jquery-ui.min.js" type="text/javascript"></script> ... in other words, how found regex expression " <script src="jquery.js" type="text/javascript"></script> " have tried regular expression? <\s*script\s+src\s*=\s*"jquery.js".*<\/script> https://regex101.com/r/qt7pf6/1

How to make a dynamically retrieved image clickable in angularjs -

i have retrieved image , corresponding data dynamically, in want make image clickable redirect webpage. how can achieve using angularjs. i using angularjs, no jquery. below can see can assign values object , use object on image tag. if want make other changes on click can use ng-click shown below use $location.url. $scope.object = {}; $scope.object.filepath = filepath; $scope.object.redirecturl = redirecturl <img ng-src="object.filepath" ui-sref="{{object.redirecturl}}" /> $scope.redirect = function(redirecturl) { $location.url(redirecturl); }; <img ng-src="object.filepath" ng-click="redirect(redirecturl)" />

c# - Closing AutoCAD objects which were obtained via transaction -

i'm writing autocad plugin. i'm using transaction objects , came question - need close (dispose) objects received via transaction? it written in documentation when commit() method called transaction closes every object had been received via transaction. void commit() -- function commits changes made in dbobjects opened during transaction, , closes them. but happening when don't call method? example, i'm using transaction open object , receive layer name. following: database hostapp_workdb = hostapplicationservices.workingdatabase; using ( application.documentmanager.mdiactivedocument.lockdocument() ) using ( transaction transaction = hostapp_workdb.transactionmanager.starttransaction() ) { entity entity = transaction.getobject(objectid, openmode.forread) entity; if ( entity != null ) layer = entity.layer; } as can see, here don't call commit(). happen in case? entity closed or not (as transaction in

recursion - Recursive call to a rule -

i have rule fires thousands of other same rule: (defrule calculate-temperature ?zone <- (object (is-a zone) (id ?id-zone) (dew-temperature ?dew-temperature) (delta-r ?delta-r)) (process-action (is cooling)) => (bind ?supply-temperature (+ ?delta-r ?dew-temperature)) (modify-instance ?zone (supply-temperature ?supply-temperature)) (printout ?*debug-print* "supply-temperature:", ?supply-temperature crlf)) what want modify zone's supply-temperature when can calculate it, i.e. when inside zone defined delta-r , dew-temperature. modification of object keeps on firing in recursice neverendless cycle. best practices avoid these annoying loops, please? thank nicola by rule doesn't loop: clips> (clear) clips> (defclass zone (is-a user) (slot id) (slot dew-temperature) (slot supply-temperature) (slot delta-r)) clips> (definstances start-instances (z1 of zone (id 1) (dew-temperature

telerik - NativeScript Floating Button -

i started nativescript , ran roadblock. i have appbuilder/nativescript project (ios now) in want implement floating action button. have seen plenty of examples fab positioned above listview scenario different: i have 3 repeaters (displaying unrelated data). each repeater may or may not visible on page (if there no data display, hiding it) i place fab on bottom right regardless of content is the whole page wrapped in scrollview i tried using nativescript-floatingactionbutton, cannot compile module installed. keep getting "cannot build project because module nativescript-floatingactionbutton contains insecure code. remove module , try again." i tried absolutelayout on page level, seems layout overlays rest of page , cannot see content, fab. here markup <page id="mainpage" xmlns="http://schema.nativescript.org/tns.xsd" actionbarhidden="true" loaded="pageloaded" xmlns:drawer="nativescript-telerik-ui/sided

internet explorer - jQuery 2.x issue on addEventListener while using Microsoft Web Browser OCX control -

i using ie ocx on progress abl container , has forced emulation of ie10 adding new dword entry on windows registry(on feature_browser_emulation). web file want open on embedded browser includes jquery version 2.2.4 , getting script error: line: 3573 [document.addeventlistener( "domcontentloaded", completed );], char: 4, error: object doesn't support property or method 'addeventlistener' code: 0, url: filepath/jquery-2.2.4.js. the same error persists if force emulation of ie11 , use jquery 2.x. no error if use jquery 1.12.4. emulated version correct. issue of microsoft web browser ocx? have ie11 on machine. any appreciated! thank you!! the feature_browser_emulation change useragent. found doctype specification on old webpages this: <!doctype html public "-//w3c//dtd html 4.01 transitional//en"> compelling browser render page in quirks mode , hence error on jquery occured. found 3 ways resolve issue (to ensure sta

symfony - How to create a custom action not related to entity from sonata admin -

i need add action clear symfony2 cache in sonata admin used example when jms translations updated. know how create custom action not related entity in sonata admin , how execute clear cache command when admin click on corresponding custom link. you may create action in straight-forward symfony way - create route, make common controller route. or call action in other way symfony offers. sonata admin bundle extend application it's crud controller, can use. other controllers created in normal way working well.

java - How to pass IronMQ Token Through Query String -

i trying retrieve messages ironmq, sending 1 request, include projectid , token, still getting response of token required. can please help?? in advance: here code : <form id="myform" action="https://mq-aws-us-east-1-2.iron.io/3/projects/575526342343c707/queues/testqueue1/messages?oauth=3b33k3i4pf689wpcvqz9co method="get"> <a onclick="document.getelementbyid('myform').submit();">send request ironmq</a> </form> the response : {"msg":"token required authentication"} first of all, shouldn't post token on stackoverflow. second, should "oauth", lowercase believe. third, didn't close quotes on action parameter.

c# - C#6's Improved overload resolution - clarification? -

among new features in c#6, mysterious feature (to me) "improved overload resolution" . maybe it's because couldn't find related info/examples/explanation it. the 2 remaining features not discussed support defining custom add extension method collection initializers, and minor improved overload resolution looking @ roslyn wiki there number of small improvements overload resolution, result in more things working way you’d expect them to. improvements relate “betterness” – way compiler decides of 2 overloads better given argument. and ask: question : how improved overload resolution comes play in c#6? , how different c#5 (example? documentation?) i believe meant here "better betterness" rules documented in roslyn github repo . sample code: using system; class test { static void foo(action action) {} static void foo(func<int> func) {} static int bar() { return 1; } static void main()

c++ - Variadic members in non-template class -

i'm trying write class invocation has templated constructor: template<typename f> class invocation { public: template<typename... args> invocation(f&& f, args&&... args) { /* store f , args somewhere later use */ } ... }; normally parameterize invocation class both f , args... , in case need uniform type given f , i'm trying find way store args... of types inside invocation<f> , , incur little performance hit possible. (this might not best design, can interesting exercise.) one thought use virtual functions: template<typename f> class argsbase { public: // discard return value virtual void invoke(f&& f) = 0; }; template<typename f, typename... ts> class args : public argsbase<f> { public: args(ts&&... args) : args_(std::forward<ts>(args)...) {} void invoke(f&& f) override { /* somehow call f args_ (something std::apply) */ ...

c# - How to stop visual studio 2013 hanging when loading a solution with a project from another solution -

the problem thus. every time open specific solution in visual studio hangs forever, annoying visual studio busy popup. way load starting visual studio in safemode or deleting v12.suo file before opening solution. once it's hung projects marked (initializing) apart 1 project (loading). project different solution , different place in tfs tree. if unload shared project vs loads solution fine, think problem tfs, can deal project in multiple solutions? thanks you should remove shared solution , instead share discreet components nuget packages. i have solution & project each of shared groups... there relationship between css, images, , javascript... , package each 1 nuget package. add automated release pipeline , can have checkin->dependancy in short order. i use vsts , have build creates nuget package bits need , use release management tools control visibility , quality of package. it's easy have packages deployed nuget repository (i use vsts) , let o

php - Using citation marks around a variable in array access -

i'm reading som legacy code , come on curious case: $my_assoc_array; /* user defined associative array */ $my_key; /* user defined string */ $value = $my_assoc_array["$my_key"]; is there clever reason why want have citation marks ( " ) around variable when it's used key? special corner case? or there no reason @ this? -- edit -- maybe in old version of php there difference? (remember legacy code). there 1 example can find output differs when $mykey = false . (which perhaps not apply example $mykey string, again: wild wild world of php) <?php $arr = array("1"=>"b", "0"=>"a"); $mykey = false; var_dump($arr[$mykey]); // returns "a" var_dump($arr["$mykey"]); // gives undefined index error $mykey = true; var_dump($arr[$mykey]); // returns "b" var_dump($arr["$mykey"]); // returns "b" what can (mis-)used beats me...

.htaccess - Use RegEx to redirect using data from files -

recently, restructured large site of 1 of our customers. caused news-articels on site on different place. problem google cache still showing them on old location, leading lot of 404 not founds ( 1400 news entries ). normally, redirect using simple regex fine, not path news did change, parameters. example: old url: http://www.customers-url.com/old/path/to/the/news/details/?tx_ttnews%5btt_news%5d=67&chash=a782f3027c4d00face6df122a76c38ed how new url should like: http://www.customers-url.com/new/path/to/news/?tx_news_pi1%5bnews%5d=65 as can see, parameter d did change 67 65 , part of url before ? did change. also, tx_ttnews has changed tx_news , tt_news changed news , &chash part did fall away completely. i have changed ids in csv in following format: old_id, new_id 1,2 2,3 ...etc... same goes the changed url part before ? . since im not expert in using regex question is: can done inside .htaccess using regex ( not sure if can use file input)? how co

java - Unlocking a screen stalls my max priority thread running inside a service (since Lollipop) -

i have max priority thread running inside service reads data bluetoothsocket inputstream. thread works , should work while screen locked. but, since lollipop, started experiencing "stalls" , "slow-downs" in thread @ moment screen gets unlocked (wake up), causes me lose data bluetooth device communicate with. running service foreground service doesn't help. there solution this, or maybe google talk changes introduced in lollipop. also note, since app used in experimental conditions small amount of people (it's not on playstore), partial solution problem preventing phone locked power button, if possible. thanks.

sql server - How can I simulate two SQL instances to test my stored procedures? -

i working on .net-based web application sql 2008 end. sql server contains dozen databases. in our development environment, of databases live in same sql instance. however, in production, there 2 instances, half of databases on 1 instance , half on other. in production, not allowed use linked servers (for security reasons). given above constraints, seems possible write sql statements execute fine in development environment fail miserably in production environment, because not of databases accessible single connection string. i'm writing reports draw data these databases , testing them in development environment. how can make sure i'm writing work in production? i thinking maybe setting sql server roles or users in manner restrict access of databases, not sure work.

java - Android Cannot find views -

for example, have a, b, c , main activity xml a, b, c main java respectively. i trying put frame layout in main have create fm_a, fm_b , fm_c fragment java linked a, b, c layout xml since main navigation bar activity, replace frame layout in main fragment, successful. until tried use button in layout, error saying: could not find method savesetting(view) in parent or ancestor context android:onclick attribute defined on view class android.support.v7.widget.appcompatbutton id 'btnsave' with activity alone without accesssing them fragment, can functioned, way of doing mistake? ref link: https://www.youtube.com/watch?v=ju837bqobfg&spfreload=5 update: code added setting.java @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_setting); startlinking(); startsharedpreferences(); // check second entry if (sharedpreferences.getstring("name"

css - `align-content: flex-end` does not seem to work for nested containers -

i have outer container display: flex; flex-wrap: wrap; on it, inside have series of boxes display: flex; on them. results in of boxes inside container taking same height. however, there other elements inside each box, including content area variable amount of text in it, , footer area button in it. i'd have footer area aligned bottom of each box, regardless of how text inside content area. i've tried setting content , footer areas display: flex , setting align-self: flex-end; on footer, not not fix footer bottom of each box, breaks layout of elements inside content area (there heading in each content area along text content). the layout of each box this: ---------------------------------------------------- | 'box' display: flex; | | | | ------------------------------------------------ | | | inner-container | | | |

laravel - class GeoIP not found -

i have installed geoip laravel in laravel app instructed on: https://github.com/torann/laravel-geoip but when try fetch vistors location using in controller so: $location = geoip::getlocation(); i class geoip not dound exception though have included geoip class in controller as: use geoip; this composer.json require array: "require": { "php": ">=5.5.9", "laravel/framework": "5.1.*", "laravelcollective/html": "~5.0", "matriphe/imageupload": "5.1.*", "illuminate/html": "5.0.*@dev", "gloudemans/shoppingcart": "~1.3", "jacopo/laravel-authentication-acl": "1.3.*", "cviebrock/laravel-elasticsearch": "^1.0", "elasticsearch/elasticsearch": "^2.1", "torann/geoip": "0.2.*@dev" }, my

meteor - blaze.js Uncaught Error: Can't render undefined -

using ongoworks:pdf meteor package save pdf file on client. the function: "click #button_export": function(ev, template) { var content = document.getelementbyid("printdata").innerhtml; blaze.saveaspdf(template.report, { filename: bomid + ".pdf", data: content, x: 0, y: 0, orientation: "landscape", unit: "in", format: "letter" }); }, error: blaze.js?hash=38069f4…:2218 uncaught error: can't render undefinedcheckrendercontent @ blaze.js?hash=38069f4…:2218contentasfunc @ blaze.js?hash=38069f4…:2261blaze.tohtmlwithdata @ blaze.js?hash=38069f4…:2380blaze.outputaspdf @ ongoworks_pdf.js?hash=245293c…:9442blaze.saveaspdf @ ongoworks_pdf.js?hash=245293c…:9461clickbutton_export i understand copied piece of code meteor-pdf 's example. template named report ? otherwise template.report non-existent value ( undefined ). also, co

what is this error in ruby on rails? -

i'm sorry question. tks reading. yes it's same, numbers tell expecting. if method below, 2 required arguments , 1 optional: def test_method(arg1, arg2, arg3 = 1) // code end if call following no arguments: test_method you see exact message. says either need give 2 or 3 arguments.

php - xdebug not working with breakpoints. How can I fix it? -

Image
xdebug debugs single file , project both. problem when put breakpoint not stop @ breakpoint rather stops @ first line , when press f8 moves next line, way have press f8 move way end through code. i using php 7.0.5 , xdebug 2.4.0 & netbeans 8.1. this looks after start debugging project. notice how it's debugging @ line 3(green line) while break point @ line 5(read line). as pointed out @chetan ameta in comments, unchecking solved problem

listview - reading call logs in android fragments list view -

i use code reading call logs in fragments tab activity list view when use array adapter add values app unfortunately stopped there no run time or compile time error how resolve it?? public class tabfragment2 extends fragment { arraylist<string> calllist1 = new arraylist<>(); listview calllistview; arrayadapter<string> arrayadapter; public view oncreateview(layoutinflater inflater,viewgroup container, bundle savedinstancestate) { // inflate layout fragment view view = inflater.inflate(r.layout.activity_call, container, false); calllistview = (listview)view.findviewbyid(r.id.listview1); arrayadapter = new arrayadapter<string>(getactivity().getapplicationcontext(), android.r.layout.simple_list_item_2,calllist1); calllistview.setadapter(arrayadapter); getcalldetails(); return view; } private void getcalldetails() { string strorder = calllo

javascript - Make an extensible footer -

Image
i make footer similar footer of javascript column of jsbin in case of error: (before expanding) (after expanding) precisely, satisfies: 1) @ bottom of page, no matter how big main body (that raises error) is 2) can expanded when users click on it, , collapsed back... i have written following code ( jsbin ), shows footer, , cannot collapsed. <!doctype html> <html> <head> <link rel="stylesheet" href="https://appsforoffice.microsoft.com/fabric/1.0/fabric.min.css"> <link rel="stylesheet" href="https://appsforoffice.microsoft.com/fabric/1.0/fabric.components.min.css"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"> <style> #footer { background-color: #fa8072; width: 100%; position: fixed; bottom: 0px; } </style> </head> <body class="ms-f

mouseevent - Listening to 4th and 5th mouse buttons in Chrome apps (for browser navigation) -

i have chrome packaged app embedded webview. there buttons history , forth in browser, listen keyboard , mouse events too. this snippets catches both alt-arrow keys , multimedia buttons, not 4th , 5th mouse buttons used browser navigation: $("html").on("keydown mousedown mouseup", function (event, data) { console.info(event); }); how detect mentioned mouse buttons?

internet explorer - Serving google fonts with webfont loader not working on ie11 -

i trying load font google fonts using webfontloader. it works on browsers ie 11 + microsoft edge. the problem: first time font loaded, not shown. in page there 2 iframes. on first loading, first iframe not loaded, second loading fine but when hit refresh, both iframes load correctly this has made me think has caching - file not loaded first time. from read here : icon fonts not loading in ie11 , other places understand issue ie not loading files no-cache flag. various answers on web claim solved removing 'no-cache' flag server or setting "cache-control "max-age=3600"" flag. the problem not serving files myself , loaded dynamically using webfont-loader directly google fonts, , cannot change these flags. i unable host them myself because product considerations, can serve files google fonts (also enjoy benefits of caching other browsers).

animation - android animate x and y position with ObjectAnimator -

i search in google , @ least mabye found want need animate x , y position if view dont know if code need if need how can x , y in onanimationupdate did getanimatedvalue give me x or y ? did if call first time givme x , if call again give me y beggener how can x , y inside function onanimationupdate this code valuex x value want animate valuy y value want animate view it propertyvaluesholder pvhx = propertyvaluesholder.offloat(chatheadparent.scale_x, valuex); propertyvaluesholder pvhy = propertyvaluesholder.offloat(chatheadparent.scale_y, valuy); objectanimator animator = objectanimator.ofpropertyvaluesholder(chatheadparent, pvhx, pvhy); animator.setduration(50); animator.addupdatelistener(new valueanimator.animatorupdatelistener() { @override public void onanimationupdate(valueanimator animation) { //i need x , y position animate use them log.d(" iiiiiiiiiii ",""+animation.getanimatedvalue()+&quo

c++ - How to most efficiently increase values at a specified range in a large array and then find the largest value -

so had programming test interview , consider myself decent programmer, unable meet time constraints on online test (and there no debugger allowed). question give range of indices [low, high] , value increase these indices by, after doing m times array, find me largest value. so if had array of size 5 [0, 0, 0, 0, 0] , given instructions [0, 3] 143 [2, 4] 100 , [2,2] 100 array [143, 143, 343, 243, 100] and highest 343. i tried naive solution couldnt think of slick algorithm , thought answer had done memory copying? how 1 solve issue fastest? there missing here? thanks it isn't clear question whether large array contains zeros @ start, or whether given large array initial values, similar methods can used in both cases: a) large array of zeros first of all, in case there no need create large array, or it. given these ranges , values: [0, 3] 143 [2, 4] 100 [2, 2] 100 create list, every low index stored value, , every high index (plus 1) s

react-native rnpm windiows throws error -

Image
i trying build sample uwp app using react-native. here package.json. ` { "name": "netizen_uwp", "version": "0.0.1", "private": true, "scripts": { "start": "node node_modules/react-native/local-cli/cli.js start" }, "dependencies": { "react": "15.2.0-rc.1", "react-native": "0.29.0-rc.0", "react-native-windows": "0.29.0-rc.0" }, "main": "index.android.js", "devdependencies": { "rnpm-plugin-windows": "^0.1.1" }, "author": "", "license": "isc", "description": "" }` when run >rnpm windows,i getting attached error react/react-native/react-native-windows modules latest. can 1 me here? this general problem react-native-windows being plugin. we're behind release tr

expand - How to make SAPUI5 TreeTable expanded by default? -

i use following code (in controller): onafterrendering: function () { var t, i; if (!this.initexpand) { try { t = this.getview().getcontent()[1]; (i=0; i<t.getrows().length; i++) { t.expand(i); } this.initexpand = true; } catch (e) { console.log("expand failed: "+e.message); } } }, for initial (after loading , rendering) expanding nodes of following sap.ui.table.treetable (in view): <mvc:view displayblock="true" xmlns:l="sap.ui.layout" xmlns:table="sap.ui.table" xmlns:mvc="sap.ui.core.mvc" controllername="sap.app.controller.scr1" > <l:horizontallayout> <searchfield livechange="onsearch"/> </l:horizontallayout> <table:treetable rows="{/root}" selectionmode="none" visiblerowcount="11"

sql - Group by on multiple columns using Aggregate functions -

i had following table structure listed below budhol cocode ben obj spare2 spare1 taskno value fieldnamenew 362103 36 362101 991003 null ma1001 null 4516 613030 362103 36 362101 991003 null ma1001 null 9088 613030 362103 36 362101 991003 null ma1001 null 3387 613030 362103 36 362101 991003 null ma1001 null 4026 613030 below required output budhol cocode ben obj spare2 spare1 taskno value fieldnamenew 362103 36 362101 991003 null ma1001 null 21017 613030 i.e value should sumed if columns same i.e. sum of value column below query have tried value not coming properly select b.ben, b.budhol, b.cocode, b.fieldnamenew, b.obj, b.spare1, b.spare2, sum(b.value)as value #temp4 ( select distinct a.ben, a.budhol, a.cocode,

Run android app from html -

i have html page open on android device. want write link in html page open same app. exp. if in device install "facebook" app. write link , when click device must open "facebook" app. i think want open , android app on clicking link in browser. if need deep-linking in android. check out: https://developer.android.com/training/app-indexing/deep-linking.html https://developers.helpshift.com/android/deep-linking/

How to use dynamicToolbarColor() in android -

following code getting 1 image resource, how change dynamic images, i'm getting images bitmap. bitmap bitmap = bitmapfactory.decoderesource(getresources(), r.drawable.pfpic); palette.from(bitmap).generate(new palette.paletteasynclistener() { @override public void ongenerated(palette palette) { collapsingtoolbarlayout.setcontentscrimcolor(palette.getmutedcolor(r.attr.colorprimary)); collapsingtoolbarlayout.setstatusbarscrimcolor(palette.getmutedcolor(r.attr.colorprimarydark)); } }); } you converting 1 image, mentioned getting images in form of bitmaps right?!, why don't use bitmap reference?!. bmp = bitmapfactory.decodebytearray(b, 0, b.length); imageview.setimagebitmap(bmp); you can use 'bmp' in following code this palette.from(bmp).generate(new palette.paletteasynclistener() {

javascript - gmaps4rails - update dynamically the markers from the database on the map without refresh the page -

hello building live bus tracking rails app. displayed markers database on google map in rails 4 gmaps4rails gem. controller: @hash = gmaps4rails.build_markers(@vehicle_trackings) |track, marker| marker.lat track.latitude marker.lng track.longitude marker.picture({ url: "/images/bus filled-30.png", width: 50, height: 50 }) end view: <div id='map' style='width: 100%; height: 500px;'></div> <script> handler = gmaps.build('google'); handler.buildmap({ provider: {}, internal: {id: 'map'}}, function(){ markers = handler.addmarkers(<%=raw @hash.to_json %>); handler.bounds.extendwith(markers); handler.fitmaptobounds(); }); </script> now how update dynamically every 15 seconds markers's position on map without refresh page database? <script> handle

c# - ObjectListView localize the strings used in the Filter menu -

i tried localize strings used in objectlistviews filter menu. documentation ( link ) says have set static properties on filtermenubuilder class or put own instance of filtermenubuilder like: this.olv1.filtermenubuilder = new myfiltermenubuilder(); so far looks good, objectlistview have no filtermenubuilder-property , didn't know how further. any ideas? - thank in advance. according comment of rev1.0 filtermenubuildstrategy is correct property. accessing labels localization works documentation says: filtermenubuilder.apply_label = "test123"; thanks lot!!

excel - Copying the location of file names with specific extensions -

i have following code list out files in folder , sub folder path.but want list out files have specific extensions only(ex:.txt files alone) how can that..? code: sub test() call listfilesinfolder("d:\downloads", true) end sub sub listfilesinfolder(byval sourcefoldername string, byval includesubfolders boolean) dim fso object dim sourcefolder object dim subfolder object dim fileitem object dim r long set fso = createobject("scripting.filesystemobject") set sourcefolder = fso.getfolder(sourcefoldername) r = range("a65536").end(xlup).row + 1 each fileitem in sourcefolder.files cells(r, 1).formula = fileitem.name cells(r, 2).formula = fileitem.path r = r + 1 ' next row number x = sourcefolder.path next fileitem if includesubfolders each subfolder in sourcefolder.subfolders listfilesinfolder subfolder.path, true next subfolder end if set fileitem = nothing set sourcefolder = nothing set fso = nothing end sub you can use getextensio

asp.net - c# - Reference path of image in resource file -

i have resource file (example.resx) in solution , contains image (pic.png). have razor view (.cshtml) file building dynamically. here have give reference of pic.png image path resource. img src = 'path of image resource' any way can done ?

.net - Where do I reference System.Web.Mvc.dll from? -

in 1 of class libraries, wish make single call system.web.mvc.server.mappath(string path) . if install nuget package microsoft.aspnet.mvc class library, have first install microsoft.aspnet.webpages package well, may have further dependencies. i want single dll system.web.mvc.dll since server class in there. i tried referencing dll path: c:\program files (x86)\microsoft asp.net\asp.net web stack 5\packages\microsoft.aspnet.mvc.5.2.3\lib\net45 but dll not have server class in system.web.mvc namespace. and not see dll anywhere else on machine. where can reference dll from? used easy in old days. , stayed easy if wanted reference mvc till 2010. there no need have system.web.mvc-assembly in project use server.mappath. need reference system.web in project , can do var path = system.web.httpcontext.current.server.mappath("default.aspx");

excel - Loop counter in checkbox name -

i trying create sheet have checkbox in each non-empty line. automatically adjust number of checkboxes created macro: sub checkboxes() dim integer = 9 200 set curcell = activesheet.cells(i, 3) if curcell.value > 1 activesheet.shapes("checkbox" & cstr(i)).visible = true else activesheet.shapes("checkbox" & cstr(i)).visible = false end if next end sub i expect number of potential rows data not greater 200. macro checks if value in column c each line >1, if true checkbox visible, else it's hidden. my problem don't know how put loop counter "i" shape name - got error using code above. can help? i think more elegant solution. this loops through shapes on activesheet , checks if msoolecontrolobject (see here more information on matter). sub checkboxes() dim curcellvalue variant dim long = 1 activesheet.shapes.count if activesheet.shapes(i).type = msoolecontrolobject

How to do a bubble sort in Occam -

Image
i trying program in occam, , think not easy understand because documentation not good. anyway, hope me. i trying learn how make simple program. bubble sort in occam. #include "course.module" [32]int x: int aux: bool flag: flag:= true aux:=0 --put values on array seq k=0 10 x[i] = -x[i] -- bubble sort while (flag) seq = 0 9 if x[i] > x[i+1] aux:= x[i] x[i]:= x[i+1] x[i+1] := aux flag:= false : i got image on terminal: wrong code? occam-pi indentation sensitive a few hints in code may , courtesy of tio-ide may provide place online experimentation : #include "course.module" proc main( chan byte keyboard, screen, error ) [32]int x: int aux: bool flag: seq -- ------------------------- boseq: seq = 0 31 -- seq used <-an-iterator-> x[i] := -- put values on array seq = 0 10 -- seq used <-an-i

java - How to get the values from JPanel components like drop down, text fields which are getting created on a fly -

Image
i have jpanel consists of dropdown , text field inside jframe . there button in jframe , when user clicks on button, application adds new jpanel same components i.e. drop down , text field. so, have created function gets called on clicking on button using actionlistener . everything works fine gui side problem when user done adding jpanel s , entering values in these drop downs , text fields, click on submit button. upon clicking on submit button, should able fetch values drop downs , text fields. challenge, since using same functions create jpanel s, can't call name values since give me last jpanel values. any suggestion how should go this? have added screenshot of jframe , function create jpanel . appreciated. thanks. public static void addpanel(final container pane) { panel1 = new jpanel(); string text = "<html><b>property" + nooftimes + " :</b></html>"; jlabel label = new jlabel(text); label.setpreferre

How to add locations to Shopify locations API -

i want add locations shopify locations api. please find api locations in below. /admin/locations.json i nothing getting locations response of above service. becase didn't add locations. so, want add locations api should able list of locations. so please tell me how add locaitions at moment, locations api not allow write locations. @hymnz said, you'll need add them through admin.

file io - Loading Data into the application from GUI using Ruby -

problem : hi everyone, building automation suite using ruby-selenium webdriver-cucumber load data application using it's gui. i've take input mainframe .txt files. scenarios create customer , load multiple accounts them per data provided in inputs. current approach execute scenario using rake task passing line number parameter , script executed 1 set of data. to read data particular line, i'm using below code: file.readlines("#{file_path}")[line_number.to_i - 1] my purpose of using line line loading keep execution running if line fails load. shortcomings supposed i've load 10 accounts single customer. current script run 10 times load each account. want can load accounts in single go. what looking for to overcome above shortcoming, want capture entire data single customer file accounts etc , load them application in single execution. also, i've keep track on execution time , memory allocation well. please provide thoughts on a

sql - Suggest users based on common interest - MySql query -

basically trying suggest people based on common interests. i have table of users(id, username, firstname, lastname, etc) i have table of interested_people userid + interested_in stored. i have table of contactlist people added each other stored.(user1, user2, accepted [1,0]) what want select * users table not friend , have same interest me well. i searched lot in internet couldn't find so. here have created query , want. slow. takes 16 20 second output in phpmyadmin in local machine. kindly request guys if can edit query bit , make bandwidth & time efficient. select * users id in(select userid interested_people interested_in in(select interested_in interested_people userid = [userid]) , id not in(select user1 my_friends_userid contactlist f f.user2 = [user

scala - How to add an Ivy SSH repository to SBT resolvers? -

i frustrated trying add ssh ivy repository resolvers. what have tried based on various threads on stackoverflow : relevant part of buid.sbt val intresolver = seq[resolver]( { import java.io.file val privatekeyfile: file = new file(sys.env("home") + "/.ssh/id_rsa") val username = sys.env("scn_user_name") resolver.ssh("int-scn-snapshot-repository", "scn.int.com")(patterns( "/export/repository/maven2/snapshot/[organisation]/[module]/[revision]/[artifact].[ext]", "/export/repository/maven2/snapshot/[organisation]/[module]/[revision]/[artifact]-[type].[ext]" ) ) as(username, privatekeyfile) withpermissions("0644") } ) resolvers ++= intresolver val exportfullresolvers = taskkey[unit]("debug resolvers") exportfullresolvers := { { (resolver,idx) <- fullresolvers.value.zipwit

.net - What class library to use to be reference on UWP and ASPNETCORE apps -

Image
i create class library can used on aspnetcore app , uwp app. please correct me if i'm wrong, way understand image below (first image) can create .net core class library , have reference uwp , aspnetcore. what i've done created, .net core class library , aspnet core web app , , uwp . i tried reference .net core class library on aspnet core web app , no errors. now, tried reference .net core class library on uwp , showed error below (last image). am better of creating pcl instead stated here ? ps. im using vs2015 update 3 the tooling available in visual studio 2017 release candidate. can create .net standard class library template , use facilitate sharing code (e.g. model objects) between asp.net core app , universal windows platform (uwp) app. .net standard class library considered successor portable class library (pcl).