Posts

Showing posts from March, 2010

c# - An unhandled exception of type 'System.InvalidOperationException' occurred in System.dll -

i executing code below : class program { static void main(string[] args) { performancecounter performancecounter = new performancecounter("network interface", "bytes sent/sec", "intel(r) 82579v gigabit network connection"); console.writeline(performancecounter.nextvalue().tostring()); } } i'm getting exception. an unhandled exception of type 'system.invalidoperationexception' occurred in system.dll additional information: instance 'intel(r) 82579v gigabit network connection' not exist in specified category. i have tested parameters windows perfmon tool , working in code giving exception. can please help.. have checked if name spelled correctly? minor error, won't work. to check names exist in category, try (as suggested here: https://stackoverflow.com/a/29270209/1648463 ) performancecountercategory category = new performancecountercategory("network interface"); string[...

AngularJS ng-checked isn't updating checkbox when model changed in javascript -

i have filtered list of objects being repeated ng-repeat input checkbox beside each item. when list isn't filtered (as when page loaded) don't want checkboxes checked. if list filtered want checkboxes checked (the checkboxes form treeview via css). the checkbox has ng-checked="{{site.ischecked}}". when list filtered updating ischecked variable on objects within filter javascript code, isn't updating checkbox value. if item filtered out it's removed screen , filtered in again updated ischecked value come through screen. the html follows: <ul> <li ng-repeat="site in sites | filtersites:searchbuildings"> <input type="checkbox" ng-checked="{{site.ischecked}}" id="item-f{{site.id}}" /><label for="item-f{{site.id}}">{{site.site}}</label> <ul> <li ng-repeat="building in site.filteredbuildings"> <a href=...

javascript - Adding numbers together -

i want loop on array whilst addding numbers together. whilst looping on array, add current number next. my array looks [0,1,0,4,1] i following; [0,1,0,4,1] - 0+1= 1, 1+0= 1, 0+4=4, 4+1=5 which give me [1,1,4,5] following; 1+1 = 2, 1+4=5, 4+5=9 and on until 85. could advise on best way go this transform follows specified method of summation, end result of 21, please specify how 85. var ary = [0,1,0,4,1], transform = function (ary) { var length = ary.length; return ary.reduce(function (acc, val, index, ary) { if (index + 1 !== length) acc.push(ary[index] + ary[index + 1]); return acc; }, []); }; while (ary.length !== 1) ary = transform(ary);

mvvm - MvvmCross binding property of custom type to custom view -

i tried bind property of custom type in view model custom view, in binder method "setvalue(object value)" value null. why happens? impossible bind property of custom type custom view in mvvmcross? my viewmodel: public class recipesfiltersvm : mvxviewmodel { public searchfield dishfield { get; private set; } public searchfield cuisinefield { get; private set; } public searchfield ingredientfield { get; private set; } private readonly ifiltersservice _filtersservice; public recipesfiltersvm(ifiltersservice filtersservice) { _filtersservice = filtersservice; updatesearchfields (); } private async void updatesearchfields () { var allfilters = await _filtersservice.loadallfilters (); dishfield = new searchfield ( allfilters .where(f => f.type == filtertype.dish) .tolist() ); cuisinefield = new searchfield ( allfilters .wher...

pointers - Can you explain why I get 2 different results passing the same structure in Objective-C? -

have been struggling hope people can me. suppose have defined following structure struct _sparticleeffect { enumparticletypes type; int count; glkvector3 initialpos; glkvector3 direction; float triggerradius; cgsize prtsize; float prtclspeedmax; float prtclspeedinitial; float prtcllifemax; glkvector4 color; }; typedef struct _sparticleeffect sparticleeffect; then make instance of structure , pass single function in 2 ways - pointer , value: - (void) initgeometry { sparticleeffect splasheffect; splasheffect.count = 15; [splashprt testfunc: &splasheffect : splasheffect]; } //test function 2 parameters - pointer , value //method of splashprt - (void) testfunc: (sparticleeffect*) attrpointer: (sparticleeffect) attr { nslog(@"1: %d", attrpointer->count); nslog(@"2: %d", attr.count); } and result get 2015-07-01 16:58:28.766 [1738:707] 1: 15 2015-07-01 16:58:28.770 [1738:707]...

Generating a PDF with Prawn and Ruby On Rails -

i've been following ryan bate's railscast tutorial (excellent always) have run issue cannot seem resolve. i have prawn::document rendering using static content fine, ie with class printpdf < prawn::document def initialize super text "text" end end and in controller def print @vegetaux = vegetable.all respond_to |format| format.html format.pdf pdf = printpdf.new send_data pdf.render, filename: "vegetaux.pdf", type: "application/pdf", disposition: "inline" end end end but when try pass in rails model adding this pdf = printpdf.new(@vegetaux) & in pdf object class printpdf < prawn::document def initialize(vegetaux) super @vegetaux = vegetaux text "text" end end i error message no implicit conversion of symbol integer relating line... pdf = printpdf.new(@vegetaux) the object @vegetaux seems ok though, because in html reponse can loop t...

Trouble using Functions for Hangman game in C -

i trying make hangman gave using c functions. able make game without using functions when try use functions running few problems. the main problem having in displayword() function. need function print out word screen letters have not been correctly guessed blanked out underscore. ~header fiiles #include <stdio.h> #include <stdlib.h> #include <string.h> /* constants. */ #define num_words 50 #define alphabet_size 26 #define good_guess 0 #define bad_guess 1 #define game_over 1 #define game_continue 0 #define max_guess 10 #define max_word_len 10 /* function prototypes. */ int init(char* word); void displayword(char* word, int* guessedletters, int* length); int guessletter(char* word, int* guessedletters); void displayhangman(unsigned wrongguesses); int isgameover(char* word, int* guessedletters, unsigned wrongguesses); void readrestofline(); ~main code #include "hangman.h" /************************************************************************...

php - failed to import the csv file to mysql -

plzz me fix errors in following code.. couldn't read php code. how can make it? want show status of connection when closes. <table width="600" style="margin:115px auto; background:#f8f8f8; border:1px solid #eee; padding:20px 0 25px 0;"> <form action="<?php echo $_server["php_self"]; ?>" method="post" enctype="multipart/form-data"> <tr><td colspan="2" style="font:bold 15px arial; text-align:center; padding:0 0 5px 0;">browse , import excel file </td></tr> <tr> <td width="50%" style="font:bold 12px tahoma, arial, sans-serif; text-align:right; border-bottom:1px solid #eee; padding:5px 10px 5px 0px; border-right:1px solid #eee;">select file</td> <td width="50%" style="border-bottom:1px solid #eee; padding:5px;"><input type="file" name="file" id="file" /></td...

ember.js - In Ember Data how do I set a relationship field by id without it sending null to the server? -

i have order model export default ds.model.extend({ account: ds.belongsto('account', {async: true}), address: ds.belongsto('address', {async: true}), orderitems: ds.hasmany('orderitem', {async: true}), orderstatus: ds.belongsto('orderstatus', {async: true}), specialinstructions: ds.attr('string'), creationdate: ds.attr('date') }); this has order status, has model: export default ds.model.extend({ value: ds.attr('string'), orders: ds.hasmany('order', {async: true}) }); in order/create route use model account , aftermodel create new order in db straight away. want create in aftermodel this: var order = this.store.createrecord('order', { account: model, orderstatus: 1 }); return ember.rsvp.hash({ order: order.save().then(function() { self.set('order', order); }), products: this.store.findall('product').then(function(result) { self.set('products...

android - Custom Adapter:Row Inflated:findViewById returning null -

i making simple app reads json data , displays in listview. i've created custom adapter class named myadapter.java. inflate row findviewbyid returning null (pointed out in comment).i plan add more wigets row.xml testing have added textview. help? row.xml <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" android:padding="6dp"> <textview android:id="@+id/tvnew_title" android:layout_width="fill_parent" android:layout_height="wrap_content" android:textstyle="italic"/> </linearlayout> myadapter.java package com.test.rajat.contacts; import android.content.context; import android.util.log; import android.view.layoutinflater; import android.view....

jquery - How to make real time count up with Javascript? -

<!doctype html> <html> <head lang="en"> <meta charset="utf-8"> <title>count up</title> </head> <body> <h1>number 1</h1> <div id="counter"></div> <br> <h1>number 2</h1> <div id="counter_2"></div> <script> var start_date = new date("july 2, 2015 11:00:00"); // put in starting date here var interval = 0.366; // in seconds var increment = 1; // increase per tick var start_value = 7325698160; // initial value when it's start date var count = 0; window.onload = function () { var msinterval = interval * 1000; var = new date(); count = parseint((now - start_date)/msinterval) * increment + start_value; document.getelementbyid('counter').innerhtml = count; setinterval("count += increment; documen...

javascript - node js :-null value error in for loop -

Image
hi newbie on nodejs trying implement project in have event management site..where adding event page specific user. now problem getting stuck @ point:- exports.getdashboard=function(req,res){ var eventlist=[]; for(var i=0;i<req.user.invites.length;i++) { event.find({_id:req.user.invites[i]},function(err,events){ if(err) { console.log(err); } else { eventlist.push(events[0]); console.log(eventlist); // shows value inside array wanted } }); } console.log(eventlist); // shows null value why? variable in scope declaration res.render('dashboard'); }; explanation: created function in have variable eventlist declared , initialized every time function gets called. used variable eventlist insi...

c# - How to Debug a Post to an OWIN Service? -

Image
i have owin self host service. another service (which dont have access to) posting data on local network ip address (though computer name gives same results). the problem have value 'null' in controller. i've tried fiddler, cannot see traffic. know sending correct data, service (which cannot see) getting something. from appbuilder.use() statement, know service being hit , navigate controller. how can find out what's wrong or know going wrong please? setup public void owinwebserverconfiguration(iappbuilder appbuilder) { appbuilder.use(async (environment, next) => { //note: post hit can't find content of message debug.writeline(environment.request.uri); await next(); debug.writeline(environment.response.statuscode); }); // configure web api self-host. httpconfiguration config = new httpconfiguration(); ...

html - asp.net apply same style to textboxes within div -

i have 3 div's on 20 textboxes in each div. based on rules, each div enabled or disabled. i use following code via vb disable or enable of fields in each div, , works great: div_full1_details.attributes.add("disabled", "") div_full1_details.attributes.remove("disabled") now when enable div, apply style each box within div, , 1 hit, code above. so apply this: div_full1_details.attributes.remove("disabled")` div_full1_details.style.add("border-bottom", "thin dotted #ad9f9f") so last line of code apply style textboxes within div div_full1_details can done ? update: following comments below , search on web regarding child style, etc, have done follows, wrong: css .div_details_dotted * {border-bottom: thin dotted #ad9f9f} .div_details_dotted_white * {border-bottom: thin dotted white} vb page ' set 3 divs white dotted border-bottom div_1_details.attributes.add("class", "div_d...

Google Sheets On Form Submit Event - Complete Code Before Next Submission -

i using on form submission trigger in google sheet created. problem having there chance form submitted quicker takes execute code, first submission interrupted. ideally, complete execution first submission, , completes, begin on second submission. possible? two options. lockservice or deal concurrency. others have begun investigating using firebase alternative in-built lockservice due recent reliability issues. personally latter option recommendation. i.e. have project cope multiple entry points @ uncontrollable times.

sql - how to find out days from another table -

declare @daystaken table( application varchar(20), statusid varchar(2), flag int, createddate datetime) insert @daystaken (createddate)values ('2015-03-06 17:59:59.410'), ('2015-03-02 17:59:59.410') select datediff(dd,min(createddate),getdate())d @daystaken declare @holiday table(holiday datetime) insert @holiday ( holiday )values ( '2014-04-06 17:59:59.410'), ( '2014-06-06 17:59:59.410'), ( '2015-05-05 17:59:59.410'), ( '2015-05-01 17:59:59.410'), ( '2013-01-06 17:59:59.410'), ( '2015-02-03 17:59:59.410'), ( '2011-02-01 17:59:59.410') i have got days count daystaken table need substract days holidays table.for example daystaken table have 122 days in days 3 days holidays till present date came holidays table.so need minus result , show 119 days will do: declare @mindate date select @mindate = min(createddate) @daystaken; select datediff(day, @mindate, getdate()) - count(*) ...

javascript - Set inital state of react component with ajax -

i trying enhance projekt few react components. have managed build app , want. now need rid of dummy array contains data , fill real data form database. usually i'd ajax , parse out. i have checked facebook documentation , i've found following code snippet : ... componentdidmount: function() { $.get(this.props.source, function(result) { var lastgist = result[0]; if (this.ismounted()) { this.setstate({ username: lastgist.owner.login, lastgisturl: lastgist.html_url }); } }.bind(this)); }, ... now question is, how , when should function called in react component. or saved name , gets called automatically? thank :) is saved name , gets called automatically? yes. https://facebook.github.io/react/docs/component-specs.html#mounting-componentdidmount

c# 4.0 - How to make a panel blur in Winforms -

this question has answer here: how can set opacity or transparency of panel in winforms? 8 answers i trying fetch features through c# code in winforms inside 1 panel , taking time . want make panel blur , put 1 progress message or image there , disable other controls of form inside panel located,so user can't use other controls while features being fetched , put onto panel.i can't find opacity setting panel. how can implement ? if don't want remove form, move panel somewhere @ negative coordinates, put whatever progress bar want in panel's place , when done, put , remove progress bar control.

javascript - Can I insert 3rd party marketing tags that use document.write() into Google Tag Manager (GTM)? -

i'm installing 3rd party marketing tags gtm (v2) container. tags real nuisance, making heavy use of document.write . though google tag manager claims support document.write , these tags throw javascript errors when fired. here's example of such tag. <script src="http://ib.adnxs.com/seg?add=1958353,6039160&t=1" type="text/javascript"> </script> this script seg?add=1958353,6039160&t=1 goes on call document.write twice: document.write('<scr'+'ipt type="text/javascript" src="https://js.b1js.com/tagcontainer.js?id=110386891486949186&type=1"></scr'+'ipt>'); document.write('<scr' + 'ipt src="http://cdn.adnxs.com/ib/async_usersync.js"></scr'+'ipt>'); if ask gtm support document.write tag, , set tag fire on pages, i'll error on page load: uncaught typeerror: cannot read property 'parentnode' of null uncaught #<o...

unity3d - Can I know in Unity 5 who Instantiated the object? -

is possible information instantiated object 1 instantiated it? for example let's have objecta: instantiate(objectb, gameobject.transform.position, quaternion.identity); is there way in objectb: awake() { var vector = parent.transform.position }; where "parent" initiator. you can following accomplish that: // in objecta class's function gameobject objb = instantiate(objectb, gameobject.transform.position, quaternion.identity); objb.parentpos = transform.position; // , if want know instantiated it, use line: objb.parentgameobj = gameobject; // in objectb class public vector3 parentpos; public gameobject parentgameobj;

php - Set default radio button in Cakephp -

the below code creates radio buttons , html go them, works want set first radio button default selected 1 , im not sure needs added. <?php ($i =0; $i < count($packages); $i++){ echo "<div class='package-outter'>"; echo "name: ".$packages[$i]['package']['name']."<br>"; echo "number of campaigns (per month): ".$packages[$i]['package']['quantity']."<br>"; echo "price: ".$packages[$i]['package']['price']."<br>"; if ($i == 0){ echo $this->form->input('package', array( 'type' => 'radio', 'options' => array($packages[$i]['package']['id'] => $packages[$i]['package']['name'],), 'class' => ...

eclipse - goClipse: internal error executing preparing launch. reason: java.lang.NullPointerException why? -

i'm trying install goclipse on ubuntu 14.04. i've installed java8 repository , downloaded eclipse mars 4.5. i tried example code,in file called hello.go: package main import "fmt" func main() { fmt.printf("hello, world\n") } but work terminal follow commands: go run hello.go thankyou the "main.go" needs inside sub directory inside src folder of project structure. go files directly under src folder ignored. suggest creating "mainprogram" directory under src , running there.

maven - Artifactory: Deploying Snapshots with Ant -

Image
i deploying artifacts ant build artifactory using these targets: <project name="myapp" default="main" basedir="." xmlns:artifact="antlib:org.apache.maven.artifact.ant"> . . . <path id="maven-ant-tasks.classpath"> <fileset refid="maven-ant-tasks.fileset" /> </path> <typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="antlib:org.apache.maven.artifact.ant" classpathref="maven-ant-tasks.classpath" /> <target name="define-artifact-properties"> <property name="artifact.group" value="my.org" /> <property name="artifact.name" value="myapp" /> <property name="artifact.version" value="1.9.0-devel.snapshot" /> <property name="artifact.type" value="jar" /> <property name="artifact.dir" value="${build....

Javascript error - extensions::SafeBuiltins:82 -

Image
uncaught typeerror: illegal invocation everything works noticed there error in console. know this? if have same problem me, try disable extensions. example, when disable "open seo stats", error message disappeared.

javascript - Setting offset of an element with jQuery relative to parent -

i'm trying set offset (top , left) of element relative parent. i have container position relative , element must position display absolute. how can set top , left of absolute element? offset set top , left related document , didn't need it. thanks in advance! edit: code: var styles = { width: 200, height: 200, position: 'absolute', top: 10, left: 20 }; $imgscaledcircle.attr('src', pathimg).css(styles).addclass('active'); it set proprerties expect top , left. didn't understand why. you can use way: $(child).each(function () { $(this).css({ top: $(this).parent().offset().top + 5, left: $(this).parent().offset().left + 5 }); }); here child selector child element. can replace hardcoded 5 whatever position wanna displace.

RDLC table issue -

Image
i using rdlc report, have 2 column , single row in table. both columns inside table header tag.on first page design looks perfect table extends next page first column content shifted left , portion got hide if further extend table next pages whole content shifted left , area looks blank there. refer picture: i unable reson behind plz me.

javascript - JSON.parse from php's json_encode issue -

running issue parsing json recieved php backend. on php have array, send json_encode: $result[] = (object) array('src' => "{$mergedfile}", 'thumb_src' => "{$thumb_file}"); echo json_encode($result); and when trying json.parse recieve error: "uncaught syntaxerror: unexpected token f" the response looks like: [{"src":"upload\/lessons\/963\/video\/176481500-m.webm","thumb_src":"upload\/lessons\/963\/slide\/thumb_0f515a62753626e1aaefdc7968e8103e.jpg"}] very strange thing that, similar code works nearby.. looks fine.. appreciate help, thanks. you cannot json.parse() json, param must string : json.parse('[{"src":"upload\/lessons\/963\/video\/176481500-m.webm","thumb_src":"upload\/lessons\/963\/slide\/thumb_0f515a62753626e1aaefdc7968e8103e.jpg"}]'); the error receive can reproduced : json.parse([{"src":"uploa...

javascript - how to invalidate session on browser close button? -

this question has answer here: how clear httpsession, if user close browser in java 5 answers i using java web application jsp/servlet. if user closes browser without logging out specific page, session not invalidated automatically: login application go specific page , copy page url close browser open again browser , paste url have copied in 2nd step. result: user can access same url expected: user must not access url once browser closed. $(document).ready(function() { $(window).bind("beforeunload", function() { //post server , close sessions }); });

javascript - JQuery Change Property of Data Table -

hi there have data table created in jquery shown.. <html> <head> <link rel="stylesheet" href="ui/jquery-ui.min.css"> <script src="ui/external/jquery/jquery.js"></script> <script src="ui/jquery-ui.min.js"></script> <script src="datatables-1.10.7/media/js/jquery.js"></script> <script src="datatables-1.10.7/media/js/jquery.datatables.js"></script> </head> <body> <script> $(document).ready(function() { var table = $('#example').datatable( { scrolly: 300, paging: false }); var settings = table.fnsettings(); console.log(settings) }); </script> </body> </html> i trying modify property scrolly have different value such 400. after initialisation. however, variable settings apparently null. thanks in advance. the reason being returned null value because jquery datatables can...

Modifying number of arguments for callback functions - javascript -

i know many of used javascript ui widget plugins, etc... offers callback functions. instance have object x , has function, let .dothisafteranevent() . , according official documentation of object x , function accepts single parameter of type function() 1 argument, let _args . to visualize, here example: var handler = function(_args) { // something. } var x = $("#element-to-widget-ify").transform() x.dothisafteranevent(handler) my question is, how can modify method .dothisafteranevent() accept function with 2 or more parameters instead of one? in case, need pass second value handler function. edit: var widgets = { "widget-at-the-nav": $("#nav-widget").transform(), "widget-at-the-footer": $("#nav-footer").transform(), "widget-at-the-search": $("#nav-search").transform(), length: 3 } var handler = function(_args, _option) { console.log("key in: " + _option // ...

ssas - Process Data cube from job on SQL server -

i have sql server agent job on server(x) has step supposed process data cube on remote server(y). whenever run job fails , says server(x) not have permission process cube or not exist. believe have job set correctly how give access on server(y) server(x) process cube?? below script using. "sql server analysis services command" <batch xmlns="http://schemas.microsoft.com/analysisservices/2003/engine"> <process xmlns:xsd="http://www.w3.org/2001/xmlschema" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:ddl2="http://schemas.microsoft.com/analysisservices/2003/engine/2" xmlns:ddl2_2="http://schemas.microsoft.com/analysisservices/2003/engine/2/2" xmlns:ddl100_100="http://schemas.microsoft.com/analysisservices/2008/engine/100/100" xmlns:ddl200="http://schemas.microsoft.com/analysisservices/2010/engine/200" xmlns:ddl200_200="http://schemas.microsoft.com/analysisservices/2010/eng...

r - overlaying 2 plots from different sized dataset with legends using ggplot -

Image
i have 2 datasets, different size. how plot them , have each different color , legend? in case, legend count1, count2, , legend title choose, let's say: mylegend. need change or add following commands? x <- data.frame(q=1:10, count1=21:30) y <- data.frame(q=seq(1,10,0.5), count2=seq(11,20, 0.5)) ggplot() + geom_line(data=x, aes(x=q, y=count1)) + geom_point(data=y, aes(x=q, y=count2)) the easiest solution combine data in same data.frame, set aesthetics ( aes ) in ggplot. here 1 way can combine everything: df <- data.frame(q = c(x$q, y$q), count = c(x$count1, y$count2), type = c(rep("count1", 10), rep("count2", 19)) ) but can use commands rbind() or melt() (from reshape2 library). with data combined 1 data.frame: ggplot(df, aes(x=q, y=count, colour=type)) + geom_point() + geom_line() + scale_colour_discrete(name="mylegend") this basic example, , highly recommend hadley w...

Breeze - not return changes introduced in BeforeSaveEntities to client? -

i struggling find solution conceptual problem re beforesaveentities. in short, want avoid server informing client entity deletions introduce in savemap in beforesaveentities. the longer story follows below :-) data structure: have entity called primarydata, has parallel loosely coupled entities called secondarydata. each primarydata, there exists number of secondarydata's. business logic: whenever user deletes primarydata on client, server should delete related secondarydata. security requirement: client should not informed secondarydata's have been deleted. implementation: have implemented beforesaveentities function, catch deletion of primarydata, , add additional entityinfo's secondarydata's want delete savemap. things work expected. both primarydata , secondarydata's deleted. problem: unfortunately, xhr shows return package client includes secondarydata's have been deleted. violates security requirement above, client should not told ...

algorithm - Knight's Tour on a 5 x 5 Board Start from any Square? -

i'd check logic here... i wrote code solve knight's tour , works 8x8 boards starting knight @ square. but... on 5x5 board show no solution possible when starting @ square (0, 1). what tried 5x5 starting knight @ row 0, col 1: warnsdorff's path added roth (tie breakers based on euclidean distance center). since did not produce solution did code basic recursion backtracking test every possible path -- no solution found when starting 5x5 on 1, 0. i looked everywhere list of exhaustive solutions 5x5 board found none. is there no solution 5x5 when starting @ square 0, 1? thank you! correct, there no solution when start @ of squares adjacent corner square.

excel vba object required error when copying from one workbook to another -

does know why: set wb = workbooks.open(url) worksheets("mf in rates").range("c8:p8").copy destination:=workbooks("dashboard_final.xlsm").worksheets("hist cof").range(cells(current.row, 4), cells(current.row, 17)) would give me object required error? url valid , mf in rates valid sheet in opened spreadsheet. have give more specific filepath dashboard_final.xlsm though macro in work book?? for troubleshooting long references this, break them down individual lines , step through it. if write code this, able determine error is: dim obook workbook dim osheet worksheet dim orange range dim vcell1 variant dim vcell2 variant vcell1 = cells(current.row, 4) vcell2 = cells(current.row, 17) set obook = workbooks(dashboard_final.xlsm) set osheet = obook.worksheets("hist cof") set orange = osheet.range(vcell1, vcell2)

smtp - How to use X-MC-MergeVars for handlebars -

i new mandrill , trying setup mail using handlebars , smtp. template looks - <span> {{username}}, </span> welcome ...... this mailer.js looks (running on node.js) var mailer = require("mailer") , username = "**@***.com" , password = "*********"; mailer.send( {host: "smtp.mandrillapp.com", port: 25, to: "**@gmail.com", from: "**@gmail.com", subject: "mail using mandrill!", authentication: "login", username: "**@**.com", password: "********", headers: { "x-mc-track": "clicks", "x-mc-autotext": true, "x-mc-template": "newsfeed", "x-mc-mergevars": {"username": "pranav"}, "x-mc-mergelanguage": "handlebars" } }, function(err, result){ if(err){...

parallel processing - bash: running script on multiple directories simultaneously -

let's have multiple directories: nmg_1, nmg_2,..., nmg_5 . each of these directories contains 2 subdirectories: fol, unf . in each of subdirectories there text file. so, have script: run.sh , read line of text files in each subdirectory , output file. thus, wondering, there way run script in parallel, is, script run in multiple subdirectories @ once? given run.sh required processing on 1 text file @ time, following command keep 4 parallel bash sessions alive: find -name "*.txt" -print0 | xargs -n 1 -p 4 -0 -i {} bash run.sh {} from man xargs : --max-procs=max-procs, -p max-procs run max-procs processes @ time; default 1. if max-procs 0, xargs run many processes possible @ time. use -n option -p; otherwise chances 1 exec done.

nlp - what is the NLTK equivalent of the UIMA CAS (common annotation structure)? -

in uima, cas (common annotating structure) plays major role in structuring nlp application. allows pass metadata 1 components adds next compoment. example, sentence boundaries sentence tokenizer can added cas , used subsequent word tokenizer. what equivalent data structure in nltk ? in short, there no equivalent concept cas (common analysis system) in nltk. latter uses simpler means of representing texts uima. in nltk, texts lists of words , whereas in uima have complex (and heavy-weight) data structures defined part of cas purpose of describing input data , flow through uima system. that being said, view 2 of them serve quite different purposes anyway. if name java equivalent nltk, choose opennlp toolkit rather uima. former offers number of algorithms nlp based on machine learning (as nltk, among other things), while latter component-based framework not nlp, unstructured data in general. is, defines general model building applications working unstructured data. ...

playframework - Is it good to pass java map to view instead of form? -

what best practices? good? or better pass models view form wrapper? think? this depends on use case have. both passing model instance , model instance wrapped in form have advantages. as kris pointed out, having form gives access validation errors , on. accessing fields directly model of course, on other hand, simpler model instance. please don't pass maps data (something map[string, object] ) - if can work objects, it, that's idea of oo. in summary: if template deals form manipulation (editing, submission, ...) - use model wrapped in form. if want display data or similar - grab model instance , provide view, without additional overhead.

android - Hide Google Voice recognition -

i'm using google voice recognition , hide popup google , mic being shown.. code: intent intent = new intent( recognizerintent.action_recognize_speech); intent.putextra(recognizerintent.extra_language_model, getresources().getstring(r.string.ttslang)); try { startactivityforresult(intent, result_speech); } catch (activitynotfoundexception a) { toast t = toast.maketext(getapplicationcontext(), getresources().getstring(r.string.notts), toast.length_short); t.show(); } as think saw such apps, think possible.. if is, know how? many thanks! for that, need use speechrecognizer . example can found here . it's quite easy implement: speechrecognizer recognizer = speechrecognizer.createspeechrecognizer(this); recognizer.setrecognitionlistener(new recognitionlistener() { ... }); the listener c...

Is using a OneToManyResultSetExtractor/ResultSetExtractor with Spring Batch's JdbcCursorItemReader possible? -

i wondering whether using onetomanyresultsetextractor or resultsetextractor spring batch's jdbccursoritemreader ? the issue have expected rowmapper deals 1 object per row , have join sql query returns many rows per object. out of box, not support use of resultsetextractor . reason wrapping itemreader stateful , needs able keep track of how many rows have been consumed (it wouldn't know otherwise). way type of functionality typically done in spring batch using itemprocessor enrich object. itemreader return 1 (of 1 many) , itemprocessor enrich object many. common pattern in batch processing called driving query pattern. can read more in spring batch documentation here: http://docs.spring.io/spring-batch/trunk/reference/html/patterns.html that being said, wrap jdbccursoritemreader own implementation performs logic of aggregation you.

version control - Merge issues in GIT - File changes which are in a Merge commit vanished from a branch after a commit -

we have branch called branchmaster . used downmerge code same branch called branchdev . recently have done downmerge branchmaster branchdev . in merge commit, has lots of file changes. after which, lots of commit happened in branch branchdev . 1 of commit merge commit commit done else in team. after last merge commit, file changes in first merge commit vanished. not sure why/how. can please help? use git blame --reverse <old_commit>..<new commit> <name of file> in case there files deleted. to find deleted lines, if aware how can use git log -s <deleted string> <filename> using git reflog option in finding deleted commits. code deletion part of new commit not same dropping commit. should check reflog entries have not expired or cleaned.

javascript - KendoGrid paging has "undefined" and "NaN" -

Image
this question has answer here: pager error in kendo grid(nan-nan of 1 items) 5 answers presently attempting add paging kendo grid. here full error message: error in event handler (unknown): typeerror: cannot read property 'url' of null @ object.tinyfilter.start (chrome-extension://nlfgnnlnfbpcammlnibfkplpnbbbdeli/site.js:61:43) @ chrome-extension://nlfgnnlnfbpcammlnibfkplpnbbbdeli/site.js:137:16 here code in controller: public actionresult executerule(string ruleid, string rulesql, list<matchruleparam> parameters = null) { if (request.url != null) { var query = paginationquery.parse(request.querystring); var upperlimit = query.fromupper; var lowerlimit = query.fromlower; var datasource = new matchdatasource(); var results = datasource.executetestrule(rulei...