|
l*********y 发帖数: 142 | 2 #include
#include
#include
#include
#include
#include
#include
using namespace std;
class Counter {
public :
Counter() {
counter = 0;
}
void increment() {
counter++;
}
void decrement() {
counter --;
}
int getValue() {
return counter;
}
private:
int counter;
};
class COWString {
public:
COWString() {
pointer = NULL;
rc = new Counter();
}... 阅读全帖 |
|
p***r 发帖数: 920 | 3 purpose: 想要做一个macro 循环调用 display, 输出不同的 survey answer as text,
然 后再根据其内容,人工的输入yes/no,以便于以后的数据分析。
problem: 整个 macro 可以运行,唯一的问题是,display 的 window 在循环调用的时
候不能正确的显示 survey answer. (我是将所有的 survey answer 输出到一连串
macro variable 里面去)。
Any solution or suggestion in proving the code is appreciated
code is here
################################
data surveydata;
input x $40.;
cards;
This is programe is useless
I dont think so
Maybe its usefull
Not very much
;run;
%macro survey;
data _null_;
set surveydat... 阅读全帖 |
|
l*****a 发帖数: 14598 | 4 刚才面了个contractor
面了道简单的,print binary tree level by level
为节省时间,直接让他去collabedit,我干我的工作
class node{
private int data;
private Node left;
private Node right;
private node parent;
private int level;
public LinkedList listofNode;
public int getData()
{
return this.data;
}
public node getLeftNode()
{
return this.left;
}
public node getRightNode()
{
return this.right;
}
public printTree(Node node )
{
... 阅读全帖 |
|
M******1 发帖数: 90 | 5 import java.util.ArrayList;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
public class UberTest {
List data = new ArrayList<>();
public void fillData(){
//Use integer to denote Time here.. you can change it to DateTime
type.
data.add(new TimedKvPair(new KvPair("name1","Bnn"), 1) );
data.add(new TimedKvPair(new KvPair("name2","Dee"), 2) );
data.add(new Time... 阅读全帖 |
|
n*****3 发帖数: 15 | 6 新手刚开始vb.net不到一年,event handler部分还很困惑。手头有一个project, 是一
个windowsCE版的application.我的工作是把它转成windows application will be
running on win 7 os, 所有程序都不用改,只是event handler process 要改, 因为
不同os系统。
app是这样的,main form只包括一些button, click the button to open secondary
level forms, these forms will handle the sanner event, and based on the data
input, 3rd level forms could be open from some point and handle scanner
event too.
main form will just initial scanner class, no data handler. the secondary
and third level fo... 阅读全帖 |
|
n*****3 发帖数: 15 | 7 新手刚开始vb.net不到一年,event handler部分还很困惑。手头有一个project, 是一
个windowsCE版的application.我的工作是把它转成windows application will be
running on win 7 os, 所有程序都不用改,只是event handler process 要改, 因为
不同os系统。
app是这样的,main form只包括一些button, click the button to open secondary
level forms, these forms will handle the sanner event, and based on the data
input, 3rd level forms could be open from some point and handle scanner
event too.
main form will just initial scanner class, no data handler. the secondary
and third level fo... 阅读全帖 |
|
c*****t 发帖数: 1879 | 8 There are two cases I know of
1. Return parameter cannot be specified at parent. For example,
class ComponentSampleModel; //parent
class ByteComponentSampleModel extends ComponentSampleModel
{
public byte[] getData ();
}
class ShortComponentSampleModel extends ComponentSampleModel
{
public short[] getData ();
}
// also int version
Parent knows exactly what the possible children are (byte, short, int),
can code algorithms in one place (rather than repeated 3 times) at
parent le |
|
b**l 发帖数: 51 | 9 No Need JNI. try this:
===
/*
* @(#)WinRegistry.java 1.4 03/12/19
*
* Copyright (c) 2004 Sun Microsystems, Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
met:
*
* -Redistribution of source code must retain the above copyright notice,
this
* list of conditions and the following disclaimer.
*
* -Redistribution in binary form must reproduce the above copyright notice,
* th... 阅读全帖 |
|
m********0 发帖数: 2717 | 10 also a. Consider the following.
Adding an overloading constructor does matter in this case.
#include
using std::cout; using std::endl;
class a{
public:
a(int val): data(val){}
//a(double val): data(val){}
void getData(){cout << data << endl;}
private:
double data;
};
int main()
{
a aa(1.1);
aa.getData();
return 0;
}
the c
recompiling |
|
p********a 发帖数: 5352 | 11 %macro getdata(tic);
FILENAME myurl URL "http://ichart.finance.yahoo.com/table.csv?s=&tic";
DATA &tic;
INFILE myurl FIRSTOBS=2 missover dsd;
format date yymmdd10.;
INPUT Date: yymmdd10. Open High Low Close Volume Adj_Close ;
*if date>=today()-180;
RUN;
%mend;
%getdata(SPY); |
|
T*******i 发帖数: 4992 | 12 【 以下文字转载自 Joke 讨论区 】
发信人: TaiYouCai (有才), 信区: Joke
标 题: 汗~~售价4000多人刀 (548美刀)的意大利潮包
发信站: BBS 未名空间站 (Tue Sep 6 18:19:35 2011, 美东)
发信人: cocoon8892 (Christine), 信区: shopping
标 题: 汗~~售价4000多人刀 (548美刀)的意大利潮包
发信站: BBS 未名空间站 (Tue Sep 6 16:41:59 2011, 美东)
看看这个“伟大”的设计。。。
http://www.luisaviaroma.com/index.aspx?
#getData.aspx|CallType=Product&prodId=L8L1&des=L8L&cat=&gender=men&group=&
vendorColor=TkVSTw==&season=actual&seasProdID=52I |
|
b********e 发帖数: 215 | 13 for example;
tempalte
class Node
{
public:
T data;
Node *next;
Node(const T &item,Node *n):data(item),next(n)
}
还是:
tempalte
class Node
{
private:
T data;
Node *next;
public:
getData;
setData;
getNext;
setNext;
Node(const T &item,Node *n):data(item),next(n)
}
一般来说成员变量应写成私有的,但像这种简单的类,面试时有必要写成私有的吗? |
|
a**q 发帖数: 3 | 14 一共5个人,其中3.5个人考coding,数据结构和算法。1.5个人考设计。
coding考了recursion, DP, 二叉树bfs,简单的hash一类的。因为写程序比较快,一共
答了7,8道coding题,难度不超过cracking the code,感觉基本答得还可以,难一点的
题bug还算少,而且跟面试官解释了一些边界情况为什么没有比这么写更简洁的方法,
除了最后一个面试官很变态。考了两个很简单无难度的code让写,顺序写完(不给时间
检查)以后叫不许动,拍照,然后说你的code有bug,虽然我很快给找出来了,但是给
拍照了。其实最后一个面试官的时候已经有点晕了,他早点说需要一次写对我就会写慢
些,可是他也没有说。。。
然后栽在一道large scale的设计题上。绝对不是所有的面试官都让你随意发挥,有的
人心里装了一个答案,问的很模糊,你不答到他那个答案他就是不满意。不知道如何解
决这种情况。大概问答过程如下:
He: how would you design a distributed key-value store
Me: DHT or just using clust... 阅读全帖 |
|
b*****o 发帖数: 715 | 15 说说我看到你答案的感想吧:
He: how would you design a distributed key-value store
Me: DHT or just using clusters
我不知道这一问一答是你简化过了还是实际就这么简单。如果实际就这么简单,
回答就很有问题。一般问一个设计题,是先要把问题的各种要求先和面试官讨
论清楚。你这么回答就好像考官问如果搜索速度太慢怎么办,你回答说用
cache一样(正确的回应是先讨论哪个环节慢了)。而对于这个问题我觉得首
先应该问清楚这个系统有多大,有多少Machine,有没有balance的要求,会
不会add或者delete整个machine,等等。
然后,即使在问清楚条件的情况下,也不要马上给一个specific的方案,而是
依旧泛泛地谈大致有几类思路。然后根据考官的反应,再说具体的技术细节。
He: details?
Me: we have a large number of machines. first we use a hash function to
retrieve machine ID from the key... 阅读全帖 |
|
c*****a 发帖数: 808 | 16 那个貌似多余的
我照着你想法写的
static int i=0;
public void findKth(BSTNode node, int k){
if(node == null) return;
findKth(node.right, k );
i++;
if(i==k) System.out.println(node.getData());
findKth(node.left, k );
} |
|
d*********g 发帖数: 154 | 17
如果已经找到kth max了,就可以停了吧:
if(i==k)
{
System.out.println(node.getData());
return;
} |
|
w**********2 发帖数: 20 | 18 大家好,5天前,hc 送审的时候, 纠结通过率,搜到了这个网站,(这网站在新加坡
貌似没什么人用) 相见恨晚。。 3天前,写了onsite 小面筋,想求个祝福。可惜新注
册的用户,禁言三天,没有发上来。三天后,hc 的结果出来了, 还要加一轮。不管机
率如何, 既然还有希望,准备拼一枪。
“our profile was actually reviewed at our hiring committee in the US this
morning and I just received the results. The committee has actually decided
they need some additional data through a couple more interviews.
Accordingly, I'd like to set up 2 more interviews for you, these interviews
will be focused on system design and open ended questions.”
看了版上... 阅读全帖 |
|
w**********2 发帖数: 20 | 19 大家好,5天前,hc 送审的时候, 纠结通过率,搜到了这个网站,(这网站在新加坡
貌似没什么人用) 相见恨晚。。 3天前,写了onsite 小面筋,想求个祝福。可惜新注
册的用户,禁言三天,没有发上来。三天后,hc 的结果出来了, 还要加一轮。不管机
率如何, 既然还有希望,准备拼一枪。
“our profile was actually reviewed at our hiring committee in the US this
morning and I just received the results. The committee has actually decided
they need some additional data through a couple more interviews.
Accordingly, I'd like to set up 2 more interviews for you, these interviews
will be focused on system design and open ended questions.”
看了版上... 阅读全帖 |
|
U**m 发帖数: 313 | 20 1, 问了Evaluate Reverse Polish Notation的题目,但是并不是仅仅做一个函数算出
答案,而是说你要怎么样设计各个class,以及互相之间怎么联系。
2, 假设有两个Queue,不停的在进出数据。每个有一个getdata()的函数,返回一个数
据包括了时间以及一个字符串。如果从Queue1的数据的时间和Queue2的数据的时间相差
1秒的话,把两个字符串输出。
3, 如果我有一个网站,卖东西的,跟Amazon差不多这种,然后用户再抱怨我的网站非
常慢,然后聘了你当技术总工,你要怎么样改进?
4, 给一个日期,用字符串表示,比如20140608,求这个日期所在的星期的最后一天。
先说了说算法,然后再到机器上实际把这个已经有的程序debug出来。
求教应该什么方向去学习。尤其对于第3题,应该怎么解答。 |
|
c********2 发帖数: 377 | 21 看看这个“伟大”的设计。。。
http://www.luisaviaroma.com/index.aspx?
#getData.aspx|CallType=Product&prodId=L8L1&des=L8L&cat=&gender=men&group=&
vendorColor=TkVSTw==&season=actual&seasProdID=52I |
|
|
|
T*******i 发帖数: 4992 | 24 【 以下文字转载自 shopping 讨论区 】
发信人: cocoon8892 (Christine), 信区: shopping
标 题: 汗~~售价4000多人刀 (548美刀)的意大利潮包
发信站: BBS 未名空间站 (Tue Sep 6 16:41:59 2011, 美东)
看看这个“伟大”的设计。。。
http://www.luisaviaroma.com/index.aspx?
#getData.aspx|CallType=Product&prodId=L8L1&des=L8L&cat=&gender=men&group=&
vendorColor=TkVSTw==&season=actual&seasProdID=52I |
|
g***j 发帖数: 40861 | 25 【 以下文字转载自 Military 讨论区 】
发信人: TaiYouCai (有才), 信区: Military
标 题: 汗~~售价4000多人刀 (548美刀)的意大利潮包 (转载)
发信站: BBS 未名空间站 (Tue Sep 6 18:20:11 2011, 美东)
发信人: TaiYouCai (有才), 信区: Joke
标 题: 汗~~售价4000多人刀 (548美刀)的意大利潮包
发信站: BBS 未名空间站 (Tue Sep 6 18:19:35 2011, 美东)
发信人: cocoon8892 (Christine), 信区: shopping
标 题: 汗~~售价4000多人刀 (548美刀)的意大利潮包
发信站: BBS 未名空间站 (Tue Sep 6 16:41:59 2011, 美东)
看看这个“伟大”的设计。。。
http://www.luisaviaroma.com/index.aspx?
#getData.aspx|CallType=Product&prodId=L8L1&des=L8L&cat=&gender=men&grou
... 阅读全帖 |
|
|
b******y 发帖数: 1684 | 27 not sure what u r talking about.....
but let me try to answer...
basically for the data part, the jsp page would have things like
backendData.field1 |
backendData.field2 |
backendData.field3 |
while the controllers (action class) define where you can the backendData,
for example, SController.execute() would call SBusDelegate.getData()...
what UI framework u use? |
|
F****n 发帖数: 3271 | 28 The "standard" solution is to use
Object getData()
Since you are using primitive array and reflection you have to cast it anyway.This way you don't need reflection. |
|
|
l**********n 发帖数: 8443 | 30 【 以下文字转载自 Programming 讨论区 】
发信人: loganfreeman (Now we are one!), 信区: Programming
标 题: state::update的用法是Java 8吗
发信站: BBS 未名空间站 (Sun Sep 21 23:47:19 2014, 美东)
state::update的用法是Java 8吗?
state is an Object, :: is used to reference the function and return a
reference to the function of an Object and can be passed as a parameter.
I am not sure, so to ask here
class ExampleState implements Serializable {
private final ArrayList events;
...
public void update(Evt evt) {
even... 阅读全帖 |
|
t*********e 发帖数: 630 | 31 package org.converter;
import java.net.URI;
import java.net.URISyntaxException;
import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
import javax.faces.convert.ConverterException;
import javax.faces.convert.FacesConverter;
@FacesConverter("org.converter.UrlConverter")
public class UrlConverter implements Converter {
@Override
public Object getAsObject(FacesContext facesContext,
... 阅读全帖 |
|
t*********e 发帖数: 630 | 32 package org.converter;
import java.net.URI;
import java.net.URISyntaxException;
import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
import javax.faces.convert.ConverterException;
import javax.faces.convert.FacesConverter;
@FacesConverter("org.converter.UrlConverter")
public class UrlConverter implements Converter {
@Override
public Object getAsObject(FacesContext facesContext,
... 阅读全帖 |
|
c**t 发帖数: 2744 | 33 下面这一段code在W2k3下运行一段时间就停止了(没有新的timestamp打印到stdout),
可能是怎么回事?
#!C:\perl\bin -w
use strict;
my ($t1, $t2, $dt);
my $DIR = 'C:\Scripts';
my $PHP = 'C:\PHP\php.exe';
my $SRC = 'getData.php';
my $INTERVAL = 3;
chdir($DIR);
my $i = 0;
while(1)
{
$t1 = time;
system($PHP, $SRC);
$t2 = time;
$dt = ($INTERVAL * 60) - ($t2 - $t1);
if($dt > 0)
{
print "[", scalar(localtime(time)), "] Sleeping $dt seconds\
n";
sleep( $dt );
|
|
j****h 发帖数: 6 | 34 Hi:
I am on an aspx.vb code behind. need to make a side request which
returns (I believe a stream of) xml reponse.
Below are my sample codes
Dim excel As New CapitalIQ.Excel.Web.GetData()
Dim context As System.Web.HttpContext
Dim filename As String = String.Empty
Dim url As String = String.Empty
Dim queryString As String = String.Empty
'will initialize filename, url, querystring later
Dim request As New Sys |
|
w*******s 发帖数: 96 | 35 I want to use Javascript to change HTML id:
var td1 = document.createElement("td");
td1.ondragstart="drag(event)";
but it didn't work out. What's wrong?
|
|