由买买提看人间百态

topics

全部话题 - 话题: obj
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)
s*****h
发帖数: 44903
1
可喜可贺呀
大巨人捡到宝了
班上铁杆酱紫粉丝不发一轮包子
孤峰我说你呢
看了看当年选秀WR:
4号秀 Watkins
7号秀 Evans
12号秀 OBJ
水牛和罢课会不会有点后悔
不过OBJ如果去这俩烂队
就废了
m***t
发帖数: 22
2
来自主题: WmGame版 - 钱超了!
Too deep recursion.
program: adm/daemons/chinesed.c, object: adm/daemons/chinesed, file: /adm/daemons/chinesed.c:76
' do_balance' in ' std/room/bank.c' (' d/snow/bank') /std/room/bank.c:93
' chinese_number' in 'adm/obj/simul_efun.c' (' adm/obj/simul_efun') /adm/simul_efun/chinese.c:4
' chinese_number' in 'adm/daemons/chinesed.c' ('adm/daemons/chinesed') /adm/daemons/chinesed.c:76
怎么办??!!
T*********n
发帖数: 1361
3
我也稀饭达达的南方。。。
http://www.xiami.com/song/play?ids=/song/playlist/id/383843/obj
彭坦单飞以后结婚了,歌曲欢乐了很多。就好比当年那个创作《在别处》
,《我的秋天》的许巍,现在只能唱唱《蓝莲花》。。。彭坦的《孔雀》还行:
http://www.xiami.com/song/play?ids=/song/playlist/id/387623/obj
m*****k
发帖数: 1864
4
来自主题: Apple版 - 传Mac OS X 10.7将进行大变动

估计这样做Adobe会震怒。可能PDF什么的License都写上不许用在Obj-C的平台上,就像
苹果License里说App必须是Obj-C,javascript,C++开发一样。
d****p
发帖数: 685
5
来自主题: Apple版 - Mac is superior
? I guess Apple is already supporting GC in obj c 2.0. Of coz you have a
choice whether or not to enable in Xcode.
Guess LZ was talking about the guy implementing GC in obj c.
a***y
发帖数: 19743
6
☆─────────────────────────────────────☆
miroku (Neil) 于 (Mon Nov 1 10:07:48 2010, 美东) 提到:
发信人: miroku (Neil), 信区: PDA
标 题: Android操作系统第三季在美市场份额达44%
发信站: BBS 未名空间站 (Mon Nov 1 10:07:31 2010, 美东)
市场调研公司NPD最新发布的统计数据显示,今年第三季度,谷歌Android操作系统已成
为美国移动操作系统市场最流行的操作系统。
NPD 的统计数据显示,今年第三季度,安装Android操作系统的手机占据了美国手机销
售总量的44%,较第二季度增长了11个百分点。NPD的统计数据或许 会令苹果迷感到不
满,但Android操作系统的份额可能主要来自于RIM的损失。NPD的数据显示,RIM第三季
度市场份额下滑了6个百分点,市场占有 率滑落至22%;苹果iOS操作系统增长了1个百
分点,市场份额上升至23%。
对苹果和RIM而言,安慰奖是两家公司的手机分别占据了最流行手机的前两位。NPD表示
... 阅读全帖
n*****t
发帖数: 22014
7
来自主题: BuildingWeb版 - 简单的jquery/table/mysql网站模版
// ajax.php
// http://myhost.com/ajax.php?admin=user&pass=passwd&query=select * from table
function pre_encode(&$item, $key) {
if (is_string ( $item ))
$item = mb_encode_numericentity ( $item, array ( 0x80, 0xffff, 0,
0xffff ), 'UTF-8' );
}
$user = $_REQUEST ['user'];
$pass = $_REQUEST ['pass'];
if ($user != 'admin' || $pass != 'passwd')
die ( "incorrect passwd" );
$ret = mysql_connect ( "localhost", "root", "passwd" ) && mysql_select_db (
"database" ) && mysql_set_charset ... 阅读全帖
a***n
发帖数: 1
8
int* LinearSuffixSort(char*& inputString, int& stringLength);
Modify the statement:
cout << LinearSuffixSort(fileName,7) << endl;
to
int i=0;
cout << LinearSuffixSort(fileName,i) << endl;
This is because the function prototype is
int* (char*& , int&);
Whenever you want to reference to som obj, you have to allocate memory for
that obj first.
c**t
发帖数: 2744
9
来自主题: DotNet版 - nHibernate mapping question
It's mapping issue:
WARN:
System.IndexOutOfRangeException: Unable to find specified column in result
set
at Oracle.DataAccess.Client.OracleDataReader.GetOrdinal(String name)
at NHibernate.Type.NullableType.NullSafeGet(IDataReader rs, String name)
at NHibernate.Type.NullableType.NullSafeGet(IDataReader rs, String[]
names, ISessionImplementor session, Object owner)
at NHibernate.Type.ManyToOneType.Hydrate(IDataReader rs, String[] names,
ISessionImplementor session, Object owner)
at ... 阅读全帖
b**o
发帖数: 16
10
来自主题: Java版 - 这道题该走什么路
SomeClass obj;
Object param;
try{
obj = (SomeClass) param;
System.out.println("Yes, it is a instance of SomeClass");
}catch(ClassCastException e){
System.out.println("No, it isn't.");
}
o****h
发帖数: 58
11
来自主题: Java版 - 这道题该走什么路

