ARTS #005

ARTS #005

Posted by Dan on August 31, 2018

ARTS是由左耳朵耗子--陈皓发起的一个活动: 每周至少做一个leetcode的算法题、阅读并点评至少一篇英文技术文章、学习至少一个技术技巧、分享一篇有观点和思考的文章。(也就是Algorithm、Review、Tip、Share简称ARTS),至少坚持一年。

ARTS 005

这是第5篇,写的比较水,希望以后越来越好。

Algorihm 算法题

leetcode算法第481题 Magical String(神奇字符串) 难度:中等

A magical string S consists of only '1' and '2' and obeys the following rules:
The string S is magical because concatenating the number of contiguous occurrences of characters '1' and '2' generates the string S itself.
The first few elements of string S is the following: S = "1221121221221121122……"
If we group the consecutive '1's and '2's in S, it will be:
1 22 11 2 1 22 1 22 11 2 11 22 ......
and the occurrences of '1's or '2's in each group are:
1 2	2 1 1 2 1 2 2 1 2 2 ......
You can see that the occurrence sequence above is the S itself.
Given an integer N as input, return the number of '1's in the first N number in the magical string S.
Note: N will not exceed 100,000.
Example 1:
Input: 6
Output: 3
Explanation: The first 6 elements of magical string S is "12211" and it contains three 1's, so return 3.

神奇的字符串 S 只包含 '1' 和 '2',并遵守以下规则:
字符串 S 是神奇的,因为串联字符 '1' 和 '2' 的连续出现次数会生成字符串 S 本身。
字符串 S 的前几个元素如下:S = “1221121221221121122 ......”
如果我们将 S 中连续的 1 和 2 进行分组,它将变成:
1 22 11 2 1 22 1 22 11 2 11 22 ......
并且每个组中 '1' 或 '2' 的出现次数分别是:
1 2 2 1 1 2 1 2 2 1 2 2 ......
你可以看到上面的出现次数就是 S 本身。
给定一个整数 N 作为输入,返回神奇字符串 S 中前 N 个数字中的 '1' 的数目。
注意:N 不会超过 100,000。
示例:
输入:6
输出:3
解释:神奇字符串 S 的前 6 个元素是 “12211”,它包含三个 1,因此返回 3

解题思路:

这个题目的难点其实是怎么生成Magical String,简单一点来说就是找规律,这个规律就是题目中说的,1或2出现的次数是已知的,所以我们可以直接生成指定长度的字符串

int magicalString(int n) {
     int* result = (int*)malloc(sizeof(int) * (n+ 3));
    result[0] = 1;
    result[1] = 2;
    result[2] = 2;

    int pre =2;//当前已经生成的下标下一个
    int nextIndex = 2;//当前数组最后一位的下标
    int one_count = 1;
    
    for(;;pre++){
        int count = result[pre];
          int num = 3 - result[nextIndex];
          if(num == 1)
              one_count +=count;
        if(count ==1){
            result[++nextIndex] = num;
        }else {
            result[++nextIndex] = num;
            result[++nextIndex] = num;
        }
        if (nextIndex>=n) {
            int count =  nextIndex - n;
            for (; count >=0; count--) {
                int num11 = result[n+count];
                if (num11==1) {
                    one_count--;
                }
            }
            break;
        }
    }
    return one_count;
}

这个也可以这么写

int magicalString(int n) {
    if(n==0)
    return 0;
    if(n<4)
    return 1;
    int* result = (int*)malloc(sizeof(int) * (n+ 3));
    result[0] = 1;
    result[1] = 2;
    result[2] = 2;
    
    int pre =2;//当前已经生成的下标下一个
    int nextIndex = 2;//当前数组最后一位的下标
    int one_count = 1;
    
    for(;nextIndex<n;pre++){
        int count = result[pre];
        int num = 3 - result[nextIndex];
        
        if(count ==1){
            result[++nextIndex] = num;
        }else {
            result[++nextIndex] = num;
            result[++nextIndex] = num;
        }
        
    }
    
    for (int i = 2;  i < n; i++) {
        if (result[i] == 1) {
            one_count++;
        }
    }
    return one_count;
}

