Posts

Featured post

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