//要求做成一个method, 于是,偶这样
class Collie extends Dog{
public boolean isa(String className){ //需要全路径,如java.lang.Object
Collie param=new Collie();
try {
Class SomeClass = Class.forName(className);
// System.out.println(SomeClass);
Object obj = SomeClass.newInstance();
obj=(SomeClass)param; // 这里总是有问题呢,该怎么办 ???
return true;}
catch(Exception e){return false;}
}
}
另外一种方法倒是没问题,并且不必输入全路径,但好像烦了很多
class Collie extends Dog{
public boolean isa(String className){
m******t
发帖数: 2416
12
来自主题: Java版 - 继续问土问题

You can call obj.getClass() to get the Class object for obj.
(quite a tongue twister isn't it)
But you'll have to make sure each of the classes you need to copy
has a default constructor, otherwise you'll still end up checking
classes.
c*****t
发帖数: 1879
13
来自主题: Java版 - synchronization 锁住了什么?

Well, this is placing lock on obj. There is no such thing as code to be
protected, what this saying is really
obj logically cover the access right of the resources which should
not be concurrently accessed. and the following code need to access
these resources.
thread
(this)? what does it mean, for design.
Depend on if you want to have finer control of resources. If you want to
update a HashMap instance variable, for example, you would only care if
reading/writing to
f*******4
发帖数: 345
14
To achieve your goal, you've to do this in Method-1:

function highlight(obj) {
alert(obj.id);
}
wy
发帖数: 14511
15
来自主题: Java版 - speaking of crappy code
This one is really good:
Long id = obj.getId();
obj.setId(id);
m******y
发帖数: 102
16
来自主题: Java版 - Object比较
As BulletTooth said,
the default impl of equals is
public boolean equals(Object obj) {
return (this == obj);
}
If u don't override, u will always get "false"...
w*******e
发帖数: 285
17
我的一个server程序似乎总有内存泄漏,我用sun自己的profiling连续监控了2个礼拜
,heap size从40兆涨到了400兆,然后我看了内存的使用情况,发现有几项是数据库的
statement和resultset
percent live alloc'ed stack class
self accum bytes objs bytes objs trace name
10.76% 25.34% 52615656 243591 359835048 1665903 305016 com.mysql.jdbc.
ResultSet
10.17% 35.52% 49732488 230243 49732920 230245 305033 com.mysql.jdbc.
ResultSet
7.97% 53.57% 38974560 243591 38974560 243591 309126 com.mysql.jdbc.
Statement
7.53% 61.10% 36838880 230243 36838
g**********y
发帖数: 14569
18
来自主题: Java版 - design问题
主要看你接受端想怎么处理,如果接受方只显示Error message, 那就一种Exception就
够了;如果接受方要根据error code进行不同处理,那inheritance更好,比如:
GoodO, BadO1, BadO2, BadO3, ... all extend from ReceiveO
validator里就是:
if ... return GoodO;
if ... return BadO1;
...
if ... return BadOn;
Receiver里就是:
ReceiveO obj = validate();
obj.postProcess();
这样你就把相应的post-process delegate到child class里。
a****l
发帖数: 8211
19
2 is an interesting point, but I have never heard of that. Does that mean if
Object obj=new Object(),
then the Object is moved to some other memory address because of system
memory operations, the obj reference would be changed also? Is there any
example or reference material for this?

reference
m******t
发帖数: 2416
20
来自主题: Java版 - 哪个JSON Library最好用呢

Not sure what you mean by that - how much easier
do you need than obj.prop or obj['prop']?
8-)
c******n
发帖数: 4965
21
来自主题: Java版 - jmock ?? or any other mocking tools?
the nasty thing about jmock is that whenever I want to mock a dependent
object, I have to abstract out the object creation,
and turn a statment like
MyClass obj = new MyClass();
into
MyClass obj = createMyClass();
while production code has
MyClass createMyClass() { return new MyClass();}
and mock code has
MyClass createMyClass() { return instance_var_mock_myclass;}
I end up having a lot of createXXX() methods in each class implemented,
furthermore, clover would complain that the createXXX() them
S**********C
发帖数: 161
22
来自主题: Java版 - 问个Object.hashCode()的问题
我知道这个是个Convention,最好要Follow,这么说吧,这
是一个面试的时候别人问到的题目,我答得跟你们说的都差不多,
但好像面试的人仍然要追问,如果不这么做,会发生什么,
我回头看了你回答的第1)个,如果不Override,不应该就用
Object defatult的hashCode() 吗?
我查了一下源代码,equals() default implementation是 return this == obj,
也就是比较两个obj在内存里面是否指向同一个reference,但
hashCode() default implementation是一个native function,不知道
里面是怎么实现的,default会返回什么数值,是否也是
一个常数,那就变成问题2)? 还有对于会造成mess up,面试
的会追问怎么个mess up法,是容许duplicate了呢,还是put了
之后想get的时候返回不同值?那如果不放在HashMap里呢,比如
一个Seariable的Object,是否有同样的问题?
我觉得搞清楚这点还是有点意义的,决不是"Just a con... 阅读全帖
b******g
发帖数: 669
23
来自主题: Java版 - 问HashSet的问题?
All set cares uniqueness and equals() determine whether two object are
identical.
但是我test 了下
import java.util.HashSet;
public class testT {
private String name;
public testT(String name){
this.name=name;
}
public boolean equals(Object o){
if(!(o instanceof testT))return false;
testT person=(testT)o;
return person.name.equals(this.name);
}
public static void main(String[] args){
HashSet hs=new HashSet();
testT p1= new testT("jing");
... 阅读全帖
z****e
发帖数: 54598
24
来自主题: Java版 - OpenShift怎么上数据库?
这就是为什么我讨厌db
一个简单的东西给搞得无比复杂
加一个transaction,什么事都变得麻烦了
nosql没有transaction,配置起来简单很多
楼主看一下jdbc连接的代码,不过稍微不同的是
openshift直接用上了jndi 和 datasource
以下是参考代码,依葫芦画瓢,剩下的我看你能行
jndiname从.openshift/standalone.xml这个文件里面找
用eclipse直接快捷键:shift+command+r,输入standalone.xml,就可以找到
windows下快捷键应该类似,自己摸索一下
String jndiName = "java:jboss/datasources/PostgreSQLDS";
public String createT(T t){
try{
Connection con = null;
Context ic = new InitialContext();
Object obj = ic.lookup(... 阅读全帖
z****e
发帖数: 54598
25
来自主题: Java版 - OpenShift怎么上数据库?
这就是为什么我讨厌db
一个简单的东西给搞得无比复杂
加一个transaction,什么事都变得麻烦了
nosql没有transaction,配置起来简单很多
楼主看一下jdbc连接的代码,不过稍微不同的是
openshift直接用上了jndi 和 datasource
以下是参考代码,依葫芦画瓢,剩下的我看你能行
jndiname从.openshift/standalone.xml这个文件里面找
用eclipse直接快捷键:shift+command+r,输入standalone.xml,就可以找到
windows下快捷键应该类似,自己摸索一下
String jndiName = "java:jboss/datasources/PostgreSQLDS";
public String createT(T t){
try{
Connection con = null;
Context ic = new InitialContext();
Object obj = ic.lookup(... 阅读全帖
p*****3
发帖数: 488
26
原来java里有balanced的BST, 比C++的好用些,就是接口太多了,记不住。
写了一个求2d overlap矩形面积的题,
核心代码没多少,code都是定义各种结构各种override各种comparator去了:
public class EPI_14_20_3 {
static class Rectangle {
public int xBeg;
public int xEnd;
public int yBeg;
public int yEnd;

public Rectangle(int xb, int xe, int yb, int ye) {
xBeg = xb;
xEnd = xe;
yBeg = yb;
yEnd = ye;
}
}

static class EndPoint {
public int index... 阅读全帖
d****i
发帖数: 4809
27
just use try-catch pair:
try {
A obj = new A();
obj.aMethod();
} catch (Exception ex) {
//handle exception here
}

have
z****e
发帖数: 54598
28
来自主题: Java版 - 版上基本不讨论android?
举个例子,以前都用db,现在nosql横行
也没有说db马上就淘汰不用的道理
一样还在用,但是nosql拓宽了整个persistence的外延
使得你的选择变多变广了,你不仅会db还会nosql
那你就升值了,小本出来就算要会
他也需要从db开始搞,光会nosql是不够的
等小本学会了db再学会了nosql,他也跟你一样大了
hadoop也是如此,没有说hadoop出来之后,就替换了hibernate这些
hibernate该用还在用,hadoop不会帮你解决hibernate解决了的问题
所以你以前的投入不会白费,这就是优势
你工作了,认真观察一下公司里的系统是怎么回事
就有概念了
但是客户端就很难说了,以前写obj c现在搞swift
你觉得obj c会不会有一个大的跳水?
我觉得会,应该很快就都会换到swift上去
w*********n
发帖数: 439
29
来自主题: Java版 - Java 求解2
What happens when these statements are compiled?
Loan loan = new Loan(amount, months);
Object obj = loan;
obj.calculatePayments();
Answer
a.
A compile-time error occurs because the Object object can’t invoke the
calculatePayments method
b.
A compile-time error occurs because the Object object can’t reference a
Loan object without a cast
c.
These statements will compile without errors
l*****n
发帖数: 633
30
来自主题: Linux版 - python descriptor 问题
【 以下文字转载自 Programming 讨论区 】
发信人: luxilon (昵称不好起), 信区: Programming
标 题: python descriptor 问题
发信站: BBS 未名空间站 (Fri Nov 13 16:52:18 2009, 美东)
python.org 上说descriptor可以direct call:
Direct Call
The simplest and least common call is when user code directly invokes a
descriptor method: x.__get__(a).
但__get__()需要3个argument, 这里包括self才两个。能举个direct call的例子吗?
另外,__get__(self, obj, objtype)里面的obj和objtype到底有什么用?特别是
objtype,有使用它的例子吗?
thanks.
d******i
发帖数: 7160
31
来自主题: Linux版 - ArchLinux安装deluge失败
多谢。WebGUI终于走起来乐。用的是deluge-web。
不过加了个中文电影torrent之后,
putty得到:
[root@alarm ~]# deluge-web
[ERROR ] 14:42:35 json_api:270 'utf8' codec can't decode byte 0xfd in
position 1: invalid start byte
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/deluge/ui/web/json_api.py", line
292, in render
d = self._on_json_request(request)
File "/usr/lib/python2.7/site-packages/deluge/ui/web/json_api.py", line
264, in _on_json_request
return self._send_response(request, response... 阅读全帖
d******i
发帖数: 7160
32
来自主题: Linux版 - ArchLinux安装deluge失败
多谢。WebGUI终于走起来乐。用的是deluge-web。
不过加了个中文电影torrent之后,
putty得到:
[root@alarm ~]# deluge-web
[ERROR ] 14:42:35 json_api:270 'utf8' codec can't decode byte 0xfd in
position 1: invalid start byte
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/deluge/ui/web/json_api.py", line
292, in render
d = self._on_json_request(request)
File "/usr/lib/python2.7/site-packages/deluge/ui/web/json_api.py", line
264, in _on_json_request
return self._send_response(request, response... 阅读全帖
x****o
发帖数: 21566
33
来自主题: Linux版 - 问个kernel module的编译问题
static library?
If so, make sure they all appear in Makefile
e.g, in Makefile
...
obj-m := foo.o
foo-objs := yourcode.o xenomai.a
...
google "kernel module static library" or something similar maybe
w*s
发帖数: 7227
34
来自主题: Linux版 - Makefile link lib question
This is what i want to run:
arm-none-linux-gnueabi-g++ -ldl -o db4 db4.o -L/somePath/sql3arm -lsqlite3
-lpthread
In makefile
LIBS = -L/somePath/sql3arm -lsqlite3 -lpthread
$(TARGET): $(OBJS)
$(CXX) -o $(TARGET) $(OBJS) $(LIBS)
when i run it, it's running with lib options
arm-none-linux-gnueabi-g++ -o db4 db4.o
Any suggestions pls, thanks very much !
S*A
发帖数: 7142
35
来自主题: Linux版 - Makefile link lib question
Your variable LIBS get overriden some where.
You can add debug line like
LIBS = -L/somePath/sql3arm -lsqlite3 -lpthread
$(info LIBS = $(LIBS))
$(TARGET): $(OBJS)
$(info LIBS = $(LIBS))
$(CXX) -o $(TARGET) $(OBJS) $(LIBS)
To see if the LIBS get changed before invoking CXX
g****c
发帖数: 299
36
来自主题: Programming版 - Questions about MAKEFILE
# [Q: What does the following do? ]
link object file with lib if it exists
$(COMMAND): $(OBJS) $(MAKEFILE)
$(CC) -o $(COMMAND) $(OBJS) $(LDFLAGS) $(LIBS)
# [Q: What is LIBS? ]
I don't see LIBS defined
# [Q: What does the following do? ]
sum_up_down.o : sum_up_down.cpp $(MAKEFILE)
$(CC) $(CFLAGS) $(WARNFLAGS) -c sum_up_down.cpp -o sum_up_down.o
compile to object file

following
o******r
发帖数: 259
37
以下程序似乎是对的,在Visual Studio 2005里面却报错:
error C2660: 'B::Add' : function does not take 1 arguments
#include
using namespace std;
class A
{
public:
int Add(int X) {return Add(X, 1);};
private:
virtual int Add(int X, int Y) {return X+Y;};
};
class B: public A
{
private:
int Add(int X, int Y) {return X-Y;};
};
int main()
{
B Obj;
cout << Obj.Add(5);
return 0;
}
难道B不能用base clas A的那个public function吗?
用不同函数名就没问题了
#include
using namespac
P*****f
发帖数: 2272
38
name hiding

以下程序似乎是对的,在Visual Studio 2005里面却报错:
error C2660: 'B::Add' : function does not take 1 arguments
#include
using namespace std;
class A
{
public:
int Add(int X) {return Add(X, 1);};
private:
virtual int Add(int X, int Y) {return X+Y;};
};
class B: public A
{
private:
int Add(int X, int Y) {return X-Y;};
};
int main()
{
B Obj;
cout << Obj.Add(5);
return 0;
}
难道B不能用base clas A的那个public function吗?
用不同函数名就没问题了
#include
u
c**t
发帖数: 2744
39
来自主题: Programming版 - ask a Javascript question
obj[obj.selectedIndex].text is what you wanted
m*******o
发帖数: 264
40
来自主题: Programming版 - C++声明细问
class C{ virtual void proc (int x) {...}..};
..
C obj;
C* ptr;
..
obj.proc(5); //(1)
ptr->proc(5); //(2)
请问1和2的却别,2要比1多执行几步机器指令?
g****n
发帖数: 14
41
来自主题: Programming版 - C++声明细问
For obj.proc(5):
1. calculat the address of obj, and push this address onto the stack (or
load it into a registary). Member function requires "this" pointer.
2. push 5 onto the stack (or load it into a registary).
3. call C::proc(int). Assuming compiler is smart enough to de-virtual the
call to proc.
For ptr->proc(5):
1. push the value of ptr onto the stack (or load it into a registary).
2. push 5 onto the stack (or load it into a registary).
3. get the enry address from vtable.
4. call C::proc
j*******e
发帖数: 674
42
来自主题: Programming版 - 请问c++为什么会编译失败?
源程序:
#include
class A
{
public:
virtual void h()const{ printf("A::h() const\n");}
virtual void h(){ printf("A::h() non-const\n");}
};
class C: public A
{
public:
virtual void h(){ printf("C::h() non-const\n");}
};
int main()
{
C obj;
C* p1 = &obj;
const C* p2 = p1;
A* p3 = (A*)p1;
const A* p4 = p3;
p1->h();
//p2->h(); ///// this line will cause compile fail!!! but why?
p3->h();
p4->h();
return 0;
}
输出结果:
C::h() non-const
C::h() non-const
A::h() const
问题:
X****r
发帖数: 3557
43
来自主题: Programming版 - Scripting language的几个问题
老实说我不觉得这些自动补全之类的功能对总体的开发速度有多大影响。
就像前面有人说的那样,程序员的主要时间不是花在把代码从键盘输入到计算机里。
项目越大,这个的比重越小。输入代码的时间和代码大小成正比,而一般认为bug
的数目和代码大小的平方成正比(当然单元测试这些作得比较好的会好一点,但我
觉得怎么也有1.5次方吧),就算每个bug的解决时间是常数(实际我估计是代码
大小的.5次方左右),代码大了以后也会有越来越多的时间在QA周期上。还有一个
就是iteration带来的refactoring。假设feature数和代码大小成正比,每个feature
在单位时间里需求要改变的可能性为常数,而iteration次数和feature数目的.5次方
成正比,那refactoring所花的相对时间也会越来越多,虽然没有QA那么多。
你看那些大的项目,比如Windows,你把它的总代码行数除以开发人员的数目和所花
的时间,它名义上的每人每天写的行数是很小的数字。

起能弥补
如果你用下面这个图里面的IPython,只要 obj? 甚至 obj.之后按 TAB 补全就行,然
后可以一直 intro
a**a
发帖数: 416
44
In python 2.5,
from __future__ import with_statement
You can write a special objective working with the `with' statement, such as
with SomeClass() as obj:
## do you things here
## when leaving the current context normally or by exception,
## the obj's speciall method will be invoked and do the house
## cleaning job.
r****t
发帖数: 10904
45
不明白你什么意思,你是不是指这个,不是 array 是 dict.
>> print a
{'a': 'apple', 'c': {0: 'x', 1: 'y', 2: 'z'}, 'b': 'banana'}
print obj will call obj.__str__(self), 在里面你想干嘛都行。不过这个 print
statement 在 python 3 里面就要被取消了。
p****r
发帖数: 7
46
right. The webservices call returns something like
myobject:hash(ea214653)
How to interpret this obj. By wsdl? Or is there any function I
Can use to parse the obj. Info? Thanks.
O*****c
发帖数: 171
47
Don't want to write the files to local hd before ftping them to a remote
server
thanks!
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)