在LeetCode的运行时间是4.5ms,下面的代码是在LeetCode提交的运行时间是0ms的代码:


int magicalString(int n) {
    if (n < 2) return n;
    int r = 0;
    char* s = malloc(n);
    s[0] = 1, s[1] = 2;
    char* c = s;
    int v = 1;
    for (int i = 0; i < n; ) {
        int m = *c++;
        for (; i < n && m; --m) {
            s[i++] = v;
            r += v == 1;
        }
        v ^= 3;
    }
    free(s);
    return r;
}

Review

这篇文章来自: https://medium.com/s/story/how-do-we-stop-technology-addiction-c0c081b8c970

How Do We Stop Technology Addiction?(我们如何阻止技术成瘾)

(A guide to getting back the time our devices take from us,获取我们的设备从我们这里获取时间的指南)

You’re addicted to your smartphone. I’m addicted to my smartphone. The products and services we use on a daily basis have been designed to steal our attention and are continuously modified to become more addictive. 你沉迷于你的智能手机。 我沉迷于我的智能手机。 我们每天使用的产品和服务旨在吸引我们的注意力,并不断修改以使其更容易上瘾。

In many ways, attention is the lifeblood of modern business. For massive tech companies like Google, Facebook, Amazon, Netflix, and many others, there is a direct correlation(相关) between attention and growth/revenue/success. 在许多方面,注意力是现代商业的命脉。 对于像谷歌,Facebook,亚马逊,Netflix等许多大型科技公司而言,注意力与增长/收入/成功之间存在直接关联。

The recent evolution(演化) of technology raises many ethical and psychological questions. Are we being manipulated? Should we have more control? Do we truly understand the negative impacts of technology addiction? 最近技术的发展引发了许多道德和心理问题。 我们被操纵了吗? 我们应该有更多控制吗? 我们真的了解技术成瘾的负面影响吗?

A Recipe for Addiction(成瘾的食谱)

Adam Alter, author of Irresistible: The Rise of Addictive Technology and the Business of Keeping Us Hooked, emphasizes the fact that human beings have been susceptible(易受影响者) to behavioral addiction throughout history (long before smartphones). However, the technologies that have emerged over the past decade have drastically(大幅) amplified(放大) these tendencies. Adam Alter,“不可抗拒的诱惑:令人上瘾的技术和让我们上瘾的商业的兴起”的作者强调了这样一个事实,即人类在整个历史中都很容易受到行为上瘾(早在智能手机之前)。 然而,过去十年出现的技术已经大大放大了这些趋势。

Our addictions cause us to miss out on so many moments that we will never have the opportunity to relive. 我们的瘾使我们错过了很多我们永远不会有机会重温时刻。

