Search Results

Search found 2199 results on 88 pages for 'printing'.

Page 66/88 | < Previous Page | 62 63 64 65 66 67 68 69 70 71 72 73  | Next Page >

  • Python script shows different pythonpath

    - by Bird Jaguar IV
    Attempting to run runsnake gives ImportError: No module named wx Opening an ipython or python session seems to work fine: >>> import wx >>> import sys >>> print [p for p in sys.path if 'wx' in p] ['/usr/local/lib/wxPython-2.9.4.0/lib/python2.7/site-packages', '/usr/local/lib/wxPython-2.9.4.0/lib/python2.7/site-packages/wx-2.9.4-osx_cocoa', '/usr/local/lib/wxPython-2.9.4.0/lib/python2.7/site-packages/wx-2.9.1-osx_cocoa/tools'] as does putting that code in a script and calling python script.py. But putting that code at the beginning of runsnake.py prints an empty list (printing the whole sys.path prints a path quite different from my $PYTHONPATH). Why would it be different, and how to I get it to recognize wxPython?

    Read the article

  • Adobe Acrobat API - How to skip opening password protected PDFs?

    - by Ryan
    Hi all, I've been using Delphi and the Adobe Acrobat 9 API. I'm simply opening a PDF and printing it, followed by closing it without saving anything. I'm having an issue while opening some PDFs though. If the PDF is password protected the Open method displays Adobe's "Input password" prompt. My application is running in an automated fashion, and therefor cannot proceed beyond this password prompt until somebody clicks cancel. I've been looking for something that will either notify me that the file is password protected prior to opening it, or a parameter or something that will skip password protected files. I need my program to assume it cannot open any passworded PDF. Does anyone know enough about the Acrobat API to provide any assistance here? Thank you, Ryan

    Read the article

  • Catching errors in ANTLR and finding parent

    - by Andreas
    I have found out that I can catch errors during parsing by overwriting displayRecognitionError, but how do I find the parent "node" of this error? ex. if I have the grammar: prog: stat expr; stat: STRING; expr: INTEGER; And give it the input "abc def". Then I will get an error at "def" which should be an integer. At this point I then want to get the parent which is "expr" (since it fails inside the INTEGER part) and it's parent "prog". Kind of like printing stack trace in java. I tried to look at the node from RecognitionException parsed to displayRecognitionError, but it is null, and using CommonErrorNode the parent is null. Should I maybe take a completely different approach?

    Read the article

  • MonoDevelop seems to hang (not unresponsive) when building csprojs

    - by Michael Shimmins
    Building a solution from Visual Studio in mono develop seems to have some issues. I'm hoping someone else has experienced this and has some suggestions. The actual dcms process goes pretty quickly, but in between projects it hangs after printing: Building: XXX.YYY.ZZZ (Debug) After a few minutes (been 10 so far on this current run), it jumps to: Performing main compilation... /Library/Frameworks/Mono.framework/Versions/2.10.1/bin/dmcs /noconfig "/... Build complete -- 0 errors, 0 warnings Building: XXX.YYY.ZZZ (Debug) Then hangs again for another few minutes. This is a sln file with 29 csproj projects in it that was originally created in Visual Studio 2010. I'm wondering if there is a better way to set this up - potentially a native MD file format?

    Read the article

  • Why do i get segfault at the end of the application after everything's been done properly ?

    - by VaioIsBorn
    #include <string.h> #include <stdlib.h> #include <stdio.h> int main(void) { unsigned char *stole; unsigned char pass[] = "m4ak47"; printf("Vnesi password: \t"); scanf("%s", stole); if(strncmp(stole, pass, sizeof(pass)) != 0) { printf("wrong password!\n"); exit(0); } else printf("Password correct\n"); printf("some stuf here...\n\n"); return 0; } This program is working nice, but with one problem - if the password is correct then it DOES do the printing of 'some stuf here...' but it also shows me segmentation fault error at the end. Why ?

    Read the article

  • <thead> and <tfoot> in Safari

    - by AJ
    I trying to print a page with multiple tables. The problem is that any of these tables may break and carry over to the next page. Have been trying to get the table header to repeat on the second page. Am currently using thead and setting the display property to table-header-group. This works just as expected in IE and firefox but the header will not repeat in Safari. Since we are using software that converts our page to a pdf document for printing...and the 3rd party software uses a Safari engine, we are stuck with this problem. Does anyone know a way / workaround to make headers repeat if the table spans multiple pages in Safari?

    Read the article

  • Which is more efficient/faster when calling a cached image?

    - by andufo
    Hi, i made an image resizer in php. When an image is resized, it caches a new jpg file with the new dimensions. Next time you call the exact img.php?file=hello.jpg&size=400 it checks if the new jpg has already been created. If it has NOT been created yet, it creates the file and then prints the output (cool). If it ALREADY exists, no new file needs to be generated and instead, it just calls the already cached file. My question is regarding the second scenario. Which of these is faster? redirecting: header('Location: cache/hello_400.jpg');die(); grabbing data and printing the cached file: $data = file_get_contents('cache/hello_400.jpg'); header('Content-type: '.$mime); header('Content-Length: '.strlen($data)); echo $data; Any other ways to improve this?

    Read the article

  • How can I tell Phusion Passenger which python to use?

    - by Mike
    I'm using Phusion Passenger with a ruby app and I'd also like to set it up to work with an django appengine app I'm working on. Googling for "passenger_wsgi.py" I was able to get the following very simple non-django app working on passenger: passenger_wsgi.py: def application(environ, start_response): response_headers = [('Content-type','text/plain')] start_response('200 OK', response_headers) return ['Hello World!\n'] However, if I add the line import django.core.handlers.wsgi into the mix, I get 'An error occurred importing your passenger_wsgi.py'. By printing out the sys.path I've discovered that at least part of the reason is because Passenger is using the wrong python installation on my machine. How can I configure Passenger (on apache) to use /opt/local/bin/python2.5 instead of the system default python?

    Read the article

  • Forcing positive sign on double in .Net String.Format

    - by Max Yaffe
    Context: .Net, C# I want to print a complex number made from two doubles. The sign needs to show on the imaginary part. I'd like to use the default double formatting for each part to minimize the number of characters. I tried using String.Format("{0:+G;-G}{1:+G;-G}j", real, imaginary) but this ended up printing: "+G-Gj". Not quite what I wanted. Is there any way to do this using the G specifier or do I need to do a custom format which would sacrifice auto-switching the exponent, e.g. {1:+#.######e###;-#.######e###}j"

    Read the article

  • How to manage changes to reports in .NET?

    - by Craig Johnston
    If I need to offer the ability to create, view and print reports from a .NET app, I see that there are 2 options: use a reporting component such as Microsoft.Reporting.WinForms.ReportViewer or Crystal Reports which saves a .rpt or similar template file that can be modified as required without having to re-compile the app use System.Drawing.Printing for reporting and store report template data in a database, which keeps things simpler and avoids problems with bulky third party reporting components If I want to be able to modify a report template (which would include layout and data fields) without having to re-compile the app, would the first option above achieve this? If I wanted to be able to modify the template without re-compiling the app, how could this be achieved with the second option? How could you store data representing the templates in a database such that it could be modified without having to re-compile the app?

    Read the article

  • Another floating point question

    - by jeffmax329
    I have read most of the posts on here regarding floating point, and I understand the basic underlying issue that using IEEE 754 (and just by the nature of storing numbers in binary) certain fractions cannot be represented. I am trying to figure out the following: If both Python and JavaScript use the IEEE 754 standard, why is it that executing the following in Python .1 + .1 Results in 0.20000000000000001 (which is to be expected) Where as in Javascript (in at least Chrome and Firefox) the answer is .2 However performing .1 + .2 In both languages results in 0.30000000000000004 In addition, executing var a = 0.3; in JavaScript and printing a results in 0.3 Where as doing a = 0.3 in Python results in 0.29999999999999999 I would like to understand the reason for this difference in behavior. In addition, many of the posts on OS link to a JavaScript port of Java's BigDecimal, but the link is dead. Does anyone have a copy?

    Read the article

  • How do I get all data from a mysql table via php, and print out the contents of every cell ?

    - by roberto
    Hi. I've got a database table with at least three rows in it. From php, I have successfully connected to my db and extracted all table information with 'SELECT * from mytable' . Now I want to loop through first each row, and then each cell, printing out the contents of each cell. I know this might be a simple task for a more experienced programmer, but I can't figure it out, and I can't find any examples online and it's driving me stark raving bonkers. How can I do this ?

    Read the article

  • Storing cvs data for further manipulation using Ruby

    - by ischnura
    I am dealing with a csv file that has some customer information (email, name, address, amount, [shopping_list: item 1, item 2]). I would like work with the data and produce some labels for printing... as well as to gather some extra information (total amounts, total items 1...) My main concern is to find the appropriate structure to store the data in ruby for future manipulation. For now I have thought about the following possibilities: multidimensional arrays: pretty simple to build, but pretty hard to access the data in a beautiful ruby way. hashes: having the email as key, and storing the information in different hashes (one hash for name, another hash for address, another hash for shopping list...) (getting the cvs data in to a Database and working with the data from ruby??) I would really appreciate your advice and guidance!!

    Read the article

  • printf not passing correct Hex Address to stack

    - by kriss
    I have a hickup in using printf . I am on ubuntu 10.04. Basically i have a C program asking for some input and then prints it back. It is OK for printing something after inputing. I tried to insert some Hex Address to Stack by following format:- printf "hello world!\x12\x23\x34" | ./input1 But i don't know what is the problem. If i give only string beyond 12 bytes it overwrites BUT If I give hex address(through printf), it doesn't overwrite on return address. Instead it stores some other thing. Could anyone help??? I can't proceed further becoz of this. Thanks in advance

    Read the article

  • why is this dictionary line number count not working?

    - by jad
    i have this piece of code the last bit of the code starting from d = {} im trying to print the words with its line number located in the text but it is not working its only printing the words anyone know why ??? need help ASAP import sys import string text = [] infile = open(sys.argv[1], 'r').read() for punct in string.punctuation: infile = infile.replace(punct, "") text = infile.split() dict = open(sys.argv[2], 'r').read() dictset = [] dictset = dict.split() words = [] words = list(set(text) - set(dictset)) words = [text.lower() for text in words] words.sort() d = {} counter = 0 for lines in text: counter += 1 if word not in d: d[words] = [counter] else: d[words.append[counter] print(word, d)

    Read the article

  • Sending variables in URLs in PHP with echo

    - by alexpelan
    Hi all, I can't really find good guidelines through google searches of the proper way to escape variables in URLs. Basically I am printing out a bunch of results from a mysql query in a table and I want one of the entries in each row to be a link to that result's page. I think this is easy, that I'm just missing a apostrophe or backslash somewhere, but I can't figure it out. Here's the line that's causing the error: echo "<a href = \"movies.php/?movie_id='$row['movie_id']'\"> Who Owns It? </a> "; and this is the error I'm getting: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING If you could elaborate in your answers about general guidelines for working with echo and variables in urls, that would be great. Thanks.

    Read the article

  • How to call a specific, unknown Python object attribute?

    - by Michael Morisy
    I'm working to create a simple Python script that will ultimately tell you how many blog entries were posted in a given month, and the pyblog app is proving very helpful. However, when I create the blog object, I don't know how to access it's various attributes. I can print them all out by printing one item from the dictionary, as shown (in excerpts) below: print blog.get_recent_posts(1) 'post_status': 'publish', 'date_created_gmt': <DateTime '20100601T19:27:17' at 2853300>, 'mt_excerpt': '', 'userid': '288', 'dateCreated': <DateTime '20100601T14:27:17' at 2853350>, 'custom_fields': [{'value': '', 'id': '1317', 'key': 'brightcove_code'}, {'value': 'http://bit.ly/d0Rywl', 'id': '1403', But how can I just get it to provide that DateTime information?

    Read the article

  • Plugin methods are missing in Firefox 3.6

    - by splintor
    Hi, We have a plugin that we use to enable printing and saving from our app. We instantiate it using tag with all needed attributes, and then call Save() or Print() method on the document.embeds[0] object. This used to work perfectly on Firefox 3.5 and earlier, but it no longer works in Firefox 3.6. In 3.6, document.embeds[0].Save is null, that is our custom methods are not defined on this object. Any idea why this happens, and what has changed in Firefox 3.6 that causes it? Any idea on how to debug it and find the cause? And most important, any idea of a workaround that will allow us to access this methods? Thanks, splintor

    Read the article

  • Make Sphinx quiet (non-verbose)

    - by J. Pablo Fernández
    I'm using Sphinx through Thinking Sphinx in a Ruby on Rails project. When I create seed data and all the time, it's quite verbose, printing this: using config file '/Users/pupeno/projectx/config/development.sphinx.conf'... indexing index 'user_delta'... collected 7 docs, 0.0 MB collected 0 attr values sorted 0.0 Mvalues, 100.0% done sorted 0.0 Mhits, 99.6% done total 7 docs, 159 bytes total 0.042 sec, 3749.29 bytes/sec, 165.06 docs/sec Sphinx 0.9.8.1-release (r1533) Copyright (c) 2001-2008, Andrew Aksyonoff for every record that is created or so. Is there a way to suppress that output?

    Read the article

  • jQuery basics - selector

    - by rkrauter
    I feel dumb.. Why is my "header" div not being selected? It's background color is not being changed. I am learning about the + operator so I am not looking for a different selector. E + F an F element immediately preceded by an E element $("#divA + div").css("background-color", "red"); Html <div id="divA"> <div> Header</div> Lorem Ipsum is simply dummy text of the printing and typesetting industry. </div> Thanks!

    Read the article

  • How to debug Perl program sudden exits?

    - by taw
    I have Perl program based on io::async, and it sometimes just exits after a few hours/days without printing any error message whatsoever. There's nothing in dmesg or /var/log either. STDOUT/STDERR are both autoflush(1) so data shouldn't be lost in buffers. It doesn't actually exit from IO::Async::Loop->loop_forever - print I put there just to make sure of that never gets triggered. Now one way would be to keep peppering the program with more and more prints and hope one of them gives me some clue. Is there better way to get information what was going on in a program that made it exit/silently crash?

    Read the article

  • How to print absolute line number in uncaught exception?

    - by DSblizzard
    When error occured Python prints something like this: Traceback (most recent call last): File "<stdin>", line 2, in <module> File "<stdin>", line 8, in m File "<stdin>", line 5, in exec_st File "<stdin>", line 9, in exec_assign File "<stdin>", line 48, in ref_by_id IndexError: list index out of range where 2, ... , 48 are relative line numbers which are not very convenient. How to print absolute line numbers in such error messages? EDIT: Maybe it's a dumb question, but answer will facilitate development a little. I'm printing text in several files. When done, press shortcut which runs python and copies contents of current file to console. Proposed solution forces to press excess keystrokes (Ctrl+S, Alt+Tab) and create additional files. I hope I have put it clear.

    Read the article

  • variable being weirdly deleted

    - by calccrypto
    im having a weird problem with one variable: its not being recognized but its still printing. i would post my code, but it is massive. the basic idea is: # pseudocode def function(stuff): <do stuff> # These are the only 2 conditions if tag == 3: pka = <a string> if tag == 4: pka = <a string> print pka # (1) print pka # (2) <do stuff not modifying pka> print pka # (3) if pka == 'RSA': <do stuff> elif pka == 'DSA': <do stuff> my code will error at (2). however, it will print out (1), (2), and (3), all of which are the same. is there any general explanation of why this is happening? if my code is really needed, i will post it, but otherwise, i would rather not due to its size update: now the code will error at the if statement after (3), saying UnboundLocalError: local variable 'pka' referenced before assignment even though (1),(2),(3) just printed

    Read the article

  • reading a file that doesn't exist

    - by John
    Hi, I have got a small program that prints the contents of files using the system call - read. unsigned char buffer[8]; size_t offset=0; size_t bytes_read; int i; int fd = open(argv[1], O_RDONLY); do{ bytes_read = read(fd, buffer, sizeof(buffer)); printf("0x%06x : ", offset); for(i=0; i<bytes_read; ++i) { printf("%c ", buffer[i]); } printf("\n"); offset = offset + bytes_read; }while(bytes_read == sizeof(buffer)); Now while running I give a file name that doesn't exist. It prints some kind of data mixed with environment variables and a segmentation fault at the end. How is this possible? What is the program printing? Thanks, John

    Read the article

  • PHP Export Date range

    - by menormedia
    I have a working database export to xls but I need it to export a particular date range based on the 'closed' date. (See code below). For example, I'd like it to export all 'closed' dates for last month and/or this month (Range: Sept 1, 2012 to Sept 30, 2012 or Oct 1, 2012 to Oct 31, 2012) <?PHP //EDIT YOUR MySQL Connection Info: $DB_Server = "localhost"; //your MySQL Server $DB_Username = "root"; //your MySQL User Name $DB_Password = ""; //your MySQL Password $DB_DBName = "ost_helpdesk"; //your MySQL Database Name $DB_TBLName = "ost_ticket"; //your MySQL Table Name //$DB_TBLName, $DB_DBName, may also be commented out & passed to the browser //as parameters in a query string, so that this code may be easily reused for //any MySQL table or any MySQL database on your server //DEFINE SQL QUERY: //edit this to suit your needs $sql = "Select ticketID, name, company, subject, closed from $DB_TBLName ORDER BY closed DESC"; //Optional: print out title to top of Excel or Word file with Timestamp //for when file was generated: //set $Use_Titel = 1 to generate title, 0 not to use title $Use_Title = 1; //define date for title: EDIT this to create the time-format you need $now_date = DATE('m-d-Y'); //define title for .doc or .xls file: EDIT this if you want $title = "MDT Database Dump For Table $DB_TBLName from Database $DB_DBName on $now_date"; /* Leave the connection info below as it is: just edit the above. (Editing of code past this point recommended only for advanced users.) */ //create MySQL connection $Connect = @MYSQL_CONNECT($DB_Server, $DB_Username, $DB_Password) or DIE("Couldn't connect to MySQL:<br>" . MYSQL_ERROR() . "<br>" . MYSQL_ERRNO()); //select database $Db = @MYSQL_SELECT_DB($DB_DBName, $Connect) or DIE("Couldn't select database:<br>" . MYSQL_ERROR(). "<br>" . MYSQL_ERRNO()); //execute query $result = @MYSQL_QUERY($sql,$Connect) or DIE("Couldn't execute query:<br>" . MYSQL_ERROR(). "<br>" . MYSQL_ERRNO()); //if this parameter is included ($w=1), file returned will be in word format ('.doc') //if parameter is not included, file returned will be in excel format ('.xls') IF (ISSET($w) && ($w==1)) { $file_type = "msword"; $file_ending = "doc"; }ELSE { $file_type = "vnd.ms-excel"; $file_ending = "xls"; } //header info for browser: determines file type ('.doc' or '.xls') HEADER("Content-Type: application/$file_type"); HEADER("Content-Disposition: attachment; filename=MDT_DB_$now_date.$file_ending"); HEADER("Pragma: no-cache"); HEADER("Expires: 0"); /* Start of Formatting for Word or Excel */ IF (ISSET($w) && ($w==1)) //check for $w again { /* FORMATTING FOR WORD DOCUMENTS ('.doc') */ //create title with timestamp: IF ($Use_Title == 1) { ECHO("$title\n\n"); } //define separator (defines columns in excel & tabs in word) $sep = "\n"; //new line character WHILE($row = MYSQL_FETCH_ROW($result)) { //set_time_limit(60); // HaRa $schema_insert = ""; FOR($j=0; $j<mysql_num_fields($result);$j++) { //define field names $field_name = MYSQL_FIELD_NAME($result,$j); //will show name of fields $schema_insert .= "$field_name:\t"; IF(!ISSET($row[$j])) { $schema_insert .= "NULL".$sep; } ELSEIF ($row[$j] != "") { $schema_insert .= "$row[$j]".$sep; } ELSE { $schema_insert .= "".$sep; } } $schema_insert = STR_REPLACE($sep."$", "", $schema_insert); $schema_insert .= "\t"; PRINT(TRIM($schema_insert)); //end of each mysql row //creates line to separate data from each MySQL table row PRINT "\n----------------------------------------------------\n"; } }ELSE{ /* FORMATTING FOR EXCEL DOCUMENTS ('.xls') */ //create title with timestamp: IF ($Use_Title == 1) { ECHO("$title\n"); } //define separator (defines columns in excel & tabs in word) $sep = "\t"; //tabbed character //start of printing column names as names of MySQL fields FOR ($i = 0; $i < MYSQL_NUM_FIELDS($result); $i++) { ECHO MYSQL_FIELD_NAME($result,$i) . "\t"; } PRINT("\n"); //end of printing column names //start while loop to get data WHILE($row = MYSQL_FETCH_ROW($result)) { //set_time_limit(60); // HaRa $schema_insert = ""; FOR($j=0; $j<mysql_num_fields($result);$j++) { IF(!ISSET($row[$j])) $schema_insert .= "NULL".$sep; ELSEIF ($row[$j] != "") $schema_insert .= "$row[$j]".$sep; ELSE $schema_insert .= "".$sep; } $schema_insert = STR_REPLACE($sep."$", "", $schema_insert); //this corrects output in excel when table fields contain \n or \r //these two characters are now replaced with a space $schema_insert = PREG_REPLACE("/\r\n|\n\r|\n|\r/", " ", $schema_insert); $schema_insert .= "\t"; PRINT(TRIM($schema_insert)); PRINT "\n"; } } ?>

    Read the article

< Previous Page | 62 63 64 65 66 67 68 69 70 71 72 73  | Next Page >