f (!empty($uidarr)) {
$uids = array();
$update = array();
foreach ($uidarr as $_uid => $n) {
$uids[] = $_uid;
$update[$_uid] = array('articles-' => $n);
'mysql' != $conf['cache']['type'] and cache_delete('user-' . $_uid);
}
user_big_update(array('uid' => $uids), $update);
}
!empty($operate_create) && function_exists('operate_big_insert') and operate_big_insert($operate_create);
return TRUE;
}
// 大数据量容易超时 删除用户时使用,删除主题 回复 栏目统计 附件 全站统计
function well_thread_delete_all_by_uid($uid)
{
// 用户主题数
$user = user_read_cache($uid);
set_time_limit(0);
// 删除所有回复
if ($user['comments']) {
$postist = comment_pid_find_by_uid($uid, 1, $user['comments'], FALSE);
$pidarr = array();
foreach ($postist as $val) {
$pidarr[] = $val['pid'];
}
unset($postist);
!empty($pidarr) and comment_delete_by_pids($pidarr);
}
if ($user['articles']) {
// 如果主题、附件和回复数量太大会超时
$tidlist = thread_tid_find_by_uid($uid, 1, $user['articles'], FALSE, 'tid', array('tid'));
$tidarr = array();
foreach ($tidlist as $val) {
$tidarr[] = $val['tid'];
}
unset($tidlist);
!empty($tidarr) and well_thread_delete_all($tidarr);
}
return TRUE;
}
// 搜索标题
function well_thread_find_by_keyword($keyword, $d = NULL)
{
if (empty($keyword)) return NULL;
$db = $_SERVER['db'];
$d = $d ? $d : $db;
if (!$d) return FALSE;
$threadlist = db_sql_find("SELECT * FROM `{$d->tablepre}website_thread` WHERE subject LIKE '%$keyword%' LIMIT 60;", 'tid', $d);
if ($threadlist) {
$threadlist = arrlist_multisort($threadlist, 'tid', FALSE);
foreach ($threadlist as &$thread) {
well_thread_format($thread);
// 关键词标色
//$thread['subject'] = comment_highlight_keyword($thread['subject'], $keyword);
}
}
return $threadlist;
}
// 查找 最后评论 lastpid
function well_thread_find_lastpid($tid)
{
$arr = comment_pid_read(array('tid' => $tid), array('pid' => -1), array('pid'));
$lastpid = empty($arr) ? 0 : $arr['pid'];
return $lastpid;
}
// 更新最后的 uid
function well_thread_update_last($tid)
{
if (empty($tid)) return FALSE;
$lastpid = well_thread_find_lastpid($tid);
if (empty($lastpid)) return FALSE;
$lastpost = comment_read($lastpid);
if (empty($lastpost)) return FALSE;
$r = well_thread_update($tid, array('lastuid' => $lastpost['uid']));
return $r;
}
function well_thread_maxid()
{
$n = db_maxid('website_thread', 'tid');
return $n;
}
// 主题状态 0:通过 1~9 审核:1待审核 10~19:10退稿 11逻辑删除
function well_thread_format(&$thread)
{
global $gid, $uid, $forumlist;
$conf = _SERVER('conf');
if (empty($thread)) return;
$thread['create_date_fmt'] = humandate($thread['create_date']);
$thread['last_date_fmt'] = humandate($thread['last_date']);
$thread['create_date_fmt_ymd'] = date('Y-m-d', $thread['create_date']);
$thread['last_date_fmt_ymd'] = date('Y-m-d', $thread['last_date']);
$user = user_read_cache($thread['uid']);
$onlinelist = online_user_list_cache();
$user['online_status'] = isset($onlinelist[$user['uid']]) ? 1 : 0;
$thread['username'] = $user['username'];
$thread['user_avatar_url'] = array_value($user, 'avatar_url');
$thread['user'] = user_safe_info($user);
unset($user);
$forum = array_value($forumlist, $thread['fid']);
$thread['forum_name'] = array_value($forum, 'name');
$thread['forum_url'] = array_value($forum, 'url');
if ($thread['last_date'] == $thread['create_date']) {
$thread['last_date_fmt'] = '';
$thread['lastuid'] = 0;
$thread['lastusername'] = '';
} else {
$lastuser = $thread['lastuid'] ? user_read_cache($thread['lastuid']) : array();
$thread['lastusername'] = $thread['lastuid'] ? $lastuser['username'] : lang('guest');
$thread['lastuser'] = $thread['lastuid'] ? user_safe_info($lastuser) : array();
unset($lastuser);
}
$thread['url'] = url('read-' . $thread['tid'], '', FALSE);
if ($conf['url_rewrite_on'] > 1) {
!empty($forum['well_alias']) and $thread['url'] = url(urlencode($forum['well_alias'])."-$thread[create_date]a$thread[tid]", '', FALSE);
} else {
$thread['url'] = url("read-$thread[create_date]a$thread[tid]", '', FALSE);
}
$thread['user_url'] = url('user-' . $thread['uid']);
$thread['sticky_class'] = '';
if ($thread['sticky'] > 0) {
if (1 == $thread['sticky']) {
$thread['sticky_class'] = 'success';
} elseif (2 == $thread['sticky']) {
$thread['sticky_class'] = 'warning';
} elseif (3 == $thread['sticky']) {
$thread['sticky_class'] = 'danger';
}
}
$nopic = view_path() . 'img/nopic.png';
if ($thread['icon']) {
$attach_dir_save_rule = array_value($conf, 'attach_dir_save_rule', 'Ym');
$day = date($attach_dir_save_rule, $thread['icon']);
$thread_format_icon_default = 1;
if (1 == $thread_format_icon_default) {
// 本地文件绝对路径
$destfile = $conf['upload_path'] . 'thumbnail/' . $day . '/' . $thread['uid'] . '_' . $thread['tid'] . '_' . $thread['icon'] . '.jpeg';
// 本地
$thread['icon_fmt'] = is_file($destfile) ? file_path($thread['attach_on']) . 'thumbnail/' . $day . '/' . $thread['uid'] . '_' . $thread['tid'] . '_' . $thread['icon'] . '.jpeg' : $nopic;
if (1 == $conf['attach_on'] && 1 == $thread['attach_on']) {
// 云储存
$thread['icon_fmt'] = file_path($thread['attach_on']) . 'thumbnail/' . $day . '/' . $thread['uid'] . '_' . $thread['tid'] . '_' . $thread['icon'] . '.jpeg';
} elseif (2 == $conf['attach_on'] && 2 == $thread['attach_on']) {
// 图床 未上传成功 本地图片在的话使用本地,不在则默认
$thread['icon_fmt'] = $thread['image_url'] ? $thread['image_url'] : $thread['icon_fmt'];
}
}
} else {
$thread['icon_fmt'] = $nopic;
}
// 回复页面
$thread['pages'] = ceil($thread['posts'] / $conf['comment_pagesize']);
$thread['tag_fmt'] = $thread['tag'] ? xn_json_decode($thread['tag']) : '';
// 权限判断
$thread['allowupdate'] = ($uid == $thread['uid']) || forum_access_mod($thread['fid'], $gid, 'allowupdate');
$thread['allowdelete'] = (group_access($gid, 'allowuserdelete') and $uid == $thread['uid']) || forum_access_mod($thread['fid'], $gid, 'allowdelete');
$thread['allowtop'] = forum_access_mod($thread['fid'], $gid, 'allowtop');
$thread = well_thread_safe_info($thread);
}
function well_thread_format_last_date(&$thread)
{
if ($thread['last_date'] != $thread['create_date']) {
$thread['last_date_fmt'] = humandate($thread['last_date']);
} else {
$thread['create_date_fmt'] = humandate($thread['create_date']);
}
}
// 对 $threadlist 权限过滤
function well_thread_list_access_filter(&$threadlist, $gid)
{
global $forumlist;
if (empty($threadlist)) return NULL;
foreach ($threadlist as $tid => $thread) {
if (empty($forumlist[$thread['fid']]['accesson'])) continue;
if ($thread['sticky'] > 0) continue;
if (!forum_access_user($thread['fid'], $gid, 'allowread')) {
unset($threadlist[$tid]);
}
}
}
function well_thread_safe_info($thread)
{
unset($thread['userip'], $thread['user']['threads'], $thread['user']['posts'], $thread['user']['credits'], $thread['user']['golds'], $thread['user']['money']);
empty($thread['user']) || $thread['user'] = user_safe_info($thread['user']);
return $thread;
}
// 过滤安全数据
function well_thread_filter(&$val)
{
unset($val['userip'], $val['fid'], $val['flagid'], $val['type'], $val['user'], $val['create_date']);
}
//------------------------ 其他方法 ------------------------
// 集合主题tid,统一拉取,避免多次查询thread表
function thread_unified_pull($arr)
{
global $gid, $fid;
$stickylist = array_value($arr, 'stickylist', array());
$tidlist = array_value($arr, 'tidlist', array());
//$fid = array_value($arr, 'fid');
// 合并过滤空数组
//$tidlist = array_filter($stickylist + $tidlist);
$tidarrlist = $tidlist = $stickylist + $tidlist;
// 版块自定义
list($flaglist, $flagtids) = flag_thread_by_fid($fid);
empty($flagtids) || $tidarrlist += $flagtids;
unset($flagtids);
// 在这之前合并所有二维数组 tid值为键/array('tid值' => tid值)
$tidarr = empty($tidarrlist) ? array() : arrlist_values($tidarrlist, 'tid');
// 在这之前使用array_merge()前合并所有一维数组 tid/array(1,2,3)
if (empty($tidarr)) return NULL;
$tidarr = array_unique($tidarr);
// 主题相关统一遍历后再归类
$arrlist = well_thread_find($tidarr, count($tidarr));
// 过滤没有权限访问的主题 / filter no permission thread
well_thread_list_access_filter($arrlist, $gid);
$threadlist = array();
foreach ($arrlist as $_tid => &$_thread) {
$_thread = well_thread_safe_info($_thread);
// 归类列表数据
isset($tidlist[$_thread['tid']]) and $threadlist[$_tid] = $_thread;
// flag thread
if (!empty($flaglist)) {
foreach ($flaglist as $key => $val) {
if (isset($val['tids']) && in_array($_thread['tid'], $val['tids'])) {
$flaglist[$key]['list'][array_search($_thread['tid'], $val['tids'])] = $_thread;
ksort($flaglist[$key]['list']);
}
}
}
}
// 按之前tidlist排序
$threadlist = array2_sort_key($threadlist, $tidlist, 'tid');
unset($arrlist, $tidlist);
$arr = array('threadlist' => $threadlist, 'flaglist' => $flaglist);
return $arr;
}
// read.php 详情页其他主题调用,集合tid统一拉取数据,最后归类
function thread_other_pull($thread)
{
global $forumlist, $gid;
$fid = array_value($thread, 'fid');
$forum = array_value($forumlist, $fid);
if (empty($forum)) return NULL;
//$tid = array_value($thread, 'tid');
//$tag_fmt = array_value($thread, 'tag_fmt');
$arrlist = array();
$tidlist = array();
// 版块自定义
list($flaglist, $flagtids) = flag_thread_by_fid($fid);
empty($flagtids) || $tidlist += $flagtids;
unset($flagtids);
// 在这之前合并所有二维数组 tid值为键/array('tid值' => tid值)
$tidarr = empty($tidlist) ? array() : arrlist_values($tidlist, 'tid');
// 在这之前使用array_merge()前合并所有一维数组 tid/array(1,2,3)
if (empty($tidarr)) return NULL;
$tidarr = array_unique($tidarr);
// 主题相关统一遍历后再归类
$threadlist = well_thread_find($tidarr, count($tidarr));
// 过滤没有权限访问的主题 / filter no permission thread
well_thread_list_access_filter($threadlist, $gid);
foreach ($threadlist as &$_thread) {
$_thread = well_thread_safe_info($_thread);
// flag thread
if (!empty($flaglist)) {
foreach ($flaglist as $key => $val) {
if (isset($val['tids']) && in_array($_thread['tid'], $val['tids'])) {
$flaglist[$key]['list'][array_search($_thread['tid'], $val['tids'])] = $_thread;
ksort($flaglist[$key]['list']);
}
}
}
}
unset($threadlist);
if (!empty($flaglist)) {
foreach ($flaglist as &$val) {
$i = 0;
if (!isset($val['list'])) continue;
foreach ($val['list'] as &$v) {
++$i;
$v['i'] = $i;
}
}
$arrlist['flaglist'] = $flaglist;
unset($flaglist);
}
return $arrlist;
}
//--------------------------cache--------------------------
// 已格式化 从缓存中读取,避免重复从数据库取数据
function well_thread_read_cache($tid)
{
global $conf;
$key = 'website_thread_' . $tid;
static $cache = array(); // 用静态变量只能在当前 request 生命周期缓存,跨进程需要再加一层缓存:redis/memcached/xcache/apc
if (isset($cache[$key])) return $cache[$key];
if ('mysql' == $conf['cache']['type']) {
$r = well_thread_read($tid);
} else {
$r = cache_get($key);
if (NULL === $r) {
$r = well_thread_read($tid);
$r and cache_set($key, $r, 1800);
}
}
$cache[$key] = $r ? $r : NULL;
return $cache[$key];
}
?>
易经杂谈:语言处理、强化学习、计算机视觉、货币演变与BTC、现代医学编程频道|福州电脑网
易经杂谈:语言处理、强化学习、计算机视觉、货币演变与BTC、现代医学
编程之家770
更新时间:2026-04-10 02:37:19 目录
哲学与科技
现代医学与历史
传统文化
货币演变与比特币
西医
哲学与科技
德道经:德>仁>义>礼。人法地,军事。地法天,农业。天法道,天体天文和王朝周期律。道法自然,要懂得敬畏自然,并向大自然学习,使人道合于天道,工业和科技才不至于造成太多灾难。相比之下,康德的人为自然立法和先天综合判断,是绝对错误的!欧洲最偏爱德道经的是德国。尼采谦虚知道尊重道家,黑格尔的绝对精神和扬弃,抄袭了老子的反者道之动并且不承认。
易经讲象数理,无视现象去推理容易极端。从Q-Learning(动作和状态空间离散,关注的现象和数据可能范围有限)到DQN(基于价值函数Q(s,a)但因为神经网络而连续和辩证)再到duelingDQN(状态价值V(s)和优势函数分开建模,V更准确更知道是否避障),从REINFORCE到Actor-Critic算法(基于策略,引入价值函数)再到比它快可能6倍的DDPG,从 MADDPG到MAPPO,无不涉及易经哲学。
可把八个卦看成动能和势能的分布。离火是化学能向四周散发,震是地下动或云下雷。这和商业有关,八字和中医有关。脱离辩证的科技不太行:
- mediapipe有超敏感实时目标检测、人脸疲劳/分心检测,而2001年第一次实现实时人脸检测的cascadeClassifier被淘汰。
- TF-IDF无法理解句子结构或上下文含义用的越来越少。
- Word2Vec用于预训练,是静态词向量表示的一个里程碑,开启分布式表示并为后续深度学习在NLP领域的成功奠基。但静态表示根本缺陷是无法表示一词多义也无法捕捉复杂的句法依赖。
- LSTM/GRU关注文本深层含义用于翻译和生成。Attention可与Word2Vec结合,为序列中每个位置动态分配权重,关注全局依赖关系。
- 亚马逊首席科学家李沐b站有讲各种神经网络有细节、学校讲不清楚意义的操作基本会提。
资料评论学AI领取。NLP+计算机视觉+强化学习入门和进阶:路线、PPT、详细笔记代码。
现代医学与历史
传统文化
阴盛阳衰怪癖、把男性弱化阴柔化不只是西方的锅。中华民族往上推五千年都是一个族群。程朱理学控制科举导致明清失去贵族精神和节度使、滑铁卢战役决定现代金融、英国强大导致罗斯柴尔德富裕和李嘉诚卖国。几年前冻云迷雾预言,美国把产能和蓝领转移到第三世界(特朗普想挽回产能但实现不了)、结构不稳表现为内卷。少点内奸中华才会崛起,四年前他看美在全球撤侨、预言气象或粮食武器,结果有内奸搞转基因土豆。
阴:有形之物 地 右 前 黑 血 静 寒 女 体 月亮
阳:无形之物 天 左 后 白 气 动 热 男 用 太阳
李兆良考证的 坤舆万国图 迫使很多地图网站关闭。二进制,八进制,内存单元都属于珠算,微积分我们发明的,秦兵马俑上是超导材料硅酸铜钡,传统文化阴阳五行脏腑、八卦十二时辰356穴。还有四千年前舜帝发明农历,五千年前广西上饶傅家遗址开颅手术实践。
坤舆万国图是世界地图+天文学+大气分层,证明郑和 最早规模化跨洲际航海。
- 时间:1405 年至 1433 年,郑和率领舰队进行了 7 次下西洋。
- 航程:覆盖东南亚、印度洋、阿拉伯半岛、东非等区域,是当时世界上规模最大的远航。
- 舰队规模:最早的一次有200多艘船只,2.7万余名水手,堪称世界航海史上的奇迹。
美国在全球有300多个生化实验室,病毒基本是他搞的。SARS病毒我们有名医蒲辅周、新冠病毒我们有伤寒论。另外乙型脑炎我们有邓铁涛,现在手术刀用的明朝版本。
货币演变与比特币
第六识意,即分辨。第七识意根,名末那识,婴儿也有,我执习性德行。第八识阿赖耶识,似道,不直接与人和潜意识沟通。正确审美即自然,俗称德行好。现代货币是不良吸血系统,不过用的人暂时太多。审美低级就是违背自然和良心。BTC原则上是易存储、易分割、易交换、安全、自治、端到端和防篡改。
犹太人、港科大汪扬对比特币的价值的认识都是后知后觉,我国央行更是如此,直到想要模仿一个数字人民币才模糊萌芽。
人类从粮食到贝壳到白银到黄金再到纸币,货币价值越多,非货币价值越少。因为工作量证明、共识机制、拜占庭容错、SHA256加密,BTC能成为最好的货币。根据比特币白皮书的工作量证明、激励机制和计算机制(知乎有翻译),1.相同算力, 贪婪的攻击者的收益数学期望比诚实者低很多。2.而且找到下一区块诚实链概率p和攻击链概率q: 若p>q,则落后z个区块下,攻击链先追单个区块的概率随z指数下降=(q/p)^z。整个追上然后盗取的可能性更低。
易存储、易分割、易交换、安全...。剩下的自己找十年前冻云迷雾讲的。
我这些资料评论学区块链直接发,前三个是自己写的。
西医
北大心外教授董士勇说,现代医学能治好的慢性病非常少,两只手都能数过来。
倪海厦写下西医的十大罪证:
第一,服用西药后死得更快更痛苦
第二,西医是制造医学,以发现疾病为荣,产生的副作用当成新病。
第三,西医健康标准太低,根本不知道病因,等符合标准时,基本已经是晚期。
第四西医治不好的病让人转送给中医,根本不要脸。
第五,终身服药,一旦沾上终身就像被控制。
第六,疫苗害死人,增加社会负担医疗保险耗费大量国家资源。
第七,西医院治病越多检查越多,死的越快。仅看指标就做手术,西医误诊造成错误的开刀,造成人终身的痛苦。
第八,西药越发达人寿命越短,作假数据来替西药厂说话。
第九,西医科技发达,但是不科学,中医科技不发达,但是很科学。一双手、几根针,两分钟就能确定问题。
第十,为了赚钱,西医阻碍中药材进口。
本文发布于:2025-01-30,感谢您对本站的认可!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:易经货币杂谈现代医学视觉
发布评论