meteor reset和rm -rf .meteor / local之间有什么区别?

时间:2016-07-31 05:28:14

标签: meteor

在Meteor app dir中运行时,<?php $msg=''; $days=0; if (isset($_POST['btnCreate'])) { $join = date_create($_POST['join']); $today = date_create(date('Y-m-d')); $diff= date_diff($join,$today); $days=$diff->format("%a"); $msg=$days.' days greater than today '; } ?> <div style="text-align: center"> <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"> <input type="date" name="join" id="joinid" value="<?php echo $join;?>" class="txtbox"><br> <div class="error" id="joinerr"><?php echo $msg; ?></div><br/> <input type="submit" name="btnCreate" class="btns" value="Create Account"> </form> </div> meteor reset之间有什么区别?

有时我只是做rm -rf .meteor/local,因为它比rm -rf .meteor/local更快,但我很想了解它们的区别。

2 个答案:

答案 0 :(得分:2)

例如,

meteor reset也有助于修复构建问题。一些Meteor版本之前这是一个非常重要的事情,因为例如在构建到不同平台时存在一些问题 一般来说,你不应该需要它。只需rm -rf .meteor/local(bash)或db.dropDatabase()MongoDB shell)就足以重置项目。
有关详细信息,您可以查看此部分的Meteor源代码:https://github.com/meteor/meteor/blob/devel/tools/cli/commands.js#L1182

答案 1 :(得分:0)

执行

public class QueueImpl { private int capacity; int queueArr[]; int front = 0; int rear = -1; int currentSize = 0; QueueImpl(int queueSize){ this.capacity=queueSize; queueArr=new int[this.capacity]; } public void enqueue(int data){ if(isQueueFull()){ System.out.println("Overflow"); return; } else{ rear=rear+1; if(rear==capacity-1) { rear=0; } queueArr[rear]=data; currentSize++; System.out.println("Element " + data+ " is pushed to Queue !"); } } public int dequeue(){ if(isQueueEmpty()){ System.out.println("UnderFlow"); } else{ front=front+1; if(front == capacity-1){ System.out.println("Pop operation done ! removed: "+queueArr[front-1]); front = 0; } else { System.out.println("Pop operation done ! removed: "+queueArr[front-1]); } currentSize--; } return queueArr[front-1]; } private boolean isQueueEmpty() { boolean status=false; if(currentSize==0){ status=true; } return status; } private boolean isQueueFull() { boolean status=false; if(currentSize==capacity){ status=true; } return status; } public static void main(String arg[]) { QueueImpl queueImpl=new QueueImpl(5); queueImpl.enqueue(5); queueImpl.enqueue(2); queueImpl.enqueue(9); queueImpl.enqueue(1); // queueImpl.dequeue(); queueImpl.printQueue(queueImpl); queueImpl.reverse(queueImpl); } private void printQueue(QueueImpl queueImpl) { System.out.println(queueImpl.toString()); } @Override public String toString() { return "Queue [front=" + front + ", rear=" + rear + ", size=" + currentSize + ", queue=" + Arrays.toString(queueArr) + "]"; } private QueueImpl reverse(QueueImpl queueImpl) throws ArrayIndexOutOfBoundsException { int i=0; Stack<Integer> stack=new Stack<Integer>(); while(!queueImpl.isQueueEmpty()){ stack.push(queueImpl.dequeue()); } while(!stack.isEmpty()){ stack.get(i); i++; } while(!stack.isEmpty()){ queueImpl.enqueue(stack.pop()); } return queueImpl; } } 以重置您的项目。您的数据库或收藏集中的数据也会被删除。

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: -1 at com.tcs.QueueUsingAraay.QueueImpl.dequeue(QueueImpl.java:51) at com.tcs.QueueUsingAraay.QueueImpl.reverse(QueueImpl.java:93) at com.tcs.QueueUsingAraay.QueueImpl.main(QueueImpl.java:78) 文件将从Meteor本地存储或(临时)目录中删除。

希望它能帮到你