After reading this book, it’s evident(明显) that our addiction to modern technology boils down to(归结为) some key elements that feed off one another: 在读完这本书后,很明显我们对现代技术的依赖归结为一些相互关联的关键因素:

  1. Variable Rewards(可变奖励) Each time you visit Facebook, you may have five notifications, you may have none. Your recent photo may have 12 Likes, it may have 270. This variable reward system is captivating(迷人、着迷) for obvious(明显) reasons and always keeps users coming back for more. It’s a slot machine. Every reward is unique. The feedback you receive from any given post updates in real-time and changes every minute. This gambling(赌博) mentality(心理) is difficult to resist(反抗、抗拒) and makes us feel the need to return frequently.每次访问Facebook时,你可能有五个通知,你可能没有。 你最近的照片可能有12个赞,它可能有270个。这个可变奖励系统因为显而易见的原因而着迷,并且总是让用户回来更多。 这是一台老虎机。 每一个奖励都是独特的。 您从任何给定的帖子收到的反馈会实时更新并每分钟更改一次。 这种赌博心态难以抗拒,让我们感到需要经常回归。

  2. Distraction娱乐 Boredom is our worst enemy, so we will do anything to avoid it — even if it’s something that make us less happy. In Alter’s book, he references a fascinating experiment from 2014 in which people actually preferred to shock(摇动、晃动) themselves than sit alone with their thoughts for 20 minutes. Many of us would prefer chaos over predictability in our daily lives, and social media reinforces(加强、增援) this notion because it’s a feedback loop that becomes more arresting the more we use it. 无聊是我们最大的敌人,所以我们会做任何事情来避免它 - 即使这是让我们不那么开心的事情。 在Alter的书中,他引用了一项2014年的一项引人入胜的实验,其中人们实际上更喜欢摇动自己而不是独自思考20分钟。 在我们的日常生活中,我们中的许多人更喜欢混乱而不是可预测性,而社交媒体强化了这一概念,因为它是一个反馈循环,我们越使用它,它就越引人注目。

  3. Stopping Cues 停止提示 In 2012, Netflix officially(正式的、官方的) launched the binge-watching revolution with the rollout of auto-play across its entire(整个/全部) platform. Soon enough, Facebook and YouTube adopted the same feature. This, of course, has led to a skyrocketing(暴涨) increase in video usage since then. On top of that, infinite(limitless or endless in space, extent, or size) scrolling has also become a mainstream design element in social media. The content never stops, which is how five minutes turns into 30 minutes — without the user even realizing it. 2012年,Netflix在其整个平台上推出了自动播放功能,正式启动了一场“看剧革命”。 很快,Facebook和YouTube采用了相同的功能。 当然,这导致从那时起视频使用量急剧增加。 最重要的是,无限滚动也成为社交媒体的主流设计元素。 内容永远不会停止,这就是为什么5分钟变成了30分钟——用户甚至都没有意识到(甚至都没有用户意识到)。

  4. Vanity Metrics 虚荣指标 In our culture, people are consumed by the constant(不断的/持续的) pursuit(追赶; 工作) of arbitrary(随意的/任性的) numerical(数字的) goals as a result of real-time feedback. You just ran ten miles. Walked 10,000 steps. Your post got 100 shares. You received your 1,000th follower. You surpassed(超越) all of your friends for the longest Snapstreak (the worst of all). These “micro-victories” don’t mean anything, but they provide us with a dopamine(多巴胺) hit each time, and their increasing frequency drives us to spend more time and strive(努力) to hit new trivial(不重要的) goals on a regular basis(on a regular basis 经常; 例行的; 有规律的). 在我们的文化中,由于实时的反馈,人们被不断追求任意的数字目标所消耗。 你跑了十英里。 走了10,000步。 你的帖子被分享了100次。 你收到了你的第1000个粉丝。 你超越了所有的朋友,获得了最长的Snapstreak(最糟糕的是)。 这些“微胜利”并不意味着什么,但它们每次都为我们提供了多巴胺,而且它们的频率越来越高,这促使我们花更多的时间,并努力定期达到新的琐碎目标。

The recipe(食谱; 处方; 秘诀) for addiction is potent(有效的,强有力的), and the scariest(使人惊恐的,吓人的,可怕的( scary的最高级 )) part is that these various(各种各样的; 多方面的) factors(因素) cause people to avoid face-to-face interactions(互动; 一起活动), spend less time with family and friends, and even risk(危险,冒险) their lives. Our addictions cause us to miss out on so many moments that we will never have the opportunity to relive. 成瘾的方法是有效的,最可怕的部分是这些因素导致人们避免面对面的互动,花更少的时间与家人和朋友,甚至冒着生命危险。 我们的瘾使我们错过了很多我们永远不会有机会重温的时刻,。

Alter’s 2017 TED Talk “Why Our Screens Make Us Less Happy” is an excellent(优秀的; 卓越的; ) synopsis(大纲; 摘要) of these issues and well worth(well worth很值得) your time. Alter 2017年的TED演讲“为什么我们的屏幕让我们不那么开心”是这些问题的绝佳概述,非常值得您花时间(去看一看)

Self-Awareness自我意识

