Posts

Showing posts from July, 2015

android - Using OpenCV, how to find the values of HSV channels of the "masked region" in a masked image? -

using opencv4android, how can hsv channels of first pixel of masked region in masked image ( dilatedmat in following snippet)? i know we'd hsv channel values of first pixel hsvmat.get(0,0) don't know how apply masked region only, rather entire mat . for example, following function camera frame passed argument, , have generated mask, how should proceed there? note: please keep in mind masked region not rectangle, has irregular shape. private void detectcoloredblob (mat rgbaframe) { mat hsvimage = new mat(); imgproc.cvtcolor(rgbaframe, hsvimage, imgproc.color_rgb2hsv_full); mat maskedimage = new mat(); scalar lowerthreshold = new scalar(85, 50, 20); scalar upperthreshold = new scalar(135, 255, 77); core.inrange(hsvimage, lowerthreshold, upperthreshold, maskedimage); mat dilatedmat= new mat(); imgproc.dilate(maskedimage, dilatedmat, new mat() ); //****************what now???************

Markov Chain Transition Matrix: MATLAB function sparse - index exceeds matrix dimensions -

i'm referencing question: estimate markov chain transition matrix in matlab different state sequence lengths the described procedure worked out me, i'm not able adapt last matlab command create transition matrix s = sparse(i,j,v,m,n) transitionmatrix = sparse(uniquetransitions(:,1), uniquetransitions(:,2), p, 6,6) here data 18 unique transitions , corresponding probabilities: uniquetransitions p 5405 5414 0,046511628 5414 5420 0,046511628 5420 5420 0,139534884 5420 9999 0,046511628 5414 5430 0,046511628 5430 5414 0,023255814 5430 5191 0,023255814 5191 5462 0,023255814 5462 5414 0,023255814 5414 5414 0,139534884 5414 9999 0,023255814 5405 5419 0,023255814 5419 5419 0,162790698 5419 5412 0,069767442 5412 5419 0,046511628 5412 5414 0,023255814

ios - changing build identifier app getting crash -

i have home screen login of google plus. . project bundle identifier com.appta.product , project name apptaproduct . client want chnage bundle identifier name com.appta.solution . simple change target name nad edit scheme , when run app .and when try login google + app getting crash. please give guide change build identifier of project. version of 2.1....but before developer worked in version 2.1.in time used same build identifier com.appta.product . have app in app store. now newly working in version.please me how can change build identifier work before. please me thanks! to use google+ login, first requires register application information https://console.developers.google.com . @ google developer console application still holds old bundle identifier 'com.appta.product'. note: solution login @ google developer console , find registered application there , change bundle identifier new 1 - 'com.appta.solution'. application google+ login work th

mongodb - Upsert with $in -

i want following functionality in mongodb. have collection named 'entities', stores entity text , it's count. collection looks this: [{u'_id': u'facebook', u'n': 120}, {u'_id': u'florida', u'n': 98}, {u'_id': u'vegas', u'n': 94}, {u'_id': u'andrew_mason', u'n': 93}, {u'_id': u'obama', u'n': 85}, {u'_id': u'twitter', u'n': 81}, {u'_id': u'outlook', u'n': 81}, {u'_id': u'delhi', u'n': 75}, {u'_id': u'google', u'n': 74}, {u'_id': u'virginia', u'n': 71}] now, want update collection new entities. basically, i'll have new entities ready in array this: entityset = ['google', 'abhishek_vaid', 'andrew_mason'] my intentions that, entities in collection count should updated. entities not in collectio

java - Write a file on hdfs with permissions enabled -

i try write file on hdfs using java (v 1.8) permissions enabled. as hadoop instance have used ready docker image : https://hub.docker.com/r/sequenceiq/hadoop-docker/ i have followed write file in hdfs java following: configuration configuration = new configuration(); configuration.set("fs.defaultfs", "hdfs://127.0.0.1:9000/user/root"); configuration.set("hadoop.job.ugi", "root"); filesystem hdfs = filesystem.get(configuration ); path file = new path("hdfs://127.0.0.1:9000//user/root/test.txt"); if ( hdfs.exists( file )) { //hdfs.delete( file, true ); system.out.println("file exist"); } outputstream os = hdfs.create( file, new progressable() { public void progress() { system.out.println(""); } }); bufferedwriter br = new bufferedwriter( new

webforms - Generating and downloading an `Excel` document breaks `ASP.net` LoginStatus -

in asp.net web application have page shows (not complicated) table. have implemented button when (registered) members clicks on it, browser downloads table excel document the code generate excel follow: dim response httpresponse = httpcontext.current.response ' first let's clean response.object response.clear() response.charset = "" dim filename string = mappath("~/ex1.xls") ' set response mime type excel response.contenttype = "application/vnd.ms-excel" response.addheader("content-disposition", "attachment;filename=""" & filename & """") ' create string writer using sw new stringwriter() using htw new htmltextwriter(sw) ' instantiate datagrid dim dg new datagrid() dg.datasource = dt dg.databind() dg

knockout.js - concatenating a string to $index in foreach loop knockoutjs -

this connected answer this question the following works.. http://jsfiddle.net/vt6v6l9u/2/ <div data-bind="foreach: retrievedusers" > <div> <label data-bind="attr:{for:$index}"> i need concatenate string $index.. http://jsfiddle.net/vt6v6l9u/4/ <div data-bind="foreach: retrievedusers" > <div> <label data-bind="attr:{for:'const' + $index}"> the fiddle seems work if inspect radio button element.. find.. <label data-bind="attr:{for:'const' + $index}" for="constfunction c(){if(0<arguments.length)return c.equalitycomparer&amp;&amp;c.equalitycomparer(d,arguments[0])||(c.o(),d=arguments[0],c.n()),this;a.i.lb(c);return d}"> any sincerely appreciated thanks $index observable , must evaluated: <div data-bind="foreach: retrievedusers" > <div> <label data-bind="attr:{for:'

swing - How to draw image using FileDialog in Java -

need display selected in filedialog image, thats somewhy didnt work. when try choose image throws exception javax.imageio.iioexception: can't create imageinputstream! i think problem in getdirectory() , dont know how fix. public imageshow() throws ioexception { super("pictures"); setsize(1024,768); setdefaultcloseoperation(windowconstants.exit_on_close); setlocationrelativeto(null); jpanel buttonpanel = new jpanel(new flowlayout()); buttonopen = new jbutton("open file"); buttonpanel.add(buttonopen); actions(); filedialog(); add(buttonpanel); image = imageio.read(new file(fd.getdirectory())); imagelabel = new jlabel(new imageicon(image)); buttonpanel.add(imagelabel); } public void filedialog() { fd = new filedialog(new jframe(), "choose file"); fd.setvisible(true); } public void actions() { buttonopen.addactionlistener(new actionlistener() { @override pub

html - Show first set of ul li and hide all subsequent using CSS -

i have following html: <ul class="articles"> <li> <!-- display these --> <ol class="faces"> <li> <a href="#">view more #1</a> </li> <li> <a href="#">view more #2</a> </li> </ol> </li> <li> <!-- hide these --> <ol class="faces"> <li> <a href="#">view more #3</a> </li> <li> <a href="#">view more #4</a> </li> </ol> </li> </ul> when page first loaded, show first ol.faces li's (with #1 , #2 anchor links) , hide subsequent ol li's . possible using css without adding more classes? hide li tags direct descendants

asp.net - Could not load type 'System.ServiceModel.Activation.HttpModule' -

i run aspnet_regiis.exe, still getting same error: could not load type ‘system.servicemodel.activation.httpmodule’ assembly ‘system.servicemodel, version=3.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089′. description: unhandled exception occurred during execution of current web request. please review stack trace more information error , originated in code. exception details: system.typeloadexception: not load type ‘system.servicemodel.activation.httpmodule’ assembly ‘system.servicemodel, version=3.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089′. if running windows 8, method not work. microsoft not let run command, telling this: this option not supported on version of operating system. administrators should instead install/uninstall asp.net 4.5 iis8 using "turn windows features on/off" dialog, server manager management tool, or dism.exe command line tool. the reasons on link: http://support.microsoft.com/

visual studio 2010 - How to extract multiple lines from an image using Tesseract OCR? -

we have passed image single line having text "hello world" , tesseract ocr show result 'hello world'. but when passed image multiple lines text hello world how you it doesn't show anything. whats problem? can please me on that? need urgent help.please answer.thanks in advance :) here our codes: #include "stdafx.h" #include <iostream> #include <baseapi.h> #include <allheaders.h> #include <fstream> using namespace std; int _tmain(int argc, _tchar* argv[]) { tesseract::tessbaseapi api; api.init("", "eng", tesseract::oem_default); api.setpagesegmode(static_cast<tesseract::pagesegmode>(7)); api.setoutputname("out"); cout<<"file name:"; char image[256]; cin>>image; pix *pixs = pixread(image); string text_out; api.processpages(image, null, 0, &text_out); cout<<text_out.string(); ofstream files; files.open("out.txt"); files &

css - Fixed-Fluid-Fixed Layout for 960.gs -

our website engine uses 960.gs grid system , trying modify 3 columns fixed(100px)-fluid(max width)-fixed(100px) view. unfortunately 960.gs online generators makes or full-fixed or full-fluid grids. trying modify generated full-fluid grid view: <------------100%---------------> ======== =============== ======== | fixed| |max screen| |fixed | ======== =============== ======== <-100px> <-100px> the code (after modification): http://jsfiddle.net/vzm8x/ problem 1) not sure how make central content area max left on screen. because width:auto; doesn't work @ all, width:100% wrapping divs. problem 2) after fixed 100px div continues wrapping down anything. (display:inline; doesn't ideas?) my question is: possible modify 960.gs template according our needs? if yes please give me advice fix problems? thank in advance! with fixed-width side columns, it's easy. you're going want use floats, , may need faux columns trick, d

google sheets script - select multiple a1 notation range -

i'm opting batch update of row colors using google apps script. cannot go usual range function, rows colored not consecutive. thought, a1 notation helpful unfortunately looks can pass 1 range of a1 notation , not multiple: var a1notations="a1:c1,a3:c3,a10,c10"; sheet.getrange(a1notations).setbackground("red"); but i'm getting "range not found" error. any ideas how can make work? thanks! put range notations array, loop through array: function setmultiranges() { var ss = spreadsheetapp.getactivespreadsheet(); var sh = ss.getactivesheet(); var a1notations=["a1:c1","a3:c3","a10","c10"]; var i=0, arrylngth = a1notations.length; (i=0;i<arrylngth;i+=1) { //logger.log(a1notations[i]); //logger.log(typeof a1notations[i]); sh.getrange(a1notations[i]).setbackground("red"); }; };

math - Algorithm to find maximum value of ax + b for different values of x -

Image
imagine array a of size n , each array element contains 2 positive integers a i , b i . there q queries each query can 1 of 2 types: 1) given positive integer x , find max (a i x + b i ) i 1 n 2) update values of a i , b i i the number of queries can large hence naive o(q * n) algorithm wouldn't suffice. also, x can large 10 9 , value of objective expression can large 10 18 . can solved using variation of segment trees? if there similar question around please point me it. also, how go solving one? not looking code, hints / pointers logic. edit : can assume values of x in query type 1 non decreasing. edit 2 : can assume in updates, value of a increases. edit 3 : have found answer question here . @mikhail pointing out word envelope . using word many times did ;-) the @sorin's idea right, finding of intersection points inefficient. want construct upper envelope of lines. envelope contain not more n-1 points (each line can contribute not mo

ruby - How to use rails Paperclip to upload images without using a form helper -

i know paperclip gem rails can upload images server this. <%= form_for @object, :method => :post, html: { multipart: true } |f| %> <%= f.file_field :image %> <% end %> but since using reactjs, want pure html file upload. have been trying way: <form classname="new_object" id="new_object" enctype="multipart/form-data" action="/objects" method="post"> <input classname="upload" type="file" name="object[image]" id="object_image" /> </form> every time upload image paperclip::adapterregistry::nohandlererror in objectscontroller#create error. at point don't know problem is, great ! i found solution problem, in part mohamed. had encode file uploaded base64 using javascript, had submit value though hidden input field. then started working !

Why should I use Exception handlings in Java? -

i read many posts on java exception handling did satisfy answer yet.why should put them in codes ? i use api methods of jre , these made checked exceptions. if want use them , need throw or catch exceptions (eg.java i/o). reasonable rules use exceptions in class ? i heard java exception handlings make separating error handling codes business logic where separating error handling in below snippet ? public int division(int divident, int divisor) { int result = 0; try { result = divident / divisor; } catch (arithmeticexception e) { system.out.println("divisor must not 0 !"); } return result; } 3. java's default exception handling makes showing exception information in standard output , terminate program. use exception handling myself avoid terminating programs? it's 3 questions, it's not that's first time that's happened here. :-) yes, must handle them or declare them, because they're checked exceptions. reason m

javascript - jQuery Mobile buttons don't change to 'pressed' state immediately when pressed -

Image
in uiwebview containing simple jquery mobile styled button, looks like: pressing not change it's appearance (to 'pressed' state greyish background) immediately, after 200m~, button appearance changes (if holding press) should have been changed already. i'm not referring infamous delayed "onclick" event triggering of uiwebview, 'pressed' appearance of button not shown when pressed. how correct that? i'm using jquery mobile v1.3.0. the following line did trick: $.mobile.buttonmarkup.hoverdelay = 0; referenced jquery mobile docs page- http://jquerymobile.com/demos/1.2.0/docs/pages/phonegap.html

xslt - Problems with OpenXML 2.5 XSL Transformation Word 2013 C# -

can me out on problem? haven't done openxml before , has me stumped! i have word document invoice. in document, have usual headers etc, plus 'fields' need populated data xml dataset sqlserver. i took copy of word/document.xml docx , made recommended changes file convert xslt file. <?xml version="1.0" encoding="utf-8" standalone="yes"?> becomes <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:xs="http://www.w3.org/2001/xmlschema" xmlns:n2="urn:hl7-org:v3" exclude-result-prefixes="n2 xs xsi xsl"> <xsl:output method="xml" encoding="utf-8" indent="yes"/> <xsl:template match="/"> and file terminated </xsl:template> </xsl:stylesheet>

sql - Split a string into rows using pure SQLite -

using sqlite , i'd split string in following way. input string: c:\users\fidel\desktop\temp and have query return these rows : c:\ c:\users\ c:\users\fidel\ c:\users\fidel\desktop\ c:\users\fidel\desktop\temp in other words, i'd split file path constituent paths. there way in pure sqlite? this possible recursive common table expression : with recursive split(s, last, rest) ( values('', '', 'c:\users\fidel\desktop\temp') union select s || substr(rest, 1, 1), substr(rest, 1, 1), substr(rest, 2) split rest <> '' ) select s split rest = '' or last = '\'; (you did not ask reasonable way.)

java - Android : How to iterate on object attributes? -

cursor cursor_daily_data = db.query(table_daily_data, null, null, null, null, null, null); if (cursor_daily_data.movetofirst()) { { dailydata dailydata = new dailydata(); dailydata.time = cursor_daily_data.getstring(0); dailydata.summary = cursor_daily_data.getstring(1); dailydata.icon = cursor_daily_data.getstring(2); dailydata.sunrisetime = cursor_daily_data.getstring(3); dailydata.sunsettime = cursor_daily_data.getstring(4); dailydata.moonphase = cursor_daily_data.getstring(5); dailydata.precipintensity = cursor_daily_data.getstring(6); dailydata.precipintensitymax = cursor_daily_data.getstring(7); apiresponse.daily.data.add(dailydata); } while (cursor_daily_data.movetonext()); } cursor_daily_data.close(); db.close(); is there better way operation? not want use external libraries sugar orm ..etc without external librar

javascript - Running meteor app on Windows from MacOS -

i got meteor project friend develops on macos. when trying run it, get: this project uses meteor@1.0.2.1, isn't available on windows. work app on supported platforms, use meteor update --release meteor@1.2.1 pin app newest windows-compatible release. when running it, get: while checking cfs:gridfs@0.0.27: no compatible binary file found... then, when try override (use run instead of update), without updating, starts proxy , mongo, breaks at, skips first error while building package npm-container: error: no plugin known handle file '../../packages.json'. if want file static asset, use addassets instead of addfiles; eg, api.addassets('../../packages.json', 'client'). i read error fixed updating meteorhacks, when try to, meteor version conflicts (see first error) , have no idea how break out of loop. can shine light on how fix of these error?

jquery - Star rating widget not updating on iPad and iPhone -

i have implmented custom star-rating widget in css jquery based on radio inputs. works fine on desktop browsers , android devices it's not working on ipad iphone. you can see widget in action here . on ipad (or iphone) when touch star, doesnt' remain checked. here th full code: a jsfiddle html <form id="signup_form" class="custom" enctype="multipart/form-data" method="post" name="signup_form" action=""> <div id="field_2"> <input id="option_221" type="radio" title="very happy" value="actual_job_rate_5" name="field_2" style="display: none;"> <span class="custom radio" ></span> <input id="option_220" type="radio" title="happy" value="actual_job_rate_4" name="field_2" style="display: none;"> <span class="custom

Dynamically creating elements using jQuery -

i building list of checkbox items in jquery based on array returned handler. the containing element .listcontainer element below , each dynamic element want add takes form of .listcontaineritem element. each item have checkbox value , label based on array item creating it. <div class="listcontainer"> <div class="listcontaineritem"> <input type="checkbox" value="1" /> <div class="listcontaineritemlabel">checkbox 1</div> </div> </div> at point of function has array passed it, efficient way of creating this? have been trying accomplish below, running major performance issues. function additemtolistcontainer(item) { var currentitems = $j("#listcontaineravailable .listcontaineritem"); if ($j.grep(currentitems, function (e) { return $j(e).find(":checkbox:first").val() == item.id; }).length === 0) { labeldiv = $j("<div /&

asp.net - C# is returning exception: Procedure has no parameters and arguments were supplied -

i apologise formatting. new programming , new site, try , make question clear possible. i have webform accessing/modifying customer database. have button entering new customers details automatically assign id number getting highest id number database, , incrementing 1 (and posting form textbox). this code have written: protected void btnnew_click(object sender, eventargs e) { clear(); command.connection = conn; command.commandtype = commandtype.storedprocedure; command.commandtext = "newcustomer"; conn.open(); sqlparameter maxid = new sqlparameter(); maxid.parametername = "@maxid"; maxid.sqldbtype = sqldbtype.int; maxid.direction = parameterdirection.output; command.parameters.add(maxid); command.executenonquery(); newcustid = convert.toint32(maxid.value); newcustid += 1; txtcustid.text = (newcustid).tostring();

excel - File not found error when running an exe using Shell function -

i running sub userform supposed run exe file, found in working folder, follows: sub runprocessor() if msgbox("run simulation?", vbyesno) = vbno exit sub else chdir thisworkbook.path shell ("runsims.exe") end if end sub this working fine on local drive, started fail when moved server drive (run-time error 5 on shell function call line). i know in cmd, when working on c: drive , cd l:\...\...\ call, need enter l: well, tried insert line of code above other shell call: shell (left(thisworkbook.path, 2)) failed. how can have "runsims.exe" run, given in current working drive? chdir work change current directory on same drive - need use chdrive first if want switch folder on different drive. better yet, pass full path shell , skip changing current directory. sub runprocessor() if msgbox("run simulation?", vbyesno) = vbyes shell (thisworkbook.path & "\runsims.exe") e

c# - How can I call the constructor before deserialisation? -

i try serialize , deserialize custom class via data contract serialization. serialization works great. however, when deserializing, run problem, because of ( source ): constructors not called when objects deserialized. the thing bit of initialisation in constructor. includes data structures. without call constructor, data structures null , calls setter functions during deserialisation fail. how can call constructor or initialize object before or during deserialisation process, before accessor used? there few methods can declare callbacks via attributes, (same source): // method called after object // deserialized. use instead of // constructror. [ondeserialized] void ondeserialized(streamingcontext context) { fullname = firstname + " " + lastname; } but looks triggered after deserialisation. do have switch xml serialization? create constructor signature protected yourclassname(serializationinfo info, streamingcontext context) { }

Python if one condition is met, print "..." -

i student rather nee learning programming languages, decided pick python , enjoying far. might have stupid question cant seem find solution, have written part of program , user inputs 3 values. if 1 of values breaks statement should print out correct answer. have.. lengte = input("wat de lengte die u nodig hebt?") breedte = input("wat de breedte die u nodig hebt?") hoogte = input ("wat de hoogte die u nodig hebt?") = 140 aa = 100 aaa = 110 b = 220 bb = 115 bbb = 120 if(hoogte in range(a) , breedte in range(aa) , hoogte in range(aaa)): print "type a" if(hoogte in range(a,b) or breedte in range(aa,bb) or hoogte in range(aaa,bbb)): print "type b" but when give in 170 hoogte , 40, 40 breedte , hoogte still prints out "type a" while in eyes should "type b" because value exceeds aa lower bb.. any appreciated, sorry if seems "noob" question.. yeh pretty new this. may mis-type first condi

asp.net mvc - Kendo Grid , show command buttons only when adding a new record -

i using kendo grid display data. it's working command buttons (update/cancel or edit/delete). issue : need show command buttons (update/cancel) when adding new record. need hide buttons (edit/delete) when loading , re-loading grid. thanks, john you can achieve hiding them in databound event: $("#grid").kendogrid({ ... databound: function(e){ e.sender.tbody.find('.k-grid-edit,.k-grid-delete').hide() } }); mvc: @html.kendo().grid<..>() ... .events(e => e.databound("function(e){ e.sender.tbody.find('.k-grid-edit,.k-grid-delete').hide()"))

compilation - jrxml does not compiling -

hi have problem in jasper reports.. im executing jrxml through java class shown below string jrxmlpath = context.getrealpath("//ireport_jrxml//" + reportpath); system.out.println("in bto report selected " +jasperreport); ---->(1) jasperreport jasperreport = jaspercompilemanager.compilereport(jrxmlpath); system.out.println("in bto report compiled " +jasperreport); ----->(2) "//ireport_jrxml// path put jrxml file. executed application control executing ---->(1) line doesnt executing belo statements,here problem @ lest doesnt showing error on console. im using ireport 4.0.2,tomcat 7,jdk 1.7 , added jasperreport-3.7.4.jar file in lib folder. is there issue version problems? ireport 4.0.2,tomcat 7,jdk 1.7 , web dynamic module 3.0 tried find out problem unfortunately missed library... dint remember library ... jasper compiler doesnt executing report design elements,report without design elements executing ,

post - File uploading using GET Method -

as know, file uploading accomplished using post method. so, why can't get method used file uploads instead? there specific prohibition against http get uploads? get requests may contain entity body rfc 2616 not prevent entity body part of request. misunderstood because php muddies waters poorly-named $_get superglobal. $_get technically has nothing http get request method -- it's nothing more key-value list of url-encoded parameters request uri query string. can access $_get array if request made via post/put/etc. weird, right? not abstraction, it? why entity body bad idea so spec method ... well: in particular, convention has been established , head methods should not have significance of taking action other retrieval. these methods ought considered "safe." so important thing make sure request safe. still, prohibition "should not" ... technically http still allows requests result in action isn't strictly based around

javascript - Skrollr relative positions not working -

i need able move div 1 100% height div fixed position in 100% height div. using relative positions not know how big div is. doing wrong, skrollr documentation confuses me. here code using try , solve issue. data-0="transform: translate(0,0vh);" data-center="transform: translate(0,100vh); here reduced test case: http://codepen.io/simonfricker/pen/kvmpaz html <section class="block hero"> <div class="container"> <div class="happy" data-0="transform: translate(0,0vh);" data-top-top="transform: translate(0,10vh);">😃</div> </div> </section> <section class="block content"> <div class="container"> <p>happy face should end here on scroll</p> </div> </section> css html, body{ height:100% !important; } .block{ height:100%; } .hero{ background: red; } .content{ background: yellow; text-align:

xml - C# Deserialisation List Count Zero -

having trouble getting classes deserialise correctly. the other deserialisation classes working fine , appear similar in nature when deserialiser runs, 0 count both errordetail , string lists. what have missed/done wrong? xml: <placeorderresponse xmlns="http://blah.co.uk"> <placeorderresult xmlns:a="http://blah.co.uk/webservicemessage" xmlns:i="http://www.w3.org/2001/xmlschema-instance"> <a:errordetails xmlns:b="http://blah.co.uk/error"> <b:errordetail> <b:code>1fasd</b:code> <b:message>explain</b:message> </b:errordetail> </a:errordetails> <a:id i:nil="true"/> <a:informationalmessages xmlns:b="http://schemas.microsoft.com/2003/10/serialization/arrays"/> <a:status>1</a:status> &l

Regular expression not working in Nginx -

i write regular expression in nginx not work. why? location /profil/(cancel_email|activation) { if write following, instead location /profil/cancel_email { location /profil/activation { it works, want use reglar expression any idea please? add regexp match symbol ~ location directive, that: location ~ ^/profil/(cancel_email|activation) { ... } ref: http://nginx.org/en/docs/http/ngx_http_core_module.html#location

javascript - jQuery Mask Plugin: mask for negative integers -

i using jquery mask plugin in web project. used , don't want change now. i use following mask numbers decimal separators: for example element: <input class="number-field" value="123456"> i use following mask: $('input.number-field').mask('#,##0', {'reverse': true}); it works positive numbers, add support of negative numbers. neither of following patterns work: $('input.number-field').mask('#,##0z', { reverse: true, translation: { 'z': { pattern: /\-?/ } } }) $('input.number-field').mask('z#,##0', { reverse: true, translation: { 'z': { pattern: /\-?/ } } }) $('input.number-field').mask('z#,##0', { reverse: true, translation: { 'z': { pattern: /-/, optional: true } } }) last 1 seems working, 4 digits in line. how can use plugin negative numbers? may consider patching plu

sql - Errors when reducing VARCHAR length -

please see ddl below: create table person ( id int identity not null, name varchar(100), age int, eyecolour varchar(20), primary key (id) ) create index name on person (name) create index age on person (age) create index eyecolour on person (eyecolour) i can execute following statement: alter table person alter column name varchar(110) however, cannot execute following statement: alter table person alter column name varchar(90) the error is: msg 5074, level 16, state 1, line 1 index 'name' dependent on column 'name'. msg 4922, level 16, state 9, line 1 alter table alter column name failed because 1 or more objects access column. why seeing these errors when reduce length of varchar . in other scenarios see error e.g. change data type? is there automated way of identifying indexes , constraints affected data type change , dealing them? you automate identification part. here script find indices , for

selenium webdriver - Browser opens many times while Geb testing -

i wrote following test simple spring boot web application: @springapplicationconfiguration(classes=[pdk]) @webintegrationtest @dirtiescontext class gebmainpagespec extends gebspec { @autowired webapplicationcontext context; def setup() { system.setproperty("webdriver.chrome.driver", "chromedriver/win32/chromedriver.exe"); browser.driver = new chromedriver(); browser.baseurl = "http://localhost:8080/"; } def 'static page present , works, check without pages'() { when: go "" then: assert title == "myapp" } def 'static page present , works, check pages'() { when: mainpage then: loginwithformusername.value() == "root" } } these tests apparently work, i.e. pass or fail depending on page data. the problem opens 2 instances of chrome browser operate (by number

tfsbuild - How to start vNext TFS 2015 build revision at a specific number -

i using vnext build system of tfs 2015. i have builds versioning in traditional format. major.minor-rev.revisionnumber. so, if have build major 1, minor 12, build version 1.12-rev.1 when start. know if possible have build version start @ number other one, 55. such build version 1.12-rev.55, , increment 1 usual after that. unfortunately, it's impossible. every build definition has build number format field can use macros dictate resulting build number should like. in format using $(rev:.rr) start one. what $(rev:.rr)? to ensure every completed build has unique name. when build completed, if nothing else in build number has changed, rev integer value incremented one. source: msdn moreover, if want generating custom build number without increment. here blog detailed procedures: generate custom build numbers in tfs build vnext

Android getIdentifier returns 0x1? -

on small set of devices running application users getting crash when changing image via preferences. full stack trace: java.lang.runtimeexception: unable resume activity {com.printandpixel.lolhistory/com.printandpixel.lolhistory.activities.mainactivity}: android.content.res.resources$notfoundexception: resource id #0x1 @ android.app.activitythread.performresumeactivity(activitythread.java:3346) @ android.app.activitythread.handleresumeactivity(activitythread.java:3377) @ android.app.activitythread.handlelaunchactivity(activitythread.java:2728) @ android.app.activitythread.access$900(activitythread.java:172) @ android.app.activitythread$h.handlemessage(activitythread.java:1422) @ android.os.handler.dispatchmessage(handler.java:102) @ android.os.looper.loop(looper.java:145) @ android.app.activitythread.main(activitythread.java:5832) @ java.lang.reflect.method.invoke(native method) @ java.lang.reflect.method.invoke(method.java:372) @ com.a