Posts

Showing posts from June, 2013

javascript - Trying to redirect to the same page but with querystring value -

i want redirect same page, add querystring values. if there querystring value, want strip out , add new one. my code isn't working currently, not sure why: var url = window.location.href; if(url.indexof("?") > 0) { url = url.substring(0, url.indexof("?")); } else { url += "?joined=true"; } window.location.replace(url); the problem you're not adding new query string when strip off old one, in else clause when there's no old query string. take addition out of else , time. var url = window.location.href; if(url.indexof("?") > 0) { url = url.substring(0, url.indexof("?")); } url += "?joined=true"; window.location.replace(url);

How to programmatically tell `Spring Boot` to load configuration files from `custom location` when doing JUNIT Test -

how programmatically tell spring boot load configuration yaml files custom location when doing junit test. in program, use properties of springapplicationbuilder specify custom yaml file . @configuration @springbootapplication @componentscan public class samplewebapplication { public static void main(string[] args) { configurableapplicationcontext applicationcontext = new springapplicationbuilder(samplewebapplication.class) .properties("spring.config.name:application,conf", "spring.config.location=classpath:/viaenvironment.yaml") .build().run(args); configurableenvironment environment = applicationcontext.getenvironment(); system.out.println(environment.getproperty("app.name")); } } when doing junit test, how should configure it? i'm using spring boot 1.5.1 . please use option set spring.config.location through @testpropertysource: @testpropertysource(properties = { "sprin

Azure AD Graph API and Microdoft Graph API -

i observing latency audit events in azure ad (via reporting api of azure ad graph api) running 90-180 mins range. know if behavior observing consistent other users/customers. , in case, indeed technical problem @ microsoft end, know if temporary issue , relevant team working on it. there reason ask question. observe direction microsoft instead go microsoft graph api ( strong recommendation, see note on page  https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-graph-api ). so, in light of this, strong recommendation, know if latency issue on azure ad graph api (reporting api), fixed in near future there less focus on azure ad graph api now? regarding microsoft graph api itself, have few questions. 1) know if supports audit events on ad? if yes, can please guide on how work on prototype? 2) if answer above question yes, know if there going latency issue here well? if yes, know range of latency talking here?

php - Accessing wordpress multisite without www. sets the site url multiple times in browser bar -

when access domain: www.example.com without www. site automatically loop site url multiple times in browser bar. in browser bar before hitting enter: example.com after hitting enter: www.example.com/www.example.com/www.example.com/www.example.com/www.example.com/www.example.com/www.example.com/www.example.com/www.example.com/www.example.com/ this works fine: www.example.com i've set wordpress multisite network 3 domains. i have code in wp-config.php file define('wp_allow_multisite', true); define('multisite', true); define('subdomain_install', true); define('domain_current_site', 'www.example.com'); define('path_current_site', '/'); define('site_id_current_site', 1); define('blog_id_current_site', 1); define('noblogredirect', 'www.example.com/'); /* had set because redirected login page every time */ define('admin_cookie_path', '/'); define(&

php - Chat box Scroll to Down always to last line -

i new jo jquery php , sql programmer. have created custom chat system in newely created website. now, working good. wish keep scroll last message always. have tried many codes stackoverflow. no 1 working. found 1 code works perfect. want make bit change in it. if can me here code is window.setinterval(function() { var elem = document.getelementbyid('chat'); elem.scrolltop = elem.scrollheight; }, 1000); this working perfect me. puts user bottom scroll , keep automatically scrolling down time interval of 1 second. but issue facing when want read old messages scroll top manually. not allowing me so. keeps self bottom. please 1 can make changes in if manually scroll up, auto scroll stop. hope soon

android - FirebaseDatabaseException: Cant convert object of type java lang long to type -