Most people simply(只是) don’t understand how much time they spend on their devices, and Irresistible(不可抗拒) explores(勘查,探索) many of the alarming(使人害怕的,扰乱人心的) ways that technology has invaded(侵犯; 侵袭; 侵入) our lives over the past decade. Our lack of(lack of缺乏) self-awareness is one of the most troubling(费神,费心 ,trouble的现在分词, 令人不安; 使烦恼) signs(招牌; 手势,标识) of this epidemic(流行病; 迅速的传播). 大多数人根本不知道他们花了多少时间在自己的设备上,《万人迷Irresistible》探索了过去十年科技侵入我们生活的许多令人担忧的方式。我们缺乏自我意识是这一流行病最令人不安的迹象之一。

I realize that I’m dependent on these companies to make a living, but one of the main reasons for my concern( 关心; 顾虑) is because their advertising platforms work. 我意识到我依赖这些公司来谋生,但我担心的一个主要原因是他们的广告平台起作用

A few years ago, designer/developer Kevin Holesh created an eye-opening(使瞠目吃惊的,很有启发的; 大开眼界) app called Moment that allows people to track their day-to-day screen time and smartphone habits(习惯). Across the board, the results are consistent(一致的; 连续的; 不矛盾的; 坚持的): people severely(严重地; 严厉地) underestimate(低估; 看轻; 对…估计不足) their time spent on mobile devices. 几年前,设计师/开发人员Kevin Holesh创建了一款名为Moment的令人大开眼界的应用程序,可让人们跟踪他们的日常屏幕时间和智能手机习惯。 总体而言,结果是一致的:人们严重低估了他们在移动设备上花费的时间。

On average, we check our phones every six minutes, 150 times a day. Even when your smartphone is turned off, its presence(出席; 仪表;) alone has been proven( 证明/ 检验) to reduce your cognitive(认知的; 认识的) capacity(容量; 性能; 才能; 生产能力;). And in less than two decades, our face-to-face time with friends and family has decreased by nearly 30 percent. 平均来说,我们每六分钟查看一次手机,每天150次。即使你的智能手机关机了,它的存在也会降低你的认知能力。在不到20年的时间里,我们与朋友和家人面对面的时间减少了近30%。

Source: USC Annenberg Center for the Digital Future

There’s no denying(拒绝/拒绝承认) that we’re enamored(倾心的,被迷住的) by technology for obvious reasons, but the concern(涉及/使担忧/顾虑) is that we don’t understand the consequences(结果; 重要) of our behavior. In fact, many smartphone users are in denial(克制; 否认,否定; 拒绝,拒绝接受) about the level of distraction(注意力分散; 娱乐,消遣; 心烦意乱) caused by our devices. 不可否认的是,由于显而易见的原因,我们很痴迷于技术,但我们担心的是我们不理解我们行为的后果。 事实上,许多智能手机用户都否认我们的设备造成的注意力分散。

James Williams, a former(以前的,从前的) Google employee and advocate(提倡; 鼓吹;) for ethical(伦理学的; 道德的) design, believes social networks inhibit(抑制; 禁止) our ability to think clearly(明确地; 明亮地) and ultimately(根本; 最后,最终) affect us like a drug. The attention economy(经济; 节约) revolves(旋转/细想) around designing for addiction, so he believes that it “privileges(权益; 免责特权;特权) our impulses(冲动/凭冲动行事/突如其来的念头) over our intentions(意向; 目的; 打算; 意图).” 詹姆斯威廉姆斯,前谷歌员工和道德设计倡导者,认为社交网络抑制了我们清晰思考的能力,并最终像毒品一样影响我们。 注意力经济围绕着上瘾的设计,所以他相信它“优先考虑我们的冲动而不是我们的意图”。

To be honest, I personally feel as though(feel as though觉得,仿佛 ) I’m not helping the problem. For nearly a decade, I’ve been managing large-scale (large-scale大规模的,大范围的)Facebook advertising and Google AdWords campaigns(战役; 运动) across a wide variety of(a wide variety of种种,多种多样) industries(产业/工业). And the recent shift to(shift to转入) mobile (i.e. addiction) has been massive (大规模的; 大的,重的) on both channels.

