程序员都去什么网站上班-程序员下班后如何找女朋友? (彩蛋在文末)

生活中,我们经常发现很多程序员的薪水很高,但往往沦落为单身狗。 情人节将至,他们只能孤独一人,过着十分凄惨的生活。

程序员自从毕业进入IT行业后,往往与女性没有接触,一不小心就到了被催婚的年龄。

以前,阿里的一位高级工程师穿着一双安踏运动鞋去相亲,但被对方拒绝了。 后来某程序员自爆去相亲,却带着相亲对象吃了79个麦当劳,回来后被妹子拉黑。

程序员常常是你嘲笑的对象,因为他们每天晚上都在机器和笔记本上工作,给人的印象是书呆子、迟钝、不善于沟通……

据说世界上有两种程序员,一种是有女朋友的程序员,另一种是不知道其他程序员如何找到女朋友的程序员。

有女朋友的程序员如何找女朋友? 我们来看看网友们是怎么说的。

程序员下班后如何找女朋友?

@zhihu小鸡精

程序员都去什么网站上班-程序员下班后如何找女朋友?  (彩蛋在文末)

程序员女友内心OS:你瞎什么眼!

@zhihu杨诺

这可以说是惨不忍睹

@知识程序员阿姨

作为银幕上的程序员,你还喜欢女生吗?

@zhihuyu Cheng

在这个行业里,长得帅并不重要吧?

@几乎认识卡拉贾迪斯

说了这么离谱的话

程序员都去什么网站上班-程序员下班后如何找女朋友?  (彩蛋在文末)

很多女孩表示都想找个程序员做男朋友,但是为什么……

事实上,除了是个书呆子之外,为什么近乎完美的高薪程序员仍然单身呢? 对于这个问题目前还没有合理的解释。 那么,就让我们一起来看看下面的故事吧!

为什么程序员不再追女孩了?

为什么程序员不再追女孩了? 当然是因为,女朋友怎么能有好看的代码,女朋友怎么能有懂我的女朋友,还有女朋友总是关心我,我为什么要有女朋友。

对不起我撒谎了,我为什么撒谎,我先讲个故事。

3个月前,我向一见钟情的女孩发了求情信,没想到她回复数据的速度很快。

和它交互了一个月,传递了一些参数,我终于鼓起勇气发出新的请求。

没有反应,再恳求,再恳求,她还是回复了404,我觉得我的路径有问题。

可以ping通,但是无法访问,奇怪! 于是我决定用我哥们的代理服务器,我最好的朋友建议我改一下参数程序员都去什么网站上班,比如某种香水。

这次我立即响应,当我登录主页提示我提交数据时,她返回了一个空结果作为响应,所以我传递了更多参数并再次发送请求。

这次她显示权限不足,还是404。我找了我最好的朋友一起帮忙找bug,但是在找我的bug的过程中,我发现有几个人同时给她发请求,但是都得到了一个回复。

有的甚至已经开启了白名单。 原来服务器端并不是无法处理并发,而是直接忽略了我的请求。

最后我恍然大悟,原来是CPU和显卡的性能不够,只能当备份了。 难怪他们经常回复数据、接受参数程序员都去什么网站上班,但功能都无法使用。

程序员都去什么网站上班-程序员下班后如何找女朋友?  (彩蛋在文末)

最终我花了差不多10K,但我意识到是时候及时补仓了。 最后,当我狠心卸载的时候,她还是想尽办法保留,还让我评价一下服务……

过几天,有人建议我尝试访问好友的代理地址,传递同样的参数,也许能行,而且性能会更好。 但我没有这么做,因为即使在这个充满枪声的社会,我也不想成为一个被女生诟病的渣男。

幸运的是,我没有等到“我一直把你当同学”触发暂停请求,但最终由于天赋和学习的不足,我无法处理这些高并发问题,更不用说保证线程安全了。 考虑到时间、空间、个人心理问题后,只能选择放弃。

