Posts

Showing posts from February, 2015

How to convert string data into datetime in SQL Server using dateadd() function -

this "1432443679" string stored in column called due_date . need convert datetime using dateadd function below formula. when applied in excel workbook datetime "5/24/2015 5:01:19". in sql server couldn't time , date part. formula: 1970/01/01 12:00:00 + (1432443679/86400) excel worksheet result 5/24/2015 5:01:19 please assist me thanks in advance. try this select dateadd(ss,1432443679,cast('1970-01-01' datetime)) no need convert seconds number of days dividing 86400. in dateadd() function use seconds datepart directly add seconds 1970-01-01 , date. select dateadd(ss,cast(due_date bigint),cast('1970-01-01' datetime)) tablename

npm - Why do angular releated projects do not use semver 2.0 for prerelease tags? -

a lot of angular related projects use pre-release versioning scheme of following: e.g. angular-cli 1.0.0-beta.22, 1.0.0-beta.22-1, 1.0.0-beta.24 e.g. @angular/material 2.0.0-alpha.9 2.0.0-alpha.9-1, 2.0.0-alpha.9-2, 2.0.0-alpha.9-3, 2.0.0-alpha.10, 2.0.0-alpha.2.0.0-alpha.11, 2.0.0-alpha.11-1, due way semantic versioning works (dot separators, numeric lower precedence alphanumeric parts), 2.0.0-alpha.9-experimental-pizza still highest version @angular/material, tough 2.0.0-alpha.11 released. similar angular-cli, 1.0.0-beta.22-1 still highest version, though 1.0.0-beta.24 released. this causes package.json dependencies ^ versions, e.g. "angular-cli" : "^1.0.0-beta.22-1" to not upgrade 1.0.0-beta.24, because 24 numeric version , therefore smaller 22-1. posted issue @angular/material issue tracker here got no response. is oversight, or missing something? update: angular-cli has versions angular-cli@1.0.0-beta.25 angular-cli@1.0.0-beta.

ios - How to get IMEI number of iPhone programmatically? -

i have used following code getting imei number of iphone in objective-c: nsstring *imei = [[networkcontroller sharedinstance] imei]; but getting error, use of undeclared identifier "networkcontroller" have imported afnetworking.h can not solve error. can me solving issue? you can udid, can not imei.apple not allow this.

javascript - Set Active Menu Item with jQuery -

