Posts

Showing posts from March, 2015

javascript - How to shade between 2 lines on a line graph using chart.js version2 -

i'm new chart.js , i'm having trouble shading between 2 lines on line graph. below example of id achieve: this example of im after but base functionality in chart.js version 2 seems shade between line , 0 on y-axis. here code graph have far. shade between gtupper , gtlower lines these describe range. <html> <div> <canvas id="mychart"></canvas> </div> </html> <script> function gengraph(y) { // function generate graph chart.js $(document).ready(function(){ var roomcap = 220 var prediction = [62, 65, 135, 145, 140, 120, 135, 189, 180, 175, 100, 25] var gndtruthupper = [75, 100, 150, 175, 150, 150, 175, 200, 175, 150, 125, 100] var gndtruthlower = [50, 50, 75, 50, 25, 50, 75, 100, 125, 150, 125, 100, 75] var data = { labels: ["00", "05", "10", "15", "20", "25", "30", "35", "40&q

Query MySql in PHP with Symfony -

what difference between in application 1 / 2: $qb = $this->createquerybuilder('tu'); $transunits = $qb->select('tu, te') ->leftjoin('tu.translations', 'te') ->andwhere($qb->expr()->in('tu.id', $ids)) ->andwhere($qb->expr()->in('te.locale', $locales)) ->orderby(sprintf('tu.%s', $sortcolumn), $order) ->getquery() ->getarrayresult(); , $qb = $this->createquerybuilder('tu'); $transunits = $qb->select('tu, te') ->leftjoin('appbundle:translation', 'te') ->andwhere($qb->expr()->in('tu.id', $ids)) ->andwhere($qb->expr()->in('te.locale', $locales)) ->orderby(sprintf('tu.%s', $sort

node.js - Is it more efficient to run a Node JS application through CRON at set times, or to run a 24/7 Node Application utilizing CRON inherently? -

is more efficient run node js application through cron @ set times, or run 24/7 node application utilizing schedulers inherently? option a: cron job daily process - calls daily nodejs app cron job weekly process - calls weekly nodejs app advantage application runs when needs to. disadvantage overhead , organization. required have separate projects/scripts each different action. option b: separate nodejs application runs 24/7. calls it's daily operations daily, weekly operations weekly, etc. advantage: 1 project containing cron rules - easy add more tasks disadvantage: project must running 24/7, more overhead when not needed. if looking @ daily , weekly frequency only, go cron job calls nodejs app. if task runs in 5 minutes, have cpu , ram utilisation during minutes, instead of having full nodejs app staying in memory , using cpu resources day (although minimal). you don't need 2 directories; can have 1 directory have daily.js job file , weekly.

How to re-use groovy script in Jenkins Groovy Post Build plugin? -

i have groovy code planning re-use in jenkins groovy post build plugin of multiple jobs. how can achieve this? there place can store script in global variable , call in jobs ever need? you can load groovy file living on jenkins master within groovy postbuild , execute it. example, have special directory on c drive common scripts live. i'll update answer later code shows how load script in. update assuming have test.groovy file on c: drive, should simple following in groovy postbuild: evaluate(new file("c:\\test.groovy")) please view comment section of groovy postbuild more examples , possibly other ways.

php - Zend 1.12 Session Encoding -

i using zend 1.12 hobby project , using zend_session class in order store data in sessions. storing array session requires me following instance: $session->myarray = serialize($myarray); $session->savesession(); // later on $session = $this->getsession(); $myarray = unserialize($session->myarray); i not having serialize , unserialize data, zend 1 not have sort of mechanism handling session encoding don't have on end? just wondering, can't find in documentation. thanks!

How to read a line from python currently in console? -

i want use line of code can read typing in console, use asyncio module in python. code prints data when receives server, , after that, want read typing , save variable. fine having use non-standard module. information program: currently reads stdin non-blocking using asyncio loop.run_in_executor program runs using loop.create_connection, uses loop.run_forever stdin reader added task. code: #!python3.5 #chatroom client import socket, sys, os, traceback, asyncio threading import lock dbg = false #more error printing using full_error function #async stuf loop = asyncio.get_event_loop() lock = lock() prev_stdin = "" #server location target = 'localhost' port = 17532 buffer_size = 1024 server = none transports = [] #an array of async.iotransport`s #functions error handling full_error = lambda: traceback.print_exception(*sys.exc_info()) pause = lambda: none #make global below #pause system compatability if os.name[0:5]=='posix': def pause()

zip - Matlab trying to clean up ZipFile -

i have zip file in working folder, , looks matlab trying without prompting. after last session timed out, got following message: cleaning unclosed zipfile archive \\filepath\folder\folder\file.zip it red, didn't additional being error. i'm pretty sure did have zipfile open in winzip. however, i've gotten error while running long run-time scripts, , seems bomb them. nothing in scripts tells matlab touch file. any idea why matlab doing this, , can stop it?

SSIS- retaining null values as null in the csv output file using script task -

i using execute sql task read sql queries , script task write query results csv files using method mentioned in following post on site- ssis: script task write recordset file ( ssis: script task write recordset file ). in addition this, require 'null' populated in csv files wherever query result null. how achieve using script task???? additional code have write?? there few ways answer in persist() within foreeach data row loop: foreach (system.data.datarow row in table.rows) { // todo: string based fields, capture max length ienumerable<string> fields = (row.itemarray).select(field => field.tostring()); file.writeline(string.join(delimiter, fields)); } you have test db null in lambda expression. should work though have not tested: ienumerable<string> fields = (row.itemarray).select(field => ((field == dbnull.value) "null" : field.tostring()));

python - Qt/Spyder scaling with 4K display -

i've made switch old macbook pro razer blade stealth laptop. have many programs i've written have pyqt4 guis, , of coding in spyder. upon switching computer 4k screen spyder has become unusable not scale properly, in addition guis have written don't scale correctly , unusable. does have experience problem and/or have tips on how these things scale correctly on high dpi screens? the next version of spyder (3.0.0) natively support high dpi screen , makes use vector icons. you can try latest beta (spyder 3.0.0 beta4) if want adopter. check out talk on "what's new in spyder 3.0" @ last scipy conference: https://www.youtube.com/watch?v=5bokdo1c144

cakephp - Show custom field in query list in cakephp3 -

i want create dropdown custom field list query append id field query. how show selected fields in query. $this->loadmodel('cardtypes'); $cardtypes = $this->cardtypes->find('list')->select(['code', 'name']); in view $this->form->select('card_type_id', $cardtypes, [ 'default' => 'delta']); see manual $cardtypes = $this->cardtypes->->find('list', [ 'keyfield' => 'code', 'valuefield' => 'name' ]);

node.js - Undefined symbol when Calling function in C++ Random Char added -

in nodejs i'm building interface shared object in c. have following code: #include <node.h> #include "libcustom_encryption.h" namespace demo { using v8::exception; using v8::functioncallbackinfo; using v8::isolate; using v8::local; using v8::number; using v8::object; using v8::string; using v8::value; // // implementation of "add" method // input arguments passed using // const functioncallbackinfo<value>& args struct // void devicegetversion(const functioncallbackinfo<value>& args) { char ver[10] = {0}; unsigned int ver_size = 0; device_get_version(ver, ver_size); isolate* isolate = args.getisolate(); // // 1. save value in isolate thing // local<value> str = string::newfromutf8(isolate, "test"); // // 2. set return value (using passed in // functi

how to use text based console progress bar in multithreading C# -

hi have program downloads + extracts files in parallel (in threads). console app,and want show progress bar each operation in each thread. eg: file 1 [==========35% ] 35mb of 100mb downloaded file 2 [====20% ] 20mb of 100mb downloaded file1 downloaded, file 1 [=============50% ] 50% extracted. , on. note: able show console outputs code below, use progress bar in console app. how can use solution proposed in https://gist.github.com/danielswolf/0ab6a96899cc5377bf54 in case ? public static void downloadandgetfiles() { try { parallel.foreach(fileids, currentid => { int currentid = fileids.id clientfiledownload(currentid); }); } catch (exception e) { } } private static void clientfiledownload(int currentid) { webclient client = new webclient(); client.downloadprogresschanged += new downloadprogresscha

scala - java.text.ParseException: Unparseable date: "[timecol: timestamp]" at java.text.DateFormat.parse(DateFormat.java:366) -

i'm trying parse date stored in cassandra database, but, when parse date, receive error message java.text.parseexception: unparseable date: "[timecol: timestamp]". in database date in format "2015-08-21 04:01:00+0000". can me please? val conf = new sparkconf(true) .set("spark.cassandra.connection.host", "127.0.0.1").setappname("test") .set("spark.cassandra.connection.port", "9042") .set("spark.driver.allowmultiplecontexts", "true") .set("spark.streaming.receiver.writeaheadlog.enable", "true") val sc = new sparkcontext(conf) val csc=new cassandrasqlcontext(sc) val sqlcontext = new org.apache.spark.sql.sqlcontext(sc) import sqlcontext.implicits._ var imput: simpledateformat = new simpledateformat("yyyy-mm-dd hh:mm:ss", locale.english) var dia: simpledateformat = new simple

javascript - Grunt doesn't see my devDependency module -

i installed this: https://www.npmjs.com/package/derequire with npm install derequire --save-dev it appeared in package.json file "devdependencies": { "derequire": "^2.0.3", but when in gruntfile.js do: grunt.loadnpmtasks('derequire'); i following error: local npm module "derequire" not found. installed? other dependencies work fine. i noticed other dependencies prefixed 'grunt-' (e.g.: 'grunt-contrib-concat'). mean can't use npm derequire in grunt? how can enable it? grunt.loadnpmtasks('derequire'); doesn't work because it's supposed used grunt plugins. see reference . can't use regular npm packages. for list of grunt plugins, take here .

select - Group Concat in mysql statement -

i've got table called delitems colums. within select statement want use group_concat : +-------------------------------+-------+--------+--------+-----+ | color | total | ptotal | amount | qty | +-------------------------------+-------+--------+--------+-----+ | blue - w = 55,blue - w/o = 93 | 148 | 375 | 55500 | 2 | +-------------------------------+-------+--------+--------+-----+ mysql>select group_concat(color,' = ',qty) color, sum(qty) total, sum(p_cost) ptotal, sum(qty)*sum(p_cost) amount,count(*) qty delitems status='3' group cont_no; everything works fine except amount column. total amount wrong! here correct value: +-----------------+-------+--------+--------+-----+ | color | total | ptotal | amount | qty | +-----------------+-------+--------+--------+-----+ | blue - w = 55 | 55 | 125 | 6875 | 1 | | blue - w/o = 93 | 93 | 250 | 23250 | 1 | +-----------------+-------+---

c# - Set .pdf name but prevent download with Rotativa -

i need set .pdf name before displaying it. tried set this return new viewaspdf(getviewname(), "", reportvm) { pagesize = size.letter, filename = getviewname() + "-" + datetime.now.toshortdatestring() + ".pdf" }; , but in way .pdf automatically downloaded. possible set .pdf name , not downloading it? thanks! after long research, answer no. thing set file name using response header , remove property filename, code now: response.appendheader("content-disposition", "inline; filename=" +getviewname() + "_" + datetime.now.toshortdatestring() + ".pdf"); return new viewaspdf(getviewname(), "", reportvm) { pagesize = size.letter }; maybe there better solution, that's best after reading. hope others too!

vb.net - Set DataGridViewComboBoxColumn Value Based on a Datatable -

i read several article relating setting value of combobox still couldn't come solution. below basic example of want , in comments want do. appreciated. public sub form1_load(sender system.object, e system.eventargs) handles mybase.load dim dt new datatable dt.columns.add("id") dt.columns.add("name") dt.columns.add("value") dt.columns(0).autoincrement = true integer = 0 20 dim r datarow = dt.newrow r("name") = "test" & date.now & "" & if = 2 or = 5 or = 6 or = 8 or = 10 r("value") = "yes" else r("value") = "no" end if dt.rows.add(r) datagridview1.datasource = dt next datagridview1.readonly = false dim cmb new datagridviewcomboboxcolumn() cmb.headertext = "select data" cmb.name = "cmb" cmb.maxdropdownitems = 2 c

c++ - Is there any possibility to reach the index of an outer QML Repeater from the inner one (they are nested)? -

i trying dynamically build matrix of same type of items in qml application , keep dynamic, can change number of rows , columns in c++ file anytime. has been working well, now, access them individually, want give them dynamic names. therefore nested 2 repeaters , tried set objectname in following: repeater{ id: rows model: matrix1.row //number of rows in matrix1-object repeater{ id: columns model: matrix1.column //number of columns in matrix1-object repeateditem{ objectname: (index) +"."+ (rows.index) //matrix elements supposed numbered x.y because of nested repeaters, e.g. 0.0 first element } } } unfortunately seem have no access outer index. first value shown, second value represented string undefined in textarea of gui. in case add new property outer repeater , set same value index, set once , keep first value (0) each repeated

python - Spark cartesian product -

i have compare coordinates in order distance. therefor load data sc.textfile() , make cartesian product. there 2.000.000 lines in textfile 2.000.000 x 2.000.000 compared coordinates. i tested code 2.000 coordinates , worked fine within seconds. using big file seems stop @ point , don't know why. code looks follows: def concat(x,y): if(isinstance(y, list)&(isinstance(x,list))): return x + y if(isinstance(x,list)&isinstance(y,tuple)): return x + [y] if(isinstance(x,tuple)&isinstance(y,list)): return [x] + y else: return [x,y] def haversian_dist(tuple): lat1 = float(tuple[0][0]) lat2 = float(tuple[1][0]) lon1 = float(tuple[0][2]) lon2 = float(tuple[1][2]) p = 0.017453292519943295 = 0.5 - cos((lat2 - lat1) * p)/2 + cos(lat1 * p) * cos(lat2 * p) * (1 - cos((lon2 - lon1) * p)) / 2 print(tuple[0][1]) return (int(float(tuple[0][1])), (int(float(tuple[1][1])),12742 * asin(sqrt(a)))) def sort_val(tu

r - how to search for columns in data frames? -

i have following 2 data frames u , v . trying create resulting third data frame w using u , v such each value in col a of df u matched in cols in df v , find nth value df u col b in df v of matched column. u<-data.frame(a=c("v2","x2","x2"),b=c(2,3,4)) v<-data.frame(no=c(1,2,3,4,5),v1=c(2,9,3,1,7),v2=c(9,10,8,8,7),w1=c(5,7,9,4,3), w2=c(4,6,1,3,2),x1=c(9,6,2,7,4),x2=c(4,4,4,2,7)) resulting data frame w <-data.frame(a=c("v2","x2","x2"),b=c(2,3,4),c=c(10,4,2)) we can match 'a' column in 'u' names of 'v' column index, cbind 'b' column (row index), extract values 'v', , create 'c' column transform , assign new dataset object ('w'). w <- transform(u, c= v[cbind(b, match(as.character(a), names(v)))]) w # b c #1 v2 2 10 #2 x2 3 4 #3 x2 4 2

php - Getting results from first element of foreach -

there many matching credentials inside table inserted foreach loop getting results first foreach element. how fix that? foreach($matches $match) { $object = $match->object; $sales->whereraw("match (`object`) against (?)", array($object)); if($match->colourbase == '1') { $sales->where('colour', '=', 'cc'); $sales->orwhere('colour', '=', 'cc+dd'); if($match->maxprice) { $sales->where('price', '<=', $match->maxprice); } if($match->minprice) { $sales->where('price', '>=', $match->minprice); } } } $results = $sales->orderby('sales.updated_at', 'asc')->get(); @update this how $matches $matches = match::where('peopleid', '=

objective c - Camera view(UIImagePickerController) show different orientation for different ios devices -

i working in cocos2d-iphone , try make augmented reality game. firstly followed this tutorial face problem. my sample code is: #product.h @interface product : ccnode <uiimagepickercontrollerdelegate,uinavigationcontrollerdelegate> { uiview *overlay; uiimagepickercontroller *cameraui; } +(ccscene *) scene; -(void)loadcameraview; @end then product.m #define camera_transform 1.24299 -(void)loadcameraview { // prepare overlay view , add window overlay = [[uiview alloc] initwithframe:[[uiscreen mainscreen] bounds]]; overlay.opaque = no; overlay.backgroundcolor=[uicolor clearcolor]; cameraui = [[uiimagepickercontroller alloc] init]; cameraui.sourcetype = uiimagepickercontrollersourcetypecamera; cameraui.showscameracontrols = no; cameraui.toolbarhidden = yes; cameraui.navigationbarhidden = yes; cameraui.wantsfullscreenlayout = yes; //cameraui.shouldautorotate = no; cameraui.cameraviewtransform = cgaffinetransfo

Oracle. How can I handle outer fields with IN operator and OUTER JOIN -

i wrote query this select * (select table2.val val1, table2.val val2, table2.val val3, table2.val val4, table2.val val5, table2.val val6, case when val1 null '10' when val3 null '20' when val5 null '30' else '40' end progress table1, table2 table1.key = table2.key(+) table2.cond in ('1','2','3','4','5','6') ) progress > '20' this query not working. there's error in ,case when val1 null '10' when val3 null '20' when val5 null '30' else '40' end progress this part. error says val1 incongruence. i can resolve if use this from table2 tb2_1, table2 tb2_2, table3 tb2_3 tb2_1.key(+) = table1.key , tb2_2.key(+) = table1.key declare same tables severa

Convert SimpleXMLElement object to XML format in php -

one xml file view.xml convert simplexmlelement object after parent node it's child object need convert in xml format in php ** view.xml ** > <cards name="country-cards" model="core_country" title="country" > > <field name="name" /> > <field name="code" /> > <template><![cdata[ > <div class="span12"><strong>{{name}}</strong></div> <div> > <div class="span8"> > <span>{{name}}<br/> > {{code}}<br/></span> > </div></div>]]> > </template> > </cards> **$xml = simplexml_load_file($xmlviewfilepath);** foreach ($xml $key=>$value) { $value want convert in xml formate } question: other simple way achieve simplexmlelement obj

ios - Class extension vs. subclassing in Swift? -

i'am using third-party framework provides class instances have properties. in app, i'd add property instances. appropriate way scenario? a) extending framework's class in app b) creating subclass of framework's class , define new property need thanks in advance it's b) because adding (stored) properties in class extension not supported. there 2 important rules using extensions: extensions can add new functionality type, cannot override existing functionality extensions can add new computed properties, cannot add stored properties, or add property observers existing properties

excel - How do I Copy/Paste specific cells from other worksheet to current worksheet? -

i'm using code take username search of associate info multiple transactions. should paste them current worksheet. seems run, in doesn't throw errors , executes final "select" command, doesn't return pasted data. option explicit sub investorreport() dim investorname string dim finalrow integer dim integer 'row counter sheets("sheet1").range("d6:k50").clearcontents investorname = sheets("sheet1").range("b3").value finalrow = sheets("investments").range("i1000").end(xlup).row = 2 finalrow if sheets("investments").cells(i, 1) = investorname msgbox ("works") range(cells(i, 2), cells(i, 12)).copy sheets("sheet1").range("d100").end(xlup).offset(1, 0).pastespecial end if next range("b3").select end sub this code reference sheets: option explicit sub investorreport() dim investorname string

swift - CGrect vs constrains in IOS pro programmatical GUI Design? -

we use cgrect inside frame specifying width, height , exact coordination of rectangle (shape). do need specify constrains ui elements 1 one well? if yes, why need to? how device rotation (portrait vs. landscape mode)? need define different positioning? if defining constraints not have specify cgrect frame design. in fact best way use nslayoutconstraints. reason if set cgrect frame, when device rotating of time cgrect can wrong. @ least hight , with. if use constraints when device rotating layout subviews again automatically. means views rearrange according constraints. when set cgrect frame is, changes view's position , dimensions regardless of constraints. if try call view.layoutifneeded() or change orientation views rearranged according constraints regardless frame set before.

assembly - Storing values from special function registers to a variable -

i working on development project based on freescale mpc5534 controller. requirement, need store values 2 special function registers(namely srr0 , srr1 ) during isr(already existing) variables can accessed out of function. following assembly code snippet existing isr: lis r0,0x_value1 ori r0,r0,0x_value2 mfspefscr r3 , r0,r0,r3 mtspefscr r0 lis r3,address@h ori r3,r3,address@l mtlr r3 li r3,0x_value3 blrl rfi how planning store values registers in following manner: lis r0,0x_value1 ori r0,r0,0x_value2 mfspefscr r3// move spefscr register , r0,r0,r3 mtspefscr r0 //move spefscr register lis r3,address@h ori r3,r3,address@l mtlr r3 mfsrr0 r4 //copy srr0 r4 mfsrr1 r5 //copy srr1 r5 li r3,fpu_reset blrl rfi what troubles me is, how know if registers r4 , r5 being used other functions already(say dont have access other project files)? if so, approach right? have explicitly create stack frame isr pushing , popping r4 , r5, make sure there won't register clash? make sense

java - Creating android app for existing project -

i have project made using spring mvc + angularjs. so. consequently, have back-end api done , working in spring mvc + spring security. i want make android/iphone apps project (first - android). i'm new apps development. the questions are: can use existing api, user authentication done in spring security? what right tools ? android sdk + gradle + make views? any suggestion, maybe can simple app template have simple login function + few api calls. you can directly use apis in android projects, don't know ios.but think possible use same apis in ios app. 2.you can use eclipse or android studio writing android programs. can download sdk @ time of installation of setup file or else can give sdk path @ time of installation. 3.and coming third question have server side code in angular.js, through can interact android app. build demo project login details , use asynctask interact server. .

tfsbuild - build definition – only empty queue -

Image
if creating build definition, can’t choose default agent queue. not long ago, can create build definition includes default queue. don’t know change was, doesn’t work anymore. if go edit correct created build definition , try again create definition, can choose default queue. reason that? editing existing build definition before creating isn’t solution, because have many projects , have correct build definition , have no build definition. if meaning default agent queue such below during creation of build definition the queue that's attached pool contains agents want run definition. can first double check status of agent pool. make sure ok. and after created definition, can still change queue in general , try change queue here identify if there's still empty queue.

best match algorithm in python -

what should optimal implementation best match in python. i have txt file has country codes mapping e.g. codes name 123 abc 1234 def 1235 ghi 124 jkl 1241 mno this txt file big(13500 records) i'm putting sample. further have cdr files country code(numeric) in each record(row) want convert country name. now mean best match is, cdr record contains country code "1234" country name "def", if "1235" country name "ghi" if country code "1236" perfect match fails , should fall "abc" since "123" available. i don't know there standard name kinda search. greedy search in regular expressions. what can best implementation kind search, since cdr files big(upto 25gb). dictionaries easiest way implement this. see below solution: convert 123 abc 1234 def 1235 ghi 124 jkl 1241 mno to {1241: 'mno', 1234: 'def', 123: 'abc', 124: 'jkl&

json - Firebase error: Data requested exceeds the maximum size that can be accessed with a single request -

Image
i need export firabase database json via firebase console, when following message in json file: data requested exceeds maximum size can accessed single request how can fix this? additional details: this function use in console: edit : i found question tried access "too big" data firebase client. presume 2 related (firebase limit). have expected firebase console ui provide error message when exporting , ask user whether or not split export in multiple files. believe ux bug in json export functionality of firebase console (should greyed out if not possible export or should allow user tune file size). the firebase console has limits on size of data allows export. export link should indeed disabled when you're displaying location big export through console. if database under 256mb, can export curl request: curl "https://yours.firebaseio.com//.json?print=pretty&auth=credential" see documentation on rest api . if do

grails - Foreign Key Encryption W/ Jasypt and GORM ORM -

i work on project deals sensible data on database, need encrypt them. my technical environment : web framework : grails (v2.4.4) orm : gorm (based on hibernate 4) encryption library : jasypt (v1.3.1) in data have encrypt, can figure out 2 cases : simple attribute (eg. forename, lastname, etc.). know how deal ( hibernate type transformation : http://www.jasypt.org/hibernate.html ). no problem one. link between 2 objects (eg. person object , job object). want break link between these 2 tables on database, therefore impossible find link between person , job "where" request on db. actual problem. here sample example of code enlight case #2 : parentclass.groovy : class parentclass extends … implements ...{ string id static mapping = { id generator: 'my.package.customgeneratorutils' } } childclass.groovy : class childclass extends ... implements ...{ static belongsto = [parentclass : parentclass] ...

node.js - Error when using "npm start" -

i'm getting errors npm start. wouldn't mind, causes me not able run server , view local website. it's because use bootstrap-multiselect plugin has no d.ts (typing) file created in ts file has error call $("#category-select").multiselect({}) saying: property 'multiselect' not exist on type jquery. so terminal says when use npm start: multiselect.component.ts(16,31): error ts2339: property 'multiselect' not exist on type 'jquery'. and won't start local server. complete blocker work. bootstrap-multiselect plugin , need have it. how can either ignore error , continue start local server, or stop error happening? package.json: { "name": "the-vegan-repository", "version": "1.0.0", "scripts": { "lite-server-test": "lite-server --config=liteserver-test-config.json", "test": "tsc && concurrently \"npm run ts

c# - can i zoom winform area around mouse cursor -

one of client's sight week wants tool in winform application move mouse courser , particular area around gets zoomed in or similar control i've searched on google can't find third party or builten tool. can suggest me ? you show client windows magnifier. works described https://support.microsoft.com/en-us/help/11542/windows-use-magnifier

powershell - Power Shell script - if and switch missing statement -

i have script, worked, , it's stupid sign missing, cant find it. me please? supposed pop choice bar , change $answer according chosen project. #what project work on $caption = "choose action"; $message = "what project testing?"; $lll = new-object system.management.automation.host.choicedescription "&lll","lll"; $jjj = new-object system.management.automation.host.choicedescription "&jjj","jjj"; $ppp = new-object system.management.automation.host.choicedescription "&ppp","ppp"; $choices = [system.management.automation.host.choicedescription[]]($lll,$jjj,$ppp); $project = $host.ui.promptforchoice($caption,$message,$choices,0) switch ($project) { 0 {"lll"; break} 1 {"jjj"; break} 2 {"ppp"; break} } if ($project -eq 0) { $answer = "lll" } if ($project -eq 1) { $answer = "jjj" } if ($project

validation - Laravel unique field validate not working -

i have have field called mac store mac address need unique avoid duplicate mac address. code: return [ 'user_id' => 'required|integer', 'mac' => array('required|unique:mac', 'regex:/^([0-9a-z]{2}[-]){5}([0-9a-z]{1,2})$/'), ]; error: method [validaterequired|unique] not exist. structure: create table `devices` ( `id` int(10) unsigned not null auto_increment, `user_id` int(10) unsigned not null, `name` varchar(255) collate utf8_unicode_ci not null, `mac` varchar(255) collate utf8_unicode_ci not null, `content` varchar(255) collate utf8_unicode_ci not null, `status` tinyint(1) not null default '0', `created_at` timestamp null default null, `updated_at` timestamp null default null, `deleted_at` timestamp null default null, primary key (`id`), unique key `devices_mac_unique` (`mac`), key `devices_user_id_foreign` (`user_id`), constraint `devices_user_id_foreign` fore

How to get Azure Key Vault secret using powershell with certificate auth? -

i including powershell startup task on azure worker role needs pull secret azure key vault. use client certificate authenticate key vault request (cert gets installed on vm when role comes up). i took @ this tutorial on azure documentation, needs me write c# methods , include bunch of nuget packages. there simpler way? it possible use powershell access keys in keyvault . use get-azurekeyvaultsecret command values. has multiple parameters suit different requirements such secrets, specific secrets etc. https://msdn.microsoft.com/en-us/library/dn868047.aspx details of keyvault module commandlets can found here. https://msdn.microsoft.com/library/azure/dn868052.aspx

Filter queue overview in ActiveMQ -

is there way filter visible queues within activemq queue overview? have lot of different queues , overview page full. great filter away not important queues default. if you're talking web admin console configuration, no - it's not built scale lot of queues. but again, console simple java web app , implement filter if need it. the quick n dirty way can think of open webapps/admin/queues.jsp , add jsp-if statement in foreach-loop. hard coded, quick , not require server restart, simple browser reload. <c:foreach items="${requestcontext.brokerquery.queues}" var="row"> <!-- show queues starting important. --> <c:if test="${fn:startswith(row.name,'important.')}"> .. </c:if> </c:foreach> there are, of course, more sophisticated , better ways achieve if you're task.

vaadin - Custom double click event on table -

i have customer table. don't want edit screen double clicking on item. how change default double-click action on table? according documentation can define action double-click event, using table#setitemclickaction method.

xslt - XML remove Namespace prefix -

i have xml : <mes:fichier xmlns:mes="http://file.message.fr"> <mes:toto>xxxxx</mes:toto> <yyy:document xmlns:yyy="urn:iso:std:iso:20022:tech:xsd:acmt.02y.001.01:forward"> <yyy:id>1<yyy:id> </yyy:document> <yyy:document xmlns:yyy="urn:iso:std:iso:20022:tech:xsd:acmt.02y.001.01:forward"> <yyy:id>2<yyy:id> </yyy:document> </mes:fichier> i split 1 each document tag : example : file1 : <document xmlns="urn:iso:std:iso:20022:tech:xsd:acmt.02y.001.01:forward"> <id>1<id> </document> file2 : <document xmlns="urn:iso:std:iso:20022:tech:xsd:acmt.02y.001.01:forward"> <id>2<id> </document> i have implemented xsl dont know how remove namespaces prefixe in output files , set href parameter. <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/19

Validate OpenShift objects defined in yaml before actually applying or executing it -

i have openshift template in template.yaml file includes following objects - deployment-config, pod, service , route. using following command execute yaml: oc process -f template.yml | oc apply -f - i want perform following validations before apply/execute yaml: yaml syntax validation - if there issues yaml syntax. openshift schema validation - check if object definition abides openshift object schema. it seems command 'oc process' doing following checking: basic yaml syntax validation template object schema validation how perform schema validation of other objects (e.g. deployment-config, service, pod, etc.) defined in template.yaml? i'm having same issue cryptic errors coming oc process command. however if go openshift console , use "add project" link @ top of console, choose "import yaml / json" option , import yaml/json way slightly more useful errors.

Android recyclerview expand upwards -

when using android recyclerview, default implementation when expanding items push second half of recyclerview below expanding item down. standard way of making first half of recyclerview before expanding item go instead? sort of facebook app. in order have first fill down side of screen, please give more details problem

python - Print the consecutive 3 line at the pattern match -

i have huge file need sort , merge 3 line having pattern match "vm" , need them 1 single line, below kfg-ap4 server name , can have once nice while sorting .. tried awk getline somehow missing fit .. awk '/vm/ {printf $0 " ";getline; print $0}' mem_overc **[kfg-ap4] out: vm.overcommit_memory = 0 [kfg-ap4] out: vm.overcommit_ratio = 50 [kfg-ap4] out: vm.nr_overcommit_hugepages = 0** [kfg-ap4] executing task 'moc' [kfg-ap4] sudo: /sbin/sysctl -a | grep overcommit [kfg-ap4] out: [kfg-ap4] out: trust have received usual lecture local system [kfg-ap4] out: administrator. boils down these 3 things: [kfg-ap4] out: [kfg-ap4] out: #1) respect privacy of others. [kfg-ap4] out: #2) think before type. [kfg-ap4] out: #3) great power comes great responsibility. [kfg-ap4] out: [kfg-ap4] out: sudo password: [kfg-ap4] out: vm.overcommit_memory = 0 [kfg-ap4] out: vm.overcommit_ratio = 50 [kfg-ap4] out: vm.nr_overcommit_hugepages = 0 [kfg

android - Two drawable to edittext -

Image
i have added drawables both ends of edittext. when click on right drawable, left 1 disappears. edittext password input.icon lock , icon visibility(eye) left , right of edittext respectivily.the right icon toggles per visibility of password listener implementation right drawable: etpassword.setontouchlistener(new view.ontouchlistener() { @override public boolean ontouch(view v, motionevent event) { final int drawable_right = 2; if (event.getaction() == motionevent.action_down) { if (event.getrawx() >= (etpassword.getright() - etpassword.getcompounddrawables()[drawable_right].getbounds().width())) { if (etpassword.getinputtype() == inputtype.type_text_variation_visible_password) { etpassword.setinputtype(inputtype.type_class_text | inputtype.type_text_variation_password); etpassword.set

How to convert TIMESTAMP_WITH_TIMEZONE to GMT TIMESTAMP in ORACLE SQL -

we have field of timestamp_with_timezone(oracle sql) type , has data of different time zones. example: 25-jun-16 09.15.00.000000000 +08:00 30-jul-16 10.00.00.000000000 +03:00 now have convert each timestamp(of different time zones) in table timestamp of gmt time zone. these updates should done through procedure. we tried use sys_extract_utc function, getting error: 00000 - "not valid month" query: select sys_extract_utc(timestamp '30-jul-16 10.00.00.000000000 +03:00') dual; use below query select timestamp time zone '2012-07-02 10:00:00-04' @ time zone 'gmt'; result ------------------------------ 2012-07-02 14:00:00 (1 row) select timestamp time zone '2012-07-02 14:00:00-00' @ time zone 'edt'; result ------------------------------ 2012-07-02 10:00:00 (1 row)

java - How to check if a three digit number is a palindrome? -

this question has answer here: way number of digits in int? 27 answers i creating little trivial palindrome quiz in java. i should @ point check if user enter more or less 3 digit number such "1011" or "10" , display error message such "wrong input." however, can't check length of number int.length() in java, instead string ( string.length() ). how solve problem? this code without if-three-digit check import java.util.scanner; public class test { public static void main(string[] args) { system.out.println("please enter 3 digit number number , check if it's palindrome."); // create scanner , input number scanner input = new scanner(system.in); int number = input.nextint(); int digit1 = (int)(number / 100); int remaining = number % 100; int digit3 =

php - Doctrine QueryBuilder - multiple select fields -

i have strange problem multiple select fields. query: $query = $querybuilder ->select( [ 'sum(t1.quantity) quantity_t1', 't2.currency currency_t2', 'sum(t1.amount - t1.promotiondiscount) amount_t1', 'sum(round((t1.amount - t1.promotiondiscount) / ((100 + t2.tax) / 100), 2)) amount_net', 'sum(round((t1.amount - t1.promotiondiscount) / '.exchange_rate_gbp.', 2)) amount_gbp', 'sum(round(round((t1.amount - t1.promotiondiscount) / '.exchange_rate_gbp.', 2) / ((100 + t2.tax) / 100), 2)) amount_gbp_net' ] ) ->from(sale::class, 't2') ->join( salerow::class, 't1', join::with, $querybuilder->expr()->andx( $querybuilde

javascript - Add jQuery dependency in angularJs -

how can add jquery-ui.js controller.i'm new ui-router .state('new_patient', { url: '/newpatient', templateurl: window.localstorage.getitem('contextpath') + '/module/laboratory/newpatient', controller: 'patientcontroller', resolve: { deps: function($q, $rootscope) { var deferred = $q.defer(); var dependencies = ['jquery-ui']; require(dependencies, function() { $rootscope.$apply(function() { deferred.resolve(); }); }); return deferred.promise; } } }); or follows resolve: { async: ['jquery-ui', function($) { }] } pls help.. working of accordion.. in advance replies. .state('new_patient', {