Posts

Showing posts from June, 2014

jquery - Unable to load a text through a local host -

question: why error suggests "different-origin" material, , how fix it? i'm trying recreate this simple example (click on "try yourself") on machine using python's simplehttpserver. i've created demo_test.txt (with same contents example). demo_test.txt , jquery-2.1.4.min.js both in root directory server started. code runs fine until tries access demo_test.txt, @ point gives error: xmlhttprequest cannot load file:///users/username/project/demo_test.txt. cross origin requests supported protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource. if instead try load them urls (commented out lines) different error: no 'access-control-allow-origin' header present on requested resource. i understand bit same-origin policy, must somehow violating it. can me out? <!doctype html> <html> <head> <script src="jquery-2.1.4.min.js"></script> <!-- <scr...

C# Reflection: Create object from assembly without invoking constructorinfo -

i having problem calling constructor reflection. parameterless constructor no problem when i'm trying call once has parameter missingmethodexception . code: if (type != null) { var constructor = type.getconstructor(type.emptytypes); if (constructor != null) return activator.createinstance(type); constructor = type.getconstructors()[0]; var parameters = constructor.getparameters(); var obj = new object[parameters.length]; (var = 0; < parameters.length; i++) { obj[i] = (object) parameters[i].parametertype; } return activator.createinstance(type, bindingflags.nonpublic | bindingflags.public | bindingflags.instance, null, obj, null); } the parameterless constructor works fine. var constructor = type.getconstructor(type.emptytypes); if (constructor != null) { return activato...

php - Function to check GET parameter -

