我在excel中创建日历.第1列是2010年1月1日(dd.MM.yyyy),第2列是02.01.2010,依此类推.
这是我的代码:
int day_cell = 0;
for(int i = 0; i < days.size(); i++)
{
Date day = days.get(i);
HSSFCell cell = row.createCell(day_cell++);
cell.setCellValue(day.toString());
}
Run Code Online (Sandbox Code Playgroud)
当我到达第256列POI时抛出此异常:
java.lang.IllegalArgumentException: Invalid column index (256). Allowable column range for BIFF8 is (0..255) or ('A'..'IV')
at org.apache.poi.hssf.usermodel.HSSFCell.checkBounds(HSSFCell.java:926)
at org.apache.poi.hssf.usermodel.HSSFCell.<init>(HSSFCell.java:162)
at org.apache.poi.hssf.usermodel.HSSFRow.createCell(HSSFRow.java:141)
at org.apache.poi.hssf.usermodel.HSSFRow.createCell(HSSFRow.java:119)
Run Code Online (Sandbox Code Playgroud)
我发现这个错误报告表明它已在3.6版本中得到修复.我们使用3.5但是改为3.6似乎没有任何好处.有人有任何提示吗?
https://issues.apache.org/bugzilla/show_bug.cgi?id=46806
编辑:似乎错误问题是关于公式..
我知道"企业"这个词给了一些人毛骨悚然,但我很想知道是否有人有创建企业应用程序的经验,类似于说... Java EE应用程序,这是与Django高度并发的分布式应用程序?我知道Java有自己的问题,但它被视为企业框架,我认为这是不幸的.
有人说Rails是Java EE的一个很好的替代品但是Django呢?有没有人在这种情况下使用它?您只能在djangosites.org上看到相当标准的网站,而且它似乎能够提供更多功能.我打算废弃一些旧系统,这些系统主要是在ASP.NET上编写的,而一些Java则是为了更容易维护.我开始将Django用于其他一些应用程序,并发现它对于我在内部使用它(公司新闻,内部网等)非常棒,但是如果......应收账款系统或计费系统等等我.我不愿意看到这样一个框架,比如这个鸽子,它不属于这个类别.它似乎用于社交媒体/网络,内容繁重的网站,而不是数据处理等.我觉得它具有开始这条道路所需的所有元素.有人有什么想法?
我试图在Java中使用for循环打印出这个模式,但我有点卡住了.
zzzzz
azzzz
aazzz
aaazz
aaaaz
aaaaa
Run Code Online (Sandbox Code Playgroud)
我可以打印:
a
aa
aaa
aaaa
aaaaa
Run Code Online (Sandbox Code Playgroud)
使用:
String i = " ";
int a = 0;
for (i="a";i.length()<=5;i=i+"a")
System.out.println(i);
Run Code Online (Sandbox Code Playgroud)
和
zzzzz
zzzz
zzz
zz
z
Run Code Online (Sandbox Code Playgroud)
使用:
String i = " ";
for (i="zzzzz";i.length()>0;i=i.substring(0,i.length()-1))
System.out.println(i);
Run Code Online (Sandbox Code Playgroud)
但我无法弄清楚如何将它们结合起来.我正在考虑i每次更换子字符串并将结束索引的值增加一个,但不确定是否编码.我从这样的事情开始:
String i = " ";
String b = " ";
for (i="zzzzz";i="aaaaa";i=i.replace(i.substring(0,))
System.out.println(i);
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?
我已经成功建立了一个Spring Batch项目教程.我真的很想知道是否可以在"Spring级别"使其成为多线程.
我想要的基本思路是制作一个任务列表或任务步骤,让它们被独立的线程拾取和处理,理想情况下是一个限于'n'个线程的池.
这可能吗?如果是这样,怎么样?有人可以从我目前所在的地方指导我到那一点吗?
简单的项目我是从本教程在这里.它基本上有不同的任务,可以将信息打印到屏幕上.
这是我当前的simpleJob.xml文件,其中包含作业详细信息:
<import resource="applicationContext.xml"/>
<bean id="hello" class="helloworld.PrintTasklet">
<property name="message" value="Hello"/>
</bean>
<bean id="space" class="helloworld.PrintTasklet">
<property name="message" value=" "/>
</bean>
<bean id="world" class="helloworld.PrintTasklet">
<property name="message" value="World!\n"/>
</bean>
<bean id="taskletStep" class="org.springframework.batch.core.step.tasklet.TaskletStep" >
<property name="jobRepository" ref="jobRepository"/>
<property name="transactionManager" ref="transactionManager"/>
</bean>
<bean id="simpleJob" class="org.springframework.batch.core.job.SimpleJob">
<property name="name" value="simpleJob" />
<property name="steps">
<list>
<bean parent="taskletStep">
<property name="tasklet" ref="hello"/>
</bean>
<bean parent="taskletStep">
<property name="tasklet" ref="space"/>
</bean>
<bean parent="taskletStep">
<property name="tasklet" ref="world"/>
</bean>
</list>
</property>
<property name="jobRepository" ref="jobRepository"/>
</bean>
Run Code Online (Sandbox Code Playgroud)
我的appContext包含作业存储库bean(SimpleJobRepository),事务管理器( …
当你不取消引用时,指针不是一个引用吗?
#include "stdafx.h"
#define BOOST_TEST_MODULE example
#include <boost/test/included/unit_test.hpp>
std::list<int>* user_defined_func( ) {
std::cout << "BEGIN: user_defined_func" << std::endl;
std::list<int>* l = new std::list<int>;
l->push_back(8);
l->push_back(0);
std::cout << "END: user_defined_func" << std::endl;
return l;
}
bool validate_list(std::list<int> &L1)
{
std::cout << "BEGIN: validate_list" << std::endl;
std::list<int>::iterator it1 = L1.begin();
for(; it1 != L1.end(); ++it1)
{
if(*it1<= 1){
std::cout << "Validation failed because an item in the list was less than or equal to 1." << std::endl;
std::cout << "END: validate_list" << …Run Code Online (Sandbox Code Playgroud) 我有一个场景,例如,一个EditText在acitivity而不是使用Textview作为它的标签我想在EditText中放置文本"UserName",如果用户点击它.它应该消失,EditText应该为空以在其中输入数据.
我怎样才能做到这一点?
我正在使用位移操作符(参见我的问题Bit Array Equality),SO用户在我的移位操作数计算中指出了一个错误 - 我计算的范围是[1,32]而不是[0,31]对于一个int.(为SO社区欢呼!)
在解决问题时,我惊讶地发现以下行为:
-1 << 32 == -1
Run Code Online (Sandbox Code Playgroud)
实际上,似乎n << s编译(或由CLR解释 - 我没有检查IL),n << s % bs(n)其中bs(n)= n的位数(以位为单位).
我原以为:
-1 << 32 == 0
Run Code Online (Sandbox Code Playgroud)
似乎编译器意识到你正在超越目标的大小并纠正你的错误.
这纯粹是一个学术问题,但有没有人知道这是否在规范中定义(我在7.8 Shift运算符中找不到任何东西),只是一个未定义行为的偶然事实,或者是否存在可能产生错误的情况?
我有一个简单的表,包含MySQL中的股价:
Table `share_prices`
+----------+-------+---------------------+
| stock_id | price | date |
+----------+-------+---------------------+
| 1 | 0.05 | 2010-02-24 01:00:00 |
| 2 | 3.25 | 2010-02-24 01:00:00 |
| 3 | 3.30 | 2010-02-24 01:00:00 |
| 1 | 0.50 | 2010-02-23 23:00:00 |
| 2 | 1.90 | 2010-02-23 23:00:00 |
| 3 | 2.10 | 2010-02-23 23:00:00 |
| 1 | 1.00 | 2010-02-23 19:00:00 |
| 2 | 1.00 | 2010-02-23 19:00:00 |
| 3 | 1.00 …Run Code Online (Sandbox Code Playgroud) 我希望能够编写扩展方法,以便我可以说:
lines.ForceSpaceGroupsToBeTabs();
Run Code Online (Sandbox Code Playgroud)
代替:
lines = lines.ForceSpaceGroupsToBeTabs();
Run Code Online (Sandbox Code Playgroud)
但是,以下代码当前输出:
....one
........two
Run Code Online (Sandbox Code Playgroud)
代替:
Tone
TTtwo
Run Code Online (Sandbox Code Playgroud)
我需要在以下代码中更改以使其输出:
Tone
TTtwo
Run Code Online (Sandbox Code Playgroud)
(请注意,为了可见性. = space, T = \t):
using System;
using System.Collections.Generic;
namespace TestExtended82343
{
class Program
{
static void Main(string[] args)
{
List<string> lines = new List<string>();
lines.Add("....one");
lines.Add("........two");
lines.ForceSpaceGroupsToBeTabs();
lines.ForEach(l => Console.WriteLine(l));
Console.ReadLine();
}
}
public static class Helpers
{
public static void ForceSpaceGroupsToBeTabs(this List<string> originalLines)
{
string spaceGroup = new String('.', 4);
List<string> lines = new List<string>();
foreach (var originalLine …Run Code Online (Sandbox Code Playgroud) 我有一个Html页面index.htm,它有一个iframe来搜索search.htm,search.htm有这样的代码
function executeSearch() {
window.parent.location = "/SearchResults.aspx?t=" + txt_Search.value;
}
Run Code Online (Sandbox Code Playgroud)
这个代码现在从index.htm页面执行,它在IE和Chrome上运行得很好,但不是FireFox ......有什么工作吗?我试过window.parent.location.href,window.opener.location,window.parent.document.location ......但是没有任何工作.
在搜索网页后,我发现了一个有类似问题的人,他说这是Firefox中的安全设置......这是真的吗?若有,有什么办法吗?