temp

How to change directory for temporary files - problems with huge temporary raster files

ぐ巨炮叔叔 提交于 2019-12-06 14:15:46
问题 I'm desperately trying to writeRaster() but, since the raster is quite large I need a lot of temp memory. The space on my C:/ drive is limited and therefore I want to change the temporary dir to D:/TEMP/ . I tried different approaches I found on the Internet like: Change temporary directory http://r.789695.n4.nabble.com/How-do-I-set-the-Windows-temporary-directory-in-R-td876483.html etc. rasterOptions(tmpdir = "D:/RTEMP/") didn't solve the problem. Even if it worked while the calculation of

17.2在Java中如何处理文本I/O

社会主义新天地 提交于 2019-12-06 14:12:06
要点提示:使用Scanner类来读取文本数据,使用PrintWriter类写文本数据。   File对象封装了文件或路径属性,但是不包含从/向文件读/写数据的方法。为了进行I/O操作,需要使用正确的javaI/O类创建对象。这些对象包含从/向文件中读/写数据的方法。例如为了将文本写入一个名为temp.txt的文件中,可以使用PrintWriter类按如下操作创建一个对象。   PringWriter op = new PrintWriter("temp.txt");   op.print("java 101");   op.close();   java有许多操作各种类目的I/O类。通常,可以将它们分为输入类和输出类。输入类包含读数据的方法,输出类包含写数据的方法。PrintWriter是一个输出类的例子,而Scanner是一个输入类的例子。下面代码为temp.txt创建一个输入对象,并从该文件中读取数据:   Scanner sc = new Scanner(new File("temp.txt"));   System.out.print(sc.nextLine()); 如果文件temp.txt包含java 101,那个sc.nextLine()方法就会返回“java 101”。   输入对象从文件中读取数据流,输出对象将数据流写入文件。输入对象也称为输入流,同样

Where to put application data and temp files on Windows, Linux and MAC if java-application is being lauched using JWS

♀尐吖头ヾ 提交于 2019-12-06 13:27:23
Can we allow user to set and save application data and temp data using Java-Application that has beenrun/launch using JWS ? Does it make sense ? We would like to know if user run JNLP directly then can user save preferences settings on local so when he/she run again JNLP he/she could find his/her last saved settings again. Where to put application data i.e configuration files, properties file. user download path etc.. and where to put temp files i.e.. logs etc.. on Windows, Linux and MAC if java-application is being launched using JWS ? trashgod I often use java.util.prefs.Preferences , but

Shell脚本中执行mysql语句

南笙酒味 提交于 2019-12-06 12:37:17
对于自动化运维,诸如备份恢复之类的,DBA经常需要将SQL语句封装到shell脚本。本文描述了在Linux环境下mysql 数据库 中,shell脚本下调用sql语句的几种方法,供大家参考。对于脚本输出的结果美化,需要进一步完善和调整。以下为具体的示例及其方法。 1、将SQL语句直接嵌入到shell脚本文件中 --演示环境 [root@SZDB ~]# more /etc/issue CentOS release 5.9 (Final) Kernel \r on an \m root@localhost[(none)]> show variables like 'version'; +---------------+------------+ | Variable_name | Value | +---------------+------------+ | version | 5.6.12-log | +---------------+------------+ [root@SZDB ~]# more shell_call_sql1.sh #!/bin/bash # Define log TIMESTAMP=`date +%Y%m%d%H%M%S` LOG=call_sql_${TIMESTAMP}.log echo "Start execute sql statement at

php:// 流操作

本小妞迷上赌 提交于 2019-12-06 11:43:03
php:// - 用于访问各种I/O流 说明: PHP提供一些杂项I/O流,可支持访问PHP本身的输入和输出流,标准输入,输出和错误文件描述符,内存中和磁盘备份的临时文件流,以及能操作其他文件资源的过滤器。 php://stdin, php://stdout 和 php://stderr php://stdin,php://stdout和php://stderr支持对PHP进程相应的输入或输出流直接访问。流引用的是一个副本文件描述符,也就是若打开一个php://stdin后再关闭它,关闭的只是一个描述符的拷贝,而实际被STDIN引用的流不会被关闭。这个bug一直持续到PHP5.2.1版。所以建议直接使用常量STDIN,STDOUT和STDERR来操作,而不要去使用这些常量的封装函数来打开流。 php://stdin是只读的,而php://stdout和php://stderr是只写的。 php://input php://input是一个只读流,支持从请求体(request body)中读出原始raw数据。在POST请求中,最好使用php://input而非$ HTTP_RAW_POST_DATA ,是因为php://input不依赖于特定的php.ini指令。此外,对那些默认不计算$ HTTP_RAW_POST_DATA 的情况,激活 always_populate_raw

