Posts

Showing posts from September, 2014

svn - Any Eclipse view or plugin to only list file conflicts? -

is there view or other pane see files in project in conflicted state? in projects thousands of files (even after restart of ide, losing console output). within eclipse found show tree conflics command, need, tree conflicts only. i don't use synchronize view, i'm comfortable doing update , handling conflict edit conflicts , mark resolved (i guess that's because started using svn command line). i use svn subclipse, guess common other scms too.

linux - Expect script: Read Base64 password from file -

i have created script connect server using sftp. avoid putting password in script plain text, i'm planning on putting in file encoded in base64. can read file no problem. don't know how decode base64 expect. so, now, script reads file , puts password (directly) script. how decode it? i'm ready move script shell/bash if there's way such thing. thank you. here's code: #!/usr/bin/expect set mypassword [open "sftp_auth.cfg" r] set data [read $mypassword] spawn sftp myuser@111.111.111.111 expect "*assword:" send "$data\n" expect "sftp>" send "cd /repository\n" expect "sftp>" send "get example.sh /home/user/example2.sh\n" expect "sftp>" send "exit\n" interact you can use tcl's exec command decode password. example: [step 101] # cat foo.exp set base64_passwd ugfzc3cwcmq= set passwd [exec echo $base64_passwd | base64 -d] puts $passwd [step 102] # e

mule - Unable to create MUnit test or suite -

Image
when trying create munit test in anypoint studio right clicking on flow selecting 'create new text.xml suite' see following dialog appear: this has disadvantage of not offering stack trace follow, however, looking in error log can see following stack trace. java.lang.nullpointerexception @ org.apache.velocity.runtime.runtimeinstance.parse(runtimeinstance.java:1003) @ org.apache.velocity.runtime.runtimeinstance.parse(runtimeinstance.java:972) @ org.apache.velocity.runtime.runtimesingleton.parse(runtimesingleton.java:265) @ org.apache.velocity.app.velocity.evaluate(velocity.java:274) @ org.mule.tooling.ui.contribution.munit.munitresourceutils.createxmlconfigurationfromtemplate(munitresourceutils.java:214) @ org.mule.tooling.ui.contribution.munit.actions.createtestsuiteaction.createmunitfile(createtestsuiteaction.java:86) @ org.mule.tooling.ui.contribution.munit.actions.createtestsuiteaction.createandopenmunitfile(createtestsuiteaction.java:73) @ org.mule.tooling.ui.cont

How to handle cloudboost errors in Ionic2? -

the error when user fails log in "error: request failed status code 401". error logged here: static login(username : string, password : string){ return new promise(resolve =>{ let user = new cb.clouduser(); user.set('username', username); user.set('password', password); user.login({ success: function(user) { console.log("user"); resolve(); }, error: function(error) { console.log(error); resolve(error); } }); }); } but need error says went wrong e.g. "invalid username" or "user not authenticated". how these? error: request failed status code 401 this error means login request made server not authenticated/ not authorized make login request. can mean cb instance not initialized. please check appid , master/client key using initialize cb instance.

c++builder - __tpdsc__ error in CLANG importing WDSL (Rad Studio) -

in rad studio berlin, "[ilink32 error] error: export __tpdsc__ ..." error. steps easy: create new package in rad studio import wsdl service add soaprtl.bpi reference if compile, works fine. now change compile clang (use classic borland compiler false). compile again project , these "export __tpdsc__ " errors. for example: [ilink32 error] error: export __tpdsc__ ns_ws_efs::tstitems in module e:\temp\packsoap\win32\debug\ws_efs.obj references __tpdsc__ system::string in unit c:\program files (x86)\embarcadero\studio\18.0\lib\win32\release\rtl.bpi|system.pas it works fine in applications not in packages.

eclipse - Method comment syntax check fails in Intellij Idea -

/** * @param m_type * m_type set */ this method comment automatically created in eclipse generates syntactic error in idea. have remove 1 '*' symbol '**'. normal? in eclipse can override template preferences -> java -> code style -> code templates -> comments -> methods , click edit

jquery - add class to dots, after activated it with delay and remove that class after slider cycle over -

i need add class dots, after activated delay , remove class after slider cycle over. using slick slider if ( $('.slick-dots li').hasclass('slick-active') ) { $(".slick-dots li.slick-active button").addclass("bg-b").delay(3000); } can 1 me?

vmware - Create VM by REST API without vCenter -

is possible create vm (or other tasks) rest api server running esx without vcenter? or essential install vcenter on server? i checked these links use vcenter: https://www.youtube.com/watch?v=14wervv3ndo https://blogs.vmware.com/code/2017/02/02/getting-started-vsphere-automation-sdk-rest/ vms can created through either vsphere client or vsphere management api. there no requirement install vcenter server. example create vms through vsphere client: https://www.youtube.com/watch?v=ddus5fsczzy example create vms through open sourced pyvmomi sdk: https://github.com/vmware/pyvmomi-community-samples/blob/master/samples/create_random_marvel_vms.py example create vm through open sourced rbvmomi sdk: https://code.vmware.com/samples/781/create-vm?h=vm%20create this can done through several other sdks usage of createvm_task method. additional information method available here: http://pubs.vmware.com/vsphere-6-5/index.jsp?topic=/com.vmware.wssdk.apiref.doc/index.html&

No resource found that matches the given name: attr 'android:keyboardNavigationCluster'. when updating to Support Library 26.0.0 -

i've got issue while updating latest support library version 26.0.0 ( https://developer.android.com/topic/libraries/support-library/revisions.html#26-0-0 ): error:(18, 21) no resource found matches given name: attr 'android:keyboardnavigationcluster'. /.../app/build/intermediates/res/merged/beta/debug/values-v26/values-v26.xml error:(15, 21) no resource found matches given name: attr 'android:keyboardnavigationcluster'. error:(18, 21) no resource found matches given name: attr 'android:keyboardnavigationcluster'. error:(15, 21) no resource found matches given name: attr 'android:keyboardnavigationcluster'. error:(18, 21) no resource found matches given name: attr 'android:keyboardnavigationcluster'. error:execution failed task ':app:processbetadebugresources'. com.android.ide.common.process.processexception: failed execute aapt the file support library: <style name="base.v26.widget.appcompat.toolbar&quo

c# - Convert AngularJS service to Angular -

how convert angularjs angular? created component named forgotpassword , have no idea how correctly send http.post c# controller. function (window, angular) { "use strict"; angular.module("mobile") .service("accountservice", ["$http", function ($http) { return { forgotpassword: function (email, success, error) { $http.post("account/forgotpassword", { email: email}).success(success).error(error); } } }]); })(window, window.angular); you need create service class app.serivce.ts import { injectable } '@angular/core'; import { http, response } '@angular/http'; import { observable } 'rxjs/observable'; import 'rxjs/rx'; @injectable() export class appprovider { constructor(private http: http) { } public forgotpassword(email: string):observable<any> { let url:string = 'apiurl/account/forgotpassword'; let body: = { email: email } return this.http

prestodb - Presto unable to create injector with resource group config -

i using presto-server-0.179 on hadoop cdh5.4.7. when add etc/config.properties with: experimental.resource-groups-enabled=true resource-groups.configuration-manager=etc/resource-groups.properties i following error: 2017-07-25t03:46:22.678-0700 error main com.facebook.presto.server.prestoserver unable create injector, see following errors: 1) configuration property 'resource-groups.configuration-manager' not used @ io.airlift.bootstrap.bootstrap.lambda$initialize$2(bootstrap.java:235) 1 error com.google.inject.creationexception: unable create injector, see following errors: 1) configuration property 'resource-groups.configuration-manager' not used @ io.airlift.bootstrap.bootstrap.lambda$initialize$2(bootstrap.java:235) 1 error @ com.google.inject.internal.errors.throwcreationexceptioniferrorsexist(errors.java:466) @ com.google.inject.internal.internalinjectorcreator.initializestatically(internalinjectorcreator.java:155)