说实话,我个人觉得我似乎没有帮助解决这个问题。近十年来,我一直在管理Facebook上的大型广告和谷歌AdWords广告,涉及各行各业。最近转向移动(即上瘾)的趋势在两个渠道都很明显。

The irony(反语; 讽刺,冷嘲) is not lost on me. I realize that I’m dependent on these companies to make a living(make a living谋生; 营生; 赚钱过活; 糊口谋生), but one of the main reasons for my concern is because their advertising platforms work. Really well. Some might say scary well. 讽刺的是,我没有忘记。我意识到我依赖这些公司来谋生,但我担心的主要原因之一是因为他们的广告平台有效。 真的很好。 有些人可能会说很可怕。

This is the reason why they own the digital advertising industry(advertising industry广告业). Savvy(知道,了解) advertisers all around the world drive billions of(billions of数以亿计的;亿万) dollars in revenue(收益; 财政收入; 税收收入) targeting(目标命中) users on social and search, and the data that Facebook and Google have at(have at攻击) their disposal(处置; 处置权; 清理) will only become more powerful over time. 这就是他们拥有数字广告业的原因。 全世界精明的广告客户都会在社交和搜索方面为用户带来数十亿美元的收入,Facebook和Google拥有的数据只会随着时间的推移变得更加强大。

The Facebook Problem(s)

On the surface(On the surface在表面上,在外表上), Facebook is the most obvious(明显的; 显著的) offender(罪犯; 得罪人的人; 犯规者) of catering(给养; 承办酒席; 提供饮食及服务; 提供饮食及服务) to people’s addictive and primitive(原始的/原生的) tendencies(倾向/趋势). Even the company’s former president Sean Parker recently stated(一定的; 陈述;) that Facebook’s initial(最初的; 开始的;) objective(目标的; 客观的) was to “consume as much of your time and conscious attention(conscious attention有意识注意) as possible.” 从表面上看,Facebook是迎合人们上瘾和原始倾向的最明显的冒犯者。 即使该公司前任总裁肖恩帕克最近表示,Facebook的最初目标是“尽可能多地消耗你的时间和有意识的关注。”

People don’t trust Facebook. And there has been a lot of momentum behind the fact that social media can negatively affect your emotional well-being. In response, Facebook vowed to make changes to the product after finally admitting that content on its platform can make people “feel worse” after leaving the site. The latest News Feed update, however, is only the beginning. 人们不相信Facebook。 社交媒体可能会对您的情绪健康产生负面影响,因此背后有很多动力。 作为回应,Facebook终于承认其平台上的内容可以让人们在离开网站后“感觉更糟”之后,发誓要对产品进行更改。 然而,最新的News Feed更新只是一个开始。

Roger McNamee, a successful venture(冒险) capitalist(资本家) and former mentor(导师) to Mark Zuckerberg, believes that major changes to the business have to occur before users notice a difference. His opinion is that nothing will improve with Facebook or Google “unless they abandon their current advertising models.” Roger McNamee是一位成功的风险投资家,曾任马克扎克伯格的导师,他认为,在用户注意到差异之前,必须对业务进行重大改变。 他的观点是,除非他们放弃目前的广告模式,否则Facebook或谷歌都无法改善。

McNamee and many others agree that Facebook in particular(特定) has a responsibility to fix the problem. And let’s be honest… they’ve got a few of them. But it’s clear that fake(假) news is bane(鸩毒/祸根) of their existence(存在) right now. McNamee和其他许多人都同意Facebook特别有责任解决这个问题。 说实话……他们有一些。 但很明显,假新闻是他们现在存在的祸根。

In 2016, Zuckerberg famously denied the idea that fake news could become prevalent(流行) on the platform. Former(前任的) President Barack Obama even warned them about this matter before Donald Trump’s election(选举), but they didn’t listen and the rest is history. Now we’re facing a situation where users will only become more susceptible(易感) to manipulation and falsehoods(虚虚实实) as they spend more time on the world’s largest social network. 在2016年,扎克伯格否认了假新闻可能在平台上流行的观点。 在唐纳德特朗普当选之前,前总统巴拉克奥巴马甚至警告过他们这件事,但他们没有听,其余的都是历史。 现在我们面临的情况是,用户只会在世界上最大的社交网络上花费更多时间,因此更容易受到操纵和虚假的影响。

