我在为XSSFWorkbookfrom 设置自定义字体颜色方面遇到了一些麻烦Apache POI.当我做:
yellow = workbook.createCellStyle();
Font whiteFont = workbook.createFont();
whiteFont.setColor(new XSSFColor(new Color(255, 255, 255)).getIndexed());
yellow.setFillForegroundColor(new XSSFColor(yellowRGB));
yellow.setFillPattern(XSSFCellStyle.SOLID_FOREGROUND);
yellow.setFont(whiteFont);
Run Code Online (Sandbox Code Playgroud)
字体保持黑色,我不知道我做错了什么.
本质上,我想要做的是运行我创建的 Bash 脚本,该脚本在启动 SSH 连接之前和 SSH 连接关闭之后切换 WiFi SSID。
我~/.ssh/config通过将 ProxyCommand 设置为 添加了此./run-script; ssh %h:%p功能,但通过这样做,我觉得它会忽略我运行 ssh 命令时传递的任何参数。另外,我不知道如何在 SSH 连接关闭时让脚本再次运行。
我multiprocessing在Python 3中使用该模块但由于某种原因,它TypeError: 'int' object is not iterable在我运行程序时不断抛出.这就是我做的:
def main(i):
global urlDepth
global row
global counter
urlDepth = []
row = 0
counter = 0
login(i)
crawler(MENU_URL)
if __name__ == '__main__':
workers = 2
processes = []
for p_number in range(workers):
p = Process(target=main, args=p_number)
p.start()
processes.append(p)
for p in processes:
p.join()
Run Code Online (Sandbox Code Playgroud)
我不明白为什么会这样,有人可以帮助我吗?
不是TypeError的重复:'int'对象不可迭代,因为它是相同的错误,是的,但它有不同的原因,请在尝试将此问题标记为重复之前阅读问题/代码.
我正在尝试将我自己的自定义标题视图添加到 Google 的新视图中,NavigationView但出于某种原因,无论我做什么,Android Studio 都会给我一个警告include,RelativeLayout这里不允许。我试着做
<android.support.design.widget.NavigationView
android:id="@+id/navigation_drawer"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true">
<include layout="@layout/nav_drawer_header" />
<android.support.v7.widget.RecyclerView
android:id="@+id/nav_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#cccc"
android:choiceMode="singleChoice"
android:divider="@android:color/transparent"
android:dividerHeight="0dp"/>
</android.support.design.widget.NavigationView>
Run Code Online (Sandbox Code Playgroud)
但只有RecyclerView出现,我不知道还能做什么。
我真的很感激一些帮助。谢谢!
我有一个ArrayList我调用的自定义对象Questions.这些Questions包含的问题,唯一的ID和ArrayList的Answers.现在我正在尝试使用特定的唯一搜索问题ID.这就是我目前正在做的事情,但我担心这可能需要很长时间才能找到一个大清单,所以我想知道是否有更快的方法来做到这一点.
public Question getQuestion(String idLookingFor) {
for (Question question : questions) {
if (question.getId().equals(idLookingFor))
return question;
}
return null;
}
Run Code Online (Sandbox Code Playgroud) 我想删除每一个"*"但忽略的事件,"**"例如,如果我有"testing *single star* and **double star**",删除后的句子就是"testing single star and **double star**".
我正在考虑使用,replace("*", "")但是当我尝试使用时,它摆脱了所有的星星.
我该怎么办?