w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Problem to plot 3D surface with R‏
Try this to see why I don't think this data is well suited for wireframe: cloud(Z~X+Y, data=FI02, xlab="X", ylab="Y", main="Surface elevation", type="l", screen=list(z=-60, x=-60))

Categories : R

kruskal.test shows "All group levels must be finite" error. What is the problem?
It should work if you run data$Grp <- as.factor(data$Grp) Then (as before): kruskal.test(data$Val, data$Grp) This is because Grp is a character not a factor and is.finite applied to an object of character class is always false (see ?is.finite).

Categories : R

what is the difference between printing from a class or returning the output and printing from a function
constructors can't return values. They always return the created object. So you will get in $output the created object of your class sql_output_two_rows and not the string. Restructre the code (maybe static function for formatting or create an extra function for that)

Categories : PHP

Print Natural Sequence with help of 2 threads(1 is printing even and 2'nd is printing odd)
This could be an exercise on threads and lock monitors, but there is nothing to do in parallel that give you advantages. In your code when a thread 1 (OddThread or EvenThread) ends his work and prints out "Odd Thread Finish" (or "Even Thread Finish") the other thread 2 is waiting a notify() or a notifyAll() that never will happen because the first is over. You have to change EvenThread and OddThread adding a synchronized block with a notify call on commShare just after the while cycle. I removed the second if-branch because in this way you don't continue to check the while condition but get a wait on commShare soon. class EvenThread implements Runnable { private Share commShare; private int number = 2; public EvenThread(Share obj) { this.commShare = obj; } p

Categories : Java

Printing items within a list within a list, etc. (Printing nested lists)
The function has no argument called C therefore you cannot pass it a keyword argument called C. Either use directory=... instead or pass it the object as a normal argument. C = ... tree_traverse(C)

Categories : Python

else if is not printing my console value
Suppose Coffees.length is 2. You do this... if (Coffees.length > 1) { multCoffees = true; } ...and 2 > 1, so now multCoffees is true, but then you do this, which checks the same thing... if (Coffees.length > 1) { singleCoffee = true; } and, since 2 > 1 still, now BOTH multCoffees AND singleCoffee are true. So when you try to do if (multCoffees) { ... } else if (singleCoffee) { ... } the first if branch is true, so it is executed, and the else branch is thus ignored (despite also being true). You probably meant to instead start with if (Coffees.length == 1) { singleCoffee = true; } else if (Coffees.length > 1) { multCoffees = true; }

Categories : Javascript

Mvc 3 Printing issue
Transform property is supported in Internet Explorer 10, Firefox, and Opera. Internet Explorer 9 supports an alternative, the -ms-transform property.Safari and Chrome support an alternative, the -webkit-transform property. So you may write something like that: div { -moz-transform: rotate(70deg); /* Firefox */ -ms-transform: rotate(70deg); /* IE */ -webkit-transform: rotate(70deg); /* Safari, Chrome, iOS */ -o-transform: rotate(70deg); /* Opera */ transform: rotate(70deg); } Transform is CSS3 property. So some old browsers anyway will ignore it. I would recommend just make your print page content smaller without skale factors.

Categories : Asp Net Mvc

Printing applet GUI
Adjust the parameters in this: aset.add(new MediaPrintableArea(leftMargin, topMargin, (mediaWidth - leftMargin - rightMargin), (mediaHeight - topMargin - bottomMargin), Size2DSyntax.MM)); Or adjust the parameters in these two: b.draw((Graphics2D) g, 30, 8); //.... g2.drawString(codeParam.replace("/", ""),16,8);

Categories : Java

Why is my code printing 'None'?
Seems likes story.print_story() does not return anything. If a function does not return, it returns None. >>> def a(): ... print 1 ... >>> print a() 1 None Remove print from print story.print_story().

Categories : Python

C - Not printing out the whole string
Read scanf(3) documentation. For %s is says s Matches a sequence of non-white-space characters; the next pointer must be a pointer to character array that is long enough to hold the input sequence and the terminating null byte (''), which is added automatically. The input string stops at white space or at the maximum field width, whichever occurs first. So your code is wrong, because it should have an array for studentName i.e. char studentName[32]; scanf("%s", studentName); which is still dangerous because of possible buffer overflow (e.g. if you type a name of 32 or more letters). Using %32s instead of %s might be safer. Take also the habit of compiling with all warnings enabled and with debugging information (i.e. if usin

Categories : C

not printing to textbox
It seems to be failing in cases when you have spaces in your string. As we can see in your exception trace that parseInt failed to parse " 3377" and it threw NumberFormatException while executing: intfoundit = Integer.parseInt(foundit); So you may try to trim the string and see whether it solves your problem: intfoundit = Integer.parseInt(foundit.trim()); Better you should do the trim where you are saving/putting the key/value in the hashtable.

Categories : Java

WPF Report Printing
Try the following code PrintDialog printDialog1 = new PrintDialog(); if (printDialog1.ShowDialog() == true) { report.PrintOptions.PrinterName = printDialog1.PrintQueue.Name; report.PrintOptions.PaperSize = (CrystalDecisions.Shared.PaperSize)System.Drawing.Printing.PaperKind.A5; report.PrintToPrinter(2, true, 0, 0); crystalReportsViewer1.ViewerCore.ReportSource = report; crystalReportsViewer1.ToggleSidePanel = SAPBusinessObjects.WPF.Viewer.Constants.SidePanelKind.None; } System.Printing must be in your references so that you can use PrintQueue.Name.

Categories : C#

Printing the return value
you should use p or print or puts statement to see the output,when you will be running arraytest.rb from the command prompt. Do change as below and run your code. a = [ 'ant', 'bee', 'cat', 'dog', 'elk' ] p a[0] p a[3]

Categories : Ruby

PHP GD2 Images not printing
You said all the images on the server are created perfectly...I would test this claim more carefully. If it is indeed true, the issue lies with how you send the images to your printer or how the printer handles the images once it receives them. In either situation I don't think you are going to get much help here.....I could be wrong. GL.

Categories : PHP

Printing a webpage
The possible reason could be that window.print() just checks where the page is finishing and then cuts it off till there and makes a print out. When I try to print my webpages they give me the size around a4 size. It could be just because of the resolution of the screen of how big or small it is. Whereas the PDF print option knows about the whole page and then makes it of a legal paper size and then sends a print.

Categories : HTML

Printing WPF Document
It is very important that you read the FAQ and post your question.You need to write the code and then ask for any assistance. The code here is in C# (Have not been tested) PrinterSettings settings = new PrinterSettings();//System.Drawing.Printing.PrinterSettings PrintDocument printDoc = new PrintDocument(); settings.Copies = Copiesnumber; //put your number of copies printDoc.PrinterSettings = settings; PageSettings MyPage = new PageSettings(settings); printDoc.DefaultPageSettings = MyPage;

Categories : C#

MPI - Printing in an order
There is no way to guarantee that messages from many different processes will arrive in the "correct" order when they arrive to another process. This is essentially what is happening here. Even though you aren't explicitly sending messages, when you print something to the screen, it has to be sent to the process on your local system (mpiexec or mpirun) where it can be printed to the screen. There is no way for MPI to know what the correct order for these messages is so it just prints them as they arrive. If you require that your messages are printed in a specific order, you must send them all to one rank which can print them in whatever order you like. As long as one rank does all of the printing, all of the messages will be ordered correctly. It should be said that there will probably

Categories : C

Printing from MAP in JAVA
You are putting in map like map.put(parts[0],parts[0]); So here Key and value are same.When you print System.out.println(key + " " + value); Both will print the same. Do you need ? System.out.println("value=" + value);

Categories : Java

Printing a hash
Your problem is the first line. This works: my %testhash; my $teststr = "using this for testing this that"; foreach my $word (split(' ', lc $teststr)) { $testhash{$word}++; } foreach my $word (sort keys %testhash) { print $word." ".$testhash{$word}." "; }

Categories : Perl

printing the vector in a map
it.second will give you a copy of the vector for the given map element so you could change your inner loop to for(auto it2 = it.second.begin(); it2 != it.second.end(); ++it2) cout << *it2 << " ";

Categories : C++

Printing File by using C#
You can not read a pdf file line by line. PDF is a binary format, not a text format. To clearify this try to open the PDF file in notepad (or your prefered text editor). You can use one of the many available libraries to acomplish this anyway or write your own PDF interpreter. I would recommend the available library iTextSharp (http://itextpdf.com/)

Categories : C#

Printing using Template
There are various ways; Create a text file and search and replace keywords with appropriate values. Save/Print this. Create a html file and search and replace keywords with appropriate values. Save/Print this. Create a PDF file with built-in fields and replace these with appropriate values. Save/Print this. And more...

Categories : C#

Printing long int value in C
You must use %ld to print a long int, and %lld to print a long long int. Note that only long long int is guaranteed to be large enough to store the result of that calculation (or, indeed, the input values you're using). You will also need to ensure that you use your compiler in a C99-compatible mode (for example, using the -std=gnu99 option to gcc). This is because the long long int type was not introduced until C99; and although many compilers implement long long int in C90 mode as an extension, the constant 2147483648 may have a type of unsigned int or unsigned long in C90. If this is the case in your implementation, then the value of -2147483648 will also have unsigned type and will therefore be positive, and the overall result will be not what you expect.

Categories : C

printing out array value twice / php and pdo
You need to set the fetchMode: Default is PDO::FETCH_BOTH, so an array indexed by both column name and number will be returned. $result = $STH->fetchall(PDO::FETCH_ASSOC);

Categories : PHP

How to I keep the "Print" and the URL from printing?
You can't hide the URL or any other header or footer text. These are settings controlled by the browser and are not accessible via any API. Ultimately it is up to the user to decide whether they are printed or not. You can hide the print button by using display:none for that element in the print CSS for that page.

Categories : PHP

Printing UI Controls
Take a look at this good short article called Printing WPF window(visual) to printer and fit on a page. It shows the basics of printing in WPF, but also how to size the visual to fit the page.

Categories : Dotnet

about printing a 2D array in php
You can put variables in strings if you use ", but php cannot guess if you mean $array[0] and then the string [0], or the actual variable $array[0][0]. It guessed the first. If you want to do this in a string, add { to show what is the variable. echo "{$array[0][0]}"

Categories : PHP

C program not printing
Your code is buggy! you don't allocate memory for the bus[] array, and are trying to access values at garbage location as e.g bus[i] = 0; -- Undefined Behavior in C standard, Undefined means you can't predict how your code will behave at runtime. This code compiled because syntax-wise the code is correct but at runtime the OS will detect illegal memory access and can terminate your code. (interesting to note: as OS detects memory right violation by a process -- An invalid access to valid memory gives: SIGSEGV And access to an invalid address gives: SIGBUS). In the worst case your program may seem execute without any failure, producing garbage results. To simply correct it define bus array as char bus[N]; else allocated memory dynamically using void* malloc (size_t size); Additionally,

Categories : C

Printing from Word to PDF in VB6
The parameters can be found here - http://msdn.microsoft.com/en-us/library/office/bb237242%28v=office.12%29.aspx (just like jac said in his comment). Anyway, here's a code that will print pages 3-5 of the current document to the default printer. Some of the values may be useless and may be removed, but this is what Word generates when I record a macro and print a document. objWord.PrintOut FileName:="", Range:=wdPrintRangeOfPages, Item:=wdPrintDocumentWithMarkup, Copies:=1, Pages:="3-5", PageType:= wdPrintAllPages, Collate:=True, Background:=True, PrintToFile:=False, PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, PrintZoomPaperHeight:=0 Please note the wdPrintRangeOfPages and wdPrintDocumentWithMarkup, maybe this is what's missing. (In t

Categories : Pdf

Printing with JavaScript
It isn't a matter of "detecting" a printer when Google has already been told about it. The printer will have already been registered — at that point Google has stored all of the data on the cloud. No browsers will let you print without prompting, period. That's by design.

Categories : Javascript

printing of a wav header in c
The reason is that your struct wavHeader doesn't really look like you think it does. Let me explain. The C compiler is allowed to change the alignment of the fields in a struct. Typically that means fields are aligned at 4-byte or 8-byte-boundaries. See this discussion about C struct memory layout. In effect your struct might be laid out something like this in memory: Byte 1 2 3 4 +------+------+------+------+ | chunckID | +------+------+------+------+ | chunckSize | +------+------+------+------+ | format | +------+------+------+------+ | subchunk1ID | +------+------+------+------+ |subchunk1Size| ~~~~~ ~~~~~ << padding +------+------+------+------+ | audioFo

Categories : C

Duplex Printing in Vb.net
That's a printer property, not a document or word property. See here: PrinterSettings.Duplex Property.

Categories : Vb.Net

Printing from within properties
Using the preferred decorator syntax for properties, this works fine. It'll also help you avoid issues like this in the future class Servo(object): def __init__(self, which_servo, angle = 0): self._angle = angle; self._servo_no = which_servo @property def angle(self): return self._angle @angle.setter def angle(self, value): self._angle = value print "replace this print statement with the code to set servo" @angle.deleter def angle(self): del self._angle Seeing as your indentation is off here, I believe this is likely an issue of indentation in your source. This should work as well if you really want to use the old property function: class Servo(object): def __init__(self, which_servo, angle = 0):

Categories : Python

Text not printing
Try this: Scanner input = new Scanner (System.in); while(true){ System.out.println("Enter a choice:"); System.out.println("+ to add"); ...... if (userPick.equals("Yes")) { System.out.println("Ok."); } else if (userPick.equals("No")) { System.exit(0); } } } It will continue to loop around the logic until the terminating condition is met. You may also like to close the scanner before System.exit(); and before any termination in fact.

Categories : Java

PHP echo '

' printing

You do print exactly what is inside the echo statements. However, if that happens to be invalid HTML then the browser may decide to "fix it" in order to have something usable to work with. The correct approach to solve your problem would be to substitute <div> tags for <p> -- this would be valid HTML so the browser won't interfere, and you can use CSS to style them appropriately and achieve the same visual result you get with paragraphs.

Categories : PHP

JavaScript, not printing
First, you're calling your amort function with four arguments: onclick="amort('principalInput','interestInput','termsInput','myDiv')" But it's only defined to accept three: function amort(principalInput, interestInput, termsInput) Add the fourth argument to the function definition, then use that in the function instead of hard coding the output div name. Next, terms is not defined before you use it. You need to add a line where your parse it from the form input. You'll want to add value attributes to the option tags in your HTML form so you can read in a number of terms. See the MDN page on <select> for an example of how that syntax should look. You're also calling principalInput.toFixed(2) when principalInput isn't a number. You read a value from that field earlier in yo

Categories : Javascript

qt printing to terminal
You can use qDebug() << ..., qWarning() << ..., etc. Don't forget to include <QDebug>. Docs: QDebug

Categories : Linux

Printing with flipped coordinates
You can generally do this by changing the current transform without having it also flip horizontally. You simply scale the Y coordinates by -1 and then offset them by the height of your view. So your affine transformation matrix would look something like this: | 1.0 0.0 | | 0.0 -1.0 | | 0.0 h | where h is the height of the view. So in code, it would be something like: CGContextScaleCTM (context, 1.0, -1.0); CGContextTranslateCTM (context, 0.0, h); (I might have the order reversed on those - I can never remember which order they go in!)

Categories : IOS

Printing an ASP.NET Web Site page
If you want to print only a Datalist from a webpage. You can create a Div Name around the datalist and use the below code <script language="javascript"> function printDiv(divName) { var printContents = document.getElementById(divName).innerHTML; var originalContents = document.body.innerHTML; document.body.innerHTML = printContents; window.print(); document.body.innerHTML = originalContents; } </script> Give a div name around the Datalist like this. <div id="PrintDiv"> <asp:DataList ID="DataList1" runat="server"> </asp:DataList> </div> Finally Create a print button. <input type="button" onclick="printDiv('PrintDiv')" value="Print only Datalist!" /> EDIT Your exact code worked f

Categories : Asp Net

BeautifulSoup: Printing out also the start-tag
You have a set instead of a dictionary. Do: for text in soup.find_all("table", {'class':'main'}): # ^ colon here instead of a comma txt += text

Categories : Python



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.