John Battelle, CEO of NewCo, has some interesting ideas about how Facebook could proceed(继续), but argues(主张) that federal(联邦) regulation for Silicon Valley(硅谷) is a must. And some lawmakers(国会议员) are outraged(愤怒) at the lack of regulation to date.Facebook has no issue changing its platform on a regular basis (for users and advertisers alike), but it might be time to start considering a serious shift(转移) in the way it extracts(提取) revenue(收入) from attention. As it stands now, any form of engaging content equals profit whether it’s positive, negative, or simply false. NewCo首席执行官John Battelle对Facebook如何进行有一些有趣的想法,但认为联邦对硅谷的监管是必须的。 并且一些立法者对迄今为止缺乏监管感到愤怒.Facebook没有定期更改其平台的问题(对于用户和广告商而言),但是可能是时候开始考虑从其提取收入的方式的严重转变注意。 就目前而言,任何形式的引人入胜的内容都等于利润,无论是积极的,消极的还是假的。

Devices and Children

We can critique(批评,批判) social media, apps and games all day, but it’s important to note that the root of the problem began with the release of the iPhone in 2007. Since then, nothing has been the same. 我们可以整天批评社交媒体,应用和游戏,但重要的是要注意问题的根源始于2007年iPhone的发布。从那以后,没有什么是相同的。

By all accounts, Apple’s marquee product is a phenomenal(非凡的) invention that has changed lives and revolutionized industries, but the addictive nature of the device (and smartphones in general) is clear as day. And unfortunately we still don’t understand the long-term(长期) impact on children who have grown up with them,and whose parents don’t know any better. 从各方面来看,Apple的招牌产品是一项改变生活和革命性行业的惊人发明,但该设备(以及一般的智能手机)的上瘾性质日益明显。 不幸的是,我们仍然不理解长大后对他们长大的孩子的影响,他们的父母对此并不了解。

I’m also fearful(可怕/担心) that the manipulative(操纵) tactics(策略;战术) and addictive behavior are only increasing in magnitude(大小;量级;重要) with each generation. 我也担心操控策略和上瘾行为只会随着每一代人的增加而增加。

Recently, two major(重大的) Apple investors voiced their concerns about smartphone addiction in an open letter to the Cupertino-based company. This is a major step is the right direction because young children are spending more time with devices every day. The numbers are alarming: 最近,两位主要的苹果投资者在给库比蒂诺公司的公开信中表达了他们对智能手机成瘾的担忧。 这是一个重要的步骤是正确的方向,因为年幼的孩子每天花更多的时间在设备上。 数字惊人:

  1. A whopping(高达) 40 percent of children ages 0–8 have their own iPad. 高达40%的0-8岁儿童拥有自己的iPad。
  2. The average time spent on mobile devices each day for ages 0–8 increased by 860 percent (from five to 48 minutes) between 2011 and 2017. 2011年至2017年,0-8岁每天在移动设备上花费的平均时间增加了860%(从5分钟到48分钟)。
  3. On average, children under the age of 18 pull out their devices nearly twice as often as adults. 平均而言,18岁以下的儿童拔出设备的次数几乎是成人的两倍。

Smartphone addiction is also contributing to relationship troubles and unhappiness across younger generations. 智能手机成瘾也助长了年轻一代的关系烦恼和不快乐。

At the end of 2017, Facebook added insult(侮辱,凌辱; 损害) to injury by releasing an app for young children ages six to 12 called Messenger Kids, which has already stirred(搅动) up(stirred up挑起; 激起) a great deal of controversy(争议). As a parent, there are many reasons to be concerned. So what do we do now? 2017年底,Facebook通过发布一款名为Messenger Kids的6至12岁幼儿的应用程序,侮辱了伤害,该应用程序引发了很多争议。 作为父母,有许多理由需要关注。 所以我们现在怎么办? 2017年底,Facebook推出了一款面向6到12岁儿童的名为Messenger Kids的应用,这更是雪上加霜。这款应用已经引发了大量争议。作为父母,有很多理由值得关注。那么我们现在该怎么办呢?

