我想知道我怎么能做一些像skype或雅虎信使?
我提到雅虎或Skype,因为我真的希望信使能够处理许多在线用户.
我是一名java开发人员,但我对这类项目或VOIP和网络都没有任何想法?
我可以用java开发像信使这样的东西吗?以及我需要处理这个项目的其他技术,框架或其他任何东西?最后,我可以独自发展吗?!或者我需要一个团队开始?!
我在我的应用程序中使用同步 boost::asio SSL 套接字。我初始化所有参数,然后连接到一些主机(一个接一个)并为每个主机执行 GET 请求。
一切正常,直到我收到其中一个主机的“404 - Not Found”错误。出现此错误后,所有新连接都会失败,并显示一些未指定的 SSL 错误。
我是否必须以某种方式重置 ssl::stream?是否可以在每次连接后重新初始化 ssl::stream?
在下面的代码片段中,我删除了错误处理和所有非 asio 相关的东西。
主要的:
asio::io_service ioservice;
asio::ssl::context ctx(ioservice, asio::ssl::context::sslv23);
ctx.set_verify_mode(asio::ssl::context::verify_none);
Connector *con = new Connector(ioservice, ctx);
while (!iplist.empty())
{
...
con->ssl_connect(ipaddress, port);
...
}
Run Code Online (Sandbox Code Playgroud)
连接器:
Connector::Connector(asio::io_service& io_service, asio::ssl::context &ctx)
: sslSock(io_service, ctx)
{
}
Connector::ssl_connect(std::string ipAdr, std::string port)
{
...
tcp::resolver resolver(ioserv);
tcp::resolver::query query(ipAdr, port);
endpoint_iterator = resolver.resolve(query);
...
asio::error_code errorcode = asio::error::host_not_found;
tcp::resolver::iterator end;
// Establish connection
while (errorcode && endpoint_iterator != end)
{ …Run Code Online (Sandbox Code Playgroud) 我想使用ICloneable界面克隆一个对象,由于某种原因我不能克隆我的程序.这是我的代码:
public class GeoInfo : ICloneable
{
private long InfoID;
private string InfoName;
private Location InfoLocation;
private string Description;
private InfoTypes InfoType;
public GeoInfo(long InfoID)
{
this.InfoID = InfoID;
}
public GeoInfo(long InfoID, Location InfoLocation):this(InfoID)
{
this.InfoLocation = InfoLocation;
}
public GeoInfo(long InfoID, string InfoName, Location InfoLocation, string Description, InfoTypes InfoType):this(InfoID,InfoLocation)
{
this.InfoName = InfoName;
this.Description = Description;
this.InfoType = InfoType;
}
public object ICloneable.Clone()
{
GeoInfo toReturn = new GeoInfo(InfoID, InfoName, InfoLocation, Description, InfoType);
return (object)toReturn;
} …Run Code Online (Sandbox Code Playgroud) 我想从字符串中提取指示符和操作符designator: op1 op2,其中可能有0个或更多操作,并且允许多个空格.我在Python中使用了以下正则表达式
import re
match = re.match(r"^(\w+):(\s+(\w+))*", "des1: op1 op2")
Run Code Online (Sandbox Code Playgroud)
问题是在匹配组中只找到des1和op2,而op1不是.有谁知道为什么?
The groups from above code is Group 0: des1: op1 op2 Group 1: des1 Group 2: op2 Group 3: op2
输出n位格雷码的字符数最短的程序.n将是一个小于(由于用户建议)从标准输入中获取的任意数字.格雷码将以标准输出打印,如示例中所示.1000100000
注意:我不希望程序在合理的时间内打印格雷码(n=100000过度杀伤); 我确实希望它开始打印.
输入:
4
Run Code Online (Sandbox Code Playgroud)
预期产出:
0000
0001
0011
0010
0110
0111
0101
0100
1100
1101
1111
1110
1010
1011
1001
1000
Run Code Online (Sandbox Code Playgroud) 我正在寻找PHP5 ORM,它完全支持基于复合主键和外键的复合(多列)关系.
我希望Doctrine 2可以解决这个问题,但事实并非如此.它是关系数据建模的基本功能,但我所知道的PHP ORM软件都不支持它.
我最近发现SQLAlchemy有完全支持,但我需要PHP的东西,而不是Python.
我已经将我的database.yml配置为指向我现有的mysql数据库
我怎样才能从中生成模型?
rails generate model existing_table_name
Run Code Online (Sandbox Code Playgroud)
只提供一个emty模型..
是否有必要包含jQuery的核心,还是单独的移动框架?根据我的尝试,我得出结论,这两个文件都是必要的,但我想确定这个问题.
我有这样的代码.
for p in range(1,1000):
result = False
while result is False:
ret = urllib2.Request('http://server/?'+str(p))
try:
result = process(urllib2.urlopen(ret).read())
except (urllib2.HTTPError, urllib2.URLError):
pass
results.append(result)
Run Code Online (Sandbox Code Playgroud)
我想同时提出两三个请求来加速这个.我可以使用urllib2,以及如何使用?如果不是我应该使用哪个其他库?谢谢.
algorithm ×2
c# ×2
python ×2
activemodel ×1
asynchronous ×1
boost ×1
boost-asio ×1
c++ ×1
code-golf ×1
composite ×1
gray-code ×1
icloneable ×1
java ×1
jquery ×1
key ×1
networking ×1
openssl ×1
orm ×1
php ×1
python-2.5 ×1
regex ×1
relationship ×1
ruby ×1
urllib2 ×1
voip ×1