Posts

Showing posts from January, 2010

vba - Dynamically change charts in excel -

i have following problem. have relative large number of excel charts, , want able change size of charts (i.e. width , height) automatically. automatically mean following: have 2 cells, 1 height , 1 width, , when change them, charts change automatically, without having push other button or anything. example, cell a1 has value 100 width , cell b1 has value 200 height. so, when change a1 200 , b1 300 charts bigger. what have done able loop on charts, , change shapes, need hit button first macro run. find out if there way change shape of charts without having push button, changing values of 2 cells have width , height of charts. in advance. in vbaproject, open microsoft excel objects , select sheet have a1:b1 in. write private sub worksheet_change(byval target range) if not intersect(target, target.worksheet.range("a1:b1")) nothing 'put macro here' end if end sub this way, everytime changes in a1 or b1 macro run. careful of write in a1 or b1 tho

analytics - Inconsistent Piwik response and no tracking -

i setting piwik on iis server. have website set load piwik tracking js. have site configured in piwik. when load page in either ie or safari, 400 piwik, expected if request missing tracking parameters, request isn't. has siteid , other parameters query string parameters. the same request chrome returns 204, expected, visit not logged in piwik. i cannot find may have piwik misconfigured, , cannot figure out why ie/safari getting 400 when chrome gets 204. what should @ fixing piwik installation log requests , not send 400 ie/safari? i using piwik v2.13.1 are passing &rec=1 parameter? debug further please enable tracker debug mode in config.ini.php: [tracker] debug=1 with such configuration piwik.php resource should print relevant debug info.

regex - Notepad++: Remove lines containing the word "Correct" and the two lines above it -

i have text-file this: 010 2015.06.29 09:57:57.731 warn always_same_text] no notaris found given strings (used postadres): different_texts 010 2015.06.29 09:57:58.220 warn always_same_text] no tussenpersoon found given strings: different_texts 010 2015.06.29 09:57:59.288 warn always_same_text] more 1 cluster (2) found given string: different_texts 010 2015.06.29 09:58:00.192 warn always_same_text] more 1 cluster (2) found given string: different_texts 010 2015.06.29 09:58:02.766 warn always_same_text] no notaris found given strings (used bezoekadres): different_texts trying retrieve notaris postadres instead of bezoekadres 010 2015.06.29 09:58:02.778 warn always_same_text] correct notaris found when using postadres instead of bezoekadres 010 2015.06.29 09:58:03.647 warn always_same_text] no notaris found given strings (used bezoekadres): different_texts trying retrieve notaris postadres instead of bezoekadres 010 2015.06.29 09:58:03.659 warn always_same_text] correct nota

SBT - include dependency for everything but test -

i have dependency (stagemonitor.org) want include except "test" , "test:test". how include dependency "test"? i'm using sbt 0.13.8. thanks, johan you need exclude things manually via managedclasspath in test . check out -= operator adding on 0.13.9-rc1.

javascript - jQuery or JS : Piggyback on post return? -

i'm looking way fire event when post ajax call completes , perform action on returned data outside script/plugin without modifying post callbacks code too. see pseudo code: $.post(url, {id: 3,...}, function( d ) { ...some js code here }); //looking event : $(document).on('post', '??' ,function() { //i want access 'd' post callback in here, , other post calls return data... } try utilizing .ajaxcomplete() $(document).ajaxcomplete(function(event, jqxhr, settings) { // want access 'd' post callback in here, // , other post calls return data... // stuff when `$.post()` completes console.log(jqxhr.responsetext); // `d` }); $.post(url, {id: 3,...}, function( d ) { // stuff // ...some js code here });

php - Pulling in data around/after midnight -

