Posts

Showing posts from August, 2014

validation - How do I suppress jQuery warnings for invalid email address? -

i'm using jquery 2.2.0, , css targeting i'm updating value attribute equal value of input on input events. using type of "email" results in jquery warning in console every time event fires, unless it's valid email. warning shows when updating value attribute directly. the specified value "foo" not valid email address. -> jquery.min.js:3 is there way temporarily suppress or disable warning? open console , input rendered snippet below see. $('input').on('input', function () { $(this).attr('value', $(this).val()); }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script> <input type="email"> that's not jquery warning html5. when put invalid email value <input type="email" value="a"> it's gonna throw warning because not valid email address. so said function forcing put introduced

java - How to use QueryDslPredicateExecutor? -

spring-data offers querydslpredicateexecutor , imports following statements: import com.mysema.query.types.orderspecifier; import com.mysema.query.types.predicate; the normal querydsl library be: <dependency> <groupid>com.querydsl</groupid> <artifactid>querydsl-core</artifactid> <version>4.1.3</version> </dependency> but in order make spring class work, i'd have use following one: <dependency> <groupid>com.mysema.querydsl</groupid> <artifactid>querydsl-core</artifactid> <version>3.7.4</version> </dependency> question: what's difference between them, , why have use different (unofficial??) dependency? com.querydsl root package querydsl 4.* , com.mysema.query root package querydsl 3.*. new versions of "spring data commons" use new root package. here link github commit

boolean - Can I use OR instruction between A and B registers in HC12 (Assembly) -

