Posts

firefox - Adding a location bar shortcut for sending a new mail (via Gmail)? -

is there way can type command in location bar , browser open "new mail interface" in current tab. so, don't have go gmail , click on compose button? this works... https://mail.google.com/mail/?view=cm&fs=1 you can start filling in email too... https://mail.google.com/mail/?view=cm&fs=1&to=toemailaddress@here.com&su=subjecturlescaped&body=bodytexturlescaped cheers!

javascript - Regex Pattern Throwing a Lexer Error AngularJS -

i'm getting lexer error when using ng-pattern on input element my regex test phone-numbers , on input looks this: <input type="text" class="phone" ng-pattern="(\(?([0-9]{3})\)?)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})" placeholder="phone number" ng-model="contactformvm.contact.phone" required /> and angular yells @ me , gives me error: error: [$parse:lexerr] lexer error: unexpected next character @ columns 1-1 [\] in expression [(\(?([0-9]{3})\)?)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})]. now can see it's getting angry \ . don't know how write regex without escaping that. funny thing is, test works , validate correctly, hate throwing error nothing. any ideas why happening? thanks you need escape \ in string because ngpattern takes string , wraps in new regexp('stringhere') requires escape character .

java - How can I call a subclass method using a superclass object? -

i'm having issue code need call subclass method using superclass object. there possible way or work around? i'm stumped , there no helpful answer issue. string basiccommand = commands[0]; string advcommand = commands[1]; string percommand = commands[2]; if (objectname.get(advcommand)instanceof circle){ objectname.get(advcommand); //.changesize(reader.converttoint(percommand)); advcommand of type shape superclass of class circle , , method changesize() within circle . *data within hashmap. you need instantiate based on classname: class cc = class.forname(advcommand); circle c = (circle)c.newinstance(); c.changesize(reader.converttoint(percommand));

jquery - -ms-overflow-style: none Doesn't work with IE 11 -

i need hide scrollbar found in iframe when using ie 11. as read "-ms-overflow-style: none" works ie 10 , can need: unlike overflow: hidden, elements -ms-overflow-style: none can still scrolled via touch panning, keyboard, or mouse wheel. any suggestion please? thank you!

timezone - initialized POSIXct value different from printed values in R -

below, write small code compare results of output of posixct , print value. know why values in loop different printed values or x variable? timezones <- data.frame(dst_start= '2012-03-11 3:00', tzname='america/vancouver') timezones$tzname <- as.character(timezones$tzname) # initialize column timezones$et_dst_start <- .posixct(1) timezones$et_dst_start[1] <- as.posixct(timezones$dst_start[1], tz=timezones$tzname[1]) # assigned value dataframe timezones$et_dst_start[1] # as.posixct(timezones$dst_start[1], tz=timezones$tzname[1]) # assigned value non_initialized variable x <- as.posixct(timezones$dst_start[1], tz=timezones$tzname[1]) x why et_dst_start value differ x or when directly convert it? think has initializing column, don't know why happens. thoughts? it has indeed initializing column. reason posixct object comes time zone attribute. not attribute of separate element of vector, ...

c# - Web Request asynchronous iscompleted -

i use this. http://www.matlus.com/httpwebrequest-asynchronous-programming/ but how can know request iscompleted? how know work done? i use : postasync(url, postparameters, callbackstate => { if (callbackstate.exception != null) { throw callbackstate.exception; } else { writecallback(getresponsetext(callbackstate.responsestream)); } }); but not know whether ends process? in documentation says: each of these methods requires callback delegate called response of http call[...] callback called each response, , when response received , continue on processing response see fit whatever callbackstate delegate, hold response content. that's how know finished. edit: example docs. servicepointmanager.defaultconnectionlimit = 50; var url = "http://localhost/httptaskserver/default.aspx"; var iterations = 1000; (int = 0; < iterations; i++) { var postparameters = new na...

python - searching for doubles with regular expressions -

this question has answer here: how extract floating number string [duplicate] 7 answers is there regular expression match floating point numbers not if part of construct 15.01.2016? re.match(rex, s) should successful if s be 1.0a 1.b .1 and not successful s like 1.0.0 1.0.1 20.20.20.30 12345.657.345 edit: crucial part combination of constrains: "[0-9]*\.[0-9]*" , not part of "[0-9]+\.[0-9]+(\.[0-9]+)+" you can use regex based on arounds in python: (?<![\d.])(?:\d*\.\d+|\d+\.\d*)(?![\d.]) regex demo (?![\d.]) lookahead assertion fail match if next char dot or digit (?<![\d.]) lookbehind assertion fail match if previous char dot or digit