ok.. i've created myself messy problem. so have jquery slider shows 5 slides of content 1) -2 hours ago 2) -1 hour ago 3) (0) present 4) +1 hours 5) +2 hours the content each slide decided time of day is. when comes trying go back/forwards 1 2 hours during run midnight , after midnight whole script breaks, , kills site. <?php $h = date('g', strtotime ("-2 hour")); //set variable $h hour of day. $m = date('i', strtotime ("-2 hour")); //set variable $m min of hour. $d = date('w', strtotime ("-2 hour")); //set variable $d day of week. // saturday schedule if ($d == 6 && $h >= 0 && $h < 07) $file ='earlyhours.php'; else if ($d == 6 && $h >= 07 && $h < 09) $file ='breakfast.php'; else if ($d == 6 && $h >= 09 && $h < 12) $file ='throughthemorning.php'; else if ($d == 6 && $h >= 12 && $h < 13) $file

directx - How to apply shader to an Bitmap offline with SharpDX -

i want apply shader bitmap (offline processing) sharpdx. found sample on sharpdx homepage apply effect image offline processing. want apply shader.fx don't know how it. can me out? here code snipset: // effect 1 : bitmapsource - take decoded image data , bitmapsource var bitmapsourceeffect = new d2.effects.bitmapsource(d2dcontext); bitmapsourceeffect.wicbitmapsource = formatconverter; // effect 2 : gaussianblur - give bitmapsource gaussian blurred effect var gaussianblureffect = new d2.effects.gaussianblur(d2dcontext); gaussianblureffect.setinput(0, bitmapsourceeffect.output, true); gaussianblureffect.standarddeviation = 5f; d2dcontext.begindraw(); d2dcontext.drawimage(gaussianblureffect); d2dcontext.enddraw(); here shader.fx vec2 warp(vec2 tex) { vec2 newpos = tex; float c = -81.0/20.0; float u = tex.x * 2.0 - 1.0; float v = tex.y * 2.0 - 1.0; newpos.x = c*u/((v*v) + c); newpos.y = c*v/((u*u) + c); newpos.x = (newpos.x + 1.0)*0.5;

python - How to pass a list as an environment variable? -

i use list part of python program, , wanted convert environment variable. so, it's this: list1 = ['a.1','b.2','c.3'] items in list1: alpha,number = items.split('.') print(alpha,number) which gives me, expected: a 1 b 2 c 3 but when try set environment variable, as: export list_items = 'a.1', 'b.2', 'c.3' and do: list1 = [os.environ.get("list_items")] items in list1: alpha,number = items.split('.') print(alpha,number) i error: valueerror: many values unpack how modify way pass list, or have same output without using env variables? i'm not sure why you'd through environment variables, can this: export list_items ="a.1 b.2 c.3" and in python: list1 = [i.split(".") in os.environ.get("list_items").split(" ")] k, v in list1: print(k, v)

javascript - How to make "this" keyword refer to current instance, if used from a nested object's method? -

in javascript, if attach function object's prototype, within function, this refers current instance of object. example: function ragefest(inquiry) { this.inquiry = inquiry; } ragefest.prototype.myfunction0 = function () { console.log(this.inquiry); }; new ragefest("you mad, bro?").myfunction0(); // prints "you mad, bro?" running in node prints you mad, bro? terminal, expected. now, here's run trouble: suppose want introduce second level of organization (maybe because ragefest has lots of methods attached it, , want organize them). ragefest.prototype.myobject = { myfunction1: function () { console.log(this.inquiry); }, myfunction2: function () { console.log(this.inquiry); }.bind(this), myfunction3: function () { console.log(this.inquiry); }.bind(ragefest) }; var ragefest = new ragefest("you mad, bro?"); ragefest.myobject.myfunction1(); // undefined ragefest.myobject.myfunction2(); // undefined ragefest.myobjec

javascript - ReactJS passing object instead of function inside onClick -

i brand new react , related it. still learning mvc pattern. taking examples on react homepage , trying extend them, i'm running error when try add "onclick" span tag i'm including every todo. here i'm doing: https://jsfiddle.net/69z2wepo/11884/ and here offending code block: var todolist = react.createclass({ markcomplete: function(event){ alert("geelo"); }, render: function(){ var createitem = function(itemtext, index){ return ( <li key={index + itemtext}> {itemtext}<span id="markcomplete" onclick={this.markcomplete}>x</span> </li> ); }; return <ul id="list-container">{this.props.items.map(createitem)}</ul> } }); specifically i'm trying markcomplete fire following onclick={this.markcomplete} if click on "markcomplete" span following error: er

