您好,我将实现一个社交聊天应用程序,该程序可以满足一些要求,但是我不确定该如何实现。
需要:
应用程序“前端”应使用React Native编写
支持端到端加密
支持用户间的聊天
OAuth2.0
推送通知
历史
Django或Node后端
问题出在后端设计中。我正在考虑使用带有websockets的Node.js或带有通道的Django,但我不知道哪种存储聊天(如电报)的数据库设计很好,也不知道如何构建消息队列。
谁能给我一些有关聊天应用程序设计的提示?谢谢
我正在尝试计算数组中有多少个数字 1。
首先我有一个 C lenguaje 代码(工作正常):
int popcount2(int* array, int len){
int i;
unsigned x;
int result=0;
for (i=0; i<len; i++){
x = array[i];
do{
result+= x & 0x1;
x>>= 1;
} while(x);
}
return result;
}
Run Code Online (Sandbox Code Playgroud)
现在我需要使用 3-6 行代码将 do-while 循环转换为汇编。我写了一些代码,但结果不正确。(我是汇编世界的新手)
int popcount3(int* array, int len){
int i;
unsigned x;
int result=0;
for (i=0; i<len; i++){
x = array[i];
asm(
"ini3: \n"
"adc $0,%[r] \n"
"shr %[x] \n"
"jnz ini3 \n"
: [r]"+r" (result)
: [x] "r" (x) ); …Run Code Online (Sandbox Code Playgroud)