小编Bau*_*gen的帖子

我可以使用其他人的信用卡注册我的Android开发者帐户吗?

我想在谷歌注册一个开发者帐户,但不幸的是,我还没有信用卡,也不会很快得到一个.我正在考虑从朋友或亲戚那里借一个并用它来支付25美元的费用,然后我会向我的朋友/亲戚支付这笔金额.这看起来有道理吗?有什么影响吗?我不打算出售付费应用程序,我只想发布我制作的免费软件.

android credit-card google-play

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

固定宽度整数类型是否为标准内置类型的typedef?

从类型<cstdint>(如例如int16_t,uint_fast64_t,int_least8_t)保证是typedefS为内建类型等中的一个short,unsigned long等等?

或者是允许使用非常规内置类型来实现固定宽度类型的实现?

c++ language-lawyer

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

如何减少C++标准库libstdc ++.所以文件大小

我的计算机上有不同的C++编译器,每个编译器都有自己的libstdc ++.所以它们的大小不同.

-rwxr-xr-x. 1 root root 967K Mar 22  2017 libstdc++.so.6.0.13
-rwxr-xr-x. 1 root root 6.5M Aug  1  2017 libstdc++.so.6.0.20
-rwxr-xr-x. 1 root root  11M Aug  1  2017 libstdc++.so.6.0.21
-rwxr-xr-x. 1 root root  12M Jan 30 16:58 libstdc++.so.6.0.24
Run Code Online (Sandbox Code Playgroud)

我想知道为什么libstdc ++.so.6.0.13比其他人小得多,并且有什么方法可以减少其他人的大小.如果有人可以帮助我,我会很高兴的.

c++

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

Uniform_real不接受numeric_limits :: lowest()

我有一条线:

std::uniform_real_distribution<T> distribution(std::numeric_limits<T>::lowest(), 
                                               std::numeric_limits<T>::max());
Run Code Online (Sandbox Code Playgroud)

它编译但在Debug(VS 2017CE)上崩溃.我的猜测是,根据以下文件std::uniform_real_distribution:

需要a ? bb-a ? std::numeric_limits<RealType>::max()

当我的b::max(),a::lowest(),条件:

b-a ? std::numeric_limits<RealType>::max()

没有履行,因为b-a基本上是两倍的价值max.有没有解决这个问题,以便保持如此广泛的数字范围?::min()工作完美,但省略负值.仅浮动数字会出现问题.

c++ random c++11

8
推荐指数
2
解决办法
228
查看次数

函数指针数组的类模板参数推导适用于clang,但不适用于gcc

以下代码:

#include <array>

template <int i>
auto f(){}

int main () {
    std::array{f<5>};
}
Run Code Online (Sandbox Code Playgroud)

编译与clang 7.0,但与gcc 8.2一起失败

prog.cc: In function 'int main()':
prog.cc:7:20: error: class template argument deduction failed:
     std::array{f<5>};
                    ^
prog.cc:7:20: error: no matching function for call to 'array(<unresolved overloaded function type>)'
In file included from prog.cc:1:
/opt/wandbox/gcc-8.2.0/include/c++/8.2.0/array:244:5: note: candidate: 'template<class _Tp, class ... _Up> std::array(_Tp, _Up ...)-> std::array<typename std::enable_if<(is_same_v<_Tp, _Up> && ...), _Tp>::type, (1 + sizeof... (_Up))>'
     array(_Tp, _Up...)
     ^~~~~
/opt/wandbox/gcc-8.2.0/include/c++/8.2.0/array:244:5: note:   template argument deduction/substitution failed:
prog.cc:7:20: note: …
Run Code Online (Sandbox Code Playgroud)

c++ templates c++17

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

VMWare等效

我需要经常在干净的机器上进行测试,所以我需要某种虚拟机模拟器来加载和运行干净的操作系统映像.
你知道任何推荐的免费软件或低成本的模拟器吗?

谢谢,
阿迪巴尔达

vmware

7
推荐指数
2
解决办法
7030
查看次数

聊天应用程序:pubsubhubbub vs xmpp

