line

Replace a particular line in a text file using php?

陌路散爱 提交于 2019-12-25 02:07:42
问题 I have a text file that stores lastname, first name, address, state, etc as a string with a | delimiter and each record on a separate line. I have the part where I need to store each record on a new line and its working fine; however, now I need to be able to go back and update the name or address on a particular line and I can't get it to work. This how to replace a particular line in a text file using php? helped me here but I am not quite there yet. This overwrites the whole file and I

use awk to process a csv (tab delimited) line by line

こ雲淡風輕ζ 提交于 2019-12-25 01:34:55
问题 sorry if this is impossible to do with AWK, but this is something I can think of with AWK. I have a CSV file (tab delimited) that has about 10 columns with a big header section. The content is like this: col1 col2 col3 col4 col5 col6 col7 col8 col9 col10 I don't need to filter by col1-9, but only need to look at col10 line by line. The content in each row of col10 is like this int1/int2: int3,int4: int5: int6 My filtering condition is: if int3 + int4 >= 30 , I'll print it out to a new csv

JTable returning null for Graphics?

≡放荡痞女 提交于 2019-12-25 01:33:22
问题 I'm trying to draw lines over my JTable using a Painter object that I've made, but for some reason table.getGraphics() returns null. Painter class: import java.awt.BasicStroke; import java.awt.Graphics; import java.awt.Graphics2D; import javax.swing.JTable; public class Painter extends JTable { public Painter(){ } public void paintSudokuLines(Graphics g){ paintComponent(g); } public void paintComponent(Graphics g){ super.paintComponent(g); Graphics2D g2 = (Graphics2D) g; g2.setStroke(new

Drawing a line in excel using apache-poi

坚强是说给别人听的谎言 提交于 2019-12-24 16:45:51
问题 Can anybody write me a few lines of code showing how to write a line in a cell in excel, using apache poi ?! In plain Excel, I would go to Insert - Shapes - Line. Basicaly, make code like this: Workbook wb = new HSSFWorkbook(); Sheet sheet = wb.createSheet(); Row row=sheet.createRow(0); Cell cell = row.createCell(0); now, missing code would go here. As i searched the net, I should be using Class HSSFSimpleShape and OBJECT_TYPE_LINE. But i dont know how to implement it in my code :( I guess I

Click on line in canvas

浪子不回头ぞ 提交于 2019-12-24 14:33:05
问题 Is it possible get info, if is click on line in canvas? var canvas; var x = 200; var y = 200; var dx=4; var dy=4; var d = 5; var width, height; function init() { canvasE = document.getElementById('game'); canvas= canvasE.getContext('2d'); width = canvasE.width; height = canvasE.height; canvasE.addEventListener("click", onClick, false); drawCircle(); } function drawCircle() { clear(); canvas.arc(x-1,y-1,d,0,Math.PI*2,true); canvas.beginPath(); canvas.arc(x-1,y-1,d,0,Math.PI*2,true); canvas

C# - Need help creating program that simulates Prime Number behavior by drawing lines

六月ゝ 毕业季﹏ 提交于 2019-12-24 12:17:24
问题 I challenged myself to create a program to experiment with Prime Numbers, I already have an idea how to do it, but not the coding skills.. My plan is this: First ill create a program in C# that makes straight lines that follow some rules: rule 1: all lines have the same length. rule 2: all lines are either horizontal or vertical (no diagonals). rule 3: Every new line begins where the previous line has ended (that way all the lines are joined). Now for the tricky part: I would like to make a

Allowing new line characters in javascript regex

假如想象 提交于 2019-12-24 10:55:46
问题 I am using live validation on my site (from livevalidation.com), I have a text area where I need to allow new line / line feed / return characters, but despite my best efforts I am failing miserably. I have tried \n \r \v \s\S each with \ escape and without. This is my code without the use of the above chars: my_notes.add( Validate.Format, { pattern: /^[a-zA-Z0-9ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæçèéêëìíîïñòóôõöøùúûüýÿ\.\,\-\/\']+[a-zA-Z0

JTextPane line break

最后都变了- 提交于 2019-12-24 07:13:23
问题 In this question, the inquirer says The JTextPane do have word wrap when text exceeded width This does not seem to be the case. scrollPane = new JScrollPane(); scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); this.contentPane.add(scrollPane); txtrFghj = new JTextPane(); txtrFghj.setBorder(null); txtrFghj.setContentType("text/html"); txtrFghj.setText(content); scrollPane.setViewportView(txtrFghj); In the given code excerpt, content 's content will not

Draw lines on a picturebox using mouse clicks in C#

强颜欢笑 提交于 2019-12-24 07:07:50
问题 I'm trying to make a program that will draw lines over a picturebox using mouse clicks for the locations of where the line is to be drawn from and to. This is my current code: public partial class Form1 : Form { int Drawshape; private Point p1, p2; List<Point> p1List = new List<Point>(); List<Point> p2List = new List<Point>(); public Form1() { InitializeComponent(); pictureBox1.Image = new Bitmap(pictureBox1.Width, pictureBox1.Height); } private void button1_Click(object sender, EventArgs e)

4 imageViews in the center like 2 lines * 2 rows for all devices

这一生的挚爱 提交于 2019-12-24 04:25:26
问题 i'm trying to put 4 imageViews like they was in 2 lines * 2 rows: I did this: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/accueil"> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/font" android:src="@drawable/fond_menu" android:scaleType="centerCrop"