我想要一个随机数列表的最佳压缩算法.
列表示例:
224.19
225.57
226.09
222.74
222.20
222.11
223.14
540.56
538.96
540.14
540.44
336.45
338.47
340.78
156.73
160.02
158.56
156.23
55.08
56.33
54.88
53.45
Run Code Online (Sandbox Code Playgroud)
我可以跳过小数部分.我有很多数字列表,就像上面给出的例子一样,这就是它需要被压缩的原因.
你能推荐什么吗?
// Dividend Limit check or increase the Dividend
if (dival == 10) {
writer.println("Divident has reached it Limit !");
i++;
// update the file name
String upath = "channel_" + i;
System.out.println(path);
// find channel_1 and replace with the updated path
if (path.contains("channel_1")) {
path = "D:/File Compression/Data/low_freq/low_freq/house_1/"
+ upath + ".dat";
} else {
JOptionPane.showMessageDialog(null, "Invalid File Choosen");
System.exit(0);
}
dival = 10;
} else {
dival = dival + 10;
writer.println("Dividen:" + dival);
}
Run Code Online (Sandbox Code Playgroud)
这些行采用递归方法。第一次给出正确的路径:
D:/File Compression/Data/low_freq/low_freq/house_1/channel_2.dat
Run Code Online (Sandbox Code Playgroud)
但是在第二次调用时,它将正斜杠翻转为反斜杠: …
我添加JTable
了一个JScrollPane
然后添加到面板的滚动窗格,然后添加面板到框架,但它不起作用这里是代码.我想在桌子或框架上有滚动条,使桌子可滚动,以便用户可以看到它.我尝试了很多方法,但是对我来说没有工作的是整个代码
public class View extends JFrame {
private static final long serialVersionUID = 1L;
/**
* Launch the application.
*/
//here in the main method i it adds in the JFrame everything
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
View frame = new View();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
public void showData() throws SQLException, ParseException {
panel = new JPanel();
panel_1 = …
Run Code Online (Sandbox Code Playgroud) 我已经定义了一个函数并将其称为递归,它在这里不起作用的是代码
$(document).ready(function () {
//if i remove the slider call here it doesn't even run the function slider
slider();
function slider() {
$("#img2").fadeOut(3000, function () {
$("#img2").fadeIn(3000);
});
//recursive call
slider();
}
});
Run Code Online (Sandbox Code Playgroud) java ×2
algorithm ×1
compression ×1
file ×1
javascript ×1
jquery ×1
jscrollpane ×1
jtable ×1
path ×1
recursion ×1
string ×1
swing ×1