Time Well Spent欢乐时光 很好的利用了时间

Tristan Harris, another former Google employee and expert(专家) on technology addiction, has been at the forefront(第一线) of this conversation for the past few years. His plea(恳求) is for Silicon Valley companies to take a more thoughtful(周到) approach(途径) to design and alter(改变; 更改) the way they develop their products and business models. Tristan Harris是另一位前谷歌员工和技术成瘾专家,过去几年一直站在这次谈话的最前沿。 他的请求是硅谷公司采取更周到的方法来设计和改变他们开发产品和商业模式的方式。

In a practice(实践) that Harris calls a “race to the bottom of the brain stem,” tech(高科技) firms(公司) continue to borrow tactics(战术; 策略,手段) from one another aimed at making us more addicted: auto-play videos (Netflix, YouTube, Facebook), photo-tagging (Facebook, Google, Instagram), the ‘Like’ button (Facebook, then everyone else), push notifications (everyone). The list goes on. 在哈里斯称之为“争夺大脑底层”的实践中,科技公司继续借助彼此的策略,旨在让我们更上瘾:自动播放视频(Netflix,YouTube,Facebook),照片标记( Facebook,谷歌,Instagram),“赞”按钮(Facebook,然后是其他所有人),推送通知(每个人)。 名单还在继续。

In another fantastic(极好的; 很大的) TED Talk, he explains how this prioritization(优先) of attention is simply another way of manipulating users for financial(金融的) gain(financial gain经济利益). 在另一个梦幻般的TED演讲中,他解释了这种注意力的优先次序是如何操纵用户获取经济利益的另一种方式。

Harris, along with a handful of other ex-Silicon Valley employees, recently launched an inspiring project called the Center for Humane Technology. The idea is to build a dedicated(专用) community of former tech insiders who are working to fix the “digital attention crisis” and create a new model. 哈里斯以及其他一些前硅谷员工最近推出了一个鼓舞人心的项目,称为人文科技中心。 我们的想法是建立一个由前技术内部人员组成的专门社区,他们正致力于解决“数字注意力危机”并创建新模式。

What began as a small movement(运动) known as “Time Well Spent” has exploded(爆炸/爆发) into a national(全国性/国民) conversation, with Harris leading the charge. The challenge that lies ahead(lies ahead摆在面前) is not a small one. But given the current pace(步伐) of technology, I would argue that we don’t have any other choice. 最初被称为“Time Well Spent”的小型运动已经爆发成为一场全国性的对话,Harris领导了这项运动。 未来的挑战不是一个小问题。 但鉴于目前的技术步伐,我认为我们没有任何其他选择。

Taking Control

It’s easy to be overly negative, but I certainly don’t want to downplay(淡化) the importance of technology and the opportunities(机会) it presents us. My entire career(事业/生涯) has revolved(围绕/运转) around advancements(进步) in tech and I’m grateful(感激) for that. However, I’m also fearful that the manipulative tactics and addictive behavior are only increasing in magnitude with each generation. 这很容易过于消极,但我当然不想淡化技术的重要性和它给我们带来的机会。 我的整个职业生涯都围绕着科技的进步,我很感激。 然而,我也担心操纵策略和上瘾行为只会随着每一代人的增加而增加。

As parents of a two-year-old and two-month-old, my wife and I have been intentional(故意的) about discussing technology usage and ensuring that any screen time feels like a social — not isolated — activity. But we are not perfect. Occasionally I am guilty of using my phone instead of simply being with my children in the moment, which makes me feel terrible because every minute is so precious. I know I can do better. 作为一个两岁零2个月大的父母,我和我的妻子一直有意讨论技术使用情况,并确保任何屏幕时间都像社交活动 - 而不是孤立的活动。 但我们并不完美。 我偶尔会因为使用手机而不是仅仅和孩子在一起而感到内疚,这让我觉得很糟糕,因为每一分钟都是如此珍贵。 我知道我可以做得更好。

