space

CSS: how to add white space before element's content?

十年热恋 提交于 2019-11-30 10:18:18
问题 None of the following code works : p:before { content: " "; } p:before { content: " "; } How do I add white space before element's content ? Note: I need to color the border-left and the margin-left for semantic use and use the space as colorless margin. :) 回答1: You can use the unicode of a non breaking space : p:before { content: "\00a0 "; } See JSfiddle demo [style improved by @Jason Sperske] 回答2: Don't fart around with inserting spaces. For one, older versions of IE won't know what you're

The X angle between two 3D vectors?

帅比萌擦擦* 提交于 2019-11-30 10:03:48
I have two 3D vectors called A and B that both only have a 3D position. I know how to find the angle along the unit circle ranging from 0-360 degrees with the atan2 function by doing: EDIT: (my atan2 function made no sense, now it should find the "y-angle" between 2 vectors): toDegrees(atan2(A.x-B.x,A.z-B.z))+180 But that gives me the Y angle between the 2 vectors. I need to find the X angle between them. It has to do with using the x, y and z position values. Not the x and z only, because that gives the Y angle between the two vectors. I need the X angle, I know it sounds vague but I don't

How to handle space of Filename in Batch For Loop

人走茶凉 提交于 2019-11-30 09:42:04
问题 @echo off echo processing please wait... setlocal enabledelayedexpansion set txtfile=%~dp0mysql\my.ini.bak set newfile=%~dp0mysql\my.ini if exist "%newfile%" del /f /q "%newfile%" for /f "tokens=*" %%a in (%txtfile%) do ( set newline=%%a echo !newline! >> %newfile% ) Now my.ini.bak file is in D:\Program Files\my.ini.bak Error : The system cannot find the file Files\mysql\my.ini.bak. How to make this code work, so it copy each line from my.ini.bak to my.ini 回答1: I don't think you need to quote

How to add spaces between number and word in a string in Java?

时间秒杀一切 提交于 2019-11-30 09:05:41
问题 i have a lot of string which contains also number like : LOD140IXAL COMP 1X240GG I would like to put whitespace between numbers and word if there isn't. the number could be every where in the string. 回答1: One way to do this is using regular expressions. Replacing the following monster with a single space should do the trick: "(?<=[A-Za-z])(?=[0-9])|(?<=[0-9])(?=[A-Za-z])" When applied to your example ( LOD140IXAL COMP 1X240GG ), it produces LODIXAL COMP 1 X 240 MG . In a nutshell, the regex

bash: read line and keep spaces

我怕爱的太早我们不能终老 提交于 2019-11-30 09:02:50
问题 I am trying to read lines from a file containing multiple lines. I want to identify lines that contain only spaces. By definition, an empty line is empty and does not contain anything (including spaces). I want to detect lines that seems to be empty but they are not (lines that contain spaces only) while read line; do if [[ `echo "$line" | wc -w` == 0 && `echo "$line" | wc -c` > 1 ]]; then echo "Fake empty line detected" fi done < "$1" But because read ignores spaces in the start and in the

vb.net How to pass a string with spaces to the command line

谁都会走 提交于 2019-11-30 06:01:32
问题 I am trying to call an external program using Process: Dim strExe As String = "E:\Projects\Common Files\mktorrent.exe" Dim p As New Process Dim pinfo As New ProcessStartInfo pinfo.UseShellExecute = False pinfo.RedirectStandardOutput = True pinfo.Arguments = " -a http://blah.com/announce.php -l " & FileSizeMarker & " " & fn pinfo.FileName = strExe pinfo.WorkingDirectory = fn.Substring(0, fn.LastIndexOf("\")) pinfo.WindowStyle = ProcessWindowStyle.Normal pinfo.CreateNoWindow = True p.StartInfo

Java 内存溢出(java.lang.OutOfMemoryError)的常见情况和处理方式总结

淺唱寂寞╮ 提交于 2019-11-30 05:55:47
java.lang.OutOfMemoryError这个错误我相信大部分开发人员都有遇到过,产生该错误的原因大都出于以下原因:JVM内存过小、程序不严密,产生了过多的垃圾。 导致OutOfMemoryError异常的常见原因有以下几种: 内存中加载的数据量过于庞大,如一次从数据库取出过多数据; 集合类中有对对象的引用,使用完后未清空,使得JVM不能回收; 代码中存在死循环或循环产生过多重复的对象实体; 使用的第三方软件中的BUG; 启动参数内存值设定的过小; 此错误常见的错误提示: tomcat:java.lang.OutOfMemoryError: PermGen space tomcat:java.lang.OutOfMemoryError: Java heap space weblogic:Root cause of ServletException java.lang.OutOfMemoryError resin:java.lang.OutOfMemoryError java:java.lang.OutOfMemoryError 解决java.lang.OutOfMemoryError的方法有如下几种: 一、增加jvm的内存大小。方法有: 1)在执行某个class文件时候,可以使用java -Xmx256M aa.class来设置运行aa

Java内存溢出详解+Tomcat配置文件中JVM的启动参数设置

笑着哭i 提交于 2019-11-30 05:47:21
一、常见的Java内存溢出有以下三种: 1. java.lang.OutOfMemoryError: Java heap space ----JVM Heap(堆)溢出 JVM在启动的时候会自动设置JVM Heap的值,其初始空间(即-Xms)是物理内存的1/64,最大空间(-Xmx)不可超过物理内存。 可以利用JVM提供的-Xmn -Xms -Xmx等选项可进行设置。Heap的大小是Young Generation 和Tenured Generaion 之和。 在JVM中如果98%的时间是用于GC,且可用的Heap size 不足2%的时候将抛出此异常信息。 解决方法:手动设置JVM Heap(堆)的大小。 2. java.lang.OutOfMemoryError: PermGen space ---- PermGen space溢出。 PermGen space的全称是Permanent Generation space,是指内存的永久保存区域。 为什么会内存溢出,这是由于这块内存主要是被JVM存放Class和Meta信 息的,Class在被Load的时候被放入PermGen space区域,它和存放Instance的Heap区域不同,sun的 GC不会在主程序运行期对PermGen space进行清理,所以如果你的APP会载入很多CLASS的话,就很可能出现PermGen

What is the difference between   and  ?

偶尔善良 提交于 2019-11-30 00:26:28
问题 I have written one XSLT to transform xml to html. If input xml node contains only space then it inserts the space using following code. <xsl:text> </xsl:text> There is another numeric character which also does same thing as shown below. <xsl:text> </xsl:text> Is there any difference between these characters? Are there any examples where one of these will work and other will not? Which one is recommended to add space? Thanks, Sambhaji 回答1:   is a non-breaking space (   ).   is just the same,

Spaces in java execute path for OS X

扶醉桌前 提交于 2019-11-29 18:31:12
问题 On OS X, I am trying to .exec something, but when a path contains a space, it doesn't work. I've tried surrounding the path with quotes, escaping the space, and even using \u0020. For example, this works: Runtime.getRuntime().exec("open /foldername/toast.sh"); But if there's a space, none of these work: Runtime.getRuntime().exec("open /folder name/toast.sh"); Runtime.getRuntime().exec("open \"/folder name/toast.sh\""); Runtime.getRuntime().exec("open /folder\\ name/toast.sh"); Runtime