我正在编写一些简单的代码来解析文件并返回行数,但是eclipse中的小红框不会消失所以我假设我触发了一个无限循环.我正在阅读的文本文件只有10行......这是代码:我做错了什么?
import java.io.*;
import java.util.Scanner;
public class TestParse {
private int noLines = 0;
public static void main (String[]args) throws IOException {
Scanner defaultFR = new Scanner (new FileReader ("C:\\workspace\\Recommender\\src\\IMDBTop10.txt"));
TestParse demo = new TestParse();
demo.nLines (defaultFR);
int x = demo.getNoLines ();
System.out.println (x);
}
public TestParse() throws IOException
{
noLines = 0;
}
public void nLines (Scanner s) {
try {
while (s.hasNextLine ())
noLines++;
}
finally {
if (s!=null) s.close ();
}
}
public int getNoLines () { …Run Code Online (Sandbox Code Playgroud) body{
background:#fff url('images/testProfile.jpg') no-repeat right top;
}
Run Code Online (Sandbox Code Playgroud)
我认为这段代码应该有效,所以请提出有用的调试步骤...例如如何以极端的方式调整图像属性和位置......
一个人给出一些信用来获得问题答案的想法似乎很简单但是当应用于数百万用户的整个网络时,每个用户都有不同的声誉,似乎必须应用一些严格的检查和平衡.这个东西所基于的数学框架是什么?
delta = self.cost_derivative(activations[-1], y) * \
sigmoid_prime_vec(zs[-1])
Run Code Online (Sandbox Code Playgroud)
我不清楚高级别的内容* \以及之前的缩进sigmoid_prime_vec是什么意思.它只是跨越多行的乘法吗?
对于我的迷你论坛,我有一个"主题"表,其中包含字段id(int),title(txt)和post(txt),我试图让用户根据他们通过topicPage.php点击的主题来查看不同的页面:
<?
//send a query to retrieve all titles from the topics database
$query = "SELECT * FROM topics" ;
$result = mysql_query($query) or die ("something went wrong with this query");
?>
<span class="subtext"> <?
while($row = mysql_fetch_array($result))
{
echo "<a href = 'topicPage.php?tid=$row['id']'>" .$row['title']. " </a>"." <br>" ." <br>";
}
?>
Run Code Online (Sandbox Code Playgroud)
我在echo函数的行上得到一个解析错误.
这是确切的错误:
解析错误:语法错误,意外T_ENCAPSED_AND_WHITESPACE,在第85行的/index.php中期待T_STRING或T_VARIABLE或T_NUM_STRING