我听说过一些东西,并看到了一些使用ASP.NET/PHP构建的Web应用程序的例子,我想知道在Java世界中做类似事情的等效方法是什么.在维基百科上看,我发现了很多框架,我很困惑哪一个是最好的.
我正在研究我的论文,我正在努力将2个图像彼此相邻放置,以便第二个图像沿着第一个图像垂直居中.我也试图使用subfigure
而不是subfloat
但它们都不起作用.
这是它看起来如何alt文本http://img51.imageshack.us/img51/1174/screenshot20100224at712.png
我的代码是:
\begin{figure}[H]
\centering \subfloat[H][sparse($\mathbf{A}$)]{\includegraphics[width=0.28\textwidth]{sparsesmall} \label{sparse}}
\subfloat[H][full($\mathbf{A}$)]{\includegraphics[width=0.55\textwidth]{fullsmall}\label{full}}
\caption{Representation of $\mathbf{A}$ in MATLAB}
\label{schematic}
\end{figure}
Run Code Online (Sandbox Code Playgroud)
有什么建议让它看起来比现在好吗?谢谢
我正在从书中做一个简单的练习,我对java函数parseInt的工作原理有点困惑.我从输入文件中读取了一行,使用StringTokenizer将其拆分,现在我想将每个部分解析为整数.
我在监视窗口中检查了parseInt函数的输入确实是一个看似有效整数的字符串(例如"35").但是,当我尝试str.charAt
在str
保持值为"35"的变量上使用该函数时,我得到了奇怪的结果:
str.charAt(0) == ""
str.charAt(1) == "3"
str.charAt(2) == ""
str.charAt(3) == "5"
Run Code Online (Sandbox Code Playgroud)
这似乎是一个可能与编码有关的问题,因此我尝试使用这种方式读取文件来修复它:
InputStreamReader reader = new InputStreamReader(new FileInputStream(inputfile), "UTF-8");
Run Code Online (Sandbox Code Playgroud)
(我在编辑器中使用UTF-8编码明确保存了文件),但这没有用.任何想法可能是什么问题以及如何解决它?
编辑:我的样本
InputStreamReader reader = new InputStreamReader(new FileInputStream(inputfile), "UTF-8");
BufferedReader bfreader = new BufferedReader(reader);
line = bfreader.readLine();
while (line !=null)
{
String[] valueStrings = line.split(" ");
String hole = valueStrings[0];
int[] values = new int[4];
for (int i = 0; i <values.length; i++){
String nr = valueStrings[i+1].trim();
values [i] = Integer.parseInt(nr);
}
// it …
Run Code Online (Sandbox Code Playgroud) java ×2
encoding ×1
file-io ×1
formatting ×1
frameworks ×1
image ×1
inputstream ×1
latex ×1
parsing ×1