Posts

Showing posts from May, 2010

sql server - Getting error "The operation has timed out." when my procedure send around 5000 emails -

i have procedure identifies number of employees , send email them dynamically (add names in / from). out of 5000 emails triggered 700-800 gets sent other in re-trying or failed status every time. getting below error : the mail not sent recipients because of mail server failure. (sending mail using account 1 (2017-04-14t12:40:47). exception message: cannot send mails mail server. (the operation has timed out.). ) mail could not be sent to the recipients because of the mail server failure. (sending mail using account 1 (2017-04-13t16:43:32). exception message: cannot send mails to mail server. (service not available, closing transmission channel.the server response was: 4.3.2 maximum number of concurrent connections has exceeded limit, closing transmission channel).

python - How to get number of selected items in a listbox? -

i have listbox: self.listbox = listbox(self.master, selectmode='multiple', height = 34, width = 38) self.listbox.grid(row = 3, column = 0, rowspan = 7, sticky = w) i don't know how number of selected items in listbox? in c#, it's: listview1.selecteditems.count how can in python? i going assume you're asking listbox in tkinter not python built-in. curselection() returns tuple containing line numbers of selected element or elements, counting 0. if nothing selected, returns empty tuple.

typescript - Angular 2 - make imported modules accessible in child modules -

is possible make modules, imported in root module accessible in child modules? for example, have root module imported formsmodule & reactiveformsmodule & custom routingmodule : // ... @ngmodule({ // ... imports: [ browsermodule, formsmodule, reactiveformsmodule, routingmodule, ], // ... }) but problem in child routingmodule components reactiveformsmodule declarations not accessible, need import there (in routingmodule imports). is way make imported modules accessible each other top bottom of import statement? just imported export them module available child modules exports: [ browsermodule, formsmodule, reactiveformsmodule, routingmodule, ],

port - Runnig scilab with BackDoor from PHP -

i want run scilab backdoor module php script. ( https://atoms.scilab.org/toolboxes/backdoor/0.2 ) when run command in terminal sudo scilab-adv-cli result like opening backdoor backdoor: listening commands on tcp port 27020 and scilab still runnig, , can connect octave. but want run api. when run in php script $result = shell_exec("sudo scilab-adv-cli 2>&1"); $result start ... (loading things) opening door backdoor: listening connections on tcp port 27020 killed 2>&1 in command need showing last line result. ( http://php.net/manual/en/function.shell-exec.php#106250 ) i dont know why happening. when module backdoor wasn't installed, result "\n\n", not "killed ". when run never ending while, process showing in list of command "top" in terminal, until kill it. backdoor module process showing few seconds , ends. i tried: chown www-data:www-data -r /(path scilab folder backdoor files) chmod 777 -r /

java - How to customize properties binding from enriroment variables using Spring Boot -

i binded properties environment variable map. if property defined in application.properties binding works correctly . if property defined env variable bindings fails. consider following example: @configurationproperties("com.test") public class props { private map<string, map<string, string>> property; } following env variable expected mapped map [property={foo={bar=value}}] . export com_test_property_foo_bar=value but binding failing failed convert property value of type 'java.lang.string' required type 'java.util.map' property 'property[foo_bar]'; nested exception java.lang.illegalstateexception: cannot convert value of type 'java.lang.string' required type 'java.util.map' property 'property[foo_bar]': no matching editors or conversion strategy found based on documentation i've tried create custom converter , using @configurationpropertiesbinding register approach not able access ke

react native - Playing video file error -

i trying embed video using react-native-video library(in ios). copied code example used in github keep getting same error can't handle. error identical here: https://github.com/react-native-community/react-native-video/issues/237 . none of answer helped. hope me out, banging head on wall more 3 hours. cheers! edit: have tried giving link uri: '...' import video 'react-native-video'; //in render: return ( <view style={{width: 300, height: 500}}> <video source={{uri: "http://cdn1.highfaner.com/2017-03/06/video1488813979559.mp4"}} rate={1.0} // 0 paused, 1 normal. volume={1.0} // 0 muted, 1 normal. muted={false} // mutes audio entirely. paused={false} // pauses playback entirely. resizemode="cover" // fill whole screen @ aspect ratio.* repeat={true}

Git merge can wipe out changes, how to deal with it -

during merge commit creation. if change not staged , left outside merge commit.(this happen, , happens lot when doesn't quite known he's doing, blindly type mystery commands. or due misclick on gui git tool.[they non-technician, tried teach them, failed. let them use git can update files , keep date.]) change gone. merge commit won't have this change undoed msg. doesn't appear in merge commit. commit made change has info change. after merge change undoed without trace. this horrifying, can't rely on merge commit info tell has been changed/undoed. in fact there's no easy way tell. one approach solve limit ability merge onto master trustworthy maintainers.but fast developing mini group, add burden maintainer , slow down. i'm wondering there enforce merge commit include info changes reverted not recorded? or can ban merge operation completely, allow rebase make sure changes recorded explicitly? no automated source tool can totally foolpro

How to convert List data type into Dictionary data in python -

i want list converted dictionary e.g list1=["indrajit","mayur","swapnali","akankasha"] into dictionary having automatically generated keys like dict1 = {"1" : "indrajit","2" : "mayur", "3" : "swapnali", "4" : "akankasha"} you use enumerate starting @ 1 , convert index string, in dictionary comprehension: list1=["indrajit","mayur","swapnali","akankasha"] dict1 = {str(k):v k,v in enumerate(list1,1)} print(dict1) result: {'1': 'indrajit', '4': 'akankasha', '2': 'mayur', '3': 'swapnali'}

swift - FirebaseUI iOS remove cancel button -

Image
i'm new in ios development. wanna build authorization firebase. i'm using firebaseui-ios. wanna hide cancel button initial screen. have ideas how it? i create firebase authviewcontroller programmatically: import uikit import firebase import firebaseauthui import firebasegoogleauthui class authviewcontroller: uiviewcontroller { fileprivate var _authhandle: firauthstatedidchangelistenerhandle! var user: firuser? override func viewdidload() { super.viewdidload() configureauth() } func configureauth() { let provider: [fuiauthprovider] = [fuigoogleauth()] fuiauth.defaultauthui()?.providers = provider fuiauth.defaultauthui()?.issigninwithemailhidden = true // listen changes in authorization state _authhandle = firauth.auth()?.addstatedidchangelistener { (auth: firauth, user: firuser?) in // check if there current user if let activeuser = user { // check if current app user current firuser if self.user !=

documentation - testing for text occurrence in a docs paragraph -

i'm finding hard right information online documentation. want check paragraphs in document occurrence of particular string , if exists take action. i'm using findtext on each paragraph in loop , need test if string found. reference manual says if not found null returned. however, doesn't allow me test returned value not null how can this?

php - How to get mysqli error in different environments? -

in local/dev environment, mysqli query performing ok . however, when upload on webhost environment, got error; fatal error: call member function bind_param() on non-object in... here code: global $mysqli; $stmt = $mysqli->prepare("select id, description tbl_page_answer_category cur_own_id = ?"); $stmt->bind_param('i', $cur_id); $stmt->execute(); $stmt->bind_result($uid, $desc); to check query, tried execute query via control panel phpmyadmin , result ok . if there lacking information, please tell me can provide. first of all, have line before mysqli connect in all environments: mysqli_report(mysqli_report_error | mysqli_report_strict); after mysql errors transferred php exceptions. uncaught exception, in turn, makes php fatal error. thus, in case of mysql error, you'll conventional php error, instantly make aware of error cause. stack trace lead exact spot error occurred. note have able see php errors in general . ,

java - Curly braces only method -

this question has answer here: what initialization block? 10 answers why java accept brackets only method? made for? { // } i noticed executed automatically after static-block before constructor. although constructor of super class executed before. is there specific reason order? this junit made discovering execution order: public class testclass extends testsuperclass { public testclass() { system.out.println("constructor"); } @test public void test() { system.out.println("test"); } { system.out.println("brackets"); } static { system.out.println("static"); } } public class testsuperclass { public testsuperclass() { system.out.println("super class constructor"); } { system.out.println("super

ios - Generic Parameter cannot be inferred in Closure -

Image
right trying create network layer class on alamofire , alamofireobjectmapper library. have created 1 method request here following code func getrequest<t: basemappable>(_ url : string, success: @escaping (dataresponse<t>) -> void, failure: @escaping (error) -> void) -> void { self.request(url, method: .get).responseobject{ (response : dataresponse<t>) in success(response dataresponse<t>) } } i have imported following library in project import alamofire import alamofireobjectmapper import objectmapper here error getting while trying method in viewcontroller thanks in advance support try changing (response: dataresponse <country>) in block argument. this because generic function doesn't know type use generic parameter , type checker can't infer it. stating type explicitly.

javascript - Why does .setAttribute not work with jQuery -

$(function () { $('textarea').setattribute('style', 'height:' + ($('textarea').scrollheight) + 'px;'); }); <textarea> very, long preloading text, mean vvveeerrryyy, vvveeerrryyy long one! </textarea> what doing wrong, please? double checked it, can't find wrong its attr() . change $('textarea').scrollheight $('textarea')[0].scrollheight .because return undefined setattribute() not defined function in jquery. , don't forget add jquery library in html. $(function () { $('textarea').attr('style', 'height:' + ($('textarea')[0].scrollheight) + 'px;'); }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <textarea>this very, long preloading text, mean vvveeerrryyy, vvveeerrryyy long one!</textarea>

iOS insert View between Navigation Bar and View underneath it -

i want insert uiview between navigation bar , uiview (underneath navigationbar ) show network connectivity status. view underneath nav bar should go downward make space indicatorview . my code: indicatorview = [[uiview alloc] initwithframe:cgrectmake(0, 0, view_width, 35)]; [self.view addsubview:indicatorview]; self.view.frame = cgrectmake(0, 35, view_width, view_height - 35); this inserts view whole window shift upwards , create space @ bottom of view. what's wrong?

mysql - Calculating amout of minutes between 2 times and divide it by amount of records -

how can calculate amount of minutes between 9 , 11 of records togther (colum generated). want know how can devide output of amount of records there are. select address, min(from_unixtime(time)) "aankomsttijd", max(from_unixtime(time)) "eindtijd", timestampdiff(minute, min(from_unixtime(time)), max(from_unixtime(time))) "minuten" sensordata1 from_unixtime(sensordata1.time) between '2017/04/04' , '2017/04/05' , from_unixtime(sensordata1.time, '%h') between 9 , 11 group address having minuten > 2 , minuten < 1400 output normal database can see "minuten not real column" what want minutes 1 amount , want devide amount of records calculated minutes together. you can use query wrote source calculation want, like select sum(minuten) total_minuten, count(*) records, sum(minuten) / count(*) average_minuten ( select address,

c# - Mouse Wheel event not firing on one computer, works on another -

here's problem: i wrote wpf application uses hwnd host drawing surface. hwnd responsible sending mouse events happen. on computer, works , see 522(0x020a) mouse wheel message without issue. i installed same software on computer, , event didn't fire. went far logging event messages file see if 522 fired @ all, , never showed up. things i've tried: -making sure hwnd has focus. not did make thread re-focus every second, made sure on computer (working) "isfocused" true hwnd. -closing down any other program running. included things normal computer running in background, in case taking focus off. -switching mouse. used mouse i'm using on computer sure, , still did not work on new computer. here's base code: public abstract class win32hwndcontrol : hwndhost { protected intptr hwnd { get; private set; } protected bool hwndinitialized { get; private set; } private const string windowclass = "hwndwrapper"; protec

C# - How to use reflection run in memory with a winform -

i'm using code run file: byte[] test = file.readallbytes("testfile.exe"); assembly = assembly.load(test); methodinfo m = a.entrypoint; var parameters = m.getparameters().length == 0 ? null : new[] { new string[0] }; m.invoke(null, parameters); if in console application works charm. can execute other managed console windows or winforms. when enter code in windows form execute file in memory. following error: system.invalidoperationexception: parameter count mismatch

Load data from one table to another every 10 mins - Cassandra -

we have stream of data coming table every 10 mins. no history preserved. existing data has flushed new table b every time data loaded in table a. can done dynamically or automated in cassandra? i can think of loading table csv file , loading table b every time table flushed. have done @ database level itself. ideas or suggestions appreciated. thanks, arun for smaller amounts of data put cron: https://dba.stackexchange.com/questions/58901/what-is-a-good-way-to-copy-data-from-one-cassandra-columnfamily-to-another-on-th if larger , running newer versions of cassandra (3.8+) http://cassandra.apache.org/doc/latest/operating/cdc.html https://issues.apache.org/jira/browse/cassandra-8844 and replay data table need (by sort of outside process, script, app etc ...). basically there tools around like: https://github.com/carloscm/cassandra-commitlog-extract you use samples there cover use-case. but use cases handled @ application level, writes relatively cheap cassa

Can Android package names contain only letters and periods? -

Image
i'm trying scrape data www.apkmirror.com includes package name of apps. example, below the package name " com.lenovo.anyshare.gps ". i'm considering whether use pyparsing expression word(alphas + ".") for package name, meaning [a-za-z.] regular expression. ok, or restrictive in cases? (i wasn't able find restrictions on package name on https://developer.android.com/studio/build/application-id.html ). following commonsware 's comment, i'm assuming moment character allowed except whitespace. (i've updated regular expression \s+ , since there should @ least 1 character).

c - What is this error undefined reference to 'xdr_numbers' in RPC -

power.x struct numbers { int number; int power; }; program power_prog { version power_vers { int power(numbers) = 1; } = 1; } = 0x31415926; client.c #include <stdlib.h> #include <stdio.h> #include <rpc/rpc.h> #include "power.h" main(argc, argv) int argc; char **argv; { client *cl; /* rpc handle */ char *server; int *result; numbers num; if (argc != 2) { fprintf(stderr, "usage: %s hostname\n", argv[0]); exit(1); } server = argv[1]; /* name of server */ result = (int *)malloc(sizeof(int)); /* create client handle */ if ((cl=clnt_create(server, fact_prog, fact_vers, "udp")) == null) { /* failed! */ clnt_pcreateerror(server); exit(1); } num.number=5; num.power=3; /* call procedure bin_date */ if ((result=fact_1(&num, power, cl))==null) { /* failed ! */ clnt_perror(cl, server); exit(1); } printf("factorial returned server : %d\n", *result); cln

objective c - loading trie from Sqlite -

i working on ios custom keyboard. autocorrect using trie own word scoring logic. every time keyboard pops up, in viewdidload load nsarray sqlite database takes .01ms. concern when loading trie taking .8ms. instead of loading trie every time, there way can load once , trie should ready when keyboard pops up?

Azure Copy blobs from one container to another in same storage account using rest api and php -

i trying copy blob 1 container in same storage account. documentation of azure rest api not clear , not how copy source container destination container how copy blobs 1 storage account storage account. i have tried copy blob using below code throws error saying " authenticationfailedserver failed authenticate request. make sure value of authorization header formed correctly including signature. " $date = gmdate('d, d m y h:i:s \g\m\t'); $account_name = "accname"; $destcontainername = "destcontainer"; $blobname = "blob.png"; $sourcecontainer = "sourcecontainer"; $account_key = "asdf"; $canonicalizedheaders = "x-ms-copy-source:https://".$account_name.".blob.core.window‌​s.net/".$sourcecontainer."/".$blobname."\n‌​x-ms-version:2015-04‌​-05"; $canonicalizedresource = "/$account_name/$destcontainername/$blobname"; $arraysign = array(); $arraysign[] = 'put&

tomcat - Getting 403 error from apache tomact when accessing from mobile device -

i getting 403 error apache server accessing post restful services, coming when accessed mobile device , working fine desktop device. below error "post /myservice/check http/1.1" 403 20 "-" "mozilla/5.0 (iphone; cpu iphone os 9_1 mac os x) applewebkit/601.1.46 (khtml, gecko) version/9.0 mobile/13b143 safari/601.1"

sql - Update minutes value to 0 for unmatched data with having keeping one data as it is -

Image
need update data based on specific column unmatched & keeping 1 data is also need take care of performance huge data you can use row_number() . example: with toupdate ( select t.*, row_number() on (partition therapyadmissionid, units, totalminutes order documentstartdate) seqnum t ) update toupdate set units = 0, totalminutes = 0 seqnum > 1; i should note need suggests have flaw in data model. units , totalminutes should stored in table.

xamarin.android - Xamarin Android APP crashes after splash screen -

Image
i used visual studio team service build android xamarin app. build works fine if deploy apk phone crashed after logon screen. if try create apk file visual studio archive manager , deploy created apk works fine. can difference between local created apk , apk build server? keystore files same. suggestions? this sign configuration and build configuration update 1: i used hosted build. created test project (create new black androud project in visual studio 15.1) , uncommented line setcontentview(resource.layout.main); same result in other project app crashes after start. think not problem of code problem of build or sign update 2: changed hosted build hosted vs2017 i having same issue , resolved enabling zipalign option on signing task, maybe need too.

c++ - Compile CMake based project with minGW -

i want use signalr in windows project compiled mingw (msys2). far know cannot link against library (dll) compiled compiler (i.e. vc++). hence, need compile signalr mingw. here repository: https://github.com/aspnet/signalr-client-cpp the project based on cmake rather standard makefile. did: downloaded cmake: https://cmake.org/files/v3.8/cmake-3.8.0-win32-x86.zip extracted folder (i.e. c:/dev) exported cmake/bin folder path var (in /etc/profile) checked if works :) cmake --version cloned cpp rest sdk ( https://github.com/microsoft/cpprestsdk.git ) trying compile cpp rest sdk described here: https://github.com/microsoft/cpprestsdk/wiki/how-to-build-for-linux leads output: $ cmake .. -dcmake_build_type=release -- building for: visual studio 15 2017 -- c compiler identification msvc 19.10.25019.0 -- cxx compiler identification msvc 19.10.25019.0 -- check working c compiler: c:/program files/microsoft visual studio/2017/community/vc/tools/msvc/14.10.25017

android - oauth2: Logoff currently logged in google user and then send the oauth url from my app -

say user1 has logged gmail account on phones chrome browser. im writing android app using google rest api's , pre-requisite oauth2 authorization. if send authorization url app opened in browser user1's account assumed authenticated , authrization page (with allow/deny) buttons shown. how can programatically, logoff existing user , send oauth2 url app user explicitly enters credentials , grants oauth access app. i tried logging off follwoing not successful... 1) https://www.google.com/accounts/logoff?continue=https://accounts.google.com/o/oauth2/v2/auth?redirect_uri=http%3a%2f%2flocalhost%3a8080&prompt=consent&response_type=code&client_id=blah-blah-blah "&scope="blah blah" 2) https://accounts.google.com/logoff?continue=https://accounts.google.com/o/oauth2/v2/auth?redirect_uri=http%3a%2f%2flocalhost%3a8080&prompt=consent&response_type=code&client_id=blah-blah-blah "&scope="blah blah" in options 2 , 3, http

selenium webdriver - Incorrect HTML content in Chromdriver -

i have several tests write html code temp directory on centos 7 box , have chromedriver load them basic tests on them. in example writing html code: <html><body><form> <label for="text">text</label> <input type="text" id="text"></form></body> however when html content via getattribute('innerhtml') this <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> <title i18n-content="title">file:///tmp/formjbdsbv</title> ... which not code wrote. log file on selenium side is 09:45:03.980 info - executing: [get: file:///tmp/formjbdsbv]) 09:45:04.084 info - done: [get: file:///tmp/formjbdsbv] but, of course, test works locally , on virtual machine, not on test box, runs using xvfb. p

C# Regex replace with Regex -

Image
i have problem, want replace every "[[:de:<text>]]" "{{de|<text>}}" in text. tried output = regex.replace(input, "[[:de:(.*)]]", "{{de|(.*)}}"); but doesnt copy <text>. have no other idea how replace correctly. hope can me. use lazy dot pattern , backreferences , escape [ symbols: output = regex.replace(input, @"\[\[:de:(.*?)]]", "{{de|$1}}"); if text between de: , ]] can contain line breaks, use regexoptions.singleline modifier. see regex demo .

gtkmm - Gtk (mm) limit width of combobox -

because use comboboxes may contain text entries of long size, leads combobox increasing width far beyond reasonable size, trying give maximum width combobox. if doing this: class mycombo : public gtk::combobox { private: cellrenderertext render; public: mycombo() { render.property_width_chars() = 10; render.property_ellipsize() = pango::ellipsize_end; pack_start(render, true); } }; the result empty cell of desired width, seems logical since did not specify column show. how can attempt? using pack_start bypass renderer... another approach one: class mycombo : public gtk::combobox { private: cellrenderertext render; public: mycombo() { pack_start(render, true); set_cell_data_func(render, sigc::mem_fun(*this, &mycombo::render_iter)); } void render_iter(const treemodel::const_iterator& iter) { glib::ustring data = get_string

java - Alert Dialog not displaying due to IllegalStateException -

when click on listview row, instead of showing alert dialog box, gives illegalstateexception . says use theme.appcompat theme. dont know , new plese me understand these appcompat activity , reason trouble. java.lang.illegalstateexception: need use theme.appcompat theme (or descendant) activity. @ android.support.v7.app.appcompatdelegateimplv9.createsubdecor(appcompatdelegateimplv9.java:355) @ android.support.v7.app.appcompatdelegateimplv9.ensuresubdecor(appcompatdelegateimplv9.java:324) @ android.support.v7.app.appcompatdelegateimplv9.setcontentview(appcompatdelegateimplv9.java:285) @ android.support.v7.app.appcompatdialog.setcontentview(appcompatdialog.java:83) @ android.support.v7.app.alertcontroller.installcontent(alertcontroller.java:225) @ android.support.v7.app.alertdialog.oncreate(alertdialog.java:257) @ android.app.dialog.dispatchoncreate(dialog

c++ - error: 'l' is not a type -

i'm programming in linux , have 1 problem. have initialize 2 vectors size 'l'. 'l' should given form command line. this code: #include <iostream> #include <sys/shm.h> #include <sys/ipc.h> #include <sys/wait.h> #include <cstdlib> #include <cstdio> #include <vector> using namespace std; int l, m, n, id; struct vektori{ std::vector<long double> a(l); std::vector<long double> b(l); }; typedef struct vektori* vektor; int main(int argc, char* argv[]){ if(argc!=4){ cout<<"greska kod ulaznih parametara"<<endl; return 0; } l=atoi(argv[1]); m=atoi(argv[2]); n=atoi(argv[3]); vektor v; id=shmget(ipc_private, sizeof(vektori), 0); v=(vektor)shmat(id, null, 0); return 0;

mysql server is getting aborted when trying to start -

2017-04-14t13:48:19.151793z 0 [warning] timestamp implicit default value deprecated. please use --explicit_defaults_for_timestamp server option (see documentation more details). 2017-04-14t13:48:19.167419z 0 [error] innodb: unable create temporary file; errno: 2 2017-04-14t13:48:19.183044z 0 [error] innodb: plugin initialization aborted error generic error 2017-04-14t13:48:19.183044z 0 [error] plugin 'innodb' init function returned error. 2017-04-14t13:48:19.183044z 0 [error] plugin 'innodb' registration storage engine failed. 2017-04-14t13:48:19.183044z 0 [error] failed initialize plugins. 2017-04-14t13:48:19.183044z 0 [error] aborting this error shown when tried start mysql57 server. tried fix error setting adding following in my.ini file: explicit_defaults_for_timestamp = 1 still server gets aborted. can me fixing this?

regex - How to parse functions names from string using javascript? -

i'm looking reliable way function names string. string values can this: let str = 'qwe(); asd();zxc()' //or let str = 'qwe("foo");asd(1);zxc();' //etc. i want have array ['qwe', 'asd', 'zxc'] i tried str.split(';') how rid of parenthesis , can hold? there regexp match symbols on left of other symbol? you can use simple regex find function names in .match() var str = "qwe(); asd();zxc()"; console.log(str.match(/\w+(?=\()/g));

reporting services - How to set custom horizontal axis interval in SSRS chart? It always shows every other label -

Image
i have ssrs report, confused on version- somewhere between 2008-2014. i'm developing in vs 2013. have chart x axis showing category groups, date field displayed using expression. not want show every date when there large amount, tried writing expression interval field below set interval based on how many rows there are, shows every other label. set interval 4 or 6 or 10 or whatever , shows every other label, if interval 2. attached screen shot show i'm changing it. if change parameters , run chart different data, show interval 1 sometimes. maybe there's place interval can set? 3 different interval expressions i've tried =ceiling(countrows("getallstatusmeasuredata") / 30) 4 =4 "4" turns out there separate interval labels on axis- incorrectly assumed same. looked @ properties window chart axis , showed labelintervaloffset , 1 needed change, not interval in section called interval. screen shot below:

r - ggplot2 boxplot stat_summary text placement by group -

Image
in plot below, i'd number of observations (40 in case) overlayed on top of each boxplot. code below doesn't work when there's fill aesthetic. text need adjusted horizontally (1 left, 1 center, 1 right in case) overlay corresponding boxplots. dt <- data.table( x = factor(rep(1:2, each=120)) , f = rep(letters[1:3], 40) , y = c(rnorm(120, 1:3), rnorm(120, 1:3*2)) ) table(dt$x, dt$f) +--------------+ | b c | +--------------+ | 1 40 40 40 | | 2 40 40 40 | +--------------+ frequencyannotation <- function(x) { c(y = (quantile(x, .75, names = f) + median(x))/2, label=length(x)) } ggplot(dt, aes(x=x, y=y, fill=f)) + geom_boxplot() + stat_summary(fun.data = frequencyannotation, geom='text') as boxplots dodged when use argument fill=, have add position_dodge() stat_summary() call. ggplot(dt, aes(x=x, y=y, fill=f)) + geom_boxplot() + stat_summary(fun.data = frequencyannotation, geom='text',

maven - Jenkins pipeline re-writing mvn command and causing a failure -

in multi-repo pipeline, i'm trying commit version update , push nexus. sh step seems re-writing mvn command , commit message seen build phase. here code: def message = "ci: committing version ${version}" def build_command = "mvn clean deploy scm:checkin -p${profiles_to_build} \"-dmessage=${message}\" -dconnectiontype=ssh -dpushchanges=true -ddeployatend=true" echo build_command sh """ #!/bin/bash -xe ${build_command} """ here output [pipeline] echo mvn clean deploy scm:checkin -pall "-dmessage=ci: committing version 5.19731121.1" -dconnectiontype=ssh -dpushchanges=true -ddeployatend=true [pipeline] sh [darwin] running shell script + mvn clean deploy scm:checkin -pall '-dmessage=ci: committing version 5.19731121.1' -dconnectiontype=ssh -dpushchanges=true -ddeployatend=true .... [error] unknown lifecycle phase "committing". must specify valid lifecycle phase or goal in format &l

How to address classes within an ng-bootstrap component? -

i want add css style ngbprogressbar , i'm having trouble doing so. specifically, want give custom color progress bar. using "contextual progress bars" demo @ https://ng-bootstrap.github.io/#/components/progressbar , code src/progressbar-basic.ts file is: import {component} '@angular/core'; @component({ selector: 'ngbd-progressbar-basic', templateurl: 'src/progressbar-basic.html', styles: [` ngb-progressbar { margin-top: 5rem; } `] }) export class ngbdprogressbarbasic { } inspecting components in browser, background-color style progress bar controlled .bg-success , .progress-bar. adding .progress-bar { background-color:#ff9900; } to css file attached index.html file makes desired change, i'm trying add here, rather globally. adding done ngb-progressbar margin-top style above doesn't seem work, though don't see effect of margin-top style either. i've turned off type=&

angularjs - Angular Inline Conditional on ng-bind -

i'm trying pagetitle initialise data.products[whichitem].date if condition true or pagetitle = data.products[whichitem].valuetoday if condition false there ng-directive more appropriate or syntax wrong <section ng-bind="(true) '{{pagetitle = data.products[whichitem].date | getyear}}' : '{{pagetitle = data.products[whichitem].valuetoday}}' " ></section> do want print pagetitle value or assign value pagetitle .? you can things in controller. ng-bind print value in page $scope.setpagetitle(data,itemindex){ $scope.pagetitle = <condition> ? data.products[itemindex].date : data.products[itemindex].valuetoday; } then if want print it. <section ng-bind='pagetitle'></section> use this.

powershell - How to use "*" in nodeName -

say have 2 roles in dsc setup , have variable amount of nodes in setup: $configdata = @{ allnodes = @( @{ nodename = "*web*" # < problem lies here # can prodweb## or devweb## role = "iis", "basic" } @{ nodename = "*" role = "basic" } ) } dsc resource: configuration cfg { $allnodes.where{ $_.role.contains("basic") }.nodename { ... } $allnodes.where{ $_.role.contains("iis") }.nodename { ... } } can achieve that? the allnodes entry in configuration data array of hashtables. each hashtable needs have key nodename. value substituted when expression evaluates. nodename web* not work

ruby on rails - How do I use Turbolinks and local_time together? -

i've noticed recently, since installing rails 5 local_time gem doesn't work on pages link internal (through turbolinks). if link page external or browser refreshed, or turbolinks disabled, local_time works properly. does know how use these together? i needed initialize local time on turbolinks load. event provides chance things have run @ document ready. javascript is: document.addeventlistener("turbolinks:load", function() { localtime.run(); });

c++ - Derived class not recognized as covariant -

so creating huffman tree, , having hard time overriding function, , believe due covariance issue. here hierarchy having hard time in code: class treeinterface { public: treeinterface() {} virtual ~treeinterface() {} virtual nodeinterface * getrootnode() const = 0; }; class tree : treeinterface { public: tree() {} virtual ~tree() {} node* getrootnode() { return treeroot; } private: node* treeroot; }; those work fine, next block has issues. class huffmaninterface{ public: huffmaninterface() {} virtual ~huffmaninterface() {} virtual bool createtree(string filename) = 0; virtual string encodemessage(string toencode) = 0; virtual treeinterface * gettree() = 0; virtual map<char, string> getencodings() = 0; }; class huffman : huffmaninterface{ public: huffman() {} ~huffman() {} bool huffman::createtree(string filename){ } string huffman::encodemessage(string toencode){ } str

sorting - sort_array order by a different column, Hive -

i have 2 columns, 1 of products, , 1 of dates bought. able order dates applying sort_array(dates) function, want able sort_array(products) purchase date. there way in hive? tablename is clientid product date 100 shampoo 2016-01-02 101 book 2016-02-04 100 conditioner 2015-12-31 101 bookmark 2016-07-10 100 cream 2016-02-12 101 book2 2016-01-03 then, getting 1 row per customer: select clientid, collect_list(product) prod_list, sort_array(collect_list(date)) date_order tablename group 1; as: clientid prod_list date_order 100 ["shampoo","conditioner","cream"] ["2015-12-31","2016-01-02","2016-02-12"] 101 ["book","bookmark","book2"] ["2016-01-03","2016-02-04","2016-07-10"] but want order of products tied correct chronological order of purchases. it possible using built-in functions, not p

python - Error code 1 when installing kivy on MAC -

i think must have deleted important files on computer accident uninstalled , re-installed them , trying run kivy on atom error keeps showing no matter what. /system/library/frameworks/coreservices.framework/frameworks/launchservices.framework/headers/launchservices.h:43:10: fatal error: 'launchservices/utcoretypes.h' file not found #include <launchservices/utcoretypes.h> ^ 1 error generated. error: command 'gcc' failed exit status 1 make: *** [build] error 1 someone please help

html - CSS-Statement to change the color of a button DURING click -

i want change color of button during click. didn't find solution, thats why i'm asking. don't want change color of button after clicked. want change color during click (so color button has when press button). @ moment button gets blue while pressing it. (safari) thanks! <input type="button" value="mybutton"> you might need add :active in css element input[type='button']:active{ background-color:red; } <input type="button" value="mybutton"/>

pow - How can I create a power function with negative exponent in Clojure? -

Image
i've seen many ways develop power function in clojure (recursion, using reduce , loop , etc), none of them accepts negative exponents... can without depending on java's math/pow ? here hint of how use regular algorithms:

svm classification error in simplecv -

i can't able run svm classification in simplecv program. program given below: from simplecv import * hhfe=huehistogramfeatureextractor() ehfe=edgehistogramfeatureextractor() haarfe=haarlikefeatureextractor() extractors=[hhfe,ehfe,haarfe] svm=svmclassifier(extractors) tree=treeclassifier(extractors) trainpaths=['./data/train/apple/','./data/train/banana/','./data/train/pineapple/'] testpaths=['./data/test/apple/','./data/test/banana/','./data/test/pineapple/'] classes=['apple','banana','pineapple'] print svm.train(trainpaths,classes,verbose=true) print tree.train(trainpaths,classes,verbose=true) print svm.test(testpaths,classes,verbose=true) print tree.test(testpaths,classes,verbose=true) error as: warning: required orange machine learning library not installed warning: i'm sorry, need orange machine learning library installed use opening file: ./data/train/apple/a19.jpg error: traceback (most rec

swift - How can I display different products from an array in each custom cell? -

Image
i need display 3 or less products array in every custom cell of tableview, putted 3 image views , 3 labels in each cell show products. tableviewdatasource code. // mark: - table view data source override func numberofsections(in tableview: uitableview) -> int { // #warning incomplete implementation, return number of sections return products.count / 3 } override func tableview(_ tableview: uitableview, numberofrowsinsection section: int) -> int { // #warning incomplete implementation, return number of rows return 1 } override func tableview(_ tableview: uitableview, cellforrowat indexpath: indexpath) -> uitableviewcell { let cell = tableview.dequeuereusablecell(withidentifier: "homecell", for: indexpath) as! hometableviewcell let sectionindex = indexpath.section if (sectionindex + index + 2) <= products.count && (sectionindex + index + 1) <= products.count && currentuser != nil { cell.product1 = self.pro

html - Left align a group of tables so that they all appear on the same line -

here html: <body> <div class="horizontal-scroller"> <table class="float-left"> <tr> <td>lorem ipsum dolor sit amet, consectetur adipiscing elit.</td> </tr> </table> <table class="float-left"> <tr> <td>lorem ipsum dolor sit amet, consectetur adipiscing elit.</td> </tr> </table> <table class="float-left"> <tr> <td>lorem ipsum dolor sit amet, consectetur adipiscing elit.</td> </tr> </table> </div> </body> and css: .float-left { float: left; } .horizontal-scroller { overflow-x: auto; } i trying achive effect 3 tables appear on same row no matter size of containing div. example works when page wide enough fit them. when shrink s

tcl - Code that works in 8.4 is causing crash in 8.6, is there a better way to implement the functionality -

i have tcl utility makes easy ensure snippet of code run @ time control flow leaves current scope (of proc ). crashes in tcl 8.6.6, i'm wondering if there "better" way implement functionality in tcl 8.6? an example usage is: proc test {file} { set fh [open $file] ::util::defer [list close $fh] # ... bunch of stuff # , if hit error # [close $fh] evaluated return # proc } it's worked great in tcl 8.4, , use on code. as i'm still coming speed on functionality available in tcl 8.6, i'm asking how should ::util::defer proc written best take advantage of tcl 8.6? here 8.4 implementation: namespace eval ::util {} proc ::util::defer_impl {cmd args} { uplevel 1 $cmd } proc ::util::defer {cmd} { set vname _u_defer_var # unique variable name while {[uplevel 1 [list info vars $vname]] != ""} { set vname ${vname}_ } uplevel 1 [list set $vname $cmd] # when variable unset, trigger call command uplevel 1 [list

MYSQL/Databases Databases gone? -

i have been working on first project using databases using mysql. woke morning unable login localhost. able enter root no password , none of databases there. should do? in theory root should have access databases. if haven't deleted them, it's possible lost access them. remember mysql host-sensitive when logging in. root@% , root@localhost , root@10.0.0.1 , etc... may assigned different permissions. you can try skip-grant-table in my.ini , explained in answer: regaining access lost mysql password phpmyadmin on wamp with can reset root password , try again. if not yield effect, sql history , see if haven't accidentally deleted them?

java - How to feed appium with right parameters? -

i'm trying connect android emulator following capabilities: public class simpleandroidcalctest { webdriver driver; @before public void setup() throws malformedurlexception { desiredcapabilities capabilities = new desiredcapabilities(); capabilities.setcapability("platformname", "android"); capabilities.setcapability("platformversion", "7.1.1"); capabilities.setcapability("devicename", "android-7"); capabilities.setcapability("apppackage", "com.android.calculator2"); capabilities.setcapability("appactivity", "com.android.calculator2.calculator"); driver = new remotewebdriver(new url("http://127.0.0.1:4723/wd/hub"), capabilities); driver.manage().timeouts().implicitlywait(15, timeunit.seconds); } and keep getting following bad parameters error: [http] --> post /wd/hub/session {"desiredcapabilities":{"appp

c++ - How to augment objects in CGAL AABB tree with custom labels? -

for fixed point, efficiently find closest item (fixed) set of line segments. end, have been experimenting along lines of cgal example : #include <iostream> #include <list> #include <cgal/simple_cartesian.h> #include <cgal/aabb_tree.h> #include <cgal/aabb_traits.h> #include <cgal/aabb_segment_primitive.h> typedef cgal::simple_cartesian<double> k; typedef k::ft ft; typedef k::point_3 point; typedef k::segment_3 segment; typedef std::list<segment>::iterator iterator; typedef cgal::aabb_segment_primitive<k, iterator> primitive; typedef cgal::aabb_traits<k, primitive> traits; typedef cgal::aabb_tree<traits> tree; int main() { point a(1.0, 0.0, 0.0); point b(0.0, 1.0, 0.0); point c(0.0, 0.0, 1.0); std::list<segment> segments; segments.push_back(segment(a,b)); segments.push_back(segment(a,c)); tree tree(segments.begin(),segments.end()); tree.accelerate_distance_queries(); poin

xaml - diplay panel on button click with zero code behind using mvvm and wpf -

Image
i new in mvvm , wpf... question in summerized form- how control visibility of controls using wpf , mvvm. should 0 code behind. actual scenario-i have multiple user control panels ...say ucpanel1, ucpanel2, ucpnale3... till 6 - importing these user controls in 1 single main user control... ucmain having stackpanel buttons @ top... menu. - requirement simple... on button1 click- should able see ucpanel1 , remaining panels hidden, button2 click- should able see ucpanel2 , remaining panels hidden... on - acheieved using code behind. requirement implement such way there should minimal code possible in code behind. how xaml , view model like? can not access extended objects of ucpanel1 in viewmodel.. in mainpanel xaml... <button style="{staticresource stackpanelbuttonstyle}" command="{binding openmessagecommand}" > <!--click="btnmessege_onclick" >--> <textblock text="messaging" style=&q