Being mindful and present goes a long way, but these tech companies aren’t making it any easier on us. Putting a child in front of a screen is one of the easiest, quickest ways to make him or her seem “happier” in the short term. Unfortunately, that’s not the case. There is ample evidence to support the fact that extensive screen time is damaging young children. And while removing screens entirely is practically impossible, we have to remain aware of the fact that isolating children with screens is harmful to their development. The starting point is to acknowledge addiction and recognize that children are more vulnerable than anyone. 注意力和存在感很长,但这些科技公司并没有让我们更容易。 将孩子放在屏幕前是最简单,最快捷的方式之一,使他或她在短期内看起来更“快乐”。 不幸的是,事实并非如此。 有充分的证据支持这样一个事实,即大量的屏幕时间会伤害幼儿。 虽然完全去除屏幕几乎是不可能的,但我们必须意识到将屏幕隔离儿童对其发展有害。 起点是承认上瘾并认识到儿童比任何人都更容易受到伤害。

Silicon Valley, meanwhile, needs to harness its power to limit addiction through conscious, ethical product development. Digital media shouldn’t be viewed as a vending machine where attention turns into money without consequences. The negative effects are abundant and will only become more glaring as the race for our attention heats up. 与此同时,硅谷需要利用其力量通过有意识的,道德的产品开发来限制成瘾。 数字媒体不应被视为自动售货机,注意力转化为金钱而不会产生后果。 随着我们注意力的竞争加剧,负面影响是丰富的,只会变得更加明显。

In the meantime, track your smartphone habits. Use apps that make you feel better about yourself. Turn off unnecessary notifications. Hold yourself accountable. Set boundaries with your children. As adults, we must accept and understand own our addiction before we can encourage or expect more mindful behavior from our children. Easier said than done, but more important now than ever before. 在此期间,跟踪您的智能手机习惯。 使用让您对自己感觉更好的应用。 关闭不必要的通知。 保持自己的责任。 与您的孩子设定界限。 作为成年人,我们必须接受并理解自己的上瘾,然后我们才能鼓励或期待孩子更多的谨慎行为。 说起来容易做起来难,但现在比以往任何时候都更重要。

Tip

有时我们会有需求给view设置渐变色,如上图所示,这时我们可以CAGradientLayer这个类,具体使用方法如下:


CAGradientLayer *gradientLayer = [CAGradientLayer layer];
gradientLayer.locations = @[@0.0, @1.0];
gradientLayer.startPoint = CGPointMake(0, 0);
gradientLayer.endPoint = CGPointMake(1.0, 0);
gradientLayer.frame = closeButton.bounds;
gradientLayer.colors = @[(__bridge id)TCUIColorFromRGB(0xFF8F00).CGColor, (__bridge id)TCUIColorFromRGB(0xFF5500).CGColor];
 [view.layer addSublayer:gradientLayer];
     

Share

住在公司附近真的可以节省时间用来学习吗?

我们总觉得住在公司附近可以省时间,这样就可以有时间来学习提高自己了,真的是这样吗? 住在公司附近,相比住在离公司20多公里的地方,确实省不少时间,但是节省的时间真的是用来学习了吗?大部分并不是,而是在睡觉,在加班。反而离公司远的时候还能在路上看点东西。 住在离公司20多公里远的时候,每天要7点起床,坐60分钟的地铁到公司,晚上也要做一个小时的车程回家,在路上的这两个小时的时间还能看点东西。 离公司近的的时候呢,早上起的晚了,也是老时间到公司,所以早上省出来的时间基本用来睡觉了。 晚上呢,由于离家近,加班更多了,虽然可以回家稍微早一点,但是回到家也是不会看书的,没有环境,也没有心情。看吧,住的远的时候,还能有在路上的两个小时的时间去思考,去学习。住的近了反而生活和工作分的不那么开了。 所以所有的事情都有其两面性。有时候事情表面看起来是一回事,做起来又是另一回事。