前几天,突然听到朋友圈里,一个头像可爱的女孩说:“为什么女孩子总是追到一半就不再追了?”

什么? 一半? 为什么要给一个进度条? 一个女孩怎么会认为自己应该一直被追到底呢? ! 对不起,这种事情对于被追求者来说是一半,但是对于追求者来说已经结束了。

你不喜欢我,我心里不承认,你嘴上也不承认,后来我想通了,我不欠你什么。

我不想因为吃苦而去学习套路,因为很多事情告诉我,世界上最甜蜜、最感人的人就是这些愚蠢的人,而不是这些牛逼(pi)。

我身边的程序员都是老实女儿。 我们有一些积蓄,但我们不想成为提款机。

如果你不喜欢我,请直接告诉我,我没有比特币,更没有208万,我会怀着远大的志向和你说再见,但我仍然相信感情,我只希望当我遇见你的时候,那就是你了!

读完上面的故事,你有何感想? 程序员可能是世界上“直男癌”患者最多的群体之一。

但是……你真以为他们是直率、死板、书呆子、不懂得甜蜜的人吗? 开什么玩笑啊! 值此520之际,小编特意搜集了这位程序员的专属求婚表分享给大家,一起来看看程序员用代码做出来的甜蜜吧~

程序员的小甜蜜——烟花

完整项目预览地址:

程序员都去什么网站上班-程序员下班后如何找女朋友?  (彩蛋在文末)

属性设计

烟花应该有三种状态:

烟花:发射点(x,y),爆炸点(xEnd,yEnd),升空后爆炸等待时间(wait),爆炸后颗粒数(计数),烟花直径(半径)

烟花爆炸后的粒子:它们自己的位置(x,y),它们自己的大小(size),它们自己的速度(rate),以及烟花的最大直径(半径)。

config:全局变量和控制参数,包括画布宽度和高度、设置firework属性等。

设置全局变量

  1. const config = {

  2.    width: 360,

  3.    height: 600,

  4.    canvases: ['bg', 'firework'],

  5.    skyColor: '210, 60%, 5%, 0.2)',

  6.    fireworkTime:{min:30,max:60},

  7.    //烟花参数本身有默认值 传入undefined则使用默认参数

  8.    fireworkOpt:{

  9.        x: undefined,

  10.        y: undefined,

  11.        xEnd: undefined,

  12.        yEnd: undefined,

  13.        count: 300,   //炸裂后粒子数

  14.        wait: undefined,  //消失后 => 炸裂  等待时间

  15.    }

  16. }

构建粒子

  1. class Particle{

  2.    //默认值写法

  3.    constructor({x, y, size = 1, radius = 1.2} = {}){

  4.        this.x = x;

  5.        this.y = y;

  6.        this.size = size;

  7.        this.rate = Math.random(); //每个微粒移动的速度都是随机不同的

  8.        this.angle = Math.PI * 2 * Math.random(); //每个微粒的偏移角度

  9.        //每次微粒移动速度分解为横纵坐标的移动。

  10.        this.vx = radius * Math.cos(this.angle) * this.rate;

  11.        this.vy = radius * Math.sin(this.angle) * this.rate;

  12.    }

  13.    go(){

  14.        this.x += this.vx;

  15.        this.y += this.vy;

  16.        this.vy += 0.02; //重力影响 y越大实际越偏下

  17.        //空气阻力

  18.        this.vx *= 0.98;

  19.        this.vy *= 0.98;

  20.    }

  21.    //画出微粒的位置

  22.    render(ctx){

  23.        this.go();

  24.        ctx.beginPath();

  25.        ctx.arc(this.x, this.y, this.size, 0, Math.PI * 2, false);

  26.        ctx.fill();

  27.    }

  28. }

