Search Results

Search found 8384 results on 336 pages for 'lines'.

Page 14/336 | < Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >

  • Python script to remove lines from file containing words in array

    - by chromesub
    I have the following script which identifies lines in a file which I want to remove, based on an array but does not remove them. What should I change? sourcefile = "C:\\Python25\\PC_New.txt" filename2 = "C:\\Python25\\PC_reduced.txt" offending = ["Exception","Integer","RuntimeException"] def fixup( filename ): print "fixup ", filename fin = open( filename ) fout = open( filename2 , "w") for line in fin.readlines(): for item in offending: print "got one",line line = line.replace( item, "MUST DELETE" ) line=line.strip() fout.write(line) fin.close() fout.close() fixup(sourcefile)

    Read the article

  • Make openGL lines connected

    - by user146780
    Right now I'v created a polygon, then I do the same thing but with line_loop to draw the outline. My issue right now is if I set the line thickness to high, the lines arn't connected. Their ends would need to be (linewidth) longer... is there a way to fix this? Thanks

    Read the article

  • opengl, Black lines in-between tiles

    - by MiJyn
    When its translated in an integral value (1,2,3, etc....), there are no black lines in-between the tiles, it looks fine. But when it's translated to a non-integral (1.1, 1.5, 1.67), there are small blackish lines between each tile (I'm imagining that it's due to subpixel rendering, right?) ... and it doesn't look pretty =P So... what should I do? This is my image-loading code, by the way: bool Image::load_opengl() { this->id = 0; glGenTextures(1, &this->id); this->bind(); // Parameters... TODO: Should we change this? glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, this->size.x, this->size.y, 0, GL_BGRA, GL_UNSIGNED_BYTE, (void*) FreeImage_GetBits(this->data)); this->unbind(); return true; } I've also tried using: glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); and: glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); Here is my image drawing code: void Image::draw(Pos pos, CROP crop, SCALE scale) { if (!this->loaded || this->id == 0) { return; } // Start position & size Pos s_p; Pos s_s; // End size Pos e_s; if (crop.active) { s_p = crop.pos / this->size; s_s = crop.size / this->size; //debug("%f %f", s_s.x, s_s.y); s_s = s_s + s_p; s_s.clamp(1); //debug("%f %f", s_s.x, s_s.y); } else { s_s = 1; } if (scale.active) { e_s = scale.size; } else if (crop.active) { e_s = crop.size; } else { e_s = this->size; } // FIXME: Is this okay? s_p.y = 1 - s_p.y; s_s.y = 1 - s_s.y; // TODO: Make this use VAO/VBO's!! glPushMatrix(); glTranslate(pos.x, pos.y, 0); this->bind(); glBegin(GL_QUADS); glTexCoord2(s_p.x, s_p.y); glVertex2(0, 0); glTexCoord2(s_s.x, s_p.y); glVertex2(e_s.x, 0); glTexCoord2(s_s.x, s_s.y); glVertex2(e_s.x, e_s.y); glTexCoord2(s_p.x, s_s.y); glVertex2(0, e_s.y); glEnd(); this->unbind(); glPopMatrix(); } OpenGL Initialization code: void game__gl_init() { glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluOrtho2D(0.0, config.window.size.x, config.window.size.y, 0.0); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glDisable(GL_DEPTH_TEST); glEnable(GL_BLEND); glEnable(GL_TEXTURE_2D); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); } Screenshots of the issue:

    Read the article

  • Perl: Deleting multiple re-occuring lines where a certain criteria is met

    - by george-lule
    Dear all, I have data that looks like below, the actual file is thousands of lines long. Event_time Cease_time Object_of_reference -------------------------- -------------------------- ---------------------------------------------------------------------------------- Apr 5 2010 5:54PM NULL SubNetwork=ONRM_RootMo,SubNetwork=AXE,ManagedElement=BSJN1,BssFunction= BSS_ManagedFunction,BtsSiteMgr=LUGALAMBO_900 Apr 5 2010 5:55PM Apr 5 2010 6:43PM SubNetwork=ONRM_RootMo,SubNetwork=AXE,ManagedElement=BSJN1,BssFunction= BSS_ManagedFunction,BtsSiteMgr=LUGALAMBO_900 Apr 5 2010 5:58PM NULL SubNetwork=ONRM_RootMo,SubNetwork=AXE,ManagedElement=BSCC1,BssFunction= BSS_ManagedFunction,BtsSiteMgr=BULAGA Apr 5 2010 5:58PM Apr 5 2010 6:01PM SubNetwork=ONRM_RootMo,SubNetwork=AXE,ManagedElement=BSCC1,BssFunction= BSS_ManagedFunction,BtsSiteMgr=BULAGA Apr 5 2010 6:01PM NULL SubNetwork=ONRM_RootMo,SubNetwork=AXE,ManagedElement=BSCC1,BssFunction= BSS_ManagedFunction,BtsSiteMgr=BULAGA Apr 5 2010 6:03PM NULL SubNetwork=ONRM_RootMo,SubNetwork=AXE,ManagedElement=BSJN1,BssFunction= BSS_ManagedFunction,BtsSiteMgr=KAPKWAI_900 Apr 5 2010 6:03PM Apr 5 2010 6:04PM SubNetwork=ONRM_RootMo,SubNetwork=AXE,ManagedElement=BSJN1,BssFunction= BSS_ManagedFunction,BtsSiteMgr=KAPKWAI_900 Apr 5 2010 6:04PM NULL SubNetwork=ONRM_RootMo,SubNetwork=AXE,ManagedElement=BSJN1,BssFunction= BSS_ManagedFunction,BtsSiteMgr=KAPKWAI_900 Apr 5 2010 6:03PM Apr 5 2010 6:03PM SubNetwork=ONRM_RootMo,SubNetwork=AXE,ManagedElement=BSCC1,BssFunction= BSS_ManagedFunction,BtsSiteMgr=BULAGA Apr 5 2010 6:03PM NULL SubNetwork=ONRM_RootMo,SubNetwork=AXE,ManagedElement=BSCC1,BssFunction= BSS_ManagedFunction,BtsSiteMgr=BULAGA Apr 5 2010 6:03PM Apr 5 2010 7:01PM SubNetwork=ONRM_RootMo,SubNetwork=AXE,ManagedElement=BSCC1,BssFunction= BSS_ManagedFunction,BtsSiteMgr=BULAGA As you can see, each file has a header which describes what the various fields stand for(event start time, event cease time, affected element). The header is followed by a number of dashes. My issue is that, in the data, you see a number of entries where the cease time is NULL i.e event is still active. All such entries must go i.e for each element where the alarm cease time is NULL, the start time, the cease time(in this case NULL) and the actual element must be deleted from the file. In the remaining data, all the text starting from word SubNetwork upto BtsSiteMgr= must also go. Along with the headers and the dashes. Final output should look like below: Apr 5 2010 5:55PM Apr 5 2010 6:43PM LUGALAMBO_900 Apr 5 2010 5:58PM Apr 5 2010 6:01PM BULAGA Apr 5 2010 6:03PM Apr 5 2010 6:04PM KAPKWAI_900 Apr 5 2010 6:03PM Apr 5 2010 6:03PM BULAGA Apr 5 2010 6:03PM Apr 5 2010 7:01PM BULAGA Below is a Perl script that I have written. It has taken care of the headers, the dashes, the NULL entries but I have failed to delete the lines following the NULL entries so as to produce the above output. #!/usr/bin/perl use strict; use warnings; $^I=".bak" #Backup the file before messing it up. open (DATAIN,"<george_perl.txt")|| die("can't open datafile: $!"); # Read in the data open (DATAOUT,">gen_results.txt")|| die("can't open datafile: $!"); #Prepare for the writing while (<DATAIN>) { s/Event_time//g; s/Cease_time//g; s/Object_of_reference//g; s/\-//g; #Preceding 4 statements are for cleaning out the headers my $theline=$_; if ($theline =~ /NULL/){ next; next if $theline =~ /SubN/; } else{ print DATAOUT $theline; } } close DATAIN; close DATAOUT; Kindly help point out any modifications I need to make on the script to make it produce the necessary output. Will be very glad for your help Kind regards George.

    Read the article

  • Looping to provide multiple lines in linechart (django-googlecharts)

    - by mighty_bombero
    Hi, I'm trying to generate some charts using django-googlecharts. This works fine for rather static data but in one case I would like to render a different number of lines, based on a variable. I tried this: {% chart %} {% for line in line_data %} {% chart-data line %} {% endfor %} {% chart-size "390x200" %} {% chart-type "line" %} {% chart-labels days %} {% endchart %} Line data is a list containing lists. The template code fails with "Caught an exception while rendering: max() arg is an empty sequence". I guess the problem is that I try to loop over templatetags. What approach could be used here? Or am I completely missing something? Is this doable using inclusion tags? Thanks for your help.

    Read the article

  • IPhone Plain TableView Section Header Image and Getting Text on Two Lines

    - by jp
    Hello, this is my first question, so if I didn't do the tags correctly, I'm sorry. I tried... Well here is my question: I am hoping someone can tell me how to do a 2-line section header for a plain tableview. The problems I am having are: 1) I cannot find an image that will mimic that of the default 1-line section header. Can someone share one with me, or tell me how I can find one? 2) I cannot seem to get the section header text on two lines, since I am pulling it from the fetched results controller, a "field" (sorry if wrong terminology) that I custom defined on the class for my table. So this "field" has multiple field values in it, and I have no way to take them apart... Any help would be appreciated.

    Read the article

  • How to define a function in ghci across multiple lines

    - by Peter McGrattan
    I'm trying to define any simple function that spans multiple lines in ghci, take the following as an example: let abs n | n >= 0 = n | otherwise = -n So far I've tried pressing Enter after the first line: Prelude> let abs n | n >= 0 = n Prelude> | otherwise = -n <interactive>:1:0: parse error on input `|' I've also attempted to use the :{ and :} commands but I don't get far: Prelude> :{ unknown command ':{' use :? for help. I'm using GHC Interactive version 6.6 for Haskell 98 on Linux, what am I missing?

    Read the article

  • Crontab: cut line to many lines?

    - by Heoa
    Hard-to-read-line @daily export sunshine="~/logs/Sunshine-`date '+\%F'`" && export sunshineUrl="http://www.sunshine.net/main/search_results.asp?currency_id=1&min_price=&max_price=50000&country_id=241&region_id=&Submit=Search" && mkdir -p $sunshine && cd $sunshine && wget --mirror -l 1 $sunshineUrl Which mark do I need to have it on many lines? @daily <SOME MARK HERE> export sunshine="~/logs/Sunshine-`date '+\%F'`" && <SOME MARK HERE> export sunshineUrl="http://www.sunshine.net/main/search_results.asp?currency_id=1&min_price=&max_price=50000&country_id=241&region_id=&Submit=Search" && <SOME MARK HERE> mkdir -p $sunshine && <SOME MARK HERE> cd $sunshine && wget --mirror -l 1 $sunshineUrl No success by appending \, //, \n or /n.

    Read the article

  • javascript - shorten string to fit into a certain # of lines

    - by Mala
    Hi I have a string that must fit into a box, and must be at most 3 lines long. To shorten it, I plan to truncate it and end it with '...'. I could shorten it to a certain # of characters but if i make it look good with "wwwwwwwww [...] wwww" it won't look right with "iiiiiiiiiii [...] iiii". Is there some way I can shorten it by how much space the string would take up, as opposed to how many characters there are in a string without using a fixed-width font? Mala ps. Please no "simply create an image of '...' and overlay it over the end of the line" hacks or similar - I actually want to shorten the string to the appropriate length

    Read the article

  • javascript/php - shorten string to fit into a certain # of lines

    - by Mala
    Hi I have a string that must fit into a box, and must be at most 3 lines long. To shorten it, I plan to truncate it and end it with '...'. I could shorten it to a certain # of characters but if i make it look good with "wwwwwwwww [...] wwww" it won't look right with "iiiiiiiiiii [...] iiii". Is there some way I can shorten it by how much space the string would take up, as opposed to how many characters there are in a string without using a fixed-width font? Ideally I'd like to do this server-side (php) but recognize that actual character width stuff is far more likely to be feasible client-side (JS / jQuery) Mala ps. Please no "simply create an image of '...' and overlay it over the end of the line" hacks or similar - I actually want to shorten the string to the appropriate length

    Read the article

  • flex chart grid lines dotted

    - by Jonny
    Using the LineChart component of Flex: How do I make the horizontal grid lines (background within the chart) dotted? With the mx:Stroke within the mx:horizontalStroke, I can only set properties like weight, color and alpha. I'd like to make the line dotted... This is what I have now: <mx:LineChart id="linechartDays" width="100%" height="100%" dataProvider="{dayData}" showDataTips="true"> <mx:backgroundElements> <mx:GridLines horizontalChangeCount="1" direction="horizontal"> <mx:horizontalStroke> <mx:Stroke weight="1" color="0xcccccc"/> </mx:horizontalStroke> </mx:GridLines> </mx:backgroundElements> </mx:LineChart>

    Read the article

  • Reduce lines of code

    - by coffeeaddict
    I'm not a JavaScript guru (yet). I am trying to figure out a way to cut down the number of lines below...are there any shortcuts for lets say the if statements? function showDialog(divID) { var dialogDiv = $("#" + divID); var height = 500; var width = 400; var resizable = false; if (dialogDiv.attr("height") != "") { height = parseInt(dialogDiv.attr("height")); } if (dialogDiv.attr("width") != "") { width = parseInt(dialogDiv.attr("width")); } if (dialogDiv.attr("resizable") != "") { resizable = dialogDiv.attr("resizable"); } dialogDiv.dialog ( { resizable: resizable, width: width, height: height, bgiframe: true, modal: true, autoOpen: false, show: 'blind' } ) dialogDiv.dialog("open"); }

    Read the article

  • assembler - understanding of some lines

    - by user1571682
    with the help of some tutorials, i wrote a little piece of code, to display me a string, after booting from my floppy. my problem is now, that dont understand some lines, were i hope u can help me, or just tell me, if im right. code: mov ax, 07C0h add ax, 288 ; (512 + 4096) / 16 = 288 mov ss, ax mov sp, 4096 mov ax, 07C0h mov ds, ax line: start the program @ the adress 07C0h (could i change this?) Add space for 288 paragraphs to ax ? Space of 4096 bytes for my program (to store variables and stuff?) Go to the start adress ? thanks for your help.

    Read the article

  • Combining multiple lines into one line

    - by mkal
    I have this use case of an xml file with input like Input: <abc a="1"> <val>0.25</val> </abc> <abc a="2"> <val>0.25</val> </abc> <abc a="3"> <val>0.35</val> </abc> ... Output: <abc a="1"><val>0.25</val></abc> <abc a="2"><val>0.25</val></abc> <abc a="3"><val>0.35</val></abc> I have around 200K lines in a file in the Input format, how can I quickly convert this into output format.

    Read the article

  • PHP class constant string variable spanning over multiple lines

    - by ebae
    I want to have a string variable for a PHP class, which would be available to all methods. However, this variable is quite long, so I want to separate it into multiple lines. For example, $variable = "line 1" . "line 2" . "line 3"; But above doesn't work. I tried EOD, but EOD is not allowed within class. And when I declare it outside the class, I can't access the variable from within the class. What is the best way?

    Read the article

  • Number of lines in csv.DictReader

    - by Alan Harris-Reid
    Hi there, I have a csv DictReader object (using Python 3.1), but I would like to know the number of lines/rows contained in the reader before I iterate through it. Something like as follows... myreader = csv.DictReader(open('myFile.csv', newline='')) totalrows = ? rowcount = 0 for row in myreader: rowcount +=1 print("Row %d/%d" % (rowcount,totalrows)) I know I could get the total by iterating through the reader, but then I couldn't run the 'for' loop. I could iterate through a copy of the reader, but I cannot find how to copy an iterator. I could also use totalrows = len(open('myFile.csv').readlines()) but that seems an unnecessary re-opening of the file. I would rather get the count from the DictReader if possible. Any help would be appreciated. Alan

    Read the article

  • Dynamically creating a TreeViewin HTML with indent lines in ASP.NET

    - by Ben
    Hi, i'm quite new to HTML, and am trying to create a professional looking TreeView. I can not use the in built TreeView in ASP.NET as i need to point the target of the selection to another frame (I have tried, and this doesn't seem possible). My TreeView is built up as follows: Folder1 ChildOne ChildTwo ChildThree Folder2 ChildOne ChildTwo ChildThree I have the collapsing of the folders working, but would like to know how to format this TreeView so it has dotted lines down to the child nodes (as most TreeViews tend to have). How would i go about this? Cheers.

    Read the article

  • Regex - Ignore lines with matching text

    - by codem
    I need the RegEx command to get all the lines which DO NOT have the job name containing "filewatch". Any help will be greatly appreciated! Thanks. STATUS: FAILURE JOB: i3-imds-dcp-pd-bo1-05-ftpfilewatcher STATUS: FAILURE JOB: i3-cur-atmrec-pd-TD_FTP_Forecast_File_Del_M_Su ALARM: JOBFAILURE JOB: i3-cur-atmrec-pd-TD_FTP_Forecast_File_Del_M_Su STATUS: FAILURE JOB: i3-sss-system-heartbeat ALARM: JOBFAILURE JOB: i3-sss-system-heartbeat STATUS: FAILURE JOB: i3-chq-cspo-pd-batch-daily-renametable-fileok STATUS: FAILURE JOB: i3-chq-cspo-pd-batch-daily-renametable-file ALARM: JOBFAILURE JOB: i3-chq-cspo-pd-batch-daily-renametable-fileok ALARM: JOBFAILURE JOB: i3-chq-cspo-pd-batch-daily-renametable-file STATUS: FAILURE JOB: i3-imds-dcp-pd-bo1-35-filewatcher STATUS: FAILURE JOB: i3-imds-dcp-pd-bo1-05-ftpfilewatcher STATUS: FAILURE JOB: i3-imds-dcp-pd-bo1-35-filewatcher STATUS: FAILURE JOB: i3-imds-dcp-pd-bo1-05-ftpfilewatcher

    Read the article

  • camera preview on androd - strange lines on 1.5 version of sdk

    - by Marko
    Hi all, I am developing the camera module for an android application. In main application when user clicks on 'take picture' button, new view with SurfaceView control is opened and camera preview is shown. When users click on dpad center, camera takes picture and save it to the disc. Pretty simple and straightforward. Everything works fine on my device - HTC Tattoo, minsdkversion 1.6 ...but when I tested application on HTC Hero minsdkversion 1.5, when camera preview is shown,some strange lines occur. Anyone has idea what is going on? p.s. altough preview is crashed, taking of pictures works fine here is the picture: Thanx Marko

    Read the article

  • preg_match , regexp , php , ignore white spaces and new lines

    - by Michael
    I'm trying to extract richard123 using php preg_replace but there are a lot of white spaces and new lines and I think because of that my regexp doesn't work . The html can be seen here : http://pastebin.com/embed_iframe.php?i=vuD3z9ij My current preg_match is : $find = "/< tr bgcolor=\"F0F0F0\" valign=\"middle\">< td align=\"left\">< font size=\"-1\">(.*)<\/font><\/td>/"; preg_match_all($find, $res, $matches2); print_r($matches2); I also tried <\/td/s"; <\/td/m"; <\/td/x"; but doesn't work either .

    Read the article

  • Dynamically creating a treeview in HTML with indent lines in ASP.Net

    - by Ben
    Hi, im quite new to HTML, and am trying to create a proffessional looking TreeView. I can not use the in built treeview in ASP.Net as i need to point the target of the selection to another frame (I have tried, and this doesn't seem possible). My treeview is built up as follows: Folder1 ChildOne ChildTwo ChildThree Folder2 ChildOne ChildTwo ChildThree I have the collapsing of the folders working, but would like to know how to format this treeview so it has dotted lines down to the child nodes (as most treeviews tend to have). How would i go about this? Cheers.

    Read the article

  • Count the number of lines in a Java String

    - by Simon Guo
    Need some compact code for counting the number of lines in a string in Java. The string is to be separated by \r or \n. Each instance of those newline characters will be considered as a separate line. For example, "Hello\nWorld\nThis\nIs\t" should return 4. The prototype is private static int countLines(String str) {...} Can someone provide a compact set of statements? I have solution at here but it is too long, I think. Thank you.

    Read the article

  • printing long compilation lines with MS NMAKE

    - by Elazar Leibovich
    I have a legacy MS NMAKE Makefile I need to fix a few bugs in. There are some very long command lines I wish to debug that are being executed using the NMAKE trick of "inline files": dep: cmd @<<tmpfilename cmd_args.. << When changing the line to dep: echo cmd @<<tmpfilename cmd_args.. << NMAKE complains that the line is too long. Is there any other trick I can apply in order to view the command line NMAKE is actually executing?

    Read the article

< Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >