自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

程序員如何在工作后找到女朋友?(文末有彩蛋)

新聞
生活中我們常常發(fā)現(xiàn)很多程序員拿著高薪,卻常常淪為單身狗,每當(dāng)情人節(jié)來臨,卻只能形單影只的一個(gè)人,過得十分凄慘。

 生活中我們常常發(fā)現(xiàn)很多程序員拿著高薪,卻常常淪為單身狗,每當(dāng)情人節(jié)來臨,卻只能形單影只的一個(gè)人,過得十分凄慘。

自從程序員畢業(yè)出來工作進(jìn)入 IT 行業(yè)之后,常常接觸不到女性,一不小心就到了被催戀催婚的年紀(jì)。

前有阿里的高級工程師,穿著一雙特步的運(yùn)動鞋去相親,結(jié)果被對方婉拒。后有某程序員自爆去相親,卻帶著相親對象吃 79 塊的肯德基,結(jié)果回去后就被妹子拉黑了。

程序員們常常是大家調(diào)侃的對象,是因?yàn)樗麄兠刻炫c機(jī)器為伍,和電腦打交道,給人們留下的印象是宅,木訥,不善交流......

據(jù)說世界上有 2 種程序猿,一種是有女朋友的程序猿,另一種是不知道別的程序猿是怎么找到女朋友的程序猿。

那些有女朋友的程序員都是怎么找到女朋友的呢?讓我們一起來看下網(wǎng)友們怎么說。

程序員如何在工作后找到女朋友?

@知乎 小醬油

程序猿女朋友內(nèi)心 OS:你特么才是瞎呢!

@知乎 楊锘

這可以說很慘了

@知乎 程序員大叔

屏幕前面作為程序猿的你還喜歡女孩子嗎?

@知乎 禹程

長得帥是不分國界邊界業(yè)界的好嗎?

@知乎 卡拉迦迪斯

說出了這么人神共憤的話

有很多妹子表示,都想找程序猿當(dāng)男朋友,奈何...

其實(shí),除了宅,近乎完美的高薪程序員為什么會至今單身呢?這個(gè)問題一直沒找到一個(gè)合理的解釋。那么,就先讓我們一起來看下面這個(gè)故事!

程序員們?yōu)槭裁床蛔放耍?/strong>

程序員們?yōu)槭裁床蛔放???dāng)然是因?yàn)?,女朋友哪有代碼好看,女朋友哪有基友懂我,女朋友老管我,為什么要有女朋友。

對不起我撒謊了,為什么撒謊,容我先講個(gè)故事。

3 個(gè)月前,我發(fā)送了一個(gè)請求給一見鐘情的姑娘,沒想到她很快地響應(yīng)了數(shù)據(jù)。

在交互了一個(gè)月,傳遞了一些參數(shù)后,最終我鼓起勇氣,發(fā)送一個(gè)新請求。

沒有響應(yīng),再次請求,再三請求,她還是響應(yīng)了個(gè) 404,我覺得我的路徑有問題。

能 ping 得通,就是訪問不了,怪事!于是我決定使用閨蜜這個(gè)代理服務(wù)器,閨蜜建議我換參數(shù),比如某款香水。

這次立即給我響應(yīng)了,登上主頁面提示我提交數(shù)據(jù),她則返回了空結(jié)果作為響應(yīng),于是我傳了更多的參數(shù),并再一次發(fā)出了請求。

這次她顯示權(quán)限不足,依然 404。我找了基友,幫忙一起找 Bug,但在找我的 Bug 過程中,發(fā)現(xiàn)有好幾個(gè)人同時(shí)在給她發(fā)請求,但都得到響應(yīng)了。

有的甚至已經(jīng)開通白名單,原來 Server 端并不是不能處理并發(fā),而是直接忽略了我的請求。

最后我恍然大悟,原來是 CPU、顯卡性能不夠,只能當(dāng)備用,怪不得頻頻響應(yīng)數(shù)據(jù),接受參數(shù),卻一個(gè)功能都用不了。

最終我花了差不多 10K,但我意識到該及時(shí)止損了,最后當(dāng)我狠心卸載的時(shí)候,她還百般挽留,讓我對服務(wù)進(jìn)行評價(jià)...

過幾天,別人建議我試試訪問閨蜜這個(gè)代理地址,傳遞同樣的參數(shù),說不定就通了,性能更優(yōu)。但我沒有這么做,因?yàn)榧词乖谶@炮火連天的社會,我也不想變成,女生口誅筆伐的渣男。

幸運(yùn)的是,我沒有等到“我一直把你當(dāng)朋友啊”這個(gè)觸發(fā)事件才終止請求,但最終因才疏學(xué)淺,無法處理這種高并發(fā)問題,更不能保證線程安全,在考慮到時(shí)間、空間,及個(gè)人精力問題后,只能選擇放棄。

前幾天,突然看到了一條朋友圈,一位擁有著萌萌頭像的姑娘說:“為什么男生總是追到一半就不追了?”

What?一半?你特么給個(gè)進(jìn)度條???怎么會有女生覺得自己就應(yīng)該一直被追到底啊?!對不起,這種事情對被追求者來說是一半,對追求者來說是已經(jīng)結(jié)束了。

你不喜歡我,我心里不承認(rèn),你嘴上不承認(rèn)后來我想明白了,我并不欠你的。

我并不想因?yàn)榇煺劬蛯W(xué)套路,因?yàn)楹芏嗍虑楦嬖V我,世界上最可愛最打動人心的都是那些傻逼,而不是那些牛逼(pi)。

身邊的程序員,都是老實(shí)孩子,我們是有點(diǎn)積蓄,但不想當(dāng)提款機(jī),我付出了真心,也希望收獲真心。

如果你不喜歡我,請直接告訴我,我沒有比特幣,更沒有 208 萬,和你來一次壯志凌云地告別,但我依然相信愛情,只希望,遇見你,就是你!

看完上述這個(gè)故事,你有何感想?程序員可能是這個(gè)世界上“直男癌” 患者最多的群體之一吧。

但是……你真當(dāng)他們木訥、死板、死宅、不懂浪漫?開什么玩笑!在 520 之際,小編特地收集了這個(gè)程序員專屬的告白方式與大家分享,一起看看程序員用代碼敲出的浪漫吧~

程序員的小浪漫----煙火

完整項(xiàng)目預(yù)覽地址:http://lingyouhuiquanla.com/lover/

屬性設(shè)計(jì)

煙花應(yīng)有的三個(gè)狀態(tài)狀態(tài):

  • 升空
  • 等待炸裂
  • 炸裂后

煙花:發(fā)射點(diǎn)(x,y),爆炸點(diǎn)(xEnd,yEnd),升空后等待炸裂時(shí)間(wait),炸裂后微粒個(gè)數(shù)(count),煙花半徑(radius)

煙花炸裂后微粒:自身位置(x,y),自身大?。╯ize),自身速度(rate),最大煙花半徑(radius)。

config:為全局變量,以及控制參數(shù),包括畫布寬高,設(shè)定煙花屬性等。

設(shè)定全局變量

  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.     //煙花參數(shù)本身有默認(rèn)值 傳入undefined則使用默認(rèn)參數(shù) 
  8.     fireworkOpt:{ 
  9.         x: undefined, 
  10.         y: undefined, 
  11.         xEnd: undefined, 
  12.         yEnd: undefined, 
  13.         count: 300,   //炸裂后粒子數(shù) 
  14.         wait: undefined,  //消失后 => 炸裂  等待時(shí)間 
  15.     } 

構(gòu)建微粒類

  1. class Particle{ 
  2.     //默認(rèn)值寫法  
  3.     constructor({x, y, size = 1, radius = 1.2} = {}){ 
  4.         this.x = x; 
  5.         this.y = y; 
  6.         this.size = size
  7.          
  8.         this.rate = Math.random(); //每個(gè)微粒移動的速度都是隨機(jī)不同的 
  9.         this.angle = Math.PI * 2 * Math.random(); //每個(gè)微粒的偏移角度 
  10.          
  11.         //每次微粒移動速度分解為橫縱坐標(biāo)的移動。 
  12.         this.vx = radius * Math.cos(this.angle) * this.rate;  
  13.         this.vy = radius * Math.sin(this.angle) * this.rate; 
  14.     } 
  15.  
  16.     go(){ 
  17.         this.x += this.vx; 
  18.         this.y += this.vy;  
  19.         this.vy += 0.02; //重力影響 y越大實(shí)際越偏下 
  20.          
  21.         //空氣阻力 
  22.         this.vx *= 0.98; 
  23.         this.vy *= 0.98; 
  24.     } 
  25.      
  26.     //畫出微粒的位置 
  27.     render(ctx){ 
  28.         this.go(); 
  29.         ctx.beginPath(); 
  30.         ctx.arc(this.x, this.y, this.size, 0, Math.PI * 2, false); 
  31.         ctx.fill(); 
  32.     } 

構(gòu)建煙花類

  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.          
  11.         this.opacity = 0.8; 
  12.         this.color = `hsla(${360 * Math.random() | 0},80%,60%,1)`; 
  13.         this.wait = wait || 30 + Math.random() * 30; 
  14.         //微粒個(gè)數(shù)等 
  15.         this.count = count
  16.         this.particles = []; 
  17.         this.createParticles(); 
  18.      
  19.         this.status = 1; 
  20.     } 
  21.     //創(chuàng)建微粒 
  22.     createParticles(){ 
  23.         for(let i = 0;i < this.count; ++i){ 
  24.             this.particles.push(new Particle({x:this.xEnd, y:this.yEnd})); 
  25.         } 
  26.     } 
  27.     //升空 
  28.     rise(){ 
  29.         this.y += this.velocity * 1; 
  30.         this.velocity += 0.005; //升空時(shí)產(chǎn)生的阻力 
  31.         //煙花升空到目標(biāo)位置開始漸隱 
  32.         if(this.y - this.yEnd <= 50){ 
  33.             this.opacity = (this.y - this.yEnd) / 50; 
  34.         } 
  35.         //如果到了目標(biāo)位置 就開始第二個(gè)狀態(tài) 
  36.         if(this.y <= this.yEnd){ 
  37.             this.status = 2; 
  38.         } 
  39.     } 
  40.      
  41.     //渲染煙花  煙花所有動作完成之后返回false 
  42.     render(ctx){ 
  43.         switch(this.status){ 
  44.             case 1: //升空 
  45.             ctx.save(); 
  46.             ctx.beginPath(); 
  47.             ctx.globalCompositeOperation = 'lighter'
  48.             ctx.globalAlpha = this.opacity; 
  49.             ctx.translate(this.x, this.y); 
  50.             ctx.scale(0.8, 2.3); 
  51.             ctx.translate(-this.x, -this.y); 
  52.             ctx.fillStyle = this.color; 
  53.             ctx.arc(this.x + Math.sin(Math.PI * 2 * Math.random()) / 1.2, this.y, this.size, 0, Math.PI * 2, false); 
  54.             ctx.fill(); 
  55.             ctx.restore(); 
  56.      
  57.             this.rise(); 
  58.             return true
  59.             break; 
  60.             case 2: //煙花消失階段,等待炸裂 
  61.             if(--this.wait <= 0){ 
  62.                 this.opacity = 1; 
  63.                 this.status = 3; 
  64.             } 
  65.             return true
  66.             break; 
  67.             case 3: //炸裂之后 渲染煙花微粒 
  68.             ctx.save(); 
  69.             ctx.globalCompositeOperation = 'lighter'
  70.             ctx.globalAlpha = this.opacity; 
  71.             ctx.fillStyle = this.color; 
  72.             for(let i = 0;i < this.particles.length;++i){ 
  73.             this.particles[i].render(ctx); 
  74.             } 
  75.             ctx.restore(); 
  76.             this.opacity -= 0.01; 
  77.             return this.opacity > 0; 
  78.             break; 
  79.             default:  
  80.             return false
  81.         } 
  82.     } 