构建 Fireworks 类

  1. class Firework{

  2.    constructor({x, y = config.height, xEnd, yEnd, count = 300, wait} = {}){

  3.        //烟花自身属性

  4.        this.x = x || config.width / 8 + Math.random() * config.width * 3 / 4;

  5.        this.y = y;

  6.        this.xEnd = xEnd || this.x;

  7.        this.yEnd = yEnd || config.width / 8 + Math.random() * config.width * 3 / 8;

  8.        this.size = 2;

  9.        this.velocity = -3;

  10.        this.opacity = 0.8;

  11.        this.color = `hsla(${360 * Math.random() | 0},80%,60%,1)`;

  12.        this.wait = wait || 30 + Math.random() * 30;

  13.        //微粒个数等

  14.        this.count = count;

  15.        this.particles = [];

  16.        this.createParticles();

  17.        this.status = 1;

  18.    }

  19.    //创建微粒

  20.    createParticles(){

  21.        for(let i = 0;i < this.count; ++i){

  22.            this.particles.push(new Particle({x:this.xEnd, y:this.yEnd}));

  23.        }

  24.    }

  25.    //升空

  26.    rise(){

  27.        this.y += this.velocity * 1;

  28.        this.velocity += 0.005; //升空时产生的阻力

  29.        //烟花升空到目标位置开始渐隐

  30.        if(this.y - this.yEnd <= 50){

  31.            this.opacity = (this.y - this.yEnd) / 50;

  32.        }

  33.        //如果到了目标位置 就开始第二个状态

  34.        if(this.y <= this.yEnd){

  35.            this.status = 2;

  36.        }

  37.    }

  38.    //渲染烟花  烟花所有动作完成之后返回false

  39.    render(ctx){

  40.        switch(this.status){

  41.            case 1: //升空

  42.            ctx.save();

  43.            ctx.beginPath();

  44.            ctx.globalCompositeOperation = 'lighter';

  45.            ctx.globalAlpha = this.opacity;

  46.            ctx.translate(this.x, this.y);

  47.            ctx.scale(0.8, 2.3);

  48.            ctx.translate(-this.x, -this.y);

  49.            ctx.fillStyle = this.color;

  50.            ctx.arc(this.x + Math.sin(Math.PI * 2 * Math.random()) / 1.2, this.y, this.size, 0, Math.PI * 2, false);

  51.            ctx.fill();

  52.            ctx.restore();

  53.            this.rise();

  54.            return true;

  55.            break;

  56.            case 2: //烟花消失阶段,等待炸裂

  57.            if(--this.wait <= 0){

  58.                this.opacity = 1;

  59.                this.status = 3;

  60.            }

  61.            return true;

  62.            break;

  63.            case 3: //炸裂之后 渲染烟花微粒

  64.            ctx.save();

  65.            ctx.globalCompositeOperation = 'lighter';

  66.            ctx.globalAlpha = this.opacity;

  67.            ctx.fillStyle = this.color;

  68.            for(let i = 0;i < this.particles.length;++i){

  69.            this.particles[i].render(ctx);

  70.            }

  71.            ctx.restore();

  72.            this.opacity -= 0.01;

  73.            return this.opacity > 0;

  74.            break;

  75.            default:

  76.            return false;

  77.        }

  78.    }

  79. }