One line if statement in bash -

i've never programed in bash... yet i'm trying solve problem anchievement in game (codingame.com) i have following code: for (( i=0; i<n-1; i++ )); tmp=$(( sorted_array[i+1] - sorted_array[i] )); if [ $tmp < $result ]; result=$tmp fi done and error: /tmp/answer.sh: line 42: syntax error near unexpected token `done'at answer.sh. on line 42 /tmp/answer.sh: line 42: `done' @ answer.sh. on line 42 i want compare adjacent values of array , store minimun diference between them... cant figure how if statement in bash each command must terminated, either newline or semi-colon. in case, need separate assignment of result keyword fi . try adding semi-colon; for (( i=0; i<n-1; i++ )); tmp=$(( sorted_array[i+1] - sorted_array[i] )) if [ $tmp -lt $result ]; result=$tmp; fi done also, need use lt rather < , since < redirection operator. (unless intend run command named $tmp input file named variable $result )

Android Studio:Need help in IntentFilter -

i'm doing small program in android studio , need in code: intent myintent = new intent(this , notifyservice.class); pendingintent pendingintent = pendingintent.getservice(this, 0, myintent, 0); alarmmanager alarmmanager = (alarmmanager)getsystemservice(alarm_service); calendar calendar = calendar.getinstance(); alarmmanager.setinexactrepeating(alarmmanager.elapsed_realtime_wakeup, systemclock.elapsedrealtime() + alarmmanager.interval_fifteen_minutes, alarmmanager.interval_day, pendingintent); broadreceiver receiver = new broadreceiver(); intentfilter filter = new intentfilter("i need here!"); registerreceiver(receiver, filter); return super.onstartcommand(intent, flags, startid); so, in line i need here , when wrote intent.action_airplane_mode_changed runs should be, need code above function of action_airplane_mode_changed . basically, every fifteen minutes background program (this code there) should open notification. if nee

