标签: networking

how to fix error: object of type 'generator' has no len() -python

I just want to do the community detection using Girvan Newman Algorithm, and the code was learned from a youtube video. However, when I run the same code, there comes an error

I have tried on Mac OS X python 2.7 terminal and python 3.7 by Jupyter both and the error are the same.

我申请的代码

I expect the output to have two communities lists

python networking cluster-analysis

-4
推荐指数
1
解决办法
4339
查看次数

我怎么能从IP地址转换为MAC地址

我想将所有MAC存储在可以访问我服务器的mac地址中.我所知道的只是IP地址.所有机器都在独特的网关下.我可以从他们的IP地址获得MAC地址吗?

c c++ sockets networking

-6
推荐指数
1
解决办法
967
查看次数

我可以让Java更快吗?

我正在制作一个文件传输程序,我需要永远传输这个800kb的测试图片.显然,我不想花费30分钟来处理每一mb的数据,所以我很好奇是否有任何方法可以加速我的代码或Java.我听说过分配额外的RAM,但从未调查过.

如果有人能为我的代码找到一个更好的算法,那么我可能不得不步入C++或C并再试一次.

服务器代码块:

if(file.exists()){
    for(long l=0;l<file.length();l++){
        out.writeByte(fIS.read());
    }                   
}
Run Code Online (Sandbox Code Playgroud)

其中fIS是FileInputStream,out是传出的DataOutputStream.其余的代码基本上是发送长度和标志,但我可以添加,如果请求.

客户代码:

b = new byte[len];
for(int x=0;x<len;x++){
    b[x] = dIS.readByte();
}
fOS.write(b);
Run Code Online (Sandbox Code Playgroud)

其中len是服务器所需文件的读取长度,b是组成文件的字节数组,dIS是服务器的输入流,fOS是FileOutputStream.

我也尝试使用Readers和readLine()与writeChars()和readChar(),但这似乎等同于大约相同的事情.

java networking

-8
推荐指数
1
解决办法
106
查看次数

为什么c ++标准仍然不包括文件系统和网络?

我一直想知道这件事,并没有在任何地方找到相关的答案.你有什么线索,为什么C++标准委员会甚至不考虑在未来添加这样一个基本功能?在我看来,为了现在可以使用,每种编程语言都必须实现这些基本的东西:

  1. 多线程
  2. 联网
  3. 文件系统
  4. GUI

我很高兴已经决定,C++ 11将至少具有线程,但这对于网络和文件系统来说是如此重要吗?我们都知道这是可能的,比如提升,所以为什么他们不能做出类似的东西呢?

c++ filesystems networking standards

-11
推荐指数
2
解决办法
579
查看次数

标签 统计

networking ×4

c++ ×2

c ×1

cluster-analysis ×1

filesystems ×1

java ×1

python ×1

sockets ×1

standards ×1