Posts

Showing posts from May, 2014

jsp - Waffle Principle username is Null -

my index.jsp <% if (request.getuserprincipal() != null) { %> user principal name <b><%= request.getuserprincipal().getname() %></b>.<br> email <b><%= secur32util.getusernameex(secur32.extended_name_format.nameuserprincipal) %></b>. <br><br> <% } else { %> no user principal identified. <br><br> <% } web.xml <?xml version="1.0" encoding="iso-8859-1"?> <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5"> <filter> <filter-name>securityfilter</filter-name> <filter-class>waffle.servlet.negotiatesecurityfilter</filter-class&g

javascript - Issue with dropdown boxes resetting to empty selection on change -

i'm having issue dropdown boxes using ng-model , changing index of dropdown while being still able use dropdown. for instance, can change index of drop down using code ( http://jsfiddle.net/q5hd6/357/ ). however, when change index defaults empty selection refuses let me select else. html: <select ng-model="recievedselect" ng-options="item.id item.name item in recievedoptions"></select> <button ng-click="changeindex()">change index</button> js: $scope.recievedoptions = [ {id : 0, name: "no"}, {id : 1, name: "yes"} ]; $scope.changeindex = function() { $scope.recievedselect = $scope.recievedoptions[0]; } but if remove track item.id i'm able change indexes manually, can no longer change them button ( http://jsfiddle.net/q5hd6/358/ ). basically, both, sort of lost on go next.

c++ - what is the meaning of "sw" in libswscale of ffmpeg? -

in ffmpeg, hello libswscale , libswresample, but, meaning of sw in libswscale , libswresample? the sw short software, , implies functionality performed general purpose cpu opposed dedicated device such extension card.

javascript - React js form field names and refs with concatenation -

hi trying concatenate form field names , refs , returning jsx <select classname="lp-country" id="lp-country" name = 'country'{i} ref = 'country'{i} > where index of loop. getting unexpected token error. code screenshot: https://www.screencast.com/t/8qilizabgmm error screenshot: https://www.screencast.com/t/itzph6bvt string interpolation not used correctly there. replace name = 'country'{i} with name = {`country${i}`} same ref .

android - How to make content transition with fragments? -

Image
upon transaction fragment b, i'd specific view of fragment b move point x point y. should possible achieve using content transition: frament.setentertransition(object transition) . don't understand should pass setentertransition(object transition) in order tell specific view of b animate in specific way. a lot can found on web refers shared element transition, can't find content transition. assuming have fragment's layout: <framelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:background="@android:color/white" android:layout_height="match_parent"> <view android:id="@+id/shared_view" android:layout_width="50dp" android:layout_height="50dp" android:layout_gravity="center_vertical|right" android:bac

SoapUI can send soap request, java xml cannot -

i have project whereby have make soap request endpoint. using soapui, request goes quite , receive response, when use java, receive following error: com.sun.xml.internal.messaging.saaj.client.p2p.httpsoapconnection post severe: saaj0010: unable read response java.lang.nullpointerexception anyone know why so? here part call occurs: inputstream = new bytearrayinputstream(message.getbytes("utf-8")); messagefactory factory = messagefactory.newinstance(); soapmessage soapmsg = factory.createmessage(null, is); soapconnectionfactory connfactory = soapconnectionfactory.newinstance(); soapconnection conn = connfactory.createconnection(); url endpoint = new url(main.soap_end_point_testing); system.out.println(endpoint); soapmessage response = conn.call(soapmsg, endpoint); //right here error thrown the connection on plain http try : soapconnectionfactor

html - How to trigger the Span element to populate with the value entered in Input field (Javascript) -

i'm creating bookmarklet webpage , have come across span id="totalamount" element (summary table) populates after value manually entered input field (id="amount") clicking , typing value. can enter value using bookmarklet span id="totalamount" element not being populated. missing? this html <input id="amount" class="with-prefix sum-amount" type="tel" value="" name="amount" data-val-required="please enter amount" data-val-regex-pattern="^\d*\.?\d{0,2}$" data-val-regex="please enter amount" data-val-reasonableincome="" data-val-number="the field amount? must number." data-val="true" aria-describedby="amounttooltip"/> <div class="summary-table clearfix"> <div class="summary-table-item"> <span class="text">total amount</span> <span class="curr-sign">£<

tensorflow - Can you process a tensor in chunks in a custom Keras loss function? -

i trying write cusom keras loss function in process tensors in sub-vector chunks. example, if output tensor represented concatenation of quaternion coefficients (i.e. w,x,y,z,w,x,y,z...) might wish normalize each quaternion before calculating mean squared error in loss function like: def norm_quat_mse(y_true, y_pred): diff = y_pred - y_true dist = 0 in range(0,16,4): dist += k.sum( k.square(diff[i:i+4] / k.sqrt(k.sum(k.square(diff[i:i+4]))))) return dist/4 while keras accept function without error , use in training, outputs different loss value when applied independent function , when using model.predict(), suspect not working properly. none of built-in keras loss functions use per-chunk processing approach, possible within keras' auto-differentiation framework? try: def norm_quat_mse(y_true, y_pred): diff = y_pred - y_true dist = 0 in range(0,16,4): dist += k.sum( k.square(diff[:,i:i+4] / k.sqrt(k.sum(k.square(diff[:,

asp.net mvc - Umbraco cannot create any views -

i created new asp.net mvc project , installed umbraco 7 via nuget. having play chose easy option of using sql server ce database. i created empty umbraco instance , followed tutorial umbraco site. everything working fine ran solution today , front end wouldn't display , threw error the view found @ '~/views/simplecontentpage.cshtml' not created. i log end fine however. example view no longer worked looked this: @inherits umbraco.web.mvc.umbracotemplatepage<contentmodels.simplecontentpage> @using contentmodels = umbraco.web.publishedcontentmodels; @{ layout = "master.cshtml"; } <div id="main-container"> <div id="main" class="wrapper clearfix"> <section> <h2>@umbraco.field("pagetitle")</h2> @umbraco.field("bodytext") </section> </div> </div> once changed inherits just: @inherits umbraco.w

php - Symfony3 ( or htaccess) enforce HTTPS on specific base url only -

i have same symfony3 code base running on 2 servers (urls). both use prod environment , dev environment gets used myself debugging. the 1 has ssl certificate , requires routes forced https scheme. other not , requires normal http scheme. http://symfony.com/doc/current/security/force_https.html explains how force routes https via security.yml is there way can implement https scheme enforced base url not base url b, other maintaining 2 separate security.yml files? rewritecond %{https} !=on [or] rewritecond %{http_host} ^prod.yourdomain.com$ [nc] rewriterule ^ https://%{http_host}%{request_uri} [r=301,l] now prod.yourdomain.com redirected https.

java - How to Create JavaFX 16 bit Greyscale Images -

Image
i have application generates 16 bit grey scale images. these images generated awt bufferedimage data type databuffer.type_ushort. in app, extract 16 bit data bufferedimage, normalise 8 bit, render fx canvas canvas.getgraphicscontext2d().getpixelwriter().setpixels(...) it works looks messy wondering if possible implement javafx image or writableimage, lets call ushortimage backed 16 bit data. ushortimage have fx properties normalisation levels, otherwise used javafx image. any or pointers on how achieve run time efficiency appreciated! i don't know if looking perhaps don't understand question. can convert color image gray image desaturating color using coloradjust effect. coloradjust monochrome = new coloradjust(); monochrome.setsaturation(-1); imageview gray = new imageview(new image(image_loc)); gray.seteffect(monochrome); i not sure why poor grandma , grandpa must faded black , white, must so. import javafx.application.application; import javafx.g

php - Continuous background ajax call keeping session alive -

i've got ajax checks every 5 seconds if there overdue reminders on website. php script calls uses php session , since implementing users never logged out after inactivity if have site open in browser, because session never expires. i don't want make php session expire after fixed time regardless of activity because don't want interrupt work user may in middle of either. with in mind, solution issue?

logging - Java SLF4J hierachy execution -

there's way execute every log in hierachy particular son? for example: -parent -son -son2 executing son.log("message") execute son log , parent log. executing son2.log("message") execute son2, son , parent log. that's code: public class helloworld { public static void main(string[] args) { logger parent = loggerfactory.getlogger("parent"); ((ch.qos.logback.classic.logger) parent).setlevel(level.debug); logger son= loggerfactory.getlogger("parent.son"); son.debug("hello"); } } output: 14:15:25.180 [main] debug logger.son- hello world. desired output: 14:15:25.180 [main] debug parent.son- hello world. 14:15:25.180 [main] debug parent- hello world. thanks. that not how works. slf4j logger hierarchy cannot used (and should not be) in way want. basically, each logger, if don't define setting, settings copied parent. in hierarchy, logging level

php - select posts from the last month -

this question has answer here: mysql: query rows previous month 9 answers in table posts have column named date format - datetime - current timestamp , need select posts last month only. all dates in column december 2016. example - 2016-12-09 04:25:00 <?php $start = strtotime("-1 month"); // 1488285716 $stmt = $db->query("select * posts date > " . $start . " order by..."); ?> but posts selected! resulut should zero. help? use this $start = strtotime("-1 month"); $date = date('y-m-d h:i:s', $start); $stmt = $db->query("select * posts date > " . $date . " order by...");

algorithm - Slicing ndarray using floats in Python -

i want construct algorithm in python slice image n-by-n equal blocks. aware of existing python packages can this, interested in performing mathematical computations using dimensions of resulting blocks, need not integer values. i have converted image input ndarray using numpy , cv2 . curious if can slice ndarray object in way when split "pixel", take weighted average of "pixel's" contribution respective block. for example, if image input have dimensions 100px x 100px, , want split image 7x7 blocks, since 100/7 = ~14.2857, each block have dimensions 14.2857 x 14.2857. doesn't make sense have fraction of pixel. instead, wish interpret first block contains of information pixels (1,1),(1,2),...,(1,14),(2,1),...,(3,1),...,(14,1),... ,(14,14), 0.2857 of pixels satisfying (15,k) , (k,15), , 0.2857*0.2857 pixel (15,15). wish 49 blocks. any insight appreciated! thanks. as correctly observed, cannot have 14.29 pixel in image. can perform downsamp

java - Nesting and referencing xml file with JAXB -

first of all, new xml world. facing problem extract data cross-referenced xml file. following example (modified): <?xml version="1.0" encoding="utf-8"?> <!-- student info , students enrollment --> <studentlist> <student_info> <student id = "1"> <name>mike</name> <age>16</age> </student> <student id="2"> <name>matteo</name> <age>15</age> </student> <student id="3"> <name>matt</name> <age>17</age> </student> <student id="4"> <name>siri</name> <age>16</age> </student> <student id="5"> <name>sara</name> <age>15</age> </student> </student_info> <course_info> <

amazon web services - AWS custom platform configuration on ElasticBeanstalk for python -

i tried make custom platform configuration on ebs. wondering there configuration details python demo java , js on official page? see http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/custom-platforms.html

ldap - SSHA password encryption on OpenLDAP -

my current problem cannot stop openldap store passwords plaintext. in older openldap version , entered following configuration in slapd.conf ppolicy_hash_cleartext password-hash {ssha} {sha} so once password sent application plaintext, ldap encrypting , storing encrypted. unfortunately not able configure openldap 2.4.40. found out slapd.conf not exist anymore in newer version , instead configuration taking place in cn=config.ldif file. i tried add again same configuration there seems has no effect. edit : added ldapmodify olcpasswordhash: {ssha} entry in olcbackend={0}mdb.ldif , olcdatabase={1}mdb.ldif , olcdatabase={0}config.ldif , cn=config.ldif , still passwords sent plaintext stored plaintext. took time, figured out finally. load schema describing ppolicy attributes. ldapadd -y external -h ldapi:/// -f /etc/ldap/schema/ppolicy.ldif create ppolicy_module.ldif following content , make sure ppolicy.la located under defined olcmodulepath. store file unde

angular - Typescript can't get cookie from Response object -

Image
in google chrome extension made post call looks this: public someapicall(username: string, password: string) { var url = 'http://test.sometestserver.com/api/user/someapicall'; let headers = new headers({ "content-type": "application/x-www-form-urlencoded" }); let options = new requestoptions({ headers: headers, withcredentials: true }); return this.http.post(url, 'username=' + username + '&password=' + password, options) .map(res => { console.log(res); let cookies = res.headers.getall('set-cookie'); console.log(cookies); }) .catch(this.handleerror); } the problem when call this, fiddler shows me these response headers: but when check response object printed in console, not contain header references cookie. know problem?? for security reasons cookies http-only, httponly @ end of cookie header: set-cookie:.aspnetcore

java - Mockito NullPointerException on mocked object -

i have classes: public class myclass(){ private logger logger; @override public void prepare(map map, topologycontext topologycontext, outputcollector outputcollector) { this.collector = outputcollector; logger = loggerfactory.getlogger(myclass.class); } @override public void execute(tuple tuple) { if (tuplehelpers.isticktuple(tuple)) { logger.info("received tick tuple, triggering emit of current window counts"); emitcurrentwindowavgs(); } else { ... } } } i want test mockito in way: @runwith(mockitojunitrunner.class) public class myclasstest { @mock private logger logger; @injectmock private myclass myclass; @test public void mytest(){ tuple ticktuple = mocktuplehelpers.mockticktuple(); myclass myclass = new myclass(); // when myclass.execute(ticktuple); // // verifyzerointeractions(collector); verify(collector).emit(any(values.

python 3.x - Triggering https request from mongoDB whenever any documnet is updated/inserted -

i want trigger http request mongodb python whenever documnet updated/inserted in mongodb. pretty new it. dont know if can done using rest (eve) or there mechanism in mongodb can me it. can 1 please guide me? if can done through rest how can it?

How to get data from array to string JAVA? -

i have array looks this: ss="date:03/27/2017,text=sample,date:03/28/2017" but want 03/27/2017 array 1 string how possible in java? you use split method, take look: string ss="date:03/27/2017,text=sample,date:03/28/2017"; string date = ss.split(",")[2].split(":")[1]; system.out.println(date);//03/28/2017 step-by-step ss.split(",");//[date:03/27/2017, text=sample, date:03/28/2017] ss.split(",")[2];//date:03/28/2017 ss.split(",")[2].split(":");//[date, 03/28/2017] ss.split(",")[2].split(":")[1];//03/28/2017

sql - Insert into statement returning an error -

i error on running below code. error message: "column name or number of supplied values not match table definition." drop table employee create table employee (empid nvarchar(50) , empname nvarchar(50)) insert employee values('13','santhosh','3','karthik') are there ways make below code work. drop table employee create table employee (empid nvarchar(50) , empname nvarchar(50)) insert employee values('13','15','17'),('blr','hyd','chn') you have separate values so: drop table employee create table employee (empid nvarchar(50) , empname nvarchar(50)) insert employee values('13','santhosh') ,('3','karthik') each set of values should in parentheses. update based comments: reference: table value constructor (transact-sql) prior sql server 2008, (prior table value constructor) drop table employee create table employee (empid nvarch

Laravel on my remote server isn't routing properly -

i beginner remote servers , building website, please bear simple questions, if are. so have created laravel project on remote server (by connecting command line via putty , creating new laravel project). created folder, had move of directories inside of folder main folder, via filezilla. how appears now: illustration of uploaded files through filezilla my code in laravel sample 1 comes whenever create new project, did not change anything. problem appearing, when visit webpage, says webpage unable handle request (http error 500). when visit webpage/public or other sort of link, gives me error: notfoundhttpexception in routecollection.php line 161 (a laravel error) any or guidance in right direction appreciated. i can't comment yet, have answer here. first kind of server using? shared or vps? if it's shared hosting, have more upload files, you'll need configure ht access too. see video guide: https://youtu.be/wqmzld0iroo for routing issue, means, rou

hadoop - Perfomance improvement for hive query -

i using multiple union , doing sum of each column, query runs forever. have 96gb memory cluster. please tell me should performance improvement. following query in hive. total ( select * ( select * table1 union select * table2 union select * table3 union select * table4 union select * table5 union select * table6 union select * table7 union select * table8 union select * table9 )p ) select * ( select sum(col_1), sum(col_2), sum(col_3), sum(col_4), sum(col_5), sum(col_6), sum(col_7), sum(col_8), sum(col_9), sum(col_10) total )q;

Java OOP concept for library model -

i new java , need implementing oop rules projects similar library model (car rental model). i have 2 classes: public class book public class customer simply put, classes this: public class customer { public string fullname; public string address; /* constructor */ public customer(string fullname, string address) { this.fullname = fullname; this.address = address; }} and public class book { private string bookname; private int pagenumber; public customer customer; //i think needs fixed /* constructor */ public book(string bookname, int pagenumber, customer customer) { this.bookname = bookname; this.pagenumber = pagenumber; // ... there not sure how like: this.customer = customer ... // there should constructor without customer parameter can deal cuz easy }} each instance of customer class represents person borrowed book. struggling implement is: how pass instance of custome

simplification - How to simplify terms with usage of square root in maxima -

let's have term 1/4 * x/sqrt(2) * x^2 / 2; in maxima. output (without further modification) gives x^3/2^(7/2) . how can force output format x^3/(8*sqrt(2)) usage of square roots whenever possible? (%i1) sq2: " "(sqrt(2))$ (%i2) matchdeclare(n, lambda([n], oddp(n) , n#1))$ (%i3) defrule(r_sq2, 2^(n/2), sq2*2^((n-1)/2)) $ (%i4) e: 1/4 * x/sqrt(2) * x^2 / 2; 3 x (%o4) ---- 7/2 2 (%i5) apply1(e, r_sq2); 3 (sqrt(2)) x (%o5) ------------- 16 a rule can insert sqrt(2) . in example use "null" function prevent simplification. can consider box , rembox functions or leave sq2 undefined.

haskell - How can I concatenate user input in a list -

i codes user , insert in list, problem when user don't wanna insert more codes. don't saved list numbers because i'm using recursion call method again, when should return list don't have it. insertcode :: [integer] insertcode = putstrln "code:" code <- getline putstrln "another? (y/n)" if(resp == "y" || resp == "y") (read code::string->integer):insertcode else --i don't know i'm sorry stupids questions, imagine obvious have problem functional programming first of all, type signature wrong. insertcode uses io monad, type must io [integer] . missing conversion of code string integer (i use readln accomplish that; trying convert code function , not integer ) , missing getline y/n response user. once fixed, might write following: insertcode :: io [integer] insertcode = putstrln "code:" code <- readln putstrln "another? (y/n)" response <

can i click on a link that is not visible using webdriver -

my test case click on link of webpage. getting links , operation performed successfully, when try click on of them gives following exception exception in thread "main" org.openqa.selenium.elementnotvisibleexception: element not visible (session info: chrome=56.0.2924.87) (driver info: chromedriver=2.28.455520 (cc17746adff54984afff480136733114c6b3704b),platform=windows nt 6.3.9600 x86_64) (warning: server did not provide stacktrace information) command duration or timeout: 31 milliseconds build info: version: 'unknown', revision: '5234b32', time: '2017-03-10 09:00:17 -0800' system info: host: 'adminpc', ip: '192.168.1.79', os.name: 'windows 8.1', os.arch: 'amd64', os.version: '6.3', java.version: '1.8.0_121' driver info: org.openqa.selenium.chrome.chromedriver capabilities [{applicationcacheenabled=false, rotatable=false, mobileemulationenabled=false, networkconnectionenabled=false, chrome={chrom

Exact position of legend above R plot -

Image
i want produce simple plot legend on top right above plot (see picture below, plot on left). can achieve using following simple example: par(mar = c(4, 4, 1.5, 4)) plot(rnorm(50)) par(oma = c(0, 0, 0, 0), mar = c(0, 0, 0, 4), new = true) plot(0, 0, type = "n", bty = "n", axes = f) legend(x = "topright", "data", bty = "n", pch = 1, xpd = t, horiz = t) when scale plot different sizes legend overlaps plot area though (plot on right). how can achieve no overlapping legend varying plot sizes (or width/height ratios)? highly appreciate on problem!

swift - ios: while editing in textview, keyboard return key not working -

func textview(_ textview: uitextview, shouldchangetextin range: nsrange, replacementtext text: string) -> bool { if text == "\n" { tempdescription = txteditdescription.text txteditdescription.resignfirstresponder() return false } return true } i'm new in ios developement string variable -> "tempdescription" want store edited text in string variable on keyboard return key. it textview -> "txteditdescription" through above method simulator keyboard not hide. have ? thanks by default, return key not hooked functionality. to this, implement uitextfielddelegate on class by: class viewcontroller: uiviewcontroller, uitextfielddelegate { } then in viewdidload assign delegate of textfield iboutlet self by: textfield.delegate = self then implement following method uitextfielddelegate: (this function fires when return key hit, override functionality want.) func textfieldshouldreturn(_ textf

Crystal Report Viewer - ASP.net -

Image
i attempting add crystal report viewer asp.net web app. using reports created our desktop application created , functional. connecting same database same query across both platforms , database , query set in report designer. here's preview 1 of reports in visual studio pro 2015 in asp.net project: i have added following line reports.aspx page: <cr:crystalreportviewer id="crptviewer" runat="server" autodatabind="true" /> i added "crystalreportviewers13" folder root of application directory content of crystal report installation. i have added following web.config file: <configuration> <configsections> <sectiongroup name="businessobjects"> <sectiongroup name="crystalreports"> <section name="rptbuildprovider" type="crystaldecisions.shared.rptbuildproviderhandler, crystaldecisions.shared, version=13.0.2000.0, culture=neutral, publickeytoken=692f

javascript - Failed to execute 'getStartPositionOfChar' on 'SVGTextContentElement' -

what reason of following exception? domexception: failed execute 'getstartpositionofchar' on 'svgtextcontentelement': charnum provided (0) greater or equal maximum bound (0). actually, i'm trying integrate https://github.com/nlplab/brat own created backend. uses svg jquery.svg.min.js , jquery.svgdom.min.js. stuck @ exception. exeption raised on text element of svg while making call text.getstartpositionofchar(firstchar).x; where text <text x="0" y="0">some text</text> and firstchar=0 . i believe bug fixed in master branch, not on packaged version 1.3. try replace brat 1 directly cloned github ( git clone https://github.com/nlplab/brat.git ).

python - pyocr with tesseract runs out of memory -

i made script batch-process pdf scans text of tesseract , pyocr. code below. problem is, when processing lots of files, 20+, @ moment script runs out of memory , fails oserror. made can catch smoothly @ crashed after manual restart, these manual restarts tedious. since pyocr black box me, tried wrapping script other python scripts restart on crash, seem go down on error, freeing memory when every related script terminates. the other solution can think of, make external wrapper, check if script running , restart if not , there still unprocessed files. but maybe there better solution? or maybe made lame code can improved avoid these memory crashes? (other know lame, works enough :) ). from io import bytesio wand.image import image pil import image pi import pyocr import pyocr.builders import io import os import os.path import ast def daemon_ocr(tool, img, lang): txt = tool.image_to_string( pi.open(bytesio(img)), lang=lang, builder=pyocr.builders.

r - Number of firms per year using dplyr or datatable -

lets have data frame: df <- data.frame(city = c("ny", "ny", "ny", "ny", "ny", "la", "la", "la", "la"), yearfrom = c("2001", "2003", "2002", "2006", "2008", "2004", "2005", "2005", "2002"), yearto = c(na, "2005", na, na, "2009", na, "2008", na, na)) where yearfrom year when e.g. firm established , yearto year when canceled. if yearto na still working. i calculate number of firms every year. the table should this city |"year" |"count" "ny" |2001 1 "ny" |2002 2 "ny" |2003 3 "ny" |2004 3 "ny" |2005 2 "ny" |2006 3 "ny" |2007 3 "ny" |2008 4 "ny" |20

alfresco - Is there way to get attachments details before starting the workflow? -

before start business process, select attachments. can many times, remove attachments , choose again. i want display dynamic table information attachments. for example, retrieve attachments details, use such code: ... var divwithanchors = yahoo.util.selector.query("#page_x002e_data-form_x002e_task-details_x0023_default_assoc_packageitems-cntrl")[0]; var anchors = divwithanchors.getelementsbytagname('a'); var attachments = new array(); for(var = 0; < anchors.length; i++) { attachments[i] = anchors[i].href.split('=')[1]; } ... it gives me references nodes, example: ... workspace://spacesstore/c5a27463-c2aa-4c70-aca7-1f999d3ac76a workspace://spacesstore/29e9f035-403c-47b6-8421-624d584ff7eb workspace://spacesstore/712aaca2-9c90-4733-a690-bbf9bacb26e6 workspace://spacesstore/68893fde-ee7c-4ecb-a2df-d4953dc69439 ... then can ajax requests rest back-end (webscripts) , responses: ... for(var = 0; < attachments.length; i++) { alfresco.u

heroku - Simple node.js app deployment on DigitalOcean from GitHub -

i have node.js application on github. right using heroku hosting want give digitialocean try (the $5/month more affordable). i used using heroku, go create app > connect github account > deploy master branch > boom app deployed. when signed , started exploring seemed way , many steps app deployed. researched around find simpler way (similar 1 follow in heroku) blogs , youtube videos go through same tedious process. i know being lazy need few clicks app deployment. know better (smarter) way can deploy app on github? it not easy heroku. tempting use cheaper services digital ocean or vultr , pay fraction of price (especially using coupon links can make free months - digital ocean , vultr ) having own vps means need manage yourself. simplifying process pay when you're using heroku. doesn't have bad. here tutorial on how it: https://www.distelli.com/docs/tutorials/build-and-deploy-nodejs-to-digitalocean/ and see list of tutorials - search "de

PhpStorm - Filename color extremely bad, how to change it? -

Image
i changed theme darcula , noticed file names on left not rendering. maybe color same background. file names visible, can see name if select file. i not able find option responsible color settings. i found under settings -> editor -> colors & fonts -> file status i had change up date color.

xmlhttprequest - Javascript - Synchronous http request -

i need make synchronous request server continue script processing. as xmlhttprequest shouldn't synchronous, , it's not way use "while" until end of request, might : function main(continue) { if (continue == undefined) { server_call(); } else { /* ok, here i'm sure http request done */ } } var tmp_bool; function server_call() { var tmp_bool = false; http_request_function() { /* here when request done */ var tmp_bool = true; } wait_until_function(); } function wait_until_function() { if (tmp_bool) main(true); else window.settimeout("wait_until_function();", 1000); } it's not clean, should work. isn't there way subscribe event or of kind ? regards.

algorithm - How to determine if a line from a input file is the last line? c++ -

i have written program check balanced curly brackets in .cpp file. program works fine , finds syntax error, displays number of line problem , exits. but have display different error message if error @ last line of input cpp file. i have tried implement following way think wrong. doesn't work anyway :) else { if(current == inputfile.eof()) //this tried { cout << "syntax error @ end of program."; } else { cout << "syntax error in line: " << current << "\n"; errorfound == true; } } i did not give complete code because think simple if condition correct variable solve this. if need it, can post code later. edit: larger piece of code given requested. counter int variable updated every line counter++.

c# - How can I connect to a Bluetooth service on Gear S3? -

i writing web app gear s3 , companion win-app uwp in c#. want do: s3 acting bt server, sending data, , win-app client, supposed receive data. in tizen used registerrfcommservicebyuuid() function below: function publishtransferservice() { if(remotedevice.isconnented){ console.log("connection status: " + remotedevice.isconnected); var trans_service_uuid = '5bce9431-6c75-32ab-afe0-2ec108a30860'; adapter.registerrfcommservicebyuuid(trans_service_uuid, 'my service', servicesuccesscb, function(e) { console.log( "could not register service record, error: " + e.message); }); }else{ console.error("connection status: " + remotedevice.isconnected); } in c# try connect service follows: //to ulong converted mac-address of gear ulong gearbtaddress = 145914022804881; //create device-instance of gear bluetoothdevice geardevice = await bluetoothdevice.frombluetoothadd

Execution of CASE statement in SQL query -

let's have table named 'neighbors' contains variable 'name', , selecting name , using case statement assign values second variable, 'age'. syntax 1 can use case statement in sql takes 2 different forms: 1) simple case expression: case name when 'george' 36 when 'alfred' 40 else null end age 2) searched case expression: case when name = 'george' 36 when name = 'alfred' 40 else null end age the 2 statements doing same thing. question is, how these statements handled in memory? handled same, or may 1 more efficient other? https://docs.microsoft.com/en-us/sql/t-sql/language-elements/case-transact-sql correct syntax either case name when 'george' 36 when 'alfred' 40 else null end age or case when name = 'george' 36 when name = 'alfred' 40 else null

plone - Apache - Proxy external files to download -

consider this: we have external server files can downloaded our website (plone based) interface downloading them , try hide direct links as possible jquery.filedownload plugin needs cookie set on file on download i'm trying set our apache configuration replace links this: original: data-files-example.com/folder/subfolder/file.zip replaced: our-website-example.com/_downloads/folder/subfolder/file.zip so, missing part in case is: how set apache work this? i'm trying: namevirtualhost *:80 <virtualhost :80> serveradmin email@our-website-example.com servername our-website-example.com rewriteengine on rewriterule "^/_downloads(.)$" "https://data-files-example.com/$1" [p] rewritecond %{request_method} ^(put|delete|propfind|options|trace|propfind|proppatch|mkcol|copy|move|lock|unlock)$ rewriterule .* - [f,l] rewriterule ^/(.*) http://127.0.0.1:/virtualhostbase/http/data-files-example.com:80/my_plone_websit

javascript - Opposite of taphold event - jQuery mobile -

i want trigger when user holds button , trigger else when releases it. on non-mobile, it's straight forward using mousedown , mouseup events, on mobile (ios webview) don't work. so tried use taphold of jquery mobile works, want know equivalent of mouseup ?

vue.js - Why does using v-html provoke binding errors in a v-for loop? -

this works fine: <li v-for="post in posts"> <a v-bind:href="post.url">{{post.title}}</a> </li> but if change (using v-html instead of template): <li v-for="post in posts"> <a v-bind:href="post.url" v-html="post.title"/> </li> i error: property or method "post" not defined on instance referenced during render. what's weird changing v-html syntax appears invalidate idea of there being post altogether because error being thrown on v-bind:href now. doesn't matter put in v-html attribute -- throw error anyway because mere existence of v-html appears eliminate post object, v-bind:href fails. self closing tags not valid . use. <li v-for="post in posts"> <a v-bind:href="post.url" v-html="post.title"></a> </li>

amazon web services - AWS Kinesis and Lambda data versioning -

Image
i have created aws firehose endpoint (might change simple kinesis) receives logs producers , saves them s3 bucket , lambda function consumes data, processes , saves output db. everything works fine. planning creating staging , development flow entire structure. when release new version not capable of replacing entire producers instantly, therefore need keep older production versions until no producer left - because might make breaking protocol changes on new versions. i not sure best approach create versionable system using kinesis , lambda. should copy entire structure new versions (including dev , staging) , make producers write specific versioned stream? or should create mid lambda function inspects packets (which contain version info) , outputs events specific s3 has versioned folders? lambda functions consume data know about. let me use versioning support lambda functions. here structure image first idea here second structure i wonder better solution or there b

amazon web services - Can't connect out from my EC2 instance unless allow all traffic inbound -

Image
i have issue linux ec2 instance can't outbound(ping, curl, yum update, wget, traceroute, etc..) unless have rule in vpc acl inbound rule set allows traffic. my security group , vpc both have outbound rules allows traffic everything. the security group inbound list attached instance looks this: and vpc inbound list looks this(rule 200 1 i'm talking about): if delete inbound rule allows traffic(rule 200), can't outbound. could there i'm missing ? thanks! acl rules stateless, means don't keep track of outbound connections when evaluating inbound connections. if make outbound connection server, acl rule block server's response unless have explicitly allowed inbound connections server in acl. this 1 of primary reasons people use security groups (which stateful) instead of acl rules. looking @ network acl rules, there nothing happening there isn't covered security group rules, why use acls?