Posts

Showing posts from April, 2015

web services - .NET Webservice :Schema getting changed when calling from webservice 1 to webservice 2 -

i using 1 .net desktop application. using 1 webservice has own xsds , wsdl. call webservice operation need send xml based on xsds. able successfully. however facing problem connectivity webservice hosted desktop application. decided create 1 intermediate service call actual webservice avoid connectivity issue. intermediate service hosted on server allocated don't have connectivity issues. but problem facing when try add proxy class of intermediate service, having different schema attribute type if add proxy of actual web service. pfb details example in reference.cs of actual service, there 1 class of schema called "searchitem" having 2 attribute of type class searchitem { standandardheader header workitem2 listofitem } in reference.cs of intermediate service, class searchitem { standandardheader header workitem1 listofitem } as can see workitem2 has changed workitem1 . idea why has changed this. i sorry if question sound stupid not familiar xsds.

Can I hide the green color of traffic layer in Google maps javascript api v3? -

i working on google maps javascript api v3. need view slow traffic area(red,orange roads) in traffic layer. can hide green colored roads? can change green colored road other color or make transparent? the google maps api doesn't offer such option ( documentation ). , since google delivers pre-rendered map tiles ( example ) png , aren't editable.

Loop to get mysql values with php codeigniter -

i'm stuck on model side have write loop select values mysql. table looks this: 0 2016-11-06 08:36:19 7300 2016-11-06 08:43:11 19200 2016-11-06 08:43:12 35980 2016-11-06 08:43:17 45600 2016-11-06 08:43:21 45820 2016-11-06 08:43:27 45840 2016-11-06 08:43:28 45860 2016-11-06 08:43:29 26940 2016-11-06 08:44:34 19760 2016-11-06 08:44:36 3440 2016-11-06 08:44:38 0 2016-11-06 08:44:44 1400 2016-11-06 08:46:00 7120 2016-11-06 08:46:04 11240 2016-11-06 08:46:06 11220 2016-11-06 08:46:10 11240 2016-11-06 08:46:11 11220 2016-11-06 08:46:12 3940 2016-11-06 08:46:51 0 2016-11-06 08:46:56 basically entries generated weighting machine , inserted in database works : when on weighing machine, entries start update 0 real weight of object on weight machine, till real weight values going up. when difference on 3-4 entries less 50kg, @ real weight. weight drop 0 again, , start same cicle when on it. above example, these entries

javascript - How to create alerts only on visible fields in SharePoint using jquery? -

based on value drop down have hidden or shown text area in sharepoint. want create alert on text area fields visible. alert pops columns hidden too. 1 tell me how validate field? function presaveaction(){ if ($(".ms-rtestate-write[id^='txt']")[0].innerhtml == "<p>​</p>") { alert('please attach deviation documents'); return false; } return true; }

android - How to add Firebase custom events for analytics? -

i've seen questions , answers custom events firebase analytics, wanted ask straight question can give me straight answer :) so, method logging: @override public void logfeatureselectedevent(string categoryname, string actionname, string labelname) { bundle bundle = new bundle(); bundle.putstring(eventtrackingkeys.eventtypes.category, categoryname); bundle.putstring(eventtrackingkeys.eventtypes.action, actionname); bundle.putstring(eventtrackingkeys.eventtypes.label, labelname); mfirebaseanalytics.logevent(eventtrackingkeys.eventanalytictypes.feature_selected_event, bundle); } with custom event/key names: string category = "category"; string action = "action"; string label = "label"; string feature_selected_event = "feature_selected_event"; so, in firebase console event name "feature_selected_event", without custom parameter names.. i've seen answers should call setuserproperty() method , regist

android - Andriod Listview fast scroll to bottom automatically when scroll in the middle -

