topics

全部话题 - 话题: boolean
首页 2 3 4 5 6 末页 (共10页)
e****e
发帖数: 418
1
来自主题: JobHunting版 - g 两轮店面面经 失败告终
DFS approach. My code is lousy, the point is to show the DFS approach.
Thanks.
public int[] dFS(TreeNode root ) {
int depth = depth( root );
int[] r = new int[depth];
boolean[] m = new boolean[depth];

if ( root == null )
return r;

dFSCore( root, new MutableInt(0), r, m );

return r;
}

private void dFSCore( TreeNode node, MutableInt level, int[] r, boolean[
] m ) {
if ( node == null )
... 阅读全帖
l*****a
发帖数: 14598
2
我的体会是这种题最好定义一个结构
class Info {
int depth;
boolean balanced;
}
来记录当前子树信息,因为这种题都需要用递归从root一直到leaves.
而且求depth要递归,判断balanced还要递归,最好一次递归就把所需要的值都存下来
类似的还有那道求树中两结点间最大path那题
这是我的code,见笑了
public boolean isBalanced(TreeNode root) {
return depth(root).balanced;
}
public Info depth(TreeNode root) {
if(root==null) return new Info(true,0);
Info leftInfo=depth(root.left);
Info rightInfo=depth(root.right);
boolean bo=(Math.abs(leftInfo.depth-rightInfo.depth)<=1... 阅读全帖
s****0
发帖数: 117
3
我觉得你没有理解人家的思路。这里是我的Java实现,仅供参考。
//- 5.2.3 Generation with minimal changes
package mylib;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class Perm implements Iterable>, Iterator> {
final int n;
final int pos[];
final Integer perm[];
final boolean dir[];
final T[] data;
int cnt;
public Perm(List data) {
this.n = data.size();
pos = new int[n];
perm = new Integer[n];
dir = new boo... 阅读全帖
p*****2
发帖数: 21240
4
来自主题: JobHunting版 - scramble string 怎么用dp 阿?
感觉罗嗦不少,你按照我的java代码改改试试?
public boolean isScramble(String s1, String s2)
{
int n=s1.length();
boolean[][][] dp=new boolean[n][n][n+1];

for(int i=n-1; i>=0; i--)
for(int j=n-1; j>=0; j--)
for(int k=1; k<=n-Math.max(i,j);k++)
{
if(s1.substring(i,i+k).equals(s2.substring(j,j+k)))
dp[i][j][k]=true;
else
{
for(in... 阅读全帖
f*******t
发帖数: 7549
5
来自主题: JobHunting版 - 刚面的,发一个google新题
写了一下,牛算法实现和理解起来挺简单的
import java.util.PriorityQueue;
public class RainWater2D {
private final int[][] directions = {
{1, 0}, {0, 1}, {-1, 0}, {0, -1}
};

private int width, height;

private class Point implements Comparable {
public int x, y, h;
public Point(int y, int x, int h) {
this.y = y;
this.x = x;
this.h = h;
}
@Override
public int compareTo(Point p) {
return h >... 阅读全帖
m*****n
发帖数: 204
6
来自主题: JobHunting版 - Java编程讨论:LinkedIn的H2O

public class ElementsImpl implements IElements {

private final int batchSize;
private final AtomicInteger counter = new AtomicInteger();

ElementsImpl(int i) {
batchSize = i;
}

public int getBatchSize() {
return batchSize;
}
@Override
public void inc() {
counter.incrementAndGet();
}
@Override
public boolean reserve() {
int val = co... 阅读全帖
m*****n
发帖数: 204
7
来自主题: JobHunting版 - Java编程讨论:LinkedIn的H2O

public class ElementsImpl implements IElements {

private final int batchSize;
private final AtomicInteger counter = new AtomicInteger();

ElementsImpl(int i) {
batchSize = i;
}

public int getBatchSize() {
return batchSize;
}
@Override
public void inc() {
counter.incrementAndGet();
}
@Override
public boolean reserve() {
int val = co... 阅读全帖
a**c
发帖数: 52
8
来自主题: JobHunting版 - G家电面题
Boolean checkBasicVowel(char c) {
if (c == ‘a’ || c ==’e’ || c == ‘i’ || c ==’o’ ||
c == ‘u’ || c == ‘A’ || c ==’E’ || c == ‘I’ ||
c ==’O’ ||c == ‘U’)
return True;
}
// check whether it is vowel
Boolean checkVowel(String s, int index){
char c = s.charAt(index);
if (checkBasicVowel(c))
return True;

if (index == 0)
return False;
if (c == ‘y’ || c == ‘Y’) {
if(!checkVowel(s, index - 1))
return True;
return False;
}
return False;
}
... 阅读全帖
h******3
发帖数: 351
9
来自主题: JobHunting版 - leetcode Parlindrome Partition run time error
complain runtime error
Last executed input
"a"
public int minCut(String s){
int count = 0;
ArrayList> res = partition(s);
for(ArrayList subpa : res)
count += subpa.size();
return count;
}
public ArrayList> partition(String s) {
if(s == null || s.length() == 0)
return new ArrayList>();
boolean[][] isPa = new boolean[s.length()][s.length()];
for(int i = 0; i < s.length(); i++){
isPa[i][i] = true;
... 阅读全帖
c***w
发帖数: 134
10
来自主题: JobHunting版 - 请问个算法复杂度
题目是打印n个质数。
请问最简单的这种方法,时间复杂度是多少?谢谢
每一次计算到一个n的数,都要和n个做n个判断所以是n^n吗
/**
* naive way.
* I think it takes O(n^n) time?
*/
public static void prime(int n) {
boolean[] primes = new boolean[n + 1];
for (int i = 2; i < primes.length; i++) {
if (isPrime(i)) {
primes[i] = true;
}
}
print(primes);
}

public static boolean isPrime(int num) {
for (int j = num - 1; j > 1; j--) {
if (num % j ... 阅读全帖
L*******e
发帖数: 114
11
来自主题: JobHunting版 - 问道题: prime factor
综合楼上的解答,我试着写了一个。
/**
* find all the prime up to n(including n)
*/
public static List findPrimes(int n){
List res = new ArrayList();
if (n <= 1) return res;
// create a boolean array to track whether a number
// is a prime or not
boolean[] primeTrack = new boolean[n+1];
for (int i = 2; i <= n; i++){
primeTrack[i] = true;
}
int upper = (int)Math.sqrt(n);
for (int i = 2; i <= upper; i++){
for (int j = i * i; j <= n; j +=... 阅读全帖
x****8
发帖数: 127
12
来自主题: JobHunting版 - MS onsite面经
stack?
public static void main(String[] args) {

XmlParser p = new XmlParser("ABDC");
String s;
Stack> stk = new Stack>();
TreeNode root = null;// = new TreeNode();
while((s = p.getNextTag()) != null){
if(p.isStartTag()){
String str = p.getNextTag();//assert is string tag
TreeNode node = new TreeNode(str);
... 阅读全帖
c********p
发帖数: 1969
13
上代码,大家批斗!
public class Solution {
public boolean isMatch(String s, String p) {
// Start typing your Java solution below
// DO NOT write main() function
if(s == null || p == null){
return false;
}

int slen = s.length();
int plen = p.length();
boolean[][] dp = new boolean[slen + 1][plen + 1];
dp[0][0] = true;
for(int i = 1; i <= plen; i++){
if(p.charAt(i - 1) == '*'){
if( dp[... 阅读全帖
f*******b
发帖数: 520
14
这题是要上DP的,LZ用的方法和我开始一样,但通过不了大数据,不是DP的问题,是所
用算法本身的问题,我改了后就能过大数据了:
public boolean isMatch(String s, String p) {
int count=0;
for(int i=0;i if(p.charAt(i)!='*') count++;
if(count>s.length()) return false;
if(s.length()==0) return true;
if(p.length()==0) return s.length()==0;
boolean[][] blc=new boolean[s.length()+1][p.length()+1];
blc[0][0]=true;
for(int j=1;j for(int i=... 阅读全帖
b********g
发帖数: 28
15
public class Solution {
public boolean isMatch(String s, String p) {
// Start typing your Java solution below
// DO NOT write main() function
if(s == null || p == null) return false;
int m = s.length(), n = p.length();
boolean[][] match = new boolean[m + 1][n + 1];
match[0][0] = true;
for(int i = 1; i <= m; i++){
match[i][0] = false;
}
for(int j = 1; j <= n; j++){
if(p.charAt(j - 1) == '*'){
... 阅读全帖
l****o
发帖数: 315
16
public class Solution {
public boolean wordBreak(String s, Set dict) {
// Note: The Solution object is instantiated only once and is reused
by each test case.
boolean[] f = new boolean[s.length() + 1];
f[0] = true;
for (int i = 0; i <= s.length(); i++)
for (int j = 0; j < i; j++)
if (f[j] && dict.contains(s.substring(j, i))) {
f[i] = true;
break;
}
return f[s.le... 阅读全帖
b**m
发帖数: 1466
17
其实是前几天有人问那个(10)的简化版:
public class Solution {
public boolean wordBreak(String s, Set dict) {
if(s.length()==0){
return dict.contains(s);
}
boolean[] reachable = new boolean[s.length()+1];
reachable[0] = true;

for(int i=0;i if(!reachable[i]){
continue;
}
for(int j=i+1;j<=s.length();j++){
String e = s.substring(i,j);
if(dict.con... 阅读全帖
z*********8
发帖数: 2070
18
这个case老是fail在这个test case:
Submission Result: Runtime Error
Last executed input: "aaaaaaa", ["aaaa","aa"]
谁能帮我看看?
public class Solution {
public boolean wordBreak(String s, Set dict) {
// Note: The Solution object is instantiated only once and is reused
by each test case.
boolean[] result = new boolean[s.length()+1];
result[0] = true;
int size = s.length();

for(int i=1; i <= size; ++i)
{
if(result[i] == false && di... 阅读全帖
p*********y
发帖数: 17
19
来自主题: JobHunting版 - leetcode word break II DFS 超时
优化一下就能过。
==================================================
public class Solution {
public ArrayList wordBreak(String s, Set dict) {
int N = s.length();
ArrayList result = new ArrayList();
if (N == 0) return result;
int maxLen = 0;
for (String str : dict) {
maxLen = Math.max(maxLen, str.length());
}
StringBuilder buffer = new StringBuilder();
HashSet invalid = new HashSet阅读全帖
s*****n
发帖数: 169
20
不用那么复杂。走一遍就行。
public static void main(String[] args) {
int[][] m=new int[][]{{0,0,1,1,1},{0,1,1,1,0},{1,1,1,1,0},{1,0,1,1,1
},{1,1,1,1,1}};
//int[][] m=new int[][]{{0,0,1,1,1},{0,0,1,1,0},{1,1,1,1,1},{1,1,1,1
,1},{1,1,1,1,1}};
System.out.println(getNumberOf0Groups(m,5,5) );
}
public static int getNumberOf0Groups(int[][] m, int col, int row) {
int count = 0;
for (int i = 0; i < row; i++) {
for (int j = 0; j < col; j++) {
... 阅读全帖
p*****3
发帖数: 488
21
低手可以不...
public class Solution {
public boolean isMatch(String s, String p) {
if (s == null || p == null)
return false;

int ls = s.length();
int lp = p.length();
boolean[][] dp = new boolean[ls+1][lp+1];
dp[0][0] = true;

for (int i = 1; i <= p.length(); i++) {
dp[0][i] = (p.charAt(i-1) == '*' ? dp[0][i-2] : false);
}

for (int i = 1; i <= ls; i++) {
for (int j = 1; j... 阅读全帖
s********x
发帖数: 914
22
来自主题: JobHunting版 - 问一下OJ的Anagrams那道题
Time Limit Exceeded了
但感觉已经cache了intermediate result了
是不是这题assume只是26个小写英文字母呢,如果是的话,用array就更快?
贴一下code
class AnagramString {
boolean visited;
String str;
private Map map = null;

AnagramString(String s) {
this.str = s;
}

boolean isAnagram(String s) {
if (this.map == null) {
this.map = new HashMap(this.str.length());
for (int i = 0; i < this.str.length(); i++) {
char c =... 阅读全帖
a*********4
发帖数: 7
23
来自主题: JobHunting版 - 一道面试题
a java solution:
import java.util.*;
public class FindNonDupeSubTree {
private class Node{
int val;
Node left;
Node right;
Node (int val){
this.val = val;
left = null;
right = null;
}
}

public boolean FindSubTree(Node root, Set nodeSet, ArrayList<
Integer> validTreeRoots){
if (root == null)
return true;
Set sleft = new HashSet();
Set ... 阅读全帖
a*********4
发帖数: 7
24
来自主题: JobHunting版 - 一道面试题
a java solution:
import java.util.*;
public class FindNonDupeSubTree {
private class Node{
int val;
Node left;
Node right;
Node (int val){
this.val = val;
left = null;
right = null;
}
}

public boolean FindSubTree(Node root, Set nodeSet, ArrayList<
Integer> validTreeRoots){
if (root == null)
return true;
Set sleft = new HashSet();
Set ... 阅读全帖
y**********a
发帖数: 824
25
来自主题: JobHunting版 - codility一道题
public int largestSet(int[]A) {
int rel=0;
int[]dp=new int[A.length];
boolean[]v=new boolean[A.length];
for (int i=0;i if (!v[i]) rel=Math.max(rel, fillCycle(A, v, dp, i));
return rel;
}
int fillCycle(int[]A, boolean[]v, int[]dp, int i) {
int j=i;
for (j=i;!v[j];j=A[j]){
if (dp[j]!=0) return dfs(A, dp, i);
v[j]=true;
}
int count=1,k=A[j];
for (;k!=j;k=A[k]) ++count;
for (k=A[k];k!=j;k=A[k])dp[k]=count;
dp[j]=count;
return dfs(A, dp, i);
}
int dfs(int[]A, int[]dp, int i) {
if (dp[i]... 阅读全帖
g****9
发帖数: 163
26
GNode的定义是这个。adjacencyMatrix 是N*N的matrix,N是Node的个数。比如
int[][] adjacencyMatrix = {{1, 1, 0, 0, 1, 0},{1, 0, 0, 0, 1, 0},{0, 0, 0, 0
, 0, 0},{0, 0, 0, 0, 1, 1},{1, 1, 0, 1, 0, 0},{0, 0, 0, 1, 0, 0}}; 这个
matrix分别有6个node,每个node的value是1,2,3,4,5,6.定义的这个graph class我是
想用来验证关于graph的code的正确不,所以想简单化node 的value,让自动取i+1作为
node的value值。
class GNode {
private int val;
private boolean discovered;
private ArrayList adj;
public GNode (int x) {
val = x;
adj = new ArrayList阅读全帖
f****9
发帖数: 506
27
来自主题: JobHunting版 - L店面
Java 的 boolean不是不一定比int短么?
我说用bits,面试官说用boolean。我说不知道java的boolean多长,然后就没话说了。
碰上sb的面试官自认倒霉。
当然我自己水平也不咋地。。。
t**r
发帖数: 3428
28
public class T10 {
static boolean matchFirst(String s, String p){
System.out.println("in matchFirst: s is "+s+",p is: "+p+";");
System.out.println("s is empty "+ s.isEmpty());
System.out.println("p is empty "+ p.isEmpty());
if(s.isEmpty() ^ p.isEmpty()) return false;
if(s.isEmpty() && p.isEmpty()) return true;
return ( s.charAt(0)==p.charAt(0) || p.charAt(0)=='.' );
}
public static boolean isMatch(String s, String p) {
if (p.i... 阅读全帖
S*******C
发帖数: 822
29
这答案不对,看我测试结果,IntFileIterator对象是mutable的
[1, 2, 3, 4, 5, 9, 8, 7, 6]
[1, 2, 3, 4, 5, 4, 8, 7, 6]
true
=====================
[1, 2, 3, 4, 5, 9, 8, 7, 6]
[1, 2, 3, 4, 5, 9, 7, 6]
false
=====================
[1, 2, 3, 4, 5, 9, 8, 7, 6]
[1, 2, 3, 4, 5, 9, 8, 7, 1, 6]
false
=====================
[1, 2, 3, 4, 5, 9, 8, 7, 6]
[1, 2, 3, 4, 5, 9, 8, 7, 6, 3, 2]
false
=====================
[1, 2, 3, 4, 5, 4, 8, 7, 6]
[1, 2, 3, 4, 5, 9, 7, 6]
false
=====================
[1, 2, 3, 4, 5, 4, 8, 7, 6]
[1, 2, 3, ... 阅读全帖
m*****g
发帖数: 71
30
JUnit test 代码
public class SolutionTest {
@Test
public void test() {
int[] a;
int[] b;
boolean expect;
Solution s = new Solution();
//both empty
a = new int[] {};
b = new int[] {};
expect = true;
testSolution(s, a, b, expect);
//empty and 1 element
a = new int[] {};
b = new int[] {1};
expect = true;
testSolution(s, a, b, expect);
//empty and 2 element all 0s
a =... 阅读全帖
b**********5
发帖数: 7881
31
boolean isPalinRecursiveHelper(String s, int[] left, int right) {
if (right >= s.length()) return true;
if (left[0] > right) return true;
boolean isPalin = isPalinRecursiveHelper(s, left, right+1);
if (isPalin==false) return false;
isPalin = (s.charAt(left) == s.charAt(right));
left[0] = left[0]+1;
return isPalin;
}
boolean isPalindrome(String s) {
String sTrimmed = s.trim();
int[] left = new int[1]; left[0] = 0;
return isPalinRecursiveHelper(s, left, 0);
... 阅读全帖
x******8
发帖数: 48
32
来自主题: JobHunting版 - FB Onsite新题,有人能看看吗?
根据mitkook2大神的代码改了一下,思路是一致的,大家参考一下
// O(n*k) time, O(n) space
boolean alibaba(int numCaves, int[] strategy) {
// survival[i] means theft can be in spot i or not on this day
boolean survival[] = new boolean[n + 2];

// init the first day
// 在头尾加一个房间,且小偷不可能出现在这两个房间(为了处理下面j - 1
和j + 1越界的情况)
Arrays.fill(survival, true);
survival[0] = false;
survival[n + 1] = false;
survival[strategy[0]] = false;

for (int i ... 阅读全帖
y****z
发帖数: 52
33
来自主题: JobHunting版 - google 电面fast phone book loopup
你这个方法就是用两个HASHMAP 一个记录已经存在的 一个记录未存在的
所以这三个functions都是O(1) 空间O(N)
我想了一下 用trie最好
Class TrieNode{
boolean visited;
TrieNode[] children;
public TrieNode(){
visited=false;
children=new TrieNode[10];
}
}
插入的时候把该节点标记为visited
顺便记录父节点 然后扫描父节点下的所有子节点 如果都是visited就把父节点也标记
为visited
查找不说了
第三个方法的话就变成寻找一个visited=false的叶子就好了(假设号码10位数)
如果一个节点的visited=false 那么必然存在available的子节点
static class TrieNode{
boolean visited;
TrieNode[] children;

public TrieNode(){
visited=fal... 阅读全帖
j**********0
发帖数: 20
34
来自主题: JobHunting版 - G的一道考题
public static class BinaryNode{
BinaryNode leftChild;
BinaryNode rightChild;
int val;
public BinaryNode(int val) {
super();
this.val = val;
}

}

public int find(BinaryNode node, int from, int to){
int[] inRangeSubTree=new int[1];
find(node, from, to, inRangeSubTree);
return inRangeSubTree[0];
}

public boolean find(BinaryNode node, int from, int to, int[]
inRangeSubTree){
... 阅读全帖
k****r
发帖数: 807
35
来自主题: JobHunting版 - 问一个面试题
kao,写了一个小时。。。。大致就是这样的代码,比较丑,不知道有没有更好的办法:
public class board88 {
public static List> findBoardPath(Point start, Point end,
int k) {
Map>> map = new HashMap<>();
boolean[][] visited = new boolean[8][8];
return findHelper(visited, start.row, start.col, k, end, map); //
return the path list from the point(i, j) to end in k steps.
}
public static List> findHelper(boolean[][] visited, int i,
int j, int k, Point end... 阅读全帖
y*******5
发帖数: 887
36
来自主题: JobHunting版 - 求指点一道G家Iterator的题目
用composition pattern:
1:---
package NestedIterator;
public interface NestedNodeList extends Iterable {
}
2:---
package NestedIterator;
import java.util.Iterator;
public class Node implements NestedNodeList {
private E val;
public Node(E val) {
this.val = val;
}
@Override
public Iterator iterator() {
return new NodeIterator();
}
private class NodeIterator implements Iterator {
private boolean iterated = false;
@Override... 阅读全帖
m******y
发帖数: 219
37
来自主题: JobHunting版 - 求指点一个G家题
照着leetcode原题改的,这个case可以过,但是仅仅用curr_res == target来加入结果
感觉不够,必须要所有的数都visited。
public class Solution {
public static void main(String[] args) {
int[] nums = {1,2,3, 60, 7};
System.out.println(get(nums, 48));
}
public static List get(int[] nums, int target) {
List result = new ArrayList<>();
if (nums == null || nums.length == 0) return result;
boolean[] visited = new boolean[nums.length];
helper(nums, 0, 0, target, visited, ... 阅读全帖
a**d
发帖数: 64
38
来自主题: JobHunting版 - 问两道fb题
第一题的java答案抄了一个,运行通过的。
https://github.com/nagajyothi/InterviewBit/blob/master/DynamicProgramming/
AvgSet.java
各路大神看看还有没有更优解。
// Sum_of_Set1 / size_of_set1 = total_sum / total_size, and so, Sum_of_Set1
= size_of_set1 * total_sum / total_size.
// Now we can just iterate on size_of_set1, and we would know the required
Sum_of_Set1.
static List res = new ArrayList();
static boolean[][][] dp;
public static List> partitionAverage(int[] num) {
List阅读全帖
J*****v
发帖数: 314
39
终于做出来了,这题用来刷掉三哥效果最好
public class Solution {
public boolean minSquaredSmallerThanMax(int[] nums) {
int min = Integer.MAX_VALUE, max = Integer.MIN_VALUE;
for (int num : nums) {
min = Math.min(min, num);
max = Math.max(max, num);
}
return (long) min * min < max;
}
public int minDelectionFromFront(int[] nums) {
if(minSquaredSmallerThanMax(nums)) {
return 0;
}
int len = nums.length;
do... 阅读全帖
H**********5
发帖数: 2012
40
whole code:
package Interview.PhoneInterview.LinkedIn.Tree.BTree.Recurse.
LowestCommonAncestor;
import java.util.HashMap;
import java.util.Map;
class BTreeNodeWithParent{

int val;
BTreeNodeWithParent left;
BTreeNodeWithParent right;
BTreeNodeWithParent parent;
BTreeNodeWithParent(int val){
this.val=val;
this.left=this.right=this.parent=null;
}
}
public class LowestCommonAncestorOfABinaryTreeWithParent {
BTreeNodeWithParent LCA(BTreeNodeWithParent p... 阅读全帖

发帖数: 1
41
来自主题: JobHunting版 - 请问一道题:leetcode 416题的扩展
题目说的是等分数组,所以可以转化成找到 和为 sum / 2 的子数组。
回溯法可以找到全部子数组,参考第39题。
没看懂第二问在问什么。
此题代码如下:
class Solution {
public boolean canPartition(int[] nums) {
int sum = Arrays.stream(nums).sum();
if (sum % 2 == 1) return false;
int tar = sum / 2;
boolean[] dp = new boolean[tar + 1];
dp[0] = true;
for (int n : nums) {
for (int i = tar; i >= n; i--) {
dp[i] = dp[i] || dp[i - n];
}
}
return dp[tar];
}
}
A**l
发帖数: 2650
42
来自主题: Reunion版 - 晕,160网站硬盘满了。。。
【 以下文字转载自 Visa 讨论区 】
发信人: Aawl (宝宝蛋-湾野分舵~), 信区: Visa
标 题: 晕,160网站硬盘满了。。。
发信站: BBS 未名空间站 (Sat Sep 7 23:42:22 2013, 美东)
老丈人说有个信息错了,刚才去改,结果。。。
There is not enough space on the disk.
哎,是不是要等周一了。。。已经预约了下周三面签。。。郁闷ing。。。
Server Error in '/QotW' Application.
There is not enough space on the disk.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception ... 阅读全帖
A**l
发帖数: 2650
43
来自主题: Visa版 - 晕,160网站硬盘满了。。。
老丈人说有个信息错了,刚才去改,结果。。。
There is not enough space on the disk.
哎,是不是要等周一了。。。已经预约了下周三面签。。。郁闷ing。。。
Server Error in '/QotW' Application.
There is not enough space on the disk.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.IO.IOException: There is not enough space on the
disk.
Source Error:
An unhandled exception was generate... 阅读全帖
s******g
发帖数: 5074
44
来自主题: TrustInJesus版 - 基督徒和非基督徒做朋友吧
public class trustInJesus {
/**
* Author@leonany
*/
static String Christian;
static String NormalPerson;
static String mitbbs;

private static boolean Abuse(String abuser, String victims){
return true;
}

private static boolean Sue(String victims, String abuser){
return true;
}

private static boolean Spam(String aPerson){
return true;
}

private static void FreeTalk(){

if(Abuse(Christian,No
w***n
发帖数: 4358
45
☆─────────────────────────────────────☆
sweetww (甜麦圈) 于 (Mon Dec 6 18:52:40 2010, 美东) 提到:
rt
☆─────────────────────────────────────☆
somekiss (負二代) 于 (Mon Dec 6 19:34:05 2010, 美东) 提到:
美女

☆─────────────────────────────────────☆
PINKBULE (PINKBULE) 于 (Mon Dec 6 20:07:40 2010, 美东) 提到:
钱,有了钱,撒子就都有了,美铝,帅锅,钻石,larmer,整容手术。。。
☆─────────────────────────────────────☆
Viaaa (大V) 于 (Mon Dec 6 22:00:48 2010, 美东) 提到:
想要买漂亮衣服,可是现在身材不好,穿什么都不好看,很苦恼
☆─────────────────────────────────────☆... 阅读全帖
w***n
发帖数: 4358
46
☆─────────────────────────────────────☆
happymichael (something new) 于 (Tue Jan 18 11:31:43 2011, 美东) 提到:
都有什么啊?
外面太冷, 不适合户外活动啊
☆─────────────────────────────────────☆
happymichael (something new) 于 (Tue Jan 18 11:32:20 2011, 美东) 提到:
倒是想去南边旅游,就是机票太贵

☆─────────────────────────────────────☆
nickbear (nick) 于 (Tue Jan 18 11:36:27 2011, 美东) 提到:
我最近买了kinect,跑步机,weighting set
供参考
☆─────────────────────────────────────☆
mittim (阿诺舒华辛力加) 于 (Tue Jan 18 11:41:20 2011, 美东) 提到:
ski嘛
☆──... 阅读全帖
l*******g
发帖数: 4894
47
来自主题: CS版 - 若问JAVA问题~
正确的方法是用Integer.compareTo(Integer). return value 是然后作boolean。这里
为什么你不能直接做boolean运算是因为java本身的无平台性特点有关系。这里你如果
用& ^之类的是在做bitand bitwise,是二进制的, &&和&不一样,一个是逻辑求和一
个是bit运算。所以这里当你用int && int的时候 java 检查的结果认为int不是
boolean所以就报错啦。所以你要用0,1的时候用 &
c*******e
发帖数: 5818
48
试了这个,报错,
Set-SmbServerConfiguration -EnableSMB1Protocol $trueSet
Set-SmbServerConfiguration : Cannot process argument transformation on
parameter 'EnableSMB1Protocol'. Cannot convert
value "" to type "System.Boolean". Boolean parameters accept only Boolean
values and numbers, such as $True, $False, 1
or 0.
At line:1 char:48
+ Set-SmbServerConfiguration -EnableSMB1Protocol $trueSet
+ ~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Set-SmbSer... 阅读全帖
a*o
发帖数: 19981
49
i fule u......你自己好好看看我贴的cmd,再好好瞅瞅你那cmd


: 试了这个,报错,

: Set-SmbServerConfiguration -EnableSMB1Protocol $trueSet

: Set-SmbServerConfiguration : Cannot process argument transformation on

: parameter 'EnableSMB1Protocol'. Cannot convert

: value "" to type "System.Boolean". Boolean parameters accept only
Boolean

: values and numbers, such as $True, $False, 1

: or 0.

: At line:1 char:48

: Set-SmbServerConfiguration -EnableSMB1Protocol $trueSet

: ... 阅读全帖
n*m
发帖数: 23
50
来自主题: Java版 - Can Java thread return a value?

It can be calculated in the new thread. My sample is a typical asynchronous
call. So, you may get invalid value from the call since the new thread may not
finish.
However, there are many ways to get a "correct" value. Here is a sample
public class MyValue {
boolean ready=false;
int realvalue;
public boolean getReady() {
return ready;
}
public void setReady (boolean ready) {
this.ready = ready;
}
}
...
MainThread:
MyValue returnValue = myThread.run();
while
首页 2 3 4 5 6 末页 (共10页)