我不确定最好的堆栈来构建聊天应用程序.目前我正在考虑两个主要选择:

  • facebook龙卷风
    • 缺点:不使用主聊天协议xmpp而是使用pubsubhubbub
    • 专业人士:我非常喜欢它的开发简单性(webserver + webframework); pubsubhubbub作为协议似乎比xmpp更简单; 我知道python
  • xmpp + bosch,旁遮普,ejabberd
    • 缺点:不知道二郎; 整体看起来有点难以发展
    • 专业人士:使用xmpp协议

聊天应用程序需要具备以下条件:

  • 私人信息
  • 公共房间
  • 私人房间
  • 房间的聊天记录(不是永远,只是最后n条消息)
  • HTML嵌入
  • 网址聊天室

这两个选项看起来都是可扩展的,所以我并不担心(我们也考虑在亚马逊的ec2中运行应用程序).我知道有一个项目使用龙卷风构建一个xmpp服务器,但它还没有准备好用于生产,我们的截止日期并不是那么大.基本上我的主要担心是开发的简易性,以后稍后使用pubsubhubbub开发聊天应用程序后悔但我在某处读到PubSubHubbub可能最终取代XMPP,因为REST取代了SOAP - 所以你怎么看?

更新:您是否知道使用支持MUC(公共和私有)和PM的xmpp的任何开源解决方案?

chat xmpp tornado websub

7
推荐指数
1
解决办法
3220
查看次数

使用括号还是不使用括号实例化类?

#include <iostream>
using namespace std;

class CTest 
{
    int x;

  public:
    CTest()
    { 
       x = 3;
       cout << "A"; 
    }
};

int main () {
  CTest t1;
  CTest t2();

  return 0;
}
Run Code Online (Sandbox Code Playgroud)

CTest t1当然会打印"A".

但似乎没有任何事情发生在t2(),但代码运行良好.

那么我们在没有参数的情况下使用这些括号吗?或者为什么我们这样使用呢?

c++ constructor

7
推荐指数
1
解决办法
1万
查看次数

为什么std :: remove不能用于std :: set?

以下代码:

#include <iostream>
#include <set>
#include <algorithm>

std::set<int> s;

int main()
{
    s.insert(1);
    s.insert(2);

    std::remove(s.begin(), s.end(), 1);
}
Run Code Online (Sandbox Code Playgroud)

不用gcc 4.7.2编译:

$ LANG=C g++ test.cpp
In file included from /usr/include/c++/4.7/algorithm:63:0,
             from test.cpp:3:
/usr/include/c++/4.7/bits/stl_algo.h: In instantiation of '_FIter std::remove(_FIter, _FIter, const _Tp&) [with _FIter = std::_Rb_tree_const_iterator<int>; _Tp = int]':
test.cpp:12:38:   required from here
/usr/include/c++/4.7/bits/stl_algo.h:1135:13: error: assignment of read-only location '__result.std::_Rb_tree_const_iterator<_Tp>::operator*<int>()'
Run Code Online (Sandbox Code Playgroud)

所以我去了定义,fset::iterator我在gcc的实现中发现了这个(文件../c++/4.7/bits/stl_set.h,来自125):

  // _GLIBCXX_RESOLVE_LIB_DEFECTS                                                                                                                                                             
  // DR 103. set::iterator is required to be modifiable,                                                                                                                                      
  // but this allows modification of …
Run Code Online (Sandbox Code Playgroud)

c++ gcc stdset

7
推荐指数
1
解决办法
2235
查看次数

如何在Python 3中启用xrange以实现可移植性?

我编写了一个脚本,我想为Python 2和Python 3启用它.

导入后divisionprint_function__future__,我唯一担心的是,我的range回报整个阵列在Python 2,浪费时间和内存.

我在脚本开头添加了以下3行作为解决方法:

if sys.version_info[0] == 3:
    def xrange(i):
        return range(i)
Run Code Online (Sandbox Code Playgroud)

然后,我只xrange在我的代码中使用.

是否有更优雅的方式来做而不是我的解决方法?

python xrange python-3.x

7
推荐指数
1
解决办法
5094
查看次数