由买买提看人间百态

topics

全部话题 - 话题: tmp
1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)
W********e
发帖数: 45
1
【leetcode restore IP address】这题,思路和算法我都写出来了,不过有个地方觉
得很奇怪,小问题 ,可是我没想明白,请指教!
问题就是为什么要用tmp来代替ans这个参数?在下面的code里我有coment
class Solution {
public:
vector restoreIpAddresses(string s) {
vector result;
string ans;
dfs(s,&result,ans,4);
return result;

}
void dfs(string s,vector*result, string ans,int tokenLeft)
{
int i,sectionValue=0;
if(s.length()==0 && tokenLeft==0)
{
result->push_back(an... 阅读全帖
s******p
发帖数: 111
2
来自主题: Automobile版 - TMPS
我车是honda accord 2010
买了DOD GPE 520
如果同开记录器, GPS, 和音响, TMPS灯就会亮。 关了GPS或记录器, TMPS就不亮
。怀疑电力不够。
大虾有类似情况?
c****h
发帖数: 19
3
来自主题: Automobile版 - TMPS问题
现在的新车都有TMPS,胎压监测系统。
请问一下有TMPS的车主:
换雪胎都配sensor吗?
如果有,你的车可以自己识别新的sensor,还是去dealer,用OBD2 tool把sensor的ID
写入行车电脑?
W********e
发帖数: 45
4

可是用tmp,tmp=ans,不是一样有这个问题么??
b**u
发帖数: 1206
5
【 以下文字转载自 Windows 讨论区 】
发信人: bodu (我怎么知道,我是灌水的), 信区: Windows
标 题: win7瞎如何delete msi*.tmp目录
发信站: BBS 未名空间站 (Mon Jan 17 22:24:26 2011, 美东)
破瘟7在我的机器D盘根目录下建了上百个msi*.tmp的目录,我是超级用户,但还是不能
delete掉那些目录。有没有哪位大侠支一招,怎么除掉这些目录?谢谢。
w*s
发帖数: 7227
6
【 以下文字转载自 Programming 讨论区 】
发信人: wds (大盘5000不是梦), 信区: Programming
标 题: linux:可以从网站下载病毒进/tmp然后发作吗?
发信站: BBS 未名空间站 (Tue Jan 24 11:22:43 2017, 美东)
如果下载的文件只能进/tmp,可以引发病毒吗?
a9
发帖数: 21638
7
照你这么说crontab也可以放在/tmp文件夹。
/tmp下也可以放别的可执行文件。
s****y
发帖数: 2052
8
来自主题: Software版 - 如何清理这个DWHxxxx.tmp
每次开机都有一些DWHxxxx.tmp文件被感染木马病毒
在这个目录 c: user \appdata\tmp
每次诺顿都隔离。有没有办法杀死啊
谢谢
p*h
发帖数: 34
9
There are hundreds of tmp files under my windows directory, file
names all like this:
fffefde7_{29377421-BA7F-11D4-93E4-00A0CC5E5DDB}.tmp
Anybody know what's this? Can I delete them all?
3ks
r********r
发帖数: 2
10
c:\windows\temp下边有几个G的临时文件:
Acr4F5.tmp, Acr4F6.tmp ...
而且不断生成新的。
这是病毒么?是什么程序生成的?
谢谢!
r********r
发帖数: 2
11
c:\windows\temp下边有几个G的临时文件:
Acr4F5.tmp, Acr4F6.tmp ...
而且不断生成新的。
这是病毒么?是什么程序生成的?
谢谢!
d******6
发帖数: 59
12
Honda Odyssey TMPS (轮胎气压监测系统) 故障,需要修吗?
dealer 张嘴就要$600。 需要修吗?本月没有bugget.
c****h
发帖数: 19
13
来自主题: Automobile版 - TMPS问题
请有TMPS的车主讲讲,“肯定是”这样猜测的,就不要回帖了。

ID
a*******r
发帖数: 3452
14
来自主题: Automobile版 - tmps 读数和便携气压表读数差异
气温下降,给胎补气,发现二者读数不一致。tmps的略低2-3Opsi。哪位有研究?哪个
读数准?
S**A
发帖数: 738
15
来自主题: Medicine版 - SMZ-TMP 治 Ear Infection
1岁孩子顽固的Ear Infection,
阿莫西林当时管用了,但严重过敏;
然后是Omincef,根本没用;10天的药白吃了。
今天给开了SMZ-TMP,谁给说说能有用吗?一怕过敏,二怕没效。
c****0
发帖数: 784
16
来自主题: Joke版 - cd xxx/db/tmp;rm -rf *
其实只用改一点:
cd xxx/db/tmp && rm -rf *
欢迎讨论。
n***d
发帖数: 8857
17
来自主题: Joke版 - cd xxx/db/tmp;rm -rf *
还cd个头啊,直接rm -rf xxx/db/tmp/*
M*******n
发帖数: 10087
18
来自主题: Joke版 - cd xxx/db/tmp;rm -rf *
xxx是你收藏的所有影片目录么?删掉多可惜啊,怕被人发现可以压缩改名字嘛:
tar -cf java_tutorial.pdf xxx/db/tmp
w*s
发帖数: 7227
19
如果下载的文件只能进/tmp,可以引发病毒吗?
w*s
发帖数: 7227
20
"只要你sudo执行病毒程序",
用户只是从网页上上传到linux server 的/tmp, 有办法这个文件自动执行吗?

洞。
a9
发帖数: 21638
21
这跟是不是tmp目录没有关系。如果只是写文件到这个目录是不是执行的。

,只
w*s
发帖数: 7227
22
这个。。。一般不会这么放吧,/tmp的东西时不时要清掉的
b**u
发帖数: 1206
23
来自主题: Windows版 - win7瞎如何delete msi*.tmp目录
破瘟7在我的机器D盘根目录下建了上百个msi*.tmp的目录,我是超级用户,但还是不能
delete掉那些目录。有没有哪位大侠支一招,怎么除掉这些目录?谢谢。
l******s
发帖数: 3045
24
来自主题: JobHunting版 - 一个排列组合问题
好像BFS + Queue
共1680个解。
private static IEnumerable ThreeBuckets(){
Queue queue = new Queue();
for (int[,] tmp = new int[3, 3] { { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } };
tmp[2, 0] == 0; tmp = queue.Peek()[2, 0] != 0 ? queue.Peek() : queue.Dequeue
())
for (int i = 1; i < 10; i++)
if (!(i == tmp[0, 0] || i == tmp[0, 1] || i == tmp[0, 2] || i == tmp[1, 0] |
| i == tmp[1, 1] || i == tmp[1, 2]))
for (int j = i + 1; j < 10; j++)
if (!(j == tmp[0, 0] || j == tmp[0, 1] || j == tmp[... 阅读全帖
c******n
发帖数: 4965
25
来自主题: THU版 - Re: very archaic issue : (转载)
【 以下文字转载自 Java 讨论区 】
发信人: creation (努力自由泳50m/45sec !), 信区: Java
标 题: Re: very archaic issue :
发信站: BBS 未名空间站 (Fri Apr 29 11:58:14 2011, 美东)
one colleague replied
using ssh -t ....
would help
here is my reply to him (his approach partially works, but only when you
terminate ssh client by ctrl-C, which is SIGINT, it does not work
when the ssh is run by a daemon like hudson, and terminated with -15 )
######################################
This is a cleaner way than the hack I came up with: I foun... 阅读全帖
c******n
发帖数: 4965
26
来自主题: CS版 - Re: very archaic issue : (转载)
【 以下文字转载自 Java 讨论区 】
发信人: creation (努力自由泳50m/45sec !), 信区: Java
标 题: Re: very archaic issue :
发信站: BBS 未名空间站 (Fri Apr 29 11:58:14 2011, 美东)
one colleague replied
using ssh -t ....
would help
here is my reply to him (his approach partially works, but only when you
terminate ssh client by ctrl-C, which is SIGINT, it does not work
when the ssh is run by a daemon like hudson, and terminated with -15 )
######################################
This is a cleaner way than the hack I came up with: I foun... 阅读全帖
c******n
发帖数: 4965
27
来自主题: Java版 - very archaic issue :
one colleague replied
using ssh -t ....
would help
here is my reply to him (his approach partially works, but only when you
terminate ssh client by ctrl-C, which is SIGINT, it does not work
when the ssh is run by a daemon like hudson, and terminated with -15 )
######################################
This is a cleaner way than the hack I came up with: I found that “normally
” the remote code terminates because it wants to print to the terminal,
Which is closed after ssh is closed, so the remote c... 阅读全帖
c******n
发帖数: 4965
28
来自主题: Java版 - very archaic issue :
one colleague replied
using ssh -t ....
would help
here is my reply to him (his approach partially works, but only when you
terminate ssh client by ctrl-C, which is SIGINT, it does not work
when the ssh is run by a daemon like hudson, and terminated with -15 )
######################################
This is a cleaner way than the hack I came up with: I found that “normally
” the remote code terminates because it wants to print to the terminal,
Which is closed after ssh is closed, so the remote c... 阅读全帖
t********5
发帖数: 522
29
来自主题: JobHunting版 - 关于python interview
代码很乱 凑合看=。=
"""
# 11.33
class Node(object):
def __init__(self, value = None, next = None):
self.value = value
self.next = next

class LinkedList(object):
def __init__(self):
self.head = None
self.size = 0

def __repr__(self):
result = []
tmp = self.head
while tmp is not None:
result.append(tmp.value)
tmp = tmp.next

return str(result)

def append(self, value):
node = Node(value)
if self.head is None:
self.head = node
... 阅读全帖
d**********o
发帖数: 1321
30
来自主题: WebRadio版 - 潜水员冒泡兼征版友意见
第二次作业report
#+latex_class: cn-article
#+latex_header: \usepackage{CJKutf8}
#+latex_header: \begin{CJK}{UTF8}{gbsn}
#+latex_header: \lstset{language=c++,numbers=left,numberstyle=\tiny,
basicstyle=\ttfamily\small,tabsize=4,frame=none,escapeinside=``,
extendedchars=false,keywordstyle=\color{blue!70},commentstyle=\color{red!55!
green!55!blue!55!},rulesepcolor=\color{red!20!green!20!blue!20!}}
#+title: CS572 Project 2 Report
#+author: (me~~~)
#+begin_abstract
|---------------------------+------------... 阅读全帖
d**********o
发帖数: 1321
31
来自主题: WebRadio版 - 潜水员冒泡兼征版友意见
第二次作业report
#+latex_class: cn-article
#+latex_header: \usepackage{CJKutf8}
#+latex_header: \begin{CJK}{UTF8}{gbsn}
#+latex_header: \lstset{language=c++,numbers=left,numberstyle=\tiny,
basicstyle=\ttfamily\small,tabsize=4,frame=none,escapeinside=``,
extendedchars=false,keywordstyle=\color{blue!70},commentstyle=\color{red!55!
green!55!blue!55!},rulesepcolor=\color{red!20!green!20!blue!20!}}
#+title: CS572 Project 2 Report
#+author: (me~~~)
#+begin_abstract
|---------------------------+------------... 阅读全帖
b****g
发帖数: 192
32
来自主题: JobHunting版 - 问个递归的问题
没错,很多递归的题都是这么做的:
ArrayList tmp 存的是最终结果的其中一个。
在函数里面,这个tmp还没有完全算完,还在逐步添加以得到最终结果。
所以要先执行tmp.add(),使tmp向结果迈进一步。到这里都很好理解。
然后继续执行递归,递归里面当然还是向最终结果迈进,所以才叫做递归。
现在考虑tmp.remove()这行。
你有没有注意到,tmp.add(); dfs(); tmp.remove() 这几行都在一个for循环里面?
这是因为每次循环都对应tmp的一个值。
具体来说,tmp在执行for循环之前本来就有一个值,干干净净处女之身没被糟蹋过。
第一个执行这个循环,先执行tmp.add()得到一个tmp的值,于是tmp破处了。
于是向最终结果迈进了一步,然后执行递归,继续想最终结果迈进。
这一层一层的递归就先不管他。反正他们都是从dfs()这个递归里开始的。
总之执行完刚刚这个dfs()我们还在第一次循环里面。
假如没有这个tmp.remove(),那就继续执行第二次for循环了。
但是错误就出现了。tmp已经在第一次循环里面通过tmp.add()改变了,已经破处... 阅读全帖
g**e
发帖数: 6127
33
激动啊,得到大牛肯定
不过你前面提到的"c(x)=在x左边最后一个比ax小的位置 c(x)=0 if all are larger
than ax",我觉得这种情况c(x)=-1
这样后面算最大面积的时候 (b(x)-c(x)-1)*a(x)才正确
比如a={2,3}, b={2,2}, c={-1,0} 最大面积4
贴个完整的代码
public class LargestHistogramRectangleDP {
public static int largestHistogram(int[] a) {
int maxArea = 0;

int n = a.length;
int[] b = new int[n];
int[] c = new int[n];

b[n-1] = n;
fo... 阅读全帖
j********e
发帖数: 1192
34
来自主题: JobHunting版 - 插入节点到complete binary tree的末尾
写了个使用O(1)memory, O(logN * logN) (N是tree的size)的程序。
类似于binary search的算法,测试代码也在下面,应该没有大bug。
先获得树的高度h,然后比较h和root->right子树的高度+1,如果相同,
说明树最后一个节点在root->right,否则最后一个节点在root->left的子树。
#include
#include
#include
#include
using namespace std;
class Node {
private:
Node *left;
Node *right;
int value;

public:
Node() {
left = right = NULL;
value = 0;
}

Node(int v) {
left = right = NULL;
value = v;
}

int Height(Node *node) {
int h... 阅读全帖
c****p
发帖数: 6474
35
来自主题: JobHunting版 - 计算组合数C(m,n)
#include
#include
int C(int m, int n)
{
int *A, *B;
int tmp;
int i, j, k;
if((m <=0 ) || (n <=0 ))
return -1;
if(n == 1)
return m;
if(n == m)
return 1;
if(m - n < n)
n = m - n;

A = malloc(n*sizeof(int)); // A = {m, m - 1, .... m - n + 1}
B = malloc((n-1)*sizeof(int)); // B = {2, 3, ... n}
for(i = 0; i {
A[i] = m - i;
B[i] = i + 2;
}
A[n-1] = m - n + 1;
//i ... 阅读全帖
j*****y
发帖数: 1071
36
int numberNodes(TreeNode * root)
{
int result = 0;
int nodes = 1;
TreeNode *tmp = root;
int rightLayer = 0;
while(tmp)
{
result += nodes;
++rightLayer;
nodes *= 2;
tmp = tmp->right;
}
int leftLayer = 0;
tmp = root;
while(tmp)
{
++leftLayer;
tmp = tmp->left;
}
if(leftLayer == rightLayer)
{
return result;
}
tmp = root;
while(tmp)
{
--rightLayer;
int layer ... 阅读全帖
a***e
发帖数: 413
37
又改写了,还是通不过,有大侠能看出明显错误吗?好奇那些面试官对这类题怎么知道
到底写对没?
8 / 24 test cases passed.
多谢。
Input:
["Listen","to","many,","speak","to","a","few."], 6


Output:
["Listen","to ","many, ","speak ","to a","few. "]


Expected:
["Listen","to ","many, ","speak ","to a","few. "]
class Solution {
public:
vector fullJustify(vector &words, int L) {
int n ... 阅读全帖
d**********o
发帖数: 1321
38
来自主题: WebRadio版 - 潜水员冒泡兼征版友意见
hw3b c-.y file
上面这一楼贴了载止hw3b deadline时我match的结果(也就是老师可以以这些不match
的ERROR为借口不给后来我补上的成绩),但是因为当时我还是没有写完,后来感恩节
期间就接着又写了一些,而且hw5是based on hw3 & hw3b的基础上(当我hw5是based
on更好的hw3的结果时,我应该可以得更多的分吧)。
hw4因为写得比较顺利,就不曾保留任何交上去作业的output,没有什么一目了然的结
果是我可以贴在这里的。原本我是想要把自己最的一次作业hw5贴出来的,但那已经是
一个完整的compiler,而且以后我还需要用自己的course project来找工作,所以一定
就不贴最终结果了。那就贴一个hw3b的c-.y文件吧,它集中的hw1、hw2、hw3、 hw3b的
结果,是我自己hw3b *.y文件的最完整版本。这些作业里面也有很多机关一一人为增加
的难度,比如那六七个IO相关的function,不仅traverse tree、build syntax tree的
时候会成为一个考点(把它们作为一个node连在syntax... 阅读全帖
d**********o
发帖数: 1321
39
来自主题: WebRadio版 - 潜水员冒泡兼征版友意见
hw3b c-.y file
上面这一楼贴了载止hw3b deadline时我match的结果(也就是老师可以以这些不match
的ERROR为借口不给后来我补上的成绩),但是因为当时我还是没有写完,后来感恩节
期间就接着又写了一些,而且hw5是based on hw3 & hw3b的基础上(当我hw5是based
on更好的hw3的结果时,我应该可以得更多的分吧)。
hw4因为写得比较顺利,就不曾保留任何交上去作业的output,没有什么一目了然的结
果是我可以贴在这里的。原本我是想要把自己最的一次作业hw5贴出来的,但那已经是
一个完整的compiler,而且以后我还需要用自己的course project来找工作,所以一定
就不贴最终结果了。那就贴一个hw3b的c-.y文件吧,它集中的hw1、hw2、hw3、 hw3b的
结果,是我自己hw3b *.y文件的最完整版本。这些作业里面也有很多机关一一人为增加
的难度,比如那六七个IO相关的function,不仅traverse tree、build syntax tree的
时候会成为一个考点(把它们作为一个node连在syntax... 阅读全帖
r*****z
发帖数: 906
40
来自主题: TeX版 - 请教一个gnuplot画图问题
我用的是gnuplot 4.4,所以需要对你的命令做一点儿修改。
修改后的如下:
set term postscript eps color blacktext "Helvetica" 24
set output 'p1.eps'
set autoscale # scale axes automaticallyun
unset log
unset label
set xtic auto # set xtics automatically
set ytic auto # set ytics automatically
set title "I/O Traffic"
set xlabel "Interval(5s)"
set ylabel "Data(KB)"
set key at 1,100
set xr [0:100]
set yr [0:10000]
plot "p1.tmp" using 1:2 title 'r0' with li... 阅读全帖
h*********3
发帖数: 111
41
来自主题: JobHunting版 - 问个算法题9
憋了老半天,写了一个,现在脑袋是真的不好使了。。。
算是抛砖引玉了。。。
void DoCatalan(vector &buf,vector &catalanStack)
{
string tmp,left,backup,backup2;
if ( buf.size() == 1 )
{
tmp = buf[0];
for ( int i=catalanStack.size()-1;i>=0;i--)
{
left = catalanStack[i];
tmp = left + tmp + ")";
}
cout << tmp << endl;
return;
}
if ( catalanStack.size() == 0 )
{
backup = buf[buf.size()-1];
tmp = "(" + back... 阅读全帖
j********g
发帖数: 80
42
来自主题: JobHunting版 - leetcode出了新题word ladder
第二个过了Large的 轻拍
class Solution {
public:
vector> findLadders(string start, string end, unordered_
set &dict) {
// Start typing your C/C++ solution below
// DO NOT write int main() function
int size=dict.size();
int res=1;
int done=0;
stack stk[2];
unordered_set used;
unordered_map > path;
unordered_set level;
int index=0;
stk[index%2].push(start);
used.insert(start);
vector<... 阅读全帖
j********g
发帖数: 80
43
来自主题: JobHunting版 - leetcode出了新题word ladder
第二个过了Large的 轻拍
class Solution {
public:
vector> findLadders(string start, string end, unordered_
set &dict) {
// Start typing your C/C++ solution below
// DO NOT write int main() function
int size=dict.size();
int res=1;
int done=0;
stack stk[2];
unordered_set used;
unordered_map > path;
unordered_set level;
int index=0;
stk[index%2].push(start);
used.insert(start);
vector<... 阅读全帖
a**********2
发帖数: 340
44
来自主题: JobHunting版 - 一道G家题目
没有仔细验证
typedef pair PAIR;
void getCountArray(vector input)
{
int len = input.size();
vector count(len, 0);
vector input1;
int i;
for( i = 0; i < len; i++)
input1.push_back(PAIR(input[i],i));
vector tmp( len, PAIR(0,0));
MergeSort(input1, 0, len-1, tmp, count);
for( i = 0; i < len; i++)
cout << count[i] ;
cout << endl;
}
void Merge(vector& input, int low, int mid, int high,vector&
tmp
, vector& co... 阅读全帖
m*********a
发帖数: 3299
45
来自主题: JobHunting版 - G面经
第一题是用递归么?
#include
#include
typedef struct output_string{
char string[20];
struct output_string *next; }output_string;
void stringCopy(char *str_source,char *str_dest,int no_char){
while (no_char--) *str_dest++=*str_source++;
}
void allString(char *str,output_string *output,int char_position){
output_string *tmp;
while ((*str!='?')&(*str!='\0'))
output->string[char_position++]=*str++;
if (*str=='\0') {output->string[char_position]='\0';return;... 阅读全帖
a***e
发帖数: 413
46
还是开始没想清楚,发现用2个stack要清楚很多,2个vector就搞晕了。
Sigh,贴一个终于通过的明天再看再简化。每次碰到这种开始以为简单又老是写不对的
题就很有挫折感!
vector > zigzagLevelOrder(TreeNode *root) {
vector> ret;
vector levelVals;

stack curLevel;
stack nextLevel;
if (root==NULL)
return ret;

TreeNode *r = root;
curLevel.push(r);
bool l2r = true;

while(!curLevel.empty())
{
if (!l2r)
... 阅读全帖
m**********g
发帖数: 153
47
把pre-order iterative traversal 改造了一下, 添加了 vector
nodePath; 作为path stack. 楼主看看是不是可以?
class Solution {
public:
void preorderTraversal(TreeNode *root) {
stack st;
vector nodePath;

if(root == NULL)
return;

st.push(root);

while(st.size()) {
TreeNode *tmp = st.top();

st.pop();

//leaf node, print the path from root to leaf
... 阅读全帖
h**o
发帖数: 548
48
原来是这样.自己造不出这个path stack来.学习了.

把pre-order iterative traversal 改造了一下, 添加了 vector
nodePath; 作为path stack. 楼主看看是不是可以?
class Solution {
public:
void preorderTraversal(TreeNode *root) {
stack st;
vector nodePath;

if(root == NULL)
return;

st.push(root);

while(st.size()) {
TreeNode *tmp = st.top();

st.pop();

//leaf node, pri... 阅读全帖
1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)