Day02

眉间皱痕 提交于 2019-12-06 09:35:02
数组 数组的拷贝 /** * 删除数组中指定索引位置的元素,本质上还是数组的拷贝 * * @param s * @param index * @return */ public static String[] removeElement(String[] s, int index) { System.arraycopy(s, index + 1, s, index, s.length - index - 1); s[s.length - 1] = null; return s; } /** * 数组扩容,本质上是定义一个更大的数组,然后将原数组内容拷贝到新数组中 * * @param s * @param num * @return */ public static String[] extendRange(String s, int num) { String[] s1 = new String[s.length() + num]; System.arraycopy(s, 0, s1, 0, s.length()); return s1; } java.util.Arrays Array.toString() //打印数组 Array.binarySearch() //二分法查找数组元素 多维数组 冒泡排序 /** * 冒泡排序法 * * @param a * @return *

重构之重新组织函数(Inline Temp)

瘦欲@ 提交于 2019-12-06 08:08:59
Inline Temp 概述 一个临时变量,只被一个简单表达式赋值一次,而它妨碍了其它重构手法。 动机(Motivation) Inline Temp多半是作为Replace Temp with Query的一部分来使用。惟一单独使用Inline Temp的情况是:你发现某个临时变量被赋予某个函数调用的返回值。一般来说,这样的临时变量不会有任何危害,你可以放心地把它留在那儿。但如果这个临时变量妨碍了其它重构手法---例如Extract Method,就应该将它inline化。 作法(Mechanics) 1、如果这个临时变量并未被声明为final,那就将它声明为final,然后编译。 这可以检查该临时变量是否真的只被赋值一次。 2、找到该临时变量的所有引用点,将它们替换为为临时变量赋值的语名中的等号右侧表达式。 3、每次修改后,编译并测试。 4、修改完所有引用点之后,删除该临时变量的声明式和赋值语名。 public class InlineTemp { //before inline-temp public double GetUserSalary(String name) { double salary = userSalary(name); return salary ; } //after inline-temp public double

输入两个单调递增的链表,输出两个链表合成后的链表,当然我们需要合成后的链表满足单调不减规则。

牧云@^-^@ 提交于 2019-12-06 06:48:32
//方案一: public class Solution { public ListNode Merge(ListNode list1,ListNode list2) { ListNode node=new ListNode(-1); ListNode temp=node; while(list1!=null&&list2!=null){ if(list1.val<list2.val) { temp.next=list1; temp=temp.next; list1=list1.next; }else{ temp.next=list2; temp=temp.next; list2=list2.next; } } if(list1!=null) temp.next=list1; if(list2!=null) temp.next=list2; return node.next; } } //方案二: public class Solution { public ListNode Merge(ListNode list1,ListNode list2) { ListNode node=new ListNode(-1); ListNode temp=node; while(list1!=null&&list2!=null){ if(list1.val<list2.val) { temp

Poco学习(二)

我的梦境 提交于 2019-12-06 04:41:27
1. Poco::JSON /////////////////// POCO::JSON ///////////////////// #include "Poco/JSON//Parser.h" #include "Poco/Dynamic/Var.h" #include <fstream> void CreateJson() { Poco::JSON::Object root, temp; Poco::JSON::Array province, cities; // 1. //对中文的支持不好 cities.add("大庆"); cities.add("哈尔滨"); temp.set("name", "黑龙江"); temp.set("cities", cities); province.add(temp); cities.clear(); temp.clear(); cities.add("深圳"); cities.add("广州"); temp.set("name", "广东"); temp.set("cities", cities); province.add(temp); root.set("province", province); root.set("country", "中国"); std::ostringstream osstr; root.stringify

【codeforces 19/11/27 div2】D. A Game with Traps

三世轮回 提交于 2019-12-06 03:00:27
1 #pragma warning(disable:4996) 2 3 #include<iostream> 4 #include<string> 5 #include<queue> 6 #include<stack> 7 #include<vector> 8 #include<map> 9 #include<cstdio> 10 #include<cstdlib> 11 #include<algorithm> 12 #include<set> 13 #include<list> 14 #include<iomanip> 15 #include<cstring> 16 #include<cmath> 17 #include<limits> 18 using namespace std; 19 20 #define au auto 21 #define debug(i) cout<<"<debug> "<<i<<" <\debug>"<<endl 22 #define mfor(i,a,b) for(register int i=(a);i<=(b);i++) 23 #define mrep(i,a,b) for(register int i=(a);i>=(b);i--) 24 #define LLL __int128 25 #define Re register 26