Posts

Showing posts from September, 2011

javascript - Moving a value after php returns the table -

i have title on page. inside div tag. when page displayed simple , says "net control manager". after user makes selection php program runs mysql , returns table. returns value want put title. "net control manager: pcarg" example. the problem i'm not sure how put piece div. write value div echo php "echo $value" returned correctly. in onload in body tag use function retrieve new div (newport), , add title div. since onload happens first "undefined". how make wait new div written new data? or there method don't know about. if read correctly, you're looking pick text , append div's text? you -- making sure it's @ bottom of html before closing </body> tag. <script type="text/javascript"> $(document).ready(function () { var title = $('#title'); // or whatever div id or class name is. var newport = $('#newport'); // or whatever div id or class name is. // app...

Android - load image from path -

in project have image localized in app\src\main\res\drawable\informations\angry_face.png when want load using bitmap bitmap = bitmapfactory.decodefile("app\\src\\main\\res\\drawable\\informations\\angry_face.png"); this.image.setimagebitmap(bitmap); error occurs: unable decode stream: java.io.filenotfoundexception: app\src\main\res\drawable\informations\angry_face.png: open failed: enoent (no such file or directory) question is: how set path resource? thanks :) you accessing resources wrongly: try instead: bitmap myangryimage = bitmapfactory.decoderesource(getresources(), r.drawable.angry_face);

ruby on rails - Why default page is calling even though index.html.erb file in public folder is missing? -

i developing simple ruby on rails app.the server has started successfully.then when go default web url localhost:3000/ default route called showing home page instructions.but dont want need remove index.html.erb file in public folder under main project directory.the real problem file missing , still default page loading. what happening here , index.html.erb file located.[dont mark duplicate because here problem different].how call route show mypage.html server log started "/" ::1 @ 2016-04-19 23:29:26 +0530 processing rails::welcomecontroller#index html rendered c:/railsinstaller/ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.2.5.1/lib/rails/templates/rails/welcome/index.html.erb (0.0ms) completed 200 ok in 36ms (views: 35.1ms | activerecord: 0.0ms) files in public folder: 400.html 422.html 500.html favicon.ico robots.txt add root routes.rb root 'mycontroller#my_action'

bigcommerce - Referencing Images in Stencil Themes -

for bigcommerce stencil themes having references assets, docs not mention css , sass url references. is there specialized sass function referencing images in asserts directory, in bigcommerce stencil themes? or, cdn reference strings converted automatically? if referencing images bundled theme, can use path ../images/myimage.png , load cdn. if referencing images outside of theme, there no sass function , need hardcode cdn url (or use inline css utilize cdn handlebars helper).

Is there a target in Visual Studio 2012 that will run when the project opens? -

tl;dr have command run open project in visual studio 2012. how achieve this? longer version to make front-end parts of project build automatically in visual studio have specified in project file: <propertygroup label="nodejs"> <nodejspath>$(msbuildprojectdirectory)\..\..\tools\nodejs</nodejspath> </propertygroup> <target name="beforebuild"> <exec command="$(nodejspath)\npm install" /> <exec command="$(nodejspath)\npm run test" /> <exec command="$(nodejspath)\npm run build-all" /> </target> this fine, means sass changes not built while project running. i'd have sass continually compiled after opening project in visual studio without of back-enders needing know node process doing all. means need run npm install , npm run watch-sass on project startup. i know visual studio 2015 npm install sees package.json , want replicate. the followin...

javascript - Straightforward Way to Extend Class in Node.js -

i moving plain javascript class node.js. in plain javascript use: class blockmosaicstreamer extends mosaicstreamer{ } i can't seem find simple way implement in node.js. in node project in blockmosaicstreamer.js have: 'use strict'; function blockmosaicstreamer(){ } how extend mosaicstreamer in ./mosaicstreamer.js ? 'use strict'; function mosaicstreamer(){ } it depends how defined first class, suggest using this: class someclass { } module.exports = someclass then in extend: const someclass = require('./dir/file.js') class mynewclass extends someclass { } module.exports = mynewclass

Android ActionBarDrawerToggle -

i complete beginner , wanted know actionbardrawer have "setdrawerlister()" , "syncstate()" these 2 methods. method do? follow these link use of syncstate , can assume synchronize icon drawer , drawer when move drawer icon rotate, try remove syncstate , animation wont work

How can I send JSON to consumer using RabbitMQ and Elixir? -

i trying send json consumer rabbitmq? possible , how? using elixir programming language. follow link : https://github.com/pma/amqp open issues more information send json. iex(1)> {:ok, conn} = amqp.connection.open {:ok, %amqp.connection{pid: #pid<0.364.0>}} iex(2)> {:ok, chan} = amqp.channel.open(conn) {:ok, %amqp.channel{conn: %amqp.connection{pid: #pid<0.364.0>}, pid: #pid<0.376.0>}} iex(3)> amqp.queue.declare chan, "test_queue" {:ok, %{consumer_count: 0, message_count: 0, queue: "test_queue"}} iex(4)> amqp.exchange.declare chan, "test_exchange" :ok iex(5)> amqp.queue.bind chan, "test_queue", "test_exchange" :ok iex(6)> amqp.basic.publish(chan, "test_exchange", "", poison.encode(%{ name: "s" }), [content_type: "application/json"]) :ok

c# - Linking failed when using Hockey SDK in Xamarin IOS App -

i have xamarin.forms app. in ios project installed hockeyapp package here , followed samples here adding following code in appdelegate.cs : public override bool finishedlaunching (uiapplication app, nsdictionary options) { //we must wrap our setup in block wire // mono's sigsegv , sigbus signals hockeyapp.setup.enablecustomcrashreporting (() => { //get shared instance var manager = bithockeymanager.sharedhockeymanager; //configure use our app_id manager.configure ("your-hockeyapp-appid"); //start manager manager.startmanager (); //authenticate (there other authentication options) manager.authenticator.authenticateinstallation (); //rethrow unhandled .net exceptions native ios // exceptions stack traces appear nicely in hockeyapp appdomain.currentdomain.unhandledexception += (sender, e) => setup.throwexceptionasnative(e.exceptionobject); ...

class - Python getslice Item Operator Override Function not working -

practicing examples posted here learning python oop. looking output of '1 4', instead throws error below. class fakelist: def __getslice___(self,start,end): return str(start) + " " + str(end) f = fakelist() f[1:4] note: using f.__getitem__(1, 4) results in correct output--"1 4", shown in link above. traceback (most recent call last) in () ----> 1 f[1:4] typeerror: 'fakelist' object not subscriptable as mentioned in comments, __getitem__ method takes 1 parameter of slice type, , can access start/end of range via slice.start , slice.stop , here example more debug output show going on: class fakelist: def __getitem__(self, slice_): print('slice_', slice_) print('type(slice_)', type(slice_)) print('dir(slice_)', dir(slice_)) return str(slice_.start) + " " + str(slice_.stop) f = fakelist() print(f[1:4]) the output: s...

Convert datatable to JSON in C# -

i want records database datatable . then convert datatable json object. return json object javascript function. i use this code calling: string result = jsonconvert.serializeobject(datatabletodictionary(queryresult, "title"), newtonsoft.json.formatting.indented); to convert datatable json, works correctly , return following: { "1": { "viewcount": 703, "clickcount": 98 }, "2": { "viewcount": 509, "clickcount": 85 }, "3": { "viewcount": 578, "clickcount": 86 }, "4": { "viewcount": 737, "clickcount": 108 }, "5": { "viewcount": 769, "clickcount": 130 } } but return following: {"records":[ { "title": 1, "viewcount": 703, "clickcount": 98 }, { "title": 2, "viewcount": 509,...

java - Automatically chaining multiple tests on broken JVMs -

i running series of performance tests linux command line using maven + testng on java8. most of these tests run until break jvm (typically running out of memory) @ point manually set , run test new jvm. i able automatically chain multiple tests run back, don't know of way accomplish when previous test leaves jvm in unusable state. is there way me reset broken jvm (or along lines) via java / maven / linux / other program / framework? i have access either oracle's jdk or openjdk, if need may able convince server admin install jdk. the maven-surefire-plugin allows tests run in forked jvm. information on plugin page , you'll need like: <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-surefire-plugin</artifactid> <version>2.19.1</version> <configuration> <forkcount>1</forkcount> <reuseforks>false</reuseforks> </configuratio...

android - SQLite database errors with inputting data -

i've finished creating first database, think of syntax in oncreate wrong. can't figure out however? i've tried looking @ tutorials , tried tailor code towards theirs, nothing seems working. package com.example.bash1.sqlitediss; import android.content.contentvalues; import android.content.context; import android.database.sqlite.sqlitedatabase; import android.database.sqlite.sqliteopenhelper; public class databasehelper extends sqliteopenhelper { // database name public static final string database_stockdb = "stock.db"; // column names public static final string table_name = "stock_table"; public static final string col_1 = "id"; public static final string col_2 = "name"; public static final string col_3 = "datereceived"; public static final string col_4 = "expirydate"; public databasehelper(context context) { super(context, database_stockdb, null, 1); } @override public void oncreate(sqlitedatabase db)...

python 2.7 - facecolor = 'none' (empty circles) not working using seaborn and .map -

Image
i have following code trying plot 2 sets of data on same plot, markers being empty circles. expect inclusion of facecolor = 'none' in map function below accomplish this, not seem work. closest can below have red circles around red , blue dark dots. x1 = np.random.randn(50) y1 = np.random.randn(50)*100 x2 = np.random.randn(50) y2 = np.random.randn(50)*100 df1 = pd.dataframe({'x1':x1, 'y1':y1}) df2 = pd.dataframe({'x2':x2, 'y2':y2}) df = pd.concat([df1.rename(columns={'x1':'x','y1':'y'}) .join(pd.series(['df1']*len(df1), name='df')), df2.rename(columns={'x2':'x','y2':'y'}) .join(pd.series(['df2']*len(df2), name='df'))], ignore_index=true) pal = dict(df1="red", df2="blue") g = sns.facetgrid(df, hue='df', palette=pal, size=5) g.map(plt.scatter, "x...

sql - Declare variable -

i error message: msg 164, level 15, state 1, line 18 each group by expression must contain @ least 1 column not outer reference from t-sql code: declare @client_count int select @client_count = count(clt_nbr) client select case when status = 3 'category1' else 'category2' end category, count(*) count, @client_count [total client], count(*) / @client_count percentage client_status status in (3, 8) group status, @client_count can me fix it? thank you! your syntax wrong. need put of values need returned before from . declare @client_count int select @client_count = count(clt_nbr) client select case when status = 3 'category1' else 'category2' end category , count(status) statuscount , @client_count [total client] , count(status) / @client_count percentage client_status status in ( 3 ,8 ) group status ...

c# - Avoid numerous casts in inheritance tree -

this problem seems super basic still can't find way clear it. when have simple inheritance b , c inheriting a | |-----| b c let's these interface like: public interface { list<a> children { get; } } my issue: when got through b.children have cast b every time want use specifics. there way have list of children without having declare children in leaves of inheritance tree? precision: child of same type parent (or sub-type). , tree can go deeper. example, think ui system objects, containers, controls, labels class has children things of same type or sub-types of itself. here code. have top level as public interface iterm { string text { get; } } then, offered @damien_the_unbeliever public interface iterm<t> : iterm t : iterm { list<t> children { get; } } public interface itermcontrol : iterm<itermcontrol> { ... } public class termcontrol : itermcontrol { ... } i starting think useless have access list...

java - How to add map to a tabbed activity (Android) -

i have tabbed activity uses sectionspageadapter. there 2 tabs, each uses different fragment, 1 of google map. when attempt supportmapfragment mapfragment returns null. supportmapfragment mapfragment = (supportmapfragment) getchildfragmentmanager() .findfragmentbyid(r.id.map); i have tried: supportmapfragment mapfragment = (supportmapfragment) getfragmentmanager() .findfragmentbyid(r.id.map); if create new googlemapsactivity works fine, confirms has nothing key. fragment id map exists. mainactivity.java package com.example.frias19o.trackthem2; import android.support.design.widget.tablayout; import android.support.design.widget.floatingactionbutton; import android.support.design.widget.snackbar; import android.support.v7.app.appcompatactivity; import android.support.v7.widget.toolbar; import android.support.v4.view.viewpager; import android.os.bundle; import android.view.menu; import android.view.menuitem; import android.view.view; pub...

html - table in div goes outside of container in responsive mode -

Image
i have table inside of div. in responsive mode, table goes outside of div area , looks this: i trying have table move center in responsive mode. i want this: currently, when screen width gets small, table not close enough left fit in container. not want table go outside of container. does know how can accomplish this? .slice-table { vertical-align: middle; display: block; cursor: pointer; cursor: hand; } .inner { width: 50%; margin: 0 auto; font-size: 6px; color: #ffffff; } .spacer-20 { font-size: 0; height: 20px; line-height: 0; } <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mtjoasx8j1au+a5wdvnpi2lkffwweaa8hdddjzlplegxhjvme1fgjwpgmkzs7" crossorigin="anonymous"> <div class="st-container"> <div class="st-content" id="content"> <div class="st-con...

Compiler Error in Excel Vba -

i'm getting compiler error while running below code: sub addnameinlist() filmname = inputbox("type in new film name") worksheets("sheet2").activate range("b1").end(xldown).offset(1, 0).select activecell.value = filmname msgbox filmname & " added list" end sub error message compiler error: variable not defined you need declare filmname: sub addnameinlist() dim filmname string filmname = inputbox("type in new film name") worksheets("sheet2").range("b1").end(xldown).offset(1, 0).value = filmname msgbox filmname & " added list" end sub if have option explicit set either @ top of module or in settings requires variables declared. also avoid using .select , .activate . in general not needed , slow down code.

asp.net mvc - c# twilio client browser to browser calls -

i in process of writing c# mvc.net application , need know if can end twilio client calls after amount of time , play recording during call when call has reached time limit or recording says "this call end in 30 seconds". help. you'll have little work make work duration empty value until after call terminates. instead, use starttime parameter on call , calculate duration manually in application. after implementing can modify call using <play> verb play recording during call warning message , <hangup> call once reached specified time. an example modification in c# like: // download twilio-csharp library twilio.com/docs/csharp/install using system; using twilio; class example { static void main(string[] args) { // find account sid , auth token @ twilio.com/user/account string accountsid = "account_sid"; string authtoken = "auth_token"; var twilio = new twiliorestclient(accountsid, authtoken); ...

html - Hang image off screen without breaking responsivness -

Image
i'm having issue hanging image outside of it's container / off screen without breaking responsiveness of website. main issue have scroll right , left based on how image positioned. here's example of i'm trying achieve (the product images left , right scroll down): http://invisionapp.com/ here's i'm @ far: http://codepen.io/darcyvoutt/pen/ekrmoz the code on image is: .section { height: 505px; } .left, .right { display: block; float: left; width: 50%; } .left { background: yellow; } .right { position: relative; } .image { max-width: none !important; height: 507px !important; width: 873px !important; display: block; } let me know if have questions left out accident. try: .wrap { ... overflow: hidden; } .image { position: absolute; .right & { left: 40%; } .left & { right: 60%; } } should work html : <div class="section"> <div class="left"> ...

Error: "duplicate entry: android/support/v7/appcompat/R$anim.class" -

building app generates following error: error:execution failed task ':app:transformclasseswithjarmergingfordebug'. > com.android.build.api.transform.transformexception: java.util.zip.zipexception: duplicate entry: android/support/v7/appcompat/r$anim.class i have cleaned , built project many times no avail. has following in gradle build: compile 'com.android.support:appcompat-v7:23.3.0' it uses library via aar file. library project has above in gradle build. could offer tip on how resolve this? yup , face same problem few days ago reason - as told "that library project has above in gradle build" system wont able understand dependency hi take (app's - compile 'com.android.support:appcompat-v7:23.3.0' or module project's - compile 'com.android.support:appcompat-v7:23.3.0' ) hi says have duplicate entry how resolve - step 1 - clean/build project. go build -> clean/build project. step...

java - How can I find out, that a Node or a ButtonBase is a Button? -

the title says it. how can check node item or buttonbase item button ? can use equals method? public void initlistener(arraylist<treeitem> treebranches, buttonbase item){ if(item != null && **item.equals**....?)){ ... } } if(item != null && item instanceof button) { ... } or simply, since (null instanceof button) == false : if(item instanceof button) { ... }

Marklogic questions -

hello sql server dba , new marklogic , have few questions. would marklogic support .net framework. meant our developers using .net framework 4.5 , using linq generate scripts sql. able generate marklogic scripts performing crud operations against marklogic database? would able run sql or sql scripts retrieve data marklogic database( selecting documents sql). know couchbase supports niql. does horizontal scaling require entire cluster down? able add or remove node marklogic cluster while cluster still online? does marklogic support point in time restore (database , document). sqlserver has concept of transaction log backups , let me point in time restore. there similar that? i won't moving entire application marklogic rather part of sqlserver having contention. hybrid model. there issue 2 phase commits? (i meant commits sqlserver commits marklogic) is there minimum number of nodes required purchasing license? , minimum number of nodes required cluster? a docume...

cordova - Ionic - Splash Screen works for iOS but not for Android -

i have ionic app splash screen , icons generated using cli command ionic resources the ios version works splash screen being rendered, on android version white screen showing while loading app. i've checked config.xml file , paths seem correct , generated images present in appropriate folders. (i used splash.psd template generate them well. what missing? here config.xml file reference, have feeling i'm doing wrong here -- <?xml version="1.0" encoding="utf-8" standalone="yes"?> <widget id="com.ionicframework.testeduser720691" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> <name>tested health</name> <description> ionic framework , cordova project. </description> <author email="you@example.com" href="http://example.com.com/"> name here </author> ...

ios - Create PHLivePhoto Programmatically From UIImages -

how can create phlivephoto programmatically in objective-c (such multiple uiimages, or other means)? can't find solution in apple's documentation. know must possible in way there multiple apps on app store provide animated live photos use lock screen on iphone 6s. any appreciated! thanks

testing - Maven scope test needs to resolve depdencies -

i have dependency in pom <scope>test</scope> . understood scope concept of maven dependency should required during test builds. nevertheless maven trys download dependency during mvn package why following build failure: [info] build failure [info] ------------------------------------------------------------------------ [info] total time: 0.278 s [info] finished at: 2016-04-19t22:11:59+02:00 [info] final memory: 5m/15m [info] ------------------------------------------------------------------------ [error] failed execute goal on project my-module: not resolve dependencies project com.mycompany.app:my-module:jar:1: failure find group-a:artifact-b:jar:tests:1.0 in https://repo.maven.apache.org/maven2 cached in local repository, resolution not reattempted until update interval of central has elapsed or updates forced -> [help 1]0 i use following pom: <project> <modelversion>4.0.0</modelversion> <groupid>com.mycompany.app</groupid> ...

java - Daemon thread not working as expected -

package main.components; import java.io.serializable; import java.util.scanner; import java.util.concurrent.timeunit; public class mainsnoozerx implements runnable, serializable { private static final long serialversionuid = 1l; private static int min = 0; static thread mnz = new thread(new mainsnoozerx()); private long convertedtomilisec = 0l; private scanner scn = new scanner(system.in); @override public void run() { // todo auto-generated method stub try{ do{ system.out.println("enter minutes snooze.."); min = scn.nextint(); }while(min<0); convertedtomilisec = timeunit.minutes.tomillis(min); try { thread.sleep(convertedtomilisec); } catch (interruptedexception e) { // todo auto-generated catch block e.printstacktrace(); } system.out.println("alarm now!!!"); }catch (exception e)...

node.js - Using aggregate with populate -

i trying use aggregate populate. need $group variable of referenced objectid schema. structure like: var jobfilter = mongoose.schema({ location : { type: schema.types.objectid, ref: 'location' }, field : {type: schema.types.objectid, ref: 'jobfield'} }) var locationschema = mongoose.schema({ city : string, longitude : number, latitude : number }); and want group _field , city. wrote query did not work because of city. possible populate location somehow in query? jobfilter.aggregate( [ { $match : { "jobfilter.field" : {$ne: null}, "jobfilter.location" : {$ne: null}} }, { $group : { _id: { "field" : "$jobfilter.field" , "location...

html - Aligning multiple images -

i beginner in web coding, started making exercise see can do. i have tried align 5 images, , have been searching anywhere on web until when find out found complicated me now, due limited knowledge. #poze {align:"center"} <div id="poze"> <img src="rsz_1rsz_2000px-color_icon_greensvg.png" alt="green" style="padding:3px;border:3px solid black;" /> <img src="rsz_rsz_2000px-color_icon_bluesvg.png" alt="blue" style="padding:3px;border:3px solid black;" /> <img src="rsz_rsz_2000px-color_icon_yellowsvg.png" alt="yellow" style="padding:3px;border:3px solid black;" /> <img src="rsz_1rsz_2000px-color_icon_redsvg.png" alt="red" style="padding:3px;border:3px solid black;" /> <img src="rsz_1rsz_2000px-color_icon_purplesvg.png" alt="purple" style="padding:3px;border:3px solid b...

sql server - SQL join multiple columns into different rows -

i have 2 tables name combine , product , combine has multiple products inside , combine has strictly 3 products have 2 tables strutred below: combine | id | name | image | item1 | item2 | item3 1 | exmpl | www.exmpl.com/exmp.jpg | 3 | 2 | 16 product | id | name | image | stock 2 | productexmpl | www.product.com/product2.jpg | 3 3 | productexmpl2 | www.product.com/product3.jpg | 7 16 | productexmpl3 | www.product.com/product16.jpg | 3 what want search combine id select * combine id = '' , combine products in different rows , i've tried join tables select * combine c join product p on c.item1 = p.id , c.item2 = p.id , c.item3 = p.id joins information horizontally want information vertically means in different rows below id | name | image | stock 2 | productexmpl | www.product.com/product2.jpg...

ios - How to cache image on webview? -

i have uiwebview in uiviewcontroller. i'm loading content uiwebview via function: - (void)loadhtmlstring:(nsstring *)html { nsstring *path = [[nsbundle mainbundle] bundlepath]; nsurl *baseurl = [nsurl fileurlwithpath:path]; [self.webview loadhtmlstring:html baseurl:baseurl]; } if content contains many images, create gallery via fgallery ( https://github.com/gdavis/fgallery-iphone ). when open uiviewcontroller @ first time, i'm loading images , text in uiwebview. close application , turn off network. open app , open uiviewcontroller. i'm loading uiwebview cache. have problem. if opened gallery until turn off network, cover of gallery doesn't load cache, images gallery loaded. if didn't open gallery until turn off network, cover of gallery loaded cache. cover of gallery , first image of gallery same. why cover of gallery doesn't load if opened gallery? may suitable answer of webview - (bool)webview:(uiwebview*)webviewref shouldsta...

swift - Iterate Array 30 times using For loop -

i have array 8 elements want copy elements 1 one until count of new array reach 30 times. i used loop , while result copying first element 30 times. let myshift = ["d12","e","n12","n","off","rest1","rest2","d"] var myarray = [string]() in myshift { while myarray.count != 30 { myarray.append(i) }} i read examples map tried use didn't work. since it's not clear looking for, here 2 options. this 1 repeat contents of array until reaches 30 items in total. keep order , loop them. results in array 30 elements. let myshift = ["d12","e","n12","n","off","rest1","rest2","d"] var myarray = [string]() (0..<30).foreach { myarray.append(myshift[$0 % myshift.count]) } this 1 result in array each element repeated 30 times, total of 240 elements. let myshift = ["d12","e",...

jQuery $.ajax call to GitHub Oauth API return an unidentified error -

first of code: var requestauthuri = 'https://github.com/login/oauth/access_token'; var ajaxargs = { type : 'post', url : requestauthuri, headers : { 'accept' : 'application/json' }, data : { 'client_id' : this.args['client_id'], 'client_secret' : this.args['client_secret'], 'code' : queryvars['code'] }, datatype : 'json', error : function( jqxhr, textstatus, errorthrown ) { console.log(errorthrown); alert( textstatus + ' : ' + errorthrown ); } }; console.log(ajaxargs); $.ajax( ajaxargs ).done( function( response ) { console.log( response ); }); these server reply headers: http/1.1 200 ok server: github.com date: mon, 01 jul 2013 08:42:09 gmt content-type: application/...

excel - HLookup() with date: Already tried CLng() -

the following code. want find row value of cell in workbook ("x" in here), matching dates. code running isn't returning value. cells(2,10) date (written dic-13), , first row of range("b8:j9") range of date ( "dic-11", "dic-12", "dic-13" etc...) sub buscardatos() dim y workbook dim x workbook set y = application.activeworkbook set x = application.workbooks.open("g:\estudios\biblioteca\mercado accionario _ chileno\insertarempresa.xlsm") y.sheets("información financiera").cells(range("j3").row, range("j3").column) = _ application.hlookup(clng(cells(2, 10)), _ x.sheets("cencosud").range("b8:j9"), 2, false) end sub try this sub buscardatos() dim y workbook dim x workbook set y = application.activeworkbook set x = application.workbooks.open("g:\estudios\biblioteca\mercado accionario chileno\insertarempresa.xlsm") 'modifi...

node.js - Complex SQL query with nodes-mysql -

i have problem running following sql query mysql database nodejs , node-mysql packe added npm. insert locations (locationid,name,latitude,longitude) select '214777725','bryans road, maryland','38.628055556','-77.081666667' dual not exists (select * locations locationid = '214777725') i've tried following code: var arrvalues = [ -12.9747, -38.4767, 213287181, 'salvador, brazil' ]; var arrnames = [ 'latitude', 'longitude', 'locationid', 'name' ]; var locationid = "214777725"; if(imagedata["locationid"] != null) { var query = "insert locations ? "; query = query + " select (?)"; query = query + " dual not exists"; query = query + " (select * locations locationid = ?)"; console.log(query); connection.query(query, [arrnames,arrvalues,locationid], function(err,res) { if(err) { console.log(err)...

php - Simple HTML DOM outputs the 'wrong' hierarchy -

im scraping simple html dom , scrape div , span , img do: $c = $html->find('div, span, img'); echo $c->outertext; this gives me output on page, elements mixed appear on scraped page: div img img img span span img div span etc. is there way output php statement? first div , span , last img without multiple calls php file of course. foreach(array('div', 'span', 'img') $name){ $c = $html->find($name); echo $c->outertext; }

javascript - How to observe changes in tab from Google Chrome extension? -

i've developed chrome extension injects button toolbar of rich-text editor of specific web page, code available here . basic extension based on concept of "content script" , works because toolbar present page has loaded. now, however, i'm confronted page cannot inject button page loads because user needs interact page first (make selection or press button) before toolbar appears. so i'm looking way track changes in active tab (i have url pattern page). don't want or need browser action (i.e. little button on right-hand side of omnibox), hoping away background.js event page can declare event listener user-originated events somehow it's not working. to explain: i've got manifest.json , great: { "name": "basic tab test", "description": "blah di blah", "version": "1.0", "permissions": [ "activetab" ], "background": { "scripts...

ruby on rails - Spree eCommerce Stripe Payment gateway error -

i'm working on spree , trying integrate stripe payment method. i'm getting following error @ spree confirm state. --- !ruby/object:activemerchant::billing::response params: error: type: invalid_request_error message: must supply either card or customer id message: must supply either card or customer id success: false test: false authorization: fraud_review: avs_result: code: message: street_match: postal_match: cvv_result: code: message: any helpful. thanks.

php - WordPress: add check-boxes to custom taxonomy add/edit form -

i need add list of check-boxes custom taxonomy add/edit form. have code adding text field custom taxonomy form in plugin , works fine: <?php function taxonomy_edit_meta_field($term) { $t_id = $term->term_id; $term_meta = get_option( "taxonomy_$t_id" ); ?> <tr class="form-field"> <th scope="row" valign="top"><label for="term_meta[custom_term_meta]"><?php _e( 'term:' ); ?></label></th> <td> <input type="text" name="term_meta[custom_term_meta]" id="term_meta[custom_term_meta]" value="<?php echo esc_attr( $term_meta['custom_term_meta'] ) ? esc_attr( $term_meta['custom_term_meta'] ) : ''; ?>"> </td> </tr> <?php } add_action( 'product_cat_edit_form_fields', 'taxonomy_e...

css - Using LESS for custom styling -

the current project i'm working on has requirement customers require own styling (colours, fonts etc). other customers use default styling lovingly crafted our designer. i drawn using less have different variables file per customer , import file every css/less stylesheet it's needed. variables files reside in different folder each customer. the problem have how import/reference custom varaiables less file other stylesheets. it's asp.net web site (not mvc). wrote msbuild target compile less files each of different customers using dotless compiler. target uses fileupdate task msbuildtasks amend variables import statement in each less file prior compilation task e.g @import '/css/default/variables.less' changed '/css/customer1/variables.less' etc.

Deploy to azure functions using powershell -

is there way, can deploy azure functions using powershell scripts? ci not work because use octopus deploy deploy of our production services. beneficial if there way deploy using powershell scripts. thanks! you can deploy functions azure using kudu rest api . can see code/samples of doing in our templates repository . in this code sample, can see how our test script calls out kudu rest apis deploy zip function app. the folder structure functions function per folder. need deploy function folders ./site/wwwroot on function app. need add app settings might contain secrets if add new bindings between updates. the powershell code along lines of: $apiurl = $config.scmendpoint + "/api/zip/" if ($destinationpath) { $apiurl = $apiurl + $destinationpath } $response = invoke-restmethod -uri $apiurl -headers @{authorization=("basic {0}" -f $config.authinfo)} -method put -infile $zipfilepath -contenttype "multipart/form-da...

javascript - Browser needs reload for method to re work -

this meteor client code located in client/lib.js returns true first time if method called again returns false. 2 exact calls happens in browser console. unless hard reload page, works again correctly first time only. why , how fix it? thanks validate = (function () { const patterns = { usernamepat: new regexp('^[0-9a-za-z]{16}$', 'g') }; return { username: (name) => { return patterns.usernamepat.test(some_username); } } }());

sockets - sending erlang records to a c program -

i working on assignment , part of sending erlang terms c program able communicate each other through established tcp connection. i able send numbers, lists, boolean, binaries , able decode them in c program sent message. using ei module stuff. on erlang side, encoding using etf term_to_binary/1 , others. that said, wondering how can send records on socket encoded on erlang side , decoding on c -side. ei has many functions primitives data types decoded binary format not composite 1 records. records simple -rd(person, {name = "", email = ""}) can send gen_tcp:send(socket, term_to_binary(#person{name="stack", age = 16})). how decode on c-side. i have googled not lot of resources on this. please help! thank you! erlang external term format in detail described in documentation . there erlang interface library application contain ei library detailed encoding, decoding , sending erlang terms documentation. note there more low-level ...

java - getResource() not finding file? -

when trying load file in eclipse file loads fine, when package project .jar file using jar-splice seems application can no longer locate resource files. here's error thrown when application run and here method loads files: public static file loadfile(string path) throws filenotfoundexception { inputstream stream; stream = fileutil.class.getclassloader().getresourceasstream(path); system.out.println("stream = " + stream); //debug purposes file file = new file(fileutil.class.getclassloader().getresource(path).getfile()); if (!file.exists()) { system.err.println("path: " + fileutil.class.getclassloader().getresource(path).getpath()); //also debug purposes throw new filenotfoundexception(); } return file; } using 2 system.out.printlns it's clear application can't find file based on path, if @ picture path file it's looking located. confused has never happened before, , path it's saying c...

arrays - PHP - How to get value of span with different class name -

i'm trying values of 2 span different class name , put array this html $html = '<div class="members"> <span class="records">name: </span> <span class="values">marco</span> </div> <div class="members"> <span class="records">mobile: </span> <span class="values">+9431109890</span> </div> <div class="members"> <span class="records">age: </span> <span class="values">33</span> </div> <div class="members"> <span class="records">sex: </span> <span class="values">male</span> </div>' as have code preg_match_all("/\<span class\=\"records\"\>(.*...

javascript - TinyMCE: How do you keep relative URLs when uploading images BUT use absolute URL when using "insert link" option? -

tinymce version: 4.3.10 plugin uploading images: jbimages i need store absolute path of both images , links added form message can emailed. however, toggling "relative_urls" messes 1 of up. for example: relative_urls: true setting results in proper links. however, images uploaded via jbimages result in relative links, no emails. image gets stored "images/21312.png". won't open in email, since it's missing domain prefix. relative_urls: false setting results in proper image urls when uploading via jbimages. however, other links prefixed document root url. in other words, link added "example.org" turns "www.example.com/example.org", example.com domain root. the ideal result links saved absolute , not prefixed, while uploaded images prefixed domain's url. if there no setting accommodate above, there other plugins allow image uploading body? tried drag , drop, converts image base64 , doesn't work correctly. thanks ...

Angular Gettext: plural format in .po file -

suppose have snippet <span translate-n="foo" translate-plural="{{ $count }} items" translate>1 item</span> what syntax have have in .po file translate both singular , plural? something this: #: .tmp/ui/orders/views/detail.html:1 msgid "{{$count}} ticket selected" msgid_plural "{{$count}} tickets selected" msgstr[0] "{{$count}} ticket geselecteerd" msgstr[1] "{{$count}} tickets geselecteerd" though highly recommend using tool poedit. see developer documentation full walkthrough: https://angular-gettext.rocketeer.be/dev-guide/translate/

java - Jersey configure ResourceConfig to use FreemarkerMvcFeature -

i use code @ bottom programmatically configure grizzlywebserver. use freemarkermvcfeature, suggested added this: new resourceconfig().register(org.glassfish.jersey.server.mvc.freemarker.freemarkermvcfeature) the problem is, register method available in org.glassfish.jersey.server.resourceconfig girzzly factory expects com.sun.jersey.api.core.resourceconfig . there way register features com.sun.jersey.api.core.resourceconfig ? // include resource classes in package somepackage resourceconfig rc = new packagesresourceconfig("somepackage"); // configure server use freemarker template engine map<string, object> params = new hashmap<string, object>(); params.put(freemarkerviewprocessor.freemarker_templates_base_path, "/src/main/resources/templates"); rc.setpropertiesandfeatures(params); // create server resource config httpserver server = grizzlyserverfactory.createhttpserver(base_uri, rc); i think so...