精华内容
下载资源
问答
  • <div><p>From EF on discord: <p>Idea from ... That way, people will understand why low-view content is up there sometimes (okay, a lot). 该提问来源于开源项目:lbryio/lbry-desktop</p></div>
  • TV Trending Missing

    2020-12-08 20:16:49
    <div><p>Not sure if this is a bug or I messed something up but if it makes any difference on the W32 version it works fine, on my Linux VM console displays this <p>File "/usr/lib/python2.6/...
  • <div><p>Since the last update we the /trending category will show obsolete posts which are several days old. These posts seem to remain there until the second payout happens (4 weeks), which is ...
  • <div><p>Is it maybe a html parsing issue? Heard that github changed some html tags, so it might have messed it up. </p><p>该提问来源于开源项目:ThirtyDegreesRay/OpenHub</p></div>
  • <p>I think it would be more intuitive if you would get sent back to the Trending app to browse for more projects instead of having to click on the Trending tab again to bring it up.</p><p>该提问来源于...
  • 什么是产品搜寻趋势标签扩展 “产品搜索趋势标签”用“产品搜索”趋势产品替换了浏览器的新标签屏幕,因此猎人,制造商或关注者每天都可以了解趋势产品。 它会在后台定期加载趋势产品,因此您无需在每次打开新标签时...
  • SWERC13 Trending Topic

    千次阅读 2014-08-25 01:21:15
    map暴力。。。 Imagine you are in the hiring process for a company whose principal activity is the analysis ...of information in the ... One of the tests consists in writing a program for maintaining up


    map暴力。。。


    Imagine you are in the hiring process for a company whose principal activity is the analysis
    of information in the Web. One of the tests consists in writing a program for maintaining up to
    date a set of trending topics. You will be hired depending on the efficiency of your solution.
    They provide you with text from the most active blogs. The text is organised daily and you
    have to provide the sorted list of the N most frequent words during the last 7 days, when asked.
    INPUT
    Each input file contains one test case. The text corresponding to a day is delimited by tag
    <text>. Queries of top N words can appear between texts corresponding to two different days.
    A top N query appears as a tag like <top 10 />. In order to facilitate you the process of reading
    from input, the number always will be delimited by white spaces, as in the sample.
    Notes:
    • All words are composed only of lowercase letters of size at most 20.
    • The maximum number of different words that can appear is 20000.
    • The maximum number of words per day is 20000.
    • Words of length less than four characters are considered of no interest.
    • The number of days will be at most 1000.
    • 1 ≤ N ≤ 20
    OUTPUT
    The list of N most frequent words during the last 7 days must be shown given a query. Words
    must appear in decreasing order of frequency and in alphabetical order when equal frequency.
    There must be shown all words whose counter of appearances is equal to the word
    at position N. Even if the amount of words to be shown exceeds N.


    SAMPLE INPUT
    <text>
    imagine you are in the hiring process of a company whose
    main business is analyzing the information that appears
    in the web
    </text>
    <text>
    a simple test consists in writing a program for
    maintaining up to date a set of trending topics
    </text>
    <text>
    you will be hired depending on the efficiency of your solution
    </text>
    <top 5 />
    <text>
    they provide you with a file containing the text
    corresponding to a highly active blog
    </text>
    <text>
    the text is organized daily and you have to provide the
    sorted list of the n most frequent words during last week
    when asked
    </text>
    <text>
    each input file contains one test case the text corresponding
    to a day is delimited by tag text
    </text>
    <text>
    the query of top n words can appear between texts corresponding
    to two different days
    </text>
    <top 3 />
    <text>
    blah blah blah blah blah blah blah blah blah
    please please please
    </text>
    <top 3 />
    2
    Problem IProblem I
    Trending Topic
    SAMPLE OUTPUT
    <top 5>
    analyzing 1
    appears 1
    business 1
    company 1
    consists 1
    date 1
    depending 1
    efficiency 1
    hired 1
    hiring 1
    imagine 1
    information 1
    main 1
    maintaining 1
    process 1
    program 1
    simple 1
    solution 1
    test 1
    that 1
    topics 1
    trending 1
    whose 1
    will 1
    writing 1
    your 1
    </top>
    <top 3>
    text 4
    corresponding 3
    file 2
    provide 2
    test 2
    words 2
    </top>
    <top 3>
    blah 9
    text 4
    corresponding 3
    please 3
    </top>



    #include <iostream>
    #include <cstdio>
    #include <cstring>
    #include <algorithm>
    #include <string>
    #include <map>
    #include <vector>
    
    using namespace std;
    
    typedef pair<int,int> pII;
    
    map<string,int> Hash;
    vector<int> dy[11];
    string rHash[20200];
    int day_sum[11][20200];
    char cache[30];
    int now=9,pre=0,id=1;
    int arr[20020],na;
    string rss[20020];
    bool vis[20020];
    
    void DEBUG(int x)
    {
        int sz=dy[x].size();
        for(int i=0;i<sz;i++)
        {
            cout<<"ID: "<<dy[x][i]<<" : "<<rHash[dy[x][i]]<<endl;
            cout<<"sum: "<<day_sum[x][dy[x][i]]<<endl;
        }
    }
    
    struct RSP
    {
        int times;
        string word;
    }rsp[20020];
    
    bool cmpRSP(RSP a,RSP b)
    {
        if(a.times!=b.times)
            return a.times>b.times;
        else
            return a.word<b.word;
    }
    
    void get_top(int now,int k)
    {
        int sz=dy[now].size();
        na=0;
        int _7dayago=(now+3)%10;
        memset(vis,false,sizeof(vis));
        for(int i=0;i<sz;i++)
        {
            if(vis[dy[now][i]]==false)
            {
                arr[na++]=day_sum[now][dy[now][i]]-day_sum[_7dayago][dy[now][i]];
                vis[dy[now][i]]=true;
            }
        }
        sort(arr,arr+na);
        int sig=arr[max(0,na-k)];
        int rn=0;
        memset(vis,false,sizeof(vis));
        for(int i=0;i<sz;i++)
        {
            int times=day_sum[now][dy[now][i]]-day_sum[_7dayago][dy[now][i]];
            if(times >= sig &&vis[dy[now][i]]==false)
            {
                rsp[rn++]=(RSP){times,rHash[dy[now][i]]};
                vis[dy[now][i]]=true;
            }
        }
        sort(rsp,rsp+rn,cmpRSP);
        printf("<top %d>\n",k);
        for(int i=0;i<rn;i++)
        {
            cout<<rsp[i].word<<" "<<rsp[i].times<<endl;
        }
        printf("</top>\n");
    }
    
    int main()
    {
        while(scanf("%s",cache)!=EOF)
        {
            if(strcmp(cache,"<text>")==0)
            {
                ///read cache
                pre=now;
                now=(now+1)%10;
                dy[now]=dy[pre];
                memcpy(day_sum[now],day_sum[pre],sizeof(day_sum[0]));
                ///7 day ago    ....
                while(scanf("%s",cache))
                {
                    if(cache[0]=='<') break;
                    if(strlen(cache)<4) continue;
                    string word=cache;
                    if(Hash[word]==0)
                    {
                        rHash[id]=word;
                        Hash[word]=id++;
                    }
                    int ID=Hash[word];
                    if(day_sum[pre][ID]==0)
                        dy[now].push_back(ID);
                    day_sum[now][ID]++;
                }
            }
            else if(strcmp(cache,"<top")==0)
            {
                int top;
                scanf("%d",&top); scanf("%s",cache);
                get_top(now,top);
            }
        }
        return 0;
    }
    


    展开全文
  • <div><p>Fixes #929. * Est. account value doesn&#...t show up <p>Changes: - Add loading to Est Account Value - Add loading to steem trending charts</p><p>该提问来源于开源项目:busyorg/busy</p></div>
  • <div><p>This is what I see ... There should be a minimum threshold of usage to appear on that list, to avoid random new stuff to show up.</p><p>该提问来源于开源项目:mozilla/addons-server</p></div>
  • <div><p>When you select Trakt an error message pops up.</p><p>该提问来源于开源项目:nixgates/plugin.video.seren</p></div>
  • So Dtv returns to the library list view, but leaves the preview sidepanel up with a <code>loading</code> header. IMO, It should either: a. stay on the filtered list page and show the clicked poster ...
  • d be really useful to have llen trending data on a per key basis.. especially when there are multiple keys in play. <p>Thanks in advance</p><p>该提问来源于开源项目:MeetMe/newrelic-plugin-agent...
  • ve just hacked up the first commit to implement trending shows from Trakt.TV into the favorites dialog, which is very awesome if I may say so myself <p><img alt="image" src=...
  • <div><p><strong>What build of DuckieTV are you using (Standlone / Chrome Extension (New Tab / ...- start up DuckieTV and use fastsearch or the calendar to pull up a series and access the seriesSettings ...
  • at Trending Topics</li><li>Scroll down</li><li>News, Feed is going up</li><li> * Click View less and View more again and the left panel is immediately moved </li><li> <p>Browser: Chrome </li><li>...
  • trending and declining techniques sites with most tracking real-world data to see if fingerprinting techniques are actually used 3) heuristic analysis for developers 4) additional data could be ...
  • How to get set up with this PR?   <p>To run on your computer: <pre><code>git fetch origin pull/327/head:orta-327-checkout git checkout orta-327-checkout yarn install cd example; pod install; cd .....
  • it dosnt seem like it should, i have to keep relooking up shows and jump back and forth...make it stop please when im browsing search result it should stay there until i navigate away intentionally ...
  • by Colin Smith 通过科林·史密斯 Swift与Objective-C:... Objective-C: The trending up-and-comer vs. the dinosaur) Swift的简短历史 (A short history of Swift) I remember how pivotal it was when Swift...

    by Colin Smith

    通过科林·史密斯

    Swift与Objective-C:与恐龙有关的趋势 (Swift vs. Objective-C: The trending up-and-comer vs. the dinosaur)

    Swift的简短历史 (A short history of Swift)

    I remember how pivotal it was when Swift was introduced at Apple’s 2014 WWDC (Worldwide Developers Conference). It was the talk of the town and all the devs I worked with couldn’t wait to try it out. The iOS community was buzzing and there was a lot of excitement around the new language.

    我记得在Apple的2014年WWDC(全球开发者大会)上推出Swift时,它具有多么关键的意义。 那是小镇的话题,与我合作的所有开发人员都迫不及待地想尝试一下。 iOS社区嗡嗡作响,新语言引起了很多兴奋。

    It was developed in order to carry on some concepts we saw in Objective-C such as extensible programming. But it pushed towards a different approach to coding with the protocol-oriented design and increased safety with static typing.

    开发它是为了继承我们在Objective-C中看到的一些概念,例如可扩展编程。 但是,它采用了面向协议的设计,从而寻求了一种不同的编码方法,并通过静态类型提高了安全性。

    It was a huge hit and saw its growth sky rocket in the years after introduction. It was the most loved programming language in 2015, the second most loved in 2016, the 11th most popular programming language in 2017, beating out Objective-C, and it also beat out Objective-C in 2018.

    在推出后的数年中,这是一次巨大的成功,并见证了它的增长。 这是最喜欢 2015年的编程语言中, 第二个最喜爱的2016年,第11届最流行的 2017年的编程语言,击败了Objective-C的,也击败了 2018年的Objective-C。

    Swift is also a bet by Apple on winning over novices to become iOS developers. The hope is that new developers will learn the language and use it to build iOS apps. This then increases the ecosystem of the app store. Since Swift is optimized to work with iOS apps, this ensures the apps being written are of high quality.

    Swift也是苹果公司的赌注,旨在赢得新手成为iOS开发人员。 希望新的开发人员将学习该语言并将其用于构建iOS应用。 然后,这增加了应用商店的生态系统。 由于Swift经过优化可与iOS应用程序一起使用,因此可以确保所编写的应用程序具有高质量。

    Swifts popularity only continues to increase, especially for smaller apps and start-ups. The gap between Swift and Objective-C will only continue to grow. The future is bright for this young language.

    Swifts的受欢迎程度只会继续增加,尤其是对于较小的应用程序和初创公司。 Swift和Objective-C之间的差距只会继续扩大。 这种年轻语言的前途一片光明。

    Objective-C的简短历史 (A short history of Objective-C)

    Objective-C is an object-oriented programming language that is a superset of C, as the name of the language might reveal. This means that any valid C program will compile with an Objective-C compiler. It derives all its non-object oriented syntax from C and its object oriented syntax from SmallTalk. It was developed in 1984, so it has had time to mature as a language and is much more stable than Swift.

    正如语言的名称所揭示的那样,Objective-C是一种面向对象的编程语言,是C的超集。 这意味着任何有效的C程序都将使用Objective-C编译器进行编译。 它从C导出所有非面向对象的语法,并从SmallTalk导出其面向对象的语法。 它开发于1984年,因此已经有一段时间成为一种语言,并且比Swift稳定得多。

    Most people know Objective-C as the language that is used to develop apps for the iPhone, but the history goes much deeper than that. I’d recommend reading this article for a more in-depth look.

    大多数人都知道Objective-C是用于为iPhone开发应用程序的语言,但是历史远不止于此。 我建议阅读本文以更深入地了解。

    Swift的优势 (The strengths of Swift)

    Swift has grown tremendously in popularity for a few key reasons. First off, there are a lot of great development tools Apple has provided to work in conjunction with Swift. One of my personal favorites is the Playground, which is only compatible with Swift. Apple introduced Playgrounds in 2016. They were introduced as a way to learn how to code, but I loved them for a different reason.

    出于几个关键原因,Swift已Swift普及。 首先,苹果提供了许多很棒的开发工具来与Swift一起使用。 我个人最喜欢的游戏之一是Playground,仅与Swift兼容。 苹果于2016年推出了Playgrounds。 引入它们是一种学习编码的方法,但是出于不同的原因,我喜欢它们。

    Mobile development has always had more roadblocks than web development. You need a simulator, you usually need a proprietary Integrated Development Environment (IDE), and you need to set up a whole project just to test some small prototype. In Apple’s case, you also need a developer account. The nice thing about Playgrounds is you get around some of this. You do need Xcode or the Playgrounds app, but that is all. And you can get started with coding and compiling your code right away.

    移动开发始终比Web开发具有更多的障碍。 您需要一个模拟器,通常需要一个专有的集成开发环境(IDE),并且需要设置一个整个项目来测试一些小型原型。 在Apple的情况下,您还需要一个开发人员帐户。 Playgrounds的好处是您可以解决一些问题。 您确实需要Xcode或Playgrounds应用程序,仅此而已。 您可以立即开始编码和编译代码。

    Yet, another huge advantage of Swift is the fact that it is open source. If you have ever wondered how a programming language worked under the hood, then you can go see for yourself! This is a great way to understand the programming language you work with daily on a deeper level.

    然而,Swift的另一个巨大优势是它是开源的。 如果您曾经想知道编程语言是如何工作的,那么您可以自己看看 ! 这是更好地了解您每天使用的编程语言的好方法。

    An honorable mention goes to a nice utility only available to Swift, the Swift Package Manager. The Swift Package Manager is simply a dependency manager that is integrated with the Swift build system. It isn’t a game changer by any means, since CocoaPods and Carthage were doing this job a long time ago, but it’s another solution available if needed.

    值得一提的是,一个不错的实用程序仅适用于Swift( Swift软件包管理器) 。 Swift软件包管理器只是与Swift构建系统集成的依赖项管理器 。 由于CocoaPods和Carthage很久以前就从事这项工作,因此无论如何都不会改变游戏规则,但是如果需要的话,它是另一个可用的解决方案。

    A lot of evidence here supports the fact that Apple is doing a lot to make Swift more desirable as the programming language of choice for iOS developers. They are creating nice utilities and auxiliaries to entice people to start using the language. This shows that Apple is pushing for Swift in full force.

    这里有许多证据支持这样的事实,即苹果正在做出很多努力,使Swift更受iOS开发人员的青睐。 他们正在创建实用的工具和辅助工具,以诱使人们开始使用该语言。 这表明苹果正在全力推动Swift。

    语言特征 (Language features)

    Let’s get into some of the details of the language itself. Swift is safer due to its static typing and the use of optionals. In Swift, if your code requires a string, the features of Swift will guarantee that your code gets a string and not another type, such as an int. This of course depends on if you’re using the language as it is intended and not force unwrapping everything.

    让我们深入探讨一下语言本身的一些细节。 Swift由于其静态类型和使用可选参数而更加安全。 在Swift中,如果您的代码需要字符串,则Swift的功能将确保您的代码获取字符串,而不是其他类型(例如int)。 当然,这取决于您是否按预期使用该语言,而不是强制展开所有内容。

    Another great feature of Swift is its syntax. Especially compared to Objective-C. The best word to describe the syntax would be “succinct”. There is no need for semi-colons, calls to self or parentheses around if statements. It feels like you are skipping a lot of things that you don’t really need anyway. It can make the process of typing a lot of code “flow” better.

    Swift的另一个强大功能是语法。 特别是与Objective-C相比。 描述语法的最佳词是“简洁的”。 不需要分号,对self的调用或if语句周围的括号。 感觉就像您正在跳过很多您本来不需要的东西。 它可以使键入许多代码“流”的过程更好。

    Some people say this leads to development velocity improvements, but I wouldn’t exactly say that myself. The continual need to unwrap objects to comply with Swifts type-safety offsets the development gains that come with the succinctness.

    有人说这会导致开发速度的提高,但是我自己并不能完全说出来。 不断需要拆开对象以符合Swifts类型安全性的需求抵消了简洁带来的开发收益。

    Swift also has a lot of great control flow options with guard, if-let, advanced switch statements, repeat-while and defer. I like all the different options because it lets people control the flow of their code in a way that makes sense to them. A lot of people hate defers but love guards and vice versa. It doesn’t really matter what you like or dislike, but the options are there and you can code in the way that feels best to you.

    Swift还具有很多出色的控制流选项,包括后卫,if-let,高级switch语句,while-while和defer。 我喜欢所有不同的选项,因为它使人们可以以对他们有意义的方式控制代码流。 许多人讨厌延缓延误,但是爱护卫兵,反之亦然。 您喜欢或不喜欢的对象并不重要,但是可以使用这些选项,并且可以按照最适合自己的方式进行编码。

    I can’t forget all the functional programming features such as filter, map and reduce. This is great for handling collections and comes in handy quite often.

    我不能忘记所有功能性的编程功能,例如过滤,映射和归约。 这非常适合处理集合,并且经常派上用场。

    弱点 (The weaknesses)

    Swift is a young language, and with that, comes some shifting. The migrations between versions are simply a pain. At a small company, the migration tool provided by Apple can be helpful and cover most cases. It becomes less helpful the more code you have. It’s even worse if your codebase contains both Objective-C and Swift code that interoperate.

    Swift是一门年轻的语言,随之而来的是一些转变。 版本之间的迁移简直是痛苦。 在一家小公司中,Apple提供的迁移工具可能会有所帮助,并且可以解决大多数情况。 您拥有的代码越多,帮助就越小。 如果您的代码库同时包含可互操作的Objective-C和Swift代码,则情况更糟。

    At my last company, the migration effort took a dedicated group a whole weekend to do. They had to do it on the weekend so that they wouldn’t run into merge conflicts from other devs pushing code. This was incredibly painful for everyone involved.

    在我上一家公司,迁移工作整个周末花了一个专门小组。 他们必须在周末这样做,以免遇到其他开发人员在推动代码时的合并冲突。 这对于每个参与人员来说都非常痛苦。

    A reason for these migrations is the fact that Swift isn’t ABI stable. That means newer versions of Swift cannot work with older versions of Swift. That also means that the language cannot be packaged with the OS. This is a big deal for companies with large apps that actively combat app size because Swift is being bundled with the app and increasing the size.

    进行这些迁移的原因是Swift 的ABI不稳定 。 这意味着新版本的Swift无法与旧版本的Swift一起使用。 这也意味着该语言无法与OS打包在一起。 对于拥有大型应用程序且积极应对应用程序尺寸的公司而言,这是一笔大买卖,因为Swift已与应用程序捆绑在一起并增加了尺寸。

    Another issue is that Swift does not play well with Xcode. Xcode feels very choppy when working with Swift and autocomplete simply doesn’t work sometimes. This is strange given how hard Apple is pushing Swift. You would think that they would want make the experience of using Swift with Xcode a delight.

    另一个问题是,Swift无法与Xcode配合使用。 Xcode在使用Swift时感觉非常不稳定,有时自动完成功能根本不起作用 。 考虑到苹果在推动Swift的努力,这很奇怪。 您可能会认为,他们希望使Xcode结合使用Swift的体验。

    Swift also has problems with string handling, see the code example above. It is clunky as hell. In your day to day, this isn’t too bad. Where this comes into play the most is during interviews. Unfortunately for Swift devs, interviewers love asking questions that involve string manipulation. This is compounded by the fact that the way strings are handled has changed between versions of Swift.

    Swift在字符串处理方面也有问题,请参见上面的代码示例。 笨拙地狱。 在您的日常工作中,这还算不错。 发挥作用最大的是采访期间。 对于Swift开发人员而言,不幸的是,访问员喜欢询问涉及字符串操作的问题。 在不同版本的Swift之间,处理字符串的方式有所不同,这使情况更加复杂。

    Objective-C的优势 (The strengths of Objective-C)

    Objective-C is a highly dynamic, object oriented language. It is dynamic to the point that you can swap out method invocations at runtime using techniques like Swizzling. It is able to do these kinds of thing due to its message sending paradigm. This lets objects send messages to other objects at run time to determine the invocation of the method being called.

    Objective-C是一种高度动态的,面向对象的语言。 动态的是,您可以在运行时使用Swizzling之类的方法交换方法调用。 由于其消息发送范例,它能够执行此类操作。 这样,对象可以在运行时将消息发送到其他对象,以确定调用的方法。

    In practical purposes, what does this mean? Well, one big advantage is adaptability at runtime. This means accessing private APIs or doing things like mocking objects at runtime become possible. This can be especially useful when it comes to unit testing. Libraries like OCMock make this even easier and allow for very elaborate test set ups. Having good unit tests will make your app more stable and reliable.

    实际上,这是什么意思? 好吧,一大优势是运行时的适应性。 这意味着可以在运行时访问私有API或执行诸如模拟对象之类的操作。 对于单元测试,这可能特别有用。 像OCMock这样的库使此操作变得更加容易,并允许进行非常复杂的测试设置。 拥有良好的单元测试将使您的应用程序更加稳定和可靠。

    Speaking of stability, Objective-C has been around for a long time which makes it a very stable language. With Swift, you’ll run into bugs that are pretty surprising and would be disruptive to the stability of your app. In the example I linked above, this crash would be caused by the actual language you are using to code your app, not due to any error created by the code you wrote. This can be frustrating.

    说到稳定性,Objective-C已经存在很长时间了,这使其成为非常稳定的语言。 使用Swift,您将遇到一些令人惊讶的错误,这些错误会破坏应用程序的稳定性。 在上面链接的示例中,此崩溃是由您用来编写应用程序代码的实际语言引起的,而不是由您编写的代码创建的任何错误引起的。 这可能令人沮丧。

    The last point, which is more important to certain companies, is compatibility with C and C++ libraries. Being that Objective-C is a superset of C, it is easy to use C and C++ code with Objective-C. You can even use Objective-C++ if you feel so inclined. This is important if your are dependent on third party C and C++ libraries.

    最后一点,对于某些公司来说更重要,是与C和C ++库的兼容性。 由于Objective-C是C的超集,因此很容易在Objective-C中使用C和C ++代码。 如果您愿意,甚至可以使用Objective-C ++。 如果您依赖第三方C和C ++库,则这一点很重要。

    弱点 (The weaknesses)

    The first main complaint I hear about Objective-C is syntax. I started my professional career using Objective-C so I have no issues with it. It is verbose and a bit unconventional with the use of square brackets. But opinions on syntax are just that, opinions. I figured I would list this point though since it is one of the first things that comes up when you mention Objective-C.

    我听到的关于Objective-C的第一个主要抱怨是语法。 我使用Objective-C开始了我的职业生涯,因此没有任何问题。 使用方括号时它很冗长,有点不合常规。 但是关于语法的意见就是这样。 我想我会列出这一点,因为当您提到Objective-C时,这是第一件事。

    One thing I do agree with though is that block syntax is frustrating. There is even a website dedicated to decoding the mysteries of blocks in Objective-C. I actually use this website pretty often as a reference.

    我确实同意的一件事是,块语法令人沮丧。 甚至还有一个网站专门致力于在Objective-C中解码块的奥秘。 实际上,我经常使用该网站作为参考。

    The biggest issue Objective-C faces right now is the fact that one day Apple may drop support for Objective-C with Cocoa and other common libraries used to create iOS apps. Since Objective-C is primarily used to create iOS apps, this would be a death knell for the language. It also means that newcomers to the iOS community are afraid to commit to learning Objective-C right now since it may no longer be used in the future.

    目前,Objective-C面临的最大问题是,有一天,苹果可能会放弃Cocoa和其他用于创建iOS应用程序的公共库对Objective-C的支持。 由于Objective-C主要用于创建iOS应用,因此这是该语言的丧钟。 这也意味着,iOS社区的新手会害怕立即致力于学习Objective-C,因为它可能在将来不再使用。

    Let’s get back to the language itself. It is prone to having hard to debug issues due to the dynamic nature of the language. The ability to send messages to nil and not crash on top of the lack of strict typing are some examples of things that lead to these hard to debug issues.

    让我们回到语言本身。 由于该语言的动态特性,因此易于调试问题。 可以将消息发送为nil并且不会由于缺乏严格的键入而崩溃的能力是导致这些难以调试的问题的一些示例。

    Objective-C does not hold your hand when it comes to these things either. Though it is nice that the app doesn’t crash when you send a message to nil, it may put your app in a weird state. It is very hard to debug issues like these. The fact that Swift has strict typing and the use of unwrapping optionals prevents these things at compile time.

    在涉及到这些事情时,Objective-C也不会牵手。 虽然将消息发送到nil时应用程序不会崩溃很不错,但它可能会使您的应用程序处于怪异状态。 调试此类问题非常困难。 Swift具有严格的类型,并且使用了unwrapping可选选项,这一事实在编译时阻止了这些事情。

    我应该学习Swift还是Objective-C? (Should I learn Swift or Objective-C?)

    The answer for most people will be Swift. Apple is clearly pushing Swift as the language of choice for its iOS application development community. Swift will only continue to become more performant as ABI stability is introduced and Swift becomes packaged with the OS itself.

    对于大多数人来说,答案将是Swift。 苹果显然正在将Swift作为其iOS应用程序开发社区的首选语言。 随着ABI稳定性的引入和Swift与OS本身的打包,Swift只会继续变得更加高性能。

    If you’re looking to get a job as an iOS developer, Swift will be the language you want to learn. Most startup to mid-level companies will have their iOS apps written completely in Swift. This means you’ll be able to apply and interview for more jobs if you learn Swift.

    如果您想找一份iOS开发人员的工作,Swift将是您想要学习的语言。 大多数初创公司到中级公司将完全使用Swift编写其iOS应用程序。 这意味着,如果您学习Swift,就可以申请并面试更多工作。

    Even at larger companies where Objective-C is still used heavily, interviews can still be done in Swift. So you can learn Objective-C once you join the company and not worry about burdening yourself with more things to learn before the interview.

    即使在仍大量使用Objective-C的大型公司中,也可以在Swift中进行采访。 因此,您在加入公司后就可以学习Objective-C,而不必担心在面试前会给自己负担更多要学习的东西。

    You will want to learn Objective-C if you are already working at a start up or mid-level company and want to jump to a larger company. Skills with Objective-C will give you specialized knowledge and an edge over other interview candidates.

    如果您已经在初创公司或中级公司工作,并且想要跳到一家更大的公司,则将需要学习Objective-C。 具有Objective-C的技能将为您提供专业知识,并且比其他面试候选人更胜一筹。

    Liked what you read? Take a look at some of my other articles:

    喜欢您阅读的内容吗? 看看我的其他一些文章:

    Tips for your first tech interview.

    首次技术面试的提示。

    Starting a tech career from nothing.

    从零开始的科技职业。

    Should you get a computer science degree?

    您应该获得计算机科学学位吗?

    翻译自: https://www.freecodecamp.org/news/https-medium-com-colin-gabriel-smith-swift-vs-objective-c-5b19add8e2ed/

    展开全文
  • <p>I want to find out if a product is trending on my website (trending up or down) based on the period that is passed in. I.e. If week is passed in, it compares the current week up to the day to the ...
  • Plugin API Support

    2021-01-11 12:11:04
    <div><p>This project is awesome!... So in the above example, we could see the code coverage percentage trending up or down over time.</p><p>该提问来源于开源项目:es-analysis/plato</p></div>
  • The risk of getting exposed would increase significantly.</li><li>Positive side-effect: More diversity of authors on Trending.</li><li>Positive side-effect: Higher Distribution of SBD and SP.</li></...
  • 原文: This dataset includes several ... Data is included for the US, GB, DE, CA, and FR regions (USA, Great Britain, Germany, Canada, and France, respectively), with up to 200 listed trending video

    原文:

    This dataset includes several months (and counting) of data on daily trending YouTube videos. Data is included for the US, GB, DE, CA, and FR regions (USA, Great Britain, Germany, Canada, and France, respectively), with up to 200 listed trending videos per day.

    EDIT: Now includes data from RU, MX, KR, JP and IN regions (Russia, Mexico, South Korea, Japan and India respectively) over the same time period.

    Each region’s data is in a separate file. Data includes the video title, channel title, publish time, tags, views, likes and dislikes, description, and comment count.

    The data also includes a category_id field, which varies between regions. To retrieve the categories for a specific video, find it in the associated JSON. One such file is included for each of the five regions in the dataset.

    译:

    这个数据集包含了几个月(和计数)的数据,这些数据来自于YouTube的每日趋势视频。数据包括美国、英国、德国、加拿大和法国地区(分别为美国、英国、德国、加拿大和法国),每天最多有200个列出的趋势视频。

    编辑:现在包括来自俄罗斯、墨西哥、韩国、日本和印度的同期数据。

    每个区域的数据都在一个单独的文件中。数据包括视频标题、频道标题、发布时间、标记、视图、喜欢和不喜欢、描述和评论计数。

    数据还包括一个category_id字段,该字段因地区而异。要检索特定视频的类别,请在相关联的JSON中找到它。对于数据集中的五个区域,每个区域都包含一个这样的文件。

    大家可以到官网地址下载数据集,我自己也在百度网盘分享了一份。可关注本人公众号,回复“2020100802”获取下载链接。

    展开全文
  • padding-left:14px}#rr-search-tn .trending-now .down{background-position:0 -2657px}#rr-search-tn .trending-now .up{background-position:0 -1305px}#rr-search-tn .trending-now .down img,.trending-now .up ...
  • I was able to get everything working up to this point. When I run gettrending.py the browser window opens and begins to load the page, then I get this error message. <p>Traceback (most recent call ...
  • It ended up being a total rewrite. Instead of using list operations with O(N) searches to handle the set of "spikes" to be applied to trending scores in the future, I'm now using an in-...
  • 张贴trending: 有此趋势的;流行的social network site: 社交网站social media: 社交媒体cater to sb. : 迎合某人sign up: 注册Grammar“多种多样的” 表达 Word Preparation post: 发布;张贴 to publish something...

    Word Preparation

    post: 发布;张贴

    to publish something such as a message or picture on a website or using social media

    Teresa just posted pictures of her new dog on Facebook.
    Teresa刚刚在脸书(Facebook)上更新了自己新养的狗的一些照片。

    She posts something new just about every hour.
    她每隔一个小时左右都会更新状态。

    trending: 有此趋势的;流行的

    very popular

    I like to surf the Internet for what’s trending.
    我喜欢上网搜索热门事件。

    All the trending information is usually on the front page.
    所有热门事件通常都在头版。

    social network site: 社交网站

    a website for sharing information and communicating

    Twitter is a social networking site that nay celebrities use.
    Twitter(推特)是一个社交网站,很多名人都在用。

    I try not to spend too much time on social networking sites.
    我尽量控制自己浏览社交网站的时间。

    social media: 社交媒体

    forms of communication that let people share information using the Internet

    Information spreads faster because of social media.
    有社交媒体的推动,信息的传递变得更快捷了。

    Everyone has been talking about these events through social media.
    大家都在通过社交媒体谈论这些事件。

    cater to sb. : 迎合某人

    to give someone what he or she wants

    These exercise program mostly caters to young people.
    这项运动计划通常适用于年轻人。

    These parks cater to young children and their mothers.
    这几个公园非常适合小孩子跟妈妈一起去。

    sign up: 注册

    to register

    You need to sign up before you can download anything.
    下载任何东西之前,你需要先注册。

    I don’t want to sign up if it will take longer than twenty minutes.
    如果注册过程超过20分钟,我就不想注册了。

    Grammar

    “多种多样的” 表达

    various (= a variety of) 通常用来强调种类的数目;
    different 普通用词,强调事物间的区别或本质的不同。
    diverse 语气较强,指性质完全不同,着重显著的区别。

    • The jacket is available in various colors.
    • Our two sons are very different from each other.
    • Although these states and their people are diverse, they share the common goal of economic development.
    展开全文
  • <div><p>And come up with a better name for that ^ <p>Some people might want a quick link to "new for channels I follow" or "trending for everyone" or "trending for ~porn~ science&#...
  • <div><p>Need this to line up the PSs timers when providing trending data. <p>The requirements doc also mentions an enhancement would be to send this every hour as well. Can look into this.</p><p>该...
  • Voting on comments

    2020-12-25 23:44:11
    t raising the comment in the trending comment page? <p>When a I voted a comment before the comment moved up immediately, did that change?</p><p>该提问来源于开源项目:steemit/condenser</p></div>

空空如也

空空如也

1 2 3 4 5 6
收藏数 103
精华内容 41
关键字:

trendingup