ruby on rails - How to add a custom header to doorkeper token response -

the project i'm working on requires me add custom headers based on generated response body responses generated app. works fine after_action in application controller, need add custom header token responses generated doorkeeper. setting base_controller applicationcontroller in doorkeeper configuration, did not cause after_actions called. there possible workarounds? turns out takes 1 define custom doorkeeper::tokenscontroller class , add filter it. app/controllers/access_tokens_controller.rb: class accesstokenscontroller < doorkeeper::tokenscontroller include abstractcontroller::callbacks after_action :add_signature_to_response, only: [:create] def add_signature_to_response application = strategy.client.application # ... # response_based_on_application = ... # ... response.headers['custom-header'] = response_based_on_application end end next 1 needs register controller in doorkeeper configuration in config/initializers/doork

javascript - html storage safari incognito mode, angular2 -

i not able save data in html local / session storage when safari in private mode in ios in iphone 6 plus. can me why happening. possible on ride , make store data? possible duplicate : html5 localstorage error safari: "quota_exceeded_err: dom exception 22: attempt made add storage exceeded quota." . you can write script , on exception ask user open website in normal mode or in different browser try { localstorage.setitem("check", "test"); console.log("works!!"); } catch (exception) { console.log('browser / mode not supported'); }

html - Aligning font awesome icons beside text -

