Posts

eclipse - OleClientSite addKeyListener seems not working in swt in java -

i opening word document in swt in java using oleclientsite . want save document when user press ctrl+s . have added keylistener oleclientsite . code follows : public class swtmenuexample { static oleclientsite clientsite; static oleframe frame; static file file; static shell shell; static keylistener keylistener; public static void main(final string[] args) { final display display = new display(); shell = new shell(display); shell.setsize(800, 600); shell.settext("word example"); shell.setlayout(new filllayout()); try { frame = new oleframe(shell, swt.none); // esto abre un documento existente // clientsite = new oleclientsite(frame, swt.none, new // file("doc1.doc")); // esto abre un documento en blanco // clientsite = new oleclientsite(frame, swt.none, "word.document"); addfilemenu(frame); ...

php - Remove header value from the response -

i have laravel system , storing 1 of response in particular file : $objfile = new filesystem(); $path = "files/filename.php"; $string = $this->getslides(); if ($objfile->exists($path)) { $objfile->put($path,"",$lock = false); $objfile->put($path,$string,$lock = false); $objfile->getrequire($path); } else return getcwd() . "\n"; now contents using following lines: $objfile = new filesystem(); $path = "files/filename.php"; if ($objfile->exists($path)) { return response::json([$objfile->getrequire($path)],200); } else return getcwd() . "\n"; now what's happening when store file on server adds header : http/1.0 200 ok cache-control: no-cache content-type: application/json date: thu, 10 nov 2016 05:38:08 gmt followed stored file , when call f...

command line interface - SOAPUI CLI Testrunner -

i running script through testrunner cli. want result's saved new folder each run instead of overwriting. don't want manually change root folder everytime. how do it? testrunner.bat -r -j -j "-fc:\users\xxxxxx\desktop\reports\xxx\xxx" "-rproject report" "-edefault environment" -i "c:\tcoe\automated_smoke_and_regression_soapui_tests\xxx\xxx_production-soapui-project.xml" right script looks above pasted one. declare root location report explicitly. what do ensure each run saves report in new loc? thanks sandip

Adding an Fragment id to auto-generated fragment from android studio -

i have created auto generated fragment android studio. when tagdatafragment fragment = (tagdatafragment) getsupportfragmentmanager().findfragmentbyid(r.id.tagfragment); fragment.fillvalues(); fragment returns null . have googled , found id not added fragment. how , add fragment id . import android.support.design.widget.tablayout; import android.support.v4.app.fragmenttransaction; import android.support.v7.app.appcompatactivity; import android.support.v7.widget.toolbar; import android.support.v4.app.fragment; import android.support.v4.app.fragmentmanager; import android.support.v4.app.fragmentpageradapter; import android.support.v4.view.viewpager; import android.os.bundle; import android.view.layoutinflater; import android.view.menu; import android.view.menuitem; import android.view.view; import android.view.viewgroup; import android.widget.edittext; import android.widget.textview; public class mainactivity extends appcompatactivity { /** * {@link android.suppo...

asp.net - Entity Framework Core: issue with Contains method -

there simplified model of db: public class chat { public icollection<applicationuser> users {get; set;} //nav property - represents participants of chat } public class applicationuser : identityuser // represents net-identity user; not have references chats {...} so, in controller's class try chats such contain current user participant: var user = getuser(); _context.chats.where(chat => chat.users.contains(user)).tolist(); this code throws exception: you can not use type of expression ...applicationuser parameter's type "microsoft.entityframeworkcore.storage.valuebuffer" of method "boolean contains[valuebuffer](system.collections.generic.ienumerable`1[microsoft.entityframeworkcore.storage.valuebuffer], microsoft.entityframeworkcore.storage.valuebuffer)" what problem here? you need use any(), this var chatslist =_context.chats.where(chat => chat.users.any(u => u.id== user.id)).tolist();

javascript - Polymer - two way binding inside dom-repeat -

is possible acheive of sort. have element my-element.html here trying use template repeate generate paper-buttons feeding object controlbuttons , works in generating buttons name , id . the disabled binding not working , on-click listeners not registered approach. my question is, right way of doing ? or, not possible add such type of bindings in polymer. p.s.- sample example, in app there lot of buttons , elements , hence trying use template repeater purpose. <dom-module id="my-element"> <template> <div id="top_container" class="layout vertical center-justified"> <div id="controls" class="horizontal layout"> <template is="dom-repeat" items="{{controlbuttons}}" as="button"> <paper-button id="{{button.id}}" class="button" on-click={{button.onclickbinding}} disabled$="{{button.disablebinding...

PHP Calendar table -

hi im trying make calendar table displays months in year , days in week. i able make 1 month(nov 2016). want loop through out year , coming years. can me? <?php /* set default timezone */ date_default_timezone_set("asia/hong_kong"); /* set date */ $date = strtotime(date("y-m-d")); $day = date('d', $date); $month = date('m', $date); $year = date('y', $date); // $nextyear = strtotime('+1 month', $date); $firstday = mktime(0,0,0,$month, 1, $year); $title = strftime('%b', $firstday); $dayofweek = date('d', $firstday); $daysinmonth = cal_days_in_month(0, $month, $year); /* name of week days */ $timestamp = strtotime('next sunday'); $weekdays = array(); ($i = 0; $i < 32; $i++) { $weekdays[] = strftime('%a', $timestamp); $timestamp = strtotime('+1 day', $timestamp); } $blank = date('w', strtotime("{$year}-{$month}-01")); ?> <table class='ta...

d3.js - D3 axis ticks and grid lines do not align -

Image
i make plot 1 vertical , 1 horizontal grid line cross (0,0) point. have following script unfortunately axis ticks , origins of grid lines not align properly. source of discrepancy , how can fix this? <!doctype html> <meta charset="utf-8"> <script src="d3.min.js"></script> <body> </body> <script> var margin = {top: 60, right: 60, bottom: 60, left: 70}, width = 550, height = 550; var svg = d3.select('body').append('svg') .attr('width', width) .attr('height', height); var xscale = d3.scalelinear().domain([-1,1]).range([0+margin.left, width-margin.right]); var yscale = d3.scalelinear().domain([-1,1]).range([height - margin.bottom, 0 + margin.top]); // add x axis svg.append("g") .attr("transform", "translate(0," + (height - margin.top) + ")") .attr("class", "axis...

Manipulate highcharts bar -

Image
i'm exploring highcharts api , used stacked grouped bar charts. came on idea on changing bar's look. wanted pointed bar. possible? in advance! image below: changing column series shape might difficult because logic behind column series meant work rectangles, require extend/change highcharts internal code. instead, can use polygon series . little of configuration, should able desired effect. $(function() { var labels = { 1: 'apples', 4: 'bananas' }; highcharts.chart('container', { chart: { type: 'polygon' }, xaxis: [{ min: -0.5, max: 6, tickpositions: [0, 2, 3, 5], labels: { enabled: false } }, { offset: 0, linkedto: 0, tickpositions: [1, 4], ticklength: 0, labels: { formatter: function () { return labels[this.value]; } } }], yaxis: { min: 0, max: 100 }, series: [{ name: 'series 1', id...

jquery - Delete data on base of selected checkbox ids laravel 5.3 -

i getting id's alert want post these id's destroyall method in usercontroller here method through getting id's in alert function deleteall () { var checkedvalues = $('input:checkbox:checked').map(function() { return this.value; }).get(); alert(checkedvalues); } i want post these values through ajax , delete there route as route::post('/user-management/user/destroyall', 'usercontroller@destroyall'); in destroyall method want explode , , minus head checkbox value you need use ajax: $.ajax({ type : "post", url : "{{ url('/user-management/user/destroyall') }}", data : {ids: checkedvalues, _token: "{{ csrf_token() }}"}, success : function (response) { console.log('success', response); }, error : function (response) { console.log('error', response); }, dat...

Why does Spark not run locally while it should be possible according the documentation? -

the aim started spark executing examples , investigate output. i have cloned apache spark repository , built following instructions in readme , ran ./bin/spark-shell results in: using spark's default log4j profile: org/apache/spark/log4j-defaults.properties setting default log level "warn". adjust logging level use sc.setloglevel(newlevel). sparkr, use setloglevel(newlevel). 16/11/10 08:47:48 warn nativecodeloader: unable load native-hadoop library platform... using builtin-java classes applicable 16/11/10 08:47:48 warn utils: service 'sparkdriver' not bind on port 0. attempting port 1. 16/11/10 08:47:48 warn utils: service 'sparkdriver' not bind on port 0. attempting port 1. 16/11/10 08:47:48 warn utils: service 'sparkdriver' not bind on port 0. attempting port 1. 16/11/10 08:47:48 warn utils: service 'sparkdriver' not bind on port 0. attempting port 1. 16/11/10 08:47:48 warn utils: service 'sparkdriver' not bind on port 0...

c# - How to split a string by multiple chars? -

this question has answer here: c# split string string 8 answers i have string this: string ip = "192.168.10.30 | somename" . want split | (including spaces. code not possible unfortunately: string[] address = ip.split(new char[] {'|'}, stringsplitoptions.removeemptyentries); as leads "192.168.10.30 " . know can add .trim() address[0] right approach? simply adding spaces( ' | ' ) search pattern gives me unrecognized escape sequence you can split string, not character: var result = ip.split(new string[] {" | "}, stringsplitoptions.removeemptyentries);

reactjs - What is the difference between react-fetch and whatwg-fetch -

i'm new reactjs , i've been reading on how , post data api. i've seen these two, i'm not sure use , what's difference between two? read i'm not sure use. thanks! react-fetch whatwg-fetch react-fetch allows use component(jsx) instead of writing specific js code. under hood, uses original fetch function(or isomorphic-fetch, not relevant question). i suggest reading fetch on mdn before getting decision. which should use? depends on personal preferences. if don't have experience fetch, i'd use whatwg-fetch understand how works better. once have better understanding of it, can choose between 2 libraries. if have simple ajax request, consider using react-fetch. if situation requires mutating state, or other complex logic, i'd suggest using whatwg-fetch.

push - fcm reciving two notification -

in fcm reciving 2 notification. how stop notification tag android devices? { "to" : "bk3rnwte3h0:ci2k_hhwgipodkcizvvdmexudfq3p1...", "priority" : "normal", "notification" : { "body" : "this week's edition available.", "title" : "newsmagazine.com", "icon" : "new" }, "data" : { "volume" : "3.21.15", "contents" : "http://www.news-magazine.com/world-week/21659772" } } change way: { "to" : "bk3rnwte3h0:ci2k_hhwgipodkcizvvdmexudfq3p1...", "priority" : "normal", "data" : { "body" : "this week's edition available.", "title" : "newsmagazine.com", "icon" : "new", "volume" : "3.21.15", "contents" : "http://www.ne...

How to synchronously call multiple functions angularjs -

for example, have 4 functions: var f1 = function() {...}; var f2 = function() {...}; var f3 = function() {...}; var f4 = function() {...}; var fmain = function() {...}; the main function loop: var fmain = function () { angular.foreach(question_list, function (question, key) { f3(); //i want execute f4() after f3() returned! f4(); }); }; in f3() , f2() called! var f2() = function(){ //there's timeout function check if dynamic value equals expected value //if so, return true; otherwise, keep calling f2() until dynamic value equals expected value } in f2() , f1() called! var f1() = function(){ //there's timeout function check if dynamic value equals expected value //if so, return true; otherwise, keep calling f1() until dynamic value equals expected value } so, f3 depends on f2 , f2 depends on f1 . i want have them return synchronously (need code not proceed next line if previous line not returned yet). how can implement this?...

Range query elasticsearch -

i have written following query data elasticsearch searchrequest requestquery = requests.searchrequest(constantsvalue.indexname) .types(constantsvalue._type) .source("{size:999999," + "\"_source\" : " + "[\"dtcreated\", \"status\"]" + ",\"aggs\": " + "{\"group_by_status\": {\"terms\": {\"field\": \"status\"}," + "\"aggs\" : " + "{\"group_by_date\" : {\"date_histogram\" : " + "{\"field\" : \"dtcreated\", \"interval\" : \"day\"," + "\"format\" : \"yyyy-mm-dd\" }," + "\"aggs\" : " ...

angular - html select not clickable -

i'm converting <select> more angular 2 in syntax. i'm using angular 2 using jquery <select> bad practice worked. clicking not make happen (no dropdown appears). possible see why nothing happens looking @ output html? html: <select _ngcontent-iwn-11="" class="form-control ng-untouched ng-pristine ng-valid" id="find-category-select" multiple="" name="categories" required="" disabled="" ng-reflect-required="" ng-reflect-name="categories" ng-reflect-model=""> <!--template bindings={ "ng-reflect-ng-for-of": "[object object],[object object]" }--><optgroup _ngcontent-iwn-11="" ng-reflect-label="grocery products" label="grocery products" style=" width: 400px; height: 100px; "> <!--template bindings={ "ng-reflect-ng-for-of": "meat,dairy,confectionary,...

javascript - Windows builds of an Electron app on Cent OS 64 bit with electron-packager fails with error -

i'm trying set build on remote cent os server , stuck error. installed wine, since server has 64-bit architecture, wine command wine64 , not wine . each time try make windows build, could not find "wine" on system... make sure "wine" executable in path. error. seems it's trying execute "wine" command, have "wine64" instead, , according various guides, it's ok. making alias didn't help. suggest how can workaround issue? thanks. as turned out, built 64-bit version, had build , install 32-bit version well. though compilation , installation went warning 32-bit stuff missing, electron builds seem ok , work ok. the tutorial followed is here .

sql - TSM command to get the count of backup in GB's? -

can 1 please provide me tsm command count of backup in gb's last 30 days? an example of sql command can execute on tsm data size last 24 hours: select substr(entity,1,20) "node", cast(sum(bytes/1024/1024) decimal(8,2)) "mb bkp" summary activity = 'backup' , start_time>=current_timestamp - 24 hours group entity order 2 desc i haven't worked on tsm many years, can not change number of hours in clause 24 hours * 30 days? select substr(entity,1,20) "node", cast(sum(bytes/1024/1024) decimal(8,2)) "mb bkp" summary activity = 'backup' , start_time>=current_timestamp - 720 hours group entity order 2 desc to gb, divide bytes again 1024 in select clause.

getting specific xml data using c# -

i have xml file: <address> <data2> <person> <empl_num>>100</empl_num> <name>carl</name> <id_num>1</id_num> <isrequired>0</isrequired> </person> <person> <empl_num>200</empl_num> <name>mark</name> <id_num>2</id_num> <isrequired>0</isrequired> </person> <person> <empl_num>300</empl_num> <name>tanner</name> <id_num>3</id_num> <isrequired>0</isrequired> </person> </data2> </address> i have textbox , button. when type "1" , press button problem how can display xml data datagridview value of textbox show data has id_num = textbox.text expected output datagrid: if txtbox1.text = 1: empl_num | name | id_num | isrequired 100 | carl | 1...