i have listview fastscroll enabled , functioning properly, issue when scroll in middle scroll bar automatically comes bottom , not stick particular position. have idea please share. following main code list adapter: public class contactadapter extends arrayadapter<user> implements filterable, sectionindexer { private static string sections = ""; // rest variable declaration public contactadapter(context context, list<user> users,fragmentmanager fragmentmanager,string section) { super(context, r.layout.contact_row, new distinctmodelslist<>(users)); this.users = users; this.sections=section; this.layoutinflater = ((activity)context).getlayoutinflater(); filter = new contactsfilter(); this.fragmentmanager=fragmentmanager; } // rest view function , static modal class declaration @override public int getpositionforsection(int section) {

categories - After creating a top level category, the category itself is part of it -

Image
i created new category should appear on page. category should have 3 items should displayed directly on main page. instead category shown on top page, have select first view 3 items in it. to show 3 items, can click on either "connectivity management". looks if had 2 categories in each other, that's not case. have one. had @ servicenow documentation categories, there no hint problem. using fuji release. idea how can remove bottom category? i have other top level categories work wanted them, compared both , found no difference. how adding page , type of page adding to? i've seem similar happen when adding homepage such ess homepage . trying do? when selecting add catalog category home page have 2 options, category details , category items if choose category details , see similar see. if instead choose category items , see items within category

Android Studio (adb) stopped to see my device (Mac) -

i have nexus 7 tablet, , android studio, , able see tablet yesterday or 2 days before, since yesterday or today when connect device, dont see in devices list when want run application. i tried quit android studio, tried kill adb (ps -e | grep adb kill -9 pid_adb) , seems killing of adb had effect, because window when 1 selects deployment target displaying message "initializing adb", still dont see device. tried turn off , turn on tablet, nothing worked. i tried disconnect , reconnect usb cable, tried restart mac. i tried turn off , turn on developer debugging in tablet settings. this tablet runs android 5.1.1. have 2 more devices (android 4.4 , android 6) , both visible. i using mac (from experience mac better detect usb devices windows btw). what problem in tablet's notifications see there pending system update ready - android 5.1.1 - "downloaded , verified, click restart , install" strange because in system info see 5.1.1. if pending installati

axapta - How to pass argument from form to dialog? AX -

i created clicked() method in menuitembutton args args; args = new args(); args.parm(custtable.accountnum); super(); and in dialog run str anystringvaluefromcaller; ; super(); if( element.args() ) { // string parameter anystringvaluefromcaller = element.args().parm(); } if dialog indeed form in aot, should have no problems using args.record() or args.parm(), should described @ how pass parameter between 2 forms in axapta? if dynamically creating dialog x++, well, still able override event methods on controls described here: override event methods on dialog controls in dynamics ax . just 1 suggestion though: don't args.parm() unless need to, looking @ sample code posted, ok use args.record() instead.

c# - Unable to install package with WiX bootstrapper -

Image
i've wix setup c# application. i have wix bootstrapper used install application, .net framework , sql server. i have 2 problems installation sql server. on pc application installed, bootstrapper don't detect , try re install. on log file see "registry key not found. key = 'hkey_local_machine\software\microsoft\microsoft sql server\instance names\sql'" but checked regedit, got register : there code : <util:registrysearch id="sqlinstancekeyfound" root="hklm" key="software\microsoft\microsoft sql server\instance names\sql" value="sqlexpress" result="exists" variable="sqlserverinstalled" /> on pc without application, installation failed error 0x84b40000. there code : <exepackage id="sqlexpressx64" sourcefile=".\resources\sqlexpr_x64_enu.exe" permachine="yes" cache=&q

I want to have range filter in columns (not in templates filters which is ther in jqgrid) . Can anyone help on this -

as u see in screenshot ,in existing dropdown want add option of inbetween ,where either user can give 2 values range selection in textbox or can editabe dropdown. jqgrid data - if user enter 34:09:0;90:08:8 should values >=34:09:0 , <90:08:8 in duration filter $(function() { "use strict"; var mydata = [{ id: "1", invdate: "720:0:0", name: "test", note: "note", amount: "200.00", tax: "10.00", total: "210.00" }, { id: "2", invdate: "34:09:0", name: "test2", note: "note2", amount: "300.00", tax: "20.00", total: "320.00" }, { id: "3", invdate: "0:0:0", name: "test3", note: "note3", amount: "400.00", tax: "30.00", total: "430.00" }, {

javascript - Adobe Phonegap - Step 3 Create your app -

i using windows 10 64 bit machine, have installed phonegap windows desktop app. have installed phonegap developer app on android device. following getting started tutorial on phonegap site, have completed steps 1 , 2 , stuck on step 3. try create new project hello world template comes error 'project create failed code 1'. has else had problem, i'm new this. appreciated.

wordpress - Different Paypal accounts depending on product -

i'm testing woocommerce on wordpress site, , i'd know if possible have 2 paypal accounts linked shop. idea dedicate 1 account type of product , other 1 type. i've tried extensions available, couldn't find way this. if want use paypal, can use paypal adaptive payments. you can link each products vendor marketplace website do. ie : woocommerce wc-vendors, dokkan... depending on e-commerce plugin have embed website, can create dedicated payment gateway switch producct owner email, time wasting , maybe untrustly method. hope helps

zend framework - Zend_Db_Table_Abstract: save - sql injection -

when using zend_db_table_abstract save function, update database, need worry sql injection (quote parameters) or done automatically? how can see how query looks? no, don't have worry sql injection when using save() . behind scenes, zend framework uses zend_db_adapter_abstract::insert() , zend_db_adapter_abstract::update() , use bind parameters. values escaped framework prevent sql injection. the risk of sql injection when using zend_db_expr create custom / advanced queries, cannot happen when using save() . you may want have on zend_db_profiler list queries generated framework. alternatively, can enable database query logs. see how enable mysql query log? mysql, or how log postgresql queries? postgres.

Compare and check if multiple variables, both reference types and value types, in object has changed in C# -

in system dependent on third party service , once every minute download data them , update our data. related e-signing lot of fields update. right getting information , update on our side if nothing has changed. my thought deep copy using of methods shown below , compare values. since there many variables wonder if there someway can compare values , see if equal , not have write code check each variable? agreement shown below have both value , reference types. public class agreement { //properties here, both value , reference types public bool haschanged(agreement oldagreement) { //code here } } method example: var oldagreement = agreement.clone(); var document = client.getthirdpartyagreement(agreement.agreementdocumentid); updatedocument(agreement, document); if(agreement.haschanged(oldagreement) { agreementrepository.update(agreement); } deep copy extension methods: /// <summary> /// perform deep copy of object, using json serialis

schema - Solr issue with escaping special characters -

i having issues special characters in search term sent solr through query. when search part number 123-45, should 2 results i.e., 123-45 , 12345. please let me know how can , configuration need use in schema.xml thanks if that's character want remove, use patternreplacefilterfactory replace "-" "" when you're indexing , querying: <analyzer> <tokenizer class="solr.keywordtokenizerfactory"/> <filter class="solr.patternreplacefilterfactory" pattern="-" replacement="" /> </analyzer> the keywordtokenizer keep whole term separate token, , patternreplacefilterfactory remove - , replace nothing, meaning both indexed , queried term normalized 12345 .

Can we do a 32 bit encryption (AES256) in Mule -

Image
i have aes256 (32 bit key) encryption in mule. trying use xml encryption available in encryption component. please help. the picture flow attached. getting below error when using xml encryptor. [fatal error] :1:1: content not allowed in prolog. error 2016-11-08 16:19:37,913 [[testenc].http_listener_configuration.worker.01] root exception stack trace: root exception stack trace: org.xml.sax.saxparseexception: content not allowed in prolog. @ org.apache.xerces.parsers.domparser.parse(unknown source) @ org.apache.xerces.jaxp.documentbuilderimpl.parse(unknown source) @ javax.xml.parsers.documentbuilder.parse(unknown source) exception : org.xml.sax.saxparseexception: content not allowed in prolog. means xml either malformed or contains white space before xml declarion in many case, check xml first `

c++ - Assign static variable to non-static variable -

consider base class class , baseb class derived. baseb derived c class. clases inherit non-static variable “y” in case of baseb , c class “y” have same value. resolved situation following code: class base { protected: int y; virtual void registervalue() { y = 5; } }; class : public base { }; class baseb : public base { protected: static int x; virtual void registervalue() { // process x ... y = x; } }; class c : public baseb { }; int baseb::x = 3; int main() {} it works right assign static variable non-static variable case? it's fine language legality perspective, it's little odd. presumably can't make base::y static since interfere behaviour of class a ? you need aware of fact instances of baseb share same x , have different values of y . intended behaviour? personally i'd consider making void registervalue() pure virtual function in base class

Android Studio emulator not working correctly (zooming in and is pink) -

Image
i updated android studio , got problems. emulator pink , zooming in automatically. the pink , zooming in effect experienced result of skin . can change skin inside android virtual device manager , under edit of emulator.

rust - "parameter `'a` is never used" error when 'a is used in type parameter bound -

use std::iter::iterator; trait listterm<'a> { type iter:iterator<item=&'a u32>; fn iter(&'a self)-> self::iter; } enum termvalue<'a, lt> lt:listterm<'a>+sized+'a { str(lt) } src/lib.rs:8:16: 8:18 error: parameter `'a` never used [e0392] src/lib.rs:8 enum termvalue<'a, lt> lt:listterm<'a>+'a { ^~ 'a being used. bug, or parametric enums not finished?.. rustc --explain e0392 recommends use of phantomdata<&'a _>, don't think there's opportunity in use case, may able see. 'a being used. not far compiler concerned. cares of generic parameters used somewhere in body of struct or enum . constraints do not count. what might want use higher-ranked lifetime bound: enum termvalue<lt> for<'a> lt: 'a + listterm<'a> + sized { str(lt) } in other situations, might want use phan

Java Runtime.exec() -

i can run command command line without problem (the validation script executes): c:/python27/python ../feedvalidator/feedvalidator/src/demo.py https://das.dynalias.org:8080/das_core/das/2.16.840.1.113883.4.349/1012581676v377802/otheradmindata/carecoordinators and java if leave off url parameter , do: string[] args1 = {"c:/python27/python", "../feedvalidator/feedvalidator/src/demo.py" }; runtime r = runtime.getruntime(); process p = r.exec(args1); it works fine. if use urls parameter such as: string[] args1 = {"c:/python27/python", "../feedvalidator/feedvalidator/src/demo.py" , "http://www.intertwingly.net/blog/index.atom"}; // or string[] args1 = {"c:/python27/python", "../feedvalidator/feedvalidator/src/demo.py" , "http://www.cnn.com"}; it works fine. but if use particular url https://das.dynalias.org:8080/das_core/das/2.16.840.1.113883.4.349/1012581676v377802/otheradmindata/carecoordi

c - dlopen: detect undefined symbols with cyclic dependencies -

i have handful of shared libraries cyclic dependencies, want load dlopen . this, call dlopen rtld_lazy | rtld_global flags. this works fine. now, want check symbols in shared libraries resolved, , therefore call dlopen again rtld_now , should fail if symbols can not resolved. at least, how understand man page: however, subsequent dlopen() call loads same shared object rtld_now may force symbol resolution shared object earlier loaded rtld_lazy. here simple example illustrates problem: main.h #include <stdio.h> #include <dlfcn.h> #include <stdlib.h> #include "h.h" #define cnt 3 static const char *libs[cnt] = {"./liba.so", "./libb.so", "./libc.so"}; typedef int (*f_ptr)(); int main() { void *h[cnt]; f_ptr f[cnt]; (int = 0; < cnt; i++) { printf("dlopen: %s\n", libs[i]); h[i] = dlopen(libs[i], rtld_lazy | rtld_global); if (!h[i]) { fprintf(

html5 - Google IMA SDK Overlay & Fullslot Ad Reference for JavaScript -

i'm using google ima html5 sdk api displaying fullslot ad in our self-made player. now, i'm trying add overlay ad within same api, can't find documentation that. in faq link technical quick start guide , turns out made flash actionscript - need same guide html5/javascript. how implement both, google overlay , fullslot ad html5/javascript? update this current javascript code 2 different ad requests (it returns empty ad overlay right now, doesn't work yet): var google = google || { ima: 'blocked' }; //adblocker /* ################################################################# # # # required: google ima sdk html5 # # # ################################################################# */ wct.videoads = (function() { 'use strict'; //--------------------------------------------------------------- // adblocker //-------------------------------------------------------

java - How to get rid of OSGi bundle's properties that are not exist in their corresponding configuration ("service.pid", etc.)? -

i have class similar following: @component(configurationpid = "foo.bar", configurationpolicy = configurationpolicy.require) public class myclass { @activate public void activate(map<string, object> properties) throws exception { (string property : properties.keyset()) { if (!isvalidproperty(property)) { throw new illegalargumentexception("unknown property: " + property); } ... } } } the properties map must contain properties corresponding configuration source (e.g. file provided user). , is, contains properties not exist ( service.pid , felix.fileinstall.dir , etc.), program broken. want rid of them somehow. tried use configurationadmin.getconfiguration.getproperties , blueprint cm-properties gives same effect. can't hardcode names of properties exclude, because don't know are. there means tell osgi runtime not put them @ in map? i'm doing using service

Find distance between ArMarker and camera in ArToolkit's android java SDK -

how calculate distance betweeen smartphone camera , artoolkit marker. tried transformation matrix of marker vector value zero. float [] pmatrix = artoolkit.getinstance().getprojectionmatrix(); float x = pmatrix[3]; float y = pmatrix[7]; float z = pmatrix[11]; x, y , z zero. i think looking @ wrong positions in matrix. camera x,y,z inside last column of transformation matrix: querymarkertransformation(int markerid); returns float array 16 values. values represent opengl style transformation matrix. first 4 values represent first column of matrix. i.e: float[16] = [0.24218401, 0.9598883, 0.14125957, 0.0, -0.8614648, 0.2801126, -0.42357886, 0.0, -0.44614935, -0.019116696, 0.8947546, 0.0, 23.678268, -6.4265084, -298.65326, 1.0] matrix looks like: 0.24218401 -0.8614648 -0.44614935 23.678268 0.9598883 0.2801126 -0.019116696 -6.4265084 0.14125957 -0.42357886 0.8947546 -298.65326 0.0 0.0 0.

java - Test case in spring boot(mockmvc) not supporting Resttemplate -

i using mock mvc in test case , working fine (with out start full http server). if use resttemplate in service controller communicating service coming 'unknown host exception' while running test case. service spring boot application , registered in eureka server. my code this @autowired private resttemplate participantsresttemplate; string url = "http://account-micro-service/api/account/accounts.json"; resttemplate.exchange(url, httpmethod.post, body, string.class); 'account-micro-service' service name service registered in eureka server

javascript - How do I handle deletes in react-apollo -

i have mutation like mutation deleterecord($id: id) { deleterecord(id: $id) { id } } and in location have list of elements. is there better return server, , how should update list? more generally, best practice handling deletes in apollo/graphql? i not sure good practise style here how handle deletion of item in react-apollo updatequeries: import { graphql, compose } 'react-apollo'; import gql 'graphql-tag'; import update 'react-addons-update'; import _ 'underscore'; const scenecollectionsquery = gql ` query scenecollections { myscenes: selectedscenes (excludeowner: false, first: 24) { edges { node { ...scenecollectionscene } } } }`; const deletescenemutation = gql ` mutation deletescene($sceneid: string!) { deletescene(sceneid: $sceneid) { ok scene { id active } } }`; const scenemodifierwithstateanddata = compose( ..., graphql(deletescenemutation

django - How to Python Code on Interpreter Startup in Virtualenv? -

i want execute code after python interpreter has started. we use virtualenv , had file called sitecustomize.py got executed during interpreter start up. the sitecustomize.py part of our project. use django definition of term: small python module holds config , no code: django's definition of "project" unfortunately linux distros (ubuntu) provide global sitecustomize, , our per virtualenv sitecustomize not loaded. question how run python code on interpreter startup in virtualenv? this code should executed if interactive interpreter gets started. goal vs strategy i don't care if hook called "sitecustomize" or different :-) use usercustomize . on linux distros global sitecustomize exists, on not. this can lead confusing behaviour. no linux distro provides usercustomize. see site ... after this, attempt made import module named usercustomize, can perform arbitrary user-specific customizations, if enable_user_site true.

elasticsearch - Translog is too big on one of the nodes -

i have 2 nodes default configuration. @ node translog exceeding free space on server instance , it's more default value of 512mb (according https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules-translog.html ). due default configuration, translog must flushed , commited every 5 seconds.. isn't happens. , on first node , 1 shard (i have 5). why?

javascript - How to assign reassign checkbox ng-model on ng-repeat -

please me out. have checkboxes models defined. displaying checkboxes , using model set if checkbox selected or not. below code setting ng-model. loadvalues(obj) { vm.index = false; vm.create = false; vm.edit = false; vm.delete = false; vm.other = false; var plist = obj.functions; var currentmodule = obj.name; (var = 0; < plist.length; i++) { var currentitem = plist[i]; console.log(currentitem) if (currentitem.search("index") > 0) { vm.index = true; console.log(vm.index); } else if (currentitem.search("create") > 0) { vm.create = true; } else if (currentitem.search("edit") > 0) { vm.edit = true; } else if (currentitem.search("delete") > 0) { vm.delete = true; } else if (currentitem.search("other") > 0) { vm.other = true; } } } below check boxes. <tbody> <tr ng-repeat="item in list"> <td>

python - Retrieve list of training features names from classifier -

is there way retrieve list of feature names used training of classifier, once has been trained fit method? information before applying unseen data. data used training pandas dataframe , in case, classifier randomforestclassifier . based on documentation , previous experience, there no way list of features considered @ least @ 1 of splitting. is concern not want use features prediction, ones used training? in case suggest list feature_importances_ after fitting , eliminate features not seem relevant. train new model relevant features , use features prediction well.

c# - Linq query “where [column] in (list of values)” that return single value for each values? -

let have linq code (in linqpad): list<string> list = new list<string>(); list.add("1611080010"); list.add("1611080011"); list.add("wrongid"); var result = orders.asqueryable().where(y => list.contains(y.id)); // , yes ids string sample result.dump(); // display result in linqpad result.count(); // equal 2 is possible improve query force system return 1 element each of list element or throw exception? if have 3 values in list should have 3 values in result? on question: is possible improve query force system return 1 element each of list element or throw exception: var result = orders.asqueryable().singleordefault(y => list.contains(y.id)); singleordefault returns element of sequence, or default value if sequence empty; method throws exception if there more 1 element in sequence.

php - Doctrine DQL, using the IN statement with entities -

is in doctrine possible use in statement , pass list of entities parameter in statement? for example, with following relation: /** * @var \doctrine\common\collections\collection * * @orm\onetomany(targetentity="calendar", mappedby="education", cascade={"persist"}) */ private $calendar; i query like: select p education p p.calendar in (:calendar) an :calendar parameter array of entities. $query->setparameter('calendar', array($singleentity,$singleentity2)); but gives following error: near 'calendar in (:calendar)': error: invalid pathexpression. statefieldpathexpression or singlevaluedassociationfield you can use full entities in statement , dql like $query->select('p') ->from('education', 'p') ->where($query->expr()->in('p.calendar', ':values')) ->setparameter('values', array($singleentity,$singleentity2)); i have used before q

inheritance - Best practise for implementing multiple interfaces in C# -

i working within framework following: imyclass instance = session.getallobjectsoftype("imyclass")[0]; ilock lock = instance ilock; if(lock != null) { lock.lock(); instance.dosomething(); lock.unlock(); } isaveable saveable = instance isaveable; if(saveable != null) saveable.save(); for work have class myclass : imyclass, isaveable, ilock { } i reality have 8-15 interfaces need implement , need accessable casting main object. cleanest way implement this? looked facade patter, dont think can used here. based on comment: i hoping there better way obvious one. there lot of code going realisation the different interfaces, , ilock interface not need know isavebale functionalty. looking clean way not result in 1 class 5k lines of code , 200 public functions if want class implement interface class need inherit interface functionality injected , wrapped (aka facade). this cleanest way achieve goal of generic separate code classes isaveable,

php - How to override something from vendor laravel 5 -

i want override vendor\laravel\framework\src\illuminate\auth\password\databasetokenrepository.php i tried user model in app folder.. not working.. can tell me put it? so see vendor class. if want override functionality of class can applying method overriding. extends class wan't override, redefine function want override in class. now, can use own class whenever need instead of vendor class. for example: class tokenrepo extends databasetokenrepository{ //define functionality here ovrride } usages: $token = new tokenrepo();//instead of original databasetokenrepository

delphi - Remove highlight in RichEdit -

i using following code highlight selection of text in richedit. procedure taformatmain.bthighlighttextclick(sender: tobject); const acolor = clyellow; var format: charformat2; begin fillchar(format, sizeof(format), 0); format begin cbsize := sizeof(format); dwmask := cfm_backcolor; crbackcolor := acolor; ried.perform(em_setcharformat, scf_selection, longint(@format)); end; ried.selstart := ried.selstart + ried.sellength; end; can tell me how remove highlight or colour value "no colour" (equivalent no colour in microsoft word) be. not find relevant information topic on net. to rest background color set: format.dweffects := cfe_autobackcolor; format.dwmask := cfm_backcolor; see also: charformat2 structure

java - Difference between wildcard type vs bounded type -

this question has answer here: java generics (wildcards) 6 answers what difference between bounded wildcard , type parameters? 2 answers public static void main(string args[]) { list<double> doublelist = new arraylist<>(); doublelist.add(new double(101.215d)); doublelist.add(new double(102.215d)); doublelist.add(new double(103.215d)); printintvalue1(doublelist); system.out.println("*******"); printintvalue2(doublelist); } //bounded parameter public static <t extends number> void printintvalue1(list<t> list){ for(t num : list){ system.out.println(num.intvalue()); } } //wildcard parametr public static void printintvalue2(list<? extends number> list){ for(number num : list){ system.

How to invoke multiple python scripts from the same Process in C# -

i working on project involves executing python scripts c# (ironpython not option). trying increase speed of execution whilst running many scripts. far, have managed increase performance running each process in task in order parallelise work. is possible add several scripts instantiated process, , run them in order reduce overhead of creating many new processes , reuse existing ones? figured creating of these new processes massive bottleneck. thanks

sdk - android: how to obtain a user trusted private key from app -

i wondering if there's chance read programmatically private key android's keystore/keychain (installed user via settings–security–install sd card ) app itself? the purpose sign data key serve server afterwards.

Can you login an agent with Asterisk ARI -

i'm trying build agent app can have agent controls (login, logout, pause...etc). see asterisk 13 has ari. know how can send agent commands using ari, possible? yes, can originate action. in created call can asterisk app, including agentlogin

spring - Java web application need to refresh to "see" resource files -

i'm working on web based application spring mvc , thymeleaf. have form upload image. decided save images in src/main/resources/static/images/ , works perfect. found issue upload. when save new image , try display in html it's working. when refresh images folder sts , refresh page works fine. can give me advice why happening , there way fix it? know can use java code image content , display resource use thymeleaf's el. display image @{/images/imagename.jpg} best regards, peter the thing is, if resources within web app, won't able display , change @ will. when refresh images folder on sts, "redeploys" resources , can see images. what need put static/images folder outside web app, you'll able upload new image , have displayed on web app

angularjs - Self removable directive in angular JS -

i'm trying create application allow me append , destroy repeatable elements, encounter problem. firstly here directive append elements: myapp.directive("addwatcher", function($compile){ return function(scope, element, attrs){ element.bind("click", function(){ angular.element(document.getelementbyid('watchers-space')).append($compile("<watcher></watcher>")(scope)); }); }; }); and contains div-button: <div ng-click="remove()">x</div> and of course here watcher directive: myapp.directive('watcher', function() { return { controller: function($scope, $element, $attrs, $transclude) { $scope.remove = function() { $element.remove(); } }, templateurl: 'watcherdirective.html' }; }); the problem can add many of "watchers" can remove last 1 added, , firstly created

linux - aws server dies, status check fails -

this second time happens me. my aws server, dies, no notifications, can't ssh it, nothing. only after restart it, can ssh , goes normal. i check there faq page: http://docs.aws.amazon.com/awsec2/latest/userguide/troubleshootinginstances.html and nothing there, @ logs attached below, , still nothing... ideas? begin: loading essential drivers ... done. begin: running /scripts/init-premount ... done. begin: mounting root file system ... begin: running /scripts/local-top ... done. begin: running /scripts/local-premount ... done. [ 2.576125] ext4-fs (xvda1): info: recovery required on readonly filesystem [ 2.579775] ext4-fs (xvda1): write access enabled during recovery [ 2.644278] ext4-fs (xvda1): orphan cleanup on readonly fs [ 2.647386] ext4-fs (xvda1): 2 orphan inodes deleted [ 2.650239] ext4-fs (xvda1): recovery complete [ 2.657120] ext4-fs (xvda1): mounted filesystem ordered data mode. opts: (null) begin: running /scripts/local-bottom ... don

How can I find the alphabetically last filepath in whole filesystem? -

finding first filepath seems easy task, $ sudo find -s / -type f -print -quit /.ds_store but how can find last 1 quickly? $ sudo find -s / -type f -print | tail -n1 ^c this command takes time do.

Remove transparent space from a png image while merging with another png image using PHP GD -

Image
i merging 2 png images in php code using php-gd. images getting merged, problem there transparent space in image want remove. here php code. <?php $image1url = "/home/sunpure-refined-sunflower-oil-v-5-ltr-1.png"; $image2url = "/home/hypercity-every-day-sooji-rawa-v-1-kg-6.png"; $dest = imagecreatefrompng($image1url); $src = imagecreatefrompng($image2url); $offset2x = imagesx($src); $offset3x = imagesx($dest); $temp = imagecreatetruecolor($offset2x + $offset3x, 140); $background = imagecolorallocate($temp, 0, 0, 0); imagecolortransparent($temp, $background); imagecopymerge($temp, $src, 0, 0, 0, 0, 180, 180, 100); //have play these numbers work you, etc. imagecopymerge($temp, $dest, $offset2x-50, 0, 0, 0, 180, 180, 100); header('content-type: image/png'); imagepng($temp, "/home/myimage.png"); imagedestroy($dest); imagedestroy($src); in rightmost image, trying remove space between them , due transparent space, not happening.

VLOOKUP Text that is not unique - Excel -

i trying vlookup (bring back) products yes, first result keeps coming because vlookup gets stuck on first piece of data. i using more data range below please see below example. a1 = yes b1 = product 1 a2 = yes b2 = product 2 a3 = yes c3 = product 3 =vlookup("yes",$a$1:$c$3,2,false) it works if take out $ signs repeat values. i guessing needs different function unsure use. thanks ian check this link , understand how formula works. in example, put formula cell d2 , press ctrl+shift+enter , fill down using mouse: =iferror(index($b$1:$b$12, match(0,if("yes"=$a$1:$a$12,countif($d$1:d1, $b$1:$b$12),""), 0)),"")

c#.net remote powershell for iis -

hi have following bit of code //set exchange server name var exchangesrv = "ex1.iah.ac.uk"; // initialize powershell engine var shell = powershell.create(); // add script powershell object shell.commands.addscript("invoke-command -computername hostname.example.com -scriptblock{get-alias}"); // execute script var results = shell.invoke(); input.datasource = results; input.databind(); so want invoke power shell command , "input" list box object populating but when run on iis server not work, think because iis application not running account admin on remote server trying run command against. can 1 resolving this. how can webpage call invoke command right credentials? edit decided create profile on web server means when account using opens power-shell exchange module loaded. don't see loading when using following code using (var powershell = powershell.create())

java - Android, how to initiate realm in AsyncTask? -

i have asynctask in application below. have fetch data realm(which stored in activity) asynctask. below asynctask code: public class makeasyncrequest extends asynctask<object, string, makeasyncrequest.responsedatatype>{ public context asynccontext; private makeasyncrequest(context context){ asynccontext = context; } private static final okhttpclient client = new okhttpclient(); private static final mediatype json = mediatype.parse("application/json; charset=utf-8"); private makerequest.responsehandler handler; private string method; private user user; private realm realm; class responsedatatype { inputstream inputstream; string string; string cookie; } makeasyncrequest(makerequest.responsehandler responsehandler, string type) { method = type; handler = responsehandler; } @override protected responsedatatype doinbackground(object... params) { try { requests requests = new requests((context) params[0]);