Search Results

Search found 8942 results on 358 pages for 'print r'.

Page 37/358 | < Previous Page | 33 34 35 36 37 38 39 40 41 42 43 44  | Next Page >

  • Problem with Global Array in PHP

    - by Suezy
    Hi guys,, need some help pls.. i have a PHP code here that lets a user send a message to multiple recipients using the "phonebook" (from database) as the main list. I used an array to temporarily hold all the desired recipients for the current user. So I have a two box, with each for displaying. The user will clicks the name from the phonebook lisy and clicks "Add" button to add on the temporary list on the other select box. The problem is, whenever I use the "onChange" function in javascript; the array accepts only one recipients, and when I try to add, it replaces the first one. :( Here is my code: $recipients = array(); // How do I place the array here? function reload_page(){ i=document.maillinglist.firstletter.selectedIndex; this.location='./group_msg.php?firstletter='+document.maillinglist.firstletter.options[i].value; } function add(){ } $conn = pg_connect("host=localhost user=sa dbname=messaging"); if(isset($_GET['firstletter'])){ $letter=$_GET['firstletter']; } else { $letter='a';} print ""; print "GROUP MESSAGE"; print ""; print ""; print ""; print ""; for($chr_loop=97;$chr_loop<=122;$chr_loop++){ $alphabet = chr($chr_loop); # Displays list of users arranged by letters - this works fine if($alphabet==$letter){ print "\t\t<option value='$alphabet' selected>-------------------- $alphabet --------------------</option>\n"; } else { print "\t\t<option value='$alphabet'>-------------------- $alphabet --------------------</option>\n";} } print ""; print "<td><select style='width:210px' name=\"non_members[]\" size=10 width=200>"; $sql = "select name from test_phonebook where name like '$letter%';"; $result = pg_query($conn, $sql); # Display users from phonebook using the letter chosen while($row = pg_fetch_assoc($result)){ $my_name = $row['name']; print "<option width=200 value=\"$my_name\">$my_name</option>"; } print "</td>"; print "</select>"; print "<td><input type=submit name=add value=\"->>\" onClick=\"add()\"><br><input type=submit name=del value=\"<<-\"></td>"; print "<td><select name=\"members[]\" style='width:210px' size=10>"; # Display temporary recipients - problem: ONLY DISPLAYS ONE VALUE while (list ($key, $val) = each ($recipients)) { echo "$key -> $val <br>"; print "<option width=200 value=\"$val\">$val</option>"; } print "</select></table></form>"; My aim here, is to place all recipients that the user desires to an array, without losing the previous value added.

    Read the article

  • Why does my Canon printer print document pages at ~25% size?

    - by Erlend Alvestad
    I'm using a Canon PIXMA MP250, and I'm running 12.04 LTS. The printer's been working fine for the couple of months I've been a Linux user. That is, until today. I just printed a 1-page ODT document from LibreOffice. Instead of filling the sheet, the document occupies only a little less than 25% of the paper, in the top left corner, and the text has also shrunk to something like 5pt. I looked at the paper format settings for the document and printer, which were set to "letter". I changed these to "A4", hoping that would solve the issue. There was no change, however. I tried printing a different document in LibreOffice and got the same result. I tried exporting the original document to PDF and printing it through Document Viewer. Same result. I then printed a web page from Google Chrome. No formatting problems there. In all cases the print preview looks fine.

    Read the article

  • Can this code be further optimized??

    - by kaki
    i understand that the code given below will not be compltely understood unless i explain my whole of previous and next lines of code. But this is part of the code which is causing so much of delay in my project and want to optimize this. i want to know which code part is faulty and how could this be replaced. i guess,few can say that use of this function is heavy compared and other ligher method are available to do this work please help, thanks in advance for i in range(len(lists)): save=database_index[lists[i]] #print save #if save[1]!='text0194'and save[1]!='text0526': using_data[save[0]]=save p=os.path.join("c:/begpython/wavnk/",str(str(str(save[1]).replace('phone','text'))+'.pm')) x1=open(p , 'r') x2=open(p ,'r') for i in range(6): x1.readline() x2.readline() gen = (float(line.partition(' ')[0]) for line in x1) r= min(enumerate(gen), key=lambda x: abs(x[1] - float(save[4]))) #print r[0] a1=linecache.getline(str(str(p).replace('.pm','.mcep')), (r[0]+1)) #print a1 p1=str(str(a1).rstrip('\n')).split(' ') #print p1 join_cost_index_end[save[0]]=p1 #print join_cost_index_end gen = (float(line.partition(' ')[0]) for line in x2) r= min(enumerate(gen), key=lambda x: abs(x[1] - float(save[3]))) #print r[0] a2=linecache.getline(str(str(p).replace('.pm','.mcep')), (r[0]+1)) #print a2 p2=str(str(a2).rstrip('\n')).split(' ') #print p2 join_cost_index_strt[save[0]]=p2 #print join_cost_index_strt j=j+1 #print j #print join_cost_index_end #print join_cost_index_strt enter code here here my database_index has about 2,50,000 entries`

    Read the article

  • Finding specific words in a file (Python language)

    - by Caroline Yi
    I have to write a program in python where the user is given a menu with four different "word games". There is a file called dictionary.txt and one of the games requires the user to input a) the number of letters in a word and b) a letter to exclude from the words being searched in the dictionary (dictionary.txt has the whole dictionary). Then the program prints the words that follow the user's requirements. My question is how on earth do I open the file and search for words with a certain length in that file. I only have a basic code which only asks the user for inputs. I'm am very new at this please help :( this is what I have up to the first option. The others are fine and I know how to break the loop but this specific one is really giving me trouble. I have tried everything and I just keep getting errors. Honestly, I only took this class because someone said it would be fun. It is, but recently I've really been falling behind and I have no idea what to do now. This is an intro level course so please be nice I've never done this before until now :( print print "Choose Which Game You Want to Play" print "a) Find words with only one vowel and excluding a specific letter." print "b) Find words containing all but one of a set of letters." print "c) Find words containing a specific character string." print "d) Find words containing state abbreviations." print "e) Find US state capitals that start with months." print "q) Quit." print choice = raw_input("Enter a choice: ") choice = choice.lower() print choice while choice != "q": if choice == "a": #wordlen = word length user is looking for.s wordlen = raw_input("Please enter the word length you are looking for: ") wordlen = int(wordlen) print wordlen #letterex = letter user wishes to exclude. letterex = raw_input("Please enter the letter you'd like to exclude: ") letterex = letterex.lower() print letterex

    Read the article

  • How can I print from my lion mac mini to my windows XP, with simple file sharing?

    - by Jules
    I have quite a complicated setup, perhaps. And a lot of history on this issue, I'm hoping that I don't have to buy a new printer. I've got a HP Wireless USB Print Server, which requires client software, I can't just use it as an IP Printer. The HP software is pretty poor on the mac and is no longer supported and often locks up the printer server and takes some considerable effort to actually print something. Let alone if a windows machine attaches to it first. My printer is an Epson Stylus R285. However, the windows client software is fine and we can print from windows 7 / XP without problem. We have simple file sharing setup as this is the only way I could get windows XP to talk to windows 7. However, I can't seem to get my mac mini to connect as anything other than a guest to my xp machine, to connect to the shared printer. I'm not considering some kind of internet printing as this would seems the simplest solution. But I'm not sure what will work with my setup ?

    Read the article

  • Print over the internet from a remote linux session locally (on a Windows 7 machine) to the shared printers?

    - by obeliksz
    I'm trying to use a linux virtual machine as a file server for windows clients. I have successfully implemented remote file sharing (samba+ssh) with which I am able to print locally with a little program that I made for this purpose (jetforms style)... but I would like to hear about a somewhat more direct approach. How can I attach the printers to the server, so that I can for example open a file on the remote session and in the print dialogbox I would see my local printers (on the machine from which I have established a remote session)? I guess there should be some kind of putty tunneling, but dont know how. I have a windows 7 machine locally; there is a CentOS 6 VM over the internet. It has ssh, cups, and samba. I have found a question which asks the opposite: there is a windows based server to connect form linux but that windows has a domain, mine is just a simple windows workstation that is behind NAT and has a dynamic IP. That question is: Print from Linux to Windows networked printer.

    Read the article

  • generate parent child relation from the array to print a multi-level menu?

    - by Karthick Selvam
    How to get parent child relation from this array to print a multi-level menu $menus = array ( 0 => array ( 'id'=>0, 'check' => 1, 'display' =>'Arete Home', 'ordering' => -10, 'parent' => none, ), 1 => array ( 'id'=>1, 'check' => 1, 'display' => 'Submit Paper', 'ordering' => -10, 'parent' => 2, 'subordering' => -10, ), 2 => array ( 'id'=>2, 'check' => 1, 'display' => 'Buy Now', 'ordering' => -10, 'parent' => 1, 'subordering' => -10, ), 1461 => array ( 'id'=>1461, 'check' => 1, 'display' => 'Where are We?', 'ordering' => -10, 'parent' => 2, 'subordering' => -10, ), 1463 => array ( 'id'=>1463, 'check' => 1, 'display' =>' About Me?', 'ordering' => -10, 'parent' => 2, 'subordering' => -10, ), 1464 => array ( 'id'=>1464, 'check' => 1, 'display' => 'About You?', 'ordering' => -10, 'parent' => 2, 'subordering' => -10, ), 1465 => array ( 'id'=>1465, 'check' => 1, 'display' => 'About who?', 'ordering' => -10, 'parent' => 1, 'subordering' => -10, ), ); code sample: foreach($menus as $id=>$values) { $values['parent']=isset($values['parent']) ? $values['parent'] : 0; $menus[$values['parent']]['childs'][$id]=$values; unset($menus[$id]); } foreach($menus as $id1=>$value2) { $value2['parent']=isset($value2['parent']) ? $value2['parent'] : 0; $menus[$value2['parent']]['childs'][$id1]=$value2; unset($menus[$id1]); }

    Read the article

  • SQL SERVER – Puzzle to Win Print Book – Functions FIRST_VALUE and LAST_VALUE with OVER clause and ORDER BY

    - by pinaldave
    Some time an interesting feature and smart audience makes total difference at places. From last two days, I have been writing on SQL Server 2012 feature FIRST_VALUE and LAST_VALUE. Please read following post before I continue today as this question is based on the same. Introduction to FIRST_VALUE and LAST_VALUE Introduction to FIRST_VALUE and LAST_VALUE with OVER clause As a comment of the second post I received excellent question from Nilesh Molankar. He asks what will happen if we change few things in the T-SQL. I really like this question as this kind of questions will make us sharp and help us perform in critical situation in need. We recently publish SQL Server Interview Questions book. I promise that in future version of this book, we will for sure include this question. Instead of repeating his question, I am going to ask something very similar to his question. Let us first run following query (read yesterday’s blog post for more detail): USE AdventureWorks GO SELECT s.SalesOrderID,s.SalesOrderDetailID,s.OrderQty, FIRST_VALUE(SalesOrderDetailID) OVER (PARTITION BY SalesOrderID ORDER BY SalesOrderDetailID ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FstValue, LAST_VALUE(SalesOrderDetailID) OVER (PARTITION BY SalesOrderID ORDER BY SalesOrderDetailID ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) LstValue FROM Sales.SalesOrderDetail s WHERE SalesOrderID IN (43670, 43669, 43667, 43663) ORDER BY s.SalesOrderID,s.SalesOrderDetailID,s.OrderQty GO Here is the resultset of the above query. Now let us change the ORDER BY clause of OVER clause in above query and see what is the new result. USE AdventureWorks GO SELECT s.SalesOrderID,s.SalesOrderDetailID,s.OrderQty, FIRST_VALUE(SalesOrderDetailID) OVER (PARTITION BY SalesOrderID ORDER BY OrderQty ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FstValue, LAST_VALUE(SalesOrderDetailID) OVER (PARTITION BY SalesOrderID ORDER BY OrderQty ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) LstValue FROM Sales.SalesOrderDetail s WHERE SalesOrderID IN (43670, 43669, 43667, 43663) ORDER BY s.SalesOrderID,s.SalesOrderDetailID,s.OrderQty GO Now let us see the result and ready for interesting question: Puzzle You can see that row number 2, 3, 4, and 5 has same SalesOrderID = 43667. The FIRST_VALUE is 78 and LAST_VALUE is 77. Now if these function was working on maximum and minimum value they should have given answer as 77 and 80 respectively instead of 78 and 77. Also the value of FIRST_VALUE is greater than LAST_VALUE 77. Why? Explain in detail. Hint Let me give you a simple hint. Just for simplicity I have changed the order of columns selected in the SELECT and ORDER BY (at the end). This will not change resultset but just order of the columns as well order of the rows. However, the data remains the same. USE AdventureWorks GO SELECT s.OrderQty,s.SalesOrderID,s.SalesOrderDetailID, FIRST_VALUE(SalesOrderDetailID) OVER (PARTITION BY SalesOrderID ORDER BY OrderQty ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FstValue, LAST_VALUE(SalesOrderDetailID) OVER (PARTITION BY SalesOrderID ORDER BY OrderQty ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) LstValue FROM Sales.SalesOrderDetail s WHERE SalesOrderID IN (43670, 43669, 43667, 43663) ORDER BY s.OrderQty,s.SalesOrderID,s.SalesOrderDetailID GO Above query returns following result: Now I am very sure all of you have figured out the solution. Here is the second hint – pay attention to row 2, 3, 4, and 10. Hint2 T-SQL Enhancements: FIRST_VALUE() and LAST_VALUE() MSDN: FIRST_VALUE and LAST_VALUE Rules Leave a comment with your detailed answer by Nov 15′s blog post. Open world-wide (where Amazon ships books) If you blog about puzzle’s solution and if you win, you win additional surprise gift as well. Prizes Print copy of my new book SQL Server Interview Questions Amazon|Flipkart If you already have this book, you can opt for any of my other books SQL Wait Stats [Amazon|Flipkart|Kindle] and SQL Programming [Amazon|Flipkart|Kindle]. Reference: Pinal Dave (http://blog.SQLAuthority.com) Filed under: Pinal Dave, PostADay, SQL, SQL Authority, SQL Function, SQL Query, SQL Scripts, SQL Server, SQL Tips and Tricks, T SQL, Technology

    Read the article

  • How can I process an image in .NET for a full-page print with a quality like Windows Photo Gallery d

    - by Triynko
    I'm writing a printing routing in C#, using the .NET PrintDocument class, handling the OnPrintPage event. I've managed to maximize the margins and print the Image in landscape mode, but it simply does not look as good as when I print the same image file from Windows Photo Gallery (formerly Windows Picture and Fax Viewer), the default image preview program in Windows Vista. I noticed an option there for selecting "Sharpen Image for Printing", but what does that do? I've thought about printing copies of the image from Windows Photo Gallery first, then sending the sheets through the printer a second time to print the custom overlays I need, but it's hard to make it line up every time, since the printer sucks the sheet in without the kind of precision I need... so I really need to do ALL the drawing commands within C#, including the image. Does anyone know how to perform pre-processing on the bitmap so that it prints as nicely as Windows Photo Gallery does it? Are there any simple print drivers that can intercept Photo Gallery printing output as a standard image file (bmp, png, etc.) that can be read by the .NET Image class? I'm all for creativity here.

    Read the article

  • How do I print an HTML document from a web service?

    - by Chris Marasti-Georg
    I want to print HTML from a C# web service. The Web Browser control is overkill, and does not function well in a service-environment, nor does it function well on a system with very tight security constraints. Is there any sort of free .NET library that will support the printing of a basic HTML page? Here is the code I have so far, that is not running properly. public void PrintThing(string document) { if (Thread.CurrentThread.GetApartmentState() != ApartmentState.STA) { Thread thread = new Thread((ThreadStart) delegate { PrintDocument(document); }); thread.SetApartmentState(ApartmentState.STA); thread.Start(); } else { PrintDocument(document); } } protected void PrintDocument(string document) { WebBrowser browser = new WebBrowser(); browser.DocumentText = document; while (browser.ReadyState != WebBrowserReadyState.Complete) { Application.DoEvents(); } browser.Print(); } This works fine when called from UI-type threads, but nothing happens when called from a service-type thread. Changing Print() to ShowPrintPreviewDialog() yields the following IE script error: Error: 'dialogArguments.___IE_PrintType' is null or not an object URL: res://ieframe.dll/preview.dlg And a small empty print preview dialog appears.

    Read the article

  • Printing is not working in tomcat, when i start server with services.msc(From client side we could not print )

    - by maya
    I am using JasperReports 1.3.1 to print the report. I am sing eclipse and tomcat for development purpose. In eclipse, when i run the application, the below code will show the listed printer devices and print button. If i click the print button, the report is printing by selected device. PrintRequestAttributeSet printRequestAttributeSet = new HashPrintRequestAttributeSet(); printRequestAttributeSet.add(MediaSizeName.ISO_A5); PrintServiceAttributeSet printServiceAttributeSet = new HashPrintServiceAttributeSet(); JRPrintServiceExporter exporter = new JRPrintServiceExporter(); exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint); exporter.setParameter(JRPrintServiceExporterParameter.PRINT_REQUEST_ATTRIBUTE_SET, printRequestAttributeSet); exporter.setParameter(JRPrintServiceExporterParameter.PRINT_SERVICE_ATTRIBUTE_SET, printServiceAttributeSet); exporter.setParameter(JRPrintServiceExporterParameter.DISPLAY_PAGE_DIALOG, Boolean.FALSE); exporter.setParameter(JRPrintServiceExporterParameter.DISPLAY_PRINT_DIALOG, Boolean.TRUE); exporter.exportReport(); Here I am passing jasperPrint as a parameter which i manually construted.Its working good My problem is: I created war file and pasted in tomcat Apache Software Foundation\Tomcat 6.0\webapps directory and started the tomcat by using services.msc. At this point, its not displaying the listed printer details and also not printing. I put some logger, I found that, the code is hanging with exporter.exportReport(); after this line code is not executing . Please suggest me for how to print from client side using jasper

    Read the article

  • How do I get column names to print in this C# program?

    - by Kevin
    I've cobbled together a C# program that takes a .csv file and writes it to a datatable. Using this program, I can loop through each row of the data table and print out the information contained in the row. The console output looks like this: --- Row --- Item: 1 Item: 545 Item: 507 Item: 484 Item: 501 I'd like to print the column name beside each value, as well, so that it looks like this: --- Row --- Item: 1 Hour Item: 545 Day1 KW Item: 507 Day2 KW Item: 484 Day3 KW Item: 501 Day4 KW Can someone look at my code and tell me what I can add so that the column names will print? I am very new to C#, so please forgive me if I've overlooked something. Here is my code: // Write load_forecast data to datatable. DataTable loadDT = new DataTable(); StreamReader sr = new StreamReader(@"c:\load_forecast.csv"); string[] headers = sr.ReadLine().Split(','); foreach (string header in headers) { loadDT.Columns.Add(header); // I've added the column headers here. } while (sr.Peek() > 0) { DataRow loadDR = loadDT.NewRow(); loadDR.ItemArray = sr.ReadLine().Split(','); loadDT.Rows.Add(loadDR); } foreach (DataRow row in loadDT.Rows) { Console.WriteLine("--- Row ---"); foreach (var item in row.ItemArray) { Console.Write("Item:"); Console.WriteLine(item); // Can I add something here to also print the column names? } }

    Read the article

  • How can I improve the performance of this double-for print?

    - by Florenc
    I have the following static method that prints the data imported from a 40.000 lines .xls spreadsheet. Now, it takes about 27 seconds to print the data in the console and the memory consumption is huge. import org.apache.poi.hssf.usermodel.*; import org.apache.poi.ss.usermodel.*; public static void printSheetData(List<List<HSSFCell>> sheetData) { for (int i = 0; i < sheetData.size(); i++) { List<HSSFCell> list = (List<HSSFCell>) sheetData.get(i); for (int j = 0; j < list.size(); j++) { HSSFCell cell = (HSSFCell) list.get(j); System.out.print(cell.toString()); if (j < list.size() - 1) { System.out.print(", "); } } System.out.println(""); } } Disclaimer: I know, I know large data belong to a database, don't print output in the console, premature optimization is the root of all evils...

    Read the article

  • Why do R objects not print in a function or a "for" loop?

    - by Sal Leggio
    I have an R matrix named ddd. When I enter this, everything works fine: i <- 1 shapiro.test(ddd[,y]) ad.test(ddd[,y]) stem(ddd[,y]) print(y) The calls to Shapiro Wilk, Anderson Darling, and stem all work, and extract the same column. If I put this code in a "for" loop, the calls to Shapiro Wilk, and Anderson Darling stop working, while the the stem & leaf call and the print call continue to work. for (y in 7:10) { shapiro.test(ddd[,y]) ad.test(ddd[,y]) stem(ddd[,y]) print(y) } The decimal point is 1 digit(s) to the right of the | 0 | 0 0 | 899999 1 | 0 [1] 7 The same thing happens if I try and write a function. SW & AD do not work. The other calls do. > D <- function (y) { + shapiro.test(ddd[,y]) + ad.test(ddd[,y]) + stem(ddd[,y]) + print(y) } > D(9) The decimal point is at the | 9 | 000 9 | 10 | 00000 [1] 9 Why don't all the calls behave the same way?

    Read the article

  • What is the proper syntax for getting a Makefile to print the output directory of one of its output zip files?

    - by 9exceptionThrower9
    I'm trying to edit an Android Makefile in the hopes of getting it to print out the directory (path) location of one the ZIP files it creates. Ideally, since the build process is long and does many things, I would like for it print out the pathway to the ZIP file to a text file in a different directory I can access later: Pseudo-code idea: # print the desired pathway to output file print(getDirectoryOf(variable-name.zip)) > ~/Desktop/location_of_file.txt The Makefile snippet where I would like to insert this new bit of code is shown below. I am interested in finding the directory of $(name).zip (that is specific file I want to locate): # ----------------------------------------------------------------- # A zip of the directories that map to the target filesystem. # This zip can be used to create an OTA package or filesystem image # as a post-build step. # name := $(TARGET_PRODUCT) ifeq ($(TARGET_BUILD_TYPE),debug) name := $(name)_debug endif name := $(name)-target_files-$(FILE_NAME_TAG) intermediates := $(call intermediates-dir-for,PACKAGING,target_files) BUILT_TARGET_FILES_PACKAGE := $(intermediates)/$(name).zip $(BUILT_TARGET_FILES_PACKAGE): intermediates := $(intermediates) $(BUILT_TARGET_FILES_PACKAGE): \ zip_root := $(intermediates)/$(name) # $(1): Directory to copy # $(2): Location to copy it to # The "ls -A" is to prevent "acp s/* d" from failing if s is empty. define package_files-copy-root if [ -d "$(strip $(1))" -a "$$(ls -A $(1))" ]; then \ mkdir -p $(2) && \ $(ACP) -rd $(strip $(1))/* $(2); \ fi endef

    Read the article

  • How can I print a batch of files with custom printer settings?

    - by Li-aung Yip
    I have a collection of A3-size (tabloid size) PDF drawings which I would like to print as a batch. The particular printer I am using doesn't automatically check the paper size of the document - it always defaults to A4 (letter) size paper unless told otherwise. I need to go into the printer settings and tell the printer to use A3 size paper. A batch printing utility like DarkStorm's Batch Print Handler would be good for this. However this particular utility doesn't support changing the paper size settings or other printer settings. How can I go about batch printing these PDFs with a particular paper size?

    Read the article

  • bad printer isolation on print server or better way?

    - by Joseph
    I have noticed that when a printer or driver screws up on a Windows server it usually locks up or kills the print spooler and everyone can't print until it is fixed. Usually we have to put the troublesome printer on another server so when it fails, it doesn't take the whole group with it. That is assuming we ever figure out which printer is the problem. Is there a way to have it so that one bad apple doesn't ruin the bunch? Even if it is another form of printer serving, that would work as long as it's not hard for the user to find a printer and install drivers.

    Read the article

  • When my printer fails to print with only "printer error" as the message, how can I find details?

    - by lavinio
    Setup: Dell Latitude D620 in the docking station HP color laserjet 2550L Parallel cable Sometimes when I undock (and I do suspend before undocking and docking), when I reattach, the printer will not print. It simply says "error", with no description. Killing and restarting the spooler will not help, but rebooting will. There is nothing in the system event logs, nor does the print spooler window provide any details other than "error" My question is, when there is an error, is there any way to find out what is causing it to get stuck, so that I can "unstuck" it instead of rebooting?

    Read the article

  • Network printer - Print direct or via shared printer on Server?

    - by NickC
    It has occurred to me that a workstation can connect to a printer in two ways: 1). Printing directly to the IP of the printer with the print driver installed locally. 2). Printing to a \Server\Printer1 share with the print queue residing on the server. Question is which way is preferred? I would assume that printing directly to a network printer rather than going through the server would be the most efficient from the point of view of network traffic. On the other hand I guess a server printer share would be easier to manage with the correct driver automatically being downloaded to the workstations. Also what about using GPP (Server2012) to install this printer on the workstations, does that require any specific way?

    Read the article

  • How can I pretty print erb in BBedit indenting rails tags and not just markup?

    - by Andres Diez
    I want to re-indent my code but the rails tags <% foo %> get aligned to the left with no indentation. What I'm using is: markup utilities format pretty print Does anyone know if there is a way to reconfigure this behavior? UPDATE: I just found this out but cant seem to get it working: "The 'Pretty print' option for Markup - Utilities - Format is now implemented internally using a Dreamweaver-style source format profile. This affords slightly prettier output than was possible before. Advanced users can override the factory format profile by placing an appropriately constructed file at ~/Library/Application Support/BBEdit/SourceFormat.profile." I opened the bbedit app package, found the file, copied it to the folder indicated in "application support" and tweaked the desired indentation width just as a test before touching anything else, and it doesnt seem to do anything.

    Read the article

  • How to make PDF pages with U3D images print properly?

    - by David Thornley
    I'm creating some PDF files that have three-dimensional images (U3D) in them. When I bring them up in Acrobat, everything is fine until I try to print the file. If I've viewed a page, it prints fine, showing the U3D image as I last saw it. If I haven't viewed a page yet, the printout is blank. (I can demonstrate this right from the Print dialog, by previewing pages.) The only reference I've seen to printing U3D is in the PDF Standard, which says, basically, that this should work. It recommends "PV" or "PO" for the A key in the 3D activation dictionary, and I'm using libharu which uses "PV".

    Read the article

  • On OS X, how do I print (a web-page) directly into my Google Docs account?

    - by Peter Mounce
    Is it possible to, from the OS X 10.6 print dialog, print the web-page directly into my Google Documents account? I can save as PDF and upload it, but, well, I want to cut out the middleman (ie, me; I make too many mistakes...). I tend to use Chrome to browse the web in case that's relevant. Are there Google Docs upload-helpers in general? I tried gdocuploaded (an Adobe AIR App) but it refused to so much as launch.

    Read the article

  • Nagios plugin script not working as expected

    - by Linker3000
    I have modified an off-the-shelf Nagios plugin perl script to (in theory) return a one or zero according to the existence, or not, of a file on a remote linux server. The script runs a remote ssh session and logs in as the nagios user. The remote linux servers have private keys setup for that user, and on the bash command line the script works as expected, but when run as a plugin it always returns '1' (true) even if the file does not exist. Some help with the logic or a comment on why things are not working as expected within Nagios would be appreciated. I'd prefer to use this ssh login method rather than having to install nrpe on all the linux servers. To run from a command line (assuming remote server has a user called nagios with a valid private key): ./check_reboot_required -e ssh -H remote-servers-ip-addr -p 'filename-to-check' -v Ta. #! /usr/bin/perl -w # # # License Information: # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # ############################################################################ use POSIX; use strict; use Getopt::Long; use lib "/usr/lib/nagios/plugins" ; use vars qw($host $opt_V $opt_h $opt_v $verbose $PROGNAME $pattern $opt_p $mmin $opt_e $opt_t $opt_H $status $state $msg $msg_q $MAILQ $SHELL $device $used $avail $percent $fs $blocks $CMD $RMTOS); use utils qw(%ERRORS &print_revision &support &usage ); sub print_help (); sub print_usage (); sub process_arguments (); $ENV{'PATH'}=''; $ENV{'BASH_ENV'}=''; $ENV{'ENV'}=''; $PROGNAME = "check_reboot_required"; Getopt::Long::Configure('bundling'); $status = process_arguments(); if ($status){ print "ERROR: processing arguments\n"; exit $ERRORS{'UNKNOWN'}; } $SIG{'ALRM'} = sub { print ("ERROR: timed out waiting for $CMD on $host\n"); exit $ERRORS{'WARNING'}; }; $host = $opt_H; $pattern = $opt_p; print "Pattern >" . $pattern . "< " if $verbose; alarm($opt_t); #$CMD = "/usr/bin/find " . $pattern . " -type f 2>/dev/null| /usr/bin/wc -l"; $CMD = "[ -f " . $pattern . " ] && echo 1 || echo 0"; alarm($opt_t); ## get cmd output from remote system if (! open (OUTPUT, "$SHELL $host $CMD|" ) ) { print "ERROR: could not open $CMD on $host\n"; exit $ERRORS{'UNKNOWN'}; } my $perfdata = ""; my $state = "3"; my $msg = "Indeterminate result"; # only first line is relevant in this iteration. while (<OUTPUT>) { my $result = chomp($_); $msg = $result; print "Shell returned >" . $result . "< length is " . length($result) . " " if $verbose; if ( $result == 1 ) { $msg = "Reboot required (NB: Result still not accurate)" . $result ; $state = $ERRORS{'WARNING'}; last; } elsif ( $result == 0 ) { $msg = "No reboot required (NB: Result still not accurate) " . $result ; $state = $ERRORS{'OK'}; last; } else { $msg = "Output received, but it was neither a 1 nor a 0" ; last; } } close (OUTPUT); print "$msg | $perfdata\n"; exit $state; ##################################### #### subs sub process_arguments(){ GetOptions ("V" => \$opt_V, "version" => \$opt_V, "v" => \$opt_v, "verbose" => \$opt_v, "h" => \$opt_h, "help" => \$opt_h, "e=s" => \$opt_e, "shell=s" => \$opt_e, "p=s" => \$opt_p, "pattern=s" => \$opt_p, "t=i" => \$opt_t, "timeout=i" => \$opt_t, "H=s" => \$opt_H, "hostname=s" => \$opt_H ); if ($opt_V) { print_revision($PROGNAME,'$Revision: 1.0 $ '); exit $ERRORS{'OK'}; } if ($opt_h) { print_help(); exit $ERRORS{'OK'}; } if (defined $opt_v ){ $verbose = $opt_v; } if (defined $opt_e ){ if ( $opt_e eq "ssh" ) { if (-x "/usr/local/bin/ssh") { $SHELL = "/usr/local/bin/ssh"; } elsif ( -x "/usr/bin/ssh" ) { $SHELL = "/usr/bin/ssh"; } else { print_usage(); exit $ERRORS{'UNKNOWN'}; } } elsif ( $opt_e eq "rsh" ) { $SHELL = "/usr/bin/rsh"; } else { print_usage(); exit $ERRORS{'UNKNOWN'}; } } else { print_usage(); exit $ERRORS{'UNKNOWN'}; } unless (defined $opt_t) { $opt_t = $utils::TIMEOUT ; # default timeout } unless (defined $opt_H) { print_usage(); exit $ERRORS{'UNKNOWN'}; } return $ERRORS{'OK'}; } sub print_usage () { print "Usage: $PROGNAME -e <shell> -H <hostname> -p <directory/file pattern> [-t <timeout>] [-v verbose]\n"; } sub print_help () { print_revision($PROGNAME,'$Revision: 0.1 $'); print "\n"; print_usage(); print "\n"; print " Checks for the presence of a 'reboot-required' file on a remote host via SSH or RSH\n"; print "-e (--shell) = ssh or rsh (required)\n"; print "-H (--hostname) = remote server name (required)"; print "-p (--pattern) = File pattern for find command (default = /var/run/reboot-required)\n"; print "-t (--timeout) = Plugin timeout in seconds (default = $utils::TIMEOUT)\n"; print "-h (--help)\n"; print "-V (--version)\n"; print "-v (--verbose) = debugging output\n"; print "\n\n"; support(); }

    Read the article

< Previous Page | 33 34 35 36 37 38 39 40 41 42 43 44  | Next Page >