点燃烟花

  1. const canvas = {

  2.    init: function(){

  3.        //一些属性的设定 可以不用管

  4.        this.setProperty();

  5.        this.renderBg();

  6.        //循环体 **主要

  7.        this.loop();

  8.    },

  9.    setProperty: function(){

  10.        this.fireworks = [];

  11.        this.width = config.width;

  12.        this.height = config.height;

  13.        this.fireworkTime = (config.fireworkTime.min + (config.fireworkTime.max - config.fireworkTime.min) * Math.random()) | 0;

  14.        this.bgCtx = document.querySelector('#bg').getContext('2d');

  15.        this.fireworkCtx = document.querySelector('#firework').getContext('2d');

  16.    },

  17.    renderBg(){

  18.        this.bgCtx.fillStyle = 'hsla(210, 60%, 5%, 0.9)'

  19.        this.bgCtx.fillRect(0, 0, this.width, this.height);

  20.    },

  21.    loop(){

  22.        requestAnimationFrame(this.loop.bind(this));

  23.        this.fireworkCtx.clearRect(0, 0, this.width, this.height);

  24.        //随机创建烟花

  25.        if(--this.fireworkTime <= 0){

  26.            this.fireworks.push(new Firework(config.fireworkOpt));

  27.            //每次到点之后重新设置烟花产生时间 (|0转化为整数)

  28.            this.fireworkTime = (config.fireworkTime.min + (config.fireworkTime.max - config.fireworkTime.min) * Math.random()) | 0;

  29.        }

  30.        for(let i = this.fireworks.length - 1; i >= 0; --i){

  31.            //渲染烟花 (若返回值为false则移除烟花)

  32.            !this.fireworks[i].render(this.fireworkCtx) && this.fireworks.splice(i,1);    

  33.        }

  34.    }

  35. }

  36. canvas.init();

完全的

这时的烟花就是这样的,感觉就像少了一点尾巴。

现在我们已经消除了每一帧的画布。 添加一个小尾巴看起来很简单。 不是消除每一帧的画布,而是覆盖一层新的透明天空。

  1. //canvas.loop方法

  2. // this.fireworkCtx.clearRect(0, 0, this.width, this.height);

  3. this.fireworkCtx.fillStyle = config.skyColor;

  4. this.fireworkCtx.fillRect(0,0,this.width,this.height);    

事情就是这样完成的。 不过,还是缺少爆燃后天空立即变亮的场景。 那么在画烟花的时候,首先得到烟花的颜色和透明度。

  1. // *****Firework constructor

  2. // this.color = `hsla(${360 * Math.random() | 0},80%,60%,1)`;

  3. this.hue = 360 * Math.random() | 0;

  4. this.color = `hsla(${this.hue},80%,60%,1)`;

  1. // *****Firework 新增实例方法

  2. getSkyColor(){

  3.    const skyColor = {

  4.        //只有炸裂阶段才返回亮度

  5.        lightness: this.status == 3 ? this.opacity : 0 ,

  6.        hue: this.hue

  7.    };

  8.    return skyColor;

  9. }

  1. // *****config 修改config的skyColor

  2. // skyColor: 'hsla(210, 60%, 5%, 0.2)',

  3. skyColor: 'hsla({hue}, 60%, {lightness}%, 0.2)',

  1. // canvas.loop方法

  2. //this.fireworkCtx.fillStyle = config.skyColor;

  3. //每次替换色调与亮度值。

  4. this.fireworkCtx.fillStyle = config.skyColor.replace('{lightness}', 5 + this.skyColor.lightness * 15).replace('{hue}' , this.skyColor.hue);

  5. this.skyColor = { //新增

  6.    lightness: 0,

  7.    hue: 210

  8. };

  9. for(let i = this.fireworks.length - 1; i >= 0; --i){

  10.    //新增 天空颜色为最亮的烟花的颜色

  11.    this.skyColor = this.skyColor.lightness >= this.fireworks[i].getSkyColor().lightness ? this.skyColor : this.fireworks[i].getSkyColor();

  12.    !this.fireworks[i].render(this.fireworkCtx) && this.fireworks.splice(i,1);    

  13. }

即使现在也已经完成了。

完整的项目

Github项目地址:

收藏 (0) 打赏

感谢您的支持,我会继续努力的!

打开微信/支付宝扫一扫,即可进行扫码打赏哦,分享从这里开始,精彩与您同在
点赞 (0)

悟空资源网 网站程序 程序员都去什么网站上班-程序员下班后如何找女朋友? (彩蛋在文末) https://www.wkzy.net/game/178771.html

常见问题

相关文章

官方客服团队

为您解决烦忧 - 24小时在线 专业服务