ggplot2 - Getting Error while plotting contour map as (Error in if (any(h <= 0)) stop("bandwidths must be strictly positive") : in R -

for below data > head(df) date longitude latitude elevation max.temperature min.temperature precipitation wind relative.humidity solar ro 1 2014-07-01 77.1875 7.96184 -9999 27.725 26.673 16.115560560 8.395378 0.8132272 23.08192 yes 2 2014-07-02 77.1875 7.96184 -9999 27.931 26.897 0.700378560 8.062267 0.8074675 21.48473 yes 3 2014-07-03 77.1875 7.96184 -9999 28.179 26.686 0.000000000 9.465022 0.8107901 24.14900 no 4 2014-07-04 77.1875 7.96184 -9999 27.657 26.545 0.003433226 9.397203 0.8195020 23.42036 yes 5 2014-07-05 77.1875 7.96184 -9999 27.157 26.490 1.541518560 8.903047 0.8385059 23.90545 yes 6 2014-07-06 77.1875 7.96184 -9999 27.308 26.481 0.000000000 8.617348 0.8205267 23.96318 no i have created map using ggmap

jsf - f:ajax render does not update components anymore -

i have datatable , load modal edit data. when edit , render datatable nothing changed. i mean have datatable , actions delete , edit. when press on edit open modal edit data on modal press edit. see make render datatable can't see changes in datatable <h:form id="branchesform"> <h:panelgroup layout="block" class="box-header"> <h3 class="box-title">branches</h3> &nbsp;&nbsp; <h:commandbutton value="add new branch" id="createbranchbtn" pt:data-loading-text="loading..." pt:autocomplete="off" class="btn btn-primary sye-action-btn-loading"> <f:param name="pagetype" value="create"/> </h:commandbutton> </h:panelgroup> <h:panelgroup

How to close/hide custom keyboard Android -

i've try close custom keyboard after click item in gridview.i'm trying in baseadapter class. context come inputmethodservice. so far i've tried below: framelayout scroll = (framelayout)inflater.inflate(r.layout.keyboard, null); inputmethodmanager imm = (inputmethodmanager)context.getsystemservice(context.input_method_service); imm.hidesoftinputfromwindow(scroll.getwindowtoken(), 0); -- imm.togglesoftinput(0,inputmethodmanager.hide_implicit_only); -- scroll.setvisibility(view.invisible); thanks i'm copying , pasting app here, works fine us: public static void hidekeyboard(view v) { try { v.clearfocus(); inputmethodmanager imm = (inputmethodmanager) v.getcontext().getsystemservice(context.input_method_service); imm.hidesoftinputfromwindow(v.getwindowtoken(), 0); } catch (exception e) { // saw shit happening on code before } }

c - DTD validation error with libxml2 -

i try validate xml data dtd. have use libxml2. produced xml data looks this: <?xml version="1.0"?> <root> <vent id="1"> <usb_device_id>1</usb_device_id> <usb_device_channel>2</usb_device_channel> <vent_box_id>3</vent_box_id> <vent_box_channel>4</vent_box_channel> </vent> </root> my dtd looks this: <!element root (vent) > <!element vent (usb_device_id, usb_channel, vent_box_id, vent_box_channel) > <!attlist vent id (id) #required > <!element usb_device_id (cdata) > <!element usb_channel (cdata) > <!element vent_box_id (cdata) > i use http://xmlsoft.org/html/libxml-valid.html#xmlvalidatedtd on parsed tree. setup error message: element vent: validity error : value "1" attribute id of vent not among enu

javascript - Multiple Submit Buttons Security Risk -

for reasons, need create form 2 submit buttons going call different actions after submission. i found following example in https://struts.apache.org/docs/multiple-submit-buttons.html <s:form method="post" action="mysubmitaction"> <s:submit value="submit"/> <s:submit value="clear" action="myclearaction"/> </form> as project using struts 2.3.16.3, struts.mapper.action.prefix.enabled = true needed. however, there risk enable in struts 2.3.16.3? share same security problem in 2.3.15.2? if yes, mind providing alternatives make multiple submit buttons work on single form? if-else solution not preferred. the vulnerabilities discovered in versions struts 2.0.0 - struts 2.3.15.2 related ognl injection attack. in fact action: prefix opens door kind of attacks. previously it's discovered in s2-016 , fixed version 2.3.15.1 . lately s2-018 introduced , disabled action: prefix. recomm

Accessing javascript array values using PHP -

i have created array named "arraymodel" in javascript , trying access values in php. store values php variables. var arraymodel = new array(5); arraymodel[0] = "one"; arraymodel[1] = "two"; arraymodel[2] = "three"; arraymodel[3] = "four"; arraymodel[4] = "five"; any idea how can access values of array in php? thanks in advance. php server language , javascript browser language. means not working together. whatever write in javascript in browser, when send server example ajax php can it.

javascript - How to place notes from different source sheet in Google Spreadsheets -

i've been struggling trying find method place information cell (a range of cells) comments in different cell (range of cell) in different sheet. something this, if have apple in cell a1 in sheet1 want apple inserted comment in cell f1 in sheet 2. i tried coming this. //i'm still working on have not been able make work// //ideally put phone numbers comment's in needed cases// var ss = spreadsheetapp.getactivespreadsheet(); var targetsheet = ss.getsheetbyname("report"); var sourcesheet = ss.getsheetbyname("sheet1"); var nrange = sourcesheet.getrange(2, 3, sourcesheet.getlastrow(), 1) var sourcenotes = [nrange.getvalue()] var notes = targetsheet.getrange(2, 6, sourcesheet.getlastrow(),1) notes.setnotes(sourcenotes); as can read not working i've tried different methods none working come guys help. the function "setnotes" takes 2 dimension array, value should setnotes([sourcenotes]). check documentation . also if go

pagedown - Weird timing issue with Mathjax -

i'm using mathjax pagedown in pretty straight forward way. initmathjax(converter); var html = converter.makehtml(text); var $pagetext = ...; $pagetext.html(html); this works of time when run site locally, , never works when run in production. result can vary between each reload, think there kind of race condition based on how long takes various scripts load , run. i've tried doing mathjax.hub.reprocess() , such, don't seem help. doing mathjax.hub.queue(["typeset", mathjax.hub, $pagetext.get(0)]); 100ms after above code seems have fixed issue. feels patch, , font looks off in production. (looks mathjax generated html ends in <span class="mathjax_preview"> , rather <span class="mathjax"> ). want understand issue can fix it. thanks!

How to list all the rows in a table using SQLite in android studio using cursor -

i using android studio handle database sqlite. need list items in table items in listview..how can it. know how first item using cursor.movetofirst() this public rows getrows(){ string query = "select * "+table_name; sqlitedatabase db = getwritabledatabase(); cursor = db.rawquery(query,null); rows rows; if(cursor.movetofirst()){ rows.setcol1(cursor.getstring(0)); rows.setcol2(cursor.getstring(1)); rows.setcol3(cursor.getstring(2)); cursor.close(); } else{ rows=null; } return rows; } can use cursor.movetonext() if yes please give me code.... use this, public arraylist<rows> getrows(){ string query = "select * "+table_name; sqlitedatabase db = getwritabledatabase(); cursor = db.rawquery(query,null); arraylist<rows> list=new arraylist<rows>(); while(cursor.movetonext()){ rows r

node.js - learnyounode #9 juggling async, can official solution break? -

so learning node.js right , have done multitasking before , concept async , multitasking have many similar isses, brings me question. the official solution problem is: var http = require('http') var bl = require('bl') var results = [] var count = 0 function printresults () { (var = 0; < 3; i++) console.log(results[i]) } function httpget (index) { http.get(process.argv[2 + index], function (response) { response.pipe(bl(function (err, data) { if (err) return console.error(err) results[index] = data.tostring() //area of interest start count++ if (count == 3) printresults() //area of interest end })) }) } (var = 0; < 3; i++) httpget(i) notice part in 'area of interest' comments. not possible race condition occur here causing printresults function called multiple times? for example

regex - rm_between with multiple markers in an observation -

there helpful answers on here using rm_between when each observation has 1 instance of markers. have dataset want extract things in ""'s , of observations have multiple instances of that. example: fresh or chilled atlantic salmon "salmo salar" , danube salmon "hucho hucho" when use code, library(qdapregex) rf <- data.frame(rm_between_multiple(h2$se_desc_en, c("\"", "\""), c("\"", "\""))) it creates data frame , same line earlier "fresh or chilled atlantic salmon , danube salmon" is returned perfect. need missing data. try retain it, change code to: h3 <- rm_between_multiple(h2$se_desc_en, c("\"", "\""), c("\"", "\""), extract=true) to create list data in quotations. same line returned is: c("salmo salar", " , danube salmon ", "hucho hucho", "salmo salar&qu

C# Adding an array of RichTextBoxes to an array of TabPages in a for loop -

Image
and code: using system; using system.collections.generic; using system.componentmodel; using system.data; using system.drawing; using system.linq; using system.text; using system.threading.tasks; using system.windows.forms; namespace inform { public partial class form1 : form { public static tabpage[] tabpages = new tabpage[20]; public static richtextbox[] textboxes = new richtextbox[20]; public form1() { initializecomponent(); tabcontrol.tabpages.clear(); (int x = 0; x < 19; x++) { tabpages[x].controls.add(textboxes[x]); //error here //object reference not set instance of object. tabcontrol.tabpages.add(tabpages[x]); } } private void form1_load(object sender, eventargs e) { } } } i trying make basic typing program uses tabco

php - PHPExcel loop through rows and columns -

need identifying weird problem i'm facing. did tried searching in stack overflow didn't find possible answer. here sample program works displaying rows , columns on ui <?php date_default_timezone_set('america/los_angeles'); require_once 'phpexcel-1.8/classes/phpexcel.php'; include 'phpexcel-1.8/classes/phpexcel/iofactory.php'; $path = 'demo.xlsx'; $sheet = $objphpexcel->getsheet(0); $highestrow = $sheet->gethighestrow(); $highestcolumn = $sheet->gethighestcolumn(); $highestcolumnindex = phpexcel_cell::columnindexfromstring($highestcolumn); ($row = 2; $row <= $highestrow; ++ $row) { $val=array(); ($col = 0; $col < $highestcolumnindex; ++ $col) { $cell = $worksheet->getcellbycolumnandrow($col, $row); $val[] = $cell->getvalue(); //end of loop } $col1 = $val[0] ; $col2 = $val[1] ; $col3 = $val[2]; echo $col1; echo $col2; echo $col3; echo "<br>"; //end of loop } ?> this program

java - Hibernate connect to a MySQL Cluster -

i trying connect mysql cluster using hibernate tomcat/spring application. database connection string is: jdbc:mysql:loadbalance://host-1,host-2/database?loadbalanceblacklisttimeout=5000 , host-1 like 10.xx.xx.xxx:3306 . the schema created on host-2 innodb storage engine, instead of ndbcluster . i using hibernate 4.3.7. mysql jdbc driver of 5.1.34 version. the mysql cluster active-active type.

asp.net mvc 4 - how get json result in view without using Ajax -

i want jsonresult of action in view without using ajax action is public jsonresult courcedetails() { var result= ("_c"); return json(result, jsonrequestbehavior.allowget); } view is @{ viewbag.title = "courcedetails"; } <h2>courcedetails</h2> <div> </div>

Android - Google Fit - Get user's speed -

i'm building app needs user's current speed using google fit's android api. api finds datatype.type_speed without problem, using finddatasources method, speed value never gets returned. code follows: private void buildfitnessclient() { mclient = new googleapiclient.builder(this) .addapi(fitness.sensors_api) .addscope(new scope(scopes.fitness_location_read)) .addconnectioncallbacks(new googleapiclient.connectioncallbacks() { @override public void onconnected(bundle bundle) { showtoast("connected"); //calls fitness api fitness.sensorsapi.finddatasources(mclient, new datasourcesrequest.builder() // @ least 1 datatype must specified. .setdatatypes(datatype.type_speed) .build()) .setresultcallback(new resultcallback<da

Wordpress-Loop: PHP-code is not working -

i'm struggling making wordpress-loop working properly. guess error in if-request. please debug , optimize these few lines of php? i'm interested in learning proper coding don't hesitate give me further advices! ;-) amazing! best, enjoy weekend!!! <?php ?> <?php get_header(); ?> <!-- start body --> <body <?php body_class(); ?>> <!-- hier geht der wrapper auf--> <div class="wrapper"> <!-- logo --> <?php get_template_part( 'logo' ); ?> <div class="clear"></div> <!-- wordpress verbieten, <p>-tags zu setzen --> <?php remove_filter ('the_content', 'wpautop'); ?> <!-- t h e l o o p --> <?php if ( have_posts() ): ?> <?php while ( have_posts() ) : the_post(); ?> <div class="article-content" id="post-<?php the_id(); ?>

AWS Elastic Beanstalk - How To Upgrade Existing Environment from Ruby 2.1 to Ruby 2.2 -

aws elastic beanstalk - cannot clone latest platform or eb upgrade ruby 2.1 ruby 2.2 i've been smashing head on one. in may, aws announced ruby elastic environments offer ruby-2.2 (e.g. ruby-2.2-(passenger-standalone) or ruby-2.2-(puma) ). can't upgrade existing ruby-2.1 environments ruby-2.2. appears have recreate them completely...that seems silly? else out there experiencing this? missing simple? extra information i've been gleefully using ruby-2.1-(passenger-standalone) several months in staging , production environments. i'd upgrade them latest ruby-2.2 platform. aws documentation says pretty trivial, in fact of documentation appear state can use eb clone <env-name> --update . flag doesn't exist in eb cli 3.4.5 i'm using :( additionally, web console has clone latest platform option menu item, yet disabled. it appears can latest ruby-2.2 instances create brand new environment scratch. that's tremendously annoying. s

razor - asp.net mvc 5 html.DisplayFor DisplayFormat Display(Name) not working -

html.displayfor stopped displaying display name , formatted string... code bellow ... ideas? have searched around couldn't find anything. thanks [displayformat(dataformatstring = "{0:mm/dd/yyyy}")] [display(name = "date")] public datetime eventdatetimeday { get; set; } [display(name = "seconds")] [displayformat(dataformatstring = "{0:0.00} s")] public double duration { get; set; } razor .cshtml: @model ienumerable<ourclass> ... <th> @html.displaynamefor(model => model.eventdatetimeday) </th> ... @foreach (var item in model) { ... <td> @html.displayfor(modelitem => item.eventdatetimeday) </td> you should try using displayname attribute [displayname("seconds")] public double duration { get; set; }

java - Delay in Browser Passing on Request to Server -

my application makes lots of http requests server. max number of connections opened client 2. more requests queued on client side until 1 of them responded. problem: 99 % of requests go fine. in exceptional cases, of requests spend time in being delivered browser. hence not received server in same order sent client. these requests, checked developer tools , found high waiting time(ttfb)(460ms in case while other have 30-40 ms). not sure if helps server java http server. issue prominent in ie 9/10/11. lesser in chrome out of experience. finally figured out issue. might helpful else too. in headers had set connection- keep-alive responses timeout 5 seconds. resulted in connections opened browser closed. increased value larger value (30 secs) since application uses long polling of timeout of 20 seconds. hence same connection being reused now. dont see issue more.

javascript - File reader consuming lots of memory when reading images -

i working on application need show bulk of images locally (before upload). firefox using approx 2 gb memory reading 10 images (which 5mb size each). due huge consumption of memory, firefox hanging, generating crashes or restart issues. please suggest how might release memory after each file read. reader.onloadend = function (e) { binary = atob(reader.result.split(',')[1]); exif = exif.readfrombinaryfile(new binaryfile(binary)); binary = null; console.info("exif data",exif.orientation); tempimg = new image(); tempimg.src = reader.result; tempimg.onload = function (){ var tempw = tempimg.width; var temph = tempimg.height; console.log(1,tempw,temph); // initialize canvas var canvas = document.createelement('canvas'); var ctx = canvas.getcontext("2d"); // check if image orientation changed switch(exif.orientation){ case 6:

Python List Loop Error: TypeError: list indices must be integers, not str -

what trying check if values in 'dragonloot' exists in dictionairy 'inv' keys. if want add 1 value, if not want create new key value , add 1. i think have gotten if, else part correct how struggeling loop , reciving typeerror: list indices must integers, not str error. here code: #inventory , loot value inv = {'gold coin': 42, 'rope': 1} dragonloot = ['gold coin', 'dagger', 'gold coin', 'gold coin', 'ruby'] #function loop through items in list def displayinventory(inventory): print('inventory:') item_total = 0 j, k in inventory.items(): print(str(k) + ' ' + j) item_total += k print('total number of items: %s' % str(item_total)) #where problem occur def addtoinventory(inventory, addeditems): in addeditems: if addeditems[i] in inventory.keys(): #edit: see error here now, fix after loop working inventory[addeditems[i]

access vba - Copy Record From One Form to Another -

i have form list of records location information. each record starts checkbox. user able select multiple records interested in clicking checkboxes , click submit button on bottom pass selections through , copy them new records form. how in vba? first, data main form fed in through table. created new field , assigned boolean data type show checkbox icon next each record in form. checked on default first issue. how records unchecked default? second, assuming figure out checkbox issue, how have access pull desired records new form via coded submit button? if include checkbox boolean table field, can update records , when user clicks command button, either pass sql clause "where fieldy =true" parameter "docmd.openform "secondform", acnormal, , , , , "where fieldy =true". in form open event, use me.openargs clause filter records. or have second form record source include clause "where fieldy =true" opens records.

node.js - Mongoose : Queries through an array, return a promise of an array -

i trying iterate through opts , make same query on each element, want in return promise of array containing results of queries. how can ? i tried moment first item //opts array of objects function getrecapofcampaign (campaignid, opts) { var p_votes = models.bsvote .find({ created: { $gte: opts[0].fromdate, $lt: opts[0].todate } }) .where('campaign').equals(campaignid) .count() .exec(); return p_votes; } there bunch of promise libs out there use or use native js promise implementation on newer releases of node. in particular promise.all method. promise.all([array_or_promises]).then(values => { console.log(values); // [array_of_results_from_promises] }); using promise.all along map should give want: //opts array of objects function getrecapofcampaign(campaignid, opts) { return promise.all(opts.map(function(opt) { return models.bsvote.find({ created: { $gte: opt.fromda

rest - Naming convention for a RESTful resource that returns a list of entities with most properties hidden? -

we have endpoint, let's call /items which returns list of items. endpoint returns properties on items, , ends returning lot of data, since each item pretty heavy json object. at moment, i'm looking @ creating lightweight varsion of endpoint can used reduce bandwidth, , returns limited number of properties (e.g. item.name , item.year). is there naming convention such endpoint? i thinking along lines of /lightweight-items or similar. is there naming convention such endpoint? not i've heard of. /lightweight-items implies there resources called 'lightweight-item', not true. i suggest add query option specify data need, like /items?properties=name,year where name,year ones want have retrieved

spring - While form submitting using ajax..getting Post not supported error ...don't know what is the error? -

i using form submission using ajax in spring mvc , thymeleaf. when try submit it shows post method not supported i can't figure out mistake in code: <form class="form-horizontal" action="#" th:action="@{/teacher/teacherprofileupdation}" th:object="${teacherprofiledetailslist}" id="saveteacherform" method="post" > <br /> <div class="row"> <div class="col-lg-14 col-md-12"> <br /> <h5 style="margin-left: 15%;">personal details</h5> <hr /> <div class="form-group"> <label class="col-sm-3 control-label">name</label> <div class="col-md-3 col-sm-4 col-xs-4"> <input placeholder="teacher first name" id="txtteacherfname" th:field="*{firstname}" type="te

Is there a way to prevent gnuplot from using solid points? -

Image
i automatically generating .plt files unknown number of input files per graph. problem when gnuplot chooses solid shapes points (filled in square), solid points overwhelm other types of points. in image of gnuplot point types there way me not use 5,7,11,13,etc? or perhaps inverse of (use 1,2,3,4,6,8,etc...)? you can use set linetype select point types used: set linetype 1 pt 1 set linetype 2 pt 2 set linetype 3 pt 3 set linetype 4 pt 4 set linetype 5 pt 6 set linetype 6 pt 8 set linetype 7 pt 10 set linetype 8 pt 12 set samples 11 plot [i=1:8] i*x points notitle

HTML nested tables and list resulted unexpected output -

i'm having incredible trouble using nested tables , lists in html. swear constructing html code correctly, using sublime me make sure tags , end tags line each other , proper indentation keep track of everything. however, output far expect. suspect there may issues when try nest tables within each other, when try have table contains unordered list of tables. here main issues: -having normal bullets unordered lists makes bullets appear in random areas, makes no sense. however, after adding style="list-style-type:none" ul tags don't have worry seeing bullets, still see bullets each list item after first 1 in list. issue both outer unordered list , inner one. -the second set of "href" , "hosts" see @ bottom should inside "items" table because both tables within in same . why outside of everything, including being outside "items" table? is there tag missing?! here's html code, , can run on here see output looks

C# HTML scraping between tags -

okay i'm trying skype tool have "dictionary" command retrieve meaning of word urban dictionary @ moment i'm able load whole html document in string this: private void urbandictionary(string term) { httpwebrequest request = (httpwebrequest)webrequest.create("http://www.urbandictionary.com/define.php?term=" + term); httpwebresponse response = (httpwebresponse)request.getresponse(); streamreader stream = new streamreader(response.getresponsestream()); string final_response = stream.readtoend(); messagebox.show(final_response); } the problem want meaning <div class='meaning'> "meaning" </div> i have tried kinds of stuff cant manage retrieve text between "div" tags. how this? use htmlagilitypack library, need. http://www.codeproject.com/articles/659019/scraping-html-dom-elements-using-htmlagilitypack-h