found in stack trace, problem? can this. trying retrieve object firebase using recyclerview. my logcat com.google.firebase.database.databaseexception: can't convert object of type java.lang.long type ysy.spreadsheet.databaseview @ com.google.android.gms.internal.zzbqi.zze(unknown source) @ com.google.android.gms.internal.zzbqi.zzb(unknown source) @ com.google.android.gms.internal.zzbqi.zza(unknown source) @ com.google.firebase.database.datasnapshot.getvalue(unknown source) @ com.firebase.ui.database.firebaserecycleradapter.parsesnapshot(firebaserecycleradapter.java:151) my structure public class databaseview { private integer bodytemp; private integ

php - Sylius/Payum/Stripe config error "boolean sandbox option must be set" -

i have set stripe gateway, when try submit payment user, error, "the boolean sandbox option must set." not error paypal, stripe. here relevant config.yml entries: payum: gateways: paypal_express_checkout: factory: "paypal_express_checkout" payum.http_client: "@sylius.payum.http_client" username: "%paypal.express_checkout.username%" password: "%paypal.express_checkout.password%" signature: "%paypal.express_checkout.signature%" sandbox: true stripe: factory: stripe_checkout publishable_key: pk_test_1uyhcw3tydyjdxylvagprmkh secret_key: sk_test_81j9puwh2ftnrogotik0hjlb sandbox: true sylius_payment: driver: doctrine/orm gateways: stripe: stripe what doing wrong? (also, not real keys) there typo in paypal section of parameters.yml file. guess breaking conf

python - Installing Ta-lib creates gcc error any assistance appreciated -

i getting gcc error when trying install ta-lib global package on mac. i error below: gcc -wno-unused-result -wsign-compare -wunreachable-code -dndebug -g -fwrapv -o3 -wall -wstrict-prototypes -i//anaconda/include -arch x86_64 -i//anaconda/include -arch x86_64 -i//anaconda/lib/python3.6/site-packages/numpy/core/include -i/usr/include -i/usr/local/include -i/opt/include -i/opt/local/include -i//anaconda/include/python3.6m -c talib/common.c -o build/temp.macosx-10.7-x86_64-3.6/talib/common.o talib/common.c:242:10: fatal error: 'ta-lib/ta_defs.h' file not found #include "ta-lib/ta_defs.h" ^ 1 error generated. error: command 'gcc' failed exit status 1 i not sure understand means? pip install ta-lib package missing file? make sense installs fine ubuntu server, having issues mac. ubuntu running python anaconda same version. my gcc version below: ➜ ~ gcc /usr/bin/gcc ➜ ~ gcc --version configured with: --prefix=/applicati

filter object and return count in jasmine -

