需求:计算前1天,2天,3天的用户留存数量和用户留存率。 用户留存:某段时间内的新增用户,经过一段时间后,仍然使用应用的被认作是留存用户;这部分用户占当时新增用户的比例即是留存率。例如,5月份新增用户200,这200人在6月份启动过应用的有100人,7月份启动过应用的有80人,8月份启动过应用的有5 ...
分类:
其他好文 时间:
2020-06-26 23:56:58
阅读次数:
94
import sys # print(help(sys.stdout)) sys.stdout.write("the quick brown fox jumps over the lazy dog.") #返回值是字符串长度 sys.stderr.write("to err is humane, t ...
分类:
编程语言 时间:
2020-06-26 22:12:11
阅读次数:
55
1.对象流: ObjectInputStream 和 ObjectOutputStream2.作用:ObjectOutputStream:内存中的对象 >存储中的文件、通过网络传输出去:序列化过程ObjectInputStream:存储中的文件、通过网络接收过来 >内存中的对象:反序列化过程3.对象 ...
分类:
编程语言 时间:
2020-06-26 22:06:52
阅读次数:
50
概览 说这个问题之前得看下几种缓存模式,可以先看下缓存模式(Caching Aside、Read Through、Write Through、Write Behind)这篇文章。 先更新缓存,再更新数据库 考虑两个并发操作:线程A写,线程B读 1、线程A发起一个写操作,第一步delete cache ...
分类:
数据库 时间:
2020-06-26 21:50:54
阅读次数:
143
#!/usr/bin/env python from struct import * import pandas as pd import numpy as np import os import re import pathlib import threading import time def ...
分类:
其他好文 时间:
2020-06-26 20:41:49
阅读次数:
57
Write the current to the local file. static void CopyStream(Stream stream, string destPath) { using (var fileStream = new FileStream(destPath, FileMod ...
Yes, you can remove the CD-ROM (or or original installation media) from the sources.list Edit the sources.list file with the following command: sudo n ...
分类:
其他好文 时间:
2020-06-26 20:01:57
阅读次数:
58
1. 引入模块 from module import do_module # 若引入的文件在同级文件夹的下面,要这么写,从执行文件的下一级开始写路径 from web.web1.web2.import cal # 包与包之间用点来联系 do_module.run() 引用do_module 中的函数 ...
分类:
编程语言 时间:
2020-06-26 16:43:13
阅读次数:
60
注: 本篇文章主要集中在Linux CFS调度器源码解析。文章代码分析基于Linux-4.18.0。 一、进程的创建 进程的创建是通过do_fork()函数完成。新进程的诞生,我们调度核心层会通知调度类,调用特别的接口函数初始化新生儿。我们一路尾随do_fork()函数。do_fork() >_do ...
分类:
其他好文 时间:
2020-06-26 16:37:46
阅读次数:
70
7-4 Index of Popularity (30分) The index of popularity (IP) of someone in his/her circle of friends is defined to be the number of friends he/she has i ...
分类:
其他好文 时间:
2020-06-26 14:39:43
阅读次数:
106