what trying do: regular menu has current active page in different style. html (working properly) <div> <ul class="nav"> <li> <a class="active" href="#"> <span>one</span> </a> </li> <li> <a href="#"> <span>two</span> </a> </li> <li> <a href="#"> <span>three</span> </a> </li> </ul> </div> css (working properly) .nav .active { color: #fff; background-color: #000; } js (not working) $('a').click(function(){ $(this).addclass('active') .siblings() .removeclass('active'); }); codepen taken sara soueidan's codepen . sara soueidan's version cannot repl

c++ - What is the curiously recurring template pattern (CRTP)? -

without referring book, can please provide explanation crtp code example? in short, crtp when class has base class template specialization class itself. e.g. template <class t> class x{...}; class : public x<a> {...}; it is curiously recurring, isn't it? :) now, give you? gives x template ability base class specializations. for example, make generic singleton class (simplified version) this template <class actualclass> class singleton { public: static actualclass& getinstance() { if(p == nullptr) p = new actualclass; return *p; } protected: static actualclass* p; private: singleton(){} singleton(singleton const &); singleton& operator = (singleton const &); }; template <class t> t* singleton<t>::p = nullptr; now, in order make arbitrary class a singleton should this class a: public singleton<a> { //rest of functionality class }

asp.net - Server application has enabled CORS yet client gets "Access-Control-Allow-Origin" error -

i have restful api , i've added allow cross-origin request public static void register(httpconfiguration config) { ... // allow cross-origin request var cors = new enablecorsattribute("*", "*", "*"); config.enablecors(); ... } my client angularjs application calling server this var json = json.stringify({ request: 'init' }), req = { method: 'get', url: 'http://localhost:51615/api/call/2/' + json } $http(req) .then(function(response){ console.info('response', response) }) .catch(function(error){ console.error(error); }) even thou cross-origin should allowed still error xmlhttprequest cannot load http://localhost:51615/api/call/2/%7b%22request%22:%22init%22%7d . no 'access-con

r - Using rvest to fill out search form and download attachments -

i'm trying scrape department of labor data using rvest. have list of eins , pns (parameters in web search form) want search by. here's have far: library(rvest) library(magrittr) ## url page search form populated site <- "http://www.efast.dol.gov/portal/app/disseminate?execution=e1s1" session <- html_session(site) form <- session %>% html_nodes("form") %>% extract2(1) %>% html_form() %>% set_values(`ein` = "060646973", # example ein `pn` = "001") # example pn result <- submit_form(session, form) this leads page there list of plans. however, i'm not familiar enough rvest know how navigate result page , download attachments. it's accomplished in browser, want write script automate task. any on navigating resulting webpage , downloading attachments using rvest or other package in r appreciated. thank much! this doesn't solve problem (there plenty of rselenium resp

javascript - Modular web design -

i've been looking nice way organize website, , i've found grunt, npm, gulp, , handful of other great things. i'm going can organize webpage using modules in html, css, , javascript, or way in methods listed. example: +-- files | +-- html | | +-- header.html | | +-- footer.html | | +-- content.html | +------- | | +-- styles | | +-- stylesheet.scss | | +-- fonts.css | +--------- | | +-- scripts | | +-- base.js | | +-- jquery.min.js | | +-- bootstrap.min.js | +---------- +------------- and (magic tool) magically merge javascript files 1 file, merge styles 1 file, , merge html components 1 file. tl;dr: organizing files getting complicated, magical way organize files needed, or project explode violently. cheers, a disorganized captain crunch tools grunt, npm, gulp you've mentioned build tools... use such tool called webpack bundle css , js files 1 big js file , minify it... find link webpack css bundler here kind of languages use: static h

event.stopPropogation not working as expected -

as know event.stoppropogation() used stop event bubbling i.e stop firing parent events in code it's not working. can please check that. <div onclick="diva();"> div <p onclick="pa();"> ppp <a onclick="aa();"> hello </a> </p> </div> <script type="text/javascript"> function diva(){ alert('div') } function pa(){ alert('p') } function aa(event){ event.stoppropogation(); alert('a') } </script> it's alerting p , div while should alert a. your event undefined .pass event follows : <a onclick="aa(event);"> function diva(){ console.log('div') } function pa(){ console.log('p') } function aa(event){ event.stoppropagation(); console.log('a') } <div onclick="diva();"> div <p onclick="pa();"> p <a onclick="aa(event);"> hello

java - Sound should only play once but plays twice instead -

i building app flash cards. when click "next" button plays sound(the name of card) , plays same sound if click on card. thing when click on "next" button plays sound twice, simultaneously, causing sound robotic. assume i'm calling sound twice accident don't know or how fix it. i've been looking on place can't find way fix this. here code: private string[] soundfile={"aa.m4a","bb.m4a... public void onclick(view arg0) {... //when btnplay clicked else if(arg0.getid()==r.id.imagenumber){ //call method playsound playsound(soundfile[screennumber].tostring()); }//end btnsound clicked //begin changecard private void changecard(int screen){ switch (screen){ case 0: imagenumber.setimageresource(aa); mediap2 = mediaplayer.create(this, r.raw.aa); break;... mediap2.start(); }//end changecard //begin playsound on click public void playsound(string soundname){ bool

javascript - How to determine if the date is full date and year only in JS -

i have regex code below validate valid date. function isvaliddate(div) { var reg = /^((0?\d)|(1[012]))\/([012]?\d|30|31)\/\d{1,4}$/; var regs = /^\/\d{1,4}$/; var datefield = $(div).val(); if (datefield == "") { //alert('invalid inclusive dates.'); return false; } else { if (reg.test(datefield) == false && regs.test(datefield) == false) { // alert('invalid inclusive dates.'); return false; } else { return true; } } } i testing code can see have 2 condition in if (reg.test(datefield) == false && regs.test(datefield) == false) { . in line testing if date full date(1/1/2017) or (2017) only. if input 2 different dates return false because of condition. how achieve this?. make day , month optional: var reg = /^(?:(0?\d|1[012])\/(0?[1-9]|[12]\d|30|31)\/)?\d{1,4}$/; // ^^^ ^^

javascript - Dropzone.js doesn't work in wordpress frontend posting -

i'm building front-end posting form on wp site. simplified code of form follows: <form id="new_post" name="new_post" method="post" action="/add-property-query/" enctype="multipart/form-data"> <!-- post name --> <fieldset name="name"> <label for="title">name:</label> <input type="text" id="title" value="testname" tabindex="5" name="title" /> </fieldset> <!-- images - _thumbnail_id --> <div class="images"> <label for="boss_thumbnail">front of bottle</label> <input type="file" name="boss_thumbnail" id="boss_thumbnail" tabindex="25" /> </div> <fieldset class="submit"> <butto

javascript - How to remove prefix in jquery id -

how remove prefix in jquery .? <td><span id="stu1" class="reject-student ">not selected</span></td> <td><span id="stu2" class="select-student ">selected</span></td> <td><span id="stu5" class="select-student ">selected</span></td> jquery: var selected = $(".select-student").map(function() { return this.id; }).get(); i have trid this: var selected = $(".select-student").map(function() { var id = $('span[id^="stu"]').remove(); return this.id; }).get(); i getting result stu1 stu2 want send 1 , 2.. how can that.? you don't need $('span[id^="stu"]').remove(); statement remove element. a simple solution use string.prototype.replace() method replace stu var selected = $(".select-student").map(function() { return this.id.replace('stu', ''); })

ionic framework - How can I crop an image by aspect ratio in Angularjs? -

i developing app need crop images. cropping features not same image. suppose have image 16:9, cropping allow in same ratio, if have image in different aspect ratio, lets 4:3 editor open same aspect ratio. how may it. ??? thank in advance of you.

php - How to return matches array and also result string using preg_replace? -

i need accomplish 2 things, , wondering if both can accomplished preg_replace. i need alter string. right using preg_replace: preg_replace($terms,$replace_with,$string,1); where $terms array of terms, , $replace_with array. but need return matches in separate array (to update other values later), because there several terms, don't know 1 has matched. the way know how accomplish this, run preg_match first, default returns matches array, , preg_replace replace string new values. is there way return string, , matches preg_replace only? my end goal, have altered $string (which accomplished preg_replace), array $terms matched. no, if $terms , $replace_with have numeric keys (without gaps) can use preg_replace_callback : $matches = []; foreach($terms $k=>$term) { $rep = $replace_with[$k]; $string = preg_replace_callback($term, function ($m) use ($rep, &$matches) { $matches[] = $m[0]; return $rep; }, $string, 1); } note

Bootstrap: How can I set the items of my nav bar horizontally? -

Image
can me please... i'm trying set menu items of nav horizontally. here's header: <meta charset=amp;quot;utf-8amp;quot;> <meta http-equiv=amp;quot;x-ua-compatibleamp;quot; content=amp;quot;ie=edgeamp;quot;> <meta name=amp;quot;viewportamp;quot; content=amp;quot;width=device-width, initial-scale=1amp;quot;> <script src="https://npmcdn.com/tether@1.2.4/dist/js/tether.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" /> and menu view: <nav class="navbar navbar-default"> <div class="container-fluid"> <div class="navbar-header"> <ul class="nav navbar-nav&quo

sql - Sqlite full text search keyword 'Match' not returning any result -

i working on full text search on sqlite using fts4 . in db have normal table notes , contains 33 records . i created virtual table using fts4 this create virtual table t3 using fts4(content="notes", user_notes); i querying this select user_notes t3 user_notes match 'important' and this select user_notes t3 t3 match 'important' but non of query working, why? getting empty result no error. the documentation says: the fts4 module never writes content table, , writing content table not affect full-text index. responsibility of user ensure content table , full-text index consistent. so when insert notes table, must insert t3 table. (if actual table filled, use rebuild fts command.)

javascript - Large Number of Node Modules after create-react-app eject -

i ran create-react-app eject because wanted use less on project. noticed after doing number of modules under node_modules in project had increased. started project create-react-app, , after creating app, noticed there huge number of modules under node_modules. after creating app no eject run. have tried reinstalling create-react-app, node, , npm, , nothing return node_modules default configuration. don't understand why ejecting 1 app affect configuration of future apps create.

How can I find maven property names for libraries? -

i have these properties defined in pom.xml - <properties> <project.build.sourceencoding>utf-8</project.build.sourceencoding> <powermock.version>1.6.2</powermock.version> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> <spring.artifact.version>4.1.7.release</spring.artifact.version> <logback.version>1.1.6</logback.version> </properties> i trying understand these properties names defined - powermock.version, logback.version? how know version of ch.qos.logback.core library determined logback.version property? looked information quite bit , found there many known properties maven.compiler.source , maven.compiler.target nothing explains version ones. maven properties value placeholder, properties in ant. values accessible anywhere within pom using notation ${x}, x property. your current usage 5th style

node.js - npm3 install breaks the flat structure if installing module from local folder -

i have following dependency tree: module_a@1.9.15 module_b@1.0.22 module_c@1.1.2 module_b@1.0.22 (the important part module_b dependency of both module_a , module_c) now when create initial npm install (npm3) resolved correctly using 1 instance of module_b in flat manner: module_a@1.9.15 module_b@1.0.22 module_c@1.1.2 now want reinstall module_b local folder after changing code able test (without having push module_b registry). following: npm install ../module_b (module_b resides locally in same folder module_a) but when unfortunately flat structure breaks , module structure looks this: module_a@1.9.15 /home/gsanta/ ├── module_b@1.0.22 invalid ├─┬ module_c@1.1.2 │ └── module_b@1.0.22 why working way? i'm still using same version of module_b (1.0.22) installed local folder. how npm determine if 2 dependent modules same version (it looks it's not version field in package.json)?

html - How do I remove the border of a image in Chrome? -

#test { width: 25px; height: 25px; background-color: #dddddd; border-radius: 50%; } <img src="" alt="" id="test"> in chrome, image have border safari doesn't have. way can remove in chrome? have tried adding css? border-style:none;

java - Server Tomcat v8.5 failed to start for hello world Jersey Web Service -

i setting jersey web service cant run, apache tomcat 8.5 error'ing out. see details below simple code, libs , error. i created dynamic web project... added jersey files... ( am missing any? ) javax.ws.rs-api.2.0.1.jar jersey-client.jar jersey-common.jar jersey-contaner-servlet.jar jersey-container-servlet.jar jersey-media-jaxb.jar jersey-server.jar my web.xml <?xml version="1.0" encoding="utf-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemalocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="webapp_id" version="3.1"> <servlet> <servlet-name>myapi</servlet-name> <servlet-class>org.glassfish.jersey.servlet.servletcontainer</servlet-class> <init-param> <param-name>jersey.config.server.provider.packages&l

c++ - CPP, 'X' button listener -

i'm writing cpp program, , want execute function when 'x'(shut down) button pressed. for example, have infinite loop prints same thing everytime iterates, until 'x' button pressed, , want execute function before process ends. is there kind of listener matter? or other solution maybe (like delaying process shut down few seconds or something)? thanks! if want execute before process ends, can register std::atexit handler. function called before process exits.

Python Pandas - Groupby and Mean, but keep column name -

i trying find mean of column each unique value in column, , using code: a_df = b.groupby('r')['l'].mean and mean value each value in 'r', mean values has no column name, cant sort on it. is there way of doing above does, give mean values column name can sort on it? thank you use parameter as_index=false or reset_index : a_df = b.groupby('r', as_index=false)['l'].mean() or: a_df = b.groupby('r')['l'].mean().reset_index()

unable to sync pouchDB with couchBase Sync Gateway -

i trying sync pouchdb couchbase through sync gateway, data added pouchdb, not initial data added couchbase. example there 750 docs in couchbase none of them synced pouchdb. http://localhost:4985/_admin/db/db not showing couchbase docs too. the problem adding data couchbase server directly. couchbase mobile requires metadata in order deal replication , conflict resolution. isn't handled server sdks. the recommended approach database writes through sync gateway. to simplify use php, may want use swagger php client. (you can see example of using clients autogenerated swagger in post . example use javascript , node.js, principles same.) you can read couchbase server directly if want (to n1ql query, example). another option use "bucket shadowing". trickier, , deprecated @ point. list completeness.

Add Custom Portlet in my Header Liferay 6.2 -

i want add custom porlet in header of liferay, don't know how it. i know can add content in portal....vm. entire portlet.. is possible ? thanks in advance. of course possible !! have embed portlet thema header or leave space able enter there portlet #set ($portlet_id = '73') #set ($instance_id = 'e3j7') #set ($my_portlet_id = "${portlet_id}_instance_${instance_id}) you need portlet id able use in header documentacion: https://web.liferay.com/es/community/wiki/-/wiki/main/embedding+a+portlet+in+the+theme

Share intent to perform multiple share at the same time in android? -

suppose have text file , want share device via bluetooth,wifi-direct,online etc.by building list , using checkboxes can select preferred modes of transfer. is possible share file of them in 1 click of button , gets transferred of them via above selected options? i know in android, share-intent 1 option can used once @ time.

How to write unit test for the helper in Meteor Mocha [ Closed ] -

how test following checkuser helper 2 parameters currentuser.username , username using mocha (a javascript test framework) <div class="col-sm-1"> {{#if checkuser currentuser.username username }} <button class="btn btn-small btn-danger my-delete-btn pull-right"><span class="glyphicons glyphicon glyphicon-trash"></span></button> {{/if}} </div> welcome so. before ask (way general) question on how solve problem, should first research , write code. if stuck in specific part of coding (like unexpected error thrown , can't traced back) may ask question. also read when, when not , how ask question on so: https://stackoverflow.com/help/on-topic https://stackoverflow.com/help/dont-ask https://stackoverflow.com/help/mcve regarding question, may read " how write simple blaze unit test " part of meteor test guide .

ios - how to make UIView with equal width and height with SnapKit in Swift? -

i want make uiview rectangular snapkit in swift, this lazy var customview: uiview = { let view = uiview(frame: cgrect()) self.addsubview(view) view.snp.makeconstraints({ (make) in make.left.top.bottom.equaltosuperview().inset(self.inset) make.width.equalto(make.height) // error in line }) return view }() you have use view.mas_height instead of make.height : lazy var customview: uiview = { let view = uiview(frame: cgrect()) self.addsubview(view) view.snp.makeconstraints({ (make) in make.left.top.bottom.equaltosuperview().inset(self.inset) make.width.equalto(view.mas_height) // <--- }) return view }()

node.js - node js : ftp multiple files -

i files (json , txt files) remote machine show details on web page after loggin in. recreated intermediate page ftp file , on successful response show next page. i use https://www.npmjs.com/package/ftp package ftp file. can 1 file 1 connection. function there mget function? like multiple files different file names , extensions sample code var client = require('ftp'); var fs = require('fs'); var c = new client(); c.on('ready', function() { c.get('foo.txt', function(err, stream) { if (err) throw err; stream.once('close', function() { c.end(); }); stream.pipe(fs.createwritestream('foo.local-copy.txt')); }); }); // connect localhost:21 anonymous c.connect();

Fetch contact from MS Dynamics CRM Web API with PHP -

Image
i'm using jamesmcq's library ( https://github.com/jamesmcq/oidc-aad-php-library ) connect , fetch contacts data microsoft dynamics crm online php. have logged in via oauth , got token, when i'm trying access crm web api access_token, got following exception: aadsts65001: user or administrator has not consented use application id 'xxxxxx-xxxxxx-xxxx-xxx-xxxxxxx'. send interactive authorization request user , resource. i found answer: https://stackoverflow.com/a/34885153/1305261 , have access new azure portal, not classic, have no idea can find settings guy talked about. besides, found similar under azure active directory menu, , granted access permissions, exception still there. can me how can fix error? updated: here's setup app's privileges: in new azure portal can access screen following next steps: azure active directory app registrations select application required permissions from there, can add new permission: update

angularjs - how to insert data into database using MEAN stack (MySQL, Express, Angular, Node) -

how insert data database using mean stack (mysql, express, angular, node)? facing problem @ time of insertion. please me solve this. here code. i'm newbie in mean. index.html <html ng-app="bookitnow"> <head> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> <title> registration page </title> </head> <body> <div class="container" ng-app="bookitnow" ng-controller="myctrl"> <h1>register</h1> <form method="post"> <div class="form-group"> <input type="text" class="form-control" id="firstname" ng-model="fname" placeholder="first name" required> </div> <div class="form-group"> <input type="text" class="form-control" id="lastname"

Wordpress and Woocommerce - unable to add gallery -

i having strange issue when trying open media modal woocommerce product. basically, modal won't show up. i running fresh install of wordpress ( v4.6.1 ) , woocommerce. theme custom theme (with correct woocommerce declaration on functions.php file) i' ve tried following: disable plugins - still not working revert theme - still not working change permalinks both posts , products - still not working create new products - still not working and checked following: dev console - no errors thrown apache2 error log - again, clear, no errors. apache2 access log - no errors, still clear. something odd i've noticed, actual link: when click on add product gallery, page refreshes because link following: "http://10.254.237.107/wp-admin/post.php?post=9675&action=edit" while if try add featured picture (that opens same modal) link correct , modal shows correctly: "http://10.254.237.107/wp-admin/media-upload.php?post_id=9675&type=imag

osx - Zipped Signed Mac Application is broken after unzipping -

i have 3 mac application namely a.app, b.app , c.app in folder. 3 application signed using same certificate. zipped folder containing 3 application , uploaded google drive. in system, downloaded zip file google drive , unzipped it. applications a.app , b.app working application c.app broken , mac suggesting me move trash. 3 applications working in developer machine. i followed suggestion zip , unzipping of folder provided in stackoverflow. still results futile. code signed mac app broken after downloading one more reference looked issue. http://shreerangsblog.blogspot.in/2012/08/code-signing-on-mac-without-xcode.html kindly me resolve issue.

angular - Nativescript: Cannot overwrite ActionBar in template -

i learning nativescript , want implement sample android app angular2. when route component shall overwrite default visible startpage actionbar in template custom title , navigation button, nothing happens. my component custom actionbar: @component({ template: ` <actionbar title="customtitle"> <navigationbutton text="back" android.systemicon="ic_menu_back"></navigationbutton> </actionbar> <stacklayout> <label text="hello world" textwrap="true"></label> <page-router-outlet></page-router-outlet> </stacklayout> ` }) export class testcomponent {} the title can changed programmatically page.actionbar.title = "mygoals" , dont want in case. i tried lean on nativescript actionbar doc , sample groceries seem implement similarly. what must done differently change actionbar in template android app? update when take th

mysql - How to use PHP display data of last insert row of a specific column -

i have table in database 2 columns, id(auto increment) , name. id|name --|---- 1 |john 2 |jeff 3 |jack i wish show last insert name in webpage can echo "the last person $last_name"; i try retrieve data using following command, shows nothing. $last_name = mysqli_query($conn, 'select name namelist order id desc limit 1') someone please help? thank you. try this... if procedural $query = "insert mycity values (null, 'stuttgart', 'deu', 'stuttgart', 617000)"; mysqli_query($conn, $query); mysqli_insert_id($conn) if object oriented $query = "insert mycity values (null, 'stuttgart', 'deu', 'stuttgart', 617000)"; $mysqli->query($query); $mysqli->insert_id for more... http://php.net/manual/en/mysqli.insert-id.php

jmeter - How to improve performance of application for inserting list in elasticSearch? -

i have 2000 entries in list , trying insert list elasticsearch api nothing bulk request. please find below code same. for(car car : carlist){ elasticsearchservice.addorganization(car,"car"); } code elasticsearch service @autowired private client esclient; private void addorganization(object object, string modelname){ gson gson = new gson(); final string json = gson.tojson(object); esclient.prepareindex("elasticsearchindex",modelname).setsource(json).execute().actionget(); } have made following entry in elasticsearch.yml file threadpool: index: size: 250 queue_size: 1000 as monitoring performance of application through jmeter, found our application generates 2000 http requests connect , put data in elasticsearch takes around 10 seconds task.can make connectionpool in esclient or there way configuration @ elasticsearch server perf

html - How to scroll UIlabel Text and set it width and Hight dynamically in objective c -

i new in ios , facing problem scroll label text.my code able scroll label text width not setting properly. code this nsstring * htmlstring = @"<html><body>"; nsstring *htmlstring2=@"</body></html>"; newstring=[nsstring stringwithformat:@"%@%@%@",htmlstring,result,htmlstring2]; nslog(@"new string =%@",newstring); nsattributedstring * attrstr = [[nsattributedstring alloc] initwithdata:[newstring datausingencoding:nsunicodestringencoding] options:@{ nsdocumenttypedocumentattribute: nshtmltextdocumenttype } documentattributes:nil error:nil]; nslog(@"string value = %@",result); // [mydatansmarray addobject:idarray]; shortnamearray=[[nsmutablearray alloc]init]; shortnamearray=[responsedict valueforkey:@"abc"]; if (ui_user_interface_idiom() == uiuserinterfaceidiompad) { lbl = [[uilabel alloc]initwithframe:cgrectmake(0,0,700, 1800)]; nsstring

javascript - How i can can map an large object to an array in es6 -

this question has answer here: converting js object array using jquery 17 answers suppose have large object var object = { a: 1, b: 2, c: 3, d:4, e:5, f:6, g:7, h:8, i:9, j:10 ...}; var array = []; output [1,2,3,4,5,6,7,8,9,10...] how can map object array in es6 ? please me. you use keys, order them , return value in array. var object = { a: 1, b: 2, c: 3, d:4, e:5, f:6, g:7, h:8, i:9, j:10}; var array = object.keys(object).sort().map(k => object[k]); console.log(array);

sql - How to remove duplicates from space separated list by Oracle regexp_replace? -

i have list called 'a b a c d'. expected result 'a b c d'. far web have found out regexp_replace(l_user ,'([^,]+)(,[ ]*\1)+', '\1'); expression. , separated list. modification need done in order make space separated list. no need consider order. if understand don't need replace ',' space, remove duplicates in smarter way. if modify expression work space instead of ',', get select regexp_replace('a b a c d' ,'([^ ]+)( [ ]*\1)+', '\1') dual which gives 'a b c d' , not need. a way needed result following, bit more complicated: with string(s) ( select 'a b a c d' dual) select listagg(case when rn = 1 str end, ' ') within group (order lev) ( select str, row_number() on (partition str order 1) rn, lev ( select trim(regexp_substr(s, '[^ ]+', 1, level)) str, level lev

php - 'NoDecodeDelegateForThisImageFormat `PDF' -

i trying convert pdf png or jpeg creating thumbnail, have downloaded , installed imagemagick , tried install ghostscript(ghostscript9.20) installed in "c:\program files(x86)\gs.." then getting error fatal error: uncaught exception 'imagickexception' message 'nodecodedelegateforthisimageformat `pdf' @ error/constitute.c/readimage/501' in c:\xampp\htdocs\pdf\imagik.php:5 stack trace: #0 c:\xampp\htdocs\pdf\imagik.php(5): imagick->__construct('c:\xampp\htdocs...') #1 {main} thrown in c:\xampp\htdocs\pdf\imagik.php on line 5 i new imagemagick , ghostscript, have searched lot solving problem , found simmiler solution , need happen in windows 7 xampp 5.5.19. here php code <? php $im = new imagick( 'c:\xampp\htdocs\pdf\db-intro.pdf[1]' ); // convert jpg $im->setimagecolorspace(255); $im->setcompression(imagick::compression_png); $im->setcompressionquality(60); $im->setimageformat('png'); //resize $im-&g

python - Whoosh strict exact phrase matches with special characters -

i'm using whoosh index 100k+ documents because want run many literal phrase queries special characters such "a" vancouver island or !action pact! . i've created index using: schema = schema(path=id(stored=true), content=text(analyzer=analysis.standardanalyzer(stoplist=none))) and i've tried running searches using phrase as query, , using spannear2 . neither return correct matches. not want results similar !action pact! , want match if text contains !action pact! , word word, special character special character, including spaces.

ios - How to search through iPhone filesystem downloads folder for mp3 files in react native -

i'm working on react native ios app want through iphone's downloads folder .mp3 files can play. i've found library react-native-fs right able see files added app , can't figure out how search .mp3 files on iphone. advice on libraries use or code appreciated. code project: https://github.com/laybium/laybium in ios apps have access sandboxes. there's no such thing downloads folder, because there's no folder apps may share.

html - CSS not found for web app using Apache Tomcat 7.0 -

i have web app have been developing within eclipse ide , have been testing using tomcat sever, within eclipse. throughout development i've had no issues css files being inaccessible. now i'm @ point i'm using standalone instance of apache tomcat , css files not found? when try access them via url 404 error produced. location of css file within project appears make no difference; have tried in css/ folder , in root folder of unfiltered pages. i don't believe issue link i'm referring files with. css & page location -- opportunitytracking (unpacked .war) -- webapps -- login.xhtml -- bootstrap.css css reference in login.xhtml <link rel="stylesheet" type="text/css" href="/opportunitytracking/bootstrap.css" /> web.xml <display-name>opportunitytracking</display-name> ... <mime-mapping> <extension>css</extension> <mime-type>text/css</mime-type> &l

apache2.4 - mod_auth_openidc build steps on windows 64bit -

i trying compile mod_auth_openidc module on windows 7 64bit os got source code source code github i tried build module using visual studio 2015 throwing error "you must use gnu compiler". last few days trying build in windows ... could please me build module in windows or if 1 done in windows can please share build steps. thanks... it best download binary compiled windows release page if insist can follow guidelines from: http://wgsnetman.blogspot.nl/2013/04/building-apache-244-from-unix-source.html lot of adaptations/workarounds...

Basic Bash pipe tricks -

i'm going run short demonstration of linux audience of 9-10 y.o children @ school. guess none has never seen shell, fun of them i'd show how many things can achieve one-liner pipe. i'd start with: echo "hello world" and then: echo "hello world" | figlet echo "hello world" | rev echo "hello world" | mail johndoe@gmail.com can suggest me one-liner can use echo ? lot! if have access netcat ( nc ) , browser can this: echo "hello world!" | nc -l localhost 2888 then open browser on http://localhost:2888/ see message.

android - Firebase upload audio exceptions -

i'm trying upload mp3 audio file firebase emulator , few exceptions. file exist in "file manager"-> "downloads" directory. permissions "internet" , "read_external_storage. @override public void onclick(view view) { intent intent = new intent(); intent.settype("audio/*"); intent.setaction(intent.action_get_content); startactivityforresult(intent,req_code); } @override protected void onactivityresult(int requestcode, int resultcode, intent data) { storagemetadata metadata = new storagemetadata.builder() .setcontenttype("audio/mp3") .build(); firebasestorage fbstorageinstance = firebasestorage.getinstance(); storagereference storagereference = fbstorageinstance.getreferencefromurl("gs://myfirebase-a8d58.appspot.com"); uri fileuri = data.getdata(); storagereference audioref = storagereference.child("audio/" + fileuri.getlastpathsegment());

mysql - Getting column name ambigous -

i have query in getting column 'month' ambigious . trying following query. please check nd me. select sc.name sc, b.name brand, count(t.id) tc, sum(if(is_category_present = 1, 1, 0)) base outlet_categories oc inner join transactions t on oc.outlet_id = t.outlet_id inner join outlets o on o.id = t.outlet_id inner join brands b on t.brand_id = b.id inner join sale_channels sc on sc.id = o.sale_channel_id t.month = month qualify column names. not clear right names are, these need table aliases: select sc.name sc, b.name brand, count(t.id) tc, -------^ looks aggregation query, there no `group by`. sum(if(is_category_present = 1, 1, 0)) base --------------^ outlet_categories oc inner join transactions t on oc.outlet_id = t.outlet_id inner join outlets o on o.id = t.outlet_id inner join brands b on t.brand_id = b.id inner join sale_channels sc on sc.id = o.sale_ch

Wait for the content to fadeIn a div with jquery ajax -

i have div, button. when press button fadeout() div i load content page, jquery ajax() when content loaded, want put content div only then, fadein() div. for now, use this: success: function (data) { $('#inside-choice').html(data); $('#inside-choice').fadein('slow'); }, but syntax, fade in can start before content totally loaded. how wait until content loaded before fading in div? use promise() : success: function (data) { $('#inside-choice').html(data).promise().done(function(){ $('#inside-choice').fadein('slow'); }); }, https://api.jquery.com/promise/

How is it possible to smoothing the edges of an image using CSS? -

Image
when tried add image in website edges feel rough. ( note: in above image can see rough surface around berry). this happened when removed background using image editor.is possible smooth edges using css? if yes,then how? thanks in advance...!!! don't try fix using css. instead use png24 (not png8 or gif) because has proper alpha (transparency) , remove background colour using background colour alpha mask (or similar technique). you can free software gimp if don't have photoshop edit: noticed it's available svg , why aren't using that?

html - Put a Cytoscape graph inside a Bootstrap column -

i have 4 bootstrap columns: col-lg-1, col-lg-1, col-lg-4 , col-lg-6 (from left right). in biggest column (col-lg-6), have cytoscape graph. cytoscape style following (in <head> section): <style type="text/css"> #cy { height: 80%; width: 50%; position: absolute; left: 40%; top: 20%; background:red; } </style> then in body section, have leftmost column: <div id="cy" class="col-lg-6" style="background-color:grey;"> text </div> finally, have script in body section of html document: <script type="text/javascript"> $( document ).ready(function() { var cy = cytoscape({ container: document.getelementbyid('cy'), ..... }); }); </script> the problem cytoscape graph (and leftmost column) doesn't stack below other columns when browser resizes (as expected in bootstrap behavior). can please show me somehow detailed solution thi

Is there a way to use xpath 2.0 on Sonarqube? -

i need validate rule on xml , need regex feature, found on xpath 2.0. downloaded last sonarqube 6.1, xpath continue being version 1.0. there way use version 2.0? from quick @ source code (org/sonar/api/utils/xpathparser.java) looks me if application using jaxp service api instantiate xpath parser. see happens if you (a) put saxon on classpath, , (b) set value of system property "javax.xml.xpath.xpathfactory" value "net.sf.saxon.xpath.xpathfactoryimpl" note step (a) on own isn't enough, because saxon no longer nominates xpath parser using meta-inf mechanism - causing many problems applications written assume use of xalan. this may or may not succeed in picking saxon, , if pick saxon, may or may not succeed in running it. there other problems - example, note xpathparser class in sonarqube creates dom namespaceaware set false, isn't start.

c++ - Failure to find MyClass.cpp -

i have project, looks this: structure: myproject --- myproject.pro --- .qmake.conf --- src --- src.pro --- tmp --- myclass.cpp --- myclass.h myproject.pro template = subdirs subdirs = src .qmake.conf top_dir=$$pwd src.pro ... includepath += "$$top_dir/src/tmp/" sources += myclass.cpp headers += myclass.h ... now if try run qmake i'm getting warning failure find myclass.cpp . there way can tell qmake should *.cpp/h files? i using qt 5.7 (which means dependpath won't work). include paths ( includepath ) used include statements inside cpp/header file. those: #include <someheader> for project file have specify relative path. sources += tmp/myclass.cpp

office365 - No mailbox was found that includes the external directory object ID that was specified when using direct authorization -

when access graph api using graph explorer logged on work account following rest call works without problems https://graph.microsoft.com/v1.0/groups('42bc2ab5-230f-475c-8663-7c319d0b6696')/conversations?expand=threads(expand=posts) the guid id of office 365 group when try accessing using direct authorisation of used following guide configure windows console app https://azure.microsoft.com/en-gb/documentation/articles/active-directory-v2-protocols-oauth-client-creds/ the following 404 error returned following json response. { "error": { "code": "errornonexistentmailbox", "message": "no mailbox found includes external directory object id specified.", "innererror": { "request-id": "e8a5f034-3e8c-496c-896e-250acea6fe1c", "date": "2016-10-26t10:16:27" } } } if access group directly using following rest call works ok https://graph.mic