i'm new jasmine-karma. trying figure out how execute below scenario. this works fine describe("jasmine.objectcontaining", function() { var foo; beforeeach(function() { foo = { a: 1, b: 2, bar: "baz" }; }); it("matches objects expect key/value pairs", function() { expect(foo).toequal(jasmine.objectcontaining({ bar: "baz" })); }); }); but if change object array of objects doesn't work. so, how filter array of objects , return count. eg. describe("jasmine.objectcontaining", function() { var foo; beforeeach(function() { foo = [{ a: 1, b: 2, bar: "baz" }, { a: 1, b: 2, bar: "bdd" } ]; }); it("matches objects expect key/value pairs", function() { expect(foo).//find object(s) containing bar:"baz" , sh

cookies - How to access protected OData resources from c# application using Microsofts OData v4 Client T4 Code Generator -

i have website exposes odatas $metadata further requires request authenticated (using cookie). i want access console app, not browser. i using microsofts odata v4 client code generator. 1) create wrapper around provided container created odata client code generator. 2) log in , cookie need authentication 3) add hook request builder, can apply cookies @ request time. app, needed cookie name .aspnet.applicationcookie here full working example. can instantiate container user , password needed defined @ bottom. must match whatever controller @ login api expecting. using nito.asyncex; using system; using system.linq; using system.net; using system.net.http; using system.net.http.headers; using system.threading.tasks; namespace myappodataodataservice.default { public class myappodatacontainer : container { public cookie[] _myappodataauthcookie; public string cookieauthname = ".aspnet.applicationcookie"; private string baseu

node.js - Confusing with call back in node js -

i have query in nodejs. please modify code such way query database each iteration , store each time result in result array. , send callback function after loop execution finished.when trying place callback(result) after result.push(data) works send rows.length times because of loop. function query_database(req,callback){ result=[]; class_code=req.body.class; branch=req.body.branch; year=req.body.year; start_date=req.body.start_date; end_date=req.body.end_date; flag=false; query='select id,rollno student branch="'+branch+'" , class="'+class_code+'" , year="'+year+'"'; //console.log(query); connection.query(query, function(err, rows, fields) { if (!err){ query_total_working_days(start_date,end_date,branch,class_code,year,function(err,data){ if(err){ } else{ total_days=data; for(index=0;index<rows.length;index++){

oracle - With clause not working with union -

my query result union of several queries. facing below error when use clause within union. ideas why? select column1 table_a union abcd (select * table_b) select column2 table_a a, abcd abcd.m_reference = a.m_reference ora-32034: unsupported use of clause 32034. 00000 - "unsupported use of clause" *cause: inproper use of clause because 1 of following 2 reasons 1. nesting of clause within clause not supported yet 2. set query, clause can't specified branch. 3. clause can't sepecified within parentheses. *action: correct query , retry just define cte first, before actual union query. use regular table: with abcd (select * table_b) select column1 table_a union select column2 table_a inner join abcd on abcd.m_reference = a.m_reference you can use multiple cte follows: with cte1 (...), cte2 (...) select * ...

php - laravel | eloquent foreach not working -

i trying retrieve non admin users user table. $agents = user::where('is_admin','=', 'false')->get(); //didn't work foreach ($agents $agent=>$value) { echo "{$agent}=>{$value}"."<br>"; } //tried dumping dd($agents); but didn't work tried dumping variable check if had results, have 1 non-admin of now: , here output collection {#219 ▼ #items: array:1 [▼ 0 => user {#222 ▼ #casts: array:1 [▶] #fillable: array:6 [▶] #hidden: array:2 [▶] #connection: null #table: null #primarykey: "id" #keytype: "int" +incrementing: true #with: [] #perpage: 15 +exists: true +wasrecentlycreated: false #attributes: array:10 [▶] #original: array:10 [▶] #dates: [] #dateformat: null #appends: [] #events: [] #observables: [] #relations: [] #touches: [] +timestamps: true

jquery - How to add data-dismiss inside button tag? -

<button aria-hidden="true">close</button> i have button tag in html. want add <data-dismiss="modal"> inside button tag jquery become <button data-dismiss="modal" aria-hidden="true">close</button> . there way it? $('button').attr("data-dismiss","modal"); .attr takes 2 parameters, attribute , value .

mobile - Android custom ROMs - why so few supported devices? -

looking @ supported devices list of various custom android roms, baffled why there few (examples here: replicant, copperheados). in understanding, roms supported device list should based on particular chipsets/processors (or instruction sets if will). since mobile hardware dominated handful of vendors (eg qualcomm, samsung) , instruction sets should not many either, how come more devices not supported? re-phrase of question can be: how can (eg) qualcomm msm8996 phone on 1 rom's supported devices list, while same chipset absent? missing? often times not worth developing roms devices can't have bootloader unlocked, because rom can't flashed anyway. instance, verizon variants of phones extremely difficult unlock bootloader on. if there no bootloader unlock available, rom development non existent.

c# - Pivot query across 3 tables in SQL Server -

i can't head around solution following problem: have 3 tables (ms sql): machines +-----------+-------------+ | machineid | machinename | +-----------+-------------+ | 1 | press 1 | | 2 | press 2 | | 3 | press 3 | +-----------+-------------+ parts +-----------+-------------+ | partid | partname | +-----------+-------------+ | 1 | part 1 | | 2 | part 2 | | 3 | part 3 | +-----------+-------------+ machinepartassign +----+-----------+--------+--+ | id | machineid | partid | | +----+-----------+--------+--+ | 1 | 1 | 1 | | | 2 | 1 | 2 | | | 3 | 1 | 3 | | | 4 | 2 | 2 | | | 5 | 3 | 2 | | | 6 | 3 | 3 | | +----+-----------+--------+--+ and thats want query result: (if machine , part assigned, case when there matching row in machinepartassign true (or 1 ), otherwise should false (or 0 ). insert 1 row e

mysql - PHP running move_upload_file command in OS -

Image
i using mac , run php , found image didn't go upload/ dir. it create 9 sub-files in "upload". "flipped images" ,"original files","pddf files", "tiff images","rotated images,"jped files","processed images". , save image in 1 of sub-file. so can't retrieve file. because don't know image save. don't know how happen. , mac come out many alert. any method can make image 1 file. much. <?php if ($_files["file"]["error"] > 0) { echo "error: " . $_files["file"]["error"];} else{ echo "檔案名稱: " . $_files["file"]["name"]."<br/>"; echo "檔案類型: " . $_files["file"]["type"]."<br/>"; echo "檔案大小: " . ($_files["file"]["size"] / 1024)." kb<br />"; echo "暫存名稱: " . $_files["file"]["tmp_

angular - How to Object Data from child component to parent component -

i want pass object data child component parent component. <section class="grey_bg"> <app-search></app-search> <table> <tbody> <tr *ngfor="let contest of contests"> <td>{{contest.contest_date}}</td> <td>{{contest.prize_pool}}</td> <td>{{contest.points}}</td> <td>${{contest.entry_fee}}</td> </tr> </tbody> </table> get data child component search component has selected app-search has contest data this.authservice.getusercontests().subscribe( contests => { this.contests = contests.data } the easiest ways share information between parent , child components can found in cookbook provided angular team. the specific technique should focus on, output() via eventemitter described here .

javascript - stop autoslide from boostrap carousel with thumbnails -

i trying stop autoslide bootstrap carousel corresponding jsfiddle example. whereas $('.carousel').carousel({ interval: false }); stops main carousel, dident find way stop autosliding thumbnail part. $(document).ready(function() { var totalitems = $('#carousel .item').length; var thumbs = 3; var currentthumbs = 0; var = 0; var thumbactive = 1; function togglethumbactive (i) { $('#carousel-thumbs .item>div').removeclass('active'); $('#carousel-thumbs .item.active>div:nth-child(' + +')').addclass('active'); } $('#carousel').on('slide.bs.carousel', function(e) { //var active = $(e.target).find('.carousel-inner > .item.active'); //var = active.index(); var = $('#carousel .item.active').index()+1; var next = $(e.relatedtarget); = next.index()+1; var nextthumbs = math.ceil(to/thumbs) - 1; if (nex

mongodb - How to delete depricated string fields in options document? -

lets have collections 'testcol' document validation options in options document. { "name" : "testcol", "type" : "collection", "options" : { "validator" : { "$or" : [ { "phone" : { "$type" : "string" } }, ] }, "validationlevel" : "moderate", "validationaction" : "error" }, ... } lets want delete these options (i aware can set 'validationlevel' 'off'). can run db.runcommand('colmod'': testcol', validator: {}) , mongodb delete field 'validator' options document. can't same 'validationlevel' , 'validationaction'. db.runcommand('colmod'': testcol', validationlevel: '')

How do I display a JavaScript variable inside my HTML tags in JSP? -

i have function gets original string , slice it. how display results in html? function parsingfunction() { var originalstring = entity.getgenresolr(); var results = originalstring.slice(1, -1); return results; } </script> <div class = "option_title_summary_summary"> <p>genre list: ${parsingfunction}</p> well code using incorrect because can't update html javascript variables way, have update html javascript instead. your code this: function parsingfunction() { /*var originalstring = entity.getgenresolr(); var results = originalstring.slice(1, -1); return results;*/ return ["aaa", "bbb", "ccc"].join(" -- "); } document.getelementbyid("genrelist").textcontent = "genre list: " + parsingfunction(); <div class="option_title_summary_summary"> <p id="genrelist"> </p> i commented old code avo

recyclerview - I want to display pictures with variable width and sizes from picaso in android using staggered Grid Layout like below picture -

enter image description here i have used normal stgerredgridview : recyclerview.setlayoutmanager(new staggeredgridlayoutmanager(3, 1)); and layout file android:id="@+id/card_view" android:layout_gravity="center" android:layout_margin="10dp" android:elevation="3dp" android:layout_width="wrap_content" android:layout_height="wrap_content" card_view:cardusecompatpadding="true" card_view:cardcornerradius="8dp" android:layout_marginbottom="16dp"> <relativelayout android:layout_width="match_parent" android:layout_height="match_parent" > <imageview android:id="@+id/bookimage" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="?attr/selectableitembackgroundborderless

tomcat - Putting webapp from ${appBase}/test to root context -

i'm trying put webapp defined e.g. ${catalin.home}/webapps-test/test root context (available in host defined in server.xml test.mydomain.com appbase=webapps-test) here snippet server.xml: <host name="test.mydomain.com" appbase="webapps-test" unpackwars="false" autodeploy="false"> <valve classname="org.apache.catalina.valves.accesslogvalve" directory="/var/log/tomcat-test" prefix="jutarnji_access" suffix=".log" rotatable="false" pattern="%h %l %u %t &quot;%r&quot; %s %b %m %u %d &quot;%{referer}i&quot; &quot;%{user-agent}i&quot; &quot;%{host}i&quot;"/> </host> i'm trying define test.xml in ${catalin.home}/conf/catalina/test.mydomain.com/test.xml: <context path="" reloadable="true" /> but not working, webapp still @ http://test.mydomain.com/test/ , , not in root. i know h

How to order column names of r dataframe with respect to other dataframe column order -

this question has answer here: order column names [closed] 2 answers ordering columns of data frame 2 answers i have r dataframe column orders follows name,id,class,division i have dataframe same columns but,with different order. id,class,division,name i want above dataframe column orders same of first one. how can achieve in r? we can order second dataframe columns using column names of first (assuming both of them have same column names) df2[names(df1)] if data.table , use setcolorder library(data.table) setcolorder(df2, names(df1))

Redux-form validate on auto-fill -

we have login form using redux-form not allow login button pressed until username , password have been populated. it works fine, except when chrome autofills username/password field need trigger validation of form if both fields filled in can enable login button. how this? currently seems there no way trigger sync validation through action creator (see https://github.com/erikras/redux-form/issues/211 ). what seems work me calling handlesubmit empty handler: componentwillmount() { this.props.handlesubmit(() => ({})); } although i'm not sure work in scenario chrome , autofill. remember having similar issues there, autofilled input not marked changed.

angularjs - How to use array include in multidimension array angular 2 -

hi array this.testarray = [{ "office_id": "1", "officename": "sun" }, { "office_id": "2", "officename": "moon" }]; i want check whether officename sun there or not. tried used include this.testarray.includes("sun") work 1 dimension array( return true). how if want use multidimension array. return false. ** this.testarray.includes("sun") work array ** this.testarray = ["sun","moon","stars" }]; it return true exist. not working array one. your array not multidimensional. can : testarray.find(function(i){ return (i.officename === 'sun'); });

Connect to a Highly-Available SQL Server from R -

we've upgraded sql server 2012 highly-available dr enabled. when connecting using ssms need specify multisubnetfailover=true additional connection option + increase timeouts. how can replicate in r? without this, observe sporadic connectivity/timeout issues. related, python > packageversion('rodbc') [1] '1.3.6' > packageversion('base') [1] '2.15.2' if using data source name, can add arguments odbcconnect odbcconnect(dsn, uid = "user_name", pwd = "password", multisubnetfailover = "true") if using connection string, need add arguments in string. odbcdriverconnect("driver=driver; server=server; database=database; uid=user_name; pwd=password; multisubnetfailover = true")

Is it necessary to set loop index as a private variable in OpenMP? -

i reading openmp tutorial , , come across following program: #include <omp.h> #include <stdio.h> #include <stdlib.h> #define n 100 int main (int argc, char *argv[]) { int nthreads, tid, i; float a[n], b[n], c[n]; /* initializations */ (i=0; < n; i++) a[i] = b[i] = i; #pragma omp parallel shared(a,b,c,nthreads) private(i,tid) { tid = omp_get_thread_num(); if (tid == 0) { nthreads = omp_get_num_threads(); printf("number of threads = %d\n", nthreads); } printf("thread %d starting...\n",tid); #pragma omp (i=0; i<n; i++) { c[i] = a[i] + b[i]; printf("thread %d: c[%d]= %f\n",tid,i,c[i]); } } /* end of parallel section */ } i little confused whether loop index i must private variable or not. since same tutorial: all threads can modify , access variables (except loop index) so seems threads can't control i , right? btw, try remove i private variable,

Can't properly sign out of Facebook on Android with Firebase -

i try logging facebook, it's working. when logged out, facebook's "sign out" button still showing in login activity , when clicked on it, can log out. don't wanna that. but real question is, how sign out of facebook? i'm using both firebase authentication , facebook authentication(with support firebase) giris.java (log in) public class giris extends appcompatactivity implements view.onclicklistener { private fancybutton buttonsignin; private edittext edittextemail; private edittext edittextpassword; private textview textviewsignup, textviewsifreunuttum, girismesaji; public boolean cancel = false; public boolean isfirststart; private firebaseauth firebaseauth; private firebaseauth.authstatelistener mauthlistener; private dialog progressdialog; private callbackmanager mcallbackmanager; private static final string tag = "facebooklogin"; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate);

software design - Architecture style for uber like application -

i creating architecture , design uber android application. want ask architecture style(layered,mvc,pipe , filter or etc) more appropriate such application? , why? know many android apps mvc best option i'm still asking clear doubts.. viper best suited uber first used mvc on expanding failed support .. shifted viper , use hybrid architecture. detail can founded on website.

svm - one class classification libsvm in java -

i'm trying code one-class classification in java. defined 4 points in 2-d, (10,10), (-10,10), (10,-10), (-10,10), , test(0,0) classification, result -1, means (0,0) negative sample. doesn't make sense. here code. import libsvm.svm; import libsvm.svm_model; import libsvm.svm_node; import libsvm.svm_parameter; import libsvm.svm_problem; public class testsvm { /** * @param args */ public static void main(string[] args) { //define points a{10.0, 10.0}, b{-10.0, -10.0}, c{10,-10}, d{-10,10}, , labels {1.0, 1.0, 1.0, 1.0} svm_node pa0 = new svm_node();pa0.index = 0;pa0.value = 10.0; svm_node pa1 = new svm_node();pa1.index = 1;pa1.value = 10.0; svm_node pb0 = new svm_node();pb0.index = 0;pb0.value = -10.0; svm_node pb1 = new svm_node();pb1.index = 1;pb1.value = -10.0; svm_node pc0 = new svm_node();pc0.index = 0;pc0.value = 10.0; svm_node pc1 = new svm_node();pc1.index = 1;pc1.value = -10.0; svm_node pd0 = new svm_node();pd0.index = 0;pd0.value

Google analytics not counting pages loaded with AJAX, but they apear in real time information -

i started using ajax loading content front page. searched problem , found had add little piece of code. ga('set', 'page', pagepath);//pagepath = consulted url ga('send', 'pageview'); now, problem that, though can see in real time informacion when page's content loaded front page, visits not being loged. this analytics code i'm using <!-- google analytics --> <script> (function(i,s,o,g,r,a,m){i['googleanalyticsobject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new date();a=s.createelement(o), m=s.getelementsbytagname(o)[0];a.async=1;a.src=g;m.parentnode.insertbefore(a,m) })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); ga('create', 'ua-xxxxx-y', 'auto'); ga('send', 'pageview'); </script> <!-- end google analytics --> is there i'm missing? thanks

git - Uncommit all commits in current branch but leave all changes at the current state -

i have branch a in repo 10 commits. want find way delete commits leave changes in current branch (so state of code same commits in a gone). purpose can go on changes , cerry pick once want , structure better commit messages before merge master. flow possible? git reset master change head , index same state master , leave working tree untouched (e.g. current state).

dictionary - Handle missing keys with numeric types in Python -

for mutable types, such list, instead of using if else , can deal missing key issues this: dic = {'key1':[1, 2], 'key2':[1]} dic.setdefault('key3', []).append(1) which checks 'key3' in dic once. but immutable types, such integer, cannot use setdefault() this: dic = {'key1':3, 'key2':5} dic.setdefault('key3', 0) += 1 since setdefault() return integer 0 instead of variable dic['key3'] i'm not sure how deal elegantly, example best can this: dic = {'key1':3, 'key2':5} dic['key3'] = 1 if 'key3' not in dic else dic['key3'] + 1 but code checks 'key3' in dic twice , use memory dic['key3'] + 1 if 'key3' exists. any suggestions? you can use .get(..) specify default value , like: dic['key3'] = dic .get('key3',0) + 1 .get(key,default=none) performs lookup on dictionary. in case fails find key , return defa

python - Use sklearn's FunctionTransformer with string data? -

i'm using sklearn's functiontransformer preprocess of data, date strings such "2015-01-01 11:09:15". my customized function takes string input, found out functiontransformer cannot deal strings in source code didn't implement fit_transform. therefore, call got routed parent class as: 57 def fit(self, x, y=none): 58 if self.validate: ---> 59 check_array(x, self.accept_sparse) 60 return self the check_array seems working numeric ndarrays. of course can in pandas domain, wonder if there's better way of dealing in sklearn - esp. given possibly use pipeline in future? thanks! seems if validate parameter looking for: http://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.functiontransformer.html here example, may make sense leave string on converting float mentioned in comment. let's want add time zone info date string: import pandas pd def add_tz(df): df['date&#

jquery.easyPaginate.js all page numbers in pagination -

click here image in above images pagination taking avaliable number of pages i want limit pagination 10number ,when u click last 1 1st 10 has hide , next 10 has display iam using below code $.fn.easypaginate = function(options) { var defaults = { paginateelement: 'li', hashpage: 'page', elementsperpage: 10, effect: 'default', slideoffset: 200, firstbutton: true, firstbuttontext: '<<', lastbutton: true, lastbuttontext: '>>', prevbutton: true, prevbuttontext: '<', nextbutton: true, nextbuttontext: '>' } return this.each(function(instance) { var plugin = { nav: null, el: $(this), settings: { pages: 0, objelements: null, currentpage: 1, visiblepages: 10 } };

c# - Difference between OData complex and entity types -

i new odata , haven't yet found clear answer difference between complex , entity types. far found out entity type should have key property . there further differences , how should taken account when using odataconventionmodelbuilder ? from understanding entity type type can returned entityset , complex type type nested in entity type. in experience have tell odataconventionsmodelbuilder complex types discovers them.

mysql - Pagination on select query metamug -

this current resource file. i'm using mysql query pagination feature <?xml version="1.0" encoding="utf-8" ?> <resource xmlns="http://xml.metamug.net/resource/1.0" v="1.0"> <request method="get"> <query> select * tbl_task_master limit $limit offset $offset </query> </request> </resource> https://api.metamug.com/checklist/v1.0/task?offset=0&limit=50 it's fetching records. want paginate , subset. how make request metamug. to implement pagination need make use of limit , offset attributes of query tag , can pass parameter name you'll using in request. let's pagination parameters l , o limit , offset respectively (though not naming convention) resource file update: <?xml version="1.0" encoding="utf-8" ?> <resource xmlns="http://xml.metamug.net/resource/1.0" v="1.0"> <re

javascript - Cannot find name 'XLSX' when adding test.ts file -

i have added xlsx.full.min.js file. here code var workbook = xlsx.read(data, { type: 'binary' }); var sheetname = workbook.sheetnames[0]; var exceldata = xlsx.utils.sheet_to_row_object_array(workbook.sheets[sheetname]); you have install xlsx module using npm install xlsx have intialize xlsx variable on top of code if(typeof require !== 'undefined') xlsx = require('xlsx'); . check library details: https://www.npmjs.com/package/xlsx

python - Iterate over a tuple of lists -

this question has answer here: how can iterate through 2 lists in parallel? 6 answers i have tuple of lists. each list in tuple has same number of elements. how can iterate on in loop ex: tuplelist = ([1,2,3], ['label1', 'label2', 'label3']) (val, label) in <something>: print val, label should output: 1, label1 2, label2 3, label3 note: list of tuples contain more 2 lists. ps: have opted duplicate, please check responses correct solution. it's different iterating through 2 separate lists. you can use zip , flatten tuple_list asterix syntax. tuple_list = ([1,2,3], ['label1', 'label2', 'label3']) val, label in zip(*tuple_list): print(val, label) if you're still in python 2.7: import itertools tuple_list = ([1,2,3], ['label1', 'label2', 'label3']) v

Unable to Sent Email with Attachment using SMTP Client. Asp.net MVC C# -

i tried send email using smtp client using .net mvc pdf attachment (in memory attachment), not working on live server. please note: able sent email attachment localhost. when deployed on live server (hosted on iis) not working. same method working without attachment on live server. i getting following exception: system.net.mail.smtpexception: failure sending mail. system.net.webexception: remote name not resolved:'smtp.zoho.com' @ system.net.servicepoint.getconnection(pooledstream object owner, boolean async, ipaddress& address, socket& socket& abortsocket6) @ system.net.pooledstream.activate(object boolean async, generalasyncdelegate asynccallback) @ system.net.connectionpool.getconnection(object owningobject, asynccallback, int32 creationtimeout) @ system.net.mail.smtpconnection.getconnection(servicepoint servicepoint) @ system.net.mail.smtptransport.getconnection(servicepoint servicepoint) @ system.net.mail.smtpclient.getconnection() @ system.ne

reactjs - Can checkbox label be positioned above instead left/right? -

in official docs stated checkbox component has prop labelposition accepts values right , left. wanted display label above actual checkbox element. can done? thanks! type of labelposition enum(left, right) can pass left or right component. can try use css, jquery.

What do the symbols *1 or &2 mean in Travis CI deployment scripts? -

i'm following guide using travis deploy aws codedeploy . in docs point .travis.yml example contains following code: deploy: - provider: s3 access_key_id: akiaj4xzhimnkp3wgghq secret_access_key: &1 secure: <key> local_dir: dpl_cd_upload skip_cleanup: true on: &2 repo: travis-ci/cat-party bucket: catparty-codedeploy - provider: codedeploy access_key_id: akiaj4xzhimnkp3wgghq secret_access_key: *1 bucket: catparty-codedeploy key: latest.zip bundle_type: zip application: catpartydemoapplication deployment_group: productiondemofleet on: *2 i've got working , understand flow (first uploads zip file s3, deploys file codedeploy). i'm struggling syntax: on: &2 line in s3 section, , on: *2 part in codedeploy section. these lines doing? i ask because want modify configuration deploy different codedeploy group depending on whether commit has given tag, eg: on: tags: true all_b

changing (Alfresco) Activiti userId by code through Activiti Engine identityService -

i'm interacting activiti using activiti engine 5.20 api. is possible change userid (and groupid) through indentyservice? identityservice identityservice = processengine.getidentityservice(); org.activiti.engine.identity.user identiuser = identityservice.createuserquery().userid("kermit").singleresult(); identiuser.setid("pipponzo"); identityservice.saveuser(identiuser); it throws org.activiti.engine.activitioptimisticlockingexception: org.activiti.engine.impl.persistence.entity.userentity@650ae78c updated transaction concurrently @ org.activiti.engine.impl.db.dbsqlsession.flushupdates(dbsqlsession.java:880) @ org.activiti.engine.impl.db.dbsqlsession.flush(dbsqlsession.java:619) @ org.activiti.engine.impl.interceptor.commandcontext.flushsessions(commandcontext.java:212) @ org.activiti.engine.impl.interceptor.commandcontext.close(commandcontext.java:138) @ org.activiti.engine.impl.interceptor.commandcontextinterceptor.execute(commandcontextinterceptor.