Posts

Showing posts from September, 2013

sapui5 - UI5 Generic Tile with filter functionality -

i have generic tiles in ui5 app. requirement implement functionality of icon tab bar - filter ( https://sapui5.hana.ondemand.com/explored.html#/sample/sap.m.sample.icontabbar/preview ) these tiles. have separate tile each status , on clicking should display list in table depending on clicked status eg: 'completed tickets'. table , tiles in different views. if possible please provide suggestions how can accomplished. thanks, srinivasan you follow example of icontabbar literally, , swap icons tiles. when press icon in icontabbar in example, logic connected icon add filter binding of table. should same: logic connected tiles, should change filter of table binding. every tile result in different filter binding. that, see table filtered based on tiles clicked. with table being in different view tiles, may want use router communicate between 2 views. e.g. have tile 1 navigate /yourapp/#/stuff/filterbysomething , tile 2 navigate /yourapp/#/stuff/filterbysomething...

sql - How to select columns of different lengths -

i have table of part numbers along many of properties such: [part number] [type] [manager] [cat. code] [etc...] aaa-001 dave 123 ddd-008 d chris 153 bbb-003 b dave 254 ccc-008 c dave 153 ... i'm trying make list of unique values of each property looks more this: [type] [manager] [cat. code] [etc...] dave 123 b chris 153 c 254 d however whenever try using select distinct * or like, fills columns they're same length longest one, filled horizontally according original table: [type] [manager] [cat. code] [etc...] dave 123 b dave 254 c dave 153 d chris 153 how stop happening, , keep unique values of each column, if might different lengths? i think you've misunderstood distinct does. filter results rows returned unique, not each column. depending columns named in select, you'll di...

mysql - how to handle white spaces in sql -

i want write sql query fetch students live in specific post code. following query. select * `students` ss ss.`postcode` 'se4 1na'; now issue in database records saved without white space postcode, se41na , may in lowercase, se41na or se4 1na . the query gives me different results based on how record saved. there way in can handle this? using regexp 1 way it. performs case insensitive match default. select * students ss ss.postcode regexp '^se4[[:space:]]?1na$'; [[:space:]]? matches optional space character. regexp documentation mysql

kettle - Pentaho PDI: row listener for remote transformations -

i know how implement row listener local transformation using java ( http://wiki.pentaho.com/display/eai/executing+a+pdi+transformation ). since not spoon ui nor carte api provide mechanism continuous preview of data running on remote slave, i've tried implementing same mechanism using plain java. however, no available method seems return stepinterface when attaching slaveserver object: kettleenvironment.init(); slaveserver ss = new slaveserver("java", "192.168.200.63", "23346", "cluster", "cluster"); slaveservertransstatus state = ss.gettransstatus(transmetaname, carteobjectid, 0); is there way of getting stepinterface reference remote carte server in order attach row listener ? if not, there way of having preview of rows remote transformations running on carte server ?

c++ - Visual Studio C++11g compilation error - too many initializers -

i trying compile following source code using visual studio 2012 professional , getting compilation errors. same code working in visual studio 2013. when check vs 2012, supports of c++ 11 features. program built using c++ 11 compliant compiler. found program http://lucid-motif.blogspot.com/2013/11/coding-puzzle-knight-sequences.html ? typedef enum { _a,_b,_c,_d,_e,_f,_g,_h,_i,_j,_k,_l,_m,_n,_o,_1,_2,_3 } tkeyidentity; typedef std::vector<tkeyidentity const> tkeypath typedef std::vector<tkeypath const> tkeymap; const tkeymap keypad = { { _h, _l }, // { _i, _k, _m }, // b { _f, _j, _l, _n }, // c { _g, _m, _o }, // d { _h, _n }, // e { _c, _m, _1 }, // f (_1) not valid 2 moves followed 1 move rule { _d, _n, _2 }, // g { _a, _e, _k, _o, _1, _3 }, // h { _b, _l, _2 }, // { _c, _m, _3 }, // j (_3) not valid 2 moves followed 1 move rule { _b, _h, _2 }, // k { _a, _c, _i, _3 }, // l { _b, _d, _f, _j }, // ...

How to have multiple cache manager configuration in spring cache java -

i want have multiple spring cache managers configured in web-application , able use different cache manager @ various places in project. there way this. there several ways can , right answer depends on usage of cache. you have "main" cache manager if use cachemanager 90% of use case , b 10% i'd advise create default cachemanager (you'll need specify via cacheconfigurersupport extension), like: @configuration @enabllecaching public class cacheconfig extends cachingconfigurersupport { @override @bean // not strictly necessary public cachemanager cachemanager() { ... cachemanager } @bean public cachemanager bcachemanager() { ... cachemanager b } } then 10% use case add cacheconfig @ top of classes need use other cache manager @cacheconfig(cachemanager="bcachemanager") public class myservice { ... } if need use other cache manager 1 method, can specify @ method level well @cacheable(cachenames = "books...

networking - SonarLint low performance on network share -

when sonarlint analsysis done on network performance bad. have local eclipse installation, sonarlint analysis. there performance good. when same analysis done eclipse starts network share , eclipse workspace on network share performance 20 times slower. a sonarlint analysis lot of i/o, that's expected. nevertheless, performance being improved you'll experience better analysis times future versions.

java - Spring tool suite Refactoring issue with Spring Roo annotations -

i error in spring tool suite when trying push in spring roo code via refactor -> push in. idea wrong/forget? package net.javavideotutorials.example; import javax.persistence.entity; import org.springframework.roo.addon.javabean.roojavabean; import org.springframework.roo.addon.jpa.activerecord.roojpaactiverecord; import org.springframework.roo.addon.tostring.rootostring; @roojavabean @rootostring @roojpaactiverecord public class users { private long id; private string username; private string password; } see log file: !entry org.eclipse.ltk.ui.refactoring 4 10000 2016-07-25 16:17:51.781 !message internal error !stack 0 java.lang.reflect.invocationtargetexception @ org.eclipse.jface.operation.modalcontext.run(modalcontext.java:398) @ org.eclipse.ltk.internal.ui.refactoring.refactoringwizarddialog2.run(refactoringwizarddialog2.java:319) @ org.eclipse.ltk.ui.refactoring.refactoringwizard.internalperformfinish(refactoringwizard.java:636) @ org...

Angular 2 ngSwitch nested in ngFor -

what correct way use ngswitch within ngfor ? if following receive error got interpolation ({{}}) expression expected <span *ngfor="let action of actions"> <span [ngswitch]="{{action}}"> <span *ngswitchcase='edit'>edit</span> <span *ngswitchcase='delete'>delete</span> </span> </span> in bindings (...) or [...] don't need interpolate variable string, can use bind it. <span [ngswitch]="action">

Dynamic groups based on ip range in Ansible groups -

how create variable group based on ip address-range in ansible inventory groups ? have 2 groups of servers in different location. want create groups every time playbook playbook run on updated list of servers. groups based on distribution, prod, dev, test, qa ,dr in host inventory. thanks in advance you can scan hosts @ beginning , group them how want, e.g. network: - hosts: tasks: - group_by: key=network_{{ ansible_default_ipv4.network }} this create many groups names network_<network> many different networks have. keep in mind need gather facts hosts, depending on count of hosts , speed of connections can require significant time. facts caching speed things, anyway... if manage inventory file hand, consider manually specifying regional groups well.

c - Sending Login Details Using URL -

Image
i attempting automate process. have setup webpage basic security: i want automate ability log in. same username/password combination used each time, there hundreds of ip addresses in use, tedious use password safe programme. i wondering if can use in form of url.com/?username=user&password=pass push password through security, without having manually enter details each time? this worked me http://username:password@url.com . note: using on secure network save time, not recommend used outside of controlled environment.

javafx - Installing plugins for Eclipse offline -

i want install e(fx)clipse eclipse neon, eclipse running on machine not have internet access. there way can manually download plugin , install eclipse? to clarify: have access internet on machine can use transfer files onto machine eclipse. you can download update-site zip modifying update site adress last part site_assembly.zip example : http://download.eclipse.org/efxclipse/updates-released/2.4.0/site becomes http://download.eclipse.org/efxclipse/updates-released/2.4.0/site_assembly.zip change version number if need other one and use zip install plug-in ( help > install new software > add ) instead of adding update site url select zip , give zip download see this answer part 2 screenshot :

c# - How do I reference a class in MyScripts from within another namespace (Unity)? -

i using unity 5.3.5. have script wrote under unity assets/myscript folder. scripta.cs public class scripta : monobehaviour { //code here public static bool flag_i_want_to_reference; } then, because using unity standard asset vehicle/car thing, in separate namespace in different folder path (i.e. not in myscripts folder in different path under assets ) somecarscript.cs namespace unitystandardassets.vehicles.car { public class somecarscript : monobehaviour { //code here bool foo = scripta.flag_i_want_to_reference; } } now, have bool want reference within somecarscript.cs getting error the name 'scripta' not exist in current context i trying figure out class/reference need have using statements on top of somecarscript.cs script make work. have tried looking global namespaces , tried global::scripta.flag_i_want_to_reference , global::flag_i_want_to_reference doesn't work. have tried using "assets/myscripts/sc...

html - Add contact details to header.php Wordpress -

i'm trying add contact details right of logo on this site . at moment displaying beneath logo. i'd change font , colour match nav bar. here's code header.php show did site. i'm aware laura (the owner) should using child theme husband built site , has done lot of work without child building 1 one change seems redundant? <!doctype html> <html <?php language_attributes(); ?> class="no-js" > <!-- start --> <head> <meta charset="<?php bloginfo( 'charset' ); ?>" /> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" /> <meta name="format-detection" content="telephone=no"> <!-- set faviocn--> <?php global $pmc_data; $favicon = ''; if(isset($pmc_data['favicon'])) $favicon = $pmc_data['favicon']; if (empty($favicon)) { $favicon = get_tem...

javascript - Change .text() content and keep child html -

can tell me how remove character @ span tag without changing child html(s)? $('button').click(function() { // ... }); #name { background-color: #ccc } <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <span> <span id="name"> <a href="#">harry</a> </span> says: hello @<span id="name"> <a href="#">hermione</a> </span> </span><br /> <button>remove</button> my idea: parent .text() , split character @ , override parent text ( parent.text('') ) , append 2 parts parent. way has big problem: child html(s) wouldn't kept. i've added id outer <span> , deduplicated name ids. $('button').click(function () { $('#outer').html($('#outer').html().replace(/@/,'')); }); #name { ...

javascript - Trying to get drop down option on Select using Class -

function() { return $('.category w-select option:selected').text(); } <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <select required="required" class="category w-select" name="categories"> <option value="" selected="selected">- please select 1 -</option> <option value="1">jewelry</option> <option value="2">luxury watch</option> <option value="3">precious metal or stones</option> <option value="4">electronics</option> <option value="5">tools, equipment</option> <option value="6">musical instruments, equipment</option> <option value="7">vehicle</option> <option value="8">gun</option> <option value="9">other</optio...

java - How to PUT multipart/form-data using Spring MockMvc? -

i have controller's method put method, receives multipart/form-data: @requestmapping(value = "/putin", method = requestmethod.put) public foo updatefoo(httpservletrequest request, @requestbody foo foo, @requestparam("foo_icon") multipartfile file) { ... } and want test using mockmvc . unfortunately mockmvcrequestbuilders.fileupload creates instance of mockmultiparthttpservletrequestbuilder has post method: super(httpmethod.post, urltemplate, urlvariables) edit: surely can i can not create own implementation of mockhttpservletrequestbuilder , say public mockputmultiparthttpservletrequestbuilder(string urltemplate, object... urlvariables) { super(httpmethod.put, urltemplate, urlvariables); super.contenttype(mediatype.multipart_form_data); } because mockhttpservletrequestbuilder has package-local constructor. but i'm wondering more convenient way this, may miss...

python - How can I use "metrics.mutual_info" in scikit's feature.selection -

i use other scoring functions chi2 etc., not listed on page. http://scikit-learn.org/stable/modules/feature_selection.html http://scikit-learn.org/stable/modules/classes.html for example metrics.mutual_info , metrics.balanced_accuracy_score how can integrate code? thanks help the new scikit-learn version 0.18, has added support mutual information feature selection. no need use metrics.mutual_info . can use new feature_selection.mutual_info_classif score function in selectkbest or selectpercentile use chi2 . x_new = selectkbest(mutual_info_classif, k=100).fit_transform(x, y) for more information resent changes @ changelog .

javascript - Stop Player Movement After Collision Detection In Canvas -

i made 2 walls in canvas. 1 in top , 1 @ bottom. player controlled mouse , wanted know how make player not go through walls. here's function general collision between 2 objects: function collides(a, b) { var val = false; val = (a.x < b.x + b.width) && (a.x + a.width > b.x) && (a.y < b.y + b.height) && (a.y + a.height > b.y); return val; } here's code detects collision detection: if (collides(player, block)){ //i don't know goes here. } any appreciated. reposition player , also clamp player's y position between top , bottom walls. in mousemove handler (or wherever player repositioned mouse): // reposition player ... // , clamp player stay below top wall if( player.y < wall.y+wall.height ){ player.y = wall.y+wall.height); // , clamp player stay above bottom wall if( player.y+player.height > wall.y ){ player.y = wall.y-player.height);

oracle - ORA-01422: exact fetch returns more than requested number of rows -

stuck error... declare avgruntime number(10,0); perfcategoryrangelocount number(10,0); perfcategoryrangehicount number(10,0); dw_low number(10,0); dw_hi number(10,0); cursor lc_abc select distinct(ap.dwprocessid) auditprocess ap, dwprocess d ap.dwprocessid = d.dwprocessid , ap.insertts > sysdate - 61 , dwprocessmonitorind = 'y'; begin rec in lc_abc loop select ((ap.lastupdatets - insertts)*24*60*60) avgruntime, (.1 * ((ap.lastupdatets - insertts)))as perfcategoryrangelocount , (1.9 * ((ap.lastupdatets - insertts)))as perfcategoryrangehicount avgruntime, perfcategoryrangelocount, perfcategoryrangehicount auditprocess ap ap.dwprocessid = rec.dwprocessid , insertts > sysdate - 61 group (ap.lastupdatets - insertts); [error][1] @ line 1 ora-01422: exact fetch returns more requested number of rows ora-06512: @ line 27 you grouping...

javascript - Jquery number counter for updates -

i have jquery functions. want make 1 function can thesame results calling function , passing arguements. as can see, function same thing counting numbers. love have 1 function , parse out arguments same results. startcount(arg1, arg2); var one_countsarray = [2,4,6,7,4252]; var two_countsarray = [3,3,4,7,1229]; var sumemp = one_countsarray.reduce(add, 0); var sumallis = two_countsarray.reduce(add, 0); function add(a, b) { return + b; } var count = 0; var intv = setinterval(function(){startcount()},100); var intv2 = setinterval(function(){startcount2()},100); function startcount() { if(count == sumemp) { clearinterval(intv); } else { count++; } $('.stats_em').text(count); } var count2 = 10; function startcount2() { if(count2 == sumallis) { clearinterval(intv2); } else { count2++; } $('.stats_iss').t...

android - Exclude Gradle @LargeTest -

i trying run unit test on separate task ui tests have within integration tests in android studio, unfortunately have use apply plugin: 'com.android.application' in build.gradle file cannot add custom test tasks far can tell. since ui tests tagged "@test" , extend instrumentationtestcase run whenever gradle connectedcheck is called not needed, instead want 1 gradle command run ui tests , 1 run unit tests. figured able leverage tagging ui tests largetests have not been able complete gradle task can this. not able use "test" task in build.gradle since using com.android.application plugin, , advice? thanks what ended working me adding the @largetest using import android.support.test.filters.largetest; annotation tests needed , adding following lines build.gradle if(!project.hasproperty('android.testinstrumentationrunnerarguments.annotation')) { testinstrumentationrunnerargument 'notannotation', 'andro...

javascript - Need jquery to search data on all pages and display rather than data only on page -

my issue when search on site using jquery searching on page displayed @ moment , search of data , display on page accordingly, 2.6 m entries. using core django paginator pagination , using simple jquery , ajax search tool. please help! heres view: def tissues(request): contact_list = tissuetable.objects.all() paginator = paginator(contact_list, 100) # show 25 contacts per page page = request.get.get('page') try: contacts = paginator.page(page) except pagenotaninteger: # if page not integer, deliver first page. contacts = paginator.page(1) except emptypage: # if page out of range (e.g. 9999), deliver last page of results. contacts = paginator.page(paginator.num_pages) return render(request, '.html', {'contacts': contacts}) heres 2 templates, base , home, base.html: <html> <head> <title>animal ngs data</font></title> <meta name="viewport"...

java - wrong directory structure maven archetype-webapp using intellij -

i new in intellij ide. want create maven-archetype-webapp peoject not create correct structure.why? i can't see same structure in link. http://javapointers.com/tutorial/creating-web-application-using-maven-in-intellij/ using intellij ide 14.0.1 assuming have installed , tested maven in local system. make sure using maven build project. can check following path. settings -> build, execution, deployment -> build tools -> maven -> maven home directory if not, change maven directory local 1 , try build again.(for directory name refer tutorial link maven windows installation).

angularjs - Angular show wrong time with unknown timezone -

flight.departure_at utc format 2016-05-04t19:00:00.000z when display expression in page, it's format totally out of expectation. why 12:00 come out? how come? i want know how keep time format in utc globally without adding options everywhere. make whole app vulnerable code departure_time: {{flight.departure_at}} ||| {{flight.departure_at | date: 'hh:mm'}} output departure_time: 2016-05-04t19:00:00.000z ||| 12:00 this standard called iso-8601 , format is: yyyy-mm-ddthh:mm:ss.sssz 't' separator between date , time in iso-8601 format. 'z' 0 time zone ( getting 12:00 , because convert timezone) we can use parse , var date = new date('2016-05-04t19:00:00.000z'); console.log(date.getutchours()); // hours - 19 console.log(date.getutcminutes()); //0 console.log(date.getutcseconds());// 0 console.log(date.parse(date)); console.log(new date(date.parse(date))); or date.parse(date) getting time in standard time form...

jquery - Uploading a zip file using POST in Javascript fails silently -

i working on web application (using jquery version 2.2.4) allows users submit images , data our server. when users decide upload submissions, code should generate zip file using jszip library , upload our server using post. after searching here on stackexchange, came code: var zip = new jszip(); // create object representing zip file // ...add data , images console.log('generating compressed archive...'); zip.generateasync({ compression: 'deflate', type: 'blob' }).then(function(zc) {// function called when generation complete console.log('compression complete!'); // create file object upload var fileobj = new file([zc], filename); console.log('file object created:', fileobj); $.post('http://myurl/submit', { data: fileobj, }).done(function() { console.log('ajax post successful.'); }) .fail(function(jqxhr, textstatus, errorthrown) { console.log('ajax post fail...

f# - How do I specify a type that shares a type definition with another type? -

how specify type shares type definition type? the following code not compile: [<test>] let ``move checker``() = { position={ x=1; y=1 } } |> moveblack northeast |> should equal { position={ x=2; y=2 } } this because record i'm passing moveblack function mapped redchecker instead of blackchecker. type mismatch. expecting redchecker -> 'a given blackchecker -> blackchecker type 'redchecker' not match type 'blackchecker' more likely, error occurs because last type have definition redchecker: type blackchecker = { position:position } type redchecker = { position:position } i thought specify black checker doing this: (blackchecker:{ position={ x=1; y=1 } }) and have: [<test>] let ``move checker``() = (blackchecker:{ { position={ x=1; y=1 } }) |> moveblack northeast |> should equal (blackchecker:{ { position={ x=2; y=2 }...

jdbc - Java Move to next and previous records -

with code below can move last record of database , first record of database. create next() method move next record. move first record second record show error(sqlexception result set after last row. can't continue project until can move records next , previous. pleas public void createresultset(){ try{ stmt = connect.createstatement(resultset.type_scroll_insensitive,resultset.concur_updatable); string sql = "select * oautoparts_product"; stmt.executequery(sql); rs = stmt.getresultset(); }catch(exception e){ joptionpane.showmessagedialog(null, e); } } public void first(){ createresultset(); try{ rs.first(); string add1 = rs.getnstring("product_id"); txtpartnumber.settext(add1); string add2 = rs.getnstring("product_name"); txtpartname.settext(add2); string add3 = rs.getnstring("cost"); txtpric...

pycharm - Intellij adding remote host: Session.connect: java.net.UnknownHostException -

i want use sftp connect working machine available through vpn. i'm not able establish connection inside pycharm (intellij python), instead error. first, checked can connect host ssh , it's ok (and sftp on filezilla working same parameters , credentials). in pycharm get: connection <hostname> failed. session.connect: java.net.unknownhostexception: <hostname> i've tried use ipv6 address of server. time error is java.net.socketexception: protocol family unavailable while again ssh , filezilla ok. any suggestions? ok, bug documented: https://youtrack.jetbrains.com/issue/wi-26878 the temporary solution (below given webstorm, other ides need replace name/version) cp /applications/webstorm.app/contents/bin/webstorm.vmoptions ~/library/preferences/webstorm10/ vim ~/library/preferences/webstorm10/webstorm.vmoptions and add following lines file: -djava.net.preferipv4stack=false -djava.net.preferipv6addresses=true

php - JQUERY when user types too quickly -

i working on search system , here html code <input type="text" class="searchchats" placeholder="search"> <div class="resc"> </div> and jquery/ajax code $(".searchchats").keyup(function(e) { var val=$(this).val(); if (e.which >= 47 && e.which <= 90 || e.which==8){ if (val!="") { $(".resc").empty(); $(".resc").show(); $.ajax({ url: '../files/connect.php', type: 'get', cache: false, contenttype: false, processdata: false, data:"scts="+val, success: function(ret) { $(".resc").append(ret); } }); $(".overviewrap").hide(); }else{ $(".resc").hide(); $(".overviewrap").show(); } } }); and connect.php if ...

java - IllegalStateException when trying to parse JSON Feed with retrofit -

i'm trying display feed cardviews in recyclerview using json , retrofit library. have been working on problem 4 hours , 1 hour searching google now, still, no success. no matter try following error: d/error: java.lang.illegalstateexception: expected begin_object begin_array @ line 1 column 2 path $ d/error: java.lang.illegalstateexception: expected begin_object begin_array @ line 1 column 2 path $ json example php api: [{"id":"143","uploadid":"36","type":"excellent","userid":"58","username":"doitlikeaves","date":"31 may","timestamp":"2016-05-31 22:37:50","title":"ph zusammenfassung #2","subject":"physik"},{"id":"142","uploadid":"36","type":"presentation","userid":"58","username":"doitlikeaves"...

c# - How to enforce FIPS in asp.net code (This implementation is not part of the Windows Platform FIPS validated cryptographic algorithms.) -

my company has project created asp.net in .net framework 3.5 , windows web server 2008 r2 host project. in web server, enabled setting "system cryptography: use fips compliant algorithms encryption, hashing, , signing" after after application not run. shows following error parser error message: implementation not part of windows platform fips validated cryptographic algorithms. stack trace: [invalidoperationexception: implementation not part of windows platform fips validated cryptographic algorithms.] system.security.cryptography.rijndaelmanaged..ctor() +7715396 system.web.configuration.machinekeysection.configureencryptionobject() +232 system.web.configuration.machinekeysection.ensureconfig() +156 system.web.configuration.machinekeysection.getencodeddata(byte[] buf, byte[] modifier, int32 start, int32& length) +37 system.web.ui.objectstateformatter.serialize(object stategraph) +166 system.web.ui.objectstateformatter.system.web.ui.istatefo...

Stripe API recurring payments with Php -

i'm using stripe api 1 time payments, works fine using like: $stripe = array("secret_key" => "my_secret_key", "publishable_key" => "my_publishable_key"); stripe::setapikey($stripe['secret_key']); try { $charge = stripe_charge::create(array( "amount" => round($_post['amount'] * 100, 0), "currency" => "usd", "card" => array( "number" => 111111111111111111, "exp_month" => 10, "exp_year" => 2017, "cvc" => 321, ), "description" => $_post['item_name'])); $json = json_decode($charge); $amount_charged = round(($json->{'amount'} / 100), 2); //process payment here...... } catch (stripe_carderror $e) { $body = $e->getjsonbody(); print j...

mysql - How combine dbSendQuery with values from DataFrame in R? -

i'm looking way include data r dataframe in sql predicate. ideally, i'd use dbsendquery rmysql package send query database contains where ... in conditions includes values database. possible? example data frame bur lax lgb example query select * table airport in ('bur', 'lax', 'lgb') is there way "pass" rows of data frame query? might not possible, i'm interested know. i typically create "format" string, sub in values using sprintf , paste below: qformat <- "select * table airport in (%s)" vals <- c("bur", "lax", "lgb") qstring <- sprintf(qformat, paste0("\"", vals, "\"", collapse = ",")) cat(qstring) # select * table airport in ("bur","lax","lgb") if have lot, wrap messy part in function: somefunc <- function(x) paste0("\"", x, "\"", collapse = ...

java - Map inside map iteration -

i have following nested map defined in class: private map<string, map<string, string>> messagesbyfacttypeandcategory; public void setmessagesbyfacttypeandcategory(map<string, map<string, string>> messagesbyfacttypeandcategory) { this.messagesbyfacttypeandcategory = messagesbyfacttypeandcategory; } public map<string, map<string, string>> getmessagesbyfacttypeandcategory() { if (messagesbyfacttypeandcategory == null) { return maps.newhashmap(); } return messagesbyfacttypeandcategory; } i'm trying unable traverse messagesbyfacttypeandcategory map , data inside display in console. below code tried far: map<string, map<string, string>> newmap = executionresult.getmessagesbyfacttypeandcategory(); set set = newmap.entryset(); iterator iterator = set.iterator(); while(iterator.hasnext()) { map.entry mentry = (map.entry)iterator.next(); system.out.print("key is: "+ mentr...

c# - CRM Dynamics plugin code issue 2015 -

i'm trying create plugin microsoft crm dynamics 2015 (version 7.0.2), it's not working. plugin run when case created , attemp recover contract information account. i have following code, it's not working(contract information not saved on case/incident). edit i update code, fails, doesn't give clear error on system job or when debug using plugin registration tool. system job error message: system.servicemodel.quotaexceededexception: microsoft dynamics crm has experienced error. reference number administrators or support: #1c10449a debuging visual studio , plugin registration tool goes until tries call update method, says incident not exist, since syncrhonous plugin incident not created(only way log able debug found). public class casecontractfill : iplugin { contract checkforcontract(guid accountid, iorganizationservice service) { queryexpression accountcontractquery = new queryexpression { entityname = contract.entity...

javascript - Form Validation Jquery object -

i trying format phone number field based on country .the logic works fine when user fill in details not work when country changed , filled in again. ex: filled in form germany , without reloading page if try change county , fill in phone "+" being added though format different. $(document).ready(function($){ $('#country').on('change', function() { if ( this.value == 'us' || this.value == 'ca') { $('#c_busphone') .keydown(function (e) { var key = e.charcode || e.keycode || 0; $phone = $(this); if (key !== 8 && key !== 9) { if ($phone.val().length === 4) { $phone.val($phone.val() + ')'); } if ($phone.val().length === 5) { $phone.val($phone.val() + ' '); } if ($phone.val().length === 9) { $phone.val($phone.val() + '-'); ...