Posts

Showing posts from May, 2012

Is it possible to link a string to an external database? Imagine I want to add a text and the string has to fetch the name from a database online? -

<string name="hello_world">hello world!</string> <string name="action_settings">settings</string> <string name="hello">hello</string> can implement in string .xml file or need specific class in .java file?

ODBC Data Source Administrator with MS SQL Server -

i have scoured stack overflow , internet in general steps leading answer, have of yet been unsuccessful. main goal use asp scripts ms sql databases on standalone win7 pc, short term goal able configure odbc user or file dsn connection tests in odbc data source administrator. i have sql server 2012 installed , can connect database engine sql server management studio. when try configure dsn entry in odbc, error message reads [microsoft][sql server native client 11.0]named pipes provider: not open connection sql server [53]. all attempts test data source lead 15-second time-out tests failed! message. i have tried of recommended adjustments. other details provide? help!!

sql - I want to join two aggregrated result sets -

my query sum of total qty , sum of total returned qty. got answers individually need combine. select c.city_name ,pc.prod_cat_name ,to_char(th.txn_date, 'w') ,to_char(th.txn_date, 'yyyy') ,sum(td.qty) city c ,prod_cat pc ,product p ,txn_hdr th ,txn_det td ,store_det s ,state st c.state_id = st.state_id , s.city_id = c.city_id , s.store_id = th.store_idand th.txn_hdr_id = td.txn_hdr_id , td.prod_id = p.prod_id , p.prod_cat_id = pc.prod_cat_id group c.city_name ,pc.prod_cat_name ,to_char(th.txn_date, 'w') ,to_char(th.txn_date, 'yyyy') output bangalore electronics 1 2015 1 bangalore electronics 3 2015 1 bangalore clothing 2 2015 1 bangalore clothing 1 2015 2 chennai stationary 1 2015 10 chennai cars_bike 4 2015 5 bangalore clothing 3 2015 4 second query select c....

iis - Custom logs in Azure website file system combined into single log file -

my azure web app (app service) writes log file mywebapp.log d:\logfiles directory of vm hosts website. when log file gets size rename mywebapp1.log , mywebapp2.log , , on , new log file created. (i manually - stop website, rename file , restart site.) one day inspected directory through kudu (scm) portal , saw lone mywebapp.log larger normal. file included of individual logs existed (included contents of mywebapp1.log + mywebapp2.log , on). my app has no combines files. there azure process or did in sleep , have no recollection? there no logic in azure this. azure knows nothing log files, , not doing them, complex combining several existing files one. so i'll go sleep theory on 1 :)

JavaFX: How to clear a DatePicker value -

