Posts

Showing posts from June, 2012

tfs sdk - TFS API - how to make sure Workspace.OwnerIdentifier is not null? -

Image
i have following code var ws = vcs.getworkspace(wsname, vcs.authorizeduser); however, ws.owneridentifier null @ point. next value is: ws.update(new updateworkspaceparameters { computer = ws.computer }); and ws.owneridentifier no longer null. there must better way obtain ws.owneridentifier in scenario. ideas? our back-end tfs 2017. i can ws.owneridentifier value correctly nuget package microsoft.teamfoundationserver.extendedclient installed. tried version 15.xxx , 14.xx, both worked. you need specify wsname quotes: ( see versioncontrolserver.getworkspace method (string, string) ) var ws = vcs.getworkspace("wsname", vcs.authorizeduser); below sample reference: using system; using microsoft.teamfoundation.versioncontrol.client; using microsoft.teamfoundation.client; namespace _0912_getworkspaceidentifier { class program { static void main(string[] args) { string collection = @"http://server:8080/tfs

How to Declare Modules in java 9 -

i want use java 9 modules in project. want put data , service classes (in package named com.test.base ) in 1 module named (base), , put other things main class , gui (in package named com.test.main ) in module named (main). how declare simple module (base)? how declare module (main) dependency of (base) module? i want use (base) module reflection. assume root package com.test directory structure should use these modules? the jigsaw quick-start nice place start off out. answer specific questions: how declare simple module (base)? create class named module-info.java within com.test.base directory definition as: module base { exports com.test.base; } this exports com.test.base package. how declare module (main) dependency of (base) module? same other module base class named module-info.java within com.test.main directory definition as: module main { requires com.test.base; } makes use of exported package. i want use (ba

eclipse - how to treat file extension as C-file -

how force eclipse treat file-type c/c++ file it'll index them? my makefiles create .pp files pre-processor output , want view c/c++ files. you can define mapping .pp extension c++ source file file type in preferences | c/c++ | file types .

amazon web services - Athena Write Performance to AWS S3 -

so i'm executing query in aws athena , writing results s3. seems taking long time (way long in fact) file available when tell query execute lambda script. i'm scanning 70mb of data, , file returned 12mb. execute lambda script so: athena_client = boto3.client('athena') athena_client.start_query_execution( querystring=query_string, resultconfiguration={ 'outputlocation': 'location_on_s3', 'encryptionconfiguration': 'sse_s3', } ) if run query directly in athena takes 2.97 seconds run. looks file available after 2 minutes if run query lambda script. does know write performance of aws athena aws s3? know if normal. docs don't state how write occurs.

gcc -M how to print full path for dependencies -

my gcc command gcc <other-stuff> -c -md -o build/main.o main.c , outputs .p file make dependency rules. in .p file, files listed relative paths , absolute. how force output absolute paths files?

linux - MySQL how to recover data from an old disk? -

is possible can recover data mysql ubuntu server? needed change disk in server installed new ubuntu, in old disk still have files in /var/lib/mysql/ old databases are. possible recover database files? how it? copying database old disk /var/lib/mysql/ new server disk? work instantly or need create first empty databases in phpmyadmin? if data still here it´s promising recovery. 1/. need /var/lib/mysql directory sudo cp -r -p /var/lib/mysql /var/lib/mysql.back 2/. reinstall mysql (it erase mysql folder) sudo apt-get install mysql-server 3/. erase new data folder old one sudo cp -r -p /var/lib/mysql.bask /var/lib/mysql if you´re using same directories should work that.

r - Shiny renderPlotly with two conditions -

i developing app in shiny. want render plot using submit button. want print labels if user check inputcheckbox. able render plot via button. doesnt work when checkbox checked. here code: library(shiny) library(plotly) ui <- fluidpage( actionbutton('run', 'run'), checkboxinput('printlab', 'label', false), plotlyoutput("plot1") ) server = function(input, output) { output$plot1 <- renderplotly({ req(input$run) isolate({ ggplotly(ggplot(data = mtcars, aes(wt, hp)) + geom_point(size=1, colour = "grey")) }) req(input$printlab) isolate({ ggplotly(ggplot(data = mtcars, aes(wt, hp)) + geom_point(size=1, colour = "grey") + geom_text(aes(label=wt), size=3, colour = "black")) }) }) } runapp(shinyapp(ui, server)) i'm no shiny expert, req(input$printlab) doesn't right me. accomplish going for? server <- function(input, outp

How to use manual references when inserting and retrieving relational data using MongoDb and its C# driver -

as may obvious of question, coming relational database way of thinking (sql server) , using orms (entity framework). want same things in mongodb , having troubles it. let me explain simple scenario. suppose have user, , each user can write posts (a one-to-many relationship in sql). working simple case. i've read 2 or 3 articles (and mongodb's original documentation) when use manual references , dbref s , when embed documents within each other. , here going needing posts without users (like when visitor of website wants see posts) , users without posts (like managing user profiles or something), believe these 2 entities (documents) should separated. now let's our hands little dirty code. in entity framework implement idea above this: //user model public class user { public int id { get;set; } public string name { get; set; } public list<post> posts { get; set; } public user { this.posts = new list<post>(); } } /

How can I use Jersey libraries to convert a JSON string to something more parseable in Java? -

i new rest , trying mess around bit accustomed it. have decided create little project involves accessing location data google's api. there lot of posts converting json strings objects in java of them seem use different libraries i'm using, jersey. right now, i'm using google maps api return information location given user, right now, returns string so: { "results" : [ { "address_components" : [ { "long_name" : "san antonio", "short_name" : "san antonio", "types" : [ "locality", "political" ] }, { "long_name" : "bexar county", "short_name" : "bexar county", "types" : [ "administrative_area_level_2", "political" ] }, { "long_n

DateFormat for Kendo DatePicker -

how can format kendo date picker mm/dd/yyyy in angular. how can can remove month/dd/yyyy watermark date picker you can bind datepicker format input , provide desired formatting string, e.g.: <kendo-datepicker [format]="'mm/dd/yyyy'" ... ></kendo-datepicker> example the placeholder comes current culture info, , cannot removed, barring hacks, based on clearing underlying html input element's value programmatically.

iis - In C# what if the app pool is reset before the response of an async/await call returns? -

i have async code running in web api, therefore managed iis. since app pool prone getting restarted, happen if make async call, app pool restarted before response comes async call? i'm assuming that, since memory of app pool wiped, response never processed. correct? if so, c# have kind of mechanism can use make sure response still processed, if app pool has been reset? if await chain awaited way controller not reset app pool on you, acts same other request has not completed yet , keep app pool alive long have synchronous request. if talking "fire , forget" task not block controller completing need use kind of library offload work off of iis or have work re-tried if canceled. use hangfire.io , here a list of other options fire , forget tasks.

python - snapcraft register failing with "can't encode character" -

i'm running through create first snap tutorial @ ( https://tutorials.ubuntu.com/tutorial/create-your-first-snap ) i've made step 7 (upload store) , stuck on step register app name. running snapcraft register hello-pward123 returns following python error stack: traceback (most recent call last): file "/usr/bin/snapcraft", line 9, in <module> load_entry_point('snapcraft==2.33', 'console_scripts', 'snapcraft')() file "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 542, in load_entry_point return get_distribution(dist).load_entry_point(group, name) file "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2569, in load_entry_point return ep.load() file "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2229, in load return self.resolve() file "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2235, in resolve

ios - Importing JavaScript file into Swift file -

Image
i trying execute javascript sdk within swift application. unable find file however. added file project using cmd + click project -> add files "projectname" -> add file , move projectname/ folder. i still unable file , run inside jscontext . where going wrong? here code ( isok used test case): import foundation import javascriptcore public class wrapper { public var isok: bool var jscontext: jscontext init (pathtosdk: string) { let virtualmachine = jsvirtualmachine() self.jscontext = jscontext(virtualmachine: virtualmachine) if let sdkbundle = bundle.main.path(forresource: pathtosdk, oftype: "js") { let bundlestring = try! string(contentsoffile: sdkbundle) self.jscontext.evaluatescript(bundlestring) print("successfully initialised javascript context") self.isok = true } else { print("unable fetch sdk bundle @ path: \(pathtosdk)&

php - Pass socket.io room with socket_write? -

i curently using socket_write open websocket , pass data node.js socket.io server. sending bits of html so: private function opensocketconnection($address = 'localhost', $port = 5600) { $socket = socket_create(af_inet, sock_stream, sol_tcp); socket_connect($socket, $address, $port); return $socket; } $socket = $this->opensocketconnection(); socket_write($socket, $html, strlen($html)); this works fine , sends data node.js socket.io server catch so: socket.on('data', (msg) => {}); but want send data specific room instead of general socket.io room. there way setup can specify room? perhaps when using socket_create() or something? prevent pass room name on every socket_write if possible. clients can send data server itself. if want send message users in specific room, create message client can send tell server on behalf of client. // client-side socket.emit("sendtoroom", {room: "someroom", data: "hel

c++11 - operate on c++ 11 variadic template parameters, store into tuple -

i'm trying learn bit of c++ 11 variadic template arguments. i want take list of floating point input arguments converttest(), return std::tuple of ints. try compile following in g++: template<typename ...argsin, typename ...argsout> static inline std::tuple<argsout...> converttest(float nextarg, argsin... remainingargs) { auto = converttest(remainingargs...); auto b = std::make_tuple(int(nextarg)); auto c = std::tuple_cat(a, b); return c; } static inline std::tuple<int> converttest(float lastargin) { return std::make_tuple((int)lastargin); } int main() { auto res = converttest(0.5f, 10.11f); return 0; } i following error: error: conversion 'std::tuple<int, int>' non-scalar type 'std::tuple<>' requested i'm not sure why return type std::tuple<argsout...> resolve std::tuple<> . ideas? i've tried making return type auto , complaints missing trailing return types in case.

Windows Small System Icon Height Incorrect -

i'm running on windows 10, using delphi 7 (yes, know it's quite old). i want use system icons in windows , have gone defining timagelist called systemicons initialize follows: var fileinfo: tshfileinfo; begin systemicons.handle := shgetfileinfo('', 0, fileinfo, sizeof(fileinfo), shgfi_icon or shgfi_smallicon or shgfi_sysiconindex); ... i have systemicons properties set statically timagelist component width , height set 16. elsewhere, wish retrieve icon image list given valid shell object's image index. because these "small system icons", expect them 16x16. result of calling getsystemmetrics(sm_cysmicon) yields 16. oddly, dimensions depend upon whether retrieve them bitmap or icon. ... var icon: ticon; bm: tbitmap; begin ... icon := ticon.create; systemicons.geticon(imgindex, icon); bm := tbitmap.create; systemicons.getbitmap(imgindex, bm); the imgindex correct , same in both cases. image retrieved same in eac

javascript - Stop jQuery.typewriter plugin being executed when input is not visible -

i using typewriter plugin, should animate placeholder of input when form visible. works. however, i'd stop animation, when searchbar not visible anymore (eg. on esc event). tg_search = function() { var search_icon = $('.tg-search'), header = $('.fusion-header'), writing = false; var search_tl = new timelinemax({ reversed: true, paused: true, }) search_tl .to('.tgicon-search.-open', 0.2, {autoalpha: 0, display: 'none'}) .to('.tgicon-search.-close', 0.2, {autoalpha: 1, display: 'inline'}) .to('.tg-search__wrapper', 0.5, {y: 0, autoalpha: 1}); search_icon.click(function (e) { /*event.preventdefault();*/ writing = true; search_tl.reversed() ? search_tl.play() : search_tl.reverse(); }); // esc event $(document).on('keydown', functi

R data.table: (dynamic) forward looking Cross-Joins -

i wondering if there option cj() method in data.table take vectors formed evaluated condition instead of running full cross join. data library(data.table) df<-data.table( id=c(18l, 18l, 18l, 46l, 74l, 74l, 165l, 165l), cat=c(1300l, 1320l, 1325l, 1300l, 1300l, 1325l, 1300l, 1325l), low=c(24.625, 16.250, 14.500, 43.625, 58.250, 45.375, 90.750, 77.875), high=c(26.625, 17.500, 15.500, 45.625, 60.000, 47.375, 92.750, 79.875) ) df id cat low high 1: 18 1300 24.625 26.625 2: 18 1320 16.250 17.500 3: 18 1325 14.500 15.500 4: 46 1300 43.625 45.625 5: 74 1300 58.250 60.000 6: 74 1325 45.375 47.375 7: 165 1300 90.750 92.750 8: 165 1325 77.875 79.875 here, have total of 8 observations of 4 different items (ids 18, 46, 74 , 165). each item recorded in several categories (cat 1300, 1320, 1325) , 2 measurements taken (low , high). desired output i want create table each item (id) joins low value of each category (cat) high values of categories that la

node.js - JavaScript function; works locally but not for Lambda Minibootcamp -

this driving me crazy. appreciated. situation: an existing object, storeitem has 2 relevant properties, price, , discountpercentage. write function (from outside of object), called addcalculatediscountprice, adds method, called calculatediscountprice storeitem returns discounted price. here code: function addcalculatediscountpricemethod(storeitem) { // add method storeitem object called 'calculatediscountprice' // method should multiply storeitem's 'price' , 'discountpercentage' discount // method subtracts discount price , returns discounted price // example: // price -> 20 // discountpercentage -> .2 // discountprice = 20 - (20 * .2) storeitem.calculatediscountprice = function() { var discount = this.discountpercentage; var saved = this.price * discount; var finalprice = this.price - saved; return finalprice; }; } this part of lambda javascript mini bootcamp, has me install npm inside of each assignmen

javascript - parse specific cell and through using js-xlsx -

Image
i want parse specific cell on excel, example want parse starting on cell b5 , through cells has value, using js xlsx me on this. excel file this.

sh - unix AIX - get the status of a child background process in the parent shell script -

i have parent shell calls child shell background process. in child shell send exit parent , required capture status of child in parent process. using "jobs" command same. able capture running status of child , dont done status in parent. please find below code , output - parent shell: #!/bin/ksh date ./sleep.com& echo $? echo $! pid=$! echo $pid jobs $pid wait $pid jobs $pid echo $pid child shell (sleep.com- background process): #!/bin/ksh sleep 8 exit 10 output of execution- september 11, 2017 @ 07:58:17 pm 0 12517444 12517444 [1] + running <command unknown> ./parent.com[10]: jobs: no such job 12517444 please me capture status of jobs command post completion of child. in case error: ./parent.com[10]: jobs: no such job thanks & regards himanshu agrawal. try wait -n : #!/bin/ksh set -v date ./sleep.com& echo $? pid=$! echo $pid wait -n $pid child_exit=$? printf 'child exited code %d\n' "

autohotkey - Is there an alternate way to hold down a mouse button with AHK? -

for holding down mouse button, i've tried: click down and send {lbutton down} but both of these methods cause game i'm making macro log me out "too many actions". there alternative methods? mouseclick mouseclick, left, x, y, d

how to disable pdb.set_trace() without stopping python program and edit the code -

i suspect have issue in 1 of loops, setup break points pdb.set_trace() import pdb in range(100): print("a") pdb.set_trace() print("b") after check variable in loop few times, decide continue programming without further breaks. try break number b command, no breaks listed. guess line of code don't setup break point. how ride of "break points" without stopping program , change code? to knowledge, not bypass set_trace , neutralize it, once debugger stopped, type: pdb.set_trace = lambda: 1 then continue, wont break again.

Want to get a pivot table - like output, with two row levels in R -

i trying create grouped tables make excel pivot table. far, i've used ddply sum data groups, can't figure out how create subtotals other making them each individually , piecing them table. here sample of data after grouped ddply: species<-c("bigeye","bigeye","bigeye","bigeye","yellowfin","yellowfin", "yellowfin") country<-c("japan", "canada", "hongkong", "southkorea", "japan", "canada", "malaysia") pounds<-c(445274,152467,9768,2406,216323,19689,108) dollars<-c(4298063, 2420140, 58596, 14432,3682677,212323, 5309) unitvalue<-c(9.65, 15.87, 6, 6, 17.02,10.78, 49.16) volumeshare <-c(73, 25, 1.6, .39, 91.62, 8.34, .05) valueshare <-c(63.29, 35.64, .86, .21, 94.42, 5.44, .14) fish<-data.frame(species, country, pounds, dollars, unitvalue, volumeshare, valueshare) it creates table this: species country poun

javascript - Add <span> to innerHTML with value -

based off thread: using css stylesheet javascript .innerhtml to stylize innerhtml such this: document.getelementbyid("id").innerhtml = "this error"; all need this: document.getelementbyid('error-message').innerhtml = "<span class='error'>my error</span>"; but if have value? how apply tag this: document.getelementbyid('ptext').innerhtml = "you clicked: " + value; innerhtml string that's converted / interpreted html, long add tags around value, it'll work: document.getelementbyid('ptext').innerhtml = "<span>you clicked: " + value + "</span>"; alternatively, add span html directly, , set innerhtml of span "you clicked :" + value in js, bit cleaner.

jquery - How to query function from ajax call? -

i want draw google chart, query written in function in ajax.php file. chart in different php file calling json data using ajax. i want call function in php file, joblocation(). function joblocation(){ global $db; //query location total post $sql = 'select ljl.location_id, count(ljj.job_id) count, ljl.location_name {local_jobs_job} ljj inner join {local_jobs_location} ljl on ljj.job_location = ljl.location_id ljj.job_type = 0 group ljl.location_name'; //get query record $data = $db->get_records_sql($sql); //put query array $rows = array(); $rows = array_map(function($item) { return (object) ['c' => [ (object) ['v' => $item->location_name, 'f' => null], (object) ['v' => intval($item->count), 'f' => null] ]]; }, array_values($data)); // prepare return data $cols = [ (object) ['id' => '', 'label' => 'label', 'pattern' => '', 'type'

UWP In-App Notifications (As opposed to Toast notifications) -

on android, toast notifications work differently uwp. shows little black popup message on top of app. in uwp, toast notifications indistinguishable push notifications user perspective. there standardized way in uwp show quick notification inside app disappear after few seconds , not interfere user's experience? mean without looking user has received push notification? this article doesn't seem hint @ talking about. https://docs.microsoft.com/en-us/windows/uwp/controls-and-patterns/tiles-badges-notifications the uwp toolkit provides inappnotifications control this. http://www.uwpcommunitytoolkit.com/en/master/controls/inappnotification/

java - MQ initial context class in MQ series 9 -

i have jndi context in mq queue manager, standalone java client able lookup, initial context class, com.ibm.mq.jms.context.wmqinitialcontextfactory , working mq client jars versions before mq 8. has mqcontext.jar in classpath. with mq 8 , 9, trying use relocatable jars com.ibm.mq.allclient.jar , com.ibm.mq.tracecontrol.jar in classpath , jndi lookup failing. if add old mqcontext.jar classpath, below error. javax.naming.namingexception: caught mq exception: com.ibm.msg.client.jms.detailedmessageformatexception: jmscc0053: exception occurred deserializing message, exception: 'java.io.invalidclassexception: com.ibm.msg.client.wmq.common.wmqconnectionname; local class incompatible: stream classdesc serialversionuid = 3226780381239434112, local class serialversionuid = -2174857328193645055'. for ibm mq classes jms can find list of files required on knowledge center page " what installed ibm mq classes jms ": relocatable jar files within enter

vb.net - Reader = comm.ExecuteReader Multiple-step OLE DB operation generated errors -

i trying write code checks whether query generates rows use of reader.hasrows property. stuck error: an unhandled exception of type 'system.data.oledb.oledbexception' occurred in system.data.dll additional information: multiple-step ole db operation generated errors. check each ole db status value, if available. no work done. the visual studio debugger says error comes statement: reader = comm.executereader this code: dim reader oledbdatareader myconn.connectionstring = connstring myconn.open() dim checkquery string = "select * parentandguardian first_name = @firstname , middle_name = @middlename , last_name = @lastname" dim comm new oledbcommand(checkquery, myconn) comm.parameters.addwithvalue("@firstname", txtfirstname) comm.parameters.addwithvalue("@middlename", txtmiddlename) comm.parameters.addwithvalue("@lastname", txtlastname) reader = comm.executereader if (r

android - i can't fetch data with retrofit -

i'm implement recycler view , use retrofit fetch data api data array json after i'm implement retrofit object , inside loop have problem can't fetch data send data model , don't have error message , blank screen , message in logat e/recyclerview: no adapter attached; skipping layout this mainactivity : public class mainactivity extends appcompatactivity { private recyclerview recyclerview; private progressbar progressbar; private linearlayoutmanager mlinearlayout; arraylist<model> list; adapter adapter; string url = "https://d17h27t6h515a5.cloudfront.net/"; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.listitem); recyclerview = (recyclerview) findviewbyid(r.id.recycler_view); progressbar = (progressbar) findviewbyid(r.id.progressbar); mlinearlayout = new linearlayoutmanager(mainactivity.th

angular - Does not display toaster If first before redirecting to another page angular4? -

i have using angular4. have used toaster package is:- ng2-toastr requirement is:- if delete user redirect component , between show toaster on delete. how possible. redirect page , show toaster. please share code. good day, this.router navigate promise return true if navigation completed. can use this.router.navigate(['/heroes']).then(() => { this.toasts.show('message'); }) if need show after deleted use this this.service.delete(user).topromise().then(() => { this.toasts.show('message'); this.router.navigate(['/heroes']); }) have great day.

typescript - Type 'void' is not assignable to object -

export class logininfo { username: string; password: string; } public getlogininfo(id: number): promise<logininfo> { return this.http.get(this.url + id + '/' + '/logininfo') .topromise() .then(response => response.json() logininfo) .catch((error: response) => { this.handleerror(error); }); } got code retrieving data api controller. when compiling in ts, getting error: type 'promise<void | logininfo>' not assignable type 'promise<logininfo>' type 'void' not assignable type 'logininfo' here package versions: "typescript": "2.5.2", "@angular/compiler": "4.3.6" "@angular/compiler-cli": "4.3.6" you need return on error handling case or throw new error. method promises return logininfo if error occurs return nothing, typescript protect accidentally returning nothing, if want should r

Can we add jQuery reference to web.config file instead of adding it to every asp.net page? -

i using jquery in web forms, , looking possible way add jquery reference web.config don't have add in every page. don't master page please. because if use master page , reference giving problem aspx repeated. use master page . add jquery reference there

c++ - When to prefer const lvalue reference over rvalue reference templates -

currently reading codebase cpr requests library: https://github.com/whoshuu/cpr/blob/master/include/cpr/api.h noticed interface library uses perfect forwarding quite often. learning rvalue references relatively new me. from understanding, benefit rvalue references, templating, , forwarding function call being wrapped around take arguments rvalue reference rather value. avoids unnecessary copying. prevents 1 having generate bunch of overloads due reference deduction. however, understanding, const lvalue reference same thing. prevents need overloads , passes reference. caveat if function being wrapped around takes non-const reference, won't compile. however if within call stack won't need non-const reference, why not pass const lvalue reference? i guess main question here is, when should use 1 on other best performance? attempted test below code. got following relatively consistent results: compiler: gcc 6.3 os: debian gnu/linux 9 <<<< passing rvalue

vba - assign value of cell from another worksheet to a variable -

i cannot cope following issue. have in module code. code working when i'm in sheet2. when skipping sheet1 , run macro returns me 0. i'd appreciate if point @ mistake i've done. public sub test() dim ws worksheet dim cost double set ws = sheets("sheet1") cost = worksheets("sheet2").application.sum(range("a2:a10")) msgbox cost ws.range("c2") = cost end sub coz forget put sheet2's name in front of range(a2:a10). , no need specify sheet name before applicaiton. supposed this cost = application.sum(worksheets("sheet2").range("a2:a10"))

Jenkins blueocean plugin - Unable to create pipeline from github -

getting below error in jenkins during last step of creating pipeline github using personal access token - sep 03, 2017 7:34:43 com.squareup.okhttp.internal.platform$jdkwithjettybootplatform getselectedprotocol info: alpn callback dropped: spdy , http/2 disabled. alpn-boot on boot class path? jenkins ver. 2.78 openjdk version "1.8.0_141" i running jenkins using vagrant inside centos 7. it worked fine after changing machine mac os ubuntu & upgrading blueocean plugin "1.3.0-beta-2". the reason proxy or other setting not allowing communication happen. since took fair amount time debug, hope else doesn't waste time & check machine configs before putting bug.

node.js - how to use http-proxy npm in node with cas -

i have cas server authentication running on 8443. app1 : running on ipaddress1:3000 app2 : running on ipaddress2:3000 app1 , app2 same running on 2 different machines , has authentication enabled via cas. http-proxy app : configured reverse proxy on 3838 app1 , app2. so, requests goes app1 , app2 via 3838. but, once authentication done, app redirecting service url(i.e. ipaddress1:3000) instead of proxy server. can me out on how configure cas proxy server after authentication still accessible via proxy address(3838) ?

pyspark - Exploding pipe separated data in spark -

i have spark dataframe( input_dataframe ), data in dataframe looks below: id value 1 2 x|y|z 3 t|u i want have output_dataframe , having pipe separated fields exploded , should below: id value 1 2 x 2 y 2 z 3 t 3 u please me achieving desired solution using pyspark. appreciated we can first split , explode value column using functions below, >>> l=[(1,'a'),(2,'x|y|z'),(3,'t|u')] >>> df = spark.createdataframe(l,['id','val']) >>> df.show() +---+-----+ | id| val| +---+-----+ | 1| a| | 2|x|y|z| | 3| t|u| +---+-----+ >>> pyspark.sql import functions f >>> df.select('id',f.explode(f.split(df.val,'[|]')).alias('value')).show() +---+-----+ | id|value| +---+-----+ | 1| a| | 2| x|

linux - ACPI event not triggering associated action -

i've been trying time enable computer's fn+f9/f10 brightness control. reading this thread , tried set acpi event/action script manually change brightness. scripts work - can manually call bl_down.sh , bl_up.sh in terminal. however, reason acpi events aren't triggering scripts. i've included output of acpi_listen below, scripts: ~$ acpi_listen video/brightnessdown brtdn 00000087 00000000 # fn+f9 video/brightnessup brtup 00000086 00000000 # fn+f10 bl_down.sh #!/bin/sh bl_device=/sys/class/backlight/intel_backlight/brightness echo $(($(cat $bl_device)-100)) | sudo tee $bl_device bl_up.sh #!/bin/sh bl_device=/sys/class/backlight/intel_backlight/brightness echo $(($(cat $bl_device)+100)) | sudo tee $bl_device so know acpi enabled, , scripts work. it's event reason isn't triggering action. pointers in right direction appreciated! edit: forgot include actual acpi events: bl_down event=video/brightnessdown brtdn 00000087 00000000 action=/

css - Should I use vh or vw as responsive units? -

i'm little confused regarding units best responsive websites. know pixel units static , it's better work vh or vw better responsive results. which 1 better work responsive design? i use 'rem' everywhere. additionally set root font size (on html) dynamic javascript or relative screen size vw or vh.

javascript - Fullcalendar Repeating Events -

i using fullcalendar, , want repeat event once in month (on monday) form august november. have been able repeat event , event repeats 4 times in month on each monday of week -while need repeat once on first monday after start date . below date ranges passed along dow (days of week ) paramater. var repeatingevents = [{ title:"my repeating event", id: 1, start: '10:00', end: '14:00', dow: [ 1, 4 ], ranges: [{ //repeating events displayed if within @ least 1 of following ranges. start: moment().startof('week'), //next 2 weeks end: moment().endof('week').add(7,'d'), },{ start: moment('2015-02-01','yyyy-mm-dd'), //all of february end: moment('2015-02-01','yyyy-mm-dd').endof('month'), },/*...other ranges*/], },/*...other repeating events*/]; is there way can repeat once in month , running form start date end date? assistance appreciated if can't generate events o

android - Interact with Button from another layout in SupportMapFragment -

i know how hide/show floatingactionbutton when clicking marker in map. here's maps code: public class mapsactivity extends supportmapfragment implements onmapreadycallback, googlemap.onmapclicklistener, googlemap.onmarkerclicklistener, googlemap.oninfowindowclicklistener { private static final string tag = "maps"; private googlemap mmap; private locationmanager locationmanager; private arraylist<latlng> latlngs = new arraylist<>(); private markeroptions markeroptions = new markeroptions(); private marker markern; private marker markero; @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); getmapasync(this); } @override public void onmapready(googlemap googlemap) { try { criteria criteria = new criteria(); locationmanager = (locationmanager) getactivity().getsystemservice(context.location_service); mmap = googlemap; mmap.setonmapclicklistener(this); mma

Rails, change URL for a POST action within a controller -

i want url changed when call action within controller made. current scenario: controller: class eventcontroller < applicationcontroller def index if city.blank? failure end ... end def failure ... render 'failure' end end routes: get '/event', to: 'event#index' post '/event/failure' => 'event#failure' but code keeps url /events. desired result /events/failure i've views payment 'index' , 'failure'. i'm using rails ~ 5.0.0. for url change want redirect, : class eventcontroller < applicationcontroller def index if city.blank? redirect_to action: 'failure' end ... end def failure ... render 'failure' end end but, redirection not possible post requests given in http/1.1 you might want consider changing strategy.

Why android File.delete() , File.rename() fails on some devices? -

it works on nexus 5,but not working on samsung devices , oem devices. this code: file f = new file(path); if (f.exists()) { if (f.delete()) { mediascannerconnection.scanfile(ctx, new string[]{path, ""}, null, null); } else { // log.e(tag, ctx.getstring(r.string.unabletodelete)); } } else { toast.maketext(ctx,ctx.getstring(r.string.filenotfound),toast.length_short).show(); } you need ask user if accept read/write permission if (activitycompat.checkselfpermission(this, manifest.permission.write_external_storage) != packagemanager.permission_granted) { activitycompat.requestpermissions(this, new string[]{ manifest.permission.read_external_storage, manifest.permission.write_external_storage,}, 1); } else { createtemporaryfile(); } don't forget add <uses-permission android:name=

python - Is there a mechanism to load the complete Google Vectors in less memory and in optimized way? -

here code dealing with: import numpy np import theano import cpickle collections import defaultdict import sys, re import pandas pd import csv import getpass def build_data_cv(datafile, cv=10, clean_string=true): """ loads data , split 10 folds. """ revs = [] vocab = defaultdict(float) open(datafile, "rb") csvf: csvreader=csv.reader(csvf,delimiter=',',quotechar='"') first_line=true line in csvreader: if first_line: first_line=false continue status=[] sentences=re.split(r'[.?]', line[1].strip()) try: sentences.remove('') except valueerror: none sent in sentences: if clean_string: orig_rev = clean_str(sent.strip()) if orig_rev=='':

ruby - Implement array and iterate -

i have ruby code want use: if args[:remove_existing_trxs] == 'true' acquirer.delete_all company.delete_all currency.delete_all adminuser.delete_all basereseller.delete_all terminal.delete_all contract.delete_all merchant.delete_all merchantuser.delete_all paymenttransaction.delete_all end how can define array , iterate? something that? [model1, model2].each |model| model.public_send(:delete_all) end or using symbol#to_proc : [model1, model2].each(&:delete_all)

c# - Visual Studio project not building when I click debug or press F5 -

vs2010 c#, winforms project. it not build automatically when click on debug or press f5. if manually build project before debug, compiles , changes picked up. my other projects work expected. why doesn't build automatically? right-click solution (not project) in solution explorer , select configuration manager. check if build turn off current configuration.

spring - How to support multilingual -

i'm making own business webpage. (using java spring mvc) i'm trying support other nation's language not english. i'm using i18n .properties hardcoded file. now, i'm trying make faq (so can write faq post in admin dashboard). have add faq post dynamically, in case how can enroll other language in db? think google webpage translate 1 of answer, want know if there better solutions.

javascript - Stop a CSS rotate animation smoothly -

i created sample css class roate image indefinitely : .rotate{ animation: rotation 2s infinite linear; } @keyframes rotation { { transform: rotate(0deg); } { transform: rotate(359deg); } } i add class image in html page. shortly after want stop rotation smoothly unknown keyframe. must create css class : .rotatetostop{ ... } and javascript code : $('myelement').addclass('rotate'); // ... // shortly after, when specific event triggered $('myelement').removeclass('rotate'); $('myelement').addclass('rotatetostop'); but haven't ideas how in css 'rotatetostop' class , can me ? =) i'm afraid can't stop animation smoothly if remove animation element removing class. but can stop animation using this: .rotatetostop { animation-play-state: paused; } in case shouldn't remove .rotate class have toggle class starts or pauses animation. one problem: an

sapui5 - When to use jQuery.sap.registerModulePath() with an example? -

hi have tried reading sapui5 documentation above not able understand usage. difference between sap.ui.localresources() , jquery.sap.registermodulepath() , when use what? if can explain easy example helpful. can use jquery.sap.registermodulepath() load mockdata? if using resourceroots either in bootstrap config or in app descriptor , you've been using jquery.sap.registermodulepath time each key-value pair, defined in resourceroots , passed arguments static method. for example, may have in index.html: data-sap-ui-resourceroots='{ "my.app": "./" }' ui5 registers namespace ( "my.app" ) globally reference saying "whenever name mentioned while resolving other module names, should target module in registered path ( "./" ) relative current document.location.href .". the above code same calling jquery.sap.registermodulepath("my.app", "./") directly. here, can pass user-defined u

html - Always dropped down menu in android -

i have css menu, template, customized (but graphical design). on pc works have problems @ e.g. android phone (chrome browser). menu sign should visible beginning menu items dropped down. in addition, when put hidden, pop-up again when scroll down page. annoying. url e.g. http://k154.fsv.cvut.cz i can provide code, not sure upload it. will need see code. use plunkr or upload files github , supply link. note - if animating menu css try adding 'animation-fill-mode: forwards' keep state of open / closed menu.

javascript - Getting time series graph for 'On' and 'Off status' with help of google charts -

Image
i have production line have 2 states 'on' , 'off'. have data when production line 'on' , how long. data in following format data= [[new date("2017-09-11t10:58:14.580+03:00"),8], [new date("2017-09-11t10:59:22.013+03:00"), 16], [new date("2017-09-11t11:13:23.344+03:00"), 18], [new date("2017-09-11t11:14:00.608+03:00"), 6], [new date("2017-09-11t11:14:18.877+03:00"), 20], [new date("2017-09-11t11:14:29.214+03:00"), 16]]; so first element in array shows time when(time) production line 'on' , second element shows number of seconds 'on'. want graph can show 'on' status desired amount of seconds 1 below. how can achieved google charts or other. appreciated p.s:write managed line chart not write depiction. to shape need using google charts, you need 5 rows of data per data point 1) start line @ zero 2) move on 3) move across # of seconds 4) br