lines

Select range of lines in Notepad++

▼魔方 西西 提交于 2019-11-28 16:14:04
问题 Is there a way to select range of lines in Notepad++? I would like to write two numbers - from and to, say: from 10000 to 25000. I've got this large MySQL dump file and I can select it only by using some function. 回答1: Easiest way: Ctrl + G , go to line 10,000. Menu > Edit > Begin/End select . Ctrl + G , go to line 25,000. Menu > Edit > Begin/End select . You now have your range selected. Or, simply right click for "Begin/End select" option. 回答2: I was trying to figure the same thing out

r - ggplot2: connecting points in polar coordinates with a straight line

不想你离开。 提交于 2019-11-28 13:54:39
I have a plot in polar coordinates. I used geom_path to connect the points, but I'd like the paths to be straight lines. Here's what I have so far: example <- data.frame(c(5,4,3),c(0.9,1.1,0.6)) colnames(example) <- c("r", "theta") myplot <- ggplot(example, aes(r, theta)) + geom_point(size=3.5) + coord_polar(theta="y", start = 3/2*pi, direction=-1) + scale_x_continuous(breaks=seq(0,max(example$r)), lim=c(0, max(example$r))) + scale_y_continuous(breaks=round(seq(0, 2*pi, by=pi/4),2), expand=c(0,0), lim=c(0,2*pi)) + geom_text(aes(label=rownames(example)), size=4.4, hjust=0.5, vjust=-1) + geom

sorting lines of an enormous file.txt in java

大城市里の小女人 提交于 2019-11-28 11:19:41
I'm working with a very big text file (755Mb). I need to sort the lines (about 1890000) and then write them back in another file. I already noticed that discussion that has a starting file really similar to mine: Sorting Lines Based on words in them as keys The problem is that i cannot store the lines in a collection in memory because I get a Java Heap Space Exception (even if i expanded it at maximum)..(already tried!) I can't either open it with excel and use the sorting feature because the file is too large and it cannot be completely loaded.. I thought about using a DB ..but i think that

Three.js buffergeometry disappears after moving camera to close

和自甴很熟 提交于 2019-11-28 09:29:11
问题 My buffergeometry disappears after moving the camera to close. You can also see that in drawcalls Three.js example that has TrackballControls . In my case it's alot worser. My points disappear at the distance from 0 to 400 and my lines disappear at the distance from 0 to 100. My objects are working fine with a simple geometry but not with a buffergeometry. I found out that it has something to do with the centroid of the buffergeometry. I tryed to use different camera's, to change the camera

How to create a Three.js 3D line series with width and thickness?

不打扰是莪最后的温柔 提交于 2019-11-28 07:41:24
Is there a way to create a Three.js 3D line series with width and thickness? Even though the Three.js line object supports linewidth, this attribute is not yet supported in all browsers on all platforms in WebGL. Here's where you set linewidth in Three.js: var material = new THREE.LineBasicMaterial({ color: 0xff0000, linewidth: 5 }); The Three.js ribbon object - which had width - has recently been dropped. The Three.js tube object generates 3D extrusions but - being Bezier-based - the lines do not pass through the control points. Can anybody think of a method of drawing a line series

Drawing multiple lines in a BufferedImage

柔情痞子 提交于 2019-11-28 07:35:14
问题 I am trying to draw horizontal and vertical lines on a bufferedimage. It should end up looking like a grid of cells. But when I run the code, I see only two lines: the leftmost line and the topmost line (ie. a line from 0,0 to 0,height of image & 0,0 to width of image,0) Heres the code snippet: BufferedImage mazeImage = new BufferedImage(imgDim.width, imgDim.height, BufferedImage.TYPE_INT_RGB); Graphics2D g2d = mazeImage.createGraphics(); g2d.setBackground(Color.WHITE); g2d.fillRect(0, 0,

remove All lines except first 20 using php

喜欢而已 提交于 2019-11-28 05:28:05
问题 how to remove every line except the first 20 using php from a text file? 回答1: For a memory efficient solution you can use $file = new SplFileObject('/path/to/file.txt', 'a+'); $file->seek(19); // zero-based, hence 19 is line 20 $file->ftruncate($file->ftell()); 回答2: If loading the entire file in memory is feasible you can do: // read the file in an array. $file = file($filename); // slice first 20 elements. $file = array_slice($file,0,20); // write back to file after joining. file_put

count (non-blank) lines-of-code in bash

旧街凉风 提交于 2019-11-28 02:42:49
In Bash, how do I count the number of non-blank lines of code in a project? cat foo.c | sed '/^\s*$/d' | wc -l And if you consider comments blank lines: cat foo.pl | sed '/^\s*#/d;/^\s*$/d' | wc -l Although, that's language dependent. #!/bin/bash find . -path './pma' -prune -o -path './blog' -prune -o -path './punbb' -prune -o -path './js/3rdparty' -prune -o -print | egrep '\.php|\.as|\.sql|\.css|\.js' | grep -v '\.svn' | xargs cat | sed '/^\s*$/d' | wc -l The above will give you the total count of lines of code (blank lines removed) for a project (current folder and all subfolders recursively

C# How to skip number of lines while reading text file using Stream Reader?

爱⌒轻易说出口 提交于 2019-11-27 21:17:43
I have a program which reads a text file and processes it to be seperated into sections. So the question is how can the program be changed to allow the program to skip reading the first 5 lines of the file while using the Stream Reader to read the file? Could someones please advise on the codes? Thanks! The Codes: class Program { static void Main(string[] args) { TextReader tr = new StreamReader(@"C:\Test\new.txt"); String SplitBy = "----------------------------------------"; // Skip first 5 lines of the text file? String fullLog = tr.ReadToEnd(); String[] sections = fullLog.Split(new string[]

Count the number of lines in a Java String

烂漫一生 提交于 2019-11-27 20:22:06
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 a solution at here but it is too long, I think. Thank you. private static int countLines(String str){ String[] lines = str.split("\r\n|\r|\n"); return lines.length; } How about this: String yourInput = "..."; Matcher m