当前位置:网站首页>Determine whether the user is entering a page for the first time
Determine whether the user is entering a page for the first time
2022-06-25 07:56:00 【On procedural retreat】
Usage of this method : Determine whether the user is entering this page for the first time The main approach : take key Values stored in MemCache In cache , According to the user userId Search for value value
According to return false/true, To determine whether it is the first time to enter
The specific code is as follows :
int userID = 20170812; final String key = "key"; boolean has = MemCacheHelper.keyExists(key); boolean exsit = false; if (!has) { Map<Integer, Integer> userTabs = new HashMap<Integer, Integer>(1); userTabs.put(userID, 1); MemCacheHelper.bulidCache(key, userTabs, new Date(-1)); } else { Map<Integer, Integer> userTabs = (HashMap<Integer, Integer>)MemCacheHelper .getCache(key); if (userTabs != null && userTabs.size() > 0) { if (!userTabs.containsKey(userID)) { userTabs.put(userID, 1); MemCacheHelper.replace(key, userTabs); } else { exsit = true; } } } if(exsit){ // First entry }else { // Enter after the second time }边栏推荐
- 传统的IO存在什么问题?为什么引入零拷贝的?
- c#磁盘驱动器及文件夹还有文件类的操作
- OAuth 2.0 one click login
- 417-二叉树的层序遍历1(102. 二叉树的层序遍历、107.二叉树的层次遍历 II、199.二叉树的右视图、637.二叉树的层平均值)
- Anaconda navigator启动慢的一个解决方法
- Cifar-10 dataset application: quick start data enhancement method mixup significantly improves image recognition accuracy
- c#中设置lable控件的TextAlign属性控制文字居中的方法
- 2160. 拆分数位后四位数字的最小和
- @The difference between resource and @autowired annotation, why recommend @resource?
- 产品经理专业知识50篇(四)-从问题到能力提升:AMDGF模型工具
猜你喜欢

opencv最小值滤波(不局限于图像)

SCM Project Training

Mining microbial dark matter -- a new idea

Knowledge sharing 𞓜 conventional laminated structure of six layer PCB

深度学习系列45:图像恢复综述

C#中如何调整图像大小

【论文学习】《VQMIVC》

Machine learning notes linear regression of time series

One "stone" and two "birds", PCA can effectively improve the dilemma of missing some ground points under the airborne lidar forest

CAN透传云网关CANIOT,CANDTU记录CAN报文远程收发CAN数据
随机推荐
Vscode is good, but I won't use it again
Atlas conference vulnerability analysis collection
SSL证书免费获取教程
How much do you know about electronic components on PCB?
洛谷P6822 [PA2012]Tax(最短路+边变点)
使用Adobe Acrobat Pro调整PDF页面为统一大小
Startup, shutdown and restart of Oracle and MySQL on Linux
C#控件刷新
剑指offer刷题(中等等级)
深度学习系列48:DeepFaker
How to use ad wiring for PCB design?
【Unexpected token o in JSON at position 1出错原因及解决方法】
PCB board design - automatic layout 2021-10-15
洛谷P2839 [国家集训队]middle(二分 + 主席树 + 区间合并)
Atlassian Confluence 远程代码执行漏洞(CVE-2022-26134漏洞分析与防护
使用报文和波形记录分析仪RoyalScope的帧统计功能排查CAN总线偶发性故障
线程+线程问题记录
Introduction to the main functions of the can & canfd comprehensive test and analysis software lkmaster of the new usbcan card can analyzer
[daily training] 207 Class Schedule Card
基于RBAC 的SAAS系统权限设计