this question has answer here: how clear datepicker 1 answer how clear datepicker value if textfield clear? known, can by: datepicker.setvalue(null); but need listener textfield in datepicker. you can add changelistener textproperty of textfield. something like: textfield.textproperty().isempty().addlistener(new changelistener<boolean>() { @override public void changed(final observablevalue<? extends boolean> observable, final boolean oldvalue, final boolean newvalue) { if (newvalue){ datepicker.setvalue(null); } } {);

graph - Plotting iteratively defined function in MATLAB -

i'm not matlab professional , so, need @ producing 3d plot of iteratively defined function f : r^2-0 -> r defined below (in pseudocode) x,y values in [-1,1] and for each i = 1,2,3 , a = (0.5,0.5) function f(v in r^2-0) { a=b=0; (a,b in r) (i=0; i<i; i=i+1) { v = |v| / ||v||^2 - a; = + | ||v||-b |; b = ||v||; } return a; } (| v | denotes component-wise vector absolute value) (if want can @ fractal generated function @ question on math-exchange here: https://math.stackexchange.com/questions/1457733/a-question-about-a-fractal-like-iteratively-defined-function ) matlab code appreciated. much thanks. save main program: clear clc close % = 1; % = [ 0.5 0.5 ]; = 10; = [ 0.5 0.5 0.5 ]; xmin = -1; xmax = 1; ymin = -1; ymax = 1; nx = 101; ny = 101; dx = (xmax - xmin) / (nx - 1); dy = (ymax - ymin) / (ny - 1); x = xmin: dx: xmax; y = ymin: dy: ymax; ix = 1: nx iy = 1: ny if ...

angularjs - Angular: variable after $scope.? -

this question might seem bit strange. i'm trying create functions update database via angular , because i'm lazy function be gettable('tablebame') it select table (mysql) matching parameter , return it. didn't think issue untill noticed worked 1 table. $scope.users = {}; var gettable = function(name) { httpfactory.setname(name); httpfactory.get(function(response) { $scope./* name inserted in function here */ = response; }); }; gettable("users"); i still had static name comment right now. have tried things doesn't work. ('$scope.' + name) is there way bind return value 'response' $scope. + 'name'? just use javascript's bracket syntax access property variable name. since $scope object can use httpfactory.get(function(response) { $scope[name] = response; });

python - How to get my custom kernel working? -

import numpy np import sklearn.svm svm here kernel function def my_kernel(p1, p2): r = 1-np.dot(p1.t, p2) return np.exp(-r**2/4) and data x1 = np.random.random((50,5)) x1 = x1/np.sum(x1) x1 = x1.t y1 = [0, 0, 1, 1, 1] then use sklearn svm my_svm = svm.svc(kernel=my_kernel) my_svm.fit(x1,y1) it outputs svc(c=1.0, cache_size=200, class_weight=none, coef0=0.0, degree=3, gamma=0.0, kernel=<function my_kernel @ 0x109891e18>, max_iter=-1, probability=false, random_state=none, shrinking=true, tol=0.001, verbose=false) but when use predict() y_pred = my_svm.predict(x1) it says --------------------------------------------------------------------------- valueerror traceback (most recent call last) <ipython-input-151-48e55060e495> in <module>() ----> 1 y_pred = my_svm.predict(x1) /library/frameworks/python.framework/versions/3.4/lib/python3.4/site-packages/sklearn/svm/base.py in predict(self, x) ...

Code Composer Studio - TI CC3200 Launchpad -

how can upload example "blinky" ti cc3200 launchpad "firmware"? i mean, plug in board , blinky example starts automatically on startup of board. thank in advance you have flash flashmemory on launchpad flashtool ccs uniflash . download ccs uniflash. once you're done that, launch , choose new target configuration. have option on left side lets choose local url bin (or in case, blinky bin file, typically in sdk folder). once you're done that, should able program via program button.

memory leaks - C++ Where is the seg fault? -

i tackling assignment computer science class: make own dynamic array template. should allow creating contiguous arrays (filled things of same type) can extend without worrying running out of space. do 1 version using malloc , free. do 1 version using new , delete. my version using new , delete works flawlessly; however, in trying convert new/delete code using malloc/free, keep getting seg fault. have narrowed down segfault (i think), being in single function: adddata. take @ code in main used test this: array2<int> *testarray3 = new array2<int>(5); array2<int> *testarray4; testarray3->initarray(); testarray3->printarray(); testarray4 = testarray3->adddata(7); testarray4->printarray(); return 0; this gives seg fault; however, when change this: array2<int> *testarray3 = new array2<int>(5); array2<int> *testarray4; testarray3->initarray(); testarray3->printarray(); testarray4 = testarray3; //->adddata(7); testarra...

C++ design issue. New to templates -

i'm new c++ templates. i have class constructor takes 2 arguments. it's class keeps list of data -- it's list of moves in chess program. i need keep original class it's used in other places, need pass arguments class, , in doing have few private data members , specialize 1 of private methods -- else stay same. don't think derived class helps me here, aren't going similar objects, , private methods called constructor , call virtual method of base class -- not derived method. so guess templates going answer. looking hints how might proceed. thanks in advance your guess wrong. templates no more answer problem inheritance is. as jtbandes said in comment below question, use composition. create class contains instance of existing class member. forward or delegate operations contained object needed (i.e. member function in new class calls member functions of contained object). add other members needed, , operations work them. write new ...

c# - Web application + SQL server triggers / thresholds -

we have web application hosted in iis. in our database serves application have kinds of different data values. trying figure out way have email sent client if data value exists or exceeds threshold value. generic example: have table lists widgets , 'in inventory' quantity. every time sells widget, quantity value depleted. want send email manager when widget quantity gets below 5 , tell him reorder more widgets. we don't want have sql triggers check quantity time 'depletion' transaction takes place. instead, want type of background monitoring process checks level of widgets on timed basis. how can accomplish this? windows service / winform application? built iis run asp.net c# code? polling based monitoring should last resort. uses many resources simple task , of time see it's not case anything. , doesn't scale when data grows. instead, should focus on code changes values , act then, on in spot. , check lighter: 1 item being checked not all...

Android FloatingActionButton Hide/Show On Page Change -

i have tabbed layout, using smarttablayout , floatingactionbutton in bottom right corner. when transition page hide floatingactionbutton, make reappear different color , different icon. when call hide() method, change icon, call show() method hide() method hasn't finished it's animation before show() called resulting in floatingactionbutton not reappearing. why doing this? according material design floating action buttons found here , should follow these 2 rules when dealing tabbed layouts: if there floating action button on multiple lateral screens (such on tabs), upon entering each screen, button should show , hide if action contained on each different. if action same, button should stay on screen (and translate new position, if necessary.) for tabbed screens, floating action button should not exit screen in same direction screen exits. doing creates visual noise. cause nonfunctional floating action button appear on screen. furthermore, incorrectly implies floating ...

Python PIP on Ubuntu -

when run python pip on new brand ubuntu 15.04 system updates installed, following assertion error. python 2.7.x. similar result python 3.4.x: ➜ pip list adium-theme-ubuntu (0.3.4) <...snip...> pyopenssl (0.13.1) pyserial (2.6) exception: traceback (most recent call last): file "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main status = self.run(options, args) file "/usr/lib/python2.7/dist-packages/pip/commands/list.py", line 80, in run self.run_listing(options) file "/usr/lib/python2.7/dist-packages/pip/commands/list.py", line 142, in run_listing self.output_package_listing(installed_packages) file "/usr/lib/python2.7/dist-packages/pip/commands/list.py", line 151, in output_package_listing if dist_is_editable(dist): file "/usr/lib/python2.7/dist-packages/pip/util.py", line 367, in dist_is_editable req = frozenrequirement.from_dist(dist, [...

How to find common rows between two dataframe in R? -

i make new data frame includes common rows of 2 separate data.frame. example: data.frame 1 1 id300 2 id2345 3 id5456 4 id33 5 id45 6 id54 data.frame2 1 id832 2 id300 3 id1000 4 id45 5 id984 6 id5456 7 id888 so want output be: 1 id300 2 id45 3 id5456 any suggestion please? common <- intersect(data.frame1$col, data.frame2$col) data.frame1[common,] # give common rows in data frame 1 data.frame2[common,] # give common rows in data frame 2

Python: Automatically Generate Google Form -

i'd able generate , publish google form using python code. possible? below link give idea: https://www.reddit.com/r/learnprogramming/comments/32xd4s/how_can_i_use_python_to_submit_a_google_form_or/

c - Outputting both stopped and Running processes in linux? -

i'm presently using linux command in c program show group of processes. when process stopped (suspended) though, command not list it. need list both running , stopped jobs. note: when stopped, not mean terminated jobs. issue displaying suspended processes. execvp("/bin/ps", parmlist); i have use ps command. there anyway show both running , stopped (suspended) processes in situation? there 2 ways go it: 1) continuously monitor processes change in state. 2) register handler notified asynchronously, when state changes. 1st case execute script continously monitors process states. have use ps bsd style options ie ps axo pid,stat 2nd case you can monitor child processes. can monitor them using waitpid() provided child processes. so, register handler signals , in handler use waitpid status. you find signals explained here: [ http://linux.die.net/man/2/waitpid][1]

c# - Understanding Claims in Tokens -

i've set solution generate jwt tokens claims inside of them. however, don't understand @ point should add claims after getting user identity: var useridentity = await manager.createidentityasync(this, authenticationtype); should user information, email identity , add new claim() on fly? i can't understanding of concept... say, registered couple of users user'a' has different claims user'b' how can differentiate after calling createidentityasync ? thanks

How to get Magento Review, just average reviews no HTML -

i have been using if ($product->getratingsummary()): echo $this->getreviewssummaryhtml($product); endif; but returns html reviews. problem variable $this not accessible inside function. there way reviews value (not whole html) without using $this variable , giving product id? if check getsummaryhtml method of mage_review_block_helper , idea how magento calculate review summary. you can use below code current product object $_product set rating summary in product object. mage::getmodel('review/review')->getentitysummary($_product, mage::app()->getstore()->getid()); after can fetch summary using below method: echo $_product->getratingsummary()->getratingsummary(); echo $_product->getratingsummary()->getreviewscount();

angularjs - Not getting the requested page after reload window using angular.js -

i facing 1 issue.when clicking <li><a href="course">course</a></li> link getting requesting page when refreshing page again not coming using angular.js.its shoqing me error the requested url /gofast/subject not found on server. .i getting home page typing url oditek.in/gofast/ .i explaining code below. app.js: var gofastoapp=angular.module('gofastohome',['ngroute']); gofastoapp.config(function($routeprovider,$locationprovider) { $routeprovider .when('/',{ templateurl : 'view/home.html', controller : 'homecontroller' }) .when('/deptinfo',{ templateurl : 'view/info.html', controller : 'infocontroller' }) .when('/timetable',{ templateurl : 'view/time.html', controller : 'timecontroller' }) .when('/course',{ templateurl : 'view/course.html', co...

android - is it possible to add data to 3 tables in one database at the same time -

i want add data in 3 tables in 1 database 3 asynctask object. because asynctask objects may run or finish @ same time , i'm adding data in database in onpostexecute() , want know possible such thing or not ? thanx android sqliteopenhelper synchronized default. need make db helper singleton , not face problem. read this more info on singleton db helper.

osx elcapitan - OSX10.11 SSH connect error -

i upload .pub files server , chmod .ssh folder 700. i error when connect server.the debug message is: junjies-macbook-pro:.ssh elijah$ ssh -vvv root@elijah.pro openssh_6.9p1, libressl 2.1.7 debug1: reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 21: applying options * debug2: ssh_connect: needpriv 0 debug1: connecting elijah.pro [173.255.249.71] port 22. debug1: connection established. debug1: identity file /users/elijah/.ssh/id_rsa type 1 debug1: key_load_public: no such file or directory debug1: identity file /users/elijah/.ssh/id_rsa-cert type -1 debug1: key_load_public: no such file or directory debug1: identity file /users/elijah/.ssh/id_dsa type -1 debug1: key_load_public: no such file or directory debug1: identity file /users/elijah/.ssh/id_dsa-cert type -1 debug1: key_load_public: no such file or directory debug1: identity file /users/elijah/.ssh/id_ecdsa type -1 debug1: key_load_public: no such file or directory debug1: identity file...

.htaccess - Block domain to redirect the particular site -

Image
one of competitor redirect site own site.i need .ht access code block that.so,that no 1 can redirect site. as per comments think website redirecting cpanel option redirects . check option. redirecting might due this. no htaccess work in condition. update for htacccess # block site referrers rewriteengine on rewritecond %{http_referer} badsite\.com [nc,or] rewritecond %{http_referer} www\.badsite\.com [nc,or] rewritecond %{http_referer} http\://badsite\.com [nc,or] rewritecond %{http_referer} http\://www\.badsite\.com [nc] rewriterule .* - [f] i suggest change login details of cpanel asap

c# - How to draw line and select it in Panel -

Image
my program can draw lines using canvas.drawline(). how click line , change color (select line)? private list<point> coordfirst = new list<point>(); private list<point> coordlast = new list<point>(); public graphics canvas; private void form1_load(object sender, eventargs e) { canvas=panel1.creategraphics(); } coordinate line stored in coordfirs & coodlast. here suitable line class: class line { public color linecolor { get; set; } public float linewidth { get; set; } public bool selected { get; set; } public point start { get; set; } public point end { get; set; } public line(color c, float w, point s, point e) { linecolor = c; linewidth = w; start = s; end = e; } public void draw(graphics g) { using (pen pen = new pen(linecolor, linewidth)) g.drawline(pen, start, end); } public bool hittest(point pt) { // test if fall outside of bounding box: ...

java - Why am I getting this error? Please see the details -

i'm developing material design app & applying activity transition have written following code in mainactivity.java my mainactivity.java file's code: public class mainactivity extends appcompatactivity { public toolbar toolbar; public tablayout tablayout; public viewpager viewpager; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); if (build.version.sdk_int >= build.version_codes.lollipop) { // call material design apis here // enable transitions getwindow().requestfeature(window.feature_content_transitions); } else { } setcontentview(r.layout.activity_main); spannablestring s = new spannablestring("abc"); s.setspan(new typefacespan(this, "pacifico.ttf"), 0, s.length(), spannable.span_exclusive_exclusive); toolbar = (toolbar) findviewbyid(r.id.toolbar); ...

java - EditText and Reflection -

my problem little particular. i show forth in code: import android.app.activity; import android.content.context; import android.widget.edittext; import java.lang.reflect.field; import java.util.hashmap; public class myactivity extends activity { public hashmap initedittext(context context){ hashmap list = new hashmap(); field[] fields = context.getclass().getdeclaredfields(); (field field : fields){ if(field.getname().startswith("e_")){ string word = field.getname().substring(2); string firscaract = word.substring(0, 1).touppercase(); string key = field.getname().substring(3); try{ class<?> cl = field.gettype(); // value of member in object: (object instance of myclass) //object o = field.get(c); if (edittext.class.isassignablefrom(cl)) { edittext...

PHP telegram bot reply_mark -

i'm programming bot on telegram , didn't make special keyboard via reply_mark can me? code this: file_get_contents($website."/sendmessage?chat_id=".$myid."&text=keytest&reply_markup={"keyboard":[["test"]]}"); if copy&paste parameters bot , execute command works. that's because use text provide parts of url. api.telegram.org/bot[key]/sendmessage?chat_id=[id]&text=keytest&reply_markup={"keyboard":[["test"]]} what doing writing script executes command. far can tell you're using dot . concatenate strings. thing you're doing trying write json reply_markup directly url. what problem is, 1 of following: you're not escaping " sign or not concatenating variables correctly. so if keyboard , test variables need concatenate them correctly using dot: file_get_contents($website."/sendmessage?chat_id=".$myid."&text=keytest&reply_markup={...

javascript - Using $routeParams or $location for History Links -

i working on questionbank , have nicely coded of elements, add browser history navigating questions. so here basic setup on plunker: http://embed.plnkr.co/1f64ddrxvyfd8scvggac/preview currently page loads under /quiz $scope.currentq dynamically changed url search of /quiz?q=1 i have played around $routeparams alternative , $location can't seem work properly. can give me helping hand? // code goes here (function() { 'use strict'; var app = angular.module('questionbank', []); ////////////// //directives// ////////////// app.controller('questionbankcontroller', ['$scope', function($scope) { $scope.currentq = 0; $scope.guess = []; $scope.sbachoices = ['a', 'b', 'c', 'd', 'e']; $scope.questions = questions; $scope.prevq = function() { if ($scope.currentq !== 0) { $scope.currentq--; } }; ...

python - AttributeError at ....... 'NoneType' object has no attribute 'is_valid' while developing django model forms -

i error while saving modelform database. "attributeerror @ /giris/markayenikaydet/, 'nonetype' object has no attribute is_valid " what may cause ? stuck. related modelform generation or related not including ant function. """" model... from __future__ import unicode_literals django.db import models datetime import datetime django.urls import reverse django.utils.translation import gettext _ class marka(models.model): marka_adi = models.charfield(max_length=200) def __str__(self): return(self.marka_adi) url... from django.views.generic import redirectview django.conf.urls import include, url . import views django.utils.translation import gettext _ urlpatterns = [ url(r'^$', views.index, name='index'), url(r'^demirbas/$', views.demirbaslistview.as_view(), name='demirbas'), url(r'^demirbas/(?p<pk>\d+)$', views.demirbasdetailview.as_view(), name='de...

python - For my self referencing table query it can't compare a collection to an object or collection; -

class place(db.model): __tablename__ = 'places' id = db.column(db.integer, primary_key=true) name = db.column(db.string) lat = db.column(db.float, default=none) long = db.column(db.float, default=none) parent_place_id = db.column(db.integer, db.foreignkey('places.id')) parent_place = db.relationship("place") branches = db.relationship("branch", back_populates="place") def __str__(self): return self.name when tried following: p_place = models.place.query.get(parent_place_id) if parent_place_id else none places = models.place.query.filter(models.place.parent_place==p_place ).all() i following error: traceback (most recent call last): ... file "./app/ecom_chatbot/ecom_conversation.py", line 127, in show_locations places = models.place.query.filter(models.place.parent_place==p_place ).all() file "/root/ecom/ecom_bot/local/lib/python2.7/site-packages/sqlalch...

javascript not working on this following code -

those following code isnot working... firstly want these selected value (by sentvalue() , receivevalue()) and want use selected value on another(sent()) function .. this html code <select class="form-control" id="sents" onchange="sentvalue(this) " > <option value="0" >-- select 1 --</option> <option value="1" ">1</option> <option value="2" >2</option> <option value="3" >3</option> <option value="4" >4</option> <option value="5" >5</option> <option value="6" >6</option> <option value="7" >7</option> </select> <select class="form-control" id="receives" onchange=" receivevalue(this); counter2(this); " > <option value="0"...

c# - If list contains 4 of the given gameObjects -

Image
i trying find how can check if 4 of given gameobjects in list. have list gameobjects. gameobject gets out of list, gets in. want check if 4 of same colors in list. in case, "childtiles" list. tried doing this: void update() { foreach (gameobject tile in childtiles) { if (tile.gameobject.name == "tilegreen1" && tile.gameobject.name == "tilegreen2" && tile.gameobject.name == "tilegreen3" && tile.gameobject.name == "tilegreen4") { gamemanager.finalgreencomplete = true; debug.log (gamemanager.finalgreencomplete); } } } this returns nothing. work if check 1 object. can't use childtiles.contains() think, because possible 1 gameobject if i'm right. how check multiple gameobjects? edit: bit more information. i have 4 different colors, each color has 4 tiles. everytime player clicks button, parent rotate tiles child. childs automatically c...

r - Remove duplicated rows -

i have read csv file r data.frame. of rows have same element in 1 of columns. remove rows duplicates in column. example: platform_external_dbus 202 16 google 1 platform_external_dbus 202 16 space-ghost.verbum 1 platform_external_dbus 202 16 localhost 1 platform_external_dbus 202 16 users.sourceforge 8 platform_external_dbus 202 16 hughsie 1 i 1 of these rows since others have same data in first column. just isolate data frame columns need, use unique function :d # in above example, need first 3 columns deduped.data <- unique( yourdata[ , 1:3 ] ) # fourth column no longer 'distinguishes' them, # they're duplicates , thrown out.

.htaccess - How to rewrite url in apache? -

lets i've got site example.com/books/linux i want rewrite url books.example.com/linux without doing else (without redirecting/moving files different location on server etc.). so how can rewrite url using apache2? i glad read answers. thank much!

swift3 - Swift 3 Trimming characters -

anyone know how trim or eliminate characters string? have data uilabel "abcde1000001" , need numbers only. idea? trimming? concat? other solution? i try looking other solution let cardtrim = string.trimmingcharacters(in: characterset(charactersin: "abcdef")) your code works perfectly, need call on string variable in store value want trim. let stringtotrim = "abcde1000001" let cardtrim = stringtotrim.trimmingcharacters(in: characterset(charactersin: "abcdef")) //value: 1000001 a more generic solution use characterset.decimaldigits.inverted keep digits string. let cardtrim = stringtotrim.trimmingcharacters(in: characterset.decimaldigits.inverted) be aware trimmingcharacters removes characters in characterset beginning , end of string, if have string abc101a101 , want remove letters it, you'll have use different approach (for instance regular expressions).

android - How to open WebView in androdi by clicking ImageButton? -

android:layout_width="368dp" android:layout_height="495dp" android:orientation="vertical" tools:layout_editor_absolutey="8dp" tools:layout_editor_absolutex="8dp"> <webview android:id="@+id/webview" android:layout_width="fill_parent" android:layout_height="fill_parent" android:visibility="invisible" /> <imagebutton android:id="@+id/imgbutton" android:layout_width="100dp" android:layout_height="100dp" android:layout_marginbottom="30dp" android:layout_marginleft="140dp" android:onclick="loadurl" android:src="@drawable/img" android:contentdescription="@null"/> </linearlayout> how can open website in app clicking imagebutton or imageview without open browser? t...

vba - How to connect to OPEN workbook in another instance of Excel -

currently can run 2 excel vba processes simultaniously within 2 seperate excel instances on 1 pc. my goal import data excel instance 2 excel instance 1 every minute. unfortunately not possible connect workbook in excel instance 1 open workbook in excel instance 2. since can connect saved workbook, solution save workbook in instance 2 every minute , retrieve new data saved workbook. although rather heavy method. there better solution connect open workbook in instance of excel? (to open workbook in same instance no solution since in case can no longer run 2 vba processes simultaniously.) thanks! short version option explicit public sub getdatafromexternalxlinstance() dim instancefile object, ur variant, lr long 'if not open, getobject() open in new instance set instancefile = getobject("c:\tmp\testdata2.xlsx") '(code running testdata1) ur = instancefile.worksheets(2).usedrange 'get used range 2nd workshee...

android - Removing ChildEventListener -

i'm using firebase childeventlistener added n-number of times node data db. now i'm trying remove childeventlistener , not seem work , duplicate data. query = firebasedatabase.getinstance().getreference() .child("chat") .child("room-messages") .child(roomid) .orderbychild("timestamp") .limittolast(index); paginationlistener = query.addchildeventlistener(new childeventlistener() { @override public void onchildadded(datasnapshot datasnapshot, string s) { log.d(tag, datasnapshot.getkey() + " - single value"); try { message message = datasnapshot.getvalue(message.class); message.setid(datasnapshot.getkey()); eventbus.getdefault().post(new getpaginatedmessage(message)); } catch (runtimeexception e) { log.d(tag, "type cast exception caught");...

php - Fatal error: Call to a member function bind_param() on boolean -

Image
i'm busy on function gets settings db, , suddenly, ran error: fatal error: call member function bind_param() on boolean in c:\xampp2\htdocs\application\classes\class.functions.php on line 16 normally, mean i'm selecting stuff unexisting tables , stuff. in case, 'm not... here's getsetting function: public function getsetting($setting) { $query = $this->db->conn->prepare('select value, param ws_settings name = ?'); $query->bind_param('s', $setting); $query->execute(); $query->bind_result($value, $param); $query->store_result(); if ($query->num_rows() > 0) { while ($query->fetch()) { return $value; if ($param === '1') { $this->tpl->createparameter($setting, $value); } } } else { __('invalid.setting.request', $setting); } } the $this->db variable pa...

JavaScript - Insert PHP multidimensional array into Javascript class in Google Charts -

i'm using google charts tutorial on how convert array graph. the data in tutorial in function. want insert own data function php array. managed convert php array javascript array. below code: $jsarray = array(); foreach($movingaverages $movingaverage) { $jsarray[] = array((int) $movingaverage['unix'], (int) $movingaverage['closing-prices']); } below sample code: array ( [0] => array ( [0] => 1505040240 [1] => 3452 ) [1] => array ( [0] => 1505040300 [1] => 3451 ) [2] => array ( [0] => 1505040360 [1] => 3446 ) [3] => array ( [0] => 1505040420 [1] => 3449 ) this current javascript code: <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script> <script type="tex...

javascript - How to start a v-for loop at a specific index -

how start v-for loop @ specific index. example: array given array = [a,b,c,d,e,f]; i want use v-for loop start looping 3rd element. thank :) just use standard slice method: new vue({ el: '#app', data: { items: [ 'aaa', 'bbb', 'ccc', 'ddd', 'eee', 'fff' ] } }) <script src="https://unpkg.com/vue@2.4.2/dist/vue.min.js"></script> <div id="app"> <ul> <li v-for="item in items.slice(2)">{{ item }}</li> </ul> </div> ps: or v-for v-if: new vue({ el: '#app', data: { items: [ 'aaa', 'bbb', 'ccc', 'ddd', 'eee', 'fff' ] } }) <script src="https://unpkg.com/vue@2.4.2/dist/vue.min.js"></script> <div id=...