how align icons clean look? code pasted below. , this want this i tried put in table align left each td icons moved down. possible way? thanks <p class="for-font-size"><span class="fa fa-calendar"></span> july 25, 2017</p> <p class="for-font-size"><span class="fa fa-map-marker"></span> sample city</p> <p class="for-font-size"><span class="fa fa-venus-mars"></span> male</p> <p class="for-font-size"><span class="fa fa-envelope"></span> sample-email@gmail.com</p> <p class="for-font-size"><span class="fa fa-phone"></span> +12 34567890</p> you can use font awesome class fa-fw each icon has same width. http://fontawesome.io/examples/#fixed-width <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" re

java - WARNING: A response with a 200 (Ok) status should have an entity. Make sure that resource returns one or sets the status to 204 -

in context of servlet container mean: warning: response 200 (ok) status should have entity. make sure resource "http://localhost:8080/parse/custom/usermanagement/hello_method" returns 1 or sets status 204 (no content). where can see client (i using postman) response there (e.g. {"hello":"body"} )

c# - Throttling KVO bindings (Xamarin / Mac ) -

Image
i have mac desktop app in xamarin. there kvo model ui bound using interface builder. i listen out changes values in model, , when changed, update attached hardware new value on serial port connection. the problem have sliders. bound value on slider updates on every step of slider, rather when user releases slider. want can update text field showing value, don't want trigger handler until release. i can set slider continuous = false , solves handler issue, textfield updates on release. i can't see anyway configure binding trigger once user finishes sliding, or way throttle bound callback, runs once within given timeframe. can trigger binding update once user releases mouse? is there way throttle callback? would better practice listen out ui events update hardware? rather bound model value changes? below current set up..... in settings model [register("settingsmodel")] public class camerasettingsmodel : nsobject { export("gainmode&

How to draw shapes on Google Map? -

how draw shape on google map using google map javascript api per attached image? please let me know , if need more information. enter image description here i not sure, looking for, anyway, how one? https://developers.google.com/maps/documentation/javascript/examples/maptype-image-overlay

SQL transactions in JavaScript -

how perform transaction of sql in javascript. have connected db in javascript. since have made connection database, have execute query follows: var x = 8; database_name.db.transaction(function(transaction){ transaction.executesql("select * table testid = ?", [x], function (transaction, result){ //write success function call here }, //ondone function function (transaction, error){ //write fail function call here } //onfail function ); }) as can see, passed variable x used include value instead of ?

javascript - Using a variable in req.body -

how use variable in req.body example: var names = {abc,xyz,cde}; var check = req.body.names[0]; or var names = {abc,xyz,cde}; var dummy = names[0]; var check = req.body.[dummy]; the first case throws error cannot read index 0 , second gives error of unexpected token '[' . trying fetch form data who's names stored in array names. ps: using node in end. if use numeric indexes names must array. use bracket notation: var names = [abc, xyz, cde]; var check = req.body[names[0]];

groovy transform list into map using a groupBy max -

ok, rather simple thing not able figure out. have groovy list objects in like: def listoftings = [ ["type": "a", "value": 1], ["type": "b", "value": 3], ["type": "a", "value": 2], ["type": "b", "value": 2] ] and want map out of groupby(type) max(value): ["a": 2, "b": 3] but can not find groupby method , have not figured out using collectentries . there standard way achieve such result? try following: listoftings.groupby { it.type }.collectentries { [(it.key): it.value.max { it.value }.value] } first groupby create map of lists grouped type field: [a:[[type:a, value:1], [type:a, value:2]], b:[[type:b, value:3], [type:b, value:2]]] next, collectentries it.value.max { it.value } pick single entry maximum value field: [a:[type:a, value:2], b:[type:b, value:3]] picking value it.value.max { it.value

Creating popups with django form -

what best way of creating django form popups .i have search online not fine .please out . there number of options ... easiest of course jquery: https://jqueryui.com/dialog/ $( function() { $( "#dialog" ).dialog(); } ); <div id="dialog" title="basic dialog"><p>message</p></div>

java - MenuItem is not showing up -

i can't menuitem working ,i have created other apps before reason not show : mainactivity.java package ie.example.artur.adminapp; import android.content.intent; import android.os.asynctask; import android.os.bundle; import android.support.design.widget.floatingactionbutton; import android.support.design.widget.snackbar; import android.support.v7.app.appcompatactivity; import android.support.v7.widget.toolbar; import android.view.view; import android.view.menu; import android.view.menuitem; import android.view.viewconfiguration; import android.widget.button; import android.widget.edittext; import android.widget.textview; import java.lang.reflect.field; import java.sql.connection; import java.sql.drivermanager; import java.sql.statement; public class mainactivity extends appcompatactivity { edittext edittextname,edittextemail,edittextpassword; textview textview; privat

php - Unrecognized option "knpu_guard" under "security.firewalls.main" (Symfony) -

i add facebook login option website. try follow this tutorial . if add knpu_guard part under main section, error: unrecognized option "knpu_guard" under "security.firewalls.main" my firewalls section in security.yml looks this: firewalls: main: anonymous: ~ #pattern: ^/ provider: our_db_provider form_login: login_path: login check_path: login logout: path: /logout target: / knpu_guard: authenticators: - app.form_login_authenticator - app.api_token_authenticator - app.facebook_authenticator # default, use start() function formloginauthenticator entry_point: app.form_login_authenticator i added knpu_guard section, nothing else changed under firewalls section i think tutorial little bit obsolete because knpu_guard no longer accepted. you can use guard in

c# - Lambda Except Placement -

i want return list of lans , want exclude userinformation.globals.lanid list. code: var lanlist = _context.corp_matrixpositionoldway .where(x => x.childorglevel.startswith(parentorg.tostring())) .select(x => x.childlan) .except(userinformation.globals.lanid); error: 'iqueryable' not contain definition 'except' i think want exclude single childlan , use where : var lanlist = _context.corp_matrixpositionoldway .where(x => x.childorglevel.startswith(parentorg.tostring())) .select(x => x.childlan) .where(lan => lan != userinformation.globals.lanid);

javascript - Axios post method React. State Redux not update -

i have problem state in redux axios request case 'register_user':{ var userdata = {username: action.payload.username, password : action.payload.password}; axios({ method: 'post', url: 'php/register.php', contenttype: "application/json; charset=utf-8", datatype: "json", data: userdata }).then(function(response) { state.error = response.data.errors; state.success = response.data.success; }); return {state}; break; }//end register_user default state.error , state.success empty array . after first click state.error still empty array because axois didn't finish request. after 2nd click fine. and here have problem props: {this.props.error.length>0? <div classname="alert alert-danger">{this.props.error[0]}</div>: ''} and store: @connect((store)=>{ return{ error: store.app.error, success: store.app.success, } }) do u know how can r

asp.net - Why won't my search box return any results? -

i using asp.net mvc5 , trying add textbox above table search items in table. in view have @using (html.beginform()) { <p> find start/end point @html.textbox("searchstring") <input type="submit" value="search" /> </p> } then in controller public actionresult index(string sortorder, string searchstring) { var lift = l in db.lifts select l; if (!string.isnullorempty(searchstring)) { lift = lift.where(l => l.startpoint.contains(searchstring) || l.endpoint.contains(searchstring)); } return view(lifts.tolist()); } } however returns same table every time. silly doing wrong can't see. try using this: @using (html.beginform("index","controllername",new { sortorder = "desc/asc" },formmethod.post)) { <p> find start/end point @html.

android - Scene. Slide transition under views -

Image
look @ sample. have 2 scenes, start & end scenes. layout of start scene: <?xml version="1.0" encoding="utf-8"?> <merge android:id="@+id/vgroot" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:parenttag="relativelayout" tools:ignore="hardcodedtext" > <button android:id="@+id/btn1" style="@style/widget.appcompat.button.borderless" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/cardview" android:text="button" android:layout_centerhorizontal="true" /> <button android:id="@+id/btngo" and

Java android get logs in file -

this how logs application : try { simpledateformat sdf = new simpledateformat( "yyyy-mm-dd", locale.us); string currentdateandtime = sdf.format(new date()); final file path = new file(environment.getexternalstoragedirectory(), "smok_komunal"); if (!path.exists()) { path.mkdir(); } log.e("path ", path.getabsolutepath()); runtime.getruntime().exec("logcat -f " + path + file.separator + "dbo_logcat_" + currentdateandtime + ".txt"); } catch (ioexception e) { e.printstacktrace(); } but in logs don't have a date , time in lines how can add date , time ? for getting date , time print log this: log.e("path ", path.getabsolutepath()+ " , "+currentdateandtime ); it give both file path , date , time

ios - Prevent selected cell from being reused -

so have tableview has list of items in each cell. each of these cells contain image view which, upon being tapped, expands cell , displays image item. when scroll down table view , scroll cell selected, image gone. know due reusing cells i'm not sure on how keep expanded cells image in place while scrolling through other items. the closest i've come here: my table view reuse selected cells when scroll -- in swift if lend me hand awesome. thanks! edit: adding code snippets - sorry wait. fileprivate var expandedrowindex: int? // cellforrowat func tableview(_ tableview: uitableview, cellforrowat indexpath: indexpath) -> uitableviewcell { // catalogitem row. let item = self.items[indexpath.row] let expanded = indexpath.row == self.expandeditemrowindex // return standard catalog item cell. let reuseid = expanded ? catalogitemcell.protocell_expanded.id : catalogitemcell.protocell.id let cell = tableview.dequeuer

arrays - Java sum two double[][] with parallel stream -

Image
let's have 2 matrices: double[][] = new double[2][2] a[0][0] = 1 a[0][1] = 2 a[1][0] = 3 a[1][1] = 4 double[][] b = new double[2][2] b[0][0] = 1 b[0][1] = 2 b[1][0] = 3 b[1][1] = 4 in traditional way, sum matrices nested loop: int rows = a.length; int cols = a[0].length; double[][] res = new double[rows][cols]; for(int = 0; < rows; i++){ for(int j = 0; j < cols; j++){ res[i][j] = a[i][j] + b[i][j]; } } i'm new stream api think great fit use parallelstream question if there's way , take advantage of parallel processing? edit: not sure if right place here go: using suggestions putted stream test. set this: classical approach: public class classicmatrix { private final double[][] components; private final int cols; private final int rows; public classicmatrix(final double[][] components){ this.components = components; this.rows = components.length; this.cols = components[0].length; } public cla

java - Connection failure with Oracle DB in intellij idea -

Image
i opened database through glassfish4 server when want access database intellij idea these errors: settings in glassfish:

sharepoint online - C# CSOM SPView ListItemCollection did not update after I add new field in the SP view -

spclientcontext.credentials = new sharepointonlinecredentials(username, securepassword); //https://msdn.microsoft.com/en-us/library/office/ee534956(v=office.14).aspx web spweb = spclientcontext.web; list splist_csv = spweb.lists.getbytitle("supplier master list"); view spview_csv = splist_csv.views.getbytitle("_data pending export csv");//oracle export field spclientcontext.load(spview_csv); spclientcontext.executequery(); camlquery query = new camlquery(); query.viewxml = spview_csv.viewquery; listitemcollection items = splist_csv.getitems(query); spclientcontext.load(items); spclientcontext.executequery(); foreach (var item in items) { //some field/item missing? } hi, using code above retrieve data sharepoint online. @ first, working fine. but, when add in new column view _data pending export csv on sharepoint online, found out new added field missing. idea? ok. found out others issue, lookup field on limit. did fix change lookup field s

Animation for changing Action bar title for each fragment swipe on android -

i have set custom action bar swipe (viewpager) tabs using toolbar widget , fragments. i want have different action bar "title" each tab. great if set animation while swiping. i appreciate suggestions , links tutorials! in advance:) mainactivity.java public class mainactivity extends fragmentactivity implements json.listener { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); toolbar toptoolbar = (toolbar) findviewbyid(r.id.toolbar); toptoolbar.settitle("weather"); toptoolbar.inflatemenu(r.menu.menu_home); toptoolbar.setonmenuitemclicklistener(new toolbar.onmenuitemclicklistener() { @override public boolean onmenuitemclick(menuitem item) { int id = item.getitemid(); //noinspection simplifiableifstatement if (id == r.id.add_city) { try { autocompletefilte

c# - SharpDx Direct2D draw layers on top of each other -

i creating application using sharpdx render control want draw multiple layers in control on top of each other using direct2d rendertarget , layers should visible. problem when call rendertarget.clear(color.transparent) clear screen black , can not see other layers. if not call clear method not clear current layer, drawing line using mouse move needed clear layer. can not draw each layer every time because can have thousands of objects draw can slow down application. how clear layer transparent background, can see other layers @ same time? or there other way this? //sample code if(!newobject) drawallgeometry(rendertarget, strokewidth); else { layer = new layer(rendertarget, rendertarget.size); var layerparam = new layerparameters() { contentbounds = rectanglef.infinite }; rendertarget.pushlayer(ref layerparam, layer); rendertarget.clear(color.transparent); /* code makes screen black. want layer transparent, can see drawings of drawallgeometry() */ rendertarge

input - Error: replacement has 1 row, data has 0 (R shiny error) -

i have been trying use daterange , checkbox input have 2 filtering options data. after filtering, have computed values meaningful information. after that, used dt package visualize , shinydashboard put on website. it worked fine daterange input. gave me error title after have added checkbox option additional filtering. used modulation. i trying fix error having hard time here. here code the added line think causing problem in module part, looking @ reactive function filters data checkbox input. the error says "replacement has 1 row, data has 0" i glad if problem fixed. i appreciate time , helps! ui ui <- dashboardpage( title = "service management process dashboard" , skin = "purple" , dashboardheader(title = "it processes") , dashboardsidebar( sidebarmenu( id = "tabs" , menuitem("incident management", tabname = "incidentmanagement", icon = icon("change")) ) ) , dashboardbody(

mysql - DELETE based on select -

i have 1 complicated select, fills temporary table ids, based on need create delete query. for example, temp table's rows looks like: - first_id | second_id | third_id - 1 | 222 | 342 - 1 | 222 | 343 - 1 | 223 | 551 ... and query : delete mytable concat(first_id, 'x', second_id, 'x', third_id) in (select concat(first_id, 'x', second_id, 'x', third_id) temp_table); but query long. when show processlist, see query time 4000s. so question is, how can optimise delete query, delete rows 1 table based on select table , delete rows based on 3 keys? you can start removing concat , use join instead of subquery, try : delete mt mytable mt inner join temp_table tt on mt.first_id = tt.first_id , mt.second_id = tt.second_id , mt.third_id = tt.third_id

kernel module - Linux Platform device "remove" method -

question on standard practice when rmmod'ing module platform device. when remove platform device not seem call .remove method defined in struct platform_driver . in __exit function, i'm calling platform_device_unregister , platform_driver_unregister , looking @ source, neither of them seem call remove function. current implementation calls remove method manually in __exit function, standard procedure platform devices?

c++ - how to get template parameter of a template template parameter? -

assume std::vector didnt have value_type . is possible write template deduce value_type ? or more general, given t<x> , how can deduce x ? a naive.. template <template <typename x> t> void test(t<x> t) { x x; } will make knows bit templates laugh @ foolish attempt , when instantiated this: int main() { std::vector<int> x; test(x); } create following errors: error: expected ‘class’ before ‘t’ template < template<typename x> t> ^ error: ‘x’ not declared in scope void test(t<x> u) { ^ error: template argument 1 invalid void test(t<x> u) { ^ in function ‘void test(int)’: error: ‘x’ not declared in scope x x; ^ error: expected ‘;’ before ‘x’ x x; ^ in function ‘int main()’: error: no matching function call ‘test(std::vector<int>&)’ test(x); ^ note: candidate is: note: template<template<class x> class

asynchronous - AsyncResponseWrapper Servlet -

is possible somehow modify async servlet's response? non async responses used httpservletresponsewrapper , wondering if possible wrap async servlet response did simple response (through filter) can modify response content.

angular - How to use service class in angular2 -

i new in both angular2 , .net core followed this tutorial , learned pretty solution work angular ( and .netcore ). have problem! when create service this: import { injectable } '@angular/core' import { http } '@angular/http' import 'rxjs/rx' import { accountsummary } './account-summary.type' import { accountdetail } './account-detail.type' import { accounttype } './account-type.enum' @injectable() export class accountservice { constructor(private http : http) { } getaccountsummeries() { debugger return this.http.get('api/bank/getaccountsummeries') .map(response => response.json() accountsummary[]) .topromise(); } } and import in app.module.share.ts file: . . import { accountservice } './components/shared/account.service' //here<< export const sharedconfig: ngmodule = { bootstrap: [appcomponent], //namespace off components: declarations: [

c++11 - auto with const_cast reference behaves strange -

can me understand "weird" behavior? playing around c++11 after long pause in c++ programming. why works fine until use auto? static void printit(int a,const int *b, const int &c) { std::cout << "\narg1 : " << << "\narg2 : " << *b << "\narg3 : " << c << std::endl; } int main() { int myvar { 0x01 }; const int *pmv { &myvar }; const int &rmv { myvar }; printit(myvar,pmv,rmv); //ok prints 1,1,1 *(const_cast<int *>(pmv)) = 0x02; //remove constness pmv , sets new value printit(myvar,pmv,rmv); //ok prints 2,2,2 (const_cast<int &>(rmv)) = 0x03; //remove constness rmv , sets new value printit(myvar,pmv,rmv); //ok prints 3,3,3 myvar = 0x04; printit(myvar,pmv,rmv); //ok prints 4,4,4 //so far good... auto = const_cast<int *>(pmv); //creates new variable of type int * *a = 0x05; printit(myvar,a,rmv

@Transaction annotation between layers in Spring -

what difference in using @transactional annotation in domain/service layer , dao layer. provide advantage using in domain layer. it practice use @transactional in service layer because governs logic needed identify scope of database and/or business transaction. persistence layer design doesn't know scope of transaction. daos can made @transactional other bean, it's common practice use in service layer. tend because want separation of concerns . persistence layer retrieve / stores data , forth database. for example, if want transfer amount 1 account another, need 2 operations, 1 account needs debited other needs credited. so, scope of these operation known service layer , not persistence layer. the persistence layer cannot know transaction it's in, take example method person.updateusername() . should run in it's own separate transaction always? there no way know, depends on business logic calling it. here few thread should read where @transactio

Getting git fetch output to file through python -

i trying save git fetch output file through python, using: subprocess.check_output(["git", "fetch", "origin", ">>", "c:/bitbucket_backup/backup.log", "2>&1"], cwd='c:/bitbucket_backup/loopx') but believe there missing in subprocess.check_output args because when adding >> c:/bitbucket_backup/backup.log 2>&1 receive error: traceback (most recent call last): file "<pyshell#28>", line 1, in <module> subprocess.check_output(["git", "fetch", "origin", ">>", "c://bitbucket_backup//backup.log", "2>&1"], cwd='c://bitbucket_backup//loopx') file "c:\users\fabio\appdata\local\programs\python\python36-32\lib\subprocess.py", line 336, in check_output **kwargs).stdout file "c:\users\fabio\appdata\local\programs\python\python36-32\lib\subprocess.py", line 418

java - WebSocket: OnClose() is never called -

i'm implementing application websocket endpoint. here code: @applicationscoped @serverendpoint(value="/socket", encoders = {messageencoder.class, commandencoder.class}) public class socketendpoint { /** default-logger */ private final static logger log = loggerfactory.getlogger(socketendpoint.class); @inject sessionhandler sessionhandler; @onopen public void open(session session, endpointconfig config) { log.debug("connected session => '{}' - '{}'", session, config); sessionhandler.initsession(session); } @onmessage public void onmessage(session session, string messagejson) { // } @onclose public void onclose(session session, closereason reason) { log.debug("closing session => '{}' - '{}'", session, reason); sessionhandler.removesession(session); } @onerror public void onerror(session session, throwable e

llvm - llc: unsupported relocation on symbol -

problem llc giving me following error: llvm error: unsupported relocation on symbol detailed compilation flow i implementing llvm frontend middle-level ir (mir) of compiler, , after convert various methods many bitcode files, link them ( llvm-link ), optimize them ( opt ), convert them machine code ( llc ), make them shared library ( clang it's linker wrapper), , dynamically load them. llc step fails of methods compiling! step 1: llvm-link : merge many bitcode files i may have many functions calling each other, llvm-link different bitcode files might interact each other. step has no issues. example: llvm-link function1.bc function2.bc -o lnk.bc step 2: opt : run optimization passes for using following: opt -o3 lnk.bc -o opt.bc this step proceeds no issues, that's 1 causes problem! also, it's necessary because in future need step pass passes, e.g. loop-unroll step 3: llc : generate machine code (pic) i using following command: llc -m

javascript - Download SVG with images -

i want download svg image in dom. i've searched around on stack overflow , common approach following these steps: serialize svg xml string var svgimage = document.getelementbyid('maskedimage') var svgxml = (new xmlserializer).serializetostring(svgimage) create javascript image xml string source var img = new image(); var svgblob = new blob([data], {type: 'image/svg+xml;charset=utf-8'}); var url = domurl.createobjecturl(svgblob); img.onload = function () { /* next steps go here */ } img.src = url; draw image on canvas var canvas = document.createelement('canvas') var ctx = canvas.getcontext('2d') canvas.width = width canvas.height = height ctx.drawimage(img, 0,0, width, height) dump canvas url , make user download that window.open(canvas.todataurl('image/png')) // not point of question the thing is, svg has <image> tag svg mask (which black , white <image> ). make things worse, 1 of these images has

python - numpy get column indices where all elements are greater than threshold -

i want find column indices of numpy array elements of column greater threshold value. for example, x = array([[ 0.16, 0.40, 0.61, 0.48, 0.20], [ 0.42, 0.79, 0.64, 0.54, 0.52], [ 0.64, 0.64, 0.24, 0.63, 0.43], [ 0.33, 0.54, 0.61, 0.43, 0.29], [ 0.25, 0.56, 0.42, 0.69, 0.62]]) in above case, if threshold 0.4, result should 1,3. you can compare against min of each column using np.where : large = np.where(x.min(0) >= 0.4)[0]

python - Pip is rolling back uninstall of setuptools -

i using this ansible-django stack deploy django project aws ec2 instance. worked fine long time, suddenly, error below when deploying. it seems there new setuptools build not updated. why rollback uninstall of setuptools ? why not install setuptools 36.2.2? specifying explicitly version of setuptools in requirements solves issue, since indirectly dependent on setuptools , should not responsibility know version keep. installing collected packages: shared-django, setuptools found existing installation: shared-django 0.1.0 uninstalling shared-django-0.1.0: uninstalled shared-django-0.1.0 running setup.py install shared-django: started running setup.py install shared-django: finished status 'done' found existing installation: setuptools 36.2.0 uninstalling setuptools-36.2.0: uninstalled setuptools-36.2.0 rolling uninstall of setuptools :stderr: exception: traceback (most recent call last): file \"/webapps/catalogservice/lib