i have function security check on parameter (i'm not author): function get($name = null, $value = false) { $content = (!empty($_get[$name]) ? trim($_get[$name]) : (!empty($value) && !is_array($value) ? trim($value) : false)); if (is_numeric($content)) return preg_replace("@([^0-9])@ui", "", $content); else if (is_bool($content)) return ($content ? true : false); else if (is_float($content)) return preg_replace('@([^0-9\,\.\+\-])@ui', "", $content); else if (is_string($content)) { if (filter_var($content, filter_validate_url)) return $content; else if (filter_var($content, filter_validate_email)) return $content; else if (filter_var($content, filter_validate_ip)) return $content; else if (filter_var($content, filter_validate_float)) return $content; else return preg_replace('@([^a-za-z0...

Trying to copy from one text file to another in Python -

i attempted use code below, need 1 argument, gave 0. print "copy 1 file another:" print "type first file here:" file1 = raw_input('>') openfile = open(file1).read() file2 = raw_input('>') open2file = open(file2, 'w') second = open2file.write() print "all done" it's open2file.write(openfile) . sends content of file read opened file.

java - Arrays.asList("") returns List interface, how can object creation be possible in this case? -

this question has answer here: how can arrays.aslist return instantiated list? 3 answers i know object cannot created interface : list list2 = new list(); // error. when work arrays.aslist(),i'm confused, because function returns list , following code works perfectly: list list1 = arrays.aslist("a","b","c"); // works right side of equation returns list. code becomes list list1=new list(); how can possible , how code works although right side returns interface, didn't understand. can explain please? in advance arrays.aslist(...) returns new arraylist. due polymorphism can state returns list, , return implements list interface. arraylist is list, can returned. extra note: arraylist aslist using created in arrays class anonymous class extends functionality of arraylist class create constructor accepts native ...

java - Calculating the product of BigInteger[] -

context: i'm trying calculate factorials large n using biginteger class in java (for n>100,000) , far i'm doing: produce primes less or equal n using sieve of erasthones find powers raised. raise numbers respective powers. use divide , conquer recursive method multiply them all. from research i've done on internet, asymptotically faster multiplying k n. i've noticed slowest part of implementation part multiply prime powers. questions are: is there faster way calculate product of lots of numbers? can implementation improved ? code: public static biginteger product(biginteger[] numbers) { if (numbers.length == 0) throw new arithmeticexception("there nothing multiply!"); if (numbers.length == 1) return numbers[0]; if (numbers.length == 2) return numbers[0].multiply(numbers[1]); biginteger[] part1 = new biginteger[numbers.length / 2]; biginteger[] part2 = new biginteger[numbers.length - numbers...

javascript - How can I use callbacks between two AngularJS factories? -

in angularjs app got 2 factories called "editinfo" , "pinverify". i'm trying have editinfo factory call pinverify service callback function pinverify.sendpin(this.saveinfo) , save method inside pinverify factory when user has inputted pin , presses button calling pinverify.pinentered() the problem callback-method copied pinverify object , unable reference properties in editinfo factory. so... naturally tried using $q.defer() inside pinverify factory instead, , resolve in pinverify.pinentered() when user enters pin sent out sms. this works fine, , can inside editinfo factory instead of using callbacks: pinverify.sendpin().then(function() { this.saveinfo(); } and saveinfo method detect if pin correct , hide modal enter it. problem arises when pin is not correct . the promise has been resolved, click on button calling pinverify.pinentered nothing basically. can not resolve twice. so i'm kind of started, , considering heavy drinking w...

javascript - Where is lodash.js after install via npm? -

i ran npm insall lodash can't find lodash.js file include in browser. realize can download lodash.js prefer use npm if possible. newer versions of lodash packages replace lodash.js index.js. use node_modules/lodash/index.js.

c++ - Fastest (or most elegant) way of passing constant arguments to a CUDA kernel -

lets want cuda kernel needs lots of stuff, there dome parameters constant kernels. arguments passed main program input, can not defined in #define . the kernel run multiple times (around 65k) , needs parameters (and other inputs) maths. my question is: whats fastest (or else, elegant) way of passing these constants kernels? the constants 2 or 3 element length float* or int* arrays. around 5~10 of these. toy example : 2 constants const1 , const2 __global__ void kerneltoyexample(int inputdata, ?????){ value=inputdata*const1[0]+const2[1]/const1[2]; } is better __global__ void kerneltoyexample(int inputdata, float* const1, float* const2){ value=inputdata*const1[0]+const2[1]/const1[2]; } or __global__ void kerneltoyexample(int inputdata, float const1x, float const1y, float const1z, float const2x, float const2y){ value=inputdata*const1x+const2y/const1z; } or maybe declare them in global read memory , let kernels read there? if so, l1, l2, ...

Cannot connect to SQL Server 2014 from Visual Studio -

Image
i have installed sql server 2014 management studio. have imported database .bkp file , try make connection. connection string looks this. <connectionstrings> <add name="name" connectionstring="server=pcname\sqlexpress;database=databaseinmssql;user id=sa;password=password" providername="system.data.sqlclient" /> </connectionstrings> and error: cannot open database \"databasename\" requested login. login failed. login failed user 'sa' here code using connect public void openconnection() { if (connection == null) { connection = new system.data.sqlclient.sqlconnection(configurationmanager.connectionstrings["name"].connectionstring); } if (connection.state != connectionstate.open) { connection.open(); } } i can login windows auth, , sql server authentication in sql server management studio password , user. firewall temporarily ...

java - fasterxml serialize using toString and deserialize using String constructor -

i have pojo looks this: public class thing { private final int x; private final int y; private final int z; public thing(string strthing) { // parse strthing in arbitrary format set x, y , z } @override public string tostring() { // return string representation of thing // (same format parsed constructor) } @override public boolean equals(object obj) ... @override public int hashcode() ... } and want use key map (e.g. hashmap<thing, someotherpojo> ) which, when serializing json, uses tostring() representation of thing key, , when deserializing, uses string constructor. possible using simple jackson databind annotations? best way tackle this? through experimentation (i think documentation have been little clearer on this) have discovered can use jsoncreator annotation on string constructor , jsonvalue on tostring() method achieve want: public class thing { private final int x; private ...

Retrieving the employees Rehired within a year from their termination date in peoplesoft/oracle sql? -

i have table- empl id eff seq emp name date action 20140531 1 abc 05-may-08 hired 20140531 1 abc 05-jun-08 termin 20140531 1 abc 15-dec-08 rehired 20158888 1 xyz 25-jan-10 hired 20158888 1 xyz 05-may-10 termin 20156666 1 bbb 12-feb-12 hired 20157777 1 aaa 05-may-13 hired so if write query on above database, should return emplid- 20140531 as employee rehired within year termination date. wondering how can results. assuming table defined as create table empls(emplid number, eff_seq number, emp_name varchar2(10), action_date date, action varchar2(10)); and populated data specified in question following query you're looking for: with rehired_empls (select * empls ...

oracle - Issue with Bulk Collect -

i have procedure need fetch data cursor using bulk collect. issue approach - records getting processed , arent. unable identify root cause. when try debug issue, toad unresponsive , times out. here code. please help! procedure getpendingitems(pprogramidlst in varchar2, eventcur out cur) vsessionid number; vdefaultvalue svoltp.param.defaultvalue%type; type eventrec table of trigeventqueue.trigeventqueueid%type; type eventpartitiondate table of trigeventqueue.partitiondate%type; veventrec eventrec; veventpartitiondate eventpartitiondate; voldestpossibledate date; vtrigeventqueueid varchar2 (250); vprogramidlst varchar2 (250); vetinterval number; vcount number; vcount1 number; cursor prcursor(vcount1 number) select trigeventqueueid, partitiondate trigeventqueue trigeventqueueid in (select trigeventqueueid ( select...

javascript - Ajax file upload: what happens by default in form.onsubmit()? -

i have java servlet receives file, processes , writes resulting file through httpservletresponse's outputstream. for upload, use simple form: <form id="upload-form" action="myservlet" method="post" enctype="multipart/form-data"> select file convert: <input type="file" id="file-select" name="myfile" /> <button type="submit" id="upload-button">upload</button> </form> after file has been processed, download dialog opens automatically. since processing may take while (something 30 seconds plus upload time), wanted provide progress information through websocket on same page. works if this: var uploadform = document.getelementbyid("upload-form"); var fileselect = document.getelementbyid("file-select"); var uploadbutton = document.getelementbyid("upload-button"); var httprequest = new xmlhttprequest(); uploadform....

vba - Vlookup help needed - Can't seem to find this answer elsewhere -

i'm trying lookup id column i, in column a. code i'm using: dim x long lr = worksheets("risk explorer greeks").cells(rows.count, "i").end(xlup).row range("j2:j2" & lr).formular1c1 = "=vlookup(rc[-1], r1c1:r50000c1, 1, false)" i have ~40,000 values in column j, when run code ends populating way down cell 237,000 - how can amend code looks column j has value, , doesnt lookup loads of blank cells? alternatively if there faster way lookup rather above formula, pls suggest - i'd grateful help! you're appending number 37000 string "j2:j2", gives "j2:j237000". replace range("j2:j2" & lr) range("j2:j" & lr) . should go.

html - How to get value from input onclick with jQuery -

how can value row click? here's little example: <div class="row" id="multirows"> <div> <div class="col-sm-5"><input id="descrepair_0" name="dynfields[0][descrepair]" class="form-control removediv" type="text"></div> <div class="col-sm-5"><input id="nestparts_0" name="dynfields[0][nestparts]" class="form-control removediv" type="text"></div> <div class="col-sm-1 removediv"><input id="edprice_0" name="dynfields[0][edprice]" class="form-control removediv" type="text"></div> <div class="col-sm-1 removediv"><input id="daterepair_0" name="dynfields[0][daterepair]" class="form-control datebox removediv" type="text"></div> <input id=...

Google Maps polygons hover gap on Firefox -

i created map polygons downloaded fusion table , drawn on map. http://jsfiddle.net/2wej9smf/135/ http://codepen.io/massic80/pen/wvgkym google.maps.event.addlistener(country, 'mouseover', function(e) { this.setoptions({ fillopacity: this.fillopacity + 0.2 }); }); google.maps.event.addlistener(country, 'mouseout', function() { this.setoptions({ fillopacity: this.fillopacity - 0.2 }); }); the expected behavior having yellow country more opaque when hovering on it. ok on chrome, on firefox there gap in hovering: looks dependent on left (white) , top (green) gap between map , container's size. example, if hover on middle of peru, chile or argentina "highlighted". lowering green bar height , left margin or scrolling down within box, in order lower distance between map , borders, seems reducing gap. in particular, when clicking country it's highlighted correctly (it receives click event). update 7/23/15 ...

Uploaded videos are not playing in mobile browser but are playing on desktop broswer -

i have set server (gunicorn , nginx) upload videos using python/django, , watch them in browser. video player using videojs. videos h.264 mp4. , video size between 5-40 mb. the video uploads fine , can watch uploaded video on desktop , laptop browser too. the problem can't watch same videos (which playing on desktop browser) on mobile devices. i error: this video not loaded, either because server or network failed or because format not supported. what wrong? update however tested mobile browsers webm videos in mobile , opera , chrome plays video perfectly. command used webm: ffmpeg -i test2.mov -codec:v libvpx -quality -cpu-used 0 -b:v 600k -maxrate 600k -bufsize 1200k -qmin 10 -qmax 42 -vf scale=-1:480 -threads 4 -codec:a vorbis -b:a 128k -strict -2 test2_webmmm.webm and h.264 mp4 (only working firefox): ffmpeg -i inputfile.avi -codec:v libx264 -profile:v baseline -preset slow -b:v 250k -maxrate 250k -bufsize 500k -vf scale=-1:360 -threads 0 -codec:a li...

c# - Constraining X and Y Draggable Area -

i'm trying limit draggable area objects on screen , i'm getting few errors in code - trying keep simple now, reset the max x or y if object gets dragged beyond limits, i'm still not having success. use understanding how this. float maxdragx = 1000; float maxdragy = 700; vector3 mouseposition = new vector3(eventdata.position.x, eventdata.position.y, distance); transform.position = mouseposition; // set object coordinates mouse coordinates if(transform.parent.gameobject == partspanel) { transform.setparent(draglayer.transform); // pop object draglayer move object out of partspanel } if(transform.parent.gameobject == buildboard) { // constrain drag boundaries of buildboard code if(transform.position.x >= maxdragx) transform.position.x = new vector3(maxdragx, mouseposition.y, distance); if(transform.position.y >= maxdragy) ...

python - Replace NaN with empty list in a pandas dataframe -

i'm trying replace nan values in data empty list []. list represented str , doesn't allow me apply len() function. there anyway replace nan value actual empty list in pandas? in [28]: d = pd.dataframe({'x' : [[1,2,3], [1,2], np.nan, np.nan], 'y' : [1,2,3,4]}) in [29]: d out[29]: x y 0 [1, 2, 3] 1 1 [1, 2] 2 2 nan 3 3 nan 4 in [32]: d.x.replace(np.nan, '[]', inplace=true) in [33]: d out[33]: x y 0 [1, 2, 3] 1 1 [1, 2] 2 2 [] 3 3 [] 4 in [34]: d.x.apply(len) out[34]: 0 3 1 2 2 2 3 2 name: x, dtype: int64 this works using isnull , loc mask series: in [90]: d.loc[d.isnull()] = d.loc[d.isnull()].apply(lambda x: []) d out[90]: 0 [1, 2, 3] 1 [1, 2] 2 [] 3 [] dtype: object in [91]: d.apply(len) out[91]: 0 3 1 2 2 0 3 0 dtype: int64 you have using apply in order list object not interpreted array assign df try al...

java - Use the type parameter of the object in a default interface method -

i want compose 2 codecs (code below) together, must have compatible types fit together. code works had use line codec<f,t> c = this; work otherwise compiler didn't seem understand correctly type parameters (and restrictions on codec2 ). i'm glad code compiles there cleaner way achieve this? /** * represents coder-decoder format f format t */ public interface codec <f,t> { t encode(f obj); f decode(t obj); /** * compose 2 codecs types <f,t> , <t,e> codec type <f,e>. * @param codec2 second codec * @return new codec */ public default <e> codec<f,e> compose(codec<t,e> codec2) { codec<f,t> c = this; return new codec<f,e>() { public e encode(f obj) { return codec2.encode(c.encode(obj)); } public f decode(e obj) { return c.decode(codec2.decode(obj)); } }; } } you're declaring anonymous inner class implements codec i...

javascript - Protractor: How I can stretching and replasing elements? -

Image
i have form this: and want emulate colums stretching. can change column headings places. want emulate to. think should use webdrivers methods. can't understand kind of. it sounds use case draganddrop() browser action : browser.actions(). draganddrop(elm, {x: 400, y: 20}). perform(); you can drag , drop element element: browser.actions(). draganddrop(elm, targetelm). perform(); and, fyi, here specification: /** * convenience function performing "drag , drop" manuever. target * element may moved location of element, or offset (in * pixels). * @param {!webdriver.webelement} element element drag. * @param {(!webdriver.webelement|{x: number, y: number})} location * location drag to, either webelement or offset in pixels. * @return {!webdriver.actionsequence} self reference. */ webdriver.actionsequence.prototype.draganddrop = function(element, location) { return this.mousedown(element).mousemove(location).mouseup(); }; ...

javascript - Ratchet socket from Android and IOS clients -

i've written socket php code using ratchet . here simple code, works when send , messages web - javascript: use ratchet\messagecomponentinterface; class chat implements messagecomponentinterface{ protected $clients; public function __construct(){ $this->clients = new splobjectstorage(); } function onopen(\ratchet\connectioninterface $conn) { echo "did open\n"; $this->clients->attach($conn); } function onclose(\ratchet\connectioninterface $conn) { echo "did close\n"; $this->clients->detach($conn); } function onerror(\ratchet\connectioninterface $conn, \exception $e) { echo "the following error occured: ". $e->getmessage(); } function onmessage(\ratchet\connectioninterface $from, $msg) { $msgobj = json_decode($msg); ...

pygobject - Install python3-gi for Travis-CI and Python >= 3.3 -

what correct way install python3-gi on travis-ci using .travis.yml file? the past recommendation use python 3.2 ( travis-ci & gobject introspection ), prefer testing against more recent versions. i did try few sensible combinations of commands, knowledge of travis-ci environment basic: this example fails , without using system_site_packages: true : before_install: - sudo apt-get install -qq python3-gi virtualenv: - system_site_packages: true two examples of repositories have working (as far can tell): https://github.com/ignatenkobrain/gnome-news (circleci) https://github.com/devassistant/devassistant (travis-ci) in order use newer version either have build or use container system docker. gnome-news has example of pygobject project using circleci (which free alternative travis-ci). using fedora rawhide in docker has latest versions of entire gnome stack.

sql - Can't trim() Char(195) in MySQL -

i imported , in process of cleaning data exported older mainframe , have quite few lines start abnormal character (i.e. ascii characters 194, 195, 226, etc). can trim off of characters simple remainder = trim(leading '%' remainder) (where '%' represents character in question. the character won't removed 'Í'. if run remainder = trim(leading 'Í' remainder) query won't find , trim character, if run ascii(remainder) query on data shows character 195 strings start character. next ran remainder = trim(leading char(195) remainder) query , skipped character well. why able remove else 1 character when mysql can convert it's ascii character code , doesn't have issues displaying character when normal select query run , applicable records displayed? update have run following queries: remainder = trim(leading convert('Í' using ascii) remainder) remainder = trim(leading convert('Í' using utf8) remainder) remainder =...

javascript - $('input[type=checkbox]:checked').each not executing second time around -

i have following code on second execution not executed though check boxes checked. please help. edit: added code gets rows in table have been checked using checkboxes. sorry there code post. second time around correct rows second function itterates checked checked boxes not run. $('input[type=checkbox]').each(function() { if (this.checked == true){ var del_id = $(this).parents("tr").data(); console.log('!del_id', del_id); del_arr.push(del_id.id); mydata ={"spreadsheets_ids": del_arr}; console.log('mydata:', mydata); } }); ///off ajax call , lots of other stuff happens before comes below $('input[type=checkbox]:checked').each(function() { var $tr = $(this).closest('tr'); var del_id = $tr.attr('data-id'); console.log('still deleted: =' + del_arr); $.each(de...

javascript - jQuery Code won't connect to search form -

this question pertains this question/post . have search form requires: a: pull user input search form our backend can provide user relevant search results. b: need able insert default input either, or both, search fields enhance user search experience. should replace placeholder values. i have tried following code in main.js file (linked testpage.html): $(document).ready(function(){ $("#btn-search").click(function(e){ e.preventdefault(); var x = $("#keyword").val("nurse"); var y = $("#location").val(); $("#keyword").attr("value", x); $("#location").attr("value", y); }); }); i have tried following: $(document).ready(function(){ $("#btn-search").click(function(e){ e.preventdefault(); $("#keyword").val(nurse); $("#location").val(); }); }); do know why wouldn't work? tried put in body of page: <script> $("#btn...

java - Kerberos user principals in Keytab and KDC with JAAS -

i'm building simple jaas loginmodule. uses following code: public class jaas { private static string name; private static final boolean verbose = false; public static void main(string[] args) throws exception { if (args.length > 0) { name = args[0]; } else { name = "client"; } // create action perform privilegedexceptionaction action = new myaction(); loginandaction(name, action); } static void loginandaction(string name, privilegedexceptionaction action) throws loginexception, privilegedactionexception { // create callback handler callbackhandler callbackhandler = new textcallbackhandler(); logincontext context = null; try { // create logincontext callback handler context = new logincontext(name, callbackhandler); // perform authentication context.login(); } catch (logi...

jenkins - Accessing a downstream parameter using build flow -

assume have following downstream job: // downstream job dynamic_var = "" parallel( { dynamic_var = new date() // other value determined // @ runtime job }, { // other stuff... } ) as part of upstream job (see example below) want able call downstream job, , access variable set during downstream job. // upstream job my_build = build("my-custom-job") // beable // out.println my_build.build.get_var('dynamic_var') // or // out.println my_build.build.dynamic_var looking through output seems variable not returned, , hence not accessible. suspect because variable in question (dynamic_var) available during scope of downstream job, , hence once job finishes variable removed. my 2 questions wanted ask were: is correct variables removed upon job completion? does have idea how could (if can) achieved (additional plugins fine if required)? 1) outputting variable=value pair file acceptab...

swift - passing integer Argument in a function -

func getdriverfromid(var id : int?) -> string { if id == nil { return "no driver assigned" } else { loaddriversrest() } return "test" } getdriverfromid(nil) i getting error " getdriverfromid argument list of type (nil)" your code correct , works fine. said have couple of suggestions , have included (working) playground you. given code first checks whether id nil, don't need else flow stop (or return) anyway - makes little more pleasing eye... with in mind, function this: func getdriverfromid(var id : int?) -> string { if id == nil { return "no driver assigned" } loaddriversrest() return "test" } also, unless plan on changing "id" within code of function, don't need var before it. basically, function arguments non-mutable default can't change them, adding var enables change value of argument within code. with of in mi...

sql server - Using a 'rank' to return 'top' row in SQL -

i have data set returns clients services, table below: person_id service_category service_rank 1234 blow dry 3 1234 cut , colour 2 1234 restyle 1 4321 blow dry 3 4321 cut , colour 2 4321 fringe trim 1 (no idea why used haircutting, sensitive data , cant use itself) so need run report of services above, want bring highest service_rank (1-10 lets say, 1 being important) this bring whichever highest was, if rank 3, class of importance. in instance, expect return person_id service_category service_rank 1234 restyle 1 4321 fringe trim 1 i hope makes sense. @ moment view, using variety of tables bring data through, , ideally form part of select statement. unfortunately, learning sql , such need as can get! thanks in advance (i couldnt find addressed issue) nikki ;with cte ( select person_id, service_category, service_rank,...

Building maven raises maven-plugin:0.0.16 error, A required class was missing -

when building project weird error came up: a required class missing while executing com.github.eirslett:frontend-maven-plugin:0.0.16:install-node-and-npm: org/slf4j/helpers/markerignoringbase i don't know related maven new version? last night updated maven 3.3.3. it slf4j issue.. changed frontend-maven-plugin version 0.0.23 , fine now. <plugin> <groupid>com.github.eirslett</groupid> <artifactid>frontend-maven-plugin</artifactid> <version>0.0.23</version> </plugin>

Visual Studio 2013 and NullReferenceException while trying to run any extensions with SASS -

some time ago inherited angular app style sheets made in scss. after research found out cannot compile them in visual studio out-of-the-box , require extensions. first tried out web essentials, first thing come out on stack overflow - turned out crash visual. short googling after learned crashing frequent, , web essentials can not compile sass files anymore anyway, checked out others. however, after trying out other solutions - sassystudio, compilesass , mindscape web workbench - saw problem caused crashes in webessentials related installation of visual. tried clearing caches of extensions, uninstalling extensions , reinstalling them back, didn't @ all. the extensions seem crash on opening file, because when opening visual no scss files open no exceptions thrown. check if related specific file, or referenced in it, created empty .scss file, not compile. after checking activitylog.xml saw 2 errors in it: <entry> <record>506</record> <time>20...

r - Using functions with dplyr to parse dates -

i have code in r manipulating timestamps dyplr code below in essence, send out email @ time , response - if any. wanted extract number of attributes both sent , response items. there 3 countries involved , have time stamps set differently example uk has timestamp like: 2015-03-11 09:32:51, other 2 countries have time stamps 02/03/2015 08:02 i have created code below based on studying of dplyr , wish create function out of im getting errors udf_parsedates <- function(strformat) { email <- email %>% mutate(email.dtm = parse_date_time(sms.date,strformat), email.hour = as.numeric(format(sms.dtm,"%h")), email.dow = wday(sms.dtm, label=true, abbr=false), rep.dtm = parse_date_time(reply.date,strformat), rep.hour = as.numeric(format(rep.dtm,"%h")), rep.dow = wday(rep.dtm, label=true, abbr=false), responsetime.hours = as.numeric(difftime(rep.dtm, sms.dtm, units="hours"))) } # find hour , dow of emai...

android - Travis-CI not building my configuration -

i have android project trying build on travis-ci. project consists of app module , library module. travis-ci errors out this: configuration name 'release' not found. this doesn't make sense, since gradle building project fine on local machine. how understand cryptic travis error? thanks, igor edit: full script here - sudo: false language: android cache: apt addons: apt: packages: - s3cmd android: components: - build-tools-22.0.1 - android-22 # emulator components - sys-img-armeabi-v7a-android-22 licenses: - 'android-sdk-preview-license-52d11cd2' - 'android-sdk-license-.+' - 'android-googletv-license-99eda7fb' jdk: - oraclejdk8 before_install: - chmod +x ./drnow/gradlew # emulator management: create, start , wait before_script: - echo no | android create avd --force -n test -t android-19 --abi armeabi-v7a - emulator -avd test -no-skin -no-audio -no-window & - android...

ruby - Will Rails db Data be Lost on Redeploy to Heroku? -

i've been searching , doing research can't seem find articles directly talking this. have art gallery rails app around 6 models of different attributes, pieces of art, etc. when make changes site , redeploy, databases reset? or postgres , rails app separate on heroku? i read takes of data , puts seed.rb repopulates databases seed data once it's redeployed? sound right? insight helpful. thank you if you're using database, data won't lost on redeploys. data stored in /tmp gets lost after deploy performed. i'm going assume you're using heroku postgres. in case check out this, it's regularly create backups: https://devcenter.heroku.com/articles/heroku-postgres-backups in seed.rb should add data necessary set project, , nothing more. e.g. create admin.

css - Justify Content Inside div -

i have should basic css question. want justify text in div you'd see in newspaper. can't understand why refuses it. below codepen example i'm trying do. want letters sit flush creates box. thank you! http://codepen.io/anon/pen/rpyjqo <div id="where_we_are_factoid"><p>corporate learning<br> centers located on<br> <span>3 continents,</span><br> in 4 countries , 27 states</p></div> #where_we_are_factoid { font-size: 22px; font-weight: 200; float: right; width: 260px; } #where_we_are_factoid p { text-align: justify; text-justify: inter-word; } #where_we_are_factoid span { font-size: 39px; font-weight: 600; } the line-by-line justification can done adding mark-up, css bit complex. depending on words in use , overall width of parent div , typography can bit unpleasant, experimentation may needed. my example proof-of-concept, actual use still subject comment , debate. #wh...

sql - Update query with select statment -

i have linked sharepoint list in access 2010 , update list update query. after updated query should show result how table like. how can design query? , pass values updated table via form. how can talk form values query? best regards matthias you need create button in form name "update". on commandclick() can use sql query update record taking form values. can have new query or report in ms access can run " select * table1". hope helps.

c# - Bypass windows authentication for SSRS -

i have web server serves report using sql reporting services. there way bypass windows authentication , pass in somekind of token? we have website user logins , link inside account page links report server. don't want prompt them login again. what way this? based on custom authentication, provide custom login: http://myserver/mycustomssrslogin once make call login url? do redirect reporting url: http://myserver/mysalesreport ?

python - Fitting a Binomial distribution with pymc raises ZeroProbability error for certain FillValues -

i'm not sure if found bug in pymc. seems fitting binomial missing data can produce zeroprobability error depending on chosen fill_value masks missing data. maybe i'm using wrongly. tried following example current master branch github. i'm aware of bug concerning binomial distributions in pymc 2.3.4 , seems different issue. i fitted binomial distribution pymc , worked expected: import scipy sp import pymc def make_model(observed_values): p = pymc.uniform('p', lower = 0.0, upper = 1.0, value = 0.1) values = pymc.binomial('values', n = 10* sp.ones_like(observed_values), p = p * sp.ones_like(observed_values),\ value = observed_values, observed = true, plot = false) values = pymc.binomial('values', n = 10, p = p,\ value = observed_values, observed = true, plot = false) return locals() sp.random.seed(0) observed_values = sp.random.binomial(n = 10.0, p = 0.1, size = 100) m...

Min-width causes an extra space vertically on Android screen in portrait mode in HTML/CSS -

recently, met issue android chrome browser, in portrait mode (in landscape looks fine) when using following html code , css code. i use bootstrap framework body { min-width: 900px; } #test div { max-height: 400px; overflow: auto; } #test table { margin-bottom: 0; } #test table tr td { width: 25%; padding-right: 5px; } #test table tr th { width: 25%; } <div class="col-xs-12 col-sm-10 col-sm-offset-1" id="test"> <table class="table table-bordered"> <thead> <tr> <th>name</th> <th>size</th> <th>modification</th> <th>action</th> </tr> </thead> </table> <div> <table class="table table-bordered"> <tbody> <tr> <td>sdad asdadsasdas</td> <td...