放煙花

  1. const canvas = { 
  2.     init: function(){ 
  3.         //一些屬性的設(shè)定 可以不用管 
  4.         this.setProperty(); 
  5.         this.renderBg(); 
  6.          
  7.         //循環(huán)體 **主要 
  8.         this.loop(); 
  9.     }, 
  10.     setProperty: function(){ 
  11.         this.fireworks = []; 
  12.         this.width = config.width; 
  13.         this.height = config.height; 
  14.         this.fireworkTime = (config.fireworkTime.min + (config.fireworkTime.max - config.fireworkTime.min) * Math.random()) | 0; 
  15.      
  16.         this.bgCtx = document.querySelector('#bg').getContext('2d'); 
  17.         this.fireworkCtx = document.querySelector('#firework').getContext('2d'); 
  18.     }, 
  19.     renderBg(){ 
  20.         this.bgCtx.fillStyle = 'hsla(210, 60%, 5%, 0.9)' 
  21.         this.bgCtx.fillRect(0, 0, this.width, this.height); 
  22.     }, 
  23.      
  24.     loop(){ 
  25.         requestAnimationFrame(this.loop.bind(this)); 
  26.         this.fireworkCtx.clearRect(0, 0, this.width, this.height); 
  27.          
  28.         //隨機(jī)創(chuàng)建煙花 
  29.         if(--this.fireworkTime <= 0){ 
  30.             this.fireworks.push(new Firework(config.fireworkOpt)); 
  31.             //每次到點(diǎn)之后重新設(shè)置煙花產(chǎn)生時(shí)間 (|0轉(zhuǎn)化為整數(shù)) 
  32.             this.fireworkTime = (config.fireworkTime.min + (config.fireworkTime.max - config.fireworkTime.min) * Math.random()) | 0; 
  33.         } 
  34.      
  35.         for(let i = this.fireworks.length - 1; i >= 0; --i){ 
  36.             //渲染煙花 (若返回值為false則移除煙花) 
  37.             !this.fireworks[i].render(this.fireworkCtx) && this.fireworks.splice(i,1);     
  38.         } 
  39.      
  40.     } 
  41. canvas.init(); 

完善

此時(shí)煙花是這樣的,感覺少了點(diǎn)小尾巴。

現(xiàn)在我們每一幀都是清除了畫布,如果要加上小尾巴其實(shí)也很簡單,每一幀都不要清除畫布,而是覆蓋一層新的有透明度的天空上去。

  1. //canvas.loop方法 
  2.  
  3. // this.fireworkCtx.clearRect(0, 0, this.width, this.height); 
  4. this.fireworkCtx.fillStyle = config.skyColor; 
  5. this.fireworkCtx.fillRect(0,0,this.width,this.height);     

這時(shí)就變成這樣了。但是,還是缺少了在爆炸瞬間天空變亮的場景。那么在畫煙花的時(shí)候,先會獲取一下煙花的顏色以及透明度。

  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)`; 
  5. // *****Firework 新增實(shí)例方法 
  6. getSkyColor(){ 
  7.     const skyColor = { 
  8.         //只有炸裂階段才返回亮度 
  9.         lightness: this.status == 3 ? this.opacity : 0 , 
  10.         hue: this.hue 
  11.     }; 
  12.     return skyColor; 
  13. // *****config 修改config的skyColor 
  14. // skyColor: 'hsla(210, 60%, 5%, 0.2)'
  15. skyColor: 'hsla({hue}, 60%, {lightness}%, 0.2)'
  16. // canvas.loop方法 
  17. //this.fireworkCtx.fillStyle = config.skyColor; 
  18. //每次替換色調(diào)與亮度值。 
  19. this.fireworkCtx.fillStyle = config.skyColor.replace('{lightness}', 5 + this.skyColor.lightness * 15).replace('{hue}' , this.skyColor.hue); 
  20.  
  21. this.skyColor = { //新增 
  22.     lightness: 0, 
  23.     hue: 210 
  24. }; 
  25. for(let i = this.fireworks.length - 1; i >= 0; --i){ 
  26.     //新增 天空顏色為最亮的煙花的顏色 
  27.     this.skyColor = this.skyColor.lightness >= this.fireworks[i].getSkyColor().lightness ? this.skyColor : this.fireworks[i].getSkyColor(); 
  28.     !this.fireworks[i].render(this.fireworkCtx) && this.fireworks.splice(i,1);     

到現(xiàn)在就算是大功告成了。

完整項(xiàng)目

Github 項(xiàng)目地址:https://github.com/NewNewKing/SmallRomance

留 言 有 禮 活 動

程序員的你會如何浪漫表白呢?掃描下方二維碼,關(guān)注51CTO技術(shù)棧公眾號。歡迎在技術(shù)棧微信公眾號留言探討。小編將精選出最有價(jià)值的三條評論,分別獲得 50、30、20 元 的 紅 包 獎(jiǎng) 勵(lì),活動截止時(shí)間 5 月 25 號 12 時(shí)整。

責(zé)任編輯:武曉燕 來源: 互聯(lián)網(wǎng)素材綜合整理
相關(guān)推薦

2018-06-25 08:49:23

2018-06-11 09:00:58

2018-02-05 15:09:03

2020-12-14 09:17:47

程序員技術(shù)工資

2019-10-24 09:29:04

程序員程序員節(jié)女朋友

2018-05-28 09:05:17

程序員北京戶口加班

2009-04-07 11:17:48

程序員高薪求職

2019-01-02 09:49:42

代碼程序員女朋友

2018-10-31 11:17:55

程序員女朋友面試

2020-06-05 07:52:25

程序員離職編碼

2012-05-04 09:24:39

程序員開發(fā)彩蛋精神

2018-01-11 10:10:06

2015-06-26 11:44:15

程序員跳槽新工作

2015-11-12 15:39:53

程序員笑話

2012-07-31 08:30:33

程序員

2023-08-14 09:07:51

程序員軟件搜索

2015-08-26 10:17:29

程序員女朋友

2020-11-16 09:19:10

程序員IT互聯(lián)網(wǎng)

2019-11-04 10:37:16

PythonPython開發(fā)Python測試

2020-06-01 09:43:26

程序員互聯(lián)網(wǎng)系統(tǒng)
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號