张怀义 在小组 2049BBS
动态 帖子 71 评论 356 短评 0 收到的赞 送出的赞
  1. 张怀义   在小组 2049BBS 发表文章

    【转载】初恋情人是个鬼

    作曲 : 嫂嫂 作词 : 苏少安 演唱/混音:流芒菌

    无非是夜色撩人
    皮囊都好看逼真
    暗火点燃一口烟雾
    醉眼挑笑眉梢春
    你好呀 门口的先生
    你丢了一位初恋情人
    风来了 风又走了
    行人都睡了
    
    伪活者偏生最从容
    赴死之人总归是愚蠢
    好巧 好久 不见
    追忆者总归是狼狈
    潇洒之人偏生最天真
    “再给我来一杯vodka”
    
    无非是酒精作祟
    深吻也难以抗违
    暗火点燃眼底迷雾
    胸口蝴蝶飞一对
    飞啊飞 真假迷了神
    不如随我一起往下坠
    风走了 风又来了
    行人都醒了
    
    自大者偏生不屈身
    卑微之人总归最无畏
    可嘲 可哀
    散了
    糊涂者总归最好为
    清醒之人偏生不喜悲
    “我的初恋情人是个鬼”
    
  2. 张怀义   在小组 2049BBS 发表文章

    今天量体温,37.8度

    我感觉,头晕,发热,不舒服,而且拉肚子。

    进出小区保安量体温37.8度,我和保安说是设备坏了,让他去修下,他就放我进小区了。

    我想休息一会了。下周估计也没法入职了!!!

    也没法帮女朋友写毕业论文了。。。还有好多事情没有做。。。

  3. 张怀义   在小组 2049BBS 发表文章

    2049bbs有onion地址么?刚才看到了

    刚才打开2049bbs的时候,提示了一个cfluare打头的onion地址。我还没有保存,这个地址就没了

    有人知道么?

  4. 张怀义   在小组 2049BBS 发表文章

    rss 不输出树洞、水区和垃圾场内容

    https://github.com/Terminus2049/2049bbs/issues/7

    修改代码路径 https://github.com/Terminus2049/2049bbs/blob/master/controller/feed.go

    package controller
    
    
    
    import (
    
    	"net/http"
    
    	"strconv"
    
    	"text/template"
    
    
    
    	"github.com/terminus2049/2049bbs/model"
    
    	"goji.io/pat"
    
    )
    
    
    
    func (h *BaseHandler) FeedHandler(w http.ResponseWriter, r *http.Request) {
    
    	w.Header().Set("Content-Type", "application/atom+xml; charset=utf-8")
    
    
    
    	scf := h.App.Cf.Site
    
    
    
    	var feed = `<?xml version="1.0" encoding="utf-8"?>
    
    <feed xmlns="http://www.w3.org/2005/Atom">
    
    	<title>` + scf.Name + `</title>
    
    	<link rel="self" type="application/atom+xml" href="` + scf.MainDomain + `/feed"/>
    
    	<link rel="hub" href="https://pubsubhubbub.appspot.com"/>
    
    	<updated>{ {.Update} }</updated>
    
    	<id>` + scf.MainDomain + `/feed</id>
    
    	<author>
    
    		<name>` + scf.Name + `</name>
    
    	</author>
    
    	{ {range $_, $item := .Items} }
    
    	<entry>
    
    		<title>{ {$item.Title} }</title>
    
    		<id>` + scf.MainDomain + `/t/{ {$item.Id} }</id>
    
    		<link rel="alternate" type="text/html" href="` + scf.MainDomain + `/t/{ {$item.Id} }" />
    
    		<published>{ {$item.AddTimeFmt} }</published>
    
    		<updated>{ {$item.EditTimeFmt} }</updated>
    
    		<content type="text/plain">
    
    		  { {$item.Cname} } - { {$item.Name} } - { {$item.Des} }
    
    		</content>
    
        </entry>
    
    	{ {end} }
    
    </feed>
    
    `
    
    
    
    	db := h.App.Db
    
    
    
    	items := model.ArticleFeedList(db, 20, h.App.Cf.Site.TimeZone)
    
    
    
    	var upDate string
    
    	if len(items) > 0 {
    
    		upDate = items[0].AddTimeFmt
    
    	}
    
    
    
    	t := template.Must(template.New("feed").Parse(feed))
    
    	t.Execute(w, struct {
    
    		Update string
    
    		Items  []model.ArticleFeedListItem
    
    	}{
    
    		Update: upDate,
    
    		Items:  items,
    
    	})
    
    }
    
    
    
    func (h *BaseHandler) FeedCategoryHandler(w http.ResponseWriter, r *http.Request) {
    
    	w.Header().Set("Content-Type", "application/atom+xml; charset=utf-8")
    
    
    
    	scf := h.App.Cf.Site
    
    
    
    	var feed = `<?xml version="1.0" encoding="utf-8"?>
    
    <feed xmlns="http://www.w3.org/2005/Atom">
    
    	<title>` + scf.Name + `</title>
    
    	<link rel="self" type="application/atom+xml" href="` + scf.MainDomain + `/feed"/>
    
    	<link rel="hub" href="https://pubsubhubbub.appspot.com"/>
    
    	<updated>{ {.Update} }</updated>
    
    	<id>` + scf.MainDomain + `/feed</id>
    
    	<author>
    
    		<name>` + scf.Name + `</name>
    
    	</author>
    
    	{ {range $_, $item := .Items} }
    
    	<entry>
    
    		<title>{ {$item.Title} }</title>
    
    		<id>` + scf.MainDomain + `/t/{ {$item.Id} }</id>
    
    		<link rel="alternate" type="text/html" href="` + scf.MainDomain + `/t/{ {$item.Id} }" />
    
    		<published>{ {$item.AddTimeFmt} }</published>
    
    		<updated>{ {$item.EditTimeFmt} }</updated>
    
    		<content type="text/plain">
    
    		  { {$item.Cname} } - { {$item.Name} } - { {$item.Des} }
    
    		</content>
    
        </entry>
    
    	{ {end} }
    
    </feed>
    
    `
    
    
    
    	cid := pat.Param(r, "cid")
    
    	_, err := strconv.Atoi(cid)
    
    	if err != nil {
    
    		w.Write([]byte(`{"retcode":400,"retmsg":"cid type err"}`))
    
    		return
    
    	}
    
    			if cid == 19 || cid == 20 {
    
    		w.Write([]byte(`{"retcode":400,"retmsg":"cid is illeage"}`))
    
    		return
    
    					}
    
    	db := h.App.Db
    
    
    
    	items := model.ArticleFeedCategoryList(db, cid, 20, h.App.Cf.Site.TimeZone)
    
    
    
    	var upDate string
    
    	if len(items) > 0 {
    
    		upDate = items[0].AddTimeFmt
    
    	}
    
    
    
    	t := template.Must(template.New("feed").Parse(feed))
    
    	t.Execute(w, struct {
    
    		Update string
    
    		Items  []model.ArticleFeedListItem
    
    	}{
    
    		Update: upDate,
    
    		Items:  items,
    
    	})
    
    }
    
  5. 张怀义   在小组 2049BBS 发表文章

    2049代码记录

    Q4 表示 分母是 2的4次方。同理 Q10 表示 分母是 2的10次方。

    以下是数学推导过程 10 * log10("true energy") in Q4 = 2^4 * 10 * log10("true energy")

    = 160 * log10(2) * log2("true energy")

    令 true energy = |energy| * 2^|tot_rshifts| 且 |kLogConst| = 160 * log10(2)

    160 * log10(2) * log2("true energy") = |kLogConst| * log2(|energy| * 2^|tot_rshifts|)

    = |kLogConst| * (log2(|energy|) + |tot_rshifts|)

    令 |energy| = 2^14 + frac_Q15

    |kLogConst| * (log2(|energy|) + |tot_rshifts|) = |kLogConst| * (log2(2^14 + frac_Q15 ) + |tot_rshifts|)

    = |kLogConst| * (log2(2^14 (1+ frac_Q15>>14) ) + |tot_rshifts|)

    = |kLogConst| * (14 + log2(1+ frac_Q15>>14) + |tot_rshifts|)

    ~= |kLogConst| * (14 + frac_Q15>>14 + |tot_rshifts|)

    令 frac_Q15 = (|energy| & 0x00003FFF)

    int16_t log2_energy = kLogEnergyIntPart;

    log2_energy += (int16_t) ((energy & 0x00003FFF) >> 4);

    *log_energy = (int16_t)(((kLogConst * log2_energy) >> 19) +

        ((tot_rshifts * kLogConst) >> 9));
    
  6. 张怀义   在小组 2049BBS 发表文章

    2049增加Google验证码代码

    参考文章 https://www.socketloop.com/tutorials/golang-recaptcha-example

    1.去这里 http://www.google.com/recaptcha/ 申请secret key

    2.修改代码

    https://github.com/Terminus2049/2049bbs/blob/master/view/default/desktop/userlogin.html
    <p><label>验证码: <input type="text" id="captchaSolution" class="sl w200" value="" /></label></p>
    

    改为

    <p><label>验证码: <div class="g-recaptcha" data-sitekey="[第一步申请的secret key]"></div></label></p>
    

    另外 修改 form_post 函数

        function form_post(){
            var name = $('#name').val();
            var password = $('#password').val();
            var password2 = $('#password2').val();
            var g-recaptcha-response= $('#g-recaptcha-response').val();
            if(name && password && g-recaptcha-response){
                if(password && password2) {
                    if(password != password2){
                        $.toast('密码两次输入不同');
                        $('#password').val('');
                        $('#password2').val('');
                        return false;
                    }
                }
    
                $.ajax({
                    type: "POST",
                    url: "/{ {.Act} }",
                    data: JSON.stringify({'act': '{ {.Act} }', 'name': name, 'password': md5(password), 'g-recaptcha-response': g-recaptcha-response}),
                    dataType: "json",
                    success: function(data){
                        if(data.retcode==200){
                            window.location.href = "/";
                        }else{
                                reload();
                            $.toast(data.retmsg);
                        }
                    },
                    fail: function(errMsg) {
                        $.toast(errMsg);
                    }
                });
            }else{
                $.toast('用户名、密码和验证码必填');
            }
            return false;
        }
    

    mobile版本,参考desktop继续修改 https://github.com/Terminus2049/2049bbs/blob/master/view/default/mobile/userlogin.html

  7. 张怀义   在小组 2049BBS 发表文章

    从B站的av到BV说起~

    在知乎上,看到大神发了如何av转BV的算法。这里大部分都看懂了,唯有base58不理解。

    我通过Google搜索,发现了一个开源项目bitcoin ''' https://github.com/bitcoin/bitcoin/blob/master/src/base58.cpp '''

    看不懂,明天看看~

    后来看到一个很熟悉的单词 Merkel tree ''' https://github.com/bitcoin/bitcoin/blob/master/src/merkleblock.cpp '''

    忘了老师上课怎么说来着,也makr下,明天继续看看~

    我还发现了一堆网址 '''

        vSeeds.emplace_back("seed.bitcoin.sipa.be"); // Pieter Wuille, only supports x1, x5, x9, and xd
        vSeeds.emplace_back("dnsseed.bluematt.me"); // Matt Corallo, only supports x9
        vSeeds.emplace_back("dnsseed.bitcoin.dashjr.org"); // Luke Dashjr
        vSeeds.emplace_back("seed.bitcoinstats.com"); // Christian Decker, supports x1 - xf
        vSeeds.emplace_back("seed.bitcoin.jonasschnelli.ch"); // Jonas Schnelli, only supports x1, x5, x9, and xd
        vSeeds.emplace_back("seed.btc.petertodd.org"); // Peter Todd, only supports x1, x5, x9, and xd
        vSeeds.emplace_back("seed.bitcoin.sprovoost.nl"); // Sjors Provoost
        vSeeds.emplace_back("dnsseed.emzy.de"); // Stephan Oeste
    

    '''

    最后是零知识证明!

    果然开启了新世界的大门~

    一些我个人的观点,区块链技术就是骗钱的,我都不知道我研究区块链干嘛?

    明天先研究会比特币,等研究好了。我想看看以太坊的代码。

    https://github.com/ethereum/go-ethereum

    https://github.com/hyperledger/hyperledger

    下周去上班了,大家就看不见我了,希望大家保重

  8. 张怀义   在小组 2049BBS 发表文章

    Bosses Panic-Buy Spy Software To Keep Tabs On Remote Workers

    https://tech.slashdot.org/story/20/03/27/1943251/bosses-panic-buy-spy-software-to-keep-tabs-on-remote-workers

  9. 张怀义   在小组 2049BBS 发表文章

    高校毕业生面临萎缩的就业市场

    https://www.bbc.com/zhongwen/simp/chinese-news-52063919

    2020 年,中国有 341 万人报考研究生,比 2019 年增加 50 多万人。这也是历史的新高。

  10. 张怀义   在小组 2049BBS 发表文章

    Lisa大神能不能帮忙解释下这两个问题?

    https://pincong.rocks/article/17023

    这个是什么原理?

    https://pincong.rocks/question/22222

    这个可行么?

  11. 张怀义   在小组 2049BBS 发表文章

    2月份中国手机市场总体出货量为638.4万部,同比下降56.0%

    中金公司也第二次下调智能手机市场预期,表示2020年全球智能手机预订量将减少7%,其中二季度国内、海外疫情影响重叠,全球出货同比降幅达26%。三季度中国疫情影响消退,全球增长率5.9%,四季度增速转正。

  12. 张怀义   在小组 2049BBS 发表文章

    2月份中国汽车销量同比下降79.1%,全国汽车销量仅为31万辆

    有政府背景的中国汽车工业协会(China Association of Automobile Manufacturers)周四称,2月份中国汽车销量同比下降79.1%,全国汽车销量仅为31万辆。这是中国汽车业近几十年来最为糟糕的月度表现。

  13. 张怀义   在小组 2049BBS 发表文章

    美国准备切断华为全球的芯片供应

    https://cn.reuters.com/article/us-huawei-chip-restriction-0327-idCNKBS21E03P

  14. 张怀义   在小组 2049BBS 发表文章

    日本工程师将出售 1470 万 IPv4 地址

    https://www.theregister.co.uk/2020/03/26/apnic_jun_murai_ipv4_auction/

  15. 张怀义   在小组 2049BBS 发表文章

    如何评价2020年3月26日大陆对GitHub.io的中间人攻击

    https://www.v2ex.com/t/656367

    划重点,DNS返回的IP是真实地github.io地址, 但是这个IP返回的证书是假的

  16. 张怀义   在小组 2049BBS 发表文章

    应届本科毕业,该去一线城市,还是回老家?

    我今年毕业,不想考研。英语不好,没法出国留学/

    想去应聘程序员,也没有公司要我。我想问问,我现在的情况,是应该去一线城市碰碰运气,还是回老家// 我回老家估计就在那里娶妻生子,再也离不开了!//老家很穷,不是很想回去。哪怕回去也找不到工作。今年经济环境不好,我去准备明天的电话面试了。。。

  17. 张怀义   在小组 2049BBS 发表文章

    709案维权律师王全璋出狱倒计时

    我知道王全璋很可怜。不知道能不能去美国申请政治庇护

  18. 张怀义   在小组 2049BBS 发表文章

    应届生能不能去当程序员?

    工商管理专业的,学校里教了java和网络工程。

    我会java,我觉得比较好找工作吧? 现在会java能去什么公司应聘程序员啊?

    事情是这样的,我出去找工作,没人要我。我可能想去当程序员,修改下简历。有没有人告诉我,我该怎么做?

    我会冒泡排序,这个学校里教了,我会写的。其他的需要准备什么?一般面试都问什么?我没有女朋友。 家里都是农民,我大学刚毕业,不是硕士。 不想考国内的硕士,国外的话,我英语也不好。哎!怎么办啊,找不到工作

  19. 张怀义   在小组 2049BBS 发表文章

    【PS4游戏】 鬼灭之刃:火神血风谭

    https://www.bilibili.com/video/BV1ez411b7j5

  20. 张怀义   在小组 2049BBS 发表文章

    特朗普:不会再使用“中国病毒”这一说法

    美国总统特朗普在当地时间3月24日表示,决定不再将2019冠状病毒与中国联系在一起,包括不再使用“中国病毒”这一说法。

    据美国有线电视新闻网(CNN)报道,特朗普在接受福克斯电视台(FOX)采访时说:“你看,大家都知道它源自于中国,但我决定不应再用这一点大做文章。我想人民已经明白了。”

    特朗普也指,并不后悔早前使用这个名称来形容病毒,并辩护说有其他以来源地命名的传染性疾病。

    在特朗普发生转变前,曾在3月23日发推特呼吁保护美国亚裔群体,并指出“新冠病毒不是亚裔美国公民的错,他们是很棒的人”。

    此外,CNN在报道中指出,在咨询医学专家以及收到世界卫生组织的指导后,CNN认为该名称不准确,是一种污名化。至于2019冠状病毒的发源地,包括中国外交部发言人耿爽在内的部分中国民众,都认为这个问题仍存在争议。

  21. 张怀义   在小组 2049BBS 发表文章

    今年大学生怎么找工作啊?

    经济环境好差啊!投了好多简历,找不到工作了!!! 怎么办啊?不想花父母的钱。 今年中共经济崩盘了,我怎么办啊?

  1. 1