Posts

javascript - XPages - displaying attachments in read mode -

i have xpage file upload control , rich text control. after upload attachment , save document, unable see attachment after document has been opened in read mode. <xp:inputrichtext id="richtext1" value="#{document1.richtext1}"></xp:inputrichtext> <xp:fileupload id="fileupload1" value="#{document1.richtext1}"> </xp:fileupload> what need display saved attachment when document in read mode? the file upload control uploading files. show uploaded files need add file download control xpage. ckeditor shows text "see attached file foo.jpg"

r - Find a block of steady column values -

5can give me hint speed following program? situation: have huge amount of measurement data. need extract data "10 minutes stable operation conditions" of 5 parameters i.e. column values. here (working, slow) solution: - take first 10 rows dataframe - compare min , max of each column first value of column - if @ least 1 column min or max not within tolerance, delete first row, repeat - if within tolerance, calculate mean of results, store them, delete 10 rows, repeat. - break when dataframe has less 10 rows since using repeat loop, takes 30min extract 610 operation points 86.220 minutes of data. any appreciated. thanks! edit: created code explain. please note deleted checking routines na values , standby operation (values around 0): n_cons<-5 # number of consistent minutes? ### function check wheter value within tolerance f_cons<-function(min,max,value,tol){ z<-max > (value + tol) | min < (value - tol); return(z) } # define +/- tolera...

Entity Framework 5 table-per-type update, change sub type but keep same base type -

i have simple hierarchy public abstract class communicationsupport { public supporttypeenum type { get; set; } public country origin { get; set; } // national or foreign support } public class telecomsupport : communicationsupport { public string number { get; set; } } public class postalsupport : communicationsupport { public address address { get; set; } } i plan use table-per-type hierarchy db. 3 tables created, 1 base , 2 child using same pk base. my problem want able update communicationsupport changing it's type. let's create telecomsupport, save , change it's type postalsupport , save again (update). result expect ef keep same base record (communicationsupport id) delete record in telecomsupport table , create new 1 in postalsupport. telecomsupport , postalsupport exclusive , cannot share same base communicationsupport. how can using entityframework 5? thanks help! i don't have answer, can think of 4 "solutions" ...

c++ - Why does this not compile without enable_if? -

why following code not compile if remove enable_if? template<class t, class = typename std::enable_if< std::is_constructible<t, double,double,double>::value >::type > operator t() const { return t{x, y, z}; } example code: enable_if http://ideone.com/nwdmjh without enable_if + compile error http://ideone.com/fbmamf without enable_if , conversion operator exists every type. error if attempting instantiate conversion operator types cannot constructed {x, y, z} , doesn't change fact operator exists. because exists, type considered convertible double * , , overload resolution cannot pick best match.

Exception:java.lang.NullPointerException when comparing two strings of two different string arrays -

i'm coding trough codingbat.com/java , ran error don't understand. got 2 string arrays , want compare them. if use arrays works fine (but result not right). right result programmed helper function eliminates duplicates of array. tested helper function, returns array shortened of duplicates. i can retrieve values in new arrays _a[i] etc., , don't errors, if use _a[0].equals(_b[0]) or _a[0].compareto(_b[0]) nullpointerexception (_a[0] == _b[0] works fine...) . if use original arrays a,b code runs without problems. don't comprehend why nullpointerexception there. thanks help! code: public int commontwo(string[] a, string[] b) { string[] _a = killduplicate(a); string[] _b = killduplicate(b); int ai=0, bi=0,count=0; (int = 0; ai < _a.length & bi < _b.length; i++){ if ( _a[ai].compareto(_b[bi]) > 0) { //nullpointerexception here, not if use a,b bi++; } else if ( _a[ai].compareto(_b[bi]) <...

resolution - Get user's screen&viewport dimensions in php on first load -

i want in php height/width of both screen , viewport when user visits page. i've tried different ways cause other problems. my goals: get info on first load (no jump page, no reload). not change url not affect rest of php runs on load, or make php run twice what i've tried far: javascript viewport dimensions: if(!isset($_post['width']) || !isset($_post['height'])) { echo ' <script type="text/javascript" src="jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function () { var height = $(window).height(); var width = $(window).width(); $.ajax({ type: \'post\', data: { "height": height, "width": width }, success: function (data) { $("body").html(data); }, }); }); </script> '; } $user_width = $_post['width']; $user_height = ...

java - how to add data from text file and Sort this data data received from text file using fileInputStream -

i want should read text text file using file inputstream..and store data using set or method..and sort data using arraylist... class songdetail used set values of song,moviename , artist.... there text file "text1.txt" had store song/moviename/artist details... want when read file in class1,string reurned splited song,moviename,artist , set in songdetail class. import java.io.bufferedreader; import java.io.fileinputstream; import java.io.inputstreamreader; import java.util.*; public class class1 { public static void main(string[] args) { //arraylist <string>list = new arraylist<string>(); arraylist <string>list = new arraylist<string>(); try { fileinputstream in = new fileinputstream("text1.txt"); bufferedreader br = new bufferedreader(new inputstreamreader(in)); string strline; while((strline = br.readline())!= null) { // system.out.println(strline); list.add(strline); //sy...