Posts

Showing posts from January, 2015

How can we change Selected Tablayout Icon and Text color in android -

Image
hi new android , in app have change selected tablayout icon , text colors blue , remaining unselected icon , text colors should white wrote below code here changing icon color how can change text color also my code:- setupviewpager(viewpager); tablayout = (tablayout) findviewbyid(r.id.tabs); tablayout.setupwithviewpager(viewpager); tablayout.setontabselectedlistener( new tablayout.viewpagerontabselectedlistener(viewpager) { @override public void ontabselected(tablayout.tab tab) { super.ontabselected(tab); int tabiconcolor = contextcompat.getcolor(context, r.color.tabselectediconcolor); tab.geticon().setcolorfilter(tabiconcolor, porterduff.mode.src_in); } @override public void ontabunselected(tablayout.tab tab) { super.ontabunselected(ta

Batch File to save to Folder I created -

i have batch file below for /f "tokens=1-3 delims=/" %%a in ("%date%") md "%%a_%%b_%%c" c:\wamp\bin\mysql\mysql5.6.12\bin\mysqldump -uroot gs > c:\%date%\gs.sql i create folder current date , time want do, how set dump folder insert in current date , time folder the above file runs stops when try , direct folder 1 created i following error c:\trevor>c:\wamp\bin\mysql\mysql5.6.12\bin\mysqldump -uroot gs 04/14/2017\gs.sql 1>c:\fri access denied. what think meant this: for /f "tokens=1-3 delims=/" %%a in ("%date%") set "mydate=%%a_%%b_%%c" if not exist "c:\%mydate%\" md "c:\%mydate%" c:\wamp\bin\mysql\mysql5.6.12\bin\mysqldump -uroot gs > "c:\%mydate%\gs.sql" please aware %date% can change lot machine machine, there no way can expect therefore work accross other machines.

android - Restarting a service upon app update from playstore -

my android app makes use of service triggered if app opened (and service not running), or if device rebooted. when released first update on google play noticed on updating app google play on device, functionalities of app set through service stopped working until open app once or reboot device. i hence put message on google play asking current users using functionalities reopen app functionalities start working again. now planning release update app, time, somehow either make service persist upon app update or restart service on app update without forcing user action , existing users not experience problems in using app. any solutions with/ without code appreciated.

haskell - Why does Text.Show.Functions only return <function>? -

the standard package show functions returns constant string: λ> :m +text.show.functions λ> show (+1) "<function>" ghci's :type command more useful: λ> :t (+1) (+1) :: num => -> is impossible such level of detail @ runtime? compilation process leave kind of information @ functions, except them being functions? not same level of details, can use typeof data.typeable : prelude> import data.typeable prelude data.typeable> typeof (+1) integer -> integer

linux - how to delete a specific file from specific folder in Ubuntu 16.04 using Terminal -

i want delete zip file using terminal dont know command purpose in ubuntu. filename : android-studio-ide-162.3871768-linux.zip location : /home/raza/downloads this file want delete form location mention above. two possibilities: $ rm /home/raza/downloads/android-studio-ide-162.3871768-linux.zip or: $ unlink /home/raza/downloads/android-studio-ide-162.3871768-linux.zip in bash , similar shells can used ~raza denote /home/raza be: $ rm ~raza/downloads/android-studio-ide-162.3871768-linux.zip or: $ unlink ~raza/downloads/android-studio-ide-162.3871768-linux.zip or if logged in user raza can use ~ alone: $ rm ~/downloads/android-studio-ide-162.3871768-linux.zip or: $ unlink ~/downloads/android-studio-ide-162.3871768-linux.zip

python - Print routes in an kivy app -

i trying print routes between different points on map in kivy app. far found these different options printing map , plotting markers on specific places : mapview : it's multi-plateform tile-based map rendering widget. question is, possible download tiles routes traced ? didn't found service that. kivymaps : displays wms services, multi-plateform kivy-gmaps : integrate google maps kivy, android, doesn't seem possible trace routes api. so did succeed @ printing routes on map in kivy apps ?

c - How to acquire and release the locks in OpenMP -

this program, creates number of parallel threads , each reader thread cannot read data while writer thread writing it #include<omp.h> #include<stdio.h> #include<stdlib.h> omp_lock_t rw_lock; char data[50]; void readdata(int tid){ while(!omp_test_lock(&rw_lock)) printf("\n[thread %d - reader]: waiting data ...",tid); printf("\n[thread %d - reader]:\t%s",tid,data); omp_unset_lock(&rw_lock); } void writedata(int tid){ while(!omp_test_lock(&rw_lock)) printf("\n[thread %d - writer]: waiting data ...",tid); printf("\n[thread %d - writer]\n\tenter new data:\t",tid); scanf(" %[^\n]49s",&data); omp_unset_lock(&rw_lock); } int main(){ int read_cnt,write_cnt,wrote=0; setbuf(stdout,null); printf("\nenter data:\t"); scanf(" %[^\n]49s",&data); printf("\nenter total reader , writer thread count:\t");

python 2.7 - Keras2.0 MissingInputError while trying to visualize the trained CNN filters -

i'm trying visualize filters of trained convolutional neural network on keras following keras blog https://blog.keras.io/how-convolutional-neural-networks-see-the-world.html . import keras keras.layers import input, dense, dropout, flatten, activation keras.layers import conv2d, maxpooling2d keras.models import model keras import backend k num_classes = 10 input_shape = (32, 32, 1) # 32x32 image, 1 channel # model inputs = input(shape=input_shape) x = conv2d(32, (3, 3), activation='relu', name='block1_conv1')(inputs) x = conv2d(32, (3, 3), activation='relu', name='block1_conv2')(x) x = conv2d(32, (3, 3), activation='relu', name='block1_conv3')(x) x = conv2d(32, (3, 3), activation='relu', name='block1_conv4')(x) x = maxpooling2d(pool_size=(2, 2), name='block1_pool')(x) x = dropout(0.25)(x) x = conv2d(64, (3, 3), activation='relu', name='block2_conv1')(x) x = conv2d(64, (3, 3), activation=

node.js - App crashed in nodemon -

i trying run in debug mode using git bash nodejs application. did several times on recent ones doesn't work anymore. when run command: npm run startwindows:inspect it says: 14 apr 15:10:59 - [nodemon] v1.4.1 14 apr 15:10:59 - [nodemon] restart @ time, enter `rs` 14 apr 15:10:59 - [nodemon] ignoring: c:\xxx\.git/**/* c:\xxx\node_modules/**/* c:\xxx\bower_components/**/* .sass-cache 14 apr 15:10:59 - [nodemon] watching: c:\xxx\server/**/* c:\xxx\config-local/**/* 14 apr 15:10:59 - [nodemon] watching extensions: js,json,yaml 14 apr 15:10:59 - [nodemon] starting `node --inspect --debug-brk energyreports.js` 14 apr 15:10:59 - [nodemon] child pid: 6352 unable open devtools socket: address in use 14 apr 15:10:59 - [nodemon] app crashed - waiting file changes before starting... 14 apr 15:11:03 - [nodemon] watching 37,149 files 14 apr 15:11:03 - [nodemon] watching 37,149 files - might cause high cpu usage. reduce use "--watch". what can provide more startwindows:insp

javascript - How to include jqplot dateAxisRenderer.min.js file in your xhtml page -

i include jqplot.dateaxisrenderer.min.js file in xhtml page. how do ? pf version : 6.0.0 added dependency using pom: <dependency> <groupid>org.wicketstuff</groupid> <artifactid>jqplot</artifactid> <version>7.6.0</version> </dependency> how add in xhtml file? following xhtml file code: <?xml version="1.0" encoding="utf-8"?> <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:p="http://primefaces.org/ui" xmlns:pe="http://primefaces.org/ui/extensions"> <ui:composition template="/pages/layout.xhtml"> <ui:def

spring - Using uiUploader file in AngularJS browser throws 404 bug -

wanted upload file using uiuploader , have model multipart class: while making post request, browser throws me: {timestamp: 1492173338591, status: 400, error: "bad request",…} error:"bad request" exception:"org.springframework.web.multipart.support.missingservletrequestpartexception" message:"required request part 'file' not present" path:"/api/file" status:400 timestamp:1492173338591} when closer, can notice have 'file' property inside html file. my model class , backend controller looks like: @data public class multipartmodel { private multipartfile multipartfile; private integer reviewid; } @preauthorize("hasanyauthority('client', 'worker')") @requestmapping(value = "", method = requestmethod.post, headers = {"content-type=multipart/form-data"}, consumes = {"multipart/form-data"}) public void uploadfile(@requestpart(&

sql server - VS Studio 2015 and management studio 2012 -

so made data on sql server manangement studio 2012. when went access data in visual studio , gave me error , told me needed upgrade database. asked , said yes. worked database little , inserted couple of cells visual studio , when log on management studio database stuck in recovery pending. there way fix this? localdb files , mdf. vs2015 not best suite ssms 2012, bring compatible issue, example, integration service, etc. switch use vs2012, , if database in restoring status long time small size database, did not use with recovery when restore database because database waiting latest transaction log , try restore database [yourdatabase] recovery , , refresh it, should good. ps :you add stats track progress in case database still being restored.

javascript - Loading image being displayed only on the 1st result in while loop -

loading image being displayed below button of 1st result in while loop no matter button clicked result. example, if click submit button on first result loading image displayed below it. that's okay. when click on submit button of other result except first loading image displayed below first result , not below submit button of particular result. <?php while($a = $stmt->fetch()){ ?> <form method="post" action=""> <input type="hidden" value="<?php echo $mbs_id; ?>" class="memid"> <select class="validity" class="upgrade-valsel"> <?php while($mv = $mval->fetch()){ extract($mv); ?> <option value="<?php echo $mv_id; ?>"><?php echo $mv_validity; if($mv_validity == 1){ echo " month"; }else{ echo " months"; } ?></option> <?php } ?> </select>

python: retrieve a section of JSON data, without knowing the structure -

i have json: {u'spreadsheetid': u'19cugmhb1ds6n1jby4zo4hk_k4sqstmoffccxrc2qo', u'properties': {u'locale': u'en_us', u'timezone': u'asia/hong_kong', u'autorecalc': u'on_change', u'defaultformat': {u'padding': {u'top': 2, u'right': 3, u'left': 3, u'bottom': 2}, u'textformat': {u'foregroundcolor': {}, u'bold': false, u'strikethrough': false, u'fontfamily': u'arial,sans,sans-serif', u'fontsize': 10, u'italic': false, u'underline': false}, u'verticalalignment': u'bottom', u'backgroundcolor': {u'blue': 1, u'green': 1, u'red': 1}, u'wrapstrategy': u'overflow_cell'}, u'title': u'test pygsheets api v4'}, u'sheets': [{u'properties': {u'sheettype': u'grid', u'index': 0, u

smarty - Prestashop: how to display messages in the cart -

Image
i'm working in quota module prestashop 1.6 , in 1 of features need display message in cart's page , in modal opens when add item cart home page. i'm working hookcart hook function, public function hookcart($params) , in module's class. can instance of controller $this->context->controller my question how display messages in these 2 views? tried adding them errors array. can see message not way i'm supposed display. display in alert classes bootstrap. the views: can me? to display message on checkout page can use whatever front controller hook want. guess 1 makes sense displaytop . won't outputting html top add message controller's errors array. public function hookdisplaytop() { $controller = $this->context->controller; if ($controller->php_self != 'order' && $controller->php_self != 'order-opc') { return false; } /* can custom logic here if want display me

css - Getting HTML nested tables in email to stack vertically on mobile -

i building out email exacttarget (so no bootstrap or other useful magic tools), , need 2 content blocks stack vertically on mobile. however, no matter i've tried, cannot them stack. also, including code below @ throws off margins handful of different browsers , email clients. rest of email perfect otherwise: <td height="45" width="35%" bgcolor="#e4e4e4" style="vertical-align: top"><img src="http://image.bcbst-email.com/lib/fe8e1273736c027c76/m/1/top_border_c+copy.png" /><span style="font-family: tahoma, geneva, sans-serif; font-size: 14px; color: #eeeeee; text-align: right"></span> <table width="100%" style="border-spacing:0;"> <td height="45" width="5%"><span style="font-family: tahoma, geneva, sans-serif; font-size: 14

sql - Select latest NOT NULL values from table -

Image
i have table many statuses like id | date | isenabled | isupdated | isduplicate | issuspended | ... statuses (isenabled, isupdated, isduplicate, issuspended...) nullable bits. i need select latest (but not greater input date) not nullable statuses table. in case status has null value select previous not nullable value. i've create select select latest values , can't understand how previous not nullable values. ;with cte ( select cbs.*, rn = row_number() on (partition cbs.id order cbs.[date] desc) [dbo].companybusinessstatus cbs cbs.[date] <= @inputdate ) select * cte rn = 1 i'm using ms sql 2016 data example : 1 | 2017-01-01 | 1 | 0 | 0 | 0 _______________________________________ 1 | 2017-01-03 | 1 | null | null | 1 _______________________________________ 2 | 2017-01-03 | 1 | 1 | null | 0 _______________________________________ 1 | 2017-01-05 | 0 | 1 | 0 | null in case @inputdate '2017-01-04' need sele

database - Using tkinter for making gui in python -

i trying make gui basic dbms project , while tkinter seems pretty easy part unable how use entry take input , store use later (like if condition or something) eg: root = tk() label = label(root,text="testing") label.grid(row=0) entry = entry(root) entry.grid(row=0,column=1) now want use value/word wrote in entry field print out on example console. i thought write print(entry) but justs prints random decimal on console, ideally id store value in variable (if not possible use "entry") can use in if conditions etc i using python 3 you mean want show data in entry? you may this: v = stringvar() e = entry(master, textvariable=v) e.pack() v.set("a default value") s = e.get() you can set value of "v", example entry show " default value" string. , can value use "get" method.

Apache Camel JDBC Polling and Idempotency -

i'm building simple camel route should continuously poll table , push data activemq. each poll should pull data not pulled. best way can think of keep track of last processed sequence id , select items sequence id greater previous one. is there standard way this? it's possible, in multi user database, rows lower sequence id committed after rows higher id (certainly in oracle & sqlserver, suspect in dbms transaction support). in case keeping track of last processed id result in rows never processed. the simplest solution problem, if have control on schema , thing processing table, add sort of ‘processed’ column table , update column (as @arnaud suggests). if isn’t option there 3 other mechanism have considered solving issue: add on-insert trigger table insert record in companion table references table , includes processed column. change query join 2 tables, , mark row processed updating companion table in same way above. create companion table , insert

python - How to use a keyword list on pocketsphinx -

i building program python , pocketsphinx in order control drone voice. have dictionary: down d aw n go g ow left l eh f t right r ay t turn t er n ah p if word in dictionary works fine, if word not in dictionary pocketsphinx try find closest match dictionary. e.g if stop pocketsphinx display up , if case program should nothing. did search in internet , found problem can solved using keyword list, can't find information how use python. code have far #!/usr/bin/env python import os pocketsphinx import livespeech, get_model_path = 0 j = 0 frase = '' tab = [['x','o','o'],['o','o','o'],['o','o','o']] def move(): global i,j,frase if 'down' in frase , i!= 2: i=i+1 if 'up' in frase , i!= 0: i=i-1 if 'left' in frase , j != 0: j = j - 1 if 'right' in frase , j != 2: j = j + 1 def draw(): global i,j

jsp - Tomcat error: bean's property cant be found -

tomcat indicates error: org.apache.jasper.jasperexception: exception occurred processing jsp page /accueilemploye.jsp @ line 10 7: <body> 8: <p> 9: accueil pour:${masession.type }<br> 10: votre id: ${masession.idemp }<br> 11: bienvenu<br> 12: ${message}<br> 13: email: ${masession.email }<br> this accueilemploye.jsp file. <body> <p> accueil pour:${masession.type }<br> votre id: ${masession.idemp }<br> <%-- error here --%> bienvenu<br> ${message}<br> email: ${masession.email }<br> mot de passe: ${masession.mdp}<br> nom: ${masession.nom}<br> prenom: ${masession.prenom }<br> departement:${masession.dept } </p> </body> can't figure out where's problem, error says property idemp isnt available in bean, while there. public class utilisateur { private string nom; private string prenom; privat

How to implement Single Sign On using SAML without any third party? -

i ma beginner on saml , doing first time single sign on. have multiple applications on different domains , applications built different technologies. i want implement single sign on using saml. dont want use third party. if have solution or example project please share thanks in advance! i recommend take @ onelogin's open source saml toolkits there examples of php, python, java , ruby apps. p.s saml complex, don't try implement yourself...

c - How to get all ranks in MPI to do a send a value to rank 0 which then does a blocking receive on all of them? -

say have n processes: they calculation, , send result rank 0. want happen: rank 0 wait till has result of ranks , add them up . how do this? also, want avoid following: for eg. 4 processes p0, p1, p2, p3, p1 -> p0 p2 -> p0 p3 -> p0 in meanwhile p1 has finished calculation , p1->p0 happens again. i want p0 make addition 3 processes in 1 cycle before doing next one . can suggest mpi function this? know mpi_gather i'm not sure if blocking i've thought of this: #include <mpi.h> #include <stdio.h> int main() { int pross, rank,p_count = 0; int count = 10; mpi_init(&argc,&argv); mpi_comm_size(mpi_comm_world,&pross); mpi_comm_rank(mpi_comm_world,&rank); int * num = malloc((pross-1)*sizeof(int)); if(rank !=0) { mpi_send(&count,1,mpi_int,0,1,mpi_comm_world); } else { mpi_gather(&count, 1,mpi_int,num, 1, mpi_int, 0,mpi_comm_world);

php - Regex for numbers like 1.1 -

i trying make regex allow following 1 1.1 9.9 9 but not allow 1.11 or 9.97 or 9,7 can me? i tried '/[0-9]+(\.[0-9]?)?/' still allows 1.11 your regex match pattern describe fails exclude pattern not want match. 1.1 part in 1.11 matches regex. exclude 1.11 can add regex string has end after first decimal: ^\d+(\.\d)?$ . \d matches digit; have escape . because otherwise matches character; , $ means 'end of string'. quick reference can check this . quite logically problem happens @ start of regex, yours surely matches a1.1 . special character ^ means 'start of string'. a regex matching needs be: ^\d+(\.\d)?$

java - How to provide Maven project properties as a service? -

context i have maven module (let's call service ). uses spring-boot (non-web environment) @configurationproperties load configuration 1 or more .properties files. on runtime configuration stored in singleton class myconfiguration.java getters known properties. the goal have other modules / projects (let's call apps ) have individual .properties file , use service automatically populate configuration. further, service exports via src/main/resources root-settings.properties contains placeholders project properties required apps . these should populated via maven filtering mechanism derived project properties based on pom.xml one such property version. in service test verifies replaced maven following setup: root-settings.properties applicationversion=${project.version} pom.xml <build> <testresources> <testresource> <directory>src/test/resources</directory> <filtering>true</filtering>

python - Multiple Dictionary JSON file to pandas dataframe -

i have online data of following form: {"headers": {"ai5": "3356", "debug": null, "random": null, "sd": "7.6"}, "post": {"event": "ggstart", "ts": "1462"}, "params": {}, "bottle": {"timestamp": "2016-05-09 02:00:00.033775", "game_id": "55107008"}} {"headers": {"ai5": "8fa6", "debug": null, "random": null, "sd": "7.6"}, "post": {"event": "ggstart", "ts": "1475"}, "params": {}, "bottle": {"timestamp": "2016-05-09 02:00:00.004906", "game_id": "55107008"}} i expecting have read considering each row json format , keep on adding them final data: data = [] open('new.json') f: line in f: print(line) dat

python - Directory not found in pycharm when running code, directory not renamed -

okay, when try run python program in pycharm, i've started getting following error: c:\users\sheehanmilesk\appdata\local\programs\python\python36-32\python.exe: can't open file 'c:/users/sheehanmilesk/pycharmprojects/scraper/demospider': [errno 2] no such file or directory i assumed must have screwed file path renaming things, no, in fact file located. answering comments: i'm running windows 10, , yes, there no .py after demospider in error message. not sure why.

linux - How do I add a new username and password to a database list (i have a pass file an a username file -

!/bin/bash i working on school linux class. trying make script log username , send "users2". password go "passwords2". echo -n "username:" read | user2 echo -n "password:" read | password2 i have tried can think of if can me love that. thank you, zack to redirect output screen file, can use > , or >> append, example echo "some text" > file.txt echo "some other text" >> file.txt will result in $ cat file.txt text other text to store user input variable, input , use read input . other that, missing semicolon between 2 commands echo ... , read (or put them on separate lines). a minimal example script, appends user input file: #!/bin/bash echo -n "input: "; read input echo $input >> file.txt

Swap project tabs per project folder in Atom editor -

i have several projects work on concurrently, , have files open each one. however, having separate window open every project undesirable (mainly because when cmd-tab/alt-tab between windows there 5 different atom windows instead of 1 , have squint , try identify 1 project want). i know can open project folders in single window, tabs open files open together, presents bigger problem finding want, if each project has 4-5 files open. is there way have single atom window display multiple projects display open tabs/files 1 project @ time, swapping when select different project i found package this: project-plus . (tabbing between projects improved, solves pain points mentioned.)

ruby on rails - Why does this route globpattern in routes.rb not match the url? -

i have pattern in routes.rb file: match '/*', to: 'codeopenhub#index', constraints: { subdomain: 'code' }, via: :get when hit url code.lvh.me:3000 , takes me incorrect landing page. similarly, when try request nonexistent url http://code.lvh.me:3000/abc , 404 . makes sense page doesn't exist wouldn't have been routed codeopenhub#index page? before had get '/', to: 'codeopenhub#index', constraints: { subdomain: 'code' } correctly takes me landing page want. when try code.openhub.net/foo takes me wrong page. how can route request code.openhub.net/abc or code.openhub.net/foo codeopenhubcontroller#index method? ----update------ i've tried add more parameters constraints hash such as: get '/:id', to: 'codeopenhub#index', constraints: { subdomain: 'code', id: /[a-za-z]/ } but still did not work.

css - bootstrap btn-group buttons not joined -

Image
i'm using bootstrap version 3.3.7 , have code w3schools website (bootstrap website not available in country): <div class="btn-group btn-group-lg"> <button type="button" class="btn btn-primary">apple</button> <button type="button" class="btn btn-primary">samsung</button> <button type="button" class="btn btn-primary">sony</button> </div> the buttons not joined together: i have tried adding role="group" , , without btn-group-lg , inside form , inside containers bare on page. in chrome developer tools can see btn-group being applied , nothing being overridden (i expect border-radius be) , have redownloaded boostrap css files in case accidentally corrupted them: what else can @ see why not joined? i have similar on input groups cant find example @ point. edit based on 1 of answers, removed of application sty

java - RecyclerView item's image bug -

problem: glitch bug recyclerview's child's item imageview i have recyclerview.each item has imageview id "like" empty star. when click on item's "like", example, first, star changing empty filled in yellow, means item liked. when click on first item ok, should be, @ same time, have bug, changing sixth item's "like" filled star, shouldn't done, item wasn't liked yet. if click on second item's - seventh item have same bug. to fill item's in viewholder have model - recipe. open class recipe constructor(open var label: string, open var image: string, open var url: string, open var ingredients: realmlist<ingredient>?, open var calories: float, open var totalweight: float, open var id: int, open var isfavorite: boolean) : r

javascript - Can't use non-anonymous method with socket.io, "listener" argument must be a function -

i searched answer (simple ?) question, yet, can't find clear. i'm java developper trying fit in web market, but, oop, many things infurate me. io.sockets.on('connection', function (socket) { console.log("client has connected! id = [" + socket.id + "]"); socket.on('disconnect', onplayerdisconnected(socket)); }); function onplayerdisconnected(socket) { socket.broadcast.emit('player_disconnected', socket.id); console.log("client has disconnected! id = [" + socket.id + "]"); } here's stacktrace : events.js:219 throw new typeerror('"listener" argument must function'); ^ typeerror: "listener" argument must function if use anonymous function, works charm. problem is, if react (increasing) number of events, code won't maintenable. so, there way break down code smaller functions ? bonus question : possible event split code in multiple .js file

java - How to merge two ResponseEntity objects in Spring -

i using spring 4.2. i've make 2 separate http calls return responseentity<string> . however, have merge them before returning caller methods. their data structure similar. content different. how can merge 2 entities before returning caller ? use rest template entities inside entity want merge. final string uri = "http://localhost:8080/springrestexample/employees.xml"; resttemplate resttemplate = new resttemplate(); string result = resttemplate.getforobject(uri, string.class); final string uri2 = "http://localhost:8080/springrestexample/employees2.xml"; resttemplate resttemplate2 = new resttemplate(); string result2 = resttemplate.getforobject(uri, string.class); return result1+result2; //or mergemethod(result1,result2) you can create new endpoint service merging entities collections framework or java 8 stream map. you can create better repository data access object joining tables on db level - sql, hql, jpql.

csv - Python replace plus sign from excel -

the data pull db comes in following format: +jacket online trading account +neptune when write data csv end #name? error. tried adding single quote ' front of values when pull data, however, not fix issue. need write values come, plus sign @ front. you need format desired output column text column. result in: +jacket online trading account +neptune being written file is. no more #name? errors.

node.js - Deploy node server on heroku and receive "SyntaxError: Unexpected token import" -

i have server written in node.js using node 6.10.2 , ecmascript. want upload heroku, locally when rung server "npm start" server starts without problem, on heroku recevied following error import express 'express'; syntaxerror: unexpected token import how can fix error? thanks you have 2 options: use require() instead of import transpile code node doesn't support import keyword. in node import modules require() function. example can change this: import express 'express'; to this: const express = require('express'); or can transpile code e.g. babel if want use import . see: https://babeljs.io/

unity3d - Text in Prefabs is Empty -

i have created text , under text there 2 input fields. have created prefabs of them , instantiated through code. , working, problem instantiated object empty , not show box, there solution problem i'm facing of. here code using unityengine; using system.collections; using system.collections.generic; public class submitbutton : monobehaviour { public gameobject objects; public void start () { // debug.log ("ok"); } public void instantiatebutton () { objects.transform.position = new vector3 (57.4f, 381.58f, 0f); instantiate (resources.load ("prefabs/bupivacaine"), new vector3 (57.4f, 381.58f, 0f), quaternion.identity); } } to instantiate ui object, must make sure root child of canvas. should change instantiating method: instantiate(resources.load("prefabs/bupivacaine"), gameobject.find("parentnamehere").transform); enter name of parent gameobject in "parentnamehere" , remember: must child

Visual Studio 2017 generates TypeScript errors for a project that does not use TypeScript -

any ideas why vs2017 run typescript compiler (tsc.exe) on project not use typescript helpful? i have solution contains 3 asp.net web applications. 1 of 3 uses typescript while other 2 projects contain no files .ts extension, no tsconfig files, , no typesctript msbuild tags. however, 1 of 2 projects not use ts generates following typescript compiler errors when project built, , when solution first opened. removed project name listed errors below, assure these errors attributed 1 of projects not use typescript. this issue not exist when open (or build) same solution in visual studio 2015. error ts2451 cannot redeclare block-scoped variable 'json'. (x86)\microsoft visual studio\2017\enterprise\common7\ide\commonextensions\microsoft\typescript\lib.es6.d.ts 991 active error ts2451 cannot redeclare block-scoped variable 'json'. c:\program files (x86)\microsoft visual studio\2017\enterprise\common7\ide\commonextensions\microsoft\typescript\lib.es6.d.ts

function - Why is my new SQL view/query ignoring my business rules? -

this complicated issue, apologize in advance. i've been doing lot of analysis , research on issue, , can't find answers. in case relevant, i'm using sql server 2008 r2. i created scalar value function works according business rules, when used in stored procedure takes 17 minutes run. also, it's r.b.a.r. annoying heck out of me. as result, i'm trying write view replace it. view i've written , joined stored procedure takes 7 seconds run. problem it's not obeying business rules. i'll post both original function, plus new view, first i'm going try explain business rules before hand, because whole thing messy. if sale completed, return "completed". if sales number not completed, sales person did complete sale, return "saved". if no sales person able complete sale: a. , customer cancelled sale, return "cancelled" b. 1 sales person attempted make sale, return "missed" c. more 1 sales person atte