printing

Printing a DataTable to textbox/textfile in .NET

怎甘沉沦 提交于 2020-01-01 10:16:09
问题 Is there a predefined or "easy" method of writing a datatable to a text file or TextBox Control (With monospace font) such as DataTable.Print(): Column1| Column2| --------|--------| v1| v2| v3| v4| v5| v6| Edit Here's an initial version (vb.net) - in case anyone is interested or wants to build their own: Public Function BuildTable(ByVal dt As DataTable) As String Dim result As New StringBuilder Dim widths As New List(Of Integer) Const ColumnSeparator As Char = "|"c Const HeadingUnderline As

How to print two arrays side by side with bash script?

南笙酒味 提交于 2020-01-01 09:32:08
问题 I couldn't find a good and simple answer to this question neither on google nor here on stackoverflow. Basically I have two arrays that I need to print into the terminal side by side since one array is a list of terms and the other the terms's definitions. Does anyone know a good way of doing this? Thanks in advance. 回答1: You can use a C-style for loop to accomplish this, assuming both arrays are the same length: for ((i=0; i<=${#arr1[@]}; i++)); do printf '%s %s\n' "${arr1[i]}" "${arr2[i]}"

Julia: limited printing of large arrays

走远了吗. 提交于 2020-01-01 08:47:09
问题 I produce a number of large arrays in Julia using a script file. Printing out the whole array is cumbersome but I'd like to check the first few rows make sense. I know in the REPL there's printing which is limited by the screen size e.g. julia> zeros(1000,10) 1000×10 Array{Float64,2}: 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ⋮ ⋮ 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0

print or display variable inside function

好久不见. 提交于 2020-01-01 08:35:52
问题 Is there a way to print or display the value of a variable while inside a function, as opposed to printing the value outside the function after the function has been called? I am virtually certain there is and thought the code was called reveal or something similar, but I cannot recall the correct term. my.function <- function(x) { y <- x^2 # reveal(y) # display(y) # desired result is to print or display here: # [1] 16 cat(y) print(y) return(y) } x <- 4 my.function(x) #16[1] 16 #[1] 16 cat(y)

Print PDF file on iphone or ipad

两盒软妹~` 提交于 2020-01-01 08:35:29
问题 I attached a file to the mail I am using this code. [mail addAttachmentData:[myView PDFData] mimeType:@"application/pdf" fileName:@"name.pdf"]; How can I do the same thing for printing a file, I need to print this [myView PDFData]. I found only this for printing: NSString *PDFFileWithName = [[NSBundle mainBundle] pathForResource:@"name" ofType:@"pdf"]; NSData *dataFromPath = [NSData dataWithContentsOfFile:PDFFileWithName]; Thanks 回答1: You should read through the Drawing and Printing Guide for

How can I print text immediately without waiting for a newline in Perl?

我怕爱的太早我们不能终老 提交于 2020-01-01 07:57:06
问题 I have a computationally expensive task in perl, and would like to inform the user that computation is ongoing by printing out a period after each portion of the computation is completed. Unfortunately, until I print a "\n", none of my periods are printed. How can I address this? 回答1: You need to set autoflush for STDOUT. Example: use IO::Handle; STDOUT->autoflush(1); foreach (1..20) { print '.'; sleep(1); } 回答2: set $|=1 before you start printing. Eg. perl -e ' $|=1; foreach (1..10) { print

print div contents in javascript

若如初见. 提交于 2020-01-01 07:26:27
问题 My print html is below <div id="DivIdToPrint" style="border:1px solid #000000;"> fdghgjhghjkjk <div id="in">TO be are not to be that is the question</div> </div> and javascript code is : function printDiv() { var divToPrint=document.getElementById('DivIdToPrint'); var newWin=window.open('','Print-Window','width=400,height=400,top=100,left=100'); newWin.document.open(); newWin.document.write('<html><body onload="window.print()">'+divToPrint.innerHTML+'</body></html>'); newWin.document.close();

Ionic 2 Print function to POS printer using USB

匆匆过客 提交于 2020-01-01 07:07:42
问题 I need to develop the ionic android app which needs to be integrate with POS printer via USB. I was able to do the same with Bluetooth but when it come to USB connection i am totally zero on this. I hope some one can help me out. I tried with https://ionicframework.com/docs/native/serial/ but no idea how this one gonna work. 来源: https://stackoverflow.com/questions/48395373/ionic-2-print-function-to-pos-printer-using-usb

Ionic 2 Print function to POS printer using USB

我与影子孤独终老i 提交于 2020-01-01 07:07:19
问题 I need to develop the ionic android app which needs to be integrate with POS printer via USB. I was able to do the same with Bluetooth but when it come to USB connection i am totally zero on this. I hope some one can help me out. I tried with https://ionicframework.com/docs/native/serial/ but no idea how this one gonna work. 来源: https://stackoverflow.com/questions/48395373/ionic-2-print-function-to-pos-printer-using-usb

If the double type can handle the numbers 4.35 and 435, why do 4.35 * 100 evaluates to 434.99999999999994? [duplicate]

淺唱寂寞╮ 提交于 2020-01-01 07:00:26
问题 This question already has answers here : Is floating point math broken? (31 answers) Rounding oddity - what is special about “100”? (2 answers) Closed 6 years ago . As I understand this, some numbers can't be represented with exactitude in binary, and that's why floating-point arithmetic sometimes gives us unexpected results; like 4.35 * 100 = 434.99999999999994. Something similar to what happens with 1/3 in decimal. That makes sense, but this induces another question. Seems that in binary