Posts

Showing posts from August, 2010

Excel VBA: inserting WHEN formula into specific range of cells with variable changing column -

hello dear stackoverflow users, my issue regarding inserting formular via macro specific range of cells. again, again , again. so basic function of formula should following: =when('zek '!f3="x";"6";when('zek '!g3="x";"8";"1")) in macro has change column next specific range. happening in loop i growing. meaning --> =when('zek '!$f$"& i+2 &"....... or in other syntax should work. try not, thats why need help. this initial try exchanged literally strings: sub 123() dim a,b,c string = 1 b = 6 c = 8 .... 'used , declared variables k, x, f, a, b, c range(cells(k + 2, 5), cells(k + 27, 5)).formular1c1 = _ "=when('zek'!$f$" & f & "=" & x & ";" & & ";when('zek'!$g$" & f & "=" & x & ";" & b & ";" & c & "))" end sub with run

exchange server - Recording B2B Call Using UCMA 4.0 / Lync 2013 -

i wrote ivr using ucma 4.0, incoming call answered using userendpoint , endpoint create back call callee. want record avcall. ca do? read can create conference , create b2b call conference caller , callee , record audio using applicationendpoint want example or simpler way. can record calls exchange if no please show me example. thanks ucma b2bcall's media-less. i.e. rtp stream goes directly between source , destinations of call. ucma can record calls terminated @ ucma application (basically non b2bcalls). ucma b2bcall's in signally path (sip) only. this why it's complex record b2bcalls , reason why have turn call conference call. can add (hidden) participant conference can use record with. you can @ microsoft ucma reference application contactcenter example of conferencing support , adding hidden participant. once have hidden participant using record easy.

caching - Edge isn't checking if HTML document has been changed -

i got problem edge isn't checking if html document has changed. firefox , chrome check this. when update html document, page correctly shown in firefox , chrome, edge still show old page. does have workaround this? ctrl + f5 should refresh browser cache , reload page. check https://en.wikipedia.org/wiki/wikipedia:bypass_your_cache . there's no edge browser mentioned here, same principle should work.

Convert string representation of list to list in Python -

i wondering simplest way convert string list following list : x = u'[ "a","b","c" , " d"]' even in case user puts spaces in between commas, , spaces inside of quotes. need handle to: x = ["a", "b", "c", "d"] in python. i know can strip spaces strip() , split() using split operator , check non alphabets. code getting kludgy. there quick function i'm not aware of? >>> import ast >>> x = u'[ "a","b","c" , " d"]' >>> x = ast.literal_eval(x) >>> x ['a', 'b', 'c', ' d'] >>> x = [n.strip() n in x] >>> x ['a', 'b', 'c', 'd'] ast.literal_eval : safely evaluate expression node or string containing python expression. string or node provided may consist of following python literal structures: strings, numbers,

android - Issue with Nexus 6P : configure 60 fps preview session using camera 2 api -

i try implement high speed capture session click on button. here state callback: private cameradevice.statecallback mcameradevicestatecallback = new cameradevice.statecallback() { @override public void onopened(cameradevice cameradevice) { mcameradevice = cameradevice; startpreview(); } @override public void ondisconnected(cameradevice cameradevice) { mcameraopencloselock.release(); cameradevice.close(); mcameradevice = null; } @override public void onerror(cameradevice cameradevice, int error) { mcameraopencloselock.release(); cameradevice.close(); mcameradevice = null; } }; open camera method: private void opencamera() throws cameraaccessexception { cameramanager manager = (cameramanager) context.getsystemservice(context.camera_service); try { mcameracharacteristics = manager.getcameracharacteristics(string.valueof(currentcamid)); } catch (cameraacce

javascript - Auto trigger mouse click event on graph drawn from starting to ending of the graph? -

graph1 = new links.graph(document.getelementbyid('adaslinechart1')); graph1.draw(data1, options1); links.events.addlistener(graph1, "selectitem", function(event) { }); i looking auto trigger of graph mouse click event programmatic starting ending of graph without manual mouse click, sample: function counter(){ //trigger graph event similar mouse on click event. }

java - Class.forName() is not working with a particular class -

i trying load java reflection bunch of classes. seems working fine (i handling exception if class not found). however there particular class raising exception not thrown call class.forname() internal method , cannot catch it. here code: try { url url = class.forname(qualifiednameoftheclass); } catch (classnotfoundexception ex) { // ok class not found can handled } catch (exception e){ // catch every other exception try strange exception } so code working, using on lots of classes , it's working (sometimes finds doesn't). however there 1 case not working , cannot understand why. if qualifiednameoftheclass = sun.security.krb5.scdynamicstoreconfig code raising exception: exception in thread "mythread-1" java.lang.unsatisfiedlinkerror: no osx in java.library.path @ java.lang.classloader.loadlibrary(classloader.java:1886) @ java.lang.runtime.loadlibrary0(runtime.java:849) @ java.lang.system.loadlibrary(system.java:1088) @

javascript - how to use external js library with Aura? -

i've added <script language="javascript" type="text/javascript" src="../js/chart.bundle.js"></script> in aura:application file, file downloaded browser (can see thru console) when try create chart object in afterrender function in renderer var mychart = new chart(ctx, { ..... i've got error: something has gone wrong. afterrender threw error in 'markup://helloworld:helloworld' [afterrender threw error in 'markup://c:ltgraph' [ referenceerror: chart not defined ]] failing descriptor: {markup://helloworld:helloworld} error @ new ( http://localhost:8080/aurafw/javascript/lg7eyfz_mxfcccxumk95lq/aura_dev.js:3152:23 ) @ http://localhost:8080/aurafw/javascript/lg7eyfz_mxfcccxumk95lq/aura_dev.js:1:1 . please try again. how use external libraries in aura ? i've found problem. code wanted use library before loaded. have put checks in js code (renderer) var timestocheck = 10;

sockets - Resetting MySQL password & missing mysqld.sock file -

i trying run local mysql server, on own computer. have lost password set up. when try connect mysql, following error: error 2002 (hy000): can't connect local mysql server through socket '/var/run/mysqld/mysqld.sock' (2) i have therefore tried these steps reset mysql password, line mysql -u root mysql returns same error message: error 2002 (hy000): can't connect local mysql server through socket '/var/run/mysqld/mysqld.sock' (2) when running command mysqladmin -u root -p status following message: error: 'can't connect local mysql server through socket '/var/run/mysqld/mysqld.sock' (2)' check mysqld running , socket: '/var/run/mysqld/mysqld.sock' exists! i have been checking , file mentioned (/var/run/mysqld/mysqld.sock) doesn't exist. not sure causing this. i have tried couple of solutions online including this , this , this , this none of solutions worked me. add mysql-server inst

java - Duplicated log4j logs in Glassfish server.log -

i have several war files each representing unique application, deployed 1 glassfish domain instance. im using log4j logging , have bundled jar each war file , im trying have each application log messages different log4j log file file. now challenge messages being logged each applications log files , additionally glassfish's server.log file. how can ensure messages logged respective log files , not glassfish's server.log without turning off logging glassfish's server.log glassfish's system events continue logged server.log whilst applications events logged distinct log files. below log4.properties file log4j.rootlogger=debug, mylogger log4j.appender.mylogger=debug,mylogger log4j.additivity.mylogger=false log4j.appender.mylogger=org.apache.log4j.rollingfileappender log4j.appender.mylogger.file=c:/applogs/myapplogger.log log4j.appender.mylogger.datepattern='.'dd-mmm-yyyy log4j.appender.mylogger.layout=org.apache.log4j.patternlayout log

python - Can I use %f and %d to format floats and ints to strings in a list? -

i starter python ,without programming experience , here's question i have list called n n = [ (1.1,5) , (2.4,7) , (5.4,6) , (9.8,14) , (10,4) ] and want create list looks like k = [ ('1.1' , {'num' : '5'}) , ('2.4' , {'num' : '7'}) , ('5.4' , {'num' : '6'}) , ('9.8' , {'num' : '14'}) , ('10' , {'num' : '4'}) ] i've tried like for in range(len(n)): k.append(('%f', {'num' : '%d'})) % n[i][0] % n[i][1] but got typeerror : unsupported operand type(s) % : 'nonetype' , 'float' i'm not sure if asked question in proper way but...hope can me this, thx t^t the numbers floats , ints, respectively. expected k looks converts them strings. can build way list comprehension: >>> n = [ (1.1,5) , (2.4,7) , (5.4,6) , (9.8,14) , (10,4) ] >>> k = [ (str(x) , {'num':

amazon web services - Pushing AWS Lambda data to Kinesis Stream -

is there way push data lambda function kinesis stream? have searched internet have not found examples related it. thanks. yes, can send information lambda kinesis stream , simple do. make sure running lambda right permissions. create file called kinesis.js, file provide 'save' function receives payload , sends kinesis stream. want able include 'save' function anywhere want send data stream. code: const aws = require('aws-sdk'); const kinesisconstant = require('./kinesisconstants'); //keep consistent const kinesis = new aws.kinesis({ apiversion: kinesisconstant.api_version, //optional //accesskeyid: '<you-can-use-this-to-run-it-locally>', //optional //secretaccesskey: '<you-can-use-this-to-run-it-locally>', //optional region: kinesisconstant.region }); const savepayload = (payload) => { //we can save strings streams if( typeof payload !== kinesisconstant.payload_type) { try

html - I've issue with below image in internet explorer, in chrome it is working -

Image
i've issue below image in internet explorer, in chrome working fine. with ie 11 (issue) with chrome (working fine proper alignment) <tr> <td class="pagequestions" style="-ms-word-break: break-all;">radio button test</td> <td class="radiowidthcalc"><span style="display: block;"> <input name="9dd79f06-cc23-442b-9e46-164f22901752" class="inputradiobutton" id="9dd79f06-cc23-442b-9e46-164f22901752" style="margin-top: 3px;" type="radio" value="1"><lable class="radiobuttonlabel" style="margin-right: 15px; -ms-word-break: break-all;">asdfasdfasdfsadfasdfsadfasd asdfasdfasdfasdf asdf asdf asdfasd fasdfasdfasdfsadfasdfsadfasd asdfasdfasdfasdf asdf asdf asdfasd fasdfasdfasdfsadfasdfsadfasd asdfasdfasdfasdf asdf asdf asdfasd fasdfasdfasdfsadfasdfsadfasd asdfasdfasdfasdf asdf asdf asdfasd fasdfasdfasdfsa

mysql - Facing trouble with Sphinx Indexer Update -

i have sphinx (version sphinx 2.0.5-release ) running on server. faced problem indexing. have cron set runs every 2 hours , rotates indexers. problem database fields got updated data. corresponding indexers failed updated data. sphinx running , not stopped. is there way check if indexer updated ? or time last updated ? can notify myself after every indexer rotation indexer updated ? is there way check if indexer updated ? can capture output of indexer, , pipe log file. 3 */2 * * * * indexer | ts >> /var/log/indexer or time last updated ? well can check file dates of index files check when index regenerated. useful show example indexer created indexes (with .new. in filename) searchd hasnt loaded them. so can notify myself after every indexer rotation indexer updated ? generally using email feature of cron pretty good. http://www.cyberciti.biz/faq/linux-unix-crontab-change-mailto-settings/ use --quiet indexer, outputs errors. ... if wa

shell - Use awk/sed to delete everything after and including third comma on each line -

i have file lines one: a, b, c, d, e from that, obtain: a, b, c can use sed or awk this? yes, can: sed -r 's/([^,]+,)([^,]+,)([^,]+).*/\1\2\3/' if want keep more 3 fields, along these lines might better: sed -r 's/(([^,]+,){2}([^,]+)).*/\1/' with awk , do: awk -v ofs=',' -f, '{nf=3; print}'

html - How to separate body content with fixed header and footer for multiple pages -

i have 3 separate section header , body , footer create pdf. header part come @ top of each page , fix. ______________________ | header | |______________________| problem body content, if content big go second page. ______________________ | | | | | body | | | | | |______________________| footer part come @ bottom of each page , fix. ______________________ | footer | |______________________| so if content big , if 2 pages created should 2 pages as: ______________________ | header | |______________________| | | | | | body part1 | | | | | |______________________| | footer | |______________________| and ______________________ | header | |______________________| | | |

php - Passing Authentication Credentials in SoapHeader class -

i have xml file in format below <?php $xmlstr = <<<xml <?xml version="1.0" encoding="utf-8" ?> <soap:envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:tusa="http://schemas.datacontract.org/2004/07/tusa.services.consumerconnect" xmlns:tem="http://tempuri.org/"> <soap:header> <authenticationcredentials> <tusa:password>xxxxx</tusa:password> <tusa:username>xxxxx</tusa:username> </authenticationcredentials> </soap:header> <soap:body> <tem:addproduct> <tem:customerdetail> <tusa:addressline1>52 test drive</tusa:addressline1> <tusa:city>johannesburg</tusa:city> <tusa:maritalstatus>unknown</tusa:maritalstatus> //more nodes </tem:customerdetail> </tem:addproduct> </soap:body> &l

Windows, c++ - Gnuplot as child process, cannot get data from stdout -

i want use gnuplot c++ program in windows. launch gnuplot (v5.0) child process c++, described here: https://msdn.microsoft.com/en-us/library/windows/desktop/ms682499(v=vs.85).aspx . writing process stdin writefile works , can send commands gnuplot , plots ok; however, need read gnuplot's output back. when trying read stdout of process: readfile blocks. peeknamedpipe returns 0 bytes available read. when launch executable, example "cmd.exe", instead of "gnuplot.exe", peeknamedpipe returns number of bytes available, , readfile reads data expected. me, means code ok , somehow, "gnuplot.exe" doesn't write stdout . does know if possible read gnuplot's output this? edit the main goal able set terminal png , read image data without passing temporary file.

Docker Volumes when updating the image -

i'm newbie docker , i'm trying better understand volumes topic. here see that: volumes initialized when container created. if container’s base image contains data @ specified mount point, existing data copied new volume upon volume initialization. (note not apply when mounting host directory.) data volumes can shared , reused among containers. changes data volume made directly. changes data volume not included when update image. data volumes persist if container deleted. data volumes designed persist data, independent of container’s life cycle. docker therefore never automatically deletes volumes when remove container, nor “garbage collect” volumes no longer referenced container. which clear, except this: changes data volume not included when update image. and i'm struggling having better understanding of this. can provide me more clear overview, possibly basic example? thanks! volumes live outside of container'

Automatically set value to empty cells in Excel when another cell is populated -

Image
i have spreadsheet tracks information on shared network drive. when user adds row, entering data next available row, cell b, want set few other cells default values. instance, cell should 1up number, cell c should user name, , cell d should current date, time stamp. individually, know how pieces, not know how set cells when cell b changed blank not blank. i not opposed using vba, avoid if possible. some of things wish record easier vba . use following worksheet event macro: private sub worksheet_change(byval target range) dim s string if intersect(target, range("b:b")) nothing exit sub ary = split(environ("homepath"), "\") s = ary(ubound(ary)) application.enableevents = false target .offset(0, -1).value = .offset(-1, -1).value + 1 .offset(0, 1).value = s .offset(0, 2).value = end application.enableevents = true end sub because worksheet code, easy install ,

javascript - Ruby on rails - Load more button with kaminari and search form. Jquery problems -

i have ajax search form , ajax pagination using kaminari. change 'load more' button i'm having trouble jquery. for form , normal pagination using in index.js.erb ; $('.gig-search-list').html("<%= j render(partial: 'gigs') %>"); this replaces current results new results search form, or next page being selected kaminari gem. i have 'load more' button add results bottom of page, still have search form behave before. with example below, 'load more' button works desired, search form doesn't work @ all. $('.gig-search-list').append("<%= j render(partial: 'gigs') %>"); i tried separating them.... $("#gig_search_form").submit(function() { $('.gig-search-list').html("<%= j render(partial: 'gigs') %>") $('#map').html('<%= j render("map") %>'); }); $(".pagination").click(functio

network programming - Is it possible to use FTP protocol for instant messaging? -

is possible use ftp protocol instant messaging software instead of other common protocols? it possible build kind of im app ftp protocol painful, slower others , insecure. you might want consider xmpp open standard messaging , presence https://xmpp.org/

model view controller - Parameters in Custom Router PHP -

i trying create custom router. have far: <?php /** * created phpstorm. * user: antony * date: 5/30/16 * time: 3:31 pm */ namespace fab\router; class router { private $_geturi = array(); private $_getcontroller = array(); private $_getmethod = array(); private $_posturi = array(); private $_postcontroller = array(); private $_postmethod = array(); public function __construct() { } /** * build collection of internal urls * @param $uri - url user types in browser * @param $controller - controller handle url * @param $method - method of controller run */ public function get($uri, $controller, $method) { $this->_geturi[] = $uri; $this->_getcontroller[] = $controller; $this->_getmethod[] = $method; } /** * build collection of internal post urls * @param $uri - url user types in browser * @param $controller - controller handle url * @param $method - method of controller run */ public function post($uri, $controller, $met

foreach - Parallel processing in R done wrong? -

i have code trying process in parallel using foreach-package. code working when run on computer 4 cores takes 26 min , when switch 1 32 cores, still takes 13 min finish. wondering whether doing wrong since using 8 times cores, reduce time 1 half. code looks this: no_cores <- detectcores() cl <- makecluster(no_cores) registerdoparallel(cl) xenopus_data <- foreach(b=1:length(newly_populated_vec),.packages = c("raster", "gdistance", "rgdal","sp")) %dopar% { xenopus_walk(altdata=altdata,water=water,habitat_suitability=habitat_suitability,max_range_without_water=max_range_without_water,max_range=max_range,slope=slope,start_pt=newly_populated_vec[b]) } stopcluster(cl) for computer 4 cores following time: time_of_start [1] "2016-07-12 13:07:23 cest" time_of_end [1] "2016-07-12 13:33:10 cest" , 1 32 cores: time_of_start [1] "2016-07-12 14:35:48 cest" time_of_end [1] "2016-07-12 14:48:08 cest"

asp.net mvc - How to close json popUp which is open by partial view after save in MVC 5 -

Image
i new in mvc. using mvc 5.how close popup after create / save. here view code:- <div id='opendilog'></div>` function createemployee() { var div = $("#opendilog"); div.load("/category/create", function () { div.dialog({ modal: true, width: 500, height: 400, title: "add new details", resizable: false }); }); } assuming using jquery.ui create dialog, can add "close" button this: div.dialog({ buttons: [ { text: 'close', click: function() { $(this).dialog('close'); } } ] }); same goes "create" button. add $(this).dialog('close'); @ end of create button click handler.

vb.net - How can I know if a .net event is already handled? -

i've written code handle event follows: addhandler myobject.myevent, addressof myfunction it seemed working @ first, when ran debugger, discovered oftentimes, myfunction run several times each time myobject.myevent fired. figured out had allowed code add event handler run more once, resulting in behavior. is there way can this? if myobject.myevent not handled addhandler myobject.myevent, addressof myfunction end if assuming it's not code that's publishing event, can't. idea subscribers isolated each other - can't find out other event subscribers, raise event etc. if problem you're adding own handler multiple times, should able fix keeping track of whether you have added handler. steven's idea of removing handler before adding interesting workaround: it's valid attempt remove handler when isn't subscribed. however, i'd regard workaround app not knowing should doing. it's quick short-term fix, i'd worried leavi

c# SSIS - Object reference not set to an instance of an object -

Image
i working on ssis package (this new me). using script component source, using readonlyvariable (varpackagepath) , assigned value 'c:\development\ssisprojects\vs2012\geterrorcolumn\geterrorcolumn\package.dtsx' location of project. script used relavent column error occured. link following : http://www.techbrothersit.com/2013/12/ssis-how-to-get-error-column-name-in.html i have debugged c# code , getting error @ line : taskname = executablenode.selectsinglenode("dts:property[@dts:name='objectname']", namespcmgr).innertext; error : 'object reference not set instance of object' . my c# code : public override void createnewoutputrows() { /* add rows calling addrow method on member variable named "<output name>buffer". example, call myoutputbuffer.addrow() if output named "myoutput". */ //declare variables string taskname; string colname; int32 collineageid; string colkey; //

How to use instagram API on different websites -

my company has different websites different customers, each of them using instagram api retrieve pictures customer's instagram account. i have tried register different instagram clients has been rejected because 'we don't approve multiple submissions same company. please consolidate integrations under single client_id.' how 1 solve problem ? instagram client has own website url, privacy policy url , redirect_url can't shared between different websites. it sounds trying client approved "go live"... meet 1 of 3 acceptable use cases (since june 1st 2016)? “my app allows people login instagram , share own content” “my product helps brands , advertisers understand, manage audience , media rights.” “my product helps broadcasters , publishers discover content, digital rights media, , share media proper attribution.” if use case doesn't fit new agenda never approved go live no matter how consolidated is. other option stay in sandbox mo

android - I want to display selected item with some title in Spinner,Like item is:item6 -

i new in android ,i want work like, in spinner if select other items form array,that item should selected including text,for example,if spinner having 10 items,if select 6th item item should display "your item is: item6",this should display in spinner first item,after select of items form array,please me ,,thanks in advance.. string[] categories = {"select one","automobile","computers","education"}; // creating adapter spinner arrayadapter<string> dataadapter = new arrayadapter<string>(this, android.r.layout.simple_spinner_item, categories); // attaching data adapter spinner spinner.setadapter(dataadapter); then onitemselected listerner :- @override public void onitemselected(adapterview<?> parent, view view, int position, long id) { // on selecting spinner item string item = parent.getitematposition(position).tostring(); categories[0] = item; arrayadapter<string> newdataadapte

python - Trying to pass filename to ExcelWriter -

i trying pass customized filename variable excelwriter cannot excelwriter portion of work reason. if replace "sheetname" "temp.xlsx" in excelwriter function works, i'm not able pass variable function. need able store today's date in filename every time script run. spreadsheet = pandas.dataframe() sheetname = 'makino machine metrics ' + time.strftime("%m/%d/%y") +'.xlsx' writer = pandas.excelwriter(sheetname, engine = 'xlsxwriter') spreadsheet.to_excel(writer, sheet_name= 'results',index = false) workbook = writer.book worksheet = writer.sheets['results'] writer.save() thanks in advance help when run program following error: ioerror: [errno 2] no such file or directory: 'makino machine metrics 07/12/2016.xlsx' you can fix removing forward slashes date part: import pandas import time spreadsheet = pandas.dataframe() sheetname = 'makino machine metrics ' + tim

android - Fragment layout with FAB conflict with CoordinatorLayout -

Image
im using materialdrawer maindraweractivity replace each fragment inside container framelayout based on selected item, want add fab (just fragment) interacts coordinatorlayout can handle cool animations. maindrawer layout: <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.coordinatorlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.design.widget.appbarlayout android:id="@+id/appbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:fitssystemwindows="true" android:theme="@style/themeoverlay.appcompat.dark.actionbar"> <android.support.v7.widget.toolbar android:id="@+id/toolbar" android

database - Is local bitmap index better or normal index, if table partition is not used in query -

i have partitioned table column of enumerated values (i.e. non unique), , want make index on column enhance performance of query doesn't include partition in clause (i.e. runs on entire table) .... better make local bitmap index or normal index ? ... using oracle 12g a bitmap index better non-unique values age,sex,location etc. depends on volume of data,size of db , how frequent updates etc. below read. refer: http://www.oracle.com/technetwork/articles/sharma-indexes-093638.html

javascript - AJAX done() executed when finished all of request staff -

i have ajax request let user delete data list. when ajax done call ajax request list updated new list of data. ajax request delete data: $.ajax({ method: "delete", url: urlrequest, headers: { 'x-csrf-token': $('meta[name="csrf-token"]').attr('content') } }).done(function() { console.log('removed'); // follow function call ajax request list updated new 1 ajaxrequesttogetnewdata(); }).fail(function() { console.log('fail'); }) the delete request above has lot of information delete, text , images , worried if ajaxrequesttogetnewdata() called before server finishes of stuff. my question : .done() method safe above situation? if not, there other jquery method executed if request finishes of stuff? yes, it's entirely safe. the done() handler not called until promise returned $.ajax method has been resolved, happen after server has finis

asp.net - Select .net control by string containing in jquery -

i working in asp.net , have 2 imagebuttons this: <asp:imagebutton runat="server" id="hosciz" imageurl="../image/ciz1.png" width="20px"height="20px" alternatetext="bla bla" /> <asp:imagebutton runat="server" id="hosciz2" imageurl="../image/ciz1.png" width="20px"height="20px" alternatetext="bla bla again" /> like see both imagebutton ids contains 'hosciz' string wonder can use .each() function id containing. know there $("div[id*='hosciz']").each(function(){.....}); is there way imagebuttons or other .net controls instead of html control div ? mean there sould be, how ? i know can solve $("#<%=hosciz.clientid%>").click(function(){ 'do whatever want' }); $("#<%=hosciz2.clientid%>").click(function(){ 'do whatever want' }); but said wonder if there way each() function

node.js - How to get day wise records of particular month in mongodb? -

this schema empname: {type: string}, soldby: {type: string}, expenseprice:{type:number}, expensedesc:{type:string}, expensetype:{type:string}, createdat: {type: date, default: date.now} i tried query db.expenses.aggregate([ { $project: { _id: 1, year: { $year: "$createdat" }, month: { $month: "$createdat" }, day: { $dayofmonth: "$createdat" }, expenseprice: 1 } }, { $group: { _id: { year: "$year", month: "$month", day: "$day" }, sum: { $sum: "$expenseprice" } } } ]) i'm getting output as { "_id" : { "year" : 2015, "month" : 8, "day" : 15 }, "sum" : 200 } { "_id" : { "year" : 2016, "month" : 5, "day" : 20 }, "sum" : 150 }

postgresql - Change out put of query result dynamically in sql -

i have table called test this: label value ------------ yes 01 no 02 when run query select option 'yes'; select label table_name value = '01'; for query i'll answer 'yes'. trying change label 'yes, have'... it should returned query... idea this??? can change label while returning data query..??? use case expression: select case when label = 'yes' 'yes, have...' else label end label, value table_name value = '01' this query replace 'yes' value label column 'yes, have...' , value remain same otherwise.

python - Using Plink to run multiple remote commands in interactive shell session -

sudo python code connect remote server not getting output. able connect remote using pexpect on windows not work. from subprocess import popen,pipe command = "plink.exe -ssh test@test.com -pw root123" sh = popen(command, stdin=pipe, stdout=pipe) sh.stdin.write('ls /\n') sh.stdin.write('ls /usr\n') sh.stdin.close() out = sh.stdout.read()

xslt - XPath testing attributes of different paths against eachother -

i have these xml files: include_paths.xml <includes> <include name="foo" path="path/to/foo"> <include name="bar" path="path/to/bar"> </includes> main.xml <model> <include file="foo"> <include file="bar"> </model> xslt stylesheet (sheet.xslt) <xsl:param name="include_paths"/> <xsl:template match="/"> <ul> <xsl:apply-templates select="//include"/> </ul> </xsl:template> <xsl:template match="include"> <li><a href="#{document($include_paths)/includes/include[@name = @file]/@name}"><xsl:value-of select="@file"/></a></li> </xsl:template> i run transformation with xsltproc --stringparam include_paths include_paths.xml sheet.xslt main.xml what code supposed first give script parameter containing f

treenode - B+Tree implementation, confusion about class pointers in C++ -

i have code implementation of b+tree project , have trouble. there 2 classes , 1 leaf , saves data , , class named node (contains data , pointers leafs). classes contain more members , prev* , next* , on... methods . to keep simple: node { values[]; leaf*[]; }; leaf { values[]; }; problem is, nodes can save pointers leafs, want can save pointers nodes (for above layer). if leafs full, has split up. insert value in above node . if node full, splits up, , if no parent node , creates one. , on. splits can propagate through full tree . is there easy way around this? having class can handle different types of array pointers in multiple instances? have use templetes , polymorphism ?

python 3.x - multiprocessing with delay of second function -

i have function write data text file, second function pull data same text file , show graph. want start second function few seconds after first function started , running both till both completed. in way can live graph. code have written below starts 2 functions simultaneously second function cannot see text file. need bit of delay second function give time first function create text file. however because second function (live_graph) needs not pull data text file parameters (ex. title of graph) 1st function not sure if correct way proceed, seems not possible "key" function; got "key not defined". maybe have write text file parameters? from multiprocessing import process import time def writing(): numentries = 0 text in get_all(newlista, "sentence", "text"): if text.lower().startswith( key.lower().split(none, 1)[0] ): pass elif len(text) > 500: pass elif len(text) < 80:

Javascript - Controlling Photoshop Externally -

i have basic javascript works within action... want control photoshop outside application (in bigger script/project). basic code var numberofpaths = activedocument.pathitems; if (numberofpaths.length < 1) { 'do here - e.g. copy file folder' } else { 'do else e.g. log , nothing it' } i trying open image (one-by-one), , check see if has path, depending on if/else statement, it. i've searched around , haven't found meets trying do. not familiar javascript, more python. i've tried below, targeting photoshop similar how in applescript. though i'm @ loss. ... photoshop = application('adobe photoshop cc 2014'); var docref = photoshop.open ('path/to/file'); var numberofpaths = photoshop.activedocument.pathitems; ... any appreciated. cheers!

Maven profiles - shared goals across profiles -

is possible have goals shared across profiles? have multiplatform pom should following: windows? thing a. mac or linux? thing b, , mac? set property xyz value 1. linux x86? set property xyz value 2. linux x64? set property xyz value 3. it possible have 4 different profiles , work, however, except setting property xyz duplicated 3 times in pom. can rid of that?

php - Best way to extract data from a string -

i looking efficient , clean way extract data string , organize array of information. i'm building tool converts pasted memo information more readable format. at moment receive memos new employees this: name: john smith service: ict manager: john turner post title: support officer i want able put of information array fetched textarea post , display on page in nicer format below: full name: john smith service area: ict line manager: john turner job title: support officer i aware use functions explode() wanted see if there better ways this? i want store of information in array easy echo onto webpage once has been posted server. $newemployee['name'] = "john smith"; $newemployee['service'] = "ict"; $newemployee['manager'] = "john turner"; $newemployee['post_title'] = "it sup

java - ActiveJDBC: integer[] on PostgreSQL with multiple schemas in one DB -

i trying use activejdbc convert integer[] postgresql database java equivalent int[] . fetch done properly, object returned weblogic.jdbc.wrapper.array_org_postgresql_jdbc_pgarray . have yet find way convert that. i have tried 2 different ways of accessing data: first, using standard record.findfirst("id = ?", id) format. because have multiple schemas in database, added @table notation model. second, tried doing record.findbysql("select array record id = ?", id) . tried array::integer[] . each time pgarray type. have searched way convert type else use, nothing has worked. is there way this? need use different way of data retrieval other activejdbc ? jdbc defines java.sql.array handle array typed columns. pgarray postgres implementation of java.sql.array . given array object a can call (integer[])a.getarray() integer array jdbc array object (if jdbc driver has decided return integer objects , not other numbers ). helper metho

how to get nginx 1.9.5 above in amazon ami -

how can install , use nginx 1.9.5 above use http/2 in amazon ami . have tried latest stable version of nginx 1.10 once reload , use nginx -v it still show 1.8 .

Failed to start service 'Microsoft Service Fabric Host Service (FabricHostSvc)' -

failed start service 'microsoft service fabric host service (fabrichostsvc)'. 1 >> start-service : failed start service 'microsoft service fabric host service (fabrichostsvc)'. @ c:\program files\microsoft sdks\service fabric\tools\scripts\clustersetuputilities.psm1:433 char:5 + start-service fabrichostsvc -warningaction silentlycontinue + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + categoryinfo : openerror: (system.serviceprocess.servicecontroller:servicecontroller) [start-service], servicecommandexception + fullyqualifiederrorid : startservicefailed,microsoft.powershell.commands.startservicecommand startlocalcluster : not start fabrichostsvc @ c:\program files\microsoft sdks\service fabric\clustersetup\devclustersetup.ps1:70 char:1 + startlocalcluster + ~~~~~~~~~~~~~~~~~ + categoryinfo : notspecified: (:) [write-error], writeerrorexception + fullyqualifiederrorid : microsoft.powershell.commands.writeerrorexception,startlocalcluster sc

timer - columns combining when c# appends to csv -

Image
we've created desktop timer our users using track daily tasks , projects. outputs data .csv file when close application. going need manually update csv file either take time off or add time. when have been doing in current state after save columns combined column a. unclear on causing , tried research encoding couldn't find relate scenario. full form1.cs: full form1.cs code code related csv: //event handler closing event -- output dump here timer can used day , captures on accidetnal close private void form1_formclosing(object sender, formclosingeventargs e) { //if file exists don't need write headers can skip additional line write , append data created if (file.exists(dskpath + "\\" + agentname + ".csv")) { using (var file = new streamwriter(dskpath+"\\" + agentname + ".csv", true, encoding.utf8)) { foreach (var data in timerdata)

android - Deserializing and Serializing JSON File in C# -

i'm trying serialize object(item) file gets appended more item objects each time function called. it keeps giving me error: 07-12 15:43:27.931 i/monodroid(17468): newtonsoft.json.jsonserializationexception: cannot deserialize current json object (e.g. {"name":"value"}) type 'system.collections.generic.list`1[waterapp.item]' because type requires json array (e.g. [1,2,3]) deserialize correctly. 07-12 15:43:27.931 i/monodroid(17468): fix error either change json json array (e.g. [1,2,3]) or change deserialized type normal .net type (e.g. not primitive type integer, not collection type array or list) can deserialized json object. jsonobjectattribute can added type force deserialize json object. here object class: using system; using system.collections; using android.content; using android.preferences; using java.io; namespace waterapp { public class item { public bool type { get; set; } public string itemname { get