i give me guidance on how make program takes 2 8 data bits stored in memory, take significant part of 1 them , least significant of other , save result. example: data 1: 19 data 2: 3a result: 1a for moment i've done this. -step 1. registers , b used store data of 8 bits. -step 2. use instruction anda first 8-bit value in register a. -step 3. use andb instruction second 8-bit value in register b. but don't know how use or concatenate or b. thanks in advance!! if in step 2, , mask extract msb, , in step 3 , b mask lsb, can "or" , b using "aba" instruction. while aba technically add, when "add" bit x 0 bit, x. since corresponding bits in , b zeroed, aba acts or. alternatively, can store b register page 0 cell, , or cell register. clumsy clear. if aren't conscious code space or time, might choose solution clarity; aba solution isn't obvious unless think it. (most people doing serious coding machine ar

ASP.NET MVC Displaying multiple partial views inside a folder -

i have mvc application broken down multiple areas. structure this: areas > areaname > views > various view folders i need add folder inside these view folders called helpfiles making structure areas > areaname > views > various view folders > helpfiles in layout page, have icon when clicked, call controller method return partial views inside helpfiles folder , display them inside div. what have done far: have added method basecontroller this: public actionresult showhelptext(string viewname) { var areaname = controllercontext.routedata.datatokens["area"]; var foldername = "~"+ areaname + viewname + "helpfiles/"; viewbag.partials = ???? return view(); } on returning view code this: @foreach (string partial in viewbag.partials) { //html.renderpartial(partial); @html.partial(partial) } my problem not able figure way views folder. i realize not i

c++ - OpenGL Uniform Functions - Why so many? -

why there many functions set uniforms? gluniform1f gluniform2f gluniform3f gluniform4f gluniform1fv gluniform2fv gluniform3fv gluniform4fv gluniform1i gluniform2i gluniform3i gluniform4i gluniform1iv gluniform2iv gluniform3iv gluniform4iv gluniform1ui gluniform2ui gluniform3ui gluniform4ui gluniform1uiv gluniform2uiv gluniform3uiv gluniform4uiv gluniformmatrix2fv gluniformmatrix2x3fv gluniformmatrix2x4fv gluniformmatrix3fv gluniformmatrix3x2fv gluniformmatrix3x4fv gluniformmatrix4fv gluniformmatrix4x2fv gluniformmatrix4x3fv i think way data uploaded vertex , element buffers waaay better, since don't have call different function different type. why case uniforms? there possibility use 1 function, can pass pointer? hindsight 20/20 , choice done in line other functions take vectorial data in various types , dimensionality. i'm referring glvertex… of course. initial reason pass value was, on architectures there enough

Regex Expression to allow comma only inside a string (within quotes)and not outside it -

i kind of new regex. looking regex expression add constraint not allow comma outside string . my input "1,212121,121212","extra_data" here regex expression should not check comma in first value within quotes "1,212121,121212" should check after quotes including ,"extra_data" . in short expression should allow comma in string inside quotes , not outside. kindly me expression. i think you're looking for, group of numbers or commas surrounded parentheses followed comma , phrase (not numbers) in parentheses. capturing group #1 gives "1,212121,121212" , capturing group #2 gives ,"extra_data" ("[\d,]+")(,"[^"]+") it helpful see more of how input might come in. think biggest question remains whether first group contain numbers/commas, or there other characters such letters, underscores, etc in first group? if first group contains numbers, i've assumed, should work. if

java - Convert escaped Unicode character back to actual character -

i have following value in string variable in java has utf-8 characters encoded below dodd\u2013frank instead of dodd–frank (assume don't have control on how value assigned string variable) now how convert (encode) , store in string variable? i found following code charset.forname("utf-8").encode(str); but returns bytebuffer , want string back. edit : some more additional information. when use system.out.println(str); dodd\u2013frank i not sure correct terminology (utf-8 or unicode). pardon me that. try str = org.apache.commons.lang3.stringescapeutils.unescapejava(str); from apache commons lang

sql - How to display records from a table ordered as in the where clause? -

i trying display records,order in clause.. example: select name table name in ('yaksha','arun','naveen'); it displays arun,naveen,yaksha (alphabetical order) want display same order i.e 'yaksha''arun','naveen' how display this... using oracle db. add order by @ query's end: order case name when 'yaksha' 1 when 'arun' 2 when 'naveen' 3 end (there's no other way order. need order specific result set order.)

php - Laravel Model Observer handle events outside Laravel -

i new laravel , working on system. right system divided 2 parts, 1 of in core php , other re-coding in laravel. want trigger action when db operation happens , understand can done using laravel model observers. but in case, event generator wouldn't laravel, core php code , want handle triggers in laravel. possible? any , guidance on same nice.

javascript - google map direction with multiple directions with colors -

i need populate following data on map direction dataset 1 [ [lat, lon], [lat, lon], [lat, lon], ], dataset 2 [ [lat, lon], [lat, lon], [lat, lon], ], on ... all data sets should have route unique color data set can exceed 8 waypoints limit. able fix 8 way points limit following online tutorials https://lemonharpy.wordpress.com/2011/12/15/working-around-8-waypoint-limit-in-google-maps-directions-api/ , plotting more 8 waypoints in google maps v3 . but found no way different colored route each datasets. this code <style> #map { height: 1080px; width: 100%; border: 1px solid #000; } </style> <div id="map"></div> <script> function initmap() { //console.log("sdsfsd"); map = new google.maps.map(document.getelementbyid('map'), { zoom: 14, center: {lat: 28.6247, lng: 77.3731}, disabledefaultui:true,

java - Netezza Streaming ResultSet -

i having memory issues because trying read huge resultset netezza database. netezza support kind of "streaming" resultset mysql does? if not, limiting fetch size work instead?: stmt.setfetchsize(50); conn.setautocommitmode(false); if want pull rows store in file, best best use remote external table. here example creates transient remote external table on jdbc. invoke bulk export/load funciontality provided jdbc driver, , create pipe delimited text file. create external table 'c:\mytest.txt' using (delimiter '|' remotesource 'jdbc' ) select * table1; you can call using conn.createstatement().execute, , have add change file specification c:\mytest.txt escape existing backslash. you can read more external tables in documentation here . you can use setfetchsize, way. i'm not sure solve memory issue though.

Python multiplying every dictionary value by single number -

i know question has been asked before having difficult time following examples previous answers code work. have dictionary 12 keys, each having size of 102. want multiply every value in each key single number. following these examples ( python: perform operation on each dictionary value ) here have tried: my_data.update((x , y*1e6)for x, y in my_data.items()) this returns error "can't multiply sequence non-int of type 'float'. if change number float number (1e6 2) doubles size of each key. i tried one: for key in my_data: my_data[key] *= 2 all double size of each key (102 204). can multiply individual key desired number so: my_data['ap_33.txt_dose'] = [x * 1e6 x in my_data['ap_33.txt_dose']] edit: it requested show my_data looks like. i'm not sure how best display importing data 12 different text files dictionary. each name though (key_1, key_2, etc.) , each key has 102 float values (0, 2.88e-9, 9.6e-9, etc.) your va

Send icq message via php -

i need send message icq php. i`m using webicqpro. <?php require_once('webicqpro.class.php'); $uin = '******'; $pass = '******'; $to_uin = '******'; $icq = new webicqpro(); $icq->debug = true; $icq->setoption('useragent', 'miranda'); if ($icq->connect($uin, $pass)) { $icq->sendmessage($to_uin, 'hello! test message'); } else { die('icq connection error: ' . $icq->error); } this code fails error: error: server close connection p.s.: maybe there other working icq classes? increase limits. edit file "webicqpro.class.php": // $this->settimeout(6, 0); $this->settimeout(60, 60000);

sql - is there a way to check if a value is zero and do this or do that in mysql -

i want sql query select * members m abs(due/30*service_charge)>='0' , abs(due/30*service_charge)<='200' group id but in cases value of service_charge 0 , want write if service_charge = 0 , service_charge = 1; is there way ?. use case : select * members m abs(due/30*(case when service_charge = 0 1 else service_charge end) >= 0 , abs(due/30*(case when service_charge = 0 1 else service_charge end)<= 200 group id; however, typically handled using nullif() -- meaning null returned calculation: select * members m abs(due / 30 * nullif(service_charge, 0) >= 0 , abs(due / 30 * nullif(service_charge, 0) <= 200 group id; also, don't use single quotes around numeric constants. confuses people , confuse sql optimizer.

single sign on - JASIG CAS support for linking third party IDPs like Google, Facebook etc -

we have local credentials enable our users use credentials other providers. ie click "login google" ask if want link local account. this seems quite common requirement. need add myself cas? i see people have done similar things, use jasig cas délégation 2 idp (adfs or others) , seems not small amount of work implement ui link/unlink third party authentication. any nice off shelf code use (and with)? cheers sam no called delegated authn in cas: http://jasig.github.io/cas/4.1.x/integration/delegate-authentication.html supported since 3.5

php - Parent entity type bundle - Is it possible in D8? -

issue: got 7 different (article-like) node types. these types share 90% of fields (means have same field base same configured field instance). problem: when new mutaul field coming, have add 7 times. when need change label (field instance level), have change 7 times. when write form_alter, need address 7 different type of form_id's. solution type looking for: best have parent node type entity. entity types "extends" entity type have fields parent has. far know it's not possible. do know workarounds?

c++ - 2D vector of unknown size -

i defined empty vector of vectors : vector< vector<int> > v; how fill empty vector vector of size 2 integers ( input ) each iteration of while loop? while ( cin >> x >> y ) { //.... } will 1 work? or what's best , elegant / effective way of doing it? while ( cin >> x >> y ) { vector<int> row; row.push_back( x ); row.push_back( y ); v.push_back( row ); } as pointed out jerrycoffin, better use : struct point { int x; int y; }; and might overload output operator std::ostream& operator<< (std::ostream& o,const point& xy){ o << xy.x << " " << xy.y; return o; } and similar input operator (see e.g. here ). , can use this: int main() { point xy; std::vector<point> v; v.push_back(xy); std::cout << v[0] << std::endl; return 0; }

Xcode (C) "Check dependencies" and "Error: Executable doesn't exist" -

i'm doing school project in c using xcode. task create command line application checks if , how many times word appears in text file. far i've created first step of code, have set first argue argument "hej" though im not using word yet, , because of first filename not entered , therefore null, have set existing file called "hej.txt", in order test code go. this bit worked before: #include "stdio.h" #include "string.h" struct filesearch { char *infile; char *outfile; char *searchword; }; int main(int argc, char *argv[]) { int index = 0; struct filesearch f; f.searchword = argv[1]; file *searchfile; //for-loop assign filenames for(index = 0; index < argc ; ++index) { if((strcmp(argv[index], "-i") == 0) && argv[index] != null && strcmp(argv[index + 1], "-o") != 0) { f.infile = argv[index + 1]; } if((strcmp(a

ssl - wordpress error log: force_ssl_login is deprecated since version 4.4! Use force_ssl_admin() instead -

i turned on debugging wordpress site, , started getting these errors in error log. [25-feb-2016 05:30:18 utc] php notice: force_ssl_login deprecated since version 4.4! use force_ssl_admin() instead. in /home/public_html/wp-includes/functions.php on line 3573 is there function or filter turns ssl login ssl admin? i have tried the wp-config.php define ('force_ssl_admin', true ); method, it's not working. website still slow frequent error 500s happening. any appreciated getting out of error log. this plugin or theme who's doing old way. turn off each plugin 1 one see causing it. if you've found ask creator update plugin. try theme if it's not plugin. also should update plugins or theme anyway.

python - PUT request blocking too long with simple custom HTTP client and server -

i have implemented simple http server , client. latter issues put request using requests library , sending arbitrary json , exits. when start server, , run client, both server , client block. server appears not have gone through entire handler function yet. this on server side: $ python3 server.py put / http/1.1 that is, after printing request line, content json string not printed. @ point both client , server block reason. interestingly, when trigger keyboardinterrupt client, server proceeds: $ python3 server.py put / http/1.1 b'{"content": "hello world"}' 127.0.0.1 - - [25/feb/2016 11:52:54] "put / http/1.1" 200 - my questions: why necessary kill client let server proceed? am using of these components wrong way? how can make client , server operate (nearly) instantaneously? this code of http server. handles put requests. prints request line , content data , responds using success code client: import http.server cl

SQL Server 2012 permissions issue during bulk load of CSV file -

Image
i had gone through many other questions , haven't answered specific question. understand error expecting file present in sql server. i have installed sql server 2012 on laptop , trying bulk insert csv file local drive , getting error msg 4801, level 19, state 1, line 1 cannot bulk load because file not opened after looking @ few answers understand permissions issue have no idea how resolve it. on windows 10 , using sql server express 2012 sql server needs permission folder csv file lives in. you need give permission nt service\mssqlserver account on folder (or whatever account created in sql server install). if still doesn't work after that, make sure sql server has permissions file itself. run problem if csv file created in directory outside of directory you're giving sql server permissions to. here how configure permissions on windows folders

vba - how to remove parentheses for negative number in excel -

i trying remove parentheses negative numbers in excel, have far been unable remove them successfully i tried below code: sheet1.usedrange.select sheet1.range("a:xfd").numberformat = "0.00" objexcel.activeworkbook.precisionasdisplayed = true but works after doing texttocolumns manually. need more general solution, don't know rows have numbers. that has format of cell. right-click cell > format > (select number or currency) change how want negative number look. ... or if want in vba, change negative values red: range("a1").numberformat = "$#,##0.00;[red]$#,##0.00" this change (): range("a1").style = "currency" or this: range("a1").numberformat = "$#,##0.00_);[red]($#,##0.00)"

angularjs - how to include the svg icons on <md-icon> in angular material -

in html <md-button class="md-fab md-primary" aria-label="use android"> <md-icon md-svg-src="img/icons/andriod.svg"> </md-icon></md-button> in above html adding svg image fab button using angular material.but unfortunately showing error cannot /img/icons/andriod.svg. specified path of icon in same directory html located.is there further dependencies there added affect of icons? i new angular material. can 1 please me. i specified path of icon in same directory html located if svg in same directory html, shouldn't loc changed <md-icon md-svg-src="img/icons/andriod.svg"> to <md-icon md-svg-src="/andriod.svg">

javascript - Bootstrap Affix Not Moving -

i'm trying make navigation sidebar on website move down browser view via bootstrap's affix plugin refuses follow view , stays @ top. this structure have html: <div id="page-wrapper"> <div class="container"> <div class="row"> <div id="navigation-affix" data-spy="affix" data-offset-top="20" data-offset-bottom="200"> <div class="col-xs-2" id="navigation-wrapper"> <div class="inner"> <div class="row"> <div class="col-xs-12"> <img src="images/me.png" alt="liam potter" id="picture-me" class="img-responsive"> </div> </div>

How to separately subplot a X*Y*Z (3D) matrix matlab? -

i'd create 4 subplots each containing 16 figures. each figure 1 dimension of matrix gw. i.e. gw(:,:,1) first image. here loop first 16 images in first subplot. how should modify loop 3 more subplots? first subplot should contain first 16 images, second subplot should contain second 16 images , on. following loop i'm getting first 16 images 4 subplots. for i=1:4 figure(i); hold on; jj = 1:16 subplot (4,4,j) imshow (gw(:,:,j)); end end you need modify how access 3rd dimension of gw. try this: num_figures = 4; % because dont magic numbers in code subplots_per_figure = 16; % same here i=1:num_figures figure(i); hold on; j = 1:subplots_per_figure subplot (4,4,j) imshow (gw(:,:,j+(i-1)*subplots_per_figure)); end end

datetime - Setting timezone offset in PHP -

i'm writing api retrieve readings sensor , return list of times , values, offset using javascript's `new date(). (see below reason) i've been able time addition / subtraction working enough, using $date->sub(dateinterval::createfromdatestring($offset . " minutes")) , time , date returned have offset of +00:00 (e.g. 2016-02-26t13:32:28+00:00 instead of 2016-02-26t13:32:28+11:00 australia). this causes issues things pebble, or angularjs, apply own offsets on top of own, after seeing offset +00:00 how can correctly set offset when calling $date->format("c") ? should compile date myself (e.g. $date->format("y-m-d\th:i:s" . $plusorminus . $myoffset->format("h:i")) ) or there better way it? edit: due platform limitations (e.g. pebble smartwatch) can't, or don't want to, use timezone names, implementing timezone menu in watch app either break ux or drive filesize if add offset timezone table / library

asp.net mvc 4 - AngularJS: Hidden ID not send in the controller -

the idea when clicked account, modal pop-up , system menus in dropdownlist. problem id account made hidden type in form have no value when send in controller. here form: <form novalidate name="addmenusforuser" ng-submit="addmenudata(addmenusforuser)"> <table> <tr> <input type="hidden" name="account_info_id" ng-model="masterlist.account_info_id" value="masterlist.account_info_id"> <th> system menus </th> <td> <select class="form-control" ng-model="masterlist.system_menus_id" ng-options="c.system_menus_id c.sm_description c in menus" required></select> </td> </tr> </table> <button type="submit" class="btn btn-primary" id="addbtn&qu

java - Google Maps: input Lat and Long and receive images, information, name etc -

i'm making app in android studio user can enter in lat , long point , new activity open name of location, images , possibly paragraphs of information. i'm not sure how approach this, , apis use; if point me right direction handy tips and/or code snippets appreciated ! thanks. you can use google places api , google places api web service . according the documentation google places api web service , can retrieve place details query https://maps.googleapis.com/maps/api/place/details/output?parameters and receive json or xml response place details. you can access places photos ( documentation ) access photos stored in places , google+ databases. take account nedd api key query these services may want check the pricing , plans options .

html - Using Bootstrap affix while maintaining responsive column layout -

please see fiddle. have main content div , sidebar, want affixed top of page user scrolls. works fine, except when viewed in mobile: without affix stuff, columns behave bootstrap columns should , sidebar falls place directly below main div. affix, div disappears. i have sort of fixed using media query: //override affix on small screens: @media (max-width: 750px) { .affix { position: static; } } this puts div should on small screens , reverts affix layout on desktops. however, there void in middle disapears. drag window in, around halfway disapears, repeareas in correct position window dragged smaller still. i've tried adjusting 750px value, haven't been able come figure works. how can reconcile grid layout , affix switch on/off? how know breakpoint - should avoid using specific number of px , take approach issue? my current bootstrap layout (i've added height:500px can see scroll behaviour in js fiddle - not present in actual code): <

how codeigniter call postgresql function -

postresql function select payroll.leave_sufix_prefix('234','2014-05-09') how call codeigniter model $query = $this->db->query("select * my_function()");

jms - IBM MQ: How to know reason for dead letters? -

Image
i'm seeing bunch of messages on dead letter queue , don't understand causes this. i'm using mq explorer browse such messages. here's see in dead-letter header: this doesn't tell me real cause of problem is. how can find out ? i've read this article ibm , tells reason a badly formatted message . in way badly formatted? (note: i'm in control of both producer , consumer) you miss forest trees :-) cause in field 'reason' . mqrc_backout_threshold_reached described here in knowledge center mqrc_backout_threshold_reached (0x93a; 2362) cause message has reached backout threshold defined on qlocal, no backout queue defined. on platforms cannot define backout queue, message has reached jms-defined backout threshold of 20. action if not wanted, define backout queue relevant qlocal. cause of multiple backouts.

javascript - Display bootstrap pop up without defining the HTML (jquery) -

is possible display bootstrap pop on website, without predefining html of on html. an alternative define in javascript or separate html template. can explain me how can achieve it? try appending html node using javscript , open bootstrap modal. var modalhtml = '<div id="mymodal1" class="modal hide" tabindex="-1" role="dialog"> \ <div class="modal-header">\ <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>\ <h3>standard selectpickers</h3>\ </div>\ <div class="modal-body">\ </div>\ <div class="modal-footer">\ <button class="btn" data-dismiss="modal" aria-hidden="true">close</button>\

slot - when I enter long text in ipBlock then it goes out from block in Impresspages, any solution? -

when enter long text in ipblock or ipslot (for example sdfcvghbjnkmlsxdcfvghbjnkmldfctvgbyhujnbuihmklwedrftgyuhjnimkodcfvghbnjkml) goes out ipblock. any solution? it has nothing impresspages. controlled theme's styles. there 2 css properties control behavior: word-break - http://www.w3schools.com/cssref/css3_pr_word-break.asp word-wrap - http://www.w3schools.com/cssref/css3_pr_word-wrap.asp

spring - What do ContextLoaderListener and RequestContextListener do? -

i have application, using spring. , in web.xml use lines below <web-app> .... <listener> <listener-class> org.springframework.web.context.contextloaderlistener </listener-class> </listener> <listener> <listener-class> org.springframework.web.context.request.requestcontextlistener </listener-class> </listener> .... </web-app> what ? mandatory ? org.springframework.web.context.contextloaderlistener class spring framework. implements servletcontextlistener interface, servlet container notifies @ startup ( contextinitialized ) , @ shutdown ( contextdestroyed ) of web application. it in charge of bootstrapping (and orderly shutdown) spring applicationcontext. ref: javadoc says: bootstrap listener start , shut down spring's root webapplicationcontext. delegates contextloader contextcleanuplistener.

how i can insert a spinner selected item in mysql php in android studio? -

i used 2 spinners 1 'username' , second 'course'. stored in db, retrieving spinners data mysql database works fine! want select item spinners, when click on submit button selected item should inserted mysql db.please give me php , java code. //java file public class mainactivity_d3 extends appcompatactivity implements adapterview.onitemselectedlistener { //declaring spinner private spinner spinner2, spinner1; private string str_spinner1, str_spinner2, s_name, s_course; //an arraylist spinner items private arraylist<string> students1; private arraylist<string> students2; button mbtnsave; //json array private jsonarray result1, result2, result; //textviews display details private textview textviewname1; private textview textviewname2; private textview textviewcourse; private textview textviewsession; @override pro

javascript - How to configure an AngularJS App using configuration blocks? -

i´m trying configure angularjs app. after searching found this idea @ official angularjs.com page. seems pretty way configure application before it´s runtime. in case want read in few parameters , path-values simple .xml, .properties or comparable using javascript in configure block. have no clue neither how implement idea using concept nor if way solve problem configuring app using external file. for better demonstration build simple app working base. in end want configure values of config.path.base , config.path.rest external file. i´m pretty sure guys out there able me. so here pretty simple code: 'use strict'; var app = angular.module('configtestapp', []); var config = config || {}; config.path = { base: "localhost:8080", rest: "/sample/api/rest" } app.controller('showconfigcontroller', ['$scope', function($scope){ var vm = this; vm.greeting = "basic configuration"; vm.bas

stomp - Spring Integration for SimpMessagingTemplate -

i have mvc project below @autowired simpmessagingtemplate messagingtemplate; private void sendalarmupdate(alarmnotify alarmnotify) { messagingtemplate.convertandsend("/topic/notify/alarm",alarmnotify); } i trying convert spring integration using int-stomp:outbound-channel-adapter getting exception message payload should array of bytes , tried converting object json still same , correct way send stomp json message spring-integration @bean public reactor2tcpstompclient stompclient() { reactor2tcpstompclient stompclient = new reactor2tcpstompclient("192.168.70.xxx", 61613); //stompclient.setmessageconverter(new passthrumessageconverter()); threadpooltaskscheduler taskscheduler = new threadpooltaskscheduler(); taskscheduler.afterpropertiesset(); stompclient.settaskscheduler(taskscheduler); stompclient.setreceipttimelimit(5000); return stompclient; } @bean public stompsessionmanager stompsessionmanager() { reactor2tcpstom

android - onRequestPermissionsResult is not being called -

i want ask permission write external storage marshmallow . can't see option override onrequestpermissionsresult . able call requestpermissions . have created below method. now, want call new action based on result. please me go ahead. public static boolean verifypermissions(activity activity, string[] grantresults) { boolean allpermissionsgranted = true; if (build.version.sdk_int >= build.version_codes.m) { (string result : grantresults) { int outresult = activity.checkselfpermission(result); if (outresult != packagemanager.permission_granted) { allpermissionsgranted = false; break; } } if (!allpermissionsgranted) { activity.requestpermissions(grantresults, 1); } } return allpermissionsgranted; } i have fragment . tried below code directly showing error 'the method on

Dynamically attach directive name to html tag using angularjs -

is possible attach directive name html tag using user defined function defined in controller. assume directive name test-val in controller $scope.test = function() { // attach directive name html div [id=attch] } on trigger of function test() div should attach directive name. possible?

date - Counting weekday cycles in JavaScript -

my school runs on 7 day cycle, if today (2016/02/26) day 1, tomorrow day 0, monday day 2, , next day 1 2016/03/08. know it's strange, i'm trying find way use date object in javascript , add on 1 cycle, 7 days, not including weekends. i emphasize weekends not count towards day counting. i'm trying find way omit weekends , find next day 1 or day 5 or whatever. there either 1 or 2 weekends in 7-day school cycle, depending on start day of cycle, actual cycle length either 9 or 11 days. date.getday() method gives access day of week, possible solutions might this: var mydate= new date(); switch(true) { //sunday=0, saturday=6 case(mydate.getday() % 6 == 0) : alert('weekend!'); return; case (mydate.getday() < 4) : // mon, tues, wed mydate.setdate(mydate.getdate() + 9); break; case (mydate.getday() < 6) : // thu, fri mydate.setdate(mydate.getdate() + 11); break; }

android - Application have Only BroadcastReceiver is not working -

i have 1 callbroadcastreceiver extends broadcastreceiver , menifest declared. still not showing toast while placing outgoing call. can please help? its showing [2016-02-27 10:02:20 - onlyreciever] no launcher activity found! [2016-02-27 10:02:20 - onlyreciever] launch sync application package on device! code below - callbroadcastreceiver.class import android.content.broadcastreceiver; import android.content.context; import android.content.intent; import android.widget.toast; /** * @author cosmos * */ public class callbroadcastreceiver extends broadcastreceiver { public callbroadcastreceiver() {} @override public void onreceive(context context, intent intent) { toast.maketext(context, intent.getaction(), toast.length_long).show(); } } manifest.xml <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="ind.example.onlyreciever" android:versioncode="1" android:version

c++ - check function passed to template has class in arguments -

this little hard explain, in class have create function takes pointer , arguments want able check if function im passing function has classpointer 1st argument if automaticly add function inside "create" if not add normal functions arguments if any,like im doing template <typename function, typename... arguments> void someclass::create(hwnd hwnd, function func, arguments&&... args) { // check if function's 1st argument = class pointer std::function<void()> function = std::function<void()>(std::bind(std::forward<function>(func), this, std::forward<arguments>(args)...)); // else std::function<void()> function = std::function<void()>(std::bind(std::forward<function>(func), std::forward<arguments>(args)...)); } void threadproc1(someclass* pthis, hwnd hwnd) { // stuff in here } voi

how to hide the Vertical and horizontal Scrollbars with wxPython ? -

am using code create text window didn't figure out how hide scrollbars saw answers wxpython doesn't support , ideas ?? thanks! note:hiding scrollbar not disabling scrolling :) import wx import wx.lib.dialogs import wx.stc stc faces = {'times':'times new roman','helv':"arial","size":18} class mainwindow(wx.frame): def __init__(self,parent,title): self.filepath ='' self.leftmarginwidth = 25 wx.frame.__init__(self,parent,title=title,size=(1350,720)) self.control=stc.styledtextctrl(self,style=wx.te_multiline | wx.te_wordwrap|wx.te_no_vscroll) self.control.cmdkeyassign(ord("+"),stc.stc_scmod_ctrl,stc.stc_cmd_zoomin) #ctrl + + zoom in self.control.cmdkeyassign(ord("-"),stc.stc_scmod_ctrl,stc.stc_cmd_zoomout) #ctrl + - zoom out self.control.setviewwhitespace(false) self.control.setmargins(5,0) self.control.setmargintype(1,st

html - Bootstrap columns does not align correctly -

i have weird bug in columns can't identify, don't know if fault or bootstrap thingy. basically, have single <div class="row"> may contains many <div class="col-lg-2 col-md-2 col-sm-3 col-xs-4"> . wants achieve col* items fit on screen (100% width) , aligning each other when resizing. works normally, except in jsfiddle . the problem on rows, 1 div goes completly crazy , not align correctly in row (try resize result in fiddle, see mean). i'm using bootstrap 3.3.6 , chrome latest version (tried on ff, same weird result...). "clearfix" nothing. have tried packery.js same result. this answer ( bootstrap columns not aligning correctly ) have helped me, don't know in advance how many columns have (because depend on screen size) ... of course, have tried setting min-height each .gallery-item ... any ideas ? thanks in advance, update , here missing css appears in code: div.gallery-item { margin-bottom: 15px; }

c# - Referencing DLL Class with Strings -

is possible? i have dll have been making, in class called modbusclient , named modbusrtu. in application add following code. modbusclient client = new modbusclient(new modbusrtu()); it works, i'm trying add client dynamically 3 strings! following code. string string1 = "modbus"; string string2 = "client"; string string3 = "rtu"; string1+string2 client = new string1+string2(new string1 + string3()); i know code snippet above never work but, believe best reflect idea. you can use reflection.. string string1 = "modbus"; string string2 = "client"; string string3 = "rtu"; var modbusclienttype = type.gettype(string1+string2); var modbusrtutype = type.gettype(string1+ string3); var modbusrtuinstance = ativator.createinstance(modbusrtutype); var modbusclientinstance = activator.createinstance(modbusclienttype,modbusrtuinstance);

java - How to use @XmlJavaTypeAdapter in @RestController parameters? -

i have following restcontroller, , get-query controller thedate=2016-08-08 format. it should automatically converted java.time.localdate . xmladapter not working. why? import java.time.localdate; import java.time.format.datetimeformatter; import javax.xml.bind.annotation.adapters.xmladapter; public class localdateadapter extends xmladapter<string, localdate> { @override public localdate unmarshal(string v) throws exception { return localdate.parse(v, datetimeformatter.iso_local_date); } @override public string marshal(localdate v) throws exception { return datetimeformatter.iso_local_date.format(date); } } @restcontroller public class myservlet { @requestmapping(value = "/", method = requestmethod.get) private string test(restparams p) { } } @xmlrootelement @xmlaccessortype(xmlaccesstype.field) public class restparams { @valid @notnull @xmlelement(required = true, nillable = false)

javascript - Cross fade two instances of wavesurfer.js webaudio with react.js -

i'm looking find way crossfade audio between 2 instances of wavesurfer.js in react. i have container component passes mp3 path down wavesurfer instance i'm looking control both sources same audiocontext in container component (i think?). i've looked https://www.npmjs.com/package/crossfade not sure how source node each wave instance , pass parent component? basic setup: <container> <wave song="" /> <wave song="" /> <input type="range" ref="xfade"> </container> then have components setup this... this.wavesurfer = object.create(wavesurfer); this.wavesurfer.init({ container: this.refs.wave }); this.wavesurfer.load(this.props.song); sorry basic code info have else functioning , i'm looking info on functionality please.

mysql - If Statement Syntax error 1064 -

i want test field value , alter append field table if result of test true. i dont want create procedure etc 1 off script want pass , done with. 1064 error on 'if' int statement bellow. delimiter $$ if 2 > (select `version` `timecard`.`versioncontrol` `table` = 'employee') alter table `timecard`.`employee` add column ipaddr varchar(16) null after pword; update `timecard`.`versioncontrol` set .`version` = 2 `table` = 'employee'; end if $$ delimiter ;

excel - Compare dates yyyy with dd/mm/yyyy -

in excel possible compare year yyyy (say 2016) date dd/mm/yyyy (say 01/01/2015) , find out greater. assumption date in yyyy format first day of year. so example 2015 v 01/01/2014 return true 2015 v 01/01/2015 return false 2015 v 01/01/2016 return false i can code in vba user needs in cell in excel spreadsheet. one option write vba code in function in code module, returns greater value. public function comparedates(date1 date, date2 date) date 'compare date1 , date2 'comparedates = whichever date greater end function you can add formula =comparedates(date1, date2) in cell

lazy loading mutiple contexts in webpack -

i want load 2 modules 2 different contexts (possibly in single chunk) after i've read navigator.language, suppose have lazy load, working: var loaddata = require('bundle?lazy&name=intl!react-intl/locale-data/' + navigator.language + '.js'); var loadtranslation = require('bundle?lazy&name=intl!translantion/' + navigator.language + '.js'); loaddata (function (a) { loadtranslation (function (b) { console.log('i can\'t believe have wait ', a, b); } }); but hoping better syntax, have tried require.ensure, , with require(['bundle?lazy!react-intl/locale-data/' + navigator.language + '.js','bundle?lazy!translantion/' + navigator.language + '.js'], function (a, b) { console.log('what doing wrong?'); }); but either "require function used in way in dependencies